@botpress/webchat 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/index.d.ts +4 -0
- package/dist/adapters/messaging-to-target.d.ts +151 -0
- package/dist/adapters/target.d.ts +77 -0
- package/dist/adapters/webchat-to-target.d.ts +126 -0
- package/dist/client/MessagingClient/client.d.ts +1 -1
- package/dist/components/renderers/Audio.d.ts +1 -1
- package/dist/components/renderers/Carousel.d.ts +1 -1
- package/dist/components/renderers/File.d.ts +1 -1
- package/dist/components/renderers/Image.d.ts +1 -1
- package/dist/components/renderers/Location.d.ts +1 -1
- package/dist/components/renderers/Video.d.ts +1 -1
- package/dist/gen/client/api.d.ts +23 -23
- package/dist/gen/client/client.d.ts +19 -19
- package/dist/index.js +7988 -7788
- package/dist/index.umd.cjs +78 -78
- package/dist/schemas/init.d.ts +3828 -22
- package/dist/types/block-type.d.ts +1 -1
- package/dist/types/init.d.ts +1 -0
- package/openapi.ts +40 -0
- package/package.json +6 -3
- package/openapi/index.ts +0 -31
- package/openapi/package.json +0 -5
- package/openapi/readme.md +0 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Ye,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],_):(Ye=typeof globalThis<"u"?globalThis:Ye||self,_(Ye.Webchat={},Ye.React,Ye.ReactDOM))})(this,function(Ye,_,
|
|
1
|
+
(function(Ye,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],_):(Ye=typeof globalThis<"u"?globalThis:Ye||self,_(Ye.Webchat={},Ye.React,Ye.ReactDOM))})(this,function(Ye,_,Gn){"use strict";var QU=Object.defineProperty;var XU=(Ye,_,Gn)=>_ in Ye?QU(Ye,_,{enumerable:!0,configurable:!0,writable:!0,value:Gn}):Ye[_]=Gn;var E=(Ye,_,Gn)=>(XU(Ye,typeof _!="symbol"?_+"":_,Gn),Gn);function zd(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const R=zd(_),jw=zd(Gn);var Me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ai(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ll(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Dl={exports:{}},bs={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Zd;function Uw(){if(Zd)return bs;Zd=1;var e=_,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(a,l,c){var u,d={},h=null,f=null;c!==void 0&&(h=""+c),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(f=l.ref);for(u in l)r.call(l,u)&&!s.hasOwnProperty(u)&&(d[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:t,type:a,key:h,ref:f,props:d,_owner:i.current}}return bs.Fragment=n,bs.jsx=o,bs.jsxs=o,bs}var ws={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,44 +14,44 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+je+
|
|
19
|
-
`),
|
|
20
|
-
`),
|
|
21
|
-
`+
|
|
17
|
+
*/var Wd;function Fw(){return Wd||(Wd=1,process.env.NODE_ENV!=="production"&&function(){var e=_,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),p=Symbol.iterator,m="@@iterator";function y(M){if(M===null||typeof M!="object")return null;var ge=p&&M[p]||M[m];return typeof ge=="function"?ge:null}var v=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(M){{for(var ge=arguments.length,Se=new Array(ge>1?ge-1:0),Ke=1;Ke<ge;Ke++)Se[Ke-1]=arguments[Ke];x("error",M,Se)}}function x(M,ge,Se){{var Ke=v.ReactDebugCurrentFrame,ft=Ke.getStackAddendum();ft!==""&&(ge+="%s",Se=Se.concat([ft]));var yt=Se.map(function(at){return String(at)});yt.unshift("Warning: "+ge),Function.prototype.apply.call(console[M],console,yt)}}var I=!1,P=!1,T=!1,j=!1,U=!1,F;F=Symbol.for("react.module.reference");function O(M){return!!(typeof M=="string"||typeof M=="function"||M===r||M===s||U||M===i||M===c||M===u||j||M===f||I||P||T||typeof M=="object"&&M!==null&&(M.$$typeof===h||M.$$typeof===d||M.$$typeof===o||M.$$typeof===a||M.$$typeof===l||M.$$typeof===F||M.getModuleId!==void 0))}function N(M,ge,Se){var Ke=M.displayName;if(Ke)return Ke;var ft=ge.displayName||ge.name||"";return ft!==""?Se+"("+ft+")":Se}function J(M){return M.displayName||"Context"}function q(M){if(M==null)return null;if(typeof M.tag=="number"&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof M=="function")return M.displayName||M.name||null;if(typeof M=="string")return M;switch(M){case r:return"Fragment";case n:return"Portal";case s:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case u:return"SuspenseList"}if(typeof M=="object")switch(M.$$typeof){case a:var ge=M;return J(ge)+".Consumer";case o:var Se=M;return J(Se._context)+".Provider";case l:return N(M,M.render,"ForwardRef");case d:var Ke=M.displayName||null;return Ke!==null?Ke:q(M.type)||"Memo";case h:{var ft=M,yt=ft._payload,at=ft._init;try{return q(at(yt))}catch{return null}}}return null}var W=Object.assign,B=0,V,Y,K,pe,k,ee,xe;function S(){}S.__reactDisabledLog=!0;function Te(){{if(B===0){V=console.log,Y=console.info,K=console.warn,pe=console.error,k=console.group,ee=console.groupCollapsed,xe=console.groupEnd;var M={configurable:!0,enumerable:!0,value:S,writable:!0};Object.defineProperties(console,{info:M,log:M,warn:M,error:M,group:M,groupCollapsed:M,groupEnd:M})}B++}}function Ne(){{if(B--,B===0){var M={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:W({},M,{value:V}),info:W({},M,{value:Y}),warn:W({},M,{value:K}),error:W({},M,{value:pe}),group:W({},M,{value:k}),groupCollapsed:W({},M,{value:ee}),groupEnd:W({},M,{value:xe})})}B<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ie=v.ReactCurrentDispatcher,je;function De(M,ge,Se){{if(je===void 0)try{throw Error()}catch(ft){var Ke=ft.stack.trim().match(/\n( *(at )?)/);je=Ke&&Ke[1]||""}return`
|
|
18
|
+
`+je+M}}var Ue=!1,_e;{var ve=typeof WeakMap=="function"?WeakMap:Map;_e=new ve}function ke(M,ge){if(!M||Ue)return"";{var Se=_e.get(M);if(Se!==void 0)return Se}var Ke;Ue=!0;var ft=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var yt;yt=Ie.current,Ie.current=null,Te();try{if(ge){var at=function(){throw Error()};if(Object.defineProperty(at.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(at,[])}catch($){Ke=$}Reflect.construct(M,[],at)}else{try{at.call()}catch($){Ke=$}M.call(at.prototype)}}else{try{throw Error()}catch($){Ke=$}M()}}catch($){if($&&Ke&&typeof $.stack=="string"){for(var it=$.stack.split(`
|
|
19
|
+
`),sn=Ke.stack.split(`
|
|
20
|
+
`),A=it.length-1,g=sn.length-1;A>=1&&g>=0&&it[A]!==sn[g];)g--;for(;A>=1&&g>=0;A--,g--)if(it[A]!==sn[g]){if(A!==1||g!==1)do if(A--,g--,g<0||it[A]!==sn[g]){var w=`
|
|
21
|
+
`+it[A].replace(" at new "," at ");return M.displayName&&w.includes("<anonymous>")&&(w=w.replace("<anonymous>",M.displayName)),typeof M=="function"&&_e.set(M,w),w}while(A>=1&&g>=0);break}}}finally{Ue=!1,Ie.current=yt,Ne(),Error.prepareStackTrace=ft}var C=M?M.displayName||M.name:"",L=C?De(C):"";return typeof M=="function"&&_e.set(M,L),L}function Ce(M,ge,Se){return ke(M,!1)}function Re(M){var ge=M.prototype;return!!(ge&&ge.isReactComponent)}function qe(M,ge,Se){if(M==null)return"";if(typeof M=="function")return ke(M,Re(M));if(typeof M=="string")return De(M);switch(M){case c:return De("Suspense");case u:return De("SuspenseList")}if(typeof M=="object")switch(M.$$typeof){case l:return Ce(M.render);case d:return qe(M.type,ge,Se);case h:{var Ke=M,ft=Ke._payload,yt=Ke._init;try{return qe(yt(ft),ge,Se)}catch{}}}return""}var D=Object.prototype.hasOwnProperty,ne={},me=v.ReactDebugCurrentFrame;function he(M){if(M){var ge=M._owner,Se=qe(M.type,M._source,ge?ge.type:null);me.setExtraStackFrame(Se)}else me.setExtraStackFrame(null)}function Le(M,ge,Se,Ke,ft){{var yt=Function.call.bind(D);for(var at in M)if(yt(M,at)){var it=void 0;try{if(typeof M[at]!="function"){var sn=Error((Ke||"React class")+": "+Se+" type `"+at+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof M[at]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw sn.name="Invariant Violation",sn}it=M[at](ge,at,Ke,Se,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(A){it=A}it&&!(it instanceof Error)&&(he(ft),b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Ke||"React class",Se,at,typeof it),he(null)),it instanceof Error&&!(it.message in ne)&&(ne[it.message]=!0,he(ft),b("Failed %s type: %s",Se,it.message),he(null))}}}var Pe=Array.isArray;function Be(M){return Pe(M)}function ot(M){{var ge=typeof Symbol=="function"&&Symbol.toStringTag,Se=ge&&M[Symbol.toStringTag]||M.constructor.name||"Object";return Se}}function Ze(M){try{return Z(M),!1}catch{return!0}}function Z(M){return""+M}function Q(M){if(Ze(M))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",ot(M)),Z(M)}var G=v.ReactCurrentOwner,$e={key:!0,ref:!0,__self:!0,__source:!0},Ge,St,bt;bt={};function gt(M){if(D.call(M,"ref")){var ge=Object.getOwnPropertyDescriptor(M,"ref").get;if(ge&&ge.isReactWarning)return!1}return M.ref!==void 0}function At(M){if(D.call(M,"key")){var ge=Object.getOwnPropertyDescriptor(M,"key").get;if(ge&&ge.isReactWarning)return!1}return M.key!==void 0}function fn(M,ge){if(typeof M.ref=="string"&&G.current&&ge&&G.current.stateNode!==ge){var Se=q(G.current.type);bt[Se]||(b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',q(G.current.type),M.ref),bt[Se]=!0)}}function Rt(M,ge){{var Se=function(){Ge||(Ge=!0,b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",ge))};Se.isReactWarning=!0,Object.defineProperty(M,"key",{get:Se,configurable:!0})}}function Ft(M,ge){{var Se=function(){St||(St=!0,b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",ge))};Se.isReactWarning=!0,Object.defineProperty(M,"ref",{get:Se,configurable:!0})}}var Qt=function(M,ge,Se,Ke,ft,yt,at){var it={$$typeof:t,type:M,key:ge,ref:Se,props:at,_owner:yt};return it._store={},Object.defineProperty(it._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(it,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Ke}),Object.defineProperty(it,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ft}),Object.freeze&&(Object.freeze(it.props),Object.freeze(it)),it};function Gt(M,ge,Se,Ke,ft){{var yt,at={},it=null,sn=null;Se!==void 0&&(Q(Se),it=""+Se),At(ge)&&(Q(ge.key),it=""+ge.key),gt(ge)&&(sn=ge.ref,fn(ge,ft));for(yt in ge)D.call(ge,yt)&&!$e.hasOwnProperty(yt)&&(at[yt]=ge[yt]);if(M&&M.defaultProps){var A=M.defaultProps;for(yt in A)at[yt]===void 0&&(at[yt]=A[yt])}if(it||sn){var g=typeof M=="function"?M.displayName||M.name||"Unknown":M;it&&Rt(at,g),sn&&Ft(at,g)}return Qt(M,it,sn,ft,Ke,G.current,at)}}var Rr=v.ReactCurrentOwner,jn=v.ReactDebugCurrentFrame;function fr(M){if(M){var ge=M._owner,Se=qe(M.type,M._source,ge?ge.type:null);jn.setExtraStackFrame(Se)}else jn.setExtraStackFrame(null)}var Ri;Ri=!1;function si(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function oi(){{if(Rr.current){var M=q(Rr.current.type);if(M)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+
|
|
23
|
+
Check the render method of \``+M+"`."}return""}}function $r(M){{if(M!==void 0){var ge=M.fileName.replace(/^.*[\\\/]/,""),Se=M.lineNumber;return`
|
|
24
24
|
|
|
25
|
-
Check your code at `+ge+":"+Se+"."}return""}}var
|
|
25
|
+
Check your code at `+ge+":"+Se+"."}return""}}var Tt={};function Ot(M){{var ge=oi();if(!ge){var Se=typeof M=="string"?M:M.displayName||M.name;Se&&(ge=`
|
|
26
26
|
|
|
27
|
-
Check the top-level render call using <`+Se+">.")}return ge}}function Gt(L,ge){{if(!L._store||L._store.validated||L.key!=null)return;L._store.validated=!0;var Se=St(ge);if(Et[Se])return;Et[Se]=!0;var Ke="";L&&L._owner&&L._owner!==Tr.current&&(Ke=" It was passed a child from "+q(L._owner.type)+"."),lr(L),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Se,Ke),lr(null)}}function Yt(L,ge){{if(typeof L!="object")return;if(Be(L))for(var Se=0;Se<L.length;Se++){var Ke=L[Se];Xr(Ke)&&Gt(Ke,ge)}else if(Xr(L))L._store&&(L._store.validated=!0);else if(L){var ut=y(L);if(typeof ut=="function"&&ut!==L.entries)for(var mt=ut.call(L),st;!(st=mt.next()).done;)Xr(st.value)&&Gt(st.value,ge)}}}function Kt(L){{var ge=L.type;if(ge==null||typeof ge=="string")return;var Se;if(typeof ge=="function")Se=ge.propTypes;else if(typeof ge=="object"&&(ge.$$typeof===l||ge.$$typeof===d))Se=ge.propTypes;else return;if(Se){var Ke=q(ge);Le(Se,L.props,"prop",Ke,L)}else if(ge.PropTypes!==void 0&&!Si){Si=!0;var ut=q(ge);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ut||"Unknown")}typeof ge.getDefaultProps=="function"&&!ge.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function $t(L){{for(var ge=Object.keys(L.props),Se=0;Se<ge.length;Se++){var Ke=ge[Se];if(Ke!=="children"&&Ke!=="key"){lr(L),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Ke),lr(null);break}}L.ref!==null&&(lr(L),b("Invalid attribute `ref` supplied to `React.Fragment`."),lr(null))}}function bn(L,ge,Se,Ke,ut,mt){{var st=I(L);if(!st){var nt="";(L===void 0||typeof L=="object"&&L!==null&&Object.keys(L).length===0)&&(nt+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var tn=Or(ut);tn?nt+=tn:nt+=ei();var R;L===null?R="null":Be(L)?R="array":L!==void 0&&L.$$typeof===t?(R="<"+(q(L.type)||"Unknown")+" />",nt=" Did you accidentally export a JSX literal instead of a component?"):R=typeof L,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",R,nt)}var g=qt(L,ge,Se,ut,mt);if(g==null)return g;if(st){var w=ge.children;if(w!==void 0)if(Ke)if(Be(w)){for(var C=0;C<w.length;C++)Yt(w[C],L);Object.freeze&&Object.freeze(w)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Yt(w,L)}return L===r?$t(g):Kt(g),g}}function Sn(L,ge,Se){return bn(L,ge,Se,!0)}function cr(L,ge,Se){return bn(L,ge,Se,!1)}var Td=cr,Od=Sn;hs.Fragment=r,hs.jsx=Td,hs.jsxs=Od}()),hs}process.env.NODE_ENV==="production"?El.exports=Bb():El.exports=Vb();var Z=El.exports;function wt(){return wt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wt.apply(this,arguments)}function Sl(e,t=[]){let n=[];function r(s,o){const a=_.createContext(o),l=n.length;n=[...n,o];function c(d){const{scope:h,children:f,...p}=d,m=(h==null?void 0:h[e][l])||a,y=_.useMemo(()=>p,Object.values(p));return _.createElement(m.Provider,{value:y},f)}function u(d,h){const f=(h==null?void 0:h[e][l])||a,p=_.useContext(f);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,u]}const i=()=>{const s=n.map(o=>_.createContext(o));return function(a){const l=(a==null?void 0:a[e])||s;return _.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,zb(i,...t)]}function zb(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(s)[`__scope${c}`];return{...a,...d}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function Ir(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const ps=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{};function Zb(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function $d(...e){return t=>e.forEach(n=>Zb(n,t))}function ni(...e){return _.useCallback($d(...e),e)}const Tl=_.forwardRef((e,t)=>{const{children:n,...r}=e,i=_.Children.toArray(n),s=i.find(Hb);if(s){const o=s.props.children,a=i.map(l=>l===s?_.Children.count(o)>1?_.Children.only(null):_.isValidElement(o)?o.props.children:null:l);return _.createElement(Ol,wt({},r,{ref:t}),_.isValidElement(o)?_.cloneElement(o,void 0,a):null)}return _.createElement(Ol,wt({},r,{ref:t}),n)});Tl.displayName="Slot";const Ol=_.forwardRef((e,t)=>{const{children:n,...r}=e;return _.isValidElement(n)?_.cloneElement(n,{...qb(r,n.props),ref:t?$d(t,n.ref):n.ref}):_.Children.count(n)>1?_.Children.only(null):null});Ol.displayName="SlotClone";const Wb=({children:e})=>_.createElement(_.Fragment,null,e);function Hb(e){return _.isValidElement(e)&&e.type===Wb}function qb(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{s(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}const Tn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=_.forwardRef((r,i)=>{const{asChild:s,...o}=r,a=s?Tl:t;return _.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),_.createElement(a,wt({},o,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Kb(e,t){e&&Hn.flushSync(()=>e.dispatchEvent(t))}const Md="Avatar",[Jb,OU]=Sl(Md),[Gb,Ld]=Jb(Md),Dd=_.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,s]=_.useState("idle");return _.createElement(Gb,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:s},_.createElement(Tn.span,wt({},r,{ref:t})))}),Yb="AvatarImage",Nd=_.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...s}=e,o=Ld(Yb,n),a=Xb(r),l=Ir(c=>{i(c),o.onImageLoadingStatusChange(c)});return ps(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?_.createElement(Tn.img,wt({},s,{ref:t,src:r})):null}),Qb="AvatarFallback",jd=_.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,s=Ld(Qb,n),[o,a]=_.useState(r===void 0);return _.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),o&&s.imageLoadingStatus!=="loaded"?_.createElement(Tn.span,wt({},i,{ref:t})):null});function Xb(e){const[t,n]=_.useState("idle");return _.useEffect(()=>{if(!e){n("error");return}let r=!0;const i=new window.Image,s=o=>()=>{r&&n(o)};return n("loading"),i.onload=s("loaded"),i.onerror=s("error"),i.src=e,()=>{r=!1}},[e]),t}let Il=class{constructor(){E(this,"eventMap");this.eventMap={}}on(t,n){var r;return this.eventMap[t]||(this.eventMap[t]=new Set),(r=this.eventMap[t])==null||r.add(n),()=>{var i;(i=this.eventMap[t])==null||i.delete(n)}}emit(t,n){var r;(r=this.eventMap[t])==null||r.forEach(i=>{i(n)})}};const ew=new Il;function Ud(e,t){let n=0;if(e.length==0)return n;for(let r=0;r<e.length;r++){const i=e.charCodeAt(r);n=(n<<5)-n+i,n=n&n}return Math.abs(n)%t}const Pl=_.forwardRef(({userId:e,src:t,container:n,image:r,fallback:i,...s},o)=>{const a=Ud(e??"",15);return Z.jsxs(Dd,{ref:o,"data-color":a,...n,...s,children:[Z.jsx(Nd,{src:t,...r}),Z.jsx(jd,{...i,children:typeof s.children=="string"?s.children[0]:s.children})]})});function IU(){}function PU(){}function tw(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const nw=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,rw=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,iw={};function Fd(e,t){return((t||iw).jsx?rw:nw).test(e)}const sw=/[ \t\n\f\r]/g;function ow(e){return typeof e=="object"?e.type==="text"?Bd(e.value):!1:Bd(e)}function Bd(e){return e.replace(sw,"")===""}class ms{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}ms.prototype.property={},ms.prototype.normal={},ms.prototype.space=null;function Vd(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new ms(n,r,t)}function Al(e){return e.toLowerCase()}class On{constructor(t,n){this.property=t,this.attribute=n}}On.prototype.space=null,On.prototype.boolean=!1,On.prototype.booleanish=!1,On.prototype.overloadedBoolean=!1,On.prototype.number=!1,On.prototype.commaSeparated=!1,On.prototype.spaceSeparated=!1,On.prototype.commaOrSpaceSeparated=!1,On.prototype.mustUseProperty=!1,On.prototype.defined=!1;let aw=0;const et=ri(),Mt=ri(),zd=ri(),be=ri(),bt=ri(),Ti=ri(),wn=ri();function ri(){return 2**++aw}const Rl=Object.freeze(Object.defineProperty({__proto__:null,boolean:et,booleanish:Mt,commaOrSpaceSeparated:wn,commaSeparated:Ti,number:be,overloadedBoolean:zd,spaceSeparated:bt},Symbol.toStringTag,{value:"Module"})),$l=Object.keys(Rl);class Ml extends On{constructor(t,n,r,i){let s=-1;if(super(t,n),Zd(this,"space",i),typeof r=="number")for(;++s<$l.length;){const o=$l[s];Zd(this,$l[s],(r&Rl[o])===Rl[o])}}}Ml.prototype.defined=!0;function Zd(e,t,n){n&&(e[t]=n)}const lw={}.hasOwnProperty;function Oi(e){const t={},n={};let r;for(r in e.properties)if(lw.call(e.properties,r)){const i=e.properties[r],s=new Ml(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Al(r)]=r,n[Al(s.attribute)]=r}return new ms(t,n,e.space)}const Wd=Oi({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),Hd=Oi({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function qd(e,t){return t in e?e[t]:t}function Kd(e,t){return qd(e,t.toLowerCase())}const Jd=Oi({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:Kd,properties:{xmlns:null,xmlnsXLink:null}}),Gd=Oi({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:Mt,ariaAutoComplete:null,ariaBusy:Mt,ariaChecked:Mt,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:bt,ariaCurrent:null,ariaDescribedBy:bt,ariaDetails:null,ariaDisabled:Mt,ariaDropEffect:bt,ariaErrorMessage:null,ariaExpanded:Mt,ariaFlowTo:bt,ariaGrabbed:Mt,ariaHasPopup:null,ariaHidden:Mt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:bt,ariaLevel:be,ariaLive:null,ariaModal:Mt,ariaMultiLine:Mt,ariaMultiSelectable:Mt,ariaOrientation:null,ariaOwns:bt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:Mt,ariaReadOnly:Mt,ariaRelevant:null,ariaRequired:Mt,ariaRoleDescription:bt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:Mt,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null}}),cw=Oi({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:Kd,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ti,acceptCharset:bt,accessKey:bt,action:null,allow:null,allowFullScreen:et,allowPaymentRequest:et,allowUserMedia:et,alt:null,as:null,async:et,autoCapitalize:null,autoComplete:bt,autoFocus:et,autoPlay:et,capture:et,charSet:null,checked:et,cite:null,className:bt,cols:be,colSpan:null,content:null,contentEditable:Mt,controls:et,controlsList:bt,coords:be|Ti,crossOrigin:null,data:null,dateTime:null,decoding:null,default:et,defer:et,dir:null,dirName:null,disabled:et,download:zd,draggable:Mt,encType:null,enterKeyHint:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:et,formTarget:null,headers:bt,height:be,hidden:et,high:be,href:null,hrefLang:null,htmlFor:bt,httpEquiv:bt,id:null,imageSizes:null,imageSrcSet:null,inputMode:null,integrity:null,is:null,isMap:et,itemId:null,itemProp:bt,itemRef:bt,itemScope:et,itemType:bt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:et,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:et,muted:et,name:null,nonce:null,noModule:et,noValidate:et,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:et,optimum:be,pattern:null,ping:bt,placeholder:null,playsInline:et,poster:null,preload:null,readOnly:et,referrerPolicy:null,rel:bt,required:et,reversed:et,rows:be,rowSpan:be,sandbox:bt,scope:null,scoped:et,seamless:et,selected:et,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:Mt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:et,useMap:null,value:Mt,width:be,wrap:null,align:null,aLink:null,archive:bt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:et,declare:et,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:et,noHref:et,noShade:et,noWrap:et,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:Mt,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:et,disableRemotePlayback:et,prefix:null,property:null,results:be,security:null,unselectable:null}}),uw=Oi({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:qd,properties:{about:wn,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:bt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:et,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ti,g2:Ti,glyphName:Ti,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:wn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:bt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:wn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:wn,rev:wn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:wn,requiredFeatures:wn,requiredFonts:wn,requiredFormats:wn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:wn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:wn,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:wn,to:null,transform:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),dw=/^data[-\w.:]+$/i,Yd=/-[a-z]/g,fw=/[A-Z]/g;function hw(e,t){const n=Al(t);let r=t,i=On;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&dw.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Yd,mw);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Yd.test(s)){let o=s.replace(fw,pw);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Ml}return new i(r,t)}function pw(e){return"-"+e.toLowerCase()}function mw(e){return e.charAt(1).toUpperCase()}const gw={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},yw=Vd([Hd,Wd,Jd,Gd,cw],"html"),Ll=Vd([Hd,Wd,Jd,Gd,uw],"svg");function vw(e){return e.join(" ").trim()}var Qd={},Xd=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,bw=/\n/g,ww=/^\s*/,xw=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,_w=/^:\s*/,kw=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Cw=/^[;\s]*/,Ew=/^\s+|\s+$/g,Sw=`
|
|
28
|
-
`,ef="/",tf="*",ii="",Tw="comment",Ow="declaration",Iw=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(p){var m=p.match(bw);m&&(n+=m.length);var y=p.lastIndexOf(Sw);r=~y?p.length-y:r+p.length}function s(){var p={line:n,column:r};return function(m){return m.position=new o(p),c(),m}}function o(p){this.start=p,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(p){var m=new Error(t.source+":"+n+":"+r+": "+p);if(m.reason=p,m.filename=t.source,m.line=n,m.column=r,m.source=e,!t.silent)throw m}function l(p){var m=p.exec(e);if(m){var y=m[0];return i(y),e=e.slice(y.length),m}}function c(){l(ww)}function u(p){var m;for(p=p||[];m=d();)m!==!1&&p.push(m);return p}function d(){var p=s();if(!(ef!=e.charAt(0)||tf!=e.charAt(1))){for(var m=2;ii!=e.charAt(m)&&(tf!=e.charAt(m)||ef!=e.charAt(m+1));)++m;if(m+=2,ii===e.charAt(m-1))return a("End of comment missing");var y=e.slice(2,m-2);return r+=2,i(y),e=e.slice(m),r+=2,p({type:Tw,comment:y})}}function h(){var p=s(),m=l(xw);if(m){if(d(),!l(_w))return a("property missing ':'");var y=l(kw),v=p({type:Ow,property:nf(m[0].replace(Xd,ii)),value:y?nf(y[0].replace(Xd,ii)):ii});return l(Cw),v}}function f(){var p=[];u(p);for(var m;m=h();)m!==!1&&(p.push(m),u(p));return p}return c(),f()};function nf(e){return e?e.replace(Ew,ii):ii}var Pw=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Qd,"__esModule",{value:!0});var Aw=Pw(Iw);function Rw(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,Aw.default)(e),i=typeof t=="function";return r.forEach(function(s){if(s.type==="declaration"){var o=s.property,a=s.value;i?t(o,a,s):a&&(n=n||{},n[o]=a)}}),n}var rf=Qd.default=Rw;const $w=rf.default||rf,sf=of("end"),Dl=of("start");function of(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Mw(e){const t=Dl(e),n=sf(e);if(t&&n)return{start:t,end:n}}function gs(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?af(e.position):"start"in e||"end"in e?af(e):"line"in e||"column"in e?Nl(e):""}function Nl(e){return lf(e&&e.line)+":"+lf(e&&e.column)}function af(e){return Nl(e&&e.start)+"-"+Nl(e&&e.end)}function lf(e){return e&&typeof e=="number"?e:1}class nn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=gs(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual,this.expected,this.note,this.url}}nn.prototype.file="",nn.prototype.name="",nn.prototype.reason="",nn.prototype.message="",nn.prototype.stack="",nn.prototype.column=void 0,nn.prototype.line=void 0,nn.prototype.ancestors=void 0,nn.prototype.cause=void 0,nn.prototype.fatal=void 0,nn.prototype.place=void 0,nn.prototype.ruleId=void 0,nn.prototype.source=void 0;const jl={}.hasOwnProperty,Lw=new Map,Dw=/[A-Z]/g,Nw=/-([a-z])/g,jw=new Set(["table","tbody","thead","tfoot","tr"]),Uw=new Set(["td","th"]),cf="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Fw(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Kw(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=qw(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ll:yw,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=uf(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function uf(e,t,n){if(t.type==="element")return Bw(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Vw(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Zw(e,t,n);if(t.type==="mdxjsEsm")return zw(e,t);if(t.type==="root")return Ww(e,t,n);if(t.type==="text")return Hw(e,t)}function Bw(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ll,e.schema=i),e.ancestors.push(t);const s=ff(e,t.tagName,!1),o=Jw(e,t);let a=Fl(e,t);return jw.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!ow(l):!0})),df(e,o,s,t),Ul(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function Vw(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ys(e,t.position)}function zw(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ys(e,t.position)}function Zw(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ll,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:ff(e,t.name,!0),o=Gw(e,t),a=Fl(e,t);return df(e,o,s,t),Ul(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function Ww(e,t,n){const r={};return Ul(r,Fl(e,t)),e.create(t,e.Fragment,r,n)}function Hw(e,t){return t.value}function df(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ul(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function qw(e,t,n){return r;function r(i,s,o,a){const c=Array.isArray(o.children)?n:t;return a?c(s,o,a):c(s,o)}}function Kw(e,t){return n;function n(r,i,s,o){const a=Array.isArray(s.children),l=Dl(r);return t(i,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Jw(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&jl.call(t.properties,i)){const s=Yw(e,i,t.properties[i]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&Uw.has(t.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Gw(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else ys(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,s=e.evaluater.evaluateExpression(a.expression)}else ys(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Fl(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Lw;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const c=i.get(l)||0;o=l+"-"+c,i.set(l,c+1)}}const a=uf(e,s,o);a!==void 0&&n.push(a)}return n}function Yw(e,t,n){const r=hw(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?tw(n):vw(n)),r.property==="style"){let i=typeof n=="object"?n:Qw(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Xw(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?gw[r.property]||r.property:r.attribute,n]}}function Qw(e,t){const n={};try{$w(t,r)}catch(i){if(!e.ignoreInvalidStyle){const s=i,o=new nn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=cf+"#cannot-parse-style-attribute",o}}return n;function r(i,s){let o=i;o.slice(0,2)!=="--"&&(o.slice(0,4)==="-ms-"&&(o="ms-"+o.slice(4)),o=o.replace(Nw,t0)),n[o]=s}}function ff(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const a=Fd(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=o}else r=Fd(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return jl.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);ys(e)}function ys(e,t){const n=new nn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=cf+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Xw(e){const t={};let n;for(n in e)jl.call(e,n)&&(t[e0(n)]=e[n]);return t}function e0(e){let t=e.replace(Dw,n0);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function t0(e,t){return t.toUpperCase()}function n0(e){return"-"+e.toLowerCase()}const Bl={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},r0={};function Vl(e,t){const n=t||r0,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return hf(e,r,i)}function hf(e,t,n){if(i0(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return pf(e.children,t,n)}return Array.isArray(e)?pf(e,t,n):""}function pf(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=hf(e[i],t,n);return r.join("")}function i0(e){return!!(e&&typeof e=="object")}const mf=document.createElement("i");function zl(e){const t="&"+e+";";mf.innerHTML=t;const n=mf.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function xn(e,t,n,r){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function In(e,t){return e.length>0?(xn(e,e.length,0,t),e):t}const gf={}.hasOwnProperty;function yf(e){const t={};let n=-1;for(;++n<e.length;)s0(t,e[n]);return t}function s0(e,t){let n;for(n in t){const i=(gf.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){gf.call(i,o)||(i[o]=[]);const a=s[o];o0(i[o],Array.isArray(a)?a:a?[a]:[])}}}function o0(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);xn(e,0,0,r)}function vf(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Nn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const un=Pr(/[A-Za-z]/),rn=Pr(/[\dA-Za-z]/),a0=Pr(/[#-'*+\--9=?A-Z^-~]/);function po(e){return e!==null&&(e<32||e===127)}const Zl=Pr(/\d/),l0=Pr(/[\dA-Fa-f]/),c0=Pr(/[!-/:-@[-`{-~]/);function ze(e){return e!==null&&e<-2}function gt(e){return e!==null&&(e<0||e===32)}function rt(e){return e===-2||e===-1||e===32}const mo=Pr(/\p{P}|\p{S}/u),si=Pr(/\s/);function Pr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ii(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&rn(e.charCodeAt(n+1))&&rn(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function at(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(l){return rt(l)?(e.enter(n),a(l)):t(l)}function a(l){return rt(l)&&s++<i?(e.consume(l),a):(e.exit(n),t(l))}}const u0={tokenize:d0};function d0(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),at(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),s(a)}function s(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ze(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),o)}}const f0={tokenize:h0},bf={tokenize:p0};function h0(e){const t=this,n=[];let r=0,i,s,o;return a;function a(x){if(r<n.length){const P=n[r];return t.containerState=P[1],e.attempt(P[0].continuation,l,c)(x)}return c(x)}function l(x){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&b();const P=t.events.length;let A=P,O;for(;A--;)if(t.events[A][0]==="exit"&&t.events[A][1].type==="chunkFlow"){O=t.events[A][1].end;break}v(r);let U=P;for(;U<t.events.length;)t.events[U][1].end=Object.assign({},O),U++;return xn(t.events,A+1,0,t.events.slice(P)),t.events.length=U,c(x)}return a(x)}function c(x){if(r===n.length){if(!i)return h(x);if(i.currentConstruct&&i.currentConstruct.concrete)return p(x);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(bf,u,d)(x)}function u(x){return i&&b(),v(r),h(x)}function d(x){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,p(x)}function h(x){return t.containerState={},e.attempt(bf,f,p)(x)}function f(x){return r++,n.push([t.currentConstruct,t.containerState]),h(x)}function p(x){if(x===null){i&&b(),v(0),e.consume(x);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:s,_tokenizer:i}),m(x)}function m(x){if(x===null){y(e.exit("chunkFlow"),!0),v(0),e.consume(x);return}return ze(x)?(e.consume(x),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(x),m)}function y(x,P){const A=t.sliceStream(x);if(P&&A.push(null),x.previous=s,s&&(s.next=x),s=x,i.defineSkip(x.start),i.write(A),t.parser.lazy[x.start.line]){let O=i.events.length;for(;O--;)if(i.events[O][1].start.offset<o&&(!i.events[O][1].end||i.events[O][1].end.offset>o))return;const U=t.events.length;let F=U,B,I;for(;F--;)if(t.events[F][0]==="exit"&&t.events[F][1].type==="chunkFlow"){if(B){I=t.events[F][1].end;break}B=!0}for(v(r),O=U;O<t.events.length;)t.events[O][1].end=Object.assign({},I),O++;xn(t.events,F+1,0,t.events.slice(U)),t.events.length=O}}function v(x){let P=n.length;for(;P-- >x;){const A=n[P];t.containerState=A[1],A[0].exit.call(t,e)}n.length=x}function b(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function p0(e,t,n){return at(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function go(e){if(e===null||gt(e)||si(e))return 1;if(mo(e))return 2}function yo(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const Wl={name:"attention",tokenize:g0,resolveAll:m0};function m0(e,t){let n=-1,r,i,s,o,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d=Object.assign({},e[r][1].end),h=Object.assign({},e[n][1].start);wf(d,-l),wf(h,l),o={type:l>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},e[r][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:h},s={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},a.end)},e[r][1].end=Object.assign({},o.start),e[n][1].start=Object.assign({},a.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=In(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=In(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),c=In(c,yo(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=In(c,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=In(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,xn(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function g0(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=go(r);let s;return o;function o(l){return s=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===s)return e.consume(l),a;const c=e.exit("attentionSequence"),u=go(l),d=!u||u===2&&i||n.includes(l),h=!i||i===2&&u||n.includes(r);return c._open=!!(s===42?d:d&&(i||!h)),c._close=!!(s===42?h:h&&(u||!d)),t(l)}}function wf(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const y0={name:"autolink",tokenize:v0};function v0(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(f){return un(f)?(e.consume(f),o):c(f)}function o(f){return f===43||f===45||f===46||rn(f)?(r=1,a(f)):c(f)}function a(f){return f===58?(e.consume(f),r=0,l):(f===43||f===45||f===46||rn(f))&&r++<32?(e.consume(f),a):(r=0,c(f))}function l(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||po(f)?n(f):(e.consume(f),l)}function c(f){return f===64?(e.consume(f),u):a0(f)?(e.consume(f),c):n(f)}function u(f){return rn(f)?d(f):n(f)}function d(f){return f===46?(e.consume(f),r=0,u):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):h(f)}function h(f){if((f===45||rn(f))&&r++<63){const p=f===45?h:d;return e.consume(f),p}return n(f)}}const vs={tokenize:b0,partial:!0};function b0(e,t,n){return r;function r(s){return rt(s)?at(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||ze(s)?t(s):n(s)}}const xf={name:"blockQuote",tokenize:w0,continuation:{tokenize:x0},exit:_0};function w0(e,t,n){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return rt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function x0(e,t,n){const r=this;return i;function i(o){return rt(o)?at(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(xf,t,n)(o)}}function _0(e){e.exit("blockQuote")}const _f={name:"characterEscape",tokenize:k0};function k0(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return c0(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const kf={name:"characterReference",tokenize:C0};function C0(e,t,n){const r=this;let i=0,s,o;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,o=rn,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=l0,u):(e.enter("characterReferenceValue"),s=7,o=Zl,u(d))}function u(d){if(d===59&&i){const h=e.exit("characterReferenceValue");return o===rn&&!zl(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&i++<s?(e.consume(d),u):n(d)}}const Cf={tokenize:S0,partial:!0},Ef={name:"codeFenced",tokenize:E0,concrete:!0};function E0(e,t,n){const r=this,i={tokenize:A,partial:!0};let s=0,o=0,a;return l;function l(O){return c(O)}function c(O){const U=r.events[r.events.length-1];return s=U&&U[1].type==="linePrefix"?U[2].sliceSerialize(U[1],!0).length:0,a=O,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(O)}function u(O){return O===a?(o++,e.consume(O),u):o<3?n(O):(e.exit("codeFencedFenceSequence"),rt(O)?at(e,d,"whitespace")(O):d(O))}function d(O){return O===null||ze(O)?(e.exit("codeFencedFence"),r.interrupt?t(O):e.check(Cf,m,P)(O)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(O))}function h(O){return O===null||ze(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(O)):rt(O)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),at(e,f,"whitespace")(O)):O===96&&O===a?n(O):(e.consume(O),h)}function f(O){return O===null||ze(O)?d(O):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(O))}function p(O){return O===null||ze(O)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(O)):O===96&&O===a?n(O):(e.consume(O),p)}function m(O){return e.attempt(i,P,y)(O)}function y(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),v}function v(O){return s>0&&rt(O)?at(e,b,"linePrefix",s+1)(O):b(O)}function b(O){return O===null||ze(O)?e.check(Cf,m,P)(O):(e.enter("codeFlowValue"),x(O))}function x(O){return O===null||ze(O)?(e.exit("codeFlowValue"),b(O)):(e.consume(O),x)}function P(O){return e.exit("codeFenced"),t(O)}function A(O,U,F){let B=0;return I;function I(V){return O.enter("lineEnding"),O.consume(V),O.exit("lineEnding"),j}function j(V){return O.enter("codeFencedFence"),rt(V)?at(O,J,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(V):J(V)}function J(V){return V===a?(O.enter("codeFencedFenceSequence"),q(V)):F(V)}function q(V){return V===a?(B++,O.consume(V),q):B>=o?(O.exit("codeFencedFenceSequence"),rt(V)?at(O,H,"whitespace")(V):H(V)):F(V)}function H(V){return V===null||ze(V)?(O.exit("codeFencedFence"),U(V)):F(V)}}}function S0(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Hl={name:"codeIndented",tokenize:O0},T0={tokenize:I0,partial:!0};function O0(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),at(e,s,"linePrefix",4+1)(c)}function s(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?l(c):ze(c)?e.attempt(T0,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||ze(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function I0(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):ze(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):at(e,s,"linePrefix",4+1)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):ze(o)?i(o):n(o)}}const P0={name:"codeText",tokenize:$0,resolve:A0,previous:R0};function A0(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function R0(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function $0(e,t,n){let r=0,i,s;return o;function o(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(s=e.enter("codeTextSequence"),i=0,u(d)):ze(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||ze(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(s.type="codeTextData",c(d))}}function Sf(e){const t={};let n=-1,r,i,s,o,a,l,c;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,M0(e,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,i=void 0;s--&&(o=e[s],o[1].type==="lineEnding"||o[1].type==="lineEndingBlank");)o[0]==="enter"&&(i&&(e[i][1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);i&&(r[1].end=Object.assign({},e[i][1].start),a=e.slice(i,n),a.unshift(r),xn(e,i,n-i+1,a))}}return!c}function M0(e,t){const n=e[t][1],r=e[t][2];let i=t-1;const s=[],o=n._tokenizer||r.parser[n.contentType](n.start),a=o.events,l=[],c={};let u,d,h=-1,f=n,p=0,m=0;const y=[m];for(;f;){for(;e[++i][1]!==f;);s.push(i),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),d&&o.defineSkip(f.start),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(m=h+1,y.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(o.events=[],f?(f._tokenizer=void 0,f.previous=void 0):y.pop(),h=y.length;h--;){const v=a.slice(y[h],y[h+1]),b=s.pop();l.unshift([b,b+v.length-1]),xn(e,b,2,v)}for(h=-1;++h<l.length;)c[p+l[h][0]]=p+l[h][1],p+=l[h][1]-l[h][0]-1;return c}const L0={tokenize:j0,resolve:N0},D0={tokenize:U0,partial:!0};function N0(e){return Sf(e),e}function j0(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):ze(a)?e.check(D0,o,s)(a):(e.consume(a),i)}function s(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function U0(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),at(e,s,"linePrefix")}function s(o){if(o===null||ze(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function Tf(e,t,n,r,i,s,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(v){return v===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(v),e.exit(s),h):v===null||v===32||v===41||po(v)?n(v):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(v))}function h(v){return v===62?(e.enter(s),e.consume(v),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(v))}function f(v){return v===62?(e.exit("chunkString"),e.exit(a),h(v)):v===null||v===60||ze(v)?n(v):(e.consume(v),v===92?p:f)}function p(v){return v===60||v===62||v===92?(e.consume(v),f):f(v)}function m(v){return!u&&(v===null||v===41||gt(v))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(v)):u<c&&v===40?(e.consume(v),u++,m):v===41?(e.consume(v),u--,m):v===null||v===32||v===40||po(v)?n(v):(e.consume(v),v===92?y:m)}function y(v){return v===40||v===41||v===92?(e.consume(v),m):m(v)}}function Of(e,t,n,r,i,s){const o=this;let a=0,l;return c;function c(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(s),u}function u(f){return a>999||f===null||f===91||f===93&&!l||f===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(f):f===93?(e.exit(s),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):ze(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||ze(f)||a++>999?(e.exit("chunkString"),u(f)):(e.consume(f),l||(l=!rt(f)),f===92?h:d)}function h(f){return f===91||f===92||f===93?(e.consume(f),a++,d):d(f)}}function If(e,t,n,r,i,s){let o;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),o=h===40?41:h,l):n(h)}function l(h){return h===o?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(s),c(h))}function c(h){return h===o?(e.exit(s),l(o)):h===null?n(h):ze(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),at(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===o||h===null||ze(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?d:u)}function d(h){return h===o||h===92?(e.consume(h),u):u(h)}}function bs(e,t){let n;return r;function r(i){return ze(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):rt(i)?at(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const F0={name:"definition",tokenize:V0},B0={tokenize:z0,partial:!0};function V0(e,t,n){const r=this;let i;return s;function s(f){return e.enter("definition"),o(f)}function o(f){return Of.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=Nn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),l):n(f)}function l(f){return gt(f)?bs(e,c)(f):c(f)}function c(f){return Tf(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return e.attempt(B0,d,d)(f)}function d(f){return rt(f)?at(e,h,"whitespace")(f):h(f)}function h(f){return f===null||ze(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function z0(e,t,n){return r;function r(a){return gt(a)?bs(e,i)(a):n(a)}function i(a){return If(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return rt(a)?at(e,o,"whitespace")(a):o(a)}function o(a){return a===null||ze(a)?t(a):n(a)}}const Z0={name:"hardBreakEscape",tokenize:W0};function W0(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return ze(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const H0={name:"headingAtx",tokenize:K0,resolve:q0};function q0(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},xn(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function K0(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),s(u)}function s(u){return e.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&r++<6?(e.consume(u),o):u===null||gt(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||ze(u)?(e.exit("atxHeading"),t(u)):rt(u)?at(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||gt(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const J0=["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"],Pf=["pre","script","style","textarea"],G0={name:"htmlFlow",tokenize:ex,resolveTo:X0,concrete:!0},Y0={tokenize:nx,partial:!0},Q0={tokenize:tx,partial:!0};function X0(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function ex(e,t,n){const r=this;let i,s,o,a,l;return c;function c(S){return u(S)}function u(S){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(S),d}function d(S){return S===33?(e.consume(S),h):S===47?(e.consume(S),s=!0,m):S===63?(e.consume(S),i=3,r.interrupt?t:k):un(S)?(e.consume(S),o=String.fromCharCode(S),y):n(S)}function h(S){return S===45?(e.consume(S),i=2,f):S===91?(e.consume(S),i=5,a=0,p):un(S)?(e.consume(S),i=4,r.interrupt?t:k):n(S)}function f(S){return S===45?(e.consume(S),r.interrupt?t:k):n(S)}function p(S){const Te="CDATA[";return S===Te.charCodeAt(a++)?(e.consume(S),a===Te.length?r.interrupt?t:J:p):n(S)}function m(S){return un(S)?(e.consume(S),o=String.fromCharCode(S),y):n(S)}function y(S){if(S===null||S===47||S===62||gt(S)){const Te=S===47,Ne=o.toLowerCase();return!Te&&!s&&Pf.includes(Ne)?(i=1,r.interrupt?t(S):J(S)):J0.includes(o.toLowerCase())?(i=6,Te?(e.consume(S),v):r.interrupt?t(S):J(S)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(S):s?b(S):x(S))}return S===45||rn(S)?(e.consume(S),o+=String.fromCharCode(S),y):n(S)}function v(S){return S===62?(e.consume(S),r.interrupt?t:J):n(S)}function b(S){return rt(S)?(e.consume(S),b):I(S)}function x(S){return S===47?(e.consume(S),I):S===58||S===95||un(S)?(e.consume(S),P):rt(S)?(e.consume(S),x):I(S)}function P(S){return S===45||S===46||S===58||S===95||rn(S)?(e.consume(S),P):A(S)}function A(S){return S===61?(e.consume(S),O):rt(S)?(e.consume(S),A):x(S)}function O(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),l=S,U):rt(S)?(e.consume(S),O):F(S)}function U(S){return S===l?(e.consume(S),l=null,B):S===null||ze(S)?n(S):(e.consume(S),U)}function F(S){return S===null||S===34||S===39||S===47||S===60||S===61||S===62||S===96||gt(S)?A(S):(e.consume(S),F)}function B(S){return S===47||S===62||rt(S)?x(S):n(S)}function I(S){return S===62?(e.consume(S),j):n(S)}function j(S){return S===null||ze(S)?J(S):rt(S)?(e.consume(S),j):n(S)}function J(S){return S===45&&i===2?(e.consume(S),z):S===60&&i===1?(e.consume(S),Y):S===62&&i===4?(e.consume(S),ee):S===63&&i===3?(e.consume(S),k):S===93&&i===5?(e.consume(S),pe):ze(S)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Y0,xe,q)(S)):S===null||ze(S)?(e.exit("htmlFlowData"),q(S)):(e.consume(S),J)}function q(S){return e.check(Q0,H,xe)(S)}function H(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),V}function V(S){return S===null||ze(S)?q(S):(e.enter("htmlFlowData"),J(S))}function z(S){return S===45?(e.consume(S),k):J(S)}function Y(S){return S===47?(e.consume(S),o="",K):J(S)}function K(S){if(S===62){const Te=o.toLowerCase();return Pf.includes(Te)?(e.consume(S),ee):J(S)}return un(S)&&o.length<8?(e.consume(S),o+=String.fromCharCode(S),K):J(S)}function pe(S){return S===93?(e.consume(S),k):J(S)}function k(S){return S===62?(e.consume(S),ee):S===45&&i===2?(e.consume(S),k):J(S)}function ee(S){return S===null||ze(S)?(e.exit("htmlFlowData"),xe(S)):(e.consume(S),ee)}function xe(S){return e.exit("htmlFlow"),t(S)}}function tx(e,t,n){const r=this;return i;function i(o){return ze(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function nx(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(vs,t,n)}}const rx={name:"htmlText",tokenize:ix};function ix(e,t,n){const r=this;let i,s,o;return a;function a(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),l}function l(k){return k===33?(e.consume(k),c):k===47?(e.consume(k),A):k===63?(e.consume(k),x):un(k)?(e.consume(k),F):n(k)}function c(k){return k===45?(e.consume(k),u):k===91?(e.consume(k),s=0,p):un(k)?(e.consume(k),b):n(k)}function u(k){return k===45?(e.consume(k),f):n(k)}function d(k){return k===null?n(k):k===45?(e.consume(k),h):ze(k)?(o=d,Y(k)):(e.consume(k),d)}function h(k){return k===45?(e.consume(k),f):d(k)}function f(k){return k===62?z(k):k===45?h(k):d(k)}function p(k){const ee="CDATA[";return k===ee.charCodeAt(s++)?(e.consume(k),s===ee.length?m:p):n(k)}function m(k){return k===null?n(k):k===93?(e.consume(k),y):ze(k)?(o=m,Y(k)):(e.consume(k),m)}function y(k){return k===93?(e.consume(k),v):m(k)}function v(k){return k===62?z(k):k===93?(e.consume(k),v):m(k)}function b(k){return k===null||k===62?z(k):ze(k)?(o=b,Y(k)):(e.consume(k),b)}function x(k){return k===null?n(k):k===63?(e.consume(k),P):ze(k)?(o=x,Y(k)):(e.consume(k),x)}function P(k){return k===62?z(k):x(k)}function A(k){return un(k)?(e.consume(k),O):n(k)}function O(k){return k===45||rn(k)?(e.consume(k),O):U(k)}function U(k){return ze(k)?(o=U,Y(k)):rt(k)?(e.consume(k),U):z(k)}function F(k){return k===45||rn(k)?(e.consume(k),F):k===47||k===62||gt(k)?B(k):n(k)}function B(k){return k===47?(e.consume(k),z):k===58||k===95||un(k)?(e.consume(k),I):ze(k)?(o=B,Y(k)):rt(k)?(e.consume(k),B):z(k)}function I(k){return k===45||k===46||k===58||k===95||rn(k)?(e.consume(k),I):j(k)}function j(k){return k===61?(e.consume(k),J):ze(k)?(o=j,Y(k)):rt(k)?(e.consume(k),j):B(k)}function J(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,q):ze(k)?(o=J,Y(k)):rt(k)?(e.consume(k),J):(e.consume(k),H)}function q(k){return k===i?(e.consume(k),i=void 0,V):k===null?n(k):ze(k)?(o=q,Y(k)):(e.consume(k),q)}function H(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||gt(k)?B(k):(e.consume(k),H)}function V(k){return k===47||k===62||gt(k)?B(k):n(k)}function z(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function Y(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),K}function K(k){return rt(k)?at(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):pe(k)}function pe(k){return e.enter("htmlTextData"),o(k)}}const ql={name:"labelEnd",tokenize:ux,resolveTo:cx,resolveAll:lx},sx={tokenize:dx},ox={tokenize:fx},ax={tokenize:hx};function lx(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function cx(e,t){let n=e.length,r=0,i,s,o,a;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:Object.assign({},e[s][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[s][1].start),end:Object.assign({},e[o][1].end)},u={type:"labelText",start:Object.assign({},e[s+r+2][1].end),end:Object.assign({},e[o-2][1].start)};return a=[["enter",l,t],["enter",c,t]],a=In(a,e.slice(s+1,s+r+3)),a=In(a,[["enter",u,t]]),a=In(a,yo(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),a=In(a,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),a=In(a,e.slice(o+1)),a=In(a,[["exit",l,t]]),xn(e,s,e.length,a),e}function ux(e,t,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return a;function a(h){return s?s._inactive?d(h):(o=r.parser.defined.includes(Nn(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(sx,u,o?u:d)(h):h===91?e.attempt(ox,u,o?c:d)(h):o?u(h):d(h)}function c(h){return e.attempt(ax,u,d)(h)}function u(h){return t(h)}function d(h){return s._balanced=!0,n(h)}}function dx(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return gt(d)?bs(e,s)(d):s(d)}function s(d){return d===41?u(d):Tf(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return gt(d)?bs(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?If(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return gt(d)?bs(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function fx(e,t,n){const r=this;return i;function i(a){return Of.call(r,e,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(Nn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function hx(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const px={name:"labelStartImage",tokenize:mx,resolveAll:ql.resolveAll};function mx(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),s}function s(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const gx={name:"labelStartLink",tokenize:yx,resolveAll:ql.resolveAll};function yx(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Kl={name:"lineEnding",tokenize:vx};function vx(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),at(e,t,"linePrefix")}}const vo={name:"thematicBreak",tokenize:bx};function bx(e,t,n){let r=0,i;return s;function s(c){return e.enter("thematicBreak"),o(c)}function o(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||ze(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),rt(c)?at(e,a,"whitespace")(c):a(c))}}const pn={name:"list",tokenize:_x,continuation:{tokenize:kx},exit:Ex},wx={tokenize:Sx,partial:!0},xx={tokenize:Cx,partial:!0};function _x(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(f){const p=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Zl(f)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(vo,n,c)(f):c(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return Zl(f)&&++o<10?(e.consume(f),l):(!r.interrupt||o<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(vs,r.interrupt?n:u,e.attempt(wx,h,d))}function u(f){return r.containerState.initialBlankLine=!0,s++,h(f)}function d(f){return rt(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function kx(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(vs,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,at(e,t,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!rt(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(xx,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,at(e,e.attempt(pn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Cx(e,t,n){const r=this;return at(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function Ex(e){e.exit(this.containerState.type)}function Sx(e,t,n){const r=this;return at(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function i(s){const o=r.events[r.events.length-1];return!rt(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Af={name:"setextUnderline",tokenize:Ox,resolveTo:Tx};function Tx(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[s][1].end)):e[r][1]=o,e.push(["exit",o,t]),e}function Ox(e,t,n){const r=this;let i;return s;function s(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),rt(c)?at(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ze(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Ix={tokenize:Px};function Px(e){const t=this,n=e.attempt(vs,r,e.attempt(this.parser.constructs.flowInitial,i,at(e,e.attempt(this.parser.constructs.flow,i,e.attempt(L0,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Ax={resolveAll:$f()},Rx=Rf("string"),$x=Rf("text");function Rf(e){return{tokenize:t,resolveAll:$f(e==="text"?Mx:void 0)};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,a);return o;function o(u){return c(u)?s(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),s(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=i[u];let h=-1;if(d)for(;++h<d.length;){const f=d[h];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function $f(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function Mx(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,o=-1,a=0,l;for(;s--;){const c=i[s];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)l=!0,a++;else if(c!==-1){s++;break}}if(a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-a,offset:r.end.offset-a,_index:r.start._index+s,_bufferIndex:s?o:r.start._bufferIndex+o},end:Object.assign({},r.end)};r.end=Object.assign({},c.start),r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}function Lx(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},s=[];let o=[],a=[];const l={consume:b,enter:x,exit:P,attempt:U(A),check:U(O),interrupt:U(O,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:f,sliceSerialize:h,now:p,defineSkip:m,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&s.push(t),c;function d(j){return o=In(o,j),y(),o[o.length-1]!==null?[]:(F(t,0),c.events=yo(s,c.events,c),c.events)}function h(j,J){return Nx(f(j),J)}function f(j){return Dx(o,j)}function p(){const{line:j,column:J,offset:q,_index:H,_bufferIndex:V}=r;return{line:j,column:J,offset:q,_index:H,_bufferIndex:V}}function m(j){i[j.line]=j.column,I()}function y(){let j;for(;r._index<o.length;){const J=o[r._index];if(typeof J=="string")for(j=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===j&&r._bufferIndex<J.length;)v(J.charCodeAt(r._bufferIndex));else v(J)}}function v(j){u=u(j)}function b(j){ze(j)?(r.line++,r.column=1,r.offset+=j===-3?2:1,I()):j!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=j}function x(j,J){const q=J||{};return q.type=j,q.start=p(),c.events.push(["enter",q,c]),a.push(q),q}function P(j){const J=a.pop();return J.end=p(),c.events.push(["exit",J,c]),J}function A(j,J){F(j,J.from)}function O(j,J){J.restore()}function U(j,J){return q;function q(H,V,z){let Y,K,pe,k;return Array.isArray(H)?xe(H):"tokenize"in H?xe([H]):ee(H);function ee(Ie){return je;function je(De){const Ue=De!==null&&Ie[De],_e=De!==null&&Ie.null,ve=[...Array.isArray(Ue)?Ue:Ue?[Ue]:[],...Array.isArray(_e)?_e:_e?[_e]:[]];return xe(ve)(De)}}function xe(Ie){return Y=Ie,K=0,Ie.length===0?z:S(Ie[K])}function S(Ie){return je;function je(De){return k=B(),pe=Ie,Ie.partial||(c.currentConstruct=Ie),Ie.name&&c.parser.constructs.disable.null.includes(Ie.name)?Ne():Ie.tokenize.call(J?Object.assign(Object.create(c),J):c,l,Te,Ne)(De)}}function Te(Ie){return j(pe,k),V}function Ne(Ie){return k.restore(),++K<Y.length?S(Y[K]):z}}}function F(j,J){j.resolveAll&&!s.includes(j)&&s.push(j),j.resolve&&xn(c.events,J,c.events.length-J,j.resolve(c.events.slice(J),c)),j.resolveTo&&(c.events=j.resolveTo(c.events,c))}function B(){const j=p(),J=c.previous,q=c.currentConstruct,H=c.events.length,V=Array.from(a);return{restore:z,from:H};function z(){r=j,c.previous=J,c.currentConstruct=q,c.events.length=H,a=V,I()}}function I(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Dx(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function Nx(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
|
|
27
|
+
Check the top-level render call using <`+Se+">.")}return ge}}function Xt(M,ge){{if(!M._store||M._store.validated||M.key!=null)return;M._store.validated=!0;var Se=Ot(ge);if(Tt[Se])return;Tt[Se]=!0;var Ke="";M&&M._owner&&M._owner!==Rr.current&&(Ke=" It was passed a child from "+q(M._owner.type)+"."),fr(M),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Se,Ke),fr(null)}}function en(M,ge){{if(typeof M!="object")return;if(Be(M))for(var Se=0;Se<M.length;Se++){var Ke=M[Se];si(Ke)&&Xt(Ke,ge)}else if(si(M))M._store&&(M._store.validated=!0);else if(M){var ft=y(M);if(typeof ft=="function"&&ft!==M.entries)for(var yt=ft.call(M),at;!(at=yt.next()).done;)si(at.value)&&Xt(at.value,ge)}}}function Yt(M){{var ge=M.type;if(ge==null||typeof ge=="string")return;var Se;if(typeof ge=="function")Se=ge.propTypes;else if(typeof ge=="object"&&(ge.$$typeof===l||ge.$$typeof===d))Se=ge.propTypes;else return;if(Se){var Ke=q(ge);Le(Se,M.props,"prop",Ke,M)}else if(ge.PropTypes!==void 0&&!Ri){Ri=!0;var ft=q(ge);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ft||"Unknown")}typeof ge.getDefaultProps=="function"&&!ge.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Lt(M){{for(var ge=Object.keys(M.props),Se=0;Se<ge.length;Se++){var Ke=ge[Se];if(Ke!=="children"&&Ke!=="key"){fr(M),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Ke),fr(null);break}}M.ref!==null&&(fr(M),b("Invalid attribute `ref` supplied to `React.Fragment`."),fr(null))}}function _n(M,ge,Se,Ke,ft,yt){{var at=O(M);if(!at){var it="";(M===void 0||typeof M=="object"&&M!==null&&Object.keys(M).length===0)&&(it+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var sn=$r(ft);sn?it+=sn:it+=oi();var A;M===null?A="null":Be(M)?A="array":M!==void 0&&M.$$typeof===t?(A="<"+(q(M.type)||"Unknown")+" />",it=" Did you accidentally export a JSX literal instead of a component?"):A=typeof M,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",A,it)}var g=Gt(M,ge,Se,ft,yt);if(g==null)return g;if(at){var w=ge.children;if(w!==void 0)if(Ke)if(Be(w)){for(var C=0;C<w.length;C++)en(w[C],M);Object.freeze&&Object.freeze(w)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else en(w,M)}return M===r?Lt(g):Yt(g),g}}function In(M,ge,Se){return _n(M,ge,Se,!0)}function hr(M,ge,Se){return _n(M,ge,Se,!1)}var Fd=hr,Bd=In;ws.Fragment=r,ws.jsx=Fd,ws.jsxs=Bd}()),ws}process.env.NODE_ENV==="production"?Dl.exports=Uw():Dl.exports=Fw();var z=Dl.exports;function _t(){return _t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_t.apply(this,arguments)}function Nl(e,t=[]){let n=[];function r(s,o){const a=_.createContext(o),l=n.length;n=[...n,o];function c(d){const{scope:h,children:f,...p}=d,m=(h==null?void 0:h[e][l])||a,y=_.useMemo(()=>p,Object.values(p));return _.createElement(m.Provider,{value:y},f)}function u(d,h){const f=(h==null?void 0:h[e][l])||a,p=_.useContext(f);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${s}\``)}return c.displayName=s+"Provider",[c,u]}const i=()=>{const s=n.map(o=>_.createContext(o));return function(a){const l=(a==null?void 0:a[e])||s;return _.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,Bw(i,...t)]}function Bw(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(s)[`__scope${c}`];return{...a,...d}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function Mr(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}const xs=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{};function Vw(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Hd(...e){return t=>e.forEach(n=>Vw(n,t))}function li(...e){return _.useCallback(Hd(...e),e)}const jl=_.forwardRef((e,t)=>{const{children:n,...r}=e,i=_.Children.toArray(n),s=i.find(Zw);if(s){const o=s.props.children,a=i.map(l=>l===s?_.Children.count(o)>1?_.Children.only(null):_.isValidElement(o)?o.props.children:null:l);return _.createElement(Ul,_t({},r,{ref:t}),_.isValidElement(o)?_.cloneElement(o,void 0,a):null)}return _.createElement(Ul,_t({},r,{ref:t}),n)});jl.displayName="Slot";const Ul=_.forwardRef((e,t)=>{const{children:n,...r}=e;return _.isValidElement(n)?_.cloneElement(n,{...Ww(r,n.props),ref:t?Hd(t,n.ref):n.ref}):_.Children.count(n)>1?_.Children.only(null):null});Ul.displayName="SlotClone";const zw=({children:e})=>_.createElement(_.Fragment,null,e);function Zw(e){return _.isValidElement(e)&&e.type===zw}function Ww(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{s(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}const Pn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{const n=_.forwardRef((r,i)=>{const{asChild:s,...o}=r,a=s?jl:t;return _.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),_.createElement(a,_t({},o,{ref:i}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function Hw(e,t){e&&Gn.flushSync(()=>e.dispatchEvent(t))}const qd="Avatar",[qw,tF]=Nl(qd),[Kw,Kd]=qw(qd),Jd=_.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,s]=_.useState("idle");return _.createElement(Kw,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:s},_.createElement(Pn.span,_t({},r,{ref:t})))}),Jw="AvatarImage",Gd=_.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...s}=e,o=Kd(Jw,n),a=Yw(r),l=Mr(c=>{i(c),o.onImageLoadingStatusChange(c)});return xs(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?_.createElement(Pn.img,_t({},s,{ref:t,src:r})):null}),Gw="AvatarFallback",Yd=_.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,s=Kd(Gw,n),[o,a]=_.useState(r===void 0);return _.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),o&&s.imageLoadingStatus!=="loaded"?_.createElement(Pn.span,_t({},i,{ref:t})):null});function Yw(e){const[t,n]=_.useState("idle");return _.useEffect(()=>{if(!e){n("error");return}let r=!0;const i=new window.Image,s=o=>()=>{r&&n(o)};return n("loading"),i.onload=s("loaded"),i.onerror=s("error"),i.src=e,()=>{r=!1}},[e]),t}let Fl=class{constructor(){E(this,"eventMap");this.eventMap={}}on(t,n){var r;return this.eventMap[t]||(this.eventMap[t]=new Set),(r=this.eventMap[t])==null||r.add(n),()=>{var i;(i=this.eventMap[t])==null||i.delete(n)}}emit(t,n){var r;(r=this.eventMap[t])==null||r.forEach(i=>{i(n)})}};const Qw=new Fl;function Qd(e,t){let n=0;if(e.length==0)return n;for(let r=0;r<e.length;r++){const i=e.charCodeAt(r);n=(n<<5)-n+i,n=n&n}return Math.abs(n)%t}const Bl=_.forwardRef(({userId:e,src:t,container:n,image:r,fallback:i,...s},o)=>{const a=Qd(e??"",15);return z.jsxs(Jd,{ref:o,"data-color":a,...n,...s,children:[z.jsx(Gd,{src:t,...r}),z.jsx(Yd,{...i,children:typeof s.children=="string"?s.children[0]:s.children})]})});function nF(){}function rF(){}function Xw(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const e0=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,t0=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,n0={};function Xd(e,t){return((t||n0).jsx?t0:e0).test(e)}const r0=/[ \t\n\f\r]/g;function i0(e){return typeof e=="object"?e.type==="text"?ef(e.value):!1:ef(e)}function ef(e){return e.replace(r0,"")===""}class _s{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}_s.prototype.property={},_s.prototype.normal={},_s.prototype.space=null;function tf(e,t){const n={},r={};let i=-1;for(;++i<e.length;)Object.assign(n,e[i].property),Object.assign(r,e[i].normal);return new _s(n,r,t)}function Vl(e){return e.toLowerCase()}class An{constructor(t,n){this.property=t,this.attribute=n}}An.prototype.space=null,An.prototype.boolean=!1,An.prototype.booleanish=!1,An.prototype.overloadedBoolean=!1,An.prototype.number=!1,An.prototype.commaSeparated=!1,An.prototype.spaceSeparated=!1,An.prototype.commaOrSpaceSeparated=!1,An.prototype.mustUseProperty=!1,An.prototype.defined=!1;let s0=0;const et=ci(),Dt=ci(),nf=ci(),be=ci(),xt=ci(),$i=ci(),kn=ci();function ci(){return 2**++s0}const zl=Object.freeze(Object.defineProperty({__proto__:null,boolean:et,booleanish:Dt,commaOrSpaceSeparated:kn,commaSeparated:$i,number:be,overloadedBoolean:nf,spaceSeparated:xt},Symbol.toStringTag,{value:"Module"})),Zl=Object.keys(zl);class Wl extends An{constructor(t,n,r,i){let s=-1;if(super(t,n),rf(this,"space",i),typeof r=="number")for(;++s<Zl.length;){const o=Zl[s];rf(this,Zl[s],(r&zl[o])===zl[o])}}}Wl.prototype.defined=!0;function rf(e,t,n){n&&(e[t]=n)}const o0={}.hasOwnProperty;function Mi(e){const t={},n={};let r;for(r in e.properties)if(o0.call(e.properties,r)){const i=e.properties[r],s=new Wl(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Vl(r)]=r,n[Vl(s.attribute)]=r}return new _s(t,n,e.space)}const sf=Mi({space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()},properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),of=Mi({space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()},properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function af(e,t){return t in e?e[t]:t}function lf(e,t){return af(e,t.toLowerCase())}const cf=Mi({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:lf,properties:{xmlns:null,xmlnsXLink:null}}),uf=Mi({transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()},properties:{ariaActiveDescendant:null,ariaAtomic:Dt,ariaAutoComplete:null,ariaBusy:Dt,ariaChecked:Dt,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:xt,ariaCurrent:null,ariaDescribedBy:xt,ariaDetails:null,ariaDisabled:Dt,ariaDropEffect:xt,ariaErrorMessage:null,ariaExpanded:Dt,ariaFlowTo:xt,ariaGrabbed:Dt,ariaHasPopup:null,ariaHidden:Dt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:xt,ariaLevel:be,ariaLive:null,ariaModal:Dt,ariaMultiLine:Dt,ariaMultiSelectable:Dt,ariaOrientation:null,ariaOwns:xt,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:Dt,ariaReadOnly:Dt,ariaRelevant:null,ariaRequired:Dt,ariaRoleDescription:xt,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:Dt,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null}}),a0=Mi({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:lf,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:$i,acceptCharset:xt,accessKey:xt,action:null,allow:null,allowFullScreen:et,allowPaymentRequest:et,allowUserMedia:et,alt:null,as:null,async:et,autoCapitalize:null,autoComplete:xt,autoFocus:et,autoPlay:et,capture:et,charSet:null,checked:et,cite:null,className:xt,cols:be,colSpan:null,content:null,contentEditable:Dt,controls:et,controlsList:xt,coords:be|$i,crossOrigin:null,data:null,dateTime:null,decoding:null,default:et,defer:et,dir:null,dirName:null,disabled:et,download:nf,draggable:Dt,encType:null,enterKeyHint:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:et,formTarget:null,headers:xt,height:be,hidden:et,high:be,href:null,hrefLang:null,htmlFor:xt,httpEquiv:xt,id:null,imageSizes:null,imageSrcSet:null,inputMode:null,integrity:null,is:null,isMap:et,itemId:null,itemProp:xt,itemRef:xt,itemScope:et,itemType:xt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:et,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:et,muted:et,name:null,nonce:null,noModule:et,noValidate:et,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:et,optimum:be,pattern:null,ping:xt,placeholder:null,playsInline:et,poster:null,preload:null,readOnly:et,referrerPolicy:null,rel:xt,required:et,reversed:et,rows:be,rowSpan:be,sandbox:xt,scope:null,scoped:et,seamless:et,selected:et,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:Dt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:et,useMap:null,value:Dt,width:be,wrap:null,align:null,aLink:null,archive:xt,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:et,declare:et,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:et,noHref:et,noShade:et,noWrap:et,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:Dt,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:et,disableRemotePlayback:et,prefix:null,property:null,results:be,security:null,unselectable:null}}),l0=Mi({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:af,properties:{about:kn,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:xt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:et,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:$i,g2:$i,glyphName:$i,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:kn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:xt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:kn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:kn,rev:kn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:kn,requiredFeatures:kn,requiredFonts:kn,requiredFormats:kn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:kn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:kn,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:kn,to:null,transform:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),c0=/^data[-\w.:]+$/i,df=/-[a-z]/g,u0=/[A-Z]/g;function d0(e,t){const n=Vl(t);let r=t,i=An;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&c0.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(df,h0);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!df.test(s)){let o=s.replace(u0,f0);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Wl}return new i(r,t)}function f0(e){return"-"+e.toLowerCase()}function h0(e){return e.charAt(1).toUpperCase()}const p0={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},m0=tf([of,sf,cf,uf,a0],"html"),Hl=tf([of,sf,cf,uf,l0],"svg");function g0(e){return e.join(" ").trim()}var ff={},hf=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,y0=/\n/g,v0=/^\s*/,b0=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,w0=/^:\s*/,x0=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,_0=/^[;\s]*/,k0=/^\s+|\s+$/g,C0=`
|
|
28
|
+
`,pf="/",mf="*",ui="",E0="comment",S0="declaration",T0=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(p){var m=p.match(y0);m&&(n+=m.length);var y=p.lastIndexOf(C0);r=~y?p.length-y:r+p.length}function s(){var p={line:n,column:r};return function(m){return m.position=new o(p),c(),m}}function o(p){this.start=p,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function a(p){var m=new Error(t.source+":"+n+":"+r+": "+p);if(m.reason=p,m.filename=t.source,m.line=n,m.column=r,m.source=e,!t.silent)throw m}function l(p){var m=p.exec(e);if(m){var y=m[0];return i(y),e=e.slice(y.length),m}}function c(){l(v0)}function u(p){var m;for(p=p||[];m=d();)m!==!1&&p.push(m);return p}function d(){var p=s();if(!(pf!=e.charAt(0)||mf!=e.charAt(1))){for(var m=2;ui!=e.charAt(m)&&(mf!=e.charAt(m)||pf!=e.charAt(m+1));)++m;if(m+=2,ui===e.charAt(m-1))return a("End of comment missing");var y=e.slice(2,m-2);return r+=2,i(y),e=e.slice(m),r+=2,p({type:E0,comment:y})}}function h(){var p=s(),m=l(b0);if(m){if(d(),!l(w0))return a("property missing ':'");var y=l(x0),v=p({type:S0,property:gf(m[0].replace(hf,ui)),value:y?gf(y[0].replace(hf,ui)):ui});return l(_0),v}}function f(){var p=[];u(p);for(var m;m=h();)m!==!1&&(p.push(m),u(p));return p}return c(),f()};function gf(e){return e?e.replace(k0,ui):ui}var O0=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ff,"__esModule",{value:!0});var I0=O0(T0);function P0(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,I0.default)(e),i=typeof t=="function";return r.forEach(function(s){if(s.type==="declaration"){var o=s.property,a=s.value;i?t(o,a,s):a&&(n=n||{},n[o]=a)}}),n}var yf=ff.default=P0;const A0=yf.default||yf,vf=bf("end"),ql=bf("start");function bf(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function R0(e){const t=ql(e),n=vf(e);if(t&&n)return{start:t,end:n}}function ks(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?wf(e.position):"start"in e||"end"in e?wf(e):"line"in e||"column"in e?Kl(e):""}function Kl(e){return xf(e&&e.line)+":"+xf(e&&e.column)}function wf(e){return Kl(e&&e.start)+"-"+Kl(e&&e.end)}function xf(e){return e&&typeof e=="number"?e:1}class on extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=ks(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual,this.expected,this.note,this.url}}on.prototype.file="",on.prototype.name="",on.prototype.reason="",on.prototype.message="",on.prototype.stack="",on.prototype.column=void 0,on.prototype.line=void 0,on.prototype.ancestors=void 0,on.prototype.cause=void 0,on.prototype.fatal=void 0,on.prototype.place=void 0,on.prototype.ruleId=void 0,on.prototype.source=void 0;const Jl={}.hasOwnProperty,$0=new Map,M0=/[A-Z]/g,L0=/-([a-z])/g,D0=new Set(["table","tbody","thead","tfoot","tr"]),N0=new Set(["td","th"]),_f="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function j0(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=H0(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=W0(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Hl:m0,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=kf(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function kf(e,t,n){if(t.type==="element")return U0(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return F0(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return V0(e,t,n);if(t.type==="mdxjsEsm")return B0(e,t);if(t.type==="root")return z0(e,t,n);if(t.type==="text")return Z0(e,t)}function U0(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Hl,e.schema=i),e.ancestors.push(t);const s=Ef(e,t.tagName,!1),o=q0(e,t);let a=Yl(e,t);return D0.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!i0(l):!0})),Cf(e,o,s,t),Gl(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function F0(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Cs(e,t.position)}function B0(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Cs(e,t.position)}function V0(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Hl,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Ef(e,t.name,!0),o=K0(e,t),a=Yl(e,t);return Cf(e,o,s,t),Gl(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function z0(e,t,n){const r={};return Gl(r,Yl(e,t)),e.create(t,e.Fragment,r,n)}function Z0(e,t){return t.value}function Cf(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Gl(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function W0(e,t,n){return r;function r(i,s,o,a){const c=Array.isArray(o.children)?n:t;return a?c(s,o,a):c(s,o)}}function H0(e,t){return n;function n(r,i,s,o){const a=Array.isArray(s.children),l=ql(r);return t(i,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function q0(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Jl.call(t.properties,i)){const s=J0(e,i,t.properties[i]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&N0.has(t.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function K0(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Cs(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,s=e.evaluater.evaluateExpression(a.expression)}else Cs(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function Yl(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:$0;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const c=i.get(l)||0;o=l+"-"+c,i.set(l,c+1)}}const a=kf(e,s,o);a!==void 0&&n.push(a)}return n}function J0(e,t,n){const r=d0(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Xw(n):g0(n)),r.property==="style"){let i=typeof n=="object"?n:G0(e,String(n));return e.stylePropertyNameCase==="css"&&(i=Y0(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?p0[r.property]||r.property:r.attribute,n]}}function G0(e,t){const n={};try{A0(t,r)}catch(i){if(!e.ignoreInvalidStyle){const s=i,o=new on("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=_f+"#cannot-parse-style-attribute",o}}return n;function r(i,s){let o=i;o.slice(0,2)!=="--"&&(o.slice(0,4)==="-ms-"&&(o="ms-"+o.slice(4)),o=o.replace(L0,X0)),n[o]=s}}function Ef(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const a=Xd(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=o}else r=Xd(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Jl.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Cs(e)}function Cs(e,t){const n=new on("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=_f+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Y0(e){const t={};let n;for(n in e)Jl.call(e,n)&&(t[Q0(n)]=e[n]);return t}function Q0(e){let t=e.replace(M0,ex);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function X0(e,t){return t.toUpperCase()}function ex(e){return"-"+e.toLowerCase()}const Ql={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},tx={};function Xl(e,t){const n=t||tx,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Sf(e,r,i)}function Sf(e,t,n){if(nx(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Tf(e.children,t,n)}return Array.isArray(e)?Tf(e,t,n):""}function Tf(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Sf(e[i],t,n);return r.join("")}function nx(e){return!!(e&&typeof e=="object")}const Of=document.createElement("i");function ec(e){const t="&"+e+";";Of.innerHTML=t;const n=Of.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Cn(e,t,n,r){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function Rn(e,t){return e.length>0?(Cn(e,e.length,0,t),e):t}const If={}.hasOwnProperty;function Pf(e){const t={};let n=-1;for(;++n<e.length;)rx(t,e[n]);return t}function rx(e,t){let n;for(n in t){const i=(If.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){If.call(i,o)||(i[o]=[]);const a=s[o];ix(i[o],Array.isArray(a)?a:a?[a]:[])}}}function ix(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Cn(e,0,0,r)}function Af(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Fn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const hn=Lr(/[A-Za-z]/),an=Lr(/[\dA-Za-z]/),sx=Lr(/[#-'*+\--9=?A-Z^-~]/);function Co(e){return e!==null&&(e<32||e===127)}const tc=Lr(/\d/),ox=Lr(/[\dA-Fa-f]/),ax=Lr(/[!-/:-@[-`{-~]/);function ze(e){return e!==null&&e<-2}function vt(e){return e!==null&&(e<0||e===32)}function st(e){return e===-2||e===-1||e===32}const Eo=Lr(/\p{P}|\p{S}/u),di=Lr(/\s/);function Lr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Li(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&an(e.charCodeAt(n+1))&&an(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ct(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(l){return st(l)?(e.enter(n),a(l)):t(l)}function a(l){return st(l)&&s++<i?(e.consume(l),a):(e.exit(n),t(l))}}const lx={tokenize:cx};function cx(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),ct(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),s(a)}function s(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ze(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),o)}}const ux={tokenize:dx},Rf={tokenize:fx};function dx(e){const t=this,n=[];let r=0,i,s,o;return a;function a(x){if(r<n.length){const I=n[r];return t.containerState=I[1],e.attempt(I[0].continuation,l,c)(x)}return c(x)}function l(x){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&b();const I=t.events.length;let P=I,T;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){T=t.events[P][1].end;break}v(r);let j=I;for(;j<t.events.length;)t.events[j][1].end=Object.assign({},T),j++;return Cn(t.events,P+1,0,t.events.slice(I)),t.events.length=j,c(x)}return a(x)}function c(x){if(r===n.length){if(!i)return h(x);if(i.currentConstruct&&i.currentConstruct.concrete)return p(x);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Rf,u,d)(x)}function u(x){return i&&b(),v(r),h(x)}function d(x){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,p(x)}function h(x){return t.containerState={},e.attempt(Rf,f,p)(x)}function f(x){return r++,n.push([t.currentConstruct,t.containerState]),h(x)}function p(x){if(x===null){i&&b(),v(0),e.consume(x);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{contentType:"flow",previous:s,_tokenizer:i}),m(x)}function m(x){if(x===null){y(e.exit("chunkFlow"),!0),v(0),e.consume(x);return}return ze(x)?(e.consume(x),y(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(x),m)}function y(x,I){const P=t.sliceStream(x);if(I&&P.push(null),x.previous=s,s&&(s.next=x),s=x,i.defineSkip(x.start),i.write(P),t.parser.lazy[x.start.line]){let T=i.events.length;for(;T--;)if(i.events[T][1].start.offset<o&&(!i.events[T][1].end||i.events[T][1].end.offset>o))return;const j=t.events.length;let U=j,F,O;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if(F){O=t.events[U][1].end;break}F=!0}for(v(r),T=j;T<t.events.length;)t.events[T][1].end=Object.assign({},O),T++;Cn(t.events,U+1,0,t.events.slice(j)),t.events.length=T}}function v(x){let I=n.length;for(;I-- >x;){const P=n[I];t.containerState=P[1],P[0].exit.call(t,e)}n.length=x}function b(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function fx(e,t,n){return ct(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function So(e){if(e===null||vt(e)||di(e))return 1;if(Eo(e))return 2}function To(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const nc={name:"attention",tokenize:px,resolveAll:hx};function hx(e,t){let n=-1,r,i,s,o,a,l,c,u;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d=Object.assign({},e[r][1].end),h=Object.assign({},e[n][1].start);$f(d,-l),$f(h,l),o={type:l>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},e[r][1].end)},a={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:h},s={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},a.end)},e[r][1].end=Object.assign({},o.start),e[n][1].start=Object.assign({},a.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Rn(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=Rn(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),c=Rn(c,To(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=Rn(c,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,c=Rn(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):u=0,Cn(e,r-1,n-r+3,c),n=r+c.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function px(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=So(r);let s;return o;function o(l){return s=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===s)return e.consume(l),a;const c=e.exit("attentionSequence"),u=So(l),d=!u||u===2&&i||n.includes(l),h=!i||i===2&&u||n.includes(r);return c._open=!!(s===42?d:d&&(i||!h)),c._close=!!(s===42?h:h&&(u||!d)),t(l)}}function $f(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const mx={name:"autolink",tokenize:gx};function gx(e,t,n){let r=0;return i;function i(f){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(f){return hn(f)?(e.consume(f),o):c(f)}function o(f){return f===43||f===45||f===46||an(f)?(r=1,a(f)):c(f)}function a(f){return f===58?(e.consume(f),r=0,l):(f===43||f===45||f===46||an(f))&&r++<32?(e.consume(f),a):(r=0,c(f))}function l(f){return f===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):f===null||f===32||f===60||Co(f)?n(f):(e.consume(f),l)}function c(f){return f===64?(e.consume(f),u):sx(f)?(e.consume(f),c):n(f)}function u(f){return an(f)?d(f):n(f)}function d(f){return f===46?(e.consume(f),r=0,u):f===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(f),e.exit("autolinkMarker"),e.exit("autolink"),t):h(f)}function h(f){if((f===45||an(f))&&r++<63){const p=f===45?h:d;return e.consume(f),p}return n(f)}}const Es={tokenize:yx,partial:!0};function yx(e,t,n){return r;function r(s){return st(s)?ct(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||ze(s)?t(s):n(s)}}const Mf={name:"blockQuote",tokenize:vx,continuation:{tokenize:bx},exit:wx};function vx(e,t,n){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return st(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function bx(e,t,n){const r=this;return i;function i(o){return st(o)?ct(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(Mf,t,n)(o)}}function wx(e){e.exit("blockQuote")}const Lf={name:"characterEscape",tokenize:xx};function xx(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return ax(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const Df={name:"characterReference",tokenize:_x};function _x(e,t,n){const r=this;let i=0,s,o;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),s=31,o=an,u(d))}function c(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=ox,u):(e.enter("characterReferenceValue"),s=7,o=tc,u(d))}function u(d){if(d===59&&i){const h=e.exit("characterReferenceValue");return o===an&&!ec(r.sliceSerialize(h))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&i++<s?(e.consume(d),u):n(d)}}const Nf={tokenize:Cx,partial:!0},jf={name:"codeFenced",tokenize:kx,concrete:!0};function kx(e,t,n){const r=this,i={tokenize:P,partial:!0};let s=0,o=0,a;return l;function l(T){return c(T)}function c(T){const j=r.events[r.events.length-1];return s=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,a=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),u(T)}function u(T){return T===a?(o++,e.consume(T),u):o<3?n(T):(e.exit("codeFencedFenceSequence"),st(T)?ct(e,d,"whitespace")(T):d(T))}function d(T){return T===null||ze(T)?(e.exit("codeFencedFence"),r.interrupt?t(T):e.check(Nf,m,I)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(T))}function h(T){return T===null||ze(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(T)):st(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ct(e,f,"whitespace")(T)):T===96&&T===a?n(T):(e.consume(T),h)}function f(T){return T===null||ze(T)?d(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),p(T))}function p(T){return T===null||ze(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(T)):T===96&&T===a?n(T):(e.consume(T),p)}function m(T){return e.attempt(i,I,y)(T)}function y(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),v}function v(T){return s>0&&st(T)?ct(e,b,"linePrefix",s+1)(T):b(T)}function b(T){return T===null||ze(T)?e.check(Nf,m,I)(T):(e.enter("codeFlowValue"),x(T))}function x(T){return T===null||ze(T)?(e.exit("codeFlowValue"),b(T)):(e.consume(T),x)}function I(T){return e.exit("codeFenced"),t(T)}function P(T,j,U){let F=0;return O;function O(B){return T.enter("lineEnding"),T.consume(B),T.exit("lineEnding"),N}function N(B){return T.enter("codeFencedFence"),st(B)?ct(T,J,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):J(B)}function J(B){return B===a?(T.enter("codeFencedFenceSequence"),q(B)):U(B)}function q(B){return B===a?(F++,T.consume(B),q):F>=o?(T.exit("codeFencedFenceSequence"),st(B)?ct(T,W,"whitespace")(B):W(B)):U(B)}function W(B){return B===null||ze(B)?(T.exit("codeFencedFence"),j(B)):U(B)}}}function Cx(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const rc={name:"codeIndented",tokenize:Sx},Ex={tokenize:Tx,partial:!0};function Sx(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),ct(e,s,"linePrefix",4+1)(c)}function s(c){const u=r.events[r.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?l(c):ze(c)?e.attempt(Ex,o,l)(c):(e.enter("codeFlowValue"),a(c))}function a(c){return c===null||ze(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),a)}function l(c){return e.exit("codeIndented"),t(c)}}function Tx(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):ze(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):ct(e,s,"linePrefix",4+1)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):ze(o)?i(o):n(o)}}const Ox={name:"codeText",tokenize:Ax,resolve:Ix,previous:Px};function Ix(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Px(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Ax(e,t,n){let r=0,i,s;return o;function o(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(s=e.enter("codeTextSequence"),i=0,u(d)):ze(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(d))}function c(d){return d===null||d===32||d===96||ze(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),c)}function u(d){return d===96?(e.consume(d),i++,u):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(s.type="codeTextData",c(d))}}function Uf(e){const t={};let n=-1,r,i,s,o,a,l,c;for(;++n<e.length;){for(;n in t;)n=t[n];if(r=e[n],n&&r[1].type==="chunkFlow"&&e[n-1][1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Rx(e,n)),n=t[n],c=!0);else if(r[1]._container){for(s=n,i=void 0;s--&&(o=e[s],o[1].type==="lineEnding"||o[1].type==="lineEndingBlank");)o[0]==="enter"&&(i&&(e[i][1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);i&&(r[1].end=Object.assign({},e[i][1].start),a=e.slice(i,n),a.unshift(r),Cn(e,i,n-i+1,a))}}return!c}function Rx(e,t){const n=e[t][1],r=e[t][2];let i=t-1;const s=[],o=n._tokenizer||r.parser[n.contentType](n.start),a=o.events,l=[],c={};let u,d,h=-1,f=n,p=0,m=0;const y=[m];for(;f;){for(;e[++i][1]!==f;);s.push(i),f._tokenizer||(u=r.sliceStream(f),f.next||u.push(null),d&&o.defineSkip(f.start),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),f._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=f,f=f.next}for(f=n;++h<a.length;)a[h][0]==="exit"&&a[h-1][0]==="enter"&&a[h][1].type===a[h-1][1].type&&a[h][1].start.line!==a[h][1].end.line&&(m=h+1,y.push(m),f._tokenizer=void 0,f.previous=void 0,f=f.next);for(o.events=[],f?(f._tokenizer=void 0,f.previous=void 0):y.pop(),h=y.length;h--;){const v=a.slice(y[h],y[h+1]),b=s.pop();l.unshift([b,b+v.length-1]),Cn(e,b,2,v)}for(h=-1;++h<l.length;)c[p+l[h][0]]=p+l[h][1],p+=l[h][1]-l[h][0]-1;return c}const $x={tokenize:Dx,resolve:Lx},Mx={tokenize:Nx,partial:!0};function Lx(e){return Uf(e),e}function Dx(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):ze(a)?e.check(Mx,o,s)(a):(e.consume(a),i)}function s(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Nx(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),ct(e,s,"linePrefix")}function s(o){if(o===null||ze(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function Ff(e,t,n,r,i,s,o,a,l){const c=l||Number.POSITIVE_INFINITY;let u=0;return d;function d(v){return v===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(v),e.exit(s),h):v===null||v===32||v===41||Co(v)?n(v):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),m(v))}function h(v){return v===62?(e.enter(s),e.consume(v),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),f(v))}function f(v){return v===62?(e.exit("chunkString"),e.exit(a),h(v)):v===null||v===60||ze(v)?n(v):(e.consume(v),v===92?p:f)}function p(v){return v===60||v===62||v===92?(e.consume(v),f):f(v)}function m(v){return!u&&(v===null||v===41||vt(v))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(v)):u<c&&v===40?(e.consume(v),u++,m):v===41?(e.consume(v),u--,m):v===null||v===32||v===40||Co(v)?n(v):(e.consume(v),v===92?y:m)}function y(v){return v===40||v===41||v===92?(e.consume(v),m):m(v)}}function Bf(e,t,n,r,i,s){const o=this;let a=0,l;return c;function c(f){return e.enter(r),e.enter(i),e.consume(f),e.exit(i),e.enter(s),u}function u(f){return a>999||f===null||f===91||f===93&&!l||f===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(f):f===93?(e.exit(s),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):ze(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),u):(e.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===null||f===91||f===93||ze(f)||a++>999?(e.exit("chunkString"),u(f)):(e.consume(f),l||(l=!st(f)),f===92?h:d)}function h(f){return f===91||f===92||f===93?(e.consume(f),a++,d):d(f)}}function Vf(e,t,n,r,i,s){let o;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),o=h===40?41:h,l):n(h)}function l(h){return h===o?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(s),c(h))}function c(h){return h===o?(e.exit(s),l(o)):h===null?n(h):ze(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ct(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),u(h))}function u(h){return h===o||h===null||ze(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?d:u)}function d(h){return h===o||h===92?(e.consume(h),u):u(h)}}function Ss(e,t){let n;return r;function r(i){return ze(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):st(i)?ct(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const jx={name:"definition",tokenize:Fx},Ux={tokenize:Bx,partial:!0};function Fx(e,t,n){const r=this;let i;return s;function s(f){return e.enter("definition"),o(f)}function o(f){return Bf.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function a(f){return i=Fn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),l):n(f)}function l(f){return vt(f)?Ss(e,c)(f):c(f)}function c(f){return Ff(e,u,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function u(f){return e.attempt(Ux,d,d)(f)}function d(f){return st(f)?ct(e,h,"whitespace")(f):h(f)}function h(f){return f===null||ze(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function Bx(e,t,n){return r;function r(a){return vt(a)?Ss(e,i)(a):n(a)}function i(a){return Vf(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return st(a)?ct(e,o,"whitespace")(a):o(a)}function o(a){return a===null||ze(a)?t(a):n(a)}}const Vx={name:"hardBreakEscape",tokenize:zx};function zx(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return ze(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const Zx={name:"headingAtx",tokenize:Hx,resolve:Wx};function Wx(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Cn(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function Hx(e,t,n){let r=0;return i;function i(u){return e.enter("atxHeading"),s(u)}function s(u){return e.enter("atxHeadingSequence"),o(u)}function o(u){return u===35&&r++<6?(e.consume(u),o):u===null||vt(u)?(e.exit("atxHeadingSequence"),a(u)):n(u)}function a(u){return u===35?(e.enter("atxHeadingSequence"),l(u)):u===null||ze(u)?(e.exit("atxHeading"),t(u)):st(u)?ct(e,a,"whitespace")(u):(e.enter("atxHeadingText"),c(u))}function l(u){return u===35?(e.consume(u),l):(e.exit("atxHeadingSequence"),a(u))}function c(u){return u===null||u===35||vt(u)?(e.exit("atxHeadingText"),a(u)):(e.consume(u),c)}}const qx=["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"],zf=["pre","script","style","textarea"],Kx={name:"htmlFlow",tokenize:Qx,resolveTo:Yx,concrete:!0},Jx={tokenize:e_,partial:!0},Gx={tokenize:Xx,partial:!0};function Yx(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Qx(e,t,n){const r=this;let i,s,o,a,l;return c;function c(S){return u(S)}function u(S){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(S),d}function d(S){return S===33?(e.consume(S),h):S===47?(e.consume(S),s=!0,m):S===63?(e.consume(S),i=3,r.interrupt?t:k):hn(S)?(e.consume(S),o=String.fromCharCode(S),y):n(S)}function h(S){return S===45?(e.consume(S),i=2,f):S===91?(e.consume(S),i=5,a=0,p):hn(S)?(e.consume(S),i=4,r.interrupt?t:k):n(S)}function f(S){return S===45?(e.consume(S),r.interrupt?t:k):n(S)}function p(S){const Te="CDATA[";return S===Te.charCodeAt(a++)?(e.consume(S),a===Te.length?r.interrupt?t:J:p):n(S)}function m(S){return hn(S)?(e.consume(S),o=String.fromCharCode(S),y):n(S)}function y(S){if(S===null||S===47||S===62||vt(S)){const Te=S===47,Ne=o.toLowerCase();return!Te&&!s&&zf.includes(Ne)?(i=1,r.interrupt?t(S):J(S)):qx.includes(o.toLowerCase())?(i=6,Te?(e.consume(S),v):r.interrupt?t(S):J(S)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(S):s?b(S):x(S))}return S===45||an(S)?(e.consume(S),o+=String.fromCharCode(S),y):n(S)}function v(S){return S===62?(e.consume(S),r.interrupt?t:J):n(S)}function b(S){return st(S)?(e.consume(S),b):O(S)}function x(S){return S===47?(e.consume(S),O):S===58||S===95||hn(S)?(e.consume(S),I):st(S)?(e.consume(S),x):O(S)}function I(S){return S===45||S===46||S===58||S===95||an(S)?(e.consume(S),I):P(S)}function P(S){return S===61?(e.consume(S),T):st(S)?(e.consume(S),P):x(S)}function T(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),l=S,j):st(S)?(e.consume(S),T):U(S)}function j(S){return S===l?(e.consume(S),l=null,F):S===null||ze(S)?n(S):(e.consume(S),j)}function U(S){return S===null||S===34||S===39||S===47||S===60||S===61||S===62||S===96||vt(S)?P(S):(e.consume(S),U)}function F(S){return S===47||S===62||st(S)?x(S):n(S)}function O(S){return S===62?(e.consume(S),N):n(S)}function N(S){return S===null||ze(S)?J(S):st(S)?(e.consume(S),N):n(S)}function J(S){return S===45&&i===2?(e.consume(S),V):S===60&&i===1?(e.consume(S),Y):S===62&&i===4?(e.consume(S),ee):S===63&&i===3?(e.consume(S),k):S===93&&i===5?(e.consume(S),pe):ze(S)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Jx,xe,q)(S)):S===null||ze(S)?(e.exit("htmlFlowData"),q(S)):(e.consume(S),J)}function q(S){return e.check(Gx,W,xe)(S)}function W(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),B}function B(S){return S===null||ze(S)?q(S):(e.enter("htmlFlowData"),J(S))}function V(S){return S===45?(e.consume(S),k):J(S)}function Y(S){return S===47?(e.consume(S),o="",K):J(S)}function K(S){if(S===62){const Te=o.toLowerCase();return zf.includes(Te)?(e.consume(S),ee):J(S)}return hn(S)&&o.length<8?(e.consume(S),o+=String.fromCharCode(S),K):J(S)}function pe(S){return S===93?(e.consume(S),k):J(S)}function k(S){return S===62?(e.consume(S),ee):S===45&&i===2?(e.consume(S),k):J(S)}function ee(S){return S===null||ze(S)?(e.exit("htmlFlowData"),xe(S)):(e.consume(S),ee)}function xe(S){return e.exit("htmlFlow"),t(S)}}function Xx(e,t,n){const r=this;return i;function i(o){return ze(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function e_(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Es,t,n)}}const t_={name:"htmlText",tokenize:n_};function n_(e,t,n){const r=this;let i,s,o;return a;function a(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),l}function l(k){return k===33?(e.consume(k),c):k===47?(e.consume(k),P):k===63?(e.consume(k),x):hn(k)?(e.consume(k),U):n(k)}function c(k){return k===45?(e.consume(k),u):k===91?(e.consume(k),s=0,p):hn(k)?(e.consume(k),b):n(k)}function u(k){return k===45?(e.consume(k),f):n(k)}function d(k){return k===null?n(k):k===45?(e.consume(k),h):ze(k)?(o=d,Y(k)):(e.consume(k),d)}function h(k){return k===45?(e.consume(k),f):d(k)}function f(k){return k===62?V(k):k===45?h(k):d(k)}function p(k){const ee="CDATA[";return k===ee.charCodeAt(s++)?(e.consume(k),s===ee.length?m:p):n(k)}function m(k){return k===null?n(k):k===93?(e.consume(k),y):ze(k)?(o=m,Y(k)):(e.consume(k),m)}function y(k){return k===93?(e.consume(k),v):m(k)}function v(k){return k===62?V(k):k===93?(e.consume(k),v):m(k)}function b(k){return k===null||k===62?V(k):ze(k)?(o=b,Y(k)):(e.consume(k),b)}function x(k){return k===null?n(k):k===63?(e.consume(k),I):ze(k)?(o=x,Y(k)):(e.consume(k),x)}function I(k){return k===62?V(k):x(k)}function P(k){return hn(k)?(e.consume(k),T):n(k)}function T(k){return k===45||an(k)?(e.consume(k),T):j(k)}function j(k){return ze(k)?(o=j,Y(k)):st(k)?(e.consume(k),j):V(k)}function U(k){return k===45||an(k)?(e.consume(k),U):k===47||k===62||vt(k)?F(k):n(k)}function F(k){return k===47?(e.consume(k),V):k===58||k===95||hn(k)?(e.consume(k),O):ze(k)?(o=F,Y(k)):st(k)?(e.consume(k),F):V(k)}function O(k){return k===45||k===46||k===58||k===95||an(k)?(e.consume(k),O):N(k)}function N(k){return k===61?(e.consume(k),J):ze(k)?(o=N,Y(k)):st(k)?(e.consume(k),N):F(k)}function J(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,q):ze(k)?(o=J,Y(k)):st(k)?(e.consume(k),J):(e.consume(k),W)}function q(k){return k===i?(e.consume(k),i=void 0,B):k===null?n(k):ze(k)?(o=q,Y(k)):(e.consume(k),q)}function W(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||vt(k)?F(k):(e.consume(k),W)}function B(k){return k===47||k===62||vt(k)?F(k):n(k)}function V(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function Y(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),K}function K(k){return st(k)?ct(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):pe(k)}function pe(k){return e.enter("htmlTextData"),o(k)}}const ic={name:"labelEnd",tokenize:l_,resolveTo:a_,resolveAll:o_},r_={tokenize:c_},i_={tokenize:u_},s_={tokenize:d_};function o_(e){let t=-1;for(;++t<e.length;){const n=e[t][1];(n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd")&&(e.splice(t+1,n.type==="labelImage"?4:2),n.type="data",t++)}return e}function a_(e,t){let n=e.length,r=0,i,s,o,a;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:Object.assign({},e[s][1].start),end:Object.assign({},e[e.length-1][1].end)},c={type:"label",start:Object.assign({},e[s][1].start),end:Object.assign({},e[o][1].end)},u={type:"labelText",start:Object.assign({},e[s+r+2][1].end),end:Object.assign({},e[o-2][1].start)};return a=[["enter",l,t],["enter",c,t]],a=Rn(a,e.slice(s+1,s+r+3)),a=Rn(a,[["enter",u,t]]),a=Rn(a,To(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),a=Rn(a,[["exit",u,t],e[o-2],e[o-1],["exit",c,t]]),a=Rn(a,e.slice(o+1)),a=Rn(a,[["exit",l,t]]),Cn(e,s,e.length,a),e}function l_(e,t,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return a;function a(h){return s?s._inactive?d(h):(o=r.parser.defined.includes(Fn(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):n(h)}function l(h){return h===40?e.attempt(r_,u,o?u:d)(h):h===91?e.attempt(i_,u,o?c:d)(h):o?u(h):d(h)}function c(h){return e.attempt(s_,u,d)(h)}function u(h){return t(h)}function d(h){return s._balanced=!0,n(h)}}function c_(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return vt(d)?Ss(e,s)(d):s(d)}function s(d){return d===41?u(d):Ff(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return vt(d)?Ss(e,l)(d):u(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?Vf(e,c,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):u(d)}function c(d){return vt(d)?Ss(e,u)(d):u(d)}function u(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function u_(e,t,n){const r=this;return i;function i(a){return Bf.call(r,e,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(Fn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function d_(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const f_={name:"labelStartImage",tokenize:h_,resolveAll:ic.resolveAll};function h_(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),s}function s(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const p_={name:"labelStartLink",tokenize:m_,resolveAll:ic.resolveAll};function m_(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const sc={name:"lineEnding",tokenize:g_};function g_(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ct(e,t,"linePrefix")}}const Oo={name:"thematicBreak",tokenize:y_};function y_(e,t,n){let r=0,i;return s;function s(c){return e.enter("thematicBreak"),o(c)}function o(c){return i=c,a(c)}function a(c){return c===i?(e.enter("thematicBreakSequence"),l(c)):r>=3&&(c===null||ze(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),st(c)?ct(e,a,"whitespace")(c):a(c))}}const yn={name:"list",tokenize:w_,continuation:{tokenize:x_},exit:k_},v_={tokenize:C_,partial:!0},b_={tokenize:__,partial:!0};function w_(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(f){const p=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(p==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:tc(f)){if(r.containerState.type||(r.containerState.type=p,e.enter(p,{_container:!0})),p==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Oo,n,c)(f):c(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(f)}return n(f)}function l(f){return tc(f)&&++o<10?(e.consume(f),l):(!r.interrupt||o<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(Es,r.interrupt?n:u,e.attempt(v_,h,d))}function u(f){return r.containerState.initialBlankLine=!0,s++,h(f)}function d(f){return st(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),h):n(f)}function h(f){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function x_(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Es,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ct(e,t,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!st(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(b_,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,ct(e,e.attempt(yn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function __(e,t,n){const r=this;return ct(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function k_(e){e.exit(this.containerState.type)}function C_(e,t,n){const r=this;return ct(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function i(s){const o=r.events[r.events.length-1];return!st(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Zf={name:"setextUnderline",tokenize:S_,resolveTo:E_};function E_(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[s][1].end)):e[r][1]=o,e.push(["exit",o,t]),e}function S_(e,t,n){const r=this;let i;return s;function s(c){let u=r.events.length,d;for(;u--;)if(r.events[u][1].type!=="lineEnding"&&r.events[u][1].type!=="linePrefix"&&r.events[u][1].type!=="content"){d=r.events[u][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),a(c)}function a(c){return c===i?(e.consume(c),a):(e.exit("setextHeadingLineSequence"),st(c)?ct(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ze(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const T_={tokenize:O_};function O_(e){const t=this,n=e.attempt(Es,r,e.attempt(this.parser.constructs.flowInitial,i,ct(e,e.attempt(this.parser.constructs.flow,i,e.attempt($x,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const I_={resolveAll:Hf()},P_=Wf("string"),A_=Wf("text");function Wf(e){return{tokenize:t,resolveAll:Hf(e==="text"?R_:void 0)};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,a);return o;function o(u){return c(u)?s(u):a(u)}function a(u){if(u===null){n.consume(u);return}return n.enter("data"),n.consume(u),l}function l(u){return c(u)?(n.exit("data"),s(u)):(n.consume(u),l)}function c(u){if(u===null)return!0;const d=i[u];let h=-1;if(d)for(;++h<d.length;){const f=d[h];if(!f.previous||f.previous.call(r,r.previous))return!0}return!1}}}function Hf(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function R_(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,o=-1,a=0,l;for(;s--;){const c=i[s];if(typeof c=="string"){for(o=c.length;c.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(c===-2)l=!0,a++;else if(c!==-1){s++;break}}if(a){const c={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{line:r.end.line,column:r.end.column-a,offset:r.end.offset-a,_index:r.start._index+s,_bufferIndex:s?o:r.start._bufferIndex+o},end:Object.assign({},r.end)};r.end=Object.assign({},c.start),r.start.offset===r.end.offset?Object.assign(r,c):(e.splice(n,0,["enter",c,t],["exit",c,t]),n+=2)}n++}return e}function $_(e,t,n){let r=Object.assign(n?Object.assign({},n):{line:1,column:1,offset:0},{_index:0,_bufferIndex:-1});const i={},s=[];let o=[],a=[];const l={consume:b,enter:x,exit:I,attempt:j(P),check:j(T),interrupt:j(T,{interrupt:!0})},c={previous:null,code:null,containerState:{},events:[],parser:e,sliceStream:f,sliceSerialize:h,now:p,defineSkip:m,write:d};let u=t.tokenize.call(c,l);return t.resolveAll&&s.push(t),c;function d(N){return o=Rn(o,N),y(),o[o.length-1]!==null?[]:(U(t,0),c.events=To(s,c.events,c),c.events)}function h(N,J){return L_(f(N),J)}function f(N){return M_(o,N)}function p(){const{line:N,column:J,offset:q,_index:W,_bufferIndex:B}=r;return{line:N,column:J,offset:q,_index:W,_bufferIndex:B}}function m(N){i[N.line]=N.column,O()}function y(){let N;for(;r._index<o.length;){const J=o[r._index];if(typeof J=="string")for(N=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===N&&r._bufferIndex<J.length;)v(J.charCodeAt(r._bufferIndex));else v(J)}}function v(N){u=u(N)}function b(N){ze(N)?(r.line++,r.column=1,r.offset+=N===-3?2:1,O()):N!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),c.previous=N}function x(N,J){const q=J||{};return q.type=N,q.start=p(),c.events.push(["enter",q,c]),a.push(q),q}function I(N){const J=a.pop();return J.end=p(),c.events.push(["exit",J,c]),J}function P(N,J){U(N,J.from)}function T(N,J){J.restore()}function j(N,J){return q;function q(W,B,V){let Y,K,pe,k;return Array.isArray(W)?xe(W):"tokenize"in W?xe([W]):ee(W);function ee(Ie){return je;function je(De){const Ue=De!==null&&Ie[De],_e=De!==null&&Ie.null,ve=[...Array.isArray(Ue)?Ue:Ue?[Ue]:[],...Array.isArray(_e)?_e:_e?[_e]:[]];return xe(ve)(De)}}function xe(Ie){return Y=Ie,K=0,Ie.length===0?V:S(Ie[K])}function S(Ie){return je;function je(De){return k=F(),pe=Ie,Ie.partial||(c.currentConstruct=Ie),Ie.name&&c.parser.constructs.disable.null.includes(Ie.name)?Ne():Ie.tokenize.call(J?Object.assign(Object.create(c),J):c,l,Te,Ne)(De)}}function Te(Ie){return N(pe,k),B}function Ne(Ie){return k.restore(),++K<Y.length?S(Y[K]):V}}}function U(N,J){N.resolveAll&&!s.includes(N)&&s.push(N),N.resolve&&Cn(c.events,J,c.events.length-J,N.resolve(c.events.slice(J),c)),N.resolveTo&&(c.events=N.resolveTo(c.events,c))}function F(){const N=p(),J=c.previous,q=c.currentConstruct,W=c.events.length,B=Array.from(a);return{restore:V,from:W};function V(){r=N,c.previous=J,c.currentConstruct=q,c.events.length=W,a=B,O()}}function O(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function M_(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function L_(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
|
|
29
29
|
`;break}case-3:{o=`\r
|
|
30
|
-
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}const jx=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:F0},disable:{null:[]},document:{42:pn,43:pn,45:pn,48:pn,49:pn,50:pn,51:pn,52:pn,53:pn,54:pn,55:pn,56:pn,57:pn,62:xf},flow:{35:H0,42:vo,45:[Af,vo],60:G0,61:Af,95:vo,96:Ef,126:Ef},flowInitial:{[-2]:Hl,[-1]:Hl,32:Hl},insideSpan:{null:[Wl,Ax]},string:{38:kf,92:_f},text:{[-5]:Kl,[-4]:Kl,[-3]:Kl,33:px,38:kf,42:Wl,60:[y0,rx],91:gx,92:[Z0,_f],93:ql,95:Wl,96:P0}},Symbol.toStringTag,{value:"Module"}));function Ux(e){const n=yf([jx,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(u0),document:i(f0),flow:i(Ix),string:i(Rx),text:i($x)};return r;function i(s){return o;function o(a){return Lx(r,s,a)}}}function Fx(e){for(;!Sf(e););return e}const Mf=/[\0\t\n\r]/g;function Bx(){let e=1,t="",n=!0,r;return i;function i(s,o,a){const l=[];let c,u,d,h,f;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),d=0,t="",n&&(s.charCodeAt(0)===65279&&d++,n=void 0);d<s.length;){if(Mf.lastIndex=d,c=Mf.exec(s),h=c&&c.index!==void 0?c.index:s.length,f=s.charCodeAt(h),!c){t=s.slice(d);break}if(f===10&&d===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<h&&(l.push(s.slice(d,h)),e+=h-d),f){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const Vx=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function zx(e){return e.replace(Vx,Zx)}function Zx(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return vf(n.slice(s?2:1),s?16:10)}return zl(n)||e}const Lf={}.hasOwnProperty;function Wx(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Hx(n)(Fx(Ux(n).document().write(Bx()(e,t,!0))))}function Hx(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(me),autolinkProtocol:B,autolinkEmail:B,atxHeading:s(Re),blockQuote:s(Ue),characterEscape:B,characterReference:B,codeFenced:s(_e),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(_e,o),codeText:s(ve,o),codeTextData:B,data:B,codeFlowValue:B,definition:s(ke),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(Ce),hardBreakEscape:s(qe),hardBreakTrailing:s(qe),htmlFlow:s(N,o),htmlFlowData:B,htmlText:s(N,o),htmlTextData:B,image:s(ne),label:o,link:s(me),listItem:s(Le),listItemValue:h,listOrdered:s(he,d),listUnordered:s(he),paragraph:s(Pe),reference:S,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(Re),strong:s(Be),thematicBreak:s(Ze)},exit:{atxHeading:l(),atxHeadingSequence:A,autolink:l(),autolinkEmail:De,autolinkProtocol:je,blockQuote:l(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:Ne,characterReferenceMarkerNumeric:Ne,characterReferenceValue:Ie,codeFenced:l(y),codeFencedFence:m,codeFencedFenceInfo:f,codeFencedFenceMeta:p,codeFlowValue:I,codeIndented:l(v),codeText:l(V),codeTextData:I,data:I,definition:l(),definitionDestinationString:P,definitionLabelString:b,definitionTitleString:x,emphasis:l(),hardBreakEscape:l(J),hardBreakTrailing:l(J),htmlFlow:l(q),htmlFlowData:I,htmlText:l(H),htmlTextData:I,image:l(Y),label:pe,labelText:K,lineEnding:j,link:l(z),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Te,resourceDestinationString:k,resourceTitleString:ee,resource:xe,setextHeading:l(F),setextHeadingLineSequence:U,setextHeadingText:O,strong:l(),thematicBreak:l()}};Df(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(W){let Q={type:"root",children:[]};const G={stack:[Q],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:u,data:n},$e=[];let Ge=-1;for(;++Ge<W.length;)if(W[Ge][1].type==="listOrdered"||W[Ge][1].type==="listUnordered")if(W[Ge][0]==="enter")$e.push(Ge);else{const Ct=$e.pop();Ge=i(W,Ct,Ge)}for(Ge=-1;++Ge<W.length;){const Ct=t[W[Ge][0]];Lf.call(Ct,W[Ge][1].type)&&Ct[W[Ge][1].type].call(Object.assign({sliceSerialize:W[Ge][2].sliceSerialize},G),W[Ge][1])}if(G.tokenStack.length>0){const Ct=G.tokenStack[G.tokenStack.length-1];(Ct[1]||Nf).call(G,void 0,Ct[0])}for(Q.position={start:Ar(W.length>0?W[0][1].start:{line:1,column:1,offset:0}),end:Ar(W.length>0?W[W.length-2][1].end:{line:1,column:1,offset:0})},Ge=-1;++Ge<t.transforms.length;)Q=t.transforms[Ge](Q)||Q;return Q}function i(W,Q,G){let $e=Q-1,Ge=-1,Ct=!1,yt,pt,It,cn;for(;++$e<=G;){const Pt=W[$e];switch(Pt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Pt[0]==="enter"?Ge++:Ge--,cn=void 0;break}case"lineEndingBlank":{Pt[0]==="enter"&&(yt&&!cn&&!Ge&&!It&&(It=$e),cn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:cn=void 0}if(!Ge&&Pt[0]==="enter"&&Pt[1].type==="listItemPrefix"||Ge===-1&&Pt[0]==="exit"&&(Pt[1].type==="listUnordered"||Pt[1].type==="listOrdered")){if(yt){let Nt=$e;for(pt=void 0;Nt--;){const Jt=W[Nt];if(Jt[1].type==="lineEnding"||Jt[1].type==="lineEndingBlank"){if(Jt[0]==="exit")continue;pt&&(W[pt][1].type="lineEndingBlank",Ct=!0),Jt[1].type="lineEnding",pt=Nt}else if(!(Jt[1].type==="linePrefix"||Jt[1].type==="blockQuotePrefix"||Jt[1].type==="blockQuotePrefixWhitespace"||Jt[1].type==="blockQuoteMarker"||Jt[1].type==="listItemIndent"))break}It&&(!pt||It<pt)&&(yt._spread=!0),yt.end=Object.assign({},pt?W[pt][1].start:Pt[1].end),W.splice(pt||$e,0,["exit",yt,Pt[2]]),$e++,G++}if(Pt[1].type==="listItemPrefix"){const Nt={type:"listItem",_spread:!1,start:Object.assign({},Pt[1].start),end:void 0};yt=Nt,W.splice($e,0,["enter",Nt,Pt[2]]),$e++,G++,It=void 0,cn=!0}}}return W[Q][1]._spread=Ct,G}function s(W,Q){return G;function G($e){a.call(this,W($e),$e),Q&&Q.call(this,$e)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(W,Q,G){this.stack[this.stack.length-1].children.push(W),this.stack.push(W),this.tokenStack.push([Q,G]),W.position={start:Ar(Q.start),end:void 0}}function l(W){return Q;function Q(G){W&&W.call(this,G),c.call(this,G)}}function c(W,Q){const G=this.stack.pop(),$e=this.tokenStack.pop();if($e)$e[0].type!==W.type&&(Q?Q.call(this,W,$e[0]):($e[1]||Nf).call(this,W,$e[0]));else throw new Error("Cannot close `"+W.type+"` ("+gs({start:W.start,end:W.end})+"): it’s not open");G.position.end=Ar(W.end)}function u(){return Vl(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(W){if(this.data.expectingFirstListItemValue){const Q=this.stack[this.stack.length-2];Q.start=Number.parseInt(this.sliceSerialize(W),10),this.data.expectingFirstListItemValue=void 0}}function f(){const W=this.resume(),Q=this.stack[this.stack.length-1];Q.lang=W}function p(){const W=this.resume(),Q=this.stack[this.stack.length-1];Q.meta=W}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const W=this.resume(),Q=this.stack[this.stack.length-1];Q.value=W.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const W=this.resume(),Q=this.stack[this.stack.length-1];Q.value=W.replace(/(\r?\n|\r)$/g,"")}function b(W){const Q=this.resume(),G=this.stack[this.stack.length-1];G.label=Q,G.identifier=Nn(this.sliceSerialize(W)).toLowerCase()}function x(){const W=this.resume(),Q=this.stack[this.stack.length-1];Q.title=W}function P(){const W=this.resume(),Q=this.stack[this.stack.length-1];Q.url=W}function A(W){const Q=this.stack[this.stack.length-1];if(!Q.depth){const G=this.sliceSerialize(W).length;Q.depth=G}}function O(){this.data.setextHeadingSlurpLineEnding=!0}function U(W){const Q=this.stack[this.stack.length-1];Q.depth=this.sliceSerialize(W).codePointAt(0)===61?1:2}function F(){this.data.setextHeadingSlurpLineEnding=void 0}function B(W){const G=this.stack[this.stack.length-1].children;let $e=G[G.length-1];(!$e||$e.type!=="text")&&($e=it(),$e.position={start:Ar(W.start),end:void 0},G.push($e)),this.stack.push($e)}function I(W){const Q=this.stack.pop();Q.value+=this.sliceSerialize(W),Q.position.end=Ar(W.end)}function j(W){const Q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const G=Q.children[Q.children.length-1];G.position.end=Ar(W.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Q.type)&&(B.call(this,W),I.call(this,W))}function J(){this.data.atHardBreak=!0}function q(){const W=this.resume(),Q=this.stack[this.stack.length-1];Q.value=W}function H(){const W=this.resume(),Q=this.stack[this.stack.length-1];Q.value=W}function V(){const W=this.resume(),Q=this.stack[this.stack.length-1];Q.value=W}function z(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=Q,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function Y(){const W=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";W.type+="Reference",W.referenceType=Q,delete W.url,delete W.title}else delete W.identifier,delete W.label;this.data.referenceType=void 0}function K(W){const Q=this.sliceSerialize(W),G=this.stack[this.stack.length-2];G.label=zx(Q),G.identifier=Nn(Q).toLowerCase()}function pe(){const W=this.stack[this.stack.length-1],Q=this.resume(),G=this.stack[this.stack.length-1];if(this.data.inReference=!0,G.type==="link"){const $e=W.children;G.children=$e}else G.alt=Q}function k(){const W=this.resume(),Q=this.stack[this.stack.length-1];Q.url=W}function ee(){const W=this.resume(),Q=this.stack[this.stack.length-1];Q.title=W}function xe(){this.data.inReference=void 0}function S(){this.data.referenceType="collapsed"}function Te(W){const Q=this.resume(),G=this.stack[this.stack.length-1];G.label=Q,G.identifier=Nn(this.sliceSerialize(W)).toLowerCase(),this.data.referenceType="full"}function Ne(W){this.data.characterReferenceType=W.type}function Ie(W){const Q=this.sliceSerialize(W),G=this.data.characterReferenceType;let $e;G?($e=vf(Q,G==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):$e=zl(Q);const Ge=this.stack.pop();Ge.value+=$e,Ge.position.end=Ar(W.end)}function je(W){I.call(this,W);const Q=this.stack[this.stack.length-1];Q.url=this.sliceSerialize(W)}function De(W){I.call(this,W);const Q=this.stack[this.stack.length-1];Q.url="mailto:"+this.sliceSerialize(W)}function Ue(){return{type:"blockquote",children:[]}}function _e(){return{type:"code",lang:null,meta:null,value:""}}function ve(){return{type:"inlineCode",value:""}}function ke(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ce(){return{type:"emphasis",children:[]}}function Re(){return{type:"heading",depth:0,children:[]}}function qe(){return{type:"break"}}function N(){return{type:"html",value:""}}function ne(){return{type:"image",title:null,url:"",alt:null}}function me(){return{type:"link",title:null,url:"",children:[]}}function he(W){return{type:"list",ordered:W.type==="listOrdered",start:null,spread:W._spread,children:[]}}function Le(W){return{type:"listItem",spread:W._spread,checked:null,children:[]}}function Pe(){return{type:"paragraph",children:[]}}function Be(){return{type:"strong",children:[]}}function it(){return{type:"text",value:""}}function Ze(){return{type:"thematicBreak"}}}function Ar(e){return{line:e.line,column:e.column,offset:e.offset}}function Df(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Df(e,r):qx(e,r)}}function qx(e,t){let n;for(n in t)if(Lf.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Nf(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+gs({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+gs({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+gs({start:t.start,end:t.end})+") is still open")}function Kx(e){const t=this;t.parser=n;function n(r){return Wx(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Jx(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Gx(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
31
|
-
`}]}function
|
|
32
|
-
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function
|
|
30
|
+
`;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}const D_=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:jx},disable:{null:[]},document:{42:yn,43:yn,45:yn,48:yn,49:yn,50:yn,51:yn,52:yn,53:yn,54:yn,55:yn,56:yn,57:yn,62:Mf},flow:{35:Zx,42:Oo,45:[Zf,Oo],60:Kx,61:Zf,95:Oo,96:jf,126:jf},flowInitial:{[-2]:rc,[-1]:rc,32:rc},insideSpan:{null:[nc,I_]},string:{38:Df,92:Lf},text:{[-5]:sc,[-4]:sc,[-3]:sc,33:f_,38:Df,42:nc,60:[mx,t_],91:p_,92:[Vx,Lf],93:ic,95:nc,96:Ox}},Symbol.toStringTag,{value:"Module"}));function N_(e){const n=Pf([D_,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:n,content:i(lx),document:i(ux),flow:i(T_),string:i(P_),text:i(A_)};return r;function i(s){return o;function o(a){return $_(r,s,a)}}}function j_(e){for(;!Uf(e););return e}const qf=/[\0\t\n\r]/g;function U_(){let e=1,t="",n=!0,r;return i;function i(s,o,a){const l=[];let c,u,d,h,f;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),d=0,t="",n&&(s.charCodeAt(0)===65279&&d++,n=void 0);d<s.length;){if(qf.lastIndex=d,c=qf.exec(s),h=c&&c.index!==void 0?c.index:s.length,f=s.charCodeAt(h),!c){t=s.slice(d);break}if(f===10&&d===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<h&&(l.push(s.slice(d,h)),e+=h-d),f){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const F_=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function B_(e){return e.replace(F_,V_)}function V_(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return Af(n.slice(s?2:1),s?16:10)}return ec(n)||e}const Kf={}.hasOwnProperty;function z_(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Z_(n)(j_(N_(n).document().write(U_()(e,t,!0))))}function Z_(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(me),autolinkProtocol:F,autolinkEmail:F,atxHeading:s(Re),blockQuote:s(Ue),characterEscape:F,characterReference:F,codeFenced:s(_e),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(_e,o),codeText:s(ve,o),codeTextData:F,data:F,codeFlowValue:F,definition:s(ke),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(Ce),hardBreakEscape:s(qe),hardBreakTrailing:s(qe),htmlFlow:s(D,o),htmlFlowData:F,htmlText:s(D,o),htmlTextData:F,image:s(ne),label:o,link:s(me),listItem:s(Le),listItemValue:h,listOrdered:s(he,d),listUnordered:s(he),paragraph:s(Pe),reference:S,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(Re),strong:s(Be),thematicBreak:s(Ze)},exit:{atxHeading:l(),atxHeadingSequence:P,autolink:l(),autolinkEmail:De,autolinkProtocol:je,blockQuote:l(),characterEscapeValue:O,characterReferenceMarkerHexadecimal:Ne,characterReferenceMarkerNumeric:Ne,characterReferenceValue:Ie,codeFenced:l(y),codeFencedFence:m,codeFencedFenceInfo:f,codeFencedFenceMeta:p,codeFlowValue:O,codeIndented:l(v),codeText:l(B),codeTextData:O,data:O,definition:l(),definitionDestinationString:I,definitionLabelString:b,definitionTitleString:x,emphasis:l(),hardBreakEscape:l(J),hardBreakTrailing:l(J),htmlFlow:l(q),htmlFlowData:O,htmlText:l(W),htmlTextData:O,image:l(Y),label:pe,labelText:K,lineEnding:N,link:l(V),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:Te,resourceDestinationString:k,resourceTitleString:ee,resource:xe,setextHeading:l(U),setextHeadingLineSequence:j,setextHeadingText:T,strong:l(),thematicBreak:l()}};Jf(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(Z){let Q={type:"root",children:[]};const G={stack:[Q],tokenStack:[],config:t,enter:a,exit:c,buffer:o,resume:u,data:n},$e=[];let Ge=-1;for(;++Ge<Z.length;)if(Z[Ge][1].type==="listOrdered"||Z[Ge][1].type==="listUnordered")if(Z[Ge][0]==="enter")$e.push(Ge);else{const St=$e.pop();Ge=i(Z,St,Ge)}for(Ge=-1;++Ge<Z.length;){const St=t[Z[Ge][0]];Kf.call(St,Z[Ge][1].type)&&St[Z[Ge][1].type].call(Object.assign({sliceSerialize:Z[Ge][2].sliceSerialize},G),Z[Ge][1])}if(G.tokenStack.length>0){const St=G.tokenStack[G.tokenStack.length-1];(St[1]||Gf).call(G,void 0,St[0])}for(Q.position={start:Dr(Z.length>0?Z[0][1].start:{line:1,column:1,offset:0}),end:Dr(Z.length>0?Z[Z.length-2][1].end:{line:1,column:1,offset:0})},Ge=-1;++Ge<t.transforms.length;)Q=t.transforms[Ge](Q)||Q;return Q}function i(Z,Q,G){let $e=Q-1,Ge=-1,St=!1,bt,gt,At,fn;for(;++$e<=G;){const Rt=Z[$e];switch(Rt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Rt[0]==="enter"?Ge++:Ge--,fn=void 0;break}case"lineEndingBlank":{Rt[0]==="enter"&&(bt&&!fn&&!Ge&&!At&&(At=$e),fn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:fn=void 0}if(!Ge&&Rt[0]==="enter"&&Rt[1].type==="listItemPrefix"||Ge===-1&&Rt[0]==="exit"&&(Rt[1].type==="listUnordered"||Rt[1].type==="listOrdered")){if(bt){let Ft=$e;for(gt=void 0;Ft--;){const Qt=Z[Ft];if(Qt[1].type==="lineEnding"||Qt[1].type==="lineEndingBlank"){if(Qt[0]==="exit")continue;gt&&(Z[gt][1].type="lineEndingBlank",St=!0),Qt[1].type="lineEnding",gt=Ft}else if(!(Qt[1].type==="linePrefix"||Qt[1].type==="blockQuotePrefix"||Qt[1].type==="blockQuotePrefixWhitespace"||Qt[1].type==="blockQuoteMarker"||Qt[1].type==="listItemIndent"))break}At&&(!gt||At<gt)&&(bt._spread=!0),bt.end=Object.assign({},gt?Z[gt][1].start:Rt[1].end),Z.splice(gt||$e,0,["exit",bt,Rt[2]]),$e++,G++}if(Rt[1].type==="listItemPrefix"){const Ft={type:"listItem",_spread:!1,start:Object.assign({},Rt[1].start),end:void 0};bt=Ft,Z.splice($e,0,["enter",Ft,Rt[2]]),$e++,G++,At=void 0,fn=!0}}}return Z[Q][1]._spread=St,G}function s(Z,Q){return G;function G($e){a.call(this,Z($e),$e),Q&&Q.call(this,$e)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(Z,Q,G){this.stack[this.stack.length-1].children.push(Z),this.stack.push(Z),this.tokenStack.push([Q,G]),Z.position={start:Dr(Q.start),end:void 0}}function l(Z){return Q;function Q(G){Z&&Z.call(this,G),c.call(this,G)}}function c(Z,Q){const G=this.stack.pop(),$e=this.tokenStack.pop();if($e)$e[0].type!==Z.type&&(Q?Q.call(this,Z,$e[0]):($e[1]||Gf).call(this,Z,$e[0]));else throw new Error("Cannot close `"+Z.type+"` ("+ks({start:Z.start,end:Z.end})+"): it’s not open");G.position.end=Dr(Z.end)}function u(){return Xl(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function h(Z){if(this.data.expectingFirstListItemValue){const Q=this.stack[this.stack.length-2];Q.start=Number.parseInt(this.sliceSerialize(Z),10),this.data.expectingFirstListItemValue=void 0}}function f(){const Z=this.resume(),Q=this.stack[this.stack.length-1];Q.lang=Z}function p(){const Z=this.resume(),Q=this.stack[this.stack.length-1];Q.meta=Z}function m(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const Z=this.resume(),Q=this.stack[this.stack.length-1];Q.value=Z.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const Z=this.resume(),Q=this.stack[this.stack.length-1];Q.value=Z.replace(/(\r?\n|\r)$/g,"")}function b(Z){const Q=this.resume(),G=this.stack[this.stack.length-1];G.label=Q,G.identifier=Fn(this.sliceSerialize(Z)).toLowerCase()}function x(){const Z=this.resume(),Q=this.stack[this.stack.length-1];Q.title=Z}function I(){const Z=this.resume(),Q=this.stack[this.stack.length-1];Q.url=Z}function P(Z){const Q=this.stack[this.stack.length-1];if(!Q.depth){const G=this.sliceSerialize(Z).length;Q.depth=G}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function j(Z){const Q=this.stack[this.stack.length-1];Q.depth=this.sliceSerialize(Z).codePointAt(0)===61?1:2}function U(){this.data.setextHeadingSlurpLineEnding=void 0}function F(Z){const G=this.stack[this.stack.length-1].children;let $e=G[G.length-1];(!$e||$e.type!=="text")&&($e=ot(),$e.position={start:Dr(Z.start),end:void 0},G.push($e)),this.stack.push($e)}function O(Z){const Q=this.stack.pop();Q.value+=this.sliceSerialize(Z),Q.position.end=Dr(Z.end)}function N(Z){const Q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const G=Q.children[Q.children.length-1];G.position.end=Dr(Z.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Q.type)&&(F.call(this,Z),O.call(this,Z))}function J(){this.data.atHardBreak=!0}function q(){const Z=this.resume(),Q=this.stack[this.stack.length-1];Q.value=Z}function W(){const Z=this.resume(),Q=this.stack[this.stack.length-1];Q.value=Z}function B(){const Z=this.resume(),Q=this.stack[this.stack.length-1];Q.value=Z}function V(){const Z=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";Z.type+="Reference",Z.referenceType=Q,delete Z.url,delete Z.title}else delete Z.identifier,delete Z.label;this.data.referenceType=void 0}function Y(){const Z=this.stack[this.stack.length-1];if(this.data.inReference){const Q=this.data.referenceType||"shortcut";Z.type+="Reference",Z.referenceType=Q,delete Z.url,delete Z.title}else delete Z.identifier,delete Z.label;this.data.referenceType=void 0}function K(Z){const Q=this.sliceSerialize(Z),G=this.stack[this.stack.length-2];G.label=B_(Q),G.identifier=Fn(Q).toLowerCase()}function pe(){const Z=this.stack[this.stack.length-1],Q=this.resume(),G=this.stack[this.stack.length-1];if(this.data.inReference=!0,G.type==="link"){const $e=Z.children;G.children=$e}else G.alt=Q}function k(){const Z=this.resume(),Q=this.stack[this.stack.length-1];Q.url=Z}function ee(){const Z=this.resume(),Q=this.stack[this.stack.length-1];Q.title=Z}function xe(){this.data.inReference=void 0}function S(){this.data.referenceType="collapsed"}function Te(Z){const Q=this.resume(),G=this.stack[this.stack.length-1];G.label=Q,G.identifier=Fn(this.sliceSerialize(Z)).toLowerCase(),this.data.referenceType="full"}function Ne(Z){this.data.characterReferenceType=Z.type}function Ie(Z){const Q=this.sliceSerialize(Z),G=this.data.characterReferenceType;let $e;G?($e=Af(Q,G==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):$e=ec(Q);const Ge=this.stack.pop();Ge.value+=$e,Ge.position.end=Dr(Z.end)}function je(Z){O.call(this,Z);const Q=this.stack[this.stack.length-1];Q.url=this.sliceSerialize(Z)}function De(Z){O.call(this,Z);const Q=this.stack[this.stack.length-1];Q.url="mailto:"+this.sliceSerialize(Z)}function Ue(){return{type:"blockquote",children:[]}}function _e(){return{type:"code",lang:null,meta:null,value:""}}function ve(){return{type:"inlineCode",value:""}}function ke(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ce(){return{type:"emphasis",children:[]}}function Re(){return{type:"heading",depth:0,children:[]}}function qe(){return{type:"break"}}function D(){return{type:"html",value:""}}function ne(){return{type:"image",title:null,url:"",alt:null}}function me(){return{type:"link",title:null,url:"",children:[]}}function he(Z){return{type:"list",ordered:Z.type==="listOrdered",start:null,spread:Z._spread,children:[]}}function Le(Z){return{type:"listItem",spread:Z._spread,checked:null,children:[]}}function Pe(){return{type:"paragraph",children:[]}}function Be(){return{type:"strong",children:[]}}function ot(){return{type:"text",value:""}}function Ze(){return{type:"thematicBreak"}}}function Dr(e){return{line:e.line,column:e.column,offset:e.offset}}function Jf(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Jf(e,r):W_(e,r)}}function W_(e,t){let n;for(n in t)if(Kf.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Gf(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ks({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ks({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ks({start:t.start,end:t.end})+") is still open")}function H_(e){const t=this;t.parser=n;function n(r){return z_(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function q_(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function K_(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
31
|
+
`}]}function J_(e,t){const n=t.value?t.value+`
|
|
32
|
+
`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function G_(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Y_(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Q_(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Li(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,l);const c={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,c),e.applyData(t,c)}function X_(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ek(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Yf(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function tk(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Yf(e,t);const i={src:Li(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function nk(e,t){const n={src:Li(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function rk(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function ik(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Yf(e,t);const i={href:Li(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function sk(e,t){const n={href:Li(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ok(e,t,n){const r=e.all(t),i=n?ak(n):Qf(t),s={},o=[];if(typeof t.checked=="boolean"){const u=r[0];let d;u&&u.type==="element"&&u.tagName==="p"?d=u:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const u=r[a];(i||a!==0||u.type!=="element"||u.tagName!=="p")&&o.push({type:"text",value:`
|
|
33
33
|
`}),u.type==="element"&&u.tagName==="p"&&!i?o.push(...u.children):o.push(u)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&o.push({type:"text",value:`
|
|
34
|
-
`});const c={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,c),e.applyData(t,c)}function
|
|
34
|
+
`});const c={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,c),e.applyData(t,c)}function ak(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Qf(n[r])}return t}function Qf(e){const t=e.spread;return t??e.children.length>1}function lk(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function ck(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function uk(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function dk(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function fk(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=ql(t.children[1]),l=vf(t.children[t.children.length-1]);a&&l&&(o.position={start:a,end:l}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function hk(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:t.children.length;let l=-1;const c=[];for(;++l<a;){const d=t.children[l],h={},f=o?o[l]:void 0;f&&(h.align=f);let p={type:"element",tagName:s,properties:h,children:[]};d&&(p.children=e.all(d),e.patch(d,p),p=e.applyData(d,p)),c.push(p)}const u={type:"element",tagName:"tr",properties:{},children:e.wrap(c,!0)};return e.patch(t,u),e.applyData(t,u)}function pk(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Xf=9,eh=32;function mk(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(th(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(th(t.slice(i),i>0,!1)),s.join("")}function th(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===Xf||s===eh;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===Xf||s===eh;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function gk(e,t){const n={type:"text",value:mk(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function yk(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const vk={blockquote:q_,break:K_,code:J_,delete:G_,emphasis:Y_,footnoteReference:Q_,heading:X_,html:ek,imageReference:tk,image:nk,inlineCode:rk,linkReference:ik,link:sk,listItem:ok,list:lk,paragraph:ck,root:uk,strong:dk,table:fk,tableCell:pk,tableRow:hk,text:gk,thematicBreak:yk,toml:Io,yaml:Io,definition:Io,footnoteDefinition:Io};function Io(){}const nh=-1,Po=0,Ao=1,Ro=2,oc=3,ac=4,lc=5,cc=6,rh=7,ih=8,sh=typeof self=="object"?self:globalThis,bk=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case Po:case nh:return n(o,i);case Ao:{const a=n([],i);for(const l of o)a.push(r(l));return a}case Ro:{const a=n({},i);for(const[l,c]of o)a[r(l)]=r(c);return a}case oc:return n(new Date(o),i);case ac:{const{source:a,flags:l}=o;return n(new RegExp(a,l),i)}case lc:{const a=n(new Map,i);for(const[l,c]of o)a.set(r(l),r(c));return a}case cc:{const a=n(new Set,i);for(const l of o)a.add(r(l));return a}case rh:{const{name:a,message:l}=o;return n(new sh[a](l),i)}case ih:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i)}return n(new sh[s](o),i)};return r},oh=e=>bk(new Map,e)(0),Di="",{toString:wk}={},{keys:xk}=Object,Ts=e=>{const t=typeof e;if(t!=="object"||!e)return[Po,t];const n=wk.call(e).slice(8,-1);switch(n){case"Array":return[Ao,Di];case"Object":return[Ro,Di];case"Date":return[oc,Di];case"RegExp":return[ac,Di];case"Map":return[lc,Di];case"Set":return[cc,Di]}return n.includes("Array")?[Ao,n]:n.includes("Error")?[rh,n]:[Ro,n]},$o=([e,t])=>e===Po&&(t==="function"||t==="symbol"),_k=(e,t,n,r)=>{const i=(o,a)=>{const l=r.push(o)-1;return n.set(a,l),l},s=o=>{if(n.has(o))return n.get(o);let[a,l]=Ts(o);switch(a){case Po:{let u=o;switch(l){case"bigint":a=ih,u=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);u=null;break;case"undefined":return i([nh],o)}return i([a,u],o)}case Ao:{if(l)return i([l,[...o]],o);const u=[],d=i([a,u],o);for(const h of o)u.push(s(h));return d}case Ro:{if(l)switch(l){case"BigInt":return i([l,o.toString()],o);case"Boolean":case"Number":case"String":return i([l,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const u=[],d=i([a,u],o);for(const h of xk(o))(e||!$o(Ts(o[h])))&&u.push([s(h),s(o[h])]);return d}case oc:return i([a,o.toISOString()],o);case ac:{const{source:u,flags:d}=o;return i([a,{source:u,flags:d}],o)}case lc:{const u=[],d=i([a,u],o);for(const[h,f]of o)(e||!($o(Ts(h))||$o(Ts(f))))&&u.push([s(h),s(f)]);return d}case cc:{const u=[],d=i([a,u],o);for(const h of o)(e||!$o(Ts(h)))&&u.push(s(h));return d}}const{message:c}=o;return i([a,{name:l,message:c}],o)};return s},ah=(e,{json:t,lossy:n}={})=>{const r=[];return _k(!(t||n),!!t,new Map,r)(e),r},Mo=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?oh(ah(e,t)):structuredClone(e):(e,t)=>oh(ah(e,t));function kk(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Ck(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Ek(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||kk,r=e.options.footnoteBackLabel||Ck,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const c=e.footnoteById.get(e.footnoteOrder[l]);if(!c)continue;const u=e.all(c),d=String(c.identifier).toUpperCase(),h=Li(d.toLowerCase());let f=0;const p=[],m=e.footnoteCounts.get(d);for(;m!==void 0&&++f<=m;){p.length>0&&p.push({type:"text",value:" "});let b=typeof n=="string"?n:n(l,f);typeof b=="string"&&(b={type:"text",value:b}),p.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,f),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const y=u[u.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const b=y.children[y.children.length-1];b&&b.type==="text"?b.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...p)}else u.push(...p);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(u,!0)};e.patch(c,v),a.push(v)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Mo(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
|
|
35
35
|
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
|
|
36
|
-
`}]}}const
|
|
36
|
+
`}]}}const Lo=function(e){if(e==null)return Ik;if(typeof e=="function")return Do(e);if(typeof e=="object")return Array.isArray(e)?Sk(e):Tk(e);if(typeof e=="string")return Ok(e);throw new Error("Expected function, string, or object as test")};function Sk(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Lo(e[n]);return Do(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function Tk(e){const t=e;return Do(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function Ok(e){return Do(t);function t(n){return n&&n.type===e}}function Do(e){return t;function t(n,r,i){return!!(Pk(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Ik(){return!0}function Pk(e){return e!==null&&typeof e=="object"&&"type"in e}function hF(e){return e}const lh=[],Ak=!0,uc=!1,Rk="skip";function ch(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=Lo(i),o=r?-1:1;a(e,void 0,[])();function a(l,c,u){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const f=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(f?"<"+f+">":""))+")"})}return h;function h(){let f=lh,p,m,y;if((!t||s(l,c,u[u.length-1]||void 0))&&(f=$k(n(l,u)),f[0]===uc))return f;if("children"in l&&l.children){const v=l;if(v.children&&f[0]!==Rk)for(m=(r?v.children.length:-1)+o,y=u.concat(v);m>-1&&m<v.children.length;){const b=v.children[m];if(p=a(b,m,y)(),p[0]===uc)return p;m=typeof p[1]=="number"?p[1]:m+o}}return f}}}function $k(e){return Array.isArray(e)?e:typeof e=="number"?[Ak,e]:e==null?lh:[e]}function dc(e,t,n,r){let i,s,o;typeof t=="function"&&typeof n!="function"?(s=void 0,o=t,i=n):(s=t,o=n,i=r),ch(e,s,a,i);function a(l,c){const u=c[c.length-1],d=u?u.children.indexOf(l):void 0;return o(l,d,u)}}const fc={}.hasOwnProperty,Mk={};function Lk(e,t){const n=t||Mk,r=new Map,i=new Map,s=new Map,o={...vk,...n.handlers},a={all:c,applyData:Nk,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:l,options:n,patch:Dk,wrap:Uk};return dc(e,function(u){if(u.type==="definition"||u.type==="footnoteDefinition"){const d=u.type==="definition"?r:i,h=String(u.identifier).toUpperCase();d.has(h)||d.set(h,u)}}),a;function l(u,d){const h=u.type,f=a.handlers[h];if(fc.call(a.handlers,h)&&f)return f(a,u,d);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in u){const{children:m,...y}=u,v=Mo(y);return v.children=a.all(u),v}return Mo(u)}return(a.options.unknownHandler||jk)(a,u,d)}function c(u){const d=[];if("children"in u){const h=u.children;let f=-1;for(;++f<h.length;){const p=a.one(h[f],u);if(p){if(f&&h[f-1].type==="break"&&(!Array.isArray(p)&&p.type==="text"&&(p.value=uh(p.value)),!Array.isArray(p)&&p.type==="element")){const m=p.children[0];m&&m.type==="text"&&(m.value=uh(m.value))}Array.isArray(p)?d.push(...p):d.push(p)}}}return d}}function Dk(e,t){e.position&&(t.position=R0(e))}function Nk(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&s&&Object.assign(n.properties,Mo(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function jk(e,t){const n=t.data||{},r="value"in t&&!(fc.call(n,"hProperties")||fc.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Uk(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
37
37
|
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
38
38
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
39
|
-
`}),n}function
|
|
40
|
-
`},i),s}function V_(e,t){return e&&"run"in e?async function(n,r){const i=Qf(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Qf(n,{file:r,...t||e})}}function Xf(e){if(e)throw e}var To=Object.prototype.hasOwnProperty,eh=Object.prototype.toString,th=Object.defineProperty,nh=Object.getOwnPropertyDescriptor,rh=function(t){return typeof Array.isArray=="function"?Array.isArray(t):eh.call(t)==="[object Array]"},ih=function(t){if(!t||eh.call(t)!=="[object Object]")return!1;var n=To.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&To.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||To.call(t,i)},sh=function(t,n){th&&n.name==="__proto__"?th(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},oh=function(t,n){if(n==="__proto__")if(To.call(t,n)){if(nh)return nh(t,n).value}else return;return t[n]},z_=function e(){var t,n,r,i,s,o,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=oh(a,n),i=oh(t,n),a!==i&&(u&&i&&(ih(i)||(s=rh(i)))?(s?(s=!1,o=r&&rh(r)?r:[]):o=r&&ih(r)?r:{},sh(a,{name:n,newValue:e(u,o,i)})):typeof i<"u"&&sh(a,{name:n,newValue:i}));return a};const nc=ti(z_);function rc(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Z_(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(l,...c){const u=e[++s];let d=-1;if(l){o(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,u?W_(u,a)(...c):o(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function W_(e,t){let n;return r;function r(...o){const a=e.length>o.length;let l;a&&o.push(i);try{l=e.apply(this,o)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l instanceof Promise?l.then(s,i):l instanceof Error?i(l):s(l))}function i(o,...a){n||(n=!0,t(o,...a))}function s(o){i(null,o)}}const qn={basename:H_,dirname:q_,extname:K_,join:J_,sep:"/"};function H_(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');xs(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function q_(e){if(xs(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function K_(e){xs(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function J_(...e){let t=-1,n;for(;++t<e.length;)xs(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":G_(n)}function G_(e){xs(e);const t=e.codePointAt(0)===47;let n=Y_(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Y_(e,t){let n="",r=0,i=-1,s=0,o=-1,a,l;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return n}function xs(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Q_={cwd:X_};function X_(){return"/"}function ic(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function ek(e){if(typeof e=="string")e=new URL(e);else if(!ic(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return tk(e)}function tk(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const sc=["history","path","basename","stem","extname","dirname"];class ah{constructor(t){let n;t?ic(t)?n={path:t}:typeof t=="string"||nk(t)?n={value:t}:n=t:n={},this.cwd=Q_.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<sc.length;){const s=sc[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)sc.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?qn.basename(this.path):void 0}set basename(t){ac(t,"basename"),oc(t,"basename"),this.path=qn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?qn.dirname(this.path):void 0}set dirname(t){lh(this.basename,"dirname"),this.path=qn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?qn.extname(this.path):void 0}set extname(t){if(oc(t,"extname"),lh(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=qn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ic(t)&&(t=ek(t)),ac(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?qn.basename(this.path,this.extname):void 0}set stem(t){ac(t,"stem"),oc(t,"stem"),this.path=qn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new nn(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function oc(e,t){if(e&&e.includes(qn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+qn.sep+"`")}function ac(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function lh(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function nk(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const rk=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};Object.setPrototypeOf(s,r);const o=Object.getOwnPropertyNames(i);for(const a of o){const l=Object.getOwnPropertyDescriptor(i,a);l&&Object.defineProperty(s,a,l)}return s},ik={}.hasOwnProperty;class lc extends rk{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=Z_()}copy(){const t=new lc;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(nc(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(dc("data",this.frozen),this.namespace[t]=n,this):ik.call(this.namespace,t)&&this.namespace[t]||void 0:t?(dc("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Oo(t),r=this.parser||this.Parser;return cc("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),cc("process",this.parser||this.Parser),uc("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,o){const a=Oo(t),l=r.parse(a);r.run(l,a,function(u,d,h){if(u||!d||!h)return c(u);const f=d,p=r.stringify(f,h);ak(p)?h.value=p:h.result=p,c(u,h)});function c(u,d){u||!d?o(u):s?s(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),cc("processSync",this.parser||this.Parser),uc("processSync",this.compiler||this.Compiler),this.process(t,i),uh("processSync","process",n),r;function i(s,o){n=!0,Xf(s),r=o}}run(t,n,r){ch(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,a){const l=Oo(n);i.run(t,l,c);function c(u,d,h){const f=d||t;u?a(u):o?o(f):r(void 0,f,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),uh("runSync","run",r),i;function s(o,a){Xf(o),i=a,r=!0}}stringify(t,n){this.freeze();const r=Oo(n),i=this.compiler||this.Compiler;return uc("stringify",i),ch(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(dc("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))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");a(c.plugins),c.settings&&(i.settings=nc(!0,i.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];s(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===c){h=d;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[f,...p]=u;const m=r[h][1];rc(m)&&rc(f)&&(f=nc(!0,m,f)),r[h]=[c,f,...p]}}}}const sk=new lc().freeze();function cc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function uc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function dc(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ch(e){if(!rc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function uh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Oo(e){return ok(e)?e:new ah(e)}function ok(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function ak(e){return typeof e=="string"||lk(e)}function lk(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const ck="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",dh=[],fh={allowDangerousHtml:!0},uk=/^(https?|ircs?|mailto|xmpp)$/i,dk=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function fk(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,s=e.components,o=e.disallowedElements,a=e.rehypePlugins||dh,l=e.remarkPlugins||dh,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...fh}:fh,u=e.skipHtml,d=e.unwrapDisallowed,h=e.urlTransform||hk,f=sk().use(Kx).use(l).use(V_,c).use(a),p=new ah;typeof r=="string"&&(p.value=r);for(const b of dk)Object.hasOwn(e,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+ck+b.id,void 0);const m=f.parse(p);let y=f.runSync(m,p);return i&&(y={type:"element",tagName:"div",properties:{className:i},children:y.type==="root"?y.children:[y]}),ec(y,v),Fw(y,{Fragment:Z.Fragment,components:s,ignoreInvalidStyle:!0,jsx:Z.jsx,jsxs:Z.jsxs,passKeys:!0,passNode:!0});function v(b,x,P){if(b.type==="raw"&&P&&typeof x=="number")return u?P.children.splice(x,1):P.children[x]={type:"text",value:b.value},x;if(b.type==="element"){let A;for(A in Bl)if(Object.hasOwn(Bl,A)&&Object.hasOwn(b.properties,A)){const O=b.properties[A],U=Bl[A];(U===null||U.includes(b.tagName))&&(b.properties[A]=h(String(O||""),A,b))}}if(b.type==="element"){let A=t?!t.includes(b.tagName):o?o.includes(b.tagName):!1;if(!A&&n&&typeof x=="number"&&(A=!n(b,x,P)),A&&P&&typeof x=="number")return d&&b.children?P.children.splice(x,1,...b.children):P.children.splice(x,1),x}}}function hk(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||uk.test(e.slice(0,t))?e:""}function pk(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function hh(e,t,n){const i=Eo((n||{}).ignore||[]),s=mk(t);let o=-1;for(;++o<s.length;)Gf(e,"text",a);function a(c,u){let d=-1,h;for(;++d<u.length;){const f=u[d],p=h?h.children:void 0;if(i(f,p?p.indexOf(f):void 0,h))return;h=f}if(h)return l(c,u)}function l(c,u){const d=u[u.length-1],h=s[o][0],f=s[o][1];let p=0;const y=d.children.indexOf(c);let v=!1,b=[];h.lastIndex=0;let x=h.exec(c.value);for(;x;){const P=x.index,A={index:x.index,input:x.input,stack:[...u,c]};let O=f(...x,A);if(typeof O=="string"&&(O=O.length>0?{type:"text",value:O}:void 0),O===!1?h.lastIndex=P+1:(p!==P&&b.push({type:"text",value:c.value.slice(p,P)}),Array.isArray(O)?b.push(...O):O&&b.push(O),p=P+x[0].length,v=!0),!h.global)break;x=h.exec(c.value)}return v?(p<c.value.length&&b.push({type:"text",value:c.value.slice(p)}),d.children.splice(y,1,...b)):b=[c],y+b.length}}function mk(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([gk(i[0]),yk(i[1])])}return t}function gk(e){return typeof e=="string"?new RegExp(pk(e),"g"):e}function yk(e){return typeof e=="function"?e:function(){return e}}function vk(e){hh(e,[/\r?\n|\r/g,bk])}function bk(){return{type:"break"}}function wk(){return function(e){vk(e)}}function ph(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const fc="phrasing",hc=["autolink","link","image","label"];function xk(){return{transforms:[Ok],enter:{literalAutolink:kk,literalAutolinkEmail:pc,literalAutolinkHttp:pc,literalAutolinkWww:pc},exit:{literalAutolink:Tk,literalAutolinkEmail:Sk,literalAutolinkHttp:Ck,literalAutolinkWww:Ek}}}function _k(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:fc,notInConstruct:hc},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:fc,notInConstruct:hc},{character:":",before:"[ps]",after:"\\/",inConstruct:fc,notInConstruct:hc}]}}function kk(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function pc(e){this.config.enter.autolinkProtocol.call(this,e)}function Ck(e){this.config.exit.autolinkProtocol.call(this,e)}function Ek(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function Sk(e){this.config.exit.autolinkEmail.call(this,e)}function Tk(e){this.exit(e)}function Ok(e){hh(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Ik],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,Pk]],{ignore:["link","linkReference"]})}function Ik(e,t,n,r,i){let s="";if(!mh(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!Ak(n)))return!1;const o=Rk(n+r);if(!o[0])return!1;const a={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function Pk(e,t,n,r){return!mh(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function Ak(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Rk(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=ph(e,"(");let s=ph(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function mh(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||si(n)||mo(n))&&(!t||n!==47)}gh.peek=zk;function $k(){return{enter:{gfmFootnoteDefinition:Lk,gfmFootnoteDefinitionLabelString:Dk,gfmFootnoteCall:Uk,gfmFootnoteCallString:Fk},exit:{gfmFootnoteDefinition:jk,gfmFootnoteDefinitionLabelString:Nk,gfmFootnoteCall:Vk,gfmFootnoteCallString:Bk}}}function Mk(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:Zk,footnoteReference:gh}}}function Lk(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Dk(){this.buffer()}function Nk(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=Nn(this.sliceSerialize(e)).toLowerCase()}function jk(e){this.exit(e)}function Uk(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Fk(){this.buffer()}function Bk(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=Nn(this.sliceSerialize(e)).toLowerCase()}function Vk(e){this.exit(e)}function gh(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),a=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{...i.current(),before:s,after:"]"})),a(),o(),s+=i.move("]"),s}function zk(){return"["}function Zk(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteDefinition"),a=n.enter("label");return s+=i.move(n.safe(n.associationId(e),{...i.current(),before:s,after:"]"})),a(),s+=i.move("]:"+(e.children&&e.children.length>0?" ":"")),i.shift(4),s+=i.move(n.indentLines(n.containerFlow(e,i.current()),Wk)),o(),s}function Wk(e,t,n){return t===0?e:(n?"":" ")+e}const Hk=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];yh.peek=Yk;function qk(){return{canContainEols:["delete"],enter:{strikethrough:Jk},exit:{strikethrough:Gk}}}function Kk(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Hk}],handlers:{delete:yh}}}function Jk(e){this.enter({type:"delete",children:[]},e)}function Gk(e){this.exit(e)}function yh(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function Yk(){return"~"}function Qk(e,t={}){const n=(t.align||[]).concat(),r=t.stringLength||e1,i=[],s=[],o=[],a=[];let l=0,c=-1;for(;++c<e.length;){const p=[],m=[];let y=-1;for(e[c].length>l&&(l=e[c].length);++y<e[c].length;){const v=Xk(e[c][y]);if(t.alignDelimiters!==!1){const b=r(v);m[y]=b,(a[y]===void 0||b>a[y])&&(a[y]=b)}p.push(v)}s[c]=p,o[c]=m}let u=-1;if(typeof n=="object"&&"length"in n)for(;++u<l;)i[u]=vh(n[u]);else{const p=vh(n);for(;++u<l;)i[u]=p}u=-1;const d=[],h=[];for(;++u<l;){const p=i[u];let m="",y="";p===99?(m=":",y=":"):p===108?m=":":p===114&&(y=":");let v=t.alignDelimiters===!1?1:Math.max(1,a[u]-m.length-y.length);const b=m+"-".repeat(v)+y;t.alignDelimiters!==!1&&(v=m.length+v+y.length,v>a[u]&&(a[u]=v),h[u]=v),d[u]=b}s.splice(1,0,d),o.splice(1,0,h),c=-1;const f=[];for(;++c<s.length;){const p=s[c],m=o[c];u=-1;const y=[];for(;++u<l;){const v=p[u]||"";let b="",x="";if(t.alignDelimiters!==!1){const P=a[u]-(m[u]||0),A=i[u];A===114?b=" ".repeat(P):A===99?P%2?(b=" ".repeat(P/2+.5),x=" ".repeat(P/2-.5)):(b=" ".repeat(P/2),x=b):x=" ".repeat(P)}t.delimiterStart!==!1&&!u&&y.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&v==="")&&(t.delimiterStart!==!1||u)&&y.push(" "),t.alignDelimiters!==!1&&y.push(b),y.push(v),t.alignDelimiters!==!1&&y.push(x),t.padding!==!1&&y.push(" "),(t.delimiterEnd!==!1||u!==l-1)&&y.push("|")}f.push(t.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return f.join(`
|
|
41
|
-
`)}function
|
|
42
|
-
`&&
|
|
43
|
-
`}function
|
|
39
|
+
`}),n}function uh(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function dh(e,t){const n=Lk(e,t),r=n.one(e,void 0),i=Ek(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
|
|
40
|
+
`},i),s}function Fk(e,t){return e&&"run"in e?async function(n,r){const i=dh(n,{file:r,...t});await e.run(i,r)}:function(n,r){return dh(n,{file:r,...t||e})}}function fh(e){if(e)throw e}var No=Object.prototype.hasOwnProperty,hh=Object.prototype.toString,ph=Object.defineProperty,mh=Object.getOwnPropertyDescriptor,gh=function(t){return typeof Array.isArray=="function"?Array.isArray(t):hh.call(t)==="[object Array]"},yh=function(t){if(!t||hh.call(t)!=="[object Object]")return!1;var n=No.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&No.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||No.call(t,i)},vh=function(t,n){ph&&n.name==="__proto__"?ph(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},bh=function(t,n){if(n==="__proto__")if(No.call(t,n)){if(mh)return mh(t,n).value}else return;return t[n]},Bk=function e(){var t,n,r,i,s,o,a=arguments[0],l=1,c=arguments.length,u=!1;for(typeof a=="boolean"&&(u=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<c;++l)if(t=arguments[l],t!=null)for(n in t)r=bh(a,n),i=bh(t,n),a!==i&&(u&&i&&(yh(i)||(s=gh(i)))?(s?(s=!1,o=r&&gh(r)?r:[]):o=r&&yh(r)?r:{},vh(a,{name:n,newValue:e(u,o,i)})):typeof i<"u"&&vh(a,{name:n,newValue:i}));return a};const hc=ai(Bk);function pc(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Vk(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(l,...c){const u=e[++s];let d=-1;if(l){o(l);return}for(;++d<i.length;)(c[d]===null||c[d]===void 0)&&(c[d]=i[d]);i=c,u?zk(u,a)(...c):o(null,...c)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function zk(e,t){let n;return r;function r(...o){const a=e.length>o.length;let l;a&&o.push(i);try{l=e.apply(this,o)}catch(c){const u=c;if(a&&n)throw u;return i(u)}a||(l instanceof Promise?l.then(s,i):l instanceof Error?i(l):s(l))}function i(o,...a){n||(n=!0,t(o,...a))}function s(o){i(null,o)}}const Yn={basename:Zk,dirname:Wk,extname:Hk,join:qk,sep:"/"};function Zk(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Os(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Wk(e){if(Os(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Hk(e){Os(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function qk(...e){let t=-1,n;for(;++t<e.length;)Os(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Kk(n)}function Kk(e){Os(e);const t=e.codePointAt(0)===47;let n=Jk(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Jk(e,t){let n="",r=0,i=-1,s=0,o=-1,a,l;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return n}function Os(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Gk={cwd:Yk};function Yk(){return"/"}function mc(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Qk(e){if(typeof e=="string")e=new URL(e);else if(!mc(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Xk(e)}function Xk(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const gc=["history","path","basename","stem","extname","dirname"];class wh{constructor(t){let n;t?mc(t)?n={path:t}:typeof t=="string"||e1(t)?n={value:t}:n=t:n={},this.cwd=Gk.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<gc.length;){const s=gc[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)gc.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Yn.basename(this.path):void 0}set basename(t){vc(t,"basename"),yc(t,"basename"),this.path=Yn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Yn.dirname(this.path):void 0}set dirname(t){xh(this.basename,"dirname"),this.path=Yn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Yn.extname(this.path):void 0}set extname(t){if(yc(t,"extname"),xh(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Yn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){mc(t)&&(t=Qk(t)),vc(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Yn.basename(this.path,this.extname):void 0}set stem(t){vc(t,"stem"),yc(t,"stem"),this.path=Yn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new on(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function yc(e,t){if(e&&e.includes(Yn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Yn.sep+"`")}function vc(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function xh(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function e1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const t1=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};Object.setPrototypeOf(s,r);const o=Object.getOwnPropertyNames(i);for(const a of o){const l=Object.getOwnPropertyDescriptor(i,a);l&&Object.defineProperty(s,a,l)}return s},n1={}.hasOwnProperty;class bc extends t1{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=Vk()}copy(){const t=new bc;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(hc(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(_c("data",this.frozen),this.namespace[t]=n,this):n1.call(this.namespace,t)&&this.namespace[t]||void 0:t?(_c("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=jo(t),r=this.parser||this.Parser;return wc("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),wc("process",this.parser||this.Parser),xc("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,o){const a=jo(t),l=r.parse(a);r.run(l,a,function(u,d,h){if(u||!d||!h)return c(u);const f=d,p=r.stringify(f,h);s1(p)?h.value=p:h.result=p,c(u,h)});function c(u,d){u||!d?o(u):s?s(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),wc("processSync",this.parser||this.Parser),xc("processSync",this.compiler||this.Compiler),this.process(t,i),kh("processSync","process",n),r;function i(s,o){n=!0,fh(s),r=o}}run(t,n,r){_h(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,a){const l=jo(n);i.run(t,l,c);function c(u,d,h){const f=d||t;u?a(u):o?o(f):r(void 0,f,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),kh("runSync","run",r),i;function s(o,a){fh(o),i=a,r=!0}}stringify(t,n){this.freeze();const r=jo(n),i=this.compiler||this.Compiler;return xc("stringify",i),_h(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(_c("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(c){if(typeof c=="function")l(c,[]);else if(typeof c=="object")if(Array.isArray(c)){const[u,...d]=c;l(u,d)}else o(c);else throw new TypeError("Expected usable value, not `"+c+"`")}function o(c){if(!("plugins"in c)&&!("settings"in c))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");a(c.plugins),c.settings&&(i.settings=hc(!0,i.settings,c.settings))}function a(c){let u=-1;if(c!=null)if(Array.isArray(c))for(;++u<c.length;){const d=c[u];s(d)}else throw new TypeError("Expected a list of plugins, not `"+c+"`")}function l(c,u){let d=-1,h=-1;for(;++d<r.length;)if(r[d][0]===c){h=d;break}if(h===-1)r.push([c,...u]);else if(u.length>0){let[f,...p]=u;const m=r[h][1];pc(m)&&pc(f)&&(f=hc(!0,m,f)),r[h]=[c,f,...p]}}}}const r1=new bc().freeze();function wc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function xc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function _c(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function _h(e){if(!pc(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function kh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function jo(e){return i1(e)?e:new wh(e)}function i1(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function s1(e){return typeof e=="string"||o1(e)}function o1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const a1="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ch=[],Eh={allowDangerousHtml:!0},l1=/^(https?|ircs?|mailto|xmpp)$/i,c1=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function u1(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,s=e.components,o=e.disallowedElements,a=e.rehypePlugins||Ch,l=e.remarkPlugins||Ch,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Eh}:Eh,u=e.skipHtml,d=e.unwrapDisallowed,h=e.urlTransform||d1,f=r1().use(H_).use(l).use(Fk,c).use(a),p=new wh;typeof r=="string"&&(p.value=r);for(const b of c1)Object.hasOwn(e,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+a1+b.id,void 0);const m=f.parse(p);let y=f.runSync(m,p);return i&&(y={type:"element",tagName:"div",properties:{className:i},children:y.type==="root"?y.children:[y]}),dc(y,v),j0(y,{Fragment:z.Fragment,components:s,ignoreInvalidStyle:!0,jsx:z.jsx,jsxs:z.jsxs,passKeys:!0,passNode:!0});function v(b,x,I){if(b.type==="raw"&&I&&typeof x=="number")return u?I.children.splice(x,1):I.children[x]={type:"text",value:b.value},x;if(b.type==="element"){let P;for(P in Ql)if(Object.hasOwn(Ql,P)&&Object.hasOwn(b.properties,P)){const T=b.properties[P],j=Ql[P];(j===null||j.includes(b.tagName))&&(b.properties[P]=h(String(T||""),P,b))}}if(b.type==="element"){let P=t?!t.includes(b.tagName):o?o.includes(b.tagName):!1;if(!P&&n&&typeof x=="number"&&(P=!n(b,x,I)),P&&I&&typeof x=="number")return d&&b.children?I.children.splice(x,1,...b.children):I.children.splice(x,1),x}}}function d1(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||l1.test(e.slice(0,t))?e:""}function f1(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Sh(e,t,n){const i=Lo((n||{}).ignore||[]),s=h1(t);let o=-1;for(;++o<s.length;)ch(e,"text",a);function a(c,u){let d=-1,h;for(;++d<u.length;){const f=u[d],p=h?h.children:void 0;if(i(f,p?p.indexOf(f):void 0,h))return;h=f}if(h)return l(c,u)}function l(c,u){const d=u[u.length-1],h=s[o][0],f=s[o][1];let p=0;const y=d.children.indexOf(c);let v=!1,b=[];h.lastIndex=0;let x=h.exec(c.value);for(;x;){const I=x.index,P={index:x.index,input:x.input,stack:[...u,c]};let T=f(...x,P);if(typeof T=="string"&&(T=T.length>0?{type:"text",value:T}:void 0),T===!1?h.lastIndex=I+1:(p!==I&&b.push({type:"text",value:c.value.slice(p,I)}),Array.isArray(T)?b.push(...T):T&&b.push(T),p=I+x[0].length,v=!0),!h.global)break;x=h.exec(c.value)}return v?(p<c.value.length&&b.push({type:"text",value:c.value.slice(p)}),d.children.splice(y,1,...b)):b=[c],y+b.length}}function h1(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([p1(i[0]),m1(i[1])])}return t}function p1(e){return typeof e=="string"?new RegExp(f1(e),"g"):e}function m1(e){return typeof e=="function"?e:function(){return e}}function g1(e){Sh(e,[/\r?\n|\r/g,y1])}function y1(){return{type:"break"}}function v1(){return function(e){g1(e)}}function Th(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}const kc="phrasing",Cc=["autolink","link","image","label"];function b1(){return{transforms:[S1],enter:{literalAutolink:x1,literalAutolinkEmail:Ec,literalAutolinkHttp:Ec,literalAutolinkWww:Ec},exit:{literalAutolink:E1,literalAutolinkEmail:C1,literalAutolinkHttp:_1,literalAutolinkWww:k1}}}function w1(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:kc,notInConstruct:Cc},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:kc,notInConstruct:Cc},{character:":",before:"[ps]",after:"\\/",inConstruct:kc,notInConstruct:Cc}]}}function x1(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ec(e){this.config.enter.autolinkProtocol.call(this,e)}function _1(e){this.config.exit.autolinkProtocol.call(this,e)}function k1(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function C1(e){this.config.exit.autolinkEmail.call(this,e)}function E1(e){this.exit(e)}function S1(e){Sh(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,T1],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,O1]],{ignore:["link","linkReference"]})}function T1(e,t,n,r,i){let s="";if(!Oh(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!I1(n)))return!1;const o=P1(n+r);if(!o[0])return!1;const a={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function O1(e,t,n,r){return!Oh(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function I1(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function P1(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=Th(e,"(");let s=Th(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function Oh(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||di(n)||Eo(n))&&(!t||n!==47)}Ih.peek=B1;function A1(){return{enter:{gfmFootnoteDefinition:$1,gfmFootnoteDefinitionLabelString:M1,gfmFootnoteCall:N1,gfmFootnoteCallString:j1},exit:{gfmFootnoteDefinition:D1,gfmFootnoteDefinitionLabelString:L1,gfmFootnoteCall:F1,gfmFootnoteCallString:U1}}}function R1(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:V1,footnoteReference:Ih}}}function $1(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function M1(){this.buffer()}function L1(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=Fn(this.sliceSerialize(e)).toLowerCase()}function D1(e){this.exit(e)}function N1(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function j1(){this.buffer()}function U1(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.label=t,n.identifier=Fn(this.sliceSerialize(e)).toLowerCase()}function F1(e){this.exit(e)}function Ih(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),a=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{...i.current(),before:s,after:"]"})),a(),o(),s+=i.move("]"),s}function B1(){return"["}function V1(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteDefinition"),a=n.enter("label");return s+=i.move(n.safe(n.associationId(e),{...i.current(),before:s,after:"]"})),a(),s+=i.move("]:"+(e.children&&e.children.length>0?" ":"")),i.shift(4),s+=i.move(n.indentLines(n.containerFlow(e,i.current()),z1)),o(),s}function z1(e,t,n){return t===0?e:(n?"":" ")+e}const Z1=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ph.peek=J1;function W1(){return{canContainEols:["delete"],enter:{strikethrough:q1},exit:{strikethrough:K1}}}function H1(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Z1}],handlers:{delete:Ph}}}function q1(e){this.enter({type:"delete",children:[]},e)}function K1(e){this.exit(e)}function Ph(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function J1(){return"~"}function G1(e,t={}){const n=(t.align||[]).concat(),r=t.stringLength||Q1,i=[],s=[],o=[],a=[];let l=0,c=-1;for(;++c<e.length;){const p=[],m=[];let y=-1;for(e[c].length>l&&(l=e[c].length);++y<e[c].length;){const v=Y1(e[c][y]);if(t.alignDelimiters!==!1){const b=r(v);m[y]=b,(a[y]===void 0||b>a[y])&&(a[y]=b)}p.push(v)}s[c]=p,o[c]=m}let u=-1;if(typeof n=="object"&&"length"in n)for(;++u<l;)i[u]=Ah(n[u]);else{const p=Ah(n);for(;++u<l;)i[u]=p}u=-1;const d=[],h=[];for(;++u<l;){const p=i[u];let m="",y="";p===99?(m=":",y=":"):p===108?m=":":p===114&&(y=":");let v=t.alignDelimiters===!1?1:Math.max(1,a[u]-m.length-y.length);const b=m+"-".repeat(v)+y;t.alignDelimiters!==!1&&(v=m.length+v+y.length,v>a[u]&&(a[u]=v),h[u]=v),d[u]=b}s.splice(1,0,d),o.splice(1,0,h),c=-1;const f=[];for(;++c<s.length;){const p=s[c],m=o[c];u=-1;const y=[];for(;++u<l;){const v=p[u]||"";let b="",x="";if(t.alignDelimiters!==!1){const I=a[u]-(m[u]||0),P=i[u];P===114?b=" ".repeat(I):P===99?I%2?(b=" ".repeat(I/2+.5),x=" ".repeat(I/2-.5)):(b=" ".repeat(I/2),x=b):x=" ".repeat(I)}t.delimiterStart!==!1&&!u&&y.push("|"),t.padding!==!1&&!(t.alignDelimiters===!1&&v==="")&&(t.delimiterStart!==!1||u)&&y.push(" "),t.alignDelimiters!==!1&&y.push(b),y.push(v),t.alignDelimiters!==!1&&y.push(x),t.padding!==!1&&y.push(" "),(t.delimiterEnd!==!1||u!==l-1)&&y.push("|")}f.push(t.delimiterEnd===!1?y.join("").replace(/ +$/,""):y.join(""))}return f.join(`
|
|
41
|
+
`)}function Y1(e){return e==null?"":String(e)}function Q1(e){return e.length}function Ah(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function X1(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),eC);return i(),o}function eC(e,t,n){return">"+(n?"":" ")+e}function tC(e,t){return Rh(e,t.inConstruct,!0)&&!Rh(e,t.notInConstruct,!1)}function Rh(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function $h(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
|
|
42
|
+
`&&tC(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
43
|
+
`}function nC(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>o&&(o=s):s=1,i=r+t.length,r=n.indexOf(t,i);return o}function rC(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function iC(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function sC(e,t,n,r){const i=iC(n),s=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(rC(e,n)){const d=n.enter("codeIndented"),h=n.indentLines(s,oC);return d(),h}const a=n.createTracker(r),l=i.repeat(Math.max(nC(s,i)+1,3)),c=n.enter("codeFenced");let u=a.move(l);if(e.lang){const d=n.enter(`codeFencedLang${o}`);u+=a.move(n.safe(e.lang,{before:u,after:" ",encode:["`"],...a.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${o}`);u+=a.move(" "),u+=a.move(n.safe(e.meta,{before:u,after:`
|
|
44
44
|
`,encode:["`"],...a.current()})),d()}return u+=a.move(`
|
|
45
45
|
`),s&&(u+=a.move(s+`
|
|
46
|
-
`)),u+=a.move(l),c(),u}function
|
|
47
|
-
`,...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),o(),c}function
|
|
46
|
+
`)),u+=a.move(l),c(),u}function oC(e,t,n){return(n?"":" ")+e}function Sc(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function aC(e,t,n,r){const i=Sc(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("[");return c+=l.move(n.safe(n.associationId(e),{before:c,after:"]",...l.current()})),c+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":`
|
|
47
|
+
`,...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),o(),c}function lC(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}Mh.peek=cC;function Mh(e,t,n,r){const i=lC(n),s=n.enter("emphasis"),o=n.createTracker(r);let a=o.move(i);return a+=o.move(n.containerPhrasing(e,{before:a,after:i,...o.current()})),a+=o.move(i),s(),a}function cC(e,t,n){return n.options.emphasis||"*"}function uC(e,t){let n=!1;return dc(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,uc}),!!((!e.depth||e.depth<3)&&Xl(e)&&(t.options.setext||n))}function dC(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(uC(e,n)){const u=n.enter("headingSetext"),d=n.enter("phrasing"),h=n.containerPhrasing(e,{...s.current(),before:`
|
|
48
48
|
`,after:`
|
|
49
49
|
`});return d(),u(),h+`
|
|
50
50
|
`+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
|
|
51
51
|
`))+1))}const o="#".repeat(i),a=n.enter("headingAtx"),l=n.enter("phrasing");s.move(o+" ");let c=n.containerPhrasing(e,{before:"# ",after:`
|
|
52
|
-
`,...s.current()});return/^[\t ]/.test(c)&&(c="&#x"+c.charCodeAt(0).toString(16).toUpperCase()+";"+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),l(),a(),c}
|
|
52
|
+
`,...s.current()});return/^[\t ]/.test(c)&&(c="&#x"+c.charCodeAt(0).toString(16).toUpperCase()+";"+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),l(),a(),c}Lh.peek=fC;function Lh(e){return e.value||""}function fC(){return"<"}Dh.peek=hC;function Dh(e,t,n,r){const i=Sc(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let c=l.move("![");return c+=l.move(n.safe(e.alt,{before:c,after:"]",...l.current()})),c+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),c+=l.move("<"),c+=l.move(n.safe(e.url,{before:c,after:">",...l.current()})),c+=l.move(">")):(a=n.enter("destinationRaw"),c+=l.move(n.safe(e.url,{before:c,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),c+=l.move(" "+i),c+=l.move(n.safe(e.title,{before:c,after:i,...l.current()})),c+=l.move(i),a()),c+=l.move(")"),o(),c}function hC(){return"!"}Nh.peek=pC;function Nh(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const c=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=u,s(),i==="full"||!c||c!==d?l+=a.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function pC(){return"!"}jh.peek=mC;function jh(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const o=n.unsafe[s],a=n.compilePattern(o);let l;if(o.atBreak)for(;l=a.exec(r);){let c=l.index;r.charCodeAt(c)===10&&r.charCodeAt(c-1)===13&&c--,r=r.slice(0,c)+" "+r.slice(l.index+1)}}return i+r+i}function mC(){return"`"}function Uh(e,t){const n=Xl(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}Fh.peek=gC;function Fh(e,t,n,r){const i=Sc(n),s=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let a,l;if(Uh(e,n)){const u=n.stack;n.stack=[],a=n.enter("autolink");let d=o.move("<");return d+=o.move(n.containerPhrasing(e,{before:d,after:">",...o.current()})),d+=o.move(">"),a(),n.stack=u,d}a=n.enter("link"),l=n.enter("label");let c=o.move("[");return c+=o.move(n.containerPhrasing(e,{before:c,after:"](",...o.current()})),c+=o.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(l=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":")",...o.current()}))),l(),e.title&&(l=n.enter(`title${s}`),c+=o.move(" "+i),c+=o.move(n.safe(e.title,{before:c,after:i,...o.current()})),c+=o.move(i),l()),c+=o.move(")"),a(),c}function gC(e,t,n){return Uh(e,n)?"<":"["}Bh.peek=yC;function Bh(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const c=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(c+"]["),o();const u=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=u,s(),i==="full"||!c||c!==d?l+=a.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function yC(){return"["}function Tc(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function vC(e){const t=Tc(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function bC(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Vh(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function wC(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?bC(n):Tc(n);const a=e.ordered?o==="."?")":".":vC(n);let l=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const u=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&u&&(!u.children||!u.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),Vh(n)===o&&u){let d=-1;for(;++d<e.children.length;){const h=e.children[d];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(o=a),n.bulletCurrent=o;const c=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=s,i(),c}function xC(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function _C(e,t,n,r){const i=xC(n);let s=n.bulletCurrent||Tc(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const a=n.createTracker(r);a.move(s+" ".repeat(o-s.length)),a.shift(o);const l=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,a.current()),u);return l(),c;function u(d,h,f){return h?(f?"":" ".repeat(o))+d:(f?s:s+" ".repeat(o-s.length))+d}}function kC(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),i(),o}const CC=Lo(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function EC(e,t,n,r){return(e.children.some(function(o){return CC(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function SC(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}zh.peek=TC;function zh(e,t,n,r){const i=SC(n),s=n.enter("strong"),o=n.createTracker(r);let a=o.move(i+i);return a+=o.move(n.containerPhrasing(e,{before:a,after:i,...o.current()})),a+=o.move(i+i),s(),a}function TC(e,t,n){return n.options.strong||"*"}function OC(e,t,n,r){return n.safe(e.value,r)}function IC(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function PC(e,t,n){const r=(Vh(n)+(n.options.ruleSpaces?" ":"")).repeat(IC(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Zh={blockquote:X1,break:$h,code:sC,definition:aC,emphasis:Mh,hardBreak:$h,heading:dC,html:Lh,image:Dh,imageReference:Nh,inlineCode:jh,link:Fh,linkReference:Bh,list:wC,listItem:_C,paragraph:kC,root:EC,strong:zh,text:OC,thematicBreak:PC};function AC(){return{enter:{table:RC,tableData:Wh,tableHeader:Wh,tableRow:MC},exit:{codeText:LC,table:$C,tableData:Oc,tableHeader:Oc,tableRow:Oc}}}function RC(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function $C(e){this.exit(e),this.data.inTable=void 0}function MC(e){this.enter({type:"tableRow",children:[]},e)}function Oc(e){this.exit(e)}function Wh(e){this.enter({type:"tableCell",children:[]},e)}function LC(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,DC));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function DC(e,t){return t==="|"?t:e}function NC(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
53
53
|
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:h,table:o,tableCell:l,tableRow:a}};function o(f,p,m,y){return c(u(f,m,y),f.align)}function a(f,p,m,y){const v=d(f,m,y),b=c([v]);return b.slice(0,b.indexOf(`
|
|
54
|
-
`))}function l(f,p,m,y){const v=m.enter("tableCell"),b=m.enter("phrasing"),x=m.containerPhrasing(f,{...y,before:s,after:s});return b(),v(),x}function c(f,p){return Qk(f,{align:p,alignDelimiters:r,padding:n,stringLength:i})}function u(f,p,m){const y=f.children;let v=-1;const b=[],x=p.enter("table");for(;++v<y.length;)b[v]=d(y[v],p,m);return x(),b}function d(f,p,m){const y=f.children;let v=-1;const b=[],x=p.enter("tableRow");for(;++v<y.length;)b[v]=l(y[v],f,p,m);return x(),b}function h(f,p,m){let y=Ah.inlineCode(f,p,m);return m.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function F1(){return{exit:{taskListCheckValueChecked:$h,taskListCheckValueUnchecked:$h,paragraph:V1}}}function B1(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:z1}}}function $h(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function V1(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,o;for(;++s<i.length;){const a=i[s];if(a.type==="paragraph"){o=a;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function z1(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);s&&a.move(o);let l=Ah.listItem(e,t,n,{...r,...a.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+o}}function Z1(){return[xk(),$k(),qk(),$1(),F1()]}function W1(e){return{extensions:[_k(),Mk(),Kk(),U1(e),B1()]}}const H1={tokenize:Q1,partial:!0},Mh={tokenize:X1,partial:!0},Lh={tokenize:eC,partial:!0},Dh={tokenize:tC,partial:!0},q1={tokenize:nC,partial:!0},Nh={tokenize:G1,previous:Uh},jh={tokenize:Y1,previous:Fh},ur={tokenize:J1,previous:Bh},Kn={};function K1(){return{text:Kn}}let oi=48;for(;oi<123;)Kn[oi]=ur,oi++,oi===58?oi=65:oi===91&&(oi=97);Kn[43]=ur,Kn[45]=ur,Kn[46]=ur,Kn[95]=ur,Kn[72]=[ur,jh],Kn[104]=[ur,jh],Kn[87]=[ur,Nh],Kn[119]=[ur,Nh];function J1(e,t,n){const r=this;let i,s;return o;function o(d){return!vc(d)||!Bh.call(r,r.previous)||bc(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(d))}function a(d){return vc(d)?(e.consume(d),a):d===64?(e.consume(d),l):n(d)}function l(d){return d===46?e.check(q1,u,c)(d):d===45||d===95||rn(d)?(s=!0,e.consume(d),l):u(d)}function c(d){return e.consume(d),i=!0,l}function u(d){return s&&i&&un(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function G1(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!Uh.call(r,r.previous)||bc(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(H1,e.attempt(Mh,e.attempt(Lh,s),n),n)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function Y1(e,t,n){const r=this;let i="",s=!1;return o;function o(d){return(d===72||d===104)&&Fh.call(r,r.previous)&&!bc(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),a):n(d)}function a(d){if(un(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),a;if(d===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(d),l}return n(d)}function l(d){return d===47?(e.consume(d),s?c:(s=!0,l)):n(d)}function c(d){return d===null||po(d)||gt(d)||si(d)||mo(d)?n(d):e.attempt(Mh,e.attempt(Lh,u),n)(d)}function u(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function Q1(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),s):n(o)}function s(o){return o===null?n(o):t(o)}}function X1(e,t,n){let r,i,s;return o;function o(c){return c===46||c===95?e.check(Dh,l,a)(c):c===null||gt(c)||si(c)||c!==45&&mo(c)?l(c):(s=!0,e.consume(c),o)}function a(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),o}function l(c){return i||r||!s?n(c):t(c)}}function eC(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?s(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Dh,t,s)(o):o===null||gt(o)||si(o)?t(o):(e.consume(o),i)}function s(o){return o===41&&r++,e.consume(o),i}}function tC(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),s):a===93?(e.consume(a),i):a===60||a===null||gt(a)||si(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||gt(a)||si(a)?t(a):r(a)}function s(a){return un(a)?o(a):n(a)}function o(a){return a===59?(e.consume(a),r):un(a)?(e.consume(a),o):n(a)}}function nC(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return rn(s)?n(s):t(s)}}function Uh(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||gt(e)}function Fh(e){return!un(e)}function Bh(e){return!(e===47||vc(e))}function vc(e){return e===43||e===45||e===46||e===95||rn(e)}function bc(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const rC={tokenize:dC,partial:!0};function iC(){return{document:{91:{tokenize:lC,continuation:{tokenize:cC},exit:uC}},text:{91:{tokenize:aC},93:{add:"after",tokenize:sC,resolveTo:oC}}}}function sC(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!o||!o._balanced)return n(l);const c=Nn(r.sliceSerialize({start:o.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function oC(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function aC(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return a;function a(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(d){if(s>999||d===93&&!o||d===null||d===91||gt(d))return n(d);if(d===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Nn(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return gt(d)||(o=!0),s++,e.consume(d),d===92?u:c}function u(d){return d===91||d===92||d===93?(e.consume(d),s++,c):c(d)}}function lC(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,a;return l;function l(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(p)}function u(p){if(o>999||p===93&&!a||p===null||p===91||gt(p))return n(p);if(p===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return s=Nn(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return gt(p)||(a=!0),o++,e.consume(p),p===92?d:u}function d(p){return p===91||p===92||p===93?(e.consume(p),o++,u):u(p)}function h(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(s)||i.push(s),at(e,f,"gfmFootnoteDefinitionWhitespace")):n(p)}function f(p){return t(p)}}function cC(e,t,n){return e.check(vs,t,e.attempt(rC,t,n))}function uC(e){e.exit("gfmFootnoteDefinition")}function dC(e,t,n){const r=this;return at(e,i,"gfmFootnoteDefinitionIndent",4+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function fC(e){let n=(e||{}).singleTilde;const r={tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,a){let l=-1;for(;++l<o.length;)if(o[l][0]==="enter"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._close){let c=l;for(;c--;)if(o[c][0]==="exit"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._open&&o[l][1].end.offset-o[l][1].start.offset===o[c][1].end.offset-o[c][1].start.offset){o[l][1].type="strikethroughSequence",o[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},o[c][1].start),end:Object.assign({},o[l][1].end)},d={type:"strikethroughText",start:Object.assign({},o[c][1].end),end:Object.assign({},o[l][1].start)},h=[["enter",u,a],["enter",o[c][1],a],["exit",o[c][1],a],["enter",d,a]],f=a.parser.constructs.insideSpan.null;f&&xn(h,h.length,0,yo(f,o.slice(c+1,l),a)),xn(h,h.length,0,[["exit",d,a],["enter",o[l][1],a],["exit",o[l][1],a],["exit",u,a]]),xn(o,c-1,l-c+3,h),l=c+h.length-2;break}}for(l=-1;++l<o.length;)o[l][1].type==="strikethroughSequenceTemporary"&&(o[l][1].type="data");return o}function s(o,a,l){const c=this.previous,u=this.events;let d=0;return h;function h(p){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(p):(o.enter("strikethroughSequenceTemporary"),f(p))}function f(p){const m=go(c);if(p===126)return d>1?l(p):(o.consume(p),d++,f);if(d<2&&!n)return l(p);const y=o.exit("strikethroughSequenceTemporary"),v=go(p);return y._open=!v||v===2&&!!m,y._close=!m||m===2&&!!v,a(p)}}}class hC{constructor(){this.map=[]}add(t,n,r){pC(this,t,n,r)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push([...t]),t.length=0;let i=r.pop();for(;i;)t.push(...i),i=r.pop();this.map.length=0}}function pC(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function mC(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function gC(){return{flow:{null:{tokenize:yC,resolveAll:vC}}}}function yC(e,t,n){const r=this;let i=0,s=0,o;return a;function a(I){let j=r.events.length-1;for(;j>-1;){const H=r.events[j][1].type;if(H==="lineEnding"||H==="linePrefix")j--;else break}const J=j>-1?r.events[j][1].type:null,q=J==="tableHead"||J==="tableRow"?O:l;return q===O&&r.parser.lazy[r.now().line]?n(I):q(I)}function l(I){return e.enter("tableHead"),e.enter("tableRow"),c(I)}function c(I){return I===124||(o=!0,s+=1),u(I)}function u(I){return I===null?n(I):ze(I)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),f):n(I):rt(I)?at(e,u,"whitespace")(I):(s+=1,o&&(o=!1,i+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),o=!0,u):(e.enter("data"),d(I)))}function d(I){return I===null||I===124||gt(I)?(e.exit("data"),u(I)):(e.consume(I),I===92?h:d)}function h(I){return I===92||I===124?(e.consume(I),d):d(I)}function f(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(I):(e.enter("tableDelimiterRow"),o=!1,rt(I)?at(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):p(I))}function p(I){return I===45||I===58?y(I):I===124?(o=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),m):A(I)}function m(I){return rt(I)?at(e,y,"whitespace")(I):y(I)}function y(I){return I===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),v):I===45?(s+=1,v(I)):I===null||ze(I)?P(I):A(I)}function v(I){return I===45?(e.enter("tableDelimiterFiller"),b(I)):A(I)}function b(I){return I===45?(e.consume(I),b):I===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(I))}function x(I){return rt(I)?at(e,P,"whitespace")(I):P(I)}function P(I){return I===124?p(I):I===null||ze(I)?!o||i!==s?A(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(I)):A(I)}function A(I){return n(I)}function O(I){return e.enter("tableRow"),U(I)}function U(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),U):I===null||ze(I)?(e.exit("tableRow"),t(I)):rt(I)?at(e,U,"whitespace")(I):(e.enter("data"),F(I))}function F(I){return I===null||I===124||gt(I)?(e.exit("data"),U(I)):(e.consume(I),I===92?B:F)}function B(I){return I===92||I===124?(e.consume(I),F):F(I)}}function vC(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],a=!1,l=0,c,u,d;const h=new hC;for(;++n<e.length;){const f=e[n],p=f[1];f[0]==="enter"?p.type==="tableHead"?(a=!1,l!==0&&(Vh(h,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},h.add(n,0,[["enter",c,t]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,d=void 0,s=[0,0,0,0],o=[0,n+1,0,0],a&&(a=!1,u={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},h.add(n,0,[["enter",u,t]])),i=p.type==="tableDelimiterRow"?2:u?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],d=Io(h,t,s,i,void 0,d),s=[0,0,0,0]),o[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],d=Io(h,t,s,i,void 0,d)),s=o,o=[s[1],n,0,0])):p.type==="tableHead"?(a=!0,l=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(l=n,s[1]!==0?(o[0]=o[1],d=Io(h,t,s,i,n,d)):o[1]!==0&&(d=Io(h,t,o,i,n,d)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(o[3]=n)}for(l!==0&&Vh(h,t,l,c,u),h.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=mC(t.events,n))}return e}function Io(e,t,n,r,i,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(s.end=Object.assign({},Ai(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=Ai(t.events,n[1]);if(s={type:o,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const c=Ai(t.events,n[2]),u=Ai(t.events,n[3]),d={type:a,start:Object.assign({},c),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const h=t.events[n[2]],f=t.events[n[3]];if(h[1].end=Object.assign({},f[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,m=n[3]-n[2]-1;e.add(p,m,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(s.end=Object.assign({},Ai(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function Vh(e,t,n,r,i){const s=[],o=Ai(t.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function Ai(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const bC={tokenize:xC};function wC(){return{text:{91:bC}}}function xC(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return gt(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),o):n(l)}function o(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return ze(l)?t(l):rt(l)?e.check({tokenize:_C},t,n)(l):n(l)}}function _C(e,t,n){return at(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function kC(e){return yf([K1(),iC(),fC(e),gC(),wC()])}const CC={};function EC(e){const t=this,n=e||CC,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(kC(n)),s.push(Z1()),o.push(W1(n))}const SC=({text:e,type:t,styles:n})=>{const r=n==null?void 0:n[t],i={h1:({node:s,...o})=>Z.jsx("h1",{...o,...r==null?void 0:r.heading1}),h2:({node:s,...o})=>Z.jsx("h2",{...o,...r==null?void 0:r.heading2}),h3:({node:s,...o})=>Z.jsx("h3",{...o,...r==null?void 0:r.heading3}),h4:"h3",h5:"h3",h6:"h3",em:({node:s,...o})=>Z.jsx("em",{...o,...r==null?void 0:r.italic}),strong:({node:s,...o})=>Z.jsx("strong",{...o,...r==null?void 0:r.bold}),p:({node:s,...o})=>Z.jsx("p",{...o,...r==null?void 0:r.text}),hr:({node:s,...o})=>Z.jsx("hr",{...o,...r==null?void 0:r.horizontalRule}),a:({node:s,...o})=>Z.jsx("a",{...o,...r==null?void 0:r.link}),ol:({node:s,...o})=>Z.jsx("ol",{...o,...r==null?void 0:r.orderedList}),ul:({node:s,...o})=>Z.jsx("ul",{...o,...r==null?void 0:r.unorderedList}),li:({node:s,...o})=>Z.jsx("li",{...o,...r==null?void 0:r.listItem}),br:({node:s,...o})=>Z.jsx("br",{...o,...r==null?void 0:r.lineBreak}),img:()=>null,pre:({node:s,...o})=>Z.jsx("pre",{...o,...r==null?void 0:r.pre})};return Z.jsx(fk,{components:i,remarkPlugins:[EC,wk],children:e})},zh=_.createContext(null);function Zh(){const e=_.useContext(zh);if(!e)throw new Error("useComposerContext must be used within a Message");return e}const Wh=_.createContext(null);function TC(){const e=_.useContext(Wh);if(!e)throw new Error("useMessageContext must be used within a Message");return e}const Hh=_.createContext(null);function qh(){const e=_.useContext(Hh);if(!e)throw new Error("useModalContext must be used within a ModalProvider");return e}const Kh=_.createContext(null);function ht(){const e=_.useContext(Kh);if(!e)throw new Error("useWebchatContext must be used within a WebchatProvider");return e}const OC=({text:e,buttonValue:t,type:n,styles:r,variant:i,groupId:s,reusable:o,...a})=>{const{eventEmitter:l,client:c}=ht(),[u,d]=_.useState(!1),[h,f]=_.useState(!1),[p,m]=_.useState(!1),{state:y}=ht();_.useEffect(()=>{if(s)return l.on(`button-group-${s}-click`,()=>{f(!0),o||m(!0)})},[l,s,o]);function v(){s&&l.emit(`button-group-${s}-click`),d(!0),o||m(!0),i!=="link"&&(c==null||c.sendMessage(t))}return Z.jsx(IC,{...a,variant:i,onClick:v,disabled:p||y.isReadOnly,"data-activated":u?"":void 0,"data-group-activated":h?"":void 0,"data-type":i,value:t,...r==null?void 0:r[n],children:e})},IC=e=>{if(e.variant==="link"){const{value:r,variant:i,...s}=e;return Z.jsx("a",{...s,href:r,target:"_blank",rel:"noopener noreferrer"})}const{variant:t,...n}=e;return Z.jsx("button",{...n})},PC=_.forwardRef(({block:e,styles:t,type:n,...r},i)=>Z.jsx("div",{...r,...t==null?void 0:t[n],ref:i,children:Z.jsx(Ui,{styles:t,block:e})}));function AC(e,t){const n=t?`The ${t} has been copied to your clipboard.`:"Copied to clipboard.";return navigator.clipboard.writeText(e).then(()=>qE({title:n,type:"success"}))}const RC=(e,t={})=>new Promise((n,r)=>{if(typeof window>"u")return r("Window is not defined");if(!e)return r("Url is not defined");let i=null;const s=new Image;s.addEventListener("load",()=>{i&&clearTimeout(i),n({width:s.naturalWidth,height:s.naturalHeight})}),s.addEventListener("error",o=>{i&&clearTimeout(i),r(`${o.type}: ${o.message}`)}),s.src=e,t.timeout&&(i=setTimeout(()=>r("Timeout"),t.timeout))});let $C={data:""},MC=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||$C,LC=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,DC=/\/\*[^]*?\*\/| +/g,Jh=/\n+/g,Rr=(e,t)=>{let n="",r="",i="";for(let s in e){let o=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+o+";":r+=s[1]=="f"?Rr(o,s):s+"{"+Rr(o,s[1]=="k"?"":t)+"}":typeof o=="object"?r+=Rr(o,t?t.replace(/([^,])+/g,a=>s.replace(/(^:.*)|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):s):o!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=Rr.p?Rr.p(s,o):s+":"+o+";")}return n+(t&&i?t+"{"+i+"}":i)+r},dr={},Gh=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+Gh(e[n]);return t}return e},NC=(e,t,n,r,i)=>{let s=Gh(e),o=dr[s]||(dr[s]=(l=>{let c=0,u=11;for(;c<l.length;)u=101*u+l.charCodeAt(c++)>>>0;return"go"+u})(s));if(!dr[o]){let l=s!==e?e:(c=>{let u,d,h=[{}];for(;u=LC.exec(c.replace(DC,""));)u[4]?h.shift():u[3]?(d=u[3].replace(Jh," ").trim(),h.unshift(h[0][d]=h[0][d]||{})):h[0][u[1]]=u[2].replace(Jh," ").trim();return h[0]})(e);dr[o]=Rr(i?{["@keyframes "+o]:l}:l,n?"":"."+o)}let a=n&&dr.g?dr.g:null;return n&&(dr.g=dr[o]),((l,c,u,d)=>{d?c.data=c.data.replace(d,l):c.data.indexOf(l)===-1&&(c.data=u?l+c.data:c.data+l)})(dr[o],t,r,a),o},jC=(e,t,n)=>e.reduce((r,i,s)=>{let o=t[s];if(o&&o.call){let a=o(n),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;o=l?"."+l:a&&typeof a=="object"?a.props?"":Rr(a,""):a===!1?"":a}return r+i+(o??"")},"");function Po(e){let t=this||{},n=e.call?e(t.p):e;return NC(n.unshift?n.raw?jC(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,MC(t.target),t.g,t.o,t.k)}let Yh,wc,xc;Po.bind({g:1});let fr=Po.bind({k:1});function UC(e,t,n,r){Rr.p=t,Yh=e,wc=n,xc=r}function $r(e,t){let n=this||{};return function(){let r=arguments;function i(s,o){let a=Object.assign({},s),l=a.className||i.className;n.p=Object.assign({theme:wc&&wc()},a),n.o=/ *go\d+/.test(l),a.className=Po.apply(n,r)+(l?" "+l:""),t&&(a.ref=o);let c=e;return e[0]&&(c=a.as||e,delete a.as),xc&&c[0]&&xc(a),Yh(c,a)}return t?t(i):i}}var FC=e=>typeof e=="function",Ao=(e,t)=>FC(e)?e(t):e,BC=(()=>{let e=0;return()=>(++e).toString()})(),Qh=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),VC=20,Ro=new Map,zC=1e3,Xh=e=>{if(Ro.has(e))return;let t=setTimeout(()=>{Ro.delete(e),ai({type:4,toastId:e})},zC);Ro.set(e,t)},ZC=e=>{let t=Ro.get(e);t&&clearTimeout(t)},_c=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,VC)};case 1:return t.toast.id&&ZC(t.toast.id),{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return e.toasts.find(s=>s.id===n.id)?_c(e,{type:1,toast:n}):_c(e,{type:0,toast:n});case 3:let{toastId:r}=t;return r?Xh(r):e.toasts.forEach(s=>{Xh(s.id)}),{...e,toasts:e.toasts.map(s=>s.id===r||r===void 0?{...s,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(s=>({...s,pauseDuration:s.pauseDuration+i}))}}},$o=[],Mo={toasts:[],pausedAt:void 0},ai=e=>{Mo=_c(Mo,e),$o.forEach(t=>{t(Mo)})},WC={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},HC=(e={})=>{let[t,n]=_.useState(Mo);_.useEffect(()=>($o.push(n),()=>{let i=$o.indexOf(n);i>-1&&$o.splice(i,1)}),[t]);let r=t.toasts.map(i=>{var s,o;return{...e,...e[i.type],...i,duration:i.duration||((s=e[i.type])==null?void 0:s.duration)||(e==null?void 0:e.duration)||WC[i.type],style:{...e.style,...(o=e[i.type])==null?void 0:o.style,...i.style}}});return{...t,toasts:r}},qC=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||BC()}),_s=e=>(t,n)=>{let r=qC(t,e,n);return ai({type:2,toast:r}),r.id},mn=(e,t)=>_s("blank")(e,t);mn.error=_s("error"),mn.success=_s("success"),mn.loading=_s("loading"),mn.custom=_s("custom"),mn.dismiss=e=>{ai({type:3,toastId:e})},mn.remove=e=>ai({type:4,toastId:e}),mn.promise=(e,t,n)=>{let r=mn.loading(t.loading,{...n,...n==null?void 0:n.loading});return e.then(i=>(mn.success(Ao(t.success,i),{id:r,...n,...n==null?void 0:n.success}),i)).catch(i=>{mn.error(Ao(t.error,i),{id:r,...n,...n==null?void 0:n.error})}),e};var KC=(e,t)=>{ai({type:1,toast:{id:e,height:t}})},JC=()=>{ai({type:5,time:Date.now()})},GC=e=>{let{toasts:t,pausedAt:n}=HC(e);_.useEffect(()=>{if(n)return;let s=Date.now(),o=t.map(a=>{if(a.duration===1/0)return;let l=(a.duration||0)+a.pauseDuration-(s-a.createdAt);if(l<0){a.visible&&mn.dismiss(a.id);return}return setTimeout(()=>mn.dismiss(a.id),l)});return()=>{o.forEach(a=>a&&clearTimeout(a))}},[t,n]);let r=_.useCallback(()=>{n&&ai({type:6,time:Date.now()})},[n]),i=_.useCallback((s,o)=>{let{reverseOrder:a=!1,gutter:l=8,defaultPosition:c}=o||{},u=t.filter(f=>(f.position||c)===(s.position||c)&&f.height),d=u.findIndex(f=>f.id===s.id),h=u.filter((f,p)=>p<d&&f.visible).length;return u.filter(f=>f.visible).slice(...a?[h+1]:[0,h]).reduce((f,p)=>f+(p.height||0)+l,0)},[t]);return{toasts:t,handlers:{updateHeight:KC,startPause:JC,endPause:r,calculateOffset:i}}},YC=fr`
|
|
54
|
+
`))}function l(f,p,m,y){const v=m.enter("tableCell"),b=m.enter("phrasing"),x=m.containerPhrasing(f,{...y,before:s,after:s});return b(),v(),x}function c(f,p){return G1(f,{align:p,alignDelimiters:r,padding:n,stringLength:i})}function u(f,p,m){const y=f.children;let v=-1;const b=[],x=p.enter("table");for(;++v<y.length;)b[v]=d(y[v],p,m);return x(),b}function d(f,p,m){const y=f.children;let v=-1;const b=[],x=p.enter("tableRow");for(;++v<y.length;)b[v]=l(y[v],f,p,m);return x(),b}function h(f,p,m){let y=Zh.inlineCode(f,p,m);return m.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function jC(){return{exit:{taskListCheckValueChecked:Hh,taskListCheckValueUnchecked:Hh,paragraph:FC}}}function UC(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:BC}}}function Hh(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function FC(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,o;for(;++s<i.length;){const a=i[s];if(a.type==="paragraph"){o=a;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function BC(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);s&&a.move(o);let l=Zh.listItem(e,t,n,{...r,...a.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,c)),l;function c(u){return u+o}}function VC(){return[b1(),A1(),W1(),AC(),jC()]}function zC(e){return{extensions:[w1(),R1(),H1(),NC(e),UC()]}}const ZC={tokenize:GC,partial:!0},qh={tokenize:YC,partial:!0},Kh={tokenize:QC,partial:!0},Jh={tokenize:XC,partial:!0},WC={tokenize:eE,partial:!0},Gh={tokenize:KC,previous:Qh},Yh={tokenize:JC,previous:Xh},pr={tokenize:qC,previous:ep},Qn={};function HC(){return{text:Qn}}let fi=48;for(;fi<123;)Qn[fi]=pr,fi++,fi===58?fi=65:fi===91&&(fi=97);Qn[43]=pr,Qn[45]=pr,Qn[46]=pr,Qn[95]=pr,Qn[72]=[pr,Yh],Qn[104]=[pr,Yh],Qn[87]=[pr,Gh],Qn[119]=[pr,Gh];function qC(e,t,n){const r=this;let i,s;return o;function o(d){return!Ic(d)||!ep.call(r,r.previous)||Pc(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(d))}function a(d){return Ic(d)?(e.consume(d),a):d===64?(e.consume(d),l):n(d)}function l(d){return d===46?e.check(WC,u,c)(d):d===45||d===95||an(d)?(s=!0,e.consume(d),l):u(d)}function c(d){return e.consume(d),i=!0,l}function u(d){return s&&i&&hn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function KC(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!Qh.call(r,r.previous)||Pc(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(ZC,e.attempt(qh,e.attempt(Kh,s),n),n)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function JC(e,t,n){const r=this;let i="",s=!1;return o;function o(d){return(d===72||d===104)&&Xh.call(r,r.previous)&&!Pc(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),a):n(d)}function a(d){if(hn(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),a;if(d===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(d),l}return n(d)}function l(d){return d===47?(e.consume(d),s?c:(s=!0,l)):n(d)}function c(d){return d===null||Co(d)||vt(d)||di(d)||Eo(d)?n(d):e.attempt(qh,e.attempt(Kh,u),n)(d)}function u(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function GC(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),s):n(o)}function s(o){return o===null?n(o):t(o)}}function YC(e,t,n){let r,i,s;return o;function o(c){return c===46||c===95?e.check(Jh,l,a)(c):c===null||vt(c)||di(c)||c!==45&&Eo(c)?l(c):(s=!0,e.consume(c),o)}function a(c){return c===95?r=!0:(i=r,r=void 0),e.consume(c),o}function l(c){return i||r||!s?n(c):t(c)}}function QC(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?s(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(Jh,t,s)(o):o===null||vt(o)||di(o)?t(o):(e.consume(o),i)}function s(o){return o===41&&r++,e.consume(o),i}}function XC(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),s):a===93?(e.consume(a),i):a===60||a===null||vt(a)||di(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||vt(a)||di(a)?t(a):r(a)}function s(a){return hn(a)?o(a):n(a)}function o(a){return a===59?(e.consume(a),r):hn(a)?(e.consume(a),o):n(a)}}function eE(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return an(s)?n(s):t(s)}}function Qh(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||vt(e)}function Xh(e){return!hn(e)}function ep(e){return!(e===47||Ic(e))}function Ic(e){return e===43||e===45||e===46||e===95||an(e)}function Pc(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const tE={tokenize:cE,partial:!0};function nE(){return{document:{91:{tokenize:oE,continuation:{tokenize:aE},exit:lE}},text:{91:{tokenize:sE},93:{add:"after",tokenize:rE,resolveTo:iE}}}}function rE(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!o||!o._balanced)return n(l);const c=Fn(r.sliceSerialize({start:o.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function iE(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function sE(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return a;function a(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(d){if(s>999||d===93&&!o||d===null||d===91||vt(d))return n(d);if(d===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Fn(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return vt(d)||(o=!0),s++,e.consume(d),d===92?u:c}function u(d){return d===91||d===92||d===93?(e.consume(d),s++,c):c(d)}}function oE(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,a;return l;function l(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):n(p)}function u(p){if(o>999||p===93&&!a||p===null||p===91||vt(p))return n(p);if(p===93){e.exit("chunkString");const m=e.exit("gfmFootnoteDefinitionLabelString");return s=Fn(r.sliceSerialize(m)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return vt(p)||(a=!0),o++,e.consume(p),p===92?d:u}function d(p){return p===91||p===92||p===93?(e.consume(p),o++,u):u(p)}function h(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),i.includes(s)||i.push(s),ct(e,f,"gfmFootnoteDefinitionWhitespace")):n(p)}function f(p){return t(p)}}function aE(e,t,n){return e.check(Es,t,e.attempt(tE,t,n))}function lE(e){e.exit("gfmFootnoteDefinition")}function cE(e,t,n){const r=this;return ct(e,i,"gfmFootnoteDefinitionIndent",4+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function uE(e){let n=(e||{}).singleTilde;const r={tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,a){let l=-1;for(;++l<o.length;)if(o[l][0]==="enter"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._close){let c=l;for(;c--;)if(o[c][0]==="exit"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._open&&o[l][1].end.offset-o[l][1].start.offset===o[c][1].end.offset-o[c][1].start.offset){o[l][1].type="strikethroughSequence",o[c][1].type="strikethroughSequence";const u={type:"strikethrough",start:Object.assign({},o[c][1].start),end:Object.assign({},o[l][1].end)},d={type:"strikethroughText",start:Object.assign({},o[c][1].end),end:Object.assign({},o[l][1].start)},h=[["enter",u,a],["enter",o[c][1],a],["exit",o[c][1],a],["enter",d,a]],f=a.parser.constructs.insideSpan.null;f&&Cn(h,h.length,0,To(f,o.slice(c+1,l),a)),Cn(h,h.length,0,[["exit",d,a],["enter",o[l][1],a],["exit",o[l][1],a],["exit",u,a]]),Cn(o,c-1,l-c+3,h),l=c+h.length-2;break}}for(l=-1;++l<o.length;)o[l][1].type==="strikethroughSequenceTemporary"&&(o[l][1].type="data");return o}function s(o,a,l){const c=this.previous,u=this.events;let d=0;return h;function h(p){return c===126&&u[u.length-1][1].type!=="characterEscape"?l(p):(o.enter("strikethroughSequenceTemporary"),f(p))}function f(p){const m=So(c);if(p===126)return d>1?l(p):(o.consume(p),d++,f);if(d<2&&!n)return l(p);const y=o.exit("strikethroughSequenceTemporary"),v=So(p);return y._open=!v||v===2&&!!m,y._close=!m||m===2&&!!v,a(p)}}}class dE{constructor(){this.map=[]}add(t,n,r){fE(this,t,n,r)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push([...t]),t.length=0;let i=r.pop();for(;i;)t.push(...i),i=r.pop();this.map.length=0}}function fE(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function hE(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function pE(){return{flow:{null:{tokenize:mE,resolveAll:gE}}}}function mE(e,t,n){const r=this;let i=0,s=0,o;return a;function a(O){let N=r.events.length-1;for(;N>-1;){const W=r.events[N][1].type;if(W==="lineEnding"||W==="linePrefix")N--;else break}const J=N>-1?r.events[N][1].type:null,q=J==="tableHead"||J==="tableRow"?T:l;return q===T&&r.parser.lazy[r.now().line]?n(O):q(O)}function l(O){return e.enter("tableHead"),e.enter("tableRow"),c(O)}function c(O){return O===124||(o=!0,s+=1),u(O)}function u(O){return O===null?n(O):ze(O)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),f):n(O):st(O)?ct(e,u,"whitespace")(O):(s+=1,o&&(o=!1,i+=1),O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),o=!0,u):(e.enter("data"),d(O)))}function d(O){return O===null||O===124||vt(O)?(e.exit("data"),u(O)):(e.consume(O),O===92?h:d)}function h(O){return O===92||O===124?(e.consume(O),d):d(O)}function f(O){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(O):(e.enter("tableDelimiterRow"),o=!1,st(O)?ct(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):p(O))}function p(O){return O===45||O===58?y(O):O===124?(o=!0,e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),m):P(O)}function m(O){return st(O)?ct(e,y,"whitespace")(O):y(O)}function y(O){return O===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),v):O===45?(s+=1,v(O)):O===null||ze(O)?I(O):P(O)}function v(O){return O===45?(e.enter("tableDelimiterFiller"),b(O)):P(O)}function b(O){return O===45?(e.consume(O),b):O===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(O),e.exit("tableDelimiterMarker"),x):(e.exit("tableDelimiterFiller"),x(O))}function x(O){return st(O)?ct(e,I,"whitespace")(O):I(O)}function I(O){return O===124?p(O):O===null||ze(O)?!o||i!==s?P(O):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(O)):P(O)}function P(O){return n(O)}function T(O){return e.enter("tableRow"),j(O)}function j(O){return O===124?(e.enter("tableCellDivider"),e.consume(O),e.exit("tableCellDivider"),j):O===null||ze(O)?(e.exit("tableRow"),t(O)):st(O)?ct(e,j,"whitespace")(O):(e.enter("data"),U(O))}function U(O){return O===null||O===124||vt(O)?(e.exit("data"),j(O)):(e.consume(O),O===92?F:U)}function F(O){return O===92||O===124?(e.consume(O),U):U(O)}}function gE(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],a=!1,l=0,c,u,d;const h=new dE;for(;++n<e.length;){const f=e[n],p=f[1];f[0]==="enter"?p.type==="tableHead"?(a=!1,l!==0&&(tp(h,t,l,c,u),u=void 0,l=0),c={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},h.add(n,0,[["enter",c,t]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,d=void 0,s=[0,0,0,0],o=[0,n+1,0,0],a&&(a=!1,u={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},h.add(n,0,[["enter",u,t]])),i=p.type==="tableDelimiterRow"?2:u?3:1):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],d=Uo(h,t,s,i,void 0,d),s=[0,0,0,0]),o[2]=n)):p.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],d=Uo(h,t,s,i,void 0,d)),s=o,o=[s[1],n,0,0])):p.type==="tableHead"?(a=!0,l=n):p.type==="tableRow"||p.type==="tableDelimiterRow"?(l=n,s[1]!==0?(o[0]=o[1],d=Uo(h,t,s,i,n,d)):o[1]!==0&&(d=Uo(h,t,o,i,n,d)),i=0):i&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(o[3]=n)}for(l!==0&&tp(h,t,l,c,u),h.consume(t.events),n=-1;++n<t.events.length;){const f=t.events[n];f[0]==="enter"&&f[1].type==="table"&&(f[1]._align=hE(t.events,n))}return e}function Uo(e,t,n,r,i,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(s.end=Object.assign({},Ni(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=Ni(t.events,n[1]);if(s={type:o,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const c=Ni(t.events,n[2]),u=Ni(t.events,n[3]),d={type:a,start:Object.assign({},c),end:Object.assign({},u)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const h=t.events[n[2]],f=t.events[n[3]];if(h[1].end=Object.assign({},f[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const p=n[2]+1,m=n[3]-n[2]-1;e.add(p,m,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(s.end=Object.assign({},Ni(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function tp(e,t,n,r,i){const s=[],o=Ni(t.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function Ni(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const yE={tokenize:bE};function vE(){return{text:{91:yE}}}function bE(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return vt(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),o):n(l)}function o(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return ze(l)?t(l):st(l)?e.check({tokenize:wE},t,n)(l):n(l)}}function wE(e,t,n){return ct(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function xE(e){return Pf([HC(),nE(),uE(e),pE(),vE()])}const _E={};function kE(e){const t=this,n=e||_E,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(xE(n)),s.push(VC()),o.push(zC(n))}const CE=({text:e,type:t,styles:n})=>{const r=n==null?void 0:n[t],i={h1:({node:s,...o})=>z.jsx("h1",{...o,...r==null?void 0:r.heading1}),h2:({node:s,...o})=>z.jsx("h2",{...o,...r==null?void 0:r.heading2}),h3:({node:s,...o})=>z.jsx("h3",{...o,...r==null?void 0:r.heading3}),h4:"h3",h5:"h3",h6:"h3",em:({node:s,...o})=>z.jsx("em",{...o,...r==null?void 0:r.italic}),strong:({node:s,...o})=>z.jsx("strong",{...o,...r==null?void 0:r.bold}),p:({node:s,...o})=>z.jsx("p",{...o,...r==null?void 0:r.text}),hr:({node:s,...o})=>z.jsx("hr",{...o,...r==null?void 0:r.horizontalRule}),a:({node:s,...o})=>z.jsx("a",{...o,...r==null?void 0:r.link}),ol:({node:s,...o})=>z.jsx("ol",{...o,...r==null?void 0:r.orderedList}),ul:({node:s,...o})=>z.jsx("ul",{...o,...r==null?void 0:r.unorderedList}),li:({node:s,...o})=>z.jsx("li",{...o,...r==null?void 0:r.listItem}),br:({node:s,...o})=>z.jsx("br",{...o,...r==null?void 0:r.lineBreak}),img:()=>null,pre:({node:s,...o})=>z.jsx("pre",{...o,...r==null?void 0:r.pre})};return z.jsx(u1,{components:i,remarkPlugins:[kE,v1],children:e})},np=_.createContext(null);function rp(){const e=_.useContext(np);if(!e)throw new Error("useComposerContext must be used within a Message");return e}const ip=_.createContext(null);function EE(){const e=_.useContext(ip);if(!e)throw new Error("useMessageContext must be used within a Message");return e}const sp=_.createContext(null);function op(){const e=_.useContext(sp);if(!e)throw new Error("useModalContext must be used within a ModalProvider");return e}const ap=_.createContext(null);function mt(){const e=_.useContext(ap);if(!e)throw new Error("useWebchatContext must be used within a WebchatProvider");return e}const SE=({text:e,buttonValue:t,type:n,styles:r,variant:i,groupId:s,reusable:o,...a})=>{const{eventEmitter:l,client:c}=mt(),[u,d]=_.useState(!1),[h,f]=_.useState(!1),[p,m]=_.useState(!1),{state:y}=mt();_.useEffect(()=>{if(s)return l.on(`button-group-${s}-click`,()=>{f(!0),o||m(!0)})},[l,s,o]);function v(){s&&l.emit(`button-group-${s}-click`),d(!0),o||m(!0),i!=="link"&&(c==null||c.sendMessage(t))}return z.jsx(TE,{...a,variant:i,onClick:v,disabled:p||y.isReadOnly,"data-activated":u?"":void 0,"data-group-activated":h?"":void 0,"data-type":i,value:t,...r==null?void 0:r[n],children:e})},TE=e=>{if(e.variant==="link"){const{value:r,variant:i,...s}=e;return z.jsx("a",{...s,href:r,target:"_blank",rel:"noopener noreferrer"})}const{variant:t,...n}=e;return z.jsx("button",{...n})},OE=_.forwardRef(({block:e,styles:t,type:n,...r},i)=>z.jsx("div",{...r,...t==null?void 0:t[n],ref:i,children:z.jsx(Wi,{styles:t,block:e})}));function IE(e,t){const n=t?`The ${t} has been copied to your clipboard.`:"Copied to clipboard.";return navigator.clipboard.writeText(e).then(()=>WS({title:n,type:"success"}))}const PE=(e,t={})=>new Promise((n,r)=>{if(typeof window>"u")return r("Window is not defined");if(!e)return r("Url is not defined");let i=null;const s=new Image;s.addEventListener("load",()=>{i&&clearTimeout(i),n({width:s.naturalWidth,height:s.naturalHeight})}),s.addEventListener("error",o=>{i&&clearTimeout(i),r(`${o.type}: ${o.message}`)}),s.src=e,t.timeout&&(i=setTimeout(()=>r("Timeout"),t.timeout))});let AE={data:""},RE=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||AE,$E=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,ME=/\/\*[^]*?\*\/| +/g,lp=/\n+/g,Nr=(e,t)=>{let n="",r="",i="";for(let s in e){let o=e[s];s[0]=="@"?s[1]=="i"?n=s+" "+o+";":r+=s[1]=="f"?Nr(o,s):s+"{"+Nr(o,s[1]=="k"?"":t)+"}":typeof o=="object"?r+=Nr(o,t?t.replace(/([^,])+/g,a=>s.replace(/(^:.*)|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,a):a?a+" "+l:l)):s):o!=null&&(s=/^--/.test(s)?s:s.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=Nr.p?Nr.p(s,o):s+":"+o+";")}return n+(t&&i?t+"{"+i+"}":i)+r},mr={},cp=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+cp(e[n]);return t}return e},LE=(e,t,n,r,i)=>{let s=cp(e),o=mr[s]||(mr[s]=(l=>{let c=0,u=11;for(;c<l.length;)u=101*u+l.charCodeAt(c++)>>>0;return"go"+u})(s));if(!mr[o]){let l=s!==e?e:(c=>{let u,d,h=[{}];for(;u=$E.exec(c.replace(ME,""));)u[4]?h.shift():u[3]?(d=u[3].replace(lp," ").trim(),h.unshift(h[0][d]=h[0][d]||{})):h[0][u[1]]=u[2].replace(lp," ").trim();return h[0]})(e);mr[o]=Nr(i?{["@keyframes "+o]:l}:l,n?"":"."+o)}let a=n&&mr.g?mr.g:null;return n&&(mr.g=mr[o]),((l,c,u,d)=>{d?c.data=c.data.replace(d,l):c.data.indexOf(l)===-1&&(c.data=u?l+c.data:c.data+l)})(mr[o],t,r,a),o},DE=(e,t,n)=>e.reduce((r,i,s)=>{let o=t[s];if(o&&o.call){let a=o(n),l=a&&a.props&&a.props.className||/^go/.test(a)&&a;o=l?"."+l:a&&typeof a=="object"?a.props?"":Nr(a,""):a===!1?"":a}return r+i+(o??"")},"");function Fo(e){let t=this||{},n=e.call?e(t.p):e;return LE(n.unshift?n.raw?DE(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,RE(t.target),t.g,t.o,t.k)}let up,Ac,Rc;Fo.bind({g:1});let gr=Fo.bind({k:1});function NE(e,t,n,r){Nr.p=t,up=e,Ac=n,Rc=r}function jr(e,t){let n=this||{};return function(){let r=arguments;function i(s,o){let a=Object.assign({},s),l=a.className||i.className;n.p=Object.assign({theme:Ac&&Ac()},a),n.o=/ *go\d+/.test(l),a.className=Fo.apply(n,r)+(l?" "+l:""),t&&(a.ref=o);let c=e;return e[0]&&(c=a.as||e,delete a.as),Rc&&c[0]&&Rc(a),up(c,a)}return t?t(i):i}}var jE=e=>typeof e=="function",Bo=(e,t)=>jE(e)?e(t):e,UE=(()=>{let e=0;return()=>(++e).toString()})(),dp=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),FE=20,Vo=new Map,BE=1e3,fp=e=>{if(Vo.has(e))return;let t=setTimeout(()=>{Vo.delete(e),hi({type:4,toastId:e})},BE);Vo.set(e,t)},VE=e=>{let t=Vo.get(e);t&&clearTimeout(t)},$c=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,FE)};case 1:return t.toast.id&&VE(t.toast.id),{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return e.toasts.find(s=>s.id===n.id)?$c(e,{type:1,toast:n}):$c(e,{type:0,toast:n});case 3:let{toastId:r}=t;return r?fp(r):e.toasts.forEach(s=>{fp(s.id)}),{...e,toasts:e.toasts.map(s=>s.id===r||r===void 0?{...s,visible:!1}:s)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(s=>s.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(s=>({...s,pauseDuration:s.pauseDuration+i}))}}},zo=[],Zo={toasts:[],pausedAt:void 0},hi=e=>{Zo=$c(Zo,e),zo.forEach(t=>{t(Zo)})},zE={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},ZE=(e={})=>{let[t,n]=_.useState(Zo);_.useEffect(()=>(zo.push(n),()=>{let i=zo.indexOf(n);i>-1&&zo.splice(i,1)}),[t]);let r=t.toasts.map(i=>{var s,o;return{...e,...e[i.type],...i,duration:i.duration||((s=e[i.type])==null?void 0:s.duration)||(e==null?void 0:e.duration)||zE[i.type],style:{...e.style,...(o=e[i.type])==null?void 0:o.style,...i.style}}});return{...t,toasts:r}},WE=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||UE()}),Is=e=>(t,n)=>{let r=WE(t,e,n);return hi({type:2,toast:r}),r.id},vn=(e,t)=>Is("blank")(e,t);vn.error=Is("error"),vn.success=Is("success"),vn.loading=Is("loading"),vn.custom=Is("custom"),vn.dismiss=e=>{hi({type:3,toastId:e})},vn.remove=e=>hi({type:4,toastId:e}),vn.promise=(e,t,n)=>{let r=vn.loading(t.loading,{...n,...n==null?void 0:n.loading});return e.then(i=>(vn.success(Bo(t.success,i),{id:r,...n,...n==null?void 0:n.success}),i)).catch(i=>{vn.error(Bo(t.error,i),{id:r,...n,...n==null?void 0:n.error})}),e};var HE=(e,t)=>{hi({type:1,toast:{id:e,height:t}})},qE=()=>{hi({type:5,time:Date.now()})},KE=e=>{let{toasts:t,pausedAt:n}=ZE(e);_.useEffect(()=>{if(n)return;let s=Date.now(),o=t.map(a=>{if(a.duration===1/0)return;let l=(a.duration||0)+a.pauseDuration-(s-a.createdAt);if(l<0){a.visible&&vn.dismiss(a.id);return}return setTimeout(()=>vn.dismiss(a.id),l)});return()=>{o.forEach(a=>a&&clearTimeout(a))}},[t,n]);let r=_.useCallback(()=>{n&&hi({type:6,time:Date.now()})},[n]),i=_.useCallback((s,o)=>{let{reverseOrder:a=!1,gutter:l=8,defaultPosition:c}=o||{},u=t.filter(f=>(f.position||c)===(s.position||c)&&f.height),d=u.findIndex(f=>f.id===s.id),h=u.filter((f,p)=>p<d&&f.visible).length;return u.filter(f=>f.visible).slice(...a?[h+1]:[0,h]).reduce((f,p)=>f+(p.height||0)+l,0)},[t]);return{toasts:t,handlers:{updateHeight:HE,startPause:qE,endPause:r,calculateOffset:i}}},JE=gr`
|
|
55
55
|
from {
|
|
56
56
|
transform: scale(0) rotate(45deg);
|
|
57
57
|
opacity: 0;
|
|
@@ -59,7 +59,7 @@ from {
|
|
|
59
59
|
to {
|
|
60
60
|
transform: scale(1) rotate(45deg);
|
|
61
61
|
opacity: 1;
|
|
62
|
-
}`,
|
|
62
|
+
}`,GE=gr`
|
|
63
63
|
from {
|
|
64
64
|
transform: scale(0);
|
|
65
65
|
opacity: 0;
|
|
@@ -67,7 +67,7 @@ from {
|
|
|
67
67
|
to {
|
|
68
68
|
transform: scale(1);
|
|
69
69
|
opacity: 1;
|
|
70
|
-
}`,
|
|
70
|
+
}`,YE=gr`
|
|
71
71
|
from {
|
|
72
72
|
transform: scale(0) rotate(90deg);
|
|
73
73
|
opacity: 0;
|
|
@@ -75,7 +75,7 @@ from {
|
|
|
75
75
|
to {
|
|
76
76
|
transform: scale(1) rotate(90deg);
|
|
77
77
|
opacity: 1;
|
|
78
|
-
}`,
|
|
78
|
+
}`,QE=jr("div")`
|
|
79
79
|
width: 20px;
|
|
80
80
|
opacity: 0;
|
|
81
81
|
height: 20px;
|
|
@@ -84,14 +84,14 @@ to {
|
|
|
84
84
|
position: relative;
|
|
85
85
|
transform: rotate(45deg);
|
|
86
86
|
|
|
87
|
-
animation: ${
|
|
87
|
+
animation: ${JE} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
88
88
|
forwards;
|
|
89
89
|
animation-delay: 100ms;
|
|
90
90
|
|
|
91
91
|
&:after,
|
|
92
92
|
&:before {
|
|
93
93
|
content: '';
|
|
94
|
-
animation: ${
|
|
94
|
+
animation: ${GE} 0.15s ease-out forwards;
|
|
95
95
|
animation-delay: 150ms;
|
|
96
96
|
position: absolute;
|
|
97
97
|
border-radius: 3px;
|
|
@@ -104,18 +104,18 @@ to {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
&:before {
|
|
107
|
-
animation: ${
|
|
107
|
+
animation: ${YE} 0.15s ease-out forwards;
|
|
108
108
|
animation-delay: 180ms;
|
|
109
109
|
transform: rotate(90deg);
|
|
110
110
|
}
|
|
111
|
-
`,
|
|
111
|
+
`,XE=gr`
|
|
112
112
|
from {
|
|
113
113
|
transform: rotate(0deg);
|
|
114
114
|
}
|
|
115
115
|
to {
|
|
116
116
|
transform: rotate(360deg);
|
|
117
117
|
}
|
|
118
|
-
`,
|
|
118
|
+
`,eS=jr("div")`
|
|
119
119
|
width: 12px;
|
|
120
120
|
height: 12px;
|
|
121
121
|
box-sizing: border-box;
|
|
@@ -123,8 +123,8 @@ to {
|
|
|
123
123
|
border-radius: 100%;
|
|
124
124
|
border-color: ${e=>e.secondary||"#e0e0e0"};
|
|
125
125
|
border-right-color: ${e=>e.primary||"#616161"};
|
|
126
|
-
animation: ${
|
|
127
|
-
`,
|
|
126
|
+
animation: ${XE} 1s linear infinite;
|
|
127
|
+
`,tS=gr`
|
|
128
128
|
from {
|
|
129
129
|
transform: scale(0) rotate(45deg);
|
|
130
130
|
opacity: 0;
|
|
@@ -132,7 +132,7 @@ from {
|
|
|
132
132
|
to {
|
|
133
133
|
transform: scale(1) rotate(45deg);
|
|
134
134
|
opacity: 1;
|
|
135
|
-
}`,
|
|
135
|
+
}`,nS=gr`
|
|
136
136
|
0% {
|
|
137
137
|
height: 0;
|
|
138
138
|
width: 0;
|
|
@@ -146,7 +146,7 @@ to {
|
|
|
146
146
|
100% {
|
|
147
147
|
opacity: 1;
|
|
148
148
|
height: 10px;
|
|
149
|
-
}`,
|
|
149
|
+
}`,rS=jr("div")`
|
|
150
150
|
width: 20px;
|
|
151
151
|
opacity: 0;
|
|
152
152
|
height: 20px;
|
|
@@ -155,13 +155,13 @@ to {
|
|
|
155
155
|
position: relative;
|
|
156
156
|
transform: rotate(45deg);
|
|
157
157
|
|
|
158
|
-
animation: ${
|
|
158
|
+
animation: ${tS} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
159
159
|
forwards;
|
|
160
160
|
animation-delay: 100ms;
|
|
161
161
|
&:after {
|
|
162
162
|
content: '';
|
|
163
163
|
box-sizing: border-box;
|
|
164
|
-
animation: ${
|
|
164
|
+
animation: ${nS} 0.2s ease-out forwards;
|
|
165
165
|
opacity: 0;
|
|
166
166
|
animation-delay: 200ms;
|
|
167
167
|
position: absolute;
|
|
@@ -173,16 +173,16 @@ to {
|
|
|
173
173
|
height: 10px;
|
|
174
174
|
width: 6px;
|
|
175
175
|
}
|
|
176
|
-
`,
|
|
176
|
+
`,iS=jr("div")`
|
|
177
177
|
position: absolute;
|
|
178
|
-
`,
|
|
178
|
+
`,sS=jr("div")`
|
|
179
179
|
position: relative;
|
|
180
180
|
display: flex;
|
|
181
181
|
justify-content: center;
|
|
182
182
|
align-items: center;
|
|
183
183
|
min-width: 20px;
|
|
184
184
|
min-height: 20px;
|
|
185
|
-
`,
|
|
185
|
+
`,oS=gr`
|
|
186
186
|
from {
|
|
187
187
|
transform: scale(0.6);
|
|
188
188
|
opacity: 0.4;
|
|
@@ -190,20 +190,20 @@ from {
|
|
|
190
190
|
to {
|
|
191
191
|
transform: scale(1);
|
|
192
192
|
opacity: 1;
|
|
193
|
-
}`,
|
|
193
|
+
}`,aS=jr("div")`
|
|
194
194
|
position: relative;
|
|
195
195
|
transform: scale(0.6);
|
|
196
196
|
opacity: 0.4;
|
|
197
197
|
min-width: 20px;
|
|
198
|
-
animation: ${
|
|
198
|
+
animation: ${oS} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
199
199
|
forwards;
|
|
200
|
-
`,
|
|
200
|
+
`,lS=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?R.createElement(aS,null,t):t:n==="blank"?null:R.createElement(sS,null,R.createElement(eS,{...r}),n!=="loading"&&R.createElement(iS,null,n==="error"?R.createElement(QE,{...r}):R.createElement(rS,{...r})))},cS=e=>`
|
|
201
201
|
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
|
|
202
202
|
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
|
|
203
|
-
`,
|
|
203
|
+
`,uS=e=>`
|
|
204
204
|
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
|
|
205
205
|
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
|
|
206
|
-
`,
|
|
206
|
+
`,dS="0%{opacity:0;} 100%{opacity:1;}",fS="0%{opacity:1;} 100%{opacity:0;}",hS=jr("div")`
|
|
207
207
|
display: flex;
|
|
208
208
|
align-items: center;
|
|
209
209
|
background: #fff;
|
|
@@ -215,25 +215,25 @@ to {
|
|
|
215
215
|
pointer-events: auto;
|
|
216
216
|
padding: 8px 10px;
|
|
217
217
|
border-radius: 8px;
|
|
218
|
-
`,
|
|
218
|
+
`,pS=jr("div")`
|
|
219
219
|
display: flex;
|
|
220
220
|
justify-content: center;
|
|
221
221
|
margin: 4px 10px;
|
|
222
222
|
color: inherit;
|
|
223
223
|
flex: 1 1 auto;
|
|
224
224
|
white-space: pre-line;
|
|
225
|
-
`,
|
|
225
|
+
`,mS=(e,t)=>{let n=e.includes("top")?1:-1,[r,i]=dp()?[dS,fS]:[cS(n),uS(n)];return{animation:t?`${gr(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${gr(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},gS=R.memo(({toast:e,position:t,style:n,children:r})=>{let i=e.height?mS(e.position||t||"top-center",e.visible):{opacity:0},s=R.createElement(lS,{toast:e}),o=R.createElement(pS,{...e.ariaProps},Bo(e.message,e));return R.createElement(hS,{className:e.className,style:{...i,...n,...e.style}},typeof r=="function"?r({icon:s,message:o}):R.createElement(R.Fragment,null,s,o))});NE(R.createElement);var yS=({id:e,className:t,style:n,onHeightUpdate:r,children:i})=>{let s=R.useCallback(o=>{if(o){let a=()=>{let l=o.getBoundingClientRect().height;r(e,l)};a(),new MutationObserver(a).observe(o,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return R.createElement("div",{ref:s,className:t,style:n},i)},vS=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},i=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:dp()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}},bS=Fo`
|
|
226
226
|
z-index: 9999;
|
|
227
227
|
> * {
|
|
228
228
|
pointer-events: auto;
|
|
229
229
|
}
|
|
230
|
-
`,
|
|
230
|
+
`,Wo=16,wS=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,containerStyle:s,containerClassName:o})=>{let{toasts:a,handlers:l}=KE(n);return R.createElement("div",{style:{position:"fixed",zIndex:9999,top:Wo,left:Wo,right:Wo,bottom:Wo,pointerEvents:"none",...s},className:o,onMouseEnter:l.startPause,onMouseLeave:l.endPause},a.map(c=>{let u=c.position||t,d=l.calculateOffset(c,{reverseOrder:e,gutter:r,defaultPosition:t}),h=vS(u,d);return R.createElement(yS,{id:c.id,key:c.id,onHeightUpdate:l.updateHeight,className:c.visible?bS:"",style:h},c.type==="custom"?Bo(c.message,c):i?i(c):R.createElement(gS,{toast:c,position:u}))}))},xS=Object.defineProperty,_S=(e,t,n)=>t in e?xS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mc=(e,t,n)=>(_S(e,typeof t!="symbol"?t+"":t,n),n);let kS=class{constructor(){Mc(this,"current",this.detect()),Mc(this,"handoffState","pending"),Mc(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Ps=new kS,Ho=(e,t)=>{Ps.isServer?_.useEffect(e,t):_.useLayoutEffect(e,t)};function ji(e){let t=_.useRef(e);return Ho(()=>{t.current=e},[e]),t}function CS(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function qo(){let e=[],t=[],n={enqueue(r){t.push(r)},addEventListener(r,i,s,o){return r.addEventListener(i,s,o),n.add(()=>r.removeEventListener(i,s,o))},requestAnimationFrame(...r){let i=requestAnimationFrame(...r);return n.add(()=>cancelAnimationFrame(i))},nextFrame(...r){return n.requestAnimationFrame(()=>n.requestAnimationFrame(...r))},setTimeout(...r){let i=setTimeout(...r);return n.add(()=>clearTimeout(i))},microTask(...r){let i={current:!0};return CS(()=>{i.current&&r[0]()}),n.add(()=>{i.current=!1})},add(r){return e.push(r),()=>{let i=e.indexOf(r);if(i>=0){let[s]=e.splice(i,1);s()}}},dispose(){for(let r of e.splice(0))r()},async workQueue(){for(let r of t.splice(0))await r()},style(r,i,s){let o=r.style.getPropertyValue(i);return Object.assign(r.style,{[i]:s}),this.add(()=>{Object.assign(r.style,{[i]:o})})}};return n}function hp(){let[e]=_.useState(qo);return _.useEffect(()=>()=>e.dispose(),[e]),e}let pi=function(e){let t=ji(e);return _.useCallback((...n)=>t.current(...n),[t])};function pp(){let[e,t]=_.useState(Ps.isHandoffComplete);return e&&Ps.isHandoffComplete===!1&&t(!1),_.useEffect(()=>{e!==!0&&t(!0)},[e]),_.useEffect(()=>Ps.handoff(),[]),e}function Xn(e,t,...n){if(e in t){let i=t[e];return typeof i=="function"?i(...n):i}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Xn),r}let ES=Symbol();function mp(...e){let t=_.useRef(e);_.useEffect(()=>{t.current=e},[e]);let n=pi(r=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(r):i.current=r)});return e.every(r=>r==null||(r==null?void 0:r[ES]))?void 0:n}function gp(...e){return e.filter(Boolean).join(" ")}var yp=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(yp||{}),yr=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(yr||{});function vp({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:s=!0,name:o}){let a=bp(t,e);if(s)return Ko(a,n,r,o);let l=i??0;if(l&2){let{static:c=!1,...u}=a;if(c)return Ko(u,n,r,o)}if(l&1){let{unmount:c=!0,...u}=a;return Xn(c?0:1,{0(){return null},1(){return Ko({...u,hidden:!0,style:{display:"none"}},n,r,o)}})}return Ko(a,n,r,o)}function Ko(e,t={},n,r){var i;let{as:s=n,children:o,refName:a="ref",...l}=Dc(e,["unmount","static"]),c=e.ref!==void 0?{[a]:e.ref}:{},u=typeof o=="function"?o(t):o;l.className&&typeof l.className=="function"&&(l.className=l.className(t));let d={};if(t){let h=!1,f=[];for(let[p,m]of Object.entries(t))typeof m=="boolean"&&(h=!0),m===!0&&f.push(p);h&&(d["data-headlessui-state"]=f.join(" "))}if(s===_.Fragment&&Object.keys(wp(l)).length>0){if(!_.isValidElement(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(p=>` - ${p}`).join(`
|
|
231
231
|
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(p=>` - ${p}`).join(`
|
|
232
232
|
`)].join(`
|
|
233
|
-
`));let h=rp((i=u.props)==null?void 0:i.className,l.className),f=h?{className:h}:{};return _.cloneElement(u,Object.assign({},op(u.props,ap(Ec(l,["ref"]))),d,c,OE(u.ref,c.ref),f))}return _.createElement(s,Object.assign({},Ec(l,["ref"]),s!==_.Fragment&&c,s!==_.Fragment&&d),u)}function OE(...e){return{ref:e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}}function op(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](i,...s){let o=n[r];for(let a of o){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;a(i,...s)}}});return t}function Cc(e){var t;return Object.assign(_.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function ap(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Ec(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let Sc=_.createContext(null);Sc.displayName="OpenClosedContext";var pr=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(pr||{});function lp(){return _.useContext(Sc)}function IE({value:e,children:t}){return _.createElement(Sc.Provider,{value:e},t)}function cp(){let e=_.useRef(!1);return Do(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function PE(e=0){let[t,n]=_.useState(e),r=_.useCallback(a=>n(l=>l|a),[t]),i=_.useCallback(a=>!!(t&a),[t]),s=_.useCallback(a=>n(l=>l&~a),[n]),o=_.useCallback(a=>n(l=>l^a),[n]);return{flags:t,addFlag:r,hasFlag:i,removeFlag:s,toggleFlag:o}}function AE(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function Tc(e,...t){e&&t.length>0&&e.classList.add(...t)}function Oc(e,...t){e&&t.length>0&&e.classList.remove(...t)}function RE(e,t){let n=No();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:i}=getComputedStyle(e),[s,o]=[r,i].map(a=>{let[l=0]=a.split(",").filter(Boolean).map(c=>c.includes("ms")?parseFloat(c):parseFloat(c)*1e3).sort((c,u)=>u-c);return l});if(s+o!==0){let a=n.addEventListener(e,"transitionend",l=>{l.target===l.currentTarget&&(t(),a())})}else t();return n.add(()=>t()),n.dispose}function $E(e,t,n,r){let i=n?"enter":"leave",s=No(),o=r!==void 0?AE(r):()=>{};i==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=Jn(i,{enter:()=>t.enter,leave:()=>t.leave}),l=Jn(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=Jn(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return Oc(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),Tc(e,...a,...c),s.nextFrame(()=>{Oc(e,...c),Tc(e,...l),RE(e,()=>(Oc(e,...a),Tc(e,...t.entered),o()))}),s.dispose}function ME({container:e,direction:t,classes:n,onStart:r,onStop:i}){let s=cp(),o=ep(),a=Ri(t);Do(()=>{let l=No();o.add(l.dispose);let c=e.current;if(c&&a.current!=="idle"&&s.current)return l.dispose(),r.current(a.current),l.add($E(c,n.current,a.current==="enter",()=>{l.dispose(),i.current(a.current)})),l.dispose},[t])}function ci(e=""){return e.split(" ").filter(t=>t.trim().length>1)}let Uo=_.createContext(null);Uo.displayName="TransitionContext";var LE=(e=>(e.Visible="visible",e.Hidden="hidden",e))(LE||{});function DE(){let e=_.useContext(Uo);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function NE(){let e=_.useContext(Fo);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Fo=_.createContext(null);Fo.displayName="NestingContext";function Bo(e){return"children"in e?Bo(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function up(e,t){let n=Ri(e),r=_.useRef([]),i=cp(),s=ep(),o=li((f,p=hr.Hidden)=>{let m=r.current.findIndex(({el:y})=>y===f);m!==-1&&(Jn(p,{[hr.Unmount](){r.current.splice(m,1)},[hr.Hidden](){r.current[m].state="hidden"}}),s.microTask(()=>{var y;!Bo(r)&&i.current&&((y=n.current)==null||y.call(n))}))}),a=li(f=>{let p=r.current.find(({el:m})=>m===f);return p?p.state!=="visible"&&(p.state="visible"):r.current.push({el:f,state:"visible"}),()=>o(f,hr.Unmount)}),l=_.useRef([]),c=_.useRef(Promise.resolve()),u=_.useRef({enter:[],leave:[],idle:[]}),d=li((f,p,m)=>{l.current.splice(0),t&&(t.chains.current[p]=t.chains.current[p].filter(([y])=>y!==f)),t==null||t.chains.current[p].push([f,new Promise(y=>{l.current.push(y)})]),t==null||t.chains.current[p].push([f,new Promise(y=>{Promise.all(u.current[p].map(([v,b])=>b)).then(()=>y())})]),p==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>m(p)):m(p)}),h=li((f,p,m)=>{Promise.all(u.current[p].splice(0).map(([y,v])=>v)).then(()=>{var y;(y=l.current.shift())==null||y()}).then(()=>m(p))});return _.useMemo(()=>({children:r,register:a,unregister:o,onStart:d,onStop:h,wait:c,chains:u}),[a,o,r,d,h,u,c])}function jE(){}let UE=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function dp(e){var t;let n={};for(let r of UE)n[r]=(t=e[r])!=null?t:jE;return n}function FE(e){let t=_.useRef(dp(e));return _.useEffect(()=>{t.current=dp(e)},[e]),t}let BE="div",fp=ip.RenderStrategy,hp=Cc(function(e,t){let{beforeEnter:n,afterEnter:r,beforeLeave:i,afterLeave:s,enter:o,enterFrom:a,enterTo:l,entered:c,leave:u,leaveFrom:d,leaveTo:h,...f}=e,p=_.useRef(null),m=np(p,t),y=f.unmount?hr.Unmount:hr.Hidden,{show:v,appear:b,initial:x}=DE(),[P,A]=_.useState(v?"visible":"hidden"),O=NE(),{register:U,unregister:F}=O,B=_.useRef(null);_.useEffect(()=>U(p),[U,p]),_.useEffect(()=>{if(y===hr.Hidden&&p.current){if(v&&P!=="visible"){A("visible");return}return Jn(P,{hidden:()=>F(p),visible:()=>U(p)})}},[P,p,U,F,v,y]);let I=Ri({enter:ci(o),enterFrom:ci(a),enterTo:ci(l),entered:ci(c),leave:ci(u),leaveFrom:ci(d),leaveTo:ci(h)}),j=FE({beforeEnter:n,afterEnter:r,beforeLeave:i,afterLeave:s}),J=tp();_.useEffect(()=>{if(J&&P==="visible"&&p.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[p,P,J]);let q=x&&!b,H=(()=>!J||q||B.current===v?"idle":v?"enter":"leave")(),V=PE(0),z=li(ee=>Jn(ee,{enter:()=>{V.addFlag(pr.Opening),j.current.beforeEnter()},leave:()=>{V.addFlag(pr.Closing),j.current.beforeLeave()},idle:()=>{}})),Y=li(ee=>Jn(ee,{enter:()=>{V.removeFlag(pr.Opening),j.current.afterEnter()},leave:()=>{V.removeFlag(pr.Closing),j.current.afterLeave()},idle:()=>{}})),K=up(()=>{A("hidden"),F(p)},O);ME({container:p,classes:I,direction:H,onStart:Ri(ee=>{K.onStart(p,ee,z)}),onStop:Ri(ee=>{K.onStop(p,ee,Y),ee==="leave"&&!Bo(K)&&(A("hidden"),F(p))})}),_.useEffect(()=>{!q||(y===hr.Hidden?B.current=null:B.current=v)},[v,q,P]);let pe=f,k={ref:m};return b&&v&&ks.isServer&&(pe={...pe,className:rp(f.className,...I.current.enter,...I.current.enterFrom)}),_.createElement(Fo.Provider,{value:K},_.createElement(IE,{value:Jn(P,{visible:pr.Open,hidden:pr.Closed})|V.flags},sp({ourProps:k,theirProps:pe,defaultTag:BE,features:fp,visible:P==="visible",name:"Transition.Child"})))}),Ic=Cc(function(e,t){let{show:n,appear:r=!1,unmount:i,...s}=e,o=_.useRef(null),a=np(o,t);tp();let l=lp();if(n===void 0&&l!==null&&(n=(l&pr.Open)===pr.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,u]=_.useState(n?"visible":"hidden"),d=up(()=>{u("hidden")}),[h,f]=_.useState(!0),p=_.useRef([n]);Do(()=>{h!==!1&&p.current[p.current.length-1]!==n&&(p.current.push(n),f(!1))},[p,n]);let m=_.useMemo(()=>({show:n,appear:r,initial:h}),[n,r,h]);_.useEffect(()=>{if(n)u("visible");else if(!Bo(d))u("hidden");else{let v=o.current;if(!v)return;let b=v.getBoundingClientRect();b.x===0&&b.y===0&&b.width===0&&b.height===0&&u("hidden")}},[n,d]);let y={unmount:i};return _.createElement(Fo.Provider,{value:d},_.createElement(Uo.Provider,{value:m},sp({ourProps:{...y,as:_.Fragment,children:_.createElement(hp,{ref:a,...y,...s})},theirProps:{},defaultTag:_.Fragment,features:fp,visible:c==="visible",name:"Transition"})))}),VE=Cc(function(e,t){let n=_.useContext(Uo)!==null,r=lp()!==null;return _.createElement(_.Fragment,null,!n&&r?_.createElement(Ic,{ref:t,...e}):_.createElement(hp,{ref:t,...e}))}),zE=Object.assign(Ic,{Child:VE,Root:Ic});const ZE=e=>$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,...e},$.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"m7.5 12 3 3 6-6m5.5 3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"})),WE=e=>$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",...e},$.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M18 6 6 18M6 6l12 12"})),HE=e=>$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,...e},$.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"m15 9-6 6m0-6 6 6m7-3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));function qE(e){return mn.custom(t=>Z.jsx(JE,{type:e.type,show:t.visible,children:e.type==="custom"?e.content:Z.jsx(KE,{...e,toastId:t.id})}))}const KE=({icon:e,type:t,title:n,description:r,toastId:i})=>{const{theme:{notification:s}}=ht();return Z.jsxs(Z.Fragment,{children:[e?Z.jsx(e,{...s==null?void 0:s.icon}):Z.jsx(GE,{...s==null?void 0:s.icon,type:t}),Z.jsx("p",{...s==null?void 0:s.title,children:n}),r?Z.jsx("p",{...s==null?void 0:s.description,children:r}):null,Z.jsx(WE,{...s==null?void 0:s.closeIcon,onClick:()=>mn.dismiss(i)})]})},JE=({type:e,...t})=>{const{theme:{notification:n}}=ht();return Z.jsx(zE,{...t,...n==null?void 0:n.container,appear:!0,"data-type":e??"neutral"})},GE=({type:e,className:t})=>{switch(e){case"success":return Z.jsx(ZE,{className:t});case"error":return Z.jsx(HE,{className:t});default:return null}},YE=_.forwardRef(({url:e,type:t,styles:n,orientation:r="auto",...i},s)=>{var h,f;const o=_.useId(),{setIsLoading:a}=TC(),[l,c]=_.useState(r),[u,d]=_.useState(!1);return _.useLayoutEffect(()=>{a(p=>[...p,o])},[]),_.useEffect(()=>{e&&l==="auto"&&RC(e).then(({width:p,height:m})=>{c(QE(p,m)),a(y=>y.filter(v=>v!==o))})},[e]),Z.jsxs(Z.Fragment,{children:[u?null:Z.jsx("div",{"data-orientation":l,...(h=n==null?void 0:n[t])==null?void 0:h.placeholder}),Z.jsx("img",{"data-orientation":l,"data-loaded":u,...i,...(f=n==null?void 0:n[t])==null?void 0:f.image,src:e,alt:"",ref:s,loading:"lazy",onLoad:()=>{d(!0)}})]})});function QE(e,t){const n={square:1,portrait:.75,landscape:1.3333333333333333},r=e/t;return Object.keys(n).reduce((s,o)=>Math.abs(n[o]-r)<Math.abs(n[s]-r)?o:s)}const XE=_.forwardRef(({url:e,type:t,styles:n,...r},i)=>Z.jsx("div",{children:Z.jsx("video",{...r,controls:!0,src:e,...n==null?void 0:n[t],ref:i})})),eS=_.forwardRef(({url:e,type:t,styles:n,...r},i)=>Z.jsx("div",{children:Z.jsx("audio",{...r,controls:!0,src:e,...n==null?void 0:n[t],ref:i})}));function tS({title:e,titleId:t,...n},r){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?$.createElement("title",{id:t},e):null,$.createElement("path",{fillRule:"evenodd",d:"M10 3a.75.75 0 01.75.75v10.638l3.96-4.158a.75.75 0 111.08 1.04l-5.25 5.5a.75.75 0 01-1.08 0l-5.25-5.5a.75.75 0 111.08-1.04l3.96 4.158V3.75A.75.75 0 0110 3z",clipRule:"evenodd"}))}const nS=$.forwardRef(tS);function rS({title:e,titleId:t,...n},r){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?$.createElement("title",{id:t},e):null,$.createElement("path",{fillRule:"evenodd",d:"M15.312 11.424a5.5 5.5 0 01-9.201 2.466l-.312-.311h2.433a.75.75 0 000-1.5H3.989a.75.75 0 00-.75.75v4.242a.75.75 0 001.5 0v-2.43l.31.31a7 7 0 0011.712-3.138.75.75 0 00-1.449-.39zm1.23-3.723a.75.75 0 00.219-.53V2.929a.75.75 0 00-1.5 0V5.36l-.31-.31A7 7 0 003.239 8.188a.75.75 0 101.448.389A5.5 5.5 0 0113.89 6.11l.311.31h-2.432a.75.75 0 000 1.5h4.243a.75.75 0 00.53-.219z",clipRule:"evenodd"}))}const iS=$.forwardRef(rS);function sS({title:e,titleId:t,...n},r){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?$.createElement("title",{id:t},e):null,$.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm-.75-4.75a.75.75 0 001.5 0V8.66l1.95 2.1a.75.75 0 101.1-1.02l-3.25-3.5a.75.75 0 00-1.1 0L6.2 9.74a.75.75 0 101.1 1.02l1.95-2.1v4.59z",clipRule:"evenodd"}))}const oS=$.forwardRef(sS);function aS({title:e,titleId:t,...n},r){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?$.createElement("title",{id:t},e):null,$.createElement("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"}))}const lS=$.forwardRef(aS);function cS({title:e,titleId:t,...n},r){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?$.createElement("title",{id:t},e):null,$.createElement("path",{fillRule:"evenodd",d:"M4.5 2A1.5 1.5 0 003 3.5v13A1.5 1.5 0 004.5 18h11a1.5 1.5 0 001.5-1.5V7.621a1.5 1.5 0 00-.44-1.06l-4.12-4.122A1.5 1.5 0 0011.378 2H4.5zm4.75 6.75a.75.75 0 011.5 0v2.546l.943-1.048a.75.75 0 011.114 1.004l-2.25 2.5a.75.75 0 01-1.114 0l-2.25-2.5a.75.75 0 111.114-1.004l.943 1.048V8.75z",clipRule:"evenodd"}))}const uS=$.forwardRef(cS);function dS({title:e,titleId:t,...n},r){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?$.createElement("title",{id:t},e):null,$.createElement("path",{fillRule:"evenodd",d:"M9.69 18.933l.003.001C9.89 19.02 10 19 10 19s.11.02.308-.066l.002-.001.006-.003.018-.008a5.741 5.741 0 00.281-.14c.186-.096.446-.24.757-.433.62-.384 1.445-.966 2.274-1.765C15.302 14.988 17 12.493 17 9A7 7 0 103 9c0 3.492 1.698 5.988 3.355 7.584a13.731 13.731 0 002.273 1.765 11.842 11.842 0 00.976.544l.062.029.018.008.006.003zM10 11.25a2.25 2.25 0 100-4.5 2.25 2.25 0 000 4.5z",clipRule:"evenodd"}))}const fS=$.forwardRef(dS),hS=_.forwardRef(({type:e,latitude:t,longitude:n,title:r,styles:i,...s},o)=>{var l,c,u;const a=`https://www.google.com/maps/search/?api=1&query=${t},${n}`;return Z.jsxs("a",{...s,...(l=i==null?void 0:i[e])==null?void 0:l.container,href:a,type:"_blank",rel:"noopener",ref:o,children:[Z.jsx("p",{...(c=i==null?void 0:i[e])==null?void 0:c.title,children:r}),Z.jsx(fS,{...(u=i==null?void 0:i[e])==null?void 0:u.icon})]})}),pS=_.forwardRef(({blocks:e,styles:t,type:n,horizontalAlignment:r,verticalAlignment:i,...s},o)=>Z.jsx("div",{"data-horizontal":r,"data-vertical":i,...s,...t==null?void 0:t[n],ref:o,children:e.map((a,l)=>Z.jsx(Ui,{styles:t,block:a},l))})),mS=_.forwardRef(({blocks:e,styles:t,type:n,horizontalAlignment:r,verticalAlignment:i,...s},o)=>Z.jsx("div",{"data-horizontal":r,"data-vertical":i,...s,...t==null?void 0:t[n],ref:o,children:e.map((a,l)=>Z.jsx(Ui,{styles:t,block:a},l))}));function gS(e){return Object.prototype.toString.call(e)==="[object Object]"}function pp(e){return gS(e)||Array.isArray(e)}function yS(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Pc(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const i=JSON.stringify(Object.keys(e.breakpoints||{})),s=JSON.stringify(Object.keys(t.breakpoints||{}));return i!==s?!1:n.every(o=>{const a=e[o],l=t[o];return typeof a=="function"?`${a}`==`${l}`:!pp(a)||!pp(l)?a===l:Pc(a,l)})}function mp(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function vS(e,t){if(e.length!==t.length)return!1;const n=mp(e),r=mp(t);return n.every((i,s)=>{const o=r[s];return Pc(i,o)})}function Ac(e){return typeof e=="number"}function gp(e){return typeof e=="string"}function Rc(e){return typeof e=="boolean"}function yp(e){return Object.prototype.toString.call(e)==="[object Object]"}function Tt(e){return Math.abs(e)}function $c(e){return Math.sign(e)}function Vo(e,t){return Tt(e-t)}function bS(e,t){if(e===0||t===0||Tt(e)<=Tt(t))return 0;const n=Vo(Tt(e),Tt(t));return Tt(n/e)}function Cs(e){return Zo(e).map(Number)}function mr(e){return e[zo(e)]}function zo(e){return Math.max(0,e.length-1)}function Zo(e){return Object.keys(e)}function vp(e,t){return[e,t].reduce((n,r)=>(Zo(r).forEach(i=>{const s=n[i],o=r[i],a=yp(s)&&yp(o);n[i]=a?vp(s,o):o}),n),{})}function bp(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function wS(e,t){const n={start:r,center:i,end:s};function r(){return 0}function i(c){return s(c)/2}function s(c){return t-c}function o(){return t*Number(e)}function a(c){return Ac(e)?o():n[e](c)}return{measure:a}}function xS(e,t){const n=e==="y"?"y":"x",r=e==="y"?"x":"y",i=a(),s=l();function o(u){const{width:d,height:h}=u;return n==="x"?d:h}function a(){return n==="y"?"top":t==="rtl"?"right":"left"}function l(){return n==="y"?"bottom":t==="rtl"?"left":"right"}return{scroll:n,cross:r,startEdge:i,endEdge:s,measureSize:o}}function Mr(e,t){const n=Tt(e-t);function r(c){return c<e}function i(c){return c>t}function s(c){return r(c)||i(c)}function o(c){return s(c)?r(c)?e:t:c}function a(c){return n?c-n*Math.ceil((c-t)/n):c}return{length:n,max:t,min:e,constrain:o,reachedAny:s,reachedMax:i,reachedMin:r,removeOffset:a}}function wp(e,t,n){const{constrain:r}=Mr(0,e),i=e+1;let s=o(t);function o(h){return n?Tt((i+h)%i):r(h)}function a(){return s}function l(h){return s=o(h),d}function c(h){return u().set(a()+h)}function u(){return wp(e,a(),n)}const d={get:a,set:l,add:c,clone:u};return d}function _S(e){const t=e==="rtl"?-1:1;function n(i){return i*t}return{apply:n}}function Es(){let e=[];function t(i,s,o,a={passive:!0}){return i.addEventListener(s,o,a),e.push(()=>i.removeEventListener(s,o,a)),r}function n(){e=e.filter(i=>i())}const r={add:t,clear:n};return r}function kS(e,t,n,r,i,s,o,a,l,c,u,d,h,f,p,m,y,v,b){const{cross:x}=e,P=["INPUT","SELECT","TEXTAREA"],A={passive:!1},O=Es(),U=Es(),F=Mr(50,225).constrain(p.measure(20)),B={mouse:300,touch:400},I={mouse:500,touch:600},j=m?43:25;let J=!1,q=0,H=0,V=!1,z=!1,Y=!1,K=!1;function pe(ve,ke){if(!ke)return;function Ce(qe){(Rc(ke)||ke(ve,qe))&&Ne(qe)}const Re=n;O.add(Re,"dragstart",qe=>qe.preventDefault(),A).add(Re,"touchmove",()=>{},A).add(Re,"touchend",()=>{}).add(Re,"touchstart",Ce).add(Re,"mousedown",Ce).add(Re,"touchcancel",je).add(Re,"contextmenu",je).add(Re,"click",De,!0)}function k(){O.clear(),U.clear()}function ee(){const ve=K?r:n;U.add(ve,"touchmove",Ie,A).add(ve,"touchend",je).add(ve,"mousemove",Ie,A).add(ve,"mouseup",je)}function xe(ve){const ke=ve.nodeName||"";return P.includes(ke)}function S(){return(m?I:B)[K?"mouse":"touch"]}function Te(ve,ke){const Ce=h.add($c(ve)*-1),Re=d.byDistance(ve,!m).distance;return m||Tt(ve)<F?Re:v&&ke?Re*.5:d.byIndex(Ce.get(),0).distance}function Ne(ve){const ke=bp(ve,i);K=ke,!(ke&&ve.button!==0)&&(xe(ve.target)||(Y=m&&ke&&!ve.buttons&&J,J=Vo(s.get(),a.get())>=2,V=!0,o.pointerDown(ve),u.useFriction(0).useDuration(0),s.set(a),ee(),q=o.readPoint(ve),H=o.readPoint(ve,x),f.emit("pointerDown")))}function Ie(ve){const ke=o.readPoint(ve),Ce=o.readPoint(ve,x),Re=Vo(ke,q),qe=Vo(Ce,H);if(!z&&!K&&(!ve.cancelable||(z=Re>qe,!z)))return je(ve);const N=o.pointerMove(ve);Re>y&&(Y=!0),u.useFriction(.3).useDuration(1),l.start(),s.add(t.apply(N)),ve.preventDefault()}function je(ve){const Ce=d.byDistance(0,!1).index!==h.get(),Re=o.pointerUp(ve)*S(),qe=Te(t.apply(Re),Ce),N=bS(Re,qe),ne=j-10*N,me=b+N/50;z=!1,V=!1,U.clear(),u.useDuration(ne).useFriction(me),c.distance(qe,!m),K=!1,f.emit("pointerUp")}function De(ve){Y&&(ve.stopPropagation(),ve.preventDefault())}function Ue(){return V}return{init:pe,pointerDown:Ue,destroy:k}}function CS(e,t){let r,i;function s(d){return d.timeStamp}function o(d,h){const p=`client${(h||e.scroll)==="x"?"X":"Y"}`;return(bp(d,t)?d:d.touches[0])[p]}function a(d){return r=d,i=d,o(d)}function l(d){const h=o(d)-o(i),f=s(d)-s(r)>170;return i=d,f&&(r=d),h}function c(d){if(!r||!i)return 0;const h=o(i)-o(r),f=s(d)-s(r),p=s(d)-s(i)>170,m=h/f;return f&&!p&&Tt(m)>.1?m:0}return{pointerDown:a,pointerMove:l,pointerUp:c,readPoint:o}}function ES(e){function t(r){return e*(r/100)}return{measure:t}}function SS(e,t,n,r,i){let s,o,a=[],l=!1;function c(f){return i.measureSize(f.getBoundingClientRect())}function u(f,p){if(!p)return;o=c(e),a=r.map(c);function m(v){for(const b of v){const x=b.target===e,P=r.indexOf(b.target),A=x?o:a[P],O=c(x?e:r[P]);if(A!==O){n.requestAnimationFrame(()=>{f.reInit(),t.emit("resize")});break}}}s=new ResizeObserver(v=>{l||(Rc(p)||p(f,v))&&m(v)}),[e].concat(r).forEach(v=>s.observe(v))}function d(){s&&s.disconnect(),l=!0}return{init:u,destroy:d}}function TS(e,t,n,r){let i=!0,s=0,o=0,a=n,l=r,c=e.get(),u=0;function d(){const A=t.get()-e.get(),O=!a;let U=0;return O?(s=0,e.set(t),U=A):(s+=A/a,s*=l,c+=s,e.add(s),U=c-u),o=$c(U),u=c,i=Tt(A)<.001,P}function h(){return i}function f(){return a}function p(){return o}function m(){return s}function y(){return b(n)}function v(){return x(r)}function b(A){return a=A,P}function x(A){return l=A,P}const P={direction:p,duration:f,velocity:m,seek:d,settled:h,useBaseFriction:v,useBaseDuration:y,useFriction:x,useDuration:b};return P}function OS(e,t,n,r,i){const s=i.measure(10),o=i.measure(50),a=Mr(.1,.99);let l=!1;function c(){return!(l||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function u(f){if(!c())return;const p=e.reachedMin(t.get())?"min":"max",m=Tt(e[p]-t.get()),y=n.get()-t.get(),v=a.constrain(m/o);n.subtract(y*v),!f&&Tt(y)<s&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function d(f){l=!f}return{constrain:u,toggleActive:d}}function IS(e,t,n,r){const i=Mr(-t+e,n[0]),s=l(),o=c();function a(){const d=s[0],h=mr(s),f=s.lastIndexOf(d),p=s.indexOf(h)+1;return Mr(f,p)}function l(){return n.map(i.constrain).map(d=>parseFloat(d.toFixed(3)))}function c(){if(t<=e)return[i.max];if(r==="keepSnaps")return s;const{min:d,max:h}=a();return s.slice(d,h)}return{snapsContained:o}}function PS(e,t,n){const r=t[0],i=n?r-e:mr(t);return{limit:Mr(i,r)}}function AS(e,t,n,r){const s=t.min+.1,o=t.max+.1,{reachedMin:a,reachedMax:l}=Mr(s,o);function c(h){return h===1?l(n.get()):h===-1?a(n.get()):!1}function u(h){if(!c(h))return;const f=e*(h*-1);r.forEach(p=>p.add(f))}return{loop:u}}function RS(e){const{max:t,length:n}=e;function r(s){return(s-t)/-n}return{get:r}}function $S(e,t,n,r,i,s,o){const{startEdge:a,endEdge:l}=e,{groupSlides:c}=s,u=f().map(t.measure),d=p(),h=m();function f(){return c(r).map(v=>mr(v)[l]-v[0][a]).map(Tt)}function p(){return r.map(v=>n[a]-v[a]).map(v=>-Tt(v))}function m(){const b=mr(d)-mr(i);return c(d).map(x=>x[0]).map((x,P,A)=>{const O=!P,U=P===zo(A);return o&&O?0:o&&U?b:x+u[P]})}return{snaps:d,snapsAligned:h}}function MS(e,t,n,r,i){const{reachedAny:s,removeOffset:o,constrain:a}=r;function l(p){return p.concat().sort((m,y)=>Tt(m)-Tt(y))[0]}function c(p){const m=e?o(p):a(p),y=t.map(b=>b-m).map(b=>u(b,0)).map((b,x)=>({diff:b,index:x})).sort((b,x)=>Tt(b.diff)-Tt(x.diff)),{index:v}=y[0];return{index:v,distance:m}}function u(p,m){const y=[p,p+n,p-n];if(!e)return y[0];if(!m)return l(y);const v=y.filter(b=>$c(b)===m);return l(v)}function d(p,m){const y=t[p]-i.get(),v=u(y,m);return{index:p,distance:v}}function h(p,m){const y=i.get()+p,{index:v,distance:b}=c(y),x=!e&&s(y);if(!m||x)return{index:v,distance:p};const P=t[v]-b,A=p+u(P,0);return{index:v,distance:A}}return{byDistance:h,byIndex:d,shortcut:u}}function LS(e,t,n,r,i,s,o){function a(d){const h=d.distance,f=d.index!==t.get();s.add(h),h&&(i.duration()?e.start():(e.update(),e.render(1),e.update())),f&&(n.set(t.get()),t.set(d.index),o.emit("select"))}function l(d,h){const f=r.byDistance(d,h);a(f)}function c(d,h){const f=t.clone().set(d),p=r.byIndex(f.get(),h);a(p)}return{distance:l,index:c}}function Wo(e){let t=e;function n(){return t}function r(l){t=o(l)}function i(l){t+=o(l)}function s(l){t-=o(l)}function o(l){return Ac(l)?l:l.get()}return{get:n,set:r,add:i,subtract:s}}function xp(e,t,n){const r=e.scroll==="x"?o:a,i=n.style;let s=!1;function o(h){return`translate3d(${h}px,0px,0px)`}function a(h){return`translate3d(0px,${h}px,0px)`}function l(h){s||(i.transform=r(t.apply(h)))}function c(h){s=!h}function u(){s||(i.transform="",n.getAttribute("style")||n.removeAttribute("style"))}return{clear:u,to:l,toggleActive:c}}function DS(e,t,n,r,i,s,o,a,l){const c=Cs(i),u=Cs(i).reverse(),d=m().concat(y());function h(A,O){return A.reduce((U,F)=>U-i[F],O)}function f(A,O){return A.reduce((U,F)=>h(U,O)>0?U.concat([F]):U,[])}function p(A,O){const U=O==="start",F=U?-r:r,B=o.findSlideBounds([F]);return A.map(I=>{const j=U?0:-r,J=U?r:0,H=B.filter(V=>V.index===I)[0][U?"end":"start"];return{index:I,slideLocation:Wo(-1),translate:xp(e,t,l[I]),target:()=>a.get()>H?j:J}})}function m(){const A=s[0]-1,O=f(u,A);return p(O,"end")}function y(){const A=n-s[0]-1,O=f(c,A);return p(O,"start")}function v(){return d.every(({index:A})=>{const O=c.filter(U=>U!==A);return h(O,n)<=.1})}function b(){d.forEach(A=>{const{target:O,translate:U,slideLocation:F}=A,B=O();B!==F.get()&&(U.to(B),F.set(B))})}function x(){d.forEach(A=>A.translate.clear())}return{canLoop:v,clear:x,loop:b,loopPoints:d}}function NS(e,t){let n,r=!1;function i(a,l){if(!l)return;function c(u){for(const d of u)if(d.type==="childList"){a.reInit(),t.emit("slidesChanged");break}}n=new MutationObserver(u=>{r||(Rc(l)||l(a,u))&&c(u)}),n.observe(e,{childList:!0})}function s(){n&&n.disconnect(),r=!0}return{init:i,destroy:s}}function jS(e,t,n,r,i,s,o){const{removeOffset:a,constrain:l}=i,c=.5,u=s?[0,t,-t]:[0],d=f(u,o);function h(y){const v=y||0;return n.map(b=>Mr(c,b-c).constrain(b*v))}function f(y,v){const b=y||u,x=h(v);return b.reduce((P,A)=>{const O=r.map((U,F)=>({start:U-n[F]+x[F]+A,end:U+e-x[F]+A,index:F}));return P.concat(O)},[])}function p(y,v){const b=s?a(y):l(y);return(v||d).reduce((P,A)=>{const{index:O,start:U,end:F}=A,B=P.includes(O),I=U<b&&F>b;return!B&&I?P.concat([O]):P},[])}return{check:p,findSlideBounds:f}}function US(e,t,n,r,i,s){const{measureSize:o,startEdge:a,endEdge:l}=e,c=n[0]&&i,u=p(),d=m(),h=n.map(o),f=y();function p(){if(!c)return 0;const b=n[0];return Tt(t[a]-b[a])}function m(){if(!c)return 0;const b=s.getComputedStyle(mr(r));return parseFloat(b.getPropertyValue(`margin-${l}`))}function y(){return n.map((b,x,P)=>{const A=!x,O=x===zo(P);return A?h[x]+u:O?h[x]+d:P[x+1][a]-b[a]}).map(Tt)}return{slideSizes:h,slideSizesWithGaps:f}}function FS(e,t,n){const r=Ac(n);function i(l,c){return Cs(l).filter(u=>u%c===0).map(u=>l.slice(u,u+c))}function s(l){return Cs(l).reduce((c,u)=>{const h=t.slice(mr(c),u+1).reduce((f,p)=>f+p,0);return!u||h>e?c.concat(u):c},[]).map((c,u,d)=>l.slice(c,d[u+1]))}function o(l){return r?i(l,n):s(l)}return{groupSlides:o}}function BS(e,t,n,r,i,s,o,a){const{align:l,axis:c,direction:u,startIndex:d,inViewThreshold:h,loop:f,duration:p,dragFree:m,dragThreshold:y,slidesToScroll:v,skipSnaps:b,containScroll:x}=s,P=t.getBoundingClientRect(),A=n.map(me=>me.getBoundingClientRect()),O=_S(u),U=xS(c,u),F=U.measureSize(P),B=ES(F),I=wS(l,F),j=!f&&!!x,J=f||!!x,{slideSizes:q,slideSizesWithGaps:H}=US(U,P,A,n,J,i),V=FS(F,H,v),{snaps:z,snapsAligned:Y}=$S(U,I,P,A,H,V,j),K=-mr(z)+mr(H),{snapsContained:pe}=IS(F,K,Y,x),k=j?pe:Y,{limit:ee}=PS(K,k,f),xe=wp(zo(k),d,f),S=xe.clone(),Te=Cs(n),Ne=({dragHandler:me,scrollBody:he,scrollBounds:Le,eventHandler:Pe,animation:Be,options:{loop:it}})=>{const Ze=me.pointerDown();it||Le.constrain(Ze);const W=he.seek().settled();W&&!Ze&&(Be.stop(),Pe.emit("settle")),W||Pe.emit("scroll")},Ie=({scrollBody:me,translate:he,location:Le,offsetLocation:Pe,scrollLooper:Be,slideLooper:it,options:{loop:Ze}},W)=>{const Q=me.velocity();Pe.set(Le.get()-Q+Q*W),Ze&&(Be.loop(me.direction()),it.loop()),he.to(Pe.get())},je={start:()=>a.start(ne),stop:()=>a.stop(ne),update:()=>Ne(ne),render:me=>Ie(ne,me)},De=.68,Ue=k[xe.get()],_e=Wo(Ue),ve=Wo(Ue),ke=Wo(Ue),Ce=TS(_e,ke,p,De),Re=MS(f,k,K,ee,ke),qe=LS(je,xe,S,Re,Ce,ke,o),N=jS(F,K,q,z,ee,f,h),ne={ownerDocument:r,ownerWindow:i,eventHandler:o,containerRect:P,slideRects:A,animation:je,axis:U,direction:O,dragHandler:kS(U,O,e,r,i,ke,CS(U,i),_e,je,qe,Ce,Re,xe,o,B,m,y,b,De),eventStore:Es(),percentOfView:B,index:xe,indexPrevious:S,limit:ee,location:_e,offsetLocation:ve,options:s,resizeHandler:SS(t,o,i,n,U),scrollBody:Ce,scrollBounds:OS(ee,_e,ke,Ce,B),scrollLooper:AS(K,ee,ve,[_e,ve,ke]),scrollProgress:RS(ee),scrollSnaps:k,scrollTarget:Re,scrollTo:qe,slideLooper:DS(U,O,F,K,H,k,N,ve,n),slidesHandler:NS(t,o),slidesInView:N,slideIndexes:Te,slidesToScroll:V,target:ke,translate:xp(U,O,t)};return ne}function VS(e){const t=16.666666666666668;let n=[],r=null,i=0,s=0;function o(d){r||(r=d);const h=d-r;for(r=d,i+=h;i>=t;)n.forEach(({animation:p})=>p.update()),i-=t;const f=Tt(i/t);n.forEach(({animation:p})=>p.render(f)),s&&e.requestAnimationFrame(o)}function a(d){n.includes(d)||n.push(d),!s&&(s=e.requestAnimationFrame(o))}function l(d){n=n.filter(h=>h!==d),!n.length&&(e.cancelAnimationFrame(s),r=null,i=0,s=0)}function c(){r=null,i=0}return{start:a,stop:l,reset:c,window:e}}function zS(){const e={};let t;function n(l){t=l}function r(l){return e[l]||[]}function i(l){return r(l).forEach(c=>c(t,l)),a}function s(l,c){return e[l]=r(l).concat([c]),a}function o(l,c){return e[l]=r(l).filter(u=>u!==c),a}const a={init:n,emit:i,off:o,on:s};return a}const ZS={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,breakpoints:{},dragFree:!1,dragThreshold:10,inViewThreshold:0,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0};function WS(e){function t(s,o){return vp(s,o||{})}function n(s){const o=s.breakpoints||{},a=Zo(o).filter(l=>e.matchMedia(l).matches).map(l=>o[l]).reduce((l,c)=>t(l,c),{});return t(s,a)}function r(s){return s.map(o=>Zo(o.breakpoints||{})).reduce((o,a)=>o.concat(a),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function HS(e){let t=[];function n(s,o){return t=s.filter(({options:a})=>e.optionsAtMedia(a).active!==!1),t.forEach(a=>a.init(o,e)),s.reduce((a,l)=>Object.assign(a,{[l.name]:l}),{})}function r(){t=t.filter(s=>s.destroy())}return{init:n,destroy:r}}function $i(e,t,n){const r=e.ownerDocument,i=r.defaultView,s=WS(i),o=HS(s),a=Es(),l=Es(),c=zS(),{animationRealms:u}=$i,{mergeOptions:d,optionsAtMedia:h,optionsMediaQueries:f}=s,{on:p,off:m,emit:y}=c,v=q;let b=!1,x,P=d(ZS,$i.globalOptions),A=d(P),O=[],U,F,B;function I(){const{container:Ce,slides:Re}=A;F=(gp(Ce)?e.querySelector(Ce):Ce)||e.children[0];const N=gp(Re)?F.querySelectorAll(Re):Re;B=[].slice.call(N||F.children)}function j(Ce,Re){const qe=BS(e,F,B,r,i,Ce,c,Re);if(Ce.loop&&!qe.slideLooper.canLoop()){const N=Object.assign({},Ce,{loop:!1});return j(N,Re)}return qe}function J(Ce,Re){if(b)return;const qe=u.find(ne=>ne.window===i),N=qe||VS(i);qe||u.push(N),P=d(P,Ce),A=h(P),O=Re||O,I(),x=j(A,N),f([P,...O.map(({options:ne})=>ne)]).forEach(ne=>a.add(ne,"change",q)),A.active&&(x.translate.to(x.location.get()),x.eventHandler.init(ke),x.resizeHandler.init(ke,A.watchResize),x.slidesHandler.init(ke,A.watchSlides),l.add(r,"visibilitychange",()=>{r.hidden&&N.reset()}),x.options.loop&&x.slideLooper.loop(),F.offsetParent&&B.length&&x.dragHandler.init(ke,A.watchDrag),U=o.init(O,ke))}function q(Ce,Re){const qe=Ne();H(),J(d({startIndex:qe},Ce),Re),c.emit("reInit")}function H(){x.dragHandler.destroy(),x.animation.stop(),x.eventStore.clear(),x.translate.clear(),x.slideLooper.clear(),x.resizeHandler.destroy(),x.slidesHandler.destroy(),o.destroy(),a.clear(),l.clear()}function V(){b||(b=!0,a.clear(),H(),c.emit("destroy"))}function z(Ce){const Re=x[Ce?"target":"location"].get(),qe=A.loop?"removeOffset":"constrain";return x.slidesInView.check(x.limit[qe](Re))}function Y(Ce){const Re=z(Ce);return x.slideIndexes.filter(qe=>!Re.includes(qe))}function K(Ce,Re,qe){!A.active||b||(x.scrollBody.useBaseFriction().useDuration(Re?0:A.duration),x.scrollTo.index(Ce,qe||0))}function pe(Ce){const Re=x.index.add(1).get();K(Re,Ce===!0,-1)}function k(Ce){const Re=x.index.add(-1).get();K(Re,Ce===!0,1)}function ee(){return x.index.add(1).get()!==Ne()}function xe(){return x.index.add(-1).get()!==Ne()}function S(){return x.scrollSnaps.map(x.scrollProgress.get)}function Te(){return x.scrollProgress.get(x.location.get())}function Ne(){return x.index.get()}function Ie(){return x.indexPrevious.get()}function je(){return U}function De(){return x}function Ue(){return e}function _e(){return F}function ve(){return B}const ke={canScrollNext:ee,canScrollPrev:xe,containerNode:_e,internalEngine:De,destroy:V,off:m,on:p,emit:y,plugins:je,previousScrollSnap:Ie,reInit:v,rootNode:Ue,scrollNext:pe,scrollPrev:k,scrollProgress:Te,scrollSnapList:S,scrollTo:K,selectedScrollSnap:Ne,slideNodes:ve,slidesInView:z,slidesNotInView:Y};return J(t,n),setTimeout(()=>c.emit("init"),0),ke}$i.animationRealms=[],$i.globalOptions=void 0;function Mc(e={},t=[]){const n=_.useRef(e),r=_.useRef(t),[i,s]=_.useState(),[o,a]=_.useState(),l=_.useCallback(()=>{i&&i.reInit(n.current,r.current)},[i]);return _.useEffect(()=>{if(yS()&&o){$i.globalOptions=Mc.globalOptions;const c=$i(o,n.current,r.current);return s(c),()=>c.destroy()}else s(void 0)},[o,s]),_.useEffect(()=>{Pc(n.current,e)||(n.current=e,l())},[e,l]),_.useEffect(()=>{vS(r.current,t)||(r.current=t,l())},[t,l]),[a,i]}Mc.globalOptions=void 0;function qS({title:e,titleId:t,...n},r){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?$.createElement("title",{id:t},e):null,$.createElement("path",{fillRule:"evenodd",d:"M7.72 12.53a.75.75 0 010-1.06l7.5-7.5a.75.75 0 111.06 1.06L9.31 12l6.97 6.97a.75.75 0 11-1.06 1.06l-7.5-7.5z",clipRule:"evenodd"}))}const KS=$.forwardRef(qS);function JS({title:e,titleId:t,...n},r){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?$.createElement("title",{id:t},e):null,$.createElement("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 010 1.06l-7.5 7.5a.75.75 0 01-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 011.06-1.06l7.5 7.5z",clipRule:"evenodd"}))}const GS=$.forwardRef(JS);function YS({title:e,titleId:t,...n},r){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?$.createElement("title",{id:t},e):null,$.createElement("path",{fillRule:"evenodd",d:"M5.625 1.5c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0016.5 9h-1.875a1.875 1.875 0 01-1.875-1.875V5.25A3.75 3.75 0 009 1.5H5.625zM7.5 15a.75.75 0 01.75-.75h7.5a.75.75 0 010 1.5h-7.5A.75.75 0 017.5 15zm.75 2.25a.75.75 0 000 1.5H12a.75.75 0 000-1.5H8.25z",clipRule:"evenodd"}),$.createElement("path",{d:"M12.971 1.816A5.23 5.23 0 0114.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 013.434 1.279 9.768 9.768 0 00-6.963-6.963z"}))}const QS=$.forwardRef(YS);function XS({title:e,titleId:t,...n},r){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?$.createElement("title",{id:t},e):null,$.createElement("path",{d:"M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z"}),$.createElement("path",{d:"M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z"}))}const eT=$.forwardRef(XS);function tT({title:e,titleId:t,...n},r){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?$.createElement("title",{id:t},e):null,$.createElement("path",{d:"M21.721 12.752a9.711 9.711 0 00-.945-5.003 12.754 12.754 0 01-4.339 2.708 18.991 18.991 0 01-.214 4.772 17.165 17.165 0 005.498-2.477zM14.634 15.55a17.324 17.324 0 00.332-4.647c-.952.227-1.945.347-2.966.347-1.021 0-2.014-.12-2.966-.347a17.515 17.515 0 00.332 4.647 17.385 17.385 0 005.268 0zM9.772 17.119a18.963 18.963 0 004.456 0A17.182 17.182 0 0112 21.724a17.18 17.18 0 01-2.228-4.605zM7.777 15.23a18.87 18.87 0 01-.214-4.774 12.753 12.753 0 01-4.34-2.708 9.711 9.711 0 00-.944 5.004 17.165 17.165 0 005.498 2.477zM21.356 14.752a9.765 9.765 0 01-7.478 6.817 18.64 18.64 0 001.988-4.718 18.627 18.627 0 005.49-2.098zM2.644 14.752c1.682.971 3.53 1.688 5.49 2.099a18.64 18.64 0 001.988 4.718 9.765 9.765 0 01-7.478-6.816zM13.878 2.43a9.755 9.755 0 016.116 3.986 11.267 11.267 0 01-3.746 2.504 18.63 18.63 0 00-2.37-6.49zM12 2.276a17.152 17.152 0 012.805 7.121c-.897.23-1.837.353-2.805.353-.968 0-1.908-.122-2.805-.353A17.151 17.151 0 0112 2.276zM10.122 2.43a18.629 18.629 0 00-2.37 6.49 11.266 11.266 0 01-3.746-2.504 9.754 9.754 0 016.116-3.985z"}))}const nT=$.forwardRef(tT);function rT({title:e,titleId:t,...n},r){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?$.createElement("title",{id:t},e):null,$.createElement("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"}))}const iT=$.forwardRef(rT);function sT({title:e,titleId:t,...n},r){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?$.createElement("title",{id:t},e):null,$.createElement("path",{fillRule:"evenodd",d:"M1.5 4.5a3 3 0 013-3h1.372c.86 0 1.61.586 1.819 1.42l1.105 4.423a1.875 1.875 0 01-.694 1.955l-1.293.97c-.135.101-.164.249-.126.352a11.285 11.285 0 006.697 6.697c.103.038.25.009.352-.126l.97-1.293a1.875 1.875 0 011.955-.694l4.423 1.105c.834.209 1.42.959 1.42 1.82V19.5a3 3 0 01-3 3h-2.25C8.552 22.5 1.5 15.448 1.5 6.75V4.5z",clipRule:"evenodd"}))}const oT=$.forwardRef(sT),aT=_.forwardRef(({type:e,styles:t,blocks:n},r)=>{const[i,s]=Mc({skipSnaps:!0}),[o,a]=_.useState(!0),[l,c]=_.useState(!0),u=_.useCallback(()=>s&&s.scrollPrev(),[s]),d=_.useCallback(()=>s&&s.scrollNext(),[s]),h=t==null?void 0:t[e],f=_.useCallback(p=>{a(!p.canScrollPrev()),c(!p.canScrollNext())},[]);return _.useEffect(()=>{s&&(f(s),s.on("reInit",f),s.on("select",f))},[s,f]),Z.jsxs("div",{...h==null?void 0:h.container,"data-container":"carousel",ref:i,children:[Z.jsx("div",{ref:r,...h==null?void 0:h.slidesContainer,children:n.map((p,m)=>Z.jsx(Ui,{styles:t,block:p},m))}),Z.jsx(KS,{...h==null?void 0:h.backButton,"data-disabled":o?"":void 0,onClick:u}),Z.jsx(GS,{...h==null?void 0:h.nextButton,"data-disabled":l?"":void 0,onClick:d})]})}),Ss=Math.min,Pn=Math.max,Ho=Math.round,Mi=Math.floor,Lr=e=>({x:e,y:e}),lT={left:"right",right:"left",bottom:"top",top:"bottom"},cT={start:"end",end:"start"};function qo(e,t){return typeof e=="function"?e(t):e}function ui(e){return e.split("-")[0]}function Ts(e){return e.split("-")[1]}function uT(e){return e==="x"?"y":"x"}function _p(e){return e==="y"?"height":"width"}function Ko(e){return["top","bottom"].includes(ui(e))?"y":"x"}function kp(e){return uT(Ko(e))}function dT(e,t,n){n===void 0&&(n=!1);const r=Ts(e),i=kp(e),s=_p(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=Jo(o)),[o,Jo(o)]}function fT(e){const t=Jo(e);return[Lc(e),t,Lc(t)]}function Lc(e){return e.replace(/start|end/g,t=>cT[t])}function hT(e,t,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?s:o;default:return[]}}function pT(e,t,n,r){const i=Ts(e);let s=hT(ui(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(Lc)))),s}function Jo(e){return e.replace(/left|right|bottom|top/g,t=>lT[t])}function mT(e){return{top:0,right:0,bottom:0,left:0,...e}}function gT(e){return typeof e!="number"?mT(e):{top:e,right:e,bottom:e,left:e}}function Go(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Dr(e){return Cp(e)?(e.nodeName||"").toLowerCase():"#document"}function _n(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function gr(e){var t;return(t=(Cp(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Cp(e){return e instanceof Node||e instanceof _n(e).Node}function At(e){return e instanceof Element||e instanceof _n(e).Element}function sn(e){return e instanceof HTMLElement||e instanceof _n(e).HTMLElement}function Dc(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _n(e).ShadowRoot}function Os(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=kn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function yT(e){return["table","td","th"].includes(Dr(e))}function Nc(e){const t=jc(),n=kn(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function vT(e){let t=di(e);for(;sn(t)&&!Is(t);){if(Nc(t))return t;t=di(t)}return null}function jc(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Is(e){return["html","body","#document"].includes(Dr(e))}function kn(e){return _n(e).getComputedStyle(e)}function Yo(e){return At(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function di(e){if(Dr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Dc(e)&&e.host||gr(e);return Dc(t)?t.host:t}function Ep(e){const t=di(e);return Is(t)?e.ownerDocument?e.ownerDocument.body:e.body:sn(t)&&Os(t)?t:Ep(t)}function Nr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Ep(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=_n(i);return s?t.concat(o,o.visualViewport||[],Os(i)?i:[],o.frameElement&&n?Nr(o.frameElement):[]):t.concat(i,Nr(i,[],n))}function jr(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function gn(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Dc(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Sp(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function bT(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function Tp(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(Sp())||t.test(bT()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Op(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function Ip(){return/apple/i.test(navigator.vendor)}function wT(){return Sp().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Pp(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function xT(e){return"nativeEvent"in e}function _T(e){return e.matches("html,body")}function jn(e){return(e==null?void 0:e.ownerDocument)||document}function Uc(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Ap(e){return"composedPath"in e?e.composedPath()[0]:e.target}const kT="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Rp(e){return sn(e)&&e.matches(kT)}function Qt(e){e.preventDefault(),e.stopPropagation()}function $p(e,t,n){let{reference:r,floating:i}=e;const s=Ko(t),o=kp(t),a=_p(o),l=ui(t),c=s==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let f;switch(l){case"top":f={x:u,y:r.y-i.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-i.width,y:d};break;default:f={x:r.x,y:r.y}}switch(Ts(t)){case"start":f[o]-=h*(n&&c?-1:1);break;case"end":f[o]+=h*(n&&c?-1:1);break}return f}const CT=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=$p(c,r,l),h=r,f={},p=0;for(let m=0;m<a.length;m++){const{name:y,fn:v}=a[m],{x:b,y:x,data:P,reset:A}=await v({x:u,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:f,rects:c,platform:o,elements:{reference:e,floating:t}});if(u=b??u,d=x??d,f={...f,[y]:{...f[y],...P}},A&&p<=50){p++,typeof A=="object"&&(A.placement&&(h=A.placement),A.rects&&(c=A.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:u,y:d}=$p(c,h,l)),m=-1;continue}}return{x:u,y:d,placement:h,strategy:i,middlewareData:f}};async function Mp(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=qo(t,e),p=gT(f),y=a[h?d==="floating"?"reference":"floating":d],v=Go(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b=d==="floating"?{...o.floating,x:r,y:i}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),P=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},A=Go(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:b,offsetParent:x,strategy:l}):b);return{top:(v.top-A.top+p.top)/P.y,bottom:(A.bottom-v.bottom+p.bottom)/P.y,left:(v.left-A.left+p.left)/P.x,right:(A.right-v.right+p.right)/P.x}}const ET=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...y}=qo(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=ui(i),b=ui(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),P=h||(b||!m?[Jo(a)]:fT(a));!h&&p!=="none"&&P.push(...pT(a,m,p,x));const A=[a,...P],O=await Mp(t,y),U=[];let F=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&U.push(O[v]),d){const J=dT(i,o,x);U.push(O[J[0]],O[J[1]])}if(F=[...F,{placement:i,overflows:U}],!U.every(J=>J<=0)){var B,I;const J=(((B=s.flip)==null?void 0:B.index)||0)+1,q=A[J];if(q)return{data:{index:J,overflows:F},reset:{placement:q}};let H=(I=F.filter(V=>V.overflows[0]<=0).sort((V,z)=>V.overflows[1]-z.overflows[1])[0])==null?void 0:I.placement;if(!H)switch(f){case"bestFit":{var j;const V=(j=F.map(z=>[z.placement,z.overflows.filter(Y=>Y>0).reduce((Y,K)=>Y+K,0)]).sort((z,Y)=>z[1]-Y[1])[0])==null?void 0:j[0];V&&(H=V);break}case"initialPlacement":H=a;break}if(i!==H)return{reset:{placement:H}}}return{}}}};async function ST(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ui(n),a=Ts(n),l=Ko(n)==="y",c=["left","top"].includes(o)?-1:1,u=s&&l?-1:1,d=qo(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof p=="number"&&(f=a==="end"?p*-1:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}const TT=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await ST(t,e);return{x:n+i.x,y:r+i.y,data:i}}}},OT=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:s}=t,{apply:o=()=>{},...a}=qo(e,t),l=await Mp(t,a),c=ui(n),u=Ts(n),d=Ko(n)==="y",{width:h,height:f}=r.floating;let p,m;c==="top"||c==="bottom"?(p=c,m=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(m=c,p=u==="end"?"top":"bottom");const y=f-l[p],v=h-l[m],b=!t.middlewareData.shift;let x=y,P=v;if(d){const O=h-l.left-l.right;P=u||b?Ss(v,O):O}else{const O=f-l.top-l.bottom;x=u||b?Ss(y,O):O}if(b&&!u){const O=Pn(l.left,0),U=Pn(l.right,0),F=Pn(l.top,0),B=Pn(l.bottom,0);d?P=h-2*(O!==0||U!==0?O+U:Pn(l.left,l.right)):x=f-2*(F!==0||B!==0?F+B:Pn(l.top,l.bottom))}await o({...t,availableWidth:P,availableHeight:x});const A=await i.getDimensions(s.floating);return h!==A.width||f!==A.height?{reset:{rects:!0}}:{}}}};function Lp(e){const t=kn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=sn(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=Ho(n)!==s||Ho(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function Fc(e){return At(e)?e:e.contextElement}function Li(e){const t=Fc(e);if(!sn(t))return Lr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=Lp(t);let o=(s?Ho(n.width):n.width)/r,a=(s?Ho(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const IT=Lr(0);function Dp(e){const t=_n(e);return!jc()||!t.visualViewport?IT:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function PT(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==_n(e)?!1:t}function fi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Fc(e);let o=Lr(1);t&&(r?At(r)&&(o=Li(r)):o=Li(e));const a=PT(s,n,r)?Dp(s):Lr(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(s){const h=_n(s),f=r&&At(r)?_n(r):r;let p=h.frameElement;for(;p&&r&&f!==h;){const m=Li(p),y=p.getBoundingClientRect(),v=kn(p),b=y.left+(p.clientLeft+parseFloat(v.paddingLeft))*m.x,x=y.top+(p.clientTop+parseFloat(v.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,d*=m.y,l+=b,c+=x,p=_n(p).frameElement}}return Go({width:u,height:d,x:l,y:c})}function AT(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=sn(n),s=gr(n);if(n===s)return t;let o={scrollLeft:0,scrollTop:0},a=Lr(1);const l=Lr(0);if((i||!i&&r!=="fixed")&&((Dr(n)!=="body"||Os(s))&&(o=Yo(n)),sn(n))){const c=fi(n);a=Li(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-o.scrollLeft*a.x+l.x,y:t.y*a.y-o.scrollTop*a.y+l.y}}function RT(e){return Array.from(e.getClientRects())}function Np(e){return fi(gr(e)).left+Yo(e).scrollLeft}function $T(e){const t=gr(e),n=Yo(e),r=e.ownerDocument.body,i=Pn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Pn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Np(e);const a=-n.scrollTop;return kn(r).direction==="rtl"&&(o+=Pn(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function MT(e,t){const n=_n(e),r=gr(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const c=jc();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function LT(e,t){const n=fi(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=sn(e)?Li(e):Lr(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,c=r*s.y;return{width:o,height:a,x:l,y:c}}function jp(e,t,n){let r;if(t==="viewport")r=MT(e,n);else if(t==="document")r=$T(gr(e));else if(At(t))r=LT(t,n);else{const i=Dp(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return Go(r)}function Up(e,t){const n=di(e);return n===t||!At(n)||Is(n)?!1:kn(n).position==="fixed"||Up(n,t)}function DT(e,t){const n=t.get(e);if(n)return n;let r=Nr(e,[],!1).filter(a=>At(a)&&Dr(a)!=="body"),i=null;const s=kn(e).position==="fixed";let o=s?di(e):e;for(;At(o)&&!Is(o);){const a=kn(o),l=Nc(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Os(o)&&!l&&Up(e,o))?r=r.filter(u=>u!==o):i=a,o=di(o)}return t.set(e,r),r}function NT(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?DT(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((c,u)=>{const d=jp(t,u,i);return c.top=Pn(d.top,c.top),c.right=Ss(d.right,c.right),c.bottom=Ss(d.bottom,c.bottom),c.left=Pn(d.left,c.left),c},jp(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function jT(e){return Lp(e)}function UT(e,t,n){const r=sn(t),i=gr(t),s=n==="fixed",o=fi(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Lr(0);if(r||!r&&!s)if((Dr(t)!=="body"||Os(i))&&(a=Yo(t)),r){const c=fi(t,!0,s,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else i&&(l.x=Np(i));return{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Fp(e,t){return!sn(e)||kn(e).position==="fixed"?null:t?t(e):e.offsetParent}function Bp(e,t){const n=_n(e);if(!sn(e))return n;let r=Fp(e,t);for(;r&&yT(r)&&kn(r).position==="static";)r=Fp(r,t);return r&&(Dr(r)==="html"||Dr(r)==="body"&&kn(r).position==="static"&&!Nc(r))?n:r||vT(e)||n}const FT=async function(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||Bp,s=this.getDimensions;return{reference:UT(t,await i(n),r),floating:{x:0,y:0,...await s(n)}}};function BT(e){return kn(e).direction==="rtl"}const VT={convertOffsetParentRelativeRectToViewportRelativeRect:AT,getDocumentElement:gr,getClippingRect:NT,getOffsetParent:Bp,getElementRects:FT,getClientRects:RT,getDimensions:jT,getScale:Li,isElement:At,isRTL:BT};function zT(e,t){let n=null,r;const i=gr(e);function s(){clearTimeout(r),n&&n.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const f=Mi(u),p=Mi(i.clientWidth-(c+d)),m=Mi(i.clientHeight-(u+h)),y=Mi(c),b={rootMargin:-f+"px "+-p+"px "+-m+"px "+-y+"px",threshold:Pn(0,Ss(1,l))||1};let x=!0;function P(A){const O=A[0].intersectionRatio;if(O!==l){if(!x)return o();O?o(!1,O):r=setTimeout(()=>{o(!1,1e-7)},100)}x=!1}try{n=new IntersectionObserver(P,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(P,b)}n.observe(e)}return o(!0),s}function ZT(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Fc(e),u=i||s?[...c?Nr(c):[],...Nr(t)]:[];u.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=c&&a?zT(c,n):null;let h=-1,f=null;o&&(f=new ResizeObserver(v=>{let[b]=v;b&&b.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{f&&f.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let p,m=l?fi(e):null;l&&y();function y(){const v=fi(e);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&n(),m=v,p=requestAnimationFrame(y)}return n(),()=>{u.forEach(v=>{i&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),d&&d(),f&&f.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const WT=(e,t,n)=>{const r=new Map,i={platform:VT,...n},s={...i.platform,_c:r};return CT(e,t,{...i,platform:s})};var Qo=typeof document<"u"?_.useLayoutEffect:_.useEffect;function Xo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Xo(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!Xo(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function Vp(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zp(e,t){const n=Vp(e);return Math.round(t*n)/n}function Zp(e){const t=$.useRef(e);return Qo(()=>{t.current=e}),t}function HT(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=$.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=$.useState(r);Xo(h,r)||f(r);const[p,m]=$.useState(null),[y,v]=$.useState(null),b=$.useCallback(z=>{z!=O.current&&(O.current=z,m(z))},[m]),x=$.useCallback(z=>{z!==U.current&&(U.current=z,v(z))},[v]),P=s||p,A=o||y,O=$.useRef(null),U=$.useRef(null),F=$.useRef(u),B=Zp(l),I=Zp(i),j=$.useCallback(()=>{if(!O.current||!U.current)return;const z={placement:t,strategy:n,middleware:h};I.current&&(z.platform=I.current),WT(O.current,U.current,z).then(Y=>{const K={...Y,isPositioned:!0};J.current&&!Xo(F.current,K)&&(F.current=K,Fb.flushSync(()=>{d(K)}))})},[h,t,n,I]);Qo(()=>{c===!1&&F.current.isPositioned&&(F.current.isPositioned=!1,d(z=>({...z,isPositioned:!1})))},[c]);const J=$.useRef(!1);Qo(()=>(J.current=!0,()=>{J.current=!1}),[]),Qo(()=>{if(P&&(O.current=P),A&&(U.current=A),P&&A){if(B.current)return B.current(P,A,j);j()}},[P,A,j,B]);const q=$.useMemo(()=>({reference:O,floating:U,setReference:b,setFloating:x}),[b,x]),H=$.useMemo(()=>({reference:P,floating:A}),[P,A]),V=$.useMemo(()=>{const z={position:n,left:0,top:0};if(!H.floating)return z;const Y=zp(H.floating,u.x),K=zp(H.floating,u.y);return a?{...z,transform:"translate("+Y+"px, "+K+"px)",...Vp(H.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:K}},[n,a,H.floating,u.x,u.y]);return $.useMemo(()=>({...u,update:j,refs:q,elements:H,floatingStyles:V}),[u,j,q,H,V])}/*!
|
|
233
|
+
`));let h=gp((i=u.props)==null?void 0:i.className,l.className),f=h?{className:h}:{};return _.cloneElement(u,Object.assign({},bp(u.props,wp(Dc(l,["ref"]))),d,c,SS(u.ref,c.ref),f))}return _.createElement(s,Object.assign({},Dc(l,["ref"]),s!==_.Fragment&&c,s!==_.Fragment&&d),u)}function SS(...e){return{ref:e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}}function bp(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](i,...s){let o=n[r];for(let a of o){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;a(i,...s)}}});return t}function Lc(e){var t;return Object.assign(_.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function wp(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function Dc(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}let Nc=_.createContext(null);Nc.displayName="OpenClosedContext";var vr=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(vr||{});function xp(){return _.useContext(Nc)}function TS({value:e,children:t}){return _.createElement(Nc.Provider,{value:e},t)}function _p(){let e=_.useRef(!1);return Ho(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function OS(e=0){let[t,n]=_.useState(e),r=_.useCallback(a=>n(l=>l|a),[t]),i=_.useCallback(a=>!!(t&a),[t]),s=_.useCallback(a=>n(l=>l&~a),[n]),o=_.useCallback(a=>n(l=>l^a),[n]);return{flags:t,addFlag:r,hasFlag:i,removeFlag:s,toggleFlag:o}}function IS(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}function jc(e,...t){e&&t.length>0&&e.classList.add(...t)}function Uc(e,...t){e&&t.length>0&&e.classList.remove(...t)}function PS(e,t){let n=qo();if(!e)return n.dispose;let{transitionDuration:r,transitionDelay:i}=getComputedStyle(e),[s,o]=[r,i].map(a=>{let[l=0]=a.split(",").filter(Boolean).map(c=>c.includes("ms")?parseFloat(c):parseFloat(c)*1e3).sort((c,u)=>u-c);return l});if(s+o!==0){let a=n.addEventListener(e,"transitionend",l=>{l.target===l.currentTarget&&(t(),a())})}else t();return n.add(()=>t()),n.dispose}function AS(e,t,n,r){let i=n?"enter":"leave",s=qo(),o=r!==void 0?IS(r):()=>{};i==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let a=Xn(i,{enter:()=>t.enter,leave:()=>t.leave}),l=Xn(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=Xn(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return Uc(e,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),jc(e,...a,...c),s.nextFrame(()=>{Uc(e,...c),jc(e,...l),PS(e,()=>(Uc(e,...a),jc(e,...t.entered),o()))}),s.dispose}function RS({container:e,direction:t,classes:n,onStart:r,onStop:i}){let s=_p(),o=hp(),a=ji(t);Ho(()=>{let l=qo();o.add(l.dispose);let c=e.current;if(c&&a.current!=="idle"&&s.current)return l.dispose(),r.current(a.current),l.add(AS(c,n.current,a.current==="enter",()=>{l.dispose(),i.current(a.current)})),l.dispose},[t])}function mi(e=""){return e.split(" ").filter(t=>t.trim().length>1)}let Jo=_.createContext(null);Jo.displayName="TransitionContext";var $S=(e=>(e.Visible="visible",e.Hidden="hidden",e))($S||{});function MS(){let e=_.useContext(Jo);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function LS(){let e=_.useContext(Go);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Go=_.createContext(null);Go.displayName="NestingContext";function Yo(e){return"children"in e?Yo(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function kp(e,t){let n=ji(e),r=_.useRef([]),i=_p(),s=hp(),o=pi((f,p=yr.Hidden)=>{let m=r.current.findIndex(({el:y})=>y===f);m!==-1&&(Xn(p,{[yr.Unmount](){r.current.splice(m,1)},[yr.Hidden](){r.current[m].state="hidden"}}),s.microTask(()=>{var y;!Yo(r)&&i.current&&((y=n.current)==null||y.call(n))}))}),a=pi(f=>{let p=r.current.find(({el:m})=>m===f);return p?p.state!=="visible"&&(p.state="visible"):r.current.push({el:f,state:"visible"}),()=>o(f,yr.Unmount)}),l=_.useRef([]),c=_.useRef(Promise.resolve()),u=_.useRef({enter:[],leave:[],idle:[]}),d=pi((f,p,m)=>{l.current.splice(0),t&&(t.chains.current[p]=t.chains.current[p].filter(([y])=>y!==f)),t==null||t.chains.current[p].push([f,new Promise(y=>{l.current.push(y)})]),t==null||t.chains.current[p].push([f,new Promise(y=>{Promise.all(u.current[p].map(([v,b])=>b)).then(()=>y())})]),p==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>m(p)):m(p)}),h=pi((f,p,m)=>{Promise.all(u.current[p].splice(0).map(([y,v])=>v)).then(()=>{var y;(y=l.current.shift())==null||y()}).then(()=>m(p))});return _.useMemo(()=>({children:r,register:a,unregister:o,onStart:d,onStop:h,wait:c,chains:u}),[a,o,r,d,h,u,c])}function DS(){}let NS=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function Cp(e){var t;let n={};for(let r of NS)n[r]=(t=e[r])!=null?t:DS;return n}function jS(e){let t=_.useRef(Cp(e));return _.useEffect(()=>{t.current=Cp(e)},[e]),t}let US="div",Ep=yp.RenderStrategy,Sp=Lc(function(e,t){let{beforeEnter:n,afterEnter:r,beforeLeave:i,afterLeave:s,enter:o,enterFrom:a,enterTo:l,entered:c,leave:u,leaveFrom:d,leaveTo:h,...f}=e,p=_.useRef(null),m=mp(p,t),y=f.unmount?yr.Unmount:yr.Hidden,{show:v,appear:b,initial:x}=MS(),[I,P]=_.useState(v?"visible":"hidden"),T=LS(),{register:j,unregister:U}=T,F=_.useRef(null);_.useEffect(()=>j(p),[j,p]),_.useEffect(()=>{if(y===yr.Hidden&&p.current){if(v&&I!=="visible"){P("visible");return}return Xn(I,{hidden:()=>U(p),visible:()=>j(p)})}},[I,p,j,U,v,y]);let O=ji({enter:mi(o),enterFrom:mi(a),enterTo:mi(l),entered:mi(c),leave:mi(u),leaveFrom:mi(d),leaveTo:mi(h)}),N=jS({beforeEnter:n,afterEnter:r,beforeLeave:i,afterLeave:s}),J=pp();_.useEffect(()=>{if(J&&I==="visible"&&p.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[p,I,J]);let q=x&&!b,W=(()=>!J||q||F.current===v?"idle":v?"enter":"leave")(),B=OS(0),V=pi(ee=>Xn(ee,{enter:()=>{B.addFlag(vr.Opening),N.current.beforeEnter()},leave:()=>{B.addFlag(vr.Closing),N.current.beforeLeave()},idle:()=>{}})),Y=pi(ee=>Xn(ee,{enter:()=>{B.removeFlag(vr.Opening),N.current.afterEnter()},leave:()=>{B.removeFlag(vr.Closing),N.current.afterLeave()},idle:()=>{}})),K=kp(()=>{P("hidden"),U(p)},T);RS({container:p,classes:O,direction:W,onStart:ji(ee=>{K.onStart(p,ee,V)}),onStop:ji(ee=>{K.onStop(p,ee,Y),ee==="leave"&&!Yo(K)&&(P("hidden"),U(p))})}),_.useEffect(()=>{!q||(y===yr.Hidden?F.current=null:F.current=v)},[v,q,I]);let pe=f,k={ref:m};return b&&v&&Ps.isServer&&(pe={...pe,className:gp(f.className,...O.current.enter,...O.current.enterFrom)}),_.createElement(Go.Provider,{value:K},_.createElement(TS,{value:Xn(I,{visible:vr.Open,hidden:vr.Closed})|B.flags},vp({ourProps:k,theirProps:pe,defaultTag:US,features:Ep,visible:I==="visible",name:"Transition.Child"})))}),Fc=Lc(function(e,t){let{show:n,appear:r=!1,unmount:i,...s}=e,o=_.useRef(null),a=mp(o,t);pp();let l=xp();if(n===void 0&&l!==null&&(n=(l&vr.Open)===vr.Open),![!0,!1].includes(n))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,u]=_.useState(n?"visible":"hidden"),d=kp(()=>{u("hidden")}),[h,f]=_.useState(!0),p=_.useRef([n]);Ho(()=>{h!==!1&&p.current[p.current.length-1]!==n&&(p.current.push(n),f(!1))},[p,n]);let m=_.useMemo(()=>({show:n,appear:r,initial:h}),[n,r,h]);_.useEffect(()=>{if(n)u("visible");else if(!Yo(d))u("hidden");else{let v=o.current;if(!v)return;let b=v.getBoundingClientRect();b.x===0&&b.y===0&&b.width===0&&b.height===0&&u("hidden")}},[n,d]);let y={unmount:i};return _.createElement(Go.Provider,{value:d},_.createElement(Jo.Provider,{value:m},vp({ourProps:{...y,as:_.Fragment,children:_.createElement(Sp,{ref:a,...y,...s})},theirProps:{},defaultTag:_.Fragment,features:Ep,visible:c==="visible",name:"Transition"})))}),FS=Lc(function(e,t){let n=_.useContext(Jo)!==null,r=xp()!==null;return _.createElement(_.Fragment,null,!n&&r?_.createElement(Fc,{ref:t,...e}):_.createElement(Sp,{ref:t,...e}))}),BS=Object.assign(Fc,{Child:FS,Root:Fc});const VS=e=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,...e},R.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"m7.5 12 3 3 6-6m5.5 3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"})),zS=e=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",...e},R.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M18 6 6 18M6 6l12 12"})),ZS=e=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,...e},R.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"m15 9-6 6m0-6 6 6m7-3c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));function WS(e){return vn.custom(t=>z.jsx(qS,{type:e.type,show:t.visible,children:e.type==="custom"?e.content:z.jsx(HS,{...e,toastId:t.id})}))}const HS=({icon:e,type:t,title:n,description:r,toastId:i})=>{const{theme:{notification:s}}=mt();return z.jsxs(z.Fragment,{children:[e?z.jsx(e,{...s==null?void 0:s.icon}):z.jsx(KS,{...s==null?void 0:s.icon,type:t}),z.jsx("p",{...s==null?void 0:s.title,children:n}),r?z.jsx("p",{...s==null?void 0:s.description,children:r}):null,z.jsx(zS,{...s==null?void 0:s.closeIcon,onClick:()=>vn.dismiss(i)})]})},qS=({type:e,...t})=>{const{theme:{notification:n}}=mt();return z.jsx(BS,{...t,...n==null?void 0:n.container,appear:!0,"data-type":e??"neutral"})},KS=({type:e,className:t})=>{switch(e){case"success":return z.jsx(VS,{className:t});case"error":return z.jsx(ZS,{className:t});default:return null}},JS=_.forwardRef(({url:e,type:t,styles:n,orientation:r="auto",...i},s)=>{var h,f;const o=_.useId(),{setIsLoading:a}=EE(),[l,c]=_.useState(r),[u,d]=_.useState(!1);return _.useLayoutEffect(()=>{a(p=>[...p,o])},[]),_.useEffect(()=>{e&&l==="auto"&&PE(e).then(({width:p,height:m})=>{c(GS(p,m)),a(y=>y.filter(v=>v!==o))})},[e]),z.jsxs(z.Fragment,{children:[u?null:z.jsx("div",{"data-orientation":l,...(h=n==null?void 0:n[t])==null?void 0:h.placeholder}),z.jsx("img",{"data-orientation":l,"data-loaded":u,...i,...(f=n==null?void 0:n[t])==null?void 0:f.image,src:e,alt:"",ref:s,loading:"lazy",onLoad:()=>{d(!0)}})]})});function GS(e,t){const n={square:1,portrait:.75,landscape:1.3333333333333333},r=e/t;return Object.keys(n).reduce((s,o)=>Math.abs(n[o]-r)<Math.abs(n[s]-r)?o:s)}const YS=_.forwardRef(({url:e,type:t,styles:n,...r},i)=>z.jsx("div",{children:z.jsx("video",{...r,controls:!0,src:e,...n==null?void 0:n[t],ref:i})})),QS=_.forwardRef(({url:e,type:t,styles:n,...r},i)=>z.jsx("div",{children:z.jsx("audio",{...r,controls:!0,src:e,...n==null?void 0:n[t],ref:i})}));function XS({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M10 3a.75.75 0 01.75.75v10.638l3.96-4.158a.75.75 0 111.08 1.04l-5.25 5.5a.75.75 0 01-1.08 0l-5.25-5.5a.75.75 0 111.08-1.04l3.96 4.158V3.75A.75.75 0 0110 3z",clipRule:"evenodd"}))}const eT=R.forwardRef(XS);function tT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M15.312 11.424a5.5 5.5 0 01-9.201 2.466l-.312-.311h2.433a.75.75 0 000-1.5H3.989a.75.75 0 00-.75.75v4.242a.75.75 0 001.5 0v-2.43l.31.31a7 7 0 0011.712-3.138.75.75 0 00-1.449-.39zm1.23-3.723a.75.75 0 00.219-.53V2.929a.75.75 0 00-1.5 0V5.36l-.31-.31A7 7 0 003.239 8.188a.75.75 0 101.448.389A5.5 5.5 0 0113.89 6.11l.311.31h-2.432a.75.75 0 000 1.5h4.243a.75.75 0 00.53-.219z",clipRule:"evenodd"}))}const nT=R.forwardRef(tT);function rT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm-.75-4.75a.75.75 0 001.5 0V8.66l1.95 2.1a.75.75 0 101.1-1.02l-3.25-3.5a.75.75 0 00-1.1 0L6.2 9.74a.75.75 0 101.1 1.02l1.95-2.1v4.59z",clipRule:"evenodd"}))}const iT=R.forwardRef(rT);function sT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"}))}const oT=R.forwardRef(sT);function aT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M4.5 2A1.5 1.5 0 003 3.5v13A1.5 1.5 0 004.5 18h11a1.5 1.5 0 001.5-1.5V7.621a1.5 1.5 0 00-.44-1.06l-4.12-4.122A1.5 1.5 0 0011.378 2H4.5zm4.75 6.75a.75.75 0 011.5 0v2.546l.943-1.048a.75.75 0 011.114 1.004l-2.25 2.5a.75.75 0 01-1.114 0l-2.25-2.5a.75.75 0 111.114-1.004l.943 1.048V8.75z",clipRule:"evenodd"}))}const lT=R.forwardRef(aT);function cT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M9.69 18.933l.003.001C9.89 19.02 10 19 10 19s.11.02.308-.066l.002-.001.006-.003.018-.008a5.741 5.741 0 00.281-.14c.186-.096.446-.24.757-.433.62-.384 1.445-.966 2.274-1.765C15.302 14.988 17 12.493 17 9A7 7 0 103 9c0 3.492 1.698 5.988 3.355 7.584a13.731 13.731 0 002.273 1.765 11.842 11.842 0 00.976.544l.062.029.018.008.006.003zM10 11.25a2.25 2.25 0 100-4.5 2.25 2.25 0 000 4.5z",clipRule:"evenodd"}))}const uT=R.forwardRef(cT),dT=_.forwardRef(({type:e,latitude:t,longitude:n,title:r,styles:i,...s},o)=>{var l,c,u;const a=`https://www.google.com/maps/search/?api=1&query=${t},${n}`;return z.jsxs("a",{...s,...(l=i==null?void 0:i[e])==null?void 0:l.container,href:a,type:"_blank",rel:"noopener",ref:o,children:[z.jsx("p",{...(c=i==null?void 0:i[e])==null?void 0:c.title,children:r}),z.jsx(uT,{...(u=i==null?void 0:i[e])==null?void 0:u.icon})]})}),fT=_.forwardRef(({blocks:e,styles:t,type:n,horizontalAlignment:r,verticalAlignment:i,...s},o)=>z.jsx("div",{"data-horizontal":r,"data-vertical":i,...s,...t==null?void 0:t[n],ref:o,children:e.map((a,l)=>z.jsx(Wi,{styles:t,block:a},l))})),hT=_.forwardRef(({blocks:e,styles:t,type:n,horizontalAlignment:r,verticalAlignment:i,...s},o)=>z.jsx("div",{"data-horizontal":r,"data-vertical":i,...s,...t==null?void 0:t[n],ref:o,children:e.map((a,l)=>z.jsx(Wi,{styles:t,block:a},l))}));function pT(e){return Object.prototype.toString.call(e)==="[object Object]"}function Tp(e){return pT(e)||Array.isArray(e)}function mT(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Bc(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;const i=JSON.stringify(Object.keys(e.breakpoints||{})),s=JSON.stringify(Object.keys(t.breakpoints||{}));return i!==s?!1:n.every(o=>{const a=e[o],l=t[o];return typeof a=="function"?`${a}`==`${l}`:!Tp(a)||!Tp(l)?a===l:Bc(a,l)})}function Op(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function gT(e,t){if(e.length!==t.length)return!1;const n=Op(e),r=Op(t);return n.every((i,s)=>{const o=r[s];return Bc(i,o)})}function Vc(e){return typeof e=="number"}function Ip(e){return typeof e=="string"}function zc(e){return typeof e=="boolean"}function Pp(e){return Object.prototype.toString.call(e)==="[object Object]"}function It(e){return Math.abs(e)}function Zc(e){return Math.sign(e)}function Qo(e,t){return It(e-t)}function yT(e,t){if(e===0||t===0||It(e)<=It(t))return 0;const n=Qo(It(e),It(t));return It(n/e)}function As(e){return ea(e).map(Number)}function br(e){return e[Xo(e)]}function Xo(e){return Math.max(0,e.length-1)}function ea(e){return Object.keys(e)}function Ap(e,t){return[e,t].reduce((n,r)=>(ea(r).forEach(i=>{const s=n[i],o=r[i],a=Pp(s)&&Pp(o);n[i]=a?Ap(s,o):o}),n),{})}function Rp(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function vT(e,t){const n={start:r,center:i,end:s};function r(){return 0}function i(c){return s(c)/2}function s(c){return t-c}function o(){return t*Number(e)}function a(c){return Vc(e)?o():n[e](c)}return{measure:a}}function bT(e,t){const n=e==="y"?"y":"x",r=e==="y"?"x":"y",i=a(),s=l();function o(u){const{width:d,height:h}=u;return n==="x"?d:h}function a(){return n==="y"?"top":t==="rtl"?"right":"left"}function l(){return n==="y"?"bottom":t==="rtl"?"left":"right"}return{scroll:n,cross:r,startEdge:i,endEdge:s,measureSize:o}}function Ur(e,t){const n=It(e-t);function r(c){return c<e}function i(c){return c>t}function s(c){return r(c)||i(c)}function o(c){return s(c)?r(c)?e:t:c}function a(c){return n?c-n*Math.ceil((c-t)/n):c}return{length:n,max:t,min:e,constrain:o,reachedAny:s,reachedMax:i,reachedMin:r,removeOffset:a}}function $p(e,t,n){const{constrain:r}=Ur(0,e),i=e+1;let s=o(t);function o(h){return n?It((i+h)%i):r(h)}function a(){return s}function l(h){return s=o(h),d}function c(h){return u().set(a()+h)}function u(){return $p(e,a(),n)}const d={get:a,set:l,add:c,clone:u};return d}function wT(e){const t=e==="rtl"?-1:1;function n(i){return i*t}return{apply:n}}function Rs(){let e=[];function t(i,s,o,a={passive:!0}){return i.addEventListener(s,o,a),e.push(()=>i.removeEventListener(s,o,a)),r}function n(){e=e.filter(i=>i())}const r={add:t,clear:n};return r}function xT(e,t,n,r,i,s,o,a,l,c,u,d,h,f,p,m,y,v,b){const{cross:x}=e,I=["INPUT","SELECT","TEXTAREA"],P={passive:!1},T=Rs(),j=Rs(),U=Ur(50,225).constrain(p.measure(20)),F={mouse:300,touch:400},O={mouse:500,touch:600},N=m?43:25;let J=!1,q=0,W=0,B=!1,V=!1,Y=!1,K=!1;function pe(ve,ke){if(!ke)return;function Ce(qe){(zc(ke)||ke(ve,qe))&&Ne(qe)}const Re=n;T.add(Re,"dragstart",qe=>qe.preventDefault(),P).add(Re,"touchmove",()=>{},P).add(Re,"touchend",()=>{}).add(Re,"touchstart",Ce).add(Re,"mousedown",Ce).add(Re,"touchcancel",je).add(Re,"contextmenu",je).add(Re,"click",De,!0)}function k(){T.clear(),j.clear()}function ee(){const ve=K?r:n;j.add(ve,"touchmove",Ie,P).add(ve,"touchend",je).add(ve,"mousemove",Ie,P).add(ve,"mouseup",je)}function xe(ve){const ke=ve.nodeName||"";return I.includes(ke)}function S(){return(m?O:F)[K?"mouse":"touch"]}function Te(ve,ke){const Ce=h.add(Zc(ve)*-1),Re=d.byDistance(ve,!m).distance;return m||It(ve)<U?Re:v&&ke?Re*.5:d.byIndex(Ce.get(),0).distance}function Ne(ve){const ke=Rp(ve,i);K=ke,!(ke&&ve.button!==0)&&(xe(ve.target)||(Y=m&&ke&&!ve.buttons&&J,J=Qo(s.get(),a.get())>=2,B=!0,o.pointerDown(ve),u.useFriction(0).useDuration(0),s.set(a),ee(),q=o.readPoint(ve),W=o.readPoint(ve,x),f.emit("pointerDown")))}function Ie(ve){const ke=o.readPoint(ve),Ce=o.readPoint(ve,x),Re=Qo(ke,q),qe=Qo(Ce,W);if(!V&&!K&&(!ve.cancelable||(V=Re>qe,!V)))return je(ve);const D=o.pointerMove(ve);Re>y&&(Y=!0),u.useFriction(.3).useDuration(1),l.start(),s.add(t.apply(D)),ve.preventDefault()}function je(ve){const Ce=d.byDistance(0,!1).index!==h.get(),Re=o.pointerUp(ve)*S(),qe=Te(t.apply(Re),Ce),D=yT(Re,qe),ne=N-10*D,me=b+D/50;V=!1,B=!1,j.clear(),u.useDuration(ne).useFriction(me),c.distance(qe,!m),K=!1,f.emit("pointerUp")}function De(ve){Y&&(ve.stopPropagation(),ve.preventDefault())}function Ue(){return B}return{init:pe,pointerDown:Ue,destroy:k}}function _T(e,t){let r,i;function s(d){return d.timeStamp}function o(d,h){const p=`client${(h||e.scroll)==="x"?"X":"Y"}`;return(Rp(d,t)?d:d.touches[0])[p]}function a(d){return r=d,i=d,o(d)}function l(d){const h=o(d)-o(i),f=s(d)-s(r)>170;return i=d,f&&(r=d),h}function c(d){if(!r||!i)return 0;const h=o(i)-o(r),f=s(d)-s(r),p=s(d)-s(i)>170,m=h/f;return f&&!p&&It(m)>.1?m:0}return{pointerDown:a,pointerMove:l,pointerUp:c,readPoint:o}}function kT(e){function t(r){return e*(r/100)}return{measure:t}}function CT(e,t,n,r,i){let s,o,a=[],l=!1;function c(f){return i.measureSize(f.getBoundingClientRect())}function u(f,p){if(!p)return;o=c(e),a=r.map(c);function m(v){for(const b of v){const x=b.target===e,I=r.indexOf(b.target),P=x?o:a[I],T=c(x?e:r[I]);if(P!==T){n.requestAnimationFrame(()=>{f.reInit(),t.emit("resize")});break}}}s=new ResizeObserver(v=>{l||(zc(p)||p(f,v))&&m(v)}),[e].concat(r).forEach(v=>s.observe(v))}function d(){s&&s.disconnect(),l=!0}return{init:u,destroy:d}}function ET(e,t,n,r){let i=!0,s=0,o=0,a=n,l=r,c=e.get(),u=0;function d(){const P=t.get()-e.get(),T=!a;let j=0;return T?(s=0,e.set(t),j=P):(s+=P/a,s*=l,c+=s,e.add(s),j=c-u),o=Zc(j),u=c,i=It(P)<.001,I}function h(){return i}function f(){return a}function p(){return o}function m(){return s}function y(){return b(n)}function v(){return x(r)}function b(P){return a=P,I}function x(P){return l=P,I}const I={direction:p,duration:f,velocity:m,seek:d,settled:h,useBaseFriction:v,useBaseDuration:y,useFriction:x,useDuration:b};return I}function ST(e,t,n,r,i){const s=i.measure(10),o=i.measure(50),a=Ur(.1,.99);let l=!1;function c(){return!(l||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function u(f){if(!c())return;const p=e.reachedMin(t.get())?"min":"max",m=It(e[p]-t.get()),y=n.get()-t.get(),v=a.constrain(m/o);n.subtract(y*v),!f&&It(y)<s&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function d(f){l=!f}return{constrain:u,toggleActive:d}}function TT(e,t,n,r){const i=Ur(-t+e,n[0]),s=l(),o=c();function a(){const d=s[0],h=br(s),f=s.lastIndexOf(d),p=s.indexOf(h)+1;return Ur(f,p)}function l(){return n.map(i.constrain).map(d=>parseFloat(d.toFixed(3)))}function c(){if(t<=e)return[i.max];if(r==="keepSnaps")return s;const{min:d,max:h}=a();return s.slice(d,h)}return{snapsContained:o}}function OT(e,t,n){const r=t[0],i=n?r-e:br(t);return{limit:Ur(i,r)}}function IT(e,t,n,r){const s=t.min+.1,o=t.max+.1,{reachedMin:a,reachedMax:l}=Ur(s,o);function c(h){return h===1?l(n.get()):h===-1?a(n.get()):!1}function u(h){if(!c(h))return;const f=e*(h*-1);r.forEach(p=>p.add(f))}return{loop:u}}function PT(e){const{max:t,length:n}=e;function r(s){return(s-t)/-n}return{get:r}}function AT(e,t,n,r,i,s,o){const{startEdge:a,endEdge:l}=e,{groupSlides:c}=s,u=f().map(t.measure),d=p(),h=m();function f(){return c(r).map(v=>br(v)[l]-v[0][a]).map(It)}function p(){return r.map(v=>n[a]-v[a]).map(v=>-It(v))}function m(){const b=br(d)-br(i);return c(d).map(x=>x[0]).map((x,I,P)=>{const T=!I,j=I===Xo(P);return o&&T?0:o&&j?b:x+u[I]})}return{snaps:d,snapsAligned:h}}function RT(e,t,n,r,i){const{reachedAny:s,removeOffset:o,constrain:a}=r;function l(p){return p.concat().sort((m,y)=>It(m)-It(y))[0]}function c(p){const m=e?o(p):a(p),y=t.map(b=>b-m).map(b=>u(b,0)).map((b,x)=>({diff:b,index:x})).sort((b,x)=>It(b.diff)-It(x.diff)),{index:v}=y[0];return{index:v,distance:m}}function u(p,m){const y=[p,p+n,p-n];if(!e)return y[0];if(!m)return l(y);const v=y.filter(b=>Zc(b)===m);return l(v)}function d(p,m){const y=t[p]-i.get(),v=u(y,m);return{index:p,distance:v}}function h(p,m){const y=i.get()+p,{index:v,distance:b}=c(y),x=!e&&s(y);if(!m||x)return{index:v,distance:p};const I=t[v]-b,P=p+u(I,0);return{index:v,distance:P}}return{byDistance:h,byIndex:d,shortcut:u}}function $T(e,t,n,r,i,s,o){function a(d){const h=d.distance,f=d.index!==t.get();s.add(h),h&&(i.duration()?e.start():(e.update(),e.render(1),e.update())),f&&(n.set(t.get()),t.set(d.index),o.emit("select"))}function l(d,h){const f=r.byDistance(d,h);a(f)}function c(d,h){const f=t.clone().set(d),p=r.byIndex(f.get(),h);a(p)}return{distance:l,index:c}}function ta(e){let t=e;function n(){return t}function r(l){t=o(l)}function i(l){t+=o(l)}function s(l){t-=o(l)}function o(l){return Vc(l)?l:l.get()}return{get:n,set:r,add:i,subtract:s}}function Mp(e,t,n){const r=e.scroll==="x"?o:a,i=n.style;let s=!1;function o(h){return`translate3d(${h}px,0px,0px)`}function a(h){return`translate3d(0px,${h}px,0px)`}function l(h){s||(i.transform=r(t.apply(h)))}function c(h){s=!h}function u(){s||(i.transform="",n.getAttribute("style")||n.removeAttribute("style"))}return{clear:u,to:l,toggleActive:c}}function MT(e,t,n,r,i,s,o,a,l){const c=As(i),u=As(i).reverse(),d=m().concat(y());function h(P,T){return P.reduce((j,U)=>j-i[U],T)}function f(P,T){return P.reduce((j,U)=>h(j,T)>0?j.concat([U]):j,[])}function p(P,T){const j=T==="start",U=j?-r:r,F=o.findSlideBounds([U]);return P.map(O=>{const N=j?0:-r,J=j?r:0,W=F.filter(B=>B.index===O)[0][j?"end":"start"];return{index:O,slideLocation:ta(-1),translate:Mp(e,t,l[O]),target:()=>a.get()>W?N:J}})}function m(){const P=s[0]-1,T=f(u,P);return p(T,"end")}function y(){const P=n-s[0]-1,T=f(c,P);return p(T,"start")}function v(){return d.every(({index:P})=>{const T=c.filter(j=>j!==P);return h(T,n)<=.1})}function b(){d.forEach(P=>{const{target:T,translate:j,slideLocation:U}=P,F=T();F!==U.get()&&(j.to(F),U.set(F))})}function x(){d.forEach(P=>P.translate.clear())}return{canLoop:v,clear:x,loop:b,loopPoints:d}}function LT(e,t){let n,r=!1;function i(a,l){if(!l)return;function c(u){for(const d of u)if(d.type==="childList"){a.reInit(),t.emit("slidesChanged");break}}n=new MutationObserver(u=>{r||(zc(l)||l(a,u))&&c(u)}),n.observe(e,{childList:!0})}function s(){n&&n.disconnect(),r=!0}return{init:i,destroy:s}}function DT(e,t,n,r,i,s,o){const{removeOffset:a,constrain:l}=i,c=.5,u=s?[0,t,-t]:[0],d=f(u,o);function h(y){const v=y||0;return n.map(b=>Ur(c,b-c).constrain(b*v))}function f(y,v){const b=y||u,x=h(v);return b.reduce((I,P)=>{const T=r.map((j,U)=>({start:j-n[U]+x[U]+P,end:j+e-x[U]+P,index:U}));return I.concat(T)},[])}function p(y,v){const b=s?a(y):l(y);return(v||d).reduce((I,P)=>{const{index:T,start:j,end:U}=P,F=I.includes(T),O=j<b&&U>b;return!F&&O?I.concat([T]):I},[])}return{check:p,findSlideBounds:f}}function NT(e,t,n,r,i,s){const{measureSize:o,startEdge:a,endEdge:l}=e,c=n[0]&&i,u=p(),d=m(),h=n.map(o),f=y();function p(){if(!c)return 0;const b=n[0];return It(t[a]-b[a])}function m(){if(!c)return 0;const b=s.getComputedStyle(br(r));return parseFloat(b.getPropertyValue(`margin-${l}`))}function y(){return n.map((b,x,I)=>{const P=!x,T=x===Xo(I);return P?h[x]+u:T?h[x]+d:I[x+1][a]-b[a]}).map(It)}return{slideSizes:h,slideSizesWithGaps:f}}function jT(e,t,n){const r=Vc(n);function i(l,c){return As(l).filter(u=>u%c===0).map(u=>l.slice(u,u+c))}function s(l){return As(l).reduce((c,u)=>{const h=t.slice(br(c),u+1).reduce((f,p)=>f+p,0);return!u||h>e?c.concat(u):c},[]).map((c,u,d)=>l.slice(c,d[u+1]))}function o(l){return r?i(l,n):s(l)}return{groupSlides:o}}function UT(e,t,n,r,i,s,o,a){const{align:l,axis:c,direction:u,startIndex:d,inViewThreshold:h,loop:f,duration:p,dragFree:m,dragThreshold:y,slidesToScroll:v,skipSnaps:b,containScroll:x}=s,I=t.getBoundingClientRect(),P=n.map(me=>me.getBoundingClientRect()),T=wT(u),j=bT(c,u),U=j.measureSize(I),F=kT(U),O=vT(l,U),N=!f&&!!x,J=f||!!x,{slideSizes:q,slideSizesWithGaps:W}=NT(j,I,P,n,J,i),B=jT(U,W,v),{snaps:V,snapsAligned:Y}=AT(j,O,I,P,W,B,N),K=-br(V)+br(W),{snapsContained:pe}=TT(U,K,Y,x),k=N?pe:Y,{limit:ee}=OT(K,k,f),xe=$p(Xo(k),d,f),S=xe.clone(),Te=As(n),Ne=({dragHandler:me,scrollBody:he,scrollBounds:Le,eventHandler:Pe,animation:Be,options:{loop:ot}})=>{const Ze=me.pointerDown();ot||Le.constrain(Ze);const Z=he.seek().settled();Z&&!Ze&&(Be.stop(),Pe.emit("settle")),Z||Pe.emit("scroll")},Ie=({scrollBody:me,translate:he,location:Le,offsetLocation:Pe,scrollLooper:Be,slideLooper:ot,options:{loop:Ze}},Z)=>{const Q=me.velocity();Pe.set(Le.get()-Q+Q*Z),Ze&&(Be.loop(me.direction()),ot.loop()),he.to(Pe.get())},je={start:()=>a.start(ne),stop:()=>a.stop(ne),update:()=>Ne(ne),render:me=>Ie(ne,me)},De=.68,Ue=k[xe.get()],_e=ta(Ue),ve=ta(Ue),ke=ta(Ue),Ce=ET(_e,ke,p,De),Re=RT(f,k,K,ee,ke),qe=$T(je,xe,S,Re,Ce,ke,o),D=DT(U,K,q,V,ee,f,h),ne={ownerDocument:r,ownerWindow:i,eventHandler:o,containerRect:I,slideRects:P,animation:je,axis:j,direction:T,dragHandler:xT(j,T,e,r,i,ke,_T(j,i),_e,je,qe,Ce,Re,xe,o,F,m,y,b,De),eventStore:Rs(),percentOfView:F,index:xe,indexPrevious:S,limit:ee,location:_e,offsetLocation:ve,options:s,resizeHandler:CT(t,o,i,n,j),scrollBody:Ce,scrollBounds:ST(ee,_e,ke,Ce,F),scrollLooper:IT(K,ee,ve,[_e,ve,ke]),scrollProgress:PT(ee),scrollSnaps:k,scrollTarget:Re,scrollTo:qe,slideLooper:MT(j,T,U,K,W,k,D,ve,n),slidesHandler:LT(t,o),slidesInView:D,slideIndexes:Te,slidesToScroll:B,target:ke,translate:Mp(j,T,t)};return ne}function FT(e){const t=16.666666666666668;let n=[],r=null,i=0,s=0;function o(d){r||(r=d);const h=d-r;for(r=d,i+=h;i>=t;)n.forEach(({animation:p})=>p.update()),i-=t;const f=It(i/t);n.forEach(({animation:p})=>p.render(f)),s&&e.requestAnimationFrame(o)}function a(d){n.includes(d)||n.push(d),!s&&(s=e.requestAnimationFrame(o))}function l(d){n=n.filter(h=>h!==d),!n.length&&(e.cancelAnimationFrame(s),r=null,i=0,s=0)}function c(){r=null,i=0}return{start:a,stop:l,reset:c,window:e}}function BT(){const e={};let t;function n(l){t=l}function r(l){return e[l]||[]}function i(l){return r(l).forEach(c=>c(t,l)),a}function s(l,c){return e[l]=r(l).concat([c]),a}function o(l,c){return e[l]=r(l).filter(u=>u!==c),a}const a={init:n,emit:i,off:o,on:s};return a}const VT={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,breakpoints:{},dragFree:!1,dragThreshold:10,inViewThreshold:0,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0};function zT(e){function t(s,o){return Ap(s,o||{})}function n(s){const o=s.breakpoints||{},a=ea(o).filter(l=>e.matchMedia(l).matches).map(l=>o[l]).reduce((l,c)=>t(l,c),{});return t(s,a)}function r(s){return s.map(o=>ea(o.breakpoints||{})).reduce((o,a)=>o.concat(a),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function ZT(e){let t=[];function n(s,o){return t=s.filter(({options:a})=>e.optionsAtMedia(a).active!==!1),t.forEach(a=>a.init(o,e)),s.reduce((a,l)=>Object.assign(a,{[l.name]:l}),{})}function r(){t=t.filter(s=>s.destroy())}return{init:n,destroy:r}}function Ui(e,t,n){const r=e.ownerDocument,i=r.defaultView,s=zT(i),o=ZT(s),a=Rs(),l=Rs(),c=BT(),{animationRealms:u}=Ui,{mergeOptions:d,optionsAtMedia:h,optionsMediaQueries:f}=s,{on:p,off:m,emit:y}=c,v=q;let b=!1,x,I=d(VT,Ui.globalOptions),P=d(I),T=[],j,U,F;function O(){const{container:Ce,slides:Re}=P;U=(Ip(Ce)?e.querySelector(Ce):Ce)||e.children[0];const D=Ip(Re)?U.querySelectorAll(Re):Re;F=[].slice.call(D||U.children)}function N(Ce,Re){const qe=UT(e,U,F,r,i,Ce,c,Re);if(Ce.loop&&!qe.slideLooper.canLoop()){const D=Object.assign({},Ce,{loop:!1});return N(D,Re)}return qe}function J(Ce,Re){if(b)return;const qe=u.find(ne=>ne.window===i),D=qe||FT(i);qe||u.push(D),I=d(I,Ce),P=h(I),T=Re||T,O(),x=N(P,D),f([I,...T.map(({options:ne})=>ne)]).forEach(ne=>a.add(ne,"change",q)),P.active&&(x.translate.to(x.location.get()),x.eventHandler.init(ke),x.resizeHandler.init(ke,P.watchResize),x.slidesHandler.init(ke,P.watchSlides),l.add(r,"visibilitychange",()=>{r.hidden&&D.reset()}),x.options.loop&&x.slideLooper.loop(),U.offsetParent&&F.length&&x.dragHandler.init(ke,P.watchDrag),j=o.init(T,ke))}function q(Ce,Re){const qe=Ne();W(),J(d({startIndex:qe},Ce),Re),c.emit("reInit")}function W(){x.dragHandler.destroy(),x.animation.stop(),x.eventStore.clear(),x.translate.clear(),x.slideLooper.clear(),x.resizeHandler.destroy(),x.slidesHandler.destroy(),o.destroy(),a.clear(),l.clear()}function B(){b||(b=!0,a.clear(),W(),c.emit("destroy"))}function V(Ce){const Re=x[Ce?"target":"location"].get(),qe=P.loop?"removeOffset":"constrain";return x.slidesInView.check(x.limit[qe](Re))}function Y(Ce){const Re=V(Ce);return x.slideIndexes.filter(qe=>!Re.includes(qe))}function K(Ce,Re,qe){!P.active||b||(x.scrollBody.useBaseFriction().useDuration(Re?0:P.duration),x.scrollTo.index(Ce,qe||0))}function pe(Ce){const Re=x.index.add(1).get();K(Re,Ce===!0,-1)}function k(Ce){const Re=x.index.add(-1).get();K(Re,Ce===!0,1)}function ee(){return x.index.add(1).get()!==Ne()}function xe(){return x.index.add(-1).get()!==Ne()}function S(){return x.scrollSnaps.map(x.scrollProgress.get)}function Te(){return x.scrollProgress.get(x.location.get())}function Ne(){return x.index.get()}function Ie(){return x.indexPrevious.get()}function je(){return j}function De(){return x}function Ue(){return e}function _e(){return U}function ve(){return F}const ke={canScrollNext:ee,canScrollPrev:xe,containerNode:_e,internalEngine:De,destroy:B,off:m,on:p,emit:y,plugins:je,previousScrollSnap:Ie,reInit:v,rootNode:Ue,scrollNext:pe,scrollPrev:k,scrollProgress:Te,scrollSnapList:S,scrollTo:K,selectedScrollSnap:Ne,slideNodes:ve,slidesInView:V,slidesNotInView:Y};return J(t,n),setTimeout(()=>c.emit("init"),0),ke}Ui.animationRealms=[],Ui.globalOptions=void 0;function Wc(e={},t=[]){const n=_.useRef(e),r=_.useRef(t),[i,s]=_.useState(),[o,a]=_.useState(),l=_.useCallback(()=>{i&&i.reInit(n.current,r.current)},[i]);return _.useEffect(()=>{if(mT()&&o){Ui.globalOptions=Wc.globalOptions;const c=Ui(o,n.current,r.current);return s(c),()=>c.destroy()}else s(void 0)},[o,s]),_.useEffect(()=>{Bc(n.current,e)||(n.current=e,l())},[e,l]),_.useEffect(()=>{gT(r.current,t)||(r.current=t,l())},[t,l]),[a,i]}Wc.globalOptions=void 0;function WT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M7.72 12.53a.75.75 0 010-1.06l7.5-7.5a.75.75 0 111.06 1.06L9.31 12l6.97 6.97a.75.75 0 11-1.06 1.06l-7.5-7.5z",clipRule:"evenodd"}))}const HT=R.forwardRef(WT);function qT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 010 1.06l-7.5 7.5a.75.75 0 01-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 011.06-1.06l7.5 7.5z",clipRule:"evenodd"}))}const KT=R.forwardRef(qT);function JT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M5.625 1.5c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0016.5 9h-1.875a1.875 1.875 0 01-1.875-1.875V5.25A3.75 3.75 0 009 1.5H5.625zM7.5 15a.75.75 0 01.75-.75h7.5a.75.75 0 010 1.5h-7.5A.75.75 0 017.5 15zm.75 2.25a.75.75 0 000 1.5H12a.75.75 0 000-1.5H8.25z",clipRule:"evenodd"}),R.createElement("path",{d:"M12.971 1.816A5.23 5.23 0 0114.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 013.434 1.279 9.768 9.768 0 00-6.963-6.963z"}))}const GT=R.forwardRef(JT);function YT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{d:"M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z"}),R.createElement("path",{d:"M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z"}))}const QT=R.forwardRef(YT);function XT({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{d:"M21.721 12.752a9.711 9.711 0 00-.945-5.003 12.754 12.754 0 01-4.339 2.708 18.991 18.991 0 01-.214 4.772 17.165 17.165 0 005.498-2.477zM14.634 15.55a17.324 17.324 0 00.332-4.647c-.952.227-1.945.347-2.966.347-1.021 0-2.014-.12-2.966-.347a17.515 17.515 0 00.332 4.647 17.385 17.385 0 005.268 0zM9.772 17.119a18.963 18.963 0 004.456 0A17.182 17.182 0 0112 21.724a17.18 17.18 0 01-2.228-4.605zM7.777 15.23a18.87 18.87 0 01-.214-4.774 12.753 12.753 0 01-4.34-2.708 9.711 9.711 0 00-.944 5.004 17.165 17.165 0 005.498 2.477zM21.356 14.752a9.765 9.765 0 01-7.478 6.817 18.64 18.64 0 001.988-4.718 18.627 18.627 0 005.49-2.098zM2.644 14.752c1.682.971 3.53 1.688 5.49 2.099a18.64 18.64 0 001.988 4.718 9.765 9.765 0 01-7.478-6.816zM13.878 2.43a9.755 9.755 0 016.116 3.986 11.267 11.267 0 01-3.746 2.504 18.63 18.63 0 00-2.37-6.49zM12 2.276a17.152 17.152 0 012.805 7.121c-.897.23-1.837.353-2.805.353-.968 0-1.908-.122-2.805-.353A17.151 17.151 0 0112 2.276zM10.122 2.43a18.629 18.629 0 00-2.37 6.49 11.266 11.266 0 01-3.746-2.504 9.754 9.754 0 016.116-3.985z"}))}const eO=R.forwardRef(XT);function tO({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"}))}const nO=R.forwardRef(tO);function rO({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{fillRule:"evenodd",d:"M1.5 4.5a3 3 0 013-3h1.372c.86 0 1.61.586 1.819 1.42l1.105 4.423a1.875 1.875 0 01-.694 1.955l-1.293.97c-.135.101-.164.249-.126.352a11.285 11.285 0 006.697 6.697c.103.038.25.009.352-.126l.97-1.293a1.875 1.875 0 011.955-.694l4.423 1.105c.834.209 1.42.959 1.42 1.82V19.5a3 3 0 01-3 3h-2.25C8.552 22.5 1.5 15.448 1.5 6.75V4.5z",clipRule:"evenodd"}))}const iO=R.forwardRef(rO),sO=_.forwardRef(({type:e,styles:t,blocks:n},r)=>{const[i,s]=Wc({skipSnaps:!0}),[o,a]=_.useState(!0),[l,c]=_.useState(!0),u=_.useCallback(()=>s&&s.scrollPrev(),[s]),d=_.useCallback(()=>s&&s.scrollNext(),[s]),h=t==null?void 0:t[e],f=_.useCallback(p=>{a(!p.canScrollPrev()),c(!p.canScrollNext())},[]);return _.useEffect(()=>{s&&(f(s),s.on("reInit",f),s.on("select",f))},[s,f]),z.jsxs("div",{...h==null?void 0:h.container,"data-container":"carousel",ref:i,children:[z.jsx("div",{ref:r,...h==null?void 0:h.slidesContainer,children:n.map((p,m)=>z.jsx(Wi,{styles:t,block:p},m))}),z.jsx(HT,{...h==null?void 0:h.backButton,"data-disabled":o?"":void 0,onClick:u}),z.jsx(KT,{...h==null?void 0:h.nextButton,"data-disabled":l?"":void 0,onClick:d})]})}),$s=Math.min,$n=Math.max,na=Math.round,Fi=Math.floor,Fr=e=>({x:e,y:e}),oO={left:"right",right:"left",bottom:"top",top:"bottom"},aO={start:"end",end:"start"};function ra(e,t){return typeof e=="function"?e(t):e}function gi(e){return e.split("-")[0]}function Ms(e){return e.split("-")[1]}function lO(e){return e==="x"?"y":"x"}function Lp(e){return e==="y"?"height":"width"}function ia(e){return["top","bottom"].includes(gi(e))?"y":"x"}function Dp(e){return lO(ia(e))}function cO(e,t,n){n===void 0&&(n=!1);const r=Ms(e),i=Dp(e),s=Lp(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=sa(o)),[o,sa(o)]}function uO(e){const t=sa(e);return[Hc(e),t,Hc(t)]}function Hc(e){return e.replace(/start|end/g,t=>aO[t])}function dO(e,t,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?s:o;default:return[]}}function fO(e,t,n,r){const i=Ms(e);let s=dO(gi(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(Hc)))),s}function sa(e){return e.replace(/left|right|bottom|top/g,t=>oO[t])}function hO(e){return{top:0,right:0,bottom:0,left:0,...e}}function pO(e){return typeof e!="number"?hO(e):{top:e,right:e,bottom:e,left:e}}function oa(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Br(e){return Np(e)?(e.nodeName||"").toLowerCase():"#document"}function En(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function wr(e){var t;return(t=(Np(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Np(e){return e instanceof Node||e instanceof En(e).Node}function $t(e){return e instanceof Element||e instanceof En(e).Element}function ln(e){return e instanceof HTMLElement||e instanceof En(e).HTMLElement}function qc(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof En(e).ShadowRoot}function Ls(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Sn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function mO(e){return["table","td","th"].includes(Br(e))}function Kc(e){const t=Jc(),n=Sn(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function gO(e){let t=yi(e);for(;ln(t)&&!Ds(t);){if(Kc(t))return t;t=yi(t)}return null}function Jc(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ds(e){return["html","body","#document"].includes(Br(e))}function Sn(e){return En(e).getComputedStyle(e)}function aa(e){return $t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function yi(e){if(Br(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qc(e)&&e.host||wr(e);return qc(t)?t.host:t}function jp(e){const t=yi(e);return Ds(t)?e.ownerDocument?e.ownerDocument.body:e.body:ln(t)&&Ls(t)?t:jp(t)}function Vr(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=jp(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=En(i);return s?t.concat(o,o.visualViewport||[],Ls(i)?i:[],o.frameElement&&n?Vr(o.frameElement):[]):t.concat(i,Vr(i,[],n))}function zr(e){let t=e.activeElement;for(;((n=t)==null||(r=n.shadowRoot)==null?void 0:r.activeElement)!=null;){var n,r;t=t.shadowRoot.activeElement}return t}function bn(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&qc(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Up(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function yO(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function Fp(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(Up())||t.test(yO()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Bp(e){return e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType!=="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0}function Vp(){return/apple/i.test(navigator.vendor)}function vO(){return Up().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function zp(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function bO(e){return"nativeEvent"in e}function wO(e){return e.matches("html,body")}function Bn(e){return(e==null?void 0:e.ownerDocument)||document}function Gc(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Zp(e){return"composedPath"in e?e.composedPath()[0]:e.target}const xO="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Wp(e){return ln(e)&&e.matches(xO)}function tn(e){e.preventDefault(),e.stopPropagation()}function Hp(e,t,n){let{reference:r,floating:i}=e;const s=ia(t),o=Dp(t),a=Lp(o),l=gi(t),c=s==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let f;switch(l){case"top":f={x:u,y:r.y-i.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-i.width,y:d};break;default:f={x:r.x,y:r.y}}switch(Ms(t)){case"start":f[o]-=h*(n&&c?-1:1);break;case"end":f[o]+=h*(n&&c?-1:1);break}return f}const _O=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Hp(c,r,l),h=r,f={},p=0;for(let m=0;m<a.length;m++){const{name:y,fn:v}=a[m],{x:b,y:x,data:I,reset:P}=await v({x:u,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:f,rects:c,platform:o,elements:{reference:e,floating:t}});if(u=b??u,d=x??d,f={...f,[y]:{...f[y],...I}},P&&p<=50){p++,typeof P=="object"&&(P.placement&&(h=P.placement),P.rects&&(c=P.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):P.rects),{x:u,y:d}=Hp(c,h,l)),m=-1;continue}}return{x:u,y:d,placement:h,strategy:i,middlewareData:f}};async function qp(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=ra(t,e),p=pO(f),y=a[h?d==="floating"?"reference":"floating":d],v=oa(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),b=d==="floating"?{...o.floating,x:r,y:i}:o.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),I=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},P=oa(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({rect:b,offsetParent:x,strategy:l}):b);return{top:(v.top-P.top+p.top)/I.y,bottom:(P.bottom-v.bottom+p.bottom)/I.y,left:(v.left-P.left+p.left)/I.x,right:(P.right-v.right+p.right)/I.x}}const kO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...y}=ra(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const v=gi(i),b=gi(a)===a,x=await(l.isRTL==null?void 0:l.isRTL(c.floating)),I=h||(b||!m?[sa(a)]:uO(a));!h&&p!=="none"&&I.push(...fO(a,m,p,x));const P=[a,...I],T=await qp(t,y),j=[];let U=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&j.push(T[v]),d){const J=cO(i,o,x);j.push(T[J[0]],T[J[1]])}if(U=[...U,{placement:i,overflows:j}],!j.every(J=>J<=0)){var F,O;const J=(((F=s.flip)==null?void 0:F.index)||0)+1,q=P[J];if(q)return{data:{index:J,overflows:U},reset:{placement:q}};let W=(O=U.filter(B=>B.overflows[0]<=0).sort((B,V)=>B.overflows[1]-V.overflows[1])[0])==null?void 0:O.placement;if(!W)switch(f){case"bestFit":{var N;const B=(N=U.map(V=>[V.placement,V.overflows.filter(Y=>Y>0).reduce((Y,K)=>Y+K,0)]).sort((V,Y)=>V[1]-Y[1])[0])==null?void 0:N[0];B&&(W=B);break}case"initialPlacement":W=a;break}if(i!==W)return{reset:{placement:W}}}return{}}}};async function CO(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=gi(n),a=Ms(n),l=ia(n)==="y",c=["left","top"].includes(o)?-1:1,u=s&&l?-1:1,d=ra(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:p}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&typeof p=="number"&&(f=a==="end"?p*-1:p),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}const EO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,i=await CO(t,e);return{x:n+i.x,y:r+i.y,data:i}}}},SO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:i,elements:s}=t,{apply:o=()=>{},...a}=ra(e,t),l=await qp(t,a),c=gi(n),u=Ms(n),d=ia(n)==="y",{width:h,height:f}=r.floating;let p,m;c==="top"||c==="bottom"?(p=c,m=u===(await(i.isRTL==null?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(m=c,p=u==="end"?"top":"bottom");const y=f-l[p],v=h-l[m],b=!t.middlewareData.shift;let x=y,I=v;if(d){const T=h-l.left-l.right;I=u||b?$s(v,T):T}else{const T=f-l.top-l.bottom;x=u||b?$s(y,T):T}if(b&&!u){const T=$n(l.left,0),j=$n(l.right,0),U=$n(l.top,0),F=$n(l.bottom,0);d?I=h-2*(T!==0||j!==0?T+j:$n(l.left,l.right)):x=f-2*(U!==0||F!==0?U+F:$n(l.top,l.bottom))}await o({...t,availableWidth:I,availableHeight:x});const P=await i.getDimensions(s.floating);return h!==P.width||f!==P.height?{reset:{rects:!0}}:{}}}};function Kp(e){const t=Sn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=ln(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=na(n)!==s||na(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function Yc(e){return $t(e)?e:e.contextElement}function Bi(e){const t=Yc(e);if(!ln(t))return Fr(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=Kp(t);let o=(s?na(n.width):n.width)/r,a=(s?na(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const TO=Fr(0);function Jp(e){const t=En(e);return!Jc()||!t.visualViewport?TO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function OO(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==En(e)?!1:t}function vi(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Yc(e);let o=Fr(1);t&&(r?$t(r)&&(o=Bi(r)):o=Bi(e));const a=OO(s,n,r)?Jp(s):Fr(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(s){const h=En(s),f=r&&$t(r)?En(r):r;let p=h.frameElement;for(;p&&r&&f!==h;){const m=Bi(p),y=p.getBoundingClientRect(),v=Sn(p),b=y.left+(p.clientLeft+parseFloat(v.paddingLeft))*m.x,x=y.top+(p.clientTop+parseFloat(v.paddingTop))*m.y;l*=m.x,c*=m.y,u*=m.x,d*=m.y,l+=b,c+=x,p=En(p).frameElement}}return oa({width:u,height:d,x:l,y:c})}function IO(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=ln(n),s=wr(n);if(n===s)return t;let o={scrollLeft:0,scrollTop:0},a=Fr(1);const l=Fr(0);if((i||!i&&r!=="fixed")&&((Br(n)!=="body"||Ls(s))&&(o=aa(n)),ln(n))){const c=vi(n);a=Bi(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-o.scrollLeft*a.x+l.x,y:t.y*a.y-o.scrollTop*a.y+l.y}}function PO(e){return Array.from(e.getClientRects())}function Gp(e){return vi(wr(e)).left+aa(e).scrollLeft}function AO(e){const t=wr(e),n=aa(e),r=e.ownerDocument.body,i=$n(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=$n(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Gp(e);const a=-n.scrollTop;return Sn(r).direction==="rtl"&&(o+=$n(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function RO(e,t){const n=En(e),r=wr(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const c=Jc();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function $O(e,t){const n=vi(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=ln(e)?Bi(e):Fr(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,c=r*s.y;return{width:o,height:a,x:l,y:c}}function Yp(e,t,n){let r;if(t==="viewport")r=RO(e,n);else if(t==="document")r=AO(wr(e));else if($t(t))r=$O(t,n);else{const i=Jp(e);r={...t,x:t.x-i.x,y:t.y-i.y}}return oa(r)}function Qp(e,t){const n=yi(e);return n===t||!$t(n)||Ds(n)?!1:Sn(n).position==="fixed"||Qp(n,t)}function MO(e,t){const n=t.get(e);if(n)return n;let r=Vr(e,[],!1).filter(a=>$t(a)&&Br(a)!=="body"),i=null;const s=Sn(e).position==="fixed";let o=s?yi(e):e;for(;$t(o)&&!Ds(o);){const a=Sn(o),l=Kc(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Ls(o)&&!l&&Qp(e,o))?r=r.filter(u=>u!==o):i=a,o=yi(o)}return t.set(e,r),r}function LO(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?MO(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((c,u)=>{const d=Yp(t,u,i);return c.top=$n(d.top,c.top),c.right=$s(d.right,c.right),c.bottom=$s(d.bottom,c.bottom),c.left=$n(d.left,c.left),c},Yp(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function DO(e){return Kp(e)}function NO(e,t,n){const r=ln(t),i=wr(t),s=n==="fixed",o=vi(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=Fr(0);if(r||!r&&!s)if((Br(t)!=="body"||Ls(i))&&(a=aa(t)),r){const c=vi(t,!0,s,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else i&&(l.x=Gp(i));return{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function Xp(e,t){return!ln(e)||Sn(e).position==="fixed"?null:t?t(e):e.offsetParent}function em(e,t){const n=En(e);if(!ln(e))return n;let r=Xp(e,t);for(;r&&mO(r)&&Sn(r).position==="static";)r=Xp(r,t);return r&&(Br(r)==="html"||Br(r)==="body"&&Sn(r).position==="static"&&!Kc(r))?n:r||gO(e)||n}const jO=async function(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||em,s=this.getDimensions;return{reference:NO(t,await i(n),r),floating:{x:0,y:0,...await s(n)}}};function UO(e){return Sn(e).direction==="rtl"}const FO={convertOffsetParentRelativeRectToViewportRelativeRect:IO,getDocumentElement:wr,getClippingRect:LO,getOffsetParent:em,getElementRects:jO,getClientRects:PO,getDimensions:DO,getScale:Bi,isElement:$t,isRTL:UO};function BO(e,t){let n=null,r;const i=wr(e);function s(){clearTimeout(r),n&&n.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const f=Fi(u),p=Fi(i.clientWidth-(c+d)),m=Fi(i.clientHeight-(u+h)),y=Fi(c),b={rootMargin:-f+"px "+-p+"px "+-m+"px "+-y+"px",threshold:$n(0,$s(1,l))||1};let x=!0;function I(P){const T=P[0].intersectionRatio;if(T!==l){if(!x)return o();T?o(!1,T):r=setTimeout(()=>{o(!1,1e-7)},100)}x=!1}try{n=new IntersectionObserver(I,{...b,root:i.ownerDocument})}catch{n=new IntersectionObserver(I,b)}n.observe(e)}return o(!0),s}function VO(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Yc(e),u=i||s?[...c?Vr(c):[],...Vr(t)]:[];u.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),s&&v.addEventListener("resize",n)});const d=c&&a?BO(c,n):null;let h=-1,f=null;o&&(f=new ResizeObserver(v=>{let[b]=v;b&&b.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{f&&f.observe(t)})),n()}),c&&!l&&f.observe(c),f.observe(t));let p,m=l?vi(e):null;l&&y();function y(){const v=vi(e);m&&(v.x!==m.x||v.y!==m.y||v.width!==m.width||v.height!==m.height)&&n(),m=v,p=requestAnimationFrame(y)}return n(),()=>{u.forEach(v=>{i&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),d&&d(),f&&f.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const zO=(e,t,n)=>{const r=new Map,i={platform:FO,...n},s={...i.platform,_c:r};return _O(e,t,{...i,platform:s})};var la=typeof document<"u"?_.useLayoutEffect:_.useEffect;function ca(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!ca(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!ca(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function tm(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nm(e,t){const n=tm(e);return Math.round(t*n)/n}function rm(e){const t=R.useRef(e);return la(()=>{t.current=e}),t}function ZO(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=R.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=R.useState(r);ca(h,r)||f(r);const[p,m]=R.useState(null),[y,v]=R.useState(null),b=R.useCallback(V=>{V!=T.current&&(T.current=V,m(V))},[m]),x=R.useCallback(V=>{V!==j.current&&(j.current=V,v(V))},[v]),I=s||p,P=o||y,T=R.useRef(null),j=R.useRef(null),U=R.useRef(u),F=rm(l),O=rm(i),N=R.useCallback(()=>{if(!T.current||!j.current)return;const V={placement:t,strategy:n,middleware:h};O.current&&(V.platform=O.current),zO(T.current,j.current,V).then(Y=>{const K={...Y,isPositioned:!0};J.current&&!ca(U.current,K)&&(U.current=K,jw.flushSync(()=>{d(K)}))})},[h,t,n,O]);la(()=>{c===!1&&U.current.isPositioned&&(U.current.isPositioned=!1,d(V=>({...V,isPositioned:!1})))},[c]);const J=R.useRef(!1);la(()=>(J.current=!0,()=>{J.current=!1}),[]),la(()=>{if(I&&(T.current=I),P&&(j.current=P),I&&P){if(F.current)return F.current(I,P,N);N()}},[I,P,N,F]);const q=R.useMemo(()=>({reference:T,floating:j,setReference:b,setFloating:x}),[b,x]),W=R.useMemo(()=>({reference:I,floating:P}),[I,P]),B=R.useMemo(()=>{const V={position:n,left:0,top:0};if(!W.floating)return V;const Y=nm(W.floating,u.x),K=nm(W.floating,u.y);return a?{...V,transform:"translate("+Y+"px, "+K+"px)",...tm(W.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:K}},[n,a,W.floating,u.x,u.y]);return R.useMemo(()=>({...u,update:N,refs:q,elements:W,floatingStyles:B}),[u,N,q,W,B])}/*!
|
|
234
234
|
* tabbable 6.2.0
|
|
235
235
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
236
|
-
*/var qT=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Bc=qT.join(","),Wp=typeof Element>"u",Ps=Wp?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ea=!Wp&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},ta=function e(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=i===""||i==="true",o=s||n&&t&&e(t.parentNode);return o},KT=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},JT=function(t,n,r){if(ta(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Bc));return n&&Ps.call(t,Bc)&&i.unshift(t),i=i.filter(r),i},GT=function e(t,n,r){for(var i=[],s=Array.from(t);s.length;){var o=s.shift();if(!ta(o,!1))if(o.tagName==="SLOT"){var a=o.assignedElements(),l=a.length?a:o.children,c=e(l,!0,r);r.flatten?i.push.apply(i,c):i.push({scopeParent:o,candidates:c})}else{var u=Ps.call(o,Bc);u&&r.filter(o)&&(n||!t.includes(o))&&i.push(o);var d=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),h=!ta(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(d&&h){var f=e(d===!0?o.children:d.children,!0,r);r.flatten?i.push.apply(i,f):i.push({scopeParent:o,candidates:f})}else s.unshift.apply(s,o.children)}}return i},Hp=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},qp=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||KT(t))&&!Hp(t)?0:t.tabIndex},YT=function(t,n){var r=qp(t);return r<0&&n&&!Hp(t)?0:r},QT=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Kp=function(t){return t.tagName==="INPUT"},XT=function(t){return Kp(t)&&t.type==="hidden"},eO=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},tO=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},nO=function(t){if(!t.name)return!0;var n=t.form||ea(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var s=tO(i,t.form);return!s||s===t},rO=function(t){return Kp(t)&&t.type==="radio"},iO=function(t){return rO(t)&&!nO(t)},sO=function(t){var n,r=t&&ea(t),i=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var o,a,l;for(s=!!((o=i)!==null&&o!==void 0&&(a=o.ownerDocument)!==null&&a!==void 0&&a.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&i;){var c,u,d;r=ea(i),i=(c=r)===null||c===void 0?void 0:c.host,s=!!((u=i)!==null&&u!==void 0&&(d=u.ownerDocument)!==null&&d!==void 0&&d.contains(i))}}return s},Jp=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},oO=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var s=Ps.call(t,"details>summary:first-of-type"),o=s?t.parentElement:t;if(Ps.call(o,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof i=="function"){for(var a=t;t;){var l=t.parentElement,c=ea(t);if(l&&!l.shadowRoot&&i(l)===!0)return Jp(t);t.assignedSlot?t=t.assignedSlot:!l&&c!==t.ownerDocument?t=c.host:t=l}t=a}if(sO(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Jp(t);return!1},aO=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return Ps.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},lO=function(t,n){return!(n.disabled||ta(n)||XT(n)||oO(n,t)||eO(n)||aO(n))},Gp=function(t,n){return!(iO(n)||qp(n)<0||!lO(t,n))},cO=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},uO=function e(t){var n=[],r=[];return t.forEach(function(i,s){var o=!!i.scopeParent,a=o?i.scopeParent:i,l=YT(a,o),c=o?e(i.candidates):a;l===0?o?n.push.apply(n,c):n.push(a):r.push({documentOrder:s,tabIndex:l,item:i,isScope:o,content:c})}),r.sort(QT).reduce(function(i,s){return s.isScope?i.push.apply(i,s.content):i.push(s.content),i},[]).concat(n)},Vc=function(t,n){n=n||{};var r;return n.getShadowRoot?r=GT([t],n.includeContainer,{filter:Gp.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:cO}):r=JT(t,n.includeContainer,Gp.bind(null,n)),uO(r)};const zc="ArrowUp",na="ArrowDown",Di="ArrowLeft",As="ArrowRight";function ra(e,t,n){return Math.floor(e/t)!==n}function Rs(e,t){return t<0||t>=e.current.length}function Zc(e,t){return on(e,{disabledIndices:t})}function Yp(e,t){return on(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function on(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:s=1}=t===void 0?{}:t;const o=e.current;let a=n;do{var l,c;a=a+(r?-s:s)}while(a>=0&&a<=o.length-1&&(i?i.includes(a):o[a]==null||(l=o[a])!=null&&l.hasAttribute("disabled")||((c=o[a])==null?void 0:c.getAttribute("aria-disabled"))==="true"));return a}function dO(e,t){let{event:n,orientation:r,loop:i,cols:s,disabledIndices:o,minIndex:a,maxIndex:l,prevIndex:c,stopEvent:u=!1}=t,d=c;if(n.key===zc){if(u&&Qt(n),c===-1)d=l;else if(d=on(e,{startingIndex:d,amount:s,decrement:!0,disabledIndices:o}),i&&(c-s<a||d<0)){const h=c%s,f=l%s,p=l-(f-h);f===h?d=l:d=f>h?p:p-s}Rs(e,d)&&(d=c)}if(n.key===na&&(u&&Qt(n),c===-1?d=a:(d=on(e,{startingIndex:c,amount:s,disabledIndices:o}),i&&c+s>l&&(d=on(e,{startingIndex:c%s-s,amount:s,disabledIndices:o}))),Rs(e,d)&&(d=c)),r==="both"){const h=Mi(c/s);n.key===As&&(u&&Qt(n),c%s!==s-1?(d=on(e,{startingIndex:c,disabledIndices:o}),i&&ra(d,s,h)&&(d=on(e,{startingIndex:c-c%s-1,disabledIndices:o}))):i&&(d=on(e,{startingIndex:c-c%s-1,disabledIndices:o})),ra(d,s,h)&&(d=c)),n.key===Di&&(u&&Qt(n),c%s!==0?(d=on(e,{startingIndex:c,disabledIndices:o,decrement:!0}),i&&ra(d,s,h)&&(d=on(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:o}))):i&&(d=on(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:o})),ra(d,s,h)&&(d=c));const f=Mi(l/s)===h;Rs(e,d)&&(i&&f?d=n.key===Di?l:on(e,{startingIndex:c-c%s-1,disabledIndices:o}):d=c)}return d}let Qp=0;function yr(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Qp);const s=()=>e==null?void 0:e.focus({preventScroll:n});i?s():Qp=requestAnimationFrame(s)}var jt=typeof document<"u"?_.useLayoutEffect:_.useEffect;function ia(){return ia=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ia.apply(this,arguments)}let Wc=!1,fO=0;const Xp=()=>"floating-ui-"+fO++;function hO(){const[e,t]=$.useState(()=>Wc?Xp():void 0);return jt(()=>{e==null&&t(Xp())},[]),$.useEffect(()=>{Wc||(Wc=!0)},[]),e}const Hc=$["useId".toString()]||hO;function pO(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const mO=$.createContext(null),gO=$.createContext(null),em=()=>{var e;return((e=$.useContext(mO))==null?void 0:e.id)||null},sa=()=>$.useContext(gO);function $s(e){return"data-floating-ui-"+e}function Ur(e){const t=_.useRef(e);return jt(()=>{t.current=e}),t}function yO(e,t){var n;let r=[],i=(n=e.find(s=>s.id===t))==null?void 0:n.parentId;for(;i;){const s=e.find(o=>o.id===i);i=s==null?void 0:s.parentId,s&&(r=r.concat(s))}return r}function Ni(e,t){let n=e.filter(i=>{var s;return i.parentId===t&&((s=i.context)==null?void 0:s.open)}),r=n;for(;r.length;)r=e.filter(i=>{var s;return(s=r)==null?void 0:s.some(o=>{var a;return i.parentId===o.id&&((a=i.context)==null?void 0:a.open)})}),n=n.concat(r);return n}function vO(e,t){let n,r=-1;function i(s,o){o>r&&(n=s,r=o),Ni(e,s).forEach(l=>{i(l.id,o+1)})}return i(t,0),e.find(s=>s.id===n)}let ji=new WeakMap,oa=new WeakSet,aa={},qc=0;const bO=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,tm=e=>e&&(e.host||tm(e.parentNode)),wO=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=tm(n);return e.contains(r)?r:null}).filter(n=>n!=null);function xO(e,t,n,r){const i="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,o=wO(t,e),a=new Set,l=new Set(o),c=[];aa[i]||(aa[i]=new WeakMap);const u=aa[i];o.forEach(d),h(t),a.clear();function d(f){!f||a.has(f)||(a.add(f),f.parentNode&&d(f.parentNode))}function h(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,p=>{if(a.has(p))h(p);else{const m=s?p.getAttribute(s):null,y=m!==null&&m!=="false",v=(ji.get(p)||0)+1,b=(u.get(p)||0)+1;ji.set(p,v),u.set(p,b),c.push(p),v===1&&y&&oa.add(p),b===1&&p.setAttribute(i,""),!y&&s&&p.setAttribute(s,"true")}})}return qc++,()=>{c.forEach(f=>{const p=(ji.get(f)||0)-1,m=(u.get(f)||0)-1;ji.set(f,p),u.set(f,m),p||(!oa.has(f)&&s&&f.removeAttribute(s),oa.delete(f)),m||f.removeAttribute(i)}),qc--,qc||(ji=new WeakMap,ji=new WeakMap,oa=new WeakSet,aa={})}}function nm(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=jn(e[0]).body;return xO(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Kc=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function rm(e,t){const n=Vc(e,Kc());t==="prev"&&n.reverse();const r=n.indexOf(jr(jn(e)));return n.slice(r+1)[0]}function im(){return rm(document.body,"next")}function sm(){return rm(document.body,"prev")}function Ms(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!gn(n,r)}function _O(e){Vc(e,Kc()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function kO(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Jc={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let CO;function om(e){e.key==="Tab"&&(e.target,clearTimeout(CO))}const la=$.forwardRef(function(t,n){const[r,i]=$.useState();jt(()=>(Ip()&&i("button"),document.addEventListener("keydown",om),()=>{document.removeEventListener("keydown",om)}),[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[$s("focus-guard")]:"",style:Jc};return $.createElement("span",ia({},t,s))}),am=$.createContext(null);function EO(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=$.useState(null),s=Hc(),o=lm(),a=$.useMemo(()=>({id:t,root:n,portalContext:o,uniqueId:s}),[t,n,o,s]),l=$.useRef();return jt(()=>()=>{r==null||r.remove()},[r,a]),jt(()=>{if(l.current===a)return;l.current=a;const{id:c,root:u,portalContext:d,uniqueId:h}=a,f=c?document.getElementById(c):null,p=$s("portal");if(f){const m=document.createElement("div");m.id=h,m.setAttribute(p,""),f.appendChild(m),i(m)}else{let m=u||(d==null?void 0:d.portalNode);m&&!At(m)&&(m=m.current),m=m||document.body;let y=null;c&&(y=document.createElement("div"),y.id=c,m.appendChild(y));const v=document.createElement("div");v.id=h,v.setAttribute(p,""),m=y||m,m.appendChild(v),i(v)}},[a]),r}function SO(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const s=EO({id:n,root:r}),[o,a]=$.useState(null),l=$.useRef(null),c=$.useRef(null),u=$.useRef(null),d=$.useRef(null),h=!!o&&!o.modal&&o.open&&i&&!!(r||s);return $.useEffect(()=>{if(!s||!i||o!=null&&o.modal)return;function f(p){s&&Ms(p)&&(p.type==="focusin"?kO:_O)(s)}return s.addEventListener("focusin",f,!0),s.addEventListener("focusout",f,!0),()=>{s.removeEventListener("focusin",f,!0),s.removeEventListener("focusout",f,!0)}},[s,i,o==null?void 0:o.modal]),$.createElement(am.Provider,{value:$.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:u,afterInsideRef:d,portalNode:s,setFocusManagerState:a}),[i,s])},h&&s&&$.createElement(la,{"data-type":"outside",ref:l,onFocus:f=>{if(Ms(f,s)){var p;(p=u.current)==null||p.focus()}else{const m=sm()||(o==null?void 0:o.refs.domReference.current);m==null||m.focus()}}}),h&&s&&$.createElement("span",{"aria-owns":s.id,style:Jc}),s&&Hn.createPortal(t,s),h&&s&&$.createElement(la,{"data-type":"outside",ref:c,onFocus:f=>{if(Ms(f,s)){var p;(p=d.current)==null||p.focus()}else{const m=im()||(o==null?void 0:o.refs.domReference.current);m==null||m.focus(),o!=null&&o.closeOnFocusOut&&(o==null||o.onOpenChange(!1,f.nativeEvent))}}}))}const lm=()=>$.useContext(am),TO=$.forwardRef(function(t,n){return $.createElement("button",ia({},t,{type:"button",ref:n,tabIndex:-1,style:Jc}))});function OO(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:s=!0,initialFocus:o=0,returnFocus:a=!0,modal:l=!0,visuallyHiddenDismiss:c=!1,closeOnFocusOut:u=!0}=e,{open:d,refs:h,nodeId:f,onOpenChange:p,events:m,dataRef:y,elements:{domReference:v,floating:b}}=t,x=bO()?s:!0,P=Ur(i),A=Ur(o),O=Ur(a),U=sa(),F=lm(),B=typeof o=="number"&&o<0,I=$.useRef(null),j=$.useRef(null),J=$.useRef(!1),q=$.useRef(null),H=$.useRef(!1),V=F!=null,z=v&&v.getAttribute("role")==="combobox"&&Rp(v)&&B,Y=$.useCallback(function(ee){return ee===void 0&&(ee=b),ee?Vc(ee,Kc()):[]},[b]),K=$.useCallback(ee=>{const xe=Y(ee);return P.current.map(S=>v&&S==="reference"?v:b&&S==="floating"?b:xe).filter(Boolean).flat()},[v,b,P,Y]);$.useEffect(()=>{if(r||!l)return;function ee(S){if(S.key==="Tab"){gn(b,jr(jn(b)))&&Y().length===0&&!z&&Qt(S);const Te=K(),Ne=Ap(S);P.current[0]==="reference"&&Ne===v&&(Qt(S),S.shiftKey?yr(Te[Te.length-1]):yr(Te[1])),P.current[1]==="floating"&&Ne===b&&S.shiftKey&&(Qt(S),yr(Te[0]))}}const xe=jn(b);return xe.addEventListener("keydown",ee),()=>{xe.removeEventListener("keydown",ee)}},[r,v,b,l,P,h,z,Y,K]),$.useEffect(()=>{if(r||!u)return;function ee(){H.current=!0,setTimeout(()=>{H.current=!1})}function xe(S){const Te=S.relatedTarget;queueMicrotask(()=>{const Ne=!(gn(v,Te)||gn(b,Te)||gn(Te,b)||gn(F==null?void 0:F.portalNode,Te)||Te!=null&&Te.hasAttribute($s("focus-guard"))||U&&(Ni(U.nodesRef.current,f).find(Ie=>{var je,De;return gn((je=Ie.context)==null?void 0:je.elements.floating,Te)||gn((De=Ie.context)==null?void 0:De.elements.domReference,Te)})||yO(U.nodesRef.current,f).find(Ie=>{var je,De;return((je=Ie.context)==null?void 0:je.elements.floating)===Te||((De=Ie.context)==null?void 0:De.elements.domReference)===Te})));Te&&Ne&&!H.current&&Te!==q.current&&(J.current=!0,p(!1,S))})}if(b&&sn(v))return v.addEventListener("focusout",xe),v.addEventListener("pointerdown",ee),!l&&b.addEventListener("focusout",xe),()=>{v.removeEventListener("focusout",xe),v.removeEventListener("pointerdown",ee),!l&&b.removeEventListener("focusout",xe)}},[r,v,b,l,f,U,F,p,u]),$.useEffect(()=>{var ee;if(r)return;const xe=Array.from((F==null||(ee=F.portalNode)==null?void 0:ee.querySelectorAll("["+$s("portal")+"]"))||[]);if(b){const S=[b,...xe,I.current,j.current,P.current.includes("reference")||z?v:null].filter(Ne=>Ne!=null),Te=l?nm(S,x,!x):nm(S);return()=>{Te()}}},[r,v,b,l,P,F,z,x]),jt(()=>{if(r||!b)return;const ee=jn(b),xe=jr(ee);queueMicrotask(()=>{const S=K(b),Te=A.current,Ne=(typeof Te=="number"?S[Te]:Te.current)||b,Ie=gn(b,xe);!B&&!Ie&&d&&yr(Ne,{preventScroll:Ne===b})})},[r,d,b,B,K,A]),jt(()=>{if(r||!b)return;let ee=!1;const xe=jn(b),S=jr(xe),Te=y.current;q.current=S;function Ne(Ie){if(Ie.type==="escapeKey"&&h.domReference.current&&(q.current=h.domReference.current),["referencePress","escapeKey"].includes(Ie.type))return;const je=Ie.data.returnFocus;typeof je=="object"?(J.current=!1,ee=je.preventScroll):J.current=!je}return m.on("dismiss",Ne),()=>{m.off("dismiss",Ne);const Ie=jr(xe);(gn(b,Ie)||U&&Ni(U.nodesRef.current,f).some(De=>{var Ue;return gn((Ue=De.context)==null?void 0:Ue.elements.floating,Ie)})||Te.openEvent&&["click","mousedown"].includes(Te.openEvent.type))&&h.domReference.current&&(q.current=h.domReference.current),O.current&&sn(q.current)&&!J.current&&yr(q.current,{cancelPrevious:!1,preventScroll:ee})}},[r,b,O,y,h,m,U,f]),jt(()=>{if(!(r||!F))return F.setFocusManagerState({modal:l,closeOnFocusOut:u,open:d,onOpenChange:p,refs:h}),()=>{F.setFocusManagerState(null)}},[r,F,l,d,p,h,u]),jt(()=>{if(!r&&b&&typeof MutationObserver=="function"&&!B){const ee=()=>{const S=b.getAttribute("tabindex");P.current.includes("floating")||jr(jn(b))!==h.domReference.current&&Y().length===0?S!=="0"&&b.setAttribute("tabindex","0"):S!=="-1"&&b.setAttribute("tabindex","-1")};ee();const xe=new MutationObserver(ee);return xe.observe(b,{childList:!0,subtree:!0,attributes:!0}),()=>{xe.disconnect()}}},[r,b,h,P,Y,B]);function pe(ee){return r||!c||!l?null:$.createElement(TO,{ref:ee==="start"?I:j,onClick:xe=>p(!1,xe.nativeEvent)},typeof c=="string"?c:"Dismiss")}const k=!r&&x&&!z&&(V||l);return $.createElement($.Fragment,null,k&&$.createElement(la,{"data-type":"inside",ref:F==null?void 0:F.beforeInsideRef,onFocus:ee=>{if(l){const S=K();yr(i[0]==="reference"?S[0]:S[S.length-1])}else if(F!=null&&F.preserveTabOrder&&F.portalNode)if(J.current=!1,Ms(ee,F.portalNode)){const S=im()||v;S==null||S.focus()}else{var xe;(xe=F.beforeOutsideRef.current)==null||xe.focus()}}}),!z&&pe("start"),n,pe("end"),k&&$.createElement(la,{"data-type":"inside",ref:F==null?void 0:F.afterInsideRef,onFocus:ee=>{if(l)yr(K()[0]);else if(F!=null&&F.preserveTabOrder&&F.portalNode)if(u&&(J.current=!0),Ms(ee,F.portalNode)){const S=sm()||v;S==null||S.focus()}else{var xe;(xe=F.afterOutsideRef.current)==null||xe.focus()}}}))}function cm(e){return sn(e.target)&&e.target.tagName==="BUTTON"}function um(e){return Rp(e)}function IO(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:s}}=e,{enabled:o=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0}=t,d=$.useRef(),h=$.useRef(!1);return $.useMemo(()=>o?{reference:{onPointerDown(f){d.current=f.pointerType},onMouseDown(f){f.button===0&&(Pp(d.current,!0)&&c||a!=="click"&&(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,f.nativeEvent):(f.preventDefault(),r(!0,f.nativeEvent))))},onClick(f){if(a==="mousedown"&&d.current){d.current=void 0;return}Pp(d.current,!0)&&c||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,f.nativeEvent):r(!0,f.nativeEvent))},onKeyDown(f){d.current=void 0,!(f.defaultPrevented||!u||cm(f))&&(f.key===" "&&!um(s)&&(f.preventDefault(),h.current=!0),f.key==="Enter"&&r(!(n&&l),f.nativeEvent))},onKeyUp(f){f.defaultPrevented||!u||cm(f)||um(s)||f.key===" "&&h.current&&(h.current=!1,r(!(n&&l),f.nativeEvent))}}}:{},[o,i,a,c,u,s,l,n,r])}const PO=$["useInsertionEffect".toString()]||(e=>e());function Fr(e){const t=$.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return PO(()=>{t.current=e}),$.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}const AO={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},RO={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},$O=e=>{var t,n;return{escapeKeyBubbles:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePressBubbles:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function MO(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,nodeId:s,elements:{reference:o,domReference:a,floating:l},dataRef:c}=e,{enabled:u=!0,escapeKey:d=!0,outsidePress:h=!0,outsidePressEvent:f="pointerdown",referencePress:p=!1,referencePressEvent:m="pointerdown",ancestorScroll:y=!1,bubbles:v}=t,b=sa(),x=em()!=null,P=Fr(typeof h=="function"?h:()=>!1),A=typeof h=="function"?P:h,O=$.useRef(!1),{escapeKeyBubbles:U,outsidePressBubbles:F}=$O(v),B=Fr(j=>{if(!n||!u||!d||j.key!=="Escape")return;const J=b?Ni(b.nodesRef.current,s):[];if(!U&&(j.stopPropagation(),J.length>0)){let q=!0;if(J.forEach(H=>{var V;if((V=H.context)!=null&&V.open&&!H.context.dataRef.current.__escapeKeyBubbles){q=!1;return}}),!q)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1,xT(j)?j.nativeEvent:j)}),I=Fr(j=>{const J=O.current;if(O.current=!1,J||typeof A=="function"&&!A(j))return;const q=Ap(j),H="["+$s("inert")+"]",V=jn(l).querySelectorAll(H);let z=At(q)?q:null;for(;z&&!Is(z);){const pe=di(z);if(pe===jn(l).body||!At(pe))break;z=pe}if(V.length&&At(q)&&!_T(q)&&!gn(q,l)&&Array.from(V).every(pe=>!gn(z,pe)))return;if(sn(q)&&l){const pe=q.clientWidth>0&&q.scrollWidth>q.clientWidth,k=q.clientHeight>0&&q.scrollHeight>q.clientHeight;let ee=k&&j.offsetX>q.clientWidth;if(k&&kn(q).direction==="rtl"&&(ee=j.offsetX<=q.offsetWidth-q.clientWidth),ee||pe&&j.offsetY>q.clientHeight)return}const Y=b&&Ni(b.nodesRef.current,s).some(pe=>{var k;return Uc(j,(k=pe.context)==null?void 0:k.elements.floating)});if(Uc(j,l)||Uc(j,a)||Y)return;const K=b?Ni(b.nodesRef.current,s):[];if(K.length>0){let pe=!0;if(K.forEach(k=>{var ee;if((ee=k.context)!=null&&ee.open&&!k.context.dataRef.current.__outsidePressBubbles){pe=!1;return}}),!pe)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:x?{preventScroll:!0}:Tp(j)||Op(j)}}),r(!1,j)});return $.useEffect(()=>{if(!n||!u)return;c.current.__escapeKeyBubbles=U,c.current.__outsidePressBubbles=F;function j(H){r(!1,H)}const J=jn(l);d&&J.addEventListener("keydown",B),A&&J.addEventListener(f,I);let q=[];return y&&(At(a)&&(q=Nr(a)),At(l)&&(q=q.concat(Nr(l))),!At(o)&&o&&o.contextElement&&(q=q.concat(Nr(o.contextElement)))),q=q.filter(H=>{var V;return H!==((V=J.defaultView)==null?void 0:V.visualViewport)}),q.forEach(H=>{H.addEventListener("scroll",j,{passive:!0})}),()=>{d&&J.removeEventListener("keydown",B),A&&J.removeEventListener(f,I),q.forEach(H=>{H.removeEventListener("scroll",j)})}},[c,l,a,o,d,A,f,n,r,y,u,U,F,B,I]),$.useEffect(()=>{O.current=!1},[A,f]),$.useMemo(()=>u?{reference:{onKeyDown:B,[AO[m]]:j=>{p&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1,j.nativeEvent))}},floating:{onKeyDown:B,[RO[f]]:()=>{O.current=!0}}}:{},[u,i,p,f,m,r,B])}let Gc;process.env.NODE_ENV!=="production"&&(Gc=new Set);function LO(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e;if(process.env.NODE_ENV!=="production"){var s;const U="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";if((s=e.elements)!=null&&s.reference&&!At(e.elements.reference)){var o;if(!((o=Gc)!=null&&o.has(U))){var a;(a=Gc)==null||a.add(U),console.error(U)}}}const[l,c]=$.useState(null),u=((t=e.elements)==null?void 0:t.reference)||l,d=HT(e),h=sa(),f=Fr((U,F)=>{U&&(m.current.openEvent=F),r==null||r(U,F)}),p=$.useRef(null),m=$.useRef({}),y=$.useState(()=>pO())[0],v=Hc(),b=$.useCallback(U=>{const F=At(U)?{getBoundingClientRect:()=>U.getBoundingClientRect(),contextElement:U}:U;d.refs.setReference(F)},[d.refs]),x=$.useCallback(U=>{(At(U)||U===null)&&(p.current=U,c(U)),(At(d.refs.reference.current)||d.refs.reference.current===null||U!==null&&!At(U))&&d.refs.setReference(U)},[d.refs]),P=$.useMemo(()=>({...d.refs,setReference:x,setPositionReference:b,domReference:p}),[d.refs,x,b]),A=$.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),O=$.useMemo(()=>({...d,refs:P,elements:A,dataRef:m,nodeId:i,floatingId:v,events:y,open:n,onOpenChange:f}),[d,i,v,y,n,f,P,A]);return jt(()=>{const U=h==null?void 0:h.nodesRef.current.find(F=>F.id===i);U&&(U.context=O)}),$.useMemo(()=>({...d,context:O,refs:P,elements:A}),[d,P,A,O])}function Yc(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,s)=>(s&&Object.entries(s).forEach(o=>{let[a,l]=o;if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof l=="function"){var c;(c=r.get(a))==null||c.push(l),i[a]=function(){for(var u,d=arguments.length,h=new Array(d),f=0;f<d;f++)h[f]=arguments[f];return(u=r.get(a))==null?void 0:u.map(p=>p(...h)).find(p=>p!==void 0)}}}else i[a]=l}),i),{})}}function DO(e){e===void 0&&(e=[]);const t=e,n=$.useCallback(s=>Yc(s,e,"reference"),t),r=$.useCallback(s=>Yc(s,e,"floating"),t),i=$.useCallback(s=>Yc(s,e,"item"),e.map(s=>s==null?void 0:s.item));return $.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])}let dm=!1;function ca(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function fm(e,t){return ca(t,e===zc||e===na,e===Di||e===As)}function Qc(e,t,n){return ca(t,e===na,n?e===Di:e===As)||e==="Enter"||e==" "||e===""}function NO(e,t,n){return ca(t,n?e===Di:e===As,e===na)}function hm(e,t,n){return ca(t,n?e===As:e===Di,e===zc)}function jO(e,t){const{open:n,onOpenChange:r,refs:i,elements:{domReference:s,floating:o}}=e,{listRef:a,activeIndex:l,onNavigate:c=()=>{},enabled:u=!0,selectedIndex:d=null,allowEscape:h=!1,loop:f=!1,nested:p=!1,rtl:m=!1,virtual:y=!1,focusItemOnOpen:v="auto",focusItemOnHover:b=!0,openOnArrowKeyDown:x=!0,disabledIndices:P=void 0,orientation:A="vertical",cols:O=1,scrollItemIntoView:U=!0,virtualItemRef:F}=t;process.env.NODE_ENV!=="production"&&(h&&(f||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),y||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),A==="vertical"&&O>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const B=em(),I=sa(),j=Fr(c),J=$.useRef(v),q=$.useRef(d??-1),H=$.useRef(null),V=$.useRef(!0),z=$.useRef(j),Y=$.useRef(!!o),K=$.useRef(!1),pe=$.useRef(!1),k=Ur(P),ee=Ur(n),xe=Ur(U),[S,Te]=$.useState(),[Ne,Ie]=$.useState(),je=Fr(function(_e,ve,ke){ke===void 0&&(ke=!1);const Ce=_e.current[ve.current];Ce&&(y?(Te(Ce.id),I==null||I.events.emit("virtualfocus",Ce),F&&(F.current=Ce)):yr(Ce,{preventScroll:!0,sync:wT()&&Ip()?dm||K.current:!1}),requestAnimationFrame(()=>{const Re=xe.current;Re&&Ce&&(ke||!V.current)&&(Ce.scrollIntoView==null||Ce.scrollIntoView(typeof Re=="boolean"?{block:"nearest",inline:"nearest"}:Re))}))});jt(()=>{document.createElement("div").focus({get preventScroll(){return dm=!0,!1}})},[]),jt(()=>{u&&(n&&o?J.current&&d!=null&&(pe.current=!0,j(d)):Y.current&&(q.current=-1,z.current(null)))},[u,n,o,d,j]),jt(()=>{if(u&&n&&o)if(l==null){if(K.current=!1,d!=null)return;if(Y.current&&(q.current=-1,je(a,q)),!Y.current&&J.current&&(H.current!=null||J.current===!0&&H.current==null)){let _e=0;const ve=()=>{a.current[0]==null?(_e<2&&(_e?requestAnimationFrame:queueMicrotask)(ve),_e++):(q.current=H.current==null||Qc(H.current,A,m)||p?Zc(a,k.current):Yp(a,k.current),H.current=null,j(q.current))};ve()}}else Rs(a,l)||(q.current=l,je(a,q,pe.current),pe.current=!1)},[u,n,o,l,d,p,a,A,m,j,je,k]),jt(()=>{var _e,ve;if(!u||o||!I||y||!Y.current)return;const ke=I.nodesRef.current,Ce=(_e=ke.find(N=>N.id===B))==null||(ve=_e.context)==null?void 0:ve.elements.floating,Re=jr(jn(o)),qe=ke.some(N=>N.context&&gn(N.context.elements.floating,Re));Ce&&!qe&&V.current&&Ce.focus({preventScroll:!0})},[u,o,I,B,y]),jt(()=>{if(!u||!I||!y||B)return;function _e(ve){Ie(ve.id),F&&(F.current=ve)}return I.events.on("virtualfocus",_e),()=>{I.events.off("virtualfocus",_e)}},[u,I,y,B,F]),jt(()=>{z.current=j,Y.current=!!o}),jt(()=>{n||(H.current=null)},[n]);const De=l!=null,Ue=$.useMemo(()=>{function _e(ke){if(!n)return;const Ce=a.current.indexOf(ke);Ce!==-1&&j(Ce)}return{onFocus(ke){let{currentTarget:Ce}=ke;_e(Ce)},onClick:ke=>{let{currentTarget:Ce}=ke;return Ce.focus({preventScroll:!0})},...b&&{onMouseMove(ke){let{currentTarget:Ce}=ke;_e(Ce)},onPointerLeave(ke){let{pointerType:Ce}=ke;!V.current||Ce==="touch"||(q.current=-1,je(a,q),j(null),y||yr(i.floating.current,{preventScroll:!0}))}}}},[n,i,je,b,a,j,y]);return $.useMemo(()=>{if(!u)return{};const _e=k.current;function ve(N){if(V.current=!1,K.current=!0,!ee.current&&N.currentTarget===i.floating.current)return;if(p&&hm(N.key,A,m)){Qt(N),r(!1,N.nativeEvent),sn(s)&&!y&&s.focus();return}const ne=q.current,me=Zc(a,_e),he=Yp(a,_e);if(N.key==="Home"&&(Qt(N),q.current=me,j(q.current)),N.key==="End"&&(Qt(N),q.current=he,j(q.current)),!(O>1&&(q.current=dO(a,{event:N,orientation:A,loop:f,cols:O,disabledIndices:_e,minIndex:me,maxIndex:he,prevIndex:q.current,stopEvent:!0}),j(q.current),A==="both"))&&fm(N.key,A)){if(Qt(N),n&&!y&&jr(N.currentTarget.ownerDocument)===N.currentTarget){q.current=Qc(N.key,A,m)?me:he,j(q.current);return}Qc(N.key,A,m)?f?q.current=ne>=he?h&&ne!==a.current.length?-1:me:on(a,{startingIndex:ne,disabledIndices:_e}):q.current=Math.min(he,on(a,{startingIndex:ne,disabledIndices:_e})):f?q.current=ne<=me?h&&ne!==-1?a.current.length:he:on(a,{startingIndex:ne,decrement:!0,disabledIndices:_e}):q.current=Math.max(me,on(a,{startingIndex:ne,decrement:!0,disabledIndices:_e})),Rs(a,q.current)?j(null):j(q.current)}}function ke(N){v==="auto"&&Tp(N.nativeEvent)&&(J.current=!0)}function Ce(N){J.current=v,v==="auto"&&Op(N.nativeEvent)&&(J.current=!0)}const Re=y&&n&&De&&{"aria-activedescendant":Ne||S},qe=a.current.find(N=>(N==null?void 0:N.id)===S);return{reference:{...Re,onKeyDown(N){V.current=!1;const ne=N.key.indexOf("Arrow")===0,me=NO(N.key,A,m),he=hm(N.key,A,m),Le=fm(N.key,A),Pe=(p?me:Le)||N.key==="Enter"||N.key.trim()==="";if(y&&n){const W=I==null?void 0:I.nodesRef.current.find(G=>G.parentId==null),Q=I&&W?vO(I.nodesRef.current,W.id):null;if(ne&&Q&&F){const G=new KeyboardEvent("keydown",{key:N.key,bubbles:!0});if(me||he){var Be,it;const $e=((Be=Q.context)==null?void 0:Be.elements.domReference)===N.currentTarget,Ge=he&&!$e?(it=Q.context)==null?void 0:it.elements.domReference:me?qe:null;Ge&&(Qt(N),Ge.dispatchEvent(G),Ie(void 0))}if(Le&&Q.context&&Q.context.open&&Q.parentId&&N.currentTarget!==Q.context.elements.domReference){var Ze;Qt(N),(Ze=Q.context.elements.domReference)==null||Ze.dispatchEvent(G);return}}return ve(N)}if(!(!n&&!x&&ne)){if(Pe&&(H.current=p&&Le?null:N.key),p){me&&(Qt(N),n?(q.current=Zc(a,_e),j(q.current)):r(!0,N.nativeEvent));return}Le&&(d!=null&&(q.current=d),Qt(N),!n&&x?r(!0,N.nativeEvent):ve(N),n&&j(q.current))}},onFocus(){n&&j(null)},onPointerDown:Ce,onMouseDown:ke,onClick:ke},floating:{"aria-orientation":A==="both"?void 0:A,...Re,onKeyDown:ve,onPointerMove(){V.current=!0}},item:Ue}},[s,i,S,Ne,k,ee,a,u,A,m,y,n,De,p,d,x,h,O,f,v,j,r,Ue,I,F])}function UO(e,t){t===void 0&&(t={});const{open:n,floatingId:r}=e,{enabled:i=!0,role:s="dialog"}=t,o=Hc();return $.useMemo(()=>{const a={id:r,role:s};return i?s==="tooltip"?{reference:{"aria-describedby":n?r:void 0},floating:a}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":s==="alertdialog"?"dialog":s,"aria-controls":n?r:void 0,...s==="listbox"&&{role:"combobox"},...s==="menu"&&{id:o}},floating:{...a,...s==="menu"&&{"aria-labelledby":o}}}:{}},[i,s,n,r,o])}function FO(e,t){var n;const{open:r,dataRef:i}=e,{listRef:s,activeIndex:o,onMatch:a,onTypingChange:l,enabled:c=!0,findMatch:u=null,resetMs:d=750,ignoreKeys:h=[],selectedIndex:f=null}=t,p=$.useRef(),m=$.useRef(""),y=$.useRef((n=f??o)!=null?n:-1),v=$.useRef(null),b=Fr(a),x=Fr(l),P=Ur(u),A=Ur(h);return jt(()=>{r&&(clearTimeout(p.current),v.current=null,m.current="")},[r]),jt(()=>{if(r&&m.current===""){var O;y.current=(O=f??o)!=null?O:-1}},[r,f,o]),$.useMemo(()=>{if(!c)return{};function O(B){B?i.current.typing||(i.current.typing=B,x(B)):i.current.typing&&(i.current.typing=B,x(B))}function U(B,I,j){const J=P.current?P.current(I,j):I.find(q=>(q==null?void 0:q.toLocaleLowerCase().indexOf(j.toLocaleLowerCase()))===0);return J?B.indexOf(J):-1}function F(B){const I=s.current;if(m.current.length>0&&m.current[0]!==" "&&(U(I,I,m.current)===-1?O(!1):B.key===" "&&Qt(B)),I==null||A.current.includes(B.key)||B.key.length!==1||B.ctrlKey||B.metaKey||B.altKey)return;r&&B.key!==" "&&(Qt(B),O(!0)),I.every(H=>{var V,z;return H?((V=H[0])==null?void 0:V.toLocaleLowerCase())!==((z=H[1])==null?void 0:z.toLocaleLowerCase()):!0})&&m.current===B.key&&(m.current="",y.current=v.current),m.current+=B.key,clearTimeout(p.current),p.current=setTimeout(()=>{m.current="",y.current=v.current,O(!1)},d);const J=y.current,q=U(I,[...I.slice((J||0)+1),...I.slice(0,(J||0)+1)],m.current);q!==-1?(b(q),v.current=q):B.key!==" "&&(m.current="",O(!1))}return{reference:{onKeyDown:F},floating:{onKeyDown:F,onKeyUp(B){B.key===" "&&O(!1)}}}},[c,r,i,s,d,A,P,b,x])}const BO=({styles:e,type:t,options:n,label:r,reusable:i})=>{var z,Y,K,pe,k,ee,xe,S,Te,Ne,Ie,je;const{state:s}=ht(),[o,a]=$.useState(!1),[l,c]=$.useState(null),[u,d]=$.useState(null),{client:h}=ht(),f=n.reduce((De,Ue)=>(De[Ue.label]=Ue.value,De),{}),p=f?Object.keys(f):[],m=De=>{a(u!==null&&!i?!1:De)},{refs:y,floatingStyles:v,context:b}=LO({placement:"bottom-start",open:o,onOpenChange:m,whileElementsMounted:ZT,middleware:[TT(5),ET({padding:10}),OT({apply({rects:De,elements:Ue,availableHeight:_e}){Object.assign(Ue.floating.style,{maxHeight:`${_e}px`,minWidth:`${De.reference.width}px`})},padding:10})]}),x=$.useRef([]),P=$.useRef(p),A=$.useRef(!1),O=IO(b,{event:"mousedown"}),U=MO(b),F=UO(b,{role:"listbox"}),B=jO(b,{listRef:x,activeIndex:l,selectedIndex:u,onNavigate:c,loop:!0}),I=FO(b,{listRef:P,activeIndex:l,selectedIndex:u,onMatch:o?c:d,onTypingChange(De){A.current=De}}),{getReferenceProps:j,getFloatingProps:J,getItemProps:q}=DO([U,F,B,I,O]),H=De=>{d(De),h==null||h.sendMessage(f[p[De]]),a(!1)},V=u!==null?p[u]:void 0;return Z.jsxs(Z.Fragment,{children:[Z.jsxs("div",{tabIndex:0,ref:y.setReference,"aria-labelledby":"select-label","aria-autocomplete":"none","data-disabled":u!==null&&!i?"":void 0,...(Y=(z=e==null?void 0:e[t])==null?void 0:z.button)==null?void 0:Y.container,...j(),children:[Z.jsx("span",{...(pe=(K=e==null?void 0:e[t])==null?void 0:K.button)==null?void 0:pe.text,children:V||r||"Select..."}),Z.jsx(lS,{...(ee=(k=e==null?void 0:e[t])==null?void 0:k.button)==null?void 0:ee.icon})]}),o&&Z.jsx(SO,{children:Z.jsx(OO,{context:b,modal:!1,children:Z.jsx("div",{ref:y.setFloating,className:(Te=(S=(xe=e==null?void 0:e[t])==null?void 0:xe.content)==null?void 0:S.container)==null?void 0:Te.className,style:{...v,...(je=(Ie=(Ne=e==null?void 0:e[t])==null?void 0:Ne.content)==null?void 0:Ie.container)==null?void 0:je.style},...J(),children:p.map((De,Ue)=>{var _e,ve;return Z.jsx("div",{ref:ke=>{x.current[Ue]=ke},role:"option",tabIndex:Ue===l?0:-1,"aria-selected":Ue===u&&Ue===l,"data-active":Ue===l?"":void 0,...(ve=(_e=e==null?void 0:e[t])==null?void 0:_e.content)==null?void 0:ve.item,...q({onClick(){s.isReadOnly||H(Ue)},onKeyDown(ke){s.isReadOnly||(ke.key==="Enter"&&(ke.preventDefault(),H(Ue)),ke.key===" "&&!A.current&&(ke.preventDefault(),H(Ue)))}}),children:De},De)})})})})]})},VO=_.forwardRef(({type:e,title:t,styles:n,url:r,...i},s)=>{var o,a,l;return Z.jsxs("a",{...i,...(o=n==null?void 0:n[e])==null?void 0:o.container,href:r,download:!0,ref:s,children:[Z.jsx("p",{...(a=n==null?void 0:n[e])==null?void 0:a.title,children:t||r}),Z.jsx(uS,{...(l=n==null?void 0:n[e])==null?void 0:l.icon})]})}),Xc={text:SC,button:OC,bubble:PC,audio:eS,column:pS,file:VO,image:YE,location:hS,row:mS,video:XE,carousel:aT,dropdown:BO},Ui=({block:e,styles:t,...n})=>{const r=Xc[e.type];return Z.jsx(r,{...n,...e,styles:t})},pm=e=>{let t;const n=new Set,r=(l,c)=>{const u=typeof l=="function"?l(t):l;if(!Object.is(u,t)){const d=t;t=c??typeof u!="object"?u:Object.assign({},t,u),n.forEach(h=>h(t,d))}},i=()=>t,a={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return t=e(r,i,a),a},zO=e=>e?pm(e):pm;var eu={exports:{}},tu={},ua={exports:{}},nu={};/**
|
|
236
|
+
*/var WO=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Qc=WO.join(","),im=typeof Element>"u",Ns=im?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ua=!im&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},da=function e(t,n){var r;n===void 0&&(n=!0);var i=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=i===""||i==="true",o=s||n&&t&&e(t.parentNode);return o},HO=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},qO=function(t,n,r){if(da(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Qc));return n&&Ns.call(t,Qc)&&i.unshift(t),i=i.filter(r),i},KO=function e(t,n,r){for(var i=[],s=Array.from(t);s.length;){var o=s.shift();if(!da(o,!1))if(o.tagName==="SLOT"){var a=o.assignedElements(),l=a.length?a:o.children,c=e(l,!0,r);r.flatten?i.push.apply(i,c):i.push({scopeParent:o,candidates:c})}else{var u=Ns.call(o,Qc);u&&r.filter(o)&&(n||!t.includes(o))&&i.push(o);var d=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),h=!da(d,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(d&&h){var f=e(d===!0?o.children:d.children,!0,r);r.flatten?i.push.apply(i,f):i.push({scopeParent:o,candidates:f})}else s.unshift.apply(s,o.children)}}return i},sm=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},om=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||HO(t))&&!sm(t)?0:t.tabIndex},JO=function(t,n){var r=om(t);return r<0&&n&&!sm(t)?0:r},GO=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},am=function(t){return t.tagName==="INPUT"},YO=function(t){return am(t)&&t.type==="hidden"},QO=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},XO=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},eI=function(t){if(!t.name)return!0;var n=t.form||ua(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(t.name));else try{i=r(t.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var s=XO(i,t.form);return!s||s===t},tI=function(t){return am(t)&&t.type==="radio"},nI=function(t){return tI(t)&&!eI(t)},rI=function(t){var n,r=t&&ua(t),i=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var o,a,l;for(s=!!((o=i)!==null&&o!==void 0&&(a=o.ownerDocument)!==null&&a!==void 0&&a.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&i;){var c,u,d;r=ua(i),i=(c=r)===null||c===void 0?void 0:c.host,s=!!((u=i)!==null&&u!==void 0&&(d=u.ownerDocument)!==null&&d!==void 0&&d.contains(i))}}return s},lm=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},iI=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var s=Ns.call(t,"details>summary:first-of-type"),o=s?t.parentElement:t;if(Ns.call(o,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof i=="function"){for(var a=t;t;){var l=t.parentElement,c=ua(t);if(l&&!l.shadowRoot&&i(l)===!0)return lm(t);t.assignedSlot?t=t.assignedSlot:!l&&c!==t.ownerDocument?t=c.host:t=l}t=a}if(rI(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return lm(t);return!1},sI=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return Ns.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},oI=function(t,n){return!(n.disabled||da(n)||YO(n)||iI(n,t)||QO(n)||sI(n))},cm=function(t,n){return!(nI(n)||om(n)<0||!oI(t,n))},aI=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},lI=function e(t){var n=[],r=[];return t.forEach(function(i,s){var o=!!i.scopeParent,a=o?i.scopeParent:i,l=JO(a,o),c=o?e(i.candidates):a;l===0?o?n.push.apply(n,c):n.push(a):r.push({documentOrder:s,tabIndex:l,item:i,isScope:o,content:c})}),r.sort(GO).reduce(function(i,s){return s.isScope?i.push.apply(i,s.content):i.push(s.content),i},[]).concat(n)},Xc=function(t,n){n=n||{};var r;return n.getShadowRoot?r=KO([t],n.includeContainer,{filter:cm.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:aI}):r=qO(t,n.includeContainer,cm.bind(null,n)),lI(r)};const eu="ArrowUp",fa="ArrowDown",Vi="ArrowLeft",js="ArrowRight";function ha(e,t,n){return Math.floor(e/t)!==n}function Us(e,t){return t<0||t>=e.current.length}function tu(e,t){return cn(e,{disabledIndices:t})}function um(e,t){return cn(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function cn(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:s=1}=t===void 0?{}:t;const o=e.current;let a=n;do{var l,c;a=a+(r?-s:s)}while(a>=0&&a<=o.length-1&&(i?i.includes(a):o[a]==null||(l=o[a])!=null&&l.hasAttribute("disabled")||((c=o[a])==null?void 0:c.getAttribute("aria-disabled"))==="true"));return a}function cI(e,t){let{event:n,orientation:r,loop:i,cols:s,disabledIndices:o,minIndex:a,maxIndex:l,prevIndex:c,stopEvent:u=!1}=t,d=c;if(n.key===eu){if(u&&tn(n),c===-1)d=l;else if(d=cn(e,{startingIndex:d,amount:s,decrement:!0,disabledIndices:o}),i&&(c-s<a||d<0)){const h=c%s,f=l%s,p=l-(f-h);f===h?d=l:d=f>h?p:p-s}Us(e,d)&&(d=c)}if(n.key===fa&&(u&&tn(n),c===-1?d=a:(d=cn(e,{startingIndex:c,amount:s,disabledIndices:o}),i&&c+s>l&&(d=cn(e,{startingIndex:c%s-s,amount:s,disabledIndices:o}))),Us(e,d)&&(d=c)),r==="both"){const h=Fi(c/s);n.key===js&&(u&&tn(n),c%s!==s-1?(d=cn(e,{startingIndex:c,disabledIndices:o}),i&&ha(d,s,h)&&(d=cn(e,{startingIndex:c-c%s-1,disabledIndices:o}))):i&&(d=cn(e,{startingIndex:c-c%s-1,disabledIndices:o})),ha(d,s,h)&&(d=c)),n.key===Vi&&(u&&tn(n),c%s!==0?(d=cn(e,{startingIndex:c,disabledIndices:o,decrement:!0}),i&&ha(d,s,h)&&(d=cn(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:o}))):i&&(d=cn(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:o})),ha(d,s,h)&&(d=c));const f=Fi(l/s)===h;Us(e,d)&&(i&&f?d=n.key===Vi?l:cn(e,{startingIndex:c-c%s-1,disabledIndices:o}):d=c)}return d}let dm=0;function xr(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(dm);const s=()=>e==null?void 0:e.focus({preventScroll:n});i?s():dm=requestAnimationFrame(s)}var Bt=typeof document<"u"?_.useLayoutEffect:_.useEffect;function pa(){return pa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pa.apply(this,arguments)}let nu=!1,uI=0;const fm=()=>"floating-ui-"+uI++;function dI(){const[e,t]=R.useState(()=>nu?fm():void 0);return Bt(()=>{e==null&&t(fm())},[]),R.useEffect(()=>{nu||(nu=!0)},[]),e}const ru=R["useId".toString()]||dI;function fI(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const hI=R.createContext(null),pI=R.createContext(null),hm=()=>{var e;return((e=R.useContext(hI))==null?void 0:e.id)||null},ma=()=>R.useContext(pI);function Fs(e){return"data-floating-ui-"+e}function Zr(e){const t=_.useRef(e);return Bt(()=>{t.current=e}),t}function mI(e,t){var n;let r=[],i=(n=e.find(s=>s.id===t))==null?void 0:n.parentId;for(;i;){const s=e.find(o=>o.id===i);i=s==null?void 0:s.parentId,s&&(r=r.concat(s))}return r}function zi(e,t){let n=e.filter(i=>{var s;return i.parentId===t&&((s=i.context)==null?void 0:s.open)}),r=n;for(;r.length;)r=e.filter(i=>{var s;return(s=r)==null?void 0:s.some(o=>{var a;return i.parentId===o.id&&((a=i.context)==null?void 0:a.open)})}),n=n.concat(r);return n}function gI(e,t){let n,r=-1;function i(s,o){o>r&&(n=s,r=o),zi(e,s).forEach(l=>{i(l.id,o+1)})}return i(t,0),e.find(s=>s.id===n)}let Zi=new WeakMap,ga=new WeakSet,ya={},iu=0;const yI=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,pm=e=>e&&(e.host||pm(e.parentNode)),vI=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=pm(n);return e.contains(r)?r:null}).filter(n=>n!=null);function bI(e,t,n,r){const i="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,o=vI(t,e),a=new Set,l=new Set(o),c=[];ya[i]||(ya[i]=new WeakMap);const u=ya[i];o.forEach(d),h(t),a.clear();function d(f){!f||a.has(f)||(a.add(f),f.parentNode&&d(f.parentNode))}function h(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,p=>{if(a.has(p))h(p);else{const m=s?p.getAttribute(s):null,y=m!==null&&m!=="false",v=(Zi.get(p)||0)+1,b=(u.get(p)||0)+1;Zi.set(p,v),u.set(p,b),c.push(p),v===1&&y&&ga.add(p),b===1&&p.setAttribute(i,""),!y&&s&&p.setAttribute(s,"true")}})}return iu++,()=>{c.forEach(f=>{const p=(Zi.get(f)||0)-1,m=(u.get(f)||0)-1;Zi.set(f,p),u.set(f,m),p||(!ga.has(f)&&s&&f.removeAttribute(s),ga.delete(f)),m||f.removeAttribute(i)}),iu--,iu||(Zi=new WeakMap,Zi=new WeakMap,ga=new WeakSet,ya={})}}function mm(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Bn(e[0]).body;return bI(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const su=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function gm(e,t){const n=Xc(e,su());t==="prev"&&n.reverse();const r=n.indexOf(zr(Bn(e)));return n.slice(r+1)[0]}function ym(){return gm(document.body,"next")}function vm(){return gm(document.body,"prev")}function Bs(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!bn(n,r)}function wI(e){Xc(e,su()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function xI(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const ou={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};let _I;function bm(e){e.key==="Tab"&&(e.target,clearTimeout(_I))}const va=R.forwardRef(function(t,n){const[r,i]=R.useState();Bt(()=>(Vp()&&i("button"),document.addEventListener("keydown",bm),()=>{document.removeEventListener("keydown",bm)}),[]);const s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Fs("focus-guard")]:"",style:ou};return R.createElement("span",pa({},t,s))}),wm=R.createContext(null);function kI(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=R.useState(null),s=ru(),o=xm(),a=R.useMemo(()=>({id:t,root:n,portalContext:o,uniqueId:s}),[t,n,o,s]),l=R.useRef();return Bt(()=>()=>{r==null||r.remove()},[r,a]),Bt(()=>{if(l.current===a)return;l.current=a;const{id:c,root:u,portalContext:d,uniqueId:h}=a,f=c?document.getElementById(c):null,p=Fs("portal");if(f){const m=document.createElement("div");m.id=h,m.setAttribute(p,""),f.appendChild(m),i(m)}else{let m=u||(d==null?void 0:d.portalNode);m&&!$t(m)&&(m=m.current),m=m||document.body;let y=null;c&&(y=document.createElement("div"),y.id=c,m.appendChild(y));const v=document.createElement("div");v.id=h,v.setAttribute(p,""),m=y||m,m.appendChild(v),i(v)}},[a]),r}function CI(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const s=kI({id:n,root:r}),[o,a]=R.useState(null),l=R.useRef(null),c=R.useRef(null),u=R.useRef(null),d=R.useRef(null),h=!!o&&!o.modal&&o.open&&i&&!!(r||s);return R.useEffect(()=>{if(!s||!i||o!=null&&o.modal)return;function f(p){s&&Bs(p)&&(p.type==="focusin"?xI:wI)(s)}return s.addEventListener("focusin",f,!0),s.addEventListener("focusout",f,!0),()=>{s.removeEventListener("focusin",f,!0),s.removeEventListener("focusout",f,!0)}},[s,i,o==null?void 0:o.modal]),R.createElement(wm.Provider,{value:R.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:u,afterInsideRef:d,portalNode:s,setFocusManagerState:a}),[i,s])},h&&s&&R.createElement(va,{"data-type":"outside",ref:l,onFocus:f=>{if(Bs(f,s)){var p;(p=u.current)==null||p.focus()}else{const m=vm()||(o==null?void 0:o.refs.domReference.current);m==null||m.focus()}}}),h&&s&&R.createElement("span",{"aria-owns":s.id,style:ou}),s&&Gn.createPortal(t,s),h&&s&&R.createElement(va,{"data-type":"outside",ref:c,onFocus:f=>{if(Bs(f,s)){var p;(p=d.current)==null||p.focus()}else{const m=ym()||(o==null?void 0:o.refs.domReference.current);m==null||m.focus(),o!=null&&o.closeOnFocusOut&&(o==null||o.onOpenChange(!1,f.nativeEvent))}}}))}const xm=()=>R.useContext(wm),EI=R.forwardRef(function(t,n){return R.createElement("button",pa({},t,{type:"button",ref:n,tabIndex:-1,style:ou}))});function SI(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:s=!0,initialFocus:o=0,returnFocus:a=!0,modal:l=!0,visuallyHiddenDismiss:c=!1,closeOnFocusOut:u=!0}=e,{open:d,refs:h,nodeId:f,onOpenChange:p,events:m,dataRef:y,elements:{domReference:v,floating:b}}=t,x=yI()?s:!0,I=Zr(i),P=Zr(o),T=Zr(a),j=ma(),U=xm(),F=typeof o=="number"&&o<0,O=R.useRef(null),N=R.useRef(null),J=R.useRef(!1),q=R.useRef(null),W=R.useRef(!1),B=U!=null,V=v&&v.getAttribute("role")==="combobox"&&Wp(v)&&F,Y=R.useCallback(function(ee){return ee===void 0&&(ee=b),ee?Xc(ee,su()):[]},[b]),K=R.useCallback(ee=>{const xe=Y(ee);return I.current.map(S=>v&&S==="reference"?v:b&&S==="floating"?b:xe).filter(Boolean).flat()},[v,b,I,Y]);R.useEffect(()=>{if(r||!l)return;function ee(S){if(S.key==="Tab"){bn(b,zr(Bn(b)))&&Y().length===0&&!V&&tn(S);const Te=K(),Ne=Zp(S);I.current[0]==="reference"&&Ne===v&&(tn(S),S.shiftKey?xr(Te[Te.length-1]):xr(Te[1])),I.current[1]==="floating"&&Ne===b&&S.shiftKey&&(tn(S),xr(Te[0]))}}const xe=Bn(b);return xe.addEventListener("keydown",ee),()=>{xe.removeEventListener("keydown",ee)}},[r,v,b,l,I,h,V,Y,K]),R.useEffect(()=>{if(r||!u)return;function ee(){W.current=!0,setTimeout(()=>{W.current=!1})}function xe(S){const Te=S.relatedTarget;queueMicrotask(()=>{const Ne=!(bn(v,Te)||bn(b,Te)||bn(Te,b)||bn(U==null?void 0:U.portalNode,Te)||Te!=null&&Te.hasAttribute(Fs("focus-guard"))||j&&(zi(j.nodesRef.current,f).find(Ie=>{var je,De;return bn((je=Ie.context)==null?void 0:je.elements.floating,Te)||bn((De=Ie.context)==null?void 0:De.elements.domReference,Te)})||mI(j.nodesRef.current,f).find(Ie=>{var je,De;return((je=Ie.context)==null?void 0:je.elements.floating)===Te||((De=Ie.context)==null?void 0:De.elements.domReference)===Te})));Te&&Ne&&!W.current&&Te!==q.current&&(J.current=!0,p(!1,S))})}if(b&&ln(v))return v.addEventListener("focusout",xe),v.addEventListener("pointerdown",ee),!l&&b.addEventListener("focusout",xe),()=>{v.removeEventListener("focusout",xe),v.removeEventListener("pointerdown",ee),!l&&b.removeEventListener("focusout",xe)}},[r,v,b,l,f,j,U,p,u]),R.useEffect(()=>{var ee;if(r)return;const xe=Array.from((U==null||(ee=U.portalNode)==null?void 0:ee.querySelectorAll("["+Fs("portal")+"]"))||[]);if(b){const S=[b,...xe,O.current,N.current,I.current.includes("reference")||V?v:null].filter(Ne=>Ne!=null),Te=l?mm(S,x,!x):mm(S);return()=>{Te()}}},[r,v,b,l,I,U,V,x]),Bt(()=>{if(r||!b)return;const ee=Bn(b),xe=zr(ee);queueMicrotask(()=>{const S=K(b),Te=P.current,Ne=(typeof Te=="number"?S[Te]:Te.current)||b,Ie=bn(b,xe);!F&&!Ie&&d&&xr(Ne,{preventScroll:Ne===b})})},[r,d,b,F,K,P]),Bt(()=>{if(r||!b)return;let ee=!1;const xe=Bn(b),S=zr(xe),Te=y.current;q.current=S;function Ne(Ie){if(Ie.type==="escapeKey"&&h.domReference.current&&(q.current=h.domReference.current),["referencePress","escapeKey"].includes(Ie.type))return;const je=Ie.data.returnFocus;typeof je=="object"?(J.current=!1,ee=je.preventScroll):J.current=!je}return m.on("dismiss",Ne),()=>{m.off("dismiss",Ne);const Ie=zr(xe);(bn(b,Ie)||j&&zi(j.nodesRef.current,f).some(De=>{var Ue;return bn((Ue=De.context)==null?void 0:Ue.elements.floating,Ie)})||Te.openEvent&&["click","mousedown"].includes(Te.openEvent.type))&&h.domReference.current&&(q.current=h.domReference.current),T.current&&ln(q.current)&&!J.current&&xr(q.current,{cancelPrevious:!1,preventScroll:ee})}},[r,b,T,y,h,m,j,f]),Bt(()=>{if(!(r||!U))return U.setFocusManagerState({modal:l,closeOnFocusOut:u,open:d,onOpenChange:p,refs:h}),()=>{U.setFocusManagerState(null)}},[r,U,l,d,p,h,u]),Bt(()=>{if(!r&&b&&typeof MutationObserver=="function"&&!F){const ee=()=>{const S=b.getAttribute("tabindex");I.current.includes("floating")||zr(Bn(b))!==h.domReference.current&&Y().length===0?S!=="0"&&b.setAttribute("tabindex","0"):S!=="-1"&&b.setAttribute("tabindex","-1")};ee();const xe=new MutationObserver(ee);return xe.observe(b,{childList:!0,subtree:!0,attributes:!0}),()=>{xe.disconnect()}}},[r,b,h,I,Y,F]);function pe(ee){return r||!c||!l?null:R.createElement(EI,{ref:ee==="start"?O:N,onClick:xe=>p(!1,xe.nativeEvent)},typeof c=="string"?c:"Dismiss")}const k=!r&&x&&!V&&(B||l);return R.createElement(R.Fragment,null,k&&R.createElement(va,{"data-type":"inside",ref:U==null?void 0:U.beforeInsideRef,onFocus:ee=>{if(l){const S=K();xr(i[0]==="reference"?S[0]:S[S.length-1])}else if(U!=null&&U.preserveTabOrder&&U.portalNode)if(J.current=!1,Bs(ee,U.portalNode)){const S=ym()||v;S==null||S.focus()}else{var xe;(xe=U.beforeOutsideRef.current)==null||xe.focus()}}}),!V&&pe("start"),n,pe("end"),k&&R.createElement(va,{"data-type":"inside",ref:U==null?void 0:U.afterInsideRef,onFocus:ee=>{if(l)xr(K()[0]);else if(U!=null&&U.preserveTabOrder&&U.portalNode)if(u&&(J.current=!0),Bs(ee,U.portalNode)){const S=vm()||v;S==null||S.focus()}else{var xe;(xe=U.afterOutsideRef.current)==null||xe.focus()}}}))}function _m(e){return ln(e.target)&&e.target.tagName==="BUTTON"}function km(e){return Wp(e)}function TI(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:s}}=e,{enabled:o=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0}=t,d=R.useRef(),h=R.useRef(!1);return R.useMemo(()=>o?{reference:{onPointerDown(f){d.current=f.pointerType},onMouseDown(f){f.button===0&&(zp(d.current,!0)&&c||a!=="click"&&(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,f.nativeEvent):(f.preventDefault(),r(!0,f.nativeEvent))))},onClick(f){if(a==="mousedown"&&d.current){d.current=void 0;return}zp(d.current,!0)&&c||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,f.nativeEvent):r(!0,f.nativeEvent))},onKeyDown(f){d.current=void 0,!(f.defaultPrevented||!u||_m(f))&&(f.key===" "&&!km(s)&&(f.preventDefault(),h.current=!0),f.key==="Enter"&&r(!(n&&l),f.nativeEvent))},onKeyUp(f){f.defaultPrevented||!u||_m(f)||km(s)||f.key===" "&&h.current&&(h.current=!1,r(!(n&&l),f.nativeEvent))}}}:{},[o,i,a,c,u,s,l,n,r])}const OI=R["useInsertionEffect".toString()]||(e=>e());function Wr(e){const t=R.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return OI(()=>{t.current=e}),R.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}const II={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},PI={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},AI=e=>{var t,n;return{escapeKeyBubbles:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePressBubbles:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function RI(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,nodeId:s,elements:{reference:o,domReference:a,floating:l},dataRef:c}=e,{enabled:u=!0,escapeKey:d=!0,outsidePress:h=!0,outsidePressEvent:f="pointerdown",referencePress:p=!1,referencePressEvent:m="pointerdown",ancestorScroll:y=!1,bubbles:v}=t,b=ma(),x=hm()!=null,I=Wr(typeof h=="function"?h:()=>!1),P=typeof h=="function"?I:h,T=R.useRef(!1),{escapeKeyBubbles:j,outsidePressBubbles:U}=AI(v),F=Wr(N=>{if(!n||!u||!d||N.key!=="Escape")return;const J=b?zi(b.nodesRef.current,s):[];if(!j&&(N.stopPropagation(),J.length>0)){let q=!0;if(J.forEach(W=>{var B;if((B=W.context)!=null&&B.open&&!W.context.dataRef.current.__escapeKeyBubbles){q=!1;return}}),!q)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1,bO(N)?N.nativeEvent:N)}),O=Wr(N=>{const J=T.current;if(T.current=!1,J||typeof P=="function"&&!P(N))return;const q=Zp(N),W="["+Fs("inert")+"]",B=Bn(l).querySelectorAll(W);let V=$t(q)?q:null;for(;V&&!Ds(V);){const pe=yi(V);if(pe===Bn(l).body||!$t(pe))break;V=pe}if(B.length&&$t(q)&&!wO(q)&&!bn(q,l)&&Array.from(B).every(pe=>!bn(V,pe)))return;if(ln(q)&&l){const pe=q.clientWidth>0&&q.scrollWidth>q.clientWidth,k=q.clientHeight>0&&q.scrollHeight>q.clientHeight;let ee=k&&N.offsetX>q.clientWidth;if(k&&Sn(q).direction==="rtl"&&(ee=N.offsetX<=q.offsetWidth-q.clientWidth),ee||pe&&N.offsetY>q.clientHeight)return}const Y=b&&zi(b.nodesRef.current,s).some(pe=>{var k;return Gc(N,(k=pe.context)==null?void 0:k.elements.floating)});if(Gc(N,l)||Gc(N,a)||Y)return;const K=b?zi(b.nodesRef.current,s):[];if(K.length>0){let pe=!0;if(K.forEach(k=>{var ee;if((ee=k.context)!=null&&ee.open&&!k.context.dataRef.current.__outsidePressBubbles){pe=!1;return}}),!pe)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:x?{preventScroll:!0}:Fp(N)||Bp(N)}}),r(!1,N)});return R.useEffect(()=>{if(!n||!u)return;c.current.__escapeKeyBubbles=j,c.current.__outsidePressBubbles=U;function N(W){r(!1,W)}const J=Bn(l);d&&J.addEventListener("keydown",F),P&&J.addEventListener(f,O);let q=[];return y&&($t(a)&&(q=Vr(a)),$t(l)&&(q=q.concat(Vr(l))),!$t(o)&&o&&o.contextElement&&(q=q.concat(Vr(o.contextElement)))),q=q.filter(W=>{var B;return W!==((B=J.defaultView)==null?void 0:B.visualViewport)}),q.forEach(W=>{W.addEventListener("scroll",N,{passive:!0})}),()=>{d&&J.removeEventListener("keydown",F),P&&J.removeEventListener(f,O),q.forEach(W=>{W.removeEventListener("scroll",N)})}},[c,l,a,o,d,P,f,n,r,y,u,j,U,F,O]),R.useEffect(()=>{T.current=!1},[P,f]),R.useMemo(()=>u?{reference:{onKeyDown:F,[II[m]]:N=>{p&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1,N.nativeEvent))}},floating:{onKeyDown:F,[PI[f]]:()=>{T.current=!0}}}:{},[u,i,p,f,m,r,F])}let au;process.env.NODE_ENV!=="production"&&(au=new Set);function $I(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e;if(process.env.NODE_ENV!=="production"){var s;const j="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";if((s=e.elements)!=null&&s.reference&&!$t(e.elements.reference)){var o;if(!((o=au)!=null&&o.has(j))){var a;(a=au)==null||a.add(j),console.error(j)}}}const[l,c]=R.useState(null),u=((t=e.elements)==null?void 0:t.reference)||l,d=ZO(e),h=ma(),f=Wr((j,U)=>{j&&(m.current.openEvent=U),r==null||r(j,U)}),p=R.useRef(null),m=R.useRef({}),y=R.useState(()=>fI())[0],v=ru(),b=R.useCallback(j=>{const U=$t(j)?{getBoundingClientRect:()=>j.getBoundingClientRect(),contextElement:j}:j;d.refs.setReference(U)},[d.refs]),x=R.useCallback(j=>{($t(j)||j===null)&&(p.current=j,c(j)),($t(d.refs.reference.current)||d.refs.reference.current===null||j!==null&&!$t(j))&&d.refs.setReference(j)},[d.refs]),I=R.useMemo(()=>({...d.refs,setReference:x,setPositionReference:b,domReference:p}),[d.refs,x,b]),P=R.useMemo(()=>({...d.elements,domReference:u}),[d.elements,u]),T=R.useMemo(()=>({...d,refs:I,elements:P,dataRef:m,nodeId:i,floatingId:v,events:y,open:n,onOpenChange:f}),[d,i,v,y,n,f,I,P]);return Bt(()=>{const j=h==null?void 0:h.nodesRef.current.find(U=>U.id===i);j&&(j.context=T)}),R.useMemo(()=>({...d,context:T,refs:I,elements:P}),[d,I,P,T])}function lu(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,s)=>(s&&Object.entries(s).forEach(o=>{let[a,l]=o;if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof l=="function"){var c;(c=r.get(a))==null||c.push(l),i[a]=function(){for(var u,d=arguments.length,h=new Array(d),f=0;f<d;f++)h[f]=arguments[f];return(u=r.get(a))==null?void 0:u.map(p=>p(...h)).find(p=>p!==void 0)}}}else i[a]=l}),i),{})}}function MI(e){e===void 0&&(e=[]);const t=e,n=R.useCallback(s=>lu(s,e,"reference"),t),r=R.useCallback(s=>lu(s,e,"floating"),t),i=R.useCallback(s=>lu(s,e,"item"),e.map(s=>s==null?void 0:s.item));return R.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])}let Cm=!1;function ba(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Em(e,t){return ba(t,e===eu||e===fa,e===Vi||e===js)}function cu(e,t,n){return ba(t,e===fa,n?e===Vi:e===js)||e==="Enter"||e==" "||e===""}function LI(e,t,n){return ba(t,n?e===Vi:e===js,e===fa)}function Sm(e,t,n){return ba(t,n?e===js:e===Vi,e===eu)}function DI(e,t){const{open:n,onOpenChange:r,refs:i,elements:{domReference:s,floating:o}}=e,{listRef:a,activeIndex:l,onNavigate:c=()=>{},enabled:u=!0,selectedIndex:d=null,allowEscape:h=!1,loop:f=!1,nested:p=!1,rtl:m=!1,virtual:y=!1,focusItemOnOpen:v="auto",focusItemOnHover:b=!0,openOnArrowKeyDown:x=!0,disabledIndices:I=void 0,orientation:P="vertical",cols:T=1,scrollItemIntoView:j=!0,virtualItemRef:U}=t;process.env.NODE_ENV!=="production"&&(h&&(f||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),y||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),P==="vertical"&&T>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const F=hm(),O=ma(),N=Wr(c),J=R.useRef(v),q=R.useRef(d??-1),W=R.useRef(null),B=R.useRef(!0),V=R.useRef(N),Y=R.useRef(!!o),K=R.useRef(!1),pe=R.useRef(!1),k=Zr(I),ee=Zr(n),xe=Zr(j),[S,Te]=R.useState(),[Ne,Ie]=R.useState(),je=Wr(function(_e,ve,ke){ke===void 0&&(ke=!1);const Ce=_e.current[ve.current];Ce&&(y?(Te(Ce.id),O==null||O.events.emit("virtualfocus",Ce),U&&(U.current=Ce)):xr(Ce,{preventScroll:!0,sync:vO()&&Vp()?Cm||K.current:!1}),requestAnimationFrame(()=>{const Re=xe.current;Re&&Ce&&(ke||!B.current)&&(Ce.scrollIntoView==null||Ce.scrollIntoView(typeof Re=="boolean"?{block:"nearest",inline:"nearest"}:Re))}))});Bt(()=>{document.createElement("div").focus({get preventScroll(){return Cm=!0,!1}})},[]),Bt(()=>{u&&(n&&o?J.current&&d!=null&&(pe.current=!0,N(d)):Y.current&&(q.current=-1,V.current(null)))},[u,n,o,d,N]),Bt(()=>{if(u&&n&&o)if(l==null){if(K.current=!1,d!=null)return;if(Y.current&&(q.current=-1,je(a,q)),!Y.current&&J.current&&(W.current!=null||J.current===!0&&W.current==null)){let _e=0;const ve=()=>{a.current[0]==null?(_e<2&&(_e?requestAnimationFrame:queueMicrotask)(ve),_e++):(q.current=W.current==null||cu(W.current,P,m)||p?tu(a,k.current):um(a,k.current),W.current=null,N(q.current))};ve()}}else Us(a,l)||(q.current=l,je(a,q,pe.current),pe.current=!1)},[u,n,o,l,d,p,a,P,m,N,je,k]),Bt(()=>{var _e,ve;if(!u||o||!O||y||!Y.current)return;const ke=O.nodesRef.current,Ce=(_e=ke.find(D=>D.id===F))==null||(ve=_e.context)==null?void 0:ve.elements.floating,Re=zr(Bn(o)),qe=ke.some(D=>D.context&&bn(D.context.elements.floating,Re));Ce&&!qe&&B.current&&Ce.focus({preventScroll:!0})},[u,o,O,F,y]),Bt(()=>{if(!u||!O||!y||F)return;function _e(ve){Ie(ve.id),U&&(U.current=ve)}return O.events.on("virtualfocus",_e),()=>{O.events.off("virtualfocus",_e)}},[u,O,y,F,U]),Bt(()=>{V.current=N,Y.current=!!o}),Bt(()=>{n||(W.current=null)},[n]);const De=l!=null,Ue=R.useMemo(()=>{function _e(ke){if(!n)return;const Ce=a.current.indexOf(ke);Ce!==-1&&N(Ce)}return{onFocus(ke){let{currentTarget:Ce}=ke;_e(Ce)},onClick:ke=>{let{currentTarget:Ce}=ke;return Ce.focus({preventScroll:!0})},...b&&{onMouseMove(ke){let{currentTarget:Ce}=ke;_e(Ce)},onPointerLeave(ke){let{pointerType:Ce}=ke;!B.current||Ce==="touch"||(q.current=-1,je(a,q),N(null),y||xr(i.floating.current,{preventScroll:!0}))}}}},[n,i,je,b,a,N,y]);return R.useMemo(()=>{if(!u)return{};const _e=k.current;function ve(D){if(B.current=!1,K.current=!0,!ee.current&&D.currentTarget===i.floating.current)return;if(p&&Sm(D.key,P,m)){tn(D),r(!1,D.nativeEvent),ln(s)&&!y&&s.focus();return}const ne=q.current,me=tu(a,_e),he=um(a,_e);if(D.key==="Home"&&(tn(D),q.current=me,N(q.current)),D.key==="End"&&(tn(D),q.current=he,N(q.current)),!(T>1&&(q.current=cI(a,{event:D,orientation:P,loop:f,cols:T,disabledIndices:_e,minIndex:me,maxIndex:he,prevIndex:q.current,stopEvent:!0}),N(q.current),P==="both"))&&Em(D.key,P)){if(tn(D),n&&!y&&zr(D.currentTarget.ownerDocument)===D.currentTarget){q.current=cu(D.key,P,m)?me:he,N(q.current);return}cu(D.key,P,m)?f?q.current=ne>=he?h&&ne!==a.current.length?-1:me:cn(a,{startingIndex:ne,disabledIndices:_e}):q.current=Math.min(he,cn(a,{startingIndex:ne,disabledIndices:_e})):f?q.current=ne<=me?h&&ne!==-1?a.current.length:he:cn(a,{startingIndex:ne,decrement:!0,disabledIndices:_e}):q.current=Math.max(me,cn(a,{startingIndex:ne,decrement:!0,disabledIndices:_e})),Us(a,q.current)?N(null):N(q.current)}}function ke(D){v==="auto"&&Fp(D.nativeEvent)&&(J.current=!0)}function Ce(D){J.current=v,v==="auto"&&Bp(D.nativeEvent)&&(J.current=!0)}const Re=y&&n&&De&&{"aria-activedescendant":Ne||S},qe=a.current.find(D=>(D==null?void 0:D.id)===S);return{reference:{...Re,onKeyDown(D){B.current=!1;const ne=D.key.indexOf("Arrow")===0,me=LI(D.key,P,m),he=Sm(D.key,P,m),Le=Em(D.key,P),Pe=(p?me:Le)||D.key==="Enter"||D.key.trim()==="";if(y&&n){const Z=O==null?void 0:O.nodesRef.current.find(G=>G.parentId==null),Q=O&&Z?gI(O.nodesRef.current,Z.id):null;if(ne&&Q&&U){const G=new KeyboardEvent("keydown",{key:D.key,bubbles:!0});if(me||he){var Be,ot;const $e=((Be=Q.context)==null?void 0:Be.elements.domReference)===D.currentTarget,Ge=he&&!$e?(ot=Q.context)==null?void 0:ot.elements.domReference:me?qe:null;Ge&&(tn(D),Ge.dispatchEvent(G),Ie(void 0))}if(Le&&Q.context&&Q.context.open&&Q.parentId&&D.currentTarget!==Q.context.elements.domReference){var Ze;tn(D),(Ze=Q.context.elements.domReference)==null||Ze.dispatchEvent(G);return}}return ve(D)}if(!(!n&&!x&&ne)){if(Pe&&(W.current=p&&Le?null:D.key),p){me&&(tn(D),n?(q.current=tu(a,_e),N(q.current)):r(!0,D.nativeEvent));return}Le&&(d!=null&&(q.current=d),tn(D),!n&&x?r(!0,D.nativeEvent):ve(D),n&&N(q.current))}},onFocus(){n&&N(null)},onPointerDown:Ce,onMouseDown:ke,onClick:ke},floating:{"aria-orientation":P==="both"?void 0:P,...Re,onKeyDown:ve,onPointerMove(){B.current=!0}},item:Ue}},[s,i,S,Ne,k,ee,a,u,P,m,y,n,De,p,d,x,h,T,f,v,N,r,Ue,O,U])}function NI(e,t){t===void 0&&(t={});const{open:n,floatingId:r}=e,{enabled:i=!0,role:s="dialog"}=t,o=ru();return R.useMemo(()=>{const a={id:r,role:s};return i?s==="tooltip"?{reference:{"aria-describedby":n?r:void 0},floating:a}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":s==="alertdialog"?"dialog":s,"aria-controls":n?r:void 0,...s==="listbox"&&{role:"combobox"},...s==="menu"&&{id:o}},floating:{...a,...s==="menu"&&{"aria-labelledby":o}}}:{}},[i,s,n,r,o])}function jI(e,t){var n;const{open:r,dataRef:i}=e,{listRef:s,activeIndex:o,onMatch:a,onTypingChange:l,enabled:c=!0,findMatch:u=null,resetMs:d=750,ignoreKeys:h=[],selectedIndex:f=null}=t,p=R.useRef(),m=R.useRef(""),y=R.useRef((n=f??o)!=null?n:-1),v=R.useRef(null),b=Wr(a),x=Wr(l),I=Zr(u),P=Zr(h);return Bt(()=>{r&&(clearTimeout(p.current),v.current=null,m.current="")},[r]),Bt(()=>{if(r&&m.current===""){var T;y.current=(T=f??o)!=null?T:-1}},[r,f,o]),R.useMemo(()=>{if(!c)return{};function T(F){F?i.current.typing||(i.current.typing=F,x(F)):i.current.typing&&(i.current.typing=F,x(F))}function j(F,O,N){const J=I.current?I.current(O,N):O.find(q=>(q==null?void 0:q.toLocaleLowerCase().indexOf(N.toLocaleLowerCase()))===0);return J?F.indexOf(J):-1}function U(F){const O=s.current;if(m.current.length>0&&m.current[0]!==" "&&(j(O,O,m.current)===-1?T(!1):F.key===" "&&tn(F)),O==null||P.current.includes(F.key)||F.key.length!==1||F.ctrlKey||F.metaKey||F.altKey)return;r&&F.key!==" "&&(tn(F),T(!0)),O.every(W=>{var B,V;return W?((B=W[0])==null?void 0:B.toLocaleLowerCase())!==((V=W[1])==null?void 0:V.toLocaleLowerCase()):!0})&&m.current===F.key&&(m.current="",y.current=v.current),m.current+=F.key,clearTimeout(p.current),p.current=setTimeout(()=>{m.current="",y.current=v.current,T(!1)},d);const J=y.current,q=j(O,[...O.slice((J||0)+1),...O.slice(0,(J||0)+1)],m.current);q!==-1?(b(q),v.current=q):F.key!==" "&&(m.current="",T(!1))}return{reference:{onKeyDown:U},floating:{onKeyDown:U,onKeyUp(F){F.key===" "&&T(!1)}}}},[c,r,i,s,d,P,I,b,x])}const UI=({styles:e,type:t,options:n,label:r,reusable:i})=>{var V,Y,K,pe,k,ee,xe,S,Te,Ne,Ie,je;const{state:s}=mt(),[o,a]=R.useState(!1),[l,c]=R.useState(null),[u,d]=R.useState(null),{client:h}=mt(),f=n.reduce((De,Ue)=>(De[Ue.label]=Ue.value,De),{}),p=f?Object.keys(f):[],m=De=>{a(u!==null&&!i?!1:De)},{refs:y,floatingStyles:v,context:b}=$I({placement:"bottom-start",open:o,onOpenChange:m,whileElementsMounted:VO,middleware:[EO(5),kO({padding:10}),SO({apply({rects:De,elements:Ue,availableHeight:_e}){Object.assign(Ue.floating.style,{maxHeight:`${_e}px`,minWidth:`${De.reference.width}px`})},padding:10})]}),x=R.useRef([]),I=R.useRef(p),P=R.useRef(!1),T=TI(b,{event:"mousedown"}),j=RI(b),U=NI(b,{role:"listbox"}),F=DI(b,{listRef:x,activeIndex:l,selectedIndex:u,onNavigate:c,loop:!0}),O=jI(b,{listRef:I,activeIndex:l,selectedIndex:u,onMatch:o?c:d,onTypingChange(De){P.current=De}}),{getReferenceProps:N,getFloatingProps:J,getItemProps:q}=MI([j,U,F,O,T]),W=De=>{d(De),h==null||h.sendMessage(f[p[De]]),a(!1)},B=u!==null?p[u]:void 0;return z.jsxs(z.Fragment,{children:[z.jsxs("div",{tabIndex:0,ref:y.setReference,"aria-labelledby":"select-label","aria-autocomplete":"none","data-disabled":u!==null&&!i?"":void 0,...(Y=(V=e==null?void 0:e[t])==null?void 0:V.button)==null?void 0:Y.container,...N(),children:[z.jsx("span",{...(pe=(K=e==null?void 0:e[t])==null?void 0:K.button)==null?void 0:pe.text,children:B||r||"Select..."}),z.jsx(oT,{...(ee=(k=e==null?void 0:e[t])==null?void 0:k.button)==null?void 0:ee.icon})]}),o&&z.jsx(CI,{children:z.jsx(SI,{context:b,modal:!1,children:z.jsx("div",{ref:y.setFloating,className:(Te=(S=(xe=e==null?void 0:e[t])==null?void 0:xe.content)==null?void 0:S.container)==null?void 0:Te.className,style:{...v,...(je=(Ie=(Ne=e==null?void 0:e[t])==null?void 0:Ne.content)==null?void 0:Ie.container)==null?void 0:je.style},...J(),children:p.map((De,Ue)=>{var _e,ve;return z.jsx("div",{ref:ke=>{x.current[Ue]=ke},role:"option",tabIndex:Ue===l?0:-1,"aria-selected":Ue===u&&Ue===l,"data-active":Ue===l?"":void 0,...(ve=(_e=e==null?void 0:e[t])==null?void 0:_e.content)==null?void 0:ve.item,...q({onClick(){s.isReadOnly||W(Ue)},onKeyDown(ke){s.isReadOnly||(ke.key==="Enter"&&(ke.preventDefault(),W(Ue)),ke.key===" "&&!P.current&&(ke.preventDefault(),W(Ue)))}}),children:De},De)})})})})]})},FI=_.forwardRef(({type:e,title:t,styles:n,url:r,...i},s)=>{var o,a,l;return z.jsxs("a",{...i,...(o=n==null?void 0:n[e])==null?void 0:o.container,href:r,download:!0,ref:s,children:[z.jsx("p",{...(a=n==null?void 0:n[e])==null?void 0:a.title,children:t||r}),z.jsx(lT,{...(l=n==null?void 0:n[e])==null?void 0:l.icon})]})}),uu={text:CE,button:SE,bubble:OE,audio:QS,column:fT,file:FI,image:JS,location:dT,row:hT,video:YS,carousel:sO,dropdown:UI},Wi=({block:e,styles:t,...n})=>{const r=uu[e.type];return z.jsx(r,{...n,...e,styles:t})},Tm=e=>{let t;const n=new Set,r=(l,c)=>{const u=typeof l=="function"?l(t):l;if(!Object.is(u,t)){const d=t;t=c??typeof u!="object"?u:Object.assign({},t,u),n.forEach(h=>h(t,d))}},i=()=>t,a={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{n.clear()}};return t=e(r,i,a),a},BI=e=>e?Tm(e):Tm;var du={exports:{}},fu={},wa={exports:{}},hu={};/**
|
|
237
237
|
* @license React
|
|
238
238
|
* use-sync-external-store-shim.production.min.js
|
|
239
239
|
*
|
|
@@ -241,7 +241,7 @@ to {
|
|
|
241
241
|
*
|
|
242
242
|
* This source code is licensed under the MIT license found in the
|
|
243
243
|
* LICENSE file in the root directory of this source tree.
|
|
244
|
-
*/var
|
|
244
|
+
*/var Om;function VI(){if(Om)return hu;Om=1;var e=_;function t(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,s=e.useLayoutEffect,o=e.useDebugValue;function a(d,h){var f=h(),p=r({inst:{value:f,getSnapshot:h}}),m=p[0].inst,y=p[1];return s(function(){m.value=f,m.getSnapshot=h,l(m)&&y({inst:m})},[d,f,h]),i(function(){return l(m)&&y({inst:m}),d(function(){l(m)&&y({inst:m})})},[d]),o(f),f}function l(d){var h=d.getSnapshot;d=d.value;try{var f=h();return!n(d,f)}catch{return!0}}function c(d,h){return h()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return hu.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,hu}var pu={};/**
|
|
245
245
|
* @license React
|
|
246
246
|
* use-sync-external-store-shim.development.js
|
|
247
247
|
*
|
|
@@ -249,7 +249,7 @@ to {
|
|
|
249
249
|
*
|
|
250
250
|
* This source code is licensed under the MIT license found in the
|
|
251
251
|
* LICENSE file in the root directory of this source tree.
|
|
252
|
-
*/var
|
|
252
|
+
*/var Im;function zI(){return Im||(Im=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=_,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(x){{for(var I=arguments.length,P=new Array(I>1?I-1:0),T=1;T<I;T++)P[T-1]=arguments[T];r("error",x,P)}}function r(x,I,P){{var T=t.ReactDebugCurrentFrame,j=T.getStackAddendum();j!==""&&(I+="%s",P=P.concat([j]));var U=P.map(function(F){return String(F)});U.unshift("Warning: "+I),Function.prototype.apply.call(console[x],console,U)}}function i(x,I){return x===I&&(x!==0||1/x===1/I)||x!==x&&I!==I}var s=typeof Object.is=="function"?Object.is:i,o=e.useState,a=e.useEffect,l=e.useLayoutEffect,c=e.useDebugValue,u=!1,d=!1;function h(x,I,P){u||e.startTransition!==void 0&&(u=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var T=I();if(!d){var j=I();s(T,j)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}var U=o({inst:{value:T,getSnapshot:I}}),F=U[0].inst,O=U[1];return l(function(){F.value=T,F.getSnapshot=I,f(F)&&O({inst:F})},[x,T,I]),a(function(){f(F)&&O({inst:F});var N=function(){f(F)&&O({inst:F})};return x(N)},[x]),c(T),T}function f(x){var I=x.getSnapshot,P=x.value;try{var T=I();return!s(P,T)}catch{return!0}}function p(x,I,P){return I()}var m=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",y=!m,v=y?p:h,b=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v;pu.useSyncExternalStore=b,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),pu}var Pm;function Am(){return Pm||(Pm=1,process.env.NODE_ENV==="production"?wa.exports=VI():wa.exports=zI()),wa.exports}/**
|
|
253
253
|
* @license React
|
|
254
254
|
* use-sync-external-store-shim/with-selector.production.min.js
|
|
255
255
|
*
|
|
@@ -257,7 +257,7 @@ to {
|
|
|
257
257
|
*
|
|
258
258
|
* This source code is licensed under the MIT license found in the
|
|
259
259
|
* LICENSE file in the root directory of this source tree.
|
|
260
|
-
*/var
|
|
260
|
+
*/var Rm;function ZI(){if(Rm)return fu;Rm=1;var e=_,t=Am();function n(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,s=e.useRef,o=e.useEffect,a=e.useMemo,l=e.useDebugValue;return fu.useSyncExternalStoreWithSelector=function(c,u,d,h,f){var p=s(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=a(function(){function v(T){if(!b){if(b=!0,x=T,T=h(T),f!==void 0&&m.hasValue){var j=m.value;if(f(j,T))return I=j}return I=T}if(j=I,r(x,T))return j;var U=h(T);return f!==void 0&&f(j,U)?j:(x=T,I=U)}var b=!1,x,I,P=d===void 0?null:d;return[function(){return v(u())},P===null?void 0:function(){return v(P())}]},[u,d,h,f]);var y=i(c,p[0],p[1]);return o(function(){m.hasValue=!0,m.value=y},[y]),l(y),y},fu}var mu={};/**
|
|
261
261
|
* @license React
|
|
262
262
|
* use-sync-external-store-shim/with-selector.development.js
|
|
263
263
|
*
|
|
@@ -265,28 +265,28 @@ to {
|
|
|
265
265
|
*
|
|
266
266
|
* This source code is licensed under the MIT license found in the
|
|
267
267
|
* LICENSE file in the root directory of this source tree.
|
|
268
|
-
*/var
|
|
268
|
+
*/var $m;function WI(){return $m||($m=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=_,t=Am();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,s=e.useRef,o=e.useEffect,a=e.useMemo,l=e.useDebugValue;function c(u,d,h,f,p){var m=s(null),y;m.current===null?(y={hasValue:!1,value:null},m.current=y):y=m.current;var v=a(function(){var P=!1,T,j,U=function(J){if(!P){P=!0,T=J;var q=f(J);if(p!==void 0&&y.hasValue){var W=y.value;if(p(W,q))return j=W,W}return j=q,q}var B=T,V=j;if(r(B,J))return V;var Y=f(J);return p!==void 0&&p(V,Y)?V:(T=J,j=Y,Y)},F=h===void 0?null:h,O=function(){return U(d())},N=F===null?void 0:function(){return U(F())};return[O,N]},[d,h,f,p]),b=v[0],x=v[1],I=i(u,b,x);return o(function(){y.hasValue=!0,y.value=I},[I]),l(I),I}mu.useSyncExternalStoreWithSelector=c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),mu}process.env.NODE_ENV==="production"?du.exports=ZI():du.exports=WI();var HI=du.exports;const qI=ai(HI),{useSyncExternalStoreWithSelector:KI}=qI;let IF=!1;function JI(e,t=e.getState,n){const r=KI(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return _.useDebugValue(r),r}const Mm=e=>{const t=typeof e=="function"?BI(e):e,n=(r,i)=>JI(t,r,i);return Object.assign(n,t),n},GI=e=>e?Mm(e):Mm,gu=new Map,xa=e=>{const t=gu.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([n,r])=>[n,r.getState()])):{}},YI=(e,t,n)=>{if(e===void 0)return{type:"untracked",connection:t.connect(n)};const r=gu.get(n.name);if(r)return{type:"tracked",store:e,...r};const i={connection:t.connect(n),stores:{}};return gu.set(n.name,i),{type:"tracked",store:e,...i}},QI=(e,t={})=>(n,r,i)=>{const{enabled:s,anonymousActionType:o,store:a,...l}=t;let c;try{c=(s??!1)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return e(n,r,i);const{connection:u,...d}=YI(a,c,l);let h=!0;i.setState=(m,y,v)=>{const b=n(m,y);if(!h)return b;const x=v===void 0?{type:o||"anonymous"}:typeof v=="string"?{type:v}:v;return a===void 0?(u==null||u.send(x,r()),b):(u==null||u.send({...x,type:`${a}/${x.type}`},{...xa(l.name),[a]:i.getState()}),b)};const f=(...m)=>{const y=h;h=!1,n(...m),h=y},p=e(i.setState,r,i);if(d.type==="untracked"?u==null||u.init(p):(d.stores[d.store]=i,u==null||u.init(Object.fromEntries(Object.entries(d.stores).map(([m,y])=>[m,m===d.store?p:y.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let m=!1;const y=i.dispatch;i.dispatch=(...v)=>{y(...v)}}return u.subscribe(m=>{var y;switch(m.type){case"ACTION":if(typeof m.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return yu(m.payload,v=>{if(v.type==="__setState"){if(a===void 0){f(v.state);return}Object.keys(v.state).length!==1&&console.error(`
|
|
269
269
|
[zustand devtools middleware] Unsupported __setState action format.
|
|
270
270
|
When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
|
|
271
271
|
and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
|
|
272
|
-
`);const b=v.state[a];if(b==null)return;JSON.stringify(i.getState())!==JSON.stringify(b)&&f(b);return}i.dispatchFromDevtools&&typeof i.dispatch=="function"&&i.dispatch(v)});case"DISPATCH":switch(m.payload.type){case"RESET":return f(p),a===void 0?u==null?void 0:u.init(i.getState()):u==null?void 0:u.init(da(l.name));case"COMMIT":if(a===void 0){u==null||u.init(i.getState());return}return u==null?void 0:u.init(da(l.name));case"ROLLBACK":return ou(m.state,v=>{if(a===void 0){f(v),u==null||u.init(i.getState());return}f(v[a]),u==null||u.init(da(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return ou(m.state,v=>{if(a===void 0){f(v);return}JSON.stringify(i.getState())!==JSON.stringify(v[a])&&f(v[a])});case"IMPORT_STATE":{const{nextLiftedState:v}=m.payload,b=(y=v.computedStates.slice(-1)[0])==null?void 0:y.state;if(!b)return;f(a===void 0?b:b[a]),u==null||u.send(null,v);return}case"PAUSE_RECORDING":return h=!h}return}}),p},ou=(e,t)=>{let n;try{n=JSON.parse(e)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&t(n)};function tI(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var s;const o=l=>l===null?null:JSON.parse(l,t==null?void 0:t.reviver),a=(s=n.getItem(i))!=null?s:null;return a instanceof Promise?a.then(o):o(a)},setItem:(i,s)=>n.setItem(i,JSON.stringify(s,t==null?void 0:t.replacer)),removeItem:i=>n.removeItem(i)}}const Ls=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Ls(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Ls(r)(n)}}}},nI=(e,t)=>(n,r,i)=>{let s={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:y=>y,version:0,merge:(y,v)=>({...v,...y}),...t},o=!1;const a=new Set,l=new Set;let c;try{c=s.getStorage()}catch{}if(!c)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...y)},r,i);const u=Ls(s.serialize),d=()=>{const y=s.partialize({...r()});let v;const b=u({state:y,version:s.version}).then(x=>c.setItem(s.name,x)).catch(x=>{v=x});if(v)throw v;return b},h=i.setState;i.setState=(y,v)=>{h(y,v),d()};const f=e((...y)=>{n(...y),d()},r,i);let p;const m=()=>{var y;if(!c)return;o=!1,a.forEach(b=>b(r()));const v=((y=s.onRehydrateStorage)==null?void 0:y.call(s,r()))||void 0;return Ls(c.getItem.bind(c))(s.name).then(b=>{if(b)return s.deserialize(b)}).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==s.version){if(s.migrate)return s.migrate(b.state,b.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return b.state}).then(b=>{var x;return p=s.merge(b,(x=r())!=null?x:f),n(p,!0),d()}).then(()=>{v==null||v(p,void 0),o=!0,l.forEach(b=>b(p))}).catch(b=>{v==null||v(void 0,b)})};return i.persist={setOptions:y=>{s={...s,...y},y.getStorage&&(c=y.getStorage())},clearStorage:()=>{c==null||c.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>m(),hasHydrated:()=>o,onHydrate:y=>(a.add(y),()=>{a.delete(y)}),onFinishHydration:y=>(l.add(y),()=>{l.delete(y)})},m(),p||f},rI=(e,t)=>(n,r,i)=>{let s={storage:tI(()=>localStorage),partialize:m=>m,version:0,merge:(m,y)=>({...y,...m}),...t},o=!1;const a=new Set,l=new Set;let c=s.storage;if(!c)return e((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...m)},r,i);const u=()=>{const m=s.partialize({...r()});return c.setItem(s.name,{state:m,version:s.version})},d=i.setState;i.setState=(m,y)=>{d(m,y),u()};const h=e((...m)=>{n(...m),u()},r,i);let f;const p=()=>{var m,y;if(!c)return;o=!1,a.forEach(b=>{var x;return b((x=r())!=null?x:h)});const v=((y=s.onRehydrateStorage)==null?void 0:y.call(s,(m=r())!=null?m:h))||void 0;return Ls(c.getItem.bind(c))(s.name).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==s.version){if(s.migrate)return s.migrate(b.state,b.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return b.state}).then(b=>{var x;return f=s.merge(b,(x=r())!=null?x:h),n(f,!0),u()}).then(()=>{v==null||v(f,void 0),f=r(),o=!0,l.forEach(b=>b(f))}).catch(b=>{v==null||v(void 0,b)})};return i.persist={setOptions:m=>{s={...s,...m},m.storage&&(c=m.storage)},clearStorage:()=>{c==null||c.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>p(),hasHydrated:()=>o,onHydrate:m=>(a.add(m),()=>{a.delete(m)}),onFinishHydration:m=>(l.add(m),()=>{l.delete(m)})},s.skipHydration||p(),f||h},iI=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?nI(e,t):rI(e,t),Br=QO()(eI(iI((e,t)=>({messageHistory:{},addMessageToHistory:({userId:n,message:r})=>e(i=>({...i,messageHistory:{...i.messageHistory,[n]:[r,...(i.messageHistory[n]??[]).slice(0,100)]}})),clientMode:"",setClientMode:n=>{const{clearAll:r,clientMode:i}=t();i!==n&&r(),e(s=>({...s,clientMode:n}))},setUser:n=>e(r=>({...r,user:n})),setConversationId:n=>e(r=>({...r,conversationId:n})),clearAll:()=>{e(n=>({...n,messageHistory:{},user:void 0,conversationId:void 0}))}}),{name:"botpress-webchat"})));var An=function(){return An=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},An.apply(this,arguments)};function _m(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function sI(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function oI(){var e=_.useRef(!1),t=_.useCallback(function(){return e.current},[]);return _.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}function aI(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=_.useRef(0),i=oI(),s=_.useState(n),o=s[0],a=s[1],l=_.useCallback(function(){for(var c=[],u=0;u<arguments.length;u++)c[u]=arguments[u];var d=++r.current;return o.loading||a(function(h){return An(An({},h),{loading:!0})}),e.apply(void 0,c).then(function(h){return i()&&d===r.current&&a({value:h,loading:!1}),h},function(h){return i()&&d===r.current&&a({error:h,loading:!1}),h})},t);return[o,l]}function au(e,t){t===void 0&&(t=[]);var n=aI(e,t,{loading:!0}),r=n[0],i=n[1];return _.useEffect(function(){i()},[i]),r}function lI(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function cI(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var uI=function(e){_.useEffect(e,[])};const hi=uI;var dI=function(e){hi(function(){e()})};const fI=dI;var hI=function(e){var t=_.useRef(e);t.current=e,hi(function(){return function(){return t.current()}})};const pI=hI;var mI=function(e){var t=_.useRef(0),n=_.useState(e),r=n[0],i=n[1],s=_.useCallback(function(o){cancelAnimationFrame(t.current),t.current=requestAnimationFrame(function(){i(o)})},[]);return pI(function(){cancelAnimationFrame(t.current)}),[r,s]};const gI=mI;var yI=function(e){process.env.NODE_ENV==="development"&&(typeof e!="object"||typeof e.current>"u")&&console.error("`useScroll` expects a single ref argument.");var t=gI({x:0,y:0}),n=t[0],r=t[1];return _.useEffect(function(){var i=function(){e.current&&r({x:e.current.scrollLeft,y:e.current.scrollTop})};return e.current&&lI(e.current,"scroll",i,{capture:!1,passive:!0}),function(){e.current&&cI(e.current,"scroll",i)}},[e]),n};const vI=yI,bI=e=>{const t=new Date;return e.getTime()-t.getTime()},wI=(e=bI)=>{const[t,n]=_.useState(0),[r,i]=_.useState(),s=()=>n(o=>o+1);return au(async()=>{if(r){const o=setTimeout(s,e(r));return()=>{clearTimeout(o)}}},[r]),[t,i]};var km={},lu={},Cm={};Object.defineProperty(Cm,"__esModule",{value:!0});var fa={},xI=Me&&Me.__awaiter||function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(fa,"__esModule",{value:!0}),fa.Emitter=void 0;let _I=class{constructor(){this.listeners={}}on(t,n,r=!1){const i=this.listeners[t];i?r?i.unshift(n):i.push(n):this.listeners[t]=[n]}emit(t,n){return xI(this,void 0,void 0,function*(){const r=this.listeners[t];if(r!=null&&r.length){for(const i of r)yield i(n);return!0}else return!1})}};fa.Emitter=_I;var Em={};Object.defineProperty(Em,"__esModule",{value:!0});var Sm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.HealthEventType=void 0,function(t){t.Create="create",t.Configure="configure",t.Start="start",t.StartFailure="start-failure",t.Initialize="initialize",t.InitializeFailure="initialize-failure",t.Sleep="sleep",t.Delete="delete"}(e.HealthEventType||(e.HealthEventType={}))})(Sm);var Tm={};Object.defineProperty(Tm,"__esModule",{value:!0});var Om={};Object.defineProperty(Om,"__esModule",{value:!0});var Im={};Object.defineProperty(Im,"__esModule",{value:!0});var Pm={};Object.defineProperty(Pm,"__esModule",{value:!0}),function(e){var t=Me&&Me.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s),Object.defineProperty(r,o,{enumerable:!0,get:function(){return i[s]}})}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=Me&&Me.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,r,s)};Object.defineProperty(e,"__esModule",{value:!0}),n(Cm,e),n(fa,e),n(Em,e),n(Sm,e),n(Tm,e),n(Om,e),n(Im,e),n(Pm,e)}(lu);var ha={},Am={},cu={exports:{}},pa={},uu={},ma={},Ds={},Fi={},pi={},Bi={},Vi={},Gn={};Object.defineProperty(Gn,"__esModule",{value:!0}),Gn.ERROR_PACKET=Gn.PACKET_TYPES_REVERSE=Gn.PACKET_TYPES=void 0;const Yn=Object.create(null);Gn.PACKET_TYPES=Yn,Yn.open="0",Yn.close="1",Yn.ping="2",Yn.pong="3",Yn.message="4",Yn.upgrade="5",Yn.noop="6";const Rm=Object.create(null);Gn.PACKET_TYPES_REVERSE=Rm,Object.keys(Yn).forEach(e=>{Rm[Yn[e]]=e});const kI={type:"error",data:"parser error"};Gn.ERROR_PACKET=kI,Object.defineProperty(Vi,"__esModule",{value:!0}),Vi.encodePacket=Vi.encodePacketToBinary=void 0;const CI=Gn,$m=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Mm=typeof ArrayBuffer=="function",Lm=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Dm=({type:e,data:t},n,r)=>$m&&t instanceof Blob?n?r(t):Nm(t,r):Mm&&(t instanceof ArrayBuffer||Lm(t))?n?r(t):Nm(new Blob([t]),r):r(CI.PACKET_TYPES[e]+(t||""));Vi.encodePacket=Dm;const Nm=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function jm(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let du;function EI(e,t){if($m&&e.data instanceof Blob)return e.data.arrayBuffer().then(jm).then(t);if(Mm&&(e.data instanceof ArrayBuffer||Lm(e.data)))return t(jm(e.data));Dm(e,!1,n=>{du||(du=new TextEncoder),t(du.encode(n))})}Vi.encodePacketToBinary=EI;var ga={},zi={};Object.defineProperty(zi,"__esModule",{value:!0}),zi.decode=zi.encode=void 0;const Zi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ns=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Zi.length;e++)Ns[Zi.charCodeAt(e)]=e;const SI=e=>{let t=new Uint8Array(e),n,r=t.length,i="";for(n=0;n<r;n+=3)i+=Zi[t[n]>>2],i+=Zi[(t[n]&3)<<4|t[n+1]>>4],i+=Zi[(t[n+1]&15)<<2|t[n+2]>>6],i+=Zi[t[n+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};zi.encode=SI;const TI=e=>{let t=e.length*.75,n=e.length,r,i=0,s,o,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),u=new Uint8Array(c);for(r=0;r<n;r+=4)s=Ns[e.charCodeAt(r)],o=Ns[e.charCodeAt(r+1)],a=Ns[e.charCodeAt(r+2)],l=Ns[e.charCodeAt(r+3)],u[i++]=s<<2|o>>4,u[i++]=(o&15)<<4|a>>2,u[i++]=(a&3)<<6|l&63;return c};zi.decode=TI,Object.defineProperty(ga,"__esModule",{value:!0}),ga.decodePacket=void 0;const ya=Gn,OI=zi,II=typeof ArrayBuffer=="function",PI=(e,t)=>{if(typeof e!="string")return{type:"message",data:Um(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:AI(e.substring(1),t)}:ya.PACKET_TYPES_REVERSE[n]?e.length>1?{type:ya.PACKET_TYPES_REVERSE[n],data:e.substring(1)}:{type:ya.PACKET_TYPES_REVERSE[n]}:ya.ERROR_PACKET};ga.decodePacket=PI;const AI=(e,t)=>{if(II){const n=(0,OI.decode)(e);return Um(n,t)}else return{base64:!0,data:e}},Um=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decodePayload=e.decodePacket=e.encodePayload=e.encodePacket=e.protocol=e.createPacketDecoderStream=e.createPacketEncoderStream=void 0;const t=Vi;Object.defineProperty(e,"encodePacket",{enumerable:!0,get:function(){return t.encodePacket}});const n=ga;Object.defineProperty(e,"decodePacket",{enumerable:!0,get:function(){return n.decodePacket}});const r=Gn,i=String.fromCharCode(30),s=(h,f)=>{const p=h.length,m=new Array(p);let y=0;h.forEach((v,b)=>{(0,t.encodePacket)(v,!1,x=>{m[b]=x,++y===p&&f(m.join(i))})})};e.encodePayload=s;const o=(h,f)=>{const p=h.split(i),m=[];for(let y=0;y<p.length;y++){const v=(0,n.decodePacket)(p[y],f);if(m.push(v),v.type==="error")break}return m};e.decodePayload=o;function a(){return new TransformStream({transform(h,f){(0,t.encodePacketToBinary)(h,p=>{const m=p.length;let y;if(m<126)y=new Uint8Array(1),new DataView(y.buffer).setUint8(0,m);else if(m<65536){y=new Uint8Array(3);const v=new DataView(y.buffer);v.setUint8(0,126),v.setUint16(1,m)}else{y=new Uint8Array(9);const v=new DataView(y.buffer);v.setUint8(0,127),v.setBigUint64(1,BigInt(m))}h.data&&typeof h.data!="string"&&(y[0]|=128),f.enqueue(y),f.enqueue(p)})}})}e.createPacketEncoderStream=a;let l;function c(h){return h.reduce((f,p)=>f+p.length,0)}function u(h,f){if(h[0].length===f)return h.shift();const p=new Uint8Array(f);let m=0;for(let y=0;y<f;y++)p[y]=h[0][m++],m===h[0].length&&(h.shift(),m=0);return h.length&&m<h[0].length&&(h[0]=h[0].slice(m)),p}function d(h,f){l||(l=new TextDecoder);const p=[];let m=0,y=-1,v=!1;return new TransformStream({transform(b,x){for(p.push(b);;){if(m===0){if(c(p)<1)break;const P=u(p,1);v=(P[0]&128)===128,y=P[0]&127,y<126?m=3:y===126?m=1:m=2}else if(m===1){if(c(p)<2)break;const P=u(p,2);y=new DataView(P.buffer,P.byteOffset,P.length).getUint16(0),m=3}else if(m===2){if(c(p)<8)break;const P=u(p,8),A=new DataView(P.buffer,P.byteOffset,P.length),O=A.getUint32(0);if(O>Math.pow(2,53-32)-1){x.enqueue(r.ERROR_PACKET);break}y=O*Math.pow(2,32)+A.getUint32(4),m=3}else{if(c(p)<y)break;const P=u(p,y);x.enqueue((0,n.decodePacket)(v?P:l.decode(P),f)),m=0}if(y===0||y>h){x.enqueue(r.ERROR_PACKET);break}}}})}e.createPacketDecoderStream=d,e.protocol=4})(Bi);function dn(e){if(e)return RI(e)}function RI(e){for(var t in dn.prototype)e[t]=dn.prototype[t];return e}dn.prototype.on=dn.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},dn.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},dn.prototype.off=dn.prototype.removeListener=dn.prototype.removeAllListeners=dn.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this},dn.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},dn.prototype.emitReserved=dn.prototype.emit,dn.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},dn.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Wi=Cl(Object.freeze(Object.defineProperty({__proto__:null,Emitter:dn},Symbol.toStringTag,{value:"Module"})));var Rn={},mi={};Object.defineProperty(mi,"__esModule",{value:!0}),mi.globalThisShim=void 0,mi.globalThisShim=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())(),Object.defineProperty(Rn,"__esModule",{value:!0}),Rn.byteLength=Rn.installTimerFunctions=Rn.pick=void 0;const Vr=mi;function $I(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}Rn.pick=$I;const MI=Vr.globalThisShim.setTimeout,LI=Vr.globalThisShim.clearTimeout;function DI(e,t){t.useNativeTimers?(e.setTimeoutFn=MI.bind(Vr.globalThisShim),e.clearTimeoutFn=LI.bind(Vr.globalThisShim)):(e.setTimeoutFn=Vr.globalThisShim.setTimeout.bind(Vr.globalThisShim),e.clearTimeoutFn=Vr.globalThisShim.clearTimeout.bind(Vr.globalThisShim))}Rn.installTimerFunctions=DI;const NI=1.33;function jI(e){return typeof e=="string"?UI(e):Math.ceil((e.byteLength||e.size)*NI)}Rn.byteLength=jI;function UI(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}var fu={exports:{}},hu,Fm;function FI(){if(Fm)return hu;Fm=1;var e=1e3,t=e*60,n=t*60,r=n*24,i=r*7,s=r*365.25;hu=function(u,d){d=d||{};var h=typeof u;if(h==="string"&&u.length>0)return o(u);if(h==="number"&&isFinite(u))return d.long?l(u):a(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function o(u){if(u=String(u),!(u.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(d){var h=parseFloat(d[1]),f=(d[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return h*s;case"weeks":case"week":case"w":return h*i;case"days":case"day":case"d":return h*r;case"hours":case"hour":case"hrs":case"hr":case"h":return h*n;case"minutes":case"minute":case"mins":case"min":case"m":return h*t;case"seconds":case"second":case"secs":case"sec":case"s":return h*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return}}}}function a(u){var d=Math.abs(u);return d>=r?Math.round(u/r)+"d":d>=n?Math.round(u/n)+"h":d>=t?Math.round(u/t)+"m":d>=e?Math.round(u/e)+"s":u+"ms"}function l(u){var d=Math.abs(u);return d>=r?c(u,d,r,"day"):d>=n?c(u,d,n,"hour"):d>=t?c(u,d,t,"minute"):d>=e?c(u,d,e,"second"):u+" ms"}function c(u,d,h,f){var p=d>=h*1.5;return Math.round(u/h)+" "+f+(p?"s":"")}return hu}function BI(e){n.debug=n,n.default=n,n.coerce=l,n.disable=s,n.enable=i,n.enabled=o,n.humanize=FI(),n.destroy=c,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let d=0;for(let h=0;h<u.length;h++)d=(d<<5)-d+u.charCodeAt(h),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(u){let d,h=null,f,p;function m(...y){if(!m.enabled)return;const v=m,b=Number(new Date),x=b-(d||b);v.diff=x,v.prev=d,v.curr=b,d=b,y[0]=n.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let P=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(O,U)=>{if(O==="%%")return"%";P++;const F=n.formatters[U];if(typeof F=="function"){const B=y[P];O=F.call(v,B),y.splice(P,1),P--}return O}),n.formatArgs.call(v,y),(v.log||n.log).apply(v,y)}return m.namespace=u,m.useColors=n.useColors(),m.color=n.selectColor(u),m.extend=r,m.destroy=n.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(f!==n.namespaces&&(f=n.namespaces,p=n.enabled(u)),p),set:y=>{h=y}}),typeof n.init=="function"&&n.init(m),m}function r(u,d){const h=n(this.namespace+(typeof d>"u"?":":d)+u);return h.log=this.log,h}function i(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let d;const h=(typeof u=="string"?u:"").split(/[\s,]+/),f=h.length;for(d=0;d<f;d++)h[d]&&(u=h[d].replace(/\*/g,".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.slice(1)+"$")):n.names.push(new RegExp("^"+u+"$")))}function s(){const u=[...n.names.map(a),...n.skips.map(a).map(d=>"-"+d)].join(",");return n.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let d,h;for(d=0,h=n.skips.length;d<h;d++)if(n.skips[d].test(u))return!1;for(d=0,h=n.names.length;d<h;d++)if(n.names[d].test(u))return!0;return!1}function a(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function l(u){return u instanceof Error?u.stack||u.message:u}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var VI=BI;(function(e,t){t.formatArgs=r,t.save=i,t.load=s,t.useColors=n,t.storage=o(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;l.splice(1,0,c,"color: inherit");let u=0,d=0;l[0].replace(/%[a-zA-Z%]/g,h=>{h!=="%%"&&(u++,h==="%c"&&(d=u))}),l.splice(d,0,c)}t.log=console.debug||console.log||(()=>{});function i(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function s(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof process<"u"&&"env"in process&&(l=process.env.DEBUG),l}function o(){try{return localStorage}catch{}}e.exports=VI(t);const{formatters:a}=e.exports;a.j=function(l){try{return JSON.stringify(l)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}})(fu,fu.exports);var Qn=fu.exports,gi={};Object.defineProperty(gi,"__esModule",{value:!0}),gi.decode=gi.encode=void 0;function zI(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}gi.encode=zI;function ZI(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}gi.decode=ZI;var WI=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pi,"__esModule",{value:!0}),pi.Transport=void 0;const HI=Bi,qI=Wi,KI=Rn,JI=WI(Qn),GI=gi,YI=(0,JI.default)("engine.io-client:transport");class QI extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class XI extends qI.Emitter{constructor(t){super(),this.writable=!1,(0,KI.installTimerFunctions)(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new QI(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"?this.write(t):YI("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=(0,HI.decodePacket)(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=(0,GI.encode)(t);return n.length?"?"+n:""}}pi.Transport=XI;var vr={};Object.defineProperty(vr,"__esModule",{value:!0}),vr.yeast=vr.decode=vr.encode=void 0;const Bm="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),va=64,Vm={};let zm=0,zr=0,Zm;function pu(e){let t="";do t=Bm[e%va]+t,e=Math.floor(e/va);while(e>0);return t}vr.encode=pu;function eP(e){let t=0;for(zr=0;zr<e.length;zr++)t=t*va+Vm[e.charAt(zr)];return t}vr.decode=eP;function tP(){const e=pu(+new Date);return e!==Zm?(zm=0,Zm=e):e+"."+pu(zm++)}for(vr.yeast=tP;zr<va;zr++)Vm[Bm[zr]]=zr;var Hi={},ba={};Object.defineProperty(ba,"__esModule",{value:!0}),ba.hasCORS=void 0;let Wm=!1;try{Wm=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}ba.hasCORS=Wm,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.createCookieJar=Hi.XHR=void 0;const nP=ba,rP=mi;function iP(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||nP.hasCORS))return new XMLHttpRequest}catch{}if(!t)try{return new rP.globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}Hi.XHR=iP;function sP(){}Hi.createCookieJar=sP;var oP=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.Request=Fi.Polling=void 0;const aP=pi,lP=oP(Qn),cP=vr,Hm=Bi,mu=Hi,uP=Wi,qm=Rn,dP=mi,yn=(0,lP.default)("engine.io-client:polling");function fP(){}const hP=function(){return new mu.XHR({xdomain:!1}).responseType!=null}();class pP extends aP.Transport{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port}const n=t&&t.forceBase64;this.supportsBinary=hP&&!n,this.opts.withCredentials&&(this.cookieJar=(0,mu.createCookieJar)())}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{yn("paused"),this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(yn("we are currently polling - waiting to pause"),r++,this.once("pollComplete",function(){yn("pre-pause polling complete"),--r||n()})),this.writable||(yn("we are currently writing - waiting to pause"),r++,this.once("drain",function(){yn("pre-pause writing complete"),--r||n()}))}else n()}poll(){yn("polling"),this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){yn("polling got data %s",t);const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};(0,Hm.decodePayload)(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"?this.poll():yn('ignoring poll - transport state "%s"',this.readyState))}doClose(){const t=()=>{yn("writing close packet"),this.write([{type:"close"}])};this.readyState==="open"?(yn("transport open - closing"),t()):(yn("transport not open - deferring close"),this.once("open",t))}write(t){this.writable=!1,(0,Hm.encodePayload)(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=(0,cP.yeast)()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Un(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){yn("xhr poll");const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}Fi.Polling=pP;class Un extends uP.Emitter{constructor(t,n){super(),(0,qm.installTimerFunctions)(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.data=n.data!==void 0?n.data:null,this.create()}create(){var t;const n=(0,qm.pick)(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new mu.XHR(n);try{yn("xhr open %s: %s",this.method,this.uri),r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},yn("xhr data %s",this.data),r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=Un.requestsCount++,Un.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=fP,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Un.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(Fi.Request=Un,Un.requestsCount=0,Un.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Km);else if(typeof addEventListener=="function"){const e="onpagehide"in dP.globalThisShim?"pagehide":"unload";addEventListener(e,Km,!1)}}function Km(){for(let e in Un.requests)Un.requests.hasOwnProperty(e)&&Un.requests[e].abort()}var wa={},Cn={};Object.defineProperty(Cn,"__esModule",{value:!0}),Cn.defaultBinaryType=Cn.usingBrowserWebSocket=Cn.WebSocket=Cn.nextTick=void 0;const Jm=mi;Cn.nextTick=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),Cn.WebSocket=Jm.globalThisShim.WebSocket||Jm.globalThisShim.MozWebSocket,Cn.usingBrowserWebSocket=!0,Cn.defaultBinaryType="arraybuffer";var mP=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wa,"__esModule",{value:!0}),wa.WS=void 0;const gP=pi,yP=vr,vP=Rn,Zr=Cn,bP=mP(Qn),wP=Bi,xP=(0,bP.default)("engine.io-client:websocket"),Gm=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class _P extends gP.Transport{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=Gm?{}:(0,vP.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=Zr.usingBrowserWebSocket&&!Gm?n?new Zr.WebSocket(t,n):new Zr.WebSocket(t):new Zr.WebSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;(0,wP.encodePacket)(r,this.supportsBinary,s=>{const o={};Zr.usingBrowserWebSocket||(r.options&&(o.compress=r.options.compress),this.opts.perMessageDeflate&&(typeof s=="string"?Buffer.byteLength(s):s.length)<this.opts.perMessageDeflate.threshold&&(o.compress=!1));try{Zr.usingBrowserWebSocket?this.ws.send(s):this.ws.send(s,o)}catch{xP("websocket closed before onclose event")}i&&(0,Zr.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=(0,yP.yeast)()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!Zr.WebSocket}}wa.WS=_P;var xa={},kP=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(xa,"__esModule",{value:!0}),xa.WT=void 0;const CP=pi,EP=Cn,Ym=Bi,js=(0,kP(Qn).default)("engine.io-client:webtransport");class SP extends CP.Transport{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{js("transport closed gracefully"),this.onClose()}).catch(t=>{js("transport closed due to %s",t),this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const n=(0,Ym.createPacketDecoderStream)(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=(0,Ym.createPacketEncoderStream)();i.readable.pipeTo(t.writable),this.writer=i.writable.getWriter();const s=()=>{r.read().then(({done:a,value:l})=>{if(a){js("session is closed");return}js("received chunk: %o",l),this.onPacket(l),s()}).catch(a=>{js("an error occurred while reading: %s",a)})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.writer.write(o).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this.writer.write(r).then(()=>{i&&(0,EP.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}}xa.WT=SP,Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.transports=void 0;const TP=Fi,OP=wa,IP=xa;Ds.transports={websocket:OP.WS,webtransport:IP.WT,polling:TP.Polling};var Us={};Object.defineProperty(Us,"__esModule",{value:!0}),Us.parse=void 0;const PP=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,AP=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function RP(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=PP.exec(e||""),s={},o=14;for(;o--;)s[AP[o]]=i[o]||"";return n!=-1&&r!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=$P(s,s.path),s.queryKey=MP(s,s.query),s}Us.parse=RP;function $P(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function MP(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}var LP=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ma,"__esModule",{value:!0}),ma.Socket=void 0;const DP=Ds,Qm=Rn,NP=gi,Xm=Us,jP=LP(Qn),UP=Wi,eg=Bi,FP=Cn,_t=(0,jP.default)("engine.io-client:socket");let tg=class ds extends UP.Emitter{constructor(t,n={}){super(),this.binaryType=FP.defaultBinaryType,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=(0,Xm.parse)(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=(0,Xm.parse)(n.host).host),(0,Qm.installTimerFunctions)(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=(0,NP.decode)(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){_t('creating transport "%s"',t);const n=Object.assign({},this.opts.query);n.EIO=eg.protocol,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return _t("options: %j",r),new DP.transports[t](r)}open(){let t;if(this.opts.rememberUpgrade&&ds.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch(n){_t("error while creating transport: %s",n),this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){_t("setting transport %s",t.name),this.transport&&(_t("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){_t('probing transport "%s"',t);let n=this.createTransport(t),r=!1;ds.priorWebsocketSuccess=!1;const i=()=>{r||(_t('probe transport "%s" opened',t),n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(_t('probe transport "%s" pong',t),this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;ds.priorWebsocketSuccess=n.name==="websocket",_t('pausing current transport "%s"',this.transport.name),this.transport.pause(()=>{r||this.readyState!=="closed"&&(_t("changing transport and sending upgrade packet"),u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{_t('probe transport "%s" failed',t);const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function s(){r||(r=!0,u(),n.close(),n=null)}const o=d=>{const h=new Error("probe error: "+d);h.transport=n.name,s(),_t('probe transport "%s" failed because of error: %s',t,d),this.emitReserved("upgradeError",h)};function a(){o("transport closed")}function l(){o("socket closed")}function c(d){n&&d.name!==n.name&&(_t('"%s" works - aborting "%s"',d.name,n.name),s())}const u=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",c),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(_t("socket open"),this.readyState="open",ds.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){_t("starting upgrade probes");let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(_t('socket receive: type "%s", data "%s"',t.type,t.data),this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}else _t('packet received with socket readyState "%s"',this.readyState)}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();_t("flushing %d packets in socket",t.length),this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=(0,Qm.byteLength)(i)),r>0&&n>this.maxPayload)return _t("only send %d out of %d packets",r,this.writeBuffer.length),this.writeBuffer.slice(0,r);n+=2}return _t("payload size is %d (max: %d)",n,this.maxPayload),this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:t,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),_t("socket closing - telling transport to close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){_t("socket error %j",t),ds.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(_t('socket close with reason: "%s"',t),this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};ma.Socket=tg,tg.protocol=eg.protocol,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.nextTick=e.parse=e.installTimerFunctions=e.transports=e.Transport=e.protocol=e.Socket=void 0;const t=ma;Object.defineProperty(e,"Socket",{enumerable:!0,get:function(){return t.Socket}}),e.protocol=t.Socket.protocol;var n=pi;Object.defineProperty(e,"Transport",{enumerable:!0,get:function(){return n.Transport}});var r=Ds;Object.defineProperty(e,"transports",{enumerable:!0,get:function(){return r.transports}});var i=Rn;Object.defineProperty(e,"installTimerFunctions",{enumerable:!0,get:function(){return i.installTimerFunctions}});var s=Us;Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return s.parse}});var o=Cn;Object.defineProperty(e,"nextTick",{enumerable:!0,get:function(){return o.nextTick}})}(uu);var BP=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(pa,"__esModule",{value:!0}),pa.url=void 0;const VP=uu,ng=BP(Qn).default("socket.io-client:url");function zP(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(ng("protocol-less url %s",e),typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),ng("parse %s",e),r=VP.parse(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}pa.url=zP;var _a={},Fs={},ka={},qi={},yi={};Object.defineProperty(yi,"__esModule",{value:!0}),yi.hasBinary=yi.isBinary=void 0;const ZP=typeof ArrayBuffer=="function",WP=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,rg=Object.prototype.toString,HP=typeof Blob=="function"||typeof Blob<"u"&&rg.call(Blob)==="[object BlobConstructor]",qP=typeof File=="function"||typeof File<"u"&&rg.call(File)==="[object FileConstructor]";function ig(e){return ZP&&(e instanceof ArrayBuffer||WP(e))||HP&&e instanceof Blob||qP&&e instanceof File}yi.isBinary=ig;function Ca(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Ca(e[n]))return!0;return!1}if(ig(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Ca(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Ca(e[n]))return!0;return!1}yi.hasBinary=Ca,Object.defineProperty(qi,"__esModule",{value:!0}),qi.reconstructPacket=qi.deconstructPacket=void 0;const KP=yi;function JP(e){const t=[],n=e.data,r=e;return r.data=gu(n,t),r.attachments=t.length,{packet:r,buffers:t}}qi.deconstructPacket=JP;function gu(e,t){if(!e)return e;if((0,KP.isBinary)(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=gu(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=gu(e[r],t));return n}return e}function GP(e,t){return e.data=yu(e.data,t),delete e.attachments,e}qi.reconstructPacket=GP;function yu(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=yu(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=yu(e[n],t));return e}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Decoder=e.Encoder=e.PacketType=e.protocol=void 0;const t=Wi,n=qi,r=yi,s=(0,Qn.default)("socket.io-parser"),o=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];e.protocol=5;var a;(function(h){h[h.CONNECT=0]="CONNECT",h[h.DISCONNECT=1]="DISCONNECT",h[h.EVENT=2]="EVENT",h[h.ACK=3]="ACK",h[h.CONNECT_ERROR=4]="CONNECT_ERROR",h[h.BINARY_EVENT=5]="BINARY_EVENT",h[h.BINARY_ACK=6]="BINARY_ACK"})(a=e.PacketType||(e.PacketType={}));class l{constructor(f){this.replacer=f}encode(f){return s("encoding packet %j",f),(f.type===a.EVENT||f.type===a.ACK)&&(0,r.hasBinary)(f)?this.encodeAsBinary({type:f.type===a.EVENT?a.BINARY_EVENT:a.BINARY_ACK,nsp:f.nsp,data:f.data,id:f.id}):[this.encodeAsString(f)]}encodeAsString(f){let p=""+f.type;return(f.type===a.BINARY_EVENT||f.type===a.BINARY_ACK)&&(p+=f.attachments+"-"),f.nsp&&f.nsp!=="/"&&(p+=f.nsp+","),f.id!=null&&(p+=f.id),f.data!=null&&(p+=JSON.stringify(f.data,this.replacer)),s("encoded %j as %s",f,p),p}encodeAsBinary(f){const p=(0,n.deconstructPacket)(f),m=this.encodeAsString(p.packet),y=p.buffers;return y.unshift(m),y}}e.Encoder=l;function c(h){return Object.prototype.toString.call(h)==="[object Object]"}class u extends t.Emitter{constructor(f){super(),this.reviver=f}add(f){let p;if(typeof f=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");p=this.decodeString(f);const m=p.type===a.BINARY_EVENT;m||p.type===a.BINARY_ACK?(p.type=m?a.EVENT:a.ACK,this.reconstructor=new d(p),p.attachments===0&&super.emitReserved("decoded",p)):super.emitReserved("decoded",p)}else if((0,r.isBinary)(f)||f.base64)if(this.reconstructor)p=this.reconstructor.takeBinaryData(f),p&&(this.reconstructor=null,super.emitReserved("decoded",p));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+f)}decodeString(f){let p=0;const m={type:Number(f.charAt(0))};if(a[m.type]===void 0)throw new Error("unknown packet type "+m.type);if(m.type===a.BINARY_EVENT||m.type===a.BINARY_ACK){const v=p+1;for(;f.charAt(++p)!=="-"&&p!=f.length;);const b=f.substring(v,p);if(b!=Number(b)||f.charAt(p)!=="-")throw new Error("Illegal attachments");m.attachments=Number(b)}if(f.charAt(p+1)==="/"){const v=p+1;for(;++p&&!(f.charAt(p)===","||p===f.length););m.nsp=f.substring(v,p)}else m.nsp="/";const y=f.charAt(p+1);if(y!==""&&Number(y)==y){const v=p+1;for(;++p;){const b=f.charAt(p);if(b==null||Number(b)!=b){--p;break}if(p===f.length)break}m.id=Number(f.substring(v,p+1))}if(f.charAt(++p)){const v=this.tryParse(f.substr(p));if(u.isPayloadValid(m.type,v))m.data=v;else throw new Error("invalid payload")}return s("decoded %s as %j",f,m),m}tryParse(f){try{return JSON.parse(f,this.reviver)}catch{return!1}}static isPayloadValid(f,p){switch(f){case a.CONNECT:return c(p);case a.DISCONNECT:return p===void 0;case a.CONNECT_ERROR:return typeof p=="string"||c(p);case a.EVENT:case a.BINARY_EVENT:return Array.isArray(p)&&(typeof p[0]=="number"||typeof p[0]=="string"&&o.indexOf(p[0])===-1);case a.ACK:case a.BINARY_ACK:return Array.isArray(p)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}e.Decoder=u;class d{constructor(f){this.packet=f,this.buffers=[],this.reconPack=f}takeBinaryData(f){if(this.buffers.push(f),this.buffers.length===this.reconPack.attachments){const p=(0,n.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),p}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}})(ka);var Bs={};Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.on=void 0;function YP(e,t,n){return e.on(t,n),function(){e.off(t,n)}}Bs.on=YP;var QP=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Fs,"__esModule",{value:!0}),Fs.Socket=void 0;const Fn=ka,Ea=Bs,XP=Wi,Ut=QP(Qn).default("socket.io-client:socket"),eA=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class tA extends XP.Emitter{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[Ea.on(t,"open",this.onopen.bind(this)),Ea.on(t,"packet",this.onpacket.bind(this)),Ea.on(t,"error",this.onerror.bind(this)),Ea.on(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(eA.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:Fn.PacketType.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const o=this.ids++;Ut("emitting packet with ack id %d",o);const a=n.pop();this._registerAckCallback(o,a),r.id=o}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)?Ut("discard packet as the transport is not currently writable"):this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===t&&(Ut("removing packet with ack id %d from the buffer",t),this.sendBuffer.splice(o,1));Ut("event with ack id %d has timed out after %d ms",t,i),n.call(this,new Error("operation has timed out"))},i);this.acks[t]=(...o)=>{this.io.clearTimeoutFn(s),n.apply(this,[null,...o])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,s)=>{n.push((o,a)=>r?o?s(o):i(a):i(o)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...s)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(Ut("packet [%d] is discarded after %d tries",r.id,r.tryCount),this._queue.shift(),n&&n(i)):(Ut("packet [%d] was successfully sent",r.id),this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(Ut("draining queue"),!this.connected||this._queue.length===0)return;const n=this._queue[0];if(n.pending&&!t){Ut("packet [%d] has already been sent and is waiting for an ack",n.id);return}n.pending=!0,n.tryCount++,Ut("sending packet [%d] (try n°%d)",n.id,n.tryCount),this.flags=n.flags,this.emit.apply(this,n.args)}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){Ut("transport is open - connecting"),typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Fn.PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){Ut("close (%s)",t),this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Fn.PacketType.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Fn.PacketType.EVENT:case Fn.PacketType.BINARY_EVENT:this.onevent(t);break;case Fn.PacketType.ACK:case Fn.PacketType.BINARY_ACK:this.onack(t);break;case Fn.PacketType.DISCONNECT:this.ondisconnect();break;case Fn.PacketType.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];Ut("emitting event %j",n),t.id!=null&&(Ut("attaching ack callback to event"),n.push(this.ack(t.id))),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,Ut("sending ack %j",i),n.packet({type:Fn.PacketType.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"?(Ut("calling ack %s with %j",t.id,t.data),n.apply(this,t.data),delete this.acks[t.id]):Ut("bad ack %s",t.id)}onconnect(t,n){Ut("socket connected with id %s",t),this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){Ut("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(Ut("performing disconnect (%s)",this.nsp),this.packet({type:Fn.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}Fs.Socket=tA;var Sa={};Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.Backoff=void 0;function Ki(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Sa.Backoff=Ki,Ki.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},Ki.prototype.reset=function(){this.attempts=0},Ki.prototype.setMin=function(e){this.ms=e},Ki.prototype.setMax=function(e){this.max=e},Ki.prototype.setJitter=function(e){this.jitter=e};var nA=Me&&Me.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),rA=Me&&Me.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),iA=Me&&Me.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&nA(t,e,n);return rA(t,e),t},sA=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_a,"__esModule",{value:!0}),_a.Manager=void 0;const vu=uu,oA=Fs,aA=iA(ka),vi=Bs,lA=Sa,cA=Wi,Xt=sA(Qn).default("socket.io-client:manager");class uA extends cA.Emitter{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,vu.installTimerFunctions(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new lA.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||aA;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(Xt("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;Xt("opening %s",this.uri),this.engine=new vu.Socket(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=vi.on(n,"open",function(){r.onopen(),t&&t()}),s=a=>{Xt("error"),this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=vi.on(n,"error",s);if(this._timeout!==!1){const a=this._timeout;Xt("connect attempt will timeout after %d",a);const l=this.setTimeoutFn(()=>{Xt("connect attempt timed out after %d",a),i(),s(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){Xt("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(vi.on(t,"ping",this.onping.bind(this)),vi.on(t,"data",this.ondata.bind(this)),vi.on(t,"error",this.onerror.bind(this)),vi.on(t,"close",this.onclose.bind(this)),vi.on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){vu.nextTick(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){Xt("error",t),this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new oA.Socket(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active){Xt("socket %s is still active, skipping close",r);return}this._close()}_packet(t){Xt("writing packet %j",t);const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){Xt("cleanup"),this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){Xt("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){Xt("closed due to %s",t),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)Xt("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();Xt("will wait %dms before reconnect attempt",n),this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(Xt("attempting reconnect"),this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(Xt("reconnect attempt error"),t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):(Xt("reconnect success"),t.onreconnect())}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}_a.Manager=uA,function(e,t){var n=Me&&Me.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.connect=t.io=t.Socket=t.Manager=t.protocol=void 0;const r=pa,i=_a;Object.defineProperty(t,"Manager",{enumerable:!0,get:function(){return i.Manager}});const s=Fs;Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return s.Socket}});const a=n(Qn).default("socket.io-client"),l={};function c(d,h){typeof d=="object"&&(h=d,d=void 0),h=h||{};const f=r.url(d,h.path||"/socket.io"),p=f.source,m=f.id,y=f.path,v=l[m]&&y in l[m].nsps,b=h.forceNew||h["force new connection"]||h.multiplex===!1||v;let x;return b?(a("ignoring socket cache for %s",p),x=new i.Manager(p,h)):(l[m]||(a("new io instance for %s",p),l[m]=new i.Manager(p,h)),x=l[m]),f.query&&!h.query&&(h.query=f.queryKey),x.socket(f.path,h)}t.io=c,t.connect=c,t.default=c,Object.assign(c,{Manager:i.Manager,Socket:s.Socket,io:c,connect:c});var u=ka;Object.defineProperty(t,"protocol",{enumerable:!0,get:function(){return u.protocol}}),e.exports=c}(cu,cu.exports);var dA=cu.exports;(function(e){var t=Me&&Me.__awaiter||function(l,c,u,d){function h(f){return f instanceof u?f:new u(function(p){p(f)})}return new(u||(u=Promise))(function(f,p){function m(b){try{v(d.next(b))}catch(x){p(x)}}function y(b){try{v(d.throw(b))}catch(x){p(x)}}function v(b){b.done?f(b.value):h(b.value).then(m,y)}v((d=d.apply(l,c||[])).next())})},n=Me&&Me.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(e,"__esModule",{value:!0}),e.SocketComEmitter=e.SocketComEvents=e.SocketCom=void 0;const r=lu,i=n(dA);class s{constructor(c){this.url=c,this.pending={},this.emitter=new a,this.events=this.emitter}connect(c,u){return t(this,void 0,void 0,function*(){return new Promise((d,h)=>{this.disconnect(),this.socket=(0,i.default)(this.url,{transports:["websocket"],auth:c,autoConnect:!1,query:u});const f=setTimeout(()=>{h("connection timed out")},5e3);this.socket.on("login",p=>t(this,void 0,void 0,function*(){clearTimeout(f),d(p)})),this.socket.on("connect_error",p=>{var m;(m=this.socket)===null||m===void 0||m.close(),clearTimeout(f),h(p.message)}),this.socket.on("message",p=>t(this,void 0,void 0,function*(){var m;this.pending[p.request]&&(!((m=p.data)===null||m===void 0)&&m.error?this.pending[p.request].reject(new Error(p.data.message)):this.pending[p.request].resolve(p.data),delete this.pending[p.request]),yield this.emitter.emit(o.Message,p)})),this.socket.connect()})})}disconnect(){var c;this.socket&&!(!((c=this.socket)===null||c===void 0)&&c.disconnected)&&this.socket.disconnect()}request(c,u){var d;return t(this,void 0,void 0,function*(){if(!(!((d=this.socket)===null||d===void 0)&&d.connected))throw new Error("Client is disconnected");const h=this.random(32),f=new Promise((p,m)=>{this.pending[h]={resolve:p,reject:m}});return this.socket.send({request:h,type:c,data:u}),f})}random(c){const u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let d="";for(let h=0;h<c;h++)d+=u.charAt(Math.floor(Math.random()*u.length));return d}}e.SocketCom=s;var o;(function(l){l.Message="message"})(o=e.SocketComEvents||(e.SocketComEvents={}));class a extends r.Emitter{}e.SocketComEmitter=a})(Am);var Ta={},fA=Me&&Me.__awaiter||function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(Ta,"__esModule",{value:!0}),Ta.SocketEmitter=void 0;class hA{constructor(){this.listeners={}}on(t,n){const r=this.listeners[t];r?r.push(n):this.listeners[t]=[n]}removeListeners(t){this.listeners[t]=[]}emit(t,n){return fA(this,void 0,void 0,function*(){const r=this.listeners[t];if(r!=null&&r.length){for(const i of r)yield i(n);return!0}else return!1})}}Ta.SocketEmitter=hA;var vn=Me&&Me.__awaiter||function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(ha,"__esModule",{value:!0}),ha.MessagingSocket=void 0;const sg=Am,pA=Ta;class mA extends pA.SocketEmitter{constructor(t){super(),this.clientId=t.clientId,this.com=new sg.SocketCom(t.url),this.com.events.on(sg.SocketComEvents.Message,n=>vn(this,void 0,void 0,function*(){n.type==="message.new"&&(yield this.emit("message",n.data.message))}))}get creds(){return this._creds}get userId(){var t;return(t=this._creds)===null||t===void 0?void 0:t.userId}get conversationId(){return this._conversationId}connect(t,n){return vn(this,void 0,void 0,function*(){const r=n?{userData:JSON.stringify(n)}:void 0,i=yield this.com.connect({clientId:this.clientId,creds:t},r);return i.userId===(t==null?void 0:t.userId)&&!i.userToken&&(i.userToken=t.userToken),this._creds=i,yield this.emit("connect",this._creds),yield this.emit("user",this._creds.userId),i})}disconnect(){return vn(this,void 0,void 0,function*(){this.com.disconnect(),yield this.emit("disconnect",void 0)})}getUser(){return vn(this,void 0,void 0,function*(){return this.request("users.get",{})})}switchConversation(t){return vn(this,void 0,void 0,function*(){this._conversationId=t,yield this.emit("conversation",this._conversationId)})}createConversation(t){return vn(this,void 0,void 0,function*(){const n=yield this.request("conversations.create",{});return(t==null?void 0:t.switch)!==!1&&(yield this.switchConversation(n.id)),n})}startConversation(t){return vn(this,void 0,void 0,function*(){yield this.request("conversations.start",{id:t||this._conversationId})})}getConversation(t){return vn(this,void 0,void 0,function*(){return this.request("conversations.get",{id:t||this._conversationId})})}deleteConversation(t){return vn(this,void 0,void 0,function*(){const n=yield this.request("conversations.delete",{id:t||this._conversationId});return n&&(yield this.switchConversation(void 0)),n})}listConversations(t){return vn(this,void 0,void 0,function*(){return this.request("conversations.list",{limit:t||20})})}sendText(t){return vn(this,void 0,void 0,function*(){return this.request("messages.create",{conversationId:this._conversationId,payload:{type:"text",text:t}})})}sendPayload(t){return vn(this,void 0,void 0,function*(){return this.request("messages.create",{conversationId:this._conversationId,payload:t})})}listMessages(t){return vn(this,void 0,void 0,function*(){return this.request("messages.list",{conversationId:this._conversationId,limit:t||20})})}sendFeedback(t,n){return vn(this,void 0,void 0,function*(){yield this.request("messages.feedback",{messageId:t,feedback:n})})}request(t,n){return this.com.request(t,n)}}ha.MessagingSocket=mA,function(e){var t=Me&&Me.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s),Object.defineProperty(r,o,{enumerable:!0,get:function(){return i[s]}})}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=Me&&Me.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,r,s)};Object.defineProperty(e,"__esModule",{value:!0}),n(lu,e),n(ha,e)}(km);var Oa={},bu={},Xn={},Ia={},Vs={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getParsedType=e.ZodParsedType=e.objectUtil=e.util=void 0;var t;(function(r){r.assertEqual=a=>a;function i(a){}r.assertIs=i;function s(a){throw new Error}r.assertNever=s,r.arrayToEnum=a=>{const l={};for(const c of a)l[c]=c;return l},r.getValidEnumValues=a=>{const l=r.objectKeys(a).filter(u=>typeof a[a[u]]!="number"),c={};for(const u of l)c[u]=a[u];return r.objectValues(c)},r.objectValues=a=>r.objectKeys(a).map(function(l){return a[l]}),r.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const l=[];for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&l.push(c);return l},r.find=(a,l)=>{for(const c of a)if(l(c))return c},r.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function o(a,l=" | "){return a.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}r.joinValues=o,r.jsonStringifyReplacer=(a,l)=>typeof l=="bigint"?l.toString():l})(t=e.util||(e.util={})),function(r){r.mergeShapes=(i,s)=>({...i,...s})}(e.objectUtil||(e.objectUtil={})),e.ZodParsedType=t.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);const n=r=>{switch(typeof r){case"undefined":return e.ZodParsedType.undefined;case"string":return e.ZodParsedType.string;case"number":return isNaN(r)?e.ZodParsedType.nan:e.ZodParsedType.number;case"boolean":return e.ZodParsedType.boolean;case"function":return e.ZodParsedType.function;case"bigint":return e.ZodParsedType.bigint;case"symbol":return e.ZodParsedType.symbol;case"object":return Array.isArray(r)?e.ZodParsedType.array:r===null?e.ZodParsedType.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?e.ZodParsedType.promise:typeof Map<"u"&&r instanceof Map?e.ZodParsedType.map:typeof Set<"u"&&r instanceof Set?e.ZodParsedType.set:typeof Date<"u"&&r instanceof Date?e.ZodParsedType.date:e.ZodParsedType.object;default:return e.ZodParsedType.unknown}};e.getParsedType=n})(Vs);var er={};Object.defineProperty(er,"__esModule",{value:!0}),er.ZodError=er.quotelessJson=er.ZodIssueCode=void 0;const og=Vs;er.ZodIssueCode=og.util.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"]);const gA=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");er.quotelessJson=gA;let wu=class extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(o))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,og.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};er.ZodError=wu,wu.create=e=>new wu(e),Object.defineProperty(Ia,"__esModule",{value:!0});const bi=Vs,an=er,yA=(e,t)=>{let n;switch(e.code){case an.ZodIssueCode.invalid_type:e.received===bi.ZodParsedType.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case an.ZodIssueCode.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,bi.util.jsonStringifyReplacer)}`;break;case an.ZodIssueCode.unrecognized_keys:n=`Unrecognized key(s) in object: ${bi.util.joinValues(e.keys,", ")}`;break;case an.ZodIssueCode.invalid_union:n="Invalid input";break;case an.ZodIssueCode.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${bi.util.joinValues(e.options)}`;break;case an.ZodIssueCode.invalid_enum_value:n=`Invalid enum value. Expected ${bi.util.joinValues(e.options)}, received '${e.received}'`;break;case an.ZodIssueCode.invalid_arguments:n="Invalid function arguments";break;case an.ZodIssueCode.invalid_return_type:n="Invalid function return type";break;case an.ZodIssueCode.invalid_date:n="Invalid date";break;case an.ZodIssueCode.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:bi.util.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case an.ZodIssueCode.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case an.ZodIssueCode.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case an.ZodIssueCode.custom:n="Invalid input";break;case an.ZodIssueCode.invalid_intersection_types:n="Intersection results could not be merged";break;case an.ZodIssueCode.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case an.ZodIssueCode.not_finite:n="Number must be finite";break;default:n=t.defaultError,bi.util.assertNever(e)}return{message:n}};Ia.default=yA;var vA=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xn,"__esModule",{value:!0}),Xn.getErrorMap=Xn.setErrorMap=Xn.defaultErrorMap=void 0;const ag=vA(Ia);Xn.defaultErrorMap=ag.default;let lg=ag.default;function bA(e){lg=e}Xn.setErrorMap=bA;function wA(){return lg}Xn.getErrorMap=wA;var xu={};(function(e){var t=Me&&Me.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.isAsync=e.isValid=e.isDirty=e.isAborted=e.OK=e.DIRTY=e.INVALID=e.ParseStatus=e.addIssueToContext=e.EMPTY_PATH=e.makeIssue=void 0;const n=Xn,r=t(Ia),i=f=>{const{data:p,path:m,errorMaps:y,issueData:v}=f,b=[...m,...v.path||[]],x={...v,path:b};let P="";const A=y.filter(O=>!!O).slice().reverse();for(const O of A)P=O(x,{data:p,defaultError:P}).message;return{...v,path:b,message:v.message||P}};e.makeIssue=i,e.EMPTY_PATH=[];function s(f,p){const m=(0,e.makeIssue)({issueData:p,data:f.data,path:f.path,errorMaps:[f.common.contextualErrorMap,f.schemaErrorMap,(0,n.getErrorMap)(),r.default].filter(y=>!!y)});f.common.issues.push(m)}e.addIssueToContext=s;class o{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(p,m){const y=[];for(const v of m){if(v.status==="aborted")return e.INVALID;v.status==="dirty"&&p.dirty(),y.push(v.value)}return{status:p.value,value:y}}static async mergeObjectAsync(p,m){const y=[];for(const v of m)y.push({key:await v.key,value:await v.value});return o.mergeObjectSync(p,y)}static mergeObjectSync(p,m){const y={};for(const v of m){const{key:b,value:x}=v;if(b.status==="aborted"||x.status==="aborted")return e.INVALID;b.status==="dirty"&&p.dirty(),x.status==="dirty"&&p.dirty(),b.value!=="__proto__"&&(typeof x.value<"u"||v.alwaysSet)&&(y[b.value]=x.value)}return{status:p.value,value:y}}}e.ParseStatus=o,e.INVALID=Object.freeze({status:"aborted"});const a=f=>({status:"dirty",value:f});e.DIRTY=a;const l=f=>({status:"valid",value:f});e.OK=l;const c=f=>f.status==="aborted";e.isAborted=c;const u=f=>f.status==="dirty";e.isDirty=u;const d=f=>f.status==="valid";e.isValid=d;const h=f=>typeof Promise<"u"&&f instanceof Promise;e.isAsync=h})(xu);var cg={};Object.defineProperty(cg,"__esModule",{value:!0});var ug={},dg={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.errorUtil=void 0,function(t){t.errToObj=n=>typeof n=="string"?{message:n}:n||{},t.toString=n=>typeof n=="string"?n:n==null?void 0:n.message}(e.errorUtil||(e.errorUtil={}))})(dg),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.date=e.boolean=e.bigint=e.array=e.any=e.coerce=e.ZodFirstPartyTypeKind=e.late=e.ZodSchema=e.Schema=e.custom=e.ZodReadonly=e.ZodPipeline=e.ZodBranded=e.BRAND=e.ZodNaN=e.ZodCatch=e.ZodDefault=e.ZodNullable=e.ZodOptional=e.ZodTransformer=e.ZodEffects=e.ZodPromise=e.ZodNativeEnum=e.ZodEnum=e.ZodLiteral=e.ZodLazy=e.ZodFunction=e.ZodSet=e.ZodMap=e.ZodRecord=e.ZodTuple=e.ZodIntersection=e.ZodDiscriminatedUnion=e.ZodUnion=e.ZodObject=e.ZodArray=e.ZodVoid=e.ZodNever=e.ZodUnknown=e.ZodAny=e.ZodNull=e.ZodUndefined=e.ZodSymbol=e.ZodDate=e.ZodBoolean=e.ZodBigInt=e.ZodNumber=e.ZodString=e.ZodType=void 0,e.NEVER=e.void=e.unknown=e.union=e.undefined=e.tuple=e.transformer=e.symbol=e.string=e.strictObject=e.set=e.record=e.promise=e.preprocess=e.pipeline=e.ostring=e.optional=e.onumber=e.oboolean=e.object=e.number=e.nullable=e.null=e.never=e.nativeEnum=e.nan=e.map=e.literal=e.lazy=e.intersection=e.instanceof=e.function=e.enum=e.effect=e.discriminatedUnion=void 0;const t=Xn,n=dg,r=xu,i=Vs,s=er;class o{constructor(g,w,C,D){this._cachedPath=[],this.parent=g,this.data=w,this._path=C,this._key=D}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const a=(R,g)=>{if((0,r.isValid)(g))return{success:!0,data:g.value};if(!R.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const w=new s.ZodError(R.common.issues);return this._error=w,this._error}}};function l(R){if(!R)return{};const{errorMap:g,invalid_type_error:w,required_error:C,description:D}=R;if(g&&(w||C))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return g?{errorMap:g,description:D}:{errorMap:(ye,fe)=>ye.code!=="invalid_type"?{message:fe.defaultError}:typeof fe.data>"u"?{message:C??fe.defaultError}:{message:w??fe.defaultError},description:D}}class c{constructor(g){this.spa=this.safeParseAsync,this._def=g,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)}get description(){return this._def.description}_getType(g){return(0,i.getParsedType)(g.data)}_getOrReturnCtx(g,w){return w||{common:g.parent.common,data:g.data,parsedType:(0,i.getParsedType)(g.data),schemaErrorMap:this._def.errorMap,path:g.path,parent:g.parent}}_processInputParams(g){return{status:new r.ParseStatus,ctx:{common:g.parent.common,data:g.data,parsedType:(0,i.getParsedType)(g.data),schemaErrorMap:this._def.errorMap,path:g.path,parent:g.parent}}}_parseSync(g){const w=this._parse(g);if((0,r.isAsync)(w))throw new Error("Synchronous parse encountered promise.");return w}_parseAsync(g){const w=this._parse(g);return Promise.resolve(w)}parse(g,w){const C=this.safeParse(g,w);if(C.success)return C.data;throw C.error}safeParse(g,w){var C;const D={common:{issues:[],async:(C=w==null?void 0:w.async)!==null&&C!==void 0?C:!1,contextualErrorMap:w==null?void 0:w.errorMap},path:(w==null?void 0:w.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:g,parsedType:(0,i.getParsedType)(g)},M=this._parseSync({data:g,path:D.path,parent:D});return a(D,M)}async parseAsync(g,w){const C=await this.safeParseAsync(g,w);if(C.success)return C.data;throw C.error}async safeParseAsync(g,w){const C={common:{issues:[],contextualErrorMap:w==null?void 0:w.errorMap,async:!0},path:(w==null?void 0:w.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:g,parsedType:(0,i.getParsedType)(g)},D=this._parse({data:g,path:C.path,parent:C}),M=await((0,r.isAsync)(D)?D:Promise.resolve(D));return a(C,M)}refine(g,w){const C=D=>typeof w=="string"||typeof w>"u"?{message:w}:typeof w=="function"?w(D):w;return this._refinement((D,M)=>{const ye=g(D),fe=()=>M.addIssue({code:s.ZodIssueCode.custom,...C(D)});return typeof Promise<"u"&&ye instanceof Promise?ye.then(We=>We?!0:(fe(),!1)):ye?!0:(fe(),!1)})}refinement(g,w){return this._refinement((C,D)=>g(C)?!0:(D.addIssue(typeof w=="function"?w(C,D):w),!1))}_refinement(g){return new ne({schema:this,typeName:G.ZodEffects,effect:{type:"refinement",refinement:g}})}superRefine(g){return this._refinement(g)}optional(){return me.create(this,this._def)}nullable(){return he.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return K.create(this,this._def)}promise(){return N.create(this,this._def)}or(g){return ee.create([this,g],this._def)}and(g){return Ne.create(this,g,this._def)}transform(g){return new ne({...l(this._def),schema:this,typeName:G.ZodEffects,effect:{type:"transform",transform:g}})}default(g){const w=typeof g=="function"?g:()=>g;return new Le({...l(this._def),innerType:this,defaultValue:w,typeName:G.ZodDefault})}brand(){return new it({typeName:G.ZodBranded,type:this,...l(this._def)})}catch(g){const w=typeof g=="function"?g:()=>g;return new Pe({...l(this._def),innerType:this,catchValue:w,typeName:G.ZodCatch})}describe(g){const w=this.constructor;return new w({...this._def,description:g})}pipe(g){return Ze.create(this,g)}readonly(){return W.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}e.ZodType=c,e.Schema=c,e.ZodSchema=c;const u=/^c[^\s-]{8,}$/i,d=/^[a-z][a-z0-9]*$/,h=/^[0-9A-HJKMNP-TV-Z]{26}$/,f=/^[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,p=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,m="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let y;const v=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,b=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,x=R=>R.precision?R.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${R.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${R.precision}}Z$`):R.precision===0?R.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):R.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function P(R,g){return!!((g==="v4"||!g)&&v.test(R)||(g==="v6"||!g)&&b.test(R))}class A extends c{_parse(g){if(this._def.coerce&&(g.data=String(g.data)),this._getType(g)!==i.ZodParsedType.string){const M=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(M,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.string,received:M.parsedType}),r.INVALID}const C=new r.ParseStatus;let D;for(const M of this._def.checks)if(M.kind==="min")g.data.length<M.value&&(D=this._getOrReturnCtx(g,D),(0,r.addIssueToContext)(D,{code:s.ZodIssueCode.too_small,minimum:M.value,type:"string",inclusive:!0,exact:!1,message:M.message}),C.dirty());else if(M.kind==="max")g.data.length>M.value&&(D=this._getOrReturnCtx(g,D),(0,r.addIssueToContext)(D,{code:s.ZodIssueCode.too_big,maximum:M.value,type:"string",inclusive:!0,exact:!1,message:M.message}),C.dirty());else if(M.kind==="length"){const ye=g.data.length>M.value,fe=g.data.length<M.value;(ye||fe)&&(D=this._getOrReturnCtx(g,D),ye?(0,r.addIssueToContext)(D,{code:s.ZodIssueCode.too_big,maximum:M.value,type:"string",inclusive:!0,exact:!0,message:M.message}):fe&&(0,r.addIssueToContext)(D,{code:s.ZodIssueCode.too_small,minimum:M.value,type:"string",inclusive:!0,exact:!0,message:M.message}),C.dirty())}else if(M.kind==="email")p.test(g.data)||(D=this._getOrReturnCtx(g,D),(0,r.addIssueToContext)(D,{validation:"email",code:s.ZodIssueCode.invalid_string,message:M.message}),C.dirty());else if(M.kind==="emoji")y||(y=new RegExp(m,"u")),y.test(g.data)||(D=this._getOrReturnCtx(g,D),(0,r.addIssueToContext)(D,{validation:"emoji",code:s.ZodIssueCode.invalid_string,message:M.message}),C.dirty());else if(M.kind==="uuid")f.test(g.data)||(D=this._getOrReturnCtx(g,D),(0,r.addIssueToContext)(D,{validation:"uuid",code:s.ZodIssueCode.invalid_string,message:M.message}),C.dirty());else if(M.kind==="cuid")u.test(g.data)||(D=this._getOrReturnCtx(g,D),(0,r.addIssueToContext)(D,{validation:"cuid",code:s.ZodIssueCode.invalid_string,message:M.message}),C.dirty());else if(M.kind==="cuid2")d.test(g.data)||(D=this._getOrReturnCtx(g,D),(0,r.addIssueToContext)(D,{validation:"cuid2",code:s.ZodIssueCode.invalid_string,message:M.message}),C.dirty());else if(M.kind==="ulid")h.test(g.data)||(D=this._getOrReturnCtx(g,D),(0,r.addIssueToContext)(D,{validation:"ulid",code:s.ZodIssueCode.invalid_string,message:M.message}),C.dirty());else if(M.kind==="url")try{new URL(g.data)}catch{D=this._getOrReturnCtx(g,D),(0,r.addIssueToContext)(D,{validation:"url",code:s.ZodIssueCode.invalid_string,message:M.message}),C.dirty()}else M.kind==="regex"?(M.regex.lastIndex=0,M.regex.test(g.data)||(D=this._getOrReturnCtx(g,D),(0,r.addIssueToContext)(D,{validation:"regex",code:s.ZodIssueCode.invalid_string,message:M.message}),C.dirty())):M.kind==="trim"?g.data=g.data.trim():M.kind==="includes"?g.data.includes(M.value,M.position)||(D=this._getOrReturnCtx(g,D),(0,r.addIssueToContext)(D,{code:s.ZodIssueCode.invalid_string,validation:{includes:M.value,position:M.position},message:M.message}),C.dirty()):M.kind==="toLowerCase"?g.data=g.data.toLowerCase():M.kind==="toUpperCase"?g.data=g.data.toUpperCase():M.kind==="startsWith"?g.data.startsWith(M.value)||(D=this._getOrReturnCtx(g,D),(0,r.addIssueToContext)(D,{code:s.ZodIssueCode.invalid_string,validation:{startsWith:M.value},message:M.message}),C.dirty()):M.kind==="endsWith"?g.data.endsWith(M.value)||(D=this._getOrReturnCtx(g,D),(0,r.addIssueToContext)(D,{code:s.ZodIssueCode.invalid_string,validation:{endsWith:M.value},message:M.message}),C.dirty()):M.kind==="datetime"?x(M).test(g.data)||(D=this._getOrReturnCtx(g,D),(0,r.addIssueToContext)(D,{code:s.ZodIssueCode.invalid_string,validation:"datetime",message:M.message}),C.dirty()):M.kind==="ip"?P(g.data,M.version)||(D=this._getOrReturnCtx(g,D),(0,r.addIssueToContext)(D,{validation:"ip",code:s.ZodIssueCode.invalid_string,message:M.message}),C.dirty()):i.util.assertNever(M);return{status:C.value,value:g.data}}_regex(g,w,C){return this.refinement(D=>g.test(D),{validation:w,code:s.ZodIssueCode.invalid_string,...n.errorUtil.errToObj(C)})}_addCheck(g){return new A({...this._def,checks:[...this._def.checks,g]})}email(g){return this._addCheck({kind:"email",...n.errorUtil.errToObj(g)})}url(g){return this._addCheck({kind:"url",...n.errorUtil.errToObj(g)})}emoji(g){return this._addCheck({kind:"emoji",...n.errorUtil.errToObj(g)})}uuid(g){return this._addCheck({kind:"uuid",...n.errorUtil.errToObj(g)})}cuid(g){return this._addCheck({kind:"cuid",...n.errorUtil.errToObj(g)})}cuid2(g){return this._addCheck({kind:"cuid2",...n.errorUtil.errToObj(g)})}ulid(g){return this._addCheck({kind:"ulid",...n.errorUtil.errToObj(g)})}ip(g){return this._addCheck({kind:"ip",...n.errorUtil.errToObj(g)})}datetime(g){var w;return typeof g=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:g}):this._addCheck({kind:"datetime",precision:typeof(g==null?void 0:g.precision)>"u"?null:g==null?void 0:g.precision,offset:(w=g==null?void 0:g.offset)!==null&&w!==void 0?w:!1,...n.errorUtil.errToObj(g==null?void 0:g.message)})}regex(g,w){return this._addCheck({kind:"regex",regex:g,...n.errorUtil.errToObj(w)})}includes(g,w){return this._addCheck({kind:"includes",value:g,position:w==null?void 0:w.position,...n.errorUtil.errToObj(w==null?void 0:w.message)})}startsWith(g,w){return this._addCheck({kind:"startsWith",value:g,...n.errorUtil.errToObj(w)})}endsWith(g,w){return this._addCheck({kind:"endsWith",value:g,...n.errorUtil.errToObj(w)})}min(g,w){return this._addCheck({kind:"min",value:g,...n.errorUtil.errToObj(w)})}max(g,w){return this._addCheck({kind:"max",value:g,...n.errorUtil.errToObj(w)})}length(g,w){return this._addCheck({kind:"length",value:g,...n.errorUtil.errToObj(w)})}nonempty(g){return this.min(1,n.errorUtil.errToObj(g))}trim(){return new A({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new A({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new A({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(g=>g.kind==="datetime")}get isEmail(){return!!this._def.checks.find(g=>g.kind==="email")}get isURL(){return!!this._def.checks.find(g=>g.kind==="url")}get isEmoji(){return!!this._def.checks.find(g=>g.kind==="emoji")}get isUUID(){return!!this._def.checks.find(g=>g.kind==="uuid")}get isCUID(){return!!this._def.checks.find(g=>g.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(g=>g.kind==="cuid2")}get isULID(){return!!this._def.checks.find(g=>g.kind==="ulid")}get isIP(){return!!this._def.checks.find(g=>g.kind==="ip")}get minLength(){let g=null;for(const w of this._def.checks)w.kind==="min"&&(g===null||w.value>g)&&(g=w.value);return g}get maxLength(){let g=null;for(const w of this._def.checks)w.kind==="max"&&(g===null||w.value<g)&&(g=w.value);return g}}e.ZodString=A,A.create=R=>{var g;return new A({checks:[],typeName:G.ZodString,coerce:(g=R==null?void 0:R.coerce)!==null&&g!==void 0?g:!1,...l(R)})};function O(R,g){const w=(R.toString().split(".")[1]||"").length,C=(g.toString().split(".")[1]||"").length,D=w>C?w:C,M=parseInt(R.toFixed(D).replace(".","")),ye=parseInt(g.toFixed(D).replace(".",""));return M%ye/Math.pow(10,D)}class U extends c{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(g){if(this._def.coerce&&(g.data=Number(g.data)),this._getType(g)!==i.ZodParsedType.number){const M=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(M,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.number,received:M.parsedType}),r.INVALID}let C;const D=new r.ParseStatus;for(const M of this._def.checks)M.kind==="int"?i.util.isInteger(g.data)||(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:M.message}),D.dirty()):M.kind==="min"?(M.inclusive?g.data<M.value:g.data<=M.value)&&(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_small,minimum:M.value,type:"number",inclusive:M.inclusive,exact:!1,message:M.message}),D.dirty()):M.kind==="max"?(M.inclusive?g.data>M.value:g.data>=M.value)&&(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_big,maximum:M.value,type:"number",inclusive:M.inclusive,exact:!1,message:M.message}),D.dirty()):M.kind==="multipleOf"?O(g.data,M.value)!==0&&(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.not_multiple_of,multipleOf:M.value,message:M.message}),D.dirty()):M.kind==="finite"?Number.isFinite(g.data)||(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.not_finite,message:M.message}),D.dirty()):i.util.assertNever(M);return{status:D.value,value:g.data}}gte(g,w){return this.setLimit("min",g,!0,n.errorUtil.toString(w))}gt(g,w){return this.setLimit("min",g,!1,n.errorUtil.toString(w))}lte(g,w){return this.setLimit("max",g,!0,n.errorUtil.toString(w))}lt(g,w){return this.setLimit("max",g,!1,n.errorUtil.toString(w))}setLimit(g,w,C,D){return new U({...this._def,checks:[...this._def.checks,{kind:g,value:w,inclusive:C,message:n.errorUtil.toString(D)}]})}_addCheck(g){return new U({...this._def,checks:[...this._def.checks,g]})}int(g){return this._addCheck({kind:"int",message:n.errorUtil.toString(g)})}positive(g){return this._addCheck({kind:"min",value:0,inclusive:!1,message:n.errorUtil.toString(g)})}negative(g){return this._addCheck({kind:"max",value:0,inclusive:!1,message:n.errorUtil.toString(g)})}nonpositive(g){return this._addCheck({kind:"max",value:0,inclusive:!0,message:n.errorUtil.toString(g)})}nonnegative(g){return this._addCheck({kind:"min",value:0,inclusive:!0,message:n.errorUtil.toString(g)})}multipleOf(g,w){return this._addCheck({kind:"multipleOf",value:g,message:n.errorUtil.toString(w)})}finite(g){return this._addCheck({kind:"finite",message:n.errorUtil.toString(g)})}safe(g){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:n.errorUtil.toString(g)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:n.errorUtil.toString(g)})}get minValue(){let g=null;for(const w of this._def.checks)w.kind==="min"&&(g===null||w.value>g)&&(g=w.value);return g}get maxValue(){let g=null;for(const w of this._def.checks)w.kind==="max"&&(g===null||w.value<g)&&(g=w.value);return g}get isInt(){return!!this._def.checks.find(g=>g.kind==="int"||g.kind==="multipleOf"&&i.util.isInteger(g.value))}get isFinite(){let g=null,w=null;for(const C of this._def.checks){if(C.kind==="finite"||C.kind==="int"||C.kind==="multipleOf")return!0;C.kind==="min"?(w===null||C.value>w)&&(w=C.value):C.kind==="max"&&(g===null||C.value<g)&&(g=C.value)}return Number.isFinite(w)&&Number.isFinite(g)}}e.ZodNumber=U,U.create=R=>new U({checks:[],typeName:G.ZodNumber,coerce:(R==null?void 0:R.coerce)||!1,...l(R)});class F extends c{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(g){if(this._def.coerce&&(g.data=BigInt(g.data)),this._getType(g)!==i.ZodParsedType.bigint){const M=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(M,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.bigint,received:M.parsedType}),r.INVALID}let C;const D=new r.ParseStatus;for(const M of this._def.checks)M.kind==="min"?(M.inclusive?g.data<M.value:g.data<=M.value)&&(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_small,type:"bigint",minimum:M.value,inclusive:M.inclusive,message:M.message}),D.dirty()):M.kind==="max"?(M.inclusive?g.data>M.value:g.data>=M.value)&&(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_big,type:"bigint",maximum:M.value,inclusive:M.inclusive,message:M.message}),D.dirty()):M.kind==="multipleOf"?g.data%M.value!==BigInt(0)&&(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.not_multiple_of,multipleOf:M.value,message:M.message}),D.dirty()):i.util.assertNever(M);return{status:D.value,value:g.data}}gte(g,w){return this.setLimit("min",g,!0,n.errorUtil.toString(w))}gt(g,w){return this.setLimit("min",g,!1,n.errorUtil.toString(w))}lte(g,w){return this.setLimit("max",g,!0,n.errorUtil.toString(w))}lt(g,w){return this.setLimit("max",g,!1,n.errorUtil.toString(w))}setLimit(g,w,C,D){return new F({...this._def,checks:[...this._def.checks,{kind:g,value:w,inclusive:C,message:n.errorUtil.toString(D)}]})}_addCheck(g){return new F({...this._def,checks:[...this._def.checks,g]})}positive(g){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:n.errorUtil.toString(g)})}negative(g){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:n.errorUtil.toString(g)})}nonpositive(g){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:n.errorUtil.toString(g)})}nonnegative(g){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:n.errorUtil.toString(g)})}multipleOf(g,w){return this._addCheck({kind:"multipleOf",value:g,message:n.errorUtil.toString(w)})}get minValue(){let g=null;for(const w of this._def.checks)w.kind==="min"&&(g===null||w.value>g)&&(g=w.value);return g}get maxValue(){let g=null;for(const w of this._def.checks)w.kind==="max"&&(g===null||w.value<g)&&(g=w.value);return g}}e.ZodBigInt=F,F.create=R=>{var g;return new F({checks:[],typeName:G.ZodBigInt,coerce:(g=R==null?void 0:R.coerce)!==null&&g!==void 0?g:!1,...l(R)})};class B extends c{_parse(g){if(this._def.coerce&&(g.data=!!g.data),this._getType(g)!==i.ZodParsedType.boolean){const C=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.boolean,received:C.parsedType}),r.INVALID}return(0,r.OK)(g.data)}}e.ZodBoolean=B,B.create=R=>new B({typeName:G.ZodBoolean,coerce:(R==null?void 0:R.coerce)||!1,...l(R)});class I extends c{_parse(g){if(this._def.coerce&&(g.data=new Date(g.data)),this._getType(g)!==i.ZodParsedType.date){const M=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(M,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.date,received:M.parsedType}),r.INVALID}if(isNaN(g.data.getTime())){const M=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(M,{code:s.ZodIssueCode.invalid_date}),r.INVALID}const C=new r.ParseStatus;let D;for(const M of this._def.checks)M.kind==="min"?g.data.getTime()<M.value&&(D=this._getOrReturnCtx(g,D),(0,r.addIssueToContext)(D,{code:s.ZodIssueCode.too_small,message:M.message,inclusive:!0,exact:!1,minimum:M.value,type:"date"}),C.dirty()):M.kind==="max"?g.data.getTime()>M.value&&(D=this._getOrReturnCtx(g,D),(0,r.addIssueToContext)(D,{code:s.ZodIssueCode.too_big,message:M.message,inclusive:!0,exact:!1,maximum:M.value,type:"date"}),C.dirty()):i.util.assertNever(M);return{status:C.value,value:new Date(g.data.getTime())}}_addCheck(g){return new I({...this._def,checks:[...this._def.checks,g]})}min(g,w){return this._addCheck({kind:"min",value:g.getTime(),message:n.errorUtil.toString(w)})}max(g,w){return this._addCheck({kind:"max",value:g.getTime(),message:n.errorUtil.toString(w)})}get minDate(){let g=null;for(const w of this._def.checks)w.kind==="min"&&(g===null||w.value>g)&&(g=w.value);return g!=null?new Date(g):null}get maxDate(){let g=null;for(const w of this._def.checks)w.kind==="max"&&(g===null||w.value<g)&&(g=w.value);return g!=null?new Date(g):null}}e.ZodDate=I,I.create=R=>new I({checks:[],coerce:(R==null?void 0:R.coerce)||!1,typeName:G.ZodDate,...l(R)});class j extends c{_parse(g){if(this._getType(g)!==i.ZodParsedType.symbol){const C=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.symbol,received:C.parsedType}),r.INVALID}return(0,r.OK)(g.data)}}e.ZodSymbol=j,j.create=R=>new j({typeName:G.ZodSymbol,...l(R)});class J extends c{_parse(g){if(this._getType(g)!==i.ZodParsedType.undefined){const C=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.undefined,received:C.parsedType}),r.INVALID}return(0,r.OK)(g.data)}}e.ZodUndefined=J,J.create=R=>new J({typeName:G.ZodUndefined,...l(R)});class q extends c{_parse(g){if(this._getType(g)!==i.ZodParsedType.null){const C=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.null,received:C.parsedType}),r.INVALID}return(0,r.OK)(g.data)}}e.ZodNull=q,q.create=R=>new q({typeName:G.ZodNull,...l(R)});class H extends c{constructor(){super(...arguments),this._any=!0}_parse(g){return(0,r.OK)(g.data)}}e.ZodAny=H,H.create=R=>new H({typeName:G.ZodAny,...l(R)});class V extends c{constructor(){super(...arguments),this._unknown=!0}_parse(g){return(0,r.OK)(g.data)}}e.ZodUnknown=V,V.create=R=>new V({typeName:G.ZodUnknown,...l(R)});class z extends c{_parse(g){const w=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.never,received:w.parsedType}),r.INVALID}}e.ZodNever=z,z.create=R=>new z({typeName:G.ZodNever,...l(R)});class Y extends c{_parse(g){if(this._getType(g)!==i.ZodParsedType.undefined){const C=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.void,received:C.parsedType}),r.INVALID}return(0,r.OK)(g.data)}}e.ZodVoid=Y,Y.create=R=>new Y({typeName:G.ZodVoid,...l(R)});class K extends c{_parse(g){const{ctx:w,status:C}=this._processInputParams(g),D=this._def;if(w.parsedType!==i.ZodParsedType.array)return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.array,received:w.parsedType}),r.INVALID;if(D.exactLength!==null){const ye=w.data.length>D.exactLength.value,fe=w.data.length<D.exactLength.value;(ye||fe)&&((0,r.addIssueToContext)(w,{code:ye?s.ZodIssueCode.too_big:s.ZodIssueCode.too_small,minimum:fe?D.exactLength.value:void 0,maximum:ye?D.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:D.exactLength.message}),C.dirty())}if(D.minLength!==null&&w.data.length<D.minLength.value&&((0,r.addIssueToContext)(w,{code:s.ZodIssueCode.too_small,minimum:D.minLength.value,type:"array",inclusive:!0,exact:!1,message:D.minLength.message}),C.dirty()),D.maxLength!==null&&w.data.length>D.maxLength.value&&((0,r.addIssueToContext)(w,{code:s.ZodIssueCode.too_big,maximum:D.maxLength.value,type:"array",inclusive:!0,exact:!1,message:D.maxLength.message}),C.dirty()),w.common.async)return Promise.all([...w.data].map((ye,fe)=>D.type._parseAsync(new o(w,ye,w.path,fe)))).then(ye=>r.ParseStatus.mergeArray(C,ye));const M=[...w.data].map((ye,fe)=>D.type._parseSync(new o(w,ye,w.path,fe)));return r.ParseStatus.mergeArray(C,M)}get element(){return this._def.type}min(g,w){return new K({...this._def,minLength:{value:g,message:n.errorUtil.toString(w)}})}max(g,w){return new K({...this._def,maxLength:{value:g,message:n.errorUtil.toString(w)}})}length(g,w){return new K({...this._def,exactLength:{value:g,message:n.errorUtil.toString(w)}})}nonempty(g){return this.min(1,g)}}e.ZodArray=K,K.create=(R,g)=>new K({type:R,minLength:null,maxLength:null,exactLength:null,typeName:G.ZodArray,...l(g)});function pe(R){if(R instanceof k){const g={};for(const w in R.shape){const C=R.shape[w];g[w]=me.create(pe(C))}return new k({...R._def,shape:()=>g})}else return R instanceof K?new K({...R._def,type:pe(R.element)}):R instanceof me?me.create(pe(R.unwrap())):R instanceof he?he.create(pe(R.unwrap())):R instanceof Ie?Ie.create(R.items.map(g=>pe(g))):R}class k extends c{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const g=this._def.shape(),w=i.util.objectKeys(g);return this._cached={shape:g,keys:w}}_parse(g){if(this._getType(g)!==i.ZodParsedType.object){const Fe=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(Fe,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.object,received:Fe.parsedType}),r.INVALID}const{status:C,ctx:D}=this._processInputParams(g),{shape:M,keys:ye}=this._getCached(),fe=[];if(!(this._def.catchall instanceof z&&this._def.unknownKeys==="strip"))for(const Fe in D.data)ye.includes(Fe)||fe.push(Fe);const We=[];for(const Fe of ye){const ot=M[Fe],Dn=D.data[Fe];We.push({key:{status:"valid",value:Fe},value:ot._parse(new o(D,Dn,D.path,Fe)),alwaysSet:Fe in D.data})}if(this._def.catchall instanceof z){const Fe=this._def.unknownKeys;if(Fe==="passthrough")for(const ot of fe)We.push({key:{status:"valid",value:ot},value:{status:"valid",value:D.data[ot]}});else if(Fe==="strict")fe.length>0&&((0,r.addIssueToContext)(D,{code:s.ZodIssueCode.unrecognized_keys,keys:fe}),C.dirty());else if(Fe!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const Fe=this._def.catchall;for(const ot of fe){const Dn=D.data[ot];We.push({key:{status:"valid",value:ot},value:Fe._parse(new o(D,Dn,D.path,ot)),alwaysSet:ot in D.data})}}return D.common.async?Promise.resolve().then(async()=>{const Fe=[];for(const ot of We){const Dn=await ot.key;Fe.push({key:Dn,value:await ot.value,alwaysSet:ot.alwaysSet})}return Fe}).then(Fe=>r.ParseStatus.mergeObjectSync(C,Fe)):r.ParseStatus.mergeObjectSync(C,We)}get shape(){return this._def.shape()}strict(g){return n.errorUtil.errToObj,new k({...this._def,unknownKeys:"strict",...g!==void 0?{errorMap:(w,C)=>{var D,M,ye,fe;const We=(ye=(M=(D=this._def).errorMap)===null||M===void 0?void 0:M.call(D,w,C).message)!==null&&ye!==void 0?ye:C.defaultError;return w.code==="unrecognized_keys"?{message:(fe=n.errorUtil.errToObj(g).message)!==null&&fe!==void 0?fe:We}:{message:We}}}:{}})}strip(){return new k({...this._def,unknownKeys:"strip"})}passthrough(){return new k({...this._def,unknownKeys:"passthrough"})}extend(g){return new k({...this._def,shape:()=>({...this._def.shape(),...g})})}merge(g){return new k({unknownKeys:g._def.unknownKeys,catchall:g._def.catchall,shape:()=>({...this._def.shape(),...g._def.shape()}),typeName:G.ZodObject})}setKey(g,w){return this.augment({[g]:w})}catchall(g){return new k({...this._def,catchall:g})}pick(g){const w={};return i.util.objectKeys(g).forEach(C=>{g[C]&&this.shape[C]&&(w[C]=this.shape[C])}),new k({...this._def,shape:()=>w})}omit(g){const w={};return i.util.objectKeys(this.shape).forEach(C=>{g[C]||(w[C]=this.shape[C])}),new k({...this._def,shape:()=>w})}deepPartial(){return pe(this)}partial(g){const w={};return i.util.objectKeys(this.shape).forEach(C=>{const D=this.shape[C];g&&!g[C]?w[C]=D:w[C]=D.optional()}),new k({...this._def,shape:()=>w})}required(g){const w={};return i.util.objectKeys(this.shape).forEach(C=>{if(g&&!g[C])w[C]=this.shape[C];else{let M=this.shape[C];for(;M instanceof me;)M=M._def.innerType;w[C]=M}}),new k({...this._def,shape:()=>w})}keyof(){return Ce(i.util.objectKeys(this.shape))}}e.ZodObject=k,k.create=(R,g)=>new k({shape:()=>R,unknownKeys:"strip",catchall:z.create(),typeName:G.ZodObject,...l(g)}),k.strictCreate=(R,g)=>new k({shape:()=>R,unknownKeys:"strict",catchall:z.create(),typeName:G.ZodObject,...l(g)}),k.lazycreate=(R,g)=>new k({shape:R,unknownKeys:"strip",catchall:z.create(),typeName:G.ZodObject,...l(g)});class ee extends c{_parse(g){const{ctx:w}=this._processInputParams(g),C=this._def.options;function D(M){for(const fe of M)if(fe.result.status==="valid")return fe.result;for(const fe of M)if(fe.result.status==="dirty")return w.common.issues.push(...fe.ctx.common.issues),fe.result;const ye=M.map(fe=>new s.ZodError(fe.ctx.common.issues));return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_union,unionErrors:ye}),r.INVALID}if(w.common.async)return Promise.all(C.map(async M=>{const ye={...w,common:{...w.common,issues:[]},parent:null};return{result:await M._parseAsync({data:w.data,path:w.path,parent:ye}),ctx:ye}})).then(D);{let M;const ye=[];for(const We of C){const Fe={...w,common:{...w.common,issues:[]},parent:null},ot=We._parseSync({data:w.data,path:w.path,parent:Fe});if(ot.status==="valid")return ot;ot.status==="dirty"&&!M&&(M={result:ot,ctx:Fe}),Fe.common.issues.length&&ye.push(Fe.common.issues)}if(M)return w.common.issues.push(...M.ctx.common.issues),M.result;const fe=ye.map(We=>new s.ZodError(We));return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_union,unionErrors:fe}),r.INVALID}}get options(){return this._def.options}}e.ZodUnion=ee,ee.create=(R,g)=>new ee({options:R,typeName:G.ZodUnion,...l(g)});const xe=R=>R instanceof ve?xe(R.schema):R instanceof ne?xe(R.innerType()):R instanceof ke?[R.value]:R instanceof Re?R.options:R instanceof qe?Object.keys(R.enum):R instanceof Le?xe(R._def.innerType):R instanceof J?[void 0]:R instanceof q?[null]:null;class S extends c{_parse(g){const{ctx:w}=this._processInputParams(g);if(w.parsedType!==i.ZodParsedType.object)return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.object,received:w.parsedType}),r.INVALID;const C=this.discriminator,D=w.data[C],M=this.optionsMap.get(D);return M?w.common.async?M._parseAsync({data:w.data,path:w.path,parent:w}):M._parseSync({data:w.data,path:w.path,parent:w}):((0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[C]}),r.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(g,w,C){const D=new Map;for(const M of w){const ye=xe(M.shape[g]);if(!ye)throw new Error(`A discriminator value for key \`${g}\` could not be extracted from all schema options`);for(const fe of ye){if(D.has(fe))throw new Error(`Discriminator property ${String(g)} has duplicate value ${String(fe)}`);D.set(fe,M)}}return new S({typeName:G.ZodDiscriminatedUnion,discriminator:g,options:w,optionsMap:D,...l(C)})}}e.ZodDiscriminatedUnion=S;function Te(R,g){const w=(0,i.getParsedType)(R),C=(0,i.getParsedType)(g);if(R===g)return{valid:!0,data:R};if(w===i.ZodParsedType.object&&C===i.ZodParsedType.object){const D=i.util.objectKeys(g),M=i.util.objectKeys(R).filter(fe=>D.indexOf(fe)!==-1),ye={...R,...g};for(const fe of M){const We=Te(R[fe],g[fe]);if(!We.valid)return{valid:!1};ye[fe]=We.data}return{valid:!0,data:ye}}else if(w===i.ZodParsedType.array&&C===i.ZodParsedType.array){if(R.length!==g.length)return{valid:!1};const D=[];for(let M=0;M<R.length;M++){const ye=R[M],fe=g[M],We=Te(ye,fe);if(!We.valid)return{valid:!1};D.push(We.data)}return{valid:!0,data:D}}else return w===i.ZodParsedType.date&&C===i.ZodParsedType.date&&+R==+g?{valid:!0,data:R}:{valid:!1}}class Ne extends c{_parse(g){const{status:w,ctx:C}=this._processInputParams(g),D=(M,ye)=>{if((0,r.isAborted)(M)||(0,r.isAborted)(ye))return r.INVALID;const fe=Te(M.value,ye.value);return fe.valid?(((0,r.isDirty)(M)||(0,r.isDirty)(ye))&&w.dirty(),{status:w.value,value:fe.data}):((0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_intersection_types}),r.INVALID)};return C.common.async?Promise.all([this._def.left._parseAsync({data:C.data,path:C.path,parent:C}),this._def.right._parseAsync({data:C.data,path:C.path,parent:C})]).then(([M,ye])=>D(M,ye)):D(this._def.left._parseSync({data:C.data,path:C.path,parent:C}),this._def.right._parseSync({data:C.data,path:C.path,parent:C}))}}e.ZodIntersection=Ne,Ne.create=(R,g,w)=>new Ne({left:R,right:g,typeName:G.ZodIntersection,...l(w)});class Ie extends c{_parse(g){const{status:w,ctx:C}=this._processInputParams(g);if(C.parsedType!==i.ZodParsedType.array)return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.array,received:C.parsedType}),r.INVALID;if(C.data.length<this._def.items.length)return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.INVALID;!this._def.rest&&C.data.length>this._def.items.length&&((0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),w.dirty());const M=[...C.data].map((ye,fe)=>{const We=this._def.items[fe]||this._def.rest;return We?We._parse(new o(C,ye,C.path,fe)):null}).filter(ye=>!!ye);return C.common.async?Promise.all(M).then(ye=>r.ParseStatus.mergeArray(w,ye)):r.ParseStatus.mergeArray(w,M)}get items(){return this._def.items}rest(g){return new Ie({...this._def,rest:g})}}e.ZodTuple=Ie,Ie.create=(R,g)=>{if(!Array.isArray(R))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ie({items:R,typeName:G.ZodTuple,rest:null,...l(g)})};class je extends c{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(g){const{status:w,ctx:C}=this._processInputParams(g);if(C.parsedType!==i.ZodParsedType.object)return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.object,received:C.parsedType}),r.INVALID;const D=[],M=this._def.keyType,ye=this._def.valueType;for(const fe in C.data)D.push({key:M._parse(new o(C,fe,C.path,fe)),value:ye._parse(new o(C,C.data[fe],C.path,fe))});return C.common.async?r.ParseStatus.mergeObjectAsync(w,D):r.ParseStatus.mergeObjectSync(w,D)}get element(){return this._def.valueType}static create(g,w,C){return w instanceof c?new je({keyType:g,valueType:w,typeName:G.ZodRecord,...l(C)}):new je({keyType:A.create(),valueType:g,typeName:G.ZodRecord,...l(w)})}}e.ZodRecord=je;class De extends c{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(g){const{status:w,ctx:C}=this._processInputParams(g);if(C.parsedType!==i.ZodParsedType.map)return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.map,received:C.parsedType}),r.INVALID;const D=this._def.keyType,M=this._def.valueType,ye=[...C.data.entries()].map(([fe,We],Fe)=>({key:D._parse(new o(C,fe,C.path,[Fe,"key"])),value:M._parse(new o(C,We,C.path,[Fe,"value"]))}));if(C.common.async){const fe=new Map;return Promise.resolve().then(async()=>{for(const We of ye){const Fe=await We.key,ot=await We.value;if(Fe.status==="aborted"||ot.status==="aborted")return r.INVALID;(Fe.status==="dirty"||ot.status==="dirty")&&w.dirty(),fe.set(Fe.value,ot.value)}return{status:w.value,value:fe}})}else{const fe=new Map;for(const We of ye){const Fe=We.key,ot=We.value;if(Fe.status==="aborted"||ot.status==="aborted")return r.INVALID;(Fe.status==="dirty"||ot.status==="dirty")&&w.dirty(),fe.set(Fe.value,ot.value)}return{status:w.value,value:fe}}}}e.ZodMap=De,De.create=(R,g,w)=>new De({valueType:g,keyType:R,typeName:G.ZodMap,...l(w)});class Ue extends c{_parse(g){const{status:w,ctx:C}=this._processInputParams(g);if(C.parsedType!==i.ZodParsedType.set)return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.set,received:C.parsedType}),r.INVALID;const D=this._def;D.minSize!==null&&C.data.size<D.minSize.value&&((0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_small,minimum:D.minSize.value,type:"set",inclusive:!0,exact:!1,message:D.minSize.message}),w.dirty()),D.maxSize!==null&&C.data.size>D.maxSize.value&&((0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_big,maximum:D.maxSize.value,type:"set",inclusive:!0,exact:!1,message:D.maxSize.message}),w.dirty());const M=this._def.valueType;function ye(We){const Fe=new Set;for(const ot of We){if(ot.status==="aborted")return r.INVALID;ot.status==="dirty"&&w.dirty(),Fe.add(ot.value)}return{status:w.value,value:Fe}}const fe=[...C.data.values()].map((We,Fe)=>M._parse(new o(C,We,C.path,Fe)));return C.common.async?Promise.all(fe).then(We=>ye(We)):ye(fe)}min(g,w){return new Ue({...this._def,minSize:{value:g,message:n.errorUtil.toString(w)}})}max(g,w){return new Ue({...this._def,maxSize:{value:g,message:n.errorUtil.toString(w)}})}size(g,w){return this.min(g,w).max(g,w)}nonempty(g){return this.min(1,g)}}e.ZodSet=Ue,Ue.create=(R,g)=>new Ue({valueType:R,minSize:null,maxSize:null,typeName:G.ZodSet,...l(g)});class _e extends c{constructor(){super(...arguments),this.validate=this.implement}_parse(g){const{ctx:w}=this._processInputParams(g);if(w.parsedType!==i.ZodParsedType.function)return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.function,received:w.parsedType}),r.INVALID;function C(fe,We){return(0,r.makeIssue)({data:fe,path:w.path,errorMaps:[w.common.contextualErrorMap,w.schemaErrorMap,(0,t.getErrorMap)(),t.defaultErrorMap].filter(Fe=>!!Fe),issueData:{code:s.ZodIssueCode.invalid_arguments,argumentsError:We}})}function D(fe,We){return(0,r.makeIssue)({data:fe,path:w.path,errorMaps:[w.common.contextualErrorMap,w.schemaErrorMap,(0,t.getErrorMap)(),t.defaultErrorMap].filter(Fe=>!!Fe),issueData:{code:s.ZodIssueCode.invalid_return_type,returnTypeError:We}})}const M={errorMap:w.common.contextualErrorMap},ye=w.data;if(this._def.returns instanceof N){const fe=this;return(0,r.OK)(async function(...We){const Fe=new s.ZodError([]),ot=await fe._def.args.parseAsync(We,M).catch(Id=>{throw Fe.addIssue(C(We,Id)),Fe}),Dn=await Reflect.apply(ye,this,ot);return await fe._def.returns._def.type.parseAsync(Dn,M).catch(Id=>{throw Fe.addIssue(D(Dn,Id)),Fe})})}else{const fe=this;return(0,r.OK)(function(...We){const Fe=fe._def.args.safeParse(We,M);if(!Fe.success)throw new s.ZodError([C(We,Fe.error)]);const ot=Reflect.apply(ye,this,Fe.data),Dn=fe._def.returns.safeParse(ot,M);if(!Dn.success)throw new s.ZodError([D(ot,Dn.error)]);return Dn.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...g){return new _e({...this._def,args:Ie.create(g).rest(V.create())})}returns(g){return new _e({...this._def,returns:g})}implement(g){return this.parse(g)}strictImplement(g){return this.parse(g)}static create(g,w,C){return new _e({args:g||Ie.create([]).rest(V.create()),returns:w||V.create(),typeName:G.ZodFunction,...l(C)})}}e.ZodFunction=_e;class ve extends c{get schema(){return this._def.getter()}_parse(g){const{ctx:w}=this._processInputParams(g);return this._def.getter()._parse({data:w.data,path:w.path,parent:w})}}e.ZodLazy=ve,ve.create=(R,g)=>new ve({getter:R,typeName:G.ZodLazy,...l(g)});class ke extends c{_parse(g){if(g.data!==this._def.value){const w=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(w,{received:w.data,code:s.ZodIssueCode.invalid_literal,expected:this._def.value}),r.INVALID}return{status:"valid",value:g.data}}get value(){return this._def.value}}e.ZodLiteral=ke,ke.create=(R,g)=>new ke({value:R,typeName:G.ZodLiteral,...l(g)});function Ce(R,g){return new Re({values:R,typeName:G.ZodEnum,...l(g)})}class Re extends c{_parse(g){if(typeof g.data!="string"){const w=this._getOrReturnCtx(g),C=this._def.values;return(0,r.addIssueToContext)(w,{expected:i.util.joinValues(C),received:w.parsedType,code:s.ZodIssueCode.invalid_type}),r.INVALID}if(this._def.values.indexOf(g.data)===-1){const w=this._getOrReturnCtx(g),C=this._def.values;return(0,r.addIssueToContext)(w,{received:w.data,code:s.ZodIssueCode.invalid_enum_value,options:C}),r.INVALID}return(0,r.OK)(g.data)}get options(){return this._def.values}get enum(){const g={};for(const w of this._def.values)g[w]=w;return g}get Values(){const g={};for(const w of this._def.values)g[w]=w;return g}get Enum(){const g={};for(const w of this._def.values)g[w]=w;return g}extract(g){return Re.create(g)}exclude(g){return Re.create(this.options.filter(w=>!g.includes(w)))}}e.ZodEnum=Re,Re.create=Ce;class qe extends c{_parse(g){const w=i.util.getValidEnumValues(this._def.values),C=this._getOrReturnCtx(g);if(C.parsedType!==i.ZodParsedType.string&&C.parsedType!==i.ZodParsedType.number){const D=i.util.objectValues(w);return(0,r.addIssueToContext)(C,{expected:i.util.joinValues(D),received:C.parsedType,code:s.ZodIssueCode.invalid_type}),r.INVALID}if(w.indexOf(g.data)===-1){const D=i.util.objectValues(w);return(0,r.addIssueToContext)(C,{received:C.data,code:s.ZodIssueCode.invalid_enum_value,options:D}),r.INVALID}return(0,r.OK)(g.data)}get enum(){return this._def.values}}e.ZodNativeEnum=qe,qe.create=(R,g)=>new qe({values:R,typeName:G.ZodNativeEnum,...l(g)});class N extends c{unwrap(){return this._def.type}_parse(g){const{ctx:w}=this._processInputParams(g);if(w.parsedType!==i.ZodParsedType.promise&&w.common.async===!1)return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.promise,received:w.parsedType}),r.INVALID;const C=w.parsedType===i.ZodParsedType.promise?w.data:Promise.resolve(w.data);return(0,r.OK)(C.then(D=>this._def.type.parseAsync(D,{path:w.path,errorMap:w.common.contextualErrorMap})))}}e.ZodPromise=N,N.create=(R,g)=>new N({type:R,typeName:G.ZodPromise,...l(g)});class ne extends c{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===G.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(g){const{status:w,ctx:C}=this._processInputParams(g),D=this._def.effect||null,M={addIssue:ye=>{(0,r.addIssueToContext)(C,ye),ye.fatal?w.abort():w.dirty()},get path(){return C.path}};if(M.addIssue=M.addIssue.bind(M),D.type==="preprocess"){const ye=D.transform(C.data,M);return C.common.issues.length?{status:"dirty",value:C.data}:C.common.async?Promise.resolve(ye).then(fe=>this._def.schema._parseAsync({data:fe,path:C.path,parent:C})):this._def.schema._parseSync({data:ye,path:C.path,parent:C})}if(D.type==="refinement"){const ye=fe=>{const We=D.refinement(fe,M);if(C.common.async)return Promise.resolve(We);if(We instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return fe};if(C.common.async===!1){const fe=this._def.schema._parseSync({data:C.data,path:C.path,parent:C});return fe.status==="aborted"?r.INVALID:(fe.status==="dirty"&&w.dirty(),ye(fe.value),{status:w.value,value:fe.value})}else return this._def.schema._parseAsync({data:C.data,path:C.path,parent:C}).then(fe=>fe.status==="aborted"?r.INVALID:(fe.status==="dirty"&&w.dirty(),ye(fe.value).then(()=>({status:w.value,value:fe.value}))))}if(D.type==="transform")if(C.common.async===!1){const ye=this._def.schema._parseSync({data:C.data,path:C.path,parent:C});if(!(0,r.isValid)(ye))return ye;const fe=D.transform(ye.value,M);if(fe instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:w.value,value:fe}}else return this._def.schema._parseAsync({data:C.data,path:C.path,parent:C}).then(ye=>(0,r.isValid)(ye)?Promise.resolve(D.transform(ye.value,M)).then(fe=>({status:w.value,value:fe})):ye);i.util.assertNever(D)}}e.ZodEffects=ne,e.ZodTransformer=ne,ne.create=(R,g,w)=>new ne({schema:R,typeName:G.ZodEffects,effect:g,...l(w)}),ne.createWithPreprocess=(R,g,w)=>new ne({schema:g,effect:{type:"preprocess",transform:R},typeName:G.ZodEffects,...l(w)});class me extends c{_parse(g){return this._getType(g)===i.ZodParsedType.undefined?(0,r.OK)(void 0):this._def.innerType._parse(g)}unwrap(){return this._def.innerType}}e.ZodOptional=me,me.create=(R,g)=>new me({innerType:R,typeName:G.ZodOptional,...l(g)});class he extends c{_parse(g){return this._getType(g)===i.ZodParsedType.null?(0,r.OK)(null):this._def.innerType._parse(g)}unwrap(){return this._def.innerType}}e.ZodNullable=he,he.create=(R,g)=>new he({innerType:R,typeName:G.ZodNullable,...l(g)});class Le extends c{_parse(g){const{ctx:w}=this._processInputParams(g);let C=w.data;return w.parsedType===i.ZodParsedType.undefined&&(C=this._def.defaultValue()),this._def.innerType._parse({data:C,path:w.path,parent:w})}removeDefault(){return this._def.innerType}}e.ZodDefault=Le,Le.create=(R,g)=>new Le({innerType:R,typeName:G.ZodDefault,defaultValue:typeof g.default=="function"?g.default:()=>g.default,...l(g)});class Pe extends c{_parse(g){const{ctx:w}=this._processInputParams(g),C={...w,common:{...w.common,issues:[]}},D=this._def.innerType._parse({data:C.data,path:C.path,parent:{...C}});return(0,r.isAsync)(D)?D.then(M=>({status:"valid",value:M.status==="valid"?M.value:this._def.catchValue({get error(){return new s.ZodError(C.common.issues)},input:C.data})})):{status:"valid",value:D.status==="valid"?D.value:this._def.catchValue({get error(){return new s.ZodError(C.common.issues)},input:C.data})}}removeCatch(){return this._def.innerType}}e.ZodCatch=Pe,Pe.create=(R,g)=>new Pe({innerType:R,typeName:G.ZodCatch,catchValue:typeof g.catch=="function"?g.catch:()=>g.catch,...l(g)});class Be extends c{_parse(g){if(this._getType(g)!==i.ZodParsedType.nan){const C=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.nan,received:C.parsedType}),r.INVALID}return{status:"valid",value:g.data}}}e.ZodNaN=Be,Be.create=R=>new Be({typeName:G.ZodNaN,...l(R)}),e.BRAND=Symbol("zod_brand");class it extends c{_parse(g){const{ctx:w}=this._processInputParams(g),C=w.data;return this._def.type._parse({data:C,path:w.path,parent:w})}unwrap(){return this._def.type}}e.ZodBranded=it;class Ze extends c{_parse(g){const{status:w,ctx:C}=this._processInputParams(g);if(C.common.async)return(async()=>{const M=await this._def.in._parseAsync({data:C.data,path:C.path,parent:C});return M.status==="aborted"?r.INVALID:M.status==="dirty"?(w.dirty(),(0,r.DIRTY)(M.value)):this._def.out._parseAsync({data:M.value,path:C.path,parent:C})})();{const D=this._def.in._parseSync({data:C.data,path:C.path,parent:C});return D.status==="aborted"?r.INVALID:D.status==="dirty"?(w.dirty(),{status:"dirty",value:D.value}):this._def.out._parseSync({data:D.value,path:C.path,parent:C})}}static create(g,w){return new Ze({in:g,out:w,typeName:G.ZodPipeline})}}e.ZodPipeline=Ze;class W extends c{_parse(g){const w=this._def.innerType._parse(g);return(0,r.isValid)(w)&&(w.value=Object.freeze(w.value)),w}}e.ZodReadonly=W,W.create=(R,g)=>new W({innerType:R,typeName:G.ZodReadonly,...l(g)});const Q=(R,g={},w)=>R?H.create().superRefine((C,D)=>{var M,ye;if(!R(C)){const fe=typeof g=="function"?g(C):typeof g=="string"?{message:g}:g,We=(ye=(M=fe.fatal)!==null&&M!==void 0?M:w)!==null&&ye!==void 0?ye:!0,Fe=typeof fe=="string"?{message:fe}:fe;D.addIssue({code:"custom",...Fe,fatal:We})}}):H.create();e.custom=Q,e.late={object:k.lazycreate};var G;(function(R){R.ZodString="ZodString",R.ZodNumber="ZodNumber",R.ZodNaN="ZodNaN",R.ZodBigInt="ZodBigInt",R.ZodBoolean="ZodBoolean",R.ZodDate="ZodDate",R.ZodSymbol="ZodSymbol",R.ZodUndefined="ZodUndefined",R.ZodNull="ZodNull",R.ZodAny="ZodAny",R.ZodUnknown="ZodUnknown",R.ZodNever="ZodNever",R.ZodVoid="ZodVoid",R.ZodArray="ZodArray",R.ZodObject="ZodObject",R.ZodUnion="ZodUnion",R.ZodDiscriminatedUnion="ZodDiscriminatedUnion",R.ZodIntersection="ZodIntersection",R.ZodTuple="ZodTuple",R.ZodRecord="ZodRecord",R.ZodMap="ZodMap",R.ZodSet="ZodSet",R.ZodFunction="ZodFunction",R.ZodLazy="ZodLazy",R.ZodLiteral="ZodLiteral",R.ZodEnum="ZodEnum",R.ZodEffects="ZodEffects",R.ZodNativeEnum="ZodNativeEnum",R.ZodOptional="ZodOptional",R.ZodNullable="ZodNullable",R.ZodDefault="ZodDefault",R.ZodCatch="ZodCatch",R.ZodPromise="ZodPromise",R.ZodBranded="ZodBranded",R.ZodPipeline="ZodPipeline",R.ZodReadonly="ZodReadonly"})(G=e.ZodFirstPartyTypeKind||(e.ZodFirstPartyTypeKind={}));const $e=(R,g={message:`Input not instance of ${R.name}`})=>(0,e.custom)(w=>w instanceof R,g);e.instanceof=$e;const Ge=A.create;e.string=Ge;const Ct=U.create;e.number=Ct;const yt=Be.create;e.nan=yt;const pt=F.create;e.bigint=pt;const It=B.create;e.boolean=It;const cn=I.create;e.date=cn;const Pt=j.create;e.symbol=Pt;const Nt=J.create;e.undefined=Nt;const Jt=q.create;e.null=Jt;const qt=H.create;e.any=qt;const Tr=V.create;e.unknown=Tr;const Ln=z.create;e.never=Ln;const lr=Y.create;e.void=lr;const Si=K.create;e.array=Si;const Xr=k.create;e.object=Xr;const ei=k.strictCreate;e.strictObject=ei;const Or=ee.create;e.union=Or;const Et=S.create;e.discriminatedUnion=Et;const St=Ne.create;e.intersection=St;const Gt=Ie.create;e.tuple=Gt;const Yt=je.create;e.record=Yt;const Kt=De.create;e.map=Kt;const $t=Ue.create;e.set=$t;const bn=_e.create;e.function=bn;const Sn=ve.create;e.lazy=Sn;const cr=ke.create;e.literal=cr;const Td=Re.create;e.enum=Td;const Od=qe.create;e.nativeEnum=Od;const L=N.create;e.promise=L;const ge=ne.create;e.effect=ge,e.transformer=ge;const Se=me.create;e.optional=Se;const Ke=he.create;e.nullable=Ke;const ut=ne.createWithPreprocess;e.preprocess=ut;const mt=Ze.create;e.pipeline=mt;const st=()=>Ge().optional();e.ostring=st;const nt=()=>Ct().optional();e.onumber=nt;const tn=()=>It().optional();e.oboolean=tn,e.coerce={string:R=>A.create({...R,coerce:!0}),number:R=>U.create({...R,coerce:!0}),boolean:R=>B.create({...R,coerce:!0}),bigint:R=>F.create({...R,coerce:!0}),date:R=>I.create({...R,coerce:!0})},e.NEVER=r.INVALID}(ug),function(e){var t=Me&&Me.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s),Object.defineProperty(r,o,{enumerable:!0,get:function(){return i[s]}})}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=Me&&Me.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,r,s)};Object.defineProperty(e,"__esModule",{value:!0}),n(Xn,e),n(xu,e),n(cg,e),n(Vs,e),n(ug,e),n(er,e)}(bu),function(e){var t=Me&&Me.__createBinding||(Object.create?function(o,a,l,c){c===void 0&&(c=l),Object.defineProperty(o,c,{enumerable:!0,get:function(){return a[l]}})}:function(o,a,l,c){c===void 0&&(c=l),o[c]=a[l]}),n=Me&&Me.__setModuleDefault||(Object.create?function(o,a){Object.defineProperty(o,"default",{enumerable:!0,value:a})}:function(o,a){o.default=a}),r=Me&&Me.__importStar||function(o){if(o&&o.__esModule)return o;var a={};if(o!=null)for(var l in o)l!=="default"&&Object.prototype.hasOwnProperty.call(o,l)&&t(a,o,l);return n(a,o),a},i=Me&&Me.__exportStar||function(o,a){for(var l in o)l!=="default"&&!Object.prototype.hasOwnProperty.call(a,l)&&t(a,o,l)};Object.defineProperty(e,"__esModule",{value:!0}),e.z=void 0;const s=r(bu);e.z=s,i(bu,e),e.default=s}(Oa);const _u={},fg=Cl(Object.freeze(Object.defineProperty({__proto__:null,default:_u},Symbol.toStringTag,{value:"Module"})));function hg(e,t){return function(){return e.apply(t,arguments)}}const{toString:xA}=Object.prototype,{getPrototypeOf:ku}=Object,Pa=(e=>t=>{const n=xA.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),tr=e=>(e=e.toLowerCase(),t=>Pa(t)===e),Aa=e=>t=>typeof t===e,{isArray:Ji}=Array,zs=Aa("undefined");function _A(e){return e!==null&&!zs(e)&&e.constructor!==null&&!zs(e.constructor)&&$n(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const pg=tr("ArrayBuffer");function kA(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&pg(e.buffer),t}const CA=Aa("string"),$n=Aa("function"),mg=Aa("number"),Ra=e=>e!==null&&typeof e=="object",EA=e=>e===!0||e===!1,$a=e=>{if(Pa(e)!=="object")return!1;const t=ku(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},SA=tr("Date"),TA=tr("File"),OA=tr("Blob"),IA=tr("FileList"),PA=e=>Ra(e)&&$n(e.pipe),AA=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||$n(e.append)&&((t=Pa(e))==="formdata"||t==="object"&&$n(e.toString)&&e.toString()==="[object FormData]"))},RA=tr("URLSearchParams"),$A=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Zs(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),Ji(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let a;for(r=0;r<o;r++)a=s[r],t.call(null,e[a],a,e)}}function gg(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const yg=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),vg=e=>!zs(e)&&e!==yg;function Cu(){const{caseless:e}=vg(this)&&this||{},t={},n=(r,i)=>{const s=e&&gg(t,i)||i;$a(t[s])&&$a(r)?t[s]=Cu(t[s],r):$a(r)?t[s]=Cu({},r):Ji(r)?t[s]=r.slice():t[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Zs(arguments[r],n);return t}const MA=(e,t,n,{allOwnKeys:r}={})=>(Zs(t,(i,s)=>{n&&$n(i)?e[s]=hg(i,n):e[s]=i},{allOwnKeys:r}),e),LA=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),DA=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},NA=(e,t,n,r)=>{let i,s,o;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)o=i[s],(!r||r(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=n!==!1&&ku(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},jA=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},UA=e=>{if(!e)return null;if(Ji(e))return e;let t=e.length;if(!mg(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},FA=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ku(Uint8Array)),BA=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},VA=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},zA=tr("HTMLFormElement"),ZA=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),bg=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),WA=tr("RegExp"),wg=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Zs(n,(i,s)=>{let o;(o=t(i,s,e))!==!1&&(r[s]=o||i)}),Object.defineProperties(e,r)},HA=e=>{wg(e,(t,n)=>{if($n(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if($n(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},qA=(e,t)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return Ji(e)?r(e):r(String(e).split(t)),n},KA=()=>{},JA=(e,t)=>(e=+e,Number.isFinite(e)?e:t),Eu="abcdefghijklmnopqrstuvwxyz",xg="0123456789",_g={DIGIT:xg,ALPHA:Eu,ALPHA_DIGIT:Eu+Eu.toUpperCase()+xg},GA=(e=16,t=_g.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function YA(e){return!!(e&&$n(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const QA=e=>{const t=new Array(10),n=(r,i)=>{if(Ra(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const s=Ji(r)?[]:{};return Zs(r,(o,a)=>{const l=n(o,i+1);!zs(l)&&(s[a]=l)}),t[i]=void 0,s}}return r};return n(e,0)},XA=tr("AsyncFunction"),re={isArray:Ji,isArrayBuffer:pg,isBuffer:_A,isFormData:AA,isArrayBufferView:kA,isString:CA,isNumber:mg,isBoolean:EA,isObject:Ra,isPlainObject:$a,isUndefined:zs,isDate:SA,isFile:TA,isBlob:OA,isRegExp:WA,isFunction:$n,isStream:PA,isURLSearchParams:RA,isTypedArray:FA,isFileList:IA,forEach:Zs,merge:Cu,extend:MA,trim:$A,stripBOM:LA,inherits:DA,toFlatObject:NA,kindOf:Pa,kindOfTest:tr,endsWith:jA,toArray:UA,forEachEntry:BA,matchAll:VA,isHTMLForm:zA,hasOwnProperty:bg,hasOwnProp:bg,reduceDescriptors:wg,freezeMethods:HA,toObjectSet:qA,toCamelCase:ZA,noop:KA,toFiniteNumber:JA,findKey:gg,global:yg,isContextDefined:vg,ALPHABET:_g,generateString:GA,isSpecCompliantForm:YA,toJSONObject:QA,isAsyncFn:XA,isThenable:e=>e&&(Ra(e)||$n(e))&&$n(e.then)&&$n(e.catch)};function lt(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}re.inherits(lt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:re.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const kg=lt.prototype,Cg={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Cg[e]={value:e}}),Object.defineProperties(lt,Cg),Object.defineProperty(kg,"isAxiosError",{value:!0}),lt.from=(e,t,n,r,i,s)=>{const o=Object.create(kg);return re.toFlatObject(e,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),lt.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};const eR=null;function Su(e){return re.isPlainObject(e)||re.isArray(e)}function Eg(e){return re.endsWith(e,"[]")?e.slice(0,-2):e}function Sg(e,t,n){return e?e.concat(t).map(function(i,s){return i=Eg(i),!n&&s?"["+i+"]":i}).join(n?".":""):t}function tR(e){return re.isArray(e)&&!e.some(Su)}const nR=re.toFlatObject(re,{},null,function(t){return/^is[A-Z]/.test(t)});function Ma(e,t,n){if(!re.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=re.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!re.isUndefined(y[m])});const r=n.metaTokens,i=n.visitor||u,s=n.dots,o=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&re.isSpecCompliantForm(t);if(!re.isFunction(i))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(re.isDate(p))return p.toISOString();if(!l&&re.isBlob(p))throw new lt("Blob is not supported. Use a Buffer instead.");return re.isArrayBuffer(p)||re.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,m,y){let v=p;if(p&&!y&&typeof p=="object"){if(re.endsWith(m,"{}"))m=r?m:m.slice(0,-2),p=JSON.stringify(p);else if(re.isArray(p)&&tR(p)||(re.isFileList(p)||re.endsWith(m,"[]"))&&(v=re.toArray(p)))return m=Eg(m),v.forEach(function(x,P){!(re.isUndefined(x)||x===null)&&t.append(o===!0?Sg([m],P,s):o===null?m:m+"[]",c(x))}),!1}return Su(p)?!0:(t.append(Sg(y,m,s),c(p)),!1)}const d=[],h=Object.assign(nR,{defaultVisitor:u,convertValue:c,isVisitable:Su});function f(p,m){if(!re.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(p),re.forEach(p,function(v,b){(!(re.isUndefined(v)||v===null)&&i.call(t,v,re.isString(b)?b.trim():b,m,h))===!0&&f(v,m?m.concat(b):[b])}),d.pop()}}if(!re.isObject(e))throw new TypeError("data must be an object");return f(e),t}function Tg(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Tu(e,t){this._pairs=[],e&&Ma(e,this,t)}const Og=Tu.prototype;Og.append=function(t,n){this._pairs.push([t,n])},Og.toString=function(t){const n=t?function(r){return t.call(this,r,Tg)}:Tg;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function rR(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ig(e,t,n){if(!t)return e;const r=n&&n.encode||rR,i=n&&n.serialize;let s;if(i?s=i(t,n):s=re.isURLSearchParams(t)?t.toString():new Tu(t,n).toString(r),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}const Pg=class{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){re.forEach(this.handlers,function(r){r!==null&&t(r)})}},Ag={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},iR={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Tu,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Rg=typeof window<"u"&&typeof document<"u",sR=(e=>Rg&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),oR=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),nr={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Rg,hasStandardBrowserEnv:sR,hasStandardBrowserWebWorkerEnv:oR},Symbol.toStringTag,{value:"Module"})),...iR};function aR(e,t){return Ma(e,new nr.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return nr.isNode&&re.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function lR(e){return re.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function cR(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],t[s]=e[s];return t}function $g(e){function t(n,r,i,s){let o=n[s++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),l=s>=n.length;return o=!o&&re.isArray(i)?i.length:o,l?(re.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!a):((!i[o]||!re.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],s)&&re.isArray(i[o])&&(i[o]=cR(i[o])),!a)}if(re.isFormData(e)&&re.isFunction(e.entries)){const n={};return re.forEachEntry(e,(r,i)=>{t(lR(r),i,n,0)}),n}return null}function uR(e,t,n){if(re.isString(e))try{return(t||JSON.parse)(e),re.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Ou={transitional:Ag,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=re.isObject(t);if(s&&re.isHTMLForm(t)&&(t=new FormData(t)),re.isFormData(t))return i?JSON.stringify($g(t)):t;if(re.isArrayBuffer(t)||re.isBuffer(t)||re.isStream(t)||re.isFile(t)||re.isBlob(t))return t;if(re.isArrayBufferView(t))return t.buffer;if(re.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return aR(t,this.formSerializer).toString();if((a=re.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Ma(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),uR(t)):t}],transformResponse:[function(t){const n=this.transitional||Ou.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(t&&re.isString(t)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?lt.from(a,lt.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:nr.classes.FormData,Blob:nr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};re.forEach(["delete","get","head","post","put","patch"],e=>{Ou.headers[e]={}});const Iu=Ou,dR=re.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),fR=e=>{const t={};let n,r,i;return e&&e.split(`
|
|
273
|
-
`).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||t[n]&&
|
|
274
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[
|
|
275
|
-
`+s.map(
|
|
276
|
-
`):" "+
|
|
277
|
-
`+s):r.stack=s}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Gi(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&Lu.assertOptions(r,{silentJSONParsing:Wr.transitional(Wr.boolean),forcedJSONParsing:Wr.transitional(Wr.boolean),clarifyTimeoutError:Wr.transitional(Wr.boolean)},!1),i!=null&&(re.isFunction(i)?n.paramsSerializer={serialize:i}:Lu.assertOptions(i,{encode:Wr.function,serialize:Wr.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&re.merge(s.common,s[n.method]);s&&re.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),n.headers=br.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,h;if(!l){const p=[Fg.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),h=p.length,u=Promise.resolve(n);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let f=n;for(d=0;d<h;){const p=a[d++],m=a[d++];try{f=p(f)}catch(y){m.call(this,y);break}}try{u=Fg.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=Gi(this.defaults,t);const n=Dg(t.baseURL,t.url);return Ig(n,t.params,t.paramsSerializer)}};re.forEach(["delete","get","head","options"],function(t){Na.prototype[t]=function(n,r){return this.request(Gi(r||{},{method:t,url:n,data:(r||{}).data}))}}),re.forEach(["post","put","patch"],function(t){function n(r){return function(s,o,a){return this.request(Gi(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}Na.prototype[t]=n(),Na.prototype[t+"Form"]=n(!0)});const ja=Na,SR=class Ub{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},t(function(s,o,a){r.reason||(r.reason=new Hs(s,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new Ub(function(i){t=i}),cancel:t}}};function TR(e){return function(n){return e.apply(null,n)}}function OR(e){return re.isObject(e)&&e.isAxiosError===!0}const Du={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Du).forEach(([e,t])=>{Du[t]=e});const IR=Du;function Zg(e){const t=new ja(e),n=hg(ja.prototype.request,t);return re.extend(n,ja.prototype,t,{allOwnKeys:!0}),re.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return Zg(Gi(e,i))},n}const Lt=Zg(Iu);Lt.Axios=ja,Lt.CanceledError=Hs,Lt.CancelToken=SR,Lt.isCancel=Lg,Lt.VERSION=Vg,Lt.toFormData=Ma,Lt.AxiosError=lt,Lt.Cancel=Lt.CanceledError,Lt.all=function(t){return Promise.all(t)},Lt.spread=TR,Lt.isAxiosError=OR,Lt.mergeConfig=Gi,Lt.AxiosHeaders=br,Lt.formToJSON=e=>$g(re.isHTMLForm(e)?new FormData(e):e),Lt.getAdapter=Ug.getAdapter,Lt.HttpStatusCode=IR,Lt.default=Lt;const X=Lt,{Axios:PR,AxiosError:AR,CanceledError:RR,isCancel:$R,CancelToken:MR,VERSION:LR,all:DR,Cancel:NR,isAxiosError:jR,spread:UR,toFormData:FR,AxiosHeaders:BR,HttpStatusCode:VR,formToJSON:zR,getAdapter:ZR,mergeConfig:WR}=X,HR=Object.freeze(Object.defineProperty({__proto__:null,Axios:PR,AxiosError:AR,AxiosHeaders:BR,Cancel:NR,CancelToken:MR,CanceledError:RR,HttpStatusCode:VR,VERSION:LR,all:DR,default:X,formToJSON:zR,getAdapter:ZR,isAxiosError:jR,isCancel:$R,mergeConfig:WR,spread:UR,toFormData:FR},Symbol.toStringTag,{value:"Module"}));var Yi={};Object.defineProperty(Yi,"__esModule",{value:!0});var qR=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},KR=typeof window<"u"&&typeof window.document<"u",JR=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,GR=(typeof self>"u"?"undefined":qR(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",YR=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),QR=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",Wg=Yi.isBrowser=KR;Yi.isWebWorker=GR;var Nu=Yi.isNode=JR;Yi.isJsDom=YR,Yi.isDeno=QR;var XR=Object.create,Hg=Object.defineProperty,e$=Object.getOwnPropertyDescriptor,t$=Object.getOwnPropertyNames,n$=Object.getPrototypeOf,r$=Object.prototype.hasOwnProperty,qg=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),i$=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of t$(t))!r$.call(e,i)&&i!==n&&Hg(e,i,{get:()=>t[i],enumerable:!(r=e$(t,i))||r.enumerable});return e},Kg=(e,t,n)=>(n=e!=null?XR(n$(e)):{},i$(t||!e||!e.__esModule?Hg(n,"default",{value:e,enumerable:!0}):n,e)),s$=qg(()=>{}),o$=qg(()=>{}),a$=Kg(s$()),l$=Kg(o$()),c$="https://api.botpress.cloud",u$=6e4,d$="BP_API_URL",f$="BP_BOT_ID",h$="BP_INTEGRATION_ID",p$="BP_WORKSPACE_ID",m$="BP_TOKEN";function g$(e){let t=y$(e),n={};t.workspaceId&&(n["x-workspace-id"]=t.workspaceId),t.botId&&(n["x-bot-id"]=t.botId),t.integrationId&&(n["x-integration-id"]=t.integrationId),t.token&&(n.Authorization=`Bearer ${t.token}`),n={...n,...t.headers};let r=t.apiUrl??c$,i=t.timeout??u$;return{apiUrl:r,timeout:i,withCredentials:Wg,headers:n}}function y$(e){return Wg?e:Nu?v$(e):e}function v$(e){let t={...e,apiUrl:e.apiUrl??process.env[d$],botId:e.botId??process.env[f$],integrationId:e.integrationId??process.env[h$],workspaceId:e.workspaceId??process.env[p$]},n=t.token??process.env[m$];return n&&(t.token=n),t}var ie="https://api.botpress.cloud".replace(/\/+$/,""),b$=class{constructor(t,n=ie,r=X){E(this,"configuration");this.basePath=n,this.axios=r,t&&(this.configuration=t,this.basePath=t.basePath||this.basePath)}},w$=class extends Error{constructor(t,n){super(n),this.field=t,this.name="RequiredError"}},se="https://example.com",de=function(e,t,n){if(n==null)throw new w$(t,`Required parameter ${t} was null or undefined when calling ${e}.`)};function ju(e,t,n=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(r=>ju(e,r,n)):Object.keys(t).forEach(r=>ju(e,t[r],`${n}${n!==""?".":""}${r}`)):e.has(n)?e.append(n,t):e.set(n,t))}var oe=function(e,...t){let n=new URLSearchParams(e.search);ju(n,t),e.search=n.toString()},Je=function(e,t,n){let r=typeof e!="string";return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(e!==void 0?e:{}):e||""},ae=function(e){return e.pathname+e.search+e.hash},le=function(e,t,n,r){return(i=t,s=n)=>{let o={...e.options,url:((r==null?void 0:r.basePath)||s)+e.url};return i.request(o)}},x$=function(e){return{addParticipant:async(t,n,r={})=>{de("addParticipant","id",t);let i="/v1/chat/conversations/{id}/participants".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},breakDownWorkspaceUsageByBot:async(t,n,r,i={})=>{de("breakDownWorkspaceUsageByBot","id",t),de("breakDownWorkspaceUsageByBot","type",n);let s="/v1/admin/workspaces/{id}/usages/by-bot".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};n!==void 0&&(u.type=n),r!==void 0&&(u.period=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},callAction:async(t,n={})=>{let r="/v1/chat/actions",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},changeAISpendQuota:async(t,n={})=>{let r="/v1/admin/quotas/ai-spend",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"PUT",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},changeWorkspacePlan:async(t,n,r={})=>{de("changeWorkspacePlan","id",t);let i="/v1/admin/workspaces/{id}/change-plan".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},chargeWorkspaceUnpaidInvoices:async(t,n,r={})=>{de("chargeWorkspaceUnpaidInvoices","id",t);let i="/v1/admin/workspaces/{id}/billing/invoices/charge-unpaid".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},checkHandleAvailability:async(t,n={})=>{let r="/v1/admin/workspaces/handle-availability",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"PUT",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},configureIntegration:async(t,n={})=>{let r="/v1/chat/integrations/configure",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createBot:async(t,n={})=>{let r="/v1/admin/bots",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createConversation:async(t,n={})=>{let r="/v1/chat/conversations",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createEvent:async(t,n={})=>{let r="/v1/chat/events",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createFile:async(t,n,r,i,s,o,a,l={})=>{de("createFile","xName",t);let c="/v1/files",u=new URL(c,se),d;e&&(d=e.baseOptions);let h={method:"POST",...d,...l},f={},p={};t!=null&&(f["x-name"]=String(t)),n!=null&&(f["x-tags"]=String(n)),r!=null&&(f["x-access-policies"]=String(r)),i!=null&&(f["x-index"]=String(i)),s!=null&&(f["Content-Type"]=String(s)),o!=null&&(f["Content-Length"]=String(o)),f["Content-Type"]="application/json",oe(u,p);let m=d&&d.headers?d.headers:{};return h.headers={...f,...m,...l.headers},h.data=Je(a,h,e),{url:ae(u),options:h}},createIntegration:async(t,n={})=>{let r="/v1/admin/integrations",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createMessage:async(t,n={})=>{let r="/v1/chat/messages",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createPersonalAccessToken:async(t,n={})=>{let r="/v1/admin/account/pats",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createTable:async(t,n={})=>{let r="/v1/tables",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createTableRows:async(t,n,r={})=>{de("createTableRows","table",t);let i="/v1/tables/{table}/rows".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},createTask:async(t,n={})=>{let r="/v1/chat/tasks",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createUser:async(t,n={})=>{let r="/v1/chat/users",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createWorkspace:async(t,n={})=>{let r="/v1/admin/workspaces",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createWorkspaceMember:async(t,n={})=>{let r="/v1/admin/workspace-members",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},deleteBot:async(t,n={})=>{de("deleteBot","id",t);let r="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteBotIssue:async(t,n,r={})=>{de("deleteBotIssue","id",t),de("deleteBotIssue","issueId",n);let i="/v1/admin/bots/{id}/issues/{issueId}".replace("{id}",encodeURIComponent(String(t))).replace("{issueId}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"DELETE",...o,...r},l={};oe(s,{});let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:ae(s),options:a}},deleteConversation:async(t,n={})=>{de("deleteConversation","id",t);let r="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteFile:async(t,n={})=>{de("deleteFile","id",t);let r="/v1/files/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteIntegration:async(t,n={})=>{de("deleteIntegration","id",t);let r="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteMessage:async(t,n={})=>{de("deleteMessage","id",t);let r="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deletePersonalAccessToken:async(t,n={})=>{de("deletePersonalAccessToken","id",t);let r="/v1/admin/account/pats/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteTable:async(t,n={})=>{de("deleteTable","table",t);let r="/v1/tables/{table}".replace("{table}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteTableRows:async(t,n,r={})=>{de("deleteTableRows","table",t);let i="/v1/tables/{table}/rows/delete".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},deleteTask:async(t,n={})=>{de("deleteTask","id",t);let r="/v1/chat/tasks/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteUser:async(t,n={})=>{de("deleteUser","id",t);let r="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteWorkspace:async(t,n={})=>{de("deleteWorkspace","id",t);let r="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteWorkspaceMember:async(t,n={})=>{de("deleteWorkspaceMember","id",t);let r="/v1/admin/workspace-members/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},findTableRows:async(t,n,r={})=>{de("findTableRows","table",t);let i="/v1/tables/{table}/rows/find".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},getAccount:async(t={})=>{let n="/v1/admin/account/me",r=new URL(n,se),i;e&&(i=e.baseOptions);let s={method:"GET",...i,...t},o={};oe(r,{});let a=i&&i.headers?i.headers:{};return s.headers={...o,...a,...t.headers},{url:ae(r),options:s}},getAccountPreference:async(t,n={})=>{de("getAccountPreference","key",t);let r="/v1/admin/account/preferences/{key}".replace("{key}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getAllWorkspaceQuotaCompletion:async(t={})=>{let n="/v1/admin/workspaces/usages/quota-completion",r=new URL(n,se),i;e&&(i=e.baseOptions);let s={method:"GET",...i,...t},o={};oe(r,{});let a=i&&i.headers?i.headers:{};return s.headers={...o,...a,...t.headers},{url:ae(r),options:s}},getAuditRecords:async(t,n,r={})=>{de("getAuditRecords","id",t);let i="/v1/admin/workspaces/{id}/audit-records".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.nextToken=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},getBot:async(t,n={})=>{de("getBot","id",t);let r="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getBotAnalytics:async(t,n,r,i={})=>{de("getBotAnalytics","id",t),de("getBotAnalytics","startDate",n),de("getBotAnalytics","endDate",r);let s="/v1/admin/bots/{id}/analytics".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};n!==void 0&&(u.startDate=n),r!==void 0&&(u.endDate=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},getBotLogs:async(t,n,r,i,s={})=>{de("getBotLogs","id",t),de("getBotLogs","timeStart",n),de("getBotLogs","timeEnd",r);let o="/v1/admin/bots/{id}/logs".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"GET",...l,...s},u={},d={};n!==void 0&&(d.timeStart=n),r!==void 0&&(d.timeEnd=r),i!==void 0&&(d.nextToken=i),oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},{url:ae(a),options:c}},getBotWebchat:async(t,n,r={})=>{de("getBotWebchat","id",t),de("getBotWebchat","type",n);let i="/v1/admin/bots/{id}/webchat".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.type=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},getConversation:async(t,n={})=>{de("getConversation","id",t);let r="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getEvent:async(t,n={})=>{de("getEvent","id",t);let r="/v1/chat/events/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getFileContent:async(t,n={})=>{de("getFileContent","id",t);let r="/v1/files/{id}/content".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getFileMetadata:async(t,n={})=>{de("getFileMetadata","id",t);let r="/v1/files/{id}/metadata".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getIntegration:async(t,n={})=>{de("getIntegration","id",t);let r="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getIntegrationByName:async(t,n,r={})=>{de("getIntegrationByName","name",t),de("getIntegrationByName","version",n);let i="/v1/admin/integrations/{name}/{version}".replace("{name}",encodeURIComponent(String(t))).replace("{version}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={};oe(s,{});let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:ae(s),options:a}},getIntegrationLogs:async(t,n,r,i,s={})=>{de("getIntegrationLogs","id",t),de("getIntegrationLogs","timeStart",n),de("getIntegrationLogs","timeEnd",r);let o="/v1/admin/integrations/{id}/logs".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"GET",...l,...s},u={},d={};n!==void 0&&(d.timeStart=n),r!==void 0&&(d.timeEnd=r),i!==void 0&&(d.nextToken=i),oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},{url:ae(a),options:c}},getMessage:async(t,n={})=>{de("getMessage","id",t);let r="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getOrCreateConversation:async(t,n={})=>{let r="/v1/chat/conversations/get-or-create",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},getOrCreateMessage:async(t,n={})=>{let r="/v1/chat/messages/get-or-create",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},getOrCreateUser:async(t,n={})=>{let r="/v1/chat/users/get-or-create",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},getOrSetState:async(t,n,r,i,s={})=>{de("getOrSetState","type",t),de("getOrSetState","id",n),de("getOrSetState","name",r);let o="/v1/chat/states/{type}/{id}/{name}/get-or-set".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(n))).replace("{name}",encodeURIComponent(String(r))),a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"POST",...l,...s},u={},d={};u["Content-Type"]="application/json",oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},c.data=Je(i,c,e),{url:ae(a),options:c}},getParticipant:async(t,n,r={})=>{de("getParticipant","id",t),de("getParticipant","userId",n);let i="/v1/chat/conversations/{id}/participants/{userId}".replace("{id}",encodeURIComponent(String(t))).replace("{userId}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={};oe(s,{});let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:ae(s),options:a}},getPublicIntegration:async(t,n,r={})=>{de("getPublicIntegration","name",t),de("getPublicIntegration","version",n);let i="/v1/admin/hub/integrations/{name}/{version}".replace("{name}",encodeURIComponent(String(t))).replace("{version}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={};oe(s,{});let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:ae(s),options:a}},getPublicIntegrationById:async(t,n={})=>{de("getPublicIntegrationById","id",t);let r="/v1/admin/hub/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getPublicWorkspace:async(t,n={})=>{de("getPublicWorkspace","id",t);let r="/v1/admin/workspaces/{id}/public".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getState:async(t,n,r,i={})=>{de("getState","type",t),de("getState","id",n),de("getState","name",r);let s="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(n))).replace("{name}",encodeURIComponent(String(r))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={};oe(o,{});let u=a&&a.headers?a.headers:{};return l.headers={...c,...u,...i.headers},{url:ae(o),options:l}},getTable:async(t,n={})=>{de("getTable","table",t);let r="/v1/tables/{table}".replace("{table}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getTableRow:async(t,n,r={})=>{de("getTableRow","table",t),de("getTableRow","id",n);let i="/v1/tables/{table}/row".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.id=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},getTask:async(t,n={})=>{de("getTask","id",t);let r="/v1/chat/tasks/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getUpcomingInvoice:async(t,n={})=>{de("getUpcomingInvoice","id",t);let r="/v1/admin/workspaces/{id}/billing/upcoming-invoice".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getUsage:async(t,n,r,i={})=>{de("getUsage","type",t),de("getUsage","id",n);let s="/v1/admin/usages/{id}".replace("{id}",encodeURIComponent(String(n))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};t!==void 0&&(u.type=t),r!==void 0&&(u.period=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},getUser:async(t,n={})=>{de("getUser","id",t);let r="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getWorkspace:async(t,n={})=>{de("getWorkspace","id",t);let r="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getWorkspaceBillingDetails:async(t,n={})=>{de("getWorkspaceBillingDetails","id",t);let r="/v1/admin/workspaces/{id}/billing/details".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getWorkspaceQuota:async(t,n,r,i={})=>{de("getWorkspaceQuota","id",t),de("getWorkspaceQuota","type",n);let s="/v1/admin/workspaces/{id}/quota".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};n!==void 0&&(u.type=n),r!==void 0&&(u.period=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},introspect:async(t,n={})=>{let r="/v1/admin/introspect",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},listActivities:async(t,n,r,i={})=>{de("listActivities","taskId",t),de("listActivities","botId",n);let s="/v1/admin/activities",o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};r!==void 0&&(u.nextToken=r),t!==void 0&&(u.taskId=t),n!==void 0&&(u.botId=n),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listBotIssueEvents:async(t,n,r={})=>{de("listBotIssueEvents","id",t),de("listBotIssueEvents","issueId",n);let i="/v1/admin/bots/{id}/issues/{issueId}/events".replace("{id}",encodeURIComponent(String(t))).replace("{issueId}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={};oe(s,{});let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:ae(s),options:a}},listBotIssues:async(t,n,r={})=>{de("listBotIssues","id",t);let i="/v1/admin/bots/{id}/issues".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.nextToken=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},listBots:async(t,n,r={})=>{let i="/v1/admin/bots",s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};t!==void 0&&(c.dev=t),n!==void 0&&(c.nextToken=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},listConversations:async(t,n,r,i={})=>{let s="/v1/chat/conversations",o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};t!==void 0&&(u.nextToken=t),n!==void 0&&(u.tags=n),r&&(u.participantIds=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listEvents:async(t,n,r,i,s,o={})=>{let a="/v1/chat/events",l=new URL(a,se),c;e&&(c=e.baseOptions);let u={method:"GET",...c,...o},d={},h={};t!==void 0&&(h.nextToken=t),n!==void 0&&(h.type=n),r!==void 0&&(h.conversationId=r),i!==void 0&&(h.userId=i),s!==void 0&&(h.messageId=s),oe(l,h);let f=c&&c.headers?c.headers:{};return u.headers={...d,...f,...o.headers},{url:ae(l),options:u}},listFiles:async(t,n,r,i={})=>{de("listFiles","botId",t);let s="/v1/files/bot/{botId}".replace("{botId}",encodeURIComponent(String(t))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};n!==void 0&&(u.nextToken=n),r!==void 0&&(u.tags=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listIntegrations:async(t,n,r,i,s={})=>{let o="/v1/admin/integrations",a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"GET",...l,...s},u={},d={};t!==void 0&&(d.nextToken=t),n!==void 0&&(d.name=n),r!==void 0&&(d.version=r),i!==void 0&&(d.dev=i),oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},{url:ae(a),options:c}},listMessages:async(t,n,r,i={})=>{let s="/v1/chat/messages",o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};t!==void 0&&(u.nextToken=t),n!==void 0&&(u.conversationId=n),r!==void 0&&(u.tags=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listParticipants:async(t,n,r={})=>{de("listParticipants","id",t);let i="/v1/chat/conversations/{id}/participants".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.nextToken=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},listPersonalAccessTokens:async(t={})=>{let n="/v1/admin/account/pats",r=new URL(n,se),i;e&&(i=e.baseOptions);let s={method:"GET",...i,...t},o={};oe(r,{});let a=i&&i.headers?i.headers:{};return s.headers={...o,...a,...t.headers},{url:ae(r),options:s}},listPublicIntegrations:async(t,n,r,i={})=>{let s="/v1/admin/hub/integrations",o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};t!==void 0&&(u.nextToken=t),n!==void 0&&(u.name=n),r!==void 0&&(u.version=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listTables:async(t,n={})=>{let r="/v1/tables",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={},l={};t!==void 0&&(l.tags=t),oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},{url:ae(i),options:o}},listTasks:async(t,n,r,i,s,o,a,l={})=>{let c="/v1/chat/tasks",u=new URL(c,se),d;e&&(d=e.baseOptions);let h={method:"GET",...d,...l},f={},p={};t!==void 0&&(p.nextToken=t),n!==void 0&&(p.tags=n),r!==void 0&&(p.conversationId=r),i!==void 0&&(p.userId=i),s!==void 0&&(p.parentTaskId=s),o&&(p.status=o),a!==void 0&&(p.type=a),oe(u,p);let m=d&&d.headers?d.headers:{};return h.headers={...f,...m,...l.headers},{url:ae(u),options:h}},listUsageHistory:async(t,n,r={})=>{de("listUsageHistory","type",t),de("listUsageHistory","id",n);let i="/v1/admin/usages/{id}/history".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};t!==void 0&&(c.type=t),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},listUsers:async(t,n,r,i={})=>{let s="/v1/chat/users",o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};t!==void 0&&(u.nextToken=t),n!==void 0&&(u.conversationId=n),r!==void 0&&(u.tags=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listWorkspaceInvoices:async(t,n={})=>{de("listWorkspaceInvoices","id",t);let r="/v1/admin/workspaces/{id}/billing/invoices".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},listWorkspaceMembers:async(t,n={})=>{let r="/v1/admin/workspace-members",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={},l={};t!==void 0&&(l.nextToken=t),oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},{url:ae(i),options:o}},listWorkspaceQuotas:async(t,n,r={})=>{de("listWorkspaceQuotas","id",t);let i="/v1/admin/workspaces/{id}/quotas".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.period=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},listWorkspaceUsages:async(t,n,r,i={})=>{de("listWorkspaceUsages","id",t),de("listWorkspaceUsages","type",n);let s="/v1/admin/workspaces/{id}/usages".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};n!==void 0&&(u.type=n),r!==void 0&&(u.period=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listWorkspaces:async(t,n={})=>{let r="/v1/admin/workspaces",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={},l={};t!==void 0&&(l.nextToken=t),oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},{url:ae(i),options:o}},patchState:async(t,n,r,i,s={})=>{de("patchState","type",t),de("patchState","id",n),de("patchState","name",r);let o="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(n))).replace("{name}",encodeURIComponent(String(r))),a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"PATCH",...l,...s},u={},d={};u["Content-Type"]="application/json",oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},c.data=Je(i,c,e),{url:ae(a),options:c}},removeParticipant:async(t,n,r={})=>{de("removeParticipant","id",t),de("removeParticipant","userId",n);let i="/v1/chat/conversations/{id}/participants/{userId}".replace("{id}",encodeURIComponent(String(t))).replace("{userId}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"DELETE",...o,...r},l={};oe(s,{});let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:ae(s),options:a}},renameTableColumn:async(t,n,r={})=>{de("renameTableColumn","table",t);let i="/v1/tables/{table}/column".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},runVrl:async(t,n={})=>{let r="/v1/admin/helper/vrl",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},searchFiles:async(t,n,r,i,s={})=>{de("searchFiles","botId",t),de("searchFiles","query",n);let o="/v1/files/bot/{botId}/search".replace("{botId}",encodeURIComponent(String(t))),a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"GET",...l,...s},u={},d={};r!==void 0&&(d.tags=r),n!==void 0&&(d.query=n),i!==void 0&&(d.limit=i),oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},{url:ae(a),options:c}},setAccountPreference:async(t,n,r={})=>{de("setAccountPreference","key",t);let i="/v1/admin/account/preferences/{key}".replace("{key}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},setState:async(t,n,r,i,s={})=>{de("setState","type",t),de("setState","id",n),de("setState","name",r);let o="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(n))).replace("{name}",encodeURIComponent(String(r))),a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"POST",...l,...s},u={},d={};u["Content-Type"]="application/json",oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},c.data=Je(i,c,e),{url:ae(a),options:c}},setWorkspacePaymentMethod:async(t,n,r={})=>{de("setWorkspacePaymentMethod","id",t);let i="/v1/admin/workspaces/{id}/billing/payment-method".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},transferBot:async(t,n,r={})=>{de("transferBot","id",t);let i="/v1/admin/bots/{id}/transfer".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateAccount:async(t,n={})=>{let r="/v1/admin/account/me",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"PUT",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},updateBot:async(t,n,r={})=>{de("updateBot","id",t);let i="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateConversation:async(t,n,r={})=>{de("updateConversation","id",t);let i="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateFileMetadata:async(t,n,r={})=>{de("updateFileMetadata","id",t);let i="/v1/files/{id}/metadata".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateIntegration:async(t,n,r={})=>{de("updateIntegration","id",t);let i="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateMessage:async(t,n,r={})=>{de("updateMessage","id",t);let i="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateTable:async(t,n,r={})=>{de("updateTable","table",t);let i="/v1/tables/{table}".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateTableRows:async(t,n,r={})=>{de("updateTableRows","table",t);let i="/v1/tables/{table}/rows".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateTask:async(t,n,r={})=>{de("updateTask","id",t);let i="/v1/chat/tasks/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateUser:async(t,n,r={})=>{de("updateUser","id",t);let i="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateWorkspace:async(t,n,r={})=>{de("updateWorkspace","id",t);let i="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateWorkspaceMember:async(t,n,r={})=>{de("updateWorkspaceMember","id",t);let i="/v1/admin/workspace-members/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},upsertTableRows:async(t,n,r={})=>{de("upsertTableRows","table",t);let i="/v1/tables/{table}/rows/upsert".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}}}},ce=function(e){let t=x$(e);return{async addParticipant(n,r,i){let s=await t.addParticipant(n,r,i);return le(s,X,ie,e)},async breakDownWorkspaceUsageByBot(n,r,i,s){let o=await t.breakDownWorkspaceUsageByBot(n,r,i,s);return le(o,X,ie,e)},async callAction(n,r){let i=await t.callAction(n,r);return le(i,X,ie,e)},async changeAISpendQuota(n,r){let i=await t.changeAISpendQuota(n,r);return le(i,X,ie,e)},async changeWorkspacePlan(n,r,i){let s=await t.changeWorkspacePlan(n,r,i);return le(s,X,ie,e)},async chargeWorkspaceUnpaidInvoices(n,r,i){let s=await t.chargeWorkspaceUnpaidInvoices(n,r,i);return le(s,X,ie,e)},async checkHandleAvailability(n,r){let i=await t.checkHandleAvailability(n,r);return le(i,X,ie,e)},async configureIntegration(n,r){let i=await t.configureIntegration(n,r);return le(i,X,ie,e)},async createBot(n,r){let i=await t.createBot(n,r);return le(i,X,ie,e)},async createConversation(n,r){let i=await t.createConversation(n,r);return le(i,X,ie,e)},async createEvent(n,r){let i=await t.createEvent(n,r);return le(i,X,ie,e)},async createFile(n,r,i,s,o,a,l,c){let u=await t.createFile(n,r,i,s,o,a,l,c);return le(u,X,ie,e)},async createIntegration(n,r){let i=await t.createIntegration(n,r);return le(i,X,ie,e)},async createMessage(n,r){let i=await t.createMessage(n,r);return le(i,X,ie,e)},async createPersonalAccessToken(n,r){let i=await t.createPersonalAccessToken(n,r);return le(i,X,ie,e)},async createTable(n,r){let i=await t.createTable(n,r);return le(i,X,ie,e)},async createTableRows(n,r,i){let s=await t.createTableRows(n,r,i);return le(s,X,ie,e)},async createTask(n,r){let i=await t.createTask(n,r);return le(i,X,ie,e)},async createUser(n,r){let i=await t.createUser(n,r);return le(i,X,ie,e)},async createWorkspace(n,r){let i=await t.createWorkspace(n,r);return le(i,X,ie,e)},async createWorkspaceMember(n,r){let i=await t.createWorkspaceMember(n,r);return le(i,X,ie,e)},async deleteBot(n,r){let i=await t.deleteBot(n,r);return le(i,X,ie,e)},async deleteBotIssue(n,r,i){let s=await t.deleteBotIssue(n,r,i);return le(s,X,ie,e)},async deleteConversation(n,r){let i=await t.deleteConversation(n,r);return le(i,X,ie,e)},async deleteFile(n,r){let i=await t.deleteFile(n,r);return le(i,X,ie,e)},async deleteIntegration(n,r){let i=await t.deleteIntegration(n,r);return le(i,X,ie,e)},async deleteMessage(n,r){let i=await t.deleteMessage(n,r);return le(i,X,ie,e)},async deletePersonalAccessToken(n,r){let i=await t.deletePersonalAccessToken(n,r);return le(i,X,ie,e)},async deleteTable(n,r){let i=await t.deleteTable(n,r);return le(i,X,ie,e)},async deleteTableRows(n,r,i){let s=await t.deleteTableRows(n,r,i);return le(s,X,ie,e)},async deleteTask(n,r){let i=await t.deleteTask(n,r);return le(i,X,ie,e)},async deleteUser(n,r){let i=await t.deleteUser(n,r);return le(i,X,ie,e)},async deleteWorkspace(n,r){let i=await t.deleteWorkspace(n,r);return le(i,X,ie,e)},async deleteWorkspaceMember(n,r){let i=await t.deleteWorkspaceMember(n,r);return le(i,X,ie,e)},async findTableRows(n,r,i){let s=await t.findTableRows(n,r,i);return le(s,X,ie,e)},async getAccount(n){let r=await t.getAccount(n);return le(r,X,ie,e)},async getAccountPreference(n,r){let i=await t.getAccountPreference(n,r);return le(i,X,ie,e)},async getAllWorkspaceQuotaCompletion(n){let r=await t.getAllWorkspaceQuotaCompletion(n);return le(r,X,ie,e)},async getAuditRecords(n,r,i){let s=await t.getAuditRecords(n,r,i);return le(s,X,ie,e)},async getBot(n,r){let i=await t.getBot(n,r);return le(i,X,ie,e)},async getBotAnalytics(n,r,i,s){let o=await t.getBotAnalytics(n,r,i,s);return le(o,X,ie,e)},async getBotLogs(n,r,i,s,o){let a=await t.getBotLogs(n,r,i,s,o);return le(a,X,ie,e)},async getBotWebchat(n,r,i){let s=await t.getBotWebchat(n,r,i);return le(s,X,ie,e)},async getConversation(n,r){let i=await t.getConversation(n,r);return le(i,X,ie,e)},async getEvent(n,r){let i=await t.getEvent(n,r);return le(i,X,ie,e)},async getFileContent(n,r){let i=await t.getFileContent(n,r);return le(i,X,ie,e)},async getFileMetadata(n,r){let i=await t.getFileMetadata(n,r);return le(i,X,ie,e)},async getIntegration(n,r){let i=await t.getIntegration(n,r);return le(i,X,ie,e)},async getIntegrationByName(n,r,i){let s=await t.getIntegrationByName(n,r,i);return le(s,X,ie,e)},async getIntegrationLogs(n,r,i,s,o){let a=await t.getIntegrationLogs(n,r,i,s,o);return le(a,X,ie,e)},async getMessage(n,r){let i=await t.getMessage(n,r);return le(i,X,ie,e)},async getOrCreateConversation(n,r){let i=await t.getOrCreateConversation(n,r);return le(i,X,ie,e)},async getOrCreateMessage(n,r){let i=await t.getOrCreateMessage(n,r);return le(i,X,ie,e)},async getOrCreateUser(n,r){let i=await t.getOrCreateUser(n,r);return le(i,X,ie,e)},async getOrSetState(n,r,i,s,o){let a=await t.getOrSetState(n,r,i,s,o);return le(a,X,ie,e)},async getParticipant(n,r,i){let s=await t.getParticipant(n,r,i);return le(s,X,ie,e)},async getPublicIntegration(n,r,i){let s=await t.getPublicIntegration(n,r,i);return le(s,X,ie,e)},async getPublicIntegrationById(n,r){let i=await t.getPublicIntegrationById(n,r);return le(i,X,ie,e)},async getPublicWorkspace(n,r){let i=await t.getPublicWorkspace(n,r);return le(i,X,ie,e)},async getState(n,r,i,s){let o=await t.getState(n,r,i,s);return le(o,X,ie,e)},async getTable(n,r){let i=await t.getTable(n,r);return le(i,X,ie,e)},async getTableRow(n,r,i){let s=await t.getTableRow(n,r,i);return le(s,X,ie,e)},async getTask(n,r){let i=await t.getTask(n,r);return le(i,X,ie,e)},async getUpcomingInvoice(n,r){let i=await t.getUpcomingInvoice(n,r);return le(i,X,ie,e)},async getUsage(n,r,i,s){let o=await t.getUsage(n,r,i,s);return le(o,X,ie,e)},async getUser(n,r){let i=await t.getUser(n,r);return le(i,X,ie,e)},async getWorkspace(n,r){let i=await t.getWorkspace(n,r);return le(i,X,ie,e)},async getWorkspaceBillingDetails(n,r){let i=await t.getWorkspaceBillingDetails(n,r);return le(i,X,ie,e)},async getWorkspaceQuota(n,r,i,s){let o=await t.getWorkspaceQuota(n,r,i,s);return le(o,X,ie,e)},async introspect(n,r){let i=await t.introspect(n,r);return le(i,X,ie,e)},async listActivities(n,r,i,s){let o=await t.listActivities(n,r,i,s);return le(o,X,ie,e)},async listBotIssueEvents(n,r,i){let s=await t.listBotIssueEvents(n,r,i);return le(s,X,ie,e)},async listBotIssues(n,r,i){let s=await t.listBotIssues(n,r,i);return le(s,X,ie,e)},async listBots(n,r,i){let s=await t.listBots(n,r,i);return le(s,X,ie,e)},async listConversations(n,r,i,s){let o=await t.listConversations(n,r,i,s);return le(o,X,ie,e)},async listEvents(n,r,i,s,o,a){let l=await t.listEvents(n,r,i,s,o,a);return le(l,X,ie,e)},async listFiles(n,r,i,s){let o=await t.listFiles(n,r,i,s);return le(o,X,ie,e)},async listIntegrations(n,r,i,s,o){let a=await t.listIntegrations(n,r,i,s,o);return le(a,X,ie,e)},async listMessages(n,r,i,s){let o=await t.listMessages(n,r,i,s);return le(o,X,ie,e)},async listParticipants(n,r,i){let s=await t.listParticipants(n,r,i);return le(s,X,ie,e)},async listPersonalAccessTokens(n){let r=await t.listPersonalAccessTokens(n);return le(r,X,ie,e)},async listPublicIntegrations(n,r,i,s){let o=await t.listPublicIntegrations(n,r,i,s);return le(o,X,ie,e)},async listTables(n,r){let i=await t.listTables(n,r);return le(i,X,ie,e)},async listTasks(n,r,i,s,o,a,l,c){let u=await t.listTasks(n,r,i,s,o,a,l,c);return le(u,X,ie,e)},async listUsageHistory(n,r,i){let s=await t.listUsageHistory(n,r,i);return le(s,X,ie,e)},async listUsers(n,r,i,s){let o=await t.listUsers(n,r,i,s);return le(o,X,ie,e)},async listWorkspaceInvoices(n,r){let i=await t.listWorkspaceInvoices(n,r);return le(i,X,ie,e)},async listWorkspaceMembers(n,r){let i=await t.listWorkspaceMembers(n,r);return le(i,X,ie,e)},async listWorkspaceQuotas(n,r,i){let s=await t.listWorkspaceQuotas(n,r,i);return le(s,X,ie,e)},async listWorkspaceUsages(n,r,i,s){let o=await t.listWorkspaceUsages(n,r,i,s);return le(o,X,ie,e)},async listWorkspaces(n,r){let i=await t.listWorkspaces(n,r);return le(i,X,ie,e)},async patchState(n,r,i,s,o){let a=await t.patchState(n,r,i,s,o);return le(a,X,ie,e)},async removeParticipant(n,r,i){let s=await t.removeParticipant(n,r,i);return le(s,X,ie,e)},async renameTableColumn(n,r,i){let s=await t.renameTableColumn(n,r,i);return le(s,X,ie,e)},async runVrl(n,r){let i=await t.runVrl(n,r);return le(i,X,ie,e)},async searchFiles(n,r,i,s,o){let a=await t.searchFiles(n,r,i,s,o);return le(a,X,ie,e)},async setAccountPreference(n,r,i){let s=await t.setAccountPreference(n,r,i);return le(s,X,ie,e)},async setState(n,r,i,s,o){let a=await t.setState(n,r,i,s,o);return le(a,X,ie,e)},async setWorkspacePaymentMethod(n,r,i){let s=await t.setWorkspacePaymentMethod(n,r,i);return le(s,X,ie,e)},async transferBot(n,r,i){let s=await t.transferBot(n,r,i);return le(s,X,ie,e)},async updateAccount(n,r){let i=await t.updateAccount(n,r);return le(i,X,ie,e)},async updateBot(n,r,i){let s=await t.updateBot(n,r,i);return le(s,X,ie,e)},async updateConversation(n,r,i){let s=await t.updateConversation(n,r,i);return le(s,X,ie,e)},async updateFileMetadata(n,r,i){let s=await t.updateFileMetadata(n,r,i);return le(s,X,ie,e)},async updateIntegration(n,r,i){let s=await t.updateIntegration(n,r,i);return le(s,X,ie,e)},async updateMessage(n,r,i){let s=await t.updateMessage(n,r,i);return le(s,X,ie,e)},async updateTable(n,r,i){let s=await t.updateTable(n,r,i);return le(s,X,ie,e)},async updateTableRows(n,r,i){let s=await t.updateTableRows(n,r,i);return le(s,X,ie,e)},async updateTask(n,r,i){let s=await t.updateTask(n,r,i);return le(s,X,ie,e)},async updateUser(n,r,i){let s=await t.updateUser(n,r,i);return le(s,X,ie,e)},async updateWorkspace(n,r,i){let s=await t.updateWorkspace(n,r,i);return le(s,X,ie,e)},async updateWorkspaceMember(n,r,i){let s=await t.updateWorkspaceMember(n,r,i);return le(s,X,ie,e)},async upsertTableRows(n,r,i){let s=await t.upsertTableRows(n,r,i);return le(s,X,ie,e)}}},_$=class extends b${addParticipant(t,n){return ce(this.configuration).addParticipant(t.id,t.addParticipantBody,n).then(r=>r(this.axios,this.basePath))}breakDownWorkspaceUsageByBot(t,n){return ce(this.configuration).breakDownWorkspaceUsageByBot(t.id,t.type,t.period,n).then(r=>r(this.axios,this.basePath))}callAction(t={},n){return ce(this.configuration).callAction(t.callActionBody,n).then(r=>r(this.axios,this.basePath))}changeAISpendQuota(t={},n){return ce(this.configuration).changeAISpendQuota(t.changeAISpendQuotaBody,n).then(r=>r(this.axios,this.basePath))}changeWorkspacePlan(t,n){return ce(this.configuration).changeWorkspacePlan(t.id,t.changeWorkspacePlanBody,n).then(r=>r(this.axios,this.basePath))}chargeWorkspaceUnpaidInvoices(t,n){return ce(this.configuration).chargeWorkspaceUnpaidInvoices(t.id,t.chargeWorkspaceUnpaidInvoicesBody,n).then(r=>r(this.axios,this.basePath))}checkHandleAvailability(t={},n){return ce(this.configuration).checkHandleAvailability(t.checkHandleAvailabilityBody,n).then(r=>r(this.axios,this.basePath))}configureIntegration(t={},n){return ce(this.configuration).configureIntegration(t.configureIntegrationBody,n).then(r=>r(this.axios,this.basePath))}createBot(t={},n){return ce(this.configuration).createBot(t.createBotBody,n).then(r=>r(this.axios,this.basePath))}createConversation(t={},n){return ce(this.configuration).createConversation(t.createConversationBody,n).then(r=>r(this.axios,this.basePath))}createEvent(t={},n){return ce(this.configuration).createEvent(t.createEventBody,n).then(r=>r(this.axios,this.basePath))}createFile(t,n){return ce(this.configuration).createFile(t.xName,t.xTags,t.xAccessPolicies,t.xIndex,t.contentType,t.contentLength,t.createFileBody,n).then(r=>r(this.axios,this.basePath))}createIntegration(t={},n){return ce(this.configuration).createIntegration(t.createIntegrationBody,n).then(r=>r(this.axios,this.basePath))}createMessage(t={},n){return ce(this.configuration).createMessage(t.createMessageBody,n).then(r=>r(this.axios,this.basePath))}createPersonalAccessToken(t={},n){return ce(this.configuration).createPersonalAccessToken(t.createPersonalAccessTokenBody,n).then(r=>r(this.axios,this.basePath))}createTable(t={},n){return ce(this.configuration).createTable(t.createTableBody,n).then(r=>r(this.axios,this.basePath))}createTableRows(t,n){return ce(this.configuration).createTableRows(t.table,t.createTableRowsBody,n).then(r=>r(this.axios,this.basePath))}createTask(t={},n){return ce(this.configuration).createTask(t.createTaskBody,n).then(r=>r(this.axios,this.basePath))}createUser(t={},n){return ce(this.configuration).createUser(t.createUserBody,n).then(r=>r(this.axios,this.basePath))}createWorkspace(t={},n){return ce(this.configuration).createWorkspace(t.createWorkspaceBody,n).then(r=>r(this.axios,this.basePath))}createWorkspaceMember(t={},n){return ce(this.configuration).createWorkspaceMember(t.createWorkspaceMemberBody,n).then(r=>r(this.axios,this.basePath))}deleteBot(t,n){return ce(this.configuration).deleteBot(t.id,n).then(r=>r(this.axios,this.basePath))}deleteBotIssue(t,n){return ce(this.configuration).deleteBotIssue(t.id,t.issueId,n).then(r=>r(this.axios,this.basePath))}deleteConversation(t,n){return ce(this.configuration).deleteConversation(t.id,n).then(r=>r(this.axios,this.basePath))}deleteFile(t,n){return ce(this.configuration).deleteFile(t.id,n).then(r=>r(this.axios,this.basePath))}deleteIntegration(t,n){return ce(this.configuration).deleteIntegration(t.id,n).then(r=>r(this.axios,this.basePath))}deleteMessage(t,n){return ce(this.configuration).deleteMessage(t.id,n).then(r=>r(this.axios,this.basePath))}deletePersonalAccessToken(t,n){return ce(this.configuration).deletePersonalAccessToken(t.id,n).then(r=>r(this.axios,this.basePath))}deleteTable(t,n){return ce(this.configuration).deleteTable(t.table,n).then(r=>r(this.axios,this.basePath))}deleteTableRows(t,n){return ce(this.configuration).deleteTableRows(t.table,t.deleteTableRowsBody,n).then(r=>r(this.axios,this.basePath))}deleteTask(t,n){return ce(this.configuration).deleteTask(t.id,n).then(r=>r(this.axios,this.basePath))}deleteUser(t,n){return ce(this.configuration).deleteUser(t.id,n).then(r=>r(this.axios,this.basePath))}deleteWorkspace(t,n){return ce(this.configuration).deleteWorkspace(t.id,n).then(r=>r(this.axios,this.basePath))}deleteWorkspaceMember(t,n){return ce(this.configuration).deleteWorkspaceMember(t.id,n).then(r=>r(this.axios,this.basePath))}findTableRows(t,n){return ce(this.configuration).findTableRows(t.table,t.findTableRowsBody,n).then(r=>r(this.axios,this.basePath))}getAccount(t){return ce(this.configuration).getAccount(t).then(n=>n(this.axios,this.basePath))}getAccountPreference(t,n){return ce(this.configuration).getAccountPreference(t.key,n).then(r=>r(this.axios,this.basePath))}getAllWorkspaceQuotaCompletion(t){return ce(this.configuration).getAllWorkspaceQuotaCompletion(t).then(n=>n(this.axios,this.basePath))}getAuditRecords(t,n){return ce(this.configuration).getAuditRecords(t.id,t.nextToken,n).then(r=>r(this.axios,this.basePath))}getBot(t,n){return ce(this.configuration).getBot(t.id,n).then(r=>r(this.axios,this.basePath))}getBotAnalytics(t,n){return ce(this.configuration).getBotAnalytics(t.id,t.startDate,t.endDate,n).then(r=>r(this.axios,this.basePath))}getBotLogs(t,n){return ce(this.configuration).getBotLogs(t.id,t.timeStart,t.timeEnd,t.nextToken,n).then(r=>r(this.axios,this.basePath))}getBotWebchat(t,n){return ce(this.configuration).getBotWebchat(t.id,t.type,n).then(r=>r(this.axios,this.basePath))}getConversation(t,n){return ce(this.configuration).getConversation(t.id,n).then(r=>r(this.axios,this.basePath))}getEvent(t,n){return ce(this.configuration).getEvent(t.id,n).then(r=>r(this.axios,this.basePath))}getFileContent(t,n){return ce(this.configuration).getFileContent(t.id,n).then(r=>r(this.axios,this.basePath))}getFileMetadata(t,n){return ce(this.configuration).getFileMetadata(t.id,n).then(r=>r(this.axios,this.basePath))}getIntegration(t,n){return ce(this.configuration).getIntegration(t.id,n).then(r=>r(this.axios,this.basePath))}getIntegrationByName(t,n){return ce(this.configuration).getIntegrationByName(t.name,t.version,n).then(r=>r(this.axios,this.basePath))}getIntegrationLogs(t,n){return ce(this.configuration).getIntegrationLogs(t.id,t.timeStart,t.timeEnd,t.nextToken,n).then(r=>r(this.axios,this.basePath))}getMessage(t,n){return ce(this.configuration).getMessage(t.id,n).then(r=>r(this.axios,this.basePath))}getOrCreateConversation(t={},n){return ce(this.configuration).getOrCreateConversation(t.getOrCreateConversationBody,n).then(r=>r(this.axios,this.basePath))}getOrCreateMessage(t={},n){return ce(this.configuration).getOrCreateMessage(t.getOrCreateMessageBody,n).then(r=>r(this.axios,this.basePath))}getOrCreateUser(t={},n){return ce(this.configuration).getOrCreateUser(t.getOrCreateUserBody,n).then(r=>r(this.axios,this.basePath))}getOrSetState(t,n){return ce(this.configuration).getOrSetState(t.type,t.id,t.name,t.getOrSetStateBody,n).then(r=>r(this.axios,this.basePath))}getParticipant(t,n){return ce(this.configuration).getParticipant(t.id,t.userId,n).then(r=>r(this.axios,this.basePath))}getPublicIntegration(t,n){return ce(this.configuration).getPublicIntegration(t.name,t.version,n).then(r=>r(this.axios,this.basePath))}getPublicIntegrationById(t,n){return ce(this.configuration).getPublicIntegrationById(t.id,n).then(r=>r(this.axios,this.basePath))}getPublicWorkspace(t,n){return ce(this.configuration).getPublicWorkspace(t.id,n).then(r=>r(this.axios,this.basePath))}getState(t,n){return ce(this.configuration).getState(t.type,t.id,t.name,n).then(r=>r(this.axios,this.basePath))}getTable(t,n){return ce(this.configuration).getTable(t.table,n).then(r=>r(this.axios,this.basePath))}getTableRow(t,n){return ce(this.configuration).getTableRow(t.table,t.id,n).then(r=>r(this.axios,this.basePath))}getTask(t,n){return ce(this.configuration).getTask(t.id,n).then(r=>r(this.axios,this.basePath))}getUpcomingInvoice(t,n){return ce(this.configuration).getUpcomingInvoice(t.id,n).then(r=>r(this.axios,this.basePath))}getUsage(t,n){return ce(this.configuration).getUsage(t.type,t.id,t.period,n).then(r=>r(this.axios,this.basePath))}getUser(t,n){return ce(this.configuration).getUser(t.id,n).then(r=>r(this.axios,this.basePath))}getWorkspace(t,n){return ce(this.configuration).getWorkspace(t.id,n).then(r=>r(this.axios,this.basePath))}getWorkspaceBillingDetails(t,n){return ce(this.configuration).getWorkspaceBillingDetails(t.id,n).then(r=>r(this.axios,this.basePath))}getWorkspaceQuota(t,n){return ce(this.configuration).getWorkspaceQuota(t.id,t.type,t.period,n).then(r=>r(this.axios,this.basePath))}introspect(t={},n){return ce(this.configuration).introspect(t.introspectBody,n).then(r=>r(this.axios,this.basePath))}listActivities(t,n){return ce(this.configuration).listActivities(t.taskId,t.botId,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listBotIssueEvents(t,n){return ce(this.configuration).listBotIssueEvents(t.id,t.issueId,n).then(r=>r(this.axios,this.basePath))}listBotIssues(t,n){return ce(this.configuration).listBotIssues(t.id,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listBots(t={},n){return ce(this.configuration).listBots(t.dev,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listConversations(t={},n){return ce(this.configuration).listConversations(t.nextToken,t.tags,t.participantIds,n).then(r=>r(this.axios,this.basePath))}listEvents(t={},n){return ce(this.configuration).listEvents(t.nextToken,t.type,t.conversationId,t.userId,t.messageId,n).then(r=>r(this.axios,this.basePath))}listFiles(t,n){return ce(this.configuration).listFiles(t.botId,t.nextToken,t.tags,n).then(r=>r(this.axios,this.basePath))}listIntegrations(t={},n){return ce(this.configuration).listIntegrations(t.nextToken,t.name,t.version,t.dev,n).then(r=>r(this.axios,this.basePath))}listMessages(t={},n){return ce(this.configuration).listMessages(t.nextToken,t.conversationId,t.tags,n).then(r=>r(this.axios,this.basePath))}listParticipants(t,n){return ce(this.configuration).listParticipants(t.id,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listPersonalAccessTokens(t){return ce(this.configuration).listPersonalAccessTokens(t).then(n=>n(this.axios,this.basePath))}listPublicIntegrations(t={},n){return ce(this.configuration).listPublicIntegrations(t.nextToken,t.name,t.version,n).then(r=>r(this.axios,this.basePath))}listTables(t={},n){return ce(this.configuration).listTables(t.tags,n).then(r=>r(this.axios,this.basePath))}listTasks(t={},n){return ce(this.configuration).listTasks(t.nextToken,t.tags,t.conversationId,t.userId,t.parentTaskId,t.status,t.type,n).then(r=>r(this.axios,this.basePath))}listUsageHistory(t,n){return ce(this.configuration).listUsageHistory(t.type,t.id,n).then(r=>r(this.axios,this.basePath))}listUsers(t={},n){return ce(this.configuration).listUsers(t.nextToken,t.conversationId,t.tags,n).then(r=>r(this.axios,this.basePath))}listWorkspaceInvoices(t,n){return ce(this.configuration).listWorkspaceInvoices(t.id,n).then(r=>r(this.axios,this.basePath))}listWorkspaceMembers(t={},n){return ce(this.configuration).listWorkspaceMembers(t.nextToken,n).then(r=>r(this.axios,this.basePath))}listWorkspaceQuotas(t,n){return ce(this.configuration).listWorkspaceQuotas(t.id,t.period,n).then(r=>r(this.axios,this.basePath))}listWorkspaceUsages(t,n){return ce(this.configuration).listWorkspaceUsages(t.id,t.type,t.period,n).then(r=>r(this.axios,this.basePath))}listWorkspaces(t={},n){return ce(this.configuration).listWorkspaces(t.nextToken,n).then(r=>r(this.axios,this.basePath))}patchState(t,n){return ce(this.configuration).patchState(t.type,t.id,t.name,t.patchStateBody,n).then(r=>r(this.axios,this.basePath))}removeParticipant(t,n){return ce(this.configuration).removeParticipant(t.id,t.userId,n).then(r=>r(this.axios,this.basePath))}renameTableColumn(t,n){return ce(this.configuration).renameTableColumn(t.table,t.renameTableColumnBody,n).then(r=>r(this.axios,this.basePath))}runVrl(t={},n){return ce(this.configuration).runVrl(t.runVrlBody,n).then(r=>r(this.axios,this.basePath))}searchFiles(t,n){return ce(this.configuration).searchFiles(t.botId,t.query,t.tags,t.limit,n).then(r=>r(this.axios,this.basePath))}setAccountPreference(t,n){return ce(this.configuration).setAccountPreference(t.key,t.setAccountPreferenceBody,n).then(r=>r(this.axios,this.basePath))}setState(t,n){return ce(this.configuration).setState(t.type,t.id,t.name,t.setStateBody,n).then(r=>r(this.axios,this.basePath))}setWorkspacePaymentMethod(t,n){return ce(this.configuration).setWorkspacePaymentMethod(t.id,t.setWorkspacePaymentMethodBody,n).then(r=>r(this.axios,this.basePath))}transferBot(t,n){return ce(this.configuration).transferBot(t.id,t.transferBotBody,n).then(r=>r(this.axios,this.basePath))}updateAccount(t={},n){return ce(this.configuration).updateAccount(t.updateAccountBody,n).then(r=>r(this.axios,this.basePath))}updateBot(t,n){return ce(this.configuration).updateBot(t.id,t.updateBotBody,n).then(r=>r(this.axios,this.basePath))}updateConversation(t,n){return ce(this.configuration).updateConversation(t.id,t.updateConversationBody,n).then(r=>r(this.axios,this.basePath))}updateFileMetadata(t,n){return ce(this.configuration).updateFileMetadata(t.id,t.updateFileMetadataBody,n).then(r=>r(this.axios,this.basePath))}updateIntegration(t,n){return ce(this.configuration).updateIntegration(t.id,t.updateIntegrationBody,n).then(r=>r(this.axios,this.basePath))}updateMessage(t,n){return ce(this.configuration).updateMessage(t.id,t.updateMessageBody,n).then(r=>r(this.axios,this.basePath))}updateTable(t,n){return ce(this.configuration).updateTable(t.table,t.updateTableBody,n).then(r=>r(this.axios,this.basePath))}updateTableRows(t,n){return ce(this.configuration).updateTableRows(t.table,t.updateTableRowsBody,n).then(r=>r(this.axios,this.basePath))}updateTask(t,n){return ce(this.configuration).updateTask(t.id,t.updateTaskBody,n).then(r=>r(this.axios,this.basePath))}updateUser(t,n){return ce(this.configuration).updateUser(t.id,t.updateUserBody,n).then(r=>r(this.axios,this.basePath))}updateWorkspace(t,n){return ce(this.configuration).updateWorkspace(t.id,t.updateWorkspaceBody,n).then(r=>r(this.axios,this.basePath))}updateWorkspaceMember(t,n){return ce(this.configuration).updateWorkspaceMember(t.id,t.updateWorkspaceMemberBody,n).then(r=>r(this.axios,this.basePath))}upsertTableRows(t,n){return ce(this.configuration).upsertTableRows(t.table,t.upsertTableRowsBody,n).then(r=>r(this.axios,this.basePath))}},k$={getRandomValues:e=>new Uint8Array(e.map(()=>Math.floor(Math.random()*256)))},Uu=typeof window<"u"&&typeof window.document<"u"?window.crypto:_u;Uu.getRandomValues||(Uu=k$);var xt=class extends Error{constructor(n,r,i,s,o,a){super(s);E(this,"isApiError",!0);this.code=n,this.description=r,this.type=i,this.message=s,this.error=o,this.id=a,this.id||(this.id=xt.generateId())}format(){return`[${this.type}] ${this.message} (Error ID: ${this.id})`}toJSON(){return{id:this.id,code:this.code,type:this.type,message:this.message}}static generateId(){let n=this.getPrefix(),r=new Date().toISOString().replace(/[\-:TZ]/g,"").split(".")[0],i=4,s=Array.from(Uu.getRandomValues(new Uint8Array(i))).map(o=>o.toString(16).padStart(2,"0")).join("").toUpperCase();return`${n}_${r}x${s}`}static getPrefix(){return typeof window<"u"&&typeof window.document<"u"?"err_bwsr":"err"}},C$=e=>typeof e=="object"&&!Array.isArray(e)&&e!==null,Jg=e=>e instanceof xt||C$(e)&&e.isApiError===!0,Qi=class extends xt{constructor(e,t,n){super(500,"An unknown error occurred","Unknown",e,t,n)}},Gg=class extends xt{constructor(t,n,r){super(500,"An internal error occurred","Internal",t,n,r)}},Yg=class extends xt{constructor(e,t,n){super(401,"The request requires to be authenticated.","Unauthorized",e,t,n)}},Qg=class extends xt{constructor(t,n,r){super(403,"The requested action can't be peform by this resource.","Forbidden",t,n,r)}},Xg=class extends xt{constructor(t,n,r){super(413,"The request payload is too large.","PayloadTooLarge",t,n,r)}},ey=class extends xt{constructor(t,n,r){super(400,"The request payload is invalid.","InvalidPayload",t,n,r)}},ty=class extends xt{constructor(t,n,r){super(415,"The request is invalid because the content-type is not supported.","UnsupportedMediaType",t,n,r)}},ny=class extends xt{constructor(t,n,r){super(405,"The requested method does not exist.","MethodNotFound",t,n,r)}},ry=class extends xt{constructor(t,n,r){super(404,"The requested resource does not exist.","ResourceNotFound",t,n,r)}},iy=class extends xt{constructor(t,n,r){super(400,"The provided JSON schema is invalid.","InvalidJsonSchema",t,n,r)}},sy=class extends xt{constructor(t,n,r){super(400,"The provided data doesn't respect the provided JSON schema.","InvalidDataFormat",t,n,r)}},oy=class extends xt{constructor(t,n,r){super(400,"The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.","InvalidIdentifier",t,n,r)}},ay=class extends xt{constructor(e,t,n){super(409,"The resource is related with a different resource that the one referenced in the request. This is usually caused when providing two resource identifiers that aren't linked together.","RelationConflict",e,t,n)}},ly=class extends xt{constructor(t,n,r){super(409,"The resource cannot be deleted because it's referenced by another resource","ReferenceConstraint",t,n,r)}},cy=class extends xt{constructor(t,n,r){super(400,"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.","ReferenceNotFound",t,n,r)}},uy=class extends xt{constructor(t,n,r){super(400,"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.","InvalidQuery",t,n,r)}},dy=class extends xt{constructor(t,n,r){super(400,"An error happened during the execution of a runtime (bot or integration).","Runtime",t,n,r)}},fy=class extends xt{constructor(t,n,r){super(409,"The record attempted to be created already exists.","AlreadyExists",t,n,r)}},hy=class extends xt{constructor(t,n,r){super(429,"The request has been rate limited.","RateLimited",t,n,r)}},py=class extends xt{constructor(t,n,r){super(402,"A payment is required to perform this request.","PaymentRequired",t,n,r)}},my=class extends xt{constructor(t,n,r){super(403,"The request exceeds the allowed quota. Quotas are a soft limit that can be increased.","QuotaExceeded",t,n,r)}},gy=class extends xt{constructor(t,n,r){super(413,"The request exceeds the allowed limit. Limits are a hard limit that cannot be increased.","LimitExceeded",t,n,r)}},E$={Unknown:Qi,Internal:Gg,Unauthorized:Yg,Forbidden:Qg,PayloadTooLarge:Xg,InvalidPayload:ey,UnsupportedMediaType:ty,MethodNotFound:ny,ResourceNotFound:ry,InvalidJsonSchema:iy,InvalidDataFormat:sy,InvalidIdentifier:oy,RelationConflict:ay,ReferenceConstraint:ly,ReferenceNotFound:cy,InvalidQuery:uy,Runtime:dy,AlreadyExists:fy,RateLimited:hy,PaymentRequired:py,QuotaExceeded:my,LimitExceeded:gy},qs=e=>Jg(e)?e:e instanceof Error?new Qi(e.message,e):typeof e=="string"?new Qi(e):S$(e);function S$(e){if(typeof e=="object"&&"code"in e&&"type"in e&&"id"in e&&"message"in e&&typeof e.type=="string"&&typeof e.message=="string"){let t=E$[e.type];return t?new t(e.message,void 0,e.id||"UNKNOWN"):new Qi(`An unclassified API error occurred: ${e.message} (Type: ${e.type}, Code: ${e.code})`)}return new Qi("An invalid error occurred: "+JSON.stringify(e))}var T$=class{constructor(t,n,r){E(this,"_innerClient");E(this,"createConversation",t=>this._innerClient.createConversation({createConversationBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getConversation",t=>this._innerClient.getConversation(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listConversations",t=>this._innerClient.listConversations(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getOrCreateConversation",t=>this._innerClient.getOrCreateConversation({getOrCreateConversationBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateConversation",({id:t,...n})=>this._innerClient.updateConversation({id:t,updateConversationBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"deleteConversation",t=>this._innerClient.deleteConversation(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listParticipants",t=>this._innerClient.listParticipants(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"addParticipant",({id:t,...n})=>this._innerClient.addParticipant({id:t,addParticipantBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"getParticipant",t=>this._innerClient.getParticipant(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"removeParticipant",t=>this._innerClient.removeParticipant(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createEvent",t=>this._innerClient.createEvent({createEventBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getEvent",t=>this._innerClient.getEvent(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listEvents",t=>this._innerClient.listEvents(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createMessage",t=>this._innerClient.createMessage({createMessageBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getOrCreateMessage",t=>this._innerClient.getOrCreateMessage({getOrCreateMessageBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getMessage",t=>this._innerClient.getMessage(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateMessage",({id:t,...n})=>this._innerClient.updateMessage({id:t,updateMessageBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"listMessages",t=>this._innerClient.listMessages(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"deleteMessage",t=>this._innerClient.deleteMessage(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createUser",t=>this._innerClient.createUser({createUserBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getUser",t=>this._innerClient.getUser(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listUsers",t=>this._innerClient.listUsers(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getOrCreateUser",t=>this._innerClient.getOrCreateUser({getOrCreateUserBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateUser",({id:t,...n})=>this._innerClient.updateUser({id:t,updateUserBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"deleteUser",t=>this._innerClient.deleteUser(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getState",t=>this._innerClient.getState(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"setState",({type:t,id:n,name:r,...i})=>this._innerClient.setState({type:t,id:n,name:r,setStateBody:i}).then(s=>s.data).catch(s=>{throw ue(s)}));E(this,"getOrSetState",({type:t,id:n,name:r,...i})=>this._innerClient.getOrSetState({type:t,id:n,name:r,getOrSetStateBody:i}).then(s=>s.data).catch(s=>{throw ue(s)}));E(this,"patchState",({type:t,id:n,name:r,...i})=>this._innerClient.patchState({type:t,id:n,name:r,patchStateBody:i}).then(s=>s.data).catch(s=>{throw ue(s)}));E(this,"callAction",t=>this._innerClient.callAction({callActionBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"configureIntegration",t=>this._innerClient.configureIntegration({configureIntegrationBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getTask",t=>this._innerClient.getTask(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createTask",t=>this._innerClient.createTask({createTaskBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateTask",({id:t,...n})=>this._innerClient.updateTask({id:t,updateTaskBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"deleteTask",t=>this._innerClient.deleteTask(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listTasks",t=>this._innerClient.listTasks(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"runVrl",t=>this._innerClient.runVrl({runVrlBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getAccount",()=>this._innerClient.getAccount().then(t=>t.data).catch(t=>{throw ue(t)}));E(this,"updateAccount",t=>this._innerClient.updateAccount({updateAccountBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listPersonalAccessTokens",()=>this._innerClient.listPersonalAccessTokens().then(t=>t.data).catch(t=>{throw ue(t)}));E(this,"createPersonalAccessToken",t=>this._innerClient.createPersonalAccessToken({createPersonalAccessTokenBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"deletePersonalAccessToken",t=>this._innerClient.deletePersonalAccessToken(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"setAccountPreference",({key:t,...n})=>this._innerClient.setAccountPreference({key:t,setAccountPreferenceBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"getAccountPreference",t=>this._innerClient.getAccountPreference(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listPublicIntegrations",t=>this._innerClient.listPublicIntegrations(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getPublicIntegrationById",t=>this._innerClient.getPublicIntegrationById(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getPublicIntegration",t=>this._innerClient.getPublicIntegration(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createBot",t=>this._innerClient.createBot({createBotBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateBot",({id:t,...n})=>this._innerClient.updateBot({id:t,updateBotBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"transferBot",({id:t,...n})=>this._innerClient.transferBot({id:t,transferBotBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"listBots",t=>this._innerClient.listBots(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getBot",t=>this._innerClient.getBot(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"deleteBot",t=>this._innerClient.deleteBot(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getBotLogs",t=>this._innerClient.getBotLogs(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getBotWebchat",t=>this._innerClient.getBotWebchat(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getBotAnalytics",t=>this._innerClient.getBotAnalytics(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listBotIssues",t=>this._innerClient.listBotIssues(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"deleteBotIssue",t=>this._innerClient.deleteBotIssue(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listBotIssueEvents",t=>this._innerClient.listBotIssueEvents(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getWorkspaceBillingDetails",t=>this._innerClient.getWorkspaceBillingDetails(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"setWorkspacePaymentMethod",({id:t,...n})=>this._innerClient.setWorkspacePaymentMethod({id:t,setWorkspacePaymentMethodBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"listWorkspaceInvoices",t=>this._innerClient.listWorkspaceInvoices(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getUpcomingInvoice",t=>this._innerClient.getUpcomingInvoice(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"chargeWorkspaceUnpaidInvoices",({id:t,...n})=>this._innerClient.chargeWorkspaceUnpaidInvoices({id:t,chargeWorkspaceUnpaidInvoicesBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"createWorkspace",t=>this._innerClient.createWorkspace({createWorkspaceBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getPublicWorkspace",t=>this._innerClient.getPublicWorkspace(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getWorkspace",t=>this._innerClient.getWorkspace(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listWorkspaceUsages",t=>this._innerClient.listWorkspaceUsages(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"breakDownWorkspaceUsageByBot",t=>this._innerClient.breakDownWorkspaceUsageByBot(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getAllWorkspaceQuotaCompletion",()=>this._innerClient.getAllWorkspaceQuotaCompletion().then(t=>t.data).catch(t=>{throw ue(t)}));E(this,"getWorkspaceQuota",t=>this._innerClient.getWorkspaceQuota(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listWorkspaceQuotas",t=>this._innerClient.listWorkspaceQuotas(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateWorkspace",({id:t,...n})=>this._innerClient.updateWorkspace({id:t,updateWorkspaceBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"checkHandleAvailability",t=>this._innerClient.checkHandleAvailability({checkHandleAvailabilityBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listWorkspaces",t=>this._innerClient.listWorkspaces(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"changeWorkspacePlan",({id:t,...n})=>this._innerClient.changeWorkspacePlan({id:t,changeWorkspacePlanBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"deleteWorkspace",t=>this._innerClient.deleteWorkspace(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getAuditRecords",t=>this._innerClient.getAuditRecords(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listWorkspaceMembers",t=>this._innerClient.listWorkspaceMembers(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"deleteWorkspaceMember",t=>this._innerClient.deleteWorkspaceMember(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createWorkspaceMember",t=>this._innerClient.createWorkspaceMember({createWorkspaceMemberBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateWorkspaceMember",({id:t,...n})=>this._innerClient.updateWorkspaceMember({id:t,updateWorkspaceMemberBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"createIntegration",t=>this._innerClient.createIntegration({createIntegrationBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateIntegration",({id:t,...n})=>this._innerClient.updateIntegration({id:t,updateIntegrationBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"listIntegrations",t=>this._innerClient.listIntegrations(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getIntegration",t=>this._innerClient.getIntegration(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getIntegrationLogs",t=>this._innerClient.getIntegrationLogs(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getIntegrationByName",t=>this._innerClient.getIntegrationByName(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"deleteIntegration",t=>this._innerClient.deleteIntegration(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getUsage",t=>this._innerClient.getUsage(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listUsageHistory",t=>this._innerClient.listUsageHistory(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"changeAISpendQuota",t=>this._innerClient.changeAISpendQuota({changeAISpendQuotaBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listActivities",t=>this._innerClient.listActivities(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"introspect",t=>this._innerClient.introspect({introspectBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createFile",({xName:t,xTags:n,xAccessPolicies:r,xIndex:i,contentType:s,contentLength:o,...a})=>this._innerClient.createFile({xName:t,xTags:n,xAccessPolicies:r,xIndex:i,contentType:s,contentLength:o,createFileBody:a}).then(l=>l.data).catch(l=>{throw ue(l)}));E(this,"deleteFile",t=>this._innerClient.deleteFile(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listFiles",t=>this._innerClient.listFiles(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getFileMetadata",t=>this._innerClient.getFileMetadata(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getFileContent",t=>this._innerClient.getFileContent(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateFileMetadata",({id:t,...n})=>this._innerClient.updateFileMetadata({id:t,updateFileMetadataBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"searchFiles",t=>this._innerClient.searchFiles(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listTables",t=>this._innerClient.listTables(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getTable",t=>this._innerClient.getTable(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createTable",t=>this._innerClient.createTable({createTableBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateTable",({table:t,...n})=>this._innerClient.updateTable({table:t,updateTableBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"renameTableColumn",({table:t,...n})=>this._innerClient.renameTableColumn({table:t,renameTableColumnBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"deleteTable",t=>this._innerClient.deleteTable(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getTableRow",t=>this._innerClient.getTableRow(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"findTableRows",({table:t,...n})=>this._innerClient.findTableRows({table:t,findTableRowsBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"createTableRows",({table:t,...n})=>this._innerClient.createTableRows({table:t,createTableRowsBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"deleteTableRows",({table:t,...n})=>this._innerClient.deleteTableRows({table:t,deleteTableRowsBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"updateTableRows",({table:t,...n})=>this._innerClient.updateTableRows({table:t,updateTableRowsBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"upsertTableRows",({table:t,...n})=>this._innerClient.upsertTableRows({table:t,upsertTableRowsBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));this._innerClient=new _$(t,n,r)}};function ue(e){var t;return X.isAxiosError(e)&&((t=e.response)!=null&&t.data)?qs(e.response.data):qs(e)}var yy=100*1024*1024,O$=yy,I$=yy,P$=class extends T${constructor(n={}){let r=g$(n),i=A$(r);super(void 0,r.apiUrl,i);E(this,"config");E(this,"axiosClient");E(this,"createFile",async({name:n,data:r,index:i,tags:s,contentType:o,contentLength:a,accessPolicies:l})=>{let c={...this.config.headers,"x-name":n,"x-tags":s?JSON.stringify(s):void 0,"x-index":i?"true":"false","x-access-policies":(l==null?void 0:l.join(","))??void 0,"content-type":o??!1,"content-length":a};return(await this.axiosClient.post("/v1/files",r,{headers:c,baseURL:this.config.apiUrl}).catch(u=>{throw R$(u)})).data});this.axiosClient=i,this.config=r}};function A$(e){let{headers:t,withCredentials:n,timeout:r}=e;return X.create({headers:t,withCredentials:n,timeout:r,maxBodyLength:O$,maxContentLength:I$,httpAgent:Nu?new a$.default.Agent({keepAlive:!0}):void 0,httpsAgent:Nu?new l$.default.Agent({keepAlive:!0}):void 0})}function R$(e){var t;return X.isAxiosError(e)&&((t=e.response)!=null&&t.data)?qs(e.response.data):qs(e)}const vy=Cl(Object.freeze(Object.defineProperty({__proto__:null,AlreadyExistsError:fy,Client:P$,ForbiddenError:Qg,InternalError:Gg,InvalidDataFormatError:sy,InvalidIdentifierError:oy,InvalidJsonSchemaError:iy,InvalidPayloadError:ey,InvalidQueryError:uy,LimitExceededError:gy,MethodNotFoundError:ny,PayloadTooLargeError:Xg,PaymentRequiredError:py,QuotaExceededError:my,RateLimitedError:hy,ReferenceConstraintError:ly,ReferenceNotFoundError:cy,RelationConflictError:ay,ResourceNotFoundError:ry,RuntimeError:dy,UnauthorizedError:Yg,UnknownError:Qi,UnsupportedMediaTypeError:ty,axios:HR,errorFrom:qs,isApiError:Jg},Symbol.toStringTag,{value:"Module"})));var $$=Object.create,Ua=Object.defineProperty,M$=Object.getOwnPropertyDescriptor,L$=Object.getOwnPropertyNames,D$=Object.getPrototypeOf,N$=Object.prototype.hasOwnProperty,by=(e,t)=>{for(var n in t)Ua(e,n,{get:t[n],enumerable:!0})},wy=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of L$(t))!N$.call(e,i)&&i!==n&&Ua(e,i,{get:()=>t[i],enumerable:!(r=M$(t,i))||r.enumerable});return e},xy=(e,t,n)=>(n=e!=null?$$(D$(e)):{},wy(t||!e||!e.__esModule?Ua(n,"default",{value:e,enumerable:!0}):n,e)),j$=e=>wy(Ua({},"__esModule",{value:!0}),e),_y={};by(_y,{Bot:()=>CM,BotSpecificClient:()=>$y,Integration:()=>pM,IntegrationDefinition:()=>rM,IntegrationSpecificClient:()=>Ay,botIdHeader:()=>Fu,botUserIdHeader:()=>Sy,configurationHeader:()=>Bu,integrationIdHeader:()=>Ty,messages:()=>ky,operationHeader:()=>Vu,parseBody:()=>wr,serve:()=>zu,typeHeader:()=>Iy,webhookIdHeader:()=>Oy});var U$=j$(_y),ky={};by(ky,{defaults:()=>K$});var Rt=Oa,fn=Rt.z.string().min(1),F$=Rt.z.object({text:fn}),B$=Rt.z.object({markdown:fn}),V$=Rt.z.object({imageUrl:fn}),z$=Rt.z.object({audioUrl:fn}),Z$=Rt.z.object({videoUrl:fn}),W$=Rt.z.object({fileUrl:fn,title:fn.optional()}),H$=Rt.z.object({latitude:Rt.z.number(),longitude:Rt.z.number(),address:Rt.z.string().optional(),title:Rt.z.string().optional()}),Cy=Rt.z.object({title:fn,subtitle:fn.optional(),imageUrl:fn.optional(),actions:Rt.z.array(Rt.z.object({action:Rt.z.enum(["postback","url","say"]),label:fn,value:fn}))}),Ey=Rt.z.object({text:fn,options:Rt.z.array(Rt.z.object({label:fn,value:fn}))}),q$=Rt.z.object({items:Rt.z.array(Cy)}),K$={text:{schema:F$},markdown:{schema:B$},image:{schema:V$},audio:{schema:z$},video:{schema:Z$},file:{schema:W$},location:{schema:H$},carousel:{schema:q$},card:{schema:Cy},dropdown:{schema:Ey},choice:{schema:Ey}},Fu="x-bot-id",Sy="x-bot-user-id",Ty="x-integration-id",Oy="x-webhook-id",Bu="x-bp-configuration",Vu="x-bp-operation",Iy="x-bp-type",J$=fg,Fa=console;function wr(e){if(!e.body)throw new Error("Missing body");return JSON.parse(e.body)}async function zu(e,t=8072,n=X$){let r=(0,J$.createServer)(async(i,s)=>{try{let o=await G$(i);if(o.path==="/health"){s.writeHead(200).end("ok");return}let a=await e(o);s.writeHead((a==null?void 0:a.status)??200,(a==null?void 0:a.headers)??{}).end((a==null?void 0:a.body)??"{}")}catch(o){Fa.error("Error while handling request",{error:(o==null?void 0:o.message)??"Internal error occured"}),s.writeHead(500).end(JSON.stringify({error:(o==null?void 0:o.message)??"Internal error occured"}))}});return r.listen(t,()=>n(t)),r}async function G$(e){var i;let t=await Q$(e),n={};for(let s=0;s<e.rawHeaders.length;s+=2){let o=e.rawHeaders[s].toLowerCase(),a=e.rawHeaders[s+1];n[o]=a}let r=new URL(e.url??"",e.headers.host?`http://${e.headers.host}`:"http://botpress.cloud");return{body:t,path:r.pathname,query:Y$(r.search,"?"),headers:n,method:((i=e.method)==null?void 0:i.toUpperCase())??"GET"}}function Y$(e,t){return e.indexOf(t)===0?e.slice(t.length):e}async function Q$(e){return new Promise((t,n)=>{if(e.method!=="POST"&&e.method!=="PUT"&&e.method!=="PATCH")return t(void 0);let r="";e.on("data",i=>r+=i.toString()),e.on("error",i=>n(i)),e.on("end",()=>t(r))})}function X$(e){Fa.info(`Listening on port ${e}`)}var eM=Oa,tM=eM.z.enum(["webhook_received","message_created","action_triggered","register","unregister","ping","create_user","create_conversation"]),nM=e=>{let t=e[Fu],n=e[Sy],r=e[Ty],i=e[Oy],s=e[Bu],o=tM.parse(e[Vu]);if(!t)throw new Error("Missing bot headers");if(!n)throw new Error("Missing bot user headers");if(!r)throw new Error("Missing integration headers");if(!i)throw new Error("Missing webhook headers");if(!s)throw new Error("Missing configuration headers");if(!o)throw new Error("Missing operation headers");return{botId:t,botUserId:n,integrationId:r,webhookId:i,operation:o,configuration:s?JSON.parse(Buffer.from(s,"base64").toString("utf-8")):{}}},rM=class{constructor(e){E(this,"name");E(this,"version");E(this,"title");E(this,"description");E(this,"icon");E(this,"readme");E(this,"configuration");E(this,"events");E(this,"actions");E(this,"channels");E(this,"states");E(this,"user");E(this,"secrets");E(this,"identifier");E(this,"entities");this.props=e,this.name=e.name,this.version=e.version,this.icon=e.icon,this.readme=e.readme,this.title=e.title,this.identifier=e.identifier,this.description=e.description,this.configuration=e.configuration,this.events=e.events,this.actions=e.actions,this.channels=e.channels,this.states=e.states,this.user=e.user,this.secrets=e.secrets,this.entities=e.entities}},Py=vy,Ay=class{constructor(e){E(this,"createConversation",e=>this.client.createConversation(e));E(this,"getConversation",e=>this.client.getConversation(e));E(this,"listConversations",e=>this.client.listConversations(e));E(this,"getOrCreateConversation",e=>this.client.getOrCreateConversation(e));E(this,"updateConversation",e=>this.client.updateConversation(e));E(this,"deleteConversation",e=>this.client.deleteConversation(e));E(this,"listParticipants",e=>this.client.listParticipants(e));E(this,"addParticipant",e=>this.client.addParticipant(e));E(this,"getParticipant",e=>this.client.getParticipant(e));E(this,"removeParticipant",e=>this.client.removeParticipant(e));E(this,"createEvent",e=>this.client.createEvent(e));E(this,"getEvent",e=>this.client.getEvent(e));E(this,"listEvents",e=>this.client.listEvents(e));E(this,"createMessage",e=>this.client.createMessage(e));E(this,"getOrCreateMessage",e=>this.client.getOrCreateMessage(e));E(this,"getMessage",e=>this.client.getMessage(e));E(this,"updateMessage",e=>this.client.updateMessage(e));E(this,"listMessages",e=>this.client.listMessages(e));E(this,"deleteMessage",e=>this.client.deleteMessage(e));E(this,"createUser",e=>this.client.createUser(e));E(this,"getUser",e=>this.client.getUser(e));E(this,"listUsers",e=>this.client.listUsers(e));E(this,"getOrCreateUser",e=>this.client.getOrCreateUser(e));E(this,"updateUser",e=>this.client.updateUser(e));E(this,"deleteUser",e=>this.client.deleteUser(e));E(this,"getState",e=>this.client.getState(e));E(this,"setState",e=>this.client.setState(e));E(this,"getOrSetState",e=>this.client.getOrSetState(e));E(this,"patchState",e=>this.client.patchState(e));E(this,"configureIntegration",e=>this.client.configureIntegration(e));this.client=e}},Ry=xy(fg),Ba=e=>{if(process.env.BP_LOG_FORMAT==="json")return JSON.stringify({msg:Ry.default.format(...e),visible_to_bot_owner:!0});{let[t,...n]=e;return Ry.default.format(`[For Bot Owner] ${t}`,...n)}},iM={forBot:()=>({info:(...e)=>{console.info(Ba(e))},warn:(...e)=>{console.warn(Ba(e))},error:(...e)=>{console.error(Ba(e))},debug:(...e)=>{console.debug(Ba(e))}})},sM=e=>async t=>{let n=nM(t.headers),r=new Ay(new Py.Client({botId:n.botId,integrationId:n.integrationId})),i={ctx:n,req:t,client:r,logger:iM,instance:e};try{let s;switch(n.operation){case"webhook_received":s=await aM(i);break;case"register":s=await lM(i);break;case"unregister":s=await cM(i);break;case"message_created":s=await fM(i);break;case"action_triggered":s=await hM(i);break;case"ping":s=await oM(i);break;case"create_user":s=await uM(i);break;case"create_conversation":s=await dM(i);break;default:throw new Error(`Unknown operation ${n.operation}`)}return s?{...s,status:s.status??200}:{status:200}}catch(s){if(s instanceof Py.RuntimeError)return{status:s.code,body:JSON.stringify(s.toJSON())};throw s}},oM=async e=>{},aM=async({client:e,ctx:t,req:n,logger:r,instance:i})=>{let{req:s}=wr(n);return i.webhook({client:e,ctx:t,req:s,logger:r})},lM=async({client:e,ctx:t,req:n,logger:r,instance:i})=>{if(!i.register)return;let{webhookUrl:s}=wr(n);await i.register({client:e,ctx:t,webhookUrl:s,logger:r})},cM=async({client:e,ctx:t,req:n,logger:r,instance:i})=>{if(!i.unregister)return;let{webhookUrl:s}=wr(n);await i.unregister({ctx:t,webhookUrl:s,client:e,logger:r})},uM=async({client:e,ctx:t,req:n,logger:r,instance:i})=>{if(!i.createUser)return;let{tags:s}=wr(n);return await i.createUser({ctx:t,client:e,tags:s,logger:r})},dM=async({client:e,ctx:t,req:n,logger:r,instance:i})=>{if(!i.createConversation)return;let{channel:s,tags:o}=wr(n);return await i.createConversation({ctx:t,client:e,channel:s,tags:o,logger:r})},fM=async({ctx:e,req:t,client:n,logger:r,instance:i})=>{let{conversation:s,user:o,type:a,payload:l,message:c}=wr(t),u=i.channels[s.channel];if(!u)throw new Error(`Channel ${s.channel} not found`);let d=u.messages[a];if(!d)throw new Error(`Message of type ${a} not found in channel ${s.channel}`);await d({ctx:e,conversation:s,message:c,user:o,type:a,client:n,payload:l,ack:async({tags:h})=>{await n.updateMessage({id:c.id,tags:h})},logger:r})},hM=async({req:e,ctx:t,client:n,logger:r,instance:i})=>{let{input:s,type:o}=wr(e);if(!o)throw new Error("Missing action type");let a=i.actions[o];if(!a)throw new Error(`Action ${o} not found`);let l=await a({ctx:t,input:s,client:n,type:o,logger:r});return{body:JSON.stringify({output:l})}},pM=class{constructor(e){E(this,"props");E(this,"actions");E(this,"channels");E(this,"register");E(this,"unregister");E(this,"createUser");E(this,"createConversation");E(this,"webhook");E(this,"handler",sM(this));E(this,"start",e=>zu(this.handler,e));this.props=e,this.actions=e.actions,this.channels=e.channels,this.register=e.register,this.unregister=e.unregister,this.createUser=e.createUser,this.createConversation=e.createConversation,this.webhook=e.handler}},mM=xy(vy),$y=class{constructor(e){E(this,"getConversation",e=>this.client.getConversation(e));E(this,"listConversations",e=>this.client.listConversations(e));E(this,"updateConversation",e=>this.client.updateConversation(e));E(this,"deleteConversation",e=>this.client.deleteConversation(e));E(this,"listParticipants",e=>this.client.listParticipants(e));E(this,"addParticipant",e=>this.client.addParticipant(e));E(this,"getParticipant",e=>this.client.getParticipant(e));E(this,"removeParticipant",e=>this.client.removeParticipant(e));E(this,"getEvent",e=>this.client.getEvent(e));E(this,"listEvents",e=>this.client.listEvents(e));E(this,"createMessage",e=>this.client.createMessage(e));E(this,"getOrCreateMessage",e=>this.client.getOrCreateMessage(e));E(this,"getMessage",e=>this.client.getMessage(e));E(this,"updateMessage",e=>this.client.updateMessage(e));E(this,"listMessages",e=>this.client.listMessages(e));E(this,"deleteMessage",e=>this.client.deleteMessage(e));E(this,"getUser",e=>this.client.getUser(e));E(this,"listUsers",e=>this.client.listUsers(e));E(this,"updateUser",e=>this.client.updateUser(e));E(this,"deleteUser",e=>this.client.deleteUser(e));E(this,"getState",e=>this.client.getState(e).then(t=>({state:{...t.state,payload:t.state.payload}})));E(this,"setState",e=>this.client.setState(e).then(t=>({state:{...t.state,payload:t.state.payload}})));E(this,"getOrSetState",e=>this.client.getOrSetState(e).then(t=>({state:{...t.state,payload:t.state.payload}})));E(this,"patchState",e=>this.client.patchState(e).then(t=>({state:{...t.state,payload:t.state.payload}})));E(this,"callAction",e=>this.client.callAction(e));E(this,"createConversation",e=>this.client.createConversation(e));E(this,"getOrCreateConversation",e=>this.client.getOrCreateConversation(e));E(this,"createUser",e=>this.client.createUser(e));E(this,"getOrCreateUser",e=>this.client.getOrCreateUser(e));this.client=e}},gM=Oa,yM=gM.z.enum(["event_received","register","unregister","ping","action_triggered"]),vM=e=>{let t=e[Fu],n=e[Bu],r=e[Iy],i=yM.parse(e[Vu]);if(!t)throw new Error("Missing bot headers");if(!r)throw new Error("Missing type headers");if(!n)throw new Error("Missing configuration headers");if(!i)throw new Error("Missing operation headers");return{botId:t,operation:i,type:r,configuration:n?JSON.parse(Buffer.from(n,"base64").toString("utf-8")):{}}},bM=e=>async t=>{let n=vM(t.headers);n.operation!=="ping"&&Fa.info(`Received ${n.operation} operation for bot ${n.botId} of type ${n.type}`);let r=new $y(new mM.Client({botId:n.botId})),i={req:t,ctx:n,client:r,instance:e};switch(n.operation){case"action_triggered":throw new Error(`Operation ${n.operation} not supported yet`);case"event_received":await kM(i);break;case"register":await xM();break;case"unregister":await _M();break;case"ping":await wM();break;default:throw new Error(`Unknown operation ${n.operation}`)}return{status:200}},wM=async e=>{},xM=async e=>{},_M=async e=>{},kM=async({ctx:e,req:t,client:n,instance:r})=>{Fa.debug(`Received event ${e.type}`);let i=wr(t),s=i.event;switch(e.type){case"message_created":let o={user:s.payload.user,conversation:s.payload.conversation,message:s.payload.message,states:s.payload.states,event:s};await Promise.all(r.messageHandlers.map(c=>c({client:n,ctx:e,...o})));break;case"state_expired":let a={state:s.payload.state};await Promise.all(r.stateExpiredHandlers.map(c=>c({client:n,ctx:e,...a})));break;default:let l={event:i.event};await Promise.all(r.eventHandlers.map(c=>c({client:n,ctx:e,...l})))}},CM=class{constructor(e){E(this,"_state",{messageHandlers:[],eventHandlers:[],stateExpiredHandlers:[]});E(this,"props");E(this,"message",e=>{this._state.messageHandlers.push(e)});E(this,"event",e=>{this._state.eventHandlers.push(e)});E(this,"stateExpired",e=>{this._state.stateExpiredHandlers.push(e)});E(this,"handler",bM(this._state));E(this,"start",e=>zu(this.handler,e));this.props=e}},dt;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},e.getValidEnumValues=i=>{const s=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(s){return i[s]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},e.find=(i,s)=>{for(const o of i)if(s(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(dt||(dt={}));var Zu;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Zu||(Zu={}));const Oe=dt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Hr=e=>{switch(typeof e){case"undefined":return Oe.undefined;case"string":return Oe.string;case"number":return isNaN(e)?Oe.nan:Oe.number;case"boolean":return Oe.boolean;case"function":return Oe.function;case"bigint":return Oe.bigint;case"symbol":return Oe.symbol;case"object":return Array.isArray(e)?Oe.array:e===null?Oe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Oe.promise:typeof Map<"u"&&e instanceof Map?Oe.map:typeof Set<"u"&&e instanceof Set?Oe.set:typeof Date<"u"&&e instanceof Date?Oe.date:Oe.object;default:return Oe.unknown}},we=dt.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"]),EM=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Bn extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(o))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,dt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Bn.create=e=>new Bn(e);const Ks=(e,t)=>{let n;switch(e.code){case we.invalid_type:e.received===Oe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case we.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,dt.jsonStringifyReplacer)}`;break;case we.unrecognized_keys:n=`Unrecognized key(s) in object: ${dt.joinValues(e.keys,", ")}`;break;case we.invalid_union:n="Invalid input";break;case we.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${dt.joinValues(e.options)}`;break;case we.invalid_enum_value:n=`Invalid enum value. Expected ${dt.joinValues(e.options)}, received '${e.received}'`;break;case we.invalid_arguments:n="Invalid function arguments";break;case we.invalid_return_type:n="Invalid function return type";break;case we.invalid_date:n="Invalid date";break;case we.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:dt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case we.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case we.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case we.custom:n="Invalid input";break;case we.invalid_intersection_types:n="Intersection results could not be merged";break;case we.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case we.not_finite:n="Number must be finite";break;default:n=t.defaultError,dt.assertNever(e)}return{message:n}};let My=Ks;function SM(e){My=e}function Va(){return My}const za=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,s=[...n,...i.path||[]],o={...i,path:s};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(o,{data:t,defaultError:a}).message;return{...i,path:s,message:i.message||a}},TM=[];function Ae(e,t){const n=za({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Va(),Ks].filter(r=>!!r)});e.common.issues.push(n)}class ln{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return Qe;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return ln.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return Qe;s.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:t.value,value:r}}}const Qe=Object.freeze({status:"aborted"}),Ly=e=>({status:"dirty",value:e}),hn=e=>({status:"valid",value:e}),Wu=e=>e.status==="aborted",Hu=e=>e.status==="dirty",Js=e=>e.status==="valid",Za=e=>typeof Promise<"u"&&e instanceof Promise;var Ve;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ve||(Ve={}));class rr{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Dy=(e,t)=>{if(Js(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Bn(e.common.issues);return this._error=n,this._error}}};function Xe(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},description:i}}class tt{constructor(t){this.spa=this.safeParseAsync,this._def=t,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)}get description(){return this._def.description}_getType(t){return Hr(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Hr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ln,ctx:{common:t.parent.common,data:t.data,parsedType:Hr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Za(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Hr(t)},s=this._parseSync({data:t,path:i.path,parent:i});return Dy(i,s)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Hr(t)},i=this._parse({data:t,path:r.path,parent:r}),s=await(Za(i)?i:Promise.resolve(i));return Dy(r,s)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const o=t(i),a=()=>s.addIssue({code:we.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Zn({schema:this,typeName:He.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return _r.create(this,this._def)}nullable(){return ki.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return zn.create(this,this._def)}promise(){return ns.create(this,this._def)}or(t){return Xs.create([this,t],this._def)}and(t){return eo.create(this,t,this._def)}transform(t){return new Zn({...Xe(this._def),schema:this,typeName:He.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new so({...Xe(this._def),innerType:this,defaultValue:n,typeName:He.ZodDefault})}brand(){return new jy({typeName:He.ZodBranded,type:this,...Xe(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Ga({...Xe(this._def),innerType:this,catchValue:n,typeName:He.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return oo.create(this,t)}readonly(){return Qa.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const OM=/^c[^\s-]{8,}$/i,IM=/^[a-z][a-z0-9]*$/,PM=/^[0-9A-HJKMNP-TV-Z]{26}$/,AM=/^[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,RM=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,$M="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let qu;const MM=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,LM=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,DM=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function NM(e,t){return!!((t==="v4"||!t)&&MM.test(e)||(t==="v6"||!t)&&LM.test(e))}class Vn extends tt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Oe.string){const s=this._getOrReturnCtx(t);return Ae(s,{code:we.invalid_type,expected:Oe.string,received:s.parsedType}),Qe}const r=new ln;let i;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(i=this._getOrReturnCtx(t,i),Ae(i,{code:we.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")t.data.length>s.value&&(i=this._getOrReturnCtx(t,i),Ae(i,{code:we.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const o=t.data.length>s.value,a=t.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(t,i),o?Ae(i,{code:we.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&Ae(i,{code:we.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")RM.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"email",code:we.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")qu||(qu=new RegExp($M,"u")),qu.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"emoji",code:we.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")AM.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"uuid",code:we.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")OM.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"cuid",code:we.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")IM.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"cuid2",code:we.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")PM.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"ulid",code:we.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),Ae(i,{validation:"url",code:we.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"regex",code:we.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(t,i),Ae(i,{code:we.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(i=this._getOrReturnCtx(t,i),Ae(i,{code:we.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(i=this._getOrReturnCtx(t,i),Ae(i,{code:we.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?DM(s).test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{code:we.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="ip"?NM(t.data,s.version)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"ip",code:we.invalid_string,message:s.message}),r.dirty()):dt.assertNever(s);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:we.invalid_string,...Ve.errToObj(r)})}_addCheck(t){return new Vn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ve.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ve.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ve.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ve.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ve.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ve.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ve.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ve.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...Ve.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ve.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ve.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ve.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ve.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ve.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ve.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ve.errToObj(n)})}nonempty(t){return this.min(1,Ve.errToObj(t))}trim(){return new Vn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Vn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Vn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Vn.create=e=>{var t;return new Vn({checks:[],typeName:He.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Xe(e)})};function jM(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,s=parseInt(e.toFixed(i).replace(".","")),o=parseInt(t.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}class qr extends tt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Oe.number){const s=this._getOrReturnCtx(t);return Ae(s,{code:we.invalid_type,expected:Oe.number,received:s.parsedType}),Qe}let r;const i=new ln;for(const s of this._def.checks)s.kind==="int"?dt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Ae(r,{code:we.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:we.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:we.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?jM(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:we.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Ae(r,{code:we.not_finite,message:s.message}),i.dirty()):dt.assertNever(s);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ve.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ve.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ve.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ve.toString(n))}setLimit(t,n,r,i){return new qr({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ve.toString(i)}]})}_addCheck(t){return new qr({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ve.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ve.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ve.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ve.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ve.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ve.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ve.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ve.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ve.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&dt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}qr.create=e=>new qr({checks:[],typeName:He.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Xe(e)});class Kr extends tt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Oe.bigint){const s=this._getOrReturnCtx(t);return Ae(s,{code:we.invalid_type,expected:Oe.bigint,received:s.parsedType}),Qe}let r;const i=new ln;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:we.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:we.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:we.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):dt.assertNever(s);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ve.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ve.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ve.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ve.toString(n))}setLimit(t,n,r,i){return new Kr({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ve.toString(i)}]})}_addCheck(t){return new Kr({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ve.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ve.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ve.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ve.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ve.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Kr.create=e=>{var t;return new Kr({checks:[],typeName:He.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Xe(e)})};class Gs extends tt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Oe.boolean){const r=this._getOrReturnCtx(t);return Ae(r,{code:we.invalid_type,expected:Oe.boolean,received:r.parsedType}),Qe}return hn(t.data)}}Gs.create=e=>new Gs({typeName:He.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Xe(e)});class wi extends tt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Oe.date){const s=this._getOrReturnCtx(t);return Ae(s,{code:we.invalid_type,expected:Oe.date,received:s.parsedType}),Qe}if(isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return Ae(s,{code:we.invalid_date}),Qe}const r=new ln;let i;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(i=this._getOrReturnCtx(t,i),Ae(i,{code:we.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(i=this._getOrReturnCtx(t,i),Ae(i,{code:we.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):dt.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new wi({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ve.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ve.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}wi.create=e=>new wi({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:He.ZodDate,...Xe(e)});class Wa extends tt{_parse(t){if(this._getType(t)!==Oe.symbol){const r=this._getOrReturnCtx(t);return Ae(r,{code:we.invalid_type,expected:Oe.symbol,received:r.parsedType}),Qe}return hn(t.data)}}Wa.create=e=>new Wa({typeName:He.ZodSymbol,...Xe(e)});class Ys extends tt{_parse(t){if(this._getType(t)!==Oe.undefined){const r=this._getOrReturnCtx(t);return Ae(r,{code:we.invalid_type,expected:Oe.undefined,received:r.parsedType}),Qe}return hn(t.data)}}Ys.create=e=>new Ys({typeName:He.ZodUndefined,...Xe(e)});class Qs extends tt{_parse(t){if(this._getType(t)!==Oe.null){const r=this._getOrReturnCtx(t);return Ae(r,{code:we.invalid_type,expected:Oe.null,received:r.parsedType}),Qe}return hn(t.data)}}Qs.create=e=>new Qs({typeName:He.ZodNull,...Xe(e)});class Xi extends tt{constructor(){super(...arguments),this._any=!0}_parse(t){return hn(t.data)}}Xi.create=e=>new Xi({typeName:He.ZodAny,...Xe(e)});class xi extends tt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return hn(t.data)}}xi.create=e=>new xi({typeName:He.ZodUnknown,...Xe(e)});class xr extends tt{_parse(t){const n=this._getOrReturnCtx(t);return Ae(n,{code:we.invalid_type,expected:Oe.never,received:n.parsedType}),Qe}}xr.create=e=>new xr({typeName:He.ZodNever,...Xe(e)});class Ha extends tt{_parse(t){if(this._getType(t)!==Oe.undefined){const r=this._getOrReturnCtx(t);return Ae(r,{code:we.invalid_type,expected:Oe.void,received:r.parsedType}),Qe}return hn(t.data)}}Ha.create=e=>new Ha({typeName:He.ZodVoid,...Xe(e)});class zn extends tt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==Oe.array)return Ae(n,{code:we.invalid_type,expected:Oe.array,received:n.parsedType}),Qe;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(Ae(n,{code:o?we.too_big:we.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Ae(n,{code:we.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Ae(n,{code:we.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,a)=>i.type._parseAsync(new rr(n,o,n.path,a)))).then(o=>ln.mergeArray(r,o));const s=[...n.data].map((o,a)=>i.type._parseSync(new rr(n,o,n.path,a)));return ln.mergeArray(r,s)}get element(){return this._def.type}min(t,n){return new zn({...this._def,minLength:{value:t,message:Ve.toString(n)}})}max(t,n){return new zn({...this._def,maxLength:{value:t,message:Ve.toString(n)}})}length(t,n){return new zn({...this._def,exactLength:{value:t,message:Ve.toString(n)}})}nonempty(t){return this.min(1,t)}}zn.create=(e,t)=>new zn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:He.ZodArray,...Xe(t)});function es(e){if(e instanceof kt){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=_r.create(es(r))}return new kt({...e._def,shape:()=>t})}else return e instanceof zn?new zn({...e._def,type:es(e.element)}):e instanceof _r?_r.create(es(e.unwrap())):e instanceof ki?ki.create(es(e.unwrap())):e instanceof ir?ir.create(e.items.map(t=>es(t))):e}class kt extends tt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=dt.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==Oe.object){const c=this._getOrReturnCtx(t);return Ae(c,{code:we.invalid_type,expected:Oe.object,received:c.parsedType}),Qe}const{status:r,ctx:i}=this._processInputParams(t),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof xr&&this._def.unknownKeys==="strip"))for(const c in i.data)o.includes(c)||a.push(c);const l=[];for(const c of o){const u=s[c],d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new rr(i,d,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof xr){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")a.length>0&&(Ae(i,{code:we.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new rr(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key;c.push({key:d,value:await u.value,alwaysSet:u.alwaysSet})}return c}).then(c=>ln.mergeObjectSync(r,c)):ln.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return Ve.errToObj,new kt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,s,o,a;const l=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=Ve.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new kt({...this._def,unknownKeys:"strip"})}passthrough(){return new kt({...this._def,unknownKeys:"passthrough"})}extend(t){return new kt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new kt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:He.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new kt({...this._def,catchall:t})}pick(t){const n={};return dt.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new kt({...this._def,shape:()=>n})}omit(t){const n={};return dt.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new kt({...this._def,shape:()=>n})}deepPartial(){return es(this)}partial(t){const n={};return dt.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new kt({...this._def,shape:()=>n})}required(t){const n={};return dt.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof _r;)s=s._def.innerType;n[r]=s}}),new kt({...this._def,shape:()=>n})}keyof(){return Ny(dt.objectKeys(this.shape))}}kt.create=(e,t)=>new kt({shape:()=>e,unknownKeys:"strip",catchall:xr.create(),typeName:He.ZodObject,...Xe(t)}),kt.strictCreate=(e,t)=>new kt({shape:()=>e,unknownKeys:"strict",catchall:xr.create(),typeName:He.ZodObject,...Xe(t)}),kt.lazycreate=(e,t)=>new kt({shape:e,unknownKeys:"strip",catchall:xr.create(),typeName:He.ZodObject,...Xe(t)});class Xs extends tt{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Bn(a.ctx.common.issues));return Ae(n,{code:we.invalid_union,unionErrors:o}),Qe}if(n.common.async)return Promise.all(r.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!s&&(s={result:u,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(l=>new Bn(l));return Ae(n,{code:we.invalid_union,unionErrors:a}),Qe}}get options(){return this._def.options}}Xs.create=(e,t)=>new Xs({options:e,typeName:He.ZodUnion,...Xe(t)});const qa=e=>e instanceof no?qa(e.schema):e instanceof Zn?qa(e.innerType()):e instanceof ro?[e.value]:e instanceof Jr?e.options:e instanceof io?Object.keys(e.enum):e instanceof so?qa(e._def.innerType):e instanceof Ys?[void 0]:e instanceof Qs?[null]:null;class Ka extends tt{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.object)return Ae(n,{code:we.invalid_type,expected:Oe.object,received:n.parsedType}),Qe;const r=this.discriminator,i=n.data[r],s=this.optionsMap.get(i);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(Ae(n,{code:we.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Qe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const s of n){const o=qa(s.shape[t]);if(!o)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,s)}}return new Ka({typeName:He.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Xe(r)})}}function Ku(e,t){const n=Hr(e),r=Hr(t);if(e===t)return{valid:!0,data:e};if(n===Oe.object&&r===Oe.object){const i=dt.objectKeys(t),s=dt.objectKeys(e).filter(a=>i.indexOf(a)!==-1),o={...e,...t};for(const a of s){const l=Ku(e[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(n===Oe.array&&r===Oe.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let s=0;s<e.length;s++){const o=e[s],a=t[s],l=Ku(o,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===Oe.date&&r===Oe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class eo extends tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(s,o)=>{if(Wu(s)||Wu(o))return Qe;const a=Ku(s.value,o.value);return a.valid?((Hu(s)||Hu(o))&&n.dirty(),{status:n.value,value:a.data}):(Ae(r,{code:we.invalid_intersection_types}),Qe)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}eo.create=(e,t,n)=>new eo({left:e,right:t,typeName:He.ZodIntersection,...Xe(n)});class ir extends tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.array)return Ae(r,{code:we.invalid_type,expected:Oe.array,received:r.parsedType}),Qe;if(r.data.length<this._def.items.length)return Ae(r,{code:we.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Qe;!this._def.rest&&r.data.length>this._def.items.length&&(Ae(r,{code:we.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new rr(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>ln.mergeArray(n,o)):ln.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new ir({...this._def,rest:t})}}ir.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ir({items:e,typeName:He.ZodTuple,rest:null,...Xe(t)})};class to extends tt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.object)return Ae(r,{code:we.invalid_type,expected:Oe.object,received:r.parsedType}),Qe;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new rr(r,a,r.path,a)),value:o._parse(new rr(r,r.data[a],r.path,a))});return r.common.async?ln.mergeObjectAsync(n,i):ln.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof tt?new to({keyType:t,valueType:n,typeName:He.ZodRecord,...Xe(r)}):new to({keyType:Vn.create(),valueType:t,typeName:He.ZodRecord,...Xe(n)})}}class Ja extends tt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.map)return Ae(r,{code:we.invalid_type,expected:Oe.map,received:r.parsedType}),Qe;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,l],c)=>({key:i._parse(new rr(r,a,r.path,[c,"key"])),value:s._parse(new rr(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Qe;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of o){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Qe;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}Ja.create=(e,t,n)=>new Ja({valueType:t,keyType:e,typeName:He.ZodMap,...Xe(n)});class _i extends tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.set)return Ae(r,{code:we.invalid_type,expected:Oe.set,received:r.parsedType}),Qe;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Ae(r,{code:we.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Ae(r,{code:we.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function o(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Qe;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>s._parse(new rr(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,n){return new _i({...this._def,minSize:{value:t,message:Ve.toString(n)}})}max(t,n){return new _i({...this._def,maxSize:{value:t,message:Ve.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}_i.create=(e,t)=>new _i({valueType:e,minSize:null,maxSize:null,typeName:He.ZodSet,...Xe(t)});class ts extends tt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.function)return Ae(n,{code:we.invalid_type,expected:Oe.function,received:n.parsedType}),Qe;function r(a,l){return za({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Va(),Ks].filter(c=>!!c),issueData:{code:we.invalid_arguments,argumentsError:l}})}function i(a,l){return za({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Va(),Ks].filter(c=>!!c),issueData:{code:we.invalid_return_type,returnTypeError:l}})}const s={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof ns){const a=this;return hn(async function(...l){const c=new Bn([]),u=await a._def.args.parseAsync(l,s).catch(f=>{throw c.addIssue(r(l,f)),c}),d=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(d,s).catch(f=>{throw c.addIssue(i(d,f)),c})})}else{const a=this;return hn(function(...l){const c=a._def.args.safeParse(l,s);if(!c.success)throw new Bn([r(l,c.error)]);const u=Reflect.apply(o,this,c.data),d=a._def.returns.safeParse(u,s);if(!d.success)throw new Bn([i(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ts({...this._def,args:ir.create(t).rest(xi.create())})}returns(t){return new ts({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new ts({args:t||ir.create([]).rest(xi.create()),returns:n||xi.create(),typeName:He.ZodFunction,...Xe(r)})}}class no extends tt{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}no.create=(e,t)=>new no({getter:e,typeName:He.ZodLazy,...Xe(t)});class ro extends tt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Ae(n,{received:n.data,code:we.invalid_literal,expected:this._def.value}),Qe}return{status:"valid",value:t.data}}get value(){return this._def.value}}ro.create=(e,t)=>new ro({value:e,typeName:He.ZodLiteral,...Xe(t)});function Ny(e,t){return new Jr({values:e,typeName:He.ZodEnum,...Xe(t)})}class Jr extends tt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Ae(n,{expected:dt.joinValues(r),received:n.parsedType,code:we.invalid_type}),Qe}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return Ae(n,{received:n.data,code:we.invalid_enum_value,options:r}),Qe}return hn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return Jr.create(t)}exclude(t){return Jr.create(this.options.filter(n=>!t.includes(n)))}}Jr.create=Ny;class io extends tt{_parse(t){const n=dt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Oe.string&&r.parsedType!==Oe.number){const i=dt.objectValues(n);return Ae(r,{expected:dt.joinValues(i),received:r.parsedType,code:we.invalid_type}),Qe}if(n.indexOf(t.data)===-1){const i=dt.objectValues(n);return Ae(r,{received:r.data,code:we.invalid_enum_value,options:i}),Qe}return hn(t.data)}get enum(){return this._def.values}}io.create=(e,t)=>new io({values:e,typeName:He.ZodNativeEnum,...Xe(t)});class ns extends tt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.promise&&n.common.async===!1)return Ae(n,{code:we.invalid_type,expected:Oe.promise,received:n.parsedType}),Qe;const r=n.parsedType===Oe.promise?n.data:Promise.resolve(n.data);return hn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ns.create=(e,t)=>new ns({type:e,typeName:He.ZodPromise,...Xe(t)});class Zn extends tt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===He.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,s={addIssue:o=>{Ae(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:o,path:r.path,parent:r})}if(i.type==="refinement"){const o=a=>{const l=i.refinement(a,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Qe:(a.status==="dirty"&&n.dirty(),o(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Qe:(a.status==="dirty"&&n.dirty(),o(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Js(o))return o;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Js(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:n.value,value:a})):o);dt.assertNever(i)}}Zn.create=(e,t,n)=>new Zn({schema:e,typeName:He.ZodEffects,effect:t,...Xe(n)}),Zn.createWithPreprocess=(e,t,n)=>new Zn({schema:t,effect:{type:"preprocess",transform:e},typeName:He.ZodEffects,...Xe(n)});class _r extends tt{_parse(t){return this._getType(t)===Oe.undefined?hn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}_r.create=(e,t)=>new _r({innerType:e,typeName:He.ZodOptional,...Xe(t)});class ki extends tt{_parse(t){return this._getType(t)===Oe.null?hn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ki.create=(e,t)=>new ki({innerType:e,typeName:He.ZodNullable,...Xe(t)});class so extends tt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}so.create=(e,t)=>new so({innerType:e,typeName:He.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Xe(t)});class Ga extends tt{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Za(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Bn(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Bn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Ga.create=(e,t)=>new Ga({innerType:e,typeName:He.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Xe(t)});class Ya extends tt{_parse(t){if(this._getType(t)!==Oe.nan){const r=this._getOrReturnCtx(t);return Ae(r,{code:we.invalid_type,expected:Oe.nan,received:r.parsedType}),Qe}return{status:"valid",value:t.data}}}Ya.create=e=>new Ya({typeName:He.ZodNaN,...Xe(e)});const UM=Symbol("zod_brand");class jy extends tt{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class oo extends tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Qe:s.status==="dirty"?(n.dirty(),Ly(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Qe:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new oo({in:t,out:n,typeName:He.ZodPipeline})}}class Qa extends tt{_parse(t){const n=this._def.innerType._parse(t);return Js(n)&&(n.value=Object.freeze(n.value)),n}}Qa.create=(e,t)=>new Qa({innerType:e,typeName:He.ZodReadonly,...Xe(t)});const Uy=(e,t={},n)=>e?Xi.create().superRefine((r,i)=>{var s,o;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(o=(s=a.fatal)!==null&&s!==void 0?s:n)!==null&&o!==void 0?o:!0,c=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...c,fatal:l})}}):Xi.create(),FM={object:kt.lazycreate};var He;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(He||(He={}));const BM=(e,t={message:`Input not instance of ${e.name}`})=>Uy(n=>n instanceof e,t),Fy=Vn.create,By=qr.create,VM=Ya.create,zM=Kr.create,Vy=Gs.create,ZM=wi.create,WM=Wa.create,HM=Ys.create,qM=Qs.create,KM=Xi.create,JM=xi.create,GM=xr.create,YM=Ha.create,QM=zn.create,XM=kt.create,eL=kt.strictCreate,tL=Xs.create,nL=Ka.create,rL=eo.create,iL=ir.create,sL=to.create,oL=Ja.create,aL=_i.create,lL=ts.create,cL=no.create,uL=ro.create,dL=Jr.create,fL=io.create,hL=ns.create,zy=Zn.create,pL=_r.create,mL=ki.create,gL=Zn.createWithPreprocess,yL=oo.create;var T=Object.freeze({__proto__:null,defaultErrorMap:Ks,setErrorMap:SM,getErrorMap:Va,makeIssue:za,EMPTY_PATH:TM,addIssueToContext:Ae,ParseStatus:ln,INVALID:Qe,DIRTY:Ly,OK:hn,isAborted:Wu,isDirty:Hu,isValid:Js,isAsync:Za,get util(){return dt},get objectUtil(){return Zu},ZodParsedType:Oe,getParsedType:Hr,ZodType:tt,ZodString:Vn,ZodNumber:qr,ZodBigInt:Kr,ZodBoolean:Gs,ZodDate:wi,ZodSymbol:Wa,ZodUndefined:Ys,ZodNull:Qs,ZodAny:Xi,ZodUnknown:xi,ZodNever:xr,ZodVoid:Ha,ZodArray:zn,ZodObject:kt,ZodUnion:Xs,ZodDiscriminatedUnion:Ka,ZodIntersection:eo,ZodTuple:ir,ZodRecord:to,ZodMap:Ja,ZodSet:_i,ZodFunction:ts,ZodLazy:no,ZodLiteral:ro,ZodEnum:Jr,ZodNativeEnum:io,ZodPromise:ns,ZodEffects:Zn,ZodTransformer:Zn,ZodOptional:_r,ZodNullable:ki,ZodDefault:so,ZodCatch:Ga,ZodNaN:Ya,BRAND:UM,ZodBranded:jy,ZodPipeline:oo,ZodReadonly:Qa,custom:Uy,Schema:tt,ZodSchema:tt,late:FM,get ZodFirstPartyTypeKind(){return He},coerce:{string:e=>Vn.create({...e,coerce:!0}),number:e=>qr.create({...e,coerce:!0}),boolean:e=>Gs.create({...e,coerce:!0}),bigint:e=>Kr.create({...e,coerce:!0}),date:e=>wi.create({...e,coerce:!0})},any:KM,array:QM,bigint:zM,boolean:Vy,date:ZM,discriminatedUnion:nL,effect:zy,enum:dL,function:lL,instanceof:BM,intersection:rL,lazy:cL,literal:uL,map:oL,nan:VM,nativeEnum:fL,never:GM,null:qM,nullable:mL,number:By,object:XM,oboolean:()=>Vy().optional(),onumber:()=>By().optional(),optional:pL,ostring:()=>Fy().optional(),pipeline:yL,preprocess:gL,promise:hL,record:sL,set:aL,strictObject:eL,string:Fy,symbol:WM,transformer:zy,tuple:iL,undefined:HM,union:tL,unknown:JM,void:YM,NEVER:Qe,ZodIssueCode:we,quotelessJson:EM,ZodError:Bn});const{defaults:sr}=U$.messages,Wn={className:T.string().describe("CSS className to apply to the message").optional()},vL=sr.audio.schema.extend({...Wn,type:T.literal("audio")}),Zy=sr.card.schema.extend({type:T.literal("card"),subtitle:T.string().optional(),imageUrl:T.string().optional(),...Wn}),bL=Zy.omit({type:!0}),wL=T.object({items:T.array(bL),...Wn,type:T.literal("carousel")}),xL=sr.choice.schema.extend({text:T.string(),...Wn,type:T.literal("choice"),disableFreeText:T.boolean().optional()}),_L=sr.dropdown.schema.extend({text:T.string(),...Wn,type:T.literal("dropdown")}),kL=sr.file.schema.extend({...Wn,type:T.literal("file")}),CL=sr.image.schema.extend({...Wn,type:T.literal("image")}),EL=sr.location.schema.extend({...Wn,type:T.literal("location")}),SL=sr.markdown.schema.extend({...Wn,type:T.literal("markdown")}),TL=sr.text.schema.extend({...Wn,type:T.literal("text")}),OL=sr.video.schema.extend({...Wn,type:T.literal("video")}),IL=T.union([vL,Zy,wL,xL,_L,kL,CL,EL,SL,TL,OL]),PL=T.object({type:T.literal("webchat_visibility"),data:T.object({visibility:T.union([T.literal("show"),T.literal("hide"),T.literal("toggle")])})}),AL=T.object({type:T.literal("webchat_config"),data:T.object({config:T.record(T.any())})}),RL=T.object({type:T.literal("custom"),data:T.object({event:T.record(T.any())})});T.union([PL,AL,RL]),T.object({type:T.literal("message_created"),data:IL});const or=T.object({className:T.string().optional(),avatarUrl:T.string().url().optional()}),$L=or.extend({type:T.literal("audio"),audio:T.string(),title:T.string().optional()}),ML=T.union([T.object({title:T.string(),action:T.literal("Say something"),text:T.string()}),T.object({title:T.string(),action:T.literal("Open URL"),url:T.string()}),T.object({title:T.string(),action:T.literal("Postback"),payload:T.string()})]),Wy=or.extend({type:T.literal("card"),title:T.string(),subtitle:T.string().optional(),image:T.string().optional(),actions:T.array(ML)}),LL=or.extend({type:T.literal("carousel"),items:T.array(Wy)}),DL=or.extend({type:T.literal("dropdown"),message:T.string().optional(),options:T.array(T.object({label:T.string(),value:T.string()})),allowCreation:T.boolean().optional(),placeholderText:T.string().optional(),allowMultiple:T.boolean().optional(),buttonText:T.string().optional(),width:T.number().optional(),displayInKeyboard:T.boolean().optional(),markdown:T.boolean().optional(),text:T.string().optional()}),NL=or.extend({type:T.literal("file"),file:T.string(),title:T.string().optional()}),jL=or.extend({type:T.literal("image"),image:T.string()}),UL=or.extend({type:T.literal("location"),latitude:T.number(),longitude:T.number(),address:T.string().optional(),title:T.string().optional()}),FL=or.extend({type:T.literal("single-choice"),text:T.string(),disableFreeText:T.boolean().optional(),choices:T.array(T.object({title:T.string(),value:T.string()}))}),BL=or.extend({type:T.literal("text"),text:T.string(),markdown:T.boolean().optional()}),VL=or.extend({type:T.literal("video"),video:T.string(),title:T.string().optional()}),zL=T.object({type:T.literal("quick_reply"),text:T.string(),payload:T.string().optional()}),Hy=T.union([$L,Wy,LL,DL,NL,jL,UL,FL,BL,VL,zL]),ZL=T.object({type:T.literal("webchat-visibility"),visibility:T.union([T.literal("show"),T.literal("hide"),T.literal("toggle")])}),WL=T.object({type:T.literal("webchat-config"),config:T.record(T.any())}),HL=T.object({type:T.literal("custom-event"),event:T.record(T.any())}),qL=T.union([ZL,WL,HL]);T.object({type:T.literal("trigger"),trigger:qL});const qy=e=>({type:"card",title:e.title,subtitle:e.subtitle,image:e.imageUrl,actions:e.actions.map(KL)}),KL=e=>{switch(e.action){case"postback":return{title:e.label,action:"Postback",payload:e.value};case"url":return{title:e.label,action:"Open URL",url:e.value};case"say":return{title:e.label,action:"Say something",text:e.value};default:throw new Error(`Unknown action type ${e.action}`)}},JL=e=>({...e,type:"audio",audio:e.audioUrl}),GL=e=>qy(e),YL=e=>({...e,type:"carousel",items:e.items.map(qy)}),QL=e=>({...e,type:"single-choice",text:e.text,choices:e.options.map(t=>({title:t.label,value:t.value})),disableFreeText:e.disableFreeText}),XL=e=>({...e,type:"dropdown",message:e.text,options:e.options.map(t=>({label:t.label,value:t.value}))}),eD=e=>({...e,type:"file",file:e.fileUrl,title:e.title}),tD=e=>({...e,type:"image",image:e.imageUrl}),nD=e=>({...e,type:"location",latitude:e.latitude,longitude:e.longitude}),rD=e=>({...e,type:"text",text:e.markdown,markdown:!0}),iD=e=>({...e,type:"text",text:e.text,markdown:!0}),sD=e=>({...e,type:"video",video:e.videoUrl});let Xa;const oD=new Uint8Array(16);function aD(){if(!Xa&&(Xa=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Xa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Xa(oD)}const en=[];for(let e=0;e<256;++e)en.push((e+256).toString(16).slice(1));function lD(e,t=0){return en[e[t+0]]+en[e[t+1]]+en[e[t+2]]+en[e[t+3]]+"-"+en[e[t+4]]+en[e[t+5]]+"-"+en[e[t+6]]+en[e[t+7]]+"-"+en[e[t+8]]+en[e[t+9]]+"-"+en[e[t+10]]+en[e[t+11]]+en[e[t+12]]+en[e[t+13]]+en[e[t+14]]+en[e[t+15]]}const Ky={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function cD(e,t,n){if(Ky.randomUUID&&!t&&!e)return Ky.randomUUID();e=e||{};const r=e.random||(e.rng||aD)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return lD(r)}const el=e=>({block:e,type:"bubble"}),uD=e=>e.action==="Say something"?{type:"button",variant:"action",text:e.title,buttonValue:e.text,reusable:!0}:e.action==="Open URL"?{type:"button",variant:"link",text:e.title,buttonValue:e.url,reusable:!0}:{type:"button",variant:"action",text:e.title,buttonValue:e.payload,reusable:!0},Jy=({title:e,image:t,actions:n,subtitle:r})=>{const i=[];return t&&i.push({type:"image",url:t}),e&&i.push({type:"text",text:`## ${e}`}),r&&i.push({type:"text",text:r}),n.length>0&&i.push({type:"row",blocks:n.map(uD)}),{type:"column",horizontalAlignment:"center",blocks:[...i]}},dD=({choices:e,text:t})=>{const n=cD(),r=el({type:"text",text:t});return e.length===0?r:{type:"column",horizontalAlignment:"left",blocks:[r,{type:"row",blocks:e.map(({title:i,value:s})=>({type:"button",variant:"action",text:i,buttonValue:s,groupId:n}))}]}},fD=({options:e,text:t})=>{const n=[{type:"dropdown",label:t??"Select an option",options:e}];return t&&n.unshift({type:"text",text:t}),{type:"column",blocks:n}},Gy=({type:e,audio:t})=>({type:e,url:t}),Yy=e=>el(Jy(e)),Qy=({items:e})=>({type:"carousel",blocks:e.map(Jy)}),Xy=e=>dD(e),ev=e=>el(fD(e)),tv=({file:e,...t})=>({url:e,...t}),nv=({type:e,image:t})=>({type:e,url:t}),rv=({type:e,latitude:t,longitude:n,title:r,address:i})=>({type:e,latitude:t,longitude:n,title:r??i??"View on map"}),Ju=({type:e,text:t})=>el({type:e,text:t}),iv=({type:e,video:t})=>({type:e,url:t}),sv=e=>{switch(e.type){case"audio":return Gy(e);case"card":return Yy(e);case"carousel":return Qy(e);case"single-choice":return Xy(e);case"dropdown":return ev(e);case"file":return tv(e);case"image":return nv(e);case"location":return rv(e);case"text":return Ju(e);case"video":return iv(e);default:throw new Error("Unsuported message type")}},hD=e=>{const t=JL(e);return Gy(t)},pD=e=>{const t=GL(e);return Yy(t)},mD=e=>{const t=YL(e);return Qy(t)},gD=e=>{const t=QL(e);return Xy(t)},yD=e=>{const t=XL(e);return ev(t)},vD=e=>{const t=eD(e);return tv(t)},bD=e=>{const t=tD(e);return nv(t)},wD=e=>{const t=nD(e);return rv(t)},xD=e=>{const t=rD(e);return Ju(t)},_D=e=>{const t=iD(e);return Ju(t)},kD=e=>{const t=sD(e);return iv(t)},CD=e=>{switch(e.type){case"audio":return hD(e);case"card":return pD(e);case"carousel":return mD(e);case"choice":return gD(e);case"dropdown":return yD(e);case"file":return vD(e);case"image":return bD(e);case"location":return wD(e);case"markdown":return xD(e);case"text":return _D(e);case"video":return kD(e);default:throw new Error("Unsuported message type")}};class ov{constructor(t){E(this,"socket");E(this,"clientId");E(this,"userId");E(this,"conversationId");E(this,"userToken");E(this,"connected",!1);E(this,"emitter");E(this,"on");E(this,"mode","messaging");this.socket=new km.MessagingSocket(t),this.emitter=new Il,this.clientId=t.clientId,this.on=this.emitter.on.bind(this.emitter),this.socket.on("message",n=>{const r=n.payload;if(r.type==="trigger")switch(r.trigger.type){case"webchat-visibility":this.emitter.emit("webchatVisibility",r.trigger.visibility);break;case"webchat-config":this.emitter.emit("webchatConfig",r.trigger.config);break;case"custom-event":this.emitter.emit("customEvent",r.trigger.event);break}else{const i=Hy.parse(r),s=sv(i);this.emitter.emit("message",{...n,payload:s})}}),this.socket.on("conversation",n=>{this.emitter.emit("conversation",n)})}async connect(t,n){if(this.connected)return;this.connected=!0;const r=await this.socket.connect(t,n).catch(i=>{throw this.connected=!1,i});return this.userId=r.userId,this.userToken=r.userToken,r}async disconnect(){await this.socket.disconnect(),this.connected=!1}async sendMessage(t){this.conversationId||await this.newConversation(),await this.socket.sendText(t),this.emitter.emit("messageSent",t)}async sendEvent(t){this.conversationId||await this.newConversation(),await this.socket.sendPayload({type:"trigger",payload:t})}async switchConversation(t){await this.socket.switchConversation(t),this.conversationId=t}async conversationExists(t){return(await this.socket.listConversations()).some(r=>r.id===t)}async newConversation(){const{id:t}=await this.socket.createConversation();await this.socket.startConversation(),this.conversationId=t}async listMessages(t){return(await this.socket.listMessages(t)).map(r=>{const i=Hy.parse(r.payload),s=sv(i);return{...r,payload:s}})}}function av(e,t){return function(){return e.apply(t,arguments)}}const{toString:lv}=Object.prototype,{getPrototypeOf:Gu}=Object,Yu=(e=>t=>{const n=lv.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),kr=e=>(e=e.toLowerCase(),t=>Yu(t)===e),tl=e=>t=>typeof t===e,{isArray:rs}=Array,ao=tl("undefined");function ED(e){return e!==null&&!ao(e)&&e.constructor!==null&&!ao(e.constructor)&&Ci(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const cv=kr("ArrayBuffer");function SD(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&cv(e.buffer),t}const TD=tl("string"),Ci=tl("function"),uv=tl("number"),Qu=e=>e!==null&&typeof e=="object",OD=e=>e===!0||e===!1,nl=e=>{if(Yu(e)!=="object")return!1;const t=Gu(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},ID=kr("Date"),PD=kr("File"),AD=kr("Blob"),RD=kr("FileList"),$D=e=>Qu(e)&&Ci(e.pipe),MD=e=>{const t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||lv.call(e)===t||Ci(e.toString)&&e.toString()===t)},LD=kr("URLSearchParams"),DD=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function lo(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),rs(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let a;for(r=0;r<o;r++)a=s[r],t.call(null,e[a],a,e)}}function dv(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const fv=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),hv=e=>!ao(e)&&e!==fv;function Xu(){const{caseless:e}=hv(this)&&this||{},t={},n=(r,i)=>{const s=e&&dv(t,i)||i;nl(t[s])&&nl(r)?t[s]=Xu(t[s],r):nl(r)?t[s]=Xu({},r):rs(r)?t[s]=r.slice():t[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&lo(arguments[r],n);return t}const ND=(e,t,n,{allOwnKeys:r}={})=>(lo(t,(i,s)=>{n&&Ci(i)?e[s]=av(i,n):e[s]=i},{allOwnKeys:r}),e),jD=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),UD=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},FD=(e,t,n,r)=>{let i,s,o;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)o=i[s],(!r||r(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=n!==!1&&Gu(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},BD=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},VD=e=>{if(!e)return null;if(rs(e))return e;let t=e.length;if(!uv(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},zD=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Gu(Uint8Array)),ZD=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},WD=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},HD=kr("HTMLFormElement"),qD=e=>e.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),pv=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),KD=kr("RegExp"),mv=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};lo(n,(i,s)=>{t(i,s,e)!==!1&&(r[s]=i)}),Object.defineProperties(e,r)},te={isArray:rs,isArrayBuffer:cv,isBuffer:ED,isFormData:MD,isArrayBufferView:SD,isString:TD,isNumber:uv,isBoolean:OD,isObject:Qu,isPlainObject:nl,isUndefined:ao,isDate:ID,isFile:PD,isBlob:AD,isRegExp:KD,isFunction:Ci,isStream:$D,isURLSearchParams:LD,isTypedArray:zD,isFileList:RD,forEach:lo,merge:Xu,extend:ND,trim:DD,stripBOM:jD,inherits:UD,toFlatObject:FD,kindOf:Yu,kindOfTest:kr,endsWith:BD,toArray:VD,forEachEntry:ZD,matchAll:WD,isHTMLForm:HD,hasOwnProperty:pv,hasOwnProp:pv,reduceDescriptors:mv,freezeMethods:e=>{mv(e,(t,n)=>{if(Ci(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Ci(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},toObjectSet:(e,t)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return rs(e)?r(e):r(String(e).split(t)),n},toCamelCase:qD,noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:dv,global:fv,isContextDefined:hv,toJSONObject:e=>{const t=new Array(10),n=(r,i)=>{if(Qu(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const s=rs(r)?[]:{};return lo(r,(o,a)=>{const l=n(o,i+1);!ao(l)&&(s[a]=l)}),t[i]=void 0,s}}return r};return n(e,0)}};function ct(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}te.inherits(ct,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:te.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const gv=ct.prototype,yv={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{yv[e]={value:e}}),Object.defineProperties(ct,yv),Object.defineProperty(gv,"isAxiosError",{value:!0}),ct.from=(e,t,n,r,i,s)=>{const o=Object.create(gv);return te.toFlatObject(e,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),ct.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};var JD=typeof self=="object"?self.FormData:window.FormData;const GD=ti(JD);function ed(e){return te.isPlainObject(e)||te.isArray(e)}function vv(e){return te.endsWith(e,"[]")?e.slice(0,-2):e}function bv(e,t,n){return e?e.concat(t).map(function(i,s){return i=vv(i),!n&&s?"["+i+"]":i}).join(n?".":""):t}function YD(e){return te.isArray(e)&&!e.some(ed)}const QD=te.toFlatObject(te,{},null,function(t){return/^is[A-Z]/.test(t)});function XD(e){return e&&te.isFunction(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator]}function rl(e,t,n){if(!te.isObject(e))throw new TypeError("target must be an object");t=t||new(GD||FormData),n=te.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!te.isUndefined(y[m])});const r=n.metaTokens,i=n.visitor||u,s=n.dots,o=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&XD(t);if(!te.isFunction(i))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(te.isDate(p))return p.toISOString();if(!l&&te.isBlob(p))throw new ct("Blob is not supported. Use a Buffer instead.");return te.isArrayBuffer(p)||te.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,m,y){let v=p;if(p&&!y&&typeof p=="object"){if(te.endsWith(m,"{}"))m=r?m:m.slice(0,-2),p=JSON.stringify(p);else if(te.isArray(p)&&YD(p)||te.isFileList(p)||te.endsWith(m,"[]")&&(v=te.toArray(p)))return m=vv(m),v.forEach(function(x,P){!(te.isUndefined(x)||x===null)&&t.append(o===!0?bv([m],P,s):o===null?m:m+"[]",c(x))}),!1}return ed(p)?!0:(t.append(bv(y,m,s),c(p)),!1)}const d=[],h=Object.assign(QD,{defaultVisitor:u,convertValue:c,isVisitable:ed});function f(p,m){if(!te.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(p),te.forEach(p,function(v,b){(!(te.isUndefined(v)||v===null)&&i.call(t,v,te.isString(b)?b.trim():b,m,h))===!0&&f(v,m?m.concat(b):[b])}),d.pop()}}if(!te.isObject(e))throw new TypeError("data must be an object");return f(e),t}function wv(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function td(e,t){this._pairs=[],e&&rl(e,this,t)}const xv=td.prototype;xv.append=function(t,n){this._pairs.push([t,n])},xv.toString=function(t){const n=t?function(r){return t.call(this,r,wv)}:wv;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function eN(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function _v(e,t,n){if(!t)return e;const r=n&&n.encode||eN,i=n&&n.serialize;let s;if(i?s=i(t,n):s=te.isURLSearchParams(t)?t.toString():new td(t,n).toString(r),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class tN{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){te.forEach(this.handlers,function(r){r!==null&&t(r)})}}const kv=tN,Cv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},nN=typeof URLSearchParams<"u"?URLSearchParams:td,rN=FormData,iN=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),sN=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),ar={isBrowser:!0,classes:{URLSearchParams:nN,FormData:rN,Blob},isStandardBrowserEnv:iN,isStandardBrowserWebWorkerEnv:sN,protocols:["http","https","file","blob","url","data"]};function oN(e,t){return rl(e,new ar.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return ar.isNode&&te.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function aN(e){return te.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function lN(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],t[s]=e[s];return t}function Ev(e){function t(n,r,i,s){let o=n[s++];const a=Number.isFinite(+o),l=s>=n.length;return o=!o&&te.isArray(i)?i.length:o,l?(te.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!a):((!i[o]||!te.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],s)&&te.isArray(i[o])&&(i[o]=lN(i[o])),!a)}if(te.isFormData(e)&&te.isFunction(e.entries)){const n={};return te.forEachEntry(e,(r,i)=>{t(aN(r),i,n,0)}),n}return null}const cN={"Content-Type":void 0};function uN(e,t,n){if(te.isString(e))try{return(t||JSON.parse)(e),te.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const il={transitional:Cv,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=te.isObject(t);if(s&&te.isHTMLForm(t)&&(t=new FormData(t)),te.isFormData(t))return i&&i?JSON.stringify(Ev(t)):t;if(te.isArrayBuffer(t)||te.isBuffer(t)||te.isStream(t)||te.isFile(t)||te.isBlob(t))return t;if(te.isArrayBufferView(t))return t.buffer;if(te.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return oN(t,this.formSerializer).toString();if((a=te.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return rl(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),uN(t)):t}],transformResponse:[function(t){const n=this.transitional||il.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(t&&te.isString(t)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?ct.from(a,ct.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ar.classes.FormData,Blob:ar.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};te.forEach(["delete","get","head"],function(t){il.headers[t]={}}),te.forEach(["post","put","patch"],function(t){il.headers[t]=te.merge(cN)});const nd=il,dN=te.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),fN=e=>{const t={};let n,r,i;return e&&e.split(`
|
|
278
|
-
`).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||t[n]&&
|
|
279
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[Sv]=this[Sv]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=co(o);r[a]||(gN(i,o),r[a]=!0)}return te.isArray(t)?t.forEach(s):s(t),this}}ol.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]),te.freezeMethods(ol.prototype),te.freezeMethods(ol);const Cr=ol;function rd(e,t){const n=this||nd,r=t||n,i=Cr.from(r.headers);let s=r.data;return te.forEach(e,function(a){s=a.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function Ov(e){return!!(e&&e.__CANCEL__)}function uo(e,t,n){ct.call(this,e??"canceled",ct.ERR_CANCELED,t,n),this.name="CanceledError"}te.inherits(uo,ct,{__CANCEL__:!0});const yN=null;function vN(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ct("Request failed with status code "+n.status,[ct.ERR_BAD_REQUEST,ct.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const bN=ar.isStandardBrowserEnv?function(){return{write:function(n,r,i,s,o,a){const l=[];l.push(n+"="+encodeURIComponent(r)),te.isNumber(i)&&l.push("expires="+new Date(i).toGMTString()),te.isString(s)&&l.push("path="+s),te.isString(o)&&l.push("domain="+o),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function wN(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function xN(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function Iv(e,t){return e&&!wN(t)?xN(e,t):t}const _N=ar.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(s){let o=s;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(o){const a=te.isString(o)?i(o):o;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function kN(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function CN(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,s=0,o;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=r[s];o||(o=c),n[i]=l,r[i]=c;let d=s,h=0;for(;d!==i;)h+=n[d++],d=d%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const f=u&&c-u;return f?Math.round(h*1e3/f):void 0}}function Pv(e,t){let n=0;const r=CN(50,250);return i=>{const s=i.loaded,o=i.lengthComputable?i.total:void 0,a=s-n,l=r(a),c=s<=o;n=s;const u={loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&c?(o-s)/l:void 0,event:i};u[t?"download":"upload"]=!0,e(u)}}const al={http:yN,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){let i=e.data;const s=Cr.from(e.headers).normalize(),o=e.responseType;let a;function l(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}te.isFormData(i)&&(ar.isStandardBrowserEnv||ar.isStandardBrowserWebWorkerEnv)&&s.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const f=e.auth.username||"",p=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(f+":"+p))}const u=Iv(e.baseURL,e.url);c.open(e.method.toUpperCase(),_v(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout;function d(){if(!c)return;const f=Cr.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),m={data:!o||o==="text"||o==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:f,config:e,request:c};vN(function(v){n(v),l()},function(v){r(v),l()},m),c=null}if("onloadend"in c?c.onloadend=d:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(d)},c.onabort=function(){c&&(r(new ct("Request aborted",ct.ECONNABORTED,e,c)),c=null)},c.onerror=function(){r(new ct("Network Error",ct.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let p=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const m=e.transitional||Cv;e.timeoutErrorMessage&&(p=e.timeoutErrorMessage),r(new ct(p,m.clarifyTimeoutError?ct.ETIMEDOUT:ct.ECONNABORTED,e,c)),c=null},ar.isStandardBrowserEnv){const f=(e.withCredentials||_N(u))&&e.xsrfCookieName&&bN.read(e.xsrfCookieName);f&&s.set(e.xsrfHeaderName,f)}i===void 0&&s.setContentType(null),"setRequestHeader"in c&&te.forEach(s.toJSON(),function(p,m){c.setRequestHeader(m,p)}),te.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),o&&o!=="json"&&(c.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&c.addEventListener("progress",Pv(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",Pv(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=f=>{c&&(r(!f||f.type?new uo(null,e,c):f),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const h=kN(u);if(h&&ar.protocols.indexOf(h)===-1){r(new ct("Unsupported protocol "+h+":",ct.ERR_BAD_REQUEST,e));return}c.send(i||null)})}};te.forEach(al,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const EN={getAdapter:e=>{e=te.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let i=0;i<t&&(n=e[i],!(r=te.isString(n)?al[n.toLowerCase()]:n));i++);if(!r)throw r===!1?new ct(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(te.hasOwnProp(al,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`);if(!te.isFunction(r))throw new TypeError("adapter is not a function");return r},adapters:al};function id(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new uo(null,e)}function Av(e){return id(e),e.headers=Cr.from(e.headers),e.data=rd.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),EN.getAdapter(e.adapter||nd.adapter)(e).then(function(r){return id(e),r.data=rd.call(e,e.transformResponse,r),r.headers=Cr.from(r.headers),r},function(r){return Ov(r)||(id(e),r&&r.response&&(r.response.data=rd.call(e,e.transformResponse,r.response),r.response.headers=Cr.from(r.response.headers))),Promise.reject(r)})}const Rv=e=>e instanceof Cr?e.toJSON():e;function is(e,t){t=t||{};const n={};function r(c,u,d){return te.isPlainObject(c)&&te.isPlainObject(u)?te.merge.call({caseless:d},c,u):te.isPlainObject(u)?te.merge({},u):te.isArray(u)?u.slice():u}function i(c,u,d){if(te.isUndefined(u)){if(!te.isUndefined(c))return r(void 0,c,d)}else return r(c,u,d)}function s(c,u){if(!te.isUndefined(u))return r(void 0,u)}function o(c,u){if(te.isUndefined(u)){if(!te.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,d){if(d in t)return r(c,u);if(d in e)return r(void 0,c)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,u)=>i(Rv(c),Rv(u),!0)};return te.forEach(Object.keys(e).concat(Object.keys(t)),function(u){const d=l[u]||i,h=d(e[u],t[u],u);te.isUndefined(h)&&d!==a||(n[u]=h)}),n}const $v="1.2.5",sd={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{sd[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Mv={};sd.transitional=function(t,n,r){function i(s,o){return"[Axios v"+$v+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,a)=>{if(t===!1)throw new ct(i(o," has been removed"+(n?" in "+n:"")),ct.ERR_DEPRECATED);return n&&!Mv[o]&&(Mv[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,o,a):!0}};function SN(e,t,n){if(typeof e!="object")throw new ct("options must be an object",ct.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const s=r[i],o=t[s];if(o){const a=e[s],l=a===void 0||o(a,s,e);if(l!==!0)throw new ct("option "+s+" must be "+l,ct.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ct("Unknown option "+s,ct.ERR_BAD_OPTION)}}const od={assertOptions:SN,validators:sd},Gr=od.validators;class ll{constructor(t){this.defaults=t,this.interceptors={request:new kv,response:new kv}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=is(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&od.assertOptions(r,{silentJSONParsing:Gr.transitional(Gr.boolean),forcedJSONParsing:Gr.transitional(Gr.boolean),clarifyTimeoutError:Gr.transitional(Gr.boolean)},!1),i!==void 0&&od.assertOptions(i,{encode:Gr.function,serialize:Gr.function},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o;o=s&&te.merge(s.common,s[n.method]),o&&te.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),n.headers=Cr.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,h;if(!l){const p=[Av.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),h=p.length,u=Promise.resolve(n);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let f=n;for(d=0;d<h;){const p=a[d++],m=a[d++];try{f=p(f)}catch(y){m.call(this,y);break}}try{u=Av.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=is(this.defaults,t);const n=Iv(t.baseURL,t.url);return _v(n,t.params,t.paramsSerializer)}}te.forEach(["delete","get","head","options"],function(t){ll.prototype[t]=function(n,r){return this.request(is(r||{},{method:t,url:n,data:(r||{}).data}))}}),te.forEach(["post","put","patch"],function(t){function n(r){return function(s,o,a){return this.request(is(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}ll.prototype[t]=n(),ll.prototype[t+"Form"]=n(!0)});const cl=ll;class ad{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},t(function(s,o,a){r.reason||(r.reason=new uo(s,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new ad(function(i){t=i}),cancel:t}}}const TN=ad;function ON(e){return function(n){return e.apply(null,n)}}function IN(e){return te.isObject(e)&&e.isAxiosError===!0}const ld={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ld).forEach(([e,t])=>{ld[t]=e});const PN=ld;function Lv(e){const t=new cl(e),n=av(cl.prototype.request,t);return te.extend(n,cl.prototype,t,{allOwnKeys:!0}),te.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return Lv(is(e,i))},n}const Ft=Lv(nd);Ft.Axios=cl,Ft.CanceledError=uo,Ft.CancelToken=TN,Ft.isCancel=Ov,Ft.VERSION=$v,Ft.toFormData=rl,Ft.AxiosError=ct,Ft.Cancel=Ft.CanceledError,Ft.all=function(t){return Promise.all(t)},Ft.spread=ON,Ft.isAxiosError=IN,Ft.mergeConfig=is,Ft.AxiosHeaders=Cr,Ft.formToJSON=e=>Ev(te.isHTMLForm(e)?new FormData(e):e),Ft.HttpStatusCode=PN,Ft.default=Ft;const Ot=Ft,Dt="https://webchat.botpress.cloud".replace(/\/+$/,"");class AN{constructor(t,n=Dt,r=Ot){E(this,"configuration");this.basePath=n,this.axios=r,t&&(this.configuration=t,this.basePath=t.basePath||this.basePath)}}class RN extends Error{constructor(t,n){super(n),this.field=t,this.name="RequiredError"}}const Bt="https://example.com",ft=function(e,t,n){if(n==null)throw new RN(t,`Required parameter ${t} was null or undefined when calling ${e}.`)};function cd(e,t,n=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(r=>cd(e,r,n)):Object.keys(t).forEach(r=>cd(e,t[r],`${n}${n!==""?".":""}${r}`)):e.has(n)?e.append(n,t):e.set(n,t))}const Vt=function(e,...t){const n=new URLSearchParams(e.search);cd(n,t),e.search=n.toString()},ss=function(e,t,n){const r=typeof e!="string";return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(e!==void 0?e:{}):e||""},zt=function(e){return e.pathname+e.search+e.hash},Zt=function(e,t,n,r){return(i=t,s=n)=>{const o={...e.options,url:((r==null?void 0:r.basePath)||s)+e.url};return i.request(o)}},$N=function(e){return{addParticipant:async(t,n,r,i={})=>{ft("addParticipant","xUserKey",t),ft("addParticipant","id",n);const s="/v1/conversations/{id}/participants".replace("{id}",encodeURIComponent(String(n))),o=new URL(s,Bt);let a;e&&(a=e.baseOptions);const l={method:"POST",...a,...i},c={},u={};t!=null&&(c["x-user-key"]=String(t)),c["Content-Type"]="application/json",Vt(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},l.data=ss(r,l,e),{url:zt(o),options:l}},createConversation:async(t,n,r={})=>{ft("createConversation","xUserKey",t);const i="/v1/conversations",s=new URL(i,Bt);let o;e&&(o=e.baseOptions);const a={method:"POST",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),l["Content-Type"]="application/json",Vt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=ss(n,a,e),{url:zt(s),options:a}},createEvent:async(t,n,r={})=>{ft("createEvent","xUserKey",t);const i="/v1/events",s=new URL(i,Bt);let o;e&&(o=e.baseOptions);const a={method:"POST",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),l["Content-Type"]="application/json",Vt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=ss(n,a,e),{url:zt(s),options:a}},createMessage:async(t,n,r={})=>{ft("createMessage","xUserKey",t);const i="/v1/messages",s=new URL(i,Bt);let o;e&&(o=e.baseOptions);const a={method:"POST",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),l["Content-Type"]="application/json",Vt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=ss(n,a,e),{url:zt(s),options:a}},createUser:async(t,n={})=>{const r="/v1/users",i=new URL(r,Bt);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",Vt(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=ss(t,o,e),{url:zt(i),options:o}},deleteConversation:async(t,n,r={})=>{ft("deleteConversation","xUserKey",t),ft("deleteConversation","id",n);const i="/v1/conversations/{id}".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,Bt);let o;e&&(o=e.baseOptions);const a={method:"DELETE",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),Vt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:zt(s),options:a}},deleteMessage:async(t,n,r={})=>{ft("deleteMessage","xUserKey",t),ft("deleteMessage","id",n);const i="/v1/messages/{id}".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,Bt);let o;e&&(o=e.baseOptions);const a={method:"DELETE",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),Vt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:zt(s),options:a}},deleteUser:async(t,n={})=>{ft("deleteUser","xUserKey",t);const r="/v1/users/me",i=new URL(r,Bt);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...n},a={},l={};t!=null&&(a["x-user-key"]=String(t)),Vt(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},{url:zt(i),options:o}},getConversation:async(t,n,r={})=>{ft("getConversation","xUserKey",t),ft("getConversation","id",n);const i="/v1/conversations/{id}".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,Bt);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),Vt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:zt(s),options:a}},getEvent:async(t,n,r={})=>{ft("getEvent","xUserKey",t),ft("getEvent","id",n);const i="/v1/events/{id}".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,Bt);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),Vt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:zt(s),options:a}},getMessage:async(t,n,r={})=>{ft("getMessage","xUserKey",t),ft("getMessage","id",n);const i="/v1/messages/{id}".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,Bt);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),Vt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:zt(s),options:a}},getParticipant:async(t,n,r,i={})=>{ft("getParticipant","xUserKey",t),ft("getParticipant","id",n),ft("getParticipant","userId",r);const s="/v1/conversations/{id}/participants/{userId}".replace("{id}",encodeURIComponent(String(n))).replace("{userId}",encodeURIComponent(String(r))),o=new URL(s,Bt);let a;e&&(a=e.baseOptions);const l={method:"GET",...a,...i},c={},u={};t!=null&&(c["x-user-key"]=String(t)),Vt(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:zt(o),options:l}},getUser:async(t,n={})=>{ft("getUser","xUserKey",t);const r="/v1/users/me",i=new URL(r,Bt);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...n},a={},l={};t!=null&&(a["x-user-key"]=String(t)),Vt(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},{url:zt(i),options:o}},listConversationMessages:async(t,n,r,i={})=>{ft("listConversationMessages","xUserKey",t),ft("listConversationMessages","id",n);const s="/v1/conversations/{id}/messages".replace("{id}",encodeURIComponent(String(n))),o=new URL(s,Bt);let a;e&&(a=e.baseOptions);const l={method:"GET",...a,...i},c={},u={};r!==void 0&&(u.nextToken=r),t!=null&&(c["x-user-key"]=String(t)),Vt(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:zt(o),options:l}},listConversations:async(t,n,r={})=>{ft("listConversations","xUserKey",t);const i="/v1/conversations",s=new URL(i,Bt);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.nextToken=n),t!=null&&(l["x-user-key"]=String(t)),Vt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:zt(s),options:a}},listParticipants:async(t,n,r,i={})=>{ft("listParticipants","xUserKey",t),ft("listParticipants","id",n);const s="/v1/conversations/{id}/participants".replace("{id}",encodeURIComponent(String(n))),o=new URL(s,Bt);let a;e&&(a=e.baseOptions);const l={method:"GET",...a,...i},c={},u={};r!==void 0&&(u.nextToken=r),t!=null&&(c["x-user-key"]=String(t)),Vt(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:zt(o),options:l}},listenConversation:async(t,n,r={})=>{ft("listenConversation","xUserKey",t),ft("listenConversation","id",n);const i="/v1/conversations/{id}/listen".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,Bt);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),Vt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:zt(s),options:a}},removeParticipant:async(t,n,r,i={})=>{ft("removeParticipant","xUserKey",t),ft("removeParticipant","id",n),ft("removeParticipant","userId",r);const s="/v1/conversations/{id}/participants/{userId}".replace("{id}",encodeURIComponent(String(n))).replace("{userId}",encodeURIComponent(String(r))),o=new URL(s,Bt);let a;e&&(a=e.baseOptions);const l={method:"DELETE",...a,...i},c={},u={};t!=null&&(c["x-user-key"]=String(t)),Vt(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:zt(o),options:l}},updateUser:async(t,n,r={})=>{ft("updateUser","xUserKey",t);const i="/v1/users/me",s=new URL(i,Bt);let o;e&&(o=e.baseOptions);const a={method:"PUT",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),l["Content-Type"]="application/json",Vt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=ss(n,a,e),{url:zt(s),options:a}}}},Wt=function(e){const t=$N(e);return{async addParticipant(n,r,i,s){const o=await t.addParticipant(n,r,i,s);return Zt(o,Ot,Dt,e)},async createConversation(n,r,i){const s=await t.createConversation(n,r,i);return Zt(s,Ot,Dt,e)},async createEvent(n,r,i){const s=await t.createEvent(n,r,i);return Zt(s,Ot,Dt,e)},async createMessage(n,r,i){const s=await t.createMessage(n,r,i);return Zt(s,Ot,Dt,e)},async createUser(n,r){const i=await t.createUser(n,r);return Zt(i,Ot,Dt,e)},async deleteConversation(n,r,i){const s=await t.deleteConversation(n,r,i);return Zt(s,Ot,Dt,e)},async deleteMessage(n,r,i){const s=await t.deleteMessage(n,r,i);return Zt(s,Ot,Dt,e)},async deleteUser(n,r){const i=await t.deleteUser(n,r);return Zt(i,Ot,Dt,e)},async getConversation(n,r,i){const s=await t.getConversation(n,r,i);return Zt(s,Ot,Dt,e)},async getEvent(n,r,i){const s=await t.getEvent(n,r,i);return Zt(s,Ot,Dt,e)},async getMessage(n,r,i){const s=await t.getMessage(n,r,i);return Zt(s,Ot,Dt,e)},async getParticipant(n,r,i,s){const o=await t.getParticipant(n,r,i,s);return Zt(o,Ot,Dt,e)},async getUser(n,r){const i=await t.getUser(n,r);return Zt(i,Ot,Dt,e)},async listConversationMessages(n,r,i,s){const o=await t.listConversationMessages(n,r,i,s);return Zt(o,Ot,Dt,e)},async listConversations(n,r,i){const s=await t.listConversations(n,r,i);return Zt(s,Ot,Dt,e)},async listParticipants(n,r,i,s){const o=await t.listParticipants(n,r,i,s);return Zt(o,Ot,Dt,e)},async listenConversation(n,r,i){const s=await t.listenConversation(n,r,i);return Zt(s,Ot,Dt,e)},async removeParticipant(n,r,i,s){const o=await t.removeParticipant(n,r,i,s);return Zt(o,Ot,Dt,e)},async updateUser(n,r,i){const s=await t.updateUser(n,r,i);return Zt(s,Ot,Dt,e)}}};class MN extends AN{addParticipant(t,n){return Wt(this.configuration).addParticipant(t.xUserKey,t.id,t.addParticipantBody,n).then(r=>r(this.axios,this.basePath))}createConversation(t,n){return Wt(this.configuration).createConversation(t.xUserKey,t.createConversationBody,n).then(r=>r(this.axios,this.basePath))}createEvent(t,n){return Wt(this.configuration).createEvent(t.xUserKey,t.createEventBody,n).then(r=>r(this.axios,this.basePath))}createMessage(t,n){return Wt(this.configuration).createMessage(t.xUserKey,t.createMessageBody,n).then(r=>r(this.axios,this.basePath))}createUser(t={},n){return Wt(this.configuration).createUser(t.createUserBody,n).then(r=>r(this.axios,this.basePath))}deleteConversation(t,n){return Wt(this.configuration).deleteConversation(t.xUserKey,t.id,n).then(r=>r(this.axios,this.basePath))}deleteMessage(t,n){return Wt(this.configuration).deleteMessage(t.xUserKey,t.id,n).then(r=>r(this.axios,this.basePath))}deleteUser(t,n){return Wt(this.configuration).deleteUser(t.xUserKey,n).then(r=>r(this.axios,this.basePath))}getConversation(t,n){return Wt(this.configuration).getConversation(t.xUserKey,t.id,n).then(r=>r(this.axios,this.basePath))}getEvent(t,n){return Wt(this.configuration).getEvent(t.xUserKey,t.id,n).then(r=>r(this.axios,this.basePath))}getMessage(t,n){return Wt(this.configuration).getMessage(t.xUserKey,t.id,n).then(r=>r(this.axios,this.basePath))}getParticipant(t,n){return Wt(this.configuration).getParticipant(t.xUserKey,t.id,t.userId,n).then(r=>r(this.axios,this.basePath))}getUser(t,n){return Wt(this.configuration).getUser(t.xUserKey,n).then(r=>r(this.axios,this.basePath))}listConversationMessages(t,n){return Wt(this.configuration).listConversationMessages(t.xUserKey,t.id,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listConversations(t,n){return Wt(this.configuration).listConversations(t.xUserKey,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listParticipants(t,n){return Wt(this.configuration).listParticipants(t.xUserKey,t.id,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listenConversation(t,n){return Wt(this.configuration).listenConversation(t.xUserKey,t.id,n).then(r=>r(this.axios,this.basePath))}removeParticipant(t,n){return Wt(this.configuration).removeParticipant(t.xUserKey,t.id,t.userId,n).then(r=>r(this.axios,this.basePath))}updateUser(t,n){return Wt(this.configuration).updateUser(t.xUserKey,t.updateUserBody,n).then(r=>r(this.axios,this.basePath))}}const LN={getRandomValues:e=>new Uint8Array(e.map(()=>Math.floor(Math.random()*256)))};let ud=typeof window<"u"&&typeof window.document<"u"?window.crypto:_u;ud.getRandomValues||(ud=LN);class vt extends Error{constructor(n,r,i,s,o,a){super(s);E(this,"isApiError",!0);this.code=n,this.description=r,this.type=i,this.message=s,this.error=o,this.id=a,this.id||(this.id=vt.generateId())}format(){return`[${this.type}] ${this.message} (Error ID: ${this.id})`}toJSON(){return{id:this.id,code:this.code,type:this.type,message:this.message}}static generateId(){const n=this.getPrefix(),r=new Date().toISOString().replace(/[\-:TZ]/g,"").split(".")[0],i=4,s=Array.from(ud.getRandomValues(new Uint8Array(i))).map(o=>o.toString(16).padStart(2,"0")).join("").toUpperCase();return`${n}_${r}x${s}`}static getPrefix(){return typeof window<"u"&&typeof window.document<"u"?"err_bwsr":"err"}}const DN=e=>typeof e=="object"&&!Array.isArray(e)&&e!==null,dd=e=>e instanceof vt||DN(e)&&e.isApiError===!0;class fo extends vt{constructor(t,n,r){super(500,"An unknown error occurred","Unknown",t,n,r)}}class NN extends vt{constructor(t,n,r){super(500,"An internal error occurred","Internal",t,n,r)}}class jN extends vt{constructor(t,n,r){super(401,"The request requires to be authenticated.","Unauthorized",t,n,r)}}class UN extends vt{constructor(t,n,r){super(403,"The requested action can't be peform by this resource.","Forbidden",t,n,r)}}class FN extends vt{constructor(t,n,r){super(413,"The request payload is too large.","PayloadTooLarge",t,n,r)}}class BN extends vt{constructor(t,n,r){super(400,"The request payload is invalid.","InvalidPayload",t,n,r)}}class VN extends vt{constructor(t,n,r){super(415,"The request is invalid because the content-type is not supported.","UnsupportedMediaType",t,n,r)}}class zN extends vt{constructor(t,n,r){super(405,"The requested method does not exist.","MethodNotFound",t,n,r)}}class ZN extends vt{constructor(t,n,r){super(404,"The requested resource does not exist.","ResourceNotFound",t,n,r)}}class WN extends vt{constructor(t,n,r){super(400,"The provided JSON schema is invalid.","InvalidJsonSchema",t,n,r)}}class HN extends vt{constructor(t,n,r){super(400,"The provided data doesn't respect the provided JSON schema.","InvalidDataFormat",t,n,r)}}class qN extends vt{constructor(t,n,r){super(400,"The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.","InvalidIdentifier",t,n,r)}}class KN extends vt{constructor(t,n,r){super(409,"The resource is related with a different resource that the one referenced in the request. This is usually caused when providing two resource identifiers that aren't linked together.","RelationConflict",t,n,r)}}class JN extends vt{constructor(t,n,r){super(409,"The resource cannot be deleted because it's referenced by another resource","ReferenceConstraint",t,n,r)}}class GN extends vt{constructor(t,n,r){super(400,"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.","ReferenceNotFound",t,n,r)}}class YN extends vt{constructor(t,n,r){super(400,"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.","InvalidQuery",t,n,r)}}class QN extends vt{constructor(t,n,r){super(400,"An error happened during the execution of a runtime (bot or integration).","Runtime",t,n,r)}}class XN extends vt{constructor(t,n,r){super(409,"The record attempted to be created already exists.","AlreadyExists",t,n,r)}}class ej extends vt{constructor(t,n,r){super(429,"The request has been rate limited.","RateLimited",t,n,r)}}class tj extends vt{constructor(t,n,r){super(402,"A payment is required to perform this request.","PaymentRequired",t,n,r)}}class nj extends vt{constructor(t,n,r){super(403,"The request exceeds the allowed quota. Quotas are a soft limit that can be increased.","QuotaExceeded",t,n,r)}}class rj extends vt{constructor(t,n,r){super(413,"The request exceeds the allowed limit. Limits are a hard limit that cannot be increased.","LimitExceeded",t,n,r)}}class ij extends vt{constructor(t,n,r){super(400,"Request payload contains breaking changes which is not allowed for this resource without a version increment.","BreakingChanges",t,n,r)}}const sj={Unknown:fo,Internal:NN,Unauthorized:jN,Forbidden:UN,PayloadTooLarge:FN,InvalidPayload:BN,UnsupportedMediaType:VN,MethodNotFound:zN,ResourceNotFound:ZN,InvalidJsonSchema:WN,InvalidDataFormat:HN,InvalidIdentifier:qN,RelationConflict:KN,ReferenceConstraint:JN,ReferenceNotFound:GN,InvalidQuery:YN,Runtime:QN,AlreadyExists:XN,RateLimited:ej,PaymentRequired:tj,QuotaExceeded:nj,LimitExceeded:rj,BreakingChanges:ij},Dv=e=>dd(e)?e:e instanceof Error?new fo(e.message,e):typeof e=="string"?new fo(e):oj(e);function oj(e){if(typeof e=="object"&&"code"in e&&"type"in e&&"id"in e&&"message"in e&&typeof e.type=="string"&&typeof e.message=="string"){const t=sj[e.type];return t?new t(e.message,void 0,e.id||"UNKNOWN"):new fo(`An unclassified API error occurred: ${e.message} (Type: ${e.type}, Code: ${e.code})`)}return new fo("An invalid error occurred: "+JSON.stringify(e))}class aj{constructor(t,n,r){E(this,"_innerClient");E(this,"getConversation",t=>this._innerClient.getConversation(t).then(n=>n.data).catch(n=>{throw Ht(n)}));E(this,"createConversation",({xUserKey:t,...n})=>this._innerClient.createConversation({xUserKey:t,createConversationBody:n}).then(r=>r.data).catch(r=>{throw Ht(r)}));E(this,"deleteConversation",t=>this._innerClient.deleteConversation(t).then(n=>n.data).catch(n=>{throw Ht(n)}));E(this,"listConversations",t=>this._innerClient.listConversations(t).then(n=>n.data).catch(n=>{throw Ht(n)}));E(this,"listenConversation",t=>this._innerClient.listenConversation(t).then(n=>n.data).catch(n=>{throw Ht(n)}));E(this,"listConversationMessages",t=>this._innerClient.listConversationMessages(t).then(n=>n.data).catch(n=>{throw Ht(n)}));E(this,"addParticipant",({id:t,xUserKey:n,...r})=>this._innerClient.addParticipant({id:t,xUserKey:n,addParticipantBody:r}).then(i=>i.data).catch(i=>{throw Ht(i)}));E(this,"removeParticipant",t=>this._innerClient.removeParticipant(t).then(n=>n.data).catch(n=>{throw Ht(n)}));E(this,"getParticipant",t=>this._innerClient.getParticipant(t).then(n=>n.data).catch(n=>{throw Ht(n)}));E(this,"listParticipants",t=>this._innerClient.listParticipants(t).then(n=>n.data).catch(n=>{throw Ht(n)}));E(this,"getMessage",t=>this._innerClient.getMessage(t).then(n=>n.data).catch(n=>{throw Ht(n)}));E(this,"createMessage",({xUserKey:t,...n})=>this._innerClient.createMessage({xUserKey:t,createMessageBody:n}).then(r=>r.data).catch(r=>{throw Ht(r)}));E(this,"deleteMessage",t=>this._innerClient.deleteMessage(t).then(n=>n.data).catch(n=>{throw Ht(n)}));E(this,"getUser",t=>this._innerClient.getUser(t).then(n=>n.data).catch(n=>{throw Ht(n)}));E(this,"createUser",t=>this._innerClient.createUser({createUserBody:t}).then(n=>n.data).catch(n=>{throw Ht(n)}));E(this,"updateUser",({xUserKey:t,...n})=>this._innerClient.updateUser({xUserKey:t,updateUserBody:n}).then(r=>r.data).catch(r=>{throw Ht(r)}));E(this,"deleteUser",t=>this._innerClient.deleteUser(t).then(n=>n.data).catch(n=>{throw Ht(n)}));E(this,"getEvent",t=>this._innerClient.getEvent(t).then(n=>n.data).catch(n=>{throw Ht(n)}));E(this,"createEvent",({xUserKey:t,...n})=>this._innerClient.createEvent({xUserKey:t,createEventBody:n}).then(r=>r.data).catch(r=>{throw Ht(r)}));this._innerClient=new MN(t,n,r)}}function Ht(e){var t;return Ot.isAxiosError(e)&&((t=e.response)!=null&&t.data)?Dv(e.response.data):Dv(e)}class Nv{constructor(){E(this,"listeners",{})}emit(t,n){const r=this.listeners[t];if(r)for(const i of[...r])i(n)}onceOrMore(t,n){const r=i=>{n(i)==="stop-listening"&&this.off(t,r)};this.on(t,r)}once(t,n){const r=i=>{this.off(t,r),n(i)};this.on(t,r)}on(t,n){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(n)}off(t,n){const r=this.listeners[t];if(!r)return;const i=r.indexOf(n);i!==-1&&r.splice(i,1)}cleanup(){this.listeners={}}}var fd={exports:{}};/** @license
|
|
272
|
+
`);const b=v.state[a];if(b==null)return;JSON.stringify(i.getState())!==JSON.stringify(b)&&f(b);return}i.dispatchFromDevtools&&typeof i.dispatch=="function"&&i.dispatch(v)});case"DISPATCH":switch(m.payload.type){case"RESET":return f(p),a===void 0?u==null?void 0:u.init(i.getState()):u==null?void 0:u.init(xa(l.name));case"COMMIT":if(a===void 0){u==null||u.init(i.getState());return}return u==null?void 0:u.init(xa(l.name));case"ROLLBACK":return yu(m.state,v=>{if(a===void 0){f(v),u==null||u.init(i.getState());return}f(v[a]),u==null||u.init(xa(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return yu(m.state,v=>{if(a===void 0){f(v);return}JSON.stringify(i.getState())!==JSON.stringify(v[a])&&f(v[a])});case"IMPORT_STATE":{const{nextLiftedState:v}=m.payload,b=(y=v.computedStates.slice(-1)[0])==null?void 0:y.state;if(!b)return;f(a===void 0?b:b[a]),u==null||u.send(null,v);return}case"PAUSE_RECORDING":return h=!h}return}}),p},yu=(e,t)=>{let n;try{n=JSON.parse(e)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&t(n)};function XI(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var s;const o=l=>l===null?null:JSON.parse(l,t==null?void 0:t.reviver),a=(s=n.getItem(i))!=null?s:null;return a instanceof Promise?a.then(o):o(a)},setItem:(i,s)=>n.setItem(i,JSON.stringify(s,t==null?void 0:t.replacer)),removeItem:i=>n.removeItem(i)}}const Vs=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Vs(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Vs(r)(n)}}}},eP=(e,t)=>(n,r,i)=>{let s={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:y=>y,version:0,merge:(y,v)=>({...v,...y}),...t},o=!1;const a=new Set,l=new Set;let c;try{c=s.getStorage()}catch{}if(!c)return e((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...y)},r,i);const u=Vs(s.serialize),d=()=>{const y=s.partialize({...r()});let v;const b=u({state:y,version:s.version}).then(x=>c.setItem(s.name,x)).catch(x=>{v=x});if(v)throw v;return b},h=i.setState;i.setState=(y,v)=>{h(y,v),d()};const f=e((...y)=>{n(...y),d()},r,i);let p;const m=()=>{var y;if(!c)return;o=!1,a.forEach(b=>b(r()));const v=((y=s.onRehydrateStorage)==null?void 0:y.call(s,r()))||void 0;return Vs(c.getItem.bind(c))(s.name).then(b=>{if(b)return s.deserialize(b)}).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==s.version){if(s.migrate)return s.migrate(b.state,b.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return b.state}).then(b=>{var x;return p=s.merge(b,(x=r())!=null?x:f),n(p,!0),d()}).then(()=>{v==null||v(p,void 0),o=!0,l.forEach(b=>b(p))}).catch(b=>{v==null||v(void 0,b)})};return i.persist={setOptions:y=>{s={...s,...y},y.getStorage&&(c=y.getStorage())},clearStorage:()=>{c==null||c.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>m(),hasHydrated:()=>o,onHydrate:y=>(a.add(y),()=>{a.delete(y)}),onFinishHydration:y=>(l.add(y),()=>{l.delete(y)})},m(),p||f},tP=(e,t)=>(n,r,i)=>{let s={storage:XI(()=>localStorage),partialize:m=>m,version:0,merge:(m,y)=>({...y,...m}),...t},o=!1;const a=new Set,l=new Set;let c=s.storage;if(!c)return e((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...m)},r,i);const u=()=>{const m=s.partialize({...r()});return c.setItem(s.name,{state:m,version:s.version})},d=i.setState;i.setState=(m,y)=>{d(m,y),u()};const h=e((...m)=>{n(...m),u()},r,i);let f;const p=()=>{var m,y;if(!c)return;o=!1,a.forEach(b=>{var x;return b((x=r())!=null?x:h)});const v=((y=s.onRehydrateStorage)==null?void 0:y.call(s,(m=r())!=null?m:h))||void 0;return Vs(c.getItem.bind(c))(s.name).then(b=>{if(b)if(typeof b.version=="number"&&b.version!==s.version){if(s.migrate)return s.migrate(b.state,b.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return b.state}).then(b=>{var x;return f=s.merge(b,(x=r())!=null?x:h),n(f,!0),u()}).then(()=>{v==null||v(f,void 0),f=r(),o=!0,l.forEach(b=>b(f))}).catch(b=>{v==null||v(void 0,b)})};return i.persist={setOptions:m=>{s={...s,...m},m.storage&&(c=m.storage)},clearStorage:()=>{c==null||c.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>p(),hasHydrated:()=>o,onHydrate:m=>(a.add(m),()=>{a.delete(m)}),onFinishHydration:m=>(l.add(m),()=>{l.delete(m)})},s.skipHydration||p(),f||h},nP=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?eP(e,t):tP(e,t),Hr=GI()(QI(nP((e,t)=>({messageHistory:{},addMessageToHistory:({userId:n,message:r})=>e(i=>({...i,messageHistory:{...i.messageHistory,[n]:[r,...(i.messageHistory[n]??[]).slice(0,100)]}})),clientMode:"",setClientMode:n=>{const{clearAll:r,clientMode:i}=t();i!==n&&r(),e(s=>({...s,clientMode:n}))},setUser:n=>e(r=>({...r,user:n})),setConversationId:n=>e(r=>({...r,conversationId:n})),clearAll:()=>{e(n=>({...n,messageHistory:{},user:void 0,conversationId:void 0}))}}),{name:"botpress-webchat"})));var Mn=function(){return Mn=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Mn.apply(this,arguments)};function Lm(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function rP(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function iP(){var e=_.useRef(!1),t=_.useCallback(function(){return e.current},[]);return _.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}function sP(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=_.useRef(0),i=iP(),s=_.useState(n),o=s[0],a=s[1],l=_.useCallback(function(){for(var c=[],u=0;u<arguments.length;u++)c[u]=arguments[u];var d=++r.current;return o.loading||a(function(h){return Mn(Mn({},h),{loading:!0})}),e.apply(void 0,c).then(function(h){return i()&&d===r.current&&a({value:h,loading:!1}),h},function(h){return i()&&d===r.current&&a({error:h,loading:!1}),h})},t);return[o,l]}function vu(e,t){t===void 0&&(t=[]);var n=sP(e,t,{loading:!0}),r=n[0],i=n[1];return _.useEffect(function(){i()},[i]),r}function oP(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.addEventListener&&e.addEventListener.apply(e,t)}function aP(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];e&&e.removeEventListener&&e.removeEventListener.apply(e,t)}var lP=function(e){_.useEffect(e,[])};const bi=lP;var cP=function(e){bi(function(){e()})};const uP=cP;var dP=function(e){var t=_.useRef(e);t.current=e,bi(function(){return function(){return t.current()}})};const fP=dP;var hP=function(e){var t=_.useRef(0),n=_.useState(e),r=n[0],i=n[1],s=_.useCallback(function(o){cancelAnimationFrame(t.current),t.current=requestAnimationFrame(function(){i(o)})},[]);return fP(function(){cancelAnimationFrame(t.current)}),[r,s]};const pP=hP;var mP=function(e){process.env.NODE_ENV==="development"&&(typeof e!="object"||typeof e.current>"u")&&console.error("`useScroll` expects a single ref argument.");var t=pP({x:0,y:0}),n=t[0],r=t[1];return _.useEffect(function(){var i=function(){e.current&&r({x:e.current.scrollLeft,y:e.current.scrollTop})};return e.current&&oP(e.current,"scroll",i,{capture:!1,passive:!0}),function(){e.current&&aP(e.current,"scroll",i)}},[e]),n};const gP=mP,yP=e=>{const t=new Date;return e.getTime()-t.getTime()},vP=(e=yP)=>{const[t,n]=_.useState(0),[r,i]=_.useState(),s=()=>n(o=>o+1);return vu(async()=>{if(r){const o=setTimeout(s,e(r));return()=>{clearTimeout(o)}}},[r]),[t,i]};var Dm={},bu={},Nm={};Object.defineProperty(Nm,"__esModule",{value:!0});var _a={},bP=Me&&Me.__awaiter||function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(_a,"__esModule",{value:!0}),_a.Emitter=void 0;let wP=class{constructor(){this.listeners={}}on(t,n,r=!1){const i=this.listeners[t];i?r?i.unshift(n):i.push(n):this.listeners[t]=[n]}emit(t,n){return bP(this,void 0,void 0,function*(){const r=this.listeners[t];if(r!=null&&r.length){for(const i of r)yield i(n);return!0}else return!1})}};_a.Emitter=wP;var jm={};Object.defineProperty(jm,"__esModule",{value:!0});var Um={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.HealthEventType=void 0,function(t){t.Create="create",t.Configure="configure",t.Start="start",t.StartFailure="start-failure",t.Initialize="initialize",t.InitializeFailure="initialize-failure",t.Sleep="sleep",t.Delete="delete"}(e.HealthEventType||(e.HealthEventType={}))})(Um);var Fm={};Object.defineProperty(Fm,"__esModule",{value:!0});var Bm={};Object.defineProperty(Bm,"__esModule",{value:!0});var Vm={};Object.defineProperty(Vm,"__esModule",{value:!0});var zm={};Object.defineProperty(zm,"__esModule",{value:!0}),function(e){var t=Me&&Me.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s),Object.defineProperty(r,o,{enumerable:!0,get:function(){return i[s]}})}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=Me&&Me.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,r,s)};Object.defineProperty(e,"__esModule",{value:!0}),n(Nm,e),n(_a,e),n(jm,e),n(Um,e),n(Fm,e),n(Bm,e),n(Vm,e),n(zm,e)}(bu);var ka={},Zm={},wu={exports:{}},Ca={},xu={},Ea={},zs={},Hi={},wi={},qi={},Ki={},er={};Object.defineProperty(er,"__esModule",{value:!0}),er.ERROR_PACKET=er.PACKET_TYPES_REVERSE=er.PACKET_TYPES=void 0;const tr=Object.create(null);er.PACKET_TYPES=tr,tr.open="0",tr.close="1",tr.ping="2",tr.pong="3",tr.message="4",tr.upgrade="5",tr.noop="6";const Wm=Object.create(null);er.PACKET_TYPES_REVERSE=Wm,Object.keys(tr).forEach(e=>{Wm[tr[e]]=e});const xP={type:"error",data:"parser error"};er.ERROR_PACKET=xP,Object.defineProperty(Ki,"__esModule",{value:!0}),Ki.encodePacket=Ki.encodePacketToBinary=void 0;const _P=er,Hm=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",qm=typeof ArrayBuffer=="function",Km=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Jm=({type:e,data:t},n,r)=>Hm&&t instanceof Blob?n?r(t):Gm(t,r):qm&&(t instanceof ArrayBuffer||Km(t))?n?r(t):Gm(new Blob([t]),r):r(_P.PACKET_TYPES[e]+(t||""));Ki.encodePacket=Jm;const Gm=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function Ym(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let _u;function kP(e,t){if(Hm&&e.data instanceof Blob)return e.data.arrayBuffer().then(Ym).then(t);if(qm&&(e.data instanceof ArrayBuffer||Km(e.data)))return t(Ym(e.data));Jm(e,!1,n=>{_u||(_u=new TextEncoder),t(_u.encode(n))})}Ki.encodePacketToBinary=kP;var Sa={},Ji={};Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.decode=Ji.encode=void 0;const Gi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Zs=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<Gi.length;e++)Zs[Gi.charCodeAt(e)]=e;const CP=e=>{let t=new Uint8Array(e),n,r=t.length,i="";for(n=0;n<r;n+=3)i+=Gi[t[n]>>2],i+=Gi[(t[n]&3)<<4|t[n+1]>>4],i+=Gi[(t[n+1]&15)<<2|t[n+2]>>6],i+=Gi[t[n+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};Ji.encode=CP;const EP=e=>{let t=e.length*.75,n=e.length,r,i=0,s,o,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),u=new Uint8Array(c);for(r=0;r<n;r+=4)s=Zs[e.charCodeAt(r)],o=Zs[e.charCodeAt(r+1)],a=Zs[e.charCodeAt(r+2)],l=Zs[e.charCodeAt(r+3)],u[i++]=s<<2|o>>4,u[i++]=(o&15)<<4|a>>2,u[i++]=(a&3)<<6|l&63;return c};Ji.decode=EP,Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.decodePacket=void 0;const Ta=er,SP=Ji,TP=typeof ArrayBuffer=="function",OP=(e,t)=>{if(typeof e!="string")return{type:"message",data:Qm(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:IP(e.substring(1),t)}:Ta.PACKET_TYPES_REVERSE[n]?e.length>1?{type:Ta.PACKET_TYPES_REVERSE[n],data:e.substring(1)}:{type:Ta.PACKET_TYPES_REVERSE[n]}:Ta.ERROR_PACKET};Sa.decodePacket=OP;const IP=(e,t)=>{if(TP){const n=(0,SP.decode)(e);return Qm(n,t)}else return{base64:!0,data:e}},Qm=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decodePayload=e.decodePacket=e.encodePayload=e.encodePacket=e.protocol=e.createPacketDecoderStream=e.createPacketEncoderStream=void 0;const t=Ki;Object.defineProperty(e,"encodePacket",{enumerable:!0,get:function(){return t.encodePacket}});const n=Sa;Object.defineProperty(e,"decodePacket",{enumerable:!0,get:function(){return n.decodePacket}});const r=er,i=String.fromCharCode(30),s=(h,f)=>{const p=h.length,m=new Array(p);let y=0;h.forEach((v,b)=>{(0,t.encodePacket)(v,!1,x=>{m[b]=x,++y===p&&f(m.join(i))})})};e.encodePayload=s;const o=(h,f)=>{const p=h.split(i),m=[];for(let y=0;y<p.length;y++){const v=(0,n.decodePacket)(p[y],f);if(m.push(v),v.type==="error")break}return m};e.decodePayload=o;function a(){return new TransformStream({transform(h,f){(0,t.encodePacketToBinary)(h,p=>{const m=p.length;let y;if(m<126)y=new Uint8Array(1),new DataView(y.buffer).setUint8(0,m);else if(m<65536){y=new Uint8Array(3);const v=new DataView(y.buffer);v.setUint8(0,126),v.setUint16(1,m)}else{y=new Uint8Array(9);const v=new DataView(y.buffer);v.setUint8(0,127),v.setBigUint64(1,BigInt(m))}h.data&&typeof h.data!="string"&&(y[0]|=128),f.enqueue(y),f.enqueue(p)})}})}e.createPacketEncoderStream=a;let l;function c(h){return h.reduce((f,p)=>f+p.length,0)}function u(h,f){if(h[0].length===f)return h.shift();const p=new Uint8Array(f);let m=0;for(let y=0;y<f;y++)p[y]=h[0][m++],m===h[0].length&&(h.shift(),m=0);return h.length&&m<h[0].length&&(h[0]=h[0].slice(m)),p}function d(h,f){l||(l=new TextDecoder);const p=[];let m=0,y=-1,v=!1;return new TransformStream({transform(b,x){for(p.push(b);;){if(m===0){if(c(p)<1)break;const I=u(p,1);v=(I[0]&128)===128,y=I[0]&127,y<126?m=3:y===126?m=1:m=2}else if(m===1){if(c(p)<2)break;const I=u(p,2);y=new DataView(I.buffer,I.byteOffset,I.length).getUint16(0),m=3}else if(m===2){if(c(p)<8)break;const I=u(p,8),P=new DataView(I.buffer,I.byteOffset,I.length),T=P.getUint32(0);if(T>Math.pow(2,53-32)-1){x.enqueue(r.ERROR_PACKET);break}y=T*Math.pow(2,32)+P.getUint32(4),m=3}else{if(c(p)<y)break;const I=u(p,y);x.enqueue((0,n.decodePacket)(v?I:l.decode(I),f)),m=0}if(y===0||y>h){x.enqueue(r.ERROR_PACKET);break}}}})}e.createPacketDecoderStream=d,e.protocol=4})(qi);function pn(e){if(e)return PP(e)}function PP(e){for(var t in pn.prototype)e[t]=pn.prototype[t];return e}pn.prototype.on=pn.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},pn.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},pn.prototype.off=pn.prototype.removeListener=pn.prototype.removeAllListeners=pn.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this},pn.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},pn.prototype.emitReserved=pn.prototype.emit,pn.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},pn.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Yi=Ll(Object.freeze(Object.defineProperty({__proto__:null,Emitter:pn},Symbol.toStringTag,{value:"Module"})));var Ln={},xi={};Object.defineProperty(xi,"__esModule",{value:!0}),xi.globalThisShim=void 0,xi.globalThisShim=(()=>typeof self<"u"?self:typeof window<"u"?window:Function("return this")())(),Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.byteLength=Ln.installTimerFunctions=Ln.pick=void 0;const qr=xi;function AP(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}Ln.pick=AP;const RP=qr.globalThisShim.setTimeout,$P=qr.globalThisShim.clearTimeout;function MP(e,t){t.useNativeTimers?(e.setTimeoutFn=RP.bind(qr.globalThisShim),e.clearTimeoutFn=$P.bind(qr.globalThisShim)):(e.setTimeoutFn=qr.globalThisShim.setTimeout.bind(qr.globalThisShim),e.clearTimeoutFn=qr.globalThisShim.clearTimeout.bind(qr.globalThisShim))}Ln.installTimerFunctions=MP;const LP=1.33;function DP(e){return typeof e=="string"?NP(e):Math.ceil((e.byteLength||e.size)*LP)}Ln.byteLength=DP;function NP(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}var ku={exports:{}},Cu,Xm;function jP(){if(Xm)return Cu;Xm=1;var e=1e3,t=e*60,n=t*60,r=n*24,i=r*7,s=r*365.25;Cu=function(u,d){d=d||{};var h=typeof u;if(h==="string"&&u.length>0)return o(u);if(h==="number"&&isFinite(u))return d.long?l(u):a(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function o(u){if(u=String(u),!(u.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(d){var h=parseFloat(d[1]),f=(d[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return h*s;case"weeks":case"week":case"w":return h*i;case"days":case"day":case"d":return h*r;case"hours":case"hour":case"hrs":case"hr":case"h":return h*n;case"minutes":case"minute":case"mins":case"min":case"m":return h*t;case"seconds":case"second":case"secs":case"sec":case"s":return h*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return h;default:return}}}}function a(u){var d=Math.abs(u);return d>=r?Math.round(u/r)+"d":d>=n?Math.round(u/n)+"h":d>=t?Math.round(u/t)+"m":d>=e?Math.round(u/e)+"s":u+"ms"}function l(u){var d=Math.abs(u);return d>=r?c(u,d,r,"day"):d>=n?c(u,d,n,"hour"):d>=t?c(u,d,t,"minute"):d>=e?c(u,d,e,"second"):u+" ms"}function c(u,d,h,f){var p=d>=h*1.5;return Math.round(u/h)+" "+f+(p?"s":"")}return Cu}function UP(e){n.debug=n,n.default=n,n.coerce=l,n.disable=s,n.enable=i,n.enabled=o,n.humanize=jP(),n.destroy=c,Object.keys(e).forEach(u=>{n[u]=e[u]}),n.names=[],n.skips=[],n.formatters={};function t(u){let d=0;for(let h=0;h<u.length;h++)d=(d<<5)-d+u.charCodeAt(h),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=t;function n(u){let d,h=null,f,p;function m(...y){if(!m.enabled)return;const v=m,b=Number(new Date),x=b-(d||b);v.diff=x,v.prev=d,v.curr=b,d=b,y[0]=n.coerce(y[0]),typeof y[0]!="string"&&y.unshift("%O");let I=0;y[0]=y[0].replace(/%([a-zA-Z%])/g,(T,j)=>{if(T==="%%")return"%";I++;const U=n.formatters[j];if(typeof U=="function"){const F=y[I];T=U.call(v,F),y.splice(I,1),I--}return T}),n.formatArgs.call(v,y),(v.log||n.log).apply(v,y)}return m.namespace=u,m.useColors=n.useColors(),m.color=n.selectColor(u),m.extend=r,m.destroy=n.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(f!==n.namespaces&&(f=n.namespaces,p=n.enabled(u)),p),set:y=>{h=y}}),typeof n.init=="function"&&n.init(m),m}function r(u,d){const h=n(this.namespace+(typeof d>"u"?":":d)+u);return h.log=this.log,h}function i(u){n.save(u),n.namespaces=u,n.names=[],n.skips=[];let d;const h=(typeof u=="string"?u:"").split(/[\s,]+/),f=h.length;for(d=0;d<f;d++)h[d]&&(u=h[d].replace(/\*/g,".*?"),u[0]==="-"?n.skips.push(new RegExp("^"+u.slice(1)+"$")):n.names.push(new RegExp("^"+u+"$")))}function s(){const u=[...n.names.map(a),...n.skips.map(a).map(d=>"-"+d)].join(",");return n.enable(""),u}function o(u){if(u[u.length-1]==="*")return!0;let d,h;for(d=0,h=n.skips.length;d<h;d++)if(n.skips[d].test(u))return!1;for(d=0,h=n.names.length;d<h;d++)if(n.names[d].test(u))return!0;return!1}function a(u){return u.toString().substring(2,u.toString().length-2).replace(/\.\*\?$/,"*")}function l(u){return u instanceof Error?u.stack||u.message:u}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var FP=UP;(function(e,t){t.formatArgs=r,t.save=i,t.load=s,t.useColors=n,t.storage=o(),t.destroy=(()=>{let l=!1;return()=>{l||(l=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function n(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(l){if(l[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+l[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const c="color: "+this.color;l.splice(1,0,c,"color: inherit");let u=0,d=0;l[0].replace(/%[a-zA-Z%]/g,h=>{h!=="%%"&&(u++,h==="%c"&&(d=u))}),l.splice(d,0,c)}t.log=console.debug||console.log||(()=>{});function i(l){try{l?t.storage.setItem("debug",l):t.storage.removeItem("debug")}catch{}}function s(){let l;try{l=t.storage.getItem("debug")}catch{}return!l&&typeof process<"u"&&"env"in process&&(l=process.env.DEBUG),l}function o(){try{return localStorage}catch{}}e.exports=FP(t);const{formatters:a}=e.exports;a.j=function(l){try{return JSON.stringify(l)}catch(c){return"[UnexpectedJSONParseError]: "+c.message}}})(ku,ku.exports);var nr=ku.exports,_i={};Object.defineProperty(_i,"__esModule",{value:!0}),_i.decode=_i.encode=void 0;function BP(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}_i.encode=BP;function VP(e){let t={},n=e.split("&");for(let r=0,i=n.length;r<i;r++){let s=n[r].split("=");t[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return t}_i.decode=VP;var zP=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wi,"__esModule",{value:!0}),wi.Transport=void 0;const ZP=qi,WP=Yi,HP=Ln,qP=zP(nr),KP=_i,JP=(0,qP.default)("engine.io-client:transport");class GP extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class YP extends WP.Emitter{constructor(t){super(),this.writable=!1,(0,HP.installTimerFunctions)(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,n,r){return super.emitReserved("error",new GP(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"?this.write(t):JP("transport is not open, discarding packets")}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=(0,ZP.decodePacket)(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=(0,KP.encode)(t);return n.length?"?"+n:""}}wi.Transport=YP;var _r={};Object.defineProperty(_r,"__esModule",{value:!0}),_r.yeast=_r.decode=_r.encode=void 0;const eg="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Oa=64,tg={};let ng=0,Kr=0,rg;function Eu(e){let t="";do t=eg[e%Oa]+t,e=Math.floor(e/Oa);while(e>0);return t}_r.encode=Eu;function QP(e){let t=0;for(Kr=0;Kr<e.length;Kr++)t=t*Oa+tg[e.charAt(Kr)];return t}_r.decode=QP;function XP(){const e=Eu(+new Date);return e!==rg?(ng=0,rg=e):e+"."+Eu(ng++)}for(_r.yeast=XP;Kr<Oa;Kr++)tg[eg[Kr]]=Kr;var Qi={},Ia={};Object.defineProperty(Ia,"__esModule",{value:!0}),Ia.hasCORS=void 0;let ig=!1;try{ig=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}Ia.hasCORS=ig,Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.createCookieJar=Qi.XHR=void 0;const eA=Ia,tA=xi;function nA(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||eA.hasCORS))return new XMLHttpRequest}catch{}if(!t)try{return new tA.globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}Qi.XHR=nA;function rA(){}Qi.createCookieJar=rA;var iA=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.Request=Hi.Polling=void 0;const sA=wi,oA=iA(nr),aA=_r,sg=qi,Su=Qi,lA=Yi,og=Ln,cA=xi,wn=(0,oA.default)("engine.io-client:polling");function uA(){}const dA=function(){return new Su.XHR({xdomain:!1}).responseType!=null}();class fA extends sA.Transport{constructor(t){if(super(t),this.polling=!1,typeof location<"u"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||i!==t.port}const n=t&&t.forceBase64;this.supportsBinary=dA&&!n,this.opts.withCredentials&&(this.cookieJar=(0,Su.createCookieJar)())}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const n=()=>{wn("paused"),this.readyState="paused",t()};if(this.polling||!this.writable){let r=0;this.polling&&(wn("we are currently polling - waiting to pause"),r++,this.once("pollComplete",function(){wn("pre-pause polling complete"),--r||n()})),this.writable||(wn("we are currently writing - waiting to pause"),r++,this.once("drain",function(){wn("pre-pause writing complete"),--r||n()}))}else n()}poll(){wn("polling"),this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){wn("polling got data %s",t);const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};(0,sg.decodePayload)(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"?this.poll():wn('ignoring poll - transport state "%s"',this.readyState))}doClose(){const t=()=>{wn("writing close packet"),this.write([{type:"close"}])};this.readyState==="open"?(wn("transport open - closing"),t()):(wn("transport not open - deferring close"),this.once("open",t))}write(t){this.writable=!1,(0,sg.encodePayload)(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=(0,aA.yeast)()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}request(t={}){return Object.assign(t,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new Vn(this.uri(),t)}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(i,s)=>{this.onError("xhr post error",i,s)})}doPoll(){wn("xhr poll");const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}Hi.Polling=fA;class Vn extends lA.Emitter{constructor(t,n){super(),(0,og.installTimerFunctions)(this,n),this.opts=n,this.method=n.method||"GET",this.uri=t,this.data=n.data!==void 0?n.data:null,this.create()}create(){var t;const n=(0,og.pick)(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new Su.XHR(n);try{wn("xhr open %s: %s",this.method,this.uri),r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let i in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(i)&&r.setRequestHeader(i,this.opts.extraHeaders[i])}}catch{}if(this.method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this.opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var i;r.readyState===3&&((i=this.opts.cookieJar)===null||i===void 0||i.parseCookies(r)),r.readyState===4&&(r.status===200||r.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof r.status=="number"?r.status:0)},0))},wn("xhr data %s",this.data),r.send(this.data)}catch(i){this.setTimeoutFn(()=>{this.onError(i)},0);return}typeof document<"u"&&(this.index=Vn.requestsCount++,Vn.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(!(typeof this.xhr>"u"||this.xhr===null)){if(this.xhr.onreadystatechange=uA,t)try{this.xhr.abort()}catch{}typeof document<"u"&&delete Vn.requests[this.index],this.xhr=null}}onLoad(){const t=this.xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(Hi.Request=Vn,Vn.requestsCount=0,Vn.requests={},typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",ag);else if(typeof addEventListener=="function"){const e="onpagehide"in cA.globalThisShim?"pagehide":"unload";addEventListener(e,ag,!1)}}function ag(){for(let e in Vn.requests)Vn.requests.hasOwnProperty(e)&&Vn.requests[e].abort()}var Pa={},Tn={};Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.defaultBinaryType=Tn.usingBrowserWebSocket=Tn.WebSocket=Tn.nextTick=void 0;const lg=xi;Tn.nextTick=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0))(),Tn.WebSocket=lg.globalThisShim.WebSocket||lg.globalThisShim.MozWebSocket,Tn.usingBrowserWebSocket=!0,Tn.defaultBinaryType="arraybuffer";var hA=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pa,"__esModule",{value:!0}),Pa.WS=void 0;const pA=wi,mA=_r,gA=Ln,Jr=Tn,yA=hA(nr),vA=qi,bA=(0,yA.default)("engine.io-client:websocket"),cg=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class wA extends pA.Transport{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const t=this.uri(),n=this.opts.protocols,r=cg?{}:(0,gA.pick)(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=Jr.usingBrowserWebSocket&&!cg?n?new Jr.WebSocket(t,n):new Jr.WebSocket(t):new Jr.WebSocket(t,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;(0,vA.encodePacket)(r,this.supportsBinary,s=>{const o={};Jr.usingBrowserWebSocket||(r.options&&(o.compress=r.options.compress),this.opts.perMessageDeflate&&(typeof s=="string"?Buffer.byteLength(s):s.length)<this.opts.perMessageDeflate.threshold&&(o.compress=!1));try{Jr.usingBrowserWebSocket?this.ws.send(s):this.ws.send(s,o)}catch{bA("websocket closed before onclose event")}i&&(0,Jr.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=(0,mA.yeast)()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}check(){return!!Jr.WebSocket}}Pa.WS=wA;var Aa={},xA=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Aa,"__esModule",{value:!0}),Aa.WT=void 0;const _A=wi,kA=Tn,ug=qi,Ws=(0,xA(nr).default)("engine.io-client:webtransport");class CA extends _A.Transport{get name(){return"webtransport"}doOpen(){typeof WebTransport=="function"&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then(()=>{Ws("transport closed gracefully"),this.onClose()}).catch(t=>{Ws("transport closed due to %s",t),this.onError("webtransport error",t)}),this.transport.ready.then(()=>{this.transport.createBidirectionalStream().then(t=>{const n=(0,ug.createPacketDecoderStream)(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=(0,ug.createPacketEncoderStream)();i.readable.pipeTo(t.writable),this.writer=i.writable.getWriter();const s=()=>{r.read().then(({done:a,value:l})=>{if(a){Ws("session is closed");return}Ws("received chunk: %o",l),this.onPacket(l),s()}).catch(a=>{Ws("an error occurred while reading: %s",a)})};s();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this.writer.write(o).then(()=>this.onOpen())})}))}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],i=n===t.length-1;this.writer.write(r).then(()=>{i&&(0,kA.nextTick)(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this.transport)===null||t===void 0||t.close()}}Aa.WT=CA,Object.defineProperty(zs,"__esModule",{value:!0}),zs.transports=void 0;const EA=Hi,SA=Pa,TA=Aa;zs.transports={websocket:SA.WS,webtransport:TA.WT,polling:EA.Polling};var Hs={};Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.parse=void 0;const OA=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,IA=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function PA(e){const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=OA.exec(e||""),s={},o=14;for(;o--;)s[IA[o]]=i[o]||"";return n!=-1&&r!=-1&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=AA(s,s.path),s.queryKey=RA(s,s.query),s}Hs.parse=PA;function AA(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function RA(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}var $A=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.Socket=void 0;const MA=zs,dg=Ln,LA=_i,fg=Hs,DA=$A(nr),NA=Yi,hg=qi,jA=Tn,Ct=(0,DA.default)("engine.io-client:socket");let pg=class vs extends NA.Emitter{constructor(t,n={}){super(),this.binaryType=jA.defaultBinaryType,this.writeBuffer=[],t&&typeof t=="object"&&(n=t,t=null),t?(t=(0,fg.parse)(t),n.hostname=t.host,n.secure=t.protocol==="https"||t.protocol==="wss",n.port=t.port,t.query&&(n.query=t.query)):n.host&&(n.hostname=(0,fg.parse)(n.host).host),(0,dg.installTimerFunctions)(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=(0,LA.decode)(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(t){Ct('creating transport "%s"',t);const n=Object.assign({},this.opts.query);n.EIO=hg.protocol,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return Ct("options: %j",r),new MA.transports[t](r)}open(){let t;if(this.opts.rememberUpgrade&&vs.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)t="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else t=this.transports[0];this.readyState="opening";try{t=this.createTransport(t)}catch(n){Ct("error while creating transport: %s",n),this.transports.shift(),this.open();return}t.open(),this.setTransport(t)}setTransport(t){Ct("setting transport %s",t.name),this.transport&&(Ct("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(t){Ct('probing transport "%s"',t);let n=this.createTransport(t),r=!1;vs.priorWebsocketSuccess=!1;const i=()=>{r||(Ct('probe transport "%s" opened',t),n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(Ct('probe transport "%s" pong',t),this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;vs.priorWebsocketSuccess=n.name==="websocket",Ct('pausing current transport "%s"',this.transport.name),this.transport.pause(()=>{r||this.readyState!=="closed"&&(Ct("changing transport and sending upgrade packet"),u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{Ct('probe transport "%s" failed',t);const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function s(){r||(r=!0,u(),n.close(),n=null)}const o=d=>{const h=new Error("probe error: "+d);h.transport=n.name,s(),Ct('probe transport "%s" failed because of error: %s',t,d),this.emitReserved("upgradeError",h)};function a(){o("transport closed")}function l(){o("socket closed")}function c(d){n&&d.name!==n.name&&(Ct('"%s" works - aborting "%s"',d.name,n.name),s())}const u=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",c),this.upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onOpen(){if(Ct("socket open"),this.readyState="open",vs.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade){Ct("starting upgrade probes");let t=0;const n=this.upgrades.length;for(;t<n;t++)this.probe(this.upgrades[t])}}onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(Ct('socket receive: type "%s", data "%s"',t.type,t.data),this.emitReserved("packet",t),this.emitReserved("heartbeat"),this.resetPingTimeout(),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=t.data,this.onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}else Ct('packet received with socket readyState "%s"',this.readyState)}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this.getWritablePackets();Ct("flushing %d packets in socket",t.length),this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=(0,dg.byteLength)(i)),r>0&&n>this.maxPayload)return Ct("only send %d out of %d packets",r,this.writeBuffer.length),this.writeBuffer.slice(0,r);n+=2}return Ct("payload size is %d (max: %d)",n,this.maxPayload),this.writeBuffer}write(t,n,r){return this.sendPacket("message",t,n,r),this}send(t,n,r){return this.sendPacket("message",t,n,r),this}sendPacket(t,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const s={type:t,data:n,options:r};this.emitReserved("packetCreate",s),this.writeBuffer.push(s),i&&this.once("flush",i),this.flush()}close(){const t=()=>{this.onClose("forced close"),Ct("socket closing - telling transport to close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}onError(t){Ct("socket error %j",t),vs.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(t,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(Ct('socket close with reason: "%s"',t),this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){const n=[];let r=0;const i=t.length;for(;r<i;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}};Ea.Socket=pg,pg.protocol=hg.protocol,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.nextTick=e.parse=e.installTimerFunctions=e.transports=e.Transport=e.protocol=e.Socket=void 0;const t=Ea;Object.defineProperty(e,"Socket",{enumerable:!0,get:function(){return t.Socket}}),e.protocol=t.Socket.protocol;var n=wi;Object.defineProperty(e,"Transport",{enumerable:!0,get:function(){return n.Transport}});var r=zs;Object.defineProperty(e,"transports",{enumerable:!0,get:function(){return r.transports}});var i=Ln;Object.defineProperty(e,"installTimerFunctions",{enumerable:!0,get:function(){return i.installTimerFunctions}});var s=Hs;Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return s.parse}});var o=Tn;Object.defineProperty(e,"nextTick",{enumerable:!0,get:function(){return o.nextTick}})}(xu);var UA=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ca,"__esModule",{value:!0}),Ca.url=void 0;const FA=xu,mg=UA(nr).default("socket.io-client:url");function BA(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(mg("protocol-less url %s",e),typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),mg("parse %s",e),r=FA.parse(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const s=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+s+":"+r.port+t,r.href=r.protocol+"://"+s+(n&&n.port===r.port?"":":"+r.port),r}Ca.url=BA;var Ra={},qs={},$a={},Xi={},ki={};Object.defineProperty(ki,"__esModule",{value:!0}),ki.hasBinary=ki.isBinary=void 0;const VA=typeof ArrayBuffer=="function",zA=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,gg=Object.prototype.toString,ZA=typeof Blob=="function"||typeof Blob<"u"&&gg.call(Blob)==="[object BlobConstructor]",WA=typeof File=="function"||typeof File<"u"&&gg.call(File)==="[object FileConstructor]";function yg(e){return VA&&(e instanceof ArrayBuffer||zA(e))||ZA&&e instanceof Blob||WA&&e instanceof File}ki.isBinary=yg;function Ma(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Ma(e[n]))return!0;return!1}if(yg(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Ma(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Ma(e[n]))return!0;return!1}ki.hasBinary=Ma,Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.reconstructPacket=Xi.deconstructPacket=void 0;const HA=ki;function qA(e){const t=[],n=e.data,r=e;return r.data=Tu(n,t),r.attachments=t.length,{packet:r,buffers:t}}Xi.deconstructPacket=qA;function Tu(e,t){if(!e)return e;if((0,HA.isBinary)(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Tu(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Tu(e[r],t));return n}return e}function KA(e,t){return e.data=Ou(e.data,t),delete e.attachments,e}Xi.reconstructPacket=KA;function Ou(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Ou(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Ou(e[n],t));return e}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Decoder=e.Encoder=e.PacketType=e.protocol=void 0;const t=Yi,n=Xi,r=ki,s=(0,nr.default)("socket.io-parser"),o=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];e.protocol=5;var a;(function(h){h[h.CONNECT=0]="CONNECT",h[h.DISCONNECT=1]="DISCONNECT",h[h.EVENT=2]="EVENT",h[h.ACK=3]="ACK",h[h.CONNECT_ERROR=4]="CONNECT_ERROR",h[h.BINARY_EVENT=5]="BINARY_EVENT",h[h.BINARY_ACK=6]="BINARY_ACK"})(a=e.PacketType||(e.PacketType={}));class l{constructor(f){this.replacer=f}encode(f){return s("encoding packet %j",f),(f.type===a.EVENT||f.type===a.ACK)&&(0,r.hasBinary)(f)?this.encodeAsBinary({type:f.type===a.EVENT?a.BINARY_EVENT:a.BINARY_ACK,nsp:f.nsp,data:f.data,id:f.id}):[this.encodeAsString(f)]}encodeAsString(f){let p=""+f.type;return(f.type===a.BINARY_EVENT||f.type===a.BINARY_ACK)&&(p+=f.attachments+"-"),f.nsp&&f.nsp!=="/"&&(p+=f.nsp+","),f.id!=null&&(p+=f.id),f.data!=null&&(p+=JSON.stringify(f.data,this.replacer)),s("encoded %j as %s",f,p),p}encodeAsBinary(f){const p=(0,n.deconstructPacket)(f),m=this.encodeAsString(p.packet),y=p.buffers;return y.unshift(m),y}}e.Encoder=l;function c(h){return Object.prototype.toString.call(h)==="[object Object]"}class u extends t.Emitter{constructor(f){super(),this.reviver=f}add(f){let p;if(typeof f=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");p=this.decodeString(f);const m=p.type===a.BINARY_EVENT;m||p.type===a.BINARY_ACK?(p.type=m?a.EVENT:a.ACK,this.reconstructor=new d(p),p.attachments===0&&super.emitReserved("decoded",p)):super.emitReserved("decoded",p)}else if((0,r.isBinary)(f)||f.base64)if(this.reconstructor)p=this.reconstructor.takeBinaryData(f),p&&(this.reconstructor=null,super.emitReserved("decoded",p));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+f)}decodeString(f){let p=0;const m={type:Number(f.charAt(0))};if(a[m.type]===void 0)throw new Error("unknown packet type "+m.type);if(m.type===a.BINARY_EVENT||m.type===a.BINARY_ACK){const v=p+1;for(;f.charAt(++p)!=="-"&&p!=f.length;);const b=f.substring(v,p);if(b!=Number(b)||f.charAt(p)!=="-")throw new Error("Illegal attachments");m.attachments=Number(b)}if(f.charAt(p+1)==="/"){const v=p+1;for(;++p&&!(f.charAt(p)===","||p===f.length););m.nsp=f.substring(v,p)}else m.nsp="/";const y=f.charAt(p+1);if(y!==""&&Number(y)==y){const v=p+1;for(;++p;){const b=f.charAt(p);if(b==null||Number(b)!=b){--p;break}if(p===f.length)break}m.id=Number(f.substring(v,p+1))}if(f.charAt(++p)){const v=this.tryParse(f.substr(p));if(u.isPayloadValid(m.type,v))m.data=v;else throw new Error("invalid payload")}return s("decoded %s as %j",f,m),m}tryParse(f){try{return JSON.parse(f,this.reviver)}catch{return!1}}static isPayloadValid(f,p){switch(f){case a.CONNECT:return c(p);case a.DISCONNECT:return p===void 0;case a.CONNECT_ERROR:return typeof p=="string"||c(p);case a.EVENT:case a.BINARY_EVENT:return Array.isArray(p)&&(typeof p[0]=="number"||typeof p[0]=="string"&&o.indexOf(p[0])===-1);case a.ACK:case a.BINARY_ACK:return Array.isArray(p)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}e.Decoder=u;class d{constructor(f){this.packet=f,this.buffers=[],this.reconPack=f}takeBinaryData(f){if(this.buffers.push(f),this.buffers.length===this.reconPack.attachments){const p=(0,n.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),p}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}})($a);var Ks={};Object.defineProperty(Ks,"__esModule",{value:!0}),Ks.on=void 0;function JA(e,t,n){return e.on(t,n),function(){e.off(t,n)}}Ks.on=JA;var GA=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qs,"__esModule",{value:!0}),qs.Socket=void 0;const zn=$a,La=Ks,YA=Yi,Vt=GA(nr).default("socket.io-client:socket"),QA=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class XA extends YA.Emitter{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[La.on(t,"open",this.onopen.bind(this)),La.on(t,"packet",this.onpacket.bind(this)),La.on(t,"error",this.onerror.bind(this)),La.on(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){if(QA.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const r={type:zn.PacketType.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const o=this.ids++;Vt("emitting packet with ack id %d",o);const a=n.pop();this._registerAckCallback(o,a),r.id=o}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)?Vt("discard packet as the transport is not currently writable"):this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r),this.flags={},this}_registerAckCallback(t,n){var r;const i=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(i===void 0){this.acks[t]=n;return}const s=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===t&&(Vt("removing packet with ack id %d from the buffer",t),this.sendBuffer.splice(o,1));Vt("event with ack id %d has timed out after %d ms",t,i),n.call(this,new Error("operation has timed out"))},i);this.acks[t]=(...o)=>{this.io.clearTimeoutFn(s),n.apply(this,[null,...o])}}emitWithAck(t,...n){const r=this.flags.timeout!==void 0||this._opts.ackTimeout!==void 0;return new Promise((i,s)=>{n.push((o,a)=>r?o?s(o):i(a):i(o)),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((i,...s)=>r!==this._queue[0]?void 0:(i!==null?r.tryCount>this._opts.retries&&(Vt("packet [%d] is discarded after %d tries",r.id,r.tryCount),this._queue.shift(),n&&n(i)):(Vt("packet [%d] was successfully sent",r.id),this._queue.shift(),n&&n(null,...s)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(Vt("draining queue"),!this.connected||this._queue.length===0)return;const n=this._queue[0];if(n.pending&&!t){Vt("packet [%d] has already been sent and is waiting for an ack",n.id);return}n.pending=!0,n.tryCount++,Vt("sending packet [%d] (try n°%d)",n.id,n.tryCount),this.flags=n.flags,this.emit.apply(this,n.args)}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){Vt("transport is open - connecting"),typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:zn.PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){Vt("close (%s)",t),this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case zn.PacketType.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case zn.PacketType.EVENT:case zn.PacketType.BINARY_EVENT:this.onevent(t);break;case zn.PacketType.ACK:case zn.PacketType.BINARY_ACK:this.onack(t);break;case zn.PacketType.DISCONNECT:this.ondisconnect();break;case zn.PacketType.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];Vt("emitting event %j",n),t.id!=null&&(Vt("attaching ack callback to event"),n.push(this.ack(t.id))),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...i){r||(r=!0,Vt("sending ack %j",i),n.packet({type:zn.PacketType.ACK,id:t,data:i}))}}onack(t){const n=this.acks[t.id];typeof n=="function"?(Vt("calling ack %s with %j",t.id,t.data),n.apply(this,t.data),delete this.acks[t.id]):Vt("bad ack %s",t.id)}onconnect(t,n){Vt("socket connected with id %s",t),this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){Vt("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&(Vt("performing disconnect (%s)",this.nsp),this.packet({type:zn.PacketType.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}qs.Socket=XA;var Da={};Object.defineProperty(Da,"__esModule",{value:!0}),Da.Backoff=void 0;function es(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Da.Backoff=es,es.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},es.prototype.reset=function(){this.attempts=0},es.prototype.setMin=function(e){this.ms=e},es.prototype.setMax=function(e){this.max=e},es.prototype.setJitter=function(e){this.jitter=e};var eR=Me&&Me.__createBinding||(Object.create?function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]}),tR=Me&&Me.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),nR=Me&&Me.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)n!=="default"&&Object.prototype.hasOwnProperty.call(e,n)&&eR(t,e,n);return tR(t,e),t},rR=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ra,"__esModule",{value:!0}),Ra.Manager=void 0;const Iu=xu,iR=qs,sR=nR($a),Ci=Ks,oR=Da,aR=Yi,nn=rR(nr).default("socket.io-client:manager");class lR extends aR.Emitter{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Iu.installTimerFunctions(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new oR.Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const i=n.parser||sR;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(nn("readyState %s",this._readyState),~this._readyState.indexOf("open"))return this;nn("opening %s",this.uri),this.engine=new Iu.Socket(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Ci.on(n,"open",function(){r.onopen(),t&&t()}),s=a=>{nn("error"),this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=Ci.on(n,"error",s);if(this._timeout!==!1){const a=this._timeout;nn("connect attempt will timeout after %d",a);const l=this.setTimeoutFn(()=>{nn("connect attempt timed out after %d",a),i(),s(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(i),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){nn("open"),this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(Ci.on(t,"ping",this.onping.bind(this)),Ci.on(t,"data",this.ondata.bind(this)),Ci.on(t,"error",this.onerror.bind(this)),Ci.on(t,"close",this.onclose.bind(this)),Ci.on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){Iu.nextTick(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){nn("error",t),this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new iR.Socket(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active){nn("socket %s is still active, skipping close",r);return}this._close()}_packet(t){nn("writing packet %j",t);const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){nn("cleanup"),this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){nn("disconnect"),this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(t,n){nn("closed due to %s",t),this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)nn("reconnect failed"),this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();nn("will wait %dms before reconnect attempt",n),this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(nn("attempting reconnect"),this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(i=>{i?(nn("reconnect attempt error"),t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",i)):(nn("reconnect success"),t.onreconnect())}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}Ra.Manager=lR,function(e,t){var n=Me&&Me.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.connect=t.io=t.Socket=t.Manager=t.protocol=void 0;const r=Ca,i=Ra;Object.defineProperty(t,"Manager",{enumerable:!0,get:function(){return i.Manager}});const s=qs;Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return s.Socket}});const a=n(nr).default("socket.io-client"),l={};function c(d,h){typeof d=="object"&&(h=d,d=void 0),h=h||{};const f=r.url(d,h.path||"/socket.io"),p=f.source,m=f.id,y=f.path,v=l[m]&&y in l[m].nsps,b=h.forceNew||h["force new connection"]||h.multiplex===!1||v;let x;return b?(a("ignoring socket cache for %s",p),x=new i.Manager(p,h)):(l[m]||(a("new io instance for %s",p),l[m]=new i.Manager(p,h)),x=l[m]),f.query&&!h.query&&(h.query=f.queryKey),x.socket(f.path,h)}t.io=c,t.connect=c,t.default=c,Object.assign(c,{Manager:i.Manager,Socket:s.Socket,io:c,connect:c});var u=$a;Object.defineProperty(t,"protocol",{enumerable:!0,get:function(){return u.protocol}}),e.exports=c}(wu,wu.exports);var cR=wu.exports;(function(e){var t=Me&&Me.__awaiter||function(l,c,u,d){function h(f){return f instanceof u?f:new u(function(p){p(f)})}return new(u||(u=Promise))(function(f,p){function m(b){try{v(d.next(b))}catch(x){p(x)}}function y(b){try{v(d.throw(b))}catch(x){p(x)}}function v(b){b.done?f(b.value):h(b.value).then(m,y)}v((d=d.apply(l,c||[])).next())})},n=Me&&Me.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(e,"__esModule",{value:!0}),e.SocketComEmitter=e.SocketComEvents=e.SocketCom=void 0;const r=bu,i=n(cR);class s{constructor(c){this.url=c,this.pending={},this.emitter=new a,this.events=this.emitter}connect(c,u){return t(this,void 0,void 0,function*(){return new Promise((d,h)=>{this.disconnect(),this.socket=(0,i.default)(this.url,{transports:["websocket"],auth:c,autoConnect:!1,query:u});const f=setTimeout(()=>{h("connection timed out")},5e3);this.socket.on("login",p=>t(this,void 0,void 0,function*(){clearTimeout(f),d(p)})),this.socket.on("connect_error",p=>{var m;(m=this.socket)===null||m===void 0||m.close(),clearTimeout(f),h(p.message)}),this.socket.on("message",p=>t(this,void 0,void 0,function*(){var m;this.pending[p.request]&&(!((m=p.data)===null||m===void 0)&&m.error?this.pending[p.request].reject(new Error(p.data.message)):this.pending[p.request].resolve(p.data),delete this.pending[p.request]),yield this.emitter.emit(o.Message,p)})),this.socket.connect()})})}disconnect(){var c;this.socket&&!(!((c=this.socket)===null||c===void 0)&&c.disconnected)&&this.socket.disconnect()}request(c,u){var d;return t(this,void 0,void 0,function*(){if(!(!((d=this.socket)===null||d===void 0)&&d.connected))throw new Error("Client is disconnected");const h=this.random(32),f=new Promise((p,m)=>{this.pending[h]={resolve:p,reject:m}});return this.socket.send({request:h,type:c,data:u}),f})}random(c){const u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let d="";for(let h=0;h<c;h++)d+=u.charAt(Math.floor(Math.random()*u.length));return d}}e.SocketCom=s;var o;(function(l){l.Message="message"})(o=e.SocketComEvents||(e.SocketComEvents={}));class a extends r.Emitter{}e.SocketComEmitter=a})(Zm);var Na={},uR=Me&&Me.__awaiter||function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(Na,"__esModule",{value:!0}),Na.SocketEmitter=void 0;class dR{constructor(){this.listeners={}}on(t,n){const r=this.listeners[t];r?r.push(n):this.listeners[t]=[n]}removeListeners(t){this.listeners[t]=[]}emit(t,n){return uR(this,void 0,void 0,function*(){const r=this.listeners[t];if(r!=null&&r.length){for(const i of r)yield i(n);return!0}else return!1})}}Na.SocketEmitter=dR;var xn=Me&&Me.__awaiter||function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(u){try{c(r.next(u))}catch(d){o(d)}}function l(u){try{c(r.throw(u))}catch(d){o(d)}}function c(u){u.done?s(u.value):i(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};Object.defineProperty(ka,"__esModule",{value:!0}),ka.MessagingSocket=void 0;const vg=Zm,fR=Na;class hR extends fR.SocketEmitter{constructor(t){super(),this.clientId=t.clientId,this.com=new vg.SocketCom(t.url),this.com.events.on(vg.SocketComEvents.Message,n=>xn(this,void 0,void 0,function*(){n.type==="message.new"&&(yield this.emit("message",n.data.message))}))}get creds(){return this._creds}get userId(){var t;return(t=this._creds)===null||t===void 0?void 0:t.userId}get conversationId(){return this._conversationId}connect(t,n){return xn(this,void 0,void 0,function*(){const r=n?{userData:JSON.stringify(n)}:void 0,i=yield this.com.connect({clientId:this.clientId,creds:t},r);return i.userId===(t==null?void 0:t.userId)&&!i.userToken&&(i.userToken=t.userToken),this._creds=i,yield this.emit("connect",this._creds),yield this.emit("user",this._creds.userId),i})}disconnect(){return xn(this,void 0,void 0,function*(){this.com.disconnect(),yield this.emit("disconnect",void 0)})}getUser(){return xn(this,void 0,void 0,function*(){return this.request("users.get",{})})}switchConversation(t){return xn(this,void 0,void 0,function*(){this._conversationId=t,yield this.emit("conversation",this._conversationId)})}createConversation(t){return xn(this,void 0,void 0,function*(){const n=yield this.request("conversations.create",{});return(t==null?void 0:t.switch)!==!1&&(yield this.switchConversation(n.id)),n})}startConversation(t){return xn(this,void 0,void 0,function*(){yield this.request("conversations.start",{id:t||this._conversationId})})}getConversation(t){return xn(this,void 0,void 0,function*(){return this.request("conversations.get",{id:t||this._conversationId})})}deleteConversation(t){return xn(this,void 0,void 0,function*(){const n=yield this.request("conversations.delete",{id:t||this._conversationId});return n&&(yield this.switchConversation(void 0)),n})}listConversations(t){return xn(this,void 0,void 0,function*(){return this.request("conversations.list",{limit:t||20})})}sendText(t){return xn(this,void 0,void 0,function*(){return this.request("messages.create",{conversationId:this._conversationId,payload:{type:"text",text:t}})})}sendPayload(t){return xn(this,void 0,void 0,function*(){return this.request("messages.create",{conversationId:this._conversationId,payload:t})})}listMessages(t){return xn(this,void 0,void 0,function*(){return this.request("messages.list",{conversationId:this._conversationId,limit:t||20})})}sendFeedback(t,n){return xn(this,void 0,void 0,function*(){yield this.request("messages.feedback",{messageId:t,feedback:n})})}request(t,n){return this.com.request(t,n)}}ka.MessagingSocket=hR,function(e){var t=Me&&Me.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s),Object.defineProperty(r,o,{enumerable:!0,get:function(){return i[s]}})}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=Me&&Me.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,r,s)};Object.defineProperty(e,"__esModule",{value:!0}),n(bu,e),n(ka,e)}(Dm);var ja={},Pu={},rr={},Ua={},Js={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getParsedType=e.ZodParsedType=e.objectUtil=e.util=void 0;var t;(function(r){r.assertEqual=a=>a;function i(a){}r.assertIs=i;function s(a){throw new Error}r.assertNever=s,r.arrayToEnum=a=>{const l={};for(const c of a)l[c]=c;return l},r.getValidEnumValues=a=>{const l=r.objectKeys(a).filter(u=>typeof a[a[u]]!="number"),c={};for(const u of l)c[u]=a[u];return r.objectValues(c)},r.objectValues=a=>r.objectKeys(a).map(function(l){return a[l]}),r.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const l=[];for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&l.push(c);return l},r.find=(a,l)=>{for(const c of a)if(l(c))return c},r.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function o(a,l=" | "){return a.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}r.joinValues=o,r.jsonStringifyReplacer=(a,l)=>typeof l=="bigint"?l.toString():l})(t=e.util||(e.util={})),function(r){r.mergeShapes=(i,s)=>({...i,...s})}(e.objectUtil||(e.objectUtil={})),e.ZodParsedType=t.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);const n=r=>{switch(typeof r){case"undefined":return e.ZodParsedType.undefined;case"string":return e.ZodParsedType.string;case"number":return isNaN(r)?e.ZodParsedType.nan:e.ZodParsedType.number;case"boolean":return e.ZodParsedType.boolean;case"function":return e.ZodParsedType.function;case"bigint":return e.ZodParsedType.bigint;case"symbol":return e.ZodParsedType.symbol;case"object":return Array.isArray(r)?e.ZodParsedType.array:r===null?e.ZodParsedType.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?e.ZodParsedType.promise:typeof Map<"u"&&r instanceof Map?e.ZodParsedType.map:typeof Set<"u"&&r instanceof Set?e.ZodParsedType.set:typeof Date<"u"&&r instanceof Date?e.ZodParsedType.date:e.ZodParsedType.object;default:return e.ZodParsedType.unknown}};e.getParsedType=n})(Js);var ir={};Object.defineProperty(ir,"__esModule",{value:!0}),ir.ZodError=ir.quotelessJson=ir.ZodIssueCode=void 0;const bg=Js;ir.ZodIssueCode=bg.util.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"]);const pR=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");ir.quotelessJson=pR;let Au=class extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(o))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,bg.util.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};ir.ZodError=Au,Au.create=e=>new Au(e),Object.defineProperty(Ua,"__esModule",{value:!0});const Ei=Js,un=ir,mR=(e,t)=>{let n;switch(e.code){case un.ZodIssueCode.invalid_type:e.received===Ei.ZodParsedType.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case un.ZodIssueCode.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ei.util.jsonStringifyReplacer)}`;break;case un.ZodIssueCode.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ei.util.joinValues(e.keys,", ")}`;break;case un.ZodIssueCode.invalid_union:n="Invalid input";break;case un.ZodIssueCode.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ei.util.joinValues(e.options)}`;break;case un.ZodIssueCode.invalid_enum_value:n=`Invalid enum value. Expected ${Ei.util.joinValues(e.options)}, received '${e.received}'`;break;case un.ZodIssueCode.invalid_arguments:n="Invalid function arguments";break;case un.ZodIssueCode.invalid_return_type:n="Invalid function return type";break;case un.ZodIssueCode.invalid_date:n="Invalid date";break;case un.ZodIssueCode.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ei.util.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case un.ZodIssueCode.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case un.ZodIssueCode.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case un.ZodIssueCode.custom:n="Invalid input";break;case un.ZodIssueCode.invalid_intersection_types:n="Intersection results could not be merged";break;case un.ZodIssueCode.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case un.ZodIssueCode.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ei.util.assertNever(e)}return{message:n}};Ua.default=mR;var gR=Me&&Me.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rr,"__esModule",{value:!0}),rr.getErrorMap=rr.setErrorMap=rr.defaultErrorMap=void 0;const wg=gR(Ua);rr.defaultErrorMap=wg.default;let xg=wg.default;function yR(e){xg=e}rr.setErrorMap=yR;function vR(){return xg}rr.getErrorMap=vR;var Ru={};(function(e){var t=Me&&Me.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(e,"__esModule",{value:!0}),e.isAsync=e.isValid=e.isDirty=e.isAborted=e.OK=e.DIRTY=e.INVALID=e.ParseStatus=e.addIssueToContext=e.EMPTY_PATH=e.makeIssue=void 0;const n=rr,r=t(Ua),i=f=>{const{data:p,path:m,errorMaps:y,issueData:v}=f,b=[...m,...v.path||[]],x={...v,path:b};let I="";const P=y.filter(T=>!!T).slice().reverse();for(const T of P)I=T(x,{data:p,defaultError:I}).message;return{...v,path:b,message:v.message||I}};e.makeIssue=i,e.EMPTY_PATH=[];function s(f,p){const m=(0,e.makeIssue)({issueData:p,data:f.data,path:f.path,errorMaps:[f.common.contextualErrorMap,f.schemaErrorMap,(0,n.getErrorMap)(),r.default].filter(y=>!!y)});f.common.issues.push(m)}e.addIssueToContext=s;class o{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(p,m){const y=[];for(const v of m){if(v.status==="aborted")return e.INVALID;v.status==="dirty"&&p.dirty(),y.push(v.value)}return{status:p.value,value:y}}static async mergeObjectAsync(p,m){const y=[];for(const v of m)y.push({key:await v.key,value:await v.value});return o.mergeObjectSync(p,y)}static mergeObjectSync(p,m){const y={};for(const v of m){const{key:b,value:x}=v;if(b.status==="aborted"||x.status==="aborted")return e.INVALID;b.status==="dirty"&&p.dirty(),x.status==="dirty"&&p.dirty(),b.value!=="__proto__"&&(typeof x.value<"u"||v.alwaysSet)&&(y[b.value]=x.value)}return{status:p.value,value:y}}}e.ParseStatus=o,e.INVALID=Object.freeze({status:"aborted"});const a=f=>({status:"dirty",value:f});e.DIRTY=a;const l=f=>({status:"valid",value:f});e.OK=l;const c=f=>f.status==="aborted";e.isAborted=c;const u=f=>f.status==="dirty";e.isDirty=u;const d=f=>f.status==="valid";e.isValid=d;const h=f=>typeof Promise<"u"&&f instanceof Promise;e.isAsync=h})(Ru);var _g={};Object.defineProperty(_g,"__esModule",{value:!0});var kg={},Cg={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.errorUtil=void 0,function(t){t.errToObj=n=>typeof n=="string"?{message:n}:n||{},t.toString=n=>typeof n=="string"?n:n==null?void 0:n.message}(e.errorUtil||(e.errorUtil={}))})(Cg),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.date=e.boolean=e.bigint=e.array=e.any=e.coerce=e.ZodFirstPartyTypeKind=e.late=e.ZodSchema=e.Schema=e.custom=e.ZodReadonly=e.ZodPipeline=e.ZodBranded=e.BRAND=e.ZodNaN=e.ZodCatch=e.ZodDefault=e.ZodNullable=e.ZodOptional=e.ZodTransformer=e.ZodEffects=e.ZodPromise=e.ZodNativeEnum=e.ZodEnum=e.ZodLiteral=e.ZodLazy=e.ZodFunction=e.ZodSet=e.ZodMap=e.ZodRecord=e.ZodTuple=e.ZodIntersection=e.ZodDiscriminatedUnion=e.ZodUnion=e.ZodObject=e.ZodArray=e.ZodVoid=e.ZodNever=e.ZodUnknown=e.ZodAny=e.ZodNull=e.ZodUndefined=e.ZodSymbol=e.ZodDate=e.ZodBoolean=e.ZodBigInt=e.ZodNumber=e.ZodString=e.ZodType=void 0,e.NEVER=e.void=e.unknown=e.union=e.undefined=e.tuple=e.transformer=e.symbol=e.string=e.strictObject=e.set=e.record=e.promise=e.preprocess=e.pipeline=e.ostring=e.optional=e.onumber=e.oboolean=e.object=e.number=e.nullable=e.null=e.never=e.nativeEnum=e.nan=e.map=e.literal=e.lazy=e.intersection=e.instanceof=e.function=e.enum=e.effect=e.discriminatedUnion=void 0;const t=rr,n=Cg,r=Ru,i=Js,s=ir;class o{constructor(g,w,C,L){this._cachedPath=[],this.parent=g,this.data=w,this._path=C,this._key=L}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const a=(A,g)=>{if((0,r.isValid)(g))return{success:!0,data:g.value};if(!A.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const w=new s.ZodError(A.common.issues);return this._error=w,this._error}}};function l(A){if(!A)return{};const{errorMap:g,invalid_type_error:w,required_error:C,description:L}=A;if(g&&(w||C))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return g?{errorMap:g,description:L}:{errorMap:(ye,fe)=>ye.code!=="invalid_type"?{message:fe.defaultError}:typeof fe.data>"u"?{message:C??fe.defaultError}:{message:w??fe.defaultError},description:L}}class c{constructor(g){this.spa=this.safeParseAsync,this._def=g,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)}get description(){return this._def.description}_getType(g){return(0,i.getParsedType)(g.data)}_getOrReturnCtx(g,w){return w||{common:g.parent.common,data:g.data,parsedType:(0,i.getParsedType)(g.data),schemaErrorMap:this._def.errorMap,path:g.path,parent:g.parent}}_processInputParams(g){return{status:new r.ParseStatus,ctx:{common:g.parent.common,data:g.data,parsedType:(0,i.getParsedType)(g.data),schemaErrorMap:this._def.errorMap,path:g.path,parent:g.parent}}}_parseSync(g){const w=this._parse(g);if((0,r.isAsync)(w))throw new Error("Synchronous parse encountered promise.");return w}_parseAsync(g){const w=this._parse(g);return Promise.resolve(w)}parse(g,w){const C=this.safeParse(g,w);if(C.success)return C.data;throw C.error}safeParse(g,w){var C;const L={common:{issues:[],async:(C=w==null?void 0:w.async)!==null&&C!==void 0?C:!1,contextualErrorMap:w==null?void 0:w.errorMap},path:(w==null?void 0:w.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:g,parsedType:(0,i.getParsedType)(g)},$=this._parseSync({data:g,path:L.path,parent:L});return a(L,$)}async parseAsync(g,w){const C=await this.safeParseAsync(g,w);if(C.success)return C.data;throw C.error}async safeParseAsync(g,w){const C={common:{issues:[],contextualErrorMap:w==null?void 0:w.errorMap,async:!0},path:(w==null?void 0:w.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:g,parsedType:(0,i.getParsedType)(g)},L=this._parse({data:g,path:C.path,parent:C}),$=await((0,r.isAsync)(L)?L:Promise.resolve(L));return a(C,$)}refine(g,w){const C=L=>typeof w=="string"||typeof w>"u"?{message:w}:typeof w=="function"?w(L):w;return this._refinement((L,$)=>{const ye=g(L),fe=()=>$.addIssue({code:s.ZodIssueCode.custom,...C(L)});return typeof Promise<"u"&&ye instanceof Promise?ye.then(We=>We?!0:(fe(),!1)):ye?!0:(fe(),!1)})}refinement(g,w){return this._refinement((C,L)=>g(C)?!0:(L.addIssue(typeof w=="function"?w(C,L):w),!1))}_refinement(g){return new ne({schema:this,typeName:G.ZodEffects,effect:{type:"refinement",refinement:g}})}superRefine(g){return this._refinement(g)}optional(){return me.create(this,this._def)}nullable(){return he.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return K.create(this,this._def)}promise(){return D.create(this,this._def)}or(g){return ee.create([this,g],this._def)}and(g){return Ne.create(this,g,this._def)}transform(g){return new ne({...l(this._def),schema:this,typeName:G.ZodEffects,effect:{type:"transform",transform:g}})}default(g){const w=typeof g=="function"?g:()=>g;return new Le({...l(this._def),innerType:this,defaultValue:w,typeName:G.ZodDefault})}brand(){return new ot({typeName:G.ZodBranded,type:this,...l(this._def)})}catch(g){const w=typeof g=="function"?g:()=>g;return new Pe({...l(this._def),innerType:this,catchValue:w,typeName:G.ZodCatch})}describe(g){const w=this.constructor;return new w({...this._def,description:g})}pipe(g){return Ze.create(this,g)}readonly(){return Z.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}e.ZodType=c,e.Schema=c,e.ZodSchema=c;const u=/^c[^\s-]{8,}$/i,d=/^[a-z][a-z0-9]*$/,h=/^[0-9A-HJKMNP-TV-Z]{26}$/,f=/^[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,p=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,m="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let y;const v=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,b=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,x=A=>A.precision?A.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${A.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${A.precision}}Z$`):A.precision===0?A.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):A.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function I(A,g){return!!((g==="v4"||!g)&&v.test(A)||(g==="v6"||!g)&&b.test(A))}class P extends c{_parse(g){if(this._def.coerce&&(g.data=String(g.data)),this._getType(g)!==i.ZodParsedType.string){const $=this._getOrReturnCtx(g);return(0,r.addIssueToContext)($,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.string,received:$.parsedType}),r.INVALID}const C=new r.ParseStatus;let L;for(const $ of this._def.checks)if($.kind==="min")g.data.length<$.value&&(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.too_small,minimum:$.value,type:"string",inclusive:!0,exact:!1,message:$.message}),C.dirty());else if($.kind==="max")g.data.length>$.value&&(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.too_big,maximum:$.value,type:"string",inclusive:!0,exact:!1,message:$.message}),C.dirty());else if($.kind==="length"){const ye=g.data.length>$.value,fe=g.data.length<$.value;(ye||fe)&&(L=this._getOrReturnCtx(g,L),ye?(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.too_big,maximum:$.value,type:"string",inclusive:!0,exact:!0,message:$.message}):fe&&(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.too_small,minimum:$.value,type:"string",inclusive:!0,exact:!0,message:$.message}),C.dirty())}else if($.kind==="email")p.test(g.data)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"email",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty());else if($.kind==="emoji")y||(y=new RegExp(m,"u")),y.test(g.data)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"emoji",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty());else if($.kind==="uuid")f.test(g.data)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"uuid",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty());else if($.kind==="cuid")u.test(g.data)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"cuid",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty());else if($.kind==="cuid2")d.test(g.data)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"cuid2",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty());else if($.kind==="ulid")h.test(g.data)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"ulid",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty());else if($.kind==="url")try{new URL(g.data)}catch{L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"url",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty()}else $.kind==="regex"?($.regex.lastIndex=0,$.regex.test(g.data)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"regex",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty())):$.kind==="trim"?g.data=g.data.trim():$.kind==="includes"?g.data.includes($.value,$.position)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.invalid_string,validation:{includes:$.value,position:$.position},message:$.message}),C.dirty()):$.kind==="toLowerCase"?g.data=g.data.toLowerCase():$.kind==="toUpperCase"?g.data=g.data.toUpperCase():$.kind==="startsWith"?g.data.startsWith($.value)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.invalid_string,validation:{startsWith:$.value},message:$.message}),C.dirty()):$.kind==="endsWith"?g.data.endsWith($.value)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.invalid_string,validation:{endsWith:$.value},message:$.message}),C.dirty()):$.kind==="datetime"?x($).test(g.data)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.invalid_string,validation:"datetime",message:$.message}),C.dirty()):$.kind==="ip"?I(g.data,$.version)||(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{validation:"ip",code:s.ZodIssueCode.invalid_string,message:$.message}),C.dirty()):i.util.assertNever($);return{status:C.value,value:g.data}}_regex(g,w,C){return this.refinement(L=>g.test(L),{validation:w,code:s.ZodIssueCode.invalid_string,...n.errorUtil.errToObj(C)})}_addCheck(g){return new P({...this._def,checks:[...this._def.checks,g]})}email(g){return this._addCheck({kind:"email",...n.errorUtil.errToObj(g)})}url(g){return this._addCheck({kind:"url",...n.errorUtil.errToObj(g)})}emoji(g){return this._addCheck({kind:"emoji",...n.errorUtil.errToObj(g)})}uuid(g){return this._addCheck({kind:"uuid",...n.errorUtil.errToObj(g)})}cuid(g){return this._addCheck({kind:"cuid",...n.errorUtil.errToObj(g)})}cuid2(g){return this._addCheck({kind:"cuid2",...n.errorUtil.errToObj(g)})}ulid(g){return this._addCheck({kind:"ulid",...n.errorUtil.errToObj(g)})}ip(g){return this._addCheck({kind:"ip",...n.errorUtil.errToObj(g)})}datetime(g){var w;return typeof g=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:g}):this._addCheck({kind:"datetime",precision:typeof(g==null?void 0:g.precision)>"u"?null:g==null?void 0:g.precision,offset:(w=g==null?void 0:g.offset)!==null&&w!==void 0?w:!1,...n.errorUtil.errToObj(g==null?void 0:g.message)})}regex(g,w){return this._addCheck({kind:"regex",regex:g,...n.errorUtil.errToObj(w)})}includes(g,w){return this._addCheck({kind:"includes",value:g,position:w==null?void 0:w.position,...n.errorUtil.errToObj(w==null?void 0:w.message)})}startsWith(g,w){return this._addCheck({kind:"startsWith",value:g,...n.errorUtil.errToObj(w)})}endsWith(g,w){return this._addCheck({kind:"endsWith",value:g,...n.errorUtil.errToObj(w)})}min(g,w){return this._addCheck({kind:"min",value:g,...n.errorUtil.errToObj(w)})}max(g,w){return this._addCheck({kind:"max",value:g,...n.errorUtil.errToObj(w)})}length(g,w){return this._addCheck({kind:"length",value:g,...n.errorUtil.errToObj(w)})}nonempty(g){return this.min(1,n.errorUtil.errToObj(g))}trim(){return new P({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new P({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new P({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(g=>g.kind==="datetime")}get isEmail(){return!!this._def.checks.find(g=>g.kind==="email")}get isURL(){return!!this._def.checks.find(g=>g.kind==="url")}get isEmoji(){return!!this._def.checks.find(g=>g.kind==="emoji")}get isUUID(){return!!this._def.checks.find(g=>g.kind==="uuid")}get isCUID(){return!!this._def.checks.find(g=>g.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(g=>g.kind==="cuid2")}get isULID(){return!!this._def.checks.find(g=>g.kind==="ulid")}get isIP(){return!!this._def.checks.find(g=>g.kind==="ip")}get minLength(){let g=null;for(const w of this._def.checks)w.kind==="min"&&(g===null||w.value>g)&&(g=w.value);return g}get maxLength(){let g=null;for(const w of this._def.checks)w.kind==="max"&&(g===null||w.value<g)&&(g=w.value);return g}}e.ZodString=P,P.create=A=>{var g;return new P({checks:[],typeName:G.ZodString,coerce:(g=A==null?void 0:A.coerce)!==null&&g!==void 0?g:!1,...l(A)})};function T(A,g){const w=(A.toString().split(".")[1]||"").length,C=(g.toString().split(".")[1]||"").length,L=w>C?w:C,$=parseInt(A.toFixed(L).replace(".","")),ye=parseInt(g.toFixed(L).replace(".",""));return $%ye/Math.pow(10,L)}class j extends c{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(g){if(this._def.coerce&&(g.data=Number(g.data)),this._getType(g)!==i.ZodParsedType.number){const $=this._getOrReturnCtx(g);return(0,r.addIssueToContext)($,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.number,received:$.parsedType}),r.INVALID}let C;const L=new r.ParseStatus;for(const $ of this._def.checks)$.kind==="int"?i.util.isInteger(g.data)||(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:$.message}),L.dirty()):$.kind==="min"?($.inclusive?g.data<$.value:g.data<=$.value)&&(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_small,minimum:$.value,type:"number",inclusive:$.inclusive,exact:!1,message:$.message}),L.dirty()):$.kind==="max"?($.inclusive?g.data>$.value:g.data>=$.value)&&(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_big,maximum:$.value,type:"number",inclusive:$.inclusive,exact:!1,message:$.message}),L.dirty()):$.kind==="multipleOf"?T(g.data,$.value)!==0&&(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.not_multiple_of,multipleOf:$.value,message:$.message}),L.dirty()):$.kind==="finite"?Number.isFinite(g.data)||(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.not_finite,message:$.message}),L.dirty()):i.util.assertNever($);return{status:L.value,value:g.data}}gte(g,w){return this.setLimit("min",g,!0,n.errorUtil.toString(w))}gt(g,w){return this.setLimit("min",g,!1,n.errorUtil.toString(w))}lte(g,w){return this.setLimit("max",g,!0,n.errorUtil.toString(w))}lt(g,w){return this.setLimit("max",g,!1,n.errorUtil.toString(w))}setLimit(g,w,C,L){return new j({...this._def,checks:[...this._def.checks,{kind:g,value:w,inclusive:C,message:n.errorUtil.toString(L)}]})}_addCheck(g){return new j({...this._def,checks:[...this._def.checks,g]})}int(g){return this._addCheck({kind:"int",message:n.errorUtil.toString(g)})}positive(g){return this._addCheck({kind:"min",value:0,inclusive:!1,message:n.errorUtil.toString(g)})}negative(g){return this._addCheck({kind:"max",value:0,inclusive:!1,message:n.errorUtil.toString(g)})}nonpositive(g){return this._addCheck({kind:"max",value:0,inclusive:!0,message:n.errorUtil.toString(g)})}nonnegative(g){return this._addCheck({kind:"min",value:0,inclusive:!0,message:n.errorUtil.toString(g)})}multipleOf(g,w){return this._addCheck({kind:"multipleOf",value:g,message:n.errorUtil.toString(w)})}finite(g){return this._addCheck({kind:"finite",message:n.errorUtil.toString(g)})}safe(g){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:n.errorUtil.toString(g)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:n.errorUtil.toString(g)})}get minValue(){let g=null;for(const w of this._def.checks)w.kind==="min"&&(g===null||w.value>g)&&(g=w.value);return g}get maxValue(){let g=null;for(const w of this._def.checks)w.kind==="max"&&(g===null||w.value<g)&&(g=w.value);return g}get isInt(){return!!this._def.checks.find(g=>g.kind==="int"||g.kind==="multipleOf"&&i.util.isInteger(g.value))}get isFinite(){let g=null,w=null;for(const C of this._def.checks){if(C.kind==="finite"||C.kind==="int"||C.kind==="multipleOf")return!0;C.kind==="min"?(w===null||C.value>w)&&(w=C.value):C.kind==="max"&&(g===null||C.value<g)&&(g=C.value)}return Number.isFinite(w)&&Number.isFinite(g)}}e.ZodNumber=j,j.create=A=>new j({checks:[],typeName:G.ZodNumber,coerce:(A==null?void 0:A.coerce)||!1,...l(A)});class U extends c{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(g){if(this._def.coerce&&(g.data=BigInt(g.data)),this._getType(g)!==i.ZodParsedType.bigint){const $=this._getOrReturnCtx(g);return(0,r.addIssueToContext)($,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.bigint,received:$.parsedType}),r.INVALID}let C;const L=new r.ParseStatus;for(const $ of this._def.checks)$.kind==="min"?($.inclusive?g.data<$.value:g.data<=$.value)&&(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_small,type:"bigint",minimum:$.value,inclusive:$.inclusive,message:$.message}),L.dirty()):$.kind==="max"?($.inclusive?g.data>$.value:g.data>=$.value)&&(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_big,type:"bigint",maximum:$.value,inclusive:$.inclusive,message:$.message}),L.dirty()):$.kind==="multipleOf"?g.data%$.value!==BigInt(0)&&(C=this._getOrReturnCtx(g,C),(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.not_multiple_of,multipleOf:$.value,message:$.message}),L.dirty()):i.util.assertNever($);return{status:L.value,value:g.data}}gte(g,w){return this.setLimit("min",g,!0,n.errorUtil.toString(w))}gt(g,w){return this.setLimit("min",g,!1,n.errorUtil.toString(w))}lte(g,w){return this.setLimit("max",g,!0,n.errorUtil.toString(w))}lt(g,w){return this.setLimit("max",g,!1,n.errorUtil.toString(w))}setLimit(g,w,C,L){return new U({...this._def,checks:[...this._def.checks,{kind:g,value:w,inclusive:C,message:n.errorUtil.toString(L)}]})}_addCheck(g){return new U({...this._def,checks:[...this._def.checks,g]})}positive(g){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:n.errorUtil.toString(g)})}negative(g){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:n.errorUtil.toString(g)})}nonpositive(g){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:n.errorUtil.toString(g)})}nonnegative(g){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:n.errorUtil.toString(g)})}multipleOf(g,w){return this._addCheck({kind:"multipleOf",value:g,message:n.errorUtil.toString(w)})}get minValue(){let g=null;for(const w of this._def.checks)w.kind==="min"&&(g===null||w.value>g)&&(g=w.value);return g}get maxValue(){let g=null;for(const w of this._def.checks)w.kind==="max"&&(g===null||w.value<g)&&(g=w.value);return g}}e.ZodBigInt=U,U.create=A=>{var g;return new U({checks:[],typeName:G.ZodBigInt,coerce:(g=A==null?void 0:A.coerce)!==null&&g!==void 0?g:!1,...l(A)})};class F extends c{_parse(g){if(this._def.coerce&&(g.data=!!g.data),this._getType(g)!==i.ZodParsedType.boolean){const C=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.boolean,received:C.parsedType}),r.INVALID}return(0,r.OK)(g.data)}}e.ZodBoolean=F,F.create=A=>new F({typeName:G.ZodBoolean,coerce:(A==null?void 0:A.coerce)||!1,...l(A)});class O extends c{_parse(g){if(this._def.coerce&&(g.data=new Date(g.data)),this._getType(g)!==i.ZodParsedType.date){const $=this._getOrReturnCtx(g);return(0,r.addIssueToContext)($,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.date,received:$.parsedType}),r.INVALID}if(isNaN(g.data.getTime())){const $=this._getOrReturnCtx(g);return(0,r.addIssueToContext)($,{code:s.ZodIssueCode.invalid_date}),r.INVALID}const C=new r.ParseStatus;let L;for(const $ of this._def.checks)$.kind==="min"?g.data.getTime()<$.value&&(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.too_small,message:$.message,inclusive:!0,exact:!1,minimum:$.value,type:"date"}),C.dirty()):$.kind==="max"?g.data.getTime()>$.value&&(L=this._getOrReturnCtx(g,L),(0,r.addIssueToContext)(L,{code:s.ZodIssueCode.too_big,message:$.message,inclusive:!0,exact:!1,maximum:$.value,type:"date"}),C.dirty()):i.util.assertNever($);return{status:C.value,value:new Date(g.data.getTime())}}_addCheck(g){return new O({...this._def,checks:[...this._def.checks,g]})}min(g,w){return this._addCheck({kind:"min",value:g.getTime(),message:n.errorUtil.toString(w)})}max(g,w){return this._addCheck({kind:"max",value:g.getTime(),message:n.errorUtil.toString(w)})}get minDate(){let g=null;for(const w of this._def.checks)w.kind==="min"&&(g===null||w.value>g)&&(g=w.value);return g!=null?new Date(g):null}get maxDate(){let g=null;for(const w of this._def.checks)w.kind==="max"&&(g===null||w.value<g)&&(g=w.value);return g!=null?new Date(g):null}}e.ZodDate=O,O.create=A=>new O({checks:[],coerce:(A==null?void 0:A.coerce)||!1,typeName:G.ZodDate,...l(A)});class N extends c{_parse(g){if(this._getType(g)!==i.ZodParsedType.symbol){const C=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.symbol,received:C.parsedType}),r.INVALID}return(0,r.OK)(g.data)}}e.ZodSymbol=N,N.create=A=>new N({typeName:G.ZodSymbol,...l(A)});class J extends c{_parse(g){if(this._getType(g)!==i.ZodParsedType.undefined){const C=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.undefined,received:C.parsedType}),r.INVALID}return(0,r.OK)(g.data)}}e.ZodUndefined=J,J.create=A=>new J({typeName:G.ZodUndefined,...l(A)});class q extends c{_parse(g){if(this._getType(g)!==i.ZodParsedType.null){const C=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.null,received:C.parsedType}),r.INVALID}return(0,r.OK)(g.data)}}e.ZodNull=q,q.create=A=>new q({typeName:G.ZodNull,...l(A)});class W extends c{constructor(){super(...arguments),this._any=!0}_parse(g){return(0,r.OK)(g.data)}}e.ZodAny=W,W.create=A=>new W({typeName:G.ZodAny,...l(A)});class B extends c{constructor(){super(...arguments),this._unknown=!0}_parse(g){return(0,r.OK)(g.data)}}e.ZodUnknown=B,B.create=A=>new B({typeName:G.ZodUnknown,...l(A)});class V extends c{_parse(g){const w=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.never,received:w.parsedType}),r.INVALID}}e.ZodNever=V,V.create=A=>new V({typeName:G.ZodNever,...l(A)});class Y extends c{_parse(g){if(this._getType(g)!==i.ZodParsedType.undefined){const C=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.void,received:C.parsedType}),r.INVALID}return(0,r.OK)(g.data)}}e.ZodVoid=Y,Y.create=A=>new Y({typeName:G.ZodVoid,...l(A)});class K extends c{_parse(g){const{ctx:w,status:C}=this._processInputParams(g),L=this._def;if(w.parsedType!==i.ZodParsedType.array)return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.array,received:w.parsedType}),r.INVALID;if(L.exactLength!==null){const ye=w.data.length>L.exactLength.value,fe=w.data.length<L.exactLength.value;(ye||fe)&&((0,r.addIssueToContext)(w,{code:ye?s.ZodIssueCode.too_big:s.ZodIssueCode.too_small,minimum:fe?L.exactLength.value:void 0,maximum:ye?L.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:L.exactLength.message}),C.dirty())}if(L.minLength!==null&&w.data.length<L.minLength.value&&((0,r.addIssueToContext)(w,{code:s.ZodIssueCode.too_small,minimum:L.minLength.value,type:"array",inclusive:!0,exact:!1,message:L.minLength.message}),C.dirty()),L.maxLength!==null&&w.data.length>L.maxLength.value&&((0,r.addIssueToContext)(w,{code:s.ZodIssueCode.too_big,maximum:L.maxLength.value,type:"array",inclusive:!0,exact:!1,message:L.maxLength.message}),C.dirty()),w.common.async)return Promise.all([...w.data].map((ye,fe)=>L.type._parseAsync(new o(w,ye,w.path,fe)))).then(ye=>r.ParseStatus.mergeArray(C,ye));const $=[...w.data].map((ye,fe)=>L.type._parseSync(new o(w,ye,w.path,fe)));return r.ParseStatus.mergeArray(C,$)}get element(){return this._def.type}min(g,w){return new K({...this._def,minLength:{value:g,message:n.errorUtil.toString(w)}})}max(g,w){return new K({...this._def,maxLength:{value:g,message:n.errorUtil.toString(w)}})}length(g,w){return new K({...this._def,exactLength:{value:g,message:n.errorUtil.toString(w)}})}nonempty(g){return this.min(1,g)}}e.ZodArray=K,K.create=(A,g)=>new K({type:A,minLength:null,maxLength:null,exactLength:null,typeName:G.ZodArray,...l(g)});function pe(A){if(A instanceof k){const g={};for(const w in A.shape){const C=A.shape[w];g[w]=me.create(pe(C))}return new k({...A._def,shape:()=>g})}else return A instanceof K?new K({...A._def,type:pe(A.element)}):A instanceof me?me.create(pe(A.unwrap())):A instanceof he?he.create(pe(A.unwrap())):A instanceof Ie?Ie.create(A.items.map(g=>pe(g))):A}class k extends c{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const g=this._def.shape(),w=i.util.objectKeys(g);return this._cached={shape:g,keys:w}}_parse(g){if(this._getType(g)!==i.ZodParsedType.object){const Fe=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(Fe,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.object,received:Fe.parsedType}),r.INVALID}const{status:C,ctx:L}=this._processInputParams(g),{shape:$,keys:ye}=this._getCached(),fe=[];if(!(this._def.catchall instanceof V&&this._def.unknownKeys==="strip"))for(const Fe in L.data)ye.includes(Fe)||fe.push(Fe);const We=[];for(const Fe of ye){const lt=$[Fe],Un=L.data[Fe];We.push({key:{status:"valid",value:Fe},value:lt._parse(new o(L,Un,L.path,Fe)),alwaysSet:Fe in L.data})}if(this._def.catchall instanceof V){const Fe=this._def.unknownKeys;if(Fe==="passthrough")for(const lt of fe)We.push({key:{status:"valid",value:lt},value:{status:"valid",value:L.data[lt]}});else if(Fe==="strict")fe.length>0&&((0,r.addIssueToContext)(L,{code:s.ZodIssueCode.unrecognized_keys,keys:fe}),C.dirty());else if(Fe!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const Fe=this._def.catchall;for(const lt of fe){const Un=L.data[lt];We.push({key:{status:"valid",value:lt},value:Fe._parse(new o(L,Un,L.path,lt)),alwaysSet:lt in L.data})}}return L.common.async?Promise.resolve().then(async()=>{const Fe=[];for(const lt of We){const Un=await lt.key;Fe.push({key:Un,value:await lt.value,alwaysSet:lt.alwaysSet})}return Fe}).then(Fe=>r.ParseStatus.mergeObjectSync(C,Fe)):r.ParseStatus.mergeObjectSync(C,We)}get shape(){return this._def.shape()}strict(g){return n.errorUtil.errToObj,new k({...this._def,unknownKeys:"strict",...g!==void 0?{errorMap:(w,C)=>{var L,$,ye,fe;const We=(ye=($=(L=this._def).errorMap)===null||$===void 0?void 0:$.call(L,w,C).message)!==null&&ye!==void 0?ye:C.defaultError;return w.code==="unrecognized_keys"?{message:(fe=n.errorUtil.errToObj(g).message)!==null&&fe!==void 0?fe:We}:{message:We}}}:{}})}strip(){return new k({...this._def,unknownKeys:"strip"})}passthrough(){return new k({...this._def,unknownKeys:"passthrough"})}extend(g){return new k({...this._def,shape:()=>({...this._def.shape(),...g})})}merge(g){return new k({unknownKeys:g._def.unknownKeys,catchall:g._def.catchall,shape:()=>({...this._def.shape(),...g._def.shape()}),typeName:G.ZodObject})}setKey(g,w){return this.augment({[g]:w})}catchall(g){return new k({...this._def,catchall:g})}pick(g){const w={};return i.util.objectKeys(g).forEach(C=>{g[C]&&this.shape[C]&&(w[C]=this.shape[C])}),new k({...this._def,shape:()=>w})}omit(g){const w={};return i.util.objectKeys(this.shape).forEach(C=>{g[C]||(w[C]=this.shape[C])}),new k({...this._def,shape:()=>w})}deepPartial(){return pe(this)}partial(g){const w={};return i.util.objectKeys(this.shape).forEach(C=>{const L=this.shape[C];g&&!g[C]?w[C]=L:w[C]=L.optional()}),new k({...this._def,shape:()=>w})}required(g){const w={};return i.util.objectKeys(this.shape).forEach(C=>{if(g&&!g[C])w[C]=this.shape[C];else{let $=this.shape[C];for(;$ instanceof me;)$=$._def.innerType;w[C]=$}}),new k({...this._def,shape:()=>w})}keyof(){return Ce(i.util.objectKeys(this.shape))}}e.ZodObject=k,k.create=(A,g)=>new k({shape:()=>A,unknownKeys:"strip",catchall:V.create(),typeName:G.ZodObject,...l(g)}),k.strictCreate=(A,g)=>new k({shape:()=>A,unknownKeys:"strict",catchall:V.create(),typeName:G.ZodObject,...l(g)}),k.lazycreate=(A,g)=>new k({shape:A,unknownKeys:"strip",catchall:V.create(),typeName:G.ZodObject,...l(g)});class ee extends c{_parse(g){const{ctx:w}=this._processInputParams(g),C=this._def.options;function L($){for(const fe of $)if(fe.result.status==="valid")return fe.result;for(const fe of $)if(fe.result.status==="dirty")return w.common.issues.push(...fe.ctx.common.issues),fe.result;const ye=$.map(fe=>new s.ZodError(fe.ctx.common.issues));return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_union,unionErrors:ye}),r.INVALID}if(w.common.async)return Promise.all(C.map(async $=>{const ye={...w,common:{...w.common,issues:[]},parent:null};return{result:await $._parseAsync({data:w.data,path:w.path,parent:ye}),ctx:ye}})).then(L);{let $;const ye=[];for(const We of C){const Fe={...w,common:{...w.common,issues:[]},parent:null},lt=We._parseSync({data:w.data,path:w.path,parent:Fe});if(lt.status==="valid")return lt;lt.status==="dirty"&&!$&&($={result:lt,ctx:Fe}),Fe.common.issues.length&&ye.push(Fe.common.issues)}if($)return w.common.issues.push(...$.ctx.common.issues),$.result;const fe=ye.map(We=>new s.ZodError(We));return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_union,unionErrors:fe}),r.INVALID}}get options(){return this._def.options}}e.ZodUnion=ee,ee.create=(A,g)=>new ee({options:A,typeName:G.ZodUnion,...l(g)});const xe=A=>A instanceof ve?xe(A.schema):A instanceof ne?xe(A.innerType()):A instanceof ke?[A.value]:A instanceof Re?A.options:A instanceof qe?Object.keys(A.enum):A instanceof Le?xe(A._def.innerType):A instanceof J?[void 0]:A instanceof q?[null]:null;class S extends c{_parse(g){const{ctx:w}=this._processInputParams(g);if(w.parsedType!==i.ZodParsedType.object)return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.object,received:w.parsedType}),r.INVALID;const C=this.discriminator,L=w.data[C],$=this.optionsMap.get(L);return $?w.common.async?$._parseAsync({data:w.data,path:w.path,parent:w}):$._parseSync({data:w.data,path:w.path,parent:w}):((0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[C]}),r.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(g,w,C){const L=new Map;for(const $ of w){const ye=xe($.shape[g]);if(!ye)throw new Error(`A discriminator value for key \`${g}\` could not be extracted from all schema options`);for(const fe of ye){if(L.has(fe))throw new Error(`Discriminator property ${String(g)} has duplicate value ${String(fe)}`);L.set(fe,$)}}return new S({typeName:G.ZodDiscriminatedUnion,discriminator:g,options:w,optionsMap:L,...l(C)})}}e.ZodDiscriminatedUnion=S;function Te(A,g){const w=(0,i.getParsedType)(A),C=(0,i.getParsedType)(g);if(A===g)return{valid:!0,data:A};if(w===i.ZodParsedType.object&&C===i.ZodParsedType.object){const L=i.util.objectKeys(g),$=i.util.objectKeys(A).filter(fe=>L.indexOf(fe)!==-1),ye={...A,...g};for(const fe of $){const We=Te(A[fe],g[fe]);if(!We.valid)return{valid:!1};ye[fe]=We.data}return{valid:!0,data:ye}}else if(w===i.ZodParsedType.array&&C===i.ZodParsedType.array){if(A.length!==g.length)return{valid:!1};const L=[];for(let $=0;$<A.length;$++){const ye=A[$],fe=g[$],We=Te(ye,fe);if(!We.valid)return{valid:!1};L.push(We.data)}return{valid:!0,data:L}}else return w===i.ZodParsedType.date&&C===i.ZodParsedType.date&&+A==+g?{valid:!0,data:A}:{valid:!1}}class Ne extends c{_parse(g){const{status:w,ctx:C}=this._processInputParams(g),L=($,ye)=>{if((0,r.isAborted)($)||(0,r.isAborted)(ye))return r.INVALID;const fe=Te($.value,ye.value);return fe.valid?(((0,r.isDirty)($)||(0,r.isDirty)(ye))&&w.dirty(),{status:w.value,value:fe.data}):((0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_intersection_types}),r.INVALID)};return C.common.async?Promise.all([this._def.left._parseAsync({data:C.data,path:C.path,parent:C}),this._def.right._parseAsync({data:C.data,path:C.path,parent:C})]).then(([$,ye])=>L($,ye)):L(this._def.left._parseSync({data:C.data,path:C.path,parent:C}),this._def.right._parseSync({data:C.data,path:C.path,parent:C}))}}e.ZodIntersection=Ne,Ne.create=(A,g,w)=>new Ne({left:A,right:g,typeName:G.ZodIntersection,...l(w)});class Ie extends c{_parse(g){const{status:w,ctx:C}=this._processInputParams(g);if(C.parsedType!==i.ZodParsedType.array)return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.array,received:C.parsedType}),r.INVALID;if(C.data.length<this._def.items.length)return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.INVALID;!this._def.rest&&C.data.length>this._def.items.length&&((0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),w.dirty());const $=[...C.data].map((ye,fe)=>{const We=this._def.items[fe]||this._def.rest;return We?We._parse(new o(C,ye,C.path,fe)):null}).filter(ye=>!!ye);return C.common.async?Promise.all($).then(ye=>r.ParseStatus.mergeArray(w,ye)):r.ParseStatus.mergeArray(w,$)}get items(){return this._def.items}rest(g){return new Ie({...this._def,rest:g})}}e.ZodTuple=Ie,Ie.create=(A,g)=>{if(!Array.isArray(A))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ie({items:A,typeName:G.ZodTuple,rest:null,...l(g)})};class je extends c{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(g){const{status:w,ctx:C}=this._processInputParams(g);if(C.parsedType!==i.ZodParsedType.object)return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.object,received:C.parsedType}),r.INVALID;const L=[],$=this._def.keyType,ye=this._def.valueType;for(const fe in C.data)L.push({key:$._parse(new o(C,fe,C.path,fe)),value:ye._parse(new o(C,C.data[fe],C.path,fe))});return C.common.async?r.ParseStatus.mergeObjectAsync(w,L):r.ParseStatus.mergeObjectSync(w,L)}get element(){return this._def.valueType}static create(g,w,C){return w instanceof c?new je({keyType:g,valueType:w,typeName:G.ZodRecord,...l(C)}):new je({keyType:P.create(),valueType:g,typeName:G.ZodRecord,...l(w)})}}e.ZodRecord=je;class De extends c{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(g){const{status:w,ctx:C}=this._processInputParams(g);if(C.parsedType!==i.ZodParsedType.map)return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.map,received:C.parsedType}),r.INVALID;const L=this._def.keyType,$=this._def.valueType,ye=[...C.data.entries()].map(([fe,We],Fe)=>({key:L._parse(new o(C,fe,C.path,[Fe,"key"])),value:$._parse(new o(C,We,C.path,[Fe,"value"]))}));if(C.common.async){const fe=new Map;return Promise.resolve().then(async()=>{for(const We of ye){const Fe=await We.key,lt=await We.value;if(Fe.status==="aborted"||lt.status==="aborted")return r.INVALID;(Fe.status==="dirty"||lt.status==="dirty")&&w.dirty(),fe.set(Fe.value,lt.value)}return{status:w.value,value:fe}})}else{const fe=new Map;for(const We of ye){const Fe=We.key,lt=We.value;if(Fe.status==="aborted"||lt.status==="aborted")return r.INVALID;(Fe.status==="dirty"||lt.status==="dirty")&&w.dirty(),fe.set(Fe.value,lt.value)}return{status:w.value,value:fe}}}}e.ZodMap=De,De.create=(A,g,w)=>new De({valueType:g,keyType:A,typeName:G.ZodMap,...l(w)});class Ue extends c{_parse(g){const{status:w,ctx:C}=this._processInputParams(g);if(C.parsedType!==i.ZodParsedType.set)return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.set,received:C.parsedType}),r.INVALID;const L=this._def;L.minSize!==null&&C.data.size<L.minSize.value&&((0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_small,minimum:L.minSize.value,type:"set",inclusive:!0,exact:!1,message:L.minSize.message}),w.dirty()),L.maxSize!==null&&C.data.size>L.maxSize.value&&((0,r.addIssueToContext)(C,{code:s.ZodIssueCode.too_big,maximum:L.maxSize.value,type:"set",inclusive:!0,exact:!1,message:L.maxSize.message}),w.dirty());const $=this._def.valueType;function ye(We){const Fe=new Set;for(const lt of We){if(lt.status==="aborted")return r.INVALID;lt.status==="dirty"&&w.dirty(),Fe.add(lt.value)}return{status:w.value,value:Fe}}const fe=[...C.data.values()].map((We,Fe)=>$._parse(new o(C,We,C.path,Fe)));return C.common.async?Promise.all(fe).then(We=>ye(We)):ye(fe)}min(g,w){return new Ue({...this._def,minSize:{value:g,message:n.errorUtil.toString(w)}})}max(g,w){return new Ue({...this._def,maxSize:{value:g,message:n.errorUtil.toString(w)}})}size(g,w){return this.min(g,w).max(g,w)}nonempty(g){return this.min(1,g)}}e.ZodSet=Ue,Ue.create=(A,g)=>new Ue({valueType:A,minSize:null,maxSize:null,typeName:G.ZodSet,...l(g)});class _e extends c{constructor(){super(...arguments),this.validate=this.implement}_parse(g){const{ctx:w}=this._processInputParams(g);if(w.parsedType!==i.ZodParsedType.function)return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.function,received:w.parsedType}),r.INVALID;function C(fe,We){return(0,r.makeIssue)({data:fe,path:w.path,errorMaps:[w.common.contextualErrorMap,w.schemaErrorMap,(0,t.getErrorMap)(),t.defaultErrorMap].filter(Fe=>!!Fe),issueData:{code:s.ZodIssueCode.invalid_arguments,argumentsError:We}})}function L(fe,We){return(0,r.makeIssue)({data:fe,path:w.path,errorMaps:[w.common.contextualErrorMap,w.schemaErrorMap,(0,t.getErrorMap)(),t.defaultErrorMap].filter(Fe=>!!Fe),issueData:{code:s.ZodIssueCode.invalid_return_type,returnTypeError:We}})}const $={errorMap:w.common.contextualErrorMap},ye=w.data;if(this._def.returns instanceof D){const fe=this;return(0,r.OK)(async function(...We){const Fe=new s.ZodError([]),lt=await fe._def.args.parseAsync(We,$).catch(Vd=>{throw Fe.addIssue(C(We,Vd)),Fe}),Un=await Reflect.apply(ye,this,lt);return await fe._def.returns._def.type.parseAsync(Un,$).catch(Vd=>{throw Fe.addIssue(L(Un,Vd)),Fe})})}else{const fe=this;return(0,r.OK)(function(...We){const Fe=fe._def.args.safeParse(We,$);if(!Fe.success)throw new s.ZodError([C(We,Fe.error)]);const lt=Reflect.apply(ye,this,Fe.data),Un=fe._def.returns.safeParse(lt,$);if(!Un.success)throw new s.ZodError([L(lt,Un.error)]);return Un.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...g){return new _e({...this._def,args:Ie.create(g).rest(B.create())})}returns(g){return new _e({...this._def,returns:g})}implement(g){return this.parse(g)}strictImplement(g){return this.parse(g)}static create(g,w,C){return new _e({args:g||Ie.create([]).rest(B.create()),returns:w||B.create(),typeName:G.ZodFunction,...l(C)})}}e.ZodFunction=_e;class ve extends c{get schema(){return this._def.getter()}_parse(g){const{ctx:w}=this._processInputParams(g);return this._def.getter()._parse({data:w.data,path:w.path,parent:w})}}e.ZodLazy=ve,ve.create=(A,g)=>new ve({getter:A,typeName:G.ZodLazy,...l(g)});class ke extends c{_parse(g){if(g.data!==this._def.value){const w=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(w,{received:w.data,code:s.ZodIssueCode.invalid_literal,expected:this._def.value}),r.INVALID}return{status:"valid",value:g.data}}get value(){return this._def.value}}e.ZodLiteral=ke,ke.create=(A,g)=>new ke({value:A,typeName:G.ZodLiteral,...l(g)});function Ce(A,g){return new Re({values:A,typeName:G.ZodEnum,...l(g)})}class Re extends c{_parse(g){if(typeof g.data!="string"){const w=this._getOrReturnCtx(g),C=this._def.values;return(0,r.addIssueToContext)(w,{expected:i.util.joinValues(C),received:w.parsedType,code:s.ZodIssueCode.invalid_type}),r.INVALID}if(this._def.values.indexOf(g.data)===-1){const w=this._getOrReturnCtx(g),C=this._def.values;return(0,r.addIssueToContext)(w,{received:w.data,code:s.ZodIssueCode.invalid_enum_value,options:C}),r.INVALID}return(0,r.OK)(g.data)}get options(){return this._def.values}get enum(){const g={};for(const w of this._def.values)g[w]=w;return g}get Values(){const g={};for(const w of this._def.values)g[w]=w;return g}get Enum(){const g={};for(const w of this._def.values)g[w]=w;return g}extract(g){return Re.create(g)}exclude(g){return Re.create(this.options.filter(w=>!g.includes(w)))}}e.ZodEnum=Re,Re.create=Ce;class qe extends c{_parse(g){const w=i.util.getValidEnumValues(this._def.values),C=this._getOrReturnCtx(g);if(C.parsedType!==i.ZodParsedType.string&&C.parsedType!==i.ZodParsedType.number){const L=i.util.objectValues(w);return(0,r.addIssueToContext)(C,{expected:i.util.joinValues(L),received:C.parsedType,code:s.ZodIssueCode.invalid_type}),r.INVALID}if(w.indexOf(g.data)===-1){const L=i.util.objectValues(w);return(0,r.addIssueToContext)(C,{received:C.data,code:s.ZodIssueCode.invalid_enum_value,options:L}),r.INVALID}return(0,r.OK)(g.data)}get enum(){return this._def.values}}e.ZodNativeEnum=qe,qe.create=(A,g)=>new qe({values:A,typeName:G.ZodNativeEnum,...l(g)});class D extends c{unwrap(){return this._def.type}_parse(g){const{ctx:w}=this._processInputParams(g);if(w.parsedType!==i.ZodParsedType.promise&&w.common.async===!1)return(0,r.addIssueToContext)(w,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.promise,received:w.parsedType}),r.INVALID;const C=w.parsedType===i.ZodParsedType.promise?w.data:Promise.resolve(w.data);return(0,r.OK)(C.then(L=>this._def.type.parseAsync(L,{path:w.path,errorMap:w.common.contextualErrorMap})))}}e.ZodPromise=D,D.create=(A,g)=>new D({type:A,typeName:G.ZodPromise,...l(g)});class ne extends c{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===G.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(g){const{status:w,ctx:C}=this._processInputParams(g),L=this._def.effect||null,$={addIssue:ye=>{(0,r.addIssueToContext)(C,ye),ye.fatal?w.abort():w.dirty()},get path(){return C.path}};if($.addIssue=$.addIssue.bind($),L.type==="preprocess"){const ye=L.transform(C.data,$);return C.common.issues.length?{status:"dirty",value:C.data}:C.common.async?Promise.resolve(ye).then(fe=>this._def.schema._parseAsync({data:fe,path:C.path,parent:C})):this._def.schema._parseSync({data:ye,path:C.path,parent:C})}if(L.type==="refinement"){const ye=fe=>{const We=L.refinement(fe,$);if(C.common.async)return Promise.resolve(We);if(We instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return fe};if(C.common.async===!1){const fe=this._def.schema._parseSync({data:C.data,path:C.path,parent:C});return fe.status==="aborted"?r.INVALID:(fe.status==="dirty"&&w.dirty(),ye(fe.value),{status:w.value,value:fe.value})}else return this._def.schema._parseAsync({data:C.data,path:C.path,parent:C}).then(fe=>fe.status==="aborted"?r.INVALID:(fe.status==="dirty"&&w.dirty(),ye(fe.value).then(()=>({status:w.value,value:fe.value}))))}if(L.type==="transform")if(C.common.async===!1){const ye=this._def.schema._parseSync({data:C.data,path:C.path,parent:C});if(!(0,r.isValid)(ye))return ye;const fe=L.transform(ye.value,$);if(fe instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:w.value,value:fe}}else return this._def.schema._parseAsync({data:C.data,path:C.path,parent:C}).then(ye=>(0,r.isValid)(ye)?Promise.resolve(L.transform(ye.value,$)).then(fe=>({status:w.value,value:fe})):ye);i.util.assertNever(L)}}e.ZodEffects=ne,e.ZodTransformer=ne,ne.create=(A,g,w)=>new ne({schema:A,typeName:G.ZodEffects,effect:g,...l(w)}),ne.createWithPreprocess=(A,g,w)=>new ne({schema:g,effect:{type:"preprocess",transform:A},typeName:G.ZodEffects,...l(w)});class me extends c{_parse(g){return this._getType(g)===i.ZodParsedType.undefined?(0,r.OK)(void 0):this._def.innerType._parse(g)}unwrap(){return this._def.innerType}}e.ZodOptional=me,me.create=(A,g)=>new me({innerType:A,typeName:G.ZodOptional,...l(g)});class he extends c{_parse(g){return this._getType(g)===i.ZodParsedType.null?(0,r.OK)(null):this._def.innerType._parse(g)}unwrap(){return this._def.innerType}}e.ZodNullable=he,he.create=(A,g)=>new he({innerType:A,typeName:G.ZodNullable,...l(g)});class Le extends c{_parse(g){const{ctx:w}=this._processInputParams(g);let C=w.data;return w.parsedType===i.ZodParsedType.undefined&&(C=this._def.defaultValue()),this._def.innerType._parse({data:C,path:w.path,parent:w})}removeDefault(){return this._def.innerType}}e.ZodDefault=Le,Le.create=(A,g)=>new Le({innerType:A,typeName:G.ZodDefault,defaultValue:typeof g.default=="function"?g.default:()=>g.default,...l(g)});class Pe extends c{_parse(g){const{ctx:w}=this._processInputParams(g),C={...w,common:{...w.common,issues:[]}},L=this._def.innerType._parse({data:C.data,path:C.path,parent:{...C}});return(0,r.isAsync)(L)?L.then($=>({status:"valid",value:$.status==="valid"?$.value:this._def.catchValue({get error(){return new s.ZodError(C.common.issues)},input:C.data})})):{status:"valid",value:L.status==="valid"?L.value:this._def.catchValue({get error(){return new s.ZodError(C.common.issues)},input:C.data})}}removeCatch(){return this._def.innerType}}e.ZodCatch=Pe,Pe.create=(A,g)=>new Pe({innerType:A,typeName:G.ZodCatch,catchValue:typeof g.catch=="function"?g.catch:()=>g.catch,...l(g)});class Be extends c{_parse(g){if(this._getType(g)!==i.ZodParsedType.nan){const C=this._getOrReturnCtx(g);return(0,r.addIssueToContext)(C,{code:s.ZodIssueCode.invalid_type,expected:i.ZodParsedType.nan,received:C.parsedType}),r.INVALID}return{status:"valid",value:g.data}}}e.ZodNaN=Be,Be.create=A=>new Be({typeName:G.ZodNaN,...l(A)}),e.BRAND=Symbol("zod_brand");class ot extends c{_parse(g){const{ctx:w}=this._processInputParams(g),C=w.data;return this._def.type._parse({data:C,path:w.path,parent:w})}unwrap(){return this._def.type}}e.ZodBranded=ot;class Ze extends c{_parse(g){const{status:w,ctx:C}=this._processInputParams(g);if(C.common.async)return(async()=>{const $=await this._def.in._parseAsync({data:C.data,path:C.path,parent:C});return $.status==="aborted"?r.INVALID:$.status==="dirty"?(w.dirty(),(0,r.DIRTY)($.value)):this._def.out._parseAsync({data:$.value,path:C.path,parent:C})})();{const L=this._def.in._parseSync({data:C.data,path:C.path,parent:C});return L.status==="aborted"?r.INVALID:L.status==="dirty"?(w.dirty(),{status:"dirty",value:L.value}):this._def.out._parseSync({data:L.value,path:C.path,parent:C})}}static create(g,w){return new Ze({in:g,out:w,typeName:G.ZodPipeline})}}e.ZodPipeline=Ze;class Z extends c{_parse(g){const w=this._def.innerType._parse(g);return(0,r.isValid)(w)&&(w.value=Object.freeze(w.value)),w}}e.ZodReadonly=Z,Z.create=(A,g)=>new Z({innerType:A,typeName:G.ZodReadonly,...l(g)});const Q=(A,g={},w)=>A?W.create().superRefine((C,L)=>{var $,ye;if(!A(C)){const fe=typeof g=="function"?g(C):typeof g=="string"?{message:g}:g,We=(ye=($=fe.fatal)!==null&&$!==void 0?$:w)!==null&&ye!==void 0?ye:!0,Fe=typeof fe=="string"?{message:fe}:fe;L.addIssue({code:"custom",...Fe,fatal:We})}}):W.create();e.custom=Q,e.late={object:k.lazycreate};var G;(function(A){A.ZodString="ZodString",A.ZodNumber="ZodNumber",A.ZodNaN="ZodNaN",A.ZodBigInt="ZodBigInt",A.ZodBoolean="ZodBoolean",A.ZodDate="ZodDate",A.ZodSymbol="ZodSymbol",A.ZodUndefined="ZodUndefined",A.ZodNull="ZodNull",A.ZodAny="ZodAny",A.ZodUnknown="ZodUnknown",A.ZodNever="ZodNever",A.ZodVoid="ZodVoid",A.ZodArray="ZodArray",A.ZodObject="ZodObject",A.ZodUnion="ZodUnion",A.ZodDiscriminatedUnion="ZodDiscriminatedUnion",A.ZodIntersection="ZodIntersection",A.ZodTuple="ZodTuple",A.ZodRecord="ZodRecord",A.ZodMap="ZodMap",A.ZodSet="ZodSet",A.ZodFunction="ZodFunction",A.ZodLazy="ZodLazy",A.ZodLiteral="ZodLiteral",A.ZodEnum="ZodEnum",A.ZodEffects="ZodEffects",A.ZodNativeEnum="ZodNativeEnum",A.ZodOptional="ZodOptional",A.ZodNullable="ZodNullable",A.ZodDefault="ZodDefault",A.ZodCatch="ZodCatch",A.ZodPromise="ZodPromise",A.ZodBranded="ZodBranded",A.ZodPipeline="ZodPipeline",A.ZodReadonly="ZodReadonly"})(G=e.ZodFirstPartyTypeKind||(e.ZodFirstPartyTypeKind={}));const $e=(A,g={message:`Input not instance of ${A.name}`})=>(0,e.custom)(w=>w instanceof A,g);e.instanceof=$e;const Ge=P.create;e.string=Ge;const St=j.create;e.number=St;const bt=Be.create;e.nan=bt;const gt=U.create;e.bigint=gt;const At=F.create;e.boolean=At;const fn=O.create;e.date=fn;const Rt=N.create;e.symbol=Rt;const Ft=J.create;e.undefined=Ft;const Qt=q.create;e.null=Qt;const Gt=W.create;e.any=Gt;const Rr=B.create;e.unknown=Rr;const jn=V.create;e.never=jn;const fr=Y.create;e.void=fr;const Ri=K.create;e.array=Ri;const si=k.create;e.object=si;const oi=k.strictCreate;e.strictObject=oi;const $r=ee.create;e.union=$r;const Tt=S.create;e.discriminatedUnion=Tt;const Ot=Ne.create;e.intersection=Ot;const Xt=Ie.create;e.tuple=Xt;const en=je.create;e.record=en;const Yt=De.create;e.map=Yt;const Lt=Ue.create;e.set=Lt;const _n=_e.create;e.function=_n;const In=ve.create;e.lazy=In;const hr=ke.create;e.literal=hr;const Fd=Re.create;e.enum=Fd;const Bd=qe.create;e.nativeEnum=Bd;const M=D.create;e.promise=M;const ge=ne.create;e.effect=ge,e.transformer=ge;const Se=me.create;e.optional=Se;const Ke=he.create;e.nullable=Ke;const ft=ne.createWithPreprocess;e.preprocess=ft;const yt=Ze.create;e.pipeline=yt;const at=()=>Ge().optional();e.ostring=at;const it=()=>St().optional();e.onumber=it;const sn=()=>At().optional();e.oboolean=sn,e.coerce={string:A=>P.create({...A,coerce:!0}),number:A=>j.create({...A,coerce:!0}),boolean:A=>F.create({...A,coerce:!0}),bigint:A=>U.create({...A,coerce:!0}),date:A=>O.create({...A,coerce:!0})},e.NEVER=r.INVALID}(kg),function(e){var t=Me&&Me.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s),Object.defineProperty(r,o,{enumerable:!0,get:function(){return i[s]}})}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),n=Me&&Me.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,r,s)};Object.defineProperty(e,"__esModule",{value:!0}),n(rr,e),n(Ru,e),n(_g,e),n(Js,e),n(kg,e),n(ir,e)}(Pu),function(e){var t=Me&&Me.__createBinding||(Object.create?function(o,a,l,c){c===void 0&&(c=l),Object.defineProperty(o,c,{enumerable:!0,get:function(){return a[l]}})}:function(o,a,l,c){c===void 0&&(c=l),o[c]=a[l]}),n=Me&&Me.__setModuleDefault||(Object.create?function(o,a){Object.defineProperty(o,"default",{enumerable:!0,value:a})}:function(o,a){o.default=a}),r=Me&&Me.__importStar||function(o){if(o&&o.__esModule)return o;var a={};if(o!=null)for(var l in o)l!=="default"&&Object.prototype.hasOwnProperty.call(o,l)&&t(a,o,l);return n(a,o),a},i=Me&&Me.__exportStar||function(o,a){for(var l in o)l!=="default"&&!Object.prototype.hasOwnProperty.call(a,l)&&t(a,o,l)};Object.defineProperty(e,"__esModule",{value:!0}),e.z=void 0;const s=r(Pu);e.z=s,i(Pu,e),e.default=s}(ja);const $u={},Eg=Ll(Object.freeze(Object.defineProperty({__proto__:null,default:$u},Symbol.toStringTag,{value:"Module"})));function Sg(e,t){return function(){return e.apply(t,arguments)}}const{toString:bR}=Object.prototype,{getPrototypeOf:Mu}=Object,Fa=(e=>t=>{const n=bR.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),sr=e=>(e=e.toLowerCase(),t=>Fa(t)===e),Ba=e=>t=>typeof t===e,{isArray:ts}=Array,Gs=Ba("undefined");function wR(e){return e!==null&&!Gs(e)&&e.constructor!==null&&!Gs(e.constructor)&&Dn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Tg=sr("ArrayBuffer");function xR(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Tg(e.buffer),t}const _R=Ba("string"),Dn=Ba("function"),Og=Ba("number"),Va=e=>e!==null&&typeof e=="object",kR=e=>e===!0||e===!1,za=e=>{if(Fa(e)!=="object")return!1;const t=Mu(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},CR=sr("Date"),ER=sr("File"),SR=sr("Blob"),TR=sr("FileList"),OR=e=>Va(e)&&Dn(e.pipe),IR=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Dn(e.append)&&((t=Fa(e))==="formdata"||t==="object"&&Dn(e.toString)&&e.toString()==="[object FormData]"))},PR=sr("URLSearchParams"),AR=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ys(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),ts(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let a;for(r=0;r<o;r++)a=s[r],t.call(null,e[a],a,e)}}function Ig(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Pg=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Ag=e=>!Gs(e)&&e!==Pg;function Lu(){const{caseless:e}=Ag(this)&&this||{},t={},n=(r,i)=>{const s=e&&Ig(t,i)||i;za(t[s])&&za(r)?t[s]=Lu(t[s],r):za(r)?t[s]=Lu({},r):ts(r)?t[s]=r.slice():t[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Ys(arguments[r],n);return t}const RR=(e,t,n,{allOwnKeys:r}={})=>(Ys(t,(i,s)=>{n&&Dn(i)?e[s]=Sg(i,n):e[s]=i},{allOwnKeys:r}),e),$R=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),MR=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},LR=(e,t,n,r)=>{let i,s,o;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)o=i[s],(!r||r(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=n!==!1&&Mu(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},DR=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},NR=e=>{if(!e)return null;if(ts(e))return e;let t=e.length;if(!Og(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},jR=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Mu(Uint8Array)),UR=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},FR=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},BR=sr("HTMLFormElement"),VR=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Rg=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),zR=sr("RegExp"),$g=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Ys(n,(i,s)=>{let o;(o=t(i,s,e))!==!1&&(r[s]=o||i)}),Object.defineProperties(e,r)},ZR=e=>{$g(e,(t,n)=>{if(Dn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Dn(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},WR=(e,t)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return ts(e)?r(e):r(String(e).split(t)),n},HR=()=>{},qR=(e,t)=>(e=+e,Number.isFinite(e)?e:t),Du="abcdefghijklmnopqrstuvwxyz",Mg="0123456789",Lg={DIGIT:Mg,ALPHA:Du,ALPHA_DIGIT:Du+Du.toUpperCase()+Mg},KR=(e=16,t=Lg.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function JR(e){return!!(e&&Dn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const GR=e=>{const t=new Array(10),n=(r,i)=>{if(Va(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const s=ts(r)?[]:{};return Ys(r,(o,a)=>{const l=n(o,i+1);!Gs(l)&&(s[a]=l)}),t[i]=void 0,s}}return r};return n(e,0)},YR=sr("AsyncFunction"),re={isArray:ts,isArrayBuffer:Tg,isBuffer:wR,isFormData:IR,isArrayBufferView:xR,isString:_R,isNumber:Og,isBoolean:kR,isObject:Va,isPlainObject:za,isUndefined:Gs,isDate:CR,isFile:ER,isBlob:SR,isRegExp:zR,isFunction:Dn,isStream:OR,isURLSearchParams:PR,isTypedArray:jR,isFileList:TR,forEach:Ys,merge:Lu,extend:RR,trim:AR,stripBOM:$R,inherits:MR,toFlatObject:LR,kindOf:Fa,kindOfTest:sr,endsWith:DR,toArray:NR,forEachEntry:UR,matchAll:FR,isHTMLForm:BR,hasOwnProperty:Rg,hasOwnProp:Rg,reduceDescriptors:$g,freezeMethods:ZR,toObjectSet:WR,toCamelCase:VR,noop:HR,toFiniteNumber:qR,findKey:Ig,global:Pg,isContextDefined:Ag,ALPHABET:Lg,generateString:KR,isSpecCompliantForm:JR,toJSONObject:GR,isAsyncFn:YR,isThenable:e=>e&&(Va(e)||Dn(e))&&Dn(e.then)&&Dn(e.catch)};function ut(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}re.inherits(ut,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:re.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const Dg=ut.prototype,Ng={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Ng[e]={value:e}}),Object.defineProperties(ut,Ng),Object.defineProperty(Dg,"isAxiosError",{value:!0}),ut.from=(e,t,n,r,i,s)=>{const o=Object.create(Dg);return re.toFlatObject(e,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),ut.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};const QR=null;function Nu(e){return re.isPlainObject(e)||re.isArray(e)}function jg(e){return re.endsWith(e,"[]")?e.slice(0,-2):e}function Ug(e,t,n){return e?e.concat(t).map(function(i,s){return i=jg(i),!n&&s?"["+i+"]":i}).join(n?".":""):t}function XR(e){return re.isArray(e)&&!e.some(Nu)}const e$=re.toFlatObject(re,{},null,function(t){return/^is[A-Z]/.test(t)});function Za(e,t,n){if(!re.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=re.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!re.isUndefined(y[m])});const r=n.metaTokens,i=n.visitor||u,s=n.dots,o=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&re.isSpecCompliantForm(t);if(!re.isFunction(i))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(re.isDate(p))return p.toISOString();if(!l&&re.isBlob(p))throw new ut("Blob is not supported. Use a Buffer instead.");return re.isArrayBuffer(p)||re.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,m,y){let v=p;if(p&&!y&&typeof p=="object"){if(re.endsWith(m,"{}"))m=r?m:m.slice(0,-2),p=JSON.stringify(p);else if(re.isArray(p)&&XR(p)||(re.isFileList(p)||re.endsWith(m,"[]"))&&(v=re.toArray(p)))return m=jg(m),v.forEach(function(x,I){!(re.isUndefined(x)||x===null)&&t.append(o===!0?Ug([m],I,s):o===null?m:m+"[]",c(x))}),!1}return Nu(p)?!0:(t.append(Ug(y,m,s),c(p)),!1)}const d=[],h=Object.assign(e$,{defaultVisitor:u,convertValue:c,isVisitable:Nu});function f(p,m){if(!re.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(p),re.forEach(p,function(v,b){(!(re.isUndefined(v)||v===null)&&i.call(t,v,re.isString(b)?b.trim():b,m,h))===!0&&f(v,m?m.concat(b):[b])}),d.pop()}}if(!re.isObject(e))throw new TypeError("data must be an object");return f(e),t}function Fg(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function ju(e,t){this._pairs=[],e&&Za(e,this,t)}const Bg=ju.prototype;Bg.append=function(t,n){this._pairs.push([t,n])},Bg.toString=function(t){const n=t?function(r){return t.call(this,r,Fg)}:Fg;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function t$(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Vg(e,t,n){if(!t)return e;const r=n&&n.encode||t$,i=n&&n.serialize;let s;if(i?s=i(t,n):s=re.isURLSearchParams(t)?t.toString():new ju(t,n).toString(r),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}const zg=class{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){re.forEach(this.handlers,function(r){r!==null&&t(r)})}},Zg={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},n$={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ju,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Wg=typeof window<"u"&&typeof document<"u",r$=(e=>Wg&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),i$=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),or={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Wg,hasStandardBrowserEnv:r$,hasStandardBrowserWebWorkerEnv:i$},Symbol.toStringTag,{value:"Module"})),...n$};function s$(e,t){return Za(e,new or.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return or.isNode&&re.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function o$(e){return re.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function a$(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],t[s]=e[s];return t}function Hg(e){function t(n,r,i,s){let o=n[s++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),l=s>=n.length;return o=!o&&re.isArray(i)?i.length:o,l?(re.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!a):((!i[o]||!re.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],s)&&re.isArray(i[o])&&(i[o]=a$(i[o])),!a)}if(re.isFormData(e)&&re.isFunction(e.entries)){const n={};return re.forEachEntry(e,(r,i)=>{t(o$(r),i,n,0)}),n}return null}function l$(e,t,n){if(re.isString(e))try{return(t||JSON.parse)(e),re.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Uu={transitional:Zg,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=re.isObject(t);if(s&&re.isHTMLForm(t)&&(t=new FormData(t)),re.isFormData(t))return i?JSON.stringify(Hg(t)):t;if(re.isArrayBuffer(t)||re.isBuffer(t)||re.isStream(t)||re.isFile(t)||re.isBlob(t))return t;if(re.isArrayBufferView(t))return t.buffer;if(re.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return s$(t,this.formSerializer).toString();if((a=re.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Za(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),l$(t)):t}],transformResponse:[function(t){const n=this.transitional||Uu.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(t&&re.isString(t)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?ut.from(a,ut.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:or.classes.FormData,Blob:or.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};re.forEach(["delete","get","head","post","put","patch"],e=>{Uu.headers[e]={}});const Fu=Uu,c$=re.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),u$=e=>{const t={};let n,r,i;return e&&e.split(`
|
|
273
|
+
`).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||t[n]&&c$[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},qg=Symbol("internals");function Qs(e){return e&&String(e).trim().toLowerCase()}function Wa(e){return e===!1||e==null?e:re.isArray(e)?e.map(Wa):String(e)}function d$(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const f$=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Bu(e,t,n,r,i){if(re.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!re.isString(t)){if(re.isString(r))return t.indexOf(r)!==-1;if(re.isRegExp(r))return r.test(t)}}function h$(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function p$(e,t){const n=re.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,s,o){return this[r].call(this,t,i,s,o)},configurable:!0})})}let Ha=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function s(a,l,c){const u=Qs(l);if(!u)throw new Error("header name must be a non-empty string");const d=re.findKey(i,u);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||l]=Wa(a))}const o=(a,l)=>re.forEach(a,(c,u)=>s(c,u,l));return re.isPlainObject(t)||t instanceof this.constructor?o(t,n):re.isString(t)&&(t=t.trim())&&!f$(t)?o(u$(t),n):t!=null&&s(n,t,r),this}get(t,n){if(t=Qs(t),t){const r=re.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return d$(i);if(re.isFunction(n))return n.call(this,i,r);if(re.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Qs(t),t){const r=re.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Bu(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function s(o){if(o=Qs(o),o){const a=re.findKey(r,o);a&&(!n||Bu(r,r[a],a,n))&&(delete r[a],i=!0)}}return re.isArray(t)?t.forEach(s):s(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const s=n[r];(!t||Bu(this,this[s],s,t,!0))&&(delete this[s],i=!0)}return i}normalize(t){const n=this,r={};return re.forEach(this,(i,s)=>{const o=re.findKey(r,s);if(o){n[o]=Wa(i),delete n[s];return}const a=t?h$(s):String(s).trim();a!==s&&delete n[s],n[a]=Wa(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return re.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&re.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
274
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[qg]=this[qg]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=Qs(o);r[a]||(p$(i,o),r[a]=!0)}return re.isArray(t)?t.forEach(s):s(t),this}};Ha.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),re.reduceDescriptors(Ha.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),re.freezeMethods(Ha);const kr=Ha;function Vu(e,t){const n=this||Fu,r=t||n,i=kr.from(r.headers);let s=r.data;return re.forEach(e,function(a){s=a.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function Kg(e){return!!(e&&e.__CANCEL__)}function Xs(e,t,n){ut.call(this,e??"canceled",ut.ERR_CANCELED,t,n),this.name="CanceledError"}re.inherits(Xs,ut,{__CANCEL__:!0});function m$(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ut("Request failed with status code "+n.status,[ut.ERR_BAD_REQUEST,ut.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const g$=or.hasStandardBrowserEnv?{write(e,t,n,r,i,s){const o=[e+"="+encodeURIComponent(t)];re.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),re.isString(r)&&o.push("path="+r),re.isString(i)&&o.push("domain="+i),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function y$(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function v$(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Jg(e,t){return e&&!y$(t)?v$(e,t):t}const b$=or.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(s){let o=s;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(o){const a=re.isString(o)?i(o):o;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function w$(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function x$(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,s=0,o;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=r[s];o||(o=c),n[i]=l,r[i]=c;let d=s,h=0;for(;d!==i;)h+=n[d++],d=d%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const f=u&&c-u;return f?Math.round(h*1e3/f):void 0}}function Gg(e,t){let n=0;const r=x$(50,250);return i=>{const s=i.loaded,o=i.lengthComputable?i.total:void 0,a=s-n,l=r(a),c=s<=o;n=s;const u={loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&c?(o-s)/l:void 0,event:i};u[t?"download":"upload"]=!0,e(u)}}const zu={http:QR,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){let i=e.data;const s=kr.from(e.headers).normalize();let{responseType:o,withXSRFToken:a}=e,l;function c(){e.cancelToken&&e.cancelToken.unsubscribe(l),e.signal&&e.signal.removeEventListener("abort",l)}let u;if(re.isFormData(i)){if(or.hasStandardBrowserEnv||or.hasStandardBrowserWebWorkerEnv)s.setContentType(!1);else if((u=s.getContentType())!==!1){const[m,...y]=u?u.split(";").map(v=>v.trim()).filter(Boolean):[];s.setContentType([m||"multipart/form-data",...y].join("; "))}}let d=new XMLHttpRequest;if(e.auth){const m=e.auth.username||"",y=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(m+":"+y))}const h=Jg(e.baseURL,e.url);d.open(e.method.toUpperCase(),Vg(h,e.params,e.paramsSerializer),!0),d.timeout=e.timeout;function f(){if(!d)return;const m=kr.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders()),v={data:!o||o==="text"||o==="json"?d.responseText:d.response,status:d.status,statusText:d.statusText,headers:m,config:e,request:d};m$(function(x){n(x),c()},function(x){r(x),c()},v),d=null}if("onloadend"in d?d.onloadend=f:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(f)},d.onabort=function(){d&&(r(new ut("Request aborted",ut.ECONNABORTED,e,d)),d=null)},d.onerror=function(){r(new ut("Network Error",ut.ERR_NETWORK,e,d)),d=null},d.ontimeout=function(){let y=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const v=e.transitional||Zg;e.timeoutErrorMessage&&(y=e.timeoutErrorMessage),r(new ut(y,v.clarifyTimeoutError?ut.ETIMEDOUT:ut.ECONNABORTED,e,d)),d=null},or.hasStandardBrowserEnv&&(a&&re.isFunction(a)&&(a=a(e)),a||a!==!1&&b$(h))){const m=e.xsrfHeaderName&&e.xsrfCookieName&&g$.read(e.xsrfCookieName);m&&s.set(e.xsrfHeaderName,m)}i===void 0&&s.setContentType(null),"setRequestHeader"in d&&re.forEach(s.toJSON(),function(y,v){d.setRequestHeader(v,y)}),re.isUndefined(e.withCredentials)||(d.withCredentials=!!e.withCredentials),o&&o!=="json"&&(d.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&d.addEventListener("progress",Gg(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",Gg(e.onUploadProgress)),(e.cancelToken||e.signal)&&(l=m=>{d&&(r(!m||m.type?new Xs(null,e,d):m),d.abort(),d=null)},e.cancelToken&&e.cancelToken.subscribe(l),e.signal&&(e.signal.aborted?l():e.signal.addEventListener("abort",l)));const p=w$(h);if(p&&or.protocols.indexOf(p)===-1){r(new ut("Unsupported protocol "+p+":",ut.ERR_BAD_REQUEST,e));return}d.send(i||null)})}};re.forEach(zu,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Yg=e=>`- ${e}`,_$=e=>re.isFunction(e)||e===null||e===!1,Qg={getAdapter:e=>{e=re.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let s=0;s<t;s++){n=e[s];let o;if(r=n,!_$(n)&&(r=zu[(o=String(n)).toLowerCase()],r===void 0))throw new ut(`Unknown adapter '${o}'`);if(r)break;i[o||"#"+s]=r}if(!r){const s=Object.entries(i).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=t?s.length>1?`since :
|
|
275
|
+
`+s.map(Yg).join(`
|
|
276
|
+
`):" "+Yg(s[0]):"as no adapter specified";throw new ut("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:zu};function Zu(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Xs(null,e)}function Xg(e){return Zu(e),e.headers=kr.from(e.headers),e.data=Vu.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Qg.getAdapter(e.adapter||Fu.adapter)(e).then(function(r){return Zu(e),r.data=Vu.call(e,e.transformResponse,r),r.headers=kr.from(r.headers),r},function(r){return Kg(r)||(Zu(e),r&&r.response&&(r.response.data=Vu.call(e,e.transformResponse,r.response),r.response.headers=kr.from(r.response.headers))),Promise.reject(r)})}const ey=e=>e instanceof kr?{...e}:e;function ns(e,t){t=t||{};const n={};function r(c,u,d){return re.isPlainObject(c)&&re.isPlainObject(u)?re.merge.call({caseless:d},c,u):re.isPlainObject(u)?re.merge({},u):re.isArray(u)?u.slice():u}function i(c,u,d){if(re.isUndefined(u)){if(!re.isUndefined(c))return r(void 0,c,d)}else return r(c,u,d)}function s(c,u){if(!re.isUndefined(u))return r(void 0,u)}function o(c,u){if(re.isUndefined(u)){if(!re.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,d){if(d in t)return r(c,u);if(d in e)return r(void 0,c)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,u)=>i(ey(c),ey(u),!0)};return re.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=l[u]||i,h=d(e[u],t[u],u);re.isUndefined(h)&&d!==a||(n[u]=h)}),n}const ty="1.6.8",Wu={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Wu[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const ny={};Wu.transitional=function(t,n,r){function i(s,o){return"[Axios v"+ty+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,a)=>{if(t===!1)throw new ut(i(o," has been removed"+(n?" in "+n:"")),ut.ERR_DEPRECATED);return n&&!ny[o]&&(ny[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,o,a):!0}};function k$(e,t,n){if(typeof e!="object")throw new ut("options must be an object",ut.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const s=r[i],o=t[s];if(o){const a=e[s],l=a===void 0||o(a,s,e);if(l!==!0)throw new ut("option "+s+" must be "+l,ut.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ut("Unknown option "+s,ut.ERR_BAD_OPTION)}}const Hu={assertOptions:k$,validators:Wu},Gr=Hu.validators;let qa=class{constructor(t){this.defaults=t,this.interceptors={request:new zg,response:new zg}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const s=i.stack?i.stack.replace(/^.+\n/,""):"";r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
277
|
+
`+s):r.stack=s}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ns(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&Hu.assertOptions(r,{silentJSONParsing:Gr.transitional(Gr.boolean),forcedJSONParsing:Gr.transitional(Gr.boolean),clarifyTimeoutError:Gr.transitional(Gr.boolean)},!1),i!=null&&(re.isFunction(i)?n.paramsSerializer={serialize:i}:Hu.assertOptions(i,{encode:Gr.function,serialize:Gr.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&re.merge(s.common,s[n.method]);s&&re.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),n.headers=kr.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,h;if(!l){const p=[Xg.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),h=p.length,u=Promise.resolve(n);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let f=n;for(d=0;d<h;){const p=a[d++],m=a[d++];try{f=p(f)}catch(y){m.call(this,y);break}}try{u=Xg.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=ns(this.defaults,t);const n=Jg(t.baseURL,t.url);return Vg(n,t.params,t.paramsSerializer)}};re.forEach(["delete","get","head","options"],function(t){qa.prototype[t]=function(n,r){return this.request(ns(r||{},{method:t,url:n,data:(r||{}).data}))}}),re.forEach(["post","put","patch"],function(t){function n(r){return function(s,o,a){return this.request(ns(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}qa.prototype[t]=n(),qa.prototype[t+"Form"]=n(!0)});const Ka=qa,C$=class Nw{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},t(function(s,o,a){r.reason||(r.reason=new Xs(s,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new Nw(function(i){t=i}),cancel:t}}};function E$(e){return function(n){return e.apply(null,n)}}function S$(e){return re.isObject(e)&&e.isAxiosError===!0}const qu={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(qu).forEach(([e,t])=>{qu[t]=e});const T$=qu;function ry(e){const t=new Ka(e),n=Sg(Ka.prototype.request,t);return re.extend(n,Ka.prototype,t,{allOwnKeys:!0}),re.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return ry(ns(e,i))},n}const Nt=ry(Fu);Nt.Axios=Ka,Nt.CanceledError=Xs,Nt.CancelToken=C$,Nt.isCancel=Kg,Nt.VERSION=ty,Nt.toFormData=Za,Nt.AxiosError=ut,Nt.Cancel=Nt.CanceledError,Nt.all=function(t){return Promise.all(t)},Nt.spread=E$,Nt.isAxiosError=S$,Nt.mergeConfig=ns,Nt.AxiosHeaders=kr,Nt.formToJSON=e=>Hg(re.isHTMLForm(e)?new FormData(e):e),Nt.getAdapter=Qg.getAdapter,Nt.HttpStatusCode=T$,Nt.default=Nt;const X=Nt,{Axios:O$,AxiosError:I$,CanceledError:P$,isCancel:A$,CancelToken:R$,VERSION:$$,all:M$,Cancel:L$,isAxiosError:D$,spread:N$,toFormData:j$,AxiosHeaders:U$,HttpStatusCode:F$,formToJSON:B$,getAdapter:V$,mergeConfig:z$}=X,Z$=Object.freeze(Object.defineProperty({__proto__:null,Axios:O$,AxiosError:I$,AxiosHeaders:U$,Cancel:L$,CancelToken:R$,CanceledError:P$,HttpStatusCode:F$,VERSION:$$,all:M$,default:X,formToJSON:B$,getAdapter:V$,isAxiosError:D$,isCancel:A$,mergeConfig:z$,spread:N$,toFormData:j$},Symbol.toStringTag,{value:"Module"}));var rs={};Object.defineProperty(rs,"__esModule",{value:!0});var W$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H$=typeof window<"u"&&typeof window.document<"u",q$=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,K$=(typeof self>"u"?"undefined":W$(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",J$=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),G$=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u",iy=rs.isBrowser=H$;rs.isWebWorker=K$;var Ku=rs.isNode=q$;rs.isJsDom=J$,rs.isDeno=G$;var Y$=Object.create,sy=Object.defineProperty,Q$=Object.getOwnPropertyDescriptor,X$=Object.getOwnPropertyNames,eM=Object.getPrototypeOf,tM=Object.prototype.hasOwnProperty,oy=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),nM=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of X$(t))!tM.call(e,i)&&i!==n&&sy(e,i,{get:()=>t[i],enumerable:!(r=Q$(t,i))||r.enumerable});return e},ay=(e,t,n)=>(n=e!=null?Y$(eM(e)):{},nM(t||!e||!e.__esModule?sy(n,"default",{value:e,enumerable:!0}):n,e)),rM=oy(()=>{}),iM=oy(()=>{}),sM=ay(rM()),oM=ay(iM()),aM="https://api.botpress.cloud",lM=6e4,cM="BP_API_URL",uM="BP_BOT_ID",dM="BP_INTEGRATION_ID",fM="BP_WORKSPACE_ID",hM="BP_TOKEN";function pM(e){let t=mM(e),n={};t.workspaceId&&(n["x-workspace-id"]=t.workspaceId),t.botId&&(n["x-bot-id"]=t.botId),t.integrationId&&(n["x-integration-id"]=t.integrationId),t.token&&(n.Authorization=`Bearer ${t.token}`),n={...n,...t.headers};let r=t.apiUrl??aM,i=t.timeout??lM;return{apiUrl:r,timeout:i,withCredentials:iy,headers:n}}function mM(e){return iy?e:Ku?gM(e):e}function gM(e){let t={...e,apiUrl:e.apiUrl??process.env[cM],botId:e.botId??process.env[uM],integrationId:e.integrationId??process.env[dM],workspaceId:e.workspaceId??process.env[fM]},n=t.token??process.env[hM];return n&&(t.token=n),t}var ie="https://api.botpress.cloud".replace(/\/+$/,""),yM=class{constructor(t,n=ie,r=X){E(this,"configuration");this.basePath=n,this.axios=r,t&&(this.configuration=t,this.basePath=t.basePath||this.basePath)}},vM=class extends Error{constructor(t,n){super(n),this.field=t,this.name="RequiredError"}},se="https://example.com",de=function(e,t,n){if(n==null)throw new vM(t,`Required parameter ${t} was null or undefined when calling ${e}.`)};function Ju(e,t,n=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(r=>Ju(e,r,n)):Object.keys(t).forEach(r=>Ju(e,t[r],`${n}${n!==""?".":""}${r}`)):e.has(n)?e.append(n,t):e.set(n,t))}var oe=function(e,...t){let n=new URLSearchParams(e.search);Ju(n,t),e.search=n.toString()},Je=function(e,t,n){let r=typeof e!="string";return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(e!==void 0?e:{}):e||""},ae=function(e){return e.pathname+e.search+e.hash},le=function(e,t,n,r){return(i=t,s=n)=>{let o={...e.options,url:((r==null?void 0:r.basePath)||s)+e.url};return i.request(o)}},bM=function(e){return{addParticipant:async(t,n,r={})=>{de("addParticipant","id",t);let i="/v1/chat/conversations/{id}/participants".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},breakDownWorkspaceUsageByBot:async(t,n,r,i={})=>{de("breakDownWorkspaceUsageByBot","id",t),de("breakDownWorkspaceUsageByBot","type",n);let s="/v1/admin/workspaces/{id}/usages/by-bot".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};n!==void 0&&(u.type=n),r!==void 0&&(u.period=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},callAction:async(t,n={})=>{let r="/v1/chat/actions",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},changeAISpendQuota:async(t,n={})=>{let r="/v1/admin/quotas/ai-spend",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"PUT",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},changeWorkspacePlan:async(t,n,r={})=>{de("changeWorkspacePlan","id",t);let i="/v1/admin/workspaces/{id}/change-plan".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},chargeWorkspaceUnpaidInvoices:async(t,n,r={})=>{de("chargeWorkspaceUnpaidInvoices","id",t);let i="/v1/admin/workspaces/{id}/billing/invoices/charge-unpaid".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},checkHandleAvailability:async(t,n={})=>{let r="/v1/admin/workspaces/handle-availability",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"PUT",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},configureIntegration:async(t,n={})=>{let r="/v1/chat/integrations/configure",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createBot:async(t,n={})=>{let r="/v1/admin/bots",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createConversation:async(t,n={})=>{let r="/v1/chat/conversations",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createEvent:async(t,n={})=>{let r="/v1/chat/events",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createFile:async(t,n,r,i,s,o,a,l={})=>{de("createFile","xName",t);let c="/v1/files",u=new URL(c,se),d;e&&(d=e.baseOptions);let h={method:"POST",...d,...l},f={},p={};t!=null&&(f["x-name"]=String(t)),n!=null&&(f["x-tags"]=String(n)),r!=null&&(f["x-access-policies"]=String(r)),i!=null&&(f["x-index"]=String(i)),s!=null&&(f["Content-Type"]=String(s)),o!=null&&(f["Content-Length"]=String(o)),f["Content-Type"]="application/json",oe(u,p);let m=d&&d.headers?d.headers:{};return h.headers={...f,...m,...l.headers},h.data=Je(a,h,e),{url:ae(u),options:h}},createIntegration:async(t,n={})=>{let r="/v1/admin/integrations",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createMessage:async(t,n={})=>{let r="/v1/chat/messages",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createPersonalAccessToken:async(t,n={})=>{let r="/v1/admin/account/pats",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createTable:async(t,n={})=>{let r="/v1/tables",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createTableRows:async(t,n,r={})=>{de("createTableRows","table",t);let i="/v1/tables/{table}/rows".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},createTask:async(t,n={})=>{let r="/v1/chat/tasks",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createUser:async(t,n={})=>{let r="/v1/chat/users",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createWorkspace:async(t,n={})=>{let r="/v1/admin/workspaces",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},createWorkspaceMember:async(t,n={})=>{let r="/v1/admin/workspace-members",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},deleteBot:async(t,n={})=>{de("deleteBot","id",t);let r="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteBotIssue:async(t,n,r={})=>{de("deleteBotIssue","id",t),de("deleteBotIssue","issueId",n);let i="/v1/admin/bots/{id}/issues/{issueId}".replace("{id}",encodeURIComponent(String(t))).replace("{issueId}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"DELETE",...o,...r},l={};oe(s,{});let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:ae(s),options:a}},deleteConversation:async(t,n={})=>{de("deleteConversation","id",t);let r="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteFile:async(t,n={})=>{de("deleteFile","id",t);let r="/v1/files/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteIntegration:async(t,n={})=>{de("deleteIntegration","id",t);let r="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteMessage:async(t,n={})=>{de("deleteMessage","id",t);let r="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deletePersonalAccessToken:async(t,n={})=>{de("deletePersonalAccessToken","id",t);let r="/v1/admin/account/pats/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteTable:async(t,n={})=>{de("deleteTable","table",t);let r="/v1/tables/{table}".replace("{table}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteTableRows:async(t,n,r={})=>{de("deleteTableRows","table",t);let i="/v1/tables/{table}/rows/delete".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},deleteTask:async(t,n={})=>{de("deleteTask","id",t);let r="/v1/chat/tasks/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteUser:async(t,n={})=>{de("deleteUser","id",t);let r="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteWorkspace:async(t,n={})=>{de("deleteWorkspace","id",t);let r="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},deleteWorkspaceMember:async(t,n={})=>{de("deleteWorkspaceMember","id",t);let r="/v1/admin/workspace-members/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"DELETE",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},findTableRows:async(t,n,r={})=>{de("findTableRows","table",t);let i="/v1/tables/{table}/rows/find".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},getAccount:async(t={})=>{let n="/v1/admin/account/me",r=new URL(n,se),i;e&&(i=e.baseOptions);let s={method:"GET",...i,...t},o={};oe(r,{});let a=i&&i.headers?i.headers:{};return s.headers={...o,...a,...t.headers},{url:ae(r),options:s}},getAccountPreference:async(t,n={})=>{de("getAccountPreference","key",t);let r="/v1/admin/account/preferences/{key}".replace("{key}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getAllWorkspaceQuotaCompletion:async(t={})=>{let n="/v1/admin/workspaces/usages/quota-completion",r=new URL(n,se),i;e&&(i=e.baseOptions);let s={method:"GET",...i,...t},o={};oe(r,{});let a=i&&i.headers?i.headers:{};return s.headers={...o,...a,...t.headers},{url:ae(r),options:s}},getAuditRecords:async(t,n,r={})=>{de("getAuditRecords","id",t);let i="/v1/admin/workspaces/{id}/audit-records".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.nextToken=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},getBot:async(t,n={})=>{de("getBot","id",t);let r="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getBotAnalytics:async(t,n,r,i={})=>{de("getBotAnalytics","id",t),de("getBotAnalytics","startDate",n),de("getBotAnalytics","endDate",r);let s="/v1/admin/bots/{id}/analytics".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};n!==void 0&&(u.startDate=n),r!==void 0&&(u.endDate=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},getBotLogs:async(t,n,r,i,s={})=>{de("getBotLogs","id",t),de("getBotLogs","timeStart",n),de("getBotLogs","timeEnd",r);let o="/v1/admin/bots/{id}/logs".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"GET",...l,...s},u={},d={};n!==void 0&&(d.timeStart=n),r!==void 0&&(d.timeEnd=r),i!==void 0&&(d.nextToken=i),oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},{url:ae(a),options:c}},getBotWebchat:async(t,n,r={})=>{de("getBotWebchat","id",t),de("getBotWebchat","type",n);let i="/v1/admin/bots/{id}/webchat".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.type=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},getConversation:async(t,n={})=>{de("getConversation","id",t);let r="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getEvent:async(t,n={})=>{de("getEvent","id",t);let r="/v1/chat/events/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getFileContent:async(t,n={})=>{de("getFileContent","id",t);let r="/v1/files/{id}/content".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getFileMetadata:async(t,n={})=>{de("getFileMetadata","id",t);let r="/v1/files/{id}/metadata".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getIntegration:async(t,n={})=>{de("getIntegration","id",t);let r="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getIntegrationByName:async(t,n,r={})=>{de("getIntegrationByName","name",t),de("getIntegrationByName","version",n);let i="/v1/admin/integrations/{name}/{version}".replace("{name}",encodeURIComponent(String(t))).replace("{version}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={};oe(s,{});let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:ae(s),options:a}},getIntegrationLogs:async(t,n,r,i,s={})=>{de("getIntegrationLogs","id",t),de("getIntegrationLogs","timeStart",n),de("getIntegrationLogs","timeEnd",r);let o="/v1/admin/integrations/{id}/logs".replace("{id}",encodeURIComponent(String(t))),a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"GET",...l,...s},u={},d={};n!==void 0&&(d.timeStart=n),r!==void 0&&(d.timeEnd=r),i!==void 0&&(d.nextToken=i),oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},{url:ae(a),options:c}},getMessage:async(t,n={})=>{de("getMessage","id",t);let r="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getOrCreateConversation:async(t,n={})=>{let r="/v1/chat/conversations/get-or-create",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},getOrCreateMessage:async(t,n={})=>{let r="/v1/chat/messages/get-or-create",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},getOrCreateUser:async(t,n={})=>{let r="/v1/chat/users/get-or-create",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},getOrSetState:async(t,n,r,i,s={})=>{de("getOrSetState","type",t),de("getOrSetState","id",n),de("getOrSetState","name",r);let o="/v1/chat/states/{type}/{id}/{name}/get-or-set".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(n))).replace("{name}",encodeURIComponent(String(r))),a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"POST",...l,...s},u={},d={};u["Content-Type"]="application/json",oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},c.data=Je(i,c,e),{url:ae(a),options:c}},getParticipant:async(t,n,r={})=>{de("getParticipant","id",t),de("getParticipant","userId",n);let i="/v1/chat/conversations/{id}/participants/{userId}".replace("{id}",encodeURIComponent(String(t))).replace("{userId}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={};oe(s,{});let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:ae(s),options:a}},getPublicIntegration:async(t,n,r={})=>{de("getPublicIntegration","name",t),de("getPublicIntegration","version",n);let i="/v1/admin/hub/integrations/{name}/{version}".replace("{name}",encodeURIComponent(String(t))).replace("{version}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={};oe(s,{});let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:ae(s),options:a}},getPublicIntegrationById:async(t,n={})=>{de("getPublicIntegrationById","id",t);let r="/v1/admin/hub/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getPublicWorkspace:async(t,n={})=>{de("getPublicWorkspace","id",t);let r="/v1/admin/workspaces/{id}/public".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getState:async(t,n,r,i={})=>{de("getState","type",t),de("getState","id",n),de("getState","name",r);let s="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(n))).replace("{name}",encodeURIComponent(String(r))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={};oe(o,{});let u=a&&a.headers?a.headers:{};return l.headers={...c,...u,...i.headers},{url:ae(o),options:l}},getTable:async(t,n={})=>{de("getTable","table",t);let r="/v1/tables/{table}".replace("{table}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getTableRow:async(t,n,r={})=>{de("getTableRow","table",t),de("getTableRow","id",n);let i="/v1/tables/{table}/row".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.id=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},getTask:async(t,n={})=>{de("getTask","id",t);let r="/v1/chat/tasks/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getUpcomingInvoice:async(t,n={})=>{de("getUpcomingInvoice","id",t);let r="/v1/admin/workspaces/{id}/billing/upcoming-invoice".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getUsage:async(t,n,r,i={})=>{de("getUsage","type",t),de("getUsage","id",n);let s="/v1/admin/usages/{id}".replace("{id}",encodeURIComponent(String(n))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};t!==void 0&&(u.type=t),r!==void 0&&(u.period=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},getUser:async(t,n={})=>{de("getUser","id",t);let r="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getWorkspace:async(t,n={})=>{de("getWorkspace","id",t);let r="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getWorkspaceBillingDetails:async(t,n={})=>{de("getWorkspaceBillingDetails","id",t);let r="/v1/admin/workspaces/{id}/billing/details".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},getWorkspaceQuota:async(t,n,r,i={})=>{de("getWorkspaceQuota","id",t),de("getWorkspaceQuota","type",n);let s="/v1/admin/workspaces/{id}/quota".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};n!==void 0&&(u.type=n),r!==void 0&&(u.period=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},introspect:async(t,n={})=>{let r="/v1/admin/introspect",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},listActivities:async(t,n,r,i={})=>{de("listActivities","taskId",t),de("listActivities","botId",n);let s="/v1/admin/activities",o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};r!==void 0&&(u.nextToken=r),t!==void 0&&(u.taskId=t),n!==void 0&&(u.botId=n),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listBotIssueEvents:async(t,n,r={})=>{de("listBotIssueEvents","id",t),de("listBotIssueEvents","issueId",n);let i="/v1/admin/bots/{id}/issues/{issueId}/events".replace("{id}",encodeURIComponent(String(t))).replace("{issueId}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={};oe(s,{});let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:ae(s),options:a}},listBotIssues:async(t,n,r={})=>{de("listBotIssues","id",t);let i="/v1/admin/bots/{id}/issues".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.nextToken=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},listBots:async(t,n,r={})=>{let i="/v1/admin/bots",s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};t!==void 0&&(c.dev=t),n!==void 0&&(c.nextToken=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},listConversations:async(t,n,r,i={})=>{let s="/v1/chat/conversations",o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};t!==void 0&&(u.nextToken=t),n!==void 0&&(u.tags=n),r&&(u.participantIds=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listEvents:async(t,n,r,i,s,o={})=>{let a="/v1/chat/events",l=new URL(a,se),c;e&&(c=e.baseOptions);let u={method:"GET",...c,...o},d={},h={};t!==void 0&&(h.nextToken=t),n!==void 0&&(h.type=n),r!==void 0&&(h.conversationId=r),i!==void 0&&(h.userId=i),s!==void 0&&(h.messageId=s),oe(l,h);let f=c&&c.headers?c.headers:{};return u.headers={...d,...f,...o.headers},{url:ae(l),options:u}},listFiles:async(t,n,r,i={})=>{de("listFiles","botId",t);let s="/v1/files/bot/{botId}".replace("{botId}",encodeURIComponent(String(t))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};n!==void 0&&(u.nextToken=n),r!==void 0&&(u.tags=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listIntegrations:async(t,n,r,i,s={})=>{let o="/v1/admin/integrations",a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"GET",...l,...s},u={},d={};t!==void 0&&(d.nextToken=t),n!==void 0&&(d.name=n),r!==void 0&&(d.version=r),i!==void 0&&(d.dev=i),oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},{url:ae(a),options:c}},listMessages:async(t,n,r,i={})=>{let s="/v1/chat/messages",o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};t!==void 0&&(u.nextToken=t),n!==void 0&&(u.conversationId=n),r!==void 0&&(u.tags=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listParticipants:async(t,n,r={})=>{de("listParticipants","id",t);let i="/v1/chat/conversations/{id}/participants".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.nextToken=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},listPersonalAccessTokens:async(t={})=>{let n="/v1/admin/account/pats",r=new URL(n,se),i;e&&(i=e.baseOptions);let s={method:"GET",...i,...t},o={};oe(r,{});let a=i&&i.headers?i.headers:{};return s.headers={...o,...a,...t.headers},{url:ae(r),options:s}},listPublicIntegrations:async(t,n,r,i={})=>{let s="/v1/admin/hub/integrations",o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};t!==void 0&&(u.nextToken=t),n!==void 0&&(u.name=n),r!==void 0&&(u.version=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listTables:async(t,n={})=>{let r="/v1/tables",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={},l={};t!==void 0&&(l.tags=t),oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},{url:ae(i),options:o}},listTasks:async(t,n,r,i,s,o,a,l={})=>{let c="/v1/chat/tasks",u=new URL(c,se),d;e&&(d=e.baseOptions);let h={method:"GET",...d,...l},f={},p={};t!==void 0&&(p.nextToken=t),n!==void 0&&(p.tags=n),r!==void 0&&(p.conversationId=r),i!==void 0&&(p.userId=i),s!==void 0&&(p.parentTaskId=s),o&&(p.status=o),a!==void 0&&(p.type=a),oe(u,p);let m=d&&d.headers?d.headers:{};return h.headers={...f,...m,...l.headers},{url:ae(u),options:h}},listUsageHistory:async(t,n,r={})=>{de("listUsageHistory","type",t),de("listUsageHistory","id",n);let i="/v1/admin/usages/{id}/history".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};t!==void 0&&(c.type=t),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},listUsers:async(t,n,r,i={})=>{let s="/v1/chat/users",o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};t!==void 0&&(u.nextToken=t),n!==void 0&&(u.conversationId=n),r!==void 0&&(u.tags=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listWorkspaceInvoices:async(t,n={})=>{de("listWorkspaceInvoices","id",t);let r="/v1/admin/workspaces/{id}/billing/invoices".replace("{id}",encodeURIComponent(String(t))),i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={};oe(i,{});let l=s&&s.headers?s.headers:{};return o.headers={...a,...l,...n.headers},{url:ae(i),options:o}},listWorkspaceMembers:async(t,n={})=>{let r="/v1/admin/workspace-members",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={},l={};t!==void 0&&(l.nextToken=t),oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},{url:ae(i),options:o}},listWorkspaceQuotas:async(t,n,r={})=>{de("listWorkspaceQuotas","id",t);let i="/v1/admin/workspaces/{id}/quotas".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.period=n),oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:ae(s),options:a}},listWorkspaceUsages:async(t,n,r,i={})=>{de("listWorkspaceUsages","id",t),de("listWorkspaceUsages","type",n);let s="/v1/admin/workspaces/{id}/usages".replace("{id}",encodeURIComponent(String(t))),o=new URL(s,se),a;e&&(a=e.baseOptions);let l={method:"GET",...a,...i},c={},u={};n!==void 0&&(u.type=n),r!==void 0&&(u.period=r),oe(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:ae(o),options:l}},listWorkspaces:async(t,n={})=>{let r="/v1/admin/workspaces",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"GET",...s,...n},a={},l={};t!==void 0&&(l.nextToken=t),oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},{url:ae(i),options:o}},patchState:async(t,n,r,i,s={})=>{de("patchState","type",t),de("patchState","id",n),de("patchState","name",r);let o="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(n))).replace("{name}",encodeURIComponent(String(r))),a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"PATCH",...l,...s},u={},d={};u["Content-Type"]="application/json",oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},c.data=Je(i,c,e),{url:ae(a),options:c}},removeParticipant:async(t,n,r={})=>{de("removeParticipant","id",t),de("removeParticipant","userId",n);let i="/v1/chat/conversations/{id}/participants/{userId}".replace("{id}",encodeURIComponent(String(t))).replace("{userId}",encodeURIComponent(String(n))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"DELETE",...o,...r},l={};oe(s,{});let c=o&&o.headers?o.headers:{};return a.headers={...l,...c,...r.headers},{url:ae(s),options:a}},renameTableColumn:async(t,n,r={})=>{de("renameTableColumn","table",t);let i="/v1/tables/{table}/column".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},runVrl:async(t,n={})=>{let r="/v1/admin/helper/vrl",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},searchFiles:async(t,n,r,i,s={})=>{de("searchFiles","botId",t),de("searchFiles","query",n);let o="/v1/files/bot/{botId}/search".replace("{botId}",encodeURIComponent(String(t))),a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"GET",...l,...s},u={},d={};r!==void 0&&(d.tags=r),n!==void 0&&(d.query=n),i!==void 0&&(d.limit=i),oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},{url:ae(a),options:c}},setAccountPreference:async(t,n,r={})=>{de("setAccountPreference","key",t);let i="/v1/admin/account/preferences/{key}".replace("{key}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},setState:async(t,n,r,i,s={})=>{de("setState","type",t),de("setState","id",n),de("setState","name",r);let o="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(n))).replace("{name}",encodeURIComponent(String(r))),a=new URL(o,se),l;e&&(l=e.baseOptions);let c={method:"POST",...l,...s},u={},d={};u["Content-Type"]="application/json",oe(a,d);let h=l&&l.headers?l.headers:{};return c.headers={...u,...h,...s.headers},c.data=Je(i,c,e),{url:ae(a),options:c}},setWorkspacePaymentMethod:async(t,n,r={})=>{de("setWorkspacePaymentMethod","id",t);let i="/v1/admin/workspaces/{id}/billing/payment-method".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},transferBot:async(t,n,r={})=>{de("transferBot","id",t);let i="/v1/admin/bots/{id}/transfer".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateAccount:async(t,n={})=>{let r="/v1/admin/account/me",i=new URL(r,se),s;e&&(s=e.baseOptions);let o={method:"PUT",...s,...n},a={},l={};a["Content-Type"]="application/json",oe(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=Je(t,o,e),{url:ae(i),options:o}},updateBot:async(t,n,r={})=>{de("updateBot","id",t);let i="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateConversation:async(t,n,r={})=>{de("updateConversation","id",t);let i="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateFileMetadata:async(t,n,r={})=>{de("updateFileMetadata","id",t);let i="/v1/files/{id}/metadata".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateIntegration:async(t,n,r={})=>{de("updateIntegration","id",t);let i="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateMessage:async(t,n,r={})=>{de("updateMessage","id",t);let i="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateTable:async(t,n,r={})=>{de("updateTable","table",t);let i="/v1/tables/{table}".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateTableRows:async(t,n,r={})=>{de("updateTableRows","table",t);let i="/v1/tables/{table}/rows".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateTask:async(t,n,r={})=>{de("updateTask","id",t);let i="/v1/chat/tasks/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateUser:async(t,n,r={})=>{de("updateUser","id",t);let i="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateWorkspace:async(t,n,r={})=>{de("updateWorkspace","id",t);let i="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},updateWorkspaceMember:async(t,n,r={})=>{de("updateWorkspaceMember","id",t);let i="/v1/admin/workspace-members/{id}".replace("{id}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"PUT",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}},upsertTableRows:async(t,n,r={})=>{de("upsertTableRows","table",t);let i="/v1/tables/{table}/rows/upsert".replace("{table}",encodeURIComponent(String(t))),s=new URL(i,se),o;e&&(o=e.baseOptions);let a={method:"POST",...o,...r},l={},c={};l["Content-Type"]="application/json",oe(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=Je(n,a,e),{url:ae(s),options:a}}}},ce=function(e){let t=bM(e);return{async addParticipant(n,r,i){let s=await t.addParticipant(n,r,i);return le(s,X,ie,e)},async breakDownWorkspaceUsageByBot(n,r,i,s){let o=await t.breakDownWorkspaceUsageByBot(n,r,i,s);return le(o,X,ie,e)},async callAction(n,r){let i=await t.callAction(n,r);return le(i,X,ie,e)},async changeAISpendQuota(n,r){let i=await t.changeAISpendQuota(n,r);return le(i,X,ie,e)},async changeWorkspacePlan(n,r,i){let s=await t.changeWorkspacePlan(n,r,i);return le(s,X,ie,e)},async chargeWorkspaceUnpaidInvoices(n,r,i){let s=await t.chargeWorkspaceUnpaidInvoices(n,r,i);return le(s,X,ie,e)},async checkHandleAvailability(n,r){let i=await t.checkHandleAvailability(n,r);return le(i,X,ie,e)},async configureIntegration(n,r){let i=await t.configureIntegration(n,r);return le(i,X,ie,e)},async createBot(n,r){let i=await t.createBot(n,r);return le(i,X,ie,e)},async createConversation(n,r){let i=await t.createConversation(n,r);return le(i,X,ie,e)},async createEvent(n,r){let i=await t.createEvent(n,r);return le(i,X,ie,e)},async createFile(n,r,i,s,o,a,l,c){let u=await t.createFile(n,r,i,s,o,a,l,c);return le(u,X,ie,e)},async createIntegration(n,r){let i=await t.createIntegration(n,r);return le(i,X,ie,e)},async createMessage(n,r){let i=await t.createMessage(n,r);return le(i,X,ie,e)},async createPersonalAccessToken(n,r){let i=await t.createPersonalAccessToken(n,r);return le(i,X,ie,e)},async createTable(n,r){let i=await t.createTable(n,r);return le(i,X,ie,e)},async createTableRows(n,r,i){let s=await t.createTableRows(n,r,i);return le(s,X,ie,e)},async createTask(n,r){let i=await t.createTask(n,r);return le(i,X,ie,e)},async createUser(n,r){let i=await t.createUser(n,r);return le(i,X,ie,e)},async createWorkspace(n,r){let i=await t.createWorkspace(n,r);return le(i,X,ie,e)},async createWorkspaceMember(n,r){let i=await t.createWorkspaceMember(n,r);return le(i,X,ie,e)},async deleteBot(n,r){let i=await t.deleteBot(n,r);return le(i,X,ie,e)},async deleteBotIssue(n,r,i){let s=await t.deleteBotIssue(n,r,i);return le(s,X,ie,e)},async deleteConversation(n,r){let i=await t.deleteConversation(n,r);return le(i,X,ie,e)},async deleteFile(n,r){let i=await t.deleteFile(n,r);return le(i,X,ie,e)},async deleteIntegration(n,r){let i=await t.deleteIntegration(n,r);return le(i,X,ie,e)},async deleteMessage(n,r){let i=await t.deleteMessage(n,r);return le(i,X,ie,e)},async deletePersonalAccessToken(n,r){let i=await t.deletePersonalAccessToken(n,r);return le(i,X,ie,e)},async deleteTable(n,r){let i=await t.deleteTable(n,r);return le(i,X,ie,e)},async deleteTableRows(n,r,i){let s=await t.deleteTableRows(n,r,i);return le(s,X,ie,e)},async deleteTask(n,r){let i=await t.deleteTask(n,r);return le(i,X,ie,e)},async deleteUser(n,r){let i=await t.deleteUser(n,r);return le(i,X,ie,e)},async deleteWorkspace(n,r){let i=await t.deleteWorkspace(n,r);return le(i,X,ie,e)},async deleteWorkspaceMember(n,r){let i=await t.deleteWorkspaceMember(n,r);return le(i,X,ie,e)},async findTableRows(n,r,i){let s=await t.findTableRows(n,r,i);return le(s,X,ie,e)},async getAccount(n){let r=await t.getAccount(n);return le(r,X,ie,e)},async getAccountPreference(n,r){let i=await t.getAccountPreference(n,r);return le(i,X,ie,e)},async getAllWorkspaceQuotaCompletion(n){let r=await t.getAllWorkspaceQuotaCompletion(n);return le(r,X,ie,e)},async getAuditRecords(n,r,i){let s=await t.getAuditRecords(n,r,i);return le(s,X,ie,e)},async getBot(n,r){let i=await t.getBot(n,r);return le(i,X,ie,e)},async getBotAnalytics(n,r,i,s){let o=await t.getBotAnalytics(n,r,i,s);return le(o,X,ie,e)},async getBotLogs(n,r,i,s,o){let a=await t.getBotLogs(n,r,i,s,o);return le(a,X,ie,e)},async getBotWebchat(n,r,i){let s=await t.getBotWebchat(n,r,i);return le(s,X,ie,e)},async getConversation(n,r){let i=await t.getConversation(n,r);return le(i,X,ie,e)},async getEvent(n,r){let i=await t.getEvent(n,r);return le(i,X,ie,e)},async getFileContent(n,r){let i=await t.getFileContent(n,r);return le(i,X,ie,e)},async getFileMetadata(n,r){let i=await t.getFileMetadata(n,r);return le(i,X,ie,e)},async getIntegration(n,r){let i=await t.getIntegration(n,r);return le(i,X,ie,e)},async getIntegrationByName(n,r,i){let s=await t.getIntegrationByName(n,r,i);return le(s,X,ie,e)},async getIntegrationLogs(n,r,i,s,o){let a=await t.getIntegrationLogs(n,r,i,s,o);return le(a,X,ie,e)},async getMessage(n,r){let i=await t.getMessage(n,r);return le(i,X,ie,e)},async getOrCreateConversation(n,r){let i=await t.getOrCreateConversation(n,r);return le(i,X,ie,e)},async getOrCreateMessage(n,r){let i=await t.getOrCreateMessage(n,r);return le(i,X,ie,e)},async getOrCreateUser(n,r){let i=await t.getOrCreateUser(n,r);return le(i,X,ie,e)},async getOrSetState(n,r,i,s,o){let a=await t.getOrSetState(n,r,i,s,o);return le(a,X,ie,e)},async getParticipant(n,r,i){let s=await t.getParticipant(n,r,i);return le(s,X,ie,e)},async getPublicIntegration(n,r,i){let s=await t.getPublicIntegration(n,r,i);return le(s,X,ie,e)},async getPublicIntegrationById(n,r){let i=await t.getPublicIntegrationById(n,r);return le(i,X,ie,e)},async getPublicWorkspace(n,r){let i=await t.getPublicWorkspace(n,r);return le(i,X,ie,e)},async getState(n,r,i,s){let o=await t.getState(n,r,i,s);return le(o,X,ie,e)},async getTable(n,r){let i=await t.getTable(n,r);return le(i,X,ie,e)},async getTableRow(n,r,i){let s=await t.getTableRow(n,r,i);return le(s,X,ie,e)},async getTask(n,r){let i=await t.getTask(n,r);return le(i,X,ie,e)},async getUpcomingInvoice(n,r){let i=await t.getUpcomingInvoice(n,r);return le(i,X,ie,e)},async getUsage(n,r,i,s){let o=await t.getUsage(n,r,i,s);return le(o,X,ie,e)},async getUser(n,r){let i=await t.getUser(n,r);return le(i,X,ie,e)},async getWorkspace(n,r){let i=await t.getWorkspace(n,r);return le(i,X,ie,e)},async getWorkspaceBillingDetails(n,r){let i=await t.getWorkspaceBillingDetails(n,r);return le(i,X,ie,e)},async getWorkspaceQuota(n,r,i,s){let o=await t.getWorkspaceQuota(n,r,i,s);return le(o,X,ie,e)},async introspect(n,r){let i=await t.introspect(n,r);return le(i,X,ie,e)},async listActivities(n,r,i,s){let o=await t.listActivities(n,r,i,s);return le(o,X,ie,e)},async listBotIssueEvents(n,r,i){let s=await t.listBotIssueEvents(n,r,i);return le(s,X,ie,e)},async listBotIssues(n,r,i){let s=await t.listBotIssues(n,r,i);return le(s,X,ie,e)},async listBots(n,r,i){let s=await t.listBots(n,r,i);return le(s,X,ie,e)},async listConversations(n,r,i,s){let o=await t.listConversations(n,r,i,s);return le(o,X,ie,e)},async listEvents(n,r,i,s,o,a){let l=await t.listEvents(n,r,i,s,o,a);return le(l,X,ie,e)},async listFiles(n,r,i,s){let o=await t.listFiles(n,r,i,s);return le(o,X,ie,e)},async listIntegrations(n,r,i,s,o){let a=await t.listIntegrations(n,r,i,s,o);return le(a,X,ie,e)},async listMessages(n,r,i,s){let o=await t.listMessages(n,r,i,s);return le(o,X,ie,e)},async listParticipants(n,r,i){let s=await t.listParticipants(n,r,i);return le(s,X,ie,e)},async listPersonalAccessTokens(n){let r=await t.listPersonalAccessTokens(n);return le(r,X,ie,e)},async listPublicIntegrations(n,r,i,s){let o=await t.listPublicIntegrations(n,r,i,s);return le(o,X,ie,e)},async listTables(n,r){let i=await t.listTables(n,r);return le(i,X,ie,e)},async listTasks(n,r,i,s,o,a,l,c){let u=await t.listTasks(n,r,i,s,o,a,l,c);return le(u,X,ie,e)},async listUsageHistory(n,r,i){let s=await t.listUsageHistory(n,r,i);return le(s,X,ie,e)},async listUsers(n,r,i,s){let o=await t.listUsers(n,r,i,s);return le(o,X,ie,e)},async listWorkspaceInvoices(n,r){let i=await t.listWorkspaceInvoices(n,r);return le(i,X,ie,e)},async listWorkspaceMembers(n,r){let i=await t.listWorkspaceMembers(n,r);return le(i,X,ie,e)},async listWorkspaceQuotas(n,r,i){let s=await t.listWorkspaceQuotas(n,r,i);return le(s,X,ie,e)},async listWorkspaceUsages(n,r,i,s){let o=await t.listWorkspaceUsages(n,r,i,s);return le(o,X,ie,e)},async listWorkspaces(n,r){let i=await t.listWorkspaces(n,r);return le(i,X,ie,e)},async patchState(n,r,i,s,o){let a=await t.patchState(n,r,i,s,o);return le(a,X,ie,e)},async removeParticipant(n,r,i){let s=await t.removeParticipant(n,r,i);return le(s,X,ie,e)},async renameTableColumn(n,r,i){let s=await t.renameTableColumn(n,r,i);return le(s,X,ie,e)},async runVrl(n,r){let i=await t.runVrl(n,r);return le(i,X,ie,e)},async searchFiles(n,r,i,s,o){let a=await t.searchFiles(n,r,i,s,o);return le(a,X,ie,e)},async setAccountPreference(n,r,i){let s=await t.setAccountPreference(n,r,i);return le(s,X,ie,e)},async setState(n,r,i,s,o){let a=await t.setState(n,r,i,s,o);return le(a,X,ie,e)},async setWorkspacePaymentMethod(n,r,i){let s=await t.setWorkspacePaymentMethod(n,r,i);return le(s,X,ie,e)},async transferBot(n,r,i){let s=await t.transferBot(n,r,i);return le(s,X,ie,e)},async updateAccount(n,r){let i=await t.updateAccount(n,r);return le(i,X,ie,e)},async updateBot(n,r,i){let s=await t.updateBot(n,r,i);return le(s,X,ie,e)},async updateConversation(n,r,i){let s=await t.updateConversation(n,r,i);return le(s,X,ie,e)},async updateFileMetadata(n,r,i){let s=await t.updateFileMetadata(n,r,i);return le(s,X,ie,e)},async updateIntegration(n,r,i){let s=await t.updateIntegration(n,r,i);return le(s,X,ie,e)},async updateMessage(n,r,i){let s=await t.updateMessage(n,r,i);return le(s,X,ie,e)},async updateTable(n,r,i){let s=await t.updateTable(n,r,i);return le(s,X,ie,e)},async updateTableRows(n,r,i){let s=await t.updateTableRows(n,r,i);return le(s,X,ie,e)},async updateTask(n,r,i){let s=await t.updateTask(n,r,i);return le(s,X,ie,e)},async updateUser(n,r,i){let s=await t.updateUser(n,r,i);return le(s,X,ie,e)},async updateWorkspace(n,r,i){let s=await t.updateWorkspace(n,r,i);return le(s,X,ie,e)},async updateWorkspaceMember(n,r,i){let s=await t.updateWorkspaceMember(n,r,i);return le(s,X,ie,e)},async upsertTableRows(n,r,i){let s=await t.upsertTableRows(n,r,i);return le(s,X,ie,e)}}},wM=class extends yM{addParticipant(t,n){return ce(this.configuration).addParticipant(t.id,t.addParticipantBody,n).then(r=>r(this.axios,this.basePath))}breakDownWorkspaceUsageByBot(t,n){return ce(this.configuration).breakDownWorkspaceUsageByBot(t.id,t.type,t.period,n).then(r=>r(this.axios,this.basePath))}callAction(t={},n){return ce(this.configuration).callAction(t.callActionBody,n).then(r=>r(this.axios,this.basePath))}changeAISpendQuota(t={},n){return ce(this.configuration).changeAISpendQuota(t.changeAISpendQuotaBody,n).then(r=>r(this.axios,this.basePath))}changeWorkspacePlan(t,n){return ce(this.configuration).changeWorkspacePlan(t.id,t.changeWorkspacePlanBody,n).then(r=>r(this.axios,this.basePath))}chargeWorkspaceUnpaidInvoices(t,n){return ce(this.configuration).chargeWorkspaceUnpaidInvoices(t.id,t.chargeWorkspaceUnpaidInvoicesBody,n).then(r=>r(this.axios,this.basePath))}checkHandleAvailability(t={},n){return ce(this.configuration).checkHandleAvailability(t.checkHandleAvailabilityBody,n).then(r=>r(this.axios,this.basePath))}configureIntegration(t={},n){return ce(this.configuration).configureIntegration(t.configureIntegrationBody,n).then(r=>r(this.axios,this.basePath))}createBot(t={},n){return ce(this.configuration).createBot(t.createBotBody,n).then(r=>r(this.axios,this.basePath))}createConversation(t={},n){return ce(this.configuration).createConversation(t.createConversationBody,n).then(r=>r(this.axios,this.basePath))}createEvent(t={},n){return ce(this.configuration).createEvent(t.createEventBody,n).then(r=>r(this.axios,this.basePath))}createFile(t,n){return ce(this.configuration).createFile(t.xName,t.xTags,t.xAccessPolicies,t.xIndex,t.contentType,t.contentLength,t.createFileBody,n).then(r=>r(this.axios,this.basePath))}createIntegration(t={},n){return ce(this.configuration).createIntegration(t.createIntegrationBody,n).then(r=>r(this.axios,this.basePath))}createMessage(t={},n){return ce(this.configuration).createMessage(t.createMessageBody,n).then(r=>r(this.axios,this.basePath))}createPersonalAccessToken(t={},n){return ce(this.configuration).createPersonalAccessToken(t.createPersonalAccessTokenBody,n).then(r=>r(this.axios,this.basePath))}createTable(t={},n){return ce(this.configuration).createTable(t.createTableBody,n).then(r=>r(this.axios,this.basePath))}createTableRows(t,n){return ce(this.configuration).createTableRows(t.table,t.createTableRowsBody,n).then(r=>r(this.axios,this.basePath))}createTask(t={},n){return ce(this.configuration).createTask(t.createTaskBody,n).then(r=>r(this.axios,this.basePath))}createUser(t={},n){return ce(this.configuration).createUser(t.createUserBody,n).then(r=>r(this.axios,this.basePath))}createWorkspace(t={},n){return ce(this.configuration).createWorkspace(t.createWorkspaceBody,n).then(r=>r(this.axios,this.basePath))}createWorkspaceMember(t={},n){return ce(this.configuration).createWorkspaceMember(t.createWorkspaceMemberBody,n).then(r=>r(this.axios,this.basePath))}deleteBot(t,n){return ce(this.configuration).deleteBot(t.id,n).then(r=>r(this.axios,this.basePath))}deleteBotIssue(t,n){return ce(this.configuration).deleteBotIssue(t.id,t.issueId,n).then(r=>r(this.axios,this.basePath))}deleteConversation(t,n){return ce(this.configuration).deleteConversation(t.id,n).then(r=>r(this.axios,this.basePath))}deleteFile(t,n){return ce(this.configuration).deleteFile(t.id,n).then(r=>r(this.axios,this.basePath))}deleteIntegration(t,n){return ce(this.configuration).deleteIntegration(t.id,n).then(r=>r(this.axios,this.basePath))}deleteMessage(t,n){return ce(this.configuration).deleteMessage(t.id,n).then(r=>r(this.axios,this.basePath))}deletePersonalAccessToken(t,n){return ce(this.configuration).deletePersonalAccessToken(t.id,n).then(r=>r(this.axios,this.basePath))}deleteTable(t,n){return ce(this.configuration).deleteTable(t.table,n).then(r=>r(this.axios,this.basePath))}deleteTableRows(t,n){return ce(this.configuration).deleteTableRows(t.table,t.deleteTableRowsBody,n).then(r=>r(this.axios,this.basePath))}deleteTask(t,n){return ce(this.configuration).deleteTask(t.id,n).then(r=>r(this.axios,this.basePath))}deleteUser(t,n){return ce(this.configuration).deleteUser(t.id,n).then(r=>r(this.axios,this.basePath))}deleteWorkspace(t,n){return ce(this.configuration).deleteWorkspace(t.id,n).then(r=>r(this.axios,this.basePath))}deleteWorkspaceMember(t,n){return ce(this.configuration).deleteWorkspaceMember(t.id,n).then(r=>r(this.axios,this.basePath))}findTableRows(t,n){return ce(this.configuration).findTableRows(t.table,t.findTableRowsBody,n).then(r=>r(this.axios,this.basePath))}getAccount(t){return ce(this.configuration).getAccount(t).then(n=>n(this.axios,this.basePath))}getAccountPreference(t,n){return ce(this.configuration).getAccountPreference(t.key,n).then(r=>r(this.axios,this.basePath))}getAllWorkspaceQuotaCompletion(t){return ce(this.configuration).getAllWorkspaceQuotaCompletion(t).then(n=>n(this.axios,this.basePath))}getAuditRecords(t,n){return ce(this.configuration).getAuditRecords(t.id,t.nextToken,n).then(r=>r(this.axios,this.basePath))}getBot(t,n){return ce(this.configuration).getBot(t.id,n).then(r=>r(this.axios,this.basePath))}getBotAnalytics(t,n){return ce(this.configuration).getBotAnalytics(t.id,t.startDate,t.endDate,n).then(r=>r(this.axios,this.basePath))}getBotLogs(t,n){return ce(this.configuration).getBotLogs(t.id,t.timeStart,t.timeEnd,t.nextToken,n).then(r=>r(this.axios,this.basePath))}getBotWebchat(t,n){return ce(this.configuration).getBotWebchat(t.id,t.type,n).then(r=>r(this.axios,this.basePath))}getConversation(t,n){return ce(this.configuration).getConversation(t.id,n).then(r=>r(this.axios,this.basePath))}getEvent(t,n){return ce(this.configuration).getEvent(t.id,n).then(r=>r(this.axios,this.basePath))}getFileContent(t,n){return ce(this.configuration).getFileContent(t.id,n).then(r=>r(this.axios,this.basePath))}getFileMetadata(t,n){return ce(this.configuration).getFileMetadata(t.id,n).then(r=>r(this.axios,this.basePath))}getIntegration(t,n){return ce(this.configuration).getIntegration(t.id,n).then(r=>r(this.axios,this.basePath))}getIntegrationByName(t,n){return ce(this.configuration).getIntegrationByName(t.name,t.version,n).then(r=>r(this.axios,this.basePath))}getIntegrationLogs(t,n){return ce(this.configuration).getIntegrationLogs(t.id,t.timeStart,t.timeEnd,t.nextToken,n).then(r=>r(this.axios,this.basePath))}getMessage(t,n){return ce(this.configuration).getMessage(t.id,n).then(r=>r(this.axios,this.basePath))}getOrCreateConversation(t={},n){return ce(this.configuration).getOrCreateConversation(t.getOrCreateConversationBody,n).then(r=>r(this.axios,this.basePath))}getOrCreateMessage(t={},n){return ce(this.configuration).getOrCreateMessage(t.getOrCreateMessageBody,n).then(r=>r(this.axios,this.basePath))}getOrCreateUser(t={},n){return ce(this.configuration).getOrCreateUser(t.getOrCreateUserBody,n).then(r=>r(this.axios,this.basePath))}getOrSetState(t,n){return ce(this.configuration).getOrSetState(t.type,t.id,t.name,t.getOrSetStateBody,n).then(r=>r(this.axios,this.basePath))}getParticipant(t,n){return ce(this.configuration).getParticipant(t.id,t.userId,n).then(r=>r(this.axios,this.basePath))}getPublicIntegration(t,n){return ce(this.configuration).getPublicIntegration(t.name,t.version,n).then(r=>r(this.axios,this.basePath))}getPublicIntegrationById(t,n){return ce(this.configuration).getPublicIntegrationById(t.id,n).then(r=>r(this.axios,this.basePath))}getPublicWorkspace(t,n){return ce(this.configuration).getPublicWorkspace(t.id,n).then(r=>r(this.axios,this.basePath))}getState(t,n){return ce(this.configuration).getState(t.type,t.id,t.name,n).then(r=>r(this.axios,this.basePath))}getTable(t,n){return ce(this.configuration).getTable(t.table,n).then(r=>r(this.axios,this.basePath))}getTableRow(t,n){return ce(this.configuration).getTableRow(t.table,t.id,n).then(r=>r(this.axios,this.basePath))}getTask(t,n){return ce(this.configuration).getTask(t.id,n).then(r=>r(this.axios,this.basePath))}getUpcomingInvoice(t,n){return ce(this.configuration).getUpcomingInvoice(t.id,n).then(r=>r(this.axios,this.basePath))}getUsage(t,n){return ce(this.configuration).getUsage(t.type,t.id,t.period,n).then(r=>r(this.axios,this.basePath))}getUser(t,n){return ce(this.configuration).getUser(t.id,n).then(r=>r(this.axios,this.basePath))}getWorkspace(t,n){return ce(this.configuration).getWorkspace(t.id,n).then(r=>r(this.axios,this.basePath))}getWorkspaceBillingDetails(t,n){return ce(this.configuration).getWorkspaceBillingDetails(t.id,n).then(r=>r(this.axios,this.basePath))}getWorkspaceQuota(t,n){return ce(this.configuration).getWorkspaceQuota(t.id,t.type,t.period,n).then(r=>r(this.axios,this.basePath))}introspect(t={},n){return ce(this.configuration).introspect(t.introspectBody,n).then(r=>r(this.axios,this.basePath))}listActivities(t,n){return ce(this.configuration).listActivities(t.taskId,t.botId,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listBotIssueEvents(t,n){return ce(this.configuration).listBotIssueEvents(t.id,t.issueId,n).then(r=>r(this.axios,this.basePath))}listBotIssues(t,n){return ce(this.configuration).listBotIssues(t.id,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listBots(t={},n){return ce(this.configuration).listBots(t.dev,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listConversations(t={},n){return ce(this.configuration).listConversations(t.nextToken,t.tags,t.participantIds,n).then(r=>r(this.axios,this.basePath))}listEvents(t={},n){return ce(this.configuration).listEvents(t.nextToken,t.type,t.conversationId,t.userId,t.messageId,n).then(r=>r(this.axios,this.basePath))}listFiles(t,n){return ce(this.configuration).listFiles(t.botId,t.nextToken,t.tags,n).then(r=>r(this.axios,this.basePath))}listIntegrations(t={},n){return ce(this.configuration).listIntegrations(t.nextToken,t.name,t.version,t.dev,n).then(r=>r(this.axios,this.basePath))}listMessages(t={},n){return ce(this.configuration).listMessages(t.nextToken,t.conversationId,t.tags,n).then(r=>r(this.axios,this.basePath))}listParticipants(t,n){return ce(this.configuration).listParticipants(t.id,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listPersonalAccessTokens(t){return ce(this.configuration).listPersonalAccessTokens(t).then(n=>n(this.axios,this.basePath))}listPublicIntegrations(t={},n){return ce(this.configuration).listPublicIntegrations(t.nextToken,t.name,t.version,n).then(r=>r(this.axios,this.basePath))}listTables(t={},n){return ce(this.configuration).listTables(t.tags,n).then(r=>r(this.axios,this.basePath))}listTasks(t={},n){return ce(this.configuration).listTasks(t.nextToken,t.tags,t.conversationId,t.userId,t.parentTaskId,t.status,t.type,n).then(r=>r(this.axios,this.basePath))}listUsageHistory(t,n){return ce(this.configuration).listUsageHistory(t.type,t.id,n).then(r=>r(this.axios,this.basePath))}listUsers(t={},n){return ce(this.configuration).listUsers(t.nextToken,t.conversationId,t.tags,n).then(r=>r(this.axios,this.basePath))}listWorkspaceInvoices(t,n){return ce(this.configuration).listWorkspaceInvoices(t.id,n).then(r=>r(this.axios,this.basePath))}listWorkspaceMembers(t={},n){return ce(this.configuration).listWorkspaceMembers(t.nextToken,n).then(r=>r(this.axios,this.basePath))}listWorkspaceQuotas(t,n){return ce(this.configuration).listWorkspaceQuotas(t.id,t.period,n).then(r=>r(this.axios,this.basePath))}listWorkspaceUsages(t,n){return ce(this.configuration).listWorkspaceUsages(t.id,t.type,t.period,n).then(r=>r(this.axios,this.basePath))}listWorkspaces(t={},n){return ce(this.configuration).listWorkspaces(t.nextToken,n).then(r=>r(this.axios,this.basePath))}patchState(t,n){return ce(this.configuration).patchState(t.type,t.id,t.name,t.patchStateBody,n).then(r=>r(this.axios,this.basePath))}removeParticipant(t,n){return ce(this.configuration).removeParticipant(t.id,t.userId,n).then(r=>r(this.axios,this.basePath))}renameTableColumn(t,n){return ce(this.configuration).renameTableColumn(t.table,t.renameTableColumnBody,n).then(r=>r(this.axios,this.basePath))}runVrl(t={},n){return ce(this.configuration).runVrl(t.runVrlBody,n).then(r=>r(this.axios,this.basePath))}searchFiles(t,n){return ce(this.configuration).searchFiles(t.botId,t.query,t.tags,t.limit,n).then(r=>r(this.axios,this.basePath))}setAccountPreference(t,n){return ce(this.configuration).setAccountPreference(t.key,t.setAccountPreferenceBody,n).then(r=>r(this.axios,this.basePath))}setState(t,n){return ce(this.configuration).setState(t.type,t.id,t.name,t.setStateBody,n).then(r=>r(this.axios,this.basePath))}setWorkspacePaymentMethod(t,n){return ce(this.configuration).setWorkspacePaymentMethod(t.id,t.setWorkspacePaymentMethodBody,n).then(r=>r(this.axios,this.basePath))}transferBot(t,n){return ce(this.configuration).transferBot(t.id,t.transferBotBody,n).then(r=>r(this.axios,this.basePath))}updateAccount(t={},n){return ce(this.configuration).updateAccount(t.updateAccountBody,n).then(r=>r(this.axios,this.basePath))}updateBot(t,n){return ce(this.configuration).updateBot(t.id,t.updateBotBody,n).then(r=>r(this.axios,this.basePath))}updateConversation(t,n){return ce(this.configuration).updateConversation(t.id,t.updateConversationBody,n).then(r=>r(this.axios,this.basePath))}updateFileMetadata(t,n){return ce(this.configuration).updateFileMetadata(t.id,t.updateFileMetadataBody,n).then(r=>r(this.axios,this.basePath))}updateIntegration(t,n){return ce(this.configuration).updateIntegration(t.id,t.updateIntegrationBody,n).then(r=>r(this.axios,this.basePath))}updateMessage(t,n){return ce(this.configuration).updateMessage(t.id,t.updateMessageBody,n).then(r=>r(this.axios,this.basePath))}updateTable(t,n){return ce(this.configuration).updateTable(t.table,t.updateTableBody,n).then(r=>r(this.axios,this.basePath))}updateTableRows(t,n){return ce(this.configuration).updateTableRows(t.table,t.updateTableRowsBody,n).then(r=>r(this.axios,this.basePath))}updateTask(t,n){return ce(this.configuration).updateTask(t.id,t.updateTaskBody,n).then(r=>r(this.axios,this.basePath))}updateUser(t,n){return ce(this.configuration).updateUser(t.id,t.updateUserBody,n).then(r=>r(this.axios,this.basePath))}updateWorkspace(t,n){return ce(this.configuration).updateWorkspace(t.id,t.updateWorkspaceBody,n).then(r=>r(this.axios,this.basePath))}updateWorkspaceMember(t,n){return ce(this.configuration).updateWorkspaceMember(t.id,t.updateWorkspaceMemberBody,n).then(r=>r(this.axios,this.basePath))}upsertTableRows(t,n){return ce(this.configuration).upsertTableRows(t.table,t.upsertTableRowsBody,n).then(r=>r(this.axios,this.basePath))}},xM={getRandomValues:e=>new Uint8Array(e.map(()=>Math.floor(Math.random()*256)))},Gu=typeof window<"u"&&typeof window.document<"u"?window.crypto:$u;Gu.getRandomValues||(Gu=xM);var kt=class extends Error{constructor(n,r,i,s,o,a){super(s);E(this,"isApiError",!0);this.code=n,this.description=r,this.type=i,this.message=s,this.error=o,this.id=a,this.id||(this.id=kt.generateId())}format(){return`[${this.type}] ${this.message} (Error ID: ${this.id})`}toJSON(){return{id:this.id,code:this.code,type:this.type,message:this.message}}static generateId(){let n=this.getPrefix(),r=new Date().toISOString().replace(/[\-:TZ]/g,"").split(".")[0],i=4,s=Array.from(Gu.getRandomValues(new Uint8Array(i))).map(o=>o.toString(16).padStart(2,"0")).join("").toUpperCase();return`${n}_${r}x${s}`}static getPrefix(){return typeof window<"u"&&typeof window.document<"u"?"err_bwsr":"err"}},_M=e=>typeof e=="object"&&!Array.isArray(e)&&e!==null,ly=e=>e instanceof kt||_M(e)&&e.isApiError===!0,is=class extends kt{constructor(e,t,n){super(500,"An unknown error occurred","Unknown",e,t,n)}},cy=class extends kt{constructor(t,n,r){super(500,"An internal error occurred","Internal",t,n,r)}},uy=class extends kt{constructor(e,t,n){super(401,"The request requires to be authenticated.","Unauthorized",e,t,n)}},dy=class extends kt{constructor(t,n,r){super(403,"The requested action can't be peform by this resource.","Forbidden",t,n,r)}},fy=class extends kt{constructor(t,n,r){super(413,"The request payload is too large.","PayloadTooLarge",t,n,r)}},hy=class extends kt{constructor(t,n,r){super(400,"The request payload is invalid.","InvalidPayload",t,n,r)}},py=class extends kt{constructor(t,n,r){super(415,"The request is invalid because the content-type is not supported.","UnsupportedMediaType",t,n,r)}},my=class extends kt{constructor(t,n,r){super(405,"The requested method does not exist.","MethodNotFound",t,n,r)}},gy=class extends kt{constructor(t,n,r){super(404,"The requested resource does not exist.","ResourceNotFound",t,n,r)}},yy=class extends kt{constructor(t,n,r){super(400,"The provided JSON schema is invalid.","InvalidJsonSchema",t,n,r)}},vy=class extends kt{constructor(t,n,r){super(400,"The provided data doesn't respect the provided JSON schema.","InvalidDataFormat",t,n,r)}},by=class extends kt{constructor(t,n,r){super(400,"The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.","InvalidIdentifier",t,n,r)}},wy=class extends kt{constructor(e,t,n){super(409,"The resource is related with a different resource that the one referenced in the request. This is usually caused when providing two resource identifiers that aren't linked together.","RelationConflict",e,t,n)}},xy=class extends kt{constructor(t,n,r){super(409,"The resource cannot be deleted because it's referenced by another resource","ReferenceConstraint",t,n,r)}},_y=class extends kt{constructor(t,n,r){super(400,"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.","ReferenceNotFound",t,n,r)}},ky=class extends kt{constructor(t,n,r){super(400,"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.","InvalidQuery",t,n,r)}},Cy=class extends kt{constructor(t,n,r){super(400,"An error happened during the execution of a runtime (bot or integration).","Runtime",t,n,r)}},Ey=class extends kt{constructor(t,n,r){super(409,"The record attempted to be created already exists.","AlreadyExists",t,n,r)}},Sy=class extends kt{constructor(t,n,r){super(429,"The request has been rate limited.","RateLimited",t,n,r)}},Ty=class extends kt{constructor(t,n,r){super(402,"A payment is required to perform this request.","PaymentRequired",t,n,r)}},Oy=class extends kt{constructor(t,n,r){super(403,"The request exceeds the allowed quota. Quotas are a soft limit that can be increased.","QuotaExceeded",t,n,r)}},Iy=class extends kt{constructor(t,n,r){super(413,"The request exceeds the allowed limit. Limits are a hard limit that cannot be increased.","LimitExceeded",t,n,r)}},kM={Unknown:is,Internal:cy,Unauthorized:uy,Forbidden:dy,PayloadTooLarge:fy,InvalidPayload:hy,UnsupportedMediaType:py,MethodNotFound:my,ResourceNotFound:gy,InvalidJsonSchema:yy,InvalidDataFormat:vy,InvalidIdentifier:by,RelationConflict:wy,ReferenceConstraint:xy,ReferenceNotFound:_y,InvalidQuery:ky,Runtime:Cy,AlreadyExists:Ey,RateLimited:Sy,PaymentRequired:Ty,QuotaExceeded:Oy,LimitExceeded:Iy},eo=e=>ly(e)?e:e instanceof Error?new is(e.message,e):typeof e=="string"?new is(e):CM(e);function CM(e){if(typeof e=="object"&&"code"in e&&"type"in e&&"id"in e&&"message"in e&&typeof e.type=="string"&&typeof e.message=="string"){let t=kM[e.type];return t?new t(e.message,void 0,e.id||"UNKNOWN"):new is(`An unclassified API error occurred: ${e.message} (Type: ${e.type}, Code: ${e.code})`)}return new is("An invalid error occurred: "+JSON.stringify(e))}var EM=class{constructor(t,n,r){E(this,"_innerClient");E(this,"createConversation",t=>this._innerClient.createConversation({createConversationBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getConversation",t=>this._innerClient.getConversation(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listConversations",t=>this._innerClient.listConversations(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getOrCreateConversation",t=>this._innerClient.getOrCreateConversation({getOrCreateConversationBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateConversation",({id:t,...n})=>this._innerClient.updateConversation({id:t,updateConversationBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"deleteConversation",t=>this._innerClient.deleteConversation(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listParticipants",t=>this._innerClient.listParticipants(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"addParticipant",({id:t,...n})=>this._innerClient.addParticipant({id:t,addParticipantBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"getParticipant",t=>this._innerClient.getParticipant(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"removeParticipant",t=>this._innerClient.removeParticipant(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createEvent",t=>this._innerClient.createEvent({createEventBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getEvent",t=>this._innerClient.getEvent(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listEvents",t=>this._innerClient.listEvents(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createMessage",t=>this._innerClient.createMessage({createMessageBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getOrCreateMessage",t=>this._innerClient.getOrCreateMessage({getOrCreateMessageBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getMessage",t=>this._innerClient.getMessage(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateMessage",({id:t,...n})=>this._innerClient.updateMessage({id:t,updateMessageBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"listMessages",t=>this._innerClient.listMessages(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"deleteMessage",t=>this._innerClient.deleteMessage(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createUser",t=>this._innerClient.createUser({createUserBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getUser",t=>this._innerClient.getUser(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listUsers",t=>this._innerClient.listUsers(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getOrCreateUser",t=>this._innerClient.getOrCreateUser({getOrCreateUserBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateUser",({id:t,...n})=>this._innerClient.updateUser({id:t,updateUserBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"deleteUser",t=>this._innerClient.deleteUser(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getState",t=>this._innerClient.getState(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"setState",({type:t,id:n,name:r,...i})=>this._innerClient.setState({type:t,id:n,name:r,setStateBody:i}).then(s=>s.data).catch(s=>{throw ue(s)}));E(this,"getOrSetState",({type:t,id:n,name:r,...i})=>this._innerClient.getOrSetState({type:t,id:n,name:r,getOrSetStateBody:i}).then(s=>s.data).catch(s=>{throw ue(s)}));E(this,"patchState",({type:t,id:n,name:r,...i})=>this._innerClient.patchState({type:t,id:n,name:r,patchStateBody:i}).then(s=>s.data).catch(s=>{throw ue(s)}));E(this,"callAction",t=>this._innerClient.callAction({callActionBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"configureIntegration",t=>this._innerClient.configureIntegration({configureIntegrationBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getTask",t=>this._innerClient.getTask(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createTask",t=>this._innerClient.createTask({createTaskBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateTask",({id:t,...n})=>this._innerClient.updateTask({id:t,updateTaskBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"deleteTask",t=>this._innerClient.deleteTask(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listTasks",t=>this._innerClient.listTasks(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"runVrl",t=>this._innerClient.runVrl({runVrlBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getAccount",()=>this._innerClient.getAccount().then(t=>t.data).catch(t=>{throw ue(t)}));E(this,"updateAccount",t=>this._innerClient.updateAccount({updateAccountBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listPersonalAccessTokens",()=>this._innerClient.listPersonalAccessTokens().then(t=>t.data).catch(t=>{throw ue(t)}));E(this,"createPersonalAccessToken",t=>this._innerClient.createPersonalAccessToken({createPersonalAccessTokenBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"deletePersonalAccessToken",t=>this._innerClient.deletePersonalAccessToken(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"setAccountPreference",({key:t,...n})=>this._innerClient.setAccountPreference({key:t,setAccountPreferenceBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"getAccountPreference",t=>this._innerClient.getAccountPreference(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listPublicIntegrations",t=>this._innerClient.listPublicIntegrations(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getPublicIntegrationById",t=>this._innerClient.getPublicIntegrationById(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getPublicIntegration",t=>this._innerClient.getPublicIntegration(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createBot",t=>this._innerClient.createBot({createBotBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateBot",({id:t,...n})=>this._innerClient.updateBot({id:t,updateBotBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"transferBot",({id:t,...n})=>this._innerClient.transferBot({id:t,transferBotBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"listBots",t=>this._innerClient.listBots(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getBot",t=>this._innerClient.getBot(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"deleteBot",t=>this._innerClient.deleteBot(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getBotLogs",t=>this._innerClient.getBotLogs(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getBotWebchat",t=>this._innerClient.getBotWebchat(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getBotAnalytics",t=>this._innerClient.getBotAnalytics(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listBotIssues",t=>this._innerClient.listBotIssues(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"deleteBotIssue",t=>this._innerClient.deleteBotIssue(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listBotIssueEvents",t=>this._innerClient.listBotIssueEvents(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getWorkspaceBillingDetails",t=>this._innerClient.getWorkspaceBillingDetails(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"setWorkspacePaymentMethod",({id:t,...n})=>this._innerClient.setWorkspacePaymentMethod({id:t,setWorkspacePaymentMethodBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"listWorkspaceInvoices",t=>this._innerClient.listWorkspaceInvoices(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getUpcomingInvoice",t=>this._innerClient.getUpcomingInvoice(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"chargeWorkspaceUnpaidInvoices",({id:t,...n})=>this._innerClient.chargeWorkspaceUnpaidInvoices({id:t,chargeWorkspaceUnpaidInvoicesBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"createWorkspace",t=>this._innerClient.createWorkspace({createWorkspaceBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getPublicWorkspace",t=>this._innerClient.getPublicWorkspace(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getWorkspace",t=>this._innerClient.getWorkspace(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listWorkspaceUsages",t=>this._innerClient.listWorkspaceUsages(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"breakDownWorkspaceUsageByBot",t=>this._innerClient.breakDownWorkspaceUsageByBot(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getAllWorkspaceQuotaCompletion",()=>this._innerClient.getAllWorkspaceQuotaCompletion().then(t=>t.data).catch(t=>{throw ue(t)}));E(this,"getWorkspaceQuota",t=>this._innerClient.getWorkspaceQuota(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listWorkspaceQuotas",t=>this._innerClient.listWorkspaceQuotas(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateWorkspace",({id:t,...n})=>this._innerClient.updateWorkspace({id:t,updateWorkspaceBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"checkHandleAvailability",t=>this._innerClient.checkHandleAvailability({checkHandleAvailabilityBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listWorkspaces",t=>this._innerClient.listWorkspaces(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"changeWorkspacePlan",({id:t,...n})=>this._innerClient.changeWorkspacePlan({id:t,changeWorkspacePlanBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"deleteWorkspace",t=>this._innerClient.deleteWorkspace(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getAuditRecords",t=>this._innerClient.getAuditRecords(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listWorkspaceMembers",t=>this._innerClient.listWorkspaceMembers(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"deleteWorkspaceMember",t=>this._innerClient.deleteWorkspaceMember(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createWorkspaceMember",t=>this._innerClient.createWorkspaceMember({createWorkspaceMemberBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateWorkspaceMember",({id:t,...n})=>this._innerClient.updateWorkspaceMember({id:t,updateWorkspaceMemberBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"createIntegration",t=>this._innerClient.createIntegration({createIntegrationBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateIntegration",({id:t,...n})=>this._innerClient.updateIntegration({id:t,updateIntegrationBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"listIntegrations",t=>this._innerClient.listIntegrations(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getIntegration",t=>this._innerClient.getIntegration(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getIntegrationLogs",t=>this._innerClient.getIntegrationLogs(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getIntegrationByName",t=>this._innerClient.getIntegrationByName(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"deleteIntegration",t=>this._innerClient.deleteIntegration(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getUsage",t=>this._innerClient.getUsage(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listUsageHistory",t=>this._innerClient.listUsageHistory(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"changeAISpendQuota",t=>this._innerClient.changeAISpendQuota({changeAISpendQuotaBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listActivities",t=>this._innerClient.listActivities(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"introspect",t=>this._innerClient.introspect({introspectBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createFile",({xName:t,xTags:n,xAccessPolicies:r,xIndex:i,contentType:s,contentLength:o,...a})=>this._innerClient.createFile({xName:t,xTags:n,xAccessPolicies:r,xIndex:i,contentType:s,contentLength:o,createFileBody:a}).then(l=>l.data).catch(l=>{throw ue(l)}));E(this,"deleteFile",t=>this._innerClient.deleteFile(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listFiles",t=>this._innerClient.listFiles(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getFileMetadata",t=>this._innerClient.getFileMetadata(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getFileContent",t=>this._innerClient.getFileContent(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateFileMetadata",({id:t,...n})=>this._innerClient.updateFileMetadata({id:t,updateFileMetadataBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"searchFiles",t=>this._innerClient.searchFiles(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"listTables",t=>this._innerClient.listTables(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getTable",t=>this._innerClient.getTable(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"createTable",t=>this._innerClient.createTable({createTableBody:t}).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"updateTable",({table:t,...n})=>this._innerClient.updateTable({table:t,updateTableBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"renameTableColumn",({table:t,...n})=>this._innerClient.renameTableColumn({table:t,renameTableColumnBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"deleteTable",t=>this._innerClient.deleteTable(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"getTableRow",t=>this._innerClient.getTableRow(t).then(n=>n.data).catch(n=>{throw ue(n)}));E(this,"findTableRows",({table:t,...n})=>this._innerClient.findTableRows({table:t,findTableRowsBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"createTableRows",({table:t,...n})=>this._innerClient.createTableRows({table:t,createTableRowsBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"deleteTableRows",({table:t,...n})=>this._innerClient.deleteTableRows({table:t,deleteTableRowsBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"updateTableRows",({table:t,...n})=>this._innerClient.updateTableRows({table:t,updateTableRowsBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));E(this,"upsertTableRows",({table:t,...n})=>this._innerClient.upsertTableRows({table:t,upsertTableRowsBody:n}).then(r=>r.data).catch(r=>{throw ue(r)}));this._innerClient=new wM(t,n,r)}};function ue(e){var t;return X.isAxiosError(e)&&((t=e.response)!=null&&t.data)?eo(e.response.data):eo(e)}var Py=100*1024*1024,SM=Py,TM=Py,OM=class extends EM{constructor(n={}){let r=pM(n),i=IM(r);super(void 0,r.apiUrl,i);E(this,"config");E(this,"axiosClient");E(this,"createFile",async({name:n,data:r,index:i,tags:s,contentType:o,contentLength:a,accessPolicies:l})=>{let c={...this.config.headers,"x-name":n,"x-tags":s?JSON.stringify(s):void 0,"x-index":i?"true":"false","x-access-policies":(l==null?void 0:l.join(","))??void 0,"content-type":o??!1,"content-length":a};return(await this.axiosClient.post("/v1/files",r,{headers:c,baseURL:this.config.apiUrl}).catch(u=>{throw PM(u)})).data});this.axiosClient=i,this.config=r}};function IM(e){let{headers:t,withCredentials:n,timeout:r}=e;return X.create({headers:t,withCredentials:n,timeout:r,maxBodyLength:SM,maxContentLength:TM,httpAgent:Ku?new sM.default.Agent({keepAlive:!0}):void 0,httpsAgent:Ku?new oM.default.Agent({keepAlive:!0}):void 0})}function PM(e){var t;return X.isAxiosError(e)&&((t=e.response)!=null&&t.data)?eo(e.response.data):eo(e)}const Ay=Ll(Object.freeze(Object.defineProperty({__proto__:null,AlreadyExistsError:Ey,Client:OM,ForbiddenError:dy,InternalError:cy,InvalidDataFormatError:vy,InvalidIdentifierError:by,InvalidJsonSchemaError:yy,InvalidPayloadError:hy,InvalidQueryError:ky,LimitExceededError:Iy,MethodNotFoundError:my,PayloadTooLargeError:fy,PaymentRequiredError:Ty,QuotaExceededError:Oy,RateLimitedError:Sy,ReferenceConstraintError:xy,ReferenceNotFoundError:_y,RelationConflictError:wy,ResourceNotFoundError:gy,RuntimeError:Cy,UnauthorizedError:uy,UnknownError:is,UnsupportedMediaTypeError:py,axios:Z$,errorFrom:eo,isApiError:ly},Symbol.toStringTag,{value:"Module"})));var AM=Object.create,Ja=Object.defineProperty,RM=Object.getOwnPropertyDescriptor,$M=Object.getOwnPropertyNames,MM=Object.getPrototypeOf,LM=Object.prototype.hasOwnProperty,Ry=(e,t)=>{for(var n in t)Ja(e,n,{get:t[n],enumerable:!0})},$y=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of $M(t))!LM.call(e,i)&&i!==n&&Ja(e,i,{get:()=>t[i],enumerable:!(r=RM(t,i))||r.enumerable});return e},My=(e,t,n)=>(n=e!=null?AM(MM(e)):{},$y(t||!e||!e.__esModule?Ja(n,"default",{value:e,enumerable:!0}):n,e)),DM=e=>$y(Ja({},"__esModule",{value:!0}),e),Ly={};Ry(Ly,{Bot:()=>_L,BotSpecificClient:()=>Hy,Integration:()=>fL,IntegrationDefinition:()=>tL,IntegrationSpecificClient:()=>Zy,botIdHeader:()=>Yu,botUserIdHeader:()=>Uy,configurationHeader:()=>Qu,integrationIdHeader:()=>Fy,messages:()=>Dy,operationHeader:()=>Xu,parseBody:()=>Cr,serve:()=>ed,typeHeader:()=>Vy,webhookIdHeader:()=>By});var NM=DM(Ly),Dy={};Ry(Dy,{defaults:()=>HM});var Mt=ja,mn=Mt.z.string().min(1),jM=Mt.z.object({text:mn}),UM=Mt.z.object({markdown:mn}),FM=Mt.z.object({imageUrl:mn}),BM=Mt.z.object({audioUrl:mn}),VM=Mt.z.object({videoUrl:mn}),zM=Mt.z.object({fileUrl:mn,title:mn.optional()}),ZM=Mt.z.object({latitude:Mt.z.number(),longitude:Mt.z.number(),address:Mt.z.string().optional(),title:Mt.z.string().optional()}),Ny=Mt.z.object({title:mn,subtitle:mn.optional(),imageUrl:mn.optional(),actions:Mt.z.array(Mt.z.object({action:Mt.z.enum(["postback","url","say"]),label:mn,value:mn}))}),jy=Mt.z.object({text:mn,options:Mt.z.array(Mt.z.object({label:mn,value:mn}))}),WM=Mt.z.object({items:Mt.z.array(Ny)}),HM={text:{schema:jM},markdown:{schema:UM},image:{schema:FM},audio:{schema:BM},video:{schema:VM},file:{schema:zM},location:{schema:ZM},carousel:{schema:WM},card:{schema:Ny},dropdown:{schema:jy},choice:{schema:jy}},Yu="x-bot-id",Uy="x-bot-user-id",Fy="x-integration-id",By="x-webhook-id",Qu="x-bp-configuration",Xu="x-bp-operation",Vy="x-bp-type",qM=Eg,Ga=console;function Cr(e){if(!e.body)throw new Error("Missing body");return JSON.parse(e.body)}async function ed(e,t=8072,n=YM){let r=(0,qM.createServer)(async(i,s)=>{try{let o=await KM(i);if(o.path==="/health"){s.writeHead(200).end("ok");return}let a=await e(o);s.writeHead((a==null?void 0:a.status)??200,(a==null?void 0:a.headers)??{}).end((a==null?void 0:a.body)??"{}")}catch(o){Ga.error("Error while handling request",{error:(o==null?void 0:o.message)??"Internal error occured"}),s.writeHead(500).end(JSON.stringify({error:(o==null?void 0:o.message)??"Internal error occured"}))}});return r.listen(t,()=>n(t)),r}async function KM(e){var i;let t=await GM(e),n={};for(let s=0;s<e.rawHeaders.length;s+=2){let o=e.rawHeaders[s].toLowerCase(),a=e.rawHeaders[s+1];n[o]=a}let r=new URL(e.url??"",e.headers.host?`http://${e.headers.host}`:"http://botpress.cloud");return{body:t,path:r.pathname,query:JM(r.search,"?"),headers:n,method:((i=e.method)==null?void 0:i.toUpperCase())??"GET"}}function JM(e,t){return e.indexOf(t)===0?e.slice(t.length):e}async function GM(e){return new Promise((t,n)=>{if(e.method!=="POST"&&e.method!=="PUT"&&e.method!=="PATCH")return t(void 0);let r="";e.on("data",i=>r+=i.toString()),e.on("error",i=>n(i)),e.on("end",()=>t(r))})}function YM(e){Ga.info(`Listening on port ${e}`)}var QM=ja,XM=QM.z.enum(["webhook_received","message_created","action_triggered","register","unregister","ping","create_user","create_conversation"]),eL=e=>{let t=e[Yu],n=e[Uy],r=e[Fy],i=e[By],s=e[Qu],o=XM.parse(e[Xu]);if(!t)throw new Error("Missing bot headers");if(!n)throw new Error("Missing bot user headers");if(!r)throw new Error("Missing integration headers");if(!i)throw new Error("Missing webhook headers");if(!s)throw new Error("Missing configuration headers");if(!o)throw new Error("Missing operation headers");return{botId:t,botUserId:n,integrationId:r,webhookId:i,operation:o,configuration:s?JSON.parse(Buffer.from(s,"base64").toString("utf-8")):{}}},tL=class{constructor(e){E(this,"name");E(this,"version");E(this,"title");E(this,"description");E(this,"icon");E(this,"readme");E(this,"configuration");E(this,"events");E(this,"actions");E(this,"channels");E(this,"states");E(this,"user");E(this,"secrets");E(this,"identifier");E(this,"entities");this.props=e,this.name=e.name,this.version=e.version,this.icon=e.icon,this.readme=e.readme,this.title=e.title,this.identifier=e.identifier,this.description=e.description,this.configuration=e.configuration,this.events=e.events,this.actions=e.actions,this.channels=e.channels,this.states=e.states,this.user=e.user,this.secrets=e.secrets,this.entities=e.entities}},zy=Ay,Zy=class{constructor(e){E(this,"createConversation",e=>this.client.createConversation(e));E(this,"getConversation",e=>this.client.getConversation(e));E(this,"listConversations",e=>this.client.listConversations(e));E(this,"getOrCreateConversation",e=>this.client.getOrCreateConversation(e));E(this,"updateConversation",e=>this.client.updateConversation(e));E(this,"deleteConversation",e=>this.client.deleteConversation(e));E(this,"listParticipants",e=>this.client.listParticipants(e));E(this,"addParticipant",e=>this.client.addParticipant(e));E(this,"getParticipant",e=>this.client.getParticipant(e));E(this,"removeParticipant",e=>this.client.removeParticipant(e));E(this,"createEvent",e=>this.client.createEvent(e));E(this,"getEvent",e=>this.client.getEvent(e));E(this,"listEvents",e=>this.client.listEvents(e));E(this,"createMessage",e=>this.client.createMessage(e));E(this,"getOrCreateMessage",e=>this.client.getOrCreateMessage(e));E(this,"getMessage",e=>this.client.getMessage(e));E(this,"updateMessage",e=>this.client.updateMessage(e));E(this,"listMessages",e=>this.client.listMessages(e));E(this,"deleteMessage",e=>this.client.deleteMessage(e));E(this,"createUser",e=>this.client.createUser(e));E(this,"getUser",e=>this.client.getUser(e));E(this,"listUsers",e=>this.client.listUsers(e));E(this,"getOrCreateUser",e=>this.client.getOrCreateUser(e));E(this,"updateUser",e=>this.client.updateUser(e));E(this,"deleteUser",e=>this.client.deleteUser(e));E(this,"getState",e=>this.client.getState(e));E(this,"setState",e=>this.client.setState(e));E(this,"getOrSetState",e=>this.client.getOrSetState(e));E(this,"patchState",e=>this.client.patchState(e));E(this,"configureIntegration",e=>this.client.configureIntegration(e));this.client=e}},Wy=My(Eg),Ya=e=>{if(process.env.BP_LOG_FORMAT==="json")return JSON.stringify({msg:Wy.default.format(...e),visible_to_bot_owner:!0});{let[t,...n]=e;return Wy.default.format(`[For Bot Owner] ${t}`,...n)}},nL={forBot:()=>({info:(...e)=>{console.info(Ya(e))},warn:(...e)=>{console.warn(Ya(e))},error:(...e)=>{console.error(Ya(e))},debug:(...e)=>{console.debug(Ya(e))}})},rL=e=>async t=>{let n=eL(t.headers),r=new Zy(new zy.Client({botId:n.botId,integrationId:n.integrationId})),i={ctx:n,req:t,client:r,logger:nL,instance:e};try{let s;switch(n.operation){case"webhook_received":s=await sL(i);break;case"register":s=await oL(i);break;case"unregister":s=await aL(i);break;case"message_created":s=await uL(i);break;case"action_triggered":s=await dL(i);break;case"ping":s=await iL(i);break;case"create_user":s=await lL(i);break;case"create_conversation":s=await cL(i);break;default:throw new Error(`Unknown operation ${n.operation}`)}return s?{...s,status:s.status??200}:{status:200}}catch(s){if(s instanceof zy.RuntimeError)return{status:s.code,body:JSON.stringify(s.toJSON())};throw s}},iL=async e=>{},sL=async({client:e,ctx:t,req:n,logger:r,instance:i})=>{let{req:s}=Cr(n);return i.webhook({client:e,ctx:t,req:s,logger:r})},oL=async({client:e,ctx:t,req:n,logger:r,instance:i})=>{if(!i.register)return;let{webhookUrl:s}=Cr(n);await i.register({client:e,ctx:t,webhookUrl:s,logger:r})},aL=async({client:e,ctx:t,req:n,logger:r,instance:i})=>{if(!i.unregister)return;let{webhookUrl:s}=Cr(n);await i.unregister({ctx:t,webhookUrl:s,client:e,logger:r})},lL=async({client:e,ctx:t,req:n,logger:r,instance:i})=>{if(!i.createUser)return;let{tags:s}=Cr(n);return await i.createUser({ctx:t,client:e,tags:s,logger:r})},cL=async({client:e,ctx:t,req:n,logger:r,instance:i})=>{if(!i.createConversation)return;let{channel:s,tags:o}=Cr(n);return await i.createConversation({ctx:t,client:e,channel:s,tags:o,logger:r})},uL=async({ctx:e,req:t,client:n,logger:r,instance:i})=>{let{conversation:s,user:o,type:a,payload:l,message:c}=Cr(t),u=i.channels[s.channel];if(!u)throw new Error(`Channel ${s.channel} not found`);let d=u.messages[a];if(!d)throw new Error(`Message of type ${a} not found in channel ${s.channel}`);await d({ctx:e,conversation:s,message:c,user:o,type:a,client:n,payload:l,ack:async({tags:h})=>{await n.updateMessage({id:c.id,tags:h})},logger:r})},dL=async({req:e,ctx:t,client:n,logger:r,instance:i})=>{let{input:s,type:o}=Cr(e);if(!o)throw new Error("Missing action type");let a=i.actions[o];if(!a)throw new Error(`Action ${o} not found`);let l=await a({ctx:t,input:s,client:n,type:o,logger:r});return{body:JSON.stringify({output:l})}},fL=class{constructor(e){E(this,"props");E(this,"actions");E(this,"channels");E(this,"register");E(this,"unregister");E(this,"createUser");E(this,"createConversation");E(this,"webhook");E(this,"handler",rL(this));E(this,"start",e=>ed(this.handler,e));this.props=e,this.actions=e.actions,this.channels=e.channels,this.register=e.register,this.unregister=e.unregister,this.createUser=e.createUser,this.createConversation=e.createConversation,this.webhook=e.handler}},hL=My(Ay),Hy=class{constructor(e){E(this,"getConversation",e=>this.client.getConversation(e));E(this,"listConversations",e=>this.client.listConversations(e));E(this,"updateConversation",e=>this.client.updateConversation(e));E(this,"deleteConversation",e=>this.client.deleteConversation(e));E(this,"listParticipants",e=>this.client.listParticipants(e));E(this,"addParticipant",e=>this.client.addParticipant(e));E(this,"getParticipant",e=>this.client.getParticipant(e));E(this,"removeParticipant",e=>this.client.removeParticipant(e));E(this,"getEvent",e=>this.client.getEvent(e));E(this,"listEvents",e=>this.client.listEvents(e));E(this,"createMessage",e=>this.client.createMessage(e));E(this,"getOrCreateMessage",e=>this.client.getOrCreateMessage(e));E(this,"getMessage",e=>this.client.getMessage(e));E(this,"updateMessage",e=>this.client.updateMessage(e));E(this,"listMessages",e=>this.client.listMessages(e));E(this,"deleteMessage",e=>this.client.deleteMessage(e));E(this,"getUser",e=>this.client.getUser(e));E(this,"listUsers",e=>this.client.listUsers(e));E(this,"updateUser",e=>this.client.updateUser(e));E(this,"deleteUser",e=>this.client.deleteUser(e));E(this,"getState",e=>this.client.getState(e).then(t=>({state:{...t.state,payload:t.state.payload}})));E(this,"setState",e=>this.client.setState(e).then(t=>({state:{...t.state,payload:t.state.payload}})));E(this,"getOrSetState",e=>this.client.getOrSetState(e).then(t=>({state:{...t.state,payload:t.state.payload}})));E(this,"patchState",e=>this.client.patchState(e).then(t=>({state:{...t.state,payload:t.state.payload}})));E(this,"callAction",e=>this.client.callAction(e));E(this,"createConversation",e=>this.client.createConversation(e));E(this,"getOrCreateConversation",e=>this.client.getOrCreateConversation(e));E(this,"createUser",e=>this.client.createUser(e));E(this,"getOrCreateUser",e=>this.client.getOrCreateUser(e));this.client=e}},pL=ja,mL=pL.z.enum(["event_received","register","unregister","ping","action_triggered"]),gL=e=>{let t=e[Yu],n=e[Qu],r=e[Vy],i=mL.parse(e[Xu]);if(!t)throw new Error("Missing bot headers");if(!r)throw new Error("Missing type headers");if(!n)throw new Error("Missing configuration headers");if(!i)throw new Error("Missing operation headers");return{botId:t,operation:i,type:r,configuration:n?JSON.parse(Buffer.from(n,"base64").toString("utf-8")):{}}},yL=e=>async t=>{let n=gL(t.headers);n.operation!=="ping"&&Ga.info(`Received ${n.operation} operation for bot ${n.botId} of type ${n.type}`);let r=new Hy(new hL.Client({botId:n.botId})),i={req:t,ctx:n,client:r,instance:e};switch(n.operation){case"action_triggered":throw new Error(`Operation ${n.operation} not supported yet`);case"event_received":await xL(i);break;case"register":await bL();break;case"unregister":await wL();break;case"ping":await vL();break;default:throw new Error(`Unknown operation ${n.operation}`)}return{status:200}},vL=async e=>{},bL=async e=>{},wL=async e=>{},xL=async({ctx:e,req:t,client:n,instance:r})=>{Ga.debug(`Received event ${e.type}`);let i=Cr(t),s=i.event;switch(e.type){case"message_created":let o={user:s.payload.user,conversation:s.payload.conversation,message:s.payload.message,states:s.payload.states,event:s};await Promise.all(r.messageHandlers.map(c=>c({client:n,ctx:e,...o})));break;case"state_expired":let a={state:s.payload.state};await Promise.all(r.stateExpiredHandlers.map(c=>c({client:n,ctx:e,...a})));break;default:let l={event:i.event};await Promise.all(r.eventHandlers.map(c=>c({client:n,ctx:e,...l})))}},_L=class{constructor(e){E(this,"_state",{messageHandlers:[],eventHandlers:[],stateExpiredHandlers:[]});E(this,"props");E(this,"message",e=>{this._state.messageHandlers.push(e)});E(this,"event",e=>{this._state.eventHandlers.push(e)});E(this,"stateExpired",e=>{this._state.stateExpiredHandlers.push(e)});E(this,"handler",yL(this._state));E(this,"start",e=>ed(this.handler,e));this.props=e}},ht;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},e.getValidEnumValues=i=>{const s=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(s){return i[s]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},e.find=(i,s)=>{for(const o of i)if(s(o))return o},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(ht||(ht={}));var td;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(td||(td={}));const Oe=ht.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Yr=e=>{switch(typeof e){case"undefined":return Oe.undefined;case"string":return Oe.string;case"number":return isNaN(e)?Oe.nan:Oe.number;case"boolean":return Oe.boolean;case"function":return Oe.function;case"bigint":return Oe.bigint;case"symbol":return Oe.symbol;case"object":return Array.isArray(e)?Oe.array:e===null?Oe.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Oe.promise:typeof Map<"u"&&e instanceof Map?Oe.map:typeof Set<"u"&&e instanceof Set?Oe.set:typeof Date<"u"&&e instanceof Date?Oe.date:Oe.object;default:return Oe.unknown}},we=ht.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"]),kL=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Zn extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(n(o))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,ht.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Zn.create=e=>new Zn(e);const to=(e,t)=>{let n;switch(e.code){case we.invalid_type:e.received===Oe.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case we.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,ht.jsonStringifyReplacer)}`;break;case we.unrecognized_keys:n=`Unrecognized key(s) in object: ${ht.joinValues(e.keys,", ")}`;break;case we.invalid_union:n="Invalid input";break;case we.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ht.joinValues(e.options)}`;break;case we.invalid_enum_value:n=`Invalid enum value. Expected ${ht.joinValues(e.options)}, received '${e.received}'`;break;case we.invalid_arguments:n="Invalid function arguments";break;case we.invalid_return_type:n="Invalid function return type";break;case we.invalid_date:n="Invalid date";break;case we.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:ht.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case we.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case we.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case we.custom:n="Invalid input";break;case we.invalid_intersection_types:n="Intersection results could not be merged";break;case we.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case we.not_finite:n="Number must be finite";break;default:n=t.defaultError,ht.assertNever(e)}return{message:n}};let qy=to;function CL(e){qy=e}function Qa(){return qy}const Xa=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,s=[...n,...i.path||[]],o={...i,path:s};let a="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)a=c(o,{data:t,defaultError:a}).message;return{...i,path:s,message:i.message||a}},EL=[];function Ae(e,t){const n=Xa({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Qa(),to].filter(r=>!!r)});e.common.issues.push(n)}class dn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return Qe;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return dn.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return Qe;s.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:t.value,value:r}}}const Qe=Object.freeze({status:"aborted"}),Ky=e=>({status:"dirty",value:e}),gn=e=>({status:"valid",value:e}),nd=e=>e.status==="aborted",rd=e=>e.status==="dirty",no=e=>e.status==="valid",el=e=>typeof Promise<"u"&&e instanceof Promise;var Ve;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Ve||(Ve={}));class ar{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Jy=(e,t)=>{if(no(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Zn(e.common.issues);return this._error=n,this._error}}};function Xe(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},description:i}}class tt{constructor(t){this.spa=this.safeParseAsync,this._def=t,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)}get description(){return this._def.description}_getType(t){return Yr(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Yr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new dn,ctx:{common:t.parent.common,data:t.data,parsedType:Yr(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(el(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Yr(t)},s=this._parseSync({data:t,path:i.path,parent:i});return Jy(i,s)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Yr(t)},i=this._parse({data:t,path:r.path,parent:r}),s=await(el(i)?i:Promise.resolve(i));return Jy(r,s)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const o=t(i),a=()=>s.addIssue({code:we.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new qn({schema:this,typeName:He.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Sr.create(this,this._def)}nullable(){return Ii.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Hn.create(this,this._def)}promise(){return ls.create(this,this._def)}or(t){return oo.create([this,t],this._def)}and(t){return ao.create(this,t,this._def)}transform(t){return new qn({...Xe(this._def),schema:this,typeName:He.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new ho({...Xe(this._def),innerType:this,defaultValue:n,typeName:He.ZodDefault})}brand(){return new Yy({typeName:He.ZodBranded,type:this,...Xe(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new ol({...Xe(this._def),innerType:this,catchValue:n,typeName:He.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return po.create(this,t)}readonly(){return ll.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const SL=/^c[^\s-]{8,}$/i,TL=/^[a-z][a-z0-9]*$/,OL=/^[0-9A-HJKMNP-TV-Z]{26}$/,IL=/^[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,PL=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,AL="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let id;const RL=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,$L=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ML=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function LL(e,t){return!!((t==="v4"||!t)&&RL.test(e)||(t==="v6"||!t)&&$L.test(e))}class Wn extends tt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Oe.string){const s=this._getOrReturnCtx(t);return Ae(s,{code:we.invalid_type,expected:Oe.string,received:s.parsedType}),Qe}const r=new dn;let i;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(i=this._getOrReturnCtx(t,i),Ae(i,{code:we.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")t.data.length>s.value&&(i=this._getOrReturnCtx(t,i),Ae(i,{code:we.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const o=t.data.length>s.value,a=t.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(t,i),o?Ae(i,{code:we.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&Ae(i,{code:we.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")PL.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"email",code:we.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")id||(id=new RegExp(AL,"u")),id.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"emoji",code:we.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")IL.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"uuid",code:we.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")SL.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"cuid",code:we.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")TL.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"cuid2",code:we.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")OL.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"ulid",code:we.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),Ae(i,{validation:"url",code:we.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"regex",code:we.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(t,i),Ae(i,{code:we.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(i=this._getOrReturnCtx(t,i),Ae(i,{code:we.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(i=this._getOrReturnCtx(t,i),Ae(i,{code:we.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?ML(s).test(t.data)||(i=this._getOrReturnCtx(t,i),Ae(i,{code:we.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="ip"?LL(t.data,s.version)||(i=this._getOrReturnCtx(t,i),Ae(i,{validation:"ip",code:we.invalid_string,message:s.message}),r.dirty()):ht.assertNever(s);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:we.invalid_string,...Ve.errToObj(r)})}_addCheck(t){return new Wn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ve.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ve.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ve.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ve.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ve.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ve.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ve.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ve.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,...Ve.errToObj(t==null?void 0:t.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ve.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...Ve.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ve.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ve.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ve.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ve.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ve.errToObj(n)})}nonempty(t){return this.min(1,Ve.errToObj(t))}trim(){return new Wn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Wn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Wn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Wn.create=e=>{var t;return new Wn({checks:[],typeName:He.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Xe(e)})};function DL(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,s=parseInt(e.toFixed(i).replace(".","")),o=parseInt(t.toFixed(i).replace(".",""));return s%o/Math.pow(10,i)}class Qr extends tt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Oe.number){const s=this._getOrReturnCtx(t);return Ae(s,{code:we.invalid_type,expected:Oe.number,received:s.parsedType}),Qe}let r;const i=new dn;for(const s of this._def.checks)s.kind==="int"?ht.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Ae(r,{code:we.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:we.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:we.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?DL(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:we.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Ae(r,{code:we.not_finite,message:s.message}),i.dirty()):ht.assertNever(s);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ve.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ve.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ve.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ve.toString(n))}setLimit(t,n,r,i){return new Qr({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ve.toString(i)}]})}_addCheck(t){return new Qr({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ve.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ve.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ve.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ve.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ve.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ve.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ve.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ve.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ve.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&ht.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}Qr.create=e=>new Qr({checks:[],typeName:He.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...Xe(e)});class Xr extends tt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==Oe.bigint){const s=this._getOrReturnCtx(t);return Ae(s,{code:we.invalid_type,expected:Oe.bigint,received:s.parsedType}),Qe}let r;const i=new dn;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:we.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:we.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Ae(r,{code:we.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):ht.assertNever(s);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ve.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ve.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ve.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ve.toString(n))}setLimit(t,n,r,i){return new Xr({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ve.toString(i)}]})}_addCheck(t){return new Xr({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ve.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ve.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ve.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ve.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ve.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Xr.create=e=>{var t;return new Xr({checks:[],typeName:He.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...Xe(e)})};class ro extends tt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Oe.boolean){const r=this._getOrReturnCtx(t);return Ae(r,{code:we.invalid_type,expected:Oe.boolean,received:r.parsedType}),Qe}return gn(t.data)}}ro.create=e=>new ro({typeName:He.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...Xe(e)});class Si extends tt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Oe.date){const s=this._getOrReturnCtx(t);return Ae(s,{code:we.invalid_type,expected:Oe.date,received:s.parsedType}),Qe}if(isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return Ae(s,{code:we.invalid_date}),Qe}const r=new dn;let i;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(i=this._getOrReturnCtx(t,i),Ae(i,{code:we.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(i=this._getOrReturnCtx(t,i),Ae(i,{code:we.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):ht.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Si({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ve.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ve.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Si.create=e=>new Si({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:He.ZodDate,...Xe(e)});class tl extends tt{_parse(t){if(this._getType(t)!==Oe.symbol){const r=this._getOrReturnCtx(t);return Ae(r,{code:we.invalid_type,expected:Oe.symbol,received:r.parsedType}),Qe}return gn(t.data)}}tl.create=e=>new tl({typeName:He.ZodSymbol,...Xe(e)});class io extends tt{_parse(t){if(this._getType(t)!==Oe.undefined){const r=this._getOrReturnCtx(t);return Ae(r,{code:we.invalid_type,expected:Oe.undefined,received:r.parsedType}),Qe}return gn(t.data)}}io.create=e=>new io({typeName:He.ZodUndefined,...Xe(e)});class so extends tt{_parse(t){if(this._getType(t)!==Oe.null){const r=this._getOrReturnCtx(t);return Ae(r,{code:we.invalid_type,expected:Oe.null,received:r.parsedType}),Qe}return gn(t.data)}}so.create=e=>new so({typeName:He.ZodNull,...Xe(e)});class ss extends tt{constructor(){super(...arguments),this._any=!0}_parse(t){return gn(t.data)}}ss.create=e=>new ss({typeName:He.ZodAny,...Xe(e)});class Ti extends tt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return gn(t.data)}}Ti.create=e=>new Ti({typeName:He.ZodUnknown,...Xe(e)});class Er extends tt{_parse(t){const n=this._getOrReturnCtx(t);return Ae(n,{code:we.invalid_type,expected:Oe.never,received:n.parsedType}),Qe}}Er.create=e=>new Er({typeName:He.ZodNever,...Xe(e)});class nl extends tt{_parse(t){if(this._getType(t)!==Oe.undefined){const r=this._getOrReturnCtx(t);return Ae(r,{code:we.invalid_type,expected:Oe.void,received:r.parsedType}),Qe}return gn(t.data)}}nl.create=e=>new nl({typeName:He.ZodVoid,...Xe(e)});class Hn extends tt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==Oe.array)return Ae(n,{code:we.invalid_type,expected:Oe.array,received:n.parsedType}),Qe;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(Ae(n,{code:o?we.too_big:we.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Ae(n,{code:we.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Ae(n,{code:we.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,a)=>i.type._parseAsync(new ar(n,o,n.path,a)))).then(o=>dn.mergeArray(r,o));const s=[...n.data].map((o,a)=>i.type._parseSync(new ar(n,o,n.path,a)));return dn.mergeArray(r,s)}get element(){return this._def.type}min(t,n){return new Hn({...this._def,minLength:{value:t,message:Ve.toString(n)}})}max(t,n){return new Hn({...this._def,maxLength:{value:t,message:Ve.toString(n)}})}length(t,n){return new Hn({...this._def,exactLength:{value:t,message:Ve.toString(n)}})}nonempty(t){return this.min(1,t)}}Hn.create=(e,t)=>new Hn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:He.ZodArray,...Xe(t)});function os(e){if(e instanceof Et){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Sr.create(os(r))}return new Et({...e._def,shape:()=>t})}else return e instanceof Hn?new Hn({...e._def,type:os(e.element)}):e instanceof Sr?Sr.create(os(e.unwrap())):e instanceof Ii?Ii.create(os(e.unwrap())):e instanceof lr?lr.create(e.items.map(t=>os(t))):e}class Et extends tt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=ht.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==Oe.object){const c=this._getOrReturnCtx(t);return Ae(c,{code:we.invalid_type,expected:Oe.object,received:c.parsedType}),Qe}const{status:r,ctx:i}=this._processInputParams(t),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Er&&this._def.unknownKeys==="strip"))for(const c in i.data)o.includes(c)||a.push(c);const l=[];for(const c of o){const u=s[c],d=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new ar(i,d,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof Er){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of a)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")a.length>0&&(Ae(i,{code:we.unrecognized_keys,keys:a}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of a){const d=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new ar(i,d,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const d=await u.key;c.push({key:d,value:await u.value,alwaysSet:u.alwaysSet})}return c}).then(c=>dn.mergeObjectSync(r,c)):dn.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return Ve.errToObj,new Et({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,s,o,a;const l=(o=(s=(i=this._def).errorMap)===null||s===void 0?void 0:s.call(i,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=Ve.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new Et({...this._def,unknownKeys:"strip"})}passthrough(){return new Et({...this._def,unknownKeys:"passthrough"})}extend(t){return new Et({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Et({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:He.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Et({...this._def,catchall:t})}pick(t){const n={};return ht.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Et({...this._def,shape:()=>n})}omit(t){const n={};return ht.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Et({...this._def,shape:()=>n})}deepPartial(){return os(this)}partial(t){const n={};return ht.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new Et({...this._def,shape:()=>n})}required(t){const n={};return ht.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Sr;)s=s._def.innerType;n[r]=s}}),new Et({...this._def,shape:()=>n})}keyof(){return Gy(ht.objectKeys(this.shape))}}Et.create=(e,t)=>new Et({shape:()=>e,unknownKeys:"strip",catchall:Er.create(),typeName:He.ZodObject,...Xe(t)}),Et.strictCreate=(e,t)=>new Et({shape:()=>e,unknownKeys:"strict",catchall:Er.create(),typeName:He.ZodObject,...Xe(t)}),Et.lazycreate=(e,t)=>new Et({shape:e,unknownKeys:"strip",catchall:Er.create(),typeName:He.ZodObject,...Xe(t)});class oo extends tt{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Zn(a.ctx.common.issues));return Ae(n,{code:we.invalid_union,unionErrors:o}),Qe}if(n.common.async)return Promise.all(r.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!s&&(s={result:u,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(l=>new Zn(l));return Ae(n,{code:we.invalid_union,unionErrors:a}),Qe}}get options(){return this._def.options}}oo.create=(e,t)=>new oo({options:e,typeName:He.ZodUnion,...Xe(t)});const rl=e=>e instanceof co?rl(e.schema):e instanceof qn?rl(e.innerType()):e instanceof uo?[e.value]:e instanceof ei?e.options:e instanceof fo?Object.keys(e.enum):e instanceof ho?rl(e._def.innerType):e instanceof io?[void 0]:e instanceof so?[null]:null;class il extends tt{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.object)return Ae(n,{code:we.invalid_type,expected:Oe.object,received:n.parsedType}),Qe;const r=this.discriminator,i=n.data[r],s=this.optionsMap.get(i);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(Ae(n,{code:we.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Qe)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const s of n){const o=rl(s.shape[t]);if(!o)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of o){if(i.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);i.set(a,s)}}return new il({typeName:He.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Xe(r)})}}function sd(e,t){const n=Yr(e),r=Yr(t);if(e===t)return{valid:!0,data:e};if(n===Oe.object&&r===Oe.object){const i=ht.objectKeys(t),s=ht.objectKeys(e).filter(a=>i.indexOf(a)!==-1),o={...e,...t};for(const a of s){const l=sd(e[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(n===Oe.array&&r===Oe.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let s=0;s<e.length;s++){const o=e[s],a=t[s],l=sd(o,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===Oe.date&&r===Oe.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class ao extends tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(s,o)=>{if(nd(s)||nd(o))return Qe;const a=sd(s.value,o.value);return a.valid?((rd(s)||rd(o))&&n.dirty(),{status:n.value,value:a.data}):(Ae(r,{code:we.invalid_intersection_types}),Qe)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ao.create=(e,t,n)=>new ao({left:e,right:t,typeName:He.ZodIntersection,...Xe(n)});class lr extends tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.array)return Ae(r,{code:we.invalid_type,expected:Oe.array,received:r.parsedType}),Qe;if(r.data.length<this._def.items.length)return Ae(r,{code:we.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Qe;!this._def.rest&&r.data.length>this._def.items.length&&(Ae(r,{code:we.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new ar(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>dn.mergeArray(n,o)):dn.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new lr({...this._def,rest:t})}}lr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new lr({items:e,typeName:He.ZodTuple,rest:null,...Xe(t)})};class lo extends tt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.object)return Ae(r,{code:we.invalid_type,expected:Oe.object,received:r.parsedType}),Qe;const i=[],s=this._def.keyType,o=this._def.valueType;for(const a in r.data)i.push({key:s._parse(new ar(r,a,r.path,a)),value:o._parse(new ar(r,r.data[a],r.path,a))});return r.common.async?dn.mergeObjectAsync(n,i):dn.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof tt?new lo({keyType:t,valueType:n,typeName:He.ZodRecord,...Xe(r)}):new lo({keyType:Wn.create(),valueType:t,typeName:He.ZodRecord,...Xe(n)})}}class sl extends tt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.map)return Ae(r,{code:we.invalid_type,expected:Oe.map,received:r.parsedType}),Qe;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,l],c)=>({key:i._parse(new ar(r,a,r.path,[c,"key"])),value:s._parse(new ar(r,l,r.path,[c,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Qe;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of o){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Qe;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),a.set(c.value,u.value)}return{status:n.value,value:a}}}}sl.create=(e,t,n)=>new sl({valueType:t,keyType:e,typeName:He.ZodMap,...Xe(n)});class Oi extends tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Oe.set)return Ae(r,{code:we.invalid_type,expected:Oe.set,received:r.parsedType}),Qe;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Ae(r,{code:we.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Ae(r,{code:we.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function o(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Qe;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const a=[...r.data.values()].map((l,c)=>s._parse(new ar(r,l,r.path,c)));return r.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,n){return new Oi({...this._def,minSize:{value:t,message:Ve.toString(n)}})}max(t,n){return new Oi({...this._def,maxSize:{value:t,message:Ve.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Oi.create=(e,t)=>new Oi({valueType:e,minSize:null,maxSize:null,typeName:He.ZodSet,...Xe(t)});class as extends tt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.function)return Ae(n,{code:we.invalid_type,expected:Oe.function,received:n.parsedType}),Qe;function r(a,l){return Xa({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Qa(),to].filter(c=>!!c),issueData:{code:we.invalid_arguments,argumentsError:l}})}function i(a,l){return Xa({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Qa(),to].filter(c=>!!c),issueData:{code:we.invalid_return_type,returnTypeError:l}})}const s={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof ls){const a=this;return gn(async function(...l){const c=new Zn([]),u=await a._def.args.parseAsync(l,s).catch(f=>{throw c.addIssue(r(l,f)),c}),d=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(d,s).catch(f=>{throw c.addIssue(i(d,f)),c})})}else{const a=this;return gn(function(...l){const c=a._def.args.safeParse(l,s);if(!c.success)throw new Zn([r(l,c.error)]);const u=Reflect.apply(o,this,c.data),d=a._def.returns.safeParse(u,s);if(!d.success)throw new Zn([i(u,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new as({...this._def,args:lr.create(t).rest(Ti.create())})}returns(t){return new as({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new as({args:t||lr.create([]).rest(Ti.create()),returns:n||Ti.create(),typeName:He.ZodFunction,...Xe(r)})}}class co extends tt{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}co.create=(e,t)=>new co({getter:e,typeName:He.ZodLazy,...Xe(t)});class uo extends tt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Ae(n,{received:n.data,code:we.invalid_literal,expected:this._def.value}),Qe}return{status:"valid",value:t.data}}get value(){return this._def.value}}uo.create=(e,t)=>new uo({value:e,typeName:He.ZodLiteral,...Xe(t)});function Gy(e,t){return new ei({values:e,typeName:He.ZodEnum,...Xe(t)})}class ei extends tt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Ae(n,{expected:ht.joinValues(r),received:n.parsedType,code:we.invalid_type}),Qe}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return Ae(n,{received:n.data,code:we.invalid_enum_value,options:r}),Qe}return gn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return ei.create(t)}exclude(t){return ei.create(this.options.filter(n=>!t.includes(n)))}}ei.create=Gy;class fo extends tt{_parse(t){const n=ht.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Oe.string&&r.parsedType!==Oe.number){const i=ht.objectValues(n);return Ae(r,{expected:ht.joinValues(i),received:r.parsedType,code:we.invalid_type}),Qe}if(n.indexOf(t.data)===-1){const i=ht.objectValues(n);return Ae(r,{received:r.data,code:we.invalid_enum_value,options:i}),Qe}return gn(t.data)}get enum(){return this._def.values}}fo.create=(e,t)=>new fo({values:e,typeName:He.ZodNativeEnum,...Xe(t)});class ls extends tt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Oe.promise&&n.common.async===!1)return Ae(n,{code:we.invalid_type,expected:Oe.promise,received:n.parsedType}),Qe;const r=n.parsedType===Oe.promise?n.data:Promise.resolve(n.data);return gn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}ls.create=(e,t)=>new ls({type:e,typeName:He.ZodPromise,...Xe(t)});class qn extends tt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===He.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,s={addIssue:o=>{Ae(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(o).then(a=>this._def.schema._parseAsync({data:a,path:r.path,parent:r})):this._def.schema._parseSync({data:o,path:r.path,parent:r})}if(i.type==="refinement"){const o=a=>{const l=i.refinement(a,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Qe:(a.status==="dirty"&&n.dirty(),o(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Qe:(a.status==="dirty"&&n.dirty(),o(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!no(o))return o;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>no(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:n.value,value:a})):o);ht.assertNever(i)}}qn.create=(e,t,n)=>new qn({schema:e,typeName:He.ZodEffects,effect:t,...Xe(n)}),qn.createWithPreprocess=(e,t,n)=>new qn({schema:t,effect:{type:"preprocess",transform:e},typeName:He.ZodEffects,...Xe(n)});class Sr extends tt{_parse(t){return this._getType(t)===Oe.undefined?gn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Sr.create=(e,t)=>new Sr({innerType:e,typeName:He.ZodOptional,...Xe(t)});class Ii extends tt{_parse(t){return this._getType(t)===Oe.null?gn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ii.create=(e,t)=>new Ii({innerType:e,typeName:He.ZodNullable,...Xe(t)});class ho extends tt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Oe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ho.create=(e,t)=>new ho({innerType:e,typeName:He.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Xe(t)});class ol extends tt{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return el(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Zn(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Zn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ol.create=(e,t)=>new ol({innerType:e,typeName:He.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Xe(t)});class al extends tt{_parse(t){if(this._getType(t)!==Oe.nan){const r=this._getOrReturnCtx(t);return Ae(r,{code:we.invalid_type,expected:Oe.nan,received:r.parsedType}),Qe}return{status:"valid",value:t.data}}}al.create=e=>new al({typeName:He.ZodNaN,...Xe(e)});const NL=Symbol("zod_brand");class Yy extends tt{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class po extends tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Qe:s.status==="dirty"?(n.dirty(),Ky(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Qe:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new po({in:t,out:n,typeName:He.ZodPipeline})}}class ll extends tt{_parse(t){const n=this._def.innerType._parse(t);return no(n)&&(n.value=Object.freeze(n.value)),n}}ll.create=(e,t)=>new ll({innerType:e,typeName:He.ZodReadonly,...Xe(t)});const Qy=(e,t={},n)=>e?ss.create().superRefine((r,i)=>{var s,o;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(o=(s=a.fatal)!==null&&s!==void 0?s:n)!==null&&o!==void 0?o:!0,c=typeof a=="string"?{message:a}:a;i.addIssue({code:"custom",...c,fatal:l})}}):ss.create(),jL={object:Et.lazycreate};var He;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(He||(He={}));const UL=(e,t={message:`Input not instance of ${e.name}`})=>Qy(n=>n instanceof e,t),rt=Wn.create,mo=Qr.create,FL=al.create,BL=Xr.create,Tr=ro.create,VL=Si.create,zL=tl.create,ZL=io.create,WL=so.create,go=ss.create,HL=Ti.create,qL=Er.create,KL=nl.create,cs=Hn.create,jt=Et.create,JL=Et.strictCreate,ti=oo.create,GL=il.create,YL=ao.create,QL=lr.create,yo=lo.create,XL=sl.create,eD=Oi.create,tD=as.create,nD=co.create,nt=uo.create,rD=ei.create,iD=fo.create,sD=ls.create,Xy=qn.create,oD=Sr.create,aD=Ii.create,lD=qn.createWithPreprocess,cD=po.create;var H=Object.freeze({__proto__:null,defaultErrorMap:to,setErrorMap:CL,getErrorMap:Qa,makeIssue:Xa,EMPTY_PATH:EL,addIssueToContext:Ae,ParseStatus:dn,INVALID:Qe,DIRTY:Ky,OK:gn,isAborted:nd,isDirty:rd,isValid:no,isAsync:el,get util(){return ht},get objectUtil(){return td},ZodParsedType:Oe,getParsedType:Yr,ZodType:tt,ZodString:Wn,ZodNumber:Qr,ZodBigInt:Xr,ZodBoolean:ro,ZodDate:Si,ZodSymbol:tl,ZodUndefined:io,ZodNull:so,ZodAny:ss,ZodUnknown:Ti,ZodNever:Er,ZodVoid:nl,ZodArray:Hn,ZodObject:Et,ZodUnion:oo,ZodDiscriminatedUnion:il,ZodIntersection:ao,ZodTuple:lr,ZodRecord:lo,ZodMap:sl,ZodSet:Oi,ZodFunction:as,ZodLazy:co,ZodLiteral:uo,ZodEnum:ei,ZodNativeEnum:fo,ZodPromise:ls,ZodEffects:qn,ZodTransformer:qn,ZodOptional:Sr,ZodNullable:Ii,ZodDefault:ho,ZodCatch:ol,ZodNaN:al,BRAND:NL,ZodBranded:Yy,ZodPipeline:po,ZodReadonly:ll,custom:Qy,Schema:tt,ZodSchema:tt,late:jL,get ZodFirstPartyTypeKind(){return He},coerce:{string:e=>Wn.create({...e,coerce:!0}),number:e=>Qr.create({...e,coerce:!0}),boolean:e=>ro.create({...e,coerce:!0}),bigint:e=>Xr.create({...e,coerce:!0}),date:e=>Si.create({...e,coerce:!0})},any:go,array:cs,bigint:BL,boolean:Tr,date:VL,discriminatedUnion:GL,effect:Xy,enum:rD,function:tD,instanceof:UL,intersection:YL,lazy:nD,literal:nt,map:XL,nan:FL,nativeEnum:iD,never:qL,null:WL,nullable:aD,number:mo,object:jt,oboolean:()=>Tr().optional(),onumber:()=>mo().optional(),optional:oD,ostring:()=>rt().optional(),pipeline:cD,preprocess:lD,promise:sD,record:yo,set:eD,strictObject:JL,string:rt,symbol:zL,transformer:Xy,tuple:QL,undefined:ZL,union:ti,unknown:HL,void:KL,NEVER:Qe,ZodIssueCode:we,quotelessJson:kL,ZodError:Zn});const{defaults:cr}=NM.messages,Kn={className:rt().describe("CSS className to apply to the message").optional()},ev=cr.audio.schema.extend({...Kn,type:nt("audio")}),od=cr.card.schema.extend({type:nt("card"),subtitle:rt().optional(),imageUrl:rt().optional(),...Kn}),uD=od.omit({type:!0}),tv=jt({items:cs(uD),...Kn,type:nt("carousel")}),nv=cr.choice.schema.extend({text:rt(),...Kn,type:nt("choice"),disableFreeText:Tr().optional()}),rv=cr.dropdown.schema.extend({text:rt(),...Kn,type:nt("dropdown")}),iv=cr.file.schema.extend({...Kn,type:nt("file")}),sv=cr.image.schema.extend({...Kn,type:nt("image")}),ov=cr.location.schema.extend({...Kn,type:nt("location")}),av=cr.markdown.schema.extend({...Kn,type:nt("markdown")}),lv=cr.text.schema.extend({...Kn,type:nt("text")}),cv=cr.video.schema.extend({...Kn,type:nt("video")}),uv=ti([ev,od,tv,nv,rv,iv,sv,ov,av,lv,cv]),dv=jt({type:nt("webchat_visibility"),data:jt({visibility:ti([nt("show"),nt("hide"),nt("toggle")])})}),fv=jt({type:nt("webchat_config"),data:jt({config:yo(go())})}),hv=jt({type:nt("custom"),data:jt({event:yo(go())})}),pv=ti([dv,fv,hv]),dD=pv,fD=jt({type:nt("message_created"),data:uv}),hD=Object.freeze(Object.defineProperty({__proto__:null,audioSchema:ev,cardSchema:od,carouselSchema:tv,choiceSchema:nv,customSchema:hv,dropdownSchema:rv,fileSchema:iv,imageSchema:sv,locationSchema:ov,markdownSchema:av,messageCreatedSchema:fD,messageSchema:uv,textSchema:lv,triggerSchema:pv,triggerSignalSchema:dD,videoSchema:cv,webchatConfigSchema:fv,webchatVisibilitySchema:dv},Symbol.toStringTag,{value:"Module"})),ur=jt({className:rt().optional(),avatarUrl:rt().url().optional()}),mv=ur.extend({type:nt("audio"),audio:rt(),title:rt().optional()}),pD=ti([jt({title:rt(),action:nt("Say something"),text:rt()}),jt({title:rt(),action:nt("Open URL"),url:rt()}),jt({title:rt(),action:nt("Postback"),payload:rt()})]),ad=ur.extend({type:nt("card"),title:rt(),subtitle:rt().optional(),image:rt().optional(),actions:cs(pD)}),gv=ur.extend({type:nt("carousel"),items:cs(ad)}),yv=ur.extend({type:nt("dropdown"),message:rt().optional(),options:cs(jt({label:rt(),value:rt()})),allowCreation:Tr().optional(),placeholderText:rt().optional(),allowMultiple:Tr().optional(),buttonText:rt().optional(),width:mo().optional(),displayInKeyboard:Tr().optional(),markdown:Tr().optional(),text:rt().optional()}),vv=ur.extend({type:nt("file"),file:rt(),title:rt().optional()}),bv=ur.extend({type:nt("image"),image:rt()}),wv=ur.extend({type:nt("location"),latitude:mo(),longitude:mo(),address:rt().optional(),title:rt().optional()}),xv=ur.extend({type:nt("single-choice"),text:rt(),disableFreeText:Tr().optional(),choices:cs(jt({title:rt(),value:rt()}))}),_v=ur.extend({type:nt("text"),text:rt(),markdown:Tr().optional()}),kv=ur.extend({type:nt("video"),video:rt(),title:rt().optional()}),Cv=jt({type:nt("quick_reply"),text:rt(),payload:rt().optional()}),cl=ti([mv,ad,gv,yv,vv,bv,wv,xv,_v,kv,Cv]),Ev=jt({type:nt("webchat-visibility"),visibility:ti([nt("show"),nt("hide"),nt("toggle")])}),Sv=jt({type:nt("webchat-config"),config:yo(go())}),Tv=jt({type:nt("custom-event"),event:yo(go())}),Ov=ti([Ev,Sv,Tv]),mD=jt({type:nt("trigger"),trigger:Ov}),gD=Object.freeze(Object.defineProperty({__proto__:null,audioSchema:mv,cardSchema:ad,carouselSchame:gv,customEventSchema:Tv,dropdownSchema:yv,fileSchema:vv,imageSchema:bv,locationSchema:wv,messageSchema:cl,messageSignalSchema:cl,quickReplySchema:Cv,singleChoiceSchema:xv,textSchema:_v,triggerSchema:Ov,triggerSignalSchema:mD,videoSchema:kv,webchatConfigSchema:Sv,webchatVisibilitySchema:Ev},Symbol.toStringTag,{value:"Module"})),Iv=e=>({type:"card",title:e.title,subtitle:e.subtitle,image:e.imageUrl,actions:e.actions.map(yD)}),yD=e=>{switch(e.action){case"postback":return{title:e.label,action:"Postback",payload:e.value};case"url":return{title:e.label,action:"Open URL",url:e.value};case"say":return{title:e.label,action:"Say something",text:e.value};default:throw new Error(`Unknown action type ${e.action}`)}},Pv=e=>({...e,type:"audio",audio:e.audioUrl}),Av=e=>Iv(e),Rv=e=>({...e,type:"carousel",items:e.items.map(Iv)}),$v=e=>({...e,type:"single-choice",text:e.text,choices:e.options.map(t=>({title:t.label,value:t.value})),disableFreeText:e.disableFreeText}),Mv=e=>({...e,type:"dropdown",message:e.text,options:e.options.map(t=>({label:t.label,value:t.value}))}),Lv=e=>({...e,type:"file",file:e.fileUrl,title:e.title}),Dv=e=>({...e,type:"image",image:e.imageUrl}),Nv=e=>({...e,type:"location",latitude:e.latitude,longitude:e.longitude}),jv=e=>({...e,type:"text",text:e.markdown,markdown:!0}),Uv=e=>({...e,type:"text",text:e.text,markdown:!0}),Fv=e=>({...e,type:"video",video:e.videoUrl}),vD=e=>{switch(e.type){case"audio":return Pv(e);case"card":return Av(e);case"carousel":return Rv(e);case"choice":return $v(e);case"dropdown":return Mv(e);case"file":return Lv(e);case"image":return Dv(e);case"location":return Nv(e);case"markdown":return jv(e);case"text":return Uv(e);case"video":return Fv(e);default:throw new Error("Unsuported message type")}},Bv=e=>({type:"webchat-visibility",visibility:e.data.visibility}),Vv=e=>({type:"webchat-config",config:e.data.config}),zv=e=>({type:"custom-event",event:e.data.event}),bD=Object.freeze(Object.defineProperty({__proto__:null,audioAdapter:Pv,cardAdapter:Av,carouselAdapter:Rv,choiceAdapter:$v,customAdapter:zv,dropdownAdapter:Mv,fileAdapter:Lv,imageAdapter:Dv,locationAdapter:Nv,markdownAdapter:jv,messageAdapter:vD,textAdapter:Uv,triggerAdapter:e=>{switch(e.type){case"webchat_visibility":return Bv(e);case"webchat_config":return Vv(e);case"custom":return zv(e);default:throw new Error("unknown trigger type")}},videoAdapter:Fv,webchatConfigAdapter:Vv,webchatVisibilityAdapter:Bv},Symbol.toStringTag,{value:"Module"})),Zv=e=>({type:"card",title:e.title,subtitle:e.subtitle,imageUrl:e.image,actions:e.actions.map(wD)}),wD=e=>{switch(e.action){case"Postback":return{label:e.title,action:"postback",value:e.payload};case"Open URL":return{label:e.title,action:"url",value:e.url};case"Say something":return{label:e.title,action:"say",value:e.text};default:throw new Error("Unknown action type")}},xD=e=>({...e,type:"audio",audioUrl:e.audio}),_D=e=>Zv(e),kD=e=>({...e,type:"carousel",items:e.items.map(Zv)}),CD=e=>({...e,type:"dropdown",text:e.message??"",options:e.options.map(t=>({label:t.label,value:t.value}))}),ED=e=>({...e,type:"file",fileUrl:e.file,title:e.title}),SD=e=>({...e,type:"image",imageUrl:e.image}),TD=e=>({...e,type:"location",latitude:e.latitude,longitude:e.longitude}),OD=e=>({...e,type:"choice",text:e.text,options:e.choices.map(t=>({label:t.title,value:t.value})),disableFreeText:e.disableFreeText}),ID=e=>({...e,type:"text",text:e.text}),PD=e=>({...e,type:"video",videoUrl:e.video}),AD=e=>({...e,type:"text",text:e.payload??e.text}),RD=Object.freeze(Object.defineProperty({__proto__:null,messaging:gD,messagingToWebChat:Object.freeze(Object.defineProperty({__proto__:null,messageAdapter:e=>{switch(e.type){case"audio":return xD(e);case"card":return _D(e);case"carousel":return kD(e);case"dropdown":return CD(e);case"file":return ED(e);case"image":return SD(e);case"location":return TD(e);case"single-choice":return OD(e);case"text":return ID(e);case"video":return PD(e);case"quick_reply":return AD(e);default:throw new Error("Unsuported message type")}}},Symbol.toStringTag,{value:"Module"})),webchat:hD,webchatToMessaging:bD},Symbol.toStringTag,{value:"Module"}));let ul;const $D=new Uint8Array(16);function MD(){if(!ul&&(ul=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ul))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ul($D)}const rn=[];for(let e=0;e<256;++e)rn.push((e+256).toString(16).slice(1));function LD(e,t=0){return rn[e[t+0]]+rn[e[t+1]]+rn[e[t+2]]+rn[e[t+3]]+"-"+rn[e[t+4]]+rn[e[t+5]]+"-"+rn[e[t+6]]+rn[e[t+7]]+"-"+rn[e[t+8]]+rn[e[t+9]]+"-"+rn[e[t+10]]+rn[e[t+11]]+rn[e[t+12]]+rn[e[t+13]]+rn[e[t+14]]+rn[e[t+15]]}const Wv={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function DD(e,t,n){if(Wv.randomUUID&&!t&&!e)return Wv.randomUUID();e=e||{};const r=e.random||(e.rng||MD)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(let i=0;i<16;++i)t[n+i]=r[i];return t}return LD(r)}const dl=e=>({block:e,type:"bubble"}),ND=e=>e.action==="Say something"?{type:"button",variant:"action",text:e.title,buttonValue:e.text,reusable:!0}:e.action==="Open URL"?{type:"button",variant:"link",text:e.title,buttonValue:e.url,reusable:!0}:{type:"button",variant:"action",text:e.title,buttonValue:e.payload,reusable:!0},Hv=({title:e,image:t,actions:n,subtitle:r})=>{const i=[];return t&&i.push({type:"image",url:t}),e&&i.push({type:"text",text:`## ${e}`}),r&&i.push({type:"text",text:r}),n.length>0&&i.push({type:"row",blocks:n.map(ND)}),{type:"column",horizontalAlignment:"center",blocks:[...i]}},jD=({choices:e,text:t})=>{const n=DD(),r=dl({type:"text",text:t});return e.length===0?r:{type:"column",horizontalAlignment:"left",blocks:[r,{type:"row",blocks:e.map(({title:i,value:s})=>({type:"button",variant:"action",text:i,buttonValue:s,groupId:n}))}]}},UD=({options:e,text:t})=>{const n=[{type:"dropdown",label:t??"Select an option",options:e}];return t&&n.unshift({type:"text",text:t}),{type:"column",blocks:n}},qv=({type:e,audio:t})=>({type:e,url:t}),Kv=e=>dl(Hv(e)),Jv=({items:e})=>({type:"carousel",blocks:e.map(Hv)}),Gv=e=>jD(e),Yv=e=>dl(UD(e)),Qv=({file:e,...t})=>({url:e,...t}),Xv=({type:e,image:t})=>({type:e,url:t}),eb=({type:e,latitude:t,longitude:n,title:r,address:i})=>({type:e,latitude:t,longitude:n,title:r??i??"View on map"}),ld=({type:e,text:t})=>dl({type:e,text:t}),tb=({type:e,video:t})=>({type:e,url:t}),nb=e=>{switch(e.type){case"audio":return qv(e);case"card":return Kv(e);case"carousel":return Jv(e);case"single-choice":return Gv(e);case"dropdown":return Yv(e);case"file":return Qv(e);case"image":return Xv(e);case"location":return eb(e);case"text":return ld(e);case"video":return tb(e);default:throw new Error("Unsuported message type")}},{webchatToMessaging:Jn}=RD,FD=e=>{const t=Jn.audioAdapter(e);return qv(t)},BD=e=>{const t=Jn.cardAdapter(e);return Kv(t)},VD=e=>{const t=Jn.carouselAdapter(e);return Jv(t)},zD=e=>{const t=Jn.choiceAdapter(e);return Gv(t)},ZD=e=>{const t=Jn.dropdownAdapter(e);return Yv(t)},WD=e=>{const t=Jn.fileAdapter(e);return Qv(t)},HD=e=>{const t=Jn.imageAdapter(e);return Xv(t)},qD=e=>{const t=Jn.locationAdapter(e);return eb(t)},KD=e=>{const t=Jn.markdownAdapter(e);return ld(t)},JD=e=>{const t=Jn.textAdapter(e);return ld(t)},GD=e=>{const t=Jn.videoAdapter(e);return tb(t)},YD=e=>{switch(e.type){case"audio":return FD(e);case"card":return BD(e);case"carousel":return VD(e);case"choice":return zD(e);case"dropdown":return ZD(e);case"file":return WD(e);case"image":return HD(e);case"location":return qD(e);case"markdown":return KD(e);case"text":return JD(e);case"video":return GD(e);default:throw new Error("Unsuported message type")}};class rb{constructor(t){E(this,"socket");E(this,"clientId");E(this,"userId");E(this,"conversationId");E(this,"userToken");E(this,"connected",!1);E(this,"emitter");E(this,"on");E(this,"mode","messaging");this.socket=new Dm.MessagingSocket(t),this.emitter=new Fl,this.clientId=t.clientId,this.on=this.emitter.on.bind(this.emitter),this.socket.on("message",n=>{const r=n.payload;if(r.type==="trigger")switch(r.trigger.type){case"webchat-visibility":this.emitter.emit("webchatVisibility",r.trigger.visibility);break;case"webchat-config":this.emitter.emit("webchatConfig",r.trigger.config);break;case"custom-event":this.emitter.emit("customEvent",r.trigger.event);break}else{const i=cl.parse(r),s=nb(i);this.emitter.emit("message",{...n,payload:s})}}),this.socket.on("conversation",n=>{this.emitter.emit("conversation",n)})}async connect(t,n){if(this.connected)return;this.connected=!0;const r=await this.socket.connect(t,n).catch(i=>{throw this.connected=!1,i});return this.userId=r.userId,this.userToken=r.userToken,r}async disconnect(){await this.socket.disconnect(),this.connected=!1}async sendMessage(t){this.conversationId||await this.newConversation(),await this.socket.sendText(t),this.emitter.emit("messageSent",t)}async sendEvent(t){this.conversationId||await this.newConversation(),await this.socket.sendPayload({type:"trigger",payload:t})}async switchConversation(t){await this.socket.switchConversation(t),this.conversationId=t}async conversationExists(t){return(await this.socket.listConversations()).some(r=>r.id===t)}async newConversation(){const{id:t}=await this.socket.createConversation();await this.socket.startConversation(),this.conversationId=t}async listMessages(t){return(await this.socket.listMessages(t)).map(r=>{const i=cl.parse(r.payload),s=nb(i);return{...r,payload:s}})}}function ib(e,t){return function(){return e.apply(t,arguments)}}const{toString:sb}=Object.prototype,{getPrototypeOf:cd}=Object,ud=(e=>t=>{const n=sb.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Or=e=>(e=e.toLowerCase(),t=>ud(t)===e),fl=e=>t=>typeof t===e,{isArray:us}=Array,vo=fl("undefined");function QD(e){return e!==null&&!vo(e)&&e.constructor!==null&&!vo(e.constructor)&&Pi(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ob=Or("ArrayBuffer");function XD(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ob(e.buffer),t}const eN=fl("string"),Pi=fl("function"),ab=fl("number"),dd=e=>e!==null&&typeof e=="object",tN=e=>e===!0||e===!1,hl=e=>{if(ud(e)!=="object")return!1;const t=cd(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},nN=Or("Date"),rN=Or("File"),iN=Or("Blob"),sN=Or("FileList"),oN=e=>dd(e)&&Pi(e.pipe),aN=e=>{const t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||sb.call(e)===t||Pi(e.toString)&&e.toString()===t)},lN=Or("URLSearchParams"),cN=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function bo(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),us(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const s=n?Object.getOwnPropertyNames(e):Object.keys(e),o=s.length;let a;for(r=0;r<o;r++)a=s[r],t.call(null,e[a],a,e)}}function lb(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const cb=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),ub=e=>!vo(e)&&e!==cb;function fd(){const{caseless:e}=ub(this)&&this||{},t={},n=(r,i)=>{const s=e&&lb(t,i)||i;hl(t[s])&&hl(r)?t[s]=fd(t[s],r):hl(r)?t[s]=fd({},r):us(r)?t[s]=r.slice():t[s]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&bo(arguments[r],n);return t}const uN=(e,t,n,{allOwnKeys:r}={})=>(bo(t,(i,s)=>{n&&Pi(i)?e[s]=ib(i,n):e[s]=i},{allOwnKeys:r}),e),dN=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),fN=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},hN=(e,t,n,r)=>{let i,s,o;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)o=i[s],(!r||r(o,e,t))&&!a[o]&&(t[o]=e[o],a[o]=!0);e=n!==!1&&cd(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},pN=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},mN=e=>{if(!e)return null;if(us(e))return e;let t=e.length;if(!ab(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},gN=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&cd(Uint8Array)),yN=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const s=i.value;t.call(e,s[0],s[1])}},vN=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},bN=Or("HTMLFormElement"),wN=e=>e.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),db=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),xN=Or("RegExp"),fb=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};bo(n,(i,s)=>{t(i,s,e)!==!1&&(r[s]=i)}),Object.defineProperties(e,r)},te={isArray:us,isArrayBuffer:ob,isBuffer:QD,isFormData:aN,isArrayBufferView:XD,isString:eN,isNumber:ab,isBoolean:tN,isObject:dd,isPlainObject:hl,isUndefined:vo,isDate:nN,isFile:rN,isBlob:iN,isRegExp:xN,isFunction:Pi,isStream:oN,isURLSearchParams:lN,isTypedArray:gN,isFileList:sN,forEach:bo,merge:fd,extend:uN,trim:cN,stripBOM:dN,inherits:fN,toFlatObject:hN,kindOf:ud,kindOfTest:Or,endsWith:pN,toArray:mN,forEachEntry:yN,matchAll:vN,isHTMLForm:bN,hasOwnProperty:db,hasOwnProp:db,reduceDescriptors:fb,freezeMethods:e=>{fb(e,(t,n)=>{if(Pi(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Pi(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},toObjectSet:(e,t)=>{const n={},r=i=>{i.forEach(s=>{n[s]=!0})};return us(e)?r(e):r(String(e).split(t)),n},toCamelCase:wN,noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:lb,global:cb,isContextDefined:ub,toJSONObject:e=>{const t=new Array(10),n=(r,i)=>{if(dd(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const s=us(r)?[]:{};return bo(r,(o,a)=>{const l=n(o,i+1);!vo(l)&&(s[a]=l)}),t[i]=void 0,s}}return r};return n(e,0)}};function dt(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}te.inherits(dt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:te.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const hb=dt.prototype,pb={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{pb[e]={value:e}}),Object.defineProperties(dt,pb),Object.defineProperty(hb,"isAxiosError",{value:!0}),dt.from=(e,t,n,r,i,s)=>{const o=Object.create(hb);return te.toFlatObject(e,o,function(l){return l!==Error.prototype},a=>a!=="isAxiosError"),dt.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};var _N=typeof self=="object"?self.FormData:window.FormData;const kN=ai(_N);function hd(e){return te.isPlainObject(e)||te.isArray(e)}function mb(e){return te.endsWith(e,"[]")?e.slice(0,-2):e}function gb(e,t,n){return e?e.concat(t).map(function(i,s){return i=mb(i),!n&&s?"["+i+"]":i}).join(n?".":""):t}function CN(e){return te.isArray(e)&&!e.some(hd)}const EN=te.toFlatObject(te,{},null,function(t){return/^is[A-Z]/.test(t)});function SN(e){return e&&te.isFunction(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator]}function pl(e,t,n){if(!te.isObject(e))throw new TypeError("target must be an object");t=t||new(kN||FormData),n=te.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!te.isUndefined(y[m])});const r=n.metaTokens,i=n.visitor||u,s=n.dots,o=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&SN(t);if(!te.isFunction(i))throw new TypeError("visitor must be a function");function c(p){if(p===null)return"";if(te.isDate(p))return p.toISOString();if(!l&&te.isBlob(p))throw new dt("Blob is not supported. Use a Buffer instead.");return te.isArrayBuffer(p)||te.isTypedArray(p)?l&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function u(p,m,y){let v=p;if(p&&!y&&typeof p=="object"){if(te.endsWith(m,"{}"))m=r?m:m.slice(0,-2),p=JSON.stringify(p);else if(te.isArray(p)&&CN(p)||te.isFileList(p)||te.endsWith(m,"[]")&&(v=te.toArray(p)))return m=mb(m),v.forEach(function(x,I){!(te.isUndefined(x)||x===null)&&t.append(o===!0?gb([m],I,s):o===null?m:m+"[]",c(x))}),!1}return hd(p)?!0:(t.append(gb(y,m,s),c(p)),!1)}const d=[],h=Object.assign(EN,{defaultVisitor:u,convertValue:c,isVisitable:hd});function f(p,m){if(!te.isUndefined(p)){if(d.indexOf(p)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(p),te.forEach(p,function(v,b){(!(te.isUndefined(v)||v===null)&&i.call(t,v,te.isString(b)?b.trim():b,m,h))===!0&&f(v,m?m.concat(b):[b])}),d.pop()}}if(!te.isObject(e))throw new TypeError("data must be an object");return f(e),t}function yb(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function pd(e,t){this._pairs=[],e&&pl(e,this,t)}const vb=pd.prototype;vb.append=function(t,n){this._pairs.push([t,n])},vb.toString=function(t){const n=t?function(r){return t.call(this,r,yb)}:yb;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function TN(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function bb(e,t,n){if(!t)return e;const r=n&&n.encode||TN,i=n&&n.serialize;let s;if(i?s=i(t,n):s=te.isURLSearchParams(t)?t.toString():new pd(t,n).toString(r),s){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}class ON{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){te.forEach(this.handlers,function(r){r!==null&&t(r)})}}const wb=ON,xb={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},IN=typeof URLSearchParams<"u"?URLSearchParams:pd,PN=FormData,AN=(()=>{let e;return typeof navigator<"u"&&((e=navigator.product)==="ReactNative"||e==="NativeScript"||e==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),RN=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),dr={isBrowser:!0,classes:{URLSearchParams:IN,FormData:PN,Blob},isStandardBrowserEnv:AN,isStandardBrowserWebWorkerEnv:RN,protocols:["http","https","file","blob","url","data"]};function $N(e,t){return pl(e,new dr.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,s){return dr.isNode&&te.isBuffer(n)?(this.append(r,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},t))}function MN(e){return te.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function LN(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],t[s]=e[s];return t}function _b(e){function t(n,r,i,s){let o=n[s++];const a=Number.isFinite(+o),l=s>=n.length;return o=!o&&te.isArray(i)?i.length:o,l?(te.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!a):((!i[o]||!te.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],s)&&te.isArray(i[o])&&(i[o]=LN(i[o])),!a)}if(te.isFormData(e)&&te.isFunction(e.entries)){const n={};return te.forEachEntry(e,(r,i)=>{t(MN(r),i,n,0)}),n}return null}const DN={"Content-Type":void 0};function NN(e,t,n){if(te.isString(e))try{return(t||JSON.parse)(e),te.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const ml={transitional:xb,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,s=te.isObject(t);if(s&&te.isHTMLForm(t)&&(t=new FormData(t)),te.isFormData(t))return i&&i?JSON.stringify(_b(t)):t;if(te.isArrayBuffer(t)||te.isBuffer(t)||te.isStream(t)||te.isFile(t)||te.isBlob(t))return t;if(te.isArrayBufferView(t))return t.buffer;if(te.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(s){if(r.indexOf("application/x-www-form-urlencoded")>-1)return $N(t,this.formSerializer).toString();if((a=te.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return pl(a?{"files[]":t}:t,l&&new l,this.formSerializer)}}return s||i?(n.setContentType("application/json",!1),NN(t)):t}],transformResponse:[function(t){const n=this.transitional||ml.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(t&&te.isString(t)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(o)throw a.name==="SyntaxError"?dt.from(a,dt.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:dr.classes.FormData,Blob:dr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};te.forEach(["delete","get","head"],function(t){ml.headers[t]={}}),te.forEach(["post","put","patch"],function(t){ml.headers[t]=te.merge(DN)});const md=ml,jN=te.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),UN=e=>{const t={};let n,r,i;return e&&e.split(`
|
|
278
|
+
`).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||t[n]&&jN[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},kb=Symbol("internals");function wo(e){return e&&String(e).trim().toLowerCase()}function gl(e){return e===!1||e==null?e:te.isArray(e)?e.map(gl):String(e)}function FN(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}function BN(e){return/^[-_a-zA-Z]+$/.test(e.trim())}function Cb(e,t,n,r){if(te.isFunction(r))return r.call(this,t,n);if(te.isString(t)){if(te.isString(r))return t.indexOf(r)!==-1;if(te.isRegExp(r))return r.test(t)}}function VN(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function zN(e,t){const n=te.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,s,o){return this[r].call(this,t,i,s,o)},configurable:!0})})}class yl{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function s(a,l,c){const u=wo(l);if(!u)throw new Error("header name must be a non-empty string");const d=te.findKey(i,u);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||l]=gl(a))}const o=(a,l)=>te.forEach(a,(c,u)=>s(c,u,l));return te.isPlainObject(t)||t instanceof this.constructor?o(t,n):te.isString(t)&&(t=t.trim())&&!BN(t)?o(UN(t),n):t!=null&&s(n,t,r),this}get(t,n){if(t=wo(t),t){const r=te.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return FN(i);if(te.isFunction(n))return n.call(this,i,r);if(te.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=wo(t),t){const r=te.findKey(this,t);return!!(r&&(!n||Cb(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function s(o){if(o=wo(o),o){const a=te.findKey(r,o);a&&(!n||Cb(r,r[a],a,n))&&(delete r[a],i=!0)}}return te.isArray(t)?t.forEach(s):s(t),i}clear(){return Object.keys(this).forEach(this.delete.bind(this))}normalize(t){const n=this,r={};return te.forEach(this,(i,s)=>{const o=te.findKey(r,s);if(o){n[o]=gl(i),delete n[s];return}const a=t?VN(s):String(s).trim();a!==s&&delete n[s],n[a]=gl(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return te.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&te.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
279
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[kb]=this[kb]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=wo(o);r[a]||(zN(i,o),r[a]=!0)}return te.isArray(t)?t.forEach(s):s(t),this}}yl.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]),te.freezeMethods(yl.prototype),te.freezeMethods(yl);const Ir=yl;function gd(e,t){const n=this||md,r=t||n,i=Ir.from(r.headers);let s=r.data;return te.forEach(e,function(a){s=a.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function Eb(e){return!!(e&&e.__CANCEL__)}function xo(e,t,n){dt.call(this,e??"canceled",dt.ERR_CANCELED,t,n),this.name="CanceledError"}te.inherits(xo,dt,{__CANCEL__:!0});const ZN=null;function WN(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new dt("Request failed with status code "+n.status,[dt.ERR_BAD_REQUEST,dt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const HN=dr.isStandardBrowserEnv?function(){return{write:function(n,r,i,s,o,a){const l=[];l.push(n+"="+encodeURIComponent(r)),te.isNumber(i)&&l.push("expires="+new Date(i).toGMTString()),te.isString(s)&&l.push("path="+s),te.isString(o)&&l.push("domain="+o),a===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(n){const r=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(n){this.write(n,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function qN(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function KN(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}function Sb(e,t){return e&&!qN(t)?KN(e,t):t}const JN=dr.isStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(s){let o=s;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(o){const a=te.isString(o)?i(o):o;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function GN(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function YN(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,s=0,o;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=r[s];o||(o=c),n[i]=l,r[i]=c;let d=s,h=0;for(;d!==i;)h+=n[d++],d=d%e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),c-o<t)return;const f=u&&c-u;return f?Math.round(h*1e3/f):void 0}}function Tb(e,t){let n=0;const r=YN(50,250);return i=>{const s=i.loaded,o=i.lengthComputable?i.total:void 0,a=s-n,l=r(a),c=s<=o;n=s;const u={loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&c?(o-s)/l:void 0,event:i};u[t?"download":"upload"]=!0,e(u)}}const vl={http:ZN,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){let i=e.data;const s=Ir.from(e.headers).normalize(),o=e.responseType;let a;function l(){e.cancelToken&&e.cancelToken.unsubscribe(a),e.signal&&e.signal.removeEventListener("abort",a)}te.isFormData(i)&&(dr.isStandardBrowserEnv||dr.isStandardBrowserWebWorkerEnv)&&s.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const f=e.auth.username||"",p=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";s.set("Authorization","Basic "+btoa(f+":"+p))}const u=Sb(e.baseURL,e.url);c.open(e.method.toUpperCase(),bb(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout;function d(){if(!c)return;const f=Ir.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),m={data:!o||o==="text"||o==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:f,config:e,request:c};WN(function(v){n(v),l()},function(v){r(v),l()},m),c=null}if("onloadend"in c?c.onloadend=d:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(d)},c.onabort=function(){c&&(r(new dt("Request aborted",dt.ECONNABORTED,e,c)),c=null)},c.onerror=function(){r(new dt("Network Error",dt.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let p=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const m=e.transitional||xb;e.timeoutErrorMessage&&(p=e.timeoutErrorMessage),r(new dt(p,m.clarifyTimeoutError?dt.ETIMEDOUT:dt.ECONNABORTED,e,c)),c=null},dr.isStandardBrowserEnv){const f=(e.withCredentials||JN(u))&&e.xsrfCookieName&&HN.read(e.xsrfCookieName);f&&s.set(e.xsrfHeaderName,f)}i===void 0&&s.setContentType(null),"setRequestHeader"in c&&te.forEach(s.toJSON(),function(p,m){c.setRequestHeader(m,p)}),te.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),o&&o!=="json"&&(c.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&c.addEventListener("progress",Tb(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",Tb(e.onUploadProgress)),(e.cancelToken||e.signal)&&(a=f=>{c&&(r(!f||f.type?new xo(null,e,c):f),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(a),e.signal&&(e.signal.aborted?a():e.signal.addEventListener("abort",a)));const h=GN(u);if(h&&dr.protocols.indexOf(h)===-1){r(new dt("Unsupported protocol "+h+":",dt.ERR_BAD_REQUEST,e));return}c.send(i||null)})}};te.forEach(vl,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const QN={getAdapter:e=>{e=te.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let i=0;i<t&&(n=e[i],!(r=te.isString(n)?vl[n.toLowerCase()]:n));i++);if(!r)throw r===!1?new dt(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(te.hasOwnProp(vl,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`);if(!te.isFunction(r))throw new TypeError("adapter is not a function");return r},adapters:vl};function yd(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new xo(null,e)}function Ob(e){return yd(e),e.headers=Ir.from(e.headers),e.data=gd.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),QN.getAdapter(e.adapter||md.adapter)(e).then(function(r){return yd(e),r.data=gd.call(e,e.transformResponse,r),r.headers=Ir.from(r.headers),r},function(r){return Eb(r)||(yd(e),r&&r.response&&(r.response.data=gd.call(e,e.transformResponse,r.response),r.response.headers=Ir.from(r.response.headers))),Promise.reject(r)})}const Ib=e=>e instanceof Ir?e.toJSON():e;function ds(e,t){t=t||{};const n={};function r(c,u,d){return te.isPlainObject(c)&&te.isPlainObject(u)?te.merge.call({caseless:d},c,u):te.isPlainObject(u)?te.merge({},u):te.isArray(u)?u.slice():u}function i(c,u,d){if(te.isUndefined(u)){if(!te.isUndefined(c))return r(void 0,c,d)}else return r(c,u,d)}function s(c,u){if(!te.isUndefined(u))return r(void 0,u)}function o(c,u){if(te.isUndefined(u)){if(!te.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,d){if(d in t)return r(c,u);if(d in e)return r(void 0,c)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,u)=>i(Ib(c),Ib(u),!0)};return te.forEach(Object.keys(e).concat(Object.keys(t)),function(u){const d=l[u]||i,h=d(e[u],t[u],u);te.isUndefined(h)&&d!==a||(n[u]=h)}),n}const Pb="1.2.5",vd={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{vd[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Ab={};vd.transitional=function(t,n,r){function i(s,o){return"[Axios v"+Pb+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,a)=>{if(t===!1)throw new dt(i(o," has been removed"+(n?" in "+n:"")),dt.ERR_DEPRECATED);return n&&!Ab[o]&&(Ab[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,o,a):!0}};function XN(e,t,n){if(typeof e!="object")throw new dt("options must be an object",dt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const s=r[i],o=t[s];if(o){const a=e[s],l=a===void 0||o(a,s,e);if(l!==!0)throw new dt("option "+s+" must be "+l,dt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new dt("Unknown option "+s,dt.ERR_BAD_OPTION)}}const bd={assertOptions:XN,validators:vd},ni=bd.validators;class bl{constructor(t){this.defaults=t,this.interceptors={request:new wb,response:new wb}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ds(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&bd.assertOptions(r,{silentJSONParsing:ni.transitional(ni.boolean),forcedJSONParsing:ni.transitional(ni.boolean),clarifyTimeoutError:ni.transitional(ni.boolean)},!1),i!==void 0&&bd.assertOptions(i,{encode:ni.function,serialize:ni.function},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o;o=s&&te.merge(s.common,s[n.method]),o&&te.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),n.headers=Ir.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,h;if(!l){const p=[Ob.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),h=p.length,u=Promise.resolve(n);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let f=n;for(d=0;d<h;){const p=a[d++],m=a[d++];try{f=p(f)}catch(y){m.call(this,y);break}}try{u=Ob.call(this,f)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(t){t=ds(this.defaults,t);const n=Sb(t.baseURL,t.url);return bb(n,t.params,t.paramsSerializer)}}te.forEach(["delete","get","head","options"],function(t){bl.prototype[t]=function(n,r){return this.request(ds(r||{},{method:t,url:n,data:(r||{}).data}))}}),te.forEach(["post","put","patch"],function(t){function n(r){return function(s,o,a){return this.request(ds(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}bl.prototype[t]=n(),bl.prototype[t+"Form"]=n(!0)});const wl=bl;class wd{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},t(function(s,o,a){r.reason||(r.reason=new xo(s,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new wd(function(i){t=i}),cancel:t}}}const e2=wd;function t2(e){return function(n){return e.apply(null,n)}}function n2(e){return te.isObject(e)&&e.isAxiosError===!0}const xd={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(xd).forEach(([e,t])=>{xd[t]=e});const r2=xd;function Rb(e){const t=new wl(e),n=ib(wl.prototype.request,t);return te.extend(n,wl.prototype,t,{allOwnKeys:!0}),te.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return Rb(ds(e,i))},n}const zt=Rb(md);zt.Axios=wl,zt.CanceledError=xo,zt.CancelToken=e2,zt.isCancel=Eb,zt.VERSION=Pb,zt.toFormData=pl,zt.AxiosError=dt,zt.Cancel=zt.CanceledError,zt.all=function(t){return Promise.all(t)},zt.spread=t2,zt.isAxiosError=n2,zt.mergeConfig=ds,zt.AxiosHeaders=Ir,zt.formToJSON=e=>_b(te.isHTMLForm(e)?new FormData(e):e),zt.HttpStatusCode=r2,zt.default=zt;const Pt=zt,Ut="https://webchat.botpress.cloud".replace(/\/+$/,"");class i2{constructor(t,n=Ut,r=Pt){E(this,"configuration");this.basePath=n,this.axios=r,t&&(this.configuration=t,this.basePath=t.basePath||this.basePath)}}class s2 extends Error{constructor(t,n){super(n),this.field=t,this.name="RequiredError"}}const Zt="https://example.com",pt=function(e,t,n){if(n==null)throw new s2(t,`Required parameter ${t} was null or undefined when calling ${e}.`)};function _d(e,t,n=""){t!=null&&(typeof t=="object"?Array.isArray(t)?t.forEach(r=>_d(e,r,n)):Object.keys(t).forEach(r=>_d(e,t[r],`${n}${n!==""?".":""}${r}`)):e.has(n)?e.append(n,t):e.set(n,t))}const Wt=function(e,...t){const n=new URLSearchParams(e.search);_d(n,t),e.search=n.toString()},fs=function(e,t,n){const r=typeof e!="string";return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(e!==void 0?e:{}):e||""},Ht=function(e){return e.pathname+e.search+e.hash},qt=function(e,t,n,r){return(i=t,s=n)=>{const o={...e.options,url:((r==null?void 0:r.basePath)||s)+e.url};return i.request(o)}},o2=function(e){return{addParticipant:async(t,n,r,i={})=>{pt("addParticipant","xUserKey",t),pt("addParticipant","id",n);const s="/v1/conversations/{id}/participants".replace("{id}",encodeURIComponent(String(n))),o=new URL(s,Zt);let a;e&&(a=e.baseOptions);const l={method:"POST",...a,...i},c={},u={};t!=null&&(c["x-user-key"]=String(t)),c["Content-Type"]="application/json",Wt(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},l.data=fs(r,l,e),{url:Ht(o),options:l}},createConversation:async(t,n,r={})=>{pt("createConversation","xUserKey",t);const i="/v1/conversations",s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"POST",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),l["Content-Type"]="application/json",Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=fs(n,a,e),{url:Ht(s),options:a}},createEvent:async(t,n,r={})=>{pt("createEvent","xUserKey",t);const i="/v1/events",s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"POST",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),l["Content-Type"]="application/json",Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=fs(n,a,e),{url:Ht(s),options:a}},createMessage:async(t,n,r={})=>{pt("createMessage","xUserKey",t);const i="/v1/messages",s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"POST",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),l["Content-Type"]="application/json",Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=fs(n,a,e),{url:Ht(s),options:a}},createUser:async(t,n={})=>{const r="/v1/users",i=new URL(r,Zt);let s;e&&(s=e.baseOptions);const o={method:"POST",...s,...n},a={},l={};a["Content-Type"]="application/json",Wt(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},o.data=fs(t,o,e),{url:Ht(i),options:o}},deleteConversation:async(t,n,r={})=>{pt("deleteConversation","xUserKey",t),pt("deleteConversation","id",n);const i="/v1/conversations/{id}".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"DELETE",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:Ht(s),options:a}},deleteMessage:async(t,n,r={})=>{pt("deleteMessage","xUserKey",t),pt("deleteMessage","id",n);const i="/v1/messages/{id}".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"DELETE",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:Ht(s),options:a}},deleteUser:async(t,n={})=>{pt("deleteUser","xUserKey",t);const r="/v1/users/me",i=new URL(r,Zt);let s;e&&(s=e.baseOptions);const o={method:"DELETE",...s,...n},a={},l={};t!=null&&(a["x-user-key"]=String(t)),Wt(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},{url:Ht(i),options:o}},getConversation:async(t,n,r={})=>{pt("getConversation","xUserKey",t),pt("getConversation","id",n);const i="/v1/conversations/{id}".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:Ht(s),options:a}},getEvent:async(t,n,r={})=>{pt("getEvent","xUserKey",t),pt("getEvent","id",n);const i="/v1/events/{id}".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:Ht(s),options:a}},getMessage:async(t,n,r={})=>{pt("getMessage","xUserKey",t),pt("getMessage","id",n);const i="/v1/messages/{id}".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:Ht(s),options:a}},getParticipant:async(t,n,r,i={})=>{pt("getParticipant","xUserKey",t),pt("getParticipant","id",n),pt("getParticipant","userId",r);const s="/v1/conversations/{id}/participants/{userId}".replace("{id}",encodeURIComponent(String(n))).replace("{userId}",encodeURIComponent(String(r))),o=new URL(s,Zt);let a;e&&(a=e.baseOptions);const l={method:"GET",...a,...i},c={},u={};t!=null&&(c["x-user-key"]=String(t)),Wt(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:Ht(o),options:l}},getUser:async(t,n={})=>{pt("getUser","xUserKey",t);const r="/v1/users/me",i=new URL(r,Zt);let s;e&&(s=e.baseOptions);const o={method:"GET",...s,...n},a={},l={};t!=null&&(a["x-user-key"]=String(t)),Wt(i,l);let c=s&&s.headers?s.headers:{};return o.headers={...a,...c,...n.headers},{url:Ht(i),options:o}},listConversationMessages:async(t,n,r,i={})=>{pt("listConversationMessages","xUserKey",t),pt("listConversationMessages","id",n);const s="/v1/conversations/{id}/messages".replace("{id}",encodeURIComponent(String(n))),o=new URL(s,Zt);let a;e&&(a=e.baseOptions);const l={method:"GET",...a,...i},c={},u={};r!==void 0&&(u.nextToken=r),t!=null&&(c["x-user-key"]=String(t)),Wt(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:Ht(o),options:l}},listConversations:async(t,n,r={})=>{pt("listConversations","xUserKey",t);const i="/v1/conversations",s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...r},l={},c={};n!==void 0&&(c.nextToken=n),t!=null&&(l["x-user-key"]=String(t)),Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:Ht(s),options:a}},listParticipants:async(t,n,r,i={})=>{pt("listParticipants","xUserKey",t),pt("listParticipants","id",n);const s="/v1/conversations/{id}/participants".replace("{id}",encodeURIComponent(String(n))),o=new URL(s,Zt);let a;e&&(a=e.baseOptions);const l={method:"GET",...a,...i},c={},u={};r!==void 0&&(u.nextToken=r),t!=null&&(c["x-user-key"]=String(t)),Wt(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:Ht(o),options:l}},listenConversation:async(t,n,r={})=>{pt("listenConversation","xUserKey",t),pt("listenConversation","id",n);const i="/v1/conversations/{id}/listen".replace("{id}",encodeURIComponent(String(n))),s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"GET",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},{url:Ht(s),options:a}},removeParticipant:async(t,n,r,i={})=>{pt("removeParticipant","xUserKey",t),pt("removeParticipant","id",n),pt("removeParticipant","userId",r);const s="/v1/conversations/{id}/participants/{userId}".replace("{id}",encodeURIComponent(String(n))).replace("{userId}",encodeURIComponent(String(r))),o=new URL(s,Zt);let a;e&&(a=e.baseOptions);const l={method:"DELETE",...a,...i},c={},u={};t!=null&&(c["x-user-key"]=String(t)),Wt(o,u);let d=a&&a.headers?a.headers:{};return l.headers={...c,...d,...i.headers},{url:Ht(o),options:l}},updateUser:async(t,n,r={})=>{pt("updateUser","xUserKey",t);const i="/v1/users/me",s=new URL(i,Zt);let o;e&&(o=e.baseOptions);const a={method:"PUT",...o,...r},l={},c={};t!=null&&(l["x-user-key"]=String(t)),l["Content-Type"]="application/json",Wt(s,c);let u=o&&o.headers?o.headers:{};return a.headers={...l,...u,...r.headers},a.data=fs(n,a,e),{url:Ht(s),options:a}}}},Kt=function(e){const t=o2(e);return{async addParticipant(n,r,i,s){const o=await t.addParticipant(n,r,i,s);return qt(o,Pt,Ut,e)},async createConversation(n,r,i){const s=await t.createConversation(n,r,i);return qt(s,Pt,Ut,e)},async createEvent(n,r,i){const s=await t.createEvent(n,r,i);return qt(s,Pt,Ut,e)},async createMessage(n,r,i){const s=await t.createMessage(n,r,i);return qt(s,Pt,Ut,e)},async createUser(n,r){const i=await t.createUser(n,r);return qt(i,Pt,Ut,e)},async deleteConversation(n,r,i){const s=await t.deleteConversation(n,r,i);return qt(s,Pt,Ut,e)},async deleteMessage(n,r,i){const s=await t.deleteMessage(n,r,i);return qt(s,Pt,Ut,e)},async deleteUser(n,r){const i=await t.deleteUser(n,r);return qt(i,Pt,Ut,e)},async getConversation(n,r,i){const s=await t.getConversation(n,r,i);return qt(s,Pt,Ut,e)},async getEvent(n,r,i){const s=await t.getEvent(n,r,i);return qt(s,Pt,Ut,e)},async getMessage(n,r,i){const s=await t.getMessage(n,r,i);return qt(s,Pt,Ut,e)},async getParticipant(n,r,i,s){const o=await t.getParticipant(n,r,i,s);return qt(o,Pt,Ut,e)},async getUser(n,r){const i=await t.getUser(n,r);return qt(i,Pt,Ut,e)},async listConversationMessages(n,r,i,s){const o=await t.listConversationMessages(n,r,i,s);return qt(o,Pt,Ut,e)},async listConversations(n,r,i){const s=await t.listConversations(n,r,i);return qt(s,Pt,Ut,e)},async listParticipants(n,r,i,s){const o=await t.listParticipants(n,r,i,s);return qt(o,Pt,Ut,e)},async listenConversation(n,r,i){const s=await t.listenConversation(n,r,i);return qt(s,Pt,Ut,e)},async removeParticipant(n,r,i,s){const o=await t.removeParticipant(n,r,i,s);return qt(o,Pt,Ut,e)},async updateUser(n,r,i){const s=await t.updateUser(n,r,i);return qt(s,Pt,Ut,e)}}};class a2 extends i2{addParticipant(t,n){return Kt(this.configuration).addParticipant(t.xUserKey,t.id,t.addParticipantBody,n).then(r=>r(this.axios,this.basePath))}createConversation(t,n){return Kt(this.configuration).createConversation(t.xUserKey,t.createConversationBody,n).then(r=>r(this.axios,this.basePath))}createEvent(t,n){return Kt(this.configuration).createEvent(t.xUserKey,t.createEventBody,n).then(r=>r(this.axios,this.basePath))}createMessage(t,n){return Kt(this.configuration).createMessage(t.xUserKey,t.createMessageBody,n).then(r=>r(this.axios,this.basePath))}createUser(t={},n){return Kt(this.configuration).createUser(t.createUserBody,n).then(r=>r(this.axios,this.basePath))}deleteConversation(t,n){return Kt(this.configuration).deleteConversation(t.xUserKey,t.id,n).then(r=>r(this.axios,this.basePath))}deleteMessage(t,n){return Kt(this.configuration).deleteMessage(t.xUserKey,t.id,n).then(r=>r(this.axios,this.basePath))}deleteUser(t,n){return Kt(this.configuration).deleteUser(t.xUserKey,n).then(r=>r(this.axios,this.basePath))}getConversation(t,n){return Kt(this.configuration).getConversation(t.xUserKey,t.id,n).then(r=>r(this.axios,this.basePath))}getEvent(t,n){return Kt(this.configuration).getEvent(t.xUserKey,t.id,n).then(r=>r(this.axios,this.basePath))}getMessage(t,n){return Kt(this.configuration).getMessage(t.xUserKey,t.id,n).then(r=>r(this.axios,this.basePath))}getParticipant(t,n){return Kt(this.configuration).getParticipant(t.xUserKey,t.id,t.userId,n).then(r=>r(this.axios,this.basePath))}getUser(t,n){return Kt(this.configuration).getUser(t.xUserKey,n).then(r=>r(this.axios,this.basePath))}listConversationMessages(t,n){return Kt(this.configuration).listConversationMessages(t.xUserKey,t.id,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listConversations(t,n){return Kt(this.configuration).listConversations(t.xUserKey,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listParticipants(t,n){return Kt(this.configuration).listParticipants(t.xUserKey,t.id,t.nextToken,n).then(r=>r(this.axios,this.basePath))}listenConversation(t,n){return Kt(this.configuration).listenConversation(t.xUserKey,t.id,n).then(r=>r(this.axios,this.basePath))}removeParticipant(t,n){return Kt(this.configuration).removeParticipant(t.xUserKey,t.id,t.userId,n).then(r=>r(this.axios,this.basePath))}updateUser(t,n){return Kt(this.configuration).updateUser(t.xUserKey,t.updateUserBody,n).then(r=>r(this.axios,this.basePath))}}const l2={getRandomValues:e=>new Uint8Array(e.map(()=>Math.floor(Math.random()*256)))};let kd=typeof window<"u"&&typeof window.document<"u"?window.crypto:$u;kd.getRandomValues||(kd=l2);class wt extends Error{constructor(n,r,i,s,o,a){super(s);E(this,"isApiError",!0);this.code=n,this.description=r,this.type=i,this.message=s,this.error=o,this.id=a,this.id||(this.id=wt.generateId())}format(){return`[${this.type}] ${this.message} (Error ID: ${this.id})`}toJSON(){return{id:this.id,code:this.code,type:this.type,message:this.message}}static generateId(){const n=this.getPrefix(),r=new Date().toISOString().replace(/[\-:TZ]/g,"").split(".")[0],i=4,s=Array.from(kd.getRandomValues(new Uint8Array(i))).map(o=>o.toString(16).padStart(2,"0")).join("").toUpperCase();return`${n}_${r}x${s}`}static getPrefix(){return typeof window<"u"&&typeof window.document<"u"?"err_bwsr":"err"}}const c2=e=>typeof e=="object"&&!Array.isArray(e)&&e!==null,Cd=e=>e instanceof wt||c2(e)&&e.isApiError===!0;class _o extends wt{constructor(t,n,r){super(500,"An unknown error occurred","Unknown",t,n,r)}}class u2 extends wt{constructor(t,n,r){super(500,"An internal error occurred","Internal",t,n,r)}}class d2 extends wt{constructor(t,n,r){super(401,"The request requires to be authenticated.","Unauthorized",t,n,r)}}class f2 extends wt{constructor(t,n,r){super(403,"The requested action can't be peform by this resource.","Forbidden",t,n,r)}}class h2 extends wt{constructor(t,n,r){super(413,"The request payload is too large.","PayloadTooLarge",t,n,r)}}class p2 extends wt{constructor(t,n,r){super(400,"The request payload is invalid.","InvalidPayload",t,n,r)}}class m2 extends wt{constructor(t,n,r){super(415,"The request is invalid because the content-type is not supported.","UnsupportedMediaType",t,n,r)}}class g2 extends wt{constructor(t,n,r){super(405,"The requested method does not exist.","MethodNotFound",t,n,r)}}class y2 extends wt{constructor(t,n,r){super(404,"The requested resource does not exist.","ResourceNotFound",t,n,r)}}class v2 extends wt{constructor(t,n,r){super(400,"The provided JSON schema is invalid.","InvalidJsonSchema",t,n,r)}}class b2 extends wt{constructor(t,n,r){super(400,"The provided data doesn't respect the provided JSON schema.","InvalidDataFormat",t,n,r)}}class w2 extends wt{constructor(t,n,r){super(400,"The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.","InvalidIdentifier",t,n,r)}}class x2 extends wt{constructor(t,n,r){super(409,"The resource is related with a different resource that the one referenced in the request. This is usually caused when providing two resource identifiers that aren't linked together.","RelationConflict",t,n,r)}}class _2 extends wt{constructor(t,n,r){super(409,"The resource cannot be deleted because it's referenced by another resource","ReferenceConstraint",t,n,r)}}class k2 extends wt{constructor(t,n,r){super(400,"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.","ReferenceNotFound",t,n,r)}}class C2 extends wt{constructor(t,n,r){super(400,"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.","InvalidQuery",t,n,r)}}class E2 extends wt{constructor(t,n,r){super(400,"An error happened during the execution of a runtime (bot or integration).","Runtime",t,n,r)}}class S2 extends wt{constructor(t,n,r){super(409,"The record attempted to be created already exists.","AlreadyExists",t,n,r)}}class T2 extends wt{constructor(t,n,r){super(429,"The request has been rate limited.","RateLimited",t,n,r)}}class O2 extends wt{constructor(t,n,r){super(402,"A payment is required to perform this request.","PaymentRequired",t,n,r)}}class I2 extends wt{constructor(t,n,r){super(403,"The request exceeds the allowed quota. Quotas are a soft limit that can be increased.","QuotaExceeded",t,n,r)}}class P2 extends wt{constructor(t,n,r){super(413,"The request exceeds the allowed limit. Limits are a hard limit that cannot be increased.","LimitExceeded",t,n,r)}}class A2 extends wt{constructor(t,n,r){super(400,"Request payload contains breaking changes which is not allowed for this resource without a version increment.","BreakingChanges",t,n,r)}}const R2={Unknown:_o,Internal:u2,Unauthorized:d2,Forbidden:f2,PayloadTooLarge:h2,InvalidPayload:p2,UnsupportedMediaType:m2,MethodNotFound:g2,ResourceNotFound:y2,InvalidJsonSchema:v2,InvalidDataFormat:b2,InvalidIdentifier:w2,RelationConflict:x2,ReferenceConstraint:_2,ReferenceNotFound:k2,InvalidQuery:C2,Runtime:E2,AlreadyExists:S2,RateLimited:T2,PaymentRequired:O2,QuotaExceeded:I2,LimitExceeded:P2,BreakingChanges:A2},$b=e=>Cd(e)?e:e instanceof Error?new _o(e.message,e):typeof e=="string"?new _o(e):$2(e);function $2(e){if(typeof e=="object"&&"code"in e&&"type"in e&&"id"in e&&"message"in e&&typeof e.type=="string"&&typeof e.message=="string"){const t=R2[e.type];return t?new t(e.message,void 0,e.id||"UNKNOWN"):new _o(`An unclassified API error occurred: ${e.message} (Type: ${e.type}, Code: ${e.code})`)}return new _o("An invalid error occurred: "+JSON.stringify(e))}class M2{constructor(t,n,r){E(this,"_innerClient");E(this,"addParticipant",({id:t,xUserKey:n,...r})=>this._innerClient.addParticipant({id:t,xUserKey:n,addParticipantBody:r}).then(i=>i.data).catch(i=>{throw Jt(i)}));E(this,"createConversation",({xUserKey:t,...n})=>this._innerClient.createConversation({xUserKey:t,createConversationBody:n}).then(r=>r.data).catch(r=>{throw Jt(r)}));E(this,"deleteConversation",t=>this._innerClient.deleteConversation(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"getConversation",t=>this._innerClient.getConversation(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"getParticipant",t=>this._innerClient.getParticipant(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"listConversationMessages",t=>this._innerClient.listConversationMessages(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"listConversations",t=>this._innerClient.listConversations(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"listParticipants",t=>this._innerClient.listParticipants(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"listenConversation",t=>this._innerClient.listenConversation(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"removeParticipant",t=>this._innerClient.removeParticipant(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"createMessage",({xUserKey:t,...n})=>this._innerClient.createMessage({xUserKey:t,createMessageBody:n}).then(r=>r.data).catch(r=>{throw Jt(r)}));E(this,"deleteMessage",t=>this._innerClient.deleteMessage(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"getMessage",t=>this._innerClient.getMessage(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"createUser",t=>this._innerClient.createUser({createUserBody:t}).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"deleteUser",t=>this._innerClient.deleteUser(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"getUser",t=>this._innerClient.getUser(t).then(n=>n.data).catch(n=>{throw Jt(n)}));E(this,"updateUser",({xUserKey:t,...n})=>this._innerClient.updateUser({xUserKey:t,updateUserBody:n}).then(r=>r.data).catch(r=>{throw Jt(r)}));E(this,"createEvent",({xUserKey:t,...n})=>this._innerClient.createEvent({xUserKey:t,createEventBody:n}).then(r=>r.data).catch(r=>{throw Jt(r)}));E(this,"getEvent",t=>this._innerClient.getEvent(t).then(n=>n.data).catch(n=>{throw Jt(n)}));this._innerClient=new a2(t,n,r)}}function Jt(e){var t;return Pt.isAxiosError(e)&&((t=e.response)!=null&&t.data)?$b(e.response.data):$b(e)}class Mb{constructor(){E(this,"listeners",{})}emit(t,n){const r=this.listeners[t];if(r)for(const i of[...r])i(n)}onceOrMore(t,n){const r=i=>{n(i)==="stop-listening"&&this.off(t,r)};this.on(t,r)}once(t,n){const r=i=>{this.off(t,r),n(i)};this.on(t,r)}on(t,n){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(n)}off(t,n){const r=this.listeners[t];if(!r)return;const i=r.indexOf(n);i!==-1&&r.splice(i,1)}cleanup(){this.listeners={}}}var Ed={exports:{}};/** @license
|
|
280
280
|
* eventsource.js
|
|
281
281
|
* Available under MIT License (MIT)
|
|
282
282
|
* https://github.com/Yaffle/EventSource/
|
|
283
|
-
*/(function(e,t){(function(n){var r=n.setTimeout,i=n.clearTimeout,s=n.XMLHttpRequest,o=n.XDomainRequest,a=n.ActiveXObject,l=n.EventSource,c=n.document,u=n.Promise,d=n.fetch,h=n.Response,f=n.TextDecoder,p=n.TextEncoder,m=n.AbortController;if(typeof window<"u"&&typeof c<"u"&&!("readyState"in c)&&c.body==null&&(c.readyState="loading",window.addEventListener("load",function(
|
|
284
|
-
`),he=0;he<me.length;he+=1){var Le=me[he],Pe=Le.split(": "),Be=Pe.shift(),
|
|
285
|
-
`.charCodeAt(0)||
|
|
286
|
-
`.charCodeAt(0))
|
|
287
|
-
`.charCodeAt(0)){if(
|
|
288
|
-
`,cn+=Sn):bn==="id"?Pt=Sn:bn==="event"?Nt=Sn:bn==="retry"?(Pe=De(Sn,Pe),Ze=Pe):bn==="heartbeatTimeout"&&(Be=De(Sn,Be),pt!==0&&(i(pt),pt=r(function(){Or()},Be)))}if(qt===ee){if(cn!==""){it=Pt,Nt===""&&(Nt="message");var cr=new q(Nt,{data:cn.slice(1),lastEventId:Pt});if(N.dispatchEvent(cr),Nt==="open"?_e(N,N.onopen,cr):Nt==="message"?_e(N,N.onmessage,cr):Nt==="error"&&_e(N,N.onerror,cr),It===pe)return}cn="",Nt=""}qt=Yt==="\r".charCodeAt(0)?k:ee}else qt===ee&&(Tr=$t,qt=xe),qt===xe?Yt===":".charCodeAt(0)&&(Ln=$t+1,qt=S):qt===S&&(qt=Te)}}},Xr=function(Et){if(It===K||It===Y){It=z,pt!==0&&(i(pt),pt=0),pt=r(function(){Or()},Ze),Ze=Ue(Math.min(Pe*16,Ze*2)),N.readyState=Y;var St=new V("error",{error:Et});N.dispatchEvent(St),_e(N,N.onerror,St),Et!=null&&console.error(Et)}},ei=function(){It=pe,yt!=null&&(yt.abort(),yt=void 0),pt!==0&&(i(pt),pt=0),N.readyState=pe},Or=function(){if(pt=0,It!==z){if(!W&&yt!=null)Xr(new Error("No activity within "+Be+" milliseconds. "+(It===Y?"No response received.":Q+" chars received.")+" Reconnecting.")),yt!=null&&(yt.abort(),yt=void 0);else{var Et=Math.max((W||Date.now())+Be-Date.now(),1);W=!1,pt=r(function(){Or()},Et)}return}W=!1,Q=0,pt=r(function(){Or()},Be),It=Y,cn="",Nt="",Pt=it,Jt="",Tr=0,Ln=0,qt=ee;var St=ne;if(ne.slice(0,5)!=="data:"&&ne.slice(0,5)!=="blob:"&&it!==""){var Gt=ne.indexOf("?");St=Gt===-1?ne:ne.slice(0,Gt+1)+ne.slice(Gt+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,function(Sn,cr){return cr===Le?"":Sn}),St+=(ne.indexOf("?")===-1?"?":"&")+Le+"="+encodeURIComponent(it)}var Yt=N.withCredentials,Kt={};Kt.Accept="text/event-stream";var $t=N.headers;if($t!=null)for(var bn in $t)Object.prototype.hasOwnProperty.call($t,bn)&&(Kt[bn]=$t[bn]);try{yt=Ct.open(Ge,lr,Si,Xr,St,Yt,Kt)}catch(Sn){throw ei(),Sn}};N.url=ne,N.readyState=Y,N.withCredentials=he,N.headers=G,N._close=ei,Or()}ve.prototype=Object.create(I.prototype),ve.prototype.CONNECTING=Y,ve.prototype.OPEN=K,ve.prototype.CLOSED=pe,ve.prototype.close=function(){this._close()},ve.CONNECTING=Y,ve.OPEN=K,ve.CLOSED=pe,ve.prototype.withCredentials=void 0;var qe=l;s!=null&&(l==null||!("withCredentials"in l.prototype))&&(qe=ve),function(N){{var ne=N(t);ne!==void 0&&(e.exports=ne)}}(function(N){N.EventSourcePolyfill=ve,N.NativeEventSource=l,N.EventSource=qe})})(typeof globalThis>"u"?typeof window<"u"?window:typeof self<"u"?self:Me:globalThis)})(fd,fd.exports);var lj=fd.exports;const cj=ti(lj),uj=(e,t={})=>{const n=new cj.EventSourcePolyfill(e,{headers:t.headers}),r=new Nv;return n.onopen=i=>r.emit("open",i),n.onmessage=i=>r.emit("message",i),n.onerror=i=>r.emit("error",i),{emitter:r,source:n}},dj=async(e,t={})=>{const{emitter:n,source:r}=uj(e,t);return await new Promise((i,s)=>{n.on("open",()=>{i()}),n.on("error",o=>{s(o)})}).finally(()=>n.cleanup()),{on:n.on.bind(n),close:()=>{n.cleanup(),r.close()}}},fj=T.object({type:T.literal("message_created"),data:T.object({id:T.string(),createdAt:T.string().datetime(),payload:T.union([T.object({audioUrl:T.string().min(1),className:T.string().describe("CSS className to apply to the message").optional(),type:T.literal("audio")}),T.object({title:T.string().min(1),subtitle:T.string().optional(),imageUrl:T.string().optional(),actions:T.array(T.object({action:T.enum(["postback","url","say"]),label:T.string().min(1),value:T.string().min(1)})),type:T.literal("card"),className:T.string().describe("CSS className to apply to the message").optional()}),T.object({items:T.array(T.object({title:T.string().min(1),subtitle:T.string().optional(),imageUrl:T.string().optional(),actions:T.array(T.object({action:T.enum(["postback","url","say"]),label:T.string().min(1),value:T.string().min(1)})),className:T.string().describe("CSS className to apply to the message").optional()})),className:T.string().describe("CSS className to apply to the message").optional(),type:T.literal("carousel")}),T.object({text:T.string(),options:T.array(T.object({label:T.string().min(1),value:T.string().min(1)})),className:T.string().describe("CSS className to apply to the message").optional(),type:T.literal("choice"),disableFreeText:T.boolean().optional()}),T.object({text:T.string(),options:T.array(T.object({label:T.string().min(1),value:T.string().min(1)})),className:T.string().describe("CSS className to apply to the message").optional(),type:T.literal("dropdown")}),T.object({fileUrl:T.string().min(1),title:T.string().min(1).optional(),className:T.string().describe("CSS className to apply to the message").optional(),type:T.literal("file")}),T.object({imageUrl:T.string().min(1),className:T.string().describe("CSS className to apply to the message").optional(),type:T.literal("image")}),T.object({latitude:T.number(),longitude:T.number(),address:T.string().optional(),title:T.string().optional(),className:T.string().describe("CSS className to apply to the message").optional(),type:T.literal("location")}),T.object({markdown:T.string().min(1),className:T.string().describe("CSS className to apply to the message").optional(),type:T.literal("markdown")}),T.object({text:T.string().min(1),className:T.string().describe("CSS className to apply to the message").optional(),type:T.literal("text")}),T.object({videoUrl:T.string().min(1),className:T.string().describe("CSS className to apply to the message").optional(),type:T.literal("video")})]),userId:T.string(),conversationId:T.string()})}),hj=T.object({type:T.literal("webchat_visibility"),data:T.object({visibility:T.enum(["show","hide","toggle"])})}),pj=T.object({type:T.literal("webchat_config"),data:T.object({config:T.record(T.any())})}),mj=T.object({type:T.literal("custom"),data:T.object({event:T.record(T.any())})}),gj={messageCreatedSignal:fj,webchatVisibilitySignal:hj,webchatConfigSignal:pj,customSignal:mj},jv="unknown error",kl=class kl extends Nv{constructor(n){super();E(this,"_state",{status:"disconnected"});E(this,"connect",async()=>{if(this._state.status==="connected")return;if(this._state.status==="connecting"){await this._state.connectionPromise;return}const n=this._connect();this._state={status:"connecting",connectionPromise:n},await n});E(this,"disconnect",async()=>{if(this._state.status==="disconnected")return;let n;this._state.status==="connecting"?n=await this._state.connectionPromise:n=this._state.source,this._disconnectSync(n)});E(this,"_connect",async()=>{const n=await dj(`${this._props.url}/v1/conversations/${this._props.conversationId}/listen`,{headers:{"x-user-key":this._props.userKey}});return n.on("message",this._handleMessage),n.on("error",this._handleError(n)),this._state={status:"connected",source:n},n});E(this,"_disconnectSync",n=>{n.close(),this._state={status:"disconnected"}});E(this,"_handleMessage",n=>{const r=this._parseSignal(n.data);this.emit(r.type,r.data)});E(this,"_handleError",n=>r=>{this._disconnectSync(n);const i=this._toError(r);this.emit("error",i)});E(this,"_parseSignal",n=>{for(const r of Object.values(gj)){const i=this._safeJsonParse(n),s=r.safeParse(i);if(s.success)return s.data}return{type:"unknown",data:n}});E(this,"_safeJsonParse",n=>{try{return JSON.parse(n)}catch{return n}});E(this,"_toError",n=>{if(n instanceof Error)return n;if(typeof n=="string")return new Error(n);if(n===null)return new Error(jv);if(typeof n=="object"&&"message"in n)return this._toError(n.message);try{const r=JSON.stringify(n);return new Error(r)}catch{return new Error(jv)}});this._props=n}get status(){return this._state.status}};E(kl,"listen",async n=>{const r=new kl(n);return await r.connect(),r});let hd=kl;const Uv=100*1024*1024,yj=Uv,vj=Uv,bj=6e4;class wj{constructor(t){E(this,"_auto");E(this,"createConversation",t=>this._auto.createConversation(t));E(this,"getConversation",t=>this._auto.getConversation(t));E(this,"deleteConversation",t=>this._auto.deleteConversation(t));E(this,"listConversations",t=>this._auto.listConversations(t));E(this,"listConversationMessages",t=>this._auto.listConversationMessages(t));E(this,"addParticipant",t=>this._auto.addParticipant(t));E(this,"removeParticipant",t=>this._auto.removeParticipant(t));E(this,"getParticipant",t=>this._auto.getParticipant(t));E(this,"listParticipants",t=>this._auto.listParticipants(t));E(this,"createMessage",t=>this._auto.createMessage(t));E(this,"getMessage",t=>this._auto.getMessage(t));E(this,"deleteMessage",t=>this._auto.deleteMessage(t));E(this,"createUser",t=>this._auto.createUser(t));E(this,"getUser",t=>this._auto.getUser(t));E(this,"updateUser",t=>this._auto.updateUser(t));E(this,"deleteUser",t=>this._auto.deleteUser(t));E(this,"createEvent",t=>this._auto.createEvent(t));E(this,"getEvent",t=>this._auto.getEvent(t));E(this,"listenConversation",async({id:t,xUserKey:n})=>await hd.listen({url:this.props.apiUrl,conversationId:t,userKey:n}));this.props=t;const{apiUrl:n}=t,r={...t.headers},i=t.timeout??bj,s=Ot.create({headers:r,withCredentials:!0,timeout:i,maxBodyLength:yj,maxContentLength:vj});this._auto=new aj(void 0,n,s)}}const ul={disconnected:0,user_creating:1,user_created:2,conversation_creating:3,conversation_created:4},Mn=(e,t)=>e.status===t,Ei=(e,t)=>ul[e.status]<ul[t],Fv=(e,t)=>ul[e.status]>=ul[t];class os extends Error{constructor(t){super(`Unexpected state: ${t.status}`),this.state=t}}class Bv extends Il{constructor(n){super();E(this,"_client");E(this,"_webhookId");E(this,"_state",{status:"disconnected"});E(this,"mode","pushpin");E(this,"_initialConnect",async n=>{if(Fv(this._state,"user_created"))throw new Error("Client is already connected. Please disconnect first.");if(Mn(this._state,"user_creating"))return;this._state={status:"user_creating"},console.log("createUser");const{user:{id:r},key:i}=await this._client.createUser({name:void 0,pictureUrl:void 0,userData:n});return this._state={status:"user_created",userId:r,userKey:i},{userId:r,userToken:i}});E(this,"_reConnect",async(n,r)=>{if(Fv(this._state,"user_created")){if(this._state.userId!==n.userId)throw new Error("Client is already connected. Please disconnect first.");return n}return Mn(this._state,"user_creating")||(this._state={status:"user_created",userId:n.userId,userKey:n.userToken},console.log("updateUser"),await this._client.updateUser({xUserKey:n.userToken,name:void 0,pictureUrl:void 0,userData:r})),n});E(this,"_mapMessage",n=>({id:n.id,conversationId:n.conversationId,authorId:n.userId,sentOn:new Date(n.createdAt),payload:CD(n.payload)}));const r=`${n.apiUrl}/${n.clientId}`;this._webhookId=n.clientId,this._client=new wj({apiUrl:r})}get clientId(){return this._webhookId}get userId(){if(!Ei(this._state,"user_created"))return this._state.userId}get conversationId(){if(!Ei(this._state,"conversation_created"))return this._state.conversationId}async connect(n,r){return n?await this.userExists(n)?this._reConnect(n,r):this._initialConnect(r):this._initialConnect(r)}async disconnect(){Mn(this._state,"conversation_created")?this._state.signalEmitter.cleanup():Mn(this._state,"conversation_creating")&&console.warn("zombie conversation..."),this._state={status:"disconnected"}}async sendMessage(n){if(Ei(this._state,"user_created"))throw new os(this._state);if(Mn(this._state,"conversation_creating"))throw new os(this._state);let r;Mn(this._state,"conversation_created")?r=this._state:(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},r=await this._createNewConversation(this._state)),console.log("createMessage"),await this._client.createMessage({xUserKey:r.userKey,conversationId:r.conversationId,payload:{type:"text",text:n}}),this.emit("messageSent",n)}async sendEvent(n){if(Ei(this._state,"user_created"))throw new os(this._state);if(Mn(this._state,"conversation_creating"))throw new os(this._state);let r;Mn(this._state,"conversation_created")?r=this._state:(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},r=await this._createNewConversation(this._state)),console.log("createEvent"),await this._client.createEvent({xUserKey:r.userKey,conversationId:r.conversationId,payload:{type:"custom",data:n}})}async switchConversation(n){if(Ei(this._state,"user_created"))throw new os(this._state);Mn(this._state,"conversation_created")&&this._state.conversationId===n||Mn(this._state,"conversation_creating")||(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},await this._connectConversation(this._state,n))}async conversationExists(n){if(Ei(this._state,"user_created"))return!1;try{return await this._client.getConversation({xUserKey:this._state.userKey,id:n}),!0}catch(r){if(dd(r)&&r.code===404)return!1;throw r}}async userExists({userToken:n}){try{return await this._client.getUser({xUserKey:n}),!0}catch(r){const i=s=>s.code===404||s.code===401;if(dd(r)&&i(r))return!1;throw r}}async newConversation(){if(Ei(this._state,"user_created"))throw new os(this._state);Mn(this._state,"conversation_creating")||(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},await this._createNewConversation(this._state))}async _createNewConversation(n){console.log("createConversation");const{conversation:{id:r}}=await this._client.createConversation({xUserKey:n.userKey}),i=await this._connectConversation(n,r);return await this._client.createEvent({xUserKey:n.userKey,conversationId:r,payload:{type:"conversation_started",data:{}}}),i}async listMessages(){if(!Mn(this._state,"conversation_created"))return[];const{conversationId:n,userKey:r}=this._state,i=[];let s;do{const o=await this._client.listConversationMessages({id:n,xUserKey:r,nextToken:s});i.push(...o.messages),s=o.meta.nextToken}while(s);return i.map(this._mapMessage)}async _connectConversation(n,r){const i=await this._client.listenConversation({id:r,xUserKey:n.userKey});return i.on("unknown",s=>console.log("unknown event",s)),i.on("message_created",s=>{s.userId!==n.userId&&this.emit("message",this._mapMessage(s))}),i.on("error",()=>{this._state={status:"user_created",userId:n.userId,userKey:n.userKey},this.emit("error",new Error("Connection to conversation lost"))}),i.on("webchat_visibility",s=>{this.emit("webchatVisibility",s.visibility)}),i.on("webchat_config",s=>{this.emit("webchatConfig",s.config)}),i.on("custom",s=>{this.emit("customEvent",s.event)}),this.emit("conversation",r),this._state={status:"conversation_created",userId:n.userId,userKey:n.userKey,conversationId:r,signalEmitter:i},this._state}}const xj=({clientId:e,apiUrl:t,mode:n="messaging"})=>{const[r,i]=_.useState();return _.useEffect(()=>{const s=n==="messaging"?new ov({url:t,clientId:e}):new Bv({apiUrl:t,clientId:e});i(s)},[e,t,n]),r},Vv=_.memo(_.forwardRef((e,t)=>{const{state:n,theme:{composer:r},client:i}=ht(),[s,o]=_.useState(""),[a,l]=_.useState(-1);if(n.isReadOnly||!i)return null;const c=()=>{s&&(i.sendMessage(s),o(""),l(-1))};return Z.jsx(zh.Provider,{value:{value:s,setValue:o,historyIndex:a,setHistoryIndex:l,sendMessage:c},children:Z.jsx("div",{"data-disabled":n.disableComposer,...e,...r==null?void 0:r.container,ref:t})})})),zv=_.memo(({...e})=>{const{state:t,theme:{composer:n}}=ht(),{value:r,setValue:i,historyIndex:s,setHistoryIndex:o,sendMessage:a}=Zh(),l=_.useRef(null),c=Br(d=>d.user),u=Br(d=>d.messageHistory);return _.useEffect(()=>{l.current&&(l.current.selectionStart=l.current.value.length,l.current.selectionEnd=l.current.value.length)},[r]),Z.jsx("textarea",{...n==null?void 0:n.input,disabled:t.disableComposer,ref:l,value:r,"data-has-value":!!r,onChange:d=>i(d.target.value),onKeyDown:d=>{if(!t.disableComposer){if(d.key==="Enter"&&(d.preventDefault(),a()),d.key==="ArrowUp"){d.preventDefault();const h=u[(c==null?void 0:c.userId)??""]??[];s<h.length-1&&i(h[s+1]),o(()=>Math.min(s+1,h.length-1))}if(d.key==="ArrowDown"){d.preventDefault();const h=u[(c==null?void 0:c.userId)??""]??[];i(s===0?"":h[s-1]),o(()=>Math.max(s-1,-1))}}},...e})}),Zv=_.memo(_.forwardRef(({icon:e=oS,...t},n)=>{var o,a;const{value:r,sendMessage:i}=Zh(),{theme:{composer:s}}=ht();return Z.jsx("button",{ref:n,...t,...(o=s==null?void 0:s.button)==null?void 0:o.container,disabled:!r,onClick:i,children:Z.jsx(e,{...(a=s==null?void 0:s.button)==null?void 0:a.icon})})})),Wv=({children:e})=>{const[t,n]=_.useState(!1),[r,i]=_.useState(""),[s,o]=_.useState(null),a=({title:c,content:u})=>{i(c),o(u),n(!0)},l=()=>{n(!1)};return Z.jsxs(Hh.Provider,{value:{hideModal:l,showModal:a,title:r,content:s,open:t},children:[Z.jsx(Qr,{open:t,onOpenChange:n,children:Z.jsx(Qr.Content,{title:r,children:s})}),e]})},_j=({theme:e={},renderers:t,client:n,children:r,configuration:i={},userData:s,closeWindow:o,...a})=>{const[l,c]=_.useState(0),[u,d]=_.useState([]),[h,f]=_.useState({disableComposer:!1,...a.defaultState,connected:!0}),[p,m]=_.useState(i),[y,v]=_.useState(e),b=Br(B=>B.addMessageToHistory),x=Br(B=>B.setConversationId),P=Br(B=>B.user),A=Br(B=>B.conversationId),O=Br(B=>B.setUser),U=Br(B=>B.setClientMode),F={...a,value:{theme:y,renderers:{...Xc,...t},messages:u,setMessages:d,eventEmitter:ew,configuration:i,setConfiguration:m,state:h,closeWindow:o,setState:B=>f({...h,...B}),setTheme:B=>{v(B)},client:n?{...n,sendMessage:async B=>{await n.sendMessage(B),d(I=>[...I,{direction:"outgoing",sender:{name:"You"},timestamp:new Date,block:{type:"bubble",block:{type:"text",text:B}}}]),n.userId&&b({message:B,userId:n.userId})},on:n.on,restartConversation:async()=>{await n.newConversation(),d([])}}:void 0}};return hi(()=>{n&&U(n.mode)}),hi(()=>{if(n)return n.on("message",B=>{try{const I=B.payload;d(j=>[...j,{direction:"incoming",sender:{name:p.botName??"Bot",avatar:p.botAvatar},timestamp:new Date(B.sentOn),block:I}])}catch{console.error("Invalid message payload")}})}),au(async()=>{if(n)return n.on("error",()=>{console.log("client disconnected"),c(B=>B+1)})}),hi(()=>{if(n)return n.on("conversation",B=>{x(B)})}),au(async()=>{if(!n)return;let B;try{B=await n.connect(P,s),f(j=>({...j,connected:!0}))}catch{f(J=>({...J,connected:!1}));return}O(B),A&&await n.conversationExists(A)?await n.switchConversation(A):await n.newConversation();const I=[];for(const j of await n.listMessages())try{const J=j.payload,q=j.authorId===n.userId?"outgoing":"incoming";I.push({direction:q,sender:q==="outgoing"?{name:"You"}:{name:p.botName??"Bot",avatar:p.botAvatar},timestamp:new Date(j.sentOn),block:J})}catch{console.error("Invalid message payload")}return d(I.reverse()),()=>{n.disconnect()}},[l]),Z.jsx(Kh.Provider,{...F,children:typeof r=="function"?r(p):r})};function Er(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}const kj=$["useId".toString()]||(()=>{});let Cj=0;function dl(e){const[t,n]=$.useState(kj());return ps(()=>{e||n(r=>r??String(Cj++))},[e]),e||(t?`radix-${t}`:"")}function Hv({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=Ej({defaultProp:t,onChange:n}),s=e!==void 0,o=s?e:r,a=Ir(n),l=_.useCallback(c=>{if(s){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else i(c)},[s,e,i,a]);return[o,l]}function Ej({defaultProp:e,onChange:t}){const n=_.useState(e),[r]=n,i=_.useRef(r),s=Ir(t);return _.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}function Sj(e,t=globalThis==null?void 0:globalThis.document){const n=Ir(e);_.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const pd="dismissableLayer.update",Tj="dismissableLayer.pointerDownOutside",Oj="dismissableLayer.focusOutside";let qv;const Ij=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Pj=_.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...c}=e,u=_.useContext(Ij),[d,h]=_.useState(null),f=(n=d==null?void 0:d.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,p]=_.useState({}),m=ni(t,F=>h(F)),y=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),x=d?y.indexOf(d):-1,P=u.layersWithOutsidePointerEventsDisabled.size>0,A=x>=b,O=Aj(F=>{const B=F.target,I=[...u.branches].some(j=>j.contains(B));!A||I||(s==null||s(F),a==null||a(F),F.defaultPrevented||l==null||l())},f),U=Rj(F=>{const B=F.target;[...u.branches].some(j=>j.contains(B))||(o==null||o(F),a==null||a(F),F.defaultPrevented||l==null||l())},f);return Sj(F=>{x===u.layers.size-1&&(i==null||i(F),!F.defaultPrevented&&l&&(F.preventDefault(),l()))},f),_.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(qv=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Kv(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=qv)}},[d,f,r,u]),_.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Kv())},[d,u]),_.useEffect(()=>{const F=()=>p({});return document.addEventListener(pd,F),()=>document.removeEventListener(pd,F)},[]),_.createElement(Tn.div,wt({},c,{ref:m,style:{pointerEvents:P?A?"auto":"none":void 0,...e.style},onFocusCapture:Er(e.onFocusCapture,U.onFocusCapture),onBlurCapture:Er(e.onBlurCapture,U.onBlurCapture),onPointerDownCapture:Er(e.onPointerDownCapture,O.onPointerDownCapture)}))});function Aj(e,t=globalThis==null?void 0:globalThis.document){const n=Ir(e),r=_.useRef(!1),i=_.useRef(()=>{});return _.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){Jv(Tj,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Rj(e,t=globalThis==null?void 0:globalThis.document){const n=Ir(e),r=_.useRef(!1);return _.useEffect(()=>{const i=s=>{s.target&&!r.current&&Jv(Oj,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Kv(){const e=new CustomEvent(pd);document.dispatchEvent(e)}function Jv(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Kb(i,s):i.dispatchEvent(s)}const md="focusScope.autoFocusOnMount",gd="focusScope.autoFocusOnUnmount",Gv={bubbles:!1,cancelable:!0},$j=_.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=e,[a,l]=_.useState(null),c=Ir(i),u=Ir(s),d=_.useRef(null),h=ni(t,m=>l(m)),f=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let m=function(x){if(f.paused||!a)return;const P=x.target;a.contains(P)?d.current=P:Yr(d.current,{select:!0})},y=function(x){if(f.paused||!a)return;const P=x.relatedTarget;P!==null&&(a.contains(P)||Yr(d.current,{select:!0}))},v=function(x){const P=document.activeElement;for(const A of x)A.removedNodes.length>0&&(a!=null&&a.contains(P)||Yr(a))};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const b=new MutationObserver(v);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),b.disconnect()}}},[r,a,f.paused]),_.useEffect(()=>{if(a){Xv.add(f);const m=document.activeElement;if(!a.contains(m)){const v=new CustomEvent(md,Gv);a.addEventListener(md,c),a.dispatchEvent(v),v.defaultPrevented||(Mj(Uj(Yv(a)),{select:!0}),document.activeElement===m&&Yr(a))}return()=>{a.removeEventListener(md,c),setTimeout(()=>{const v=new CustomEvent(gd,Gv);a.addEventListener(gd,u),a.dispatchEvent(v),v.defaultPrevented||Yr(m??document.body,{select:!0}),a.removeEventListener(gd,u),Xv.remove(f)},0)}}},[a,c,u,f]);const p=_.useCallback(m=>{if(!n&&!r||f.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,v=document.activeElement;if(y&&v){const b=m.currentTarget,[x,P]=Lj(b);x&&P?!m.shiftKey&&v===P?(m.preventDefault(),n&&Yr(x,{select:!0})):m.shiftKey&&v===x&&(m.preventDefault(),n&&Yr(P,{select:!0})):v===b&&m.preventDefault()}},[n,r,f.paused]);return _.createElement(Tn.div,wt({tabIndex:-1},o,{ref:h,onKeyDown:p}))});function Mj(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Yr(r,{select:t}),document.activeElement!==n)return}function Lj(e){const t=Yv(e),n=Qv(t,e),r=Qv(t.reverse(),e);return[n,r]}function Yv(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Qv(e,t){for(const n of e)if(!Dj(n,{upTo:t}))return n}function Dj(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Nj(e){return e instanceof HTMLInputElement&&"select"in e}function Yr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Nj(e)&&t&&e.select()}}const Xv=jj();function jj(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=eb(e,t),e.unshift(t)},remove(t){var n;e=eb(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function eb(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Uj(e){return e.filter(t=>t.tagName!=="A")}function Fj(e,t){return _.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const fl=e=>{const{present:t,children:n}=e,r=Bj(t),i=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),s=ni(r.ref,i.ref);return typeof n=="function"||r.isPresent?_.cloneElement(i,{ref:s}):null};fl.displayName="Presence";function Bj(e){const[t,n]=_.useState(),r=_.useRef({}),i=_.useRef(e),s=_.useRef("none"),o=e?"mounted":"unmounted",[a,l]=Fj(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const c=hl(r.current);s.current=a==="mounted"?c:"none"},[a]),ps(()=>{const c=r.current,u=i.current;if(u!==e){const h=s.current,f=hl(c);e?l("MOUNT"):f==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),ps(()=>{if(t){const c=d=>{const f=hl(r.current).includes(d.animationName);d.target===t&&f&&Hn.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(s.current=hl(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:_.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function hl(e){return(e==null?void 0:e.animationName)||"none"}let yd=0;function Vj(){_.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:tb()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:tb()),yd++,()=>{yd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),yd--}},[])}function tb(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var pl="right-scroll-bar-position",ml="width-before-scroll-bar",zj="with-scroll-bars-hidden",Zj="--removed-body-scroll-bar-size";function Wj(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Hj(e,t){var n=_.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function qj(e,t){return Hj(t||null,function(n){return e.forEach(function(r){return Wj(r,n)})})}function Kj(e){return e}function Jj(e,t){t===void 0&&(t=Kj);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var o=t(s,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(r=!0;n.length;){var o=n;n=[],o.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(s),o=n}var l=function(){var u=o;o=[],u.forEach(s)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){o.push(u),c()},filter:function(u){return o=o.filter(u),n}}}};return i}function Gj(e){e===void 0&&(e={});var t=Jj(null);return t.options=An({async:!0,ssr:!1},e),t}var nb=function(e){var t=e.sideCar,n=_m(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return $.createElement(r,An({},n))};nb.isSideCarExport=!0;function Yj(e,t){return e.useMedium(t),nb}var rb=Gj(),vd=function(){},gl=$.forwardRef(function(e,t){var n=$.useRef(null),r=$.useState({onScrollCapture:vd,onWheelCapture:vd,onTouchMoveCapture:vd}),i=r[0],s=r[1],o=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,h=e.sideCar,f=e.noIsolation,p=e.inert,m=e.allowPinchZoom,y=e.as,v=y===void 0?"div":y,b=_m(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),x=h,P=qj([n,t]),A=An(An({},b),i);return $.createElement($.Fragment,null,u&&$.createElement(x,{sideCar:rb,removeScrollBar:c,shards:d,noIsolation:f,inert:p,setCallbacks:s,allowPinchZoom:!!m,lockRef:n}),o?$.cloneElement($.Children.only(a),An(An({},A),{ref:P})):$.createElement(v,An({},A,{className:l,ref:P}),a))});gl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},gl.classNames={fullWidth:ml,zeroRight:pl};var ib,Qj=function(){if(ib)return ib;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Xj(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Qj();return t&&e.setAttribute("nonce",t),e}function e2(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function t2(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var n2=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Xj())&&(e2(t,n),t2(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},r2=function(){var e=n2();return function(t,n){$.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},sb=function(){var e=r2(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},i2={left:0,top:0,right:0,gap:0},bd=function(e){return parseInt(e||"",10)||0},s2=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[bd(n),bd(r),bd(i)]},o2=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return i2;var t=s2(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},a2=sb(),l2=function(e,t,n,r){var i=e.left,s=e.top,o=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
289
|
-
.`.concat(
|
|
283
|
+
*/(function(e,t){(function(n){var r=n.setTimeout,i=n.clearTimeout,s=n.XMLHttpRequest,o=n.XDomainRequest,a=n.ActiveXObject,l=n.EventSource,c=n.document,u=n.Promise,d=n.fetch,h=n.Response,f=n.TextDecoder,p=n.TextEncoder,m=n.AbortController;if(typeof window<"u"&&typeof c<"u"&&!("readyState"in c)&&c.body==null&&(c.readyState="loading",window.addEventListener("load",function(D){c.readyState="complete"},!1)),s==null&&a!=null&&(s=function(){return new a("Microsoft.XMLHTTP")}),Object.create==null&&(Object.create=function(D){function ne(){}return ne.prototype=D,new ne}),Date.now||(Date.now=function(){return new Date().getTime()}),m==null){var y=d;d=function(D,ne){var me=ne.signal;return y(D,{headers:ne.headers,credentials:ne.credentials,cache:ne.cache}).then(function(he){var Le=he.body.getReader();return me._reader=Le,me._aborted&&me._reader.cancel(),{status:he.status,statusText:he.statusText,headers:he.headers,body:{getReader:function(){return Le}}}})},m=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){this.signal._reader!=null&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function v(){this.bitsNeeded=0,this.codePoint=0}v.prototype.decode=function(D){function ne(Z,Q,G){if(G===1)return Z>=128>>Q&&Z<<Q<=2047;if(G===2)return Z>=2048>>Q&&Z<<Q<=55295||Z>=57344>>Q&&Z<<Q<=65535;if(G===3)return Z>=65536>>Q&&Z<<Q<=1114111;throw new Error}function me(Z,Q){if(Z===6*1)return Q>>6>15?3:Q>31?2:1;if(Z===6*2)return Q>15?3:2;if(Z===6*3)return 3;throw new Error}for(var he=65533,Le="",Pe=this.bitsNeeded,Be=this.codePoint,ot=0;ot<D.length;ot+=1){var Ze=D[ot];Pe!==0&&(Ze<128||Ze>191||!ne(Be<<6|Ze&63,Pe-6,me(Pe,Be)))&&(Pe=0,Be=he,Le+=String.fromCharCode(Be)),Pe===0?(Ze>=0&&Ze<=127?(Pe=0,Be=Ze):Ze>=192&&Ze<=223?(Pe=6*1,Be=Ze&31):Ze>=224&&Ze<=239?(Pe=6*2,Be=Ze&15):Ze>=240&&Ze<=247?(Pe=6*3,Be=Ze&7):(Pe=0,Be=he),Pe!==0&&!ne(Be,Pe,me(Pe,Be))&&(Pe=0,Be=he)):(Pe-=6,Be=Be<<6|Ze&63),Pe===0&&(Be<=65535?Le+=String.fromCharCode(Be):(Le+=String.fromCharCode(55296+(Be-65535-1>>10)),Le+=String.fromCharCode(56320+(Be-65535-1&1023))))}return this.bitsNeeded=Pe,this.codePoint=Be,Le};var b=function(){try{return new f().decode(new p().encode("test"),{stream:!0})==="test"}catch(D){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+D)}return!1};(f==null||p==null||!b())&&(f=v);var x=function(){};function I(D){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=x,this.onload=x,this.onerror=x,this.onreadystatechange=x,this._contentType="",this._xhr=D,this._sendTimeout=0,this._abort=x}I.prototype.open=function(D,ne){this._abort(!0);var me=this,he=this._xhr,Le=1,Pe=0;this._abort=function(G){me._sendTimeout!==0&&(i(me._sendTimeout),me._sendTimeout=0),(Le===1||Le===2||Le===3)&&(Le=4,he.onload=x,he.onerror=x,he.onabort=x,he.onprogress=x,he.onreadystatechange=x,he.abort(),Pe!==0&&(i(Pe),Pe=0),G||(me.readyState=4,me.onabort(null),me.onreadystatechange())),Le=0};var Be=function(){if(Le===1){var G=0,$e="",Ge=void 0;if("contentType"in he)G=200,$e="OK",Ge=he.contentType;else try{G=he.status,$e=he.statusText,Ge=he.getResponseHeader("Content-Type")}catch{G=0,$e="",Ge=void 0}G!==0&&(Le=2,me.readyState=2,me.status=G,me.statusText=$e,me._contentType=Ge,me.onreadystatechange())}},ot=function(){if(Be(),Le===2||Le===3){Le=3;var G="";try{G=he.responseText}catch{}me.readyState=3,me.responseText=G,me.onprogress()}},Ze=function(G,$e){if(($e==null||$e.preventDefault==null)&&($e={preventDefault:x}),ot(),Le===1||Le===2||Le===3){if(Le=4,Pe!==0&&(i(Pe),Pe=0),me.readyState=4,G==="load")me.onload($e);else if(G==="error")me.onerror($e);else if(G==="abort")me.onabort($e);else throw new TypeError;me.onreadystatechange()}},Z=function(G){he!=null&&(he.readyState===4?(!("onload"in he)||!("onerror"in he)||!("onabort"in he))&&Ze(he.responseText===""?"error":"load",G):he.readyState===3?"onprogress"in he||ot():he.readyState===2&&Be())},Q=function(){Pe=r(function(){Q()},500),he.readyState===3&&ot()};"onload"in he&&(he.onload=function(G){Ze("load",G)}),"onerror"in he&&(he.onerror=function(G){Ze("error",G)}),"onabort"in he&&(he.onabort=function(G){Ze("abort",G)}),"onprogress"in he&&(he.onprogress=ot),"onreadystatechange"in he&&(he.onreadystatechange=function(G){Z(G)}),("contentType"in he||!("ontimeout"in s.prototype))&&(ne+=(ne.indexOf("?")===-1?"?":"&")+"padding=true"),he.open(D,ne,!0),"readyState"in he&&(Pe=r(function(){Q()},0))},I.prototype.abort=function(){this._abort(!1)},I.prototype.getResponseHeader=function(D){return this._contentType},I.prototype.setRequestHeader=function(D,ne){var me=this._xhr;"setRequestHeader"in me&&me.setRequestHeader(D,ne)},I.prototype.getAllResponseHeaders=function(){return this._xhr.getAllResponseHeaders!=null&&this._xhr.getAllResponseHeaders()||""},I.prototype.send=function(){if((!("ontimeout"in s.prototype)||!("sendAsBinary"in s.prototype)&&!("mozAnon"in s.prototype))&&c!=null&&c.readyState!=null&&c.readyState!=="complete"){var D=this;D._sendTimeout=r(function(){D._sendTimeout=0,D.send()},4);return}var ne=this._xhr;"withCredentials"in ne&&(ne.withCredentials=this.withCredentials);try{ne.send(void 0)}catch(me){throw me}};function P(D){return D.replace(/[A-Z]/g,function(ne){return String.fromCharCode(ne.charCodeAt(0)+32)})}function T(D){for(var ne=Object.create(null),me=D.split(`\r
|
|
284
|
+
`),he=0;he<me.length;he+=1){var Le=me[he],Pe=Le.split(": "),Be=Pe.shift(),ot=Pe.join(": ");ne[P(Be)]=ot}this._map=ne}T.prototype.get=function(D){return this._map[P(D)]},s!=null&&s.HEADERS_RECEIVED==null&&(s.HEADERS_RECEIVED=2);function j(){}j.prototype.open=function(D,ne,me,he,Le,Pe,Be){D.open("GET",Le);var ot=0;D.onprogress=function(){var Z=D.responseText,Q=Z.slice(ot);ot+=Q.length,me(Q)},D.onerror=function(Z){Z.preventDefault(),he(new Error("NetworkError"))},D.onload=function(){he(null)},D.onabort=function(){he(null)},D.onreadystatechange=function(){if(D.readyState===s.HEADERS_RECEIVED){var Z=D.status,Q=D.statusText,G=D.getResponseHeader("Content-Type"),$e=D.getAllResponseHeaders();ne(Z,Q,G,new T($e))}},D.withCredentials=Pe;for(var Ze in Be)Object.prototype.hasOwnProperty.call(Be,Ze)&&D.setRequestHeader(Ze,Be[Ze]);return D.send(),D};function U(D){this._headers=D}U.prototype.get=function(D){return this._headers.get(D)};function F(){}F.prototype.open=function(D,ne,me,he,Le,Pe,Be){var ot=null,Ze=new m,Z=Ze.signal,Q=new f;return d(Le,{headers:Be,credentials:Pe?"include":"same-origin",signal:Z,cache:"no-store"}).then(function(G){return ot=G.body.getReader(),ne(G.status,G.statusText,G.headers.get("Content-Type"),new U(G.headers)),new u(function($e,Ge){var St=function(){ot.read().then(function(bt){if(bt.done)$e(void 0);else{var gt=Q.decode(bt.value,{stream:!0});me(gt),St()}}).catch(function(bt){Ge(bt)})};St()})}).catch(function(G){if(G.name!=="AbortError")return G}).then(function(G){he(G)}),{abort:function(){ot!=null&&ot.cancel(),Ze.abort()}}};function O(){this._listeners=Object.create(null)}function N(D){r(function(){throw D},0)}O.prototype.dispatchEvent=function(D){D.target=this;var ne=this._listeners[D.type];if(ne!=null)for(var me=ne.length,he=0;he<me;he+=1){var Le=ne[he];try{typeof Le.handleEvent=="function"?Le.handleEvent(D):Le.call(this,D)}catch(Pe){N(Pe)}}},O.prototype.addEventListener=function(D,ne){D=String(D);var me=this._listeners,he=me[D];he==null&&(he=[],me[D]=he);for(var Le=!1,Pe=0;Pe<he.length;Pe+=1)he[Pe]===ne&&(Le=!0);Le||he.push(ne)},O.prototype.removeEventListener=function(D,ne){D=String(D);var me=this._listeners,he=me[D];if(he!=null){for(var Le=[],Pe=0;Pe<he.length;Pe+=1)he[Pe]!==ne&&Le.push(he[Pe]);Le.length===0?delete me[D]:me[D]=Le}};function J(D){this.type=D,this.target=void 0}function q(D,ne){J.call(this,D),this.data=ne.data,this.lastEventId=ne.lastEventId}q.prototype=Object.create(J.prototype);function W(D,ne){J.call(this,D),this.status=ne.status,this.statusText=ne.statusText,this.headers=ne.headers}W.prototype=Object.create(J.prototype);function B(D,ne){J.call(this,D),this.error=ne.error}B.prototype=Object.create(J.prototype);var V=-1,Y=0,K=1,pe=2,k=-1,ee=0,xe=1,S=2,Te=3,Ne=/^text\/event\-stream(;.*)?$/i,Ie=1e3,je=18e6,De=function(D,ne){var me=D==null?ne:parseInt(D,10);return me!==me&&(me=ne),Ue(me)},Ue=function(D){return Math.min(Math.max(D,Ie),je)},_e=function(D,ne,me){try{typeof ne=="function"&&ne.call(D,me)}catch(he){N(he)}};function ve(D,ne){O.call(this),ne=ne||{},this.onopen=void 0,this.onmessage=void 0,this.onerror=void 0,this.url=void 0,this.readyState=void 0,this.withCredentials=void 0,this.headers=void 0,this._close=void 0,Re(this,D,ne)}function ke(){return s!=null&&"withCredentials"in s.prototype||o==null?new s:new o}var Ce=d!=null&&h!=null&&"body"in h.prototype;function Re(D,ne,me){ne=String(ne);var he=!!me.withCredentials,Le=me.lastEventIdQueryParameterName||"lastEventId",Pe=Ue(1e3),Be=De(me.heartbeatTimeout,45e3),ot="",Ze=Pe,Z=!1,Q=0,G=me.headers||{},$e=me.Transport,Ge=Ce&&$e==null?void 0:new I($e!=null?new $e:ke()),St=$e!=null&&typeof $e!="string"?new $e:Ge==null?new F:new j,bt=void 0,gt=0,At=V,fn="",Rt="",Ft="",Qt="",Gt=ee,Rr=0,jn=0,fr=function(Tt,Ot,Xt,en){if(At===Y)if(Tt===200&&Xt!=null&&Ne.test(Xt)){At=K,Z=Date.now(),Ze=Pe,D.readyState=K;var Yt=new W("open",{status:Tt,statusText:Ot,headers:en});D.dispatchEvent(Yt),_e(D,D.onopen,Yt)}else{var Lt="";Tt!==200?(Ot&&(Ot=Ot.replace(/\s+/g," ")),Lt="EventSource's response has a status "+Tt+" "+Ot+" that is not 200. Aborting the connection."):Lt="EventSource's response has a Content-Type specifying an unsupported type: "+(Xt==null?"-":Xt.replace(/\s+/g," "))+". Aborting the connection.",oi();var Yt=new W("error",{status:Tt,statusText:Ot,headers:en});D.dispatchEvent(Yt),_e(D,D.onerror,Yt),console.error(Lt)}},Ri=function(Tt){if(At===K){for(var Ot=-1,Xt=0;Xt<Tt.length;Xt+=1){var en=Tt.charCodeAt(Xt);(en===`
|
|
285
|
+
`.charCodeAt(0)||en==="\r".charCodeAt(0))&&(Ot=Xt)}var Yt=(Ot!==-1?Qt:"")+Tt.slice(0,Ot+1);Qt=(Ot===-1?Qt:"")+Tt.slice(Ot+1),Tt!==""&&(Z=Date.now(),Q+=Tt.length);for(var Lt=0;Lt<Yt.length;Lt+=1){var en=Yt.charCodeAt(Lt);if(Gt===k&&en===`
|
|
286
|
+
`.charCodeAt(0))Gt=ee;else if(Gt===k&&(Gt=ee),en==="\r".charCodeAt(0)||en===`
|
|
287
|
+
`.charCodeAt(0)){if(Gt!==ee){Gt===xe&&(jn=Lt+1);var _n=Yt.slice(Rr,jn-1),In=Yt.slice(jn+(jn<Lt&&Yt.charCodeAt(jn)===" ".charCodeAt(0)?1:0),Lt);_n==="data"?(fn+=`
|
|
288
|
+
`,fn+=In):_n==="id"?Rt=In:_n==="event"?Ft=In:_n==="retry"?(Pe=De(In,Pe),Ze=Pe):_n==="heartbeatTimeout"&&(Be=De(In,Be),gt!==0&&(i(gt),gt=r(function(){$r()},Be)))}if(Gt===ee){if(fn!==""){ot=Rt,Ft===""&&(Ft="message");var hr=new q(Ft,{data:fn.slice(1),lastEventId:Rt});if(D.dispatchEvent(hr),Ft==="open"?_e(D,D.onopen,hr):Ft==="message"?_e(D,D.onmessage,hr):Ft==="error"&&_e(D,D.onerror,hr),At===pe)return}fn="",Ft=""}Gt=en==="\r".charCodeAt(0)?k:ee}else Gt===ee&&(Rr=Lt,Gt=xe),Gt===xe?en===":".charCodeAt(0)&&(jn=Lt+1,Gt=S):Gt===S&&(Gt=Te)}}},si=function(Tt){if(At===K||At===Y){At=V,gt!==0&&(i(gt),gt=0),gt=r(function(){$r()},Ze),Ze=Ue(Math.min(Pe*16,Ze*2)),D.readyState=Y;var Ot=new B("error",{error:Tt});D.dispatchEvent(Ot),_e(D,D.onerror,Ot),Tt!=null&&console.error(Tt)}},oi=function(){At=pe,bt!=null&&(bt.abort(),bt=void 0),gt!==0&&(i(gt),gt=0),D.readyState=pe},$r=function(){if(gt=0,At!==V){if(!Z&&bt!=null)si(new Error("No activity within "+Be+" milliseconds. "+(At===Y?"No response received.":Q+" chars received.")+" Reconnecting.")),bt!=null&&(bt.abort(),bt=void 0);else{var Tt=Math.max((Z||Date.now())+Be-Date.now(),1);Z=!1,gt=r(function(){$r()},Tt)}return}Z=!1,Q=0,gt=r(function(){$r()},Be),At=Y,fn="",Ft="",Rt=ot,Qt="",Rr=0,jn=0,Gt=ee;var Ot=ne;if(ne.slice(0,5)!=="data:"&&ne.slice(0,5)!=="blob:"&&ot!==""){var Xt=ne.indexOf("?");Ot=Xt===-1?ne:ne.slice(0,Xt+1)+ne.slice(Xt+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,function(In,hr){return hr===Le?"":In}),Ot+=(ne.indexOf("?")===-1?"?":"&")+Le+"="+encodeURIComponent(ot)}var en=D.withCredentials,Yt={};Yt.Accept="text/event-stream";var Lt=D.headers;if(Lt!=null)for(var _n in Lt)Object.prototype.hasOwnProperty.call(Lt,_n)&&(Yt[_n]=Lt[_n]);try{bt=St.open(Ge,fr,Ri,si,Ot,en,Yt)}catch(In){throw oi(),In}};D.url=ne,D.readyState=Y,D.withCredentials=he,D.headers=G,D._close=oi,$r()}ve.prototype=Object.create(O.prototype),ve.prototype.CONNECTING=Y,ve.prototype.OPEN=K,ve.prototype.CLOSED=pe,ve.prototype.close=function(){this._close()},ve.CONNECTING=Y,ve.OPEN=K,ve.CLOSED=pe,ve.prototype.withCredentials=void 0;var qe=l;s!=null&&(l==null||!("withCredentials"in l.prototype))&&(qe=ve),function(D){{var ne=D(t);ne!==void 0&&(e.exports=ne)}}(function(D){D.EventSourcePolyfill=ve,D.NativeEventSource=l,D.EventSource=qe})})(typeof globalThis>"u"?typeof window<"u"?window:typeof self<"u"?self:Me:globalThis)})(Ed,Ed.exports);var L2=Ed.exports;const D2=ai(L2),N2=(e,t={})=>{const n=new D2.EventSourcePolyfill(e,{headers:t.headers}),r=new Mb;return n.onopen=i=>r.emit("open",i),n.onmessage=i=>r.emit("message",i),n.onerror=i=>r.emit("error",i),{emitter:r,source:n}},j2=async(e,t={})=>{const{emitter:n,source:r}=N2(e,t);return await new Promise((i,s)=>{n.on("open",()=>{i()}),n.on("error",o=>{s(o)})}).finally(()=>n.cleanup()),{on:n.on.bind(n),close:()=>{n.cleanup(),r.close()}}},U2=H.object({type:H.literal("message_created"),data:H.object({id:H.string(),createdAt:H.string().datetime(),payload:H.union([H.object({audioUrl:H.string().min(1),className:H.string().describe("CSS className to apply to the message").optional(),type:H.literal("audio")}),H.object({title:H.string().min(1),subtitle:H.string().optional(),imageUrl:H.string().optional(),actions:H.array(H.object({action:H.enum(["postback","url","say"]),label:H.string().min(1),value:H.string().min(1)})),type:H.literal("card"),className:H.string().describe("CSS className to apply to the message").optional()}),H.object({items:H.array(H.object({title:H.string().min(1),subtitle:H.string().optional(),imageUrl:H.string().optional(),actions:H.array(H.object({action:H.enum(["postback","url","say"]),label:H.string().min(1),value:H.string().min(1)})),className:H.string().describe("CSS className to apply to the message").optional()})),className:H.string().describe("CSS className to apply to the message").optional(),type:H.literal("carousel")}),H.object({text:H.string(),options:H.array(H.object({label:H.string().min(1),value:H.string().min(1)})),className:H.string().describe("CSS className to apply to the message").optional(),type:H.literal("choice"),disableFreeText:H.boolean().optional()}),H.object({text:H.string(),options:H.array(H.object({label:H.string().min(1),value:H.string().min(1)})),className:H.string().describe("CSS className to apply to the message").optional(),type:H.literal("dropdown")}),H.object({fileUrl:H.string().min(1),title:H.string().min(1).optional(),className:H.string().describe("CSS className to apply to the message").optional(),type:H.literal("file")}),H.object({imageUrl:H.string().min(1),className:H.string().describe("CSS className to apply to the message").optional(),type:H.literal("image")}),H.object({latitude:H.number(),longitude:H.number(),address:H.string().optional(),title:H.string().optional(),className:H.string().describe("CSS className to apply to the message").optional(),type:H.literal("location")}),H.object({markdown:H.string().min(1),className:H.string().describe("CSS className to apply to the message").optional(),type:H.literal("markdown")}),H.object({text:H.string().min(1),className:H.string().describe("CSS className to apply to the message").optional(),type:H.literal("text")}),H.object({videoUrl:H.string().min(1),className:H.string().describe("CSS className to apply to the message").optional(),type:H.literal("video")})]),userId:H.string(),conversationId:H.string()})}),F2=H.object({type:H.literal("webchat_visibility"),data:H.object({visibility:H.enum(["show","hide","toggle"])})}),B2=H.object({type:H.literal("webchat_config"),data:H.object({config:H.record(H.any())})}),V2=H.object({type:H.literal("custom"),data:H.object({event:H.record(H.any())})}),z2={messageCreatedSignal:U2,webchatVisibilitySignal:F2,webchatConfigSignal:B2,customSignal:V2},Lb="unknown error",Ml=class Ml extends Mb{constructor(n){super();E(this,"_state",{status:"disconnected"});E(this,"connect",async()=>{if(this._state.status==="connected")return;if(this._state.status==="connecting"){await this._state.connectionPromise;return}const n=this._connect();this._state={status:"connecting",connectionPromise:n},await n});E(this,"disconnect",async()=>{if(this._state.status==="disconnected")return;let n;this._state.status==="connecting"?n=await this._state.connectionPromise:n=this._state.source,this._disconnectSync(n)});E(this,"_connect",async()=>{const n=await j2(`${this._props.url}/v1/conversations/${this._props.conversationId}/listen`,{headers:{"x-user-key":this._props.userKey}});return n.on("message",this._handleMessage),n.on("error",this._handleError(n)),this._state={status:"connected",source:n},n});E(this,"_disconnectSync",n=>{n.close(),this._state={status:"disconnected"}});E(this,"_handleMessage",n=>{const r=this._parseSignal(n.data);this.emit(r.type,r.data)});E(this,"_handleError",n=>r=>{this._disconnectSync(n);const i=this._toError(r);this.emit("error",i)});E(this,"_parseSignal",n=>{for(const r of Object.values(z2)){const i=this._safeJsonParse(n),s=r.safeParse(i);if(s.success)return s.data}return{type:"unknown",data:n}});E(this,"_safeJsonParse",n=>{try{return JSON.parse(n)}catch{return n}});E(this,"_toError",n=>{if(n instanceof Error)return n;if(typeof n=="string")return new Error(n);if(n===null)return new Error(Lb);if(typeof n=="object"&&"message"in n)return this._toError(n.message);try{const r=JSON.stringify(n);return new Error(r)}catch{return new Error(Lb)}});this._props=n}get status(){return this._state.status}};E(Ml,"listen",async n=>{const r=new Ml(n);return await r.connect(),r});let Sd=Ml;const Db=100*1024*1024,Z2=Db,W2=Db,H2=6e4;class q2{constructor(t){E(this,"_auto");E(this,"createConversation",t=>this._auto.createConversation(t));E(this,"getConversation",t=>this._auto.getConversation(t));E(this,"deleteConversation",t=>this._auto.deleteConversation(t));E(this,"listConversations",t=>this._auto.listConversations(t));E(this,"listConversationMessages",t=>this._auto.listConversationMessages(t));E(this,"addParticipant",t=>this._auto.addParticipant(t));E(this,"removeParticipant",t=>this._auto.removeParticipant(t));E(this,"getParticipant",t=>this._auto.getParticipant(t));E(this,"listParticipants",t=>this._auto.listParticipants(t));E(this,"createMessage",t=>this._auto.createMessage(t));E(this,"getMessage",t=>this._auto.getMessage(t));E(this,"deleteMessage",t=>this._auto.deleteMessage(t));E(this,"createUser",t=>this._auto.createUser(t));E(this,"getUser",t=>this._auto.getUser(t));E(this,"updateUser",t=>this._auto.updateUser(t));E(this,"deleteUser",t=>this._auto.deleteUser(t));E(this,"createEvent",t=>this._auto.createEvent(t));E(this,"getEvent",t=>this._auto.getEvent(t));E(this,"listenConversation",async({id:t,xUserKey:n})=>await Sd.listen({url:this.props.apiUrl,conversationId:t,userKey:n}));this.props=t;const{apiUrl:n}=t,r={...t.headers},i=t.timeout??H2,s=Pt.create({headers:r,withCredentials:!0,timeout:i,maxBodyLength:Z2,maxContentLength:W2});this._auto=new M2(void 0,n,s)}}const xl={disconnected:0,user_creating:1,user_created:2,conversation_creating:3,conversation_created:4},Nn=(e,t)=>e.status===t,Ai=(e,t)=>xl[e.status]<xl[t],Nb=(e,t)=>xl[e.status]>=xl[t];class hs extends Error{constructor(t){super(`Unexpected state: ${t.status}`),this.state=t}}class jb extends Fl{constructor(n){super();E(this,"_client");E(this,"_webhookId");E(this,"_state",{status:"disconnected"});E(this,"mode","pushpin");E(this,"_initialConnect",async n=>{if(Nb(this._state,"user_created"))throw new Error("Client is already connected. Please disconnect first.");if(Nn(this._state,"user_creating"))return;this._state={status:"user_creating"},console.log("createUser");const{user:{id:r},key:i}=await this._client.createUser({name:void 0,pictureUrl:void 0,userData:n});return this._state={status:"user_created",userId:r,userKey:i},{userId:r,userToken:i}});E(this,"_reConnect",async(n,r)=>{if(Nb(this._state,"user_created")){if(this._state.userId!==n.userId)throw new Error("Client is already connected. Please disconnect first.");return n}return Nn(this._state,"user_creating")||(this._state={status:"user_created",userId:n.userId,userKey:n.userToken},console.log("updateUser"),await this._client.updateUser({xUserKey:n.userToken,name:void 0,pictureUrl:void 0,userData:r})),n});E(this,"_mapMessage",n=>({id:n.id,conversationId:n.conversationId,authorId:n.userId,sentOn:new Date(n.createdAt),payload:YD(n.payload)}));const r=`${n.apiUrl}/${n.clientId}`;this._webhookId=n.clientId,this._client=new q2({apiUrl:r})}get clientId(){return this._webhookId}get userId(){if(!Ai(this._state,"user_created"))return this._state.userId}get conversationId(){if(!Ai(this._state,"conversation_created"))return this._state.conversationId}async connect(n,r){return n?await this.userExists(n)?this._reConnect(n,r):this._initialConnect(r):this._initialConnect(r)}async disconnect(){Nn(this._state,"conversation_created")?this._state.signalEmitter.cleanup():Nn(this._state,"conversation_creating")&&console.warn("zombie conversation..."),this._state={status:"disconnected"}}async sendMessage(n){if(Ai(this._state,"user_created"))throw new hs(this._state);if(Nn(this._state,"conversation_creating"))throw new hs(this._state);let r;Nn(this._state,"conversation_created")?r=this._state:(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},r=await this._createNewConversation(this._state)),console.log("createMessage"),await this._client.createMessage({xUserKey:r.userKey,conversationId:r.conversationId,payload:{type:"text",text:n}}),this.emit("messageSent",n)}async sendEvent(n){if(Ai(this._state,"user_created"))throw new hs(this._state);if(Nn(this._state,"conversation_creating"))throw new hs(this._state);let r;Nn(this._state,"conversation_created")?r=this._state:(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},r=await this._createNewConversation(this._state)),console.log("createEvent"),await this._client.createEvent({xUserKey:r.userKey,conversationId:r.conversationId,payload:{type:"custom",data:n}})}async switchConversation(n){if(Ai(this._state,"user_created"))throw new hs(this._state);Nn(this._state,"conversation_created")&&this._state.conversationId===n||Nn(this._state,"conversation_creating")||(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},await this._connectConversation(this._state,n))}async conversationExists(n){if(Ai(this._state,"user_created"))return!1;try{return await this._client.getConversation({xUserKey:this._state.userKey,id:n}),!0}catch(r){if(Cd(r)&&r.code===404)return!1;throw r}}async userExists({userToken:n}){try{return await this._client.getUser({xUserKey:n}),!0}catch(r){const i=s=>s.code===404||s.code===401;if(Cd(r)&&i(r))return!1;throw r}}async newConversation(){if(Ai(this._state,"user_created"))throw new hs(this._state);Nn(this._state,"conversation_creating")||(this._state={status:"conversation_creating",userId:this._state.userId,userKey:this._state.userKey},await this._createNewConversation(this._state))}async _createNewConversation(n){console.log("createConversation");const{conversation:{id:r}}=await this._client.createConversation({xUserKey:n.userKey}),i=await this._connectConversation(n,r);return await this._client.createEvent({xUserKey:n.userKey,conversationId:r,payload:{type:"conversation_started",data:{}}}),i}async listMessages(){if(!Nn(this._state,"conversation_created"))return[];const{conversationId:n,userKey:r}=this._state,i=[];let s;do{const o=await this._client.listConversationMessages({id:n,xUserKey:r,nextToken:s});i.push(...o.messages),s=o.meta.nextToken}while(s);return i.map(this._mapMessage)}async _connectConversation(n,r){const i=await this._client.listenConversation({id:r,xUserKey:n.userKey});return i.on("unknown",s=>console.log("unknown event",s)),i.on("message_created",s=>{s.userId!==n.userId&&this.emit("message",this._mapMessage(s))}),i.on("error",()=>{this._state={status:"user_created",userId:n.userId,userKey:n.userKey},this.emit("error",new Error("Connection to conversation lost"))}),i.on("webchat_visibility",s=>{this.emit("webchatVisibility",s.visibility)}),i.on("webchat_config",s=>{this.emit("webchatConfig",s.config)}),i.on("custom",s=>{this.emit("customEvent",s.event)}),this.emit("conversation",r),this._state={status:"conversation_created",userId:n.userId,userKey:n.userKey,conversationId:r,signalEmitter:i},this._state}}const K2=({clientId:e,apiUrl:t,mode:n="messaging"})=>{const[r,i]=_.useState();return _.useEffect(()=>{const s=n==="messaging"?new rb({url:t,clientId:e}):new jb({apiUrl:t,clientId:e});i(s)},[e,t,n]),r},Ub=_.memo(_.forwardRef((e,t)=>{const{state:n,theme:{composer:r},client:i}=mt(),[s,o]=_.useState(""),[a,l]=_.useState(-1);if(n.isReadOnly||!i)return null;const c=()=>{s&&(i.sendMessage(s),o(""),l(-1))};return z.jsx(np.Provider,{value:{value:s,setValue:o,historyIndex:a,setHistoryIndex:l,sendMessage:c},children:z.jsx("div",{"data-disabled":n.disableComposer,...e,...r==null?void 0:r.container,ref:t})})})),Fb=_.memo(({...e})=>{const{state:t,theme:{composer:n}}=mt(),{value:r,setValue:i,historyIndex:s,setHistoryIndex:o,sendMessage:a}=rp(),l=_.useRef(null),c=Hr(d=>d.user),u=Hr(d=>d.messageHistory);return _.useEffect(()=>{l.current&&(l.current.selectionStart=l.current.value.length,l.current.selectionEnd=l.current.value.length)},[r]),z.jsx("textarea",{...n==null?void 0:n.input,disabled:t.disableComposer,ref:l,value:r,"data-has-value":!!r,onChange:d=>i(d.target.value),onKeyDown:d=>{if(!t.disableComposer){if(d.key==="Enter"&&(d.preventDefault(),a()),d.key==="ArrowUp"){d.preventDefault();const h=u[(c==null?void 0:c.userId)??""]??[];s<h.length-1&&i(h[s+1]),o(()=>Math.min(s+1,h.length-1))}if(d.key==="ArrowDown"){d.preventDefault();const h=u[(c==null?void 0:c.userId)??""]??[];i(s===0?"":h[s-1]),o(()=>Math.max(s-1,-1))}}},...e})}),Bb=_.memo(_.forwardRef(({icon:e=iT,...t},n)=>{var o,a;const{value:r,sendMessage:i}=rp(),{theme:{composer:s}}=mt();return z.jsx("button",{ref:n,...t,...(o=s==null?void 0:s.button)==null?void 0:o.container,disabled:!r,onClick:i,children:z.jsx(e,{...(a=s==null?void 0:s.button)==null?void 0:a.icon})})})),Vb=({children:e})=>{const[t,n]=_.useState(!1),[r,i]=_.useState(""),[s,o]=_.useState(null),a=({title:c,content:u})=>{i(c),o(u),n(!0)},l=()=>{n(!1)};return z.jsxs(sp.Provider,{value:{hideModal:l,showModal:a,title:r,content:s,open:t},children:[z.jsx(ii,{open:t,onOpenChange:n,children:z.jsx(ii.Content,{title:r,children:s})}),e]})},J2=({theme:e={},renderers:t,client:n,children:r,configuration:i={},userData:s,closeWindow:o,...a})=>{const[l,c]=_.useState(0),[u,d]=_.useState([]),[h,f]=_.useState({disableComposer:!1,...a.defaultState,connected:!0}),[p,m]=_.useState(i),[y,v]=_.useState(e),b=Hr(F=>F.addMessageToHistory),x=Hr(F=>F.setConversationId),I=Hr(F=>F.user),P=Hr(F=>F.conversationId),T=Hr(F=>F.setUser),j=Hr(F=>F.setClientMode),U={...a,value:{theme:y,renderers:{...uu,...t},messages:u,setMessages:d,eventEmitter:Qw,configuration:i,setConfiguration:m,state:h,closeWindow:o,setState:F=>f({...h,...F}),setTheme:F=>{v(F)},client:n?{...n,sendMessage:async F=>{await n.sendMessage(F),d(O=>[...O,{direction:"outgoing",sender:{name:"You"},timestamp:new Date,block:{type:"bubble",block:{type:"text",text:F}}}]),n.userId&&b({message:F,userId:n.userId})},on:n.on,restartConversation:async()=>{await n.newConversation(),d([])}}:void 0}};return bi(()=>{n&&j(n.mode)}),bi(()=>{if(n)return n.on("message",F=>{try{const O=F.payload;d(N=>[...N,{direction:"incoming",sender:{name:p.botName??"Bot",avatar:p.botAvatar},timestamp:new Date(F.sentOn),block:O}])}catch{console.error("Invalid message payload")}})}),vu(async()=>{if(n)return n.on("error",()=>{console.log("client disconnected"),c(F=>F+1)})}),bi(()=>{if(n)return n.on("conversation",F=>{x(F)})}),vu(async()=>{if(!n)return;let F;try{F=await n.connect(I,s),f(N=>({...N,connected:!0}))}catch{f(J=>({...J,connected:!1}));return}T(F),P&&await n.conversationExists(P)?await n.switchConversation(P):await n.newConversation();const O=[];for(const N of await n.listMessages())try{const J=N.payload,q=N.authorId===n.userId?"outgoing":"incoming";O.push({direction:q,sender:q==="outgoing"?{name:"You"}:{name:p.botName??"Bot",avatar:p.botAvatar},timestamp:new Date(N.sentOn),block:J})}catch{console.error("Invalid message payload")}return d(O.reverse()),()=>{n.disconnect()}},[l]),z.jsx(ap.Provider,{...U,children:typeof r=="function"?r(p):r})};function Pr(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}const G2=R["useId".toString()]||(()=>{});let Y2=0;function _l(e){const[t,n]=R.useState(G2());return xs(()=>{e||n(r=>r??String(Y2++))},[e]),e||(t?`radix-${t}`:"")}function zb({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=Q2({defaultProp:t,onChange:n}),s=e!==void 0,o=s?e:r,a=Mr(n),l=_.useCallback(c=>{if(s){const d=typeof c=="function"?c(e):c;d!==e&&a(d)}else i(c)},[s,e,i,a]);return[o,l]}function Q2({defaultProp:e,onChange:t}){const n=_.useState(e),[r]=n,i=_.useRef(r),s=Mr(t);return _.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}function X2(e,t=globalThis==null?void 0:globalThis.document){const n=Mr(e);_.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const Td="dismissableLayer.update",ej="dismissableLayer.pointerDownOutside",tj="dismissableLayer.focusOutside";let Zb;const nj=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rj=_.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:a,onDismiss:l,...c}=e,u=_.useContext(nj),[d,h]=_.useState(null),f=(n=d==null?void 0:d.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,p]=_.useState({}),m=li(t,U=>h(U)),y=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),x=d?y.indexOf(d):-1,I=u.layersWithOutsidePointerEventsDisabled.size>0,P=x>=b,T=ij(U=>{const F=U.target,O=[...u.branches].some(N=>N.contains(F));!P||O||(s==null||s(U),a==null||a(U),U.defaultPrevented||l==null||l())},f),j=sj(U=>{const F=U.target;[...u.branches].some(N=>N.contains(F))||(o==null||o(U),a==null||a(U),U.defaultPrevented||l==null||l())},f);return X2(U=>{x===u.layers.size-1&&(i==null||i(U),!U.defaultPrevented&&l&&(U.preventDefault(),l()))},f),_.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Zb=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Wb(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Zb)}},[d,f,r,u]),_.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Wb())},[d,u]),_.useEffect(()=>{const U=()=>p({});return document.addEventListener(Td,U),()=>document.removeEventListener(Td,U)},[]),_.createElement(Pn.div,_t({},c,{ref:m,style:{pointerEvents:I?P?"auto":"none":void 0,...e.style},onFocusCapture:Pr(e.onFocusCapture,j.onFocusCapture),onBlurCapture:Pr(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:Pr(e.onPointerDownCapture,T.onPointerDownCapture)}))});function ij(e,t=globalThis==null?void 0:globalThis.document){const n=Mr(e),r=_.useRef(!1),i=_.useRef(()=>{});return _.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let c=function(){Hb(ej,n,l,{discrete:!0})};const l={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function sj(e,t=globalThis==null?void 0:globalThis.document){const n=Mr(e),r=_.useRef(!1);return _.useEffect(()=>{const i=s=>{s.target&&!r.current&&Hb(tj,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Wb(){const e=new CustomEvent(Td);document.dispatchEvent(e)}function Hb(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Hw(i,s):i.dispatchEvent(s)}const Od="focusScope.autoFocusOnMount",Id="focusScope.autoFocusOnUnmount",qb={bubbles:!1,cancelable:!0},oj=_.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=e,[a,l]=_.useState(null),c=Mr(i),u=Mr(s),d=_.useRef(null),h=li(t,m=>l(m)),f=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let m=function(x){if(f.paused||!a)return;const I=x.target;a.contains(I)?d.current=I:ri(d.current,{select:!0})},y=function(x){if(f.paused||!a)return;const I=x.relatedTarget;I!==null&&(a.contains(I)||ri(d.current,{select:!0}))},v=function(x){const I=document.activeElement;for(const P of x)P.removedNodes.length>0&&(a!=null&&a.contains(I)||ri(a))};document.addEventListener("focusin",m),document.addEventListener("focusout",y);const b=new MutationObserver(v);return a&&b.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",y),b.disconnect()}}},[r,a,f.paused]),_.useEffect(()=>{if(a){Gb.add(f);const m=document.activeElement;if(!a.contains(m)){const v=new CustomEvent(Od,qb);a.addEventListener(Od,c),a.dispatchEvent(v),v.defaultPrevented||(aj(fj(Kb(a)),{select:!0}),document.activeElement===m&&ri(a))}return()=>{a.removeEventListener(Od,c),setTimeout(()=>{const v=new CustomEvent(Id,qb);a.addEventListener(Id,u),a.dispatchEvent(v),v.defaultPrevented||ri(m??document.body,{select:!0}),a.removeEventListener(Id,u),Gb.remove(f)},0)}}},[a,c,u,f]);const p=_.useCallback(m=>{if(!n&&!r||f.paused)return;const y=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,v=document.activeElement;if(y&&v){const b=m.currentTarget,[x,I]=lj(b);x&&I?!m.shiftKey&&v===I?(m.preventDefault(),n&&ri(x,{select:!0})):m.shiftKey&&v===x&&(m.preventDefault(),n&&ri(I,{select:!0})):v===b&&m.preventDefault()}},[n,r,f.paused]);return _.createElement(Pn.div,_t({tabIndex:-1},o,{ref:h,onKeyDown:p}))});function aj(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ri(r,{select:t}),document.activeElement!==n)return}function lj(e){const t=Kb(e),n=Jb(t,e),r=Jb(t.reverse(),e);return[n,r]}function Kb(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Jb(e,t){for(const n of e)if(!cj(n,{upTo:t}))return n}function cj(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function uj(e){return e instanceof HTMLInputElement&&"select"in e}function ri(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&uj(e)&&t&&e.select()}}const Gb=dj();function dj(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Yb(e,t),e.unshift(t)},remove(t){var n;e=Yb(e,t),(n=e[0])===null||n===void 0||n.resume()}}}function Yb(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function fj(e){return e.filter(t=>t.tagName!=="A")}function hj(e,t){return _.useReducer((n,r)=>{const i=t[n][r];return i??n},e)}const kl=e=>{const{present:t,children:n}=e,r=pj(t),i=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),s=li(r.ref,i.ref);return typeof n=="function"||r.isPresent?_.cloneElement(i,{ref:s}):null};kl.displayName="Presence";function pj(e){const[t,n]=_.useState(),r=_.useRef({}),i=_.useRef(e),s=_.useRef("none"),o=e?"mounted":"unmounted",[a,l]=hj(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const c=Cl(r.current);s.current=a==="mounted"?c:"none"},[a]),xs(()=>{const c=r.current,u=i.current;if(u!==e){const h=s.current,f=Cl(c);e?l("MOUNT"):f==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==f?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),xs(()=>{if(t){const c=d=>{const f=Cl(r.current).includes(d.animationName);d.target===t&&f&&Gn.flushSync(()=>l("ANIMATION_END"))},u=d=>{d.target===t&&(s.current=Cl(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:_.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Cl(e){return(e==null?void 0:e.animationName)||"none"}let Pd=0;function mj(){_.useEffect(()=>{var e,t;const n=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=n[0])!==null&&e!==void 0?e:Qb()),document.body.insertAdjacentElement("beforeend",(t=n[1])!==null&&t!==void 0?t:Qb()),Pd++,()=>{Pd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Pd--}},[])}function Qb(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var El="right-scroll-bar-position",Sl="width-before-scroll-bar",gj="with-scroll-bars-hidden",yj="--removed-body-scroll-bar-size";function vj(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function bj(e,t){var n=_.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}function wj(e,t){return bj(t||null,function(n){return e.forEach(function(r){return vj(r,n)})})}function xj(e){return e}function _j(e,t){t===void 0&&(t=xj);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var o=t(s,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(r=!0;n.length;){var o=n;n=[],o.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(s),o=n}var l=function(){var u=o;o=[],u.forEach(s)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(u){o.push(u),c()},filter:function(u){return o=o.filter(u),n}}}};return i}function kj(e){e===void 0&&(e={});var t=_j(null);return t.options=Mn({async:!0,ssr:!1},e),t}var Xb=function(e){var t=e.sideCar,n=Lm(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return R.createElement(r,Mn({},n))};Xb.isSideCarExport=!0;function Cj(e,t){return e.useMedium(t),Xb}var ew=kj(),Ad=function(){},Tl=R.forwardRef(function(e,t){var n=R.useRef(null),r=R.useState({onScrollCapture:Ad,onWheelCapture:Ad,onTouchMoveCapture:Ad}),i=r[0],s=r[1],o=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,h=e.sideCar,f=e.noIsolation,p=e.inert,m=e.allowPinchZoom,y=e.as,v=y===void 0?"div":y,b=Lm(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),x=h,I=wj([n,t]),P=Mn(Mn({},b),i);return R.createElement(R.Fragment,null,u&&R.createElement(x,{sideCar:ew,removeScrollBar:c,shards:d,noIsolation:f,inert:p,setCallbacks:s,allowPinchZoom:!!m,lockRef:n}),o?R.cloneElement(R.Children.only(a),Mn(Mn({},P),{ref:I})):R.createElement(v,Mn({},P,{className:l,ref:I}),a))});Tl.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Tl.classNames={fullWidth:Sl,zeroRight:El};var tw,Ej=function(){if(tw)return tw;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Sj(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Ej();return t&&e.setAttribute("nonce",t),e}function Tj(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Oj(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ij=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Sj())&&(Tj(t,n),Oj(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Pj=function(){var e=Ij();return function(t,n){R.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},nw=function(){var e=Pj(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},Aj={left:0,top:0,right:0,gap:0},Rd=function(e){return parseInt(e||"",10)||0},Rj=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Rd(n),Rd(r),Rd(i)]},$j=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Aj;var t=Rj(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Mj=nw(),Lj=function(e,t,n,r){var i=e.left,s=e.top,o=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
|
289
|
+
.`.concat(gj,` {
|
|
290
290
|
overflow: hidden `).concat(r,`;
|
|
291
291
|
padding-right: `).concat(a,"px ").concat(r,`;
|
|
292
292
|
}
|
|
@@ -303,26 +303,26 @@ to {
|
|
|
303
303
|
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
304
304
|
}
|
|
305
305
|
|
|
306
|
-
.`).concat(
|
|
306
|
+
.`).concat(El,` {
|
|
307
307
|
right: `).concat(a,"px ").concat(r,`;
|
|
308
308
|
}
|
|
309
309
|
|
|
310
|
-
.`).concat(
|
|
310
|
+
.`).concat(Sl,` {
|
|
311
311
|
margin-right: `).concat(a,"px ").concat(r,`;
|
|
312
312
|
}
|
|
313
313
|
|
|
314
|
-
.`).concat(
|
|
314
|
+
.`).concat(El," .").concat(El,` {
|
|
315
315
|
right: 0 `).concat(r,`;
|
|
316
316
|
}
|
|
317
317
|
|
|
318
|
-
.`).concat(
|
|
318
|
+
.`).concat(Sl," .").concat(Sl,` {
|
|
319
319
|
margin-right: 0 `).concat(r,`;
|
|
320
320
|
}
|
|
321
321
|
|
|
322
322
|
body {
|
|
323
|
-
`).concat(
|
|
323
|
+
`).concat(yj,": ").concat(a,`px;
|
|
324
324
|
}
|
|
325
|
-
`)},
|
|
325
|
+
`)},Dj=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r,s=R.useMemo(function(){return $j(i)},[i]);return R.createElement(Mj,{styles:Lj(s,!t,i,n?"":"!important")})},$d=!1;if(typeof window<"u")try{var Ol=Object.defineProperty({},"passive",{get:function(){return $d=!0,!0}});window.addEventListener("test",Ol,Ol),window.removeEventListener("test",Ol,Ol)}catch{$d=!1}var ps=$d?{passive:!1}:!1,Nj=function(e){return e.tagName==="TEXTAREA"},rw=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Nj(e)&&n[t]==="visible")},jj=function(e){return rw(e,"overflowY")},Uj=function(e){return rw(e,"overflowX")},iw=function(e,t){var n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var r=sw(e,n);if(r){var i=ow(e,n),s=i[1],o=i[2];if(s>o)return!0}n=n.parentNode}while(n&&n!==document.body);return!1},Fj=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Bj=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},sw=function(e,t){return e==="v"?jj(t):Uj(t)},ow=function(e,t){return e==="v"?Fj(t):Bj(t)},Vj=function(e,t){return e==="h"&&t==="rtl"?-1:1},zj=function(e,t,n,r,i){var s=Vj(e,window.getComputedStyle(t).direction),o=s*r,a=n.target,l=t.contains(a),c=!1,u=o>0,d=0,h=0;do{var f=ow(e,a),p=f[0],m=f[1],y=f[2],v=m-y-s*p;(p||v)&&sw(e,a)&&(d+=v,h+=p),a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(i&&d===0||!i&&o>d)||!u&&(i&&h===0||!i&&-o>h))&&(c=!0),c},Il=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},aw=function(e){return[e.deltaX,e.deltaY]},lw=function(e){return e&&"current"in e?e.current:e},Zj=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Wj=function(e){return`
|
|
326
326
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
327
327
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
328
|
-
`)},b2=0,ls=[];function w2(e){var t=$.useRef([]),n=$.useRef([0,0]),r=$.useRef(),i=$.useState(b2++)[0],s=$.useState(function(){return sb()})[0],o=$.useRef(e);$.useEffect(function(){o.current=e},[e]),$.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var m=sI([e.lockRef.current],(e.shards||[]).map(db),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=$.useCallback(function(m,y){if("touches"in m&&m.touches.length===2)return!o.current.allowPinchZoom;var v=vl(m),b=n.current,x="deltaX"in m?m.deltaX:b[0]-v[0],P="deltaY"in m?m.deltaY:b[1]-v[1],A,O=m.target,U=Math.abs(x)>Math.abs(P)?"h":"v";if("touches"in m&&U==="h"&&O.type==="range")return!1;var F=ab(U,O);if(!F)return!0;if(F?A=U:(A=U==="v"?"h":"v",F=ab(U,O)),!F)return!1;if(!r.current&&"changedTouches"in m&&(x||P)&&(r.current=A),!A)return!0;var B=r.current||A;return g2(B,y,m,B==="h"?x:P,!0)},[]),l=$.useCallback(function(m){var y=m;if(!(!ls.length||ls[ls.length-1]!==s)){var v="deltaY"in y?ub(y):vl(y),b=t.current.filter(function(A){return A.name===y.type&&A.target===y.target&&y2(A.delta,v)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var x=(o.current.shards||[]).map(db).filter(Boolean).filter(function(A){return A.contains(y.target)}),P=x.length>0?a(y,x[0]):!o.current.noIsolation;P&&y.cancelable&&y.preventDefault()}}},[]),c=$.useCallback(function(m,y,v,b){var x={name:m,delta:y,target:v,should:b};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(P){return P!==x})},1)},[]),u=$.useCallback(function(m){n.current=vl(m),r.current=void 0},[]),d=$.useCallback(function(m){c(m.type,ub(m),m.target,a(m,e.lockRef.current))},[]),h=$.useCallback(function(m){c(m.type,vl(m),m.target,a(m,e.lockRef.current))},[]);$.useEffect(function(){return ls.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,as),document.addEventListener("touchmove",l,as),document.addEventListener("touchstart",u,as),function(){ls=ls.filter(function(m){return m!==s}),document.removeEventListener("wheel",l,as),document.removeEventListener("touchmove",l,as),document.removeEventListener("touchstart",u,as)}},[]);var f=e.removeScrollBar,p=e.inert;return $.createElement($.Fragment,null,p?$.createElement(s,{styles:v2(i)}):null,f?$.createElement(c2,{gapMode:"margin"}):null)}const x2=Yj(rb,w2);var fb=$.forwardRef(function(e,t){return $.createElement(gl,An({},e,{ref:t,sideCar:x2}))});fb.classNames=gl.classNames;const _2=fb;var k2=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},cs=new WeakMap,bl=new WeakMap,wl={},xd=0,hb=function(e){return e&&(e.host||hb(e.parentNode))},C2=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=hb(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},E2=function(e,t,n,r){var i=C2(t,Array.isArray(e)?e:[e]);wl[n]||(wl[n]=new WeakMap);var s=wl[n],o=[],a=new Set,l=new Set(i),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};i.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(a.has(h))u(h);else{var f=h.getAttribute(r),p=f!==null&&f!=="false",m=(cs.get(h)||0)+1,y=(s.get(h)||0)+1;cs.set(h,m),s.set(h,y),o.push(h),m===1&&p&&bl.set(h,!0),y===1&&h.setAttribute(n,"true"),p||h.setAttribute(r,"true")}})};return u(t),a.clear(),xd++,function(){o.forEach(function(d){var h=cs.get(d)-1,f=s.get(d)-1;cs.set(d,h),s.set(d,f),h||(bl.has(d)||d.removeAttribute(r),bl.delete(d)),f||d.removeAttribute(n)}),xd--,xd||(cs=new WeakMap,cs=new WeakMap,bl=new WeakMap,wl={})}},S2=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||k2(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),E2(r,i,n,"aria-hidden")):function(){return null}};const pb="Dialog",[mb,MF]=Sl(pb),[T2,Sr]=mb(pb),O2=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!0}=e,a=_.useRef(null),l=_.useRef(null),[c=!1,u]=Hv({prop:r,defaultProp:i,onChange:s});return _.createElement(T2,{scope:t,triggerRef:a,contentRef:l,contentId:dl(),titleId:dl(),descriptionId:dl(),open:c,onOpenChange:u,onOpenToggle:_.useCallback(()=>u(d=>!d),[u]),modal:o},n)},I2="DialogTrigger",P2=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Sr(I2,n),s=ni(t,i.triggerRef);return _.createElement(Tn.button,wt({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":kd(i.open)},r,{ref:s,onClick:Er(e.onClick,i.onOpenToggle)}))}),A2="DialogPortal",[LF,gb]=mb(A2,{forceMount:void 0}),_d="DialogOverlay",R2=_.forwardRef((e,t)=>{const n=gb(_d,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Sr(_d,e.__scopeDialog);return s.modal?_.createElement(fl,{present:r||s.open},_.createElement($2,wt({},i,{ref:t}))):null}),$2=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Sr(_d,n);return _.createElement(_2,{as:Tl,allowPinchZoom:!0,shards:[i.contentRef]},_.createElement(Tn.div,wt({"data-state":kd(i.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),ho="DialogContent",M2=_.forwardRef((e,t)=>{const n=gb(ho,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Sr(ho,e.__scopeDialog);return _.createElement(fl,{present:r||s.open},s.modal?_.createElement(L2,wt({},i,{ref:t})):_.createElement(D2,wt({},i,{ref:t})))}),L2=_.forwardRef((e,t)=>{const n=Sr(ho,e.__scopeDialog),r=_.useRef(null),i=ni(t,n.contentRef,r);return _.useEffect(()=>{const s=r.current;if(s)return S2(s)},[]),_.createElement(yb,wt({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Er(e.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=n.triggerRef.current)===null||o===void 0||o.focus()}),onPointerDownOutside:Er(e.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:Er(e.onFocusOutside,s=>s.preventDefault())}))}),D2=_.forwardRef((e,t)=>{const n=Sr(ho,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return _.createElement(yb,wt({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o;if((o=e.onCloseAutoFocus)===null||o===void 0||o.call(e,s),!s.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),s.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:s=>{var o,a;(o=e.onInteractOutside)===null||o===void 0||o.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=s.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}}))}),yb=_.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=e,a=Sr(ho,n),l=_.useRef(null),c=ni(t,l);return Vj(),_.createElement(_.Fragment,null,_.createElement($j,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s},_.createElement(Pj,wt({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":kd(a.open)},o,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),N2="DialogTitle",j2=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Sr(N2,n);return _.createElement(Tn.h2,wt({id:i.titleId},r,{ref:t}))}),U2="DialogClose",F2=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Sr(U2,n);return _.createElement(Tn.button,wt({type:"button"},r,{ref:t,onClick:Er(e.onClick,()=>i.onOpenChange(!1))}))});function kd(e){return e?"open":"closed"}const B2=O2,V2=P2,z2=R2,Z2=M2,W2=j2,vb=F2;function H2({title:e,titleId:t,...n},r){return $.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?$.createElement("title",{id:t},e):null,$.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}))}const bb=$.forwardRef(H2);function Qr({open:e,onOpenChange:t,children:n}){return Z.jsx(B2,{open:e,onOpenChange:t,children:n})}function q2({title:e,children:t}){var r,i,s,o,a,l,c,u;const{theme:{modal:n}}=ht();return Z.jsxs(Z.Fragment,{children:[Z.jsx(z2,{...n==null?void 0:n.overlay}),Z.jsx("div",{...n==null?void 0:n.container,children:Z.jsxs(Z2,{...(r=n==null?void 0:n.dialog)==null?void 0:r.container,children:[Z.jsxs("div",{...(s=(i=n==null?void 0:n.dialog)==null?void 0:i.title)==null?void 0:s.container,children:[Z.jsx(W2,{...(a=(o=n==null?void 0:n.dialog)==null?void 0:o.title)==null?void 0:a.text,children:e}),Z.jsx(vb,{children:Z.jsx(bb,{role:"button",tabIndex:0,...(c=(l=n==null?void 0:n.dialog)==null?void 0:l.title)==null?void 0:c.closeIcon})})]}),Z.jsx("div",{...(u=n==null?void 0:n.dialog)==null?void 0:u.content,children:t})]})})]})}Qr.Button=V2,Qr.Close=vb,Qr.Content=q2;const wb=_.forwardRef(({children:e,...t},n)=>{const{theme:{container:r}}=ht();return Z.jsxs("div",{...t,...r,ref:n,children:[Z.jsx(_E,{}),Z.jsxs(Wv,{children:[Z.jsx(K2,{}),e]})]})}),K2=()=>{const{theme:{modal:e},state:{connected:t}}=ht(),{showModal:n}=qh();return _.useEffect(()=>{var r,i,s,o;t||n({title:"Connection Error",content:Z.jsxs(Z.Fragment,{children:[Z.jsx("p",{...(i=(r=e==null?void 0:e.dialog)==null?void 0:r.newConversation)==null?void 0:i.text,children:"There was an error connecting to the server. Please check your internet connection and try again."}),Z.jsx(Qr.Close,{asChild:!0,children:Z.jsx("button",{...(o=(s=e==null?void 0:e.dialog)==null?void 0:s.newConversation)==null?void 0:o.button,onClick:()=>window.location.reload(),children:"Restart"})})]})})},[t]),Z.jsx(Z.Fragment,{})},J2=_.forwardRef(({children:e,onClick:t,...n},r)=>{const{theme:{fab:i}}=ht(),{container:s,icon:o}=i??{};return Z.jsx("div",{...n,...s,ref:r,onClick:t,children:Z.jsx("div",{...o})})}),xb="Collapsible",[G2,NF]=Sl(xb),[Y2,Cd]=G2(xb),Q2=_.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:s,onOpenChange:o,...a}=e,[l=!1,c]=Hv({prop:r,defaultProp:i,onChange:o});return _.createElement(Y2,{scope:n,disabled:s,contentId:dl(),open:l,onOpenToggle:_.useCallback(()=>c(u=>!u),[c])},_.createElement(Tn.div,wt({"data-state":Ed(l),"data-disabled":s?"":void 0},a,{ref:t})))}),X2="CollapsibleTrigger",eU=_.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=Cd(X2,n);return _.createElement(Tn.button,wt({type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Ed(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},r,{ref:t,onClick:Er(e.onClick,i.onOpenToggle)}))}),_b="CollapsibleContent",tU=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Cd(_b,e.__scopeCollapsible);return _.createElement(fl,{present:n||i.open},({present:s})=>_.createElement(nU,wt({},r,{ref:t,present:s})))}),nU=_.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...s}=e,o=Cd(_b,n),[a,l]=_.useState(r),c=_.useRef(null),u=ni(t,c),d=_.useRef(0),h=d.current,f=_.useRef(0),p=f.current,m=o.open||a,y=_.useRef(m),v=_.useRef();return _.useEffect(()=>{const b=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(b)},[]),ps(()=>{const b=c.current;if(b){v.current=v.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const x=b.getBoundingClientRect();d.current=x.height,f.current=x.width,y.current||(b.style.transitionDuration=v.current.transitionDuration,b.style.animationName=v.current.animationName),l(r)}},[o.open,r]),_.createElement(Tn.div,wt({"data-state":Ed(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!m},s,{ref:u,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...e.style}}),m&&i)});function Ed(e){return e?"open":"closed"}const rU=Q2,iU=eU,sU=tU,oU=e=>$.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16",...e},$.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M15.5 5.5v-5m0 0h-5m5 0L8.833 7.167m-2.5-5H4.5c-1.4 0-2.1 0-2.635.272A2.5 2.5 0 0 0 .772 3.532C.5 4.066.5 4.767.5 6.167V11.5c0 1.4 0 2.1.272 2.635a2.5 2.5 0 0 0 1.093 1.092C2.4 15.5 3.1 15.5 4.5 15.5h5.333c1.4 0 2.1 0 2.635-.273a2.5 2.5 0 0 0 1.093-1.092c.272-.535.272-1.235.272-2.635V9.667"})),aU=_.memo(_.forwardRef((e,t)=>{const{theme:{header:n}}=ht(),[r,i]=_.useState(!1);return Z.jsx(rU,{...e,...n==null?void 0:n.container,open:r,onOpenChange:i,ref:t})})),lU=_.forwardRef((e,t)=>{var r;const{theme:{header:n}}=ht();return Z.jsx(iU,{...e,...(r=n==null?void 0:n.content)==null?void 0:r.container,ref:t})}),cU=_.forwardRef((e,t)=>{var r;const{theme:{header:n}}=ht();return Z.jsx(sU,{...e,...(r=n==null?void 0:n.expandedContent)==null?void 0:r.container,ref:t})}),uU=_.forwardRef(({src:e,children:t},n)=>{var s;const{theme:{header:r},client:i}=ht();return Z.jsx(Pl,{ref:n,userId:i==null?void 0:i.clientId,children:t,src:e,...(s=r==null?void 0:r.content)==null?void 0:s.avatar})}),dU=_.forwardRef((e,t)=>{var r;const{theme:{header:n}}=ht();return Z.jsx("h2",{...e,...(r=n==null?void 0:n.content)==null?void 0:r.title,ref:t})}),fU=_.forwardRef((e,t)=>{var r;const{theme:{header:n}}=ht();return Z.jsx("p",{...e,...(r=n==null?void 0:n.content)==null?void 0:r.description,ref:t})}),hU=_.forwardRef((e,t)=>{var r,i;const{theme:{header:n}}=ht();return Z.jsx("div",{...e,...(i=(r=n==null?void 0:n.content)==null?void 0:r.actions)==null?void 0:i.container,ref:t})}),En=Object.assign(aU,{Content:lU,ExpandedContent:cU,Avatar:uU,Description:fU,Title:dU,Actions:hU,DescriptionItem:({icon:e,title:t,link:n,...r})=>{var a,l,c,u,d,h,f,p,m,y,v,b;const{theme:{header:i}}=ht(),s=e??oU,o=x=>{x&&AC(x)};return!n&&!t?null:n?Z.jsxs("a",{...r,...(l=(a=i==null?void 0:i.expandedContent)==null?void 0:a.descriptionItems)==null?void 0:l.container,href:n,target:"_blank",rel:"noopener",children:[Z.jsx(s,{...(u=(c=i==null?void 0:i.expandedContent)==null?void 0:c.descriptionItems)==null?void 0:u.icon}),Z.jsx("p",{...(h=(d=i==null?void 0:i.expandedContent)==null?void 0:d.descriptionItems)==null?void 0:h.link,children:t})]}):Z.jsxs("div",{...r,...(p=(f=i==null?void 0:i.expandedContent)==null?void 0:f.descriptionItems)==null?void 0:p.container,onClick:x=>{o(x.currentTarget.textContent)},children:[Z.jsx(s,{...(y=(m=i==null?void 0:i.expandedContent)==null?void 0:m.descriptionItems)==null?void 0:y.icon}),Z.jsx("p",{...(b=(v=i==null?void 0:i.expandedContent)==null?void 0:v.descriptionItems)==null?void 0:b.text,children:t})]})}}),kb=_.memo(({...e})=>{const{theme:{loadingIndicator:t}}=ht();return Z.jsx("div",{...e,...t==null?void 0:t.container,children:Z.jsx("div",{...t==null?void 0:t.loader})})}),Sd=_.forwardRef(({direction:e,block:t,scroll:n,disableInput:r,children:i,sender:s,...o},a)=>{var m,y,v,b;const[l,c]=_.useState([]),{theme:{message:u},configuration:{botAvatar:d,botName:h},client:f}=ht();fI(()=>{n()}),_.useEffect(()=>{l.length===0&&n()},[l.length]);const p=Ud((f==null?void 0:f.clientId)??"",15);return Z.jsx(Wh.Provider,{value:{isLoading:l,setIsLoading:c},children:Z.jsxs("div",{...o,...u==null?void 0:u.container,"data-loaded":l.length===0,"data-disable-input":!!r,"data-direction":e,ref:a,children:[Z.jsxs(Dd,{"data-color":p,...(m=u==null?void 0:u.avatar)==null?void 0:m.container,children:[Z.jsx(Nd,{...(y=u==null?void 0:u.avatar)==null?void 0:y.image,src:(s==null?void 0:s.avatar)??d}),Z.jsx(jd,{...(v=u==null?void 0:u.avatar)==null?void 0:v.fallback,children:(s==null?void 0:s.name[0])??((b=h??"Bot")==null?void 0:b[0])})]}),t&&Z.jsx(Ui,{block:t,styles:u==null?void 0:u.blocks}),i]})})});var Cb={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Me,function(){var n=1e3,r=6e4,i=36e5,s="millisecond",o="second",a="minute",l="hour",c="day",u="week",d="month",h="quarter",f="year",p="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(H){var V=["th","st","nd","rd"],z=H%100;return"["+H+(V[(z-20)%10]||V[z]||V[0])+"]"}},x=function(H,V,z){var Y=String(H);return!Y||Y.length>=V?H:""+Array(V+1-Y.length).join(z)+H},P={s:x,z:function(H){var V=-H.utcOffset(),z=Math.abs(V),Y=Math.floor(z/60),K=z%60;return(V<=0?"+":"-")+x(Y,2,"0")+":"+x(K,2,"0")},m:function H(V,z){if(V.date()<z.date())return-H(z,V);var Y=12*(z.year()-V.year())+(z.month()-V.month()),K=V.clone().add(Y,d),pe=z-K<0,k=V.clone().add(Y+(pe?-1:1),d);return+(-(Y+(z-K)/(pe?K-k:k-K))||0)},a:function(H){return H<0?Math.ceil(H)||0:Math.floor(H)},p:function(H){return{M:d,y:f,w:u,d:c,D:p,h:l,m:a,s:o,ms:s,Q:h}[H]||String(H||"").toLowerCase().replace(/s$/,"")},u:function(H){return H===void 0}},A="en",O={};O[A]=b;var U="$isDayjsObject",F=function(H){return H instanceof J||!(!H||!H[U])},B=function H(V,z,Y){var K;if(!V)return A;if(typeof V=="string"){var pe=V.toLowerCase();O[pe]&&(K=pe),z&&(O[pe]=z,K=pe);var k=V.split("-");if(!K&&k.length>1)return H(k[0])}else{var ee=V.name;O[ee]=V,K=ee}return!Y&&K&&(A=K),K||!Y&&A},I=function(H,V){if(F(H))return H.clone();var z=typeof V=="object"?V:{};return z.date=H,z.args=arguments,new J(z)},j=P;j.l=B,j.i=F,j.w=function(H,V){return I(H,{locale:V.$L,utc:V.$u,x:V.$x,$offset:V.$offset})};var J=function(){function H(z){this.$L=B(z.locale,null,!0),this.parse(z),this.$x=this.$x||z.x||{},this[U]=!0}var V=H.prototype;return V.parse=function(z){this.$d=function(Y){var K=Y.date,pe=Y.utc;if(K===null)return new Date(NaN);if(j.u(K))return new Date;if(K instanceof Date)return new Date(K);if(typeof K=="string"&&!/Z$/i.test(K)){var k=K.match(y);if(k){var ee=k[2]-1||0,xe=(k[7]||"0").substring(0,3);return pe?new Date(Date.UTC(k[1],ee,k[3]||1,k[4]||0,k[5]||0,k[6]||0,xe)):new Date(k[1],ee,k[3]||1,k[4]||0,k[5]||0,k[6]||0,xe)}}return new Date(K)}(z),this.init()},V.init=function(){var z=this.$d;this.$y=z.getFullYear(),this.$M=z.getMonth(),this.$D=z.getDate(),this.$W=z.getDay(),this.$H=z.getHours(),this.$m=z.getMinutes(),this.$s=z.getSeconds(),this.$ms=z.getMilliseconds()},V.$utils=function(){return j},V.isValid=function(){return this.$d.toString()!==m},V.isSame=function(z,Y){var K=I(z);return this.startOf(Y)<=K&&K<=this.endOf(Y)},V.isAfter=function(z,Y){return I(z)<this.startOf(Y)},V.isBefore=function(z,Y){return this.endOf(Y)<I(z)},V.$g=function(z,Y,K){return j.u(z)?this[Y]:this.set(K,z)},V.unix=function(){return Math.floor(this.valueOf()/1e3)},V.valueOf=function(){return this.$d.getTime()},V.startOf=function(z,Y){var K=this,pe=!!j.u(Y)||Y,k=j.p(z),ee=function(Ue,_e){var ve=j.w(K.$u?Date.UTC(K.$y,_e,Ue):new Date(K.$y,_e,Ue),K);return pe?ve:ve.endOf(c)},xe=function(Ue,_e){return j.w(K.toDate()[Ue].apply(K.toDate("s"),(pe?[0,0,0,0]:[23,59,59,999]).slice(_e)),K)},S=this.$W,Te=this.$M,Ne=this.$D,Ie="set"+(this.$u?"UTC":"");switch(k){case f:return pe?ee(1,0):ee(31,11);case d:return pe?ee(1,Te):ee(0,Te+1);case u:var je=this.$locale().weekStart||0,De=(S<je?S+7:S)-je;return ee(pe?Ne-De:Ne+(6-De),Te);case c:case p:return xe(Ie+"Hours",0);case l:return xe(Ie+"Minutes",1);case a:return xe(Ie+"Seconds",2);case o:return xe(Ie+"Milliseconds",3);default:return this.clone()}},V.endOf=function(z){return this.startOf(z,!1)},V.$set=function(z,Y){var K,pe=j.p(z),k="set"+(this.$u?"UTC":""),ee=(K={},K[c]=k+"Date",K[p]=k+"Date",K[d]=k+"Month",K[f]=k+"FullYear",K[l]=k+"Hours",K[a]=k+"Minutes",K[o]=k+"Seconds",K[s]=k+"Milliseconds",K)[pe],xe=pe===c?this.$D+(Y-this.$W):Y;if(pe===d||pe===f){var S=this.clone().set(p,1);S.$d[ee](xe),S.init(),this.$d=S.set(p,Math.min(this.$D,S.daysInMonth())).$d}else ee&&this.$d[ee](xe);return this.init(),this},V.set=function(z,Y){return this.clone().$set(z,Y)},V.get=function(z){return this[j.p(z)]()},V.add=function(z,Y){var K,pe=this;z=Number(z);var k=j.p(Y),ee=function(Te){var Ne=I(pe);return j.w(Ne.date(Ne.date()+Math.round(Te*z)),pe)};if(k===d)return this.set(d,this.$M+z);if(k===f)return this.set(f,this.$y+z);if(k===c)return ee(1);if(k===u)return ee(7);var xe=(K={},K[a]=r,K[l]=i,K[o]=n,K)[k]||1,S=this.$d.getTime()+z*xe;return j.w(S,this)},V.subtract=function(z,Y){return this.add(-1*z,Y)},V.format=function(z){var Y=this,K=this.$locale();if(!this.isValid())return K.invalidDate||m;var pe=z||"YYYY-MM-DDTHH:mm:ssZ",k=j.z(this),ee=this.$H,xe=this.$m,S=this.$M,Te=K.weekdays,Ne=K.months,Ie=K.meridiem,je=function(_e,ve,ke,Ce){return _e&&(_e[ve]||_e(Y,pe))||ke[ve].slice(0,Ce)},De=function(_e){return j.s(ee%12||12,_e,"0")},Ue=Ie||function(_e,ve,ke){var Ce=_e<12?"AM":"PM";return ke?Ce.toLowerCase():Ce};return pe.replace(v,function(_e,ve){return ve||function(ke){switch(ke){case"YY":return String(Y.$y).slice(-2);case"YYYY":return j.s(Y.$y,4,"0");case"M":return S+1;case"MM":return j.s(S+1,2,"0");case"MMM":return je(K.monthsShort,S,Ne,3);case"MMMM":return je(Ne,S);case"D":return Y.$D;case"DD":return j.s(Y.$D,2,"0");case"d":return String(Y.$W);case"dd":return je(K.weekdaysMin,Y.$W,Te,2);case"ddd":return je(K.weekdaysShort,Y.$W,Te,3);case"dddd":return Te[Y.$W];case"H":return String(ee);case"HH":return j.s(ee,2,"0");case"h":return De(1);case"hh":return De(2);case"a":return Ue(ee,xe,!0);case"A":return Ue(ee,xe,!1);case"m":return String(xe);case"mm":return j.s(xe,2,"0");case"s":return String(Y.$s);case"ss":return j.s(Y.$s,2,"0");case"SSS":return j.s(Y.$ms,3,"0");case"Z":return k}return null}(_e)||k.replace(":","")})},V.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},V.diff=function(z,Y,K){var pe,k=this,ee=j.p(Y),xe=I(z),S=(xe.utcOffset()-this.utcOffset())*r,Te=this-xe,Ne=function(){return j.m(k,xe)};switch(ee){case f:pe=Ne()/12;break;case d:pe=Ne();break;case h:pe=Ne()/3;break;case u:pe=(Te-S)/6048e5;break;case c:pe=(Te-S)/864e5;break;case l:pe=Te/i;break;case a:pe=Te/r;break;case o:pe=Te/n;break;default:pe=Te}return K?pe:j.a(pe)},V.daysInMonth=function(){return this.endOf(d).$D},V.$locale=function(){return O[this.$L]},V.locale=function(z,Y){if(!z)return this.$L;var K=this.clone(),pe=B(z,Y,!0);return pe&&(K.$L=pe),K},V.clone=function(){return j.w(this.$d,this)},V.toDate=function(){return new Date(this.valueOf())},V.toJSON=function(){return this.isValid()?this.toISOString():null},V.toISOString=function(){return this.$d.toISOString()},V.toString=function(){return this.$d.toUTCString()},H}(),q=J.prototype;return I.prototype=q,[["$ms",s],["$s",o],["$m",a],["$H",l],["$W",c],["$M",d],["$y",f],["$D",p]].forEach(function(H){q[H[1]]=function(V){return this.$g(V,H[0],H[1])}}),I.extend=function(H,V){return H.$i||(H(V,J,I),H.$i=!0),I},I.locale=B,I.isDayjs=F,I.unix=function(H){return I(1e3*H)},I.en=O[A],I.Ls=O,I.p={},I})})(Cb);var pU=Cb.exports;const xl=ti(pU);var Eb={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Me,function(){return function(n,r,i){r.prototype.isToday=function(){var s="YYYY-MM-DD",o=i();return this.format(s)===o.format(s)}}})})(Eb);var mU=Eb.exports;const gU=ti(mU);var Sb={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Me,function(){return function(n,r,i){r.prototype.isYesterday=function(){var s="YYYY-MM-DD",o=i().subtract(1,"day");return this.format(s)===o.format(s)}}})})(Sb);var yU=Sb.exports;const vU=ti(yU);xl.extend(gU),xl.extend(vU);function bU(e,t="day"){if(!e||e.length===0)return[];const n=[];n.push(Tb(e[0].timestamp));for(let r=0;r<e.length;r++)if(n.push(e[r]),r+1<e.length){const i=e[r].timestamp,s=e[r+1].timestamp;xl(i).isSame(s,t)||n.push(Tb(s))}return n}function Tb(e){return{direction:"system",sender:{name:"system"},timestamp:e,block:{type:"text",text:wU(e)}}}function wU(e,t=!1){const n=xl(e),r="h:mma";return n.isToday()?t?`Today • ${n.format(r)}`:"Today":n.isYesterday()?t?`Yesterday • ${n.format(r)}`:"Yesterday":t?n.format(`YYYY-MM-DD • ${r}`):n.format("YYYY-MM-DD")}const Ob=10*1e3,Ib=_.memo(({scrollDownButton:e,...t})=>{var b,x,P,A,O,U,F,B;const{configuration:n,theme:{messageList:r}}=ht(),{messages:i,setState:s,client:o}=ht(),a=_.useMemo(()=>bU(i),[i]),[l,c]=_.useState(!0),u=_.useRef(null),{y:d}=vI(u),[h,f]=_.useState(!1),[p,m]=wI(),y=()=>{if(!u.current)return;const{scrollHeight:I}=u.current;l&&u.current.scrollTo({top:I})};_.useEffect(()=>{const I=new Date(Date.now()-Ob+2e3);i.length>0&&i[i.length-1].timestamp<I&&f(!1)},[p]),hi(()=>o==null?void 0:o.on("messageSent",()=>{f(!0),m(new Date(Date.now()+Ob))})),hi(()=>o==null?void 0:o.on("message",()=>{f(!1)})),_.useEffect(()=>{const I=i[i.length-1];s({disableComposer:!!(I!=null&&I.disableInput)})},[i.length]),_.useEffect(()=>{if(!u.current)return;const{offsetHeight:I,scrollHeight:j,scrollTop:J}=u.current;c(j<=J+I+100)},[d]);const v=e!=null&&e.icon?e==null?void 0:e.icon:nS;return Z.jsxs("ul",{...t,...r==null?void 0:r.container,ref:u,children:[Z.jsx("li",{...(b=r==null?void 0:r.scrollDownButton)==null?void 0:b.container,children:!!i.length&&Z.jsxs("button",{"data-is-at-bottom":l,...(x=r==null?void 0:r.scrollDownButton)==null?void 0:x.button,onClick:()=>{var I,j;return(j=u.current)==null?void 0:j.scrollBy({top:(I=u.current)==null?void 0:I.scrollHeight})},children:[(e==null?void 0:e.text)??"Back"," ",Z.jsx(v,{...(P=r==null?void 0:r.scrollDownButton)==null?void 0:P.icon})]})}),Z.jsxs("li",{...(A=r==null?void 0:r.marquee)==null?void 0:A.container,children:[Z.jsx(Pl,{userId:o==null?void 0:o.clientId,src:n.botAvatar,...(O=r==null?void 0:r.marquee)==null?void 0:O.avatar,children:(n.botName||"Bot").slice(0,1)}),Z.jsxs("div",{...(U=r==null?void 0:r.marquee)==null?void 0:U.content,children:[Z.jsx("h1",{...(F=r==null?void 0:r.marquee)==null?void 0:F.title,children:n.botName||"Bot"}),Z.jsx("p",{...(B=r==null?void 0:r.marquee)==null?void 0:B.description,children:n.botDescription})]})]}),a.map((I,j)=>Z.jsx(Sd,{scroll:y,...I},j)),h&&Z.jsx(Sd,{scroll:y,direction:"incoming",children:Z.jsx(kb,{})})]})}),Pb=({...e})=>{var o,a;const{theme:{header:t,modal:n},client:r}=ht(),{showModal:i}=qh(),s=l=>{var c,u,d,h;l.stopPropagation(),i({title:"Restart Conversation",content:Z.jsxs(Z.Fragment,{children:[Z.jsx("p",{...(u=(c=n==null?void 0:n.dialog)==null?void 0:c.newConversation)==null?void 0:u.text,children:"Are you sure you want to restart a new conversation?"}),Z.jsx(Qr.Close,{asChild:!0,children:Z.jsx("button",{...(h=(d=n==null?void 0:n.dialog)==null?void 0:d.newConversation)==null?void 0:h.button,onClick:r==null?void 0:r.restartConversation,children:"Restart"})})]})})};return Z.jsx(iS,{...e,...(a=(o=t==null?void 0:t.content)==null?void 0:o.actions)==null?void 0:a.icons,role:"button",tabIndex:0,onClick:s,onKeyDown:l=>{l.key==="Enter"&&s(l)}})},xU=({...e})=>{var o,a;const{theme:{header:t,modal:n},closeWindow:r,client:i}=ht(),s=l=>{l.stopPropagation(),r==null||r()};return Z.jsx(bb,{...e,...(a=(o=t==null?void 0:t.content)==null?void 0:o.actions)==null?void 0:a.icons,role:"button",tabIndex:0,onClick:s,onKeyDown:l=>{l.key==="Enter"&&s(l)}})},_U=()=>{var r,i,s,o,a,l,c,u,d,h,f,p,m,y,v;const{configuration:e,closeWindow:t}=ht(),n=!!((r=e.email)!=null&&r.title)||!!((i=e.phone)!=null&&i.title)||!!((s=e.website)!=null&&s.link)||!!((o=e.termsOfService)!=null&&o.link)||!!((a=e.privacyPolicy)!=null&&a.link);return Z.jsxs(wb,{children:[Z.jsxs(En,{children:[Z.jsxs(En.Content,{disabled:!n,children:[Z.jsx(En.Avatar,{src:e.botAvatar,children:e.botName||"Bot"}),Z.jsx(En.Title,{children:e.botName||"Bot"}),Z.jsx(En.Description,{children:e.botDescription}),Z.jsxs(En.Actions,{children:[Z.jsx(Pb,{}),t&&Z.jsx(xU,{})]})]}),Z.jsxs(En.ExpandedContent,{children:[Z.jsx(En.DescriptionItem,{"data-email":"",icon:eT,title:(l=e.email)==null?void 0:l.title,link:(c=e.email)==null?void 0:c.link}),Z.jsx(En.DescriptionItem,{"data-phone":"",icon:oT,title:(u=e.phone)==null?void 0:u.title,link:(d=e.phone)==null?void 0:d.link}),Z.jsx(En.DescriptionItem,{"data-website":"",link:(h=e.website)==null?void 0:h.link,icon:nT,title:(f=e.website)==null?void 0:f.title}),Z.jsx(En.DescriptionItem,{"data-terms":"",link:(p=e.termsOfService)==null?void 0:p.link,icon:QS,title:(m=e.termsOfService)==null?void 0:m.title}),Z.jsx(En.DescriptionItem,{"data-privacy":"",link:(y=e.privacyPolicy)==null?void 0:y.link,icon:iT,title:(v=e.privacyPolicy)==null?void 0:v.title})]})]}),Z.jsx(Ib,{}),Z.jsxs(Vv,{children:[Z.jsx(zv,{placeholder:e.composerPlaceholder||"Type your message"}),Z.jsx(Zv,{})]})]})},us=T.object({title:T.string(),link:T.string().optional()}),Ab=T.object({composerPlaceholder:T.string().optional(),botName:T.string().optional(),botAvatar:T.string().optional(),botDescription:T.string().optional(),website:us.optional(),email:us.optional(),phone:us.optional(),privacyPolicy:us.optional(),termsOfService:us.optional()}),Rb=T.enum(["heading1","heading2","heading3","text","horizontalRule","link","italic","bold","orderedList","unorderedList","listItem","lineBreak","pre"]),$b=T.object({}).passthrough().transform(e=>e),Ee=T.object({className:T.string().optional(),style:$b.optional()}),_l=T.object({container:Ee.optional(),image:Ee.optional(),fallback:Ee.optional()}),Mb=T.object({button:Ee.optional(),text:T.record(Rb,Ee.optional()),image:T.object({image:Ee.optional(),placeholder:Ee.optional()}).optional(),audio:Ee.optional(),video:Ee.optional(),file:T.object({container:Ee.optional(),title:Ee.optional(),icon:Ee.optional()}).optional(),location:T.object({container:Ee.optional(),title:Ee.optional(),icon:Ee.optional()}).optional(),column:Ee.optional(),row:Ee.optional(),bubble:Ee.optional(),carousel:T.object({container:Ee.optional(),slidesContainer:Ee.optional(),backButton:Ee.optional(),nextButton:Ee.optional()}).optional(),dropdown:T.object({button:T.object({container:Ee.optional(),icon:Ee.optional(),text:Ee.optional()}).optional(),content:T.object({container:Ee.optional(),item:Ee.optional()}).optional()}).optional()}),Lb=T.object({container:Ee.optional(),modal:T.object({overlay:Ee.optional(),container:Ee.optional(),dialog:T.object({container:Ee.optional(),title:T.object({container:Ee.optional(),text:Ee.optional(),closeIcon:Ee.optional()}).optional(),content:Ee.optional(),newConversation:T.object({text:Ee.optional(),button:Ee.optional()}).optional()}).optional()}).optional(),notification:T.object({container:Ee.optional(),title:Ee.optional(),description:Ee.optional(),icon:Ee.optional(),closeIcon:Ee.optional()}).optional(),header:T.object({container:Ee.optional(),content:T.object({container:Ee.optional(),title:Ee.optional(),description:Ee.optional(),avatar:_l.optional(),actions:T.object({container:Ee.optional(),icons:Ee.optional()}).optional()}),expandedContent:T.object({container:Ee.optional(),descriptionItems:T.object({container:Ee.optional(),icon:Ee.optional(),text:Ee.optional(),link:Ee.optional()}).optional()}).optional(),description:T.object({container:Ee.optional(),title:Ee.optional(),subtitle:Ee.optional()}).optional(),newConversationIcon:Ee.optional()}).optional(),composer:T.object({container:Ee.optional(),input:Ee.optional(),button:T.object({container:Ee.optional(),icon:Ee.optional()}).optional()}).optional(),fab:T.object({icon:Ee.optional(),container:Ee.optional()}).optional(),messageList:T.object({container:Ee.optional(),marquee:T.object({content:Ee.optional(),title:Ee.optional(),description:Ee.optional(),avatar:_l.optional(),container:Ee.optional()}).optional(),scrollDownButton:T.object({container:Ee.optional(),button:Ee.optional(),icon:Ee.optional()}).optional()}).optional(),message:T.object({container:Ee.optional(),avatar:_l.optional(),blocks:Mb.optional()}).optional(),loadingIndicator:T.object({container:Ee.optional(),loader:Ee.optional()}).optional()}),Db=T.enum(["opened","closed","initial"]),Nb=T.object({data:T.record(T.string()).optional()}),jb=T.enum(["messaging","pushpin"]),kU=T.object({clientId:T.string(),botId:T.string(),selector:T.string().optional().catch(void 0),webchatScriptUrl:T.string().optional().catch(void 0),fabScriptUrl:T.string().optional().catch(void 0),messagingUrl:T.string().optional().catch(void 0),pushpinUrl:T.string().optional().catch(void 0),clientMode:jb.optional().catch(void 0),configuration:Ab.optional().catch(void 0),theme:Lb.optional().catch(void 0),style:T.string().optional().catch(void 0),defaultState:Db.optional().catch(void 0),user:Nb.optional().catch(void 0)}),CU=({clientId:e,apiUrl:t,mode:n="messaging"})=>n==="messaging"?new ov({url:t,clientId:e}):new Bv({apiUrl:t,clientId:e});Ye.Avatar=Pl,Ye.Block=Ui,Ye.Composer=Vv,Ye.ComposerButton=Zv,Ye.ComposerInput=zv,Ye.Container=wb,Ye.Fab=J2,Ye.Header=En,Ye.LoadingIndicator=kb,Ye.Message=Sd,Ye.MessageList=Ib,Ye.Modal=Qr,Ye.ModalProvider=Wv,Ye.RestartConversation=Pb,Ye.Webchat=_U,Ye.WebchatProvider=_j,Ye.avatarThemeSchema=_l,Ye.blockThemeSchema=Mb,Ye.clientModePropsSchema=jb,Ye.configurationSchema=Ab,Ye.cssStyleSchema=$b,Ye.descriptionItemSchema=us,Ye.getClient=CU,Ye.initPropsSchema=kU,Ye.markdownTypeSchema=Rb,Ye.renderers=Xc,Ye.statePropsSchema=Db,Ye.styleOptionSchema=Ee,Ye.themeSchema=Lb,Ye.useClient=xj,Ye.useWebchatContext=ht,Ye.userPropsSchema=Nb,Object.defineProperty(Ye,Symbol.toStringTag,{value:"Module"})});
|
|
328
|
+
`)},Hj=0,ms=[];function qj(e){var t=R.useRef([]),n=R.useRef([0,0]),r=R.useRef(),i=R.useState(Hj++)[0],s=R.useState(function(){return nw()})[0],o=R.useRef(e);R.useEffect(function(){o.current=e},[e]),R.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var m=rP([e.lockRef.current],(e.shards||[]).map(lw),!0).filter(Boolean);return m.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),m.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=R.useCallback(function(m,y){if("touches"in m&&m.touches.length===2)return!o.current.allowPinchZoom;var v=Il(m),b=n.current,x="deltaX"in m?m.deltaX:b[0]-v[0],I="deltaY"in m?m.deltaY:b[1]-v[1],P,T=m.target,j=Math.abs(x)>Math.abs(I)?"h":"v";if("touches"in m&&j==="h"&&T.type==="range")return!1;var U=iw(j,T);if(!U)return!0;if(U?P=j:(P=j==="v"?"h":"v",U=iw(j,T)),!U)return!1;if(!r.current&&"changedTouches"in m&&(x||I)&&(r.current=P),!P)return!0;var F=r.current||P;return zj(F,y,m,F==="h"?x:I,!0)},[]),l=R.useCallback(function(m){var y=m;if(!(!ms.length||ms[ms.length-1]!==s)){var v="deltaY"in y?aw(y):Il(y),b=t.current.filter(function(P){return P.name===y.type&&P.target===y.target&&Zj(P.delta,v)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var x=(o.current.shards||[]).map(lw).filter(Boolean).filter(function(P){return P.contains(y.target)}),I=x.length>0?a(y,x[0]):!o.current.noIsolation;I&&y.cancelable&&y.preventDefault()}}},[]),c=R.useCallback(function(m,y,v,b){var x={name:m,delta:y,target:v,should:b};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(I){return I!==x})},1)},[]),u=R.useCallback(function(m){n.current=Il(m),r.current=void 0},[]),d=R.useCallback(function(m){c(m.type,aw(m),m.target,a(m,e.lockRef.current))},[]),h=R.useCallback(function(m){c(m.type,Il(m),m.target,a(m,e.lockRef.current))},[]);R.useEffect(function(){return ms.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,ps),document.addEventListener("touchmove",l,ps),document.addEventListener("touchstart",u,ps),function(){ms=ms.filter(function(m){return m!==s}),document.removeEventListener("wheel",l,ps),document.removeEventListener("touchmove",l,ps),document.removeEventListener("touchstart",u,ps)}},[]);var f=e.removeScrollBar,p=e.inert;return R.createElement(R.Fragment,null,p?R.createElement(s,{styles:Wj(i)}):null,f?R.createElement(Dj,{gapMode:"margin"}):null)}const Kj=Cj(ew,qj);var cw=R.forwardRef(function(e,t){return R.createElement(Tl,Mn({},e,{ref:t,sideCar:Kj}))});cw.classNames=Tl.classNames;const Jj=cw;var Gj=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},gs=new WeakMap,Pl=new WeakMap,Al={},Md=0,uw=function(e){return e&&(e.host||uw(e.parentNode))},Yj=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=uw(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Qj=function(e,t,n,r){var i=Yj(t,Array.isArray(e)?e:[e]);Al[n]||(Al[n]=new WeakMap);var s=Al[n],o=[],a=new Set,l=new Set(i),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};i.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(a.has(h))u(h);else{var f=h.getAttribute(r),p=f!==null&&f!=="false",m=(gs.get(h)||0)+1,y=(s.get(h)||0)+1;gs.set(h,m),s.set(h,y),o.push(h),m===1&&p&&Pl.set(h,!0),y===1&&h.setAttribute(n,"true"),p||h.setAttribute(r,"true")}})};return u(t),a.clear(),Md++,function(){o.forEach(function(d){var h=gs.get(d)-1,f=s.get(d)-1;gs.set(d,h),s.set(d,f),h||(Pl.has(d)||d.removeAttribute(r),Pl.delete(d)),f||d.removeAttribute(n)}),Md--,Md||(gs=new WeakMap,gs=new WeakMap,Pl=new WeakMap,Al={})}},Xj=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=t||Gj(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),Qj(r,i,n,"aria-hidden")):function(){return null}};const dw="Dialog",[fw,dB]=Nl(dw),[eU,Ar]=fw(dw),tU=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!0}=e,a=_.useRef(null),l=_.useRef(null),[c=!1,u]=zb({prop:r,defaultProp:i,onChange:s});return _.createElement(eU,{scope:t,triggerRef:a,contentRef:l,contentId:_l(),titleId:_l(),descriptionId:_l(),open:c,onOpenChange:u,onOpenToggle:_.useCallback(()=>u(d=>!d),[u]),modal:o},n)},nU="DialogTrigger",rU=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ar(nU,n),s=li(t,i.triggerRef);return _.createElement(Pn.button,_t({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Dd(i.open)},r,{ref:s,onClick:Pr(e.onClick,i.onOpenToggle)}))}),iU="DialogPortal",[fB,hw]=fw(iU,{forceMount:void 0}),Ld="DialogOverlay",sU=_.forwardRef((e,t)=>{const n=hw(Ld,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Ar(Ld,e.__scopeDialog);return s.modal?_.createElement(kl,{present:r||s.open},_.createElement(oU,_t({},i,{ref:t}))):null}),oU=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ar(Ld,n);return _.createElement(Jj,{as:jl,allowPinchZoom:!0,shards:[i.contentRef]},_.createElement(Pn.div,_t({"data-state":Dd(i.open)},r,{ref:t,style:{pointerEvents:"auto",...r.style}})))}),ko="DialogContent",aU=_.forwardRef((e,t)=>{const n=hw(ko,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Ar(ko,e.__scopeDialog);return _.createElement(kl,{present:r||s.open},s.modal?_.createElement(lU,_t({},i,{ref:t})):_.createElement(cU,_t({},i,{ref:t})))}),lU=_.forwardRef((e,t)=>{const n=Ar(ko,e.__scopeDialog),r=_.useRef(null),i=li(t,n.contentRef,r);return _.useEffect(()=>{const s=r.current;if(s)return Xj(s)},[]),_.createElement(pw,_t({},e,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pr(e.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=n.triggerRef.current)===null||o===void 0||o.focus()}),onPointerDownOutside:Pr(e.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:Pr(e.onFocusOutside,s=>s.preventDefault())}))}),cU=_.forwardRef((e,t)=>{const n=Ar(ko,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return _.createElement(pw,_t({},e,{ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o;if((o=e.onCloseAutoFocus)===null||o===void 0||o.call(e,s),!s.defaultPrevented){var a;r.current||(a=n.triggerRef.current)===null||a===void 0||a.focus(),s.preventDefault()}r.current=!1,i.current=!1},onInteractOutside:s=>{var o,a;(o=e.onInteractOutside)===null||o===void 0||o.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const l=s.target;((a=n.triggerRef.current)===null||a===void 0?void 0:a.contains(l))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}}))}),pw=_.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=e,a=Ar(ko,n),l=_.useRef(null),c=li(t,l);return mj(),_.createElement(_.Fragment,null,_.createElement(oj,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s},_.createElement(rj,_t({role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Dd(a.open)},o,{ref:c,onDismiss:()=>a.onOpenChange(!1)}))),!1)}),uU="DialogTitle",dU=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ar(uU,n);return _.createElement(Pn.h2,_t({id:i.titleId},r,{ref:t}))}),fU="DialogClose",hU=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Ar(fU,n);return _.createElement(Pn.button,_t({type:"button"},r,{ref:t,onClick:Pr(e.onClick,()=>i.onOpenChange(!1))}))});function Dd(e){return e?"open":"closed"}const pU=tU,mU=rU,gU=sU,yU=aU,vU=dU,mw=hU;function bU({title:e,titleId:t,...n},r){return R.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true",ref:r,"aria-labelledby":t},n),e?R.createElement("title",{id:t},e):null,R.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}))}const gw=R.forwardRef(bU);function ii({open:e,onOpenChange:t,children:n}){return z.jsx(pU,{open:e,onOpenChange:t,children:n})}function wU({title:e,children:t}){var r,i,s,o,a,l,c,u;const{theme:{modal:n}}=mt();return z.jsxs(z.Fragment,{children:[z.jsx(gU,{...n==null?void 0:n.overlay}),z.jsx("div",{...n==null?void 0:n.container,children:z.jsxs(yU,{...(r=n==null?void 0:n.dialog)==null?void 0:r.container,children:[z.jsxs("div",{...(s=(i=n==null?void 0:n.dialog)==null?void 0:i.title)==null?void 0:s.container,children:[z.jsx(vU,{...(a=(o=n==null?void 0:n.dialog)==null?void 0:o.title)==null?void 0:a.text,children:e}),z.jsx(mw,{children:z.jsx(gw,{role:"button",tabIndex:0,...(c=(l=n==null?void 0:n.dialog)==null?void 0:l.title)==null?void 0:c.closeIcon})})]}),z.jsx("div",{...(u=n==null?void 0:n.dialog)==null?void 0:u.content,children:t})]})})]})}ii.Button=mU,ii.Close=mw,ii.Content=wU;const yw=_.forwardRef(({children:e,...t},n)=>{const{theme:{container:r}}=mt();return z.jsxs("div",{...t,...r,ref:n,children:[z.jsx(wS,{}),z.jsxs(Vb,{children:[z.jsx(xU,{}),e]})]})}),xU=()=>{const{theme:{modal:e},state:{connected:t}}=mt(),{showModal:n}=op();return _.useEffect(()=>{var r,i,s,o;t||n({title:"Connection Error",content:z.jsxs(z.Fragment,{children:[z.jsx("p",{...(i=(r=e==null?void 0:e.dialog)==null?void 0:r.newConversation)==null?void 0:i.text,children:"There was an error connecting to the server. Please check your internet connection and try again."}),z.jsx(ii.Close,{asChild:!0,children:z.jsx("button",{...(o=(s=e==null?void 0:e.dialog)==null?void 0:s.newConversation)==null?void 0:o.button,onClick:()=>window.location.reload(),children:"Restart"})})]})})},[t]),z.jsx(z.Fragment,{})},_U=_.forwardRef(({children:e,onClick:t,...n},r)=>{const{theme:{fab:i}}=mt(),{container:s,icon:o}=i??{};return z.jsx("div",{...n,...s,ref:r,onClick:t,children:z.jsx("div",{...o})})}),vw="Collapsible",[kU,pB]=Nl(vw),[CU,Nd]=kU(vw),EU=_.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:s,onOpenChange:o,...a}=e,[l=!1,c]=zb({prop:r,defaultProp:i,onChange:o});return _.createElement(CU,{scope:n,disabled:s,contentId:_l(),open:l,onOpenToggle:_.useCallback(()=>c(u=>!u),[c])},_.createElement(Pn.div,_t({"data-state":jd(l),"data-disabled":s?"":void 0},a,{ref:t})))}),SU="CollapsibleTrigger",TU=_.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=Nd(SU,n);return _.createElement(Pn.button,_t({type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":jd(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},r,{ref:t,onClick:Pr(e.onClick,i.onOpenToggle)}))}),bw="CollapsibleContent",OU=_.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Nd(bw,e.__scopeCollapsible);return _.createElement(kl,{present:n||i.open},({present:s})=>_.createElement(IU,_t({},r,{ref:t,present:s})))}),IU=_.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...s}=e,o=Nd(bw,n),[a,l]=_.useState(r),c=_.useRef(null),u=li(t,c),d=_.useRef(0),h=d.current,f=_.useRef(0),p=f.current,m=o.open||a,y=_.useRef(m),v=_.useRef();return _.useEffect(()=>{const b=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(b)},[]),xs(()=>{const b=c.current;if(b){v.current=v.current||{transitionDuration:b.style.transitionDuration,animationName:b.style.animationName},b.style.transitionDuration="0s",b.style.animationName="none";const x=b.getBoundingClientRect();d.current=x.height,f.current=x.width,y.current||(b.style.transitionDuration=v.current.transitionDuration,b.style.animationName=v.current.animationName),l(r)}},[o.open,r]),_.createElement(Pn.div,_t({"data-state":jd(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!m},s,{ref:u,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...e.style}}),m&&i)});function jd(e){return e?"open":"closed"}const PU=EU,AU=TU,RU=OU,$U=e=>R.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:16,height:16,fill:"none",viewBox:"0 0 16 16",...e},R.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",d:"M15.5 5.5v-5m0 0h-5m5 0L8.833 7.167m-2.5-5H4.5c-1.4 0-2.1 0-2.635.272A2.5 2.5 0 0 0 .772 3.532C.5 4.066.5 4.767.5 6.167V11.5c0 1.4 0 2.1.272 2.635a2.5 2.5 0 0 0 1.093 1.092C2.4 15.5 3.1 15.5 4.5 15.5h5.333c1.4 0 2.1 0 2.635-.273a2.5 2.5 0 0 0 1.093-1.092c.272-.535.272-1.235.272-2.635V9.667"})),MU=_.memo(_.forwardRef((e,t)=>{const{theme:{header:n}}=mt(),[r,i]=_.useState(!1);return z.jsx(PU,{...e,...n==null?void 0:n.container,open:r,onOpenChange:i,ref:t})})),LU=_.forwardRef((e,t)=>{var r;const{theme:{header:n}}=mt();return z.jsx(AU,{...e,...(r=n==null?void 0:n.content)==null?void 0:r.container,ref:t})}),DU=_.forwardRef((e,t)=>{var r;const{theme:{header:n}}=mt();return z.jsx(RU,{...e,...(r=n==null?void 0:n.expandedContent)==null?void 0:r.container,ref:t})}),NU=_.forwardRef(({src:e,children:t},n)=>{var s;const{theme:{header:r},client:i}=mt();return z.jsx(Bl,{ref:n,userId:i==null?void 0:i.clientId,children:t,src:e,...(s=r==null?void 0:r.content)==null?void 0:s.avatar})}),jU=_.forwardRef((e,t)=>{var r;const{theme:{header:n}}=mt();return z.jsx("h2",{...e,...(r=n==null?void 0:n.content)==null?void 0:r.title,ref:t})}),UU=_.forwardRef((e,t)=>{var r;const{theme:{header:n}}=mt();return z.jsx("p",{...e,...(r=n==null?void 0:n.content)==null?void 0:r.description,ref:t})}),FU=_.forwardRef((e,t)=>{var r,i;const{theme:{header:n}}=mt();return z.jsx("div",{...e,...(i=(r=n==null?void 0:n.content)==null?void 0:r.actions)==null?void 0:i.container,ref:t})}),On=Object.assign(MU,{Content:LU,ExpandedContent:DU,Avatar:NU,Description:UU,Title:jU,Actions:FU,DescriptionItem:({icon:e,title:t,link:n,...r})=>{var a,l,c,u,d,h,f,p,m,y,v,b;const{theme:{header:i}}=mt(),s=e??$U,o=x=>{x&&IE(x)};return!n&&!t?null:n?z.jsxs("a",{...r,...(l=(a=i==null?void 0:i.expandedContent)==null?void 0:a.descriptionItems)==null?void 0:l.container,href:n,target:"_blank",rel:"noopener",children:[z.jsx(s,{...(u=(c=i==null?void 0:i.expandedContent)==null?void 0:c.descriptionItems)==null?void 0:u.icon}),z.jsx("p",{...(h=(d=i==null?void 0:i.expandedContent)==null?void 0:d.descriptionItems)==null?void 0:h.link,children:t})]}):z.jsxs("div",{...r,...(p=(f=i==null?void 0:i.expandedContent)==null?void 0:f.descriptionItems)==null?void 0:p.container,onClick:x=>{o(x.currentTarget.textContent)},children:[z.jsx(s,{...(y=(m=i==null?void 0:i.expandedContent)==null?void 0:m.descriptionItems)==null?void 0:y.icon}),z.jsx("p",{...(b=(v=i==null?void 0:i.expandedContent)==null?void 0:v.descriptionItems)==null?void 0:b.text,children:t})]})}}),ww=_.memo(({...e})=>{const{theme:{loadingIndicator:t}}=mt();return z.jsx("div",{...e,...t==null?void 0:t.container,children:z.jsx("div",{...t==null?void 0:t.loader})})}),Ud=_.forwardRef(({direction:e,block:t,scroll:n,disableInput:r,children:i,sender:s,...o},a)=>{var m,y,v,b;const[l,c]=_.useState([]),{theme:{message:u},configuration:{botAvatar:d,botName:h},client:f}=mt();uP(()=>{n()}),_.useEffect(()=>{l.length===0&&n()},[l.length]);const p=Qd((f==null?void 0:f.clientId)??"",15);return z.jsx(ip.Provider,{value:{isLoading:l,setIsLoading:c},children:z.jsxs("div",{...o,...u==null?void 0:u.container,"data-loaded":l.length===0,"data-disable-input":!!r,"data-direction":e,ref:a,children:[z.jsxs(Jd,{"data-color":p,...(m=u==null?void 0:u.avatar)==null?void 0:m.container,children:[z.jsx(Gd,{...(y=u==null?void 0:u.avatar)==null?void 0:y.image,src:(s==null?void 0:s.avatar)??d}),z.jsx(Yd,{...(v=u==null?void 0:u.avatar)==null?void 0:v.fallback,children:(s==null?void 0:s.name[0])??((b=h??"Bot")==null?void 0:b[0])})]}),t&&z.jsx(Wi,{block:t,styles:u==null?void 0:u.blocks}),i]})})});var xw={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Me,function(){var n=1e3,r=6e4,i=36e5,s="millisecond",o="second",a="minute",l="hour",c="day",u="week",d="month",h="quarter",f="year",p="date",m="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(W){var B=["th","st","nd","rd"],V=W%100;return"["+W+(B[(V-20)%10]||B[V]||B[0])+"]"}},x=function(W,B,V){var Y=String(W);return!Y||Y.length>=B?W:""+Array(B+1-Y.length).join(V)+W},I={s:x,z:function(W){var B=-W.utcOffset(),V=Math.abs(B),Y=Math.floor(V/60),K=V%60;return(B<=0?"+":"-")+x(Y,2,"0")+":"+x(K,2,"0")},m:function W(B,V){if(B.date()<V.date())return-W(V,B);var Y=12*(V.year()-B.year())+(V.month()-B.month()),K=B.clone().add(Y,d),pe=V-K<0,k=B.clone().add(Y+(pe?-1:1),d);return+(-(Y+(V-K)/(pe?K-k:k-K))||0)},a:function(W){return W<0?Math.ceil(W)||0:Math.floor(W)},p:function(W){return{M:d,y:f,w:u,d:c,D:p,h:l,m:a,s:o,ms:s,Q:h}[W]||String(W||"").toLowerCase().replace(/s$/,"")},u:function(W){return W===void 0}},P="en",T={};T[P]=b;var j="$isDayjsObject",U=function(W){return W instanceof J||!(!W||!W[j])},F=function W(B,V,Y){var K;if(!B)return P;if(typeof B=="string"){var pe=B.toLowerCase();T[pe]&&(K=pe),V&&(T[pe]=V,K=pe);var k=B.split("-");if(!K&&k.length>1)return W(k[0])}else{var ee=B.name;T[ee]=B,K=ee}return!Y&&K&&(P=K),K||!Y&&P},O=function(W,B){if(U(W))return W.clone();var V=typeof B=="object"?B:{};return V.date=W,V.args=arguments,new J(V)},N=I;N.l=F,N.i=U,N.w=function(W,B){return O(W,{locale:B.$L,utc:B.$u,x:B.$x,$offset:B.$offset})};var J=function(){function W(V){this.$L=F(V.locale,null,!0),this.parse(V),this.$x=this.$x||V.x||{},this[j]=!0}var B=W.prototype;return B.parse=function(V){this.$d=function(Y){var K=Y.date,pe=Y.utc;if(K===null)return new Date(NaN);if(N.u(K))return new Date;if(K instanceof Date)return new Date(K);if(typeof K=="string"&&!/Z$/i.test(K)){var k=K.match(y);if(k){var ee=k[2]-1||0,xe=(k[7]||"0").substring(0,3);return pe?new Date(Date.UTC(k[1],ee,k[3]||1,k[4]||0,k[5]||0,k[6]||0,xe)):new Date(k[1],ee,k[3]||1,k[4]||0,k[5]||0,k[6]||0,xe)}}return new Date(K)}(V),this.init()},B.init=function(){var V=this.$d;this.$y=V.getFullYear(),this.$M=V.getMonth(),this.$D=V.getDate(),this.$W=V.getDay(),this.$H=V.getHours(),this.$m=V.getMinutes(),this.$s=V.getSeconds(),this.$ms=V.getMilliseconds()},B.$utils=function(){return N},B.isValid=function(){return this.$d.toString()!==m},B.isSame=function(V,Y){var K=O(V);return this.startOf(Y)<=K&&K<=this.endOf(Y)},B.isAfter=function(V,Y){return O(V)<this.startOf(Y)},B.isBefore=function(V,Y){return this.endOf(Y)<O(V)},B.$g=function(V,Y,K){return N.u(V)?this[Y]:this.set(K,V)},B.unix=function(){return Math.floor(this.valueOf()/1e3)},B.valueOf=function(){return this.$d.getTime()},B.startOf=function(V,Y){var K=this,pe=!!N.u(Y)||Y,k=N.p(V),ee=function(Ue,_e){var ve=N.w(K.$u?Date.UTC(K.$y,_e,Ue):new Date(K.$y,_e,Ue),K);return pe?ve:ve.endOf(c)},xe=function(Ue,_e){return N.w(K.toDate()[Ue].apply(K.toDate("s"),(pe?[0,0,0,0]:[23,59,59,999]).slice(_e)),K)},S=this.$W,Te=this.$M,Ne=this.$D,Ie="set"+(this.$u?"UTC":"");switch(k){case f:return pe?ee(1,0):ee(31,11);case d:return pe?ee(1,Te):ee(0,Te+1);case u:var je=this.$locale().weekStart||0,De=(S<je?S+7:S)-je;return ee(pe?Ne-De:Ne+(6-De),Te);case c:case p:return xe(Ie+"Hours",0);case l:return xe(Ie+"Minutes",1);case a:return xe(Ie+"Seconds",2);case o:return xe(Ie+"Milliseconds",3);default:return this.clone()}},B.endOf=function(V){return this.startOf(V,!1)},B.$set=function(V,Y){var K,pe=N.p(V),k="set"+(this.$u?"UTC":""),ee=(K={},K[c]=k+"Date",K[p]=k+"Date",K[d]=k+"Month",K[f]=k+"FullYear",K[l]=k+"Hours",K[a]=k+"Minutes",K[o]=k+"Seconds",K[s]=k+"Milliseconds",K)[pe],xe=pe===c?this.$D+(Y-this.$W):Y;if(pe===d||pe===f){var S=this.clone().set(p,1);S.$d[ee](xe),S.init(),this.$d=S.set(p,Math.min(this.$D,S.daysInMonth())).$d}else ee&&this.$d[ee](xe);return this.init(),this},B.set=function(V,Y){return this.clone().$set(V,Y)},B.get=function(V){return this[N.p(V)]()},B.add=function(V,Y){var K,pe=this;V=Number(V);var k=N.p(Y),ee=function(Te){var Ne=O(pe);return N.w(Ne.date(Ne.date()+Math.round(Te*V)),pe)};if(k===d)return this.set(d,this.$M+V);if(k===f)return this.set(f,this.$y+V);if(k===c)return ee(1);if(k===u)return ee(7);var xe=(K={},K[a]=r,K[l]=i,K[o]=n,K)[k]||1,S=this.$d.getTime()+V*xe;return N.w(S,this)},B.subtract=function(V,Y){return this.add(-1*V,Y)},B.format=function(V){var Y=this,K=this.$locale();if(!this.isValid())return K.invalidDate||m;var pe=V||"YYYY-MM-DDTHH:mm:ssZ",k=N.z(this),ee=this.$H,xe=this.$m,S=this.$M,Te=K.weekdays,Ne=K.months,Ie=K.meridiem,je=function(_e,ve,ke,Ce){return _e&&(_e[ve]||_e(Y,pe))||ke[ve].slice(0,Ce)},De=function(_e){return N.s(ee%12||12,_e,"0")},Ue=Ie||function(_e,ve,ke){var Ce=_e<12?"AM":"PM";return ke?Ce.toLowerCase():Ce};return pe.replace(v,function(_e,ve){return ve||function(ke){switch(ke){case"YY":return String(Y.$y).slice(-2);case"YYYY":return N.s(Y.$y,4,"0");case"M":return S+1;case"MM":return N.s(S+1,2,"0");case"MMM":return je(K.monthsShort,S,Ne,3);case"MMMM":return je(Ne,S);case"D":return Y.$D;case"DD":return N.s(Y.$D,2,"0");case"d":return String(Y.$W);case"dd":return je(K.weekdaysMin,Y.$W,Te,2);case"ddd":return je(K.weekdaysShort,Y.$W,Te,3);case"dddd":return Te[Y.$W];case"H":return String(ee);case"HH":return N.s(ee,2,"0");case"h":return De(1);case"hh":return De(2);case"a":return Ue(ee,xe,!0);case"A":return Ue(ee,xe,!1);case"m":return String(xe);case"mm":return N.s(xe,2,"0");case"s":return String(Y.$s);case"ss":return N.s(Y.$s,2,"0");case"SSS":return N.s(Y.$ms,3,"0");case"Z":return k}return null}(_e)||k.replace(":","")})},B.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},B.diff=function(V,Y,K){var pe,k=this,ee=N.p(Y),xe=O(V),S=(xe.utcOffset()-this.utcOffset())*r,Te=this-xe,Ne=function(){return N.m(k,xe)};switch(ee){case f:pe=Ne()/12;break;case d:pe=Ne();break;case h:pe=Ne()/3;break;case u:pe=(Te-S)/6048e5;break;case c:pe=(Te-S)/864e5;break;case l:pe=Te/i;break;case a:pe=Te/r;break;case o:pe=Te/n;break;default:pe=Te}return K?pe:N.a(pe)},B.daysInMonth=function(){return this.endOf(d).$D},B.$locale=function(){return T[this.$L]},B.locale=function(V,Y){if(!V)return this.$L;var K=this.clone(),pe=F(V,Y,!0);return pe&&(K.$L=pe),K},B.clone=function(){return N.w(this.$d,this)},B.toDate=function(){return new Date(this.valueOf())},B.toJSON=function(){return this.isValid()?this.toISOString():null},B.toISOString=function(){return this.$d.toISOString()},B.toString=function(){return this.$d.toUTCString()},W}(),q=J.prototype;return O.prototype=q,[["$ms",s],["$s",o],["$m",a],["$H",l],["$W",c],["$M",d],["$y",f],["$D",p]].forEach(function(W){q[W[1]]=function(B){return this.$g(B,W[0],W[1])}}),O.extend=function(W,B){return W.$i||(W(B,J,O),W.$i=!0),O},O.locale=F,O.isDayjs=U,O.unix=function(W){return O(1e3*W)},O.en=T[P],O.Ls=T,O.p={},O})})(xw);var BU=xw.exports;const Rl=ai(BU);var _w={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Me,function(){return function(n,r,i){r.prototype.isToday=function(){var s="YYYY-MM-DD",o=i();return this.format(s)===o.format(s)}}})})(_w);var VU=_w.exports;const zU=ai(VU);var kw={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Me,function(){return function(n,r,i){r.prototype.isYesterday=function(){var s="YYYY-MM-DD",o=i().subtract(1,"day");return this.format(s)===o.format(s)}}})})(kw);var ZU=kw.exports;const WU=ai(ZU);Rl.extend(zU),Rl.extend(WU);function HU(e,t="day"){if(!e||e.length===0)return[];const n=[];n.push(Cw(e[0].timestamp));for(let r=0;r<e.length;r++)if(n.push(e[r]),r+1<e.length){const i=e[r].timestamp,s=e[r+1].timestamp;Rl(i).isSame(s,t)||n.push(Cw(s))}return n}function Cw(e){return{direction:"system",sender:{name:"system"},timestamp:e,block:{type:"text",text:qU(e)}}}function qU(e,t=!1){const n=Rl(e),r="h:mma";return n.isToday()?t?`Today • ${n.format(r)}`:"Today":n.isYesterday()?t?`Yesterday • ${n.format(r)}`:"Yesterday":t?n.format(`YYYY-MM-DD • ${r}`):n.format("YYYY-MM-DD")}const Ew=10*1e3,Sw=_.memo(({scrollDownButton:e,...t})=>{var b,x,I,P,T,j,U,F;const{configuration:n,theme:{messageList:r}}=mt(),{messages:i,setState:s,client:o}=mt(),a=_.useMemo(()=>HU(i),[i]),[l,c]=_.useState(!0),u=_.useRef(null),{y:d}=gP(u),[h,f]=_.useState(!1),[p,m]=vP(),y=()=>{if(!u.current)return;const{scrollHeight:O}=u.current;l&&u.current.scrollTo({top:O})};_.useEffect(()=>{const O=new Date(Date.now()-Ew+2e3);i.length>0&&i[i.length-1].timestamp<O&&f(!1)},[p]),bi(()=>o==null?void 0:o.on("messageSent",()=>{f(!0),m(new Date(Date.now()+Ew))})),bi(()=>o==null?void 0:o.on("message",()=>{f(!1)})),_.useEffect(()=>{const O=i[i.length-1];s({disableComposer:!!(O!=null&&O.disableInput)})},[i.length]),_.useEffect(()=>{if(!u.current)return;const{offsetHeight:O,scrollHeight:N,scrollTop:J}=u.current;c(N<=J+O+100)},[d]);const v=e!=null&&e.icon?e==null?void 0:e.icon:eT;return z.jsxs("ul",{...t,...r==null?void 0:r.container,ref:u,children:[z.jsx("li",{...(b=r==null?void 0:r.scrollDownButton)==null?void 0:b.container,children:!!i.length&&z.jsxs("button",{"data-is-at-bottom":l,...(x=r==null?void 0:r.scrollDownButton)==null?void 0:x.button,onClick:()=>{var O,N;return(N=u.current)==null?void 0:N.scrollBy({top:(O=u.current)==null?void 0:O.scrollHeight})},children:[(e==null?void 0:e.text)??"Back"," ",z.jsx(v,{...(I=r==null?void 0:r.scrollDownButton)==null?void 0:I.icon})]})}),z.jsxs("li",{...(P=r==null?void 0:r.marquee)==null?void 0:P.container,children:[z.jsx(Bl,{userId:o==null?void 0:o.clientId,src:n.botAvatar,...(T=r==null?void 0:r.marquee)==null?void 0:T.avatar,children:(n.botName||"Bot").slice(0,1)}),z.jsxs("div",{...(j=r==null?void 0:r.marquee)==null?void 0:j.content,children:[z.jsx("h1",{...(U=r==null?void 0:r.marquee)==null?void 0:U.title,children:n.botName||"Bot"}),z.jsx("p",{...(F=r==null?void 0:r.marquee)==null?void 0:F.description,children:n.botDescription})]})]}),a.map((O,N)=>z.jsx(Ud,{scroll:y,...O},N)),h&&z.jsx(Ud,{scroll:y,direction:"incoming",children:z.jsx(ww,{})})]})}),Tw=({...e})=>{var o,a;const{theme:{header:t,modal:n},client:r}=mt(),{showModal:i}=op(),s=l=>{var c,u,d,h;l.stopPropagation(),i({title:"Restart Conversation",content:z.jsxs(z.Fragment,{children:[z.jsx("p",{...(u=(c=n==null?void 0:n.dialog)==null?void 0:c.newConversation)==null?void 0:u.text,children:"Are you sure you want to restart a new conversation?"}),z.jsx(ii.Close,{asChild:!0,children:z.jsx("button",{...(h=(d=n==null?void 0:n.dialog)==null?void 0:d.newConversation)==null?void 0:h.button,onClick:r==null?void 0:r.restartConversation,children:"Restart"})})]})})};return z.jsx(nT,{...e,...(a=(o=t==null?void 0:t.content)==null?void 0:o.actions)==null?void 0:a.icons,role:"button",tabIndex:0,onClick:s,onKeyDown:l=>{l.key==="Enter"&&s(l)}})},KU=({...e})=>{var o,a;const{theme:{header:t,modal:n},closeWindow:r,client:i}=mt(),s=l=>{l.stopPropagation(),r==null||r()};return z.jsx(gw,{...e,...(a=(o=t==null?void 0:t.content)==null?void 0:o.actions)==null?void 0:a.icons,role:"button",tabIndex:0,onClick:s,onKeyDown:l=>{l.key==="Enter"&&s(l)}})},JU=()=>{var r,i,s,o,a,l,c,u,d,h,f,p,m,y,v;const{configuration:e,closeWindow:t}=mt(),n=!!((r=e.email)!=null&&r.title)||!!((i=e.phone)!=null&&i.title)||!!((s=e.website)!=null&&s.link)||!!((o=e.termsOfService)!=null&&o.link)||!!((a=e.privacyPolicy)!=null&&a.link);return z.jsxs(yw,{children:[z.jsxs(On,{children:[z.jsxs(On.Content,{disabled:!n,children:[z.jsx(On.Avatar,{src:e.botAvatar,children:e.botName||"Bot"}),z.jsx(On.Title,{children:e.botName||"Bot"}),z.jsx(On.Description,{children:e.botDescription}),z.jsxs(On.Actions,{children:[z.jsx(Tw,{}),t&&z.jsx(KU,{})]})]}),z.jsxs(On.ExpandedContent,{children:[z.jsx(On.DescriptionItem,{"data-email":"",icon:QT,title:(l=e.email)==null?void 0:l.title,link:(c=e.email)==null?void 0:c.link}),z.jsx(On.DescriptionItem,{"data-phone":"",icon:iO,title:(u=e.phone)==null?void 0:u.title,link:(d=e.phone)==null?void 0:d.link}),z.jsx(On.DescriptionItem,{"data-website":"",link:(h=e.website)==null?void 0:h.link,icon:eO,title:(f=e.website)==null?void 0:f.title}),z.jsx(On.DescriptionItem,{"data-terms":"",link:(p=e.termsOfService)==null?void 0:p.link,icon:GT,title:(m=e.termsOfService)==null?void 0:m.title}),z.jsx(On.DescriptionItem,{"data-privacy":"",link:(y=e.privacyPolicy)==null?void 0:y.link,icon:nO,title:(v=e.privacyPolicy)==null?void 0:v.title})]})]}),z.jsx(Sw,{}),z.jsxs(Ub,{children:[z.jsx(Fb,{placeholder:e.composerPlaceholder||"Type your message"}),z.jsx(Bb,{})]})]})},ys=H.object({title:H.string(),link:H.string().optional()}),Ow=H.object({composerPlaceholder:H.string().optional(),botName:H.string().optional(),botAvatar:H.string().optional(),botDescription:H.string().optional(),website:ys.optional(),email:ys.optional(),phone:ys.optional(),privacyPolicy:ys.optional(),termsOfService:ys.optional()}),Iw=H.enum(["heading1","heading2","heading3","text","horizontalRule","link","italic","bold","orderedList","unorderedList","listItem","lineBreak","pre"]),Pw=H.object({}).passthrough().transform(e=>e),Ee=H.object({className:H.string().optional(),style:Pw.optional()}),$l=H.object({container:Ee.optional(),image:Ee.optional(),fallback:Ee.optional()}),Aw=H.object({button:Ee.optional(),text:H.record(Iw,Ee.optional()),image:H.object({image:Ee.optional(),placeholder:Ee.optional()}).optional(),audio:Ee.optional(),video:Ee.optional(),file:H.object({container:Ee.optional(),title:Ee.optional(),icon:Ee.optional()}).optional(),location:H.object({container:Ee.optional(),title:Ee.optional(),icon:Ee.optional()}).optional(),column:Ee.optional(),row:Ee.optional(),bubble:Ee.optional(),carousel:H.object({container:Ee.optional(),slidesContainer:Ee.optional(),backButton:Ee.optional(),nextButton:Ee.optional()}).optional(),dropdown:H.object({button:H.object({container:Ee.optional(),icon:Ee.optional(),text:Ee.optional()}).optional(),content:H.object({container:Ee.optional(),item:Ee.optional()}).optional()}).optional()}),Rw=H.object({container:Ee.optional(),modal:H.object({overlay:Ee.optional(),container:Ee.optional(),dialog:H.object({container:Ee.optional(),title:H.object({container:Ee.optional(),text:Ee.optional(),closeIcon:Ee.optional()}).optional(),content:Ee.optional(),newConversation:H.object({text:Ee.optional(),button:Ee.optional()}).optional()}).optional()}).optional(),notification:H.object({container:Ee.optional(),title:Ee.optional(),description:Ee.optional(),icon:Ee.optional(),closeIcon:Ee.optional()}).optional(),header:H.object({container:Ee.optional(),content:H.object({container:Ee.optional(),title:Ee.optional(),description:Ee.optional(),avatar:$l.optional(),actions:H.object({container:Ee.optional(),icons:Ee.optional()}).optional()}),expandedContent:H.object({container:Ee.optional(),descriptionItems:H.object({container:Ee.optional(),icon:Ee.optional(),text:Ee.optional(),link:Ee.optional()}).optional()}).optional(),description:H.object({container:Ee.optional(),title:Ee.optional(),subtitle:Ee.optional()}).optional(),newConversationIcon:Ee.optional()}).optional(),composer:H.object({container:Ee.optional(),input:Ee.optional(),button:H.object({container:Ee.optional(),icon:Ee.optional()}).optional()}).optional(),fab:H.object({icon:Ee.optional(),container:Ee.optional()}).optional(),messageList:H.object({container:Ee.optional(),marquee:H.object({content:Ee.optional(),title:Ee.optional(),description:Ee.optional(),avatar:$l.optional(),container:Ee.optional()}).optional(),scrollDownButton:H.object({container:Ee.optional(),button:Ee.optional(),icon:Ee.optional()}).optional()}).optional(),message:H.object({container:Ee.optional(),avatar:$l.optional(),blocks:Aw.optional()}).optional(),loadingIndicator:H.object({container:Ee.optional(),loader:Ee.optional()}).optional()}),$w=H.enum(["opened","closed","initial"]),Mw=H.object({data:H.record(H.string()).optional()}),Lw=H.enum(["messaging","pushpin"]),Dw=H.object({configuration:Ow.optional().catch(void 0),theme:Rw.optional().catch(void 0),style:H.string().optional().catch(void 0),user:Mw.optional().catch(void 0)}),GU=Dw.extend({clientId:H.string(),botId:H.string(),selector:H.string().optional().catch(void 0),webchatScriptUrl:H.string().optional().catch(void 0),fabScriptUrl:H.string().optional().catch(void 0),messagingUrl:H.string().optional().catch(void 0),pushpinUrl:H.string().optional().catch(void 0),clientMode:Lw.optional().catch(void 0),defaultState:$w.optional().catch(void 0)}),YU=({clientId:e,apiUrl:t,mode:n="messaging"})=>n==="messaging"?new rb({url:t,clientId:e}):new jb({apiUrl:t,clientId:e});Ye.Avatar=Bl,Ye.Block=Wi,Ye.Composer=Ub,Ye.ComposerButton=Bb,Ye.ComposerInput=Fb,Ye.Container=yw,Ye.Fab=_U,Ye.Header=On,Ye.LoadingIndicator=ww,Ye.Message=Ud,Ye.MessageList=Sw,Ye.Modal=ii,Ye.ModalProvider=Vb,Ye.RestartConversation=Tw,Ye.Webchat=JU,Ye.WebchatProvider=J2,Ye.avatarThemeSchema=$l,Ye.blockThemeSchema=Aw,Ye.clientModePropsSchema=Lw,Ye.configPropsSchema=Dw,Ye.configurationSchema=Ow,Ye.cssStyleSchema=Pw,Ye.descriptionItemSchema=ys,Ye.getClient=YU,Ye.initPropsSchema=GU,Ye.markdownTypeSchema=Iw,Ye.renderers=uu,Ye.statePropsSchema=$w,Ye.styleOptionSchema=Ee,Ye.themeSchema=Rw,Ye.useClient=K2,Ye.useWebchatContext=mt,Ye.userPropsSchema=Mw,Object.defineProperty(Ye,Symbol.toStringTag,{value:"Module"})});
|