@botpress/webchat 4.4.5 → 4.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(re,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],x):(re=typeof globalThis<"u"?globalThis:re||self,x(re.Webchat={},re.ReactJsxRuntime,re.React,re.ReactDOM))})(this,function(re,x,M,Fu){"use strict";var ts=typeof document<"u"?document.currentScript:null;function Ru(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 C=Ru(M),$u=Ru(Fu);function Hv(e,t=[]){let n=[];function r(o,s){const a=C.createContext(s);a.displayName=o+"Context";const l=n.length;n=[...n,s];const u=c=>{var v;const{scope:h,children:d,...m}=c,p=((v=h==null?void 0:h[e])==null?void 0:v[l])||a,g=C.useMemo(()=>m,Object.values(m));return x.jsx(p.Provider,{value:g,children:d})};u.displayName=o+"Provider";function f(c,h){var p;const d=((p=h==null?void 0:h[e])==null?void 0:p[l])||a,m=C.useContext(d);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[u,f]}const i=()=>{const o=n.map(s=>C.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,jv(i,...t)]}function jv(...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(o){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(o)[`__scope${u}`];return{...a,...c}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Ln(e){const t=C.useRef(e);return C.useEffect(()=>{t.current=e}),C.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var en=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{};function Bu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ns(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Bu(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():Bu(e[i],null)}}}}function tn(...e){return C.useCallback(ns(...e),e)}var Vv=Symbol.for("react.lazy"),bi=C[" use ".trim().toString()];function Wv(e){return typeof e=="object"&&e!==null&&"then"in e}function zu(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Vv&&"_payload"in e&&Wv(e._payload)}function qv(e){const t=Yv(e),n=C.forwardRef((r,i)=>{let{children:o,...s}=r;zu(o)&&typeof bi=="function"&&(o=bi(o._payload));const a=C.Children.toArray(o),l=a.find(Gv);if(l){const u=l.props.children,f=a.map(c=>c===l?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:c);return x.jsx(t,{...s,ref:i,children:C.isValidElement(u)?C.cloneElement(u,void 0,f):null})}return x.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function Yv(e){const t=C.forwardRef((n,r)=>{let{children:i,...o}=n;if(zu(i)&&typeof bi=="function"&&(i=bi(i._payload)),C.isValidElement(i)){const s=Zv(i),a=Qv(o,i.props);return i.type!==C.Fragment&&(a.ref=r?ns(r,s):s),C.cloneElement(i,a)}return C.Children.count(i)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Kv=Symbol("radix.slottable");function Gv(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Kv}function Qv(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const l=o(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Zv(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Jv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],rs=Jv.reduce((e,t)=>{const n=qv(`Primitive.${t}`),r=C.forwardRef((i,o)=>{const{asChild:s,...a}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),yn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var is={exports:{}},os={};/**
1
+ (function(re,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],x):(re=typeof globalThis<"u"?globalThis:re||self,x(re.Webchat={},re.ReactJsxRuntime,re.React,re.ReactDOM))})(this,function(re,x,M,$u){"use strict";var ts=typeof document<"u"?document.currentScript:null;function Bu(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 A=Bu(M),zu=Bu($u);function jv(e,t=[]){let n=[];function r(o,s){const a=A.createContext(s);a.displayName=o+"Context";const l=n.length;n=[...n,s];const u=c=>{var v;const{scope:h,children:d,...m}=c,p=((v=h==null?void 0:h[e])==null?void 0:v[l])||a,g=A.useMemo(()=>m,Object.values(m));return x.jsx(p.Provider,{value:g,children:d})};u.displayName=o+"Provider";function f(c,h){var p;const d=((p=h==null?void 0:h[e])==null?void 0:p[l])||a,m=A.useContext(d);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[u,f]}const i=()=>{const o=n.map(s=>A.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return A.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,Vv(i,...t)]}function Vv(...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(o){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(o)[`__scope${u}`];return{...a,...c}},{});return A.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Ln(e){const t=A.useRef(e);return A.useEffect(()=>{t.current=e}),A.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var en=globalThis!=null&&globalThis.document?A.useLayoutEffect:()=>{};function Uu(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ns(...e){return t=>{let n=!1;const r=e.map(i=>{const o=Uu(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():Uu(e[i],null)}}}}function tn(...e){return A.useCallback(ns(...e),e)}var Wv=Symbol.for("react.lazy"),bi=A[" use ".trim().toString()];function qv(e){return typeof e=="object"&&e!==null&&"then"in e}function Hu(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Wv&&"_payload"in e&&qv(e._payload)}function Yv(e){const t=Kv(e),n=A.forwardRef((r,i)=>{let{children:o,...s}=r;Hu(o)&&typeof bi=="function"&&(o=bi(o._payload));const a=A.Children.toArray(o),l=a.find(Qv);if(l){const u=l.props.children,f=a.map(c=>c===l?A.Children.count(u)>1?A.Children.only(null):A.isValidElement(u)?u.props.children:null:c);return x.jsx(t,{...s,ref:i,children:A.isValidElement(u)?A.cloneElement(u,void 0,f):null})}return x.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function Kv(e){const t=A.forwardRef((n,r)=>{let{children:i,...o}=n;if(Hu(i)&&typeof bi=="function"&&(i=bi(i._payload)),A.isValidElement(i)){const s=Jv(i),a=Zv(o,i.props);return i.type!==A.Fragment&&(a.ref=r?ns(r,s):s),A.cloneElement(i,a)}return A.Children.count(i)>1?A.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Gv=Symbol("radix.slottable");function Qv(e){return A.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Gv}function Zv(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const l=o(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Jv(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Xv=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],rs=Xv.reduce((e,t)=>{const n=Yv(`Primitive.${t}`),r=A.forwardRef((i,o)=>{const{asChild:s,...a}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),yn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var is={exports:{}},os={};/**
2
2
  * @license React
3
3
  * use-sync-external-store-shim.production.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 Uu;function Xv(){if(Uu)return os;Uu=1;var e=M;function t(c,h){return c===h&&(c!==0||1/c===1/h)||c!==c&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(c,h){var d=h(),m=r({inst:{value:d,getSnapshot:h}}),p=m[0].inst,g=m[1];return o(function(){p.value=d,p.getSnapshot=h,l(p)&&g({inst:p})},[c,d,h]),i(function(){return l(p)&&g({inst:p}),c(function(){l(p)&&g({inst:p})})},[c]),s(d),d}function l(c){var h=c.getSnapshot;c=c.value;try{var d=h();return!n(c,d)}catch{return!0}}function u(c,h){return h()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return os.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,os}var ss={};/**
9
+ */var ju;function eb(){if(ju)return os;ju=1;var e=M;function t(c,h){return c===h&&(c!==0||1/c===1/h)||c!==c&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(c,h){var d=h(),m=r({inst:{value:d,getSnapshot:h}}),p=m[0].inst,g=m[1];return o(function(){p.value=d,p.getSnapshot=h,l(p)&&g({inst:p})},[c,d,h]),i(function(){return l(p)&&g({inst:p}),c(function(){l(p)&&g({inst:p})})},[c]),s(d),d}function l(c){var h=c.getSnapshot;c=c.value;try{var d=h();return!n(c,d)}catch{return!0}}function u(c,h){return h()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return os.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,os}var ss={};/**
10
10
  * @license React
11
11
  * use-sync-external-store-shim.development.js
12
12
  *
@@ -14,239 +14,239 @@
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 Hu;function eb(){return Hu||(Hu=1,process.env.NODE_ENV!=="production"&&function(){function e(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}function t(d,m){f||i.startTransition===void 0||(f=!0,console.error("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 p=m();if(!c){var g=m();o(p,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}g=s({inst:{value:p,getSnapshot:m}});var v=g[0].inst,y=g[1];return l(function(){v.value=p,v.getSnapshot=m,n(v)&&y({inst:v})},[d,p,m]),a(function(){return n(v)&&y({inst:v}),d(function(){n(v)&&y({inst:v})})},[d]),u(p),p}function n(d){var m=d.getSnapshot;d=d.value;try{var p=m();return!o(d,p)}catch{return!0}}function r(d,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=M,o=typeof Object.is=="function"?Object.is:e,s=i.useState,a=i.useEffect,l=i.useLayoutEffect,u=i.useDebugValue,f=!1,c=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;ss.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),ss}process.env.NODE_ENV==="production"?is.exports=Xv():is.exports=eb();var as=is.exports;function tb(){return as.useSyncExternalStore(nb,()=>!0,()=>!1)}function nb(){return()=>{}}var ls="Avatar",[rb]=Hv(ls),[ib,ju]=rb(ls),us=C.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=C.useState("idle");return x.jsx(ib,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:x.jsx(rs.span,{...r,ref:t})})});us.displayName=ls;var Vu="AvatarImage",cs=C.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,s=ju(Vu,n),a=ob(r,o),l=Ln(u=>{i(u),s.onImageLoadingStatusChange(u)});return en(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?x.jsx(rs.img,{...o,ref:t,src:r}):null});cs.displayName=Vu;var Wu="AvatarFallback",fs=C.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=ju(Wu,n),[s,a]=C.useState(r===void 0);return C.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),s&&o.imageLoadingStatus!=="loaded"?x.jsx(rs.span,{...i,ref:t}):null});fs.displayName=Wu;function qu(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function ob(e,{referrerPolicy:t,crossOrigin:n}){const r=tb(),i=C.useRef(null),o=r?(i.current||(i.current=new window.Image),i.current):null,[s,a]=C.useState(()=>qu(o,e));return en(()=>{a(qu(o,e))},[o,e]),en(()=>{const l=c=>()=>{a(c)};if(!o)return;const u=l("loaded"),f=l("error");return o.addEventListener("load",u),o.addEventListener("error",f),t&&(o.referrerPolicy=t),typeof n=="string"&&(o.crossOrigin=n),()=>{o.removeEventListener("load",u),o.removeEventListener("error",f)}},[o,n,t]),s}function Yu(e,t){let n=`${e} {`;for(const[r,i]of Object.entries(t))n+=`${r}: ${i}; `;return n+="}",n}function Ku(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 sb=(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 o=new Image;o.addEventListener("load",()=>{i&&clearTimeout(i),n({width:o.naturalWidth,height:o.naturalHeight})}),o.addEventListener("error",s=>{i&&clearTimeout(i),r(`${s.type}: ${s.message}`)}),o.src=e,t.timeout&&(i=setTimeout(()=>r("Timeout"),t.timeout))});var Gu={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(yn,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",s="second",a="minute",l="hour",u="day",f="week",c="month",h="quarter",d="year",m="date",p="Invalid Date",g=/^(\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,y={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(F){var R=["th","st","nd","rd"],N=F%100;return"["+F+(R[(N-20)%10]||R[N]||R[0])+"]"}},w=function(F,R,N){var H=String(F);return!H||H.length>=R?F:""+Array(R+1-H.length).join(N)+F},A={s:w,z:function(F){var R=-F.utcOffset(),N=Math.abs(R),H=Math.floor(N/60),z=N%60;return(R<=0?"+":"-")+w(H,2,"0")+":"+w(z,2,"0")},m:function F(R,N){if(R.date()<N.date())return-F(N,R);var H=12*(N.year()-R.year())+(N.month()-R.month()),z=R.clone().add(H,c),W=N-z<0,b=R.clone().add(H+(W?-1:1),c);return+(-(H+(N-z)/(W?z-b:b-z))||0)},a:function(F){return F<0?Math.ceil(F)||0:Math.floor(F)},p:function(F){return{M:c,y:d,w:f,d:u,D:m,h:l,m:a,s,ms:o,Q:h}[F]||String(F||"").toLowerCase().replace(/s$/,"")},u:function(F){return F===void 0}},k="en",E={};E[k]=y;var I="$isDayjsObject",D=function(F){return F instanceof B||!(!F||!F[I])},P=function F(R,N,H){var z;if(!R)return k;if(typeof R=="string"){var W=R.toLowerCase();E[W]&&(z=W),N&&(E[W]=N,z=W);var b=R.split("-");if(!z&&b.length>1)return F(b[0])}else{var _=R.name;E[_]=R,z=_}return!H&&z&&(k=z),z||!H&&k},T=function(F,R){if(D(F))return F.clone();var N=typeof R=="object"?R:{};return N.date=F,N.args=arguments,new B(N)},O=A;O.l=P,O.i=D,O.w=function(F,R){return T(F,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var B=function(){function F(N){this.$L=P(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[I]=!0}var R=F.prototype;return R.parse=function(N){this.$d=function(H){var z=H.date,W=H.utc;if(z===null)return new Date(NaN);if(O.u(z))return new Date;if(z instanceof Date)return new Date(z);if(typeof z=="string"&&!/Z$/i.test(z)){var b=z.match(g);if(b){var _=b[2]-1||0,j=(b[7]||"0").substring(0,3);return W?new Date(Date.UTC(b[1],_,b[3]||1,b[4]||0,b[5]||0,b[6]||0,j)):new Date(b[1],_,b[3]||1,b[4]||0,b[5]||0,b[6]||0,j)}}return new Date(z)}(N),this.init()},R.init=function(){var N=this.$d;this.$y=N.getFullYear(),this.$M=N.getMonth(),this.$D=N.getDate(),this.$W=N.getDay(),this.$H=N.getHours(),this.$m=N.getMinutes(),this.$s=N.getSeconds(),this.$ms=N.getMilliseconds()},R.$utils=function(){return O},R.isValid=function(){return this.$d.toString()!==p},R.isSame=function(N,H){var z=T(N);return this.startOf(H)<=z&&z<=this.endOf(H)},R.isAfter=function(N,H){return T(N)<this.startOf(H)},R.isBefore=function(N,H){return this.endOf(H)<T(N)},R.$g=function(N,H,z){return O.u(N)?this[H]:this.set(z,N)},R.unix=function(){return Math.floor(this.valueOf()/1e3)},R.valueOf=function(){return this.$d.getTime()},R.startOf=function(N,H){var z=this,W=!!O.u(H)||H,b=O.p(N),_=function(se,G){var te=O.w(z.$u?Date.UTC(z.$y,G,se):new Date(z.$y,G,se),z);return W?te:te.endOf(u)},j=function(se,G){return O.w(z.toDate()[se].apply(z.toDate("s"),(W?[0,0,0,0]:[23,59,59,999]).slice(G)),z)},S=this.$W,V=this.$M,Y=this.$D,q="set"+(this.$u?"UTC":"");switch(b){case d:return W?_(1,0):_(31,11);case c:return W?_(1,V):_(0,V+1);case f:var Q=this.$locale().weekStart||0,X=(S<Q?S+7:S)-Q;return _(W?Y-X:Y+(6-X),V);case u:case m:return j(q+"Hours",0);case l:return j(q+"Minutes",1);case a:return j(q+"Seconds",2);case s:return j(q+"Milliseconds",3);default:return this.clone()}},R.endOf=function(N){return this.startOf(N,!1)},R.$set=function(N,H){var z,W=O.p(N),b="set"+(this.$u?"UTC":""),_=(z={},z[u]=b+"Date",z[m]=b+"Date",z[c]=b+"Month",z[d]=b+"FullYear",z[l]=b+"Hours",z[a]=b+"Minutes",z[s]=b+"Seconds",z[o]=b+"Milliseconds",z)[W],j=W===u?this.$D+(H-this.$W):H;if(W===c||W===d){var S=this.clone().set(m,1);S.$d[_](j),S.init(),this.$d=S.set(m,Math.min(this.$D,S.daysInMonth())).$d}else _&&this.$d[_](j);return this.init(),this},R.set=function(N,H){return this.clone().$set(N,H)},R.get=function(N){return this[O.p(N)]()},R.add=function(N,H){var z,W=this;N=Number(N);var b=O.p(H),_=function(V){var Y=T(W);return O.w(Y.date(Y.date()+Math.round(V*N)),W)};if(b===c)return this.set(c,this.$M+N);if(b===d)return this.set(d,this.$y+N);if(b===u)return _(1);if(b===f)return _(7);var j=(z={},z[a]=r,z[l]=i,z[s]=n,z)[b]||1,S=this.$d.getTime()+N*j;return O.w(S,this)},R.subtract=function(N,H){return this.add(-1*N,H)},R.format=function(N){var H=this,z=this.$locale();if(!this.isValid())return z.invalidDate||p;var W=N||"YYYY-MM-DDTHH:mm:ssZ",b=O.z(this),_=this.$H,j=this.$m,S=this.$M,V=z.weekdays,Y=z.months,q=z.meridiem,Q=function(G,te,$,ne){return G&&(G[te]||G(H,W))||$[te].slice(0,ne)},X=function(G){return O.s(_%12||12,G,"0")},se=q||function(G,te,$){var ne=G<12?"AM":"PM";return $?ne.toLowerCase():ne};return W.replace(v,function(G,te){return te||function($){switch($){case"YY":return String(H.$y).slice(-2);case"YYYY":return O.s(H.$y,4,"0");case"M":return S+1;case"MM":return O.s(S+1,2,"0");case"MMM":return Q(z.monthsShort,S,Y,3);case"MMMM":return Q(Y,S);case"D":return H.$D;case"DD":return O.s(H.$D,2,"0");case"d":return String(H.$W);case"dd":return Q(z.weekdaysMin,H.$W,V,2);case"ddd":return Q(z.weekdaysShort,H.$W,V,3);case"dddd":return V[H.$W];case"H":return String(_);case"HH":return O.s(_,2,"0");case"h":return X(1);case"hh":return X(2);case"a":return se(_,j,!0);case"A":return se(_,j,!1);case"m":return String(j);case"mm":return O.s(j,2,"0");case"s":return String(H.$s);case"ss":return O.s(H.$s,2,"0");case"SSS":return O.s(H.$ms,3,"0");case"Z":return b}return null}(G)||b.replace(":","")})},R.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},R.diff=function(N,H,z){var W,b=this,_=O.p(H),j=T(N),S=(j.utcOffset()-this.utcOffset())*r,V=this-j,Y=function(){return O.m(b,j)};switch(_){case d:W=Y()/12;break;case c:W=Y();break;case h:W=Y()/3;break;case f:W=(V-S)/6048e5;break;case u:W=(V-S)/864e5;break;case l:W=V/i;break;case a:W=V/r;break;case s:W=V/n;break;default:W=V}return z?W:O.a(W)},R.daysInMonth=function(){return this.endOf(c).$D},R.$locale=function(){return E[this.$L]},R.locale=function(N,H){if(!N)return this.$L;var z=this.clone(),W=P(N,H,!0);return W&&(z.$L=W),z},R.clone=function(){return O.w(this.$d,this)},R.toDate=function(){return new Date(this.valueOf())},R.toJSON=function(){return this.isValid()?this.toISOString():null},R.toISOString=function(){return this.$d.toISOString()},R.toString=function(){return this.$d.toUTCString()},F}(),L=B.prototype;return T.prototype=L,[["$ms",o],["$s",s],["$m",a],["$H",l],["$W",u],["$M",c],["$y",d],["$D",m]].forEach(function(F){L[F[1]]=function(R){return this.$g(R,F[0],F[1])}}),T.extend=function(F,R){return F.$i||(F(R,B,T),F.$i=!0),T},T.locale=P,T.isDayjs=D,T.unix=function(F){return T(1e3*F)},T.en=E[k],T.Ls=E,T.p={},T})})(Gu);var ab=Gu.exports;const wi=vn(ab);var Qu={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(yn,function(){return function(n,r,i){r.prototype.isToday=function(){var o="YYYY-MM-DD",s=i();return this.format(o)===s.format(o)}}})})(Qu);var lb=Qu.exports;const ub=vn(lb);var Zu={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(yn,function(){return function(n,r,i){r.prototype.isYesterday=function(){var o="YYYY-MM-DD",s=i().subtract(1,"day");return this.format(o)===s.format(o)}}})})(Zu);var cb=Zu.exports;const fb=vn(cb);wi.extend(ub),wi.extend(fb);function Ju(e,t,n,r,i){return e.map(o=>{const{authorId:s}=o,a=s===n?"outgoing":"incoming",l=t.find(f=>f.id===s);let u;return l&&l.id===n?u={name:l.name||"You",avatar:l.pictureUrl}:l?u={name:l.name||"Agent",avatar:l.pictureUrl}:u={name:r||"Bot",avatar:i},{...o,direction:a,sender:u}})}function db(e,t="day"){var r,i,o;if(!e||e.length===0)return[];const n=[];(r=e[0])!=null&&r.timestamp&&n.push(Xu(e[0].timestamp));for(let s=0;s<e.length;s++)if(e[s]&&n.push(e[s]),s+1<e.length){const a=(i=e[s])==null?void 0:i.timestamp,l=(o=e[s+1])==null?void 0:o.timestamp;!wi(a).isSame(l,t)&&l&&n.push(Xu(l))}return n}function Xu(e){return{id:ec(e),direction:"system",sender:{name:"system"},timestamp:e,block:{type:"text",text:ec(e)}}}function ec(e,t=!1){const n=wi(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")}function hb(e=""){if(typeof e!="string")throw new TypeError("Color should be string!");const t=/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(e);if(t)return t.splice(1).map(r=>Number.parseInt(r,16));const n=/^#?([\da-f])([\da-f])([\da-f])$/i.exec(e);if(n)return n.splice(1).map(r=>Number.parseInt(r+r,16));if(e.includes(","))return e.split(",").map(r=>Number.parseInt(r));throw new Error("Invalid color format! Use #ABC or #AABBCC or r,g,b")}function pb(e){return"#"+e.map(t=>`0${t.toString(16).toUpperCase()}`.slice(-2)).join("")}function mb(e,t){return e.map(n=>Math.round(n+(255-n)*t))}function gb(e,t){return e.map(n=>Math.round(n*t))}const wr=e=>t=>mb(t,e),Sr=e=>t=>gb(t,e),yb={50:wr(.95),100:wr(.9),200:wr(.75),300:wr(.6),400:wr(.3),500:e=>e,600:Sr(.9),700:Sr(.6),800:Sr(.45),900:Sr(.3),950:Sr(.2)};function tc(e,t=yb){const n={},r=hb(e);for(const[i,o]of Object.entries(t))n[i]=pb(o(r));return n}const nc=()=>{const e={};return{on:(i,o)=>{var s;return e[i]||(e[i]=new Set),(s=e[i])==null||s.add(o),()=>{var a;return(a=e[i])==null?void 0:a.delete(o)}},emit:(i,o)=>{var s,a;(s=e[i])==null||s.forEach(l=>l(o)),(a=e["*"])==null||a.forEach(l=>l({type:i,payload:o}))},removeAllListeners:i=>{var o;i?(o=e[i])==null||o.clear():Object.keys(e).forEach(s=>{var a;(a=e[s])==null||a.clear()})}}};class bn extends Error{}class vb extends bn{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class bb extends bn{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class wb extends bn{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class xr extends bn{}class rc extends bn{constructor(t){super(`Invalid unit ${t}`)}}class vt extends bn{}class nn extends bn{constructor(){super("Zone is an abstract class")}}const ie="numeric",At="short",ht="long",ds={year:ie,month:ie,day:ie},ic={year:ie,month:At,day:ie},Sb={year:ie,month:At,day:ie,weekday:At},oc={year:ie,month:ht,day:ie},sc={year:ie,month:ht,day:ie,weekday:ht},ac={hour:ie,minute:ie},lc={hour:ie,minute:ie,second:ie},uc={hour:ie,minute:ie,second:ie,timeZoneName:At},cc={hour:ie,minute:ie,second:ie,timeZoneName:ht},fc={hour:ie,minute:ie,hourCycle:"h23"},dc={hour:ie,minute:ie,second:ie,hourCycle:"h23"},hc={hour:ie,minute:ie,second:ie,hourCycle:"h23",timeZoneName:At},pc={hour:ie,minute:ie,second:ie,hourCycle:"h23",timeZoneName:ht},mc={year:ie,month:ie,day:ie,hour:ie,minute:ie},gc={year:ie,month:ie,day:ie,hour:ie,minute:ie,second:ie},yc={year:ie,month:At,day:ie,hour:ie,minute:ie},vc={year:ie,month:At,day:ie,hour:ie,minute:ie,second:ie},xb={year:ie,month:At,day:ie,weekday:At,hour:ie,minute:ie},bc={year:ie,month:ht,day:ie,hour:ie,minute:ie,timeZoneName:At},wc={year:ie,month:ht,day:ie,hour:ie,minute:ie,second:ie,timeZoneName:At},Sc={year:ie,month:ht,day:ie,weekday:ht,hour:ie,minute:ie,timeZoneName:ht},xc={year:ie,month:ht,day:ie,weekday:ht,hour:ie,minute:ie,second:ie,timeZoneName:ht};function xe(e){return typeof e>"u"}function wn(e){return typeof e=="number"}function Si(e){return typeof e=="number"&&e%1===0}function kb(e){return typeof e=="string"}function Eb(e){return Object.prototype.toString.call(e)==="[object Date]"}function kc(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Cb(e){return Array.isArray(e)?e:[e]}function Ec(e,t,n){if(e.length!==0)return e.reduce((r,i)=>{const o=[t(i),i];return r&&n(r[0],o[0])===r[0]?r:o},null)[1]}function Ab(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function Fn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function qt(e,t,n){return Si(e)&&e>=t&&e<=n}function Tb(e,t){return e-t*Math.floor(e/t)}function Ve(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function rn(e){if(!(xe(e)||e===null||e===""))return parseInt(e,10)}function Sn(e){if(!(xe(e)||e===null||e===""))return parseFloat(e)}function hs(e){if(!(xe(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function ps(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function kr(e){return e%4===0&&(e%100!==0||e%400===0)}function Er(e){return kr(e)?366:365}function xi(e,t){const n=Tb(t-1,12)+1,r=e+(t-n)/12;return n===2?kr(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function ms(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(t.getUTCFullYear()-1900)),+t}function ki(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return t===4||r===3?53:52}function gs(e){return e>99?e:e>60?1900+e:2e3+e}function Cc(e,t,n,r=null){const i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);const s={timeZoneName:t,...o},a=new Intl.DateTimeFormat(n,s).formatToParts(i).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function Ei(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function Ac(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new vt(`Invalid unit value ${e}`);return t}function Ci(e,t){const n={};for(const r in e)if(Fn(e,r)){const i=e[r];if(i==null)continue;n[t(r)]=Ac(i)}return n}function Cr(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${Ve(n,2)}:${Ve(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${Ve(n,2)}${Ve(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Ai(e){return Ab(e,["hour","minute","second","millisecond"])}const Tc=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,Ib=["January","February","March","April","May","June","July","August","September","October","November","December"],Ic=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ob=["J","F","M","A","M","J","J","A","S","O","N","D"];function Oc(e){switch(e){case"narrow":return[...Ob];case"short":return[...Ic];case"long":return[...Ib];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Mc=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Dc=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Mb=["M","T","W","T","F","S","S"];function Nc(e){switch(e){case"narrow":return[...Mb];case"short":return[...Dc];case"long":return[...Mc];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const _c=["AM","PM"],Db=["Before Christ","Anno Domini"],Nb=["BC","AD"],_b=["B","A"];function Pc(e){switch(e){case"narrow":return[..._b];case"short":return[...Nb];case"long":return[...Db];default:return null}}function Pb(e){return _c[e.hour<12?0:1]}function Lb(e,t){return Nc(t)[e.weekday-1]}function Fb(e,t){return Oc(t)[e.month-1]}function Rb(e,t){return Pc(t)[e.year<0?0:1]}function $b(e,t,n="always",r=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&o){const c=e==="days";switch(t){case 1:return c?"tomorrow":`next ${i[e][0]}`;case-1:return c?"yesterday":`last ${i[e][0]}`;case 0:return c?"today":`this ${i[e][0]}`}}const s=Object.is(t,-0)||t<0,a=Math.abs(t),l=a===1,u=i[e],f=r?l?u[1]:u[2]||u[1]:l?i[e][0]:e;return s?`${a} ${f} ago`:`in ${a} ${f}`}function Lc(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const Bb={D:ds,DD:ic,DDD:oc,DDDD:sc,t:ac,tt:lc,ttt:uc,tttt:cc,T:fc,TT:dc,TTT:hc,TTTT:pc,f:mc,ff:yc,fff:bc,ffff:Sc,F:gc,FF:vc,FFF:wc,FFFF:xc};class lt{static create(t,n={}){return new lt(t,n)}static parseFormat(t){let n=null,r="",i=!1;const o=[];for(let s=0;s<t.length;s++){const a=t.charAt(s);a==="'"?(r.length>0&&o.push({literal:i,val:r}),n=null,r="",i=!i):i||a===n?r+=a:(r.length>0&&o.push({literal:!1,val:r}),r=a,n=a)}return r.length>0&&o.push({literal:i,val:r}),o}static macroTokenToFormatOpts(t){return Bb[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTime(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTimeParts(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).formatToParts()}resolvedOptions(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).resolvedOptions()}num(t,n=0){if(this.opts.forceSimple)return Ve(t,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(d,m)=>this.loc.extract(t,d,m),s=d=>t.isOffsetFixed&&t.offset===0&&d.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,d.format):"",a=()=>r?Pb(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(d,m)=>r?Fb(t,d):o(m?{month:d}:{month:d,day:"numeric"},"month"),u=(d,m)=>r?Lb(t,d):o(m?{weekday:d}:{weekday:d,month:"long",day:"numeric"},"weekday"),f=d=>{const m=lt.macroTokenToFormatOpts(d);return m?this.formatWithSystemDefault(t,m):d},c=d=>r?Rb(t,d):o({era:d},"era"),h=d=>{switch(d){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return a();case"d":return i?o({day:"numeric"},"day"):this.num(t.day);case"dd":return i?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return i?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return i?o({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return i?o({month:"numeric"},"month"):this.num(t.month);case"MM":return i?o({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return i?o({year:"numeric"},"year"):this.num(t.year);case"yy":return i?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return i?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return i?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return f(d)}};return Lc(lt.parseFormat(n),h)}formatDurationFromString(t,n){const r=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},i=l=>u=>{const f=r(u);return f?this.num(l.get(f),u.length):u},o=lt.parseFormat(n),s=o.reduce((l,{literal:u,val:f})=>u?l:l.concat(f),[]),a=t.shiftTo(...s.map(r).filter(l=>l));return Lc(o,i(a))}}class Tt{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Ar{get type(){throw new nn}get name(){throw new nn}get ianaName(){return this.name}get isUniversal(){throw new nn}offsetName(t,n){throw new nn}formatOffset(t,n){throw new nn}offset(t){throw new nn}equals(t){throw new nn}get isValid(){throw new nn}}let ys=null;class vs extends Ar{static get instance(){return ys===null&&(ys=new vs),ys}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Cc(t,n,r)}formatOffset(t,n){return Cr(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let Ti={};function zb(e){return Ti[e]||(Ti[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Ti[e]}const Ub={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Hb(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,o,s,a,l,u,f]=r;return[s,i,o,a,l,u,f]}function jb(e,t){const n=e.formatToParts(t),r=[];for(let i=0;i<n.length;i++){const{type:o,value:s}=n[i],a=Ub[o];o==="era"?r[a]=s:xe(a)||(r[a]=parseInt(s,10))}return r}let Ii={};class Yt extends Ar{static create(t){return Ii[t]||(Ii[t]=new Yt(t)),Ii[t]}static resetCache(){Ii={},Ti={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=Yt.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Cc(t,n,r,this.name)}formatOffset(t,n){return Cr(this.offset(t),n)}offset(t){const n=new Date(t);if(isNaN(n))return NaN;const r=zb(this.name);let[i,o,s,a,l,u,f]=r.formatToParts?jb(r,n):Hb(r,n);a==="BC"&&(i=-Math.abs(i)+1);const h=ms({year:i,month:o,day:s,hour:l===24?0:l,minute:u,second:f,millisecond:0});let d=+n;const m=d%1e3;return d-=m>=0?m:1e3+m,(h-d)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let bs=null;class it extends Ar{static get utcInstance(){return bs===null&&(bs=new it(0)),bs}static instance(t){return t===0?it.utcInstance:new it(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new it(Ei(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Cr(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Cr(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Cr(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class Vb extends Ar{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function on(e,t){if(xe(e)||e===null)return t;if(e instanceof Ar)return e;if(kb(e)){const n=e.toLowerCase();return n==="local"||n==="system"?t:n==="utc"||n==="gmt"?it.utcInstance:it.parseSpecifier(n)||Yt.create(e)}else return wn(e)?it.instance(e):typeof e=="object"&&e.offset&&typeof e.offset=="number"?e:new Vb(e)}let Fc=()=>Date.now(),Rc="system",$c=null,Bc=null,zc=null,Uc;class qe{static get now(){return Fc}static set now(t){Fc=t}static set defaultZone(t){Rc=t}static get defaultZone(){return on(Rc,vs.instance)}static get defaultLocale(){return $c}static set defaultLocale(t){$c=t}static get defaultNumberingSystem(){return Bc}static set defaultNumberingSystem(t){Bc=t}static get defaultOutputCalendar(){return zc}static set defaultOutputCalendar(t){zc=t}static get throwOnInvalid(){return Uc}static set throwOnInvalid(t){Uc=t}static resetCaches(){Re.resetCache(),Yt.resetCache()}}let Hc={};function Wb(e,t={}){const n=JSON.stringify([e,t]);let r=Hc[n];return r||(r=new Intl.ListFormat(e,t),Hc[n]=r),r}let ws={};function Ss(e,t={}){const n=JSON.stringify([e,t]);let r=ws[n];return r||(r=new Intl.DateTimeFormat(e,t),ws[n]=r),r}let xs={};function qb(e,t={}){const n=JSON.stringify([e,t]);let r=xs[n];return r||(r=new Intl.NumberFormat(e,t),xs[n]=r),r}let ks={};function Yb(e,t={}){const{base:n,...r}=t,i=JSON.stringify([e,r]);let o=ks[i];return o||(o=new Intl.RelativeTimeFormat(e,t),ks[i]=o),o}let Tr=null;function Kb(){return Tr||(Tr=new Intl.DateTimeFormat().resolvedOptions().locale,Tr)}function Gb(e){const t=e.indexOf("-u-");if(t===-1)return[e];{let n;const r=e.substring(0,t);try{n=Ss(e).resolvedOptions()}catch{n=Ss(r).resolvedOptions()}const{numberingSystem:i,calendar:o}=n;return[r,i,o]}}function Qb(e,t,n){return(n||t)&&(e+="-u",n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function Zb(e){const t=[];for(let n=1;n<=12;n++){const r=pe.utc(2016,n,1);t.push(e(r))}return t}function Jb(e){const t=[];for(let n=1;n<=7;n++){const r=pe.utc(2016,11,13+n);t.push(e(r))}return t}function Oi(e,t,n,r,i){const o=e.listingMode(n);return o==="error"?null:o==="en"?r(t):i(t)}function Xb(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}class e0{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:i,floor:o,...s}=r;if(!n||Object.keys(s).length>0){const a={useGrouping:!1,...r};r.padTo>0&&(a.minimumIntegerDigits=r.padTo),this.inf=qb(t,a)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):ps(t,3);return Ve(n,this.padTo)}}}class t0{constructor(t,n,r){this.opts=r;let i;if(t.zone.isUniversal){const s=-1*(t.offset/60),a=s>=0?`Etc/GMT+${s}`:`Etc/GMT${s}`;t.offset!==0&&Yt.create(a).valid?(i=a,this.dt=t):(i="UTC",r.timeZoneName?this.dt=t:this.dt=t.offset===0?t:pe.fromMillis(t.ts+t.offset*60*1e3))}else t.zone.type==="system"?this.dt=t:(this.dt=t,i=t.zone.name);const o={...this.opts};i&&(o.timeZone=i),this.dtf=Ss(n,o)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class n0{constructor(t,n,r){this.opts={style:"long",...r},!n&&kc()&&(this.rtf=Yb(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):$b(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}class Re{static fromOpts(t){return Re.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,n,r,i=!1){const o=t||qe.defaultLocale,s=o||(i?"en-US":Kb()),a=n||qe.defaultNumberingSystem,l=r||qe.defaultOutputCalendar;return new Re(s,a,l,o)}static resetCache(){Tr=null,ws={},xs={},ks={}}static fromObject({locale:t,numberingSystem:n,outputCalendar:r}={}){return Re.create(t,n,r)}constructor(t,n,r,i){const[o,s,a]=Gb(t);this.locale=o,this.numberingSystem=n||s||null,this.outputCalendar=r||a||null,this.intl=Qb(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Xb(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:Re.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1,r=!0){return Oi(this,t,r,Oc,()=>{const i=n?{month:t,day:"numeric"}:{month:t},o=n?"format":"standalone";return this.monthsCache[o][t]||(this.monthsCache[o][t]=Zb(s=>this.extract(s,i,"month"))),this.monthsCache[o][t]})}weekdays(t,n=!1,r=!0){return Oi(this,t,r,Nc,()=>{const i=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},o=n?"format":"standalone";return this.weekdaysCache[o][t]||(this.weekdaysCache[o][t]=Jb(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[o][t]})}meridiems(t=!0){return Oi(this,void 0,t,()=>_c,()=>{if(!this.meridiemCache){const n={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[pe.utc(2016,11,13,9),pe.utc(2016,11,13,19)].map(r=>this.extract(r,n,"dayperiod"))}return this.meridiemCache})}eras(t,n=!0){return Oi(this,t,n,Pc,()=>{const r={era:t};return this.eraCache[t]||(this.eraCache[t]=[pe.utc(-40,1,1),pe.utc(2017,1,1)].map(i=>this.extract(i,r,"era"))),this.eraCache[t]})}extract(t,n,r){const i=this.dtFormatter(t,n),o=i.formatToParts(),s=o.find(a=>a.type.toLowerCase()===r);return s?s.value:null}numberFormatter(t={}){return new e0(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new t0(t,this.intl,n)}relFormatter(t={}){return new n0(this.intl,this.isEnglish(),t)}listFormatter(t={}){return Wb(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}}function Rn(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function $n(...e){return t=>e.reduce(([n,r,i],o)=>{const[s,a,l]=o(t,i);return[{...n,...s},a||r,l]},[{},null,1]).slice(0,2)}function Bn(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const i=n.exec(e);if(i)return r(i)}return[null,null]}function jc(...e){return(t,n)=>{const r={};let i;for(i=0;i<e.length;i++)r[e[i]]=rn(t[n+i]);return[r,null,n+i]}}const Vc=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,r0=`(?:${Vc.source}?(?:\\[(${Tc.source})\\])?)?`,Es=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Wc=RegExp(`${Es.source}${r0}`),Cs=RegExp(`(?:T${Wc.source})?`),i0=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,o0=/(\d{4})-?W(\d\d)(?:-?(\d))?/,s0=/(\d{4})-?(\d{3})/,a0=jc("weekYear","weekNumber","weekDay"),l0=jc("year","ordinal"),u0=/(\d{4})-(\d\d)-(\d\d)/,qc=RegExp(`${Es.source} ?(?:${Vc.source}|(${Tc.source}))?`),c0=RegExp(`(?: ${qc.source})?`);function zn(e,t,n){const r=e[t];return xe(r)?n:rn(r)}function f0(e,t){return[{year:zn(e,t),month:zn(e,t+1,1),day:zn(e,t+2,1)},null,t+3]}function Un(e,t){return[{hours:zn(e,t,0),minutes:zn(e,t+1,0),seconds:zn(e,t+2,0),milliseconds:hs(e[t+3])},null,t+4]}function Ir(e,t){const n=!e[t]&&!e[t+1],r=Ei(e[t+1],e[t+2]),i=n?null:it.instance(r);return[{},i,t+3]}function Or(e,t){const n=e[t]?Yt.create(e[t]):null;return[{},n,t+1]}const d0=RegExp(`^T?${Es.source}$`),h0=/^-?P(?:(?:(-?\d{1,9}(?:\.\d{1,9})?)Y)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,9}(?:\.\d{1,9})?)W)?(?:(-?\d{1,9}(?:\.\d{1,9})?)D)?(?:T(?:(-?\d{1,9}(?:\.\d{1,9})?)H)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,9}))?S)?)?)$/;function p0(e){const[t,n,r,i,o,s,a,l,u]=e,f=t[0]==="-",c=l&&l[0]==="-",h=(d,m=!1)=>d!==void 0&&(m||d&&f)?-d:d;return[{years:h(Sn(n)),months:h(Sn(r)),weeks:h(Sn(i)),days:h(Sn(o)),hours:h(Sn(s)),minutes:h(Sn(a)),seconds:h(Sn(l),l==="-0"),milliseconds:h(hs(u),c)}]}const m0={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function As(e,t,n,r,i,o,s){const a={year:t.length===2?gs(rn(t)):rn(t),month:Ic.indexOf(n)+1,day:rn(r),hour:rn(i),minute:rn(o)};return s&&(a.second=rn(s)),e&&(a.weekday=e.length>3?Mc.indexOf(e)+1:Dc.indexOf(e)+1),a}const g0=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function y0(e){const[,t,n,r,i,o,s,a,l,u,f,c]=e,h=As(t,i,r,n,o,s,a);let d;return l?d=m0[l]:u?d=0:d=Ei(f,c),[h,new it(d)]}function v0(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const b0=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,w0=/^(Monday|Tuesday|Wedsday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,S0=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Yc(e){const[,t,n,r,i,o,s,a]=e;return[As(t,i,r,n,o,s,a),it.utcInstance]}function x0(e){const[,t,n,r,i,o,s,a]=e;return[As(t,a,n,r,i,o,s),it.utcInstance]}const k0=Rn(i0,Cs),E0=Rn(o0,Cs),C0=Rn(s0,Cs),A0=Rn(Wc),Kc=$n(f0,Un,Ir,Or),T0=$n(a0,Un,Ir,Or),I0=$n(l0,Un,Ir,Or),O0=$n(Un,Ir,Or);function M0(e){return Bn(e,[k0,Kc],[E0,T0],[C0,I0],[A0,O0])}function D0(e){return Bn(v0(e),[g0,y0])}function N0(e){return Bn(e,[b0,Yc],[w0,Yc],[S0,x0])}function _0(e){return Bn(e,[h0,p0])}const P0=$n(Un);function L0(e){return Bn(e,[d0,P0])}const F0=Rn(u0,c0),R0=Rn(qc),$0=$n(Un,Ir,Or);function B0(e){return Bn(e,[F0,Kc],[R0,$0])}const z0="Invalid Duration",Gc={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},U0={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Gc},bt=146097/400,Hn=146097/4800,H0={years:{quarters:4,months:12,weeks:bt/7,days:bt,hours:bt*24,minutes:bt*24*60,seconds:bt*24*60*60,milliseconds:bt*24*60*60*1e3},quarters:{months:3,weeks:bt/28,days:bt/4,hours:bt*24/4,minutes:bt*24*60/4,seconds:bt*24*60*60/4,milliseconds:bt*24*60*60*1e3/4},months:{weeks:Hn/7,days:Hn,hours:Hn*24,minutes:Hn*24*60,seconds:Hn*24*60*60,milliseconds:Hn*24*60*60*1e3},...Gc},xn=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],j0=xn.slice(0).reverse();function kn(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy};return new Ee(r)}function V0(e){return e<0?Math.floor(e):Math.ceil(e)}function Qc(e,t,n,r,i){const o=e[i][n],s=t[n]/o,a=Math.sign(s)===Math.sign(r[i]),l=!a&&r[i]!==0&&Math.abs(s)<=1?V0(s):Math.trunc(s);r[i]+=l,t[n]-=l*o}function W0(e,t){j0.reduce((n,r)=>xe(t[r])?n:(n&&Qc(e,t,n,t,r),r),null)}class Ee{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;this.values=t.values,this.loc=t.loc||Re.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=n?H0:U0,this.isLuxonDuration=!0}static fromMillis(t,n){return Ee.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new vt(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Ee({values:Ci(t,Ee.normalizeUnit),loc:Re.fromObject(n),conversionAccuracy:n.conversionAccuracy})}static fromDurationLike(t){if(wn(t))return Ee.fromMillis(t);if(Ee.isDuration(t))return t;if(typeof t=="object")return Ee.fromObject(t);throw new vt(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=_0(t);return r?Ee.fromObject(r,n):Ee.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=L0(t);return r?Ee.fromObject(r,n):Ee.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new vt("need to specify a reason the Duration is invalid");const r=t instanceof Tt?t:new Tt(t,n);if(qe.throwOnInvalid)throw new wb(r);return new Ee({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new rc(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?lt.create(this.loc,r).formatDurationFromString(this,t):z0}toHuman(t={}){const n=xn.map(r=>{const i=this.values[r];return xe(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(i)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=ps(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();if(n<0||n>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t};const r=this.shiftTo("hours","minutes","seconds","milliseconds");let i=t.format==="basic"?"hhmm":"hh:mm";(!t.suppressSeconds||r.seconds!==0||r.milliseconds!==0)&&(i+=t.format==="basic"?"ss":":ss",(!t.suppressMilliseconds||r.milliseconds!==0)&&(i+=".SSS"));let o=r.toFormat(i);return t.includePrefix&&(o="T"+o),o}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t),r={};for(const i of xn)(Fn(n.values,i)||Fn(this.values,i))&&(r[i]=n.get(i)+this.get(i));return kn(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=Ac(t(this.values[r],r));return kn(this,{values:n},!0)}get(t){return this[Ee.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...Ci(t,Ee.normalizeUnit)};return kn(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r}={}){const i=this.loc.clone({locale:t,numberingSystem:n}),o={loc:i};return r&&(o.conversionAccuracy=r),kn(this,o)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return W0(this.matrix,t),kn(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(s=>Ee.normalizeUnit(s));const n={},r={},i=this.toObject();let o;for(const s of xn)if(t.indexOf(s)>=0){o=s;let a=0;for(const u in r)a+=this.matrix[u][s]*r[u],r[u]=0;wn(i[s])&&(a+=i[s]);const l=Math.trunc(a);n[s]=l,r[s]=(a*1e3-l*1e3)/1e3;for(const u in i)xn.indexOf(u)>xn.indexOf(s)&&Qc(this.matrix,i,u,n,s)}else wn(i[s])&&(r[s]=i[s]);for(const s in r)r[s]!==0&&(n[o]+=s===o?r[s]:r[s]/this.matrix[o][s]);return kn(this,{values:n},!0).normalize()}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return kn(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,i){return r===void 0||r===0?i===void 0||i===0:r===i}for(const r of xn)if(!n(this.values[r],t.values[r]))return!1;return!0}}const Mr="Invalid Interval";function q0(e,t){return!e||!e.isValid?ze.invalid("missing or invalid start"):!t||!t.isValid?ze.invalid("missing or invalid end"):t<e?ze.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class ze{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new vt("need to specify a reason the Interval is invalid");const r=t instanceof Tt?t:new Tt(t,n);if(qe.throwOnInvalid)throw new bb(r);return new ze({invalid:r})}static fromDateTimes(t,n){const r=_r(t),i=_r(n),o=q0(r,i);return o??new ze({start:r,end:i})}static after(t,n){const r=Ee.fromDurationLike(n),i=_r(t);return ze.fromDateTimes(i,i.plus(r))}static before(t,n){const r=Ee.fromDurationLike(n),i=_r(t);return ze.fromDateTimes(i.minus(r),i)}static fromISO(t,n){const[r,i]=(t||"").split("/",2);if(r&&i){let o,s;try{o=pe.fromISO(r,n),s=o.isValid}catch{s=!1}let a,l;try{a=pe.fromISO(i,n),l=a.isValid}catch{l=!1}if(s&&l)return ze.fromDateTimes(o,a);if(s){const u=Ee.fromISO(i,n);if(u.isValid)return ze.after(o,u)}else if(l){const u=Ee.fromISO(r,n);if(u.isValid)return ze.before(a,u)}}return ze.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds"){if(!this.isValid)return NaN;const n=this.start.startOf(t),r=this.end.startOf(t);return Math.floor(r.diff(n,t).get(t))+1}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?ze.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(_r).filter(s=>this.contains(s)).sort(),r=[];let{s:i}=this,o=0;for(;i<this.e;){const s=n[o]||this.e,a=+s>+this.e?this.e:s;r.push(ze.fromDateTimes(i,a)),i=a,o+=1}return r}splitBy(t){const n=Ee.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,i=1,o;const s=[];for(;r<this.e;){const a=this.start.plus(n.mapUnits(l=>l*i));o=+a>+this.e?this.e:a,s.push(ze.fromDateTimes(r,o)),r=o,i+=1}return s}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:ze.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return ze.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((i,o)=>i.s-o.s).reduce(([i,o],s)=>o?o.overlaps(s)||o.abutsStart(s)?[i,o.union(s)]:[i.concat([o]),s]:[i,s],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const i=[],o=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),s=Array.prototype.concat(...o),a=s.sort((l,u)=>l.time-u.time);for(const l of a)r+=l.type==="s"?1:-1,r===1?n=l.time:(n&&+n!=+l.time&&i.push(ze.fromDateTimes(n,l.time)),n=null);return ze.merge(i)}difference(...t){return ze.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Mr}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Mr}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Mr}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Mr}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Mr}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):Ee.invalid(this.invalidReason)}mapEndpoints(t){return ze.fromDateTimes(t(this.s),t(this.e))}}let Mi=class{static hasDST(t=qe.defaultZone){const n=pe.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return Yt.isValidZone(t)}static normalizeZone(t){return on(t,qe.defaultZone)}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Re.create(n,r,o)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Re.create(n,r,o)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||Re.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||Re.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Re.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return Re.create(n,null,"gregory").eras(t)}static features(){return{relative:kc()}}};function Zc(e,t){const n=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Ee.fromMillis(r).as("days"))}function Y0(e,t,n){const r=[["years",(a,l)=>l.year-a.year],["quarters",(a,l)=>l.quarter-a.quarter],["months",(a,l)=>l.month-a.month+(l.year-a.year)*12],["weeks",(a,l)=>{const u=Zc(a,l);return(u-u%7)/7}],["days",Zc]],i={};let o,s;for(const[a,l]of r)if(n.indexOf(a)>=0){o=a;let u=l(e,t);s=e.plus({[a]:u}),s>t?(e=e.plus({[a]:u-1}),u-=1):e=s,i[a]=u}return[e,i,s,o]}function K0(e,t,n,r){let[i,o,s,a]=Y0(e,t,n);const l=t-i,u=n.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(s<t&&(s=i.plus({[a]:1})),s!==i&&(o[a]=(o[a]||0)+l/(s-i)));const f=Ee.fromObject(o,r);return u.length>0?Ee.fromMillis(l,r).shiftTo(...u).plus(f):f}const Ts={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Jc={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},G0=Ts.hanidec.replace(/[\[|\]]/g,"").split("");function Q0(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(e[n].search(Ts.hanidec)!==-1)t+=G0.indexOf(e[n]);else for(const i in Jc){const[o,s]=Jc[i];r>=o&&r<=s&&(t+=r-o)}}return parseInt(t,10)}else return t}function It({numberingSystem:e},t=""){return new RegExp(`${Ts[e||"latn"]}${t}`)}const Z0="missing Intl.DateTimeFormat.formatToParts support";function Ce(e,t=n=>n){return{regex:e,deser:([n])=>t(Q0(n))}}const Xc="[  ]",ef=new RegExp(Xc,"g");function J0(e){return e.replace(/\./g,"\\.?").replace(ef,Xc)}function tf(e){return e.replace(/\./g,"").replace(ef," ").toLowerCase()}function Ot(e,t){return e===null?null:{regex:RegExp(e.map(J0).join("|")),deser:([n])=>e.findIndex(r=>tf(n)===tf(r))+t}}function nf(e,t){return{regex:e,deser:([,n,r])=>Ei(n,r),groups:t}}function Is(e){return{regex:e,deser:([t])=>t}}function X0(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function ew(e,t){const n=It(t),r=It(t,"{2}"),i=It(t,"{3}"),o=It(t,"{4}"),s=It(t,"{6}"),a=It(t,"{1,2}"),l=It(t,"{1,3}"),u=It(t,"{1,6}"),f=It(t,"{1,9}"),c=It(t,"{2,4}"),h=It(t,"{4,6}"),d=g=>({regex:RegExp(X0(g.val)),deser:([v])=>v,literal:!0}),p=(g=>{if(e.literal)return d(g);switch(g.val){case"G":return Ot(t.eras("short",!1),0);case"GG":return Ot(t.eras("long",!1),0);case"y":return Ce(u);case"yy":return Ce(c,gs);case"yyyy":return Ce(o);case"yyyyy":return Ce(h);case"yyyyyy":return Ce(s);case"M":return Ce(a);case"MM":return Ce(r);case"MMM":return Ot(t.months("short",!0,!1),1);case"MMMM":return Ot(t.months("long",!0,!1),1);case"L":return Ce(a);case"LL":return Ce(r);case"LLL":return Ot(t.months("short",!1,!1),1);case"LLLL":return Ot(t.months("long",!1,!1),1);case"d":return Ce(a);case"dd":return Ce(r);case"o":return Ce(l);case"ooo":return Ce(i);case"HH":return Ce(r);case"H":return Ce(a);case"hh":return Ce(r);case"h":return Ce(a);case"mm":return Ce(r);case"m":return Ce(a);case"q":return Ce(a);case"qq":return Ce(r);case"s":return Ce(a);case"ss":return Ce(r);case"S":return Ce(l);case"SSS":return Ce(i);case"u":return Is(f);case"uu":return Is(a);case"uuu":return Ce(n);case"a":return Ot(t.meridiems(),0);case"kkkk":return Ce(o);case"kk":return Ce(c,gs);case"W":return Ce(a);case"WW":return Ce(r);case"E":case"c":return Ce(n);case"EEE":return Ot(t.weekdays("short",!1,!1),1);case"EEEE":return Ot(t.weekdays("long",!1,!1),1);case"ccc":return Ot(t.weekdays("short",!0,!1),1);case"cccc":return Ot(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return nf(new RegExp(`([+-]${a.source})(?::(${r.source}))?`),2);case"ZZZ":return nf(new RegExp(`([+-]${a.source})(${r.source})?`),2);case"z":return Is(/[a-z_+-/]{1,256}?/i);default:return d(g)}})(e)||{invalidReason:Z0};return p.token=e,p}const tw={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};function nw(e,t,n){const{type:r,value:i}=e;if(r==="literal")return{literal:!0,val:i};const o=n[r];let s=tw[r];if(typeof s=="object"&&(s=s[o]),s)return{literal:!1,val:s}}function rw(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function iw(e,t,n){const r=e.match(t);if(r){const i={};let o=1;for(const s in n)if(Fn(n,s)){const a=n[s],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(i[a.token.val[0]]=a.deser(r.slice(o,o+l))),o+=l}return[r,i]}else return[r,{}]}function ow(e){const t=o=>{switch(o){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return xe(e.z)||(n=Yt.create(e.z)),xe(e.Z)||(n||(n=new it(e.Z)),r=e.Z),xe(e.q)||(e.M=(e.q-1)*3+1),xe(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),xe(e.u)||(e.S=hs(e.u)),[Object.keys(e).reduce((o,s)=>{const a=t(s);return a&&(o[a]=e[s]),o},{}),n,r]}let Os=null;function sw(){return Os||(Os=pe.fromMillis(1555555555555)),Os}function aw(e,t){if(e.literal)return e;const n=lt.macroTokenToFormatOpts(e.val);if(!n)return e;const o=lt.create(t,n).formatDateTimeParts(sw()).map(s=>nw(s,t,n));return o.includes(void 0)?e:o}function lw(e,t){return Array.prototype.concat(...e.map(n=>aw(n,t)))}function rf(e,t,n){const r=lw(lt.parseFormat(n),e),i=r.map(s=>ew(s,e)),o=i.find(s=>s.invalidReason);if(o)return{input:t,tokens:r,invalidReason:o.invalidReason};{const[s,a]=rw(i),l=RegExp(s,"i"),[u,f]=iw(t,l,a),[c,h,d]=f?ow(f):[null,null,void 0];if(Fn(f,"a")&&Fn(f,"H"))throw new xr("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:l,rawMatches:u,matches:f,result:c,zone:h,specificOffset:d}}}function uw(e,t,n){const{result:r,zone:i,specificOffset:o,invalidReason:s}=rf(e,t,n);return[r,i,o,s]}const of=[0,31,59,90,120,151,181,212,243,273,304,334],sf=[0,31,60,91,121,152,182,213,244,274,305,335];function wt(e,t){return new Tt("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function af(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const i=r.getUTCDay();return i===0?7:i}function lf(e,t,n){return n+(kr(e)?sf:of)[t-1]}function uf(e,t){const n=kr(e)?sf:of,r=n.findIndex(o=>o<t),i=t-n[r];return{month:r+1,day:i}}function Ms(e){const{year:t,month:n,day:r}=e,i=lf(t,n,r),o=af(t,n,r);let s=Math.floor((i-o+10)/7),a;return s<1?(a=t-1,s=ki(a)):s>ki(t)?(a=t+1,s=1):a=t,{weekYear:a,weekNumber:s,weekday:o,...Ai(e)}}function cf(e){const{weekYear:t,weekNumber:n,weekday:r}=e,i=af(t,1,4),o=Er(t);let s=n*7+r-i-3,a;s<1?(a=t-1,s+=Er(a)):s>o?(a=t+1,s-=Er(t)):a=t;const{month:l,day:u}=uf(a,s);return{year:a,month:l,day:u,...Ai(e)}}function Ds(e){const{year:t,month:n,day:r}=e,i=lf(t,n,r);return{year:t,ordinal:i,...Ai(e)}}function ff(e){const{year:t,ordinal:n}=e,{month:r,day:i}=uf(t,n);return{year:t,month:r,day:i,...Ai(e)}}function cw(e){const t=Si(e.weekYear),n=qt(e.weekNumber,1,ki(e.weekYear)),r=qt(e.weekday,1,7);return t?n?r?!1:wt("weekday",e.weekday):wt("week",e.week):wt("weekYear",e.weekYear)}function fw(e){const t=Si(e.year),n=qt(e.ordinal,1,Er(e.year));return t?n?!1:wt("ordinal",e.ordinal):wt("year",e.year)}function df(e){const t=Si(e.year),n=qt(e.month,1,12),r=qt(e.day,1,xi(e.year,e.month));return t?n?r?!1:wt("day",e.day):wt("month",e.month):wt("year",e.year)}function hf(e){const{hour:t,minute:n,second:r,millisecond:i}=e,o=qt(t,0,23)||t===24&&n===0&&r===0&&i===0,s=qt(n,0,59),a=qt(r,0,59),l=qt(i,0,999);return o?s?a?l?!1:wt("millisecond",i):wt("second",r):wt("minute",n):wt("hour",t)}const Ns="Invalid DateTime",pf=864e13;function Di(e){return new Tt("unsupported zone",`the zone "${e.name}" is not supported`)}function _s(e){return e.weekData===null&&(e.weekData=Ms(e.c)),e.weekData}function Dr(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new pe({...n,...t,old:n})}function mf(e,t,n){let r=e-t*60*1e3;const i=n.offset(r);if(t===i)return[r,t];r-=(i-t)*60*1e3;const o=n.offset(r);return i===o?[r,i]:[e-Math.min(i,o)*60*1e3,Math.max(i,o)]}function gf(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Ni(e,t,n){return mf(ms(e),t,n)}function yf(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,o={...e.c,year:r,month:i,day:Math.min(e.c.day,xi(r,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},s=Ee.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=ms(o);let[l,u]=mf(a,n,e.zone);return s!==0&&(l+=s,u=e.zone.offset(l)),{ts:l,o:u}}function Nr(e,t,n,r,i,o){const{setZone:s,zone:a}=n;if(e&&Object.keys(e).length!==0){const l=t||a,u=pe.fromObject(e,{...n,zone:l,specificOffset:o});return s?u:u.setZone(a)}else return pe.invalid(new Tt("unparsable",`the input "${i}" can't be parsed as ${r}`))}function _i(e,t,n=!0){return e.isValid?lt.create(Re.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function Ps(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=Ve(e.c.year,n?6:4),t?(r+="-",r+=Ve(e.c.month),r+="-",r+=Ve(e.c.day)):(r+=Ve(e.c.month),r+=Ve(e.c.day)),r}function vf(e,t,n,r,i,o){let s=Ve(e.c.hour);return t?(s+=":",s+=Ve(e.c.minute),(e.c.second!==0||!n)&&(s+=":")):s+=Ve(e.c.minute),(e.c.second!==0||!n)&&(s+=Ve(e.c.second),(e.c.millisecond!==0||!r)&&(s+=".",s+=Ve(e.c.millisecond,3))),i&&(e.isOffsetFixed&&e.offset===0&&!o?s+="Z":e.o<0?(s+="-",s+=Ve(Math.trunc(-e.o/60)),s+=":",s+=Ve(Math.trunc(-e.o%60))):(s+="+",s+=Ve(Math.trunc(e.o/60)),s+=":",s+=Ve(Math.trunc(e.o%60)))),o&&(s+="["+e.zone.ianaName+"]"),s}const bf={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},dw={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},hw={ordinal:1,hour:0,minute:0,second:0,millisecond:0},wf=["year","month","day","hour","minute","second","millisecond"],pw=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],mw=["year","ordinal","hour","minute","second","millisecond"];function Sf(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new rc(e);return t}function xf(e,t){const n=on(t.zone,qe.defaultZone),r=Re.fromObject(t),i=qe.now();let o,s;if(xe(e.year))o=i;else{for(const u of wf)xe(e[u])&&(e[u]=bf[u]);const a=df(e)||hf(e);if(a)return pe.invalid(a);const l=n.offset(i);[o,s]=Ni(e,l,n)}return new pe({ts:o,zone:n,loc:r,o:s})}function kf(e,t,n){const r=xe(n.round)?!0:n.round,i=(s,a)=>(s=ps(s,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(s,a)),o=s=>n.calendary?t.hasSame(e,s)?0:t.startOf(s).diff(e.startOf(s),s).get(s):t.diff(e,s).get(s);if(n.unit)return i(o(n.unit),n.unit);for(const s of n.units){const a=o(s);if(Math.abs(a)>=1)return i(a,s)}return i(e>t?-0:0,n.units[n.units.length-1])}function Ef(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}class pe{constructor(t){const n=t.zone||qe.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new Tt("invalid input"):null)||(n.isValid?null:Di(n));this.ts=xe(t.ts)?qe.now():t.ts;let i=null,o=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[i,o]=[t.old.c,t.old.o];else{const a=n.offset(this.ts);i=gf(this.ts,a),r=Number.isNaN(i.year)?new Tt("invalid input"):null,i=r?null:i,o=r?null:a}this._zone=n,this.loc=t.loc||Re.create(),this.invalid=r,this.weekData=null,this.c=i,this.o=o,this.isLuxonDateTime=!0}static now(){return new pe({})}static local(){const[t,n]=Ef(arguments),[r,i,o,s,a,l,u]=n;return xf({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:u},t)}static utc(){const[t,n]=Ef(arguments),[r,i,o,s,a,l,u]=n;return t.zone=it.utcInstance,xf({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:u},t)}static fromJSDate(t,n={}){const r=Eb(t)?t.valueOf():NaN;if(Number.isNaN(r))return pe.invalid("invalid input");const i=on(n.zone,qe.defaultZone);return i.isValid?new pe({ts:r,zone:i,loc:Re.fromObject(n)}):pe.invalid(Di(i))}static fromMillis(t,n={}){if(wn(t))return t<-pf||t>pf?pe.invalid("Timestamp out of range"):new pe({ts:t,zone:on(n.zone,qe.defaultZone),loc:Re.fromObject(n)});throw new vt(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(wn(t))return new pe({ts:t*1e3,zone:on(n.zone,qe.defaultZone),loc:Re.fromObject(n)});throw new vt("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=on(n.zone,qe.defaultZone);if(!r.isValid)return pe.invalid(Di(r));const i=qe.now(),o=xe(n.specificOffset)?r.offset(i):n.specificOffset,s=Ci(t,Sf),a=!xe(s.ordinal),l=!xe(s.year),u=!xe(s.month)||!xe(s.day),f=l||u,c=s.weekYear||s.weekNumber,h=Re.fromObject(n);if((f||a)&&c)throw new xr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&a)throw new xr("Can't mix ordinal dates with month/day");const d=c||s.weekday&&!f;let m,p,g=gf(i,o);d?(m=pw,p=dw,g=Ms(g)):a?(m=mw,p=hw,g=Ds(g)):(m=wf,p=bf);let v=!1;for(const D of m){const P=s[D];xe(P)?v?s[D]=p[D]:s[D]=g[D]:v=!0}const y=d?cw(s):a?fw(s):df(s),w=y||hf(s);if(w)return pe.invalid(w);const A=d?cf(s):a?ff(s):s,[k,E]=Ni(A,o,r),I=new pe({ts:k,zone:r,o:E,loc:h});return s.weekday&&f&&t.weekday!==I.weekday?pe.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${I.toISO()}`):I}static fromISO(t,n={}){const[r,i]=M0(t);return Nr(r,i,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,i]=D0(t);return Nr(r,i,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,i]=N0(t);return Nr(r,i,n,"HTTP",n)}static fromFormat(t,n,r={}){if(xe(t)||xe(n))throw new vt("fromFormat requires an input string and a format");const{locale:i=null,numberingSystem:o=null}=r,s=Re.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0}),[a,l,u,f]=uw(s,t,n);return f?pe.invalid(f):Nr(a,l,r,`format ${n}`,t,u)}static fromString(t,n,r={}){return pe.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,i]=B0(t);return Nr(r,i,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new vt("need to specify a reason the DateTime is invalid");const r=t instanceof Tt?t:new Tt(t,n);if(qe.throwOnInvalid)throw new vb(r);return new pe({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?_s(this).weekYear:NaN}get weekNumber(){return this.isValid?_s(this).weekNumber:NaN}get weekday(){return this.isValid?_s(this).weekday:NaN}get ordinal(){return this.isValid?Ds(this.c).ordinal:NaN}get monthShort(){return this.isValid?Mi.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Mi.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Mi.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Mi.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return kr(this.year)}get daysInMonth(){return xi(this.year,this.month)}get daysInYear(){return this.isValid?Er(this.year):NaN}get weeksInWeekYear(){return this.isValid?ki(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:i}=lt.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:i}}toUTC(t=0,n={}){return this.setZone(it.instance(t),n)}toLocal(){return this.setZone(qe.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=on(t,qe.defaultZone),t.equals(this.zone))return this;if(t.isValid){let i=this.ts;if(n||r){const o=t.offset(this.ts),s=this.toObject();[i]=Ni(s,o,t)}return Dr(this,{ts:i,zone:t})}else return pe.invalid(Di(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const i=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return Dr(this,{loc:i})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=Ci(t,Sf),r=!xe(n.weekYear)||!xe(n.weekNumber)||!xe(n.weekday),i=!xe(n.ordinal),o=!xe(n.year),s=!xe(n.month)||!xe(n.day),a=o||s,l=n.weekYear||n.weekNumber;if((a||i)&&l)throw new xr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(s&&i)throw new xr("Can't mix ordinal dates with month/day");let u;r?u=cf({...Ms(this.c),...n}):xe(n.ordinal)?(u={...this.toObject(),...n},xe(n.day)&&(u.day=Math.min(xi(u.year,u.month),u.day))):u=ff({...Ds(this.c),...n});const[f,c]=Ni(u,this.o,this.zone);return Dr(this,{ts:f,o:c})}plus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t);return Dr(this,yf(this,n))}minus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t).negate();return Dr(this,yf(this,n))}startOf(t){if(!this.isValid)return this;const n={},r=Ee.normalizeUnit(t);switch(r){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(r==="weeks"&&(n.weekday=1),r==="quarters"){const i=Math.ceil(this.month/3);n.month=(i-1)*3+1}return this.set(n)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,n={}){return this.isValid?lt.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):Ns}toLocaleString(t=ds,n={}){return this.isValid?lt.create(this.loc.clone(n),t).formatDateTime(this):Ns}toLocaleParts(t={}){return this.isValid?lt.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:i=!0,extendedZone:o=!1}={}){if(!this.isValid)return null;const s=t==="extended";let a=Ps(this,s);return a+="T",a+=vf(this,s,n,r,i,o),a}toISODate({format:t="extended"}={}){return this.isValid?Ps(this,t==="extended"):null}toISOWeekDate(){return _i(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:i=!1,extendedZone:o=!1,format:s="extended"}={}){return this.isValid?(i?"T":"")+vf(this,s==="extended",n,t,r,o):null}toRFC2822(){return _i(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return _i(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Ps(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let i="HH:mm:ss.SSS";return(n||t)&&(r&&(i+=" "),n?i+="z":t&&(i+="ZZ")),_i(this,i,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Ns}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return Ee.invalid("created by diffing an invalid DateTime");const i={locale:this.locale,numberingSystem:this.numberingSystem,...r},o=Cb(n).map(Ee.normalizeUnit),s=t.valueOf()>this.valueOf(),a=s?this:t,l=s?t:this,u=K0(a,l,o,i);return s?u.negate():u}diffNow(t="milliseconds",n={}){return this.diff(pe.now(),t,n)}until(t){return this.isValid?ze.fromDateTimes(this,t):this}hasSame(t,n){if(!this.isValid)return!1;const r=t.valueOf(),i=this.setZone(t.zone,{keepLocalTime:!0});return i.startOf(n)<=r&&r<=i.endOf(n)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||pe.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let i=["years","months","days","hours","minutes","seconds"],o=t.unit;return Array.isArray(t.unit)&&(i=t.unit,o=void 0),kf(n,this.plus(r),{...t,numeric:"always",units:i,unit:o})}toRelativeCalendar(t={}){return this.isValid?kf(t.base||pe.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(pe.isDateTime))throw new vt("min requires all arguments be DateTimes");return Ec(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(pe.isDateTime))throw new vt("max requires all arguments be DateTimes");return Ec(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:i=null,numberingSystem:o=null}=r,s=Re.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});return rf(s,t,n)}static fromStringExplain(t,n,r={}){return pe.fromFormatExplain(t,n,r)}static get DATE_SHORT(){return ds}static get DATE_MED(){return ic}static get DATE_MED_WITH_WEEKDAY(){return Sb}static get DATE_FULL(){return oc}static get DATE_HUGE(){return sc}static get TIME_SIMPLE(){return ac}static get TIME_WITH_SECONDS(){return lc}static get TIME_WITH_SHORT_OFFSET(){return uc}static get TIME_WITH_LONG_OFFSET(){return cc}static get TIME_24_SIMPLE(){return fc}static get TIME_24_WITH_SECONDS(){return dc}static get TIME_24_WITH_SHORT_OFFSET(){return hc}static get TIME_24_WITH_LONG_OFFSET(){return pc}static get DATETIME_SHORT(){return mc}static get DATETIME_SHORT_WITH_SECONDS(){return gc}static get DATETIME_MED(){return yc}static get DATETIME_MED_WITH_SECONDS(){return vc}static get DATETIME_MED_WITH_WEEKDAY(){return xb}static get DATETIME_FULL(){return bc}static get DATETIME_FULL_WITH_SECONDS(){return wc}static get DATETIME_HUGE(){return Sc}static get DATETIME_HUGE_WITH_SECONDS(){return xc}}function _r(e){if(pe.isDateTime(e))return e;if(e&&e.valueOf&&wn(e.valueOf()))return pe.fromJSDate(e);if(e&&typeof e=="object")return pe.fromObject(e);throw new vt(`Unknown datetime argument: ${e}, of type ${typeof e}`)}function gw(e){const t=typeof e=="string"?pe.fromISO(e):pe.fromJSDate(e);if(!t.isValid)return"Invalid date";const r=pe.now().diff(t,["years","months","days","hours","minutes"]).toObject();return r.years&&r.years>=1?`${Math.floor(r.years)} year${Math.floor(r.years)>1?"s":""} ago`:r.months&&r.months>=1?`${Math.floor(r.months)} month${Math.floor(r.months)>1?"s":""} ago`:r.days&&r.days>=1?`${Math.floor(r.days)} day${Math.floor(r.days)>1?"s":""} ago`:r.hours&&r.hours>=1?`${Math.floor(r.hours)}h ago`:r.minutes&&r.minutes>=1?`${Math.floor(r.minutes)}m ago`:"just now"}function Ls(e){if(!/^#?([a-fA-F\d]{6}|[a-fA-F\d]{3})$/.test(e))return{r:0,g:0,b:0};const n=e.replace(/^#/,"");let r=n;n.length===3&&(r=n.split("").map(l=>l+l).join(""));const i=parseInt(r,16),o=i>>16&255,s=i>>8&255,a=i&255;return{r:o,g:s,b:a}}function yw(e){return`#${((1<<24)+(e.r<<16)+(e.g<<8)+e.b).toString(16).slice(1)}`}const vw=(e,t=30)=>{const n=Math.min(e.r,e.g,e.b),r=Math.max(e.r,e.g,e.b,n+1);return{r:Math.floor((e.r-n)/(r-n)*t*(1-.299)+120-t/2),g:Math.floor((e.g-n)/(r-n)*t*(1-.587)+120-t/2),b:Math.floor((e.b-n)/(r-n)*t*(1-.114)+120-t/2)}};function Cf(e){return Object.entries(e).reduce((t,[n,r])=>{const i=n.replace(/(\d+)/,o=>(1e3-parseInt(o)).toString());return{...t,[i]:r}},{})}const bw=2.4,ww=.2126729,Sw=.7151522,xw=.072175,kw=.56,Ew=.57,Cw=.62,Aw=.65,Pi=.022,Af=1.414,Tw=1.14,Iw=1.14,Ow=.035991,Mw=27.7847239587675,Dw=27.7847239587675,Tf=.027,If=.027,Of=.001,Nw=5e-4;function Mf(e){const{r:t,g:n,b:r}=e,i=o=>(o/255)**bw;return ww*i(t)+Sw*i(n)+xw*i(r)}function Df(e,t){if(!e||!t)return 0;let n=Mf(Ls(e)),r=Mf(Ls(t)),i=0,o=0;return n=n>Pi?n:n+(Pi-n)**Af,r=r>Pi?r:r+(Pi-r)**Af,Math.abs(r-n)<Nw?0:(r>n?(i=(r**kw-n**Ew)*Tw,o=i<Of?0:i<Ow?i-i*Mw*Tf:i-Tf):(i=(r**Aw-n**Cw)*Iw,o=i>-Of?0:i>-.035991?i-i*Dw*If:i+If),Math.abs(o*100))}const _w=(e,t,n)=>{const r=e;let i=0;for(;t.some(o=>n(o)===e);)i+=1,e=`${r} (${i})`;return e};function Nf(e){const{fontFamily:t,...n}=e,r=_f(n);return Yu(".bpReset",{...r,"font-family":`'${t}', sans-serif`})+Yu(":host, :root",{...r})}function _f(e){const{radius:t,themeMode:n,color:r,variant:i,headerVariant:o}=e;let s={},a={};if(r){const h=tc(r),d=n==="dark"?Cf(h):h,m=tc(yw(vw(Ls(r)))),p=n==="dark"?Cf(m):m,g=n==="dark"?"#101010":"#fdfdfd";a=Object.entries({...d,1:g}).reduce((y,[w,A])=>({...y,[`--bpPrimary-${w}`]:A}),{});const v=Object.entries({...p,1:g}).reduce((y,[w,A])=>({...y,[`--bpGray-${w}`]:A}),{});s={...a,...v}}t&&(s={...s,"--bpRadius-scale":t.toString()});const l=n==="dark"?{bg:"var(--transparent-dark)",bgHover:"var(--transparent-dark-hover)"}:{bg:"var(--transparent-light)",bgHover:"var(--transparent-light-hover)"},u=a?Df(a["--bpPrimary-600"],a["--bpPrimary-50"])>40?"var(--bpPrimary-50)":"var(--bpPrimary-900)":"var(--bpPrimary-50)",f=i==="solid"?{"--message-bg":"var(--bpPrimary-600)","--message-bg-hover":"var(--bpPrimary-700)","--message-text":u,"--send-button-bg":"var(--bpPrimary-600)","--send-button-bg-hover":"var(--bpPrimary-700)","--send-button-text":"var(--bpPrimary-50)","--button-bg":"var(--bpPrimary-200)","--button-bg-hover":"var(--bpPrimary-300)","--button-text":"var(--bpPrimary-800)","--fab-bg":"var(--bpPrimary-600)","--fab-bg-hover":"var(--bpPrimary-700)","--fab-icon":u,"--modal-submit-bg":"var(--bpPrimary-600)","--modal-submit-bg-hover":"var(--bpPrimary-700)"}:{"--message-bg":"var(--bpPrimary-100)","--message-bg-hover":"var(--bpPrimary-200)","--message-text":"var(--bpPrimary-900)","--send-button-bg":"var(--bpPrimary-600)","--send-button-bg-hover":"var(--bpPrimary-700)","--send-button-text":"var(--bpPrimary-50)","--button-bg":"var(--bpPrimary-500)","--button-bg-hover":"var(--bpPrimary-600)","--button-text":a?Df(a["--bpPrimary-500"],a["--bpPrimary-50"])>40?"var(--bpPrimary-50)":"var(--bpPrimary-900)":"var(--bpPrimary-50)","--fab-bg":"var(--bpPrimary-100)","--fab-bg-hover":"var(--bpPrimary-200)","--fab-icon":"var(--bpPrimary-700)","--scrollbar":"var(--bpGray-500)","--scrollbar-hover":"var(--bpGray-400)","--modal-submit-bg":"var(--bpPrimary-200)","--modal-submit-bg-hover":"var(--bpPrimary-300)"},c=o==="solid"?{"--header-bg":"var(--bpPrimary-600)","--header-bg-hover":"var(--bpPrimary-700)","--header-hover-dark":"var(--bpPrimary-800)","--header-title":u,"--header-description":u,"--header-description-icon":u,"--header-description-link":u,"--header-avatar-bg":"var(--bpPrimary-300)","--header-avatar-text":"var(--bpPrimary-700)"}:{"--header-bg":l.bg,"--header-bg-hover":l.bgHover,"--header-hover-dark":"var(--bpGray-200)","--header-title":"var(--bpGray-900)","--header-description":"var(--bpGray-600)","--header-description-icon":"var(--bpPrimary-700)","--header-description-link":"var(--bpPrimary-800)","--header-avatar-bg":"var(--bpPrimary-600)","--header-avatar-text":"var(--bpPrimary-50)"};return{...s,...f,...c}}const Pw=e=>{if(typeof URL.canParse=="function")return URL.canParse(e);try{return new URL(e),!0}catch{return!1}},Pf=["audio","file","image","video"],Lf=e=>Pf.includes(e),Ff="The Client ID is required to initialize the webchat.",Lw="The API url is required to initialize the webchat.",Fw="The Bot ID is required to initialize the webchat.",Rw="No config URL provided.",Rf=`Invalid API URL.
18
- Please use a valid API URL.`,$f=`Invalid Client ID.
19
- Please use a valid Botpress Client ID.`,Bf=`Invalid URL.
20
- Please make sure your client ID and API URL are valid`,$w=`Invalid config URL.
21
- Please make sure your config URL is valid`,Bw=`Invalid webchat configuration.
22
- Please make sure your config file is valid`,zw="Access denied to configuration file. Please check your credentials or your configuration URL and try again.",zf=`This bot has temporarily paused.
23
- Please check back later.`,Uf=`This bot has temporarily paused.
24
- Please check back later.`,Fs="Something went wrong. To fix it, please clear your browser's local and session storage and then refresh the page",Li="Please check your internet connection and refresh the page.",Hf=`You've been disconnected from the conversation.
25
- Please refresh the page.`,jf=`Unable to process the message.
26
- Please start a new conversation.`,Rs={ResourceNotFound:{type:"configuration",message:$f},Forbidden:{type:"bot",message:zf}},$s={MethodNotFound:{type:"configuration",message:Bf},QuotaExceeded:{type:"bot",message:Uf},Forbidden:{type:"bot",message:Fs}};function Vf(e){return e in Rs}function Wf(e){return e in $s}function qf(e){return e!==null&&typeof e=="object"&&"id"in e&&"code"in e&&"type"in e}function Yf(e){return e!==null&&typeof e=="object"&&"type"in e&&e.type==="error"&&"message"in e&&typeof e.message=="string"}const Kf=async(e,t=3,n=1e3)=>{let r;for(let i=1;i<=t;i++)try{return await e()}catch(o){if(r=o,i===t)throw r;const s=n*Math.pow(2,i-1);await new Promise(a=>setTimeout(a,s))}throw new Error("Unreachable: retry loop should always return or throw")},Uw=["networkerror","failedtofetch","errorininputstream"],Pr=e=>{var n;console.error("An error occurred:",e);let t={type:"unknown",message:"An unexpected error occurred"};if(qf(e))e.type==="network"?t={id:e.id,type:"network",message:Li}:(n=e.message)!=null&&n.includes("[Webhook Handler]")&&Vf(e.type)?t={id:e.id,...Rs[e.type]}:Wf(e.type)?t={id:e.id,...$s[e.type]}:t={id:e.id,type:e.type,message:e.message||"An error occurred"};else if(Yf(e))Gf(e.message)?t={type:"disconnected",message:Hf}:Qf(e.message).includes("invalidcontenttype")?t={type:"bot",message:jf}:t={type:"event",message:e.message};else if(e instanceof Error&&Gf(e.message))t={type:"network",message:Li};else if(e&&typeof e=="object"&&"type"in e&&"message"in e){const r=e;r.type==="network"?t={type:"network",message:Li}:t={type:r.type,message:r.message}}return t};function Gf(e){return Uw.some(t=>Qf(e).includes(t))}function Qf(e){return e.replaceAll(" ","").toLowerCase()}const Hw=(e,t)=>{if(!e)return{type:"configuration",message:Ff};if(!Pw(t))return{type:"configuration",message:Rf}},jw=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=i=>{var o;return t((o=i.target)==null?void 0:o.result)},r.onerror=i=>{var o;return n((o=i.target)==null?void 0:o.error)},r.readAsArrayBuffer(e)});function Vw(e,t,n,r){let i;return t&&e?i={conversationId:e,userToken:t}:t?i={conversationId:void 0,userToken:t}:i={conversationId:n,userToken:r},i}const En=M.forwardRef(({userId:e,src:t,container:n,image:r,fallback:i,...o},s)=>{const a=Ku(e??"",15);return x.jsxs(us,{ref:s,"data-color":a,...n,...o,children:[x.jsx(cs,{src:t,...r}),x.jsx(fs,{...i,children:typeof o.children=="string"?o.children[0]:o.children})]})});En.displayName="Avatar";function kP(){}function EP(){}function Ww(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const qw=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Yw=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Kw={};function Zf(e,t){return(Kw.jsx?Yw:qw).test(e)}const Gw=/[ \t\n\f\r]/g;function Qw(e){return typeof e=="object"?e.type==="text"?Jf(e.value):!1:Jf(e)}function Jf(e){return e.replace(Gw,"")===""}class Lr{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Lr.prototype.normal={},Lr.prototype.property={},Lr.prototype.space=void 0;function Xf(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Lr(n,r,t)}function Bs(e){return e.toLowerCase()}class ut{constructor(t,n){this.attribute=n,this.property=t}}ut.prototype.attribute="",ut.prototype.booleanish=!1,ut.prototype.boolean=!1,ut.prototype.commaOrSpaceSeparated=!1,ut.prototype.commaSeparated=!1,ut.prototype.defined=!1,ut.prototype.mustUseProperty=!1,ut.prototype.number=!1,ut.prototype.overloadedBoolean=!1,ut.prototype.property="",ut.prototype.spaceSeparated=!1,ut.prototype.space=void 0;let Zw=0;const ge=Cn(),We=Cn(),zs=Cn(),Z=Cn(),_e=Cn(),jn=Cn(),pt=Cn();function Cn(){return 2**++Zw}const Us=Object.freeze(Object.defineProperty({__proto__:null,boolean:ge,booleanish:We,commaOrSpaceSeparated:pt,commaSeparated:jn,number:Z,overloadedBoolean:zs,spaceSeparated:_e},Symbol.toStringTag,{value:"Module"})),Hs=Object.keys(Us);class js extends ut{constructor(t,n,r,i){let o=-1;if(super(t,n),ed(this,"space",i),typeof r=="number")for(;++o<Hs.length;){const s=Hs[o];ed(this,Hs[o],(r&Us[s])===Us[s])}}}js.prototype.defined=!0;function ed(e,t,n){n&&(e[t]=n)}function Vn(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new js(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Bs(r)]=r,n[Bs(o.attribute)]=r}return new Lr(t,n,e.space)}const td=Vn({properties:{ariaActiveDescendant:null,ariaAtomic:We,ariaAutoComplete:null,ariaBusy:We,ariaChecked:We,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:_e,ariaCurrent:null,ariaDescribedBy:_e,ariaDetails:null,ariaDisabled:We,ariaDropEffect:_e,ariaErrorMessage:null,ariaExpanded:We,ariaFlowTo:_e,ariaGrabbed:We,ariaHasPopup:null,ariaHidden:We,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:_e,ariaLevel:Z,ariaLive:null,ariaModal:We,ariaMultiLine:We,ariaMultiSelectable:We,ariaOrientation:null,ariaOwns:_e,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:We,ariaReadOnly:We,ariaRelevant:null,ariaRequired:We,ariaRoleDescription:_e,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:We,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function nd(e,t){return t in e?e[t]:t}function rd(e,t){return nd(e,t.toLowerCase())}const Jw=Vn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:jn,acceptCharset:_e,accessKey:_e,action:null,allow:null,allowFullScreen:ge,allowPaymentRequest:ge,allowUserMedia:ge,alt:null,as:null,async:ge,autoCapitalize:null,autoComplete:_e,autoFocus:ge,autoPlay:ge,blocking:_e,capture:null,charSet:null,checked:ge,cite:null,className:_e,cols:Z,colSpan:null,content:null,contentEditable:We,controls:ge,controlsList:_e,coords:Z|jn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ge,defer:ge,dir:null,dirName:null,disabled:ge,download:zs,draggable:We,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ge,formTarget:null,headers:_e,height:Z,hidden:zs,high:Z,href:null,hrefLang:null,htmlFor:_e,httpEquiv:_e,id:null,imageSizes:null,imageSrcSet:null,inert:ge,inputMode:null,integrity:null,is:null,isMap:ge,itemId:null,itemProp:_e,itemRef:_e,itemScope:ge,itemType:_e,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ge,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:ge,muted:ge,name:null,nonce:null,noModule:ge,noValidate:ge,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle: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:ge,optimum:Z,pattern:null,ping:_e,placeholder:null,playsInline:ge,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ge,referrerPolicy:null,rel:_e,required:ge,reversed:ge,rows:Z,rowSpan:Z,sandbox:_e,scope:null,scoped:ge,seamless:ge,selected:ge,shadowRootClonable:ge,shadowRootDelegatesFocus:ge,shadowRootMode:null,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:We,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:ge,useMap:null,value:We,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:_e,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ge,declare:ge,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:ge,noHref:ge,noShade:ge,noWrap:ge,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:We,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ge,disableRemotePlayback:ge,prefix:null,property:null,results:Z,security:null,unselectable:null},space:"html",transform:rd}),Xw=Vn({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",transformOrigin:"transform-origin",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"},properties:{about:pt,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:_e,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:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:ge,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,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:jn,g2:jn,glyphName:jn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:pt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,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:Z,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:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:_e,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:pt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:pt,rev:pt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:pt,requiredFeatures:pt,requiredFonts:pt,requiredFormats:pt,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:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:pt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pt,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:pt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:nd}),id=Vn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),od=Vn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:rd}),sd=Vn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),e1={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"},t1=/[A-Z]/g,ad=/-[a-z]/g,n1=/^data[-\w.:]+$/i;function r1(e,t){const n=Bs(t);let r=t,i=ut;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&n1.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(ad,o1);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!ad.test(o)){let s=o.replace(t1,i1);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=js}return new i(r,t)}function i1(e){return"-"+e.toLowerCase()}function o1(e){return e.charAt(1).toUpperCase()}const s1=Xf([td,Jw,id,od,sd],"html"),Vs=Xf([td,Xw,id,od,sd],"svg");function a1(e){return e.join(" ").trim()}var Ws={},ld=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,l1=/\n/g,u1=/^\s*/,c1=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,f1=/^:\s*/,d1=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,h1=/^[;\s]*/,p1=/^\s+|\s+$/g,m1=`
27
- `,ud="/",cd="*",An="",g1="comment",y1="declaration";function v1(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(m){var p=m.match(l1);p&&(n+=p.length);var g=m.lastIndexOf(m1);r=~g?m.length-g:r+m.length}function o(){var m={line:n,column:r};return function(p){return p.position=new s(m),u(),p}}function s(m){this.start=m,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(m){var p=new Error(t.source+":"+n+":"+r+": "+m);if(p.reason=m,p.filename=t.source,p.line=n,p.column=r,p.source=e,!t.silent)throw p}function l(m){var p=m.exec(e);if(p){var g=p[0];return i(g),e=e.slice(g.length),p}}function u(){l(u1)}function f(m){var p;for(m=m||[];p=c();)p!==!1&&m.push(p);return m}function c(){var m=o();if(!(ud!=e.charAt(0)||cd!=e.charAt(1))){for(var p=2;An!=e.charAt(p)&&(cd!=e.charAt(p)||ud!=e.charAt(p+1));)++p;if(p+=2,An===e.charAt(p-1))return a("End of comment missing");var g=e.slice(2,p-2);return r+=2,i(g),e=e.slice(p),r+=2,m({type:g1,comment:g})}}function h(){var m=o(),p=l(c1);if(p){if(c(),!l(f1))return a("property missing ':'");var g=l(d1),v=m({type:y1,property:fd(p[0].replace(ld,An)),value:g?fd(g[0].replace(ld,An)):An});return l(h1),v}}function d(){var m=[];f(m);for(var p;p=h();)p!==!1&&(m.push(p),f(m));return m}return u(),d()}function fd(e){return e?e.replace(p1,An):An}var b1=v1,w1=yn&&yn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.default=x1;const S1=w1(b1);function x1(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,S1.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:s,value:a}=o;i?t(s,a,o):a&&(n=n||{},n[s]=a)}),n}var Fi={};Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.camelCase=void 0;var k1=/^--[a-zA-Z0-9_-]+$/,E1=/-([a-z])/g,C1=/^[^-]+$/,A1=/^-(webkit|moz|ms|o|khtml)-/,T1=/^-(ms)-/,I1=function(e){return!e||C1.test(e)||k1.test(e)},O1=function(e,t){return t.toUpperCase()},dd=function(e,t){return"".concat(t,"-")},M1=function(e,t){return t===void 0&&(t={}),I1(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(T1,dd):e=e.replace(A1,dd),e.replace(E1,O1))};Fi.camelCase=M1;var D1=yn&&yn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},N1=D1(Ws),_1=Fi;function qs(e,t){var n={};return!e||typeof e!="string"||(0,N1.default)(e,function(r,i){r&&i&&(n[(0,_1.camelCase)(r,t)]=i)}),n}qs.default=qs;var P1=qs;const L1=vn(P1),hd=pd("end"),Ys=pd("start");function pd(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 F1(e){const t=Ys(e),n=hd(e);if(t&&n)return{start:t,end:n}}function Fr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?md(e.position):"start"in e||"end"in e?md(e):"line"in e||"column"in e?Ks(e):""}function Ks(e){return gd(e&&e.line)+":"+gd(e&&e.column)}function md(e){return Ks(e&&e.start)+"-"+Ks(e&&e.end)}function gd(e){return e&&typeof e=="number"?e:1}class et extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Fr(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}et.prototype.file="",et.prototype.name="",et.prototype.reason="",et.prototype.message="",et.prototype.stack="",et.prototype.column=void 0,et.prototype.line=void 0,et.prototype.ancestors=void 0,et.prototype.cause=void 0,et.prototype.fatal=void 0,et.prototype.place=void 0,et.prototype.ruleId=void 0,et.prototype.source=void 0;const Gs={}.hasOwnProperty,R1=new Map,$1=/[A-Z]/g,B1=new Set(["table","tbody","thead","tfoot","tr"]),z1=new Set(["td","th"]),yd="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function U1(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=G1(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=K1(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"?Vs:s1,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=vd(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function vd(e,t,n){if(t.type==="element")return H1(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return j1(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return W1(e,t,n);if(t.type==="mdxjsEsm")return V1(e,t);if(t.type==="root")return q1(e,t,n);if(t.type==="text")return Y1(e,t)}function H1(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Vs,e.schema=i),e.ancestors.push(t);const o=wd(e,t.tagName,!1),s=Q1(e,t);let a=Zs(e,t);return B1.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!Qw(l):!0})),bd(e,s,o,t),Qs(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function j1(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)}Rr(e,t.position)}function V1(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Rr(e,t.position)}function W1(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Vs,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:wd(e,t.name,!0),s=Z1(e,t),a=Zs(e,t);return bd(e,s,o,t),Qs(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function q1(e,t,n){const r={};return Qs(r,Zs(e,t)),e.create(t,e.Fragment,r,n)}function Y1(e,t){return t.value}function bd(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Qs(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function K1(e,t,n){return r;function r(i,o,s,a){const u=Array.isArray(s.children)?n:t;return a?u(o,s,a):u(o,s)}}function G1(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=Ys(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Q1(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Gs.call(t.properties,i)){const o=J1(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&z1.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Z1(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Rr(e,t.position);else{const i=r.name;let o;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,o=e.evaluater.evaluateExpression(a.expression)}else Rr(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Zs(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:R1;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const u=i.get(l)||0;s=l+"-"+u,i.set(l,u+1)}}const a=vd(e,o,s);a!==void 0&&n.push(a)}return n}function J1(e,t,n){const r=r1(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Ww(n):a1(n)),r.property==="style"){let i=typeof n=="object"?n:X1(e,String(n));return e.stylePropertyNameCase==="css"&&(i=eS(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?e1[r.property]||r.property:r.attribute,n]}}function X1(e,t){try{return L1(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new et("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=yd+"#cannot-parse-style-attribute",i}}function wd(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=Zf(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=Zf(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Gs.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Rr(e)}function Rr(e,t){const n=new et("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=yd+"#cannot-handle-mdx-estrees-without-createevaluater",n}function eS(e){const t={};let n;for(n in e)Gs.call(e,n)&&(t[tS(n)]=e[n]);return t}function tS(e){let t=e.replace($1,nS);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function nS(e){return"-"+e.toLowerCase()}const Js={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"]},rS={};function Xs(e,t){const n=rS,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Sd(e,r,i)}function Sd(e,t,n){if(iS(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 xd(e.children,t,n)}return Array.isArray(e)?xd(e,t,n):""}function xd(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Sd(e[i],t,n);return r.join("")}function iS(e){return!!(e&&typeof e=="object")}const kd=document.createElement("i");function ea(e){const t="&"+e+";";kd.innerHTML=t;const n=kd.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function mt(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function St(e,t){return e.length>0?(mt(e,e.length,0,t),e):t}const Ed={}.hasOwnProperty;function Cd(e){const t={};let n=-1;for(;++n<e.length;)oS(t,e[n]);return t}function oS(e,t){let n;for(n in t){const i=(Ed.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){Ed.call(i,s)||(i[s]=[]);const a=o[s];sS(i[s],Array.isArray(a)?a:a?[a]:[])}}}function sS(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);mt(e,0,0,r)}function Ad(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 Mt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ot=sn(/[A-Za-z]/),tt=sn(/[\dA-Za-z]/),aS=sn(/[#-'*+\--9=?A-Z^-~]/);function Ri(e){return e!==null&&(e<32||e===127)}const ta=sn(/\d/),lS=sn(/[\dA-Fa-f]/),uS=sn(/[!-/:-@[-`{-~]/);function ce(e){return e!==null&&e<-2}function De(e){return e!==null&&(e<0||e===32)}function ve(e){return e===-2||e===-1||e===32}const $i=sn(new RegExp("\\p{P}|\\p{S}","u")),Tn=sn(/\s/);function sn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Wn(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&tt(e.charCodeAt(n+1))&&tt(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ke(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return ve(l)?(e.enter(n),a(l)):t(l)}function a(l){return ve(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const cS={tokenize:fS};function fS(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"),ke(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ce(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const dS={tokenize:hS},Td={tokenize:pS};function hS(e){const t=this,n=[];let r=0,i,o,s;return a;function a(w){if(r<n.length){const A=n[r];return t.containerState=A[1],e.attempt(A[0].continuation,l,u)(w)}return u(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();const A=t.events.length;let k=A,E;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){E=t.events[k][1].end;break}v(r);let I=A;for(;I<t.events.length;)t.events[I][1].end={...E},I++;return mt(t.events,k+1,0,t.events.slice(A)),t.events.length=I,u(w)}return a(w)}function u(w){if(r===n.length){if(!i)return h(w);if(i.currentConstruct&&i.currentConstruct.concrete)return m(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Td,f,c)(w)}function f(w){return i&&y(),v(r),h(w)}function c(w){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,m(w)}function h(w){return t.containerState={},e.attempt(Td,d,m)(w)}function d(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function m(w){if(w===null){i&&y(),v(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),p(w)}function p(w){if(w===null){g(e.exit("chunkFlow"),!0),v(0),e.consume(w);return}return ce(w)?(e.consume(w),g(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(w),p)}function g(w,A){const k=t.sliceStream(w);if(A&&k.push(null),w.previous=o,o&&(o.next=w),o=w,i.defineSkip(w.start),i.write(k),t.parser.lazy[w.start.line]){let E=i.events.length;for(;E--;)if(i.events[E][1].start.offset<s&&(!i.events[E][1].end||i.events[E][1].end.offset>s))return;const I=t.events.length;let D=I,P,T;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(P){T=t.events[D][1].end;break}P=!0}for(v(r),E=I;E<t.events.length;)t.events[E][1].end={...T},E++;mt(t.events,D+1,0,t.events.slice(I)),t.events.length=E}}function v(w){let A=n.length;for(;A-- >w;){const k=n[A];t.containerState=k[1],k[0].exit.call(t,e)}n.length=w}function y(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function pS(e,t,n){return ke(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function qn(e){if(e===null||De(e)||Tn(e))return 1;if($i(e))return 2}function Bi(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const na={name:"attention",resolveAll:mS,tokenize:gS};function mS(e,t){let n=-1,r,i,o,s,a,l,u,f;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 c={...e[r][1].end},h={...e[n][1].start};Id(c,-l),Id(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=St(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=St(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),u=St(u,Bi(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=St(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=St(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,mt(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function gS(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=qn(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const u=e.exit("attentionSequence"),f=qn(l),c=!f||f===2&&i||n.includes(l),h=!i||i===2&&f||n.includes(r);return u._open=!!(o===42?c:c&&(i||!h)),u._close=!!(o===42?h:h&&(f||!c)),t(l)}}function Id(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const yS={name:"autolink",tokenize:vS};function vS(e,t,n){let r=0;return i;function i(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(d){return ot(d)?(e.consume(d),s):d===64?n(d):u(d)}function s(d){return d===43||d===45||d===46||tt(d)?(r=1,a(d)):u(d)}function a(d){return d===58?(e.consume(d),r=0,l):(d===43||d===45||d===46||tt(d))&&r++<32?(e.consume(d),a):(r=0,u(d))}function l(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):d===null||d===32||d===60||Ri(d)?n(d):(e.consume(d),l)}function u(d){return d===64?(e.consume(d),f):aS(d)?(e.consume(d),u):n(d)}function f(d){return tt(d)?c(d):n(d)}function c(d){return d===46?(e.consume(d),r=0,f):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):h(d)}function h(d){if((d===45||tt(d))&&r++<63){const m=d===45?h:c;return e.consume(d),m}return n(d)}}const $r={partial:!0,tokenize:bS};function bS(e,t,n){return r;function r(o){return ve(o)?ke(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||ce(o)?t(o):n(o)}}const Od={continuation:{tokenize:SS},exit:xS,name:"blockQuote",tokenize:wS};function wS(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return ve(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function SS(e,t,n){const r=this;return i;function i(s){return ve(s)?ke(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(Od,t,n)(s)}}function xS(e){e.exit("blockQuote")}const Md={name:"characterEscape",tokenize:kS};function kS(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return uS(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Dd={name:"characterReference",tokenize:ES};function ES(e,t,n){const r=this;let i=0,o,s;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),l}function l(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,s=tt,f(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=lS,f):(e.enter("characterReferenceValue"),o=7,s=ta,f(c))}function f(c){if(c===59&&i){const h=e.exit("characterReferenceValue");return s===tt&&!ea(r.sliceSerialize(h))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(c)&&i++<o?(e.consume(c),f):n(c)}}const Nd={partial:!0,tokenize:AS},_d={concrete:!0,name:"codeFenced",tokenize:CS};function CS(e,t,n){const r=this,i={partial:!0,tokenize:k};let o=0,s=0,a;return l;function l(E){return u(E)}function u(E){const I=r.events[r.events.length-1];return o=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,a=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(E)}function f(E){return E===a?(s++,e.consume(E),f):s<3?n(E):(e.exit("codeFencedFenceSequence"),ve(E)?ke(e,c,"whitespace")(E):c(E))}function c(E){return E===null||ce(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(Nd,p,A)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(E))}function h(E){return E===null||ce(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(E)):ve(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ke(e,d,"whitespace")(E)):E===96&&E===a?n(E):(e.consume(E),h)}function d(E){return E===null||ce(E)?c(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(E))}function m(E){return E===null||ce(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(E)):E===96&&E===a?n(E):(e.consume(E),m)}function p(E){return e.attempt(i,A,g)(E)}function g(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),v}function v(E){return o>0&&ve(E)?ke(e,y,"linePrefix",o+1)(E):y(E)}function y(E){return E===null||ce(E)?e.check(Nd,p,A)(E):(e.enter("codeFlowValue"),w(E))}function w(E){return E===null||ce(E)?(e.exit("codeFlowValue"),y(E)):(e.consume(E),w)}function A(E){return e.exit("codeFenced"),t(E)}function k(E,I,D){let P=0;return T;function T(R){return E.enter("lineEnding"),E.consume(R),E.exit("lineEnding"),O}function O(R){return E.enter("codeFencedFence"),ve(R)?ke(E,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):B(R)}function B(R){return R===a?(E.enter("codeFencedFenceSequence"),L(R)):D(R)}function L(R){return R===a?(P++,E.consume(R),L):P>=s?(E.exit("codeFencedFenceSequence"),ve(R)?ke(E,F,"whitespace")(R):F(R)):D(R)}function F(R){return R===null||ce(R)?(E.exit("codeFencedFence"),I(R)):D(R)}}}function AS(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const ra={name:"codeIndented",tokenize:IS},TS={partial:!0,tokenize:OS};function IS(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),ke(e,o,"linePrefix",5)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):ce(u)?e.attempt(TS,s,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||ce(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function OS(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):ke(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):ce(s)?i(s):n(s)}}const MS={name:"codeText",previous:NS,resolve:DS,tokenize:_S};function DS(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 NS(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function _S(e,t,n){let r=0,i,o;return s;function s(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),l(c))}function l(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),l):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):ce(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||ce(c)?(e.exit("codeTextData"),l(c)):(e.consume(c),u)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(o.type="codeTextData",u(c))}}class PS{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Br(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Br(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Br(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Br(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Br(this.left,n.reverse())}}}function Br(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Pd(e){const t={};let n=-1,r,i,o,s,a,l,u;const f=new PS(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,LS(f,n)),n=t[n],u=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=f.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,n),a.unshift(r),f.splice(i,n-i+1,a))}}return mt(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function LS(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],u={};let f,c,h=-1,d=n,m=0,p=0;const g=[p];for(;d;){for(;e.get(++i)[1]!==d;);o.push(i),d._tokenizer||(f=r.sliceStream(d),d.next||f.push(null),c&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(f),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),c=d,d=d.next}for(d=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&&(p=h+1,g.push(p),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):g.pop(),h=g.length;h--;){const v=a.slice(g[h],g[h+1]),y=o.pop();l.push([y,y+v.length-1]),e.splice(y,2,v)}for(l.reverse(),h=-1;++h<l.length;)u[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return u}const FS={resolve:$S,tokenize:BS},RS={partial:!0,tokenize:zS};function $S(e){return Pd(e),e}function BS(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?o(a):ce(a)?e.check(RS,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function zS(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ke(e,o,"linePrefix")}function o(s){if(s===null||ce(s))return n(s);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(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Ld(e,t,n,r,i,o,s,a,l){const u=l||Number.POSITIVE_INFINITY;let f=0;return c;function c(v){return v===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(v),e.exit(o),h):v===null||v===32||v===41||Ri(v)?n(v):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),p(v))}function h(v){return v===62?(e.enter(o),e.consume(v),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),d(v))}function d(v){return v===62?(e.exit("chunkString"),e.exit(a),h(v)):v===null||v===60||ce(v)?n(v):(e.consume(v),v===92?m:d)}function m(v){return v===60||v===62||v===92?(e.consume(v),d):d(v)}function p(v){return!f&&(v===null||v===41||De(v))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(v)):f<u&&v===40?(e.consume(v),f++,p):v===41?(e.consume(v),f--,p):v===null||v===32||v===40||Ri(v)?n(v):(e.consume(v),v===92?g:p)}function g(v){return v===40||v===41||v===92?(e.consume(v),p):p(v)}}function Fd(e,t,n,r,i,o){const s=this;let a=0,l;return u;function u(d){return e.enter(r),e.enter(i),e.consume(d),e.exit(i),e.enter(o),f}function f(d){return a>999||d===null||d===91||d===93&&!l||d===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):d===93?(e.exit(o),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):ce(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(d){return d===null||d===91||d===93||ce(d)||a++>999?(e.exit("chunkString"),f(d)):(e.consume(d),l||(l=!ve(d)),d===92?h:c)}function h(d){return d===91||d===92||d===93?(e.consume(d),a++,c):c(d)}}function Rd(e,t,n,r,i,o){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,l):n(h)}function l(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),u(h))}function u(h){return h===s?(e.exit(o),l(s)):h===null?n(h):ce(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ke(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===s||h===null||ce(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?c:f)}function c(h){return h===s||h===92?(e.consume(h),f):f(h)}}function zr(e,t){let n;return r;function r(i){return ce(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ve(i)?ke(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const US={name:"definition",tokenize:jS},HS={partial:!0,tokenize:VS};function jS(e,t,n){const r=this;let i;return o;function o(d){return e.enter("definition"),s(d)}function s(d){return Fd.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function a(d){return i=Mt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),l):n(d)}function l(d){return De(d)?zr(e,u)(d):u(d)}function u(d){return Ld(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function f(d){return e.attempt(HS,c,c)(d)}function c(d){return ve(d)?ke(e,h,"whitespace")(d):h(d)}function h(d){return d===null||ce(d)?(e.exit("definition"),r.parser.defined.push(i),t(d)):n(d)}}function VS(e,t,n){return r;function r(a){return De(a)?zr(e,i)(a):n(a)}function i(a){return Rd(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return ve(a)?ke(e,s,"whitespace")(a):s(a)}function s(a){return a===null||ce(a)?t(a):n(a)}}const WS={name:"hardBreakEscape",tokenize:qS};function qS(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return ce(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const YS={name:"headingAtx",resolve:KS,tokenize:GS};function KS(e,t){let n=e.length-2,r=3,i,o;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},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},mt(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function GS(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),s(f)}function s(f){return f===35&&r++<6?(e.consume(f),s):f===null||De(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),l(f)):f===null||ce(f)?(e.exit("atxHeading"),t(f)):ve(f)?ke(e,a,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function l(f){return f===35?(e.consume(f),l):(e.exit("atxHeadingSequence"),a(f))}function u(f){return f===null||f===35||De(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),u)}}const QS=["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"],$d=["pre","script","style","textarea"],ZS={concrete:!0,name:"htmlFlow",resolveTo:ex,tokenize:tx},JS={partial:!0,tokenize:rx},XS={partial:!0,tokenize:nx};function ex(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 tx(e,t,n){const r=this;let i,o,s,a,l;return u;function u(S){return f(S)}function f(S){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(S),c}function c(S){return S===33?(e.consume(S),h):S===47?(e.consume(S),o=!0,p):S===63?(e.consume(S),i=3,r.interrupt?t:b):ot(S)?(e.consume(S),s=String.fromCharCode(S),g):n(S)}function h(S){return S===45?(e.consume(S),i=2,d):S===91?(e.consume(S),i=5,a=0,m):ot(S)?(e.consume(S),i=4,r.interrupt?t:b):n(S)}function d(S){return S===45?(e.consume(S),r.interrupt?t:b):n(S)}function m(S){const V="CDATA[";return S===V.charCodeAt(a++)?(e.consume(S),a===V.length?r.interrupt?t:B:m):n(S)}function p(S){return ot(S)?(e.consume(S),s=String.fromCharCode(S),g):n(S)}function g(S){if(S===null||S===47||S===62||De(S)){const V=S===47,Y=s.toLowerCase();return!V&&!o&&$d.includes(Y)?(i=1,r.interrupt?t(S):B(S)):QS.includes(s.toLowerCase())?(i=6,V?(e.consume(S),v):r.interrupt?t(S):B(S)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(S):o?y(S):w(S))}return S===45||tt(S)?(e.consume(S),s+=String.fromCharCode(S),g):n(S)}function v(S){return S===62?(e.consume(S),r.interrupt?t:B):n(S)}function y(S){return ve(S)?(e.consume(S),y):T(S)}function w(S){return S===47?(e.consume(S),T):S===58||S===95||ot(S)?(e.consume(S),A):ve(S)?(e.consume(S),w):T(S)}function A(S){return S===45||S===46||S===58||S===95||tt(S)?(e.consume(S),A):k(S)}function k(S){return S===61?(e.consume(S),E):ve(S)?(e.consume(S),k):w(S)}function E(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),l=S,I):ve(S)?(e.consume(S),E):D(S)}function I(S){return S===l?(e.consume(S),l=null,P):S===null||ce(S)?n(S):(e.consume(S),I)}function D(S){return S===null||S===34||S===39||S===47||S===60||S===61||S===62||S===96||De(S)?k(S):(e.consume(S),D)}function P(S){return S===47||S===62||ve(S)?w(S):n(S)}function T(S){return S===62?(e.consume(S),O):n(S)}function O(S){return S===null||ce(S)?B(S):ve(S)?(e.consume(S),O):n(S)}function B(S){return S===45&&i===2?(e.consume(S),N):S===60&&i===1?(e.consume(S),H):S===62&&i===4?(e.consume(S),_):S===63&&i===3?(e.consume(S),b):S===93&&i===5?(e.consume(S),W):ce(S)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(JS,j,L)(S)):S===null||ce(S)?(e.exit("htmlFlowData"),L(S)):(e.consume(S),B)}function L(S){return e.check(XS,F,j)(S)}function F(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),R}function R(S){return S===null||ce(S)?L(S):(e.enter("htmlFlowData"),B(S))}function N(S){return S===45?(e.consume(S),b):B(S)}function H(S){return S===47?(e.consume(S),s="",z):B(S)}function z(S){if(S===62){const V=s.toLowerCase();return $d.includes(V)?(e.consume(S),_):B(S)}return ot(S)&&s.length<8?(e.consume(S),s+=String.fromCharCode(S),z):B(S)}function W(S){return S===93?(e.consume(S),b):B(S)}function b(S){return S===62?(e.consume(S),_):S===45&&i===2?(e.consume(S),b):B(S)}function _(S){return S===null||ce(S)?(e.exit("htmlFlowData"),j(S)):(e.consume(S),_)}function j(S){return e.exit("htmlFlow"),t(S)}}function nx(e,t,n){const r=this;return i;function i(s){return ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function rx(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt($r,t,n)}}const ix={name:"htmlText",tokenize:ox};function ox(e,t,n){const r=this;let i,o,s;return a;function a(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),l}function l(b){return b===33?(e.consume(b),u):b===47?(e.consume(b),k):b===63?(e.consume(b),w):ot(b)?(e.consume(b),D):n(b)}function u(b){return b===45?(e.consume(b),f):b===91?(e.consume(b),o=0,m):ot(b)?(e.consume(b),y):n(b)}function f(b){return b===45?(e.consume(b),d):n(b)}function c(b){return b===null?n(b):b===45?(e.consume(b),h):ce(b)?(s=c,H(b)):(e.consume(b),c)}function h(b){return b===45?(e.consume(b),d):c(b)}function d(b){return b===62?N(b):b===45?h(b):c(b)}function m(b){const _="CDATA[";return b===_.charCodeAt(o++)?(e.consume(b),o===_.length?p:m):n(b)}function p(b){return b===null?n(b):b===93?(e.consume(b),g):ce(b)?(s=p,H(b)):(e.consume(b),p)}function g(b){return b===93?(e.consume(b),v):p(b)}function v(b){return b===62?N(b):b===93?(e.consume(b),v):p(b)}function y(b){return b===null||b===62?N(b):ce(b)?(s=y,H(b)):(e.consume(b),y)}function w(b){return b===null?n(b):b===63?(e.consume(b),A):ce(b)?(s=w,H(b)):(e.consume(b),w)}function A(b){return b===62?N(b):w(b)}function k(b){return ot(b)?(e.consume(b),E):n(b)}function E(b){return b===45||tt(b)?(e.consume(b),E):I(b)}function I(b){return ce(b)?(s=I,H(b)):ve(b)?(e.consume(b),I):N(b)}function D(b){return b===45||tt(b)?(e.consume(b),D):b===47||b===62||De(b)?P(b):n(b)}function P(b){return b===47?(e.consume(b),N):b===58||b===95||ot(b)?(e.consume(b),T):ce(b)?(s=P,H(b)):ve(b)?(e.consume(b),P):N(b)}function T(b){return b===45||b===46||b===58||b===95||tt(b)?(e.consume(b),T):O(b)}function O(b){return b===61?(e.consume(b),B):ce(b)?(s=O,H(b)):ve(b)?(e.consume(b),O):P(b)}function B(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),i=b,L):ce(b)?(s=B,H(b)):ve(b)?(e.consume(b),B):(e.consume(b),F)}function L(b){return b===i?(e.consume(b),i=void 0,R):b===null?n(b):ce(b)?(s=L,H(b)):(e.consume(b),L)}function F(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||De(b)?P(b):(e.consume(b),F)}function R(b){return b===47||b===62||De(b)?P(b):n(b)}function N(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function H(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),z}function z(b){return ve(b)?ke(e,W,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):W(b)}function W(b){return e.enter("htmlTextData"),s(b)}}const ia={name:"labelEnd",resolveAll:ux,resolveTo:cx,tokenize:fx},sx={tokenize:dx},ax={tokenize:hx},lx={tokenize:px};function ux(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&mt(e,0,e.length,n),e}function cx(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",u,t]],a=St(a,e.slice(o+1,o+r+3)),a=St(a,[["enter",f,t]]),a=St(a,Bi(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=St(a,[["exit",f,t],e[s-2],e[s-1],["exit",u,t]]),a=St(a,e.slice(s+1)),a=St(a,[["exit",l,t]]),mt(e,o,e.length,a),e}function fx(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(h){return o?o._inactive?c(h):(s=r.parser.defined.includes(Mt(r.sliceSerialize({start:o.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,f,s?f:c)(h):h===91?e.attempt(ax,f,s?u:c)(h):s?f(h):c(h)}function u(h){return e.attempt(lx,f,c)(h)}function f(h){return t(h)}function c(h){return o._balanced=!0,n(h)}}function dx(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return De(c)?zr(e,o)(c):o(c)}function o(c){return c===41?f(c):Ld(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function s(c){return De(c)?zr(e,l)(c):f(c)}function a(c){return n(c)}function l(c){return c===34||c===39||c===40?Rd(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function u(c){return De(c)?zr(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function hx(e,t,n){const r=this;return i;function i(a){return Fd.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Mt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function px(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const mx={name:"labelStartImage",resolveAll:ia.resolveAll,tokenize:gx};function gx(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const yx={name:"labelStartLink",resolveAll:ia.resolveAll,tokenize:vx};function vx(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const oa={name:"lineEnding",tokenize:bx};function bx(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ke(e,t,"linePrefix")}}const zi={name:"thematicBreak",tokenize:wx};function wx(e,t,n){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),s(u)}function s(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||ce(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),ve(u)?ke(e,a,"whitespace")(u):a(u))}}const ct={continuation:{tokenize:Ex},exit:Ax,name:"list",tokenize:kx},Sx={partial:!0,tokenize:Tx},xx={partial:!0,tokenize:Cx};function kx(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(d){const m=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:ta(d)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(zi,n,u)(d):u(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return n(d)}function l(d){return ta(d)&&++s<10?(e.consume(d),l):(!r.interrupt||s<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),u(d)):n(d)}function u(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check($r,r.interrupt?n:f,e.attempt(Sx,h,c))}function f(d){return r.containerState.initialBlankLine=!0,o++,h(d)}function c(d){return ve(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),h):n(d)}function h(d){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function Ex(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check($r,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ke(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!ve(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(xx,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,ke(e,e.attempt(ct,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Cx(e,t,n){const r=this;return ke(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function Ax(e){e.exit(this.containerState.type)}function Tx(e,t,n){const r=this;return ke(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!ve(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Bd={name:"setextUnderline",resolveTo:Ix,tokenize:Ox};function Ix(e,t){let n=e.length,r,i,o;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),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function Ox(e,t,n){const r=this;let i;return o;function o(u){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),ve(u)?ke(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ce(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Mx={tokenize:Dx};function Dx(e){const t=this,n=e.attempt($r,r,e.attempt(this.parser.constructs.flowInitial,i,ke(e,e.attempt(this.parser.constructs.flow,i,e.attempt(FS,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Nx={resolveAll:Ud()},_x=zd("string"),Px=zd("text");function zd(e){return{resolveAll:Ud(e==="text"?Lx:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(f){return u(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),l}function l(f){return u(f)?(n.exit("data"),o(f)):(n.consume(f),l)}function u(f){if(f===null)return!0;const c=i[f];let h=-1;if(c)for(;++h<c.length;){const d=c[h];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function Ud(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Lx(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 o=i.length,s=-1,a=0,l;for(;o--;){const u=i[o];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(u===-2)l=!0,a++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const Fx=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:US},disable:{null:[]},document:{42:ct,43:ct,45:ct,48:ct,49:ct,50:ct,51:ct,52:ct,53:ct,54:ct,55:ct,56:ct,57:ct,62:Od},flow:{35:YS,42:zi,45:[Bd,zi],60:ZS,61:Bd,95:zi,96:_d,126:_d},flowInitial:{[-2]:ra,[-1]:ra,32:ra},insideSpan:{null:[na,Nx]},string:{38:Dd,92:Md},text:{[-5]:oa,[-4]:oa,[-3]:oa,33:mx,38:Dd,42:na,60:[yS,ix],91:yx,92:[WS,Md],93:ia,95:na,96:MS}},Symbol.toStringTag,{value:"Module"}));function Rx(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],a=[];const l={attempt:I(k),check:I(E),consume:y,enter:w,exit:A,interrupt:I(E,{interrupt:!0})},u={code:null,containerState:{},defineSkip:p,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:d,write:c};let f=t.tokenize.call(u,l);return t.resolveAll&&o.push(t),u;function c(O){return s=St(s,O),g(),s[s.length-1]!==null?[]:(D(t,0),u.events=Bi(o,u.events,u),u.events)}function h(O,B){return Bx(d(O),B)}function d(O){return $x(s,O)}function m(){const{_bufferIndex:O,_index:B,line:L,column:F,offset:R}=r;return{_bufferIndex:O,_index:B,line:L,column:F,offset:R}}function p(O){i[O.line]=O.column,T()}function g(){let O;for(;r._index<s.length;){const B=s[r._index];if(typeof B=="string")for(O=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===O&&r._bufferIndex<B.length;)v(B.charCodeAt(r._bufferIndex));else v(B)}}function v(O){f=f(O)}function y(O){ce(O)?(r.line++,r.column=1,r.offset+=O===-3?2:1,T()):O!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=O}function w(O,B){const L=B||{};return L.type=O,L.start=m(),u.events.push(["enter",L,u]),a.push(L),L}function A(O){const B=a.pop();return B.end=m(),u.events.push(["exit",B,u]),B}function k(O,B){D(O,B.from)}function E(O,B){B.restore()}function I(O,B){return L;function L(F,R,N){let H,z,W,b;return Array.isArray(F)?j(F):"tokenize"in F?j([F]):_(F);function _(q){return Q;function Q(X){const se=X!==null&&q[X],G=X!==null&&q.null,te=[...Array.isArray(se)?se:se?[se]:[],...Array.isArray(G)?G:G?[G]:[]];return j(te)(X)}}function j(q){return H=q,z=0,q.length===0?N:S(q[z])}function S(q){return Q;function Q(X){return b=P(),W=q,q.partial||(u.currentConstruct=q),q.name&&u.parser.constructs.disable.null.includes(q.name)?Y():q.tokenize.call(B?Object.assign(Object.create(u),B):u,l,V,Y)(X)}}function V(q){return O(W,b),R}function Y(q){return b.restore(),++z<H.length?S(H[z]):N}}}function D(O,B){O.resolveAll&&!o.includes(O)&&o.push(O),O.resolve&&mt(u.events,B,u.events.length-B,O.resolve(u.events.slice(B),u)),O.resolveTo&&(u.events=O.resolveTo(u.events,u))}function P(){const O=m(),B=u.previous,L=u.currentConstruct,F=u.events.length,R=Array.from(a);return{from:F,restore:N};function N(){r=O,u.previous=B,u.currentConstruct=L,u.events.length=F,a=R,T()}}function T(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function $x(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function Bx(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
17
+ */var Vu;function tb(){return Vu||(Vu=1,process.env.NODE_ENV!=="production"&&function(){function e(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}function t(d,m){f||i.startTransition===void 0||(f=!0,console.error("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 p=m();if(!c){var g=m();o(p,g)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}g=s({inst:{value:p,getSnapshot:m}});var v=g[0].inst,y=g[1];return l(function(){v.value=p,v.getSnapshot=m,n(v)&&y({inst:v})},[d,p,m]),a(function(){return n(v)&&y({inst:v}),d(function(){n(v)&&y({inst:v})})},[d]),u(p),p}function n(d){var m=d.getSnapshot;d=d.value;try{var p=m();return!o(d,p)}catch{return!0}}function r(d,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=M,o=typeof Object.is=="function"?Object.is:e,s=i.useState,a=i.useEffect,l=i.useLayoutEffect,u=i.useDebugValue,f=!1,c=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;ss.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),ss}process.env.NODE_ENV==="production"?is.exports=eb():is.exports=tb();var as=is.exports;function nb(){return as.useSyncExternalStore(rb,()=>!0,()=>!1)}function rb(){return()=>{}}var ls="Avatar",[ib]=jv(ls),[ob,Wu]=ib(ls),us=A.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,o]=A.useState("idle");return x.jsx(ob,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:x.jsx(rs.span,{...r,ref:t})})});us.displayName=ls;var qu="AvatarImage",cs=A.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...o}=e,s=Wu(qu,n),a=sb(r,o),l=Ln(u=>{i(u),s.onImageLoadingStatusChange(u)});return en(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?x.jsx(rs.img,{...o,ref:t,src:r}):null});cs.displayName=qu;var Yu="AvatarFallback",fs=A.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,o=Wu(Yu,n),[s,a]=A.useState(r===void 0);return A.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),s&&o.imageLoadingStatus!=="loaded"?x.jsx(rs.span,{...i,ref:t}):null});fs.displayName=Yu;function Ku(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function sb(e,{referrerPolicy:t,crossOrigin:n}){const r=nb(),i=A.useRef(null),o=r?(i.current||(i.current=new window.Image),i.current):null,[s,a]=A.useState(()=>Ku(o,e));return en(()=>{a(Ku(o,e))},[o,e]),en(()=>{const l=c=>()=>{a(c)};if(!o)return;const u=l("loaded"),f=l("error");return o.addEventListener("load",u),o.addEventListener("error",f),t&&(o.referrerPolicy=t),typeof n=="string"&&(o.crossOrigin=n),()=>{o.removeEventListener("load",u),o.removeEventListener("error",f)}},[o,n,t]),s}function Gu(e,t){let n=`${e} {`;for(const[r,i]of Object.entries(t))n+=`${r}: ${i}; `;return n+="}",n}function Qu(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 ab=(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 o=new Image;o.addEventListener("load",()=>{i&&clearTimeout(i),n({width:o.naturalWidth,height:o.naturalHeight})}),o.addEventListener("error",s=>{i&&clearTimeout(i),r(`${s.type}: ${s.message}`)}),o.src=e,t.timeout&&(i=setTimeout(()=>r("Timeout"),t.timeout))});var Zu={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(yn,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",s="second",a="minute",l="hour",u="day",f="week",c="month",h="quarter",d="year",m="date",p="Invalid Date",g=/^(\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,y={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(F){var R=["th","st","nd","rd"],N=F%100;return"["+F+(R[(N-20)%10]||R[N]||R[0])+"]"}},w=function(F,R,N){var j=String(F);return!j||j.length>=R?F:""+Array(R+1-j.length).join(N)+F},C={s:w,z:function(F){var R=-F.utcOffset(),N=Math.abs(R),j=Math.floor(N/60),z=N%60;return(R<=0?"+":"-")+w(j,2,"0")+":"+w(z,2,"0")},m:function F(R,N){if(R.date()<N.date())return-F(N,R);var j=12*(N.year()-R.year())+(N.month()-R.month()),z=R.clone().add(j,c),V=N-z<0,b=R.clone().add(j+(V?-1:1),c);return+(-(j+(N-z)/(V?z-b:b-z))||0)},a:function(F){return F<0?Math.ceil(F)||0:Math.floor(F)},p:function(F){return{M:c,y:d,w:f,d:u,D:m,h:l,m:a,s,ms:o,Q:h}[F]||String(F||"").toLowerCase().replace(/s$/,"")},u:function(F){return F===void 0}},k="en",E={};E[k]=y;var I="$isDayjsObject",D=function(F){return F instanceof U||!(!F||!F[I])},P=function F(R,N,j){var z;if(!R)return k;if(typeof R=="string"){var V=R.toLowerCase();E[V]&&(z=V),N&&(E[V]=N,z=V);var b=R.split("-");if(!z&&b.length>1)return F(b[0])}else{var _=R.name;E[_]=R,z=_}return!j&&z&&(k=z),z||!j&&k},T=function(F,R){if(D(F))return F.clone();var N=typeof R=="object"?R:{};return N.date=F,N.args=arguments,new U(N)},O=C;O.l=P,O.i=D,O.w=function(F,R){return T(F,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var U=function(){function F(N){this.$L=P(N.locale,null,!0),this.parse(N),this.$x=this.$x||N.x||{},this[I]=!0}var R=F.prototype;return R.parse=function(N){this.$d=function(j){var z=j.date,V=j.utc;if(z===null)return new Date(NaN);if(O.u(z))return new Date;if(z instanceof Date)return new Date(z);if(typeof z=="string"&&!/Z$/i.test(z)){var b=z.match(g);if(b){var _=b[2]-1||0,B=(b[7]||"0").substring(0,3);return V?new Date(Date.UTC(b[1],_,b[3]||1,b[4]||0,b[5]||0,b[6]||0,B)):new Date(b[1],_,b[3]||1,b[4]||0,b[5]||0,b[6]||0,B)}}return new Date(z)}(N),this.init()},R.init=function(){var N=this.$d;this.$y=N.getFullYear(),this.$M=N.getMonth(),this.$D=N.getDate(),this.$W=N.getDay(),this.$H=N.getHours(),this.$m=N.getMinutes(),this.$s=N.getSeconds(),this.$ms=N.getMilliseconds()},R.$utils=function(){return O},R.isValid=function(){return this.$d.toString()!==p},R.isSame=function(N,j){var z=T(N);return this.startOf(j)<=z&&z<=this.endOf(j)},R.isAfter=function(N,j){return T(N)<this.startOf(j)},R.isBefore=function(N,j){return this.endOf(j)<T(N)},R.$g=function(N,j,z){return O.u(N)?this[j]:this.set(z,N)},R.unix=function(){return Math.floor(this.valueOf()/1e3)},R.valueOf=function(){return this.$d.getTime()},R.startOf=function(N,j){var z=this,V=!!O.u(j)||j,b=O.p(N),_=function(se,K){var te=O.w(z.$u?Date.UTC(z.$y,K,se):new Date(z.$y,K,se),z);return V?te:te.endOf(u)},B=function(se,K){return O.w(z.toDate()[se].apply(z.toDate("s"),(V?[0,0,0,0]:[23,59,59,999]).slice(K)),z)},S=this.$W,W=this.$M,J=this.$D,Y="set"+(this.$u?"UTC":"");switch(b){case d:return V?_(1,0):_(31,11);case c:return V?_(1,W):_(0,W+1);case f:var G=this.$locale().weekStart||0,X=(S<G?S+7:S)-G;return _(V?J-X:J+(6-X),W);case u:case m:return B(Y+"Hours",0);case l:return B(Y+"Minutes",1);case a:return B(Y+"Seconds",2);case s:return B(Y+"Milliseconds",3);default:return this.clone()}},R.endOf=function(N){return this.startOf(N,!1)},R.$set=function(N,j){var z,V=O.p(N),b="set"+(this.$u?"UTC":""),_=(z={},z[u]=b+"Date",z[m]=b+"Date",z[c]=b+"Month",z[d]=b+"FullYear",z[l]=b+"Hours",z[a]=b+"Minutes",z[s]=b+"Seconds",z[o]=b+"Milliseconds",z)[V],B=V===u?this.$D+(j-this.$W):j;if(V===c||V===d){var S=this.clone().set(m,1);S.$d[_](B),S.init(),this.$d=S.set(m,Math.min(this.$D,S.daysInMonth())).$d}else _&&this.$d[_](B);return this.init(),this},R.set=function(N,j){return this.clone().$set(N,j)},R.get=function(N){return this[O.p(N)]()},R.add=function(N,j){var z,V=this;N=Number(N);var b=O.p(j),_=function(W){var J=T(V);return O.w(J.date(J.date()+Math.round(W*N)),V)};if(b===c)return this.set(c,this.$M+N);if(b===d)return this.set(d,this.$y+N);if(b===u)return _(1);if(b===f)return _(7);var B=(z={},z[a]=r,z[l]=i,z[s]=n,z)[b]||1,S=this.$d.getTime()+N*B;return O.w(S,this)},R.subtract=function(N,j){return this.add(-1*N,j)},R.format=function(N){var j=this,z=this.$locale();if(!this.isValid())return z.invalidDate||p;var V=N||"YYYY-MM-DDTHH:mm:ssZ",b=O.z(this),_=this.$H,B=this.$m,S=this.$M,W=z.weekdays,J=z.months,Y=z.meridiem,G=function(K,te,$,ne){return K&&(K[te]||K(j,V))||$[te].slice(0,ne)},X=function(K){return O.s(_%12||12,K,"0")},se=Y||function(K,te,$){var ne=K<12?"AM":"PM";return $?ne.toLowerCase():ne};return V.replace(v,function(K,te){return te||function($){switch($){case"YY":return String(j.$y).slice(-2);case"YYYY":return O.s(j.$y,4,"0");case"M":return S+1;case"MM":return O.s(S+1,2,"0");case"MMM":return G(z.monthsShort,S,J,3);case"MMMM":return G(J,S);case"D":return j.$D;case"DD":return O.s(j.$D,2,"0");case"d":return String(j.$W);case"dd":return G(z.weekdaysMin,j.$W,W,2);case"ddd":return G(z.weekdaysShort,j.$W,W,3);case"dddd":return W[j.$W];case"H":return String(_);case"HH":return O.s(_,2,"0");case"h":return X(1);case"hh":return X(2);case"a":return se(_,B,!0);case"A":return se(_,B,!1);case"m":return String(B);case"mm":return O.s(B,2,"0");case"s":return String(j.$s);case"ss":return O.s(j.$s,2,"0");case"SSS":return O.s(j.$ms,3,"0");case"Z":return b}return null}(K)||b.replace(":","")})},R.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},R.diff=function(N,j,z){var V,b=this,_=O.p(j),B=T(N),S=(B.utcOffset()-this.utcOffset())*r,W=this-B,J=function(){return O.m(b,B)};switch(_){case d:V=J()/12;break;case c:V=J();break;case h:V=J()/3;break;case f:V=(W-S)/6048e5;break;case u:V=(W-S)/864e5;break;case l:V=W/i;break;case a:V=W/r;break;case s:V=W/n;break;default:V=W}return z?V:O.a(V)},R.daysInMonth=function(){return this.endOf(c).$D},R.$locale=function(){return E[this.$L]},R.locale=function(N,j){if(!N)return this.$L;var z=this.clone(),V=P(N,j,!0);return V&&(z.$L=V),z},R.clone=function(){return O.w(this.$d,this)},R.toDate=function(){return new Date(this.valueOf())},R.toJSON=function(){return this.isValid()?this.toISOString():null},R.toISOString=function(){return this.$d.toISOString()},R.toString=function(){return this.$d.toUTCString()},F}(),L=U.prototype;return T.prototype=L,[["$ms",o],["$s",s],["$m",a],["$H",l],["$W",u],["$M",c],["$y",d],["$D",m]].forEach(function(F){L[F[1]]=function(R){return this.$g(R,F[0],F[1])}}),T.extend=function(F,R){return F.$i||(F(R,U,T),F.$i=!0),T},T.locale=P,T.isDayjs=D,T.unix=function(F){return T(1e3*F)},T.en=E[k],T.Ls=E,T.p={},T})})(Zu);var lb=Zu.exports;const wi=vn(lb);var Ju={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(yn,function(){return function(n,r,i){r.prototype.isToday=function(){var o="YYYY-MM-DD",s=i();return this.format(o)===s.format(o)}}})})(Ju);var ub=Ju.exports;const cb=vn(ub);var Xu={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(yn,function(){return function(n,r,i){r.prototype.isYesterday=function(){var o="YYYY-MM-DD",s=i().subtract(1,"day");return this.format(o)===s.format(o)}}})})(Xu);var fb=Xu.exports;const db=vn(fb);wi.extend(cb),wi.extend(db);function ec(e,t,n,r,i){return e.map(o=>{const{authorId:s}=o,a=s===n?"outgoing":"incoming",l=t.find(f=>f.id===s);let u;return l&&l.id===n?u={name:l.name||"You",avatar:l.pictureUrl}:l?u={name:l.name||"Agent",avatar:l.pictureUrl}:u={name:r||"Bot",avatar:i},{...o,direction:a,sender:u}})}function hb(e,t="day"){var r,i,o;if(!e||e.length===0)return[];const n=[];(r=e[0])!=null&&r.timestamp&&n.push(tc(e[0].timestamp));for(let s=0;s<e.length;s++)if(e[s]&&n.push(e[s]),s+1<e.length){const a=(i=e[s])==null?void 0:i.timestamp,l=(o=e[s+1])==null?void 0:o.timestamp;!wi(a).isSame(l,t)&&l&&n.push(tc(l))}return n}function tc(e){return{id:nc(e),direction:"system",sender:{name:"system"},timestamp:e,block:{type:"text",text:nc(e)}}}function nc(e,t=!1){const n=wi(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")}function pb(e=""){if(typeof e!="string")throw new TypeError("Color should be string!");const t=/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i.exec(e);if(t)return t.splice(1).map(r=>Number.parseInt(r,16));const n=/^#?([\da-f])([\da-f])([\da-f])$/i.exec(e);if(n)return n.splice(1).map(r=>Number.parseInt(r+r,16));if(e.includes(","))return e.split(",").map(r=>Number.parseInt(r));throw new Error("Invalid color format! Use #ABC or #AABBCC or r,g,b")}function mb(e){return"#"+e.map(t=>`0${t.toString(16).toUpperCase()}`.slice(-2)).join("")}function gb(e,t){return e.map(n=>Math.round(n+(255-n)*t))}function yb(e,t){return e.map(n=>Math.round(n*t))}const wr=e=>t=>gb(t,e),Sr=e=>t=>yb(t,e),vb={50:wr(.95),100:wr(.9),200:wr(.75),300:wr(.6),400:wr(.3),500:e=>e,600:Sr(.9),700:Sr(.6),800:Sr(.45),900:Sr(.3),950:Sr(.2)};function rc(e,t=vb){const n={},r=pb(e);for(const[i,o]of Object.entries(t))n[i]=mb(o(r));return n}const ic=()=>{const e={};return{on:(i,o)=>{var s;return e[i]||(e[i]=new Set),(s=e[i])==null||s.add(o),()=>{var a;return(a=e[i])==null?void 0:a.delete(o)}},emit:(i,o)=>{var s,a;(s=e[i])==null||s.forEach(l=>l(o)),(a=e["*"])==null||a.forEach(l=>l({type:i,payload:o}))},removeAllListeners:i=>{var o;i?(o=e[i])==null||o.clear():Object.keys(e).forEach(s=>{var a;(a=e[s])==null||a.clear()})}}};class bn extends Error{}class bb extends bn{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class wb extends bn{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Sb extends bn{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class xr extends bn{}class oc extends bn{constructor(t){super(`Invalid unit ${t}`)}}class vt extends bn{}class nn extends bn{constructor(){super("Zone is an abstract class")}}const ie="numeric",At="short",ht="long",ds={year:ie,month:ie,day:ie},sc={year:ie,month:At,day:ie},xb={year:ie,month:At,day:ie,weekday:At},ac={year:ie,month:ht,day:ie},lc={year:ie,month:ht,day:ie,weekday:ht},uc={hour:ie,minute:ie},cc={hour:ie,minute:ie,second:ie},fc={hour:ie,minute:ie,second:ie,timeZoneName:At},dc={hour:ie,minute:ie,second:ie,timeZoneName:ht},hc={hour:ie,minute:ie,hourCycle:"h23"},pc={hour:ie,minute:ie,second:ie,hourCycle:"h23"},mc={hour:ie,minute:ie,second:ie,hourCycle:"h23",timeZoneName:At},gc={hour:ie,minute:ie,second:ie,hourCycle:"h23",timeZoneName:ht},yc={year:ie,month:ie,day:ie,hour:ie,minute:ie},vc={year:ie,month:ie,day:ie,hour:ie,minute:ie,second:ie},bc={year:ie,month:At,day:ie,hour:ie,minute:ie},wc={year:ie,month:At,day:ie,hour:ie,minute:ie,second:ie},kb={year:ie,month:At,day:ie,weekday:At,hour:ie,minute:ie},Sc={year:ie,month:ht,day:ie,hour:ie,minute:ie,timeZoneName:At},xc={year:ie,month:ht,day:ie,hour:ie,minute:ie,second:ie,timeZoneName:At},kc={year:ie,month:ht,day:ie,weekday:ht,hour:ie,minute:ie,timeZoneName:ht},Ec={year:ie,month:ht,day:ie,weekday:ht,hour:ie,minute:ie,second:ie,timeZoneName:ht};function xe(e){return typeof e>"u"}function wn(e){return typeof e=="number"}function Si(e){return typeof e=="number"&&e%1===0}function Eb(e){return typeof e=="string"}function Cb(e){return Object.prototype.toString.call(e)==="[object Date]"}function Cc(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Ab(e){return Array.isArray(e)?e:[e]}function Ac(e,t,n){if(e.length!==0)return e.reduce((r,i)=>{const o=[t(i),i];return r&&n(r[0],o[0])===r[0]?r:o},null)[1]}function Tb(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function Fn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function qt(e,t,n){return Si(e)&&e>=t&&e<=n}function Ib(e,t){return e-t*Math.floor(e/t)}function Ve(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function rn(e){if(!(xe(e)||e===null||e===""))return parseInt(e,10)}function Sn(e){if(!(xe(e)||e===null||e===""))return parseFloat(e)}function hs(e){if(!(xe(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function ps(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function kr(e){return e%4===0&&(e%100!==0||e%400===0)}function Er(e){return kr(e)?366:365}function xi(e,t){const n=Ib(t-1,12)+1,r=e+(t-n)/12;return n===2?kr(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function ms(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(t.getUTCFullYear()-1900)),+t}function ki(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return t===4||r===3?53:52}function gs(e){return e>99?e:e>60?1900+e:2e3+e}function Tc(e,t,n,r=null){const i=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);const s={timeZoneName:t,...o},a=new Intl.DateTimeFormat(n,s).formatToParts(i).find(l=>l.type.toLowerCase()==="timezonename");return a?a.value:null}function Ei(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function Ic(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new vt(`Invalid unit value ${e}`);return t}function Ci(e,t){const n={};for(const r in e)if(Fn(e,r)){const i=e[r];if(i==null)continue;n[t(r)]=Ic(i)}return n}function Cr(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${Ve(n,2)}:${Ve(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${Ve(n,2)}${Ve(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Ai(e){return Tb(e,["hour","minute","second","millisecond"])}const Oc=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,Ob=["January","February","March","April","May","June","July","August","September","October","November","December"],Mc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Mb=["J","F","M","A","M","J","J","A","S","O","N","D"];function Dc(e){switch(e){case"narrow":return[...Mb];case"short":return[...Mc];case"long":return[...Ob];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Nc=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],_c=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Db=["M","T","W","T","F","S","S"];function Pc(e){switch(e){case"narrow":return[...Db];case"short":return[..._c];case"long":return[...Nc];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Lc=["AM","PM"],Nb=["Before Christ","Anno Domini"],_b=["BC","AD"],Pb=["B","A"];function Fc(e){switch(e){case"narrow":return[...Pb];case"short":return[..._b];case"long":return[...Nb];default:return null}}function Lb(e){return Lc[e.hour<12?0:1]}function Fb(e,t){return Pc(t)[e.weekday-1]}function Rb(e,t){return Dc(t)[e.month-1]}function $b(e,t){return Fc(t)[e.year<0?0:1]}function Bb(e,t,n="always",r=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&o){const c=e==="days";switch(t){case 1:return c?"tomorrow":`next ${i[e][0]}`;case-1:return c?"yesterday":`last ${i[e][0]}`;case 0:return c?"today":`this ${i[e][0]}`}}const s=Object.is(t,-0)||t<0,a=Math.abs(t),l=a===1,u=i[e],f=r?l?u[1]:u[2]||u[1]:l?i[e][0]:e;return s?`${a} ${f} ago`:`in ${a} ${f}`}function Rc(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const zb={D:ds,DD:sc,DDD:ac,DDDD:lc,t:uc,tt:cc,ttt:fc,tttt:dc,T:hc,TT:pc,TTT:mc,TTTT:gc,f:yc,ff:bc,fff:Sc,ffff:kc,F:vc,FF:wc,FFF:xc,FFFF:Ec};class lt{static create(t,n={}){return new lt(t,n)}static parseFormat(t){let n=null,r="",i=!1;const o=[];for(let s=0;s<t.length;s++){const a=t.charAt(s);a==="'"?(r.length>0&&o.push({literal:i,val:r}),n=null,r="",i=!i):i||a===n?r+=a:(r.length>0&&o.push({literal:!1,val:r}),r=a,n=a)}return r.length>0&&o.push({literal:i,val:r}),o}static macroTokenToFormatOpts(t){return zb[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTime(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTimeParts(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).formatToParts()}resolvedOptions(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).resolvedOptions()}num(t,n=0){if(this.opts.forceSimple)return Ve(t,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(d,m)=>this.loc.extract(t,d,m),s=d=>t.isOffsetFixed&&t.offset===0&&d.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,d.format):"",a=()=>r?Lb(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(d,m)=>r?Rb(t,d):o(m?{month:d}:{month:d,day:"numeric"},"month"),u=(d,m)=>r?Fb(t,d):o(m?{weekday:d}:{weekday:d,month:"long",day:"numeric"},"weekday"),f=d=>{const m=lt.macroTokenToFormatOpts(d);return m?this.formatWithSystemDefault(t,m):d},c=d=>r?$b(t,d):o({era:d},"era"),h=d=>{switch(d){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return a();case"d":return i?o({day:"numeric"},"day"):this.num(t.day);case"dd":return i?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return i?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return i?o({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return i?o({month:"numeric"},"month"):this.num(t.month);case"MM":return i?o({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return i?o({year:"numeric"},"year"):this.num(t.year);case"yy":return i?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return i?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return i?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return f(d)}};return Rc(lt.parseFormat(n),h)}formatDurationFromString(t,n){const r=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},i=l=>u=>{const f=r(u);return f?this.num(l.get(f),u.length):u},o=lt.parseFormat(n),s=o.reduce((l,{literal:u,val:f})=>u?l:l.concat(f),[]),a=t.shiftTo(...s.map(r).filter(l=>l));return Rc(o,i(a))}}class Tt{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Ar{get type(){throw new nn}get name(){throw new nn}get ianaName(){return this.name}get isUniversal(){throw new nn}offsetName(t,n){throw new nn}formatOffset(t,n){throw new nn}offset(t){throw new nn}equals(t){throw new nn}get isValid(){throw new nn}}let ys=null;class vs extends Ar{static get instance(){return ys===null&&(ys=new vs),ys}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Tc(t,n,r)}formatOffset(t,n){return Cr(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let Ti={};function Ub(e){return Ti[e]||(Ti[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Ti[e]}const Hb={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function jb(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,o,s,a,l,u,f]=r;return[s,i,o,a,l,u,f]}function Vb(e,t){const n=e.formatToParts(t),r=[];for(let i=0;i<n.length;i++){const{type:o,value:s}=n[i],a=Hb[o];o==="era"?r[a]=s:xe(a)||(r[a]=parseInt(s,10))}return r}let Ii={};class Yt extends Ar{static create(t){return Ii[t]||(Ii[t]=new Yt(t)),Ii[t]}static resetCache(){Ii={},Ti={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=Yt.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return Tc(t,n,r,this.name)}formatOffset(t,n){return Cr(this.offset(t),n)}offset(t){const n=new Date(t);if(isNaN(n))return NaN;const r=Ub(this.name);let[i,o,s,a,l,u,f]=r.formatToParts?Vb(r,n):jb(r,n);a==="BC"&&(i=-Math.abs(i)+1);const h=ms({year:i,month:o,day:s,hour:l===24?0:l,minute:u,second:f,millisecond:0});let d=+n;const m=d%1e3;return d-=m>=0?m:1e3+m,(h-d)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let bs=null;class it extends Ar{static get utcInstance(){return bs===null&&(bs=new it(0)),bs}static instance(t){return t===0?it.utcInstance:new it(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new it(Ei(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Cr(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Cr(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Cr(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class Wb extends Ar{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function on(e,t){if(xe(e)||e===null)return t;if(e instanceof Ar)return e;if(Eb(e)){const n=e.toLowerCase();return n==="local"||n==="system"?t:n==="utc"||n==="gmt"?it.utcInstance:it.parseSpecifier(n)||Yt.create(e)}else return wn(e)?it.instance(e):typeof e=="object"&&e.offset&&typeof e.offset=="number"?e:new Wb(e)}let $c=()=>Date.now(),Bc="system",zc=null,Uc=null,Hc=null,jc;class qe{static get now(){return $c}static set now(t){$c=t}static set defaultZone(t){Bc=t}static get defaultZone(){return on(Bc,vs.instance)}static get defaultLocale(){return zc}static set defaultLocale(t){zc=t}static get defaultNumberingSystem(){return Uc}static set defaultNumberingSystem(t){Uc=t}static get defaultOutputCalendar(){return Hc}static set defaultOutputCalendar(t){Hc=t}static get throwOnInvalid(){return jc}static set throwOnInvalid(t){jc=t}static resetCaches(){Re.resetCache(),Yt.resetCache()}}let Vc={};function qb(e,t={}){const n=JSON.stringify([e,t]);let r=Vc[n];return r||(r=new Intl.ListFormat(e,t),Vc[n]=r),r}let ws={};function Ss(e,t={}){const n=JSON.stringify([e,t]);let r=ws[n];return r||(r=new Intl.DateTimeFormat(e,t),ws[n]=r),r}let xs={};function Yb(e,t={}){const n=JSON.stringify([e,t]);let r=xs[n];return r||(r=new Intl.NumberFormat(e,t),xs[n]=r),r}let ks={};function Kb(e,t={}){const{base:n,...r}=t,i=JSON.stringify([e,r]);let o=ks[i];return o||(o=new Intl.RelativeTimeFormat(e,t),ks[i]=o),o}let Tr=null;function Gb(){return Tr||(Tr=new Intl.DateTimeFormat().resolvedOptions().locale,Tr)}function Qb(e){const t=e.indexOf("-u-");if(t===-1)return[e];{let n;const r=e.substring(0,t);try{n=Ss(e).resolvedOptions()}catch{n=Ss(r).resolvedOptions()}const{numberingSystem:i,calendar:o}=n;return[r,i,o]}}function Zb(e,t,n){return(n||t)&&(e+="-u",n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function Jb(e){const t=[];for(let n=1;n<=12;n++){const r=pe.utc(2016,n,1);t.push(e(r))}return t}function Xb(e){const t=[];for(let n=1;n<=7;n++){const r=pe.utc(2016,11,13+n);t.push(e(r))}return t}function Oi(e,t,n,r,i){const o=e.listingMode(n);return o==="error"?null:o==="en"?r(t):i(t)}function e0(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}class t0{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:i,floor:o,...s}=r;if(!n||Object.keys(s).length>0){const a={useGrouping:!1,...r};r.padTo>0&&(a.minimumIntegerDigits=r.padTo),this.inf=Yb(t,a)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):ps(t,3);return Ve(n,this.padTo)}}}class n0{constructor(t,n,r){this.opts=r;let i;if(t.zone.isUniversal){const s=-1*(t.offset/60),a=s>=0?`Etc/GMT+${s}`:`Etc/GMT${s}`;t.offset!==0&&Yt.create(a).valid?(i=a,this.dt=t):(i="UTC",r.timeZoneName?this.dt=t:this.dt=t.offset===0?t:pe.fromMillis(t.ts+t.offset*60*1e3))}else t.zone.type==="system"?this.dt=t:(this.dt=t,i=t.zone.name);const o={...this.opts};i&&(o.timeZone=i),this.dtf=Ss(n,o)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class r0{constructor(t,n,r){this.opts={style:"long",...r},!n&&Cc()&&(this.rtf=Kb(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):Bb(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}class Re{static fromOpts(t){return Re.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,n,r,i=!1){const o=t||qe.defaultLocale,s=o||(i?"en-US":Gb()),a=n||qe.defaultNumberingSystem,l=r||qe.defaultOutputCalendar;return new Re(s,a,l,o)}static resetCache(){Tr=null,ws={},xs={},ks={}}static fromObject({locale:t,numberingSystem:n,outputCalendar:r}={}){return Re.create(t,n,r)}constructor(t,n,r,i){const[o,s,a]=Qb(t);this.locale=o,this.numberingSystem=n||s||null,this.outputCalendar=r||a||null,this.intl=Zb(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=e0(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:Re.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1,r=!0){return Oi(this,t,r,Dc,()=>{const i=n?{month:t,day:"numeric"}:{month:t},o=n?"format":"standalone";return this.monthsCache[o][t]||(this.monthsCache[o][t]=Jb(s=>this.extract(s,i,"month"))),this.monthsCache[o][t]})}weekdays(t,n=!1,r=!0){return Oi(this,t,r,Pc,()=>{const i=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},o=n?"format":"standalone";return this.weekdaysCache[o][t]||(this.weekdaysCache[o][t]=Xb(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[o][t]})}meridiems(t=!0){return Oi(this,void 0,t,()=>Lc,()=>{if(!this.meridiemCache){const n={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[pe.utc(2016,11,13,9),pe.utc(2016,11,13,19)].map(r=>this.extract(r,n,"dayperiod"))}return this.meridiemCache})}eras(t,n=!0){return Oi(this,t,n,Fc,()=>{const r={era:t};return this.eraCache[t]||(this.eraCache[t]=[pe.utc(-40,1,1),pe.utc(2017,1,1)].map(i=>this.extract(i,r,"era"))),this.eraCache[t]})}extract(t,n,r){const i=this.dtFormatter(t,n),o=i.formatToParts(),s=o.find(a=>a.type.toLowerCase()===r);return s?s.value:null}numberFormatter(t={}){return new t0(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new n0(t,this.intl,n)}relFormatter(t={}){return new r0(this.intl,this.isEnglish(),t)}listFormatter(t={}){return qb(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}}function Rn(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function $n(...e){return t=>e.reduce(([n,r,i],o)=>{const[s,a,l]=o(t,i);return[{...n,...s},a||r,l]},[{},null,1]).slice(0,2)}function Bn(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const i=n.exec(e);if(i)return r(i)}return[null,null]}function Wc(...e){return(t,n)=>{const r={};let i;for(i=0;i<e.length;i++)r[e[i]]=rn(t[n+i]);return[r,null,n+i]}}const qc=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,i0=`(?:${qc.source}?(?:\\[(${Oc.source})\\])?)?`,Es=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Yc=RegExp(`${Es.source}${i0}`),Cs=RegExp(`(?:T${Yc.source})?`),o0=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,s0=/(\d{4})-?W(\d\d)(?:-?(\d))?/,a0=/(\d{4})-?(\d{3})/,l0=Wc("weekYear","weekNumber","weekDay"),u0=Wc("year","ordinal"),c0=/(\d{4})-(\d\d)-(\d\d)/,Kc=RegExp(`${Es.source} ?(?:${qc.source}|(${Oc.source}))?`),f0=RegExp(`(?: ${Kc.source})?`);function zn(e,t,n){const r=e[t];return xe(r)?n:rn(r)}function d0(e,t){return[{year:zn(e,t),month:zn(e,t+1,1),day:zn(e,t+2,1)},null,t+3]}function Un(e,t){return[{hours:zn(e,t,0),minutes:zn(e,t+1,0),seconds:zn(e,t+2,0),milliseconds:hs(e[t+3])},null,t+4]}function Ir(e,t){const n=!e[t]&&!e[t+1],r=Ei(e[t+1],e[t+2]),i=n?null:it.instance(r);return[{},i,t+3]}function Or(e,t){const n=e[t]?Yt.create(e[t]):null;return[{},n,t+1]}const h0=RegExp(`^T?${Es.source}$`),p0=/^-?P(?:(?:(-?\d{1,9}(?:\.\d{1,9})?)Y)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,9}(?:\.\d{1,9})?)W)?(?:(-?\d{1,9}(?:\.\d{1,9})?)D)?(?:T(?:(-?\d{1,9}(?:\.\d{1,9})?)H)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,9}))?S)?)?)$/;function m0(e){const[t,n,r,i,o,s,a,l,u]=e,f=t[0]==="-",c=l&&l[0]==="-",h=(d,m=!1)=>d!==void 0&&(m||d&&f)?-d:d;return[{years:h(Sn(n)),months:h(Sn(r)),weeks:h(Sn(i)),days:h(Sn(o)),hours:h(Sn(s)),minutes:h(Sn(a)),seconds:h(Sn(l),l==="-0"),milliseconds:h(hs(u),c)}]}const g0={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function As(e,t,n,r,i,o,s){const a={year:t.length===2?gs(rn(t)):rn(t),month:Mc.indexOf(n)+1,day:rn(r),hour:rn(i),minute:rn(o)};return s&&(a.second=rn(s)),e&&(a.weekday=e.length>3?Nc.indexOf(e)+1:_c.indexOf(e)+1),a}const y0=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function v0(e){const[,t,n,r,i,o,s,a,l,u,f,c]=e,h=As(t,i,r,n,o,s,a);let d;return l?d=g0[l]:u?d=0:d=Ei(f,c),[h,new it(d)]}function b0(e){return e.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const w0=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,S0=/^(Monday|Tuesday|Wedsday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,x0=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Gc(e){const[,t,n,r,i,o,s,a]=e;return[As(t,i,r,n,o,s,a),it.utcInstance]}function k0(e){const[,t,n,r,i,o,s,a]=e;return[As(t,a,n,r,i,o,s),it.utcInstance]}const E0=Rn(o0,Cs),C0=Rn(s0,Cs),A0=Rn(a0,Cs),T0=Rn(Yc),Qc=$n(d0,Un,Ir,Or),I0=$n(l0,Un,Ir,Or),O0=$n(u0,Un,Ir,Or),M0=$n(Un,Ir,Or);function D0(e){return Bn(e,[E0,Qc],[C0,I0],[A0,O0],[T0,M0])}function N0(e){return Bn(b0(e),[y0,v0])}function _0(e){return Bn(e,[w0,Gc],[S0,Gc],[x0,k0])}function P0(e){return Bn(e,[p0,m0])}const L0=$n(Un);function F0(e){return Bn(e,[h0,L0])}const R0=Rn(c0,f0),$0=Rn(Kc),B0=$n(Un,Ir,Or);function z0(e){return Bn(e,[R0,Qc],[$0,B0])}const U0="Invalid Duration",Zc={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},H0={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Zc},bt=146097/400,Hn=146097/4800,j0={years:{quarters:4,months:12,weeks:bt/7,days:bt,hours:bt*24,minutes:bt*24*60,seconds:bt*24*60*60,milliseconds:bt*24*60*60*1e3},quarters:{months:3,weeks:bt/28,days:bt/4,hours:bt*24/4,minutes:bt*24*60/4,seconds:bt*24*60*60/4,milliseconds:bt*24*60*60*1e3/4},months:{weeks:Hn/7,days:Hn,hours:Hn*24,minutes:Hn*24*60,seconds:Hn*24*60*60,milliseconds:Hn*24*60*60*1e3},...Zc},xn=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],V0=xn.slice(0).reverse();function kn(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy};return new Ee(r)}function W0(e){return e<0?Math.floor(e):Math.ceil(e)}function Jc(e,t,n,r,i){const o=e[i][n],s=t[n]/o,a=Math.sign(s)===Math.sign(r[i]),l=!a&&r[i]!==0&&Math.abs(s)<=1?W0(s):Math.trunc(s);r[i]+=l,t[n]-=l*o}function q0(e,t){V0.reduce((n,r)=>xe(t[r])?n:(n&&Jc(e,t,n,t,r),r),null)}class Ee{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;this.values=t.values,this.loc=t.loc||Re.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=n?j0:H0,this.isLuxonDuration=!0}static fromMillis(t,n){return Ee.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new vt(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Ee({values:Ci(t,Ee.normalizeUnit),loc:Re.fromObject(n),conversionAccuracy:n.conversionAccuracy})}static fromDurationLike(t){if(wn(t))return Ee.fromMillis(t);if(Ee.isDuration(t))return t;if(typeof t=="object")return Ee.fromObject(t);throw new vt(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=P0(t);return r?Ee.fromObject(r,n):Ee.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=F0(t);return r?Ee.fromObject(r,n):Ee.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new vt("need to specify a reason the Duration is invalid");const r=t instanceof Tt?t:new Tt(t,n);if(qe.throwOnInvalid)throw new Sb(r);return new Ee({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new oc(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?lt.create(this.loc,r).formatDurationFromString(this,t):U0}toHuman(t={}){const n=xn.map(r=>{const i=this.values[r];return xe(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(i)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=ps(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();if(n<0||n>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t};const r=this.shiftTo("hours","minutes","seconds","milliseconds");let i=t.format==="basic"?"hhmm":"hh:mm";(!t.suppressSeconds||r.seconds!==0||r.milliseconds!==0)&&(i+=t.format==="basic"?"ss":":ss",(!t.suppressMilliseconds||r.milliseconds!==0)&&(i+=".SSS"));let o=r.toFormat(i);return t.includePrefix&&(o="T"+o),o}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t),r={};for(const i of xn)(Fn(n.values,i)||Fn(this.values,i))&&(r[i]=n.get(i)+this.get(i));return kn(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=Ic(t(this.values[r],r));return kn(this,{values:n},!0)}get(t){return this[Ee.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...Ci(t,Ee.normalizeUnit)};return kn(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r}={}){const i=this.loc.clone({locale:t,numberingSystem:n}),o={loc:i};return r&&(o.conversionAccuracy=r),kn(this,o)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return q0(this.matrix,t),kn(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(s=>Ee.normalizeUnit(s));const n={},r={},i=this.toObject();let o;for(const s of xn)if(t.indexOf(s)>=0){o=s;let a=0;for(const u in r)a+=this.matrix[u][s]*r[u],r[u]=0;wn(i[s])&&(a+=i[s]);const l=Math.trunc(a);n[s]=l,r[s]=(a*1e3-l*1e3)/1e3;for(const u in i)xn.indexOf(u)>xn.indexOf(s)&&Jc(this.matrix,i,u,n,s)}else wn(i[s])&&(r[s]=i[s]);for(const s in r)r[s]!==0&&(n[o]+=s===o?r[s]:r[s]/this.matrix[o][s]);return kn(this,{values:n},!0).normalize()}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return kn(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,i){return r===void 0||r===0?i===void 0||i===0:r===i}for(const r of xn)if(!n(this.values[r],t.values[r]))return!1;return!0}}const Mr="Invalid Interval";function Y0(e,t){return!e||!e.isValid?ze.invalid("missing or invalid start"):!t||!t.isValid?ze.invalid("missing or invalid end"):t<e?ze.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class ze{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new vt("need to specify a reason the Interval is invalid");const r=t instanceof Tt?t:new Tt(t,n);if(qe.throwOnInvalid)throw new wb(r);return new ze({invalid:r})}static fromDateTimes(t,n){const r=_r(t),i=_r(n),o=Y0(r,i);return o??new ze({start:r,end:i})}static after(t,n){const r=Ee.fromDurationLike(n),i=_r(t);return ze.fromDateTimes(i,i.plus(r))}static before(t,n){const r=Ee.fromDurationLike(n),i=_r(t);return ze.fromDateTimes(i.minus(r),i)}static fromISO(t,n){const[r,i]=(t||"").split("/",2);if(r&&i){let o,s;try{o=pe.fromISO(r,n),s=o.isValid}catch{s=!1}let a,l;try{a=pe.fromISO(i,n),l=a.isValid}catch{l=!1}if(s&&l)return ze.fromDateTimes(o,a);if(s){const u=Ee.fromISO(i,n);if(u.isValid)return ze.after(o,u)}else if(l){const u=Ee.fromISO(r,n);if(u.isValid)return ze.before(a,u)}}return ze.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds"){if(!this.isValid)return NaN;const n=this.start.startOf(t),r=this.end.startOf(t);return Math.floor(r.diff(n,t).get(t))+1}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?ze.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(_r).filter(s=>this.contains(s)).sort(),r=[];let{s:i}=this,o=0;for(;i<this.e;){const s=n[o]||this.e,a=+s>+this.e?this.e:s;r.push(ze.fromDateTimes(i,a)),i=a,o+=1}return r}splitBy(t){const n=Ee.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,i=1,o;const s=[];for(;r<this.e;){const a=this.start.plus(n.mapUnits(l=>l*i));o=+a>+this.e?this.e:a,s.push(ze.fromDateTimes(r,o)),r=o,i+=1}return s}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:ze.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return ze.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((i,o)=>i.s-o.s).reduce(([i,o],s)=>o?o.overlaps(s)||o.abutsStart(s)?[i,o.union(s)]:[i.concat([o]),s]:[i,s],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const i=[],o=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),s=Array.prototype.concat(...o),a=s.sort((l,u)=>l.time-u.time);for(const l of a)r+=l.type==="s"?1:-1,r===1?n=l.time:(n&&+n!=+l.time&&i.push(ze.fromDateTimes(n,l.time)),n=null);return ze.merge(i)}difference(...t){return ze.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Mr}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:Mr}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Mr}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:Mr}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:Mr}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):Ee.invalid(this.invalidReason)}mapEndpoints(t){return ze.fromDateTimes(t(this.s),t(this.e))}}let Mi=class{static hasDST(t=qe.defaultZone){const n=pe.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return Yt.isValidZone(t)}static normalizeZone(t){return on(t,qe.defaultZone)}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Re.create(n,r,o)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:o="gregory"}={}){return(i||Re.create(n,r,o)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||Re.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||Re.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Re.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return Re.create(n,null,"gregory").eras(t)}static features(){return{relative:Cc()}}};function Xc(e,t){const n=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Ee.fromMillis(r).as("days"))}function K0(e,t,n){const r=[["years",(a,l)=>l.year-a.year],["quarters",(a,l)=>l.quarter-a.quarter],["months",(a,l)=>l.month-a.month+(l.year-a.year)*12],["weeks",(a,l)=>{const u=Xc(a,l);return(u-u%7)/7}],["days",Xc]],i={};let o,s;for(const[a,l]of r)if(n.indexOf(a)>=0){o=a;let u=l(e,t);s=e.plus({[a]:u}),s>t?(e=e.plus({[a]:u-1}),u-=1):e=s,i[a]=u}return[e,i,s,o]}function G0(e,t,n,r){let[i,o,s,a]=K0(e,t,n);const l=t-i,u=n.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(s<t&&(s=i.plus({[a]:1})),s!==i&&(o[a]=(o[a]||0)+l/(s-i)));const f=Ee.fromObject(o,r);return u.length>0?Ee.fromMillis(l,r).shiftTo(...u).plus(f):f}const Ts={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},ef={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Q0=Ts.hanidec.replace(/[\[|\]]/g,"").split("");function Z0(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(e[n].search(Ts.hanidec)!==-1)t+=Q0.indexOf(e[n]);else for(const i in ef){const[o,s]=ef[i];r>=o&&r<=s&&(t+=r-o)}}return parseInt(t,10)}else return t}function It({numberingSystem:e},t=""){return new RegExp(`${Ts[e||"latn"]}${t}`)}const J0="missing Intl.DateTimeFormat.formatToParts support";function Ce(e,t=n=>n){return{regex:e,deser:([n])=>t(Z0(n))}}const tf="[  ]",nf=new RegExp(tf,"g");function X0(e){return e.replace(/\./g,"\\.?").replace(nf,tf)}function rf(e){return e.replace(/\./g,"").replace(nf," ").toLowerCase()}function Ot(e,t){return e===null?null:{regex:RegExp(e.map(X0).join("|")),deser:([n])=>e.findIndex(r=>rf(n)===rf(r))+t}}function of(e,t){return{regex:e,deser:([,n,r])=>Ei(n,r),groups:t}}function Is(e){return{regex:e,deser:([t])=>t}}function ew(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function tw(e,t){const n=It(t),r=It(t,"{2}"),i=It(t,"{3}"),o=It(t,"{4}"),s=It(t,"{6}"),a=It(t,"{1,2}"),l=It(t,"{1,3}"),u=It(t,"{1,6}"),f=It(t,"{1,9}"),c=It(t,"{2,4}"),h=It(t,"{4,6}"),d=g=>({regex:RegExp(ew(g.val)),deser:([v])=>v,literal:!0}),p=(g=>{if(e.literal)return d(g);switch(g.val){case"G":return Ot(t.eras("short",!1),0);case"GG":return Ot(t.eras("long",!1),0);case"y":return Ce(u);case"yy":return Ce(c,gs);case"yyyy":return Ce(o);case"yyyyy":return Ce(h);case"yyyyyy":return Ce(s);case"M":return Ce(a);case"MM":return Ce(r);case"MMM":return Ot(t.months("short",!0,!1),1);case"MMMM":return Ot(t.months("long",!0,!1),1);case"L":return Ce(a);case"LL":return Ce(r);case"LLL":return Ot(t.months("short",!1,!1),1);case"LLLL":return Ot(t.months("long",!1,!1),1);case"d":return Ce(a);case"dd":return Ce(r);case"o":return Ce(l);case"ooo":return Ce(i);case"HH":return Ce(r);case"H":return Ce(a);case"hh":return Ce(r);case"h":return Ce(a);case"mm":return Ce(r);case"m":return Ce(a);case"q":return Ce(a);case"qq":return Ce(r);case"s":return Ce(a);case"ss":return Ce(r);case"S":return Ce(l);case"SSS":return Ce(i);case"u":return Is(f);case"uu":return Is(a);case"uuu":return Ce(n);case"a":return Ot(t.meridiems(),0);case"kkkk":return Ce(o);case"kk":return Ce(c,gs);case"W":return Ce(a);case"WW":return Ce(r);case"E":case"c":return Ce(n);case"EEE":return Ot(t.weekdays("short",!1,!1),1);case"EEEE":return Ot(t.weekdays("long",!1,!1),1);case"ccc":return Ot(t.weekdays("short",!0,!1),1);case"cccc":return Ot(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return of(new RegExp(`([+-]${a.source})(?::(${r.source}))?`),2);case"ZZZ":return of(new RegExp(`([+-]${a.source})(${r.source})?`),2);case"z":return Is(/[a-z_+-/]{1,256}?/i);default:return d(g)}})(e)||{invalidReason:J0};return p.token=e,p}const nw={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};function rw(e,t,n){const{type:r,value:i}=e;if(r==="literal")return{literal:!0,val:i};const o=n[r];let s=nw[r];if(typeof s=="object"&&(s=s[o]),s)return{literal:!1,val:s}}function iw(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function ow(e,t,n){const r=e.match(t);if(r){const i={};let o=1;for(const s in n)if(Fn(n,s)){const a=n[s],l=a.groups?a.groups+1:1;!a.literal&&a.token&&(i[a.token.val[0]]=a.deser(r.slice(o,o+l))),o+=l}return[r,i]}else return[r,{}]}function sw(e){const t=o=>{switch(o){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return xe(e.z)||(n=Yt.create(e.z)),xe(e.Z)||(n||(n=new it(e.Z)),r=e.Z),xe(e.q)||(e.M=(e.q-1)*3+1),xe(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),xe(e.u)||(e.S=hs(e.u)),[Object.keys(e).reduce((o,s)=>{const a=t(s);return a&&(o[a]=e[s]),o},{}),n,r]}let Os=null;function aw(){return Os||(Os=pe.fromMillis(1555555555555)),Os}function lw(e,t){if(e.literal)return e;const n=lt.macroTokenToFormatOpts(e.val);if(!n)return e;const o=lt.create(t,n).formatDateTimeParts(aw()).map(s=>rw(s,t,n));return o.includes(void 0)?e:o}function uw(e,t){return Array.prototype.concat(...e.map(n=>lw(n,t)))}function sf(e,t,n){const r=uw(lt.parseFormat(n),e),i=r.map(s=>tw(s,e)),o=i.find(s=>s.invalidReason);if(o)return{input:t,tokens:r,invalidReason:o.invalidReason};{const[s,a]=iw(i),l=RegExp(s,"i"),[u,f]=ow(t,l,a),[c,h,d]=f?sw(f):[null,null,void 0];if(Fn(f,"a")&&Fn(f,"H"))throw new xr("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:l,rawMatches:u,matches:f,result:c,zone:h,specificOffset:d}}}function cw(e,t,n){const{result:r,zone:i,specificOffset:o,invalidReason:s}=sf(e,t,n);return[r,i,o,s]}const af=[0,31,59,90,120,151,181,212,243,273,304,334],lf=[0,31,60,91,121,152,182,213,244,274,305,335];function wt(e,t){return new Tt("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function uf(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const i=r.getUTCDay();return i===0?7:i}function cf(e,t,n){return n+(kr(e)?lf:af)[t-1]}function ff(e,t){const n=kr(e)?lf:af,r=n.findIndex(o=>o<t),i=t-n[r];return{month:r+1,day:i}}function Ms(e){const{year:t,month:n,day:r}=e,i=cf(t,n,r),o=uf(t,n,r);let s=Math.floor((i-o+10)/7),a;return s<1?(a=t-1,s=ki(a)):s>ki(t)?(a=t+1,s=1):a=t,{weekYear:a,weekNumber:s,weekday:o,...Ai(e)}}function df(e){const{weekYear:t,weekNumber:n,weekday:r}=e,i=uf(t,1,4),o=Er(t);let s=n*7+r-i-3,a;s<1?(a=t-1,s+=Er(a)):s>o?(a=t+1,s-=Er(t)):a=t;const{month:l,day:u}=ff(a,s);return{year:a,month:l,day:u,...Ai(e)}}function Ds(e){const{year:t,month:n,day:r}=e,i=cf(t,n,r);return{year:t,ordinal:i,...Ai(e)}}function hf(e){const{year:t,ordinal:n}=e,{month:r,day:i}=ff(t,n);return{year:t,month:r,day:i,...Ai(e)}}function fw(e){const t=Si(e.weekYear),n=qt(e.weekNumber,1,ki(e.weekYear)),r=qt(e.weekday,1,7);return t?n?r?!1:wt("weekday",e.weekday):wt("week",e.week):wt("weekYear",e.weekYear)}function dw(e){const t=Si(e.year),n=qt(e.ordinal,1,Er(e.year));return t?n?!1:wt("ordinal",e.ordinal):wt("year",e.year)}function pf(e){const t=Si(e.year),n=qt(e.month,1,12),r=qt(e.day,1,xi(e.year,e.month));return t?n?r?!1:wt("day",e.day):wt("month",e.month):wt("year",e.year)}function mf(e){const{hour:t,minute:n,second:r,millisecond:i}=e,o=qt(t,0,23)||t===24&&n===0&&r===0&&i===0,s=qt(n,0,59),a=qt(r,0,59),l=qt(i,0,999);return o?s?a?l?!1:wt("millisecond",i):wt("second",r):wt("minute",n):wt("hour",t)}const Ns="Invalid DateTime",gf=864e13;function Di(e){return new Tt("unsupported zone",`the zone "${e.name}" is not supported`)}function _s(e){return e.weekData===null&&(e.weekData=Ms(e.c)),e.weekData}function Dr(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new pe({...n,...t,old:n})}function yf(e,t,n){let r=e-t*60*1e3;const i=n.offset(r);if(t===i)return[r,t];r-=(i-t)*60*1e3;const o=n.offset(r);return i===o?[r,i]:[e-Math.min(i,o)*60*1e3,Math.max(i,o)]}function vf(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Ni(e,t,n){return yf(ms(e),t,n)}function bf(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,o={...e.c,year:r,month:i,day:Math.min(e.c.day,xi(r,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},s=Ee.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=ms(o);let[l,u]=yf(a,n,e.zone);return s!==0&&(l+=s,u=e.zone.offset(l)),{ts:l,o:u}}function Nr(e,t,n,r,i,o){const{setZone:s,zone:a}=n;if(e&&Object.keys(e).length!==0){const l=t||a,u=pe.fromObject(e,{...n,zone:l,specificOffset:o});return s?u:u.setZone(a)}else return pe.invalid(new Tt("unparsable",`the input "${i}" can't be parsed as ${r}`))}function _i(e,t,n=!0){return e.isValid?lt.create(Re.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function Ps(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=Ve(e.c.year,n?6:4),t?(r+="-",r+=Ve(e.c.month),r+="-",r+=Ve(e.c.day)):(r+=Ve(e.c.month),r+=Ve(e.c.day)),r}function wf(e,t,n,r,i,o){let s=Ve(e.c.hour);return t?(s+=":",s+=Ve(e.c.minute),(e.c.second!==0||!n)&&(s+=":")):s+=Ve(e.c.minute),(e.c.second!==0||!n)&&(s+=Ve(e.c.second),(e.c.millisecond!==0||!r)&&(s+=".",s+=Ve(e.c.millisecond,3))),i&&(e.isOffsetFixed&&e.offset===0&&!o?s+="Z":e.o<0?(s+="-",s+=Ve(Math.trunc(-e.o/60)),s+=":",s+=Ve(Math.trunc(-e.o%60))):(s+="+",s+=Ve(Math.trunc(e.o/60)),s+=":",s+=Ve(Math.trunc(e.o%60)))),o&&(s+="["+e.zone.ianaName+"]"),s}const Sf={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},hw={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},pw={ordinal:1,hour:0,minute:0,second:0,millisecond:0},xf=["year","month","day","hour","minute","second","millisecond"],mw=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],gw=["year","ordinal","hour","minute","second","millisecond"];function kf(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new oc(e);return t}function Ef(e,t){const n=on(t.zone,qe.defaultZone),r=Re.fromObject(t),i=qe.now();let o,s;if(xe(e.year))o=i;else{for(const u of xf)xe(e[u])&&(e[u]=Sf[u]);const a=pf(e)||mf(e);if(a)return pe.invalid(a);const l=n.offset(i);[o,s]=Ni(e,l,n)}return new pe({ts:o,zone:n,loc:r,o:s})}function Cf(e,t,n){const r=xe(n.round)?!0:n.round,i=(s,a)=>(s=ps(s,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(s,a)),o=s=>n.calendary?t.hasSame(e,s)?0:t.startOf(s).diff(e.startOf(s),s).get(s):t.diff(e,s).get(s);if(n.unit)return i(o(n.unit),n.unit);for(const s of n.units){const a=o(s);if(Math.abs(a)>=1)return i(a,s)}return i(e>t?-0:0,n.units[n.units.length-1])}function Af(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}class pe{constructor(t){const n=t.zone||qe.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new Tt("invalid input"):null)||(n.isValid?null:Di(n));this.ts=xe(t.ts)?qe.now():t.ts;let i=null,o=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[i,o]=[t.old.c,t.old.o];else{const a=n.offset(this.ts);i=vf(this.ts,a),r=Number.isNaN(i.year)?new Tt("invalid input"):null,i=r?null:i,o=r?null:a}this._zone=n,this.loc=t.loc||Re.create(),this.invalid=r,this.weekData=null,this.c=i,this.o=o,this.isLuxonDateTime=!0}static now(){return new pe({})}static local(){const[t,n]=Af(arguments),[r,i,o,s,a,l,u]=n;return Ef({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:u},t)}static utc(){const[t,n]=Af(arguments),[r,i,o,s,a,l,u]=n;return t.zone=it.utcInstance,Ef({year:r,month:i,day:o,hour:s,minute:a,second:l,millisecond:u},t)}static fromJSDate(t,n={}){const r=Cb(t)?t.valueOf():NaN;if(Number.isNaN(r))return pe.invalid("invalid input");const i=on(n.zone,qe.defaultZone);return i.isValid?new pe({ts:r,zone:i,loc:Re.fromObject(n)}):pe.invalid(Di(i))}static fromMillis(t,n={}){if(wn(t))return t<-gf||t>gf?pe.invalid("Timestamp out of range"):new pe({ts:t,zone:on(n.zone,qe.defaultZone),loc:Re.fromObject(n)});throw new vt(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(wn(t))return new pe({ts:t*1e3,zone:on(n.zone,qe.defaultZone),loc:Re.fromObject(n)});throw new vt("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=on(n.zone,qe.defaultZone);if(!r.isValid)return pe.invalid(Di(r));const i=qe.now(),o=xe(n.specificOffset)?r.offset(i):n.specificOffset,s=Ci(t,kf),a=!xe(s.ordinal),l=!xe(s.year),u=!xe(s.month)||!xe(s.day),f=l||u,c=s.weekYear||s.weekNumber,h=Re.fromObject(n);if((f||a)&&c)throw new xr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&a)throw new xr("Can't mix ordinal dates with month/day");const d=c||s.weekday&&!f;let m,p,g=vf(i,o);d?(m=mw,p=hw,g=Ms(g)):a?(m=gw,p=pw,g=Ds(g)):(m=xf,p=Sf);let v=!1;for(const D of m){const P=s[D];xe(P)?v?s[D]=p[D]:s[D]=g[D]:v=!0}const y=d?fw(s):a?dw(s):pf(s),w=y||mf(s);if(w)return pe.invalid(w);const C=d?df(s):a?hf(s):s,[k,E]=Ni(C,o,r),I=new pe({ts:k,zone:r,o:E,loc:h});return s.weekday&&f&&t.weekday!==I.weekday?pe.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${I.toISO()}`):I}static fromISO(t,n={}){const[r,i]=D0(t);return Nr(r,i,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,i]=N0(t);return Nr(r,i,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,i]=_0(t);return Nr(r,i,n,"HTTP",n)}static fromFormat(t,n,r={}){if(xe(t)||xe(n))throw new vt("fromFormat requires an input string and a format");const{locale:i=null,numberingSystem:o=null}=r,s=Re.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0}),[a,l,u,f]=cw(s,t,n);return f?pe.invalid(f):Nr(a,l,r,`format ${n}`,t,u)}static fromString(t,n,r={}){return pe.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,i]=z0(t);return Nr(r,i,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new vt("need to specify a reason the DateTime is invalid");const r=t instanceof Tt?t:new Tt(t,n);if(qe.throwOnInvalid)throw new bb(r);return new pe({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?_s(this).weekYear:NaN}get weekNumber(){return this.isValid?_s(this).weekNumber:NaN}get weekday(){return this.isValid?_s(this).weekday:NaN}get ordinal(){return this.isValid?Ds(this.c).ordinal:NaN}get monthShort(){return this.isValid?Mi.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Mi.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Mi.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Mi.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return kr(this.year)}get daysInMonth(){return xi(this.year,this.month)}get daysInYear(){return this.isValid?Er(this.year):NaN}get weeksInWeekYear(){return this.isValid?ki(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:i}=lt.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:i}}toUTC(t=0,n={}){return this.setZone(it.instance(t),n)}toLocal(){return this.setZone(qe.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=on(t,qe.defaultZone),t.equals(this.zone))return this;if(t.isValid){let i=this.ts;if(n||r){const o=t.offset(this.ts),s=this.toObject();[i]=Ni(s,o,t)}return Dr(this,{ts:i,zone:t})}else return pe.invalid(Di(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const i=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return Dr(this,{loc:i})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=Ci(t,kf),r=!xe(n.weekYear)||!xe(n.weekNumber)||!xe(n.weekday),i=!xe(n.ordinal),o=!xe(n.year),s=!xe(n.month)||!xe(n.day),a=o||s,l=n.weekYear||n.weekNumber;if((a||i)&&l)throw new xr("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(s&&i)throw new xr("Can't mix ordinal dates with month/day");let u;r?u=df({...Ms(this.c),...n}):xe(n.ordinal)?(u={...this.toObject(),...n},xe(n.day)&&(u.day=Math.min(xi(u.year,u.month),u.day))):u=hf({...Ds(this.c),...n});const[f,c]=Ni(u,this.o,this.zone);return Dr(this,{ts:f,o:c})}plus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t);return Dr(this,bf(this,n))}minus(t){if(!this.isValid)return this;const n=Ee.fromDurationLike(t).negate();return Dr(this,bf(this,n))}startOf(t){if(!this.isValid)return this;const n={},r=Ee.normalizeUnit(t);switch(r){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(r==="weeks"&&(n.weekday=1),r==="quarters"){const i=Math.ceil(this.month/3);n.month=(i-1)*3+1}return this.set(n)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,n={}){return this.isValid?lt.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):Ns}toLocaleString(t=ds,n={}){return this.isValid?lt.create(this.loc.clone(n),t).formatDateTime(this):Ns}toLocaleParts(t={}){return this.isValid?lt.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:i=!0,extendedZone:o=!1}={}){if(!this.isValid)return null;const s=t==="extended";let a=Ps(this,s);return a+="T",a+=wf(this,s,n,r,i,o),a}toISODate({format:t="extended"}={}){return this.isValid?Ps(this,t==="extended"):null}toISOWeekDate(){return _i(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:i=!1,extendedZone:o=!1,format:s="extended"}={}){return this.isValid?(i?"T":"")+wf(this,s==="extended",n,t,r,o):null}toRFC2822(){return _i(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return _i(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Ps(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let i="HH:mm:ss.SSS";return(n||t)&&(r&&(i+=" "),n?i+="z":t&&(i+="ZZ")),_i(this,i,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():Ns}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return Ee.invalid("created by diffing an invalid DateTime");const i={locale:this.locale,numberingSystem:this.numberingSystem,...r},o=Ab(n).map(Ee.normalizeUnit),s=t.valueOf()>this.valueOf(),a=s?this:t,l=s?t:this,u=G0(a,l,o,i);return s?u.negate():u}diffNow(t="milliseconds",n={}){return this.diff(pe.now(),t,n)}until(t){return this.isValid?ze.fromDateTimes(this,t):this}hasSame(t,n){if(!this.isValid)return!1;const r=t.valueOf(),i=this.setZone(t.zone,{keepLocalTime:!0});return i.startOf(n)<=r&&r<=i.endOf(n)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||pe.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let i=["years","months","days","hours","minutes","seconds"],o=t.unit;return Array.isArray(t.unit)&&(i=t.unit,o=void 0),Cf(n,this.plus(r),{...t,numeric:"always",units:i,unit:o})}toRelativeCalendar(t={}){return this.isValid?Cf(t.base||pe.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(pe.isDateTime))throw new vt("min requires all arguments be DateTimes");return Ac(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(pe.isDateTime))throw new vt("max requires all arguments be DateTimes");return Ac(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:i=null,numberingSystem:o=null}=r,s=Re.fromOpts({locale:i,numberingSystem:o,defaultToEN:!0});return sf(s,t,n)}static fromStringExplain(t,n,r={}){return pe.fromFormatExplain(t,n,r)}static get DATE_SHORT(){return ds}static get DATE_MED(){return sc}static get DATE_MED_WITH_WEEKDAY(){return xb}static get DATE_FULL(){return ac}static get DATE_HUGE(){return lc}static get TIME_SIMPLE(){return uc}static get TIME_WITH_SECONDS(){return cc}static get TIME_WITH_SHORT_OFFSET(){return fc}static get TIME_WITH_LONG_OFFSET(){return dc}static get TIME_24_SIMPLE(){return hc}static get TIME_24_WITH_SECONDS(){return pc}static get TIME_24_WITH_SHORT_OFFSET(){return mc}static get TIME_24_WITH_LONG_OFFSET(){return gc}static get DATETIME_SHORT(){return yc}static get DATETIME_SHORT_WITH_SECONDS(){return vc}static get DATETIME_MED(){return bc}static get DATETIME_MED_WITH_SECONDS(){return wc}static get DATETIME_MED_WITH_WEEKDAY(){return kb}static get DATETIME_FULL(){return Sc}static get DATETIME_FULL_WITH_SECONDS(){return xc}static get DATETIME_HUGE(){return kc}static get DATETIME_HUGE_WITH_SECONDS(){return Ec}}function _r(e){if(pe.isDateTime(e))return e;if(e&&e.valueOf&&wn(e.valueOf()))return pe.fromJSDate(e);if(e&&typeof e=="object")return pe.fromObject(e);throw new vt(`Unknown datetime argument: ${e}, of type ${typeof e}`)}function yw(e){const t=typeof e=="string"?pe.fromISO(e):pe.fromJSDate(e);if(!t.isValid)return"Invalid date";const r=pe.now().diff(t,["years","months","days","hours","minutes"]).toObject();return r.years&&r.years>=1?`${Math.floor(r.years)} year${Math.floor(r.years)>1?"s":""} ago`:r.months&&r.months>=1?`${Math.floor(r.months)} month${Math.floor(r.months)>1?"s":""} ago`:r.days&&r.days>=1?`${Math.floor(r.days)} day${Math.floor(r.days)>1?"s":""} ago`:r.hours&&r.hours>=1?`${Math.floor(r.hours)}h ago`:r.minutes&&r.minutes>=1?`${Math.floor(r.minutes)}m ago`:"just now"}function Ls(e){if(!/^#?([a-fA-F\d]{6}|[a-fA-F\d]{3})$/.test(e))return{r:0,g:0,b:0};const n=e.replace(/^#/,"");let r=n;n.length===3&&(r=n.split("").map(l=>l+l).join(""));const i=parseInt(r,16),o=i>>16&255,s=i>>8&255,a=i&255;return{r:o,g:s,b:a}}function vw(e){return`#${((1<<24)+(e.r<<16)+(e.g<<8)+e.b).toString(16).slice(1)}`}const bw=(e,t=30)=>{const n=Math.min(e.r,e.g,e.b),r=Math.max(e.r,e.g,e.b,n+1);return{r:Math.floor((e.r-n)/(r-n)*t*(1-.299)+120-t/2),g:Math.floor((e.g-n)/(r-n)*t*(1-.587)+120-t/2),b:Math.floor((e.b-n)/(r-n)*t*(1-.114)+120-t/2)}};function Tf(e){return Object.entries(e).reduce((t,[n,r])=>{const i=n.replace(/(\d+)/,o=>(1e3-parseInt(o)).toString());return{...t,[i]:r}},{})}const ww=2.4,Sw=.2126729,xw=.7151522,kw=.072175,Ew=.56,Cw=.57,Aw=.62,Tw=.65,Pi=.022,If=1.414,Iw=1.14,Ow=1.14,Mw=.035991,Dw=27.7847239587675,Nw=27.7847239587675,Of=.027,Mf=.027,Df=.001,_w=5e-4;function Nf(e){const{r:t,g:n,b:r}=e,i=o=>(o/255)**ww;return Sw*i(t)+xw*i(n)+kw*i(r)}function _f(e,t){if(!e||!t)return 0;let n=Nf(Ls(e)),r=Nf(Ls(t)),i=0,o=0;return n=n>Pi?n:n+(Pi-n)**If,r=r>Pi?r:r+(Pi-r)**If,Math.abs(r-n)<_w?0:(r>n?(i=(r**Ew-n**Cw)*Iw,o=i<Df?0:i<Mw?i-i*Dw*Of:i-Of):(i=(r**Tw-n**Aw)*Ow,o=i>-Df?0:i>-.035991?i-i*Nw*Mf:i+Mf),Math.abs(o*100))}const Pw=(e,t,n)=>{const r=e;let i=0;for(;t.some(o=>n(o)===e);)i+=1,e=`${r} (${i})`;return e};function Pf(e){const{fontFamily:t,...n}=e,r=Lf(n);return Gu(".bpReset",{...r,"font-family":`'${t}', sans-serif`})+Gu(":host, :root",{...r})}function Lf(e){const{radius:t,themeMode:n,color:r,variant:i,headerVariant:o}=e;let s={},a={};if(r){const h=rc(r),d=n==="dark"?Tf(h):h,m=rc(vw(bw(Ls(r)))),p=n==="dark"?Tf(m):m,g=n==="dark"?"#101010":"#fdfdfd";a=Object.entries({...d,1:g}).reduce((y,[w,C])=>({...y,[`--bpPrimary-${w}`]:C}),{});const v=Object.entries({...p,1:g}).reduce((y,[w,C])=>({...y,[`--bpGray-${w}`]:C}),{});s={...a,...v}}t&&(s={...s,"--bpRadius-scale":t.toString()});const l=n==="dark"?{bg:"var(--transparent-dark)",bgHover:"var(--transparent-dark-hover)"}:{bg:"var(--transparent-light)",bgHover:"var(--transparent-light-hover)"},u=a?_f(a["--bpPrimary-600"],a["--bpPrimary-50"])>40?"var(--bpPrimary-50)":"var(--bpPrimary-900)":"var(--bpPrimary-50)",f=i==="solid"?{"--message-bg":"var(--bpPrimary-600)","--message-bg-hover":"var(--bpPrimary-700)","--message-text":u,"--send-button-bg":"var(--bpPrimary-600)","--send-button-bg-hover":"var(--bpPrimary-700)","--send-button-text":"var(--bpPrimary-50)","--button-bg":"var(--bpPrimary-200)","--button-bg-hover":"var(--bpPrimary-300)","--button-text":"var(--bpPrimary-800)","--fab-bg":"var(--bpPrimary-600)","--fab-bg-hover":"var(--bpPrimary-700)","--fab-icon":u,"--modal-submit-bg":"var(--bpPrimary-600)","--modal-submit-bg-hover":"var(--bpPrimary-700)"}:{"--message-bg":"var(--bpPrimary-100)","--message-bg-hover":"var(--bpPrimary-200)","--message-text":"var(--bpPrimary-900)","--send-button-bg":"var(--bpPrimary-600)","--send-button-bg-hover":"var(--bpPrimary-700)","--send-button-text":"var(--bpPrimary-50)","--button-bg":"var(--bpPrimary-500)","--button-bg-hover":"var(--bpPrimary-600)","--button-text":a?_f(a["--bpPrimary-500"],a["--bpPrimary-50"])>40?"var(--bpPrimary-50)":"var(--bpPrimary-900)":"var(--bpPrimary-50)","--fab-bg":"var(--bpPrimary-100)","--fab-bg-hover":"var(--bpPrimary-200)","--fab-icon":"var(--bpPrimary-700)","--scrollbar":"var(--bpGray-500)","--scrollbar-hover":"var(--bpGray-400)","--modal-submit-bg":"var(--bpPrimary-200)","--modal-submit-bg-hover":"var(--bpPrimary-300)"},c=o==="solid"?{"--header-bg":"var(--bpPrimary-600)","--header-bg-hover":"var(--bpPrimary-700)","--header-hover-dark":"var(--bpPrimary-800)","--header-title":u,"--header-description":u,"--header-description-icon":u,"--header-description-link":u,"--header-avatar-bg":"var(--bpPrimary-300)","--header-avatar-text":"var(--bpPrimary-700)"}:{"--header-bg":l.bg,"--header-bg-hover":l.bgHover,"--header-hover-dark":"var(--bpGray-200)","--header-title":"var(--bpGray-900)","--header-description":"var(--bpGray-600)","--header-description-icon":"var(--bpPrimary-700)","--header-description-link":"var(--bpPrimary-800)","--header-avatar-bg":"var(--bpPrimary-600)","--header-avatar-text":"var(--bpPrimary-50)"};return{...s,...f,...c}}const Lw=e=>{if(typeof URL.canParse=="function")return URL.canParse(e);try{return new URL(e),!0}catch{return!1}},Ff=["audio","file","image","video"],Rf=e=>Ff.includes(e),$f="The Client ID is required to initialize the webchat.",Fw="The API url is required to initialize the webchat.",Rw="The Bot ID is required to initialize the webchat.",$w="No config URL provided.",Bf=`Invalid API URL.
18
+ Please use a valid API URL.`,zf=`Invalid Client ID.
19
+ Please use a valid Botpress Client ID.`,Uf=`Invalid URL.
20
+ Please make sure your client ID and API URL are valid`,Bw=`Invalid config URL.
21
+ Please make sure your config URL is valid`,zw=`Invalid webchat configuration.
22
+ Please make sure your config file is valid`,Uw="Access denied to configuration file. Please check your credentials or your configuration URL and try again.",Hf=`This bot has temporarily paused.
23
+ Please check back later.`,jf=`This bot has temporarily paused.
24
+ Please check back later.`,Fs="Something went wrong. To fix it, please clear your browser's local and session storage and then refresh the page",Li="Please check your internet connection and refresh the page.",Vf=`You've been disconnected from the conversation.
25
+ Please refresh the page.`,Wf=`Unable to process the message.
26
+ Please start a new conversation.`,Rs={ResourceNotFound:{type:"configuration",message:zf},Forbidden:{type:"bot",message:Hf}},$s={MethodNotFound:{type:"configuration",message:Uf},QuotaExceeded:{type:"bot",message:jf},Forbidden:{type:"bot",message:Fs}};function qf(e){return e in Rs}function Yf(e){return e in $s}function Kf(e){return e!==null&&typeof e=="object"&&"id"in e&&"code"in e&&"type"in e}function Gf(e){return e!==null&&typeof e=="object"&&"type"in e&&e.type==="error"&&"message"in e&&typeof e.message=="string"}const Qf=async(e,t=3,n=1e3)=>{let r;for(let i=1;i<=t;i++)try{return await e()}catch(o){if(r=o,i===t)throw r;const s=n*Math.pow(2,i-1);await new Promise(a=>setTimeout(a,s))}throw new Error("Unreachable: retry loop should always return or throw")},Hw=["networkerror","failedtofetch","errorininputstream"],Pr=e=>{var n;console.error("An error occurred:",e);let t={type:"unknown",message:"An unexpected error occurred"};if(Kf(e))e.type==="network"?t={id:e.id,type:"network",message:Li}:(n=e.message)!=null&&n.includes("[Webhook Handler]")&&qf(e.type)?t={id:e.id,...Rs[e.type]}:Yf(e.type)?t={id:e.id,...$s[e.type]}:t={id:e.id,type:e.type,message:e.message||"An error occurred"};else if(Gf(e))Zf(e.message)?t={type:"disconnected",message:Vf}:Jf(e.message).includes("invalidcontenttype")?t={type:"bot",message:Wf}:t={type:"event",message:e.message};else if(e instanceof Error&&Zf(e.message))t={type:"network",message:Li};else if(e&&typeof e=="object"&&"type"in e&&"message"in e){const r=e;r.type==="network"?t={type:"network",message:Li}:t={type:r.type,message:r.message}}return t};function Zf(e){return Hw.some(t=>Jf(e).includes(t))}function Jf(e){return e.replaceAll(" ","").toLowerCase()}const jw=(e,t)=>{if(!e)return{type:"configuration",message:$f};if(!Lw(t))return{type:"configuration",message:Bf}},Vw=e=>new Promise((t,n)=>{const r=new FileReader;r.onload=i=>{var o;return t((o=i.target)==null?void 0:o.result)},r.onerror=i=>{var o;return n((o=i.target)==null?void 0:o.error)},r.readAsArrayBuffer(e)});function Ww(e,t,n,r){let i;return t&&e?i={conversationId:e,userToken:t}:t?i={conversationId:void 0,userToken:t}:i={conversationId:n,userToken:r},i}const En=M.forwardRef(({userId:e,src:t,container:n,image:r,fallback:i,...o},s)=>{const a=Qu(e??"",15);return x.jsxs(us,{ref:s,"data-color":a,...n,...o,children:[x.jsx(cs,{src:t,...r}),x.jsx(fs,{...i,children:typeof o.children=="string"?o.children[0]:o.children})]})});En.displayName="Avatar";function CP(){}function AP(){}function qw(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Yw=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Kw=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Gw={};function Xf(e,t){return(Gw.jsx?Kw:Yw).test(e)}const Qw=/[ \t\n\f\r]/g;function Zw(e){return typeof e=="object"?e.type==="text"?ed(e.value):!1:ed(e)}function ed(e){return e.replace(Qw,"")===""}class Lr{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Lr.prototype.normal={},Lr.prototype.property={},Lr.prototype.space=void 0;function td(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Lr(n,r,t)}function Bs(e){return e.toLowerCase()}class ut{constructor(t,n){this.attribute=n,this.property=t}}ut.prototype.attribute="",ut.prototype.booleanish=!1,ut.prototype.boolean=!1,ut.prototype.commaOrSpaceSeparated=!1,ut.prototype.commaSeparated=!1,ut.prototype.defined=!1,ut.prototype.mustUseProperty=!1,ut.prototype.number=!1,ut.prototype.overloadedBoolean=!1,ut.prototype.property="",ut.prototype.spaceSeparated=!1,ut.prototype.space=void 0;let Jw=0;const ge=Cn(),We=Cn(),zs=Cn(),Q=Cn(),_e=Cn(),jn=Cn(),pt=Cn();function Cn(){return 2**++Jw}const Us=Object.freeze(Object.defineProperty({__proto__:null,boolean:ge,booleanish:We,commaOrSpaceSeparated:pt,commaSeparated:jn,number:Q,overloadedBoolean:zs,spaceSeparated:_e},Symbol.toStringTag,{value:"Module"})),Hs=Object.keys(Us);class js extends ut{constructor(t,n,r,i){let o=-1;if(super(t,n),nd(this,"space",i),typeof r=="number")for(;++o<Hs.length;){const s=Hs[o];nd(this,Hs[o],(r&Us[s])===Us[s])}}}js.prototype.defined=!0;function nd(e,t,n){n&&(e[t]=n)}function Vn(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new js(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Bs(r)]=r,n[Bs(o.attribute)]=r}return new Lr(t,n,e.space)}const rd=Vn({properties:{ariaActiveDescendant:null,ariaAtomic:We,ariaAutoComplete:null,ariaBusy:We,ariaChecked:We,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:_e,ariaCurrent:null,ariaDescribedBy:_e,ariaDetails:null,ariaDisabled:We,ariaDropEffect:_e,ariaErrorMessage:null,ariaExpanded:We,ariaFlowTo:_e,ariaGrabbed:We,ariaHasPopup:null,ariaHidden:We,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:_e,ariaLevel:Q,ariaLive:null,ariaModal:We,ariaMultiLine:We,ariaMultiSelectable:We,ariaOrientation:null,ariaOwns:_e,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:We,ariaReadOnly:We,ariaRelevant:null,ariaRequired:We,ariaRoleDescription:_e,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:We,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function id(e,t){return t in e?e[t]:t}function od(e,t){return id(e,t.toLowerCase())}const Xw=Vn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:jn,acceptCharset:_e,accessKey:_e,action:null,allow:null,allowFullScreen:ge,allowPaymentRequest:ge,allowUserMedia:ge,alt:null,as:null,async:ge,autoCapitalize:null,autoComplete:_e,autoFocus:ge,autoPlay:ge,blocking:_e,capture:null,charSet:null,checked:ge,cite:null,className:_e,cols:Q,colSpan:null,content:null,contentEditable:We,controls:ge,controlsList:_e,coords:Q|jn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ge,defer:ge,dir:null,dirName:null,disabled:ge,download:zs,draggable:We,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ge,formTarget:null,headers:_e,height:Q,hidden:zs,high:Q,href:null,hrefLang:null,htmlFor:_e,httpEquiv:_e,id:null,imageSizes:null,imageSrcSet:null,inert:ge,inputMode:null,integrity:null,is:null,isMap:ge,itemId:null,itemProp:_e,itemRef:_e,itemScope:ge,itemType:_e,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ge,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:ge,muted:ge,name:null,nonce:null,noModule:ge,noValidate:ge,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle: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:ge,optimum:Q,pattern:null,ping:_e,placeholder:null,playsInline:ge,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ge,referrerPolicy:null,rel:_e,required:ge,reversed:ge,rows:Q,rowSpan:Q,sandbox:_e,scope:null,scoped:ge,seamless:ge,selected:ge,shadowRootClonable:ge,shadowRootDelegatesFocus:ge,shadowRootMode:null,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:We,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:ge,useMap:null,value:We,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:_e,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ge,declare:ge,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:ge,noHref:ge,noShade:ge,noWrap:ge,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:We,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ge,disableRemotePlayback:ge,prefix:null,property:null,results:Q,security:null,unselectable:null},space:"html",transform:od}),e1=Vn({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",transformOrigin:"transform-origin",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"},properties:{about:pt,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:_e,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:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:ge,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,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:jn,g2:jn,glyphName:jn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:pt,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,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:Q,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:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:_e,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:pt,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:pt,rev:pt,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:pt,requiredFeatures:pt,requiredFonts:pt,requiredFormats:pt,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:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:pt,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pt,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:pt,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:id}),sd=Vn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),ad=Vn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:od}),ld=Vn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),t1={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"},n1=/[A-Z]/g,ud=/-[a-z]/g,r1=/^data[-\w.:]+$/i;function i1(e,t){const n=Bs(t);let r=t,i=ut;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&r1.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(ud,s1);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!ud.test(o)){let s=o.replace(n1,o1);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=js}return new i(r,t)}function o1(e){return"-"+e.toLowerCase()}function s1(e){return e.charAt(1).toUpperCase()}const a1=td([rd,Xw,sd,ad,ld],"html"),Vs=td([rd,e1,sd,ad,ld],"svg");function l1(e){return e.join(" ").trim()}var Ws={},cd=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,u1=/\n/g,c1=/^\s*/,f1=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,d1=/^:\s*/,h1=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,p1=/^[;\s]*/,m1=/^\s+|\s+$/g,g1=`
27
+ `,fd="/",dd="*",An="",y1="comment",v1="declaration";function b1(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(m){var p=m.match(u1);p&&(n+=p.length);var g=m.lastIndexOf(g1);r=~g?m.length-g:r+m.length}function o(){var m={line:n,column:r};return function(p){return p.position=new s(m),u(),p}}function s(m){this.start=m,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(m){var p=new Error(t.source+":"+n+":"+r+": "+m);if(p.reason=m,p.filename=t.source,p.line=n,p.column=r,p.source=e,!t.silent)throw p}function l(m){var p=m.exec(e);if(p){var g=p[0];return i(g),e=e.slice(g.length),p}}function u(){l(c1)}function f(m){var p;for(m=m||[];p=c();)p!==!1&&m.push(p);return m}function c(){var m=o();if(!(fd!=e.charAt(0)||dd!=e.charAt(1))){for(var p=2;An!=e.charAt(p)&&(dd!=e.charAt(p)||fd!=e.charAt(p+1));)++p;if(p+=2,An===e.charAt(p-1))return a("End of comment missing");var g=e.slice(2,p-2);return r+=2,i(g),e=e.slice(p),r+=2,m({type:y1,comment:g})}}function h(){var m=o(),p=l(f1);if(p){if(c(),!l(d1))return a("property missing ':'");var g=l(h1),v=m({type:v1,property:hd(p[0].replace(cd,An)),value:g?hd(g[0].replace(cd,An)):An});return l(p1),v}}function d(){var m=[];f(m);for(var p;p=h();)p!==!1&&(m.push(p),f(m));return m}return u(),d()}function hd(e){return e?e.replace(m1,An):An}var w1=b1,S1=yn&&yn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.default=k1;const x1=S1(w1);function k1(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,x1.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:s,value:a}=o;i?t(s,a,o):a&&(n=n||{},n[s]=a)}),n}var Fi={};Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.camelCase=void 0;var E1=/^--[a-zA-Z0-9_-]+$/,C1=/-([a-z])/g,A1=/^[^-]+$/,T1=/^-(webkit|moz|ms|o|khtml)-/,I1=/^-(ms)-/,O1=function(e){return!e||A1.test(e)||E1.test(e)},M1=function(e,t){return t.toUpperCase()},pd=function(e,t){return"".concat(t,"-")},D1=function(e,t){return t===void 0&&(t={}),O1(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(I1,pd):e=e.replace(T1,pd),e.replace(C1,M1))};Fi.camelCase=D1;var N1=yn&&yn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},_1=N1(Ws),P1=Fi;function qs(e,t){var n={};return!e||typeof e!="string"||(0,_1.default)(e,function(r,i){r&&i&&(n[(0,P1.camelCase)(r,t)]=i)}),n}qs.default=qs;var L1=qs;const F1=vn(L1),md=gd("end"),Ys=gd("start");function gd(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 R1(e){const t=Ys(e),n=md(e);if(t&&n)return{start:t,end:n}}function Fr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?yd(e.position):"start"in e||"end"in e?yd(e):"line"in e||"column"in e?Ks(e):""}function Ks(e){return vd(e&&e.line)+":"+vd(e&&e.column)}function yd(e){return Ks(e&&e.start)+"-"+Ks(e&&e.end)}function vd(e){return e&&typeof e=="number"?e:1}class et extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?o.ruleId=r:(o.source=r.slice(0,l),o.ruleId=r.slice(l+1))}if(!o.place&&o.ancestors&&o.ancestors){const l=o.ancestors[o.ancestors.length-1];l&&(o.place=l.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Fr(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}et.prototype.file="",et.prototype.name="",et.prototype.reason="",et.prototype.message="",et.prototype.stack="",et.prototype.column=void 0,et.prototype.line=void 0,et.prototype.ancestors=void 0,et.prototype.cause=void 0,et.prototype.fatal=void 0,et.prototype.place=void 0,et.prototype.ruleId=void 0,et.prototype.source=void 0;const Gs={}.hasOwnProperty,$1=new Map,B1=/[A-Z]/g,z1=new Set(["table","tbody","thead","tfoot","tr"]),U1=new Set(["td","th"]),bd="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function H1(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=Q1(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=G1(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"?Vs:a1,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=wd(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function wd(e,t,n){if(t.type==="element")return j1(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return V1(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return q1(e,t,n);if(t.type==="mdxjsEsm")return W1(e,t);if(t.type==="root")return Y1(e,t,n);if(t.type==="text")return K1(e,t)}function j1(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Vs,e.schema=i),e.ancestors.push(t);const o=xd(e,t.tagName,!1),s=Z1(e,t);let a=Zs(e,t);return z1.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!Zw(l):!0})),Sd(e,s,o,t),Qs(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function V1(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)}Rr(e,t.position)}function W1(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Rr(e,t.position)}function q1(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Vs,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:xd(e,t.name,!0),s=J1(e,t),a=Zs(e,t);return Sd(e,s,o,t),Qs(s,a),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function Y1(e,t,n){const r={};return Qs(r,Zs(e,t)),e.create(t,e.Fragment,r,n)}function K1(e,t){return t.value}function Sd(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Qs(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function G1(e,t,n){return r;function r(i,o,s,a){const u=Array.isArray(s.children)?n:t;return a?u(o,s,a):u(o,s)}}function Q1(e,t){return n;function n(r,i,o,s){const a=Array.isArray(o.children),l=Ys(r);return t(i,o,s,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function Z1(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Gs.call(t.properties,i)){const o=X1(e,i,t.properties[i]);if(o){const[s,a]=o;e.tableCellAlignToStyle&&s==="align"&&typeof a=="string"&&U1.has(t.tagName)?r=a:n[s]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function J1(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const a=s.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Rr(e,t.position);else{const i=r.name;let o;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,o=e.evaluater.evaluateExpression(a.expression)}else Rr(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Zs(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:$1;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const l=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(l){const u=i.get(l)||0;s=l+"-"+u,i.set(l,u+1)}}const a=wd(e,o,s);a!==void 0&&n.push(a)}return n}function X1(e,t,n){const r=i1(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?qw(n):l1(n)),r.property==="style"){let i=typeof n=="object"?n:eS(e,String(n));return e.stylePropertyNameCase==="css"&&(i=tS(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?t1[r.property]||r.property:r.attribute,n]}}function eS(e,t){try{return F1(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new et("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=bd+"#cannot-parse-style-attribute",i}}function xd(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const a=Xf(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=s}else r=Xf(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Gs.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Rr(e)}function Rr(e,t){const n=new et("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=bd+"#cannot-handle-mdx-estrees-without-createevaluater",n}function tS(e){const t={};let n;for(n in e)Gs.call(e,n)&&(t[nS(n)]=e[n]);return t}function nS(e){let t=e.replace(B1,rS);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function rS(e){return"-"+e.toLowerCase()}const Js={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"]},iS={};function Xs(e,t){const n=iS,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return kd(e,r,i)}function kd(e,t,n){if(oS(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 Ed(e.children,t,n)}return Array.isArray(e)?Ed(e,t,n):""}function Ed(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=kd(e[i],t,n);return r.join("")}function oS(e){return!!(e&&typeof e=="object")}const Cd=document.createElement("i");function ea(e){const t="&"+e+";";Cd.innerHTML=t;const n=Cd.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function mt(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function St(e,t){return e.length>0?(mt(e,e.length,0,t),e):t}const Ad={}.hasOwnProperty;function Td(e){const t={};let n=-1;for(;++n<e.length;)sS(t,e[n]);return t}function sS(e,t){let n;for(n in t){const i=(Ad.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){Ad.call(i,s)||(i[s]=[]);const a=o[s];aS(i[s],Array.isArray(a)?a:a?[a]:[])}}}function aS(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);mt(e,0,0,r)}function Id(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 Mt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ot=sn(/[A-Za-z]/),tt=sn(/[\dA-Za-z]/),lS=sn(/[#-'*+\--9=?A-Z^-~]/);function Ri(e){return e!==null&&(e<32||e===127)}const ta=sn(/\d/),uS=sn(/[\dA-Fa-f]/),cS=sn(/[!-/:-@[-`{-~]/);function ce(e){return e!==null&&e<-2}function De(e){return e!==null&&(e<0||e===32)}function ve(e){return e===-2||e===-1||e===32}const $i=sn(new RegExp("\\p{P}|\\p{S}","u")),Tn=sn(/\s/);function sn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Wn(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&tt(e.charCodeAt(n+1))&&tt(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(s=String.fromCharCode(o,a),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ke(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(l){return ve(l)?(e.enter(n),a(l)):t(l)}function a(l){return ve(l)&&o++<i?(e.consume(l),a):(e.exit(n),t(l))}}const fS={tokenize:dS};function dS(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"),ke(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,s(a)}function s(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return ce(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),s)}}const hS={tokenize:pS},Od={tokenize:mS};function pS(e){const t=this,n=[];let r=0,i,o,s;return a;function a(w){if(r<n.length){const C=n[r];return t.containerState=C[1],e.attempt(C[0].continuation,l,u)(w)}return u(w)}function l(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&y();const C=t.events.length;let k=C,E;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){E=t.events[k][1].end;break}v(r);let I=C;for(;I<t.events.length;)t.events[I][1].end={...E},I++;return mt(t.events,k+1,0,t.events.slice(C)),t.events.length=I,u(w)}return a(w)}function u(w){if(r===n.length){if(!i)return h(w);if(i.currentConstruct&&i.currentConstruct.concrete)return m(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Od,f,c)(w)}function f(w){return i&&y(),v(r),h(w)}function c(w){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,m(w)}function h(w){return t.containerState={},e.attempt(Od,d,m)(w)}function d(w){return r++,n.push([t.currentConstruct,t.containerState]),h(w)}function m(w){if(w===null){i&&y(),v(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),p(w)}function p(w){if(w===null){g(e.exit("chunkFlow"),!0),v(0),e.consume(w);return}return ce(w)?(e.consume(w),g(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(w),p)}function g(w,C){const k=t.sliceStream(w);if(C&&k.push(null),w.previous=o,o&&(o.next=w),o=w,i.defineSkip(w.start),i.write(k),t.parser.lazy[w.start.line]){let E=i.events.length;for(;E--;)if(i.events[E][1].start.offset<s&&(!i.events[E][1].end||i.events[E][1].end.offset>s))return;const I=t.events.length;let D=I,P,T;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(P){T=t.events[D][1].end;break}P=!0}for(v(r),E=I;E<t.events.length;)t.events[E][1].end={...T},E++;mt(t.events,D+1,0,t.events.slice(I)),t.events.length=E}}function v(w){let C=n.length;for(;C-- >w;){const k=n[C];t.containerState=k[1],k[0].exit.call(t,e)}n.length=w}function y(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function mS(e,t,n){return ke(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function qn(e){if(e===null||De(e)||Tn(e))return 1;if($i(e))return 2}function Bi(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const na={name:"attention",resolveAll:gS,tokenize:yS};function gS(e,t){let n=-1,r,i,o,s,a,l,u,f;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 c={...e[r][1].end},h={...e[n][1].start};Md(c,-l),Md(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:h},o={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...s.start},end:{...a.end}},e[r][1].end={...s.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=St(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=St(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),u=St(u,Bi(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=St(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=St(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,mt(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function yS(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=qn(r);let o;return s;function s(l){return o=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===o)return e.consume(l),a;const u=e.exit("attentionSequence"),f=qn(l),c=!f||f===2&&i||n.includes(l),h=!i||i===2&&f||n.includes(r);return u._open=!!(o===42?c:c&&(i||!h)),u._close=!!(o===42?h:h&&(f||!c)),t(l)}}function Md(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const vS={name:"autolink",tokenize:bS};function bS(e,t,n){let r=0;return i;function i(d){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(d){return ot(d)?(e.consume(d),s):d===64?n(d):u(d)}function s(d){return d===43||d===45||d===46||tt(d)?(r=1,a(d)):u(d)}function a(d){return d===58?(e.consume(d),r=0,l):(d===43||d===45||d===46||tt(d))&&r++<32?(e.consume(d),a):(r=0,u(d))}function l(d){return d===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):d===null||d===32||d===60||Ri(d)?n(d):(e.consume(d),l)}function u(d){return d===64?(e.consume(d),f):lS(d)?(e.consume(d),u):n(d)}function f(d){return tt(d)?c(d):n(d)}function c(d){return d===46?(e.consume(d),r=0,f):d===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(d),e.exit("autolinkMarker"),e.exit("autolink"),t):h(d)}function h(d){if((d===45||tt(d))&&r++<63){const m=d===45?h:c;return e.consume(d),m}return n(d)}}const $r={partial:!0,tokenize:wS};function wS(e,t,n){return r;function r(o){return ve(o)?ke(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||ce(o)?t(o):n(o)}}const Dd={continuation:{tokenize:xS},exit:kS,name:"blockQuote",tokenize:SS};function SS(e,t,n){const r=this;return i;function i(s){if(s===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return ve(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function xS(e,t,n){const r=this;return i;function i(s){return ve(s)?ke(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(Dd,t,n)(s)}}function kS(e){e.exit("blockQuote")}const Nd={name:"characterEscape",tokenize:ES};function ES(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return cS(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const _d={name:"characterReference",tokenize:CS};function CS(e,t,n){const r=this;let i=0,o,s;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),l}function l(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,s=tt,f(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=uS,f):(e.enter("characterReferenceValue"),o=7,s=ta,f(c))}function f(c){if(c===59&&i){const h=e.exit("characterReferenceValue");return s===tt&&!ea(r.sliceSerialize(h))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(c)&&i++<o?(e.consume(c),f):n(c)}}const Pd={partial:!0,tokenize:TS},Ld={concrete:!0,name:"codeFenced",tokenize:AS};function AS(e,t,n){const r=this,i={partial:!0,tokenize:k};let o=0,s=0,a;return l;function l(E){return u(E)}function u(E){const I=r.events[r.events.length-1];return o=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,a=E,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(E)}function f(E){return E===a?(s++,e.consume(E),f):s<3?n(E):(e.exit("codeFencedFenceSequence"),ve(E)?ke(e,c,"whitespace")(E):c(E))}function c(E){return E===null||ce(E)?(e.exit("codeFencedFence"),r.interrupt?t(E):e.check(Pd,p,C)(E)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(E))}function h(E){return E===null||ce(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(E)):ve(E)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ke(e,d,"whitespace")(E)):E===96&&E===a?n(E):(e.consume(E),h)}function d(E){return E===null||ce(E)?c(E):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),m(E))}function m(E){return E===null||ce(E)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(E)):E===96&&E===a?n(E):(e.consume(E),m)}function p(E){return e.attempt(i,C,g)(E)}function g(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),v}function v(E){return o>0&&ve(E)?ke(e,y,"linePrefix",o+1)(E):y(E)}function y(E){return E===null||ce(E)?e.check(Pd,p,C)(E):(e.enter("codeFlowValue"),w(E))}function w(E){return E===null||ce(E)?(e.exit("codeFlowValue"),y(E)):(e.consume(E),w)}function C(E){return e.exit("codeFenced"),t(E)}function k(E,I,D){let P=0;return T;function T(R){return E.enter("lineEnding"),E.consume(R),E.exit("lineEnding"),O}function O(R){return E.enter("codeFencedFence"),ve(R)?ke(E,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):U(R)}function U(R){return R===a?(E.enter("codeFencedFenceSequence"),L(R)):D(R)}function L(R){return R===a?(P++,E.consume(R),L):P>=s?(E.exit("codeFencedFenceSequence"),ve(R)?ke(E,F,"whitespace")(R):F(R)):D(R)}function F(R){return R===null||ce(R)?(E.exit("codeFencedFence"),I(R)):D(R)}}}function TS(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const ra={name:"codeIndented",tokenize:OS},IS={partial:!0,tokenize:MS};function OS(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),ke(e,o,"linePrefix",5)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?l(u):ce(u)?e.attempt(IS,s,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||ce(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function MS(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):ke(e,o,"linePrefix",5)(s)}function o(s){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(s):ce(s)?i(s):n(s)}}const DS={name:"codeText",previous:_S,resolve:NS,tokenize:PS};function NS(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 _S(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function PS(e,t,n){let r=0,i,o;return s;function s(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),l(c))}function l(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),l):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):ce(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||ce(c)?(e.exit("codeTextData"),l(c)):(e.consume(c),u)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(o.type="codeTextData",u(c))}}class LS{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Br(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Br(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Br(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Br(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Br(this.left,n.reverse())}}}function Br(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Fd(e){const t={};let n=-1,r,i,o,s,a,l,u;const f=new LS(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,o=0,o<l.length&&l[o][1].type==="lineEndingBlank"&&(o+=2),o<l.length&&l[o][1].type==="content"))for(;++o<l.length&&l[o][1].type!=="content";)l[o][1].type==="chunkText"&&(l[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,FS(f,n)),n=t[n],u=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=f.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,n),a.unshift(r),f.splice(i,n-i+1,a))}}return mt(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function FS(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const a=s.events,l=[],u={};let f,c,h=-1,d=n,m=0,p=0;const g=[p];for(;d;){for(;e.get(++i)[1]!==d;);o.push(i),d._tokenizer||(f=r.sliceStream(d),d.next||f.push(null),c&&s.defineSkip(d.start),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(f),d._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),c=d,d=d.next}for(d=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&&(p=h+1,g.push(p),d._tokenizer=void 0,d.previous=void 0,d=d.next);for(s.events=[],d?(d._tokenizer=void 0,d.previous=void 0):g.pop(),h=g.length;h--;){const v=a.slice(g[h],g[h+1]),y=o.pop();l.push([y,y+v.length-1]),e.splice(y,2,v)}for(l.reverse(),h=-1;++h<l.length;)u[m+l[h][0]]=m+l[h][1],m+=l[h][1]-l[h][0]-1;return u}const RS={resolve:BS,tokenize:zS},$S={partial:!0,tokenize:US};function BS(e){return Fd(e),e}function zS(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?o(a):ce(a)?e.check($S,s,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function s(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function US(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ke(e,o,"linePrefix")}function o(s){if(s===null||ce(s))return n(s);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(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Rd(e,t,n,r,i,o,s,a,l){const u=l||Number.POSITIVE_INFINITY;let f=0;return c;function c(v){return v===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(v),e.exit(o),h):v===null||v===32||v===41||Ri(v)?n(v):(e.enter(r),e.enter(s),e.enter(a),e.enter("chunkString",{contentType:"string"}),p(v))}function h(v){return v===62?(e.enter(o),e.consume(v),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),d(v))}function d(v){return v===62?(e.exit("chunkString"),e.exit(a),h(v)):v===null||v===60||ce(v)?n(v):(e.consume(v),v===92?m:d)}function m(v){return v===60||v===62||v===92?(e.consume(v),d):d(v)}function p(v){return!f&&(v===null||v===41||De(v))?(e.exit("chunkString"),e.exit(a),e.exit(s),e.exit(r),t(v)):f<u&&v===40?(e.consume(v),f++,p):v===41?(e.consume(v),f--,p):v===null||v===32||v===40||Ri(v)?n(v):(e.consume(v),v===92?g:p)}function g(v){return v===40||v===41||v===92?(e.consume(v),p):p(v)}}function $d(e,t,n,r,i,o){const s=this;let a=0,l;return u;function u(d){return e.enter(r),e.enter(i),e.consume(d),e.exit(i),e.enter(o),f}function f(d){return a>999||d===null||d===91||d===93&&!l||d===94&&!a&&"_hiddenFootnoteSupport"in s.parser.constructs?n(d):d===93?(e.exit(o),e.enter(i),e.consume(d),e.exit(i),e.exit(r),t):ce(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(d))}function c(d){return d===null||d===91||d===93||ce(d)||a++>999?(e.exit("chunkString"),f(d)):(e.consume(d),l||(l=!ve(d)),d===92?h:c)}function h(d){return d===91||d===92||d===93?(e.consume(d),a++,c):c(d)}}function Bd(e,t,n,r,i,o){let s;return a;function a(h){return h===34||h===39||h===40?(e.enter(r),e.enter(i),e.consume(h),e.exit(i),s=h===40?41:h,l):n(h)}function l(h){return h===s?(e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):(e.enter(o),u(h))}function u(h){return h===s?(e.exit(o),l(s)):h===null?n(h):ce(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),ke(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(h))}function f(h){return h===s||h===null||ce(h)?(e.exit("chunkString"),u(h)):(e.consume(h),h===92?c:f)}function c(h){return h===s||h===92?(e.consume(h),f):f(h)}}function zr(e,t){let n;return r;function r(i){return ce(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):ve(i)?ke(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const HS={name:"definition",tokenize:VS},jS={partial:!0,tokenize:WS};function VS(e,t,n){const r=this;let i;return o;function o(d){return e.enter("definition"),s(d)}function s(d){return $d.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(d)}function a(d){return i=Mt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),d===58?(e.enter("definitionMarker"),e.consume(d),e.exit("definitionMarker"),l):n(d)}function l(d){return De(d)?zr(e,u)(d):u(d)}function u(d){return Rd(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(d)}function f(d){return e.attempt(jS,c,c)(d)}function c(d){return ve(d)?ke(e,h,"whitespace")(d):h(d)}function h(d){return d===null||ce(d)?(e.exit("definition"),r.parser.defined.push(i),t(d)):n(d)}}function WS(e,t,n){return r;function r(a){return De(a)?zr(e,i)(a):n(a)}function i(a){return Bd(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return ve(a)?ke(e,s,"whitespace")(a):s(a)}function s(a){return a===null||ce(a)?t(a):n(a)}}const qS={name:"hardBreakEscape",tokenize:YS};function YS(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return ce(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const KS={name:"headingAtx",resolve:GS,tokenize:QS};function GS(e,t){let n=e.length-2,r=3,i,o;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},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},mt(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function QS(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),s(f)}function s(f){return f===35&&r++<6?(e.consume(f),s):f===null||De(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),l(f)):f===null||ce(f)?(e.exit("atxHeading"),t(f)):ve(f)?ke(e,a,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function l(f){return f===35?(e.consume(f),l):(e.exit("atxHeadingSequence"),a(f))}function u(f){return f===null||f===35||De(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),u)}}const ZS=["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"],zd=["pre","script","style","textarea"],JS={concrete:!0,name:"htmlFlow",resolveTo:tx,tokenize:nx},XS={partial:!0,tokenize:ix},ex={partial:!0,tokenize:rx};function tx(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 nx(e,t,n){const r=this;let i,o,s,a,l;return u;function u(S){return f(S)}function f(S){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(S),c}function c(S){return S===33?(e.consume(S),h):S===47?(e.consume(S),o=!0,p):S===63?(e.consume(S),i=3,r.interrupt?t:b):ot(S)?(e.consume(S),s=String.fromCharCode(S),g):n(S)}function h(S){return S===45?(e.consume(S),i=2,d):S===91?(e.consume(S),i=5,a=0,m):ot(S)?(e.consume(S),i=4,r.interrupt?t:b):n(S)}function d(S){return S===45?(e.consume(S),r.interrupt?t:b):n(S)}function m(S){const W="CDATA[";return S===W.charCodeAt(a++)?(e.consume(S),a===W.length?r.interrupt?t:U:m):n(S)}function p(S){return ot(S)?(e.consume(S),s=String.fromCharCode(S),g):n(S)}function g(S){if(S===null||S===47||S===62||De(S)){const W=S===47,J=s.toLowerCase();return!W&&!o&&zd.includes(J)?(i=1,r.interrupt?t(S):U(S)):ZS.includes(s.toLowerCase())?(i=6,W?(e.consume(S),v):r.interrupt?t(S):U(S)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(S):o?y(S):w(S))}return S===45||tt(S)?(e.consume(S),s+=String.fromCharCode(S),g):n(S)}function v(S){return S===62?(e.consume(S),r.interrupt?t:U):n(S)}function y(S){return ve(S)?(e.consume(S),y):T(S)}function w(S){return S===47?(e.consume(S),T):S===58||S===95||ot(S)?(e.consume(S),C):ve(S)?(e.consume(S),w):T(S)}function C(S){return S===45||S===46||S===58||S===95||tt(S)?(e.consume(S),C):k(S)}function k(S){return S===61?(e.consume(S),E):ve(S)?(e.consume(S),k):w(S)}function E(S){return S===null||S===60||S===61||S===62||S===96?n(S):S===34||S===39?(e.consume(S),l=S,I):ve(S)?(e.consume(S),E):D(S)}function I(S){return S===l?(e.consume(S),l=null,P):S===null||ce(S)?n(S):(e.consume(S),I)}function D(S){return S===null||S===34||S===39||S===47||S===60||S===61||S===62||S===96||De(S)?k(S):(e.consume(S),D)}function P(S){return S===47||S===62||ve(S)?w(S):n(S)}function T(S){return S===62?(e.consume(S),O):n(S)}function O(S){return S===null||ce(S)?U(S):ve(S)?(e.consume(S),O):n(S)}function U(S){return S===45&&i===2?(e.consume(S),N):S===60&&i===1?(e.consume(S),j):S===62&&i===4?(e.consume(S),_):S===63&&i===3?(e.consume(S),b):S===93&&i===5?(e.consume(S),V):ce(S)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(XS,B,L)(S)):S===null||ce(S)?(e.exit("htmlFlowData"),L(S)):(e.consume(S),U)}function L(S){return e.check(ex,F,B)(S)}function F(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),R}function R(S){return S===null||ce(S)?L(S):(e.enter("htmlFlowData"),U(S))}function N(S){return S===45?(e.consume(S),b):U(S)}function j(S){return S===47?(e.consume(S),s="",z):U(S)}function z(S){if(S===62){const W=s.toLowerCase();return zd.includes(W)?(e.consume(S),_):U(S)}return ot(S)&&s.length<8?(e.consume(S),s+=String.fromCharCode(S),z):U(S)}function V(S){return S===93?(e.consume(S),b):U(S)}function b(S){return S===62?(e.consume(S),_):S===45&&i===2?(e.consume(S),b):U(S)}function _(S){return S===null||ce(S)?(e.exit("htmlFlowData"),B(S)):(e.consume(S),_)}function B(S){return e.exit("htmlFlow"),t(S)}}function rx(e,t,n){const r=this;return i;function i(s){return ce(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function ix(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt($r,t,n)}}const ox={name:"htmlText",tokenize:sx};function sx(e,t,n){const r=this;let i,o,s;return a;function a(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),l}function l(b){return b===33?(e.consume(b),u):b===47?(e.consume(b),k):b===63?(e.consume(b),w):ot(b)?(e.consume(b),D):n(b)}function u(b){return b===45?(e.consume(b),f):b===91?(e.consume(b),o=0,m):ot(b)?(e.consume(b),y):n(b)}function f(b){return b===45?(e.consume(b),d):n(b)}function c(b){return b===null?n(b):b===45?(e.consume(b),h):ce(b)?(s=c,j(b)):(e.consume(b),c)}function h(b){return b===45?(e.consume(b),d):c(b)}function d(b){return b===62?N(b):b===45?h(b):c(b)}function m(b){const _="CDATA[";return b===_.charCodeAt(o++)?(e.consume(b),o===_.length?p:m):n(b)}function p(b){return b===null?n(b):b===93?(e.consume(b),g):ce(b)?(s=p,j(b)):(e.consume(b),p)}function g(b){return b===93?(e.consume(b),v):p(b)}function v(b){return b===62?N(b):b===93?(e.consume(b),v):p(b)}function y(b){return b===null||b===62?N(b):ce(b)?(s=y,j(b)):(e.consume(b),y)}function w(b){return b===null?n(b):b===63?(e.consume(b),C):ce(b)?(s=w,j(b)):(e.consume(b),w)}function C(b){return b===62?N(b):w(b)}function k(b){return ot(b)?(e.consume(b),E):n(b)}function E(b){return b===45||tt(b)?(e.consume(b),E):I(b)}function I(b){return ce(b)?(s=I,j(b)):ve(b)?(e.consume(b),I):N(b)}function D(b){return b===45||tt(b)?(e.consume(b),D):b===47||b===62||De(b)?P(b):n(b)}function P(b){return b===47?(e.consume(b),N):b===58||b===95||ot(b)?(e.consume(b),T):ce(b)?(s=P,j(b)):ve(b)?(e.consume(b),P):N(b)}function T(b){return b===45||b===46||b===58||b===95||tt(b)?(e.consume(b),T):O(b)}function O(b){return b===61?(e.consume(b),U):ce(b)?(s=O,j(b)):ve(b)?(e.consume(b),O):P(b)}function U(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),i=b,L):ce(b)?(s=U,j(b)):ve(b)?(e.consume(b),U):(e.consume(b),F)}function L(b){return b===i?(e.consume(b),i=void 0,R):b===null?n(b):ce(b)?(s=L,j(b)):(e.consume(b),L)}function F(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||De(b)?P(b):(e.consume(b),F)}function R(b){return b===47||b===62||De(b)?P(b):n(b)}function N(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function j(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),z}function z(b){return ve(b)?ke(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):V(b)}function V(b){return e.enter("htmlTextData"),s(b)}}const ia={name:"labelEnd",resolveAll:cx,resolveTo:fx,tokenize:dx},ax={tokenize:hx},lx={tokenize:px},ux={tokenize:mx};function cx(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&mt(e,0,e.length,n),e}function fx(e,t){let n=e.length,r=0,i,o,s,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const l={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return a=[["enter",l,t],["enter",u,t]],a=St(a,e.slice(o+1,o+r+3)),a=St(a,[["enter",f,t]]),a=St(a,Bi(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),a=St(a,[["exit",f,t],e[s-2],e[s-1],["exit",u,t]]),a=St(a,e.slice(s+1)),a=St(a,[["exit",l,t]]),mt(e,o,e.length,a),e}function dx(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(h){return o?o._inactive?c(h):(s=r.parser.defined.includes(Mt(r.sliceSerialize({start:o.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(ax,f,s?f:c)(h):h===91?e.attempt(lx,f,s?u:c)(h):s?f(h):c(h)}function u(h){return e.attempt(ux,f,c)(h)}function f(h){return t(h)}function c(h){return o._balanced=!0,n(h)}}function hx(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return De(c)?zr(e,o)(c):o(c)}function o(c){return c===41?f(c):Rd(e,s,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function s(c){return De(c)?zr(e,l)(c):f(c)}function a(c){return n(c)}function l(c){return c===34||c===39||c===40?Bd(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function u(c){return De(c)?zr(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function px(e,t,n){const r=this;return i;function i(a){return $d.call(r,e,o,s,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(Mt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function s(a){return n(a)}}function mx(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const gx={name:"labelStartImage",resolveAll:ia.resolveAll,tokenize:yx};function yx(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),s):n(a)}function s(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const vx={name:"labelStartLink",resolveAll:ia.resolveAll,tokenize:bx};function bx(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const oa={name:"lineEnding",tokenize:wx};function wx(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ke(e,t,"linePrefix")}}const zi={name:"thematicBreak",tokenize:Sx};function Sx(e,t,n){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),s(u)}function s(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||ce(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),ve(u)?ke(e,a,"whitespace")(u):a(u))}}const ct={continuation:{tokenize:Cx},exit:Tx,name:"list",tokenize:Ex},xx={partial:!0,tokenize:Ix},kx={partial:!0,tokenize:Ax};function Ex(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return a;function a(d){const m=r.containerState.type||(d===42||d===43||d===45?"listUnordered":"listOrdered");if(m==="listUnordered"?!r.containerState.marker||d===r.containerState.marker:ta(d)){if(r.containerState.type||(r.containerState.type=m,e.enter(m,{_container:!0})),m==="listUnordered")return e.enter("listItemPrefix"),d===42||d===45?e.check(zi,n,u)(d):u(d);if(!r.interrupt||d===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(d)}return n(d)}function l(d){return ta(d)&&++s<10?(e.consume(d),l):(!r.interrupt||s<2)&&(r.containerState.marker?d===r.containerState.marker:d===41||d===46)?(e.exit("listItemValue"),u(d)):n(d)}function u(d){return e.enter("listItemMarker"),e.consume(d),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||d,e.check($r,r.interrupt?n:f,e.attempt(xx,h,c))}function f(d){return r.containerState.initialBlankLine=!0,o++,h(d)}function c(d){return ve(d)?(e.enter("listItemPrefixWhitespace"),e.consume(d),e.exit("listItemPrefixWhitespace"),h):n(d)}function h(d){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(d)}}function Cx(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check($r,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ke(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!ve(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(kx,t,s)(a))}function s(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,ke(e,e.attempt(ct,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Ax(e,t,n){const r=this;return ke(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function Tx(e){e.exit(this.containerState.type)}function Ix(e,t,n){const r=this;return ke(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!ve(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Ud={name:"setextUnderline",resolveTo:Ox,tokenize:Mx};function Ox(e,t){let n=e.length,r,i,o;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),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function Mx(e,t,n){const r=this;let i;return o;function o(u){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),ve(u)?ke(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||ce(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Dx={tokenize:Nx};function Nx(e){const t=this,n=e.attempt($r,r,e.attempt(this.parser.constructs.flowInitial,i,ke(e,e.attempt(this.parser.constructs.flow,i,e.attempt(RS,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const _x={resolveAll:jd()},Px=Hd("string"),Lx=Hd("text");function Hd(e){return{resolveAll:jd(e==="text"?Fx:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,a);return s;function s(f){return u(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),l}function l(f){return u(f)?(n.exit("data"),o(f)):(n.consume(f),l)}function u(f){if(f===null)return!0;const c=i[f];let h=-1;if(c)for(;++h<c.length;){const d=c[h];if(!d.previous||d.previous.call(r,r.previous))return!0}return!1}}}function jd(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Fx(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 o=i.length,s=-1,a=0,l;for(;o--;){const u=i[o];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)a++,s--;if(s)break;s=-1}else if(u===-2)l=!0,a++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const Rx=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:{null:[42,95]},contentInitial:{91:HS},disable:{null:[]},document:{42:ct,43:ct,45:ct,48:ct,49:ct,50:ct,51:ct,52:ct,53:ct,54:ct,55:ct,56:ct,57:ct,62:Dd},flow:{35:KS,42:zi,45:[Ud,zi],60:JS,61:Ud,95:zi,96:Ld,126:Ld},flowInitial:{[-2]:ra,[-1]:ra,32:ra},insideSpan:{null:[na,_x]},string:{38:_d,92:Nd},text:{[-5]:oa,[-4]:oa,[-3]:oa,33:gx,38:_d,42:na,60:[vS,ox],91:vx,92:[qS,Nd],93:ia,95:na,96:DS}},Symbol.toStringTag,{value:"Module"}));function $x(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],a=[];const l={attempt:I(k),check:I(E),consume:y,enter:w,exit:C,interrupt:I(E,{interrupt:!0})},u={code:null,containerState:{},defineSkip:p,events:[],now:m,parser:e,previous:null,sliceSerialize:h,sliceStream:d,write:c};let f=t.tokenize.call(u,l);return t.resolveAll&&o.push(t),u;function c(O){return s=St(s,O),g(),s[s.length-1]!==null?[]:(D(t,0),u.events=Bi(o,u.events,u),u.events)}function h(O,U){return zx(d(O),U)}function d(O){return Bx(s,O)}function m(){const{_bufferIndex:O,_index:U,line:L,column:F,offset:R}=r;return{_bufferIndex:O,_index:U,line:L,column:F,offset:R}}function p(O){i[O.line]=O.column,T()}function g(){let O;for(;r._index<s.length;){const U=s[r._index];if(typeof U=="string")for(O=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===O&&r._bufferIndex<U.length;)v(U.charCodeAt(r._bufferIndex));else v(U)}}function v(O){f=f(O)}function y(O){ce(O)?(r.line++,r.column=1,r.offset+=O===-3?2:1,T()):O!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=O}function w(O,U){const L=U||{};return L.type=O,L.start=m(),u.events.push(["enter",L,u]),a.push(L),L}function C(O){const U=a.pop();return U.end=m(),u.events.push(["exit",U,u]),U}function k(O,U){D(O,U.from)}function E(O,U){U.restore()}function I(O,U){return L;function L(F,R,N){let j,z,V,b;return Array.isArray(F)?B(F):"tokenize"in F?B([F]):_(F);function _(Y){return G;function G(X){const se=X!==null&&Y[X],K=X!==null&&Y.null,te=[...Array.isArray(se)?se:se?[se]:[],...Array.isArray(K)?K:K?[K]:[]];return B(te)(X)}}function B(Y){return j=Y,z=0,Y.length===0?N:S(Y[z])}function S(Y){return G;function G(X){return b=P(),V=Y,Y.partial||(u.currentConstruct=Y),Y.name&&u.parser.constructs.disable.null.includes(Y.name)?J():Y.tokenize.call(U?Object.assign(Object.create(u),U):u,l,W,J)(X)}}function W(Y){return O(V,b),R}function J(Y){return b.restore(),++z<j.length?S(j[z]):N}}}function D(O,U){O.resolveAll&&!o.includes(O)&&o.push(O),O.resolve&&mt(u.events,U,u.events.length-U,O.resolve(u.events.slice(U),u)),O.resolveTo&&(u.events=O.resolveTo(u.events,u))}function P(){const O=m(),U=u.previous,L=u.currentConstruct,F=u.events.length,R=Array.from(a);return{from:F,restore:N};function N(){r=O,u.previous=U,u.currentConstruct=L,u.events.length=F,a=R,T()}}function T(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Bx(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const a=s[0];typeof a=="string"?s[0]=a.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function zx(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
28
28
  `;break}case-3:{s=`\r
29
- `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function zx(e){const r={constructs:Cd([Fx,...(e||{}).extensions||[]]),content:i(cS),defined:[],document:i(dS),flow:i(Mx),lazy:{},string:i(_x),text:i(Px)};return r;function i(o){return s;function s(a){return Rx(r,o,a)}}}function Ux(e){for(;!Pd(e););return e}const Hd=/[\0\t\n\r]/g;function Hx(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const l=[];let u,f,c,h,d;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(Hd.lastIndex=c,u=Hd.exec(o),h=u&&u.index!==void 0?u.index:o.length,d=o.charCodeAt(h),!u){t=o.slice(c);break}if(d===10&&c===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),c<h&&(l.push(o.slice(c,h)),e+=h-c),d){case 0:{l.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,l.push(-2);e++<f;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}c=h+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const jx=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Vx(e){return e.replace(jx,Wx)}function Wx(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Ad(n.slice(o?2:1),o?16:10)}return ea(n)||e}const jd={}.hasOwnProperty;function qx(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Yx(n)(Ux(zx(n).document().write(Hx()(e,t,!0))))}function Yx(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(fe),autolinkProtocol:P,autolinkEmail:P,atxHeading:o(Oe),blockQuote:o(G),characterEscape:P,characterReference:P,codeFenced:o(te),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(te,s),codeText:o($,s),codeTextData:P,data:P,codeFlowValue:P,definition:o(ne),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(me),hardBreakEscape:o(J),hardBreakTrailing:o(J),htmlFlow:o(ue,s),htmlFlowData:P,htmlText:o(ue,s),htmlTextData:P,image:o(de),label:s,link:o(fe),listItem:o(Fe),listItemValue:h,listOrdered:o(Ae,c),listUnordered:o(Ae),paragraph:o(Me),reference:S,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(Oe),strong:o(He),thematicBreak:o(ae)},exit:{atxHeading:l(),atxHeadingSequence:k,autolink:l(),autolinkEmail:se,autolinkProtocol:X,blockQuote:l(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:Y,characterReferenceMarkerNumeric:Y,characterReferenceValue:q,characterReference:Q,codeFenced:l(g),codeFencedFence:p,codeFencedFenceInfo:d,codeFencedFenceMeta:m,codeFlowValue:T,codeIndented:l(v),codeText:l(R),codeTextData:T,data:T,definition:l(),definitionDestinationString:A,definitionLabelString:y,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(B),hardBreakTrailing:l(B),htmlFlow:l(L),htmlFlowData:T,htmlText:l(F),htmlTextData:T,image:l(H),label:W,labelText:z,lineEnding:O,link:l(N),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:V,resourceDestinationString:b,resourceTitleString:_,resource:j,setextHeading:l(D),setextHeadingLineSequence:I,setextHeadingText:E,strong:l(),thematicBreak:l()}};Vd(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(U){let K={type:"root",children:[]};const oe={stack:[K],tokenStack:[],config:t,enter:a,exit:u,buffer:s,resume:f,data:n},le=[];let he=-1;for(;++he<U.length;)if(U[he][1].type==="listOrdered"||U[he][1].type==="listUnordered")if(U[he][0]==="enter")le.push(he);else{const je=le.pop();he=i(U,je,he)}for(he=-1;++he<U.length;){const je=t[U[he][0]];jd.call(je,U[he][1].type)&&je[U[he][1].type].call(Object.assign({sliceSerialize:U[he][2].sliceSerialize},oe),U[he][1])}if(oe.tokenStack.length>0){const je=oe.tokenStack[oe.tokenStack.length-1];(je[1]||Wd).call(oe,void 0,je[0])}for(K.position={start:an(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:an(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},he=-1;++he<t.transforms.length;)K=t.transforms[he](K)||K;return K}function i(U,K,oe){let le=K-1,he=-1,je=!1,Ge,Ze,Et,Rt;for(;++le<=oe;){const Qe=U[le];switch(Qe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Qe[0]==="enter"?he++:he--,Rt=void 0;break}case"lineEndingBlank":{Qe[0]==="enter"&&(Ge&&!Rt&&!he&&!Et&&(Et=le),Rt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Rt=void 0}if(!he&&Qe[0]==="enter"&&Qe[1].type==="listItemPrefix"||he===-1&&Qe[0]==="exit"&&(Qe[1].type==="listUnordered"||Qe[1].type==="listOrdered")){if(Ge){let Ct=le;for(Ze=void 0;Ct--;){const at=U[Ct];if(at[1].type==="lineEnding"||at[1].type==="lineEndingBlank"){if(at[0]==="exit")continue;Ze&&(U[Ze][1].type="lineEndingBlank",je=!0),at[1].type="lineEnding",Ze=Ct}else if(!(at[1].type==="linePrefix"||at[1].type==="blockQuotePrefix"||at[1].type==="blockQuotePrefixWhitespace"||at[1].type==="blockQuoteMarker"||at[1].type==="listItemIndent"))break}Et&&(!Ze||Et<Ze)&&(Ge._spread=!0),Ge.end=Object.assign({},Ze?U[Ze][1].start:Qe[1].end),U.splice(Ze||le,0,["exit",Ge,Qe[2]]),le++,oe++}if(Qe[1].type==="listItemPrefix"){const Ct={type:"listItem",_spread:!1,start:Object.assign({},Qe[1].start),end:void 0};Ge=Ct,U.splice(le,0,["enter",Ct,Qe[2]]),le++,oe++,Et=void 0,Rt=!0}}}return U[K][1]._spread=je,oe}function o(U,K){return oe;function oe(le){a.call(this,U(le),le),K&&K.call(this,le)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(U,K,oe){this.stack[this.stack.length-1].children.push(U),this.stack.push(U),this.tokenStack.push([K,oe||void 0]),U.position={start:an(K.start),end:void 0}}function l(U){return K;function K(oe){U&&U.call(this,oe),u.call(this,oe)}}function u(U,K){const oe=this.stack.pop(),le=this.tokenStack.pop();if(le)le[0].type!==U.type&&(K?K.call(this,U,le[0]):(le[1]||Wd).call(this,U,le[0]));else throw new Error("Cannot close `"+U.type+"` ("+Fr({start:U.start,end:U.end})+"): it’s not open");oe.position.end=an(U.end)}function f(){return Xs(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function h(U){if(this.data.expectingFirstListItemValue){const K=this.stack[this.stack.length-2];K.start=Number.parseInt(this.sliceSerialize(U),10),this.data.expectingFirstListItemValue=void 0}}function d(){const U=this.resume(),K=this.stack[this.stack.length-1];K.lang=U}function m(){const U=this.resume(),K=this.stack[this.stack.length-1];K.meta=U}function p(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const U=this.resume(),K=this.stack[this.stack.length-1];K.value=U.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const U=this.resume(),K=this.stack[this.stack.length-1];K.value=U.replace(/(\r?\n|\r)$/g,"")}function y(U){const K=this.resume(),oe=this.stack[this.stack.length-1];oe.label=K,oe.identifier=Mt(this.sliceSerialize(U)).toLowerCase()}function w(){const U=this.resume(),K=this.stack[this.stack.length-1];K.title=U}function A(){const U=this.resume(),K=this.stack[this.stack.length-1];K.url=U}function k(U){const K=this.stack[this.stack.length-1];if(!K.depth){const oe=this.sliceSerialize(U).length;K.depth=oe}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function I(U){const K=this.stack[this.stack.length-1];K.depth=this.sliceSerialize(U).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function P(U){const oe=this.stack[this.stack.length-1].children;let le=oe[oe.length-1];(!le||le.type!=="text")&&(le=ee(),le.position={start:an(U.start),end:void 0},oe.push(le)),this.stack.push(le)}function T(U){const K=this.stack.pop();K.value+=this.sliceSerialize(U),K.position.end=an(U.end)}function O(U){const K=this.stack[this.stack.length-1];if(this.data.atHardBreak){const oe=K.children[K.children.length-1];oe.position.end=an(U.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(K.type)&&(P.call(this,U),T.call(this,U))}function B(){this.data.atHardBreak=!0}function L(){const U=this.resume(),K=this.stack[this.stack.length-1];K.value=U}function F(){const U=this.resume(),K=this.stack[this.stack.length-1];K.value=U}function R(){const U=this.resume(),K=this.stack[this.stack.length-1];K.value=U}function N(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const K=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=K,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function H(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const K=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=K,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function z(U){const K=this.sliceSerialize(U),oe=this.stack[this.stack.length-2];oe.label=Vx(K),oe.identifier=Mt(K).toLowerCase()}function W(){const U=this.stack[this.stack.length-1],K=this.resume(),oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,oe.type==="link"){const le=U.children;oe.children=le}else oe.alt=K}function b(){const U=this.resume(),K=this.stack[this.stack.length-1];K.url=U}function _(){const U=this.resume(),K=this.stack[this.stack.length-1];K.title=U}function j(){this.data.inReference=void 0}function S(){this.data.referenceType="collapsed"}function V(U){const K=this.resume(),oe=this.stack[this.stack.length-1];oe.label=K,oe.identifier=Mt(this.sliceSerialize(U)).toLowerCase(),this.data.referenceType="full"}function Y(U){this.data.characterReferenceType=U.type}function q(U){const K=this.sliceSerialize(U),oe=this.data.characterReferenceType;let le;oe?(le=Ad(K,oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):le=ea(K);const he=this.stack[this.stack.length-1];he.value+=le}function Q(U){const K=this.stack.pop();K.position.end=an(U.end)}function X(U){T.call(this,U);const K=this.stack[this.stack.length-1];K.url=this.sliceSerialize(U)}function se(U){T.call(this,U);const K=this.stack[this.stack.length-1];K.url="mailto:"+this.sliceSerialize(U)}function G(){return{type:"blockquote",children:[]}}function te(){return{type:"code",lang:null,meta:null,value:""}}function $(){return{type:"inlineCode",value:""}}function ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function me(){return{type:"emphasis",children:[]}}function Oe(){return{type:"heading",depth:0,children:[]}}function J(){return{type:"break"}}function ue(){return{type:"html",value:""}}function de(){return{type:"image",title:null,url:"",alt:null}}function fe(){return{type:"link",title:null,url:"",children:[]}}function Ae(U){return{type:"list",ordered:U.type==="listOrdered",start:null,spread:U._spread,children:[]}}function Fe(U){return{type:"listItem",spread:U._spread,checked:null,children:[]}}function Me(){return{type:"paragraph",children:[]}}function He(){return{type:"strong",children:[]}}function ee(){return{type:"text",value:""}}function ae(){return{type:"thematicBreak"}}}function an(e){return{line:e.line,column:e.column,offset:e.offset}}function Vd(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Vd(e,r):Kx(e,r)}}function Kx(e,t){let n;for(n in t)if(jd.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 Wd(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Fr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Fr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Fr({start:t.start,end:t.end})+") is still open")}function Gx(e){const t=this;t.parser=n;function n(r){return qx(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Qx(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 Zx(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
30
- `}]}function Jx(e,t){const n=t.value?t.value+`
31
- `:"",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 Xx(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ek(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tk(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Wn(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+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(s)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function nk(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 rk(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function qd(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),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function ik(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return qd(e,t);const i={src:Wn(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function ok(e,t){const n={src:Wn(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 sk(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 ak(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return qd(e,t);const i={href:Wn(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function lk(e,t){const n={href:Wn(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 uk(e,t,n){const r=e.all(t),i=n?ck(n):Yd(t),o={},s=[];if(typeof t.checked=="boolean"){const f=r[0];let c;f&&f.type==="element"&&f.tagName==="p"?c=f:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const f=r[a];(i||a!==0||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
29
+ `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function Ux(e){const r={constructs:Td([Rx,...(e||{}).extensions||[]]),content:i(fS),defined:[],document:i(hS),flow:i(Dx),lazy:{},string:i(Px),text:i(Lx)};return r;function i(o){return s;function s(a){return $x(r,o,a)}}}function Hx(e){for(;!Fd(e););return e}const Vd=/[\0\t\n\r]/g;function jx(){let e=1,t="",n=!0,r;return i;function i(o,s,a){const l=[];let u,f,c,h,d;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(Vd.lastIndex=c,u=Vd.exec(o),h=u&&u.index!==void 0?u.index:o.length,d=o.charCodeAt(h),!u){t=o.slice(c);break}if(d===10&&c===h&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),c<h&&(l.push(o.slice(c,h)),e+=h-c),d){case 0:{l.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,l.push(-2);e++<f;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}c=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 Wx(e){return e.replace(Vx,qx)}function qx(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Id(n.slice(o?2:1),o?16:10)}return ea(n)||e}const Wd={}.hasOwnProperty;function Yx(e,t,n){return typeof t!="string"&&(n=t,t=void 0),Kx(n)(Hx(Ux(n).document().write(jx()(e,t,!0))))}function Kx(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(fe),autolinkProtocol:P,autolinkEmail:P,atxHeading:o(Oe),blockQuote:o(K),characterEscape:P,characterReference:P,codeFenced:o(te),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(te,s),codeText:o($,s),codeTextData:P,data:P,codeFlowValue:P,definition:o(ne),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(me),hardBreakEscape:o(Z),hardBreakTrailing:o(Z),htmlFlow:o(ue,s),htmlFlowData:P,htmlText:o(ue,s),htmlTextData:P,image:o(de),label:s,link:o(fe),listItem:o(Fe),listItemValue:h,listOrdered:o(Ae,c),listUnordered:o(Ae),paragraph:o(Me),reference:S,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(Oe),strong:o(He),thematicBreak:o(ae)},exit:{atxHeading:l(),atxHeadingSequence:k,autolink:l(),autolinkEmail:se,autolinkProtocol:X,blockQuote:l(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:J,characterReferenceMarkerNumeric:J,characterReferenceValue:Y,characterReference:G,codeFenced:l(g),codeFencedFence:p,codeFencedFenceInfo:d,codeFencedFenceMeta:m,codeFlowValue:T,codeIndented:l(v),codeText:l(R),codeTextData:T,data:T,definition:l(),definitionDestinationString:C,definitionLabelString:y,definitionTitleString:w,emphasis:l(),hardBreakEscape:l(U),hardBreakTrailing:l(U),htmlFlow:l(L),htmlFlowData:T,htmlText:l(F),htmlTextData:T,image:l(j),label:V,labelText:z,lineEnding:O,link:l(N),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:W,resourceDestinationString:b,resourceTitleString:_,resource:B,setextHeading:l(D),setextHeadingLineSequence:I,setextHeadingText:E,strong:l(),thematicBreak:l()}};qd(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(H){let q={type:"root",children:[]};const oe={stack:[q],tokenStack:[],config:t,enter:a,exit:u,buffer:s,resume:f,data:n},le=[];let he=-1;for(;++he<H.length;)if(H[he][1].type==="listOrdered"||H[he][1].type==="listUnordered")if(H[he][0]==="enter")le.push(he);else{const je=le.pop();he=i(H,je,he)}for(he=-1;++he<H.length;){const je=t[H[he][0]];Wd.call(je,H[he][1].type)&&je[H[he][1].type].call(Object.assign({sliceSerialize:H[he][2].sliceSerialize},oe),H[he][1])}if(oe.tokenStack.length>0){const je=oe.tokenStack[oe.tokenStack.length-1];(je[1]||Yd).call(oe,void 0,je[0])}for(q.position={start:an(H.length>0?H[0][1].start:{line:1,column:1,offset:0}),end:an(H.length>0?H[H.length-2][1].end:{line:1,column:1,offset:0})},he=-1;++he<t.transforms.length;)q=t.transforms[he](q)||q;return q}function i(H,q,oe){let le=q-1,he=-1,je=!1,Ge,Ze,Et,Rt;for(;++le<=oe;){const Qe=H[le];switch(Qe[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Qe[0]==="enter"?he++:he--,Rt=void 0;break}case"lineEndingBlank":{Qe[0]==="enter"&&(Ge&&!Rt&&!he&&!Et&&(Et=le),Rt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Rt=void 0}if(!he&&Qe[0]==="enter"&&Qe[1].type==="listItemPrefix"||he===-1&&Qe[0]==="exit"&&(Qe[1].type==="listUnordered"||Qe[1].type==="listOrdered")){if(Ge){let Ct=le;for(Ze=void 0;Ct--;){const at=H[Ct];if(at[1].type==="lineEnding"||at[1].type==="lineEndingBlank"){if(at[0]==="exit")continue;Ze&&(H[Ze][1].type="lineEndingBlank",je=!0),at[1].type="lineEnding",Ze=Ct}else if(!(at[1].type==="linePrefix"||at[1].type==="blockQuotePrefix"||at[1].type==="blockQuotePrefixWhitespace"||at[1].type==="blockQuoteMarker"||at[1].type==="listItemIndent"))break}Et&&(!Ze||Et<Ze)&&(Ge._spread=!0),Ge.end=Object.assign({},Ze?H[Ze][1].start:Qe[1].end),H.splice(Ze||le,0,["exit",Ge,Qe[2]]),le++,oe++}if(Qe[1].type==="listItemPrefix"){const Ct={type:"listItem",_spread:!1,start:Object.assign({},Qe[1].start),end:void 0};Ge=Ct,H.splice(le,0,["enter",Ct,Qe[2]]),le++,oe++,Et=void 0,Rt=!0}}}return H[q][1]._spread=je,oe}function o(H,q){return oe;function oe(le){a.call(this,H(le),le),q&&q.call(this,le)}}function s(){this.stack.push({type:"fragment",children:[]})}function a(H,q,oe){this.stack[this.stack.length-1].children.push(H),this.stack.push(H),this.tokenStack.push([q,oe||void 0]),H.position={start:an(q.start),end:void 0}}function l(H){return q;function q(oe){H&&H.call(this,oe),u.call(this,oe)}}function u(H,q){const oe=this.stack.pop(),le=this.tokenStack.pop();if(le)le[0].type!==H.type&&(q?q.call(this,H,le[0]):(le[1]||Yd).call(this,H,le[0]));else throw new Error("Cannot close `"+H.type+"` ("+Fr({start:H.start,end:H.end})+"): it’s not open");oe.position.end=an(H.end)}function f(){return Xs(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function h(H){if(this.data.expectingFirstListItemValue){const q=this.stack[this.stack.length-2];q.start=Number.parseInt(this.sliceSerialize(H),10),this.data.expectingFirstListItemValue=void 0}}function d(){const H=this.resume(),q=this.stack[this.stack.length-1];q.lang=H}function m(){const H=this.resume(),q=this.stack[this.stack.length-1];q.meta=H}function p(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){const H=this.resume(),q=this.stack[this.stack.length-1];q.value=H.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function v(){const H=this.resume(),q=this.stack[this.stack.length-1];q.value=H.replace(/(\r?\n|\r)$/g,"")}function y(H){const q=this.resume(),oe=this.stack[this.stack.length-1];oe.label=q,oe.identifier=Mt(this.sliceSerialize(H)).toLowerCase()}function w(){const H=this.resume(),q=this.stack[this.stack.length-1];q.title=H}function C(){const H=this.resume(),q=this.stack[this.stack.length-1];q.url=H}function k(H){const q=this.stack[this.stack.length-1];if(!q.depth){const oe=this.sliceSerialize(H).length;q.depth=oe}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function I(H){const q=this.stack[this.stack.length-1];q.depth=this.sliceSerialize(H).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function P(H){const oe=this.stack[this.stack.length-1].children;let le=oe[oe.length-1];(!le||le.type!=="text")&&(le=ee(),le.position={start:an(H.start),end:void 0},oe.push(le)),this.stack.push(le)}function T(H){const q=this.stack.pop();q.value+=this.sliceSerialize(H),q.position.end=an(H.end)}function O(H){const q=this.stack[this.stack.length-1];if(this.data.atHardBreak){const oe=q.children[q.children.length-1];oe.position.end=an(H.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(q.type)&&(P.call(this,H),T.call(this,H))}function U(){this.data.atHardBreak=!0}function L(){const H=this.resume(),q=this.stack[this.stack.length-1];q.value=H}function F(){const H=this.resume(),q=this.stack[this.stack.length-1];q.value=H}function R(){const H=this.resume(),q=this.stack[this.stack.length-1];q.value=H}function N(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=q,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function j(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const q=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=q,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function z(H){const q=this.sliceSerialize(H),oe=this.stack[this.stack.length-2];oe.label=Wx(q),oe.identifier=Mt(q).toLowerCase()}function V(){const H=this.stack[this.stack.length-1],q=this.resume(),oe=this.stack[this.stack.length-1];if(this.data.inReference=!0,oe.type==="link"){const le=H.children;oe.children=le}else oe.alt=q}function b(){const H=this.resume(),q=this.stack[this.stack.length-1];q.url=H}function _(){const H=this.resume(),q=this.stack[this.stack.length-1];q.title=H}function B(){this.data.inReference=void 0}function S(){this.data.referenceType="collapsed"}function W(H){const q=this.resume(),oe=this.stack[this.stack.length-1];oe.label=q,oe.identifier=Mt(this.sliceSerialize(H)).toLowerCase(),this.data.referenceType="full"}function J(H){this.data.characterReferenceType=H.type}function Y(H){const q=this.sliceSerialize(H),oe=this.data.characterReferenceType;let le;oe?(le=Id(q,oe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):le=ea(q);const he=this.stack[this.stack.length-1];he.value+=le}function G(H){const q=this.stack.pop();q.position.end=an(H.end)}function X(H){T.call(this,H);const q=this.stack[this.stack.length-1];q.url=this.sliceSerialize(H)}function se(H){T.call(this,H);const q=this.stack[this.stack.length-1];q.url="mailto:"+this.sliceSerialize(H)}function K(){return{type:"blockquote",children:[]}}function te(){return{type:"code",lang:null,meta:null,value:""}}function $(){return{type:"inlineCode",value:""}}function ne(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function me(){return{type:"emphasis",children:[]}}function Oe(){return{type:"heading",depth:0,children:[]}}function Z(){return{type:"break"}}function ue(){return{type:"html",value:""}}function de(){return{type:"image",title:null,url:"",alt:null}}function fe(){return{type:"link",title:null,url:"",children:[]}}function Ae(H){return{type:"list",ordered:H.type==="listOrdered",start:null,spread:H._spread,children:[]}}function Fe(H){return{type:"listItem",spread:H._spread,checked:null,children:[]}}function Me(){return{type:"paragraph",children:[]}}function He(){return{type:"strong",children:[]}}function ee(){return{type:"text",value:""}}function ae(){return{type:"thematicBreak"}}}function an(e){return{line:e.line,column:e.column,offset:e.offset}}function qd(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?qd(e,r):Gx(e,r)}}function Gx(e,t){let n;for(n in t)if(Wd.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 Yd(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Fr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Fr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Fr({start:t.start,end:t.end})+") is still open")}function Qx(e){const t=this;t.parser=n;function n(r){return Yx(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Zx(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 Jx(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
30
+ `}]}function Xx(e,t){const n=t.value?t.value+`
31
+ `:"",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 ek(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tk(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nk(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Wn(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let s,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),s=e.footnoteOrder.length):s=o+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(s)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function rk(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 ik(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Kd(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),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const s=i[i.length-1];return s&&s.type==="text"?s.value+=r:i.push({type:"text",value:r}),i}function ok(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Kd(e,t);const i={src:Wn(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function sk(e,t){const n={src:Wn(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 ak(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 lk(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Kd(e,t);const i={href:Wn(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function uk(e,t){const n={href:Wn(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 ck(e,t,n){const r=e.all(t),i=n?fk(n):Gd(t),o={},s=[];if(typeof t.checked=="boolean"){const f=r[0];let c;f&&f.type==="element"&&f.tagName==="p"?c=f:(c={type:"element",tagName:"p",properties:{},children:[]},r.unshift(c)),c.children.length>0&&c.children.unshift({type:"text",value:" "}),c.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let a=-1;for(;++a<r.length;){const f=r[a];(i||a!==0||f.type!=="element"||f.tagName!=="p")&&s.push({type:"text",value:`
32
32
  `}),f.type==="element"&&f.tagName==="p"&&!i?s.push(...f.children):s.push(f)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&s.push({type:"text",value:`
33
- `});const u={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,u),e.applyData(t,u)}function ck(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=Yd(n[r])}return t}function Yd(e){const t=e.spread;return t??e.children.length>1}function fk(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 s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function dk(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function hk(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function pk(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mk(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Ys(t.children[1]),l=hd(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function gk(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const u=[];for(;++l<a;){const c=t.children[l],h={},d=s?s[l]:void 0;d&&(h.align=d);let m={type:"element",tagName:o,properties:h,children:[]};c&&(m.children=e.all(c),e.patch(c,m),m=e.applyData(c,m)),u.push(m)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,f),e.applyData(t,f)}function yk(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Kd=9,Gd=32;function vk(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(Qd(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Qd(t.slice(i),i>0,!1)),o.join("")}function Qd(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Kd||o===Gd;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Kd||o===Gd;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function bk(e,t){const n={type:"text",value:vk(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function wk(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Sk={blockquote:Qx,break:Zx,code:Jx,delete:Xx,emphasis:ek,footnoteReference:tk,heading:nk,html:rk,imageReference:ik,image:ok,inlineCode:sk,linkReference:ak,link:lk,listItem:uk,list:fk,paragraph:dk,root:hk,strong:pk,table:mk,tableCell:yk,tableRow:gk,text:bk,thematicBreak:wk,toml:Ui,yaml:Ui,definition:Ui,footnoteDefinition:Ui};function Ui(){}const Zd=-1,Hi=0,Ur=1,ji=2,sa=3,aa=4,la=5,ua=6,Jd=7,Xd=8,eh=typeof self=="object"?self:globalThis,xk=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case Hi:case Zd:return n(s,i);case Ur:{const a=n([],i);for(const l of s)a.push(r(l));return a}case ji:{const a=n({},i);for(const[l,u]of s)a[r(l)]=r(u);return a}case sa:return n(new Date(s),i);case aa:{const{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case la:{const a=n(new Map,i);for(const[l,u]of s)a.set(r(l),r(u));return a}case ua:{const a=n(new Set,i);for(const l of s)a.add(r(l));return a}case Jd:{const{name:a,message:l}=s;return n(new eh[a](l),i)}case Xd:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new eh[o](s),i)};return r},th=e=>xk(new Map,e)(0),Yn="",{toString:kk}={},{keys:Ek}=Object,Hr=e=>{const t=typeof e;if(t!=="object"||!e)return[Hi,t];const n=kk.call(e).slice(8,-1);switch(n){case"Array":return[Ur,Yn];case"Object":return[ji,Yn];case"Date":return[sa,Yn];case"RegExp":return[aa,Yn];case"Map":return[la,Yn];case"Set":return[ua,Yn];case"DataView":return[Ur,n]}return n.includes("Array")?[Ur,n]:n.includes("Error")?[Jd,n]:[ji,n]},Vi=([e,t])=>e===Hi&&(t==="function"||t==="symbol"),Ck=(e,t,n,r)=>{const i=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=Hr(s);switch(a){case Hi:{let f=s;switch(l){case"bigint":a=Xd,f=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);f=null;break;case"undefined":return i([Zd],s)}return i([a,f],s)}case Ur:{if(l){let h=s;return l==="DataView"?h=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(s)),i([l,[...h]],s)}const f=[],c=i([a,f],s);for(const h of s)f.push(o(h));return c}case ji:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const f=[],c=i([a,f],s);for(const h of Ek(s))(e||!Vi(Hr(s[h])))&&f.push([o(h),o(s[h])]);return c}case sa:return i([a,s.toISOString()],s);case aa:{const{source:f,flags:c}=s;return i([a,{source:f,flags:c}],s)}case la:{const f=[],c=i([a,f],s);for(const[h,d]of s)(e||!(Vi(Hr(h))||Vi(Hr(d))))&&f.push([o(h),o(d)]);return c}case ua:{const f=[],c=i([a,f],s);for(const h of s)(e||!Vi(Hr(h)))&&f.push(o(h));return c}}const{message:u}=s;return i([a,{name:l,message:u}],s)};return o},nh=(e,{json:t,lossy:n}={})=>{const r=[];return Ck(!(t||n),!!t,new Map,r)(e),r},Wi=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?th(nh(e,t)):structuredClone(e):(e,t)=>th(nh(e,t));function Ak(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 Tk(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Ik(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Ak,r=e.options.footnoteBackLabel||Tk,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const f=e.all(u),c=String(u.identifier).toUpperCase(),h=Wn(c.toLowerCase());let d=0;const m=[],p=e.footnoteCounts.get(c);for(;p!==void 0&&++d<=p;){m.length>0&&m.push({type:"text",value:" "});let y=typeof n=="string"?n:n(l,d);typeof y=="string"&&(y={type:"text",value:y}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(y)?y:[y]})}const g=f[f.length-1];if(g&&g.type==="element"&&g.tagName==="p"){const y=g.children[g.children.length-1];y&&y.type==="text"?y.value+=" ":g.children.push({type:"text",value:" "}),g.children.push(...m)}else f.push(...m);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(f,!0)};e.patch(u,v),a.push(v)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Wi(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
33
+ `});const u={type:"element",tagName:"li",properties:o,children:s};return e.patch(t,u),e.applyData(t,u)}function fk(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=Gd(n[r])}return t}function Gd(e){const t=e.spread;return t??e.children.length>1}function dk(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 s=r[i];if(s.type==="element"&&s.tagName==="li"&&s.properties&&Array.isArray(s.properties.className)&&s.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function hk(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pk(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function mk(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gk(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const s={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],s),i.push(s)}if(n.length>0){const s={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=Ys(t.children[1]),l=md(t.children[t.children.length-1]);a&&l&&(s.position={start:a,end:l}),i.push(s)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function yk(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",s=n&&n.type==="table"?n.align:void 0,a=s?s.length:t.children.length;let l=-1;const u=[];for(;++l<a;){const c=t.children[l],h={},d=s?s[l]:void 0;d&&(h.align=d);let m={type:"element",tagName:o,properties:h,children:[]};c&&(m.children=e.all(c),e.patch(c,m),m=e.applyData(c,m)),u.push(m)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,f),e.applyData(t,f)}function vk(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Qd=9,Zd=32;function bk(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const o=[];for(;r;)o.push(Jd(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(Jd(t.slice(i),i>0,!1)),o.join("")}function Jd(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===Qd||o===Zd;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===Qd||o===Zd;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function wk(e,t){const n={type:"text",value:bk(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Sk(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const xk={blockquote:Zx,break:Jx,code:Xx,delete:ek,emphasis:tk,footnoteReference:nk,heading:rk,html:ik,imageReference:ok,image:sk,inlineCode:ak,linkReference:lk,link:uk,listItem:ck,list:dk,paragraph:hk,root:pk,strong:mk,table:gk,tableCell:vk,tableRow:yk,text:wk,thematicBreak:Sk,toml:Ui,yaml:Ui,definition:Ui,footnoteDefinition:Ui};function Ui(){}const Xd=-1,Hi=0,Ur=1,ji=2,sa=3,aa=4,la=5,ua=6,eh=7,th=8,nh=typeof self=="object"?self:globalThis,kk=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,s]=t[i];switch(o){case Hi:case Xd:return n(s,i);case Ur:{const a=n([],i);for(const l of s)a.push(r(l));return a}case ji:{const a=n({},i);for(const[l,u]of s)a[r(l)]=r(u);return a}case sa:return n(new Date(s),i);case aa:{const{source:a,flags:l}=s;return n(new RegExp(a,l),i)}case la:{const a=n(new Map,i);for(const[l,u]of s)a.set(r(l),r(u));return a}case ua:{const a=n(new Set,i);for(const l of s)a.add(r(l));return a}case eh:{const{name:a,message:l}=s;return n(new nh[a](l),i)}case th:return n(BigInt(s),i);case"BigInt":return n(Object(BigInt(s)),i);case"ArrayBuffer":return n(new Uint8Array(s).buffer,s);case"DataView":{const{buffer:a}=new Uint8Array(s);return n(new DataView(a),s)}}return n(new nh[o](s),i)};return r},rh=e=>kk(new Map,e)(0),Yn="",{toString:Ek}={},{keys:Ck}=Object,Hr=e=>{const t=typeof e;if(t!=="object"||!e)return[Hi,t];const n=Ek.call(e).slice(8,-1);switch(n){case"Array":return[Ur,Yn];case"Object":return[ji,Yn];case"Date":return[sa,Yn];case"RegExp":return[aa,Yn];case"Map":return[la,Yn];case"Set":return[ua,Yn];case"DataView":return[Ur,n]}return n.includes("Array")?[Ur,n]:n.includes("Error")?[eh,n]:[ji,n]},Vi=([e,t])=>e===Hi&&(t==="function"||t==="symbol"),Ak=(e,t,n,r)=>{const i=(s,a)=>{const l=r.push(s)-1;return n.set(a,l),l},o=s=>{if(n.has(s))return n.get(s);let[a,l]=Hr(s);switch(a){case Hi:{let f=s;switch(l){case"bigint":a=th,f=s.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);f=null;break;case"undefined":return i([Xd],s)}return i([a,f],s)}case Ur:{if(l){let h=s;return l==="DataView"?h=new Uint8Array(s.buffer):l==="ArrayBuffer"&&(h=new Uint8Array(s)),i([l,[...h]],s)}const f=[],c=i([a,f],s);for(const h of s)f.push(o(h));return c}case ji:{if(l)switch(l){case"BigInt":return i([l,s.toString()],s);case"Boolean":case"Number":case"String":return i([l,s.valueOf()],s)}if(t&&"toJSON"in s)return o(s.toJSON());const f=[],c=i([a,f],s);for(const h of Ck(s))(e||!Vi(Hr(s[h])))&&f.push([o(h),o(s[h])]);return c}case sa:return i([a,s.toISOString()],s);case aa:{const{source:f,flags:c}=s;return i([a,{source:f,flags:c}],s)}case la:{const f=[],c=i([a,f],s);for(const[h,d]of s)(e||!(Vi(Hr(h))||Vi(Hr(d))))&&f.push([o(h),o(d)]);return c}case ua:{const f=[],c=i([a,f],s);for(const h of s)(e||!Vi(Hr(h)))&&f.push(o(h));return c}}const{message:u}=s;return i([a,{name:l,message:u}],s)};return o},ih=(e,{json:t,lossy:n}={})=>{const r=[];return Ak(!(t||n),!!t,new Map,r)(e),r},Wi=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?rh(ih(e,t)):structuredClone(e):(e,t)=>rh(ih(e,t));function Tk(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 Ik(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Ok(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Tk,r=e.options.footnoteBackLabel||Ik,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",s=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const f=e.all(u),c=String(u.identifier).toUpperCase(),h=Wn(c.toLowerCase());let d=0;const m=[],p=e.footnoteCounts.get(c);for(;p!==void 0&&++d<=p;){m.length>0&&m.push({type:"text",value:" "});let y=typeof n=="string"?n:n(l,d);typeof y=="string"&&(y={type:"text",value:y}),m.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+h+(d>1?"-"+d:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,d),className:["data-footnote-backref"]},children:Array.isArray(y)?y:[y]})}const g=f[f.length-1];if(g&&g.type==="element"&&g.tagName==="p"){const y=g.children[g.children.length-1];y&&y.type==="text"?y.value+=" ":g.children.push({type:"text",value:" "}),g.children.push(...m)}else f.push(...m);const v={type:"element",tagName:"li",properties:{id:t+"fn-"+h},children:e.wrap(f,!0)};e.patch(u,v),a.push(v)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Wi(s),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
34
34
  `},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)},{type:"text",value:`
35
- `}]}}const qi=function(e){if(e==null)return Nk;if(typeof e=="function")return Yi(e);if(typeof e=="object")return Array.isArray(e)?Ok(e):Mk(e);if(typeof e=="string")return Dk(e);throw new Error("Expected function, string, or object as test")};function Ok(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=qi(e[n]);return Yi(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function Mk(e){const t=e;return Yi(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function Dk(e){return Yi(t);function t(n){return n&&n.type===e}}function Yi(e){return t;function t(n,r,i){return!!(_k(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function Nk(){return!0}function _k(e){return e!==null&&typeof e=="object"&&"type"in e}function PP(e){return e}const rh=[],Pk=!0,ca=!1,Lk="skip";function ih(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=qi(i),s=r?-1:1;a(e,void 0,[])();function a(l,u,f){const c=l&&typeof l=="object"?l:{};if(typeof c.type=="string"){const d=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(d?"<"+d+">":""))+")"})}return h;function h(){let d=rh,m,p,g;if((!t||o(l,u,f[f.length-1]||void 0))&&(d=Fk(n(l,f)),d[0]===ca))return d;if("children"in l&&l.children){const v=l;if(v.children&&d[0]!==Lk)for(p=(r?v.children.length:-1)+s,g=f.concat(v);p>-1&&p<v.children.length;){const y=v.children[p];if(m=a(y,p,g)(),m[0]===ca)return m;p=typeof m[1]=="number"?m[1]:p+s}}return d}}}function Fk(e){return Array.isArray(e)?e:typeof e=="number"?[Pk,e]:e==null?rh:[e]}function fa(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),ih(e,o,a,i);function a(l,u){const f=u[u.length-1],c=f?f.children.indexOf(l):void 0;return s(l,c,f)}}const da={}.hasOwnProperty,Rk={};function $k(e,t){const n=t||Rk,r=new Map,i=new Map,o=new Map,s={...Sk,...n.handlers},a={all:u,applyData:zk,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:n,patch:Bk,wrap:Hk};return fa(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const c=f.type==="definition"?r:i,h=String(f.identifier).toUpperCase();c.has(h)||c.set(h,f)}}),a;function l(f,c){const h=f.type,d=a.handlers[h];if(da.call(a.handlers,h)&&d)return d(a,f,c);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in f){const{children:p,...g}=f,v=Wi(g);return v.children=a.all(f),v}return Wi(f)}return(a.options.unknownHandler||Uk)(a,f,c)}function u(f){const c=[];if("children"in f){const h=f.children;let d=-1;for(;++d<h.length;){const m=a.one(h[d],f);if(m){if(d&&h[d-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=oh(m.value)),!Array.isArray(m)&&m.type==="element")){const p=m.children[0];p&&p.type==="text"&&(p.value=oh(p.value))}Array.isArray(m)?c.push(...m):c.push(m)}}}return c}}function Bk(e,t){e.position&&(t.position=F1(e))}function zk(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,Wi(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Uk(e,t){const n=t.data||{},r="value"in t&&!(da.call(n,"hProperties")||da.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 Hk(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
35
+ `}]}}const qi=function(e){if(e==null)return _k;if(typeof e=="function")return Yi(e);if(typeof e=="object")return Array.isArray(e)?Mk(e):Dk(e);if(typeof e=="string")return Nk(e);throw new Error("Expected function, string, or object as test")};function Mk(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=qi(e[n]);return Yi(r);function r(...i){let o=-1;for(;++o<t.length;)if(t[o].apply(this,i))return!0;return!1}}function Dk(e){const t=e;return Yi(n);function n(r){const i=r;let o;for(o in e)if(i[o]!==t[o])return!1;return!0}}function Nk(e){return Yi(t);function t(n){return n&&n.type===e}}function Yi(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 _k(){return!0}function Pk(e){return e!==null&&typeof e=="object"&&"type"in e}function FP(e){return e}const oh=[],Lk=!0,ca=!1,Fk="skip";function sh(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const o=qi(i),s=r?-1:1;a(e,void 0,[])();function a(l,u,f){const c=l&&typeof l=="object"?l:{};if(typeof c.type=="string"){const d=typeof c.tagName=="string"?c.tagName:typeof c.name=="string"?c.name:void 0;Object.defineProperty(h,"name",{value:"node ("+(l.type+(d?"<"+d+">":""))+")"})}return h;function h(){let d=oh,m,p,g;if((!t||o(l,u,f[f.length-1]||void 0))&&(d=Rk(n(l,f)),d[0]===ca))return d;if("children"in l&&l.children){const v=l;if(v.children&&d[0]!==Fk)for(p=(r?v.children.length:-1)+s,g=f.concat(v);p>-1&&p<v.children.length;){const y=v.children[p];if(m=a(y,p,g)(),m[0]===ca)return m;p=typeof m[1]=="number"?m[1]:p+s}}return d}}}function Rk(e){return Array.isArray(e)?e:typeof e=="number"?[Lk,e]:e==null?oh:[e]}function fa(e,t,n,r){let i,o,s;typeof t=="function"&&typeof n!="function"?(o=void 0,s=t,i=n):(o=t,s=n,i=r),sh(e,o,a,i);function a(l,u){const f=u[u.length-1],c=f?f.children.indexOf(l):void 0;return s(l,c,f)}}const da={}.hasOwnProperty,$k={};function Bk(e,t){const n=t||$k,r=new Map,i=new Map,o=new Map,s={...xk,...n.handlers},a={all:u,applyData:Uk,definitionById:r,footnoteById:i,footnoteCounts:o,footnoteOrder:[],handlers:s,one:l,options:n,patch:zk,wrap:jk};return fa(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const c=f.type==="definition"?r:i,h=String(f.identifier).toUpperCase();c.has(h)||c.set(h,f)}}),a;function l(f,c){const h=f.type,d=a.handlers[h];if(da.call(a.handlers,h)&&d)return d(a,f,c);if(a.options.passThrough&&a.options.passThrough.includes(h)){if("children"in f){const{children:p,...g}=f,v=Wi(g);return v.children=a.all(f),v}return Wi(f)}return(a.options.unknownHandler||Hk)(a,f,c)}function u(f){const c=[];if("children"in f){const h=f.children;let d=-1;for(;++d<h.length;){const m=a.one(h[d],f);if(m){if(d&&h[d-1].type==="break"&&(!Array.isArray(m)&&m.type==="text"&&(m.value=ah(m.value)),!Array.isArray(m)&&m.type==="element")){const p=m.children[0];p&&p.type==="text"&&(p.value=ah(p.value))}Array.isArray(m)?c.push(...m):c.push(m)}}}return c}}function zk(e,t){e.position&&(t.position=R1(e))}function Uk(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const s="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:s}}n.type==="element"&&o&&Object.assign(n.properties,Wi(o)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function Hk(e,t){const n=t.data||{},r="value"in t&&!(da.call(n,"hProperties")||da.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 jk(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
36
36
  `});++r<e.length;)r&&n.push({type:"text",value:`
37
37
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
38
- `}),n}function oh(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function sh(e,t){const n=$k(e,t),r=n.one(e,void 0),i=Ik(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
39
- `},i),o}function jk(e,t){return e&&"run"in e?async function(n,r){const i=sh(n,{file:r,...t});await e.run(i,r)}:function(n,r){return sh(n,{file:r,...e||t})}}function ah(e){if(e)throw e}var Ki=Object.prototype.hasOwnProperty,lh=Object.prototype.toString,uh=Object.defineProperty,ch=Object.getOwnPropertyDescriptor,fh=function(t){return typeof Array.isArray=="function"?Array.isArray(t):lh.call(t)==="[object Array]"},dh=function(t){if(!t||lh.call(t)!=="[object Object]")return!1;var n=Ki.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ki.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Ki.call(t,i)},hh=function(t,n){uh&&n.name==="__proto__"?uh(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},ph=function(t,n){if(n==="__proto__")if(Ki.call(t,n)){if(ch)return ch(t,n).value}else return;return t[n]},Vk=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,u=arguments.length,f=!1;for(typeof a=="boolean"&&(f=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=ph(a,n),i=ph(t,n),a!==i&&(f&&i&&(dh(i)||(o=fh(i)))?(o?(o=!1,s=r&&fh(r)?r:[]):s=r&&dh(r)?r:{},hh(a,{name:n,newValue:e(f,s,i)})):typeof i<"u"&&hh(a,{name:n,newValue:i}));return a};const ha=vn(Vk);function pa(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 Wk(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(l,...u){const f=e[++o];let c=-1;if(l){s(l);return}for(;++c<i.length;)(u[c]===null||u[c]===void 0)&&(u[c]=i[c]);i=u,f?qk(f,a)(...u):s(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function qk(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(i);try{l=e.apply(this,s)}catch(u){const f=u;if(a&&n)throw f;return i(f)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const $t={basename:Yk,dirname:Kk,extname:Gk,join:Qk,sep:"/"};function Yk(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');jr(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function Kk(e){if(jr(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 Gk(e){jr(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Qk(...e){let t=-1,n;for(;++t<e.length;)jr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Zk(n)}function Zk(e){jr(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,o=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===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=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function jr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Xk={cwd:eE};function eE(){return"/"}function ma(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function tE(e){if(typeof e=="string")e=new URL(e);else if(!ma(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 nE(e)}function nE(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 ga=["history","path","basename","stem","extname","dirname"];class mh{constructor(t){let n;t?ma(t)?n={path:t}:typeof t=="string"||rE(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Xk.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ga.length;){const o=ga[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)ga.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?$t.basename(this.path):void 0}set basename(t){va(t,"basename"),ya(t,"basename"),this.path=$t.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?$t.dirname(this.path):void 0}set dirname(t){gh(this.basename,"dirname"),this.path=$t.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?$t.extname(this.path):void 0}set extname(t){if(ya(t,"extname"),gh(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=$t.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ma(t)&&(t=tE(t)),va(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?$t.basename(this.path,this.extname):void 0}set stem(t){va(t,"stem"),ya(t,"stem"),this.path=$t.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 et(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 ya(e,t){if(e&&e.includes($t.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+$t.sep+"`")}function va(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function gh(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function rE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const iE=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},oE={}.hasOwnProperty;class ba extends iE{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=Wk()}copy(){const t=new ba;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ha(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(xa("data",this.frozen),this.namespace[t]=n,this):oE.call(this.namespace,t)&&this.namespace[t]||void 0:t?(xa("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=Gi(t),r=this.parser||this.Parser;return wa("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),wa("process",this.parser||this.Parser),Sa("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=Gi(t),l=r.parse(a);r.run(l,a,function(f,c,h){if(f||!c||!h)return u(f);const d=c,m=r.stringify(d,h);lE(m)?h.value=m:h.result=m,u(f,h)});function u(f,c){f||!c?s(f):o?o(c):n(void 0,c)}}}processSync(t){let n=!1,r;return this.freeze(),wa("processSync",this.parser||this.Parser),Sa("processSync",this.compiler||this.Compiler),this.process(t,i),vh("processSync","process",n),r;function i(o,s){n=!0,ah(o),r=s}}run(t,n,r){yh(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const l=Gi(n);i.run(t,l,u);function u(f,c,h){const d=c||t;f?a(f):s?s(d):r(void 0,d,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),vh("runSync","run",r),i;function o(s,a){ah(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=Gi(n),i=this.compiler||this.Compiler;return Sa("stringify",i),yh(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(xa("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[f,...c]=u;l(f,c)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))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(u.plugins),u.settings&&(i.settings=ha(!0,i.settings,u.settings))}function a(u){let f=-1;if(u!=null)if(Array.isArray(u))for(;++f<u.length;){const c=u[f];o(c)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,f){let c=-1,h=-1;for(;++c<r.length;)if(r[c][0]===u){h=c;break}if(h===-1)r.push([u,...f]);else if(f.length>0){let[d,...m]=f;const p=r[h][1];pa(p)&&pa(d)&&(d=ha(!0,p,d)),r[h]=[u,d,...m]}}}}const sE=new ba().freeze();function wa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Sa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function xa(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 yh(e){if(!pa(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function vh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Gi(e){return aE(e)?e:new mh(e)}function aE(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function lE(e){return typeof e=="string"||uE(e)}function uE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const cE="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",bh=[],wh={allowDangerousHtml:!0},fE=/^(https?|ircs?|mailto|xmpp)$/i,dE=[{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 Sh(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,a=e.rehypePlugins||bh,l=e.remarkPlugins||bh,u=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...wh}:wh,f=e.skipHtml,c=e.unwrapDisallowed,h=e.urlTransform||xh,d=sE().use(Gx).use(l).use(jk,u).use(a),m=new mh;typeof r=="string"&&(m.value=r);for(const y of dE)Object.hasOwn(e,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+cE+y.id,void 0);const p=d.parse(m);let g=d.runSync(p,m);return i&&(g={type:"element",tagName:"div",properties:{className:i},children:g.type==="root"?g.children:[g]}),fa(g,v),U1(g,{Fragment:x.Fragment,components:o,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function v(y,w,A){if(y.type==="raw"&&A&&typeof w=="number")return f?A.children.splice(w,1):A.children[w]={type:"text",value:y.value},w;if(y.type==="element"){let k;for(k in Js)if(Object.hasOwn(Js,k)&&Object.hasOwn(y.properties,k)){const E=y.properties[k],I=Js[k];(I===null||I.includes(y.tagName))&&(y.properties[k]=h(String(E||""),k,y))}}if(y.type==="element"){let k=t?!t.includes(y.tagName):s?s.includes(y.tagName):!1;if(!k&&n&&typeof w=="number"&&(k=!n(y,w,A)),k&&A&&typeof w=="number")return c&&y.children?A.children.splice(w,1,...y.children):A.children.splice(w,1),w}}}function xh(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||fE.test(e.slice(0,t))?e:""}function hE(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function kh(e,t,n){const i=qi((n||{}).ignore||[]),o=pE(t);let s=-1;for(;++s<o.length;)ih(e,"text",a);function a(u,f){let c=-1,h;for(;++c<f.length;){const d=f[c],m=h?h.children:void 0;if(i(d,m?m.indexOf(d):void 0,h))return;h=d}if(h)return l(u,f)}function l(u,f){const c=f[f.length-1],h=o[s][0],d=o[s][1];let m=0;const g=c.children.indexOf(u);let v=!1,y=[];h.lastIndex=0;let w=h.exec(u.value);for(;w;){const A=w.index,k={index:w.index,input:w.input,stack:[...f,u]};let E=d(...w,k);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?h.lastIndex=A+1:(m!==A&&y.push({type:"text",value:u.value.slice(m,A)}),Array.isArray(E)?y.push(...E):E&&y.push(E),m=A+w[0].length,v=!0),!h.global)break;w=h.exec(u.value)}return v?(m<u.value.length&&y.push({type:"text",value:u.value.slice(m)}),c.children.splice(g,1,...y)):y=[u],g+y.length}}function pE(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([mE(i[0]),gE(i[1])])}return t}function mE(e){return typeof e=="string"?new RegExp(hE(e),"g"):e}function gE(e){return typeof e=="function"?e:function(){return e}}function yE(e){kh(e,[/\r?\n|\r/g,vE])}function vE(){return{type:"break"}}function bE(){return function(e){yE(e)}}function Eh(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 ka="phrasing",Ea=["autolink","link","image","label"];function wE(){return{transforms:[TE],enter:{literalAutolink:xE,literalAutolinkEmail:Ca,literalAutolinkHttp:Ca,literalAutolinkWww:Ca},exit:{literalAutolink:AE,literalAutolinkEmail:CE,literalAutolinkHttp:kE,literalAutolinkWww:EE}}}function SE(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ka,notInConstruct:Ea},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ka,notInConstruct:Ea},{character:":",before:"[ps]",after:"\\/",inConstruct:ka,notInConstruct:Ea}]}}function xE(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ca(e){this.config.enter.autolinkProtocol.call(this,e)}function kE(e){this.config.exit.autolinkProtocol.call(this,e)}function EE(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 CE(e){this.config.exit.autolinkEmail.call(this,e)}function AE(e){this.exit(e)}function TE(e){kh(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,IE],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),OE]],{ignore:["link","linkReference"]})}function IE(e,t,n,r,i){let o="";if(!Ch(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!ME(n)))return!1;const s=DE(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function OE(e,t,n,r){return!Ch(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function ME(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 DE(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=Eh(e,"(");let o=Eh(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Ch(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Tn(n)||$i(n))&&(!t||n!==47)}Ah.peek=zE;function NE(){this.buffer()}function _E(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function PE(){this.buffer()}function LE(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function FE(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Mt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function RE(e){this.exit(e)}function $E(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Mt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function BE(e){this.exit(e)}function zE(){return"["}function Ah(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function UE(){return{enter:{gfmFootnoteCallString:NE,gfmFootnoteCall:_E,gfmFootnoteDefinitionLabelString:PE,gfmFootnoteDefinition:LE},exit:{gfmFootnoteCallString:FE,gfmFootnoteCall:RE,gfmFootnoteDefinitionLabelString:$E,gfmFootnoteDefinition:BE}}}function HE(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ah},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const a=o.createTracker(s);let l=a.move("[^");const u=o.enter("footnoteDefinition"),f=o.enter("label");return l+=a.move(o.safe(o.associationId(r),{before:l,after:"]"})),f(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
40
- `:" ")+o.indentLines(o.containerFlow(r,a.current()),t?Th:jE))),u(),l}}function jE(e,t,n){return t===0?e:Th(e,t,n)}function Th(e,t,n){return(n?"":" ")+e}const VE=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Ih.peek=GE;function WE(){return{canContainEols:["delete"],enter:{strikethrough:YE},exit:{strikethrough:KE}}}function qE(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:VE}],handlers:{delete:Ih}}}function YE(e){this.enter({type:"delete",children:[]},e)}function KE(e){this.exit(e)}function Ih(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function GE(){return"~"}function QE(e){return e.length}function ZE(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||QE,o=[],s=[],a=[],l=[];let u=0,f=-1;for(;++f<e.length;){const p=[],g=[];let v=-1;for(e[f].length>u&&(u=e[f].length);++v<e[f].length;){const y=JE(e[f][v]);if(n.alignDelimiters!==!1){const w=i(y);g[v]=w,(l[v]===void 0||w>l[v])&&(l[v]=w)}p.push(y)}s[f]=p,a[f]=g}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<u;)o[c]=Oh(r[c]);else{const p=Oh(r);for(;++c<u;)o[c]=p}c=-1;const h=[],d=[];for(;++c<u;){const p=o[c];let g="",v="";p===99?(g=":",v=":"):p===108?g=":":p===114&&(v=":");let y=n.alignDelimiters===!1?1:Math.max(1,l[c]-g.length-v.length);const w=g+"-".repeat(y)+v;n.alignDelimiters!==!1&&(y=g.length+y+v.length,y>l[c]&&(l[c]=y),d[c]=y),h[c]=w}s.splice(1,0,h),a.splice(1,0,d),f=-1;const m=[];for(;++f<s.length;){const p=s[f],g=a[f];c=-1;const v=[];for(;++c<u;){const y=p[c]||"";let w="",A="";if(n.alignDelimiters!==!1){const k=l[c]-(g[c]||0),E=o[c];E===114?w=" ".repeat(k):E===99?k%2?(w=" ".repeat(k/2+.5),A=" ".repeat(k/2-.5)):(w=" ".repeat(k/2),A=w):A=" ".repeat(k)}n.delimiterStart!==!1&&!c&&v.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&y==="")&&(n.delimiterStart!==!1||c)&&v.push(" "),n.alignDelimiters!==!1&&v.push(w),v.push(y),n.alignDelimiters!==!1&&v.push(A),n.padding!==!1&&v.push(" "),(n.delimiterEnd!==!1||c!==u-1)&&v.push("|")}m.push(n.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return m.join(`
41
- `)}function JE(e){return e==null?"":String(e)}function Oh(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 XE(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),eC);return i(),s}function eC(e,t,n){return">"+(n?"":" ")+e}function tC(e,t){return Mh(e,t.inConstruct,!0)&&!Mh(e,t.notInConstruct,!1)}function Mh(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 Dh(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,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}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 oC(e,t,n,r){const i=iC(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(rC(e,n)){const c=n.enter("codeIndented"),h=n.indentLines(o,sC);return c(),h}const a=n.createTracker(r),l=i.repeat(Math.max(nC(o,i)+1,3)),u=n.enter("codeFenced");let f=a.move(l);if(e.lang){const c=n.enter(`codeFencedLang${s}`);f+=a.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),c()}if(e.lang&&e.meta){const c=n.enter(`codeFencedMeta${s}`);f+=a.move(" "),f+=a.move(n.safe(e.meta,{before:f,after:`
38
+ `}),n}function ah(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function lh(e,t){const n=Bk(e,t),r=n.one(e,void 0),i=Ok(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:`
39
+ `},i),o}function Vk(e,t){return e&&"run"in e?async function(n,r){const i=lh(n,{file:r,...t});await e.run(i,r)}:function(n,r){return lh(n,{file:r,...e||t})}}function uh(e){if(e)throw e}var Ki=Object.prototype.hasOwnProperty,ch=Object.prototype.toString,fh=Object.defineProperty,dh=Object.getOwnPropertyDescriptor,hh=function(t){return typeof Array.isArray=="function"?Array.isArray(t):ch.call(t)==="[object Array]"},ph=function(t){if(!t||ch.call(t)!=="[object Object]")return!1;var n=Ki.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ki.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Ki.call(t,i)},mh=function(t,n){fh&&n.name==="__proto__"?fh(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},gh=function(t,n){if(n==="__proto__")if(Ki.call(t,n)){if(dh)return dh(t,n).value}else return;return t[n]},Wk=function e(){var t,n,r,i,o,s,a=arguments[0],l=1,u=arguments.length,f=!1;for(typeof a=="boolean"&&(f=a,a=arguments[1]||{},l=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});l<u;++l)if(t=arguments[l],t!=null)for(n in t)r=gh(a,n),i=gh(t,n),a!==i&&(f&&i&&(ph(i)||(o=hh(i)))?(o?(o=!1,s=r&&hh(r)?r:[]):s=r&&ph(r)?r:{},mh(a,{name:n,newValue:e(f,s,i)})):typeof i<"u"&&mh(a,{name:n,newValue:i}));return a};const ha=vn(Wk);function pa(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 qk(){const e=[],t={run:n,use:r};return t;function n(...i){let o=-1;const s=i.pop();if(typeof s!="function")throw new TypeError("Expected function as last argument, not "+s);a(null,...i);function a(l,...u){const f=e[++o];let c=-1;if(l){s(l);return}for(;++c<i.length;)(u[c]===null||u[c]===void 0)&&(u[c]=i[c]);i=u,f?Yk(f,a)(...u):s(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function Yk(e,t){let n;return r;function r(...s){const a=e.length>s.length;let l;a&&s.push(i);try{l=e.apply(this,s)}catch(u){const f=u;if(a&&n)throw f;return i(f)}a||(l&&l.then&&typeof l.then=="function"?l.then(o,i):l instanceof Error?i(l):o(l))}function i(s,...a){n||(n=!0,t(s,...a))}function o(s){i(null,s)}}const $t={basename:Kk,dirname:Gk,extname:Qk,join:Zk,sep:"/"};function Kk(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');jr(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let s=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else s<0&&(o=!0,s=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=s));return n===r?r=s:r<0&&(r=e.length),e.slice(n,r)}function Gk(e){if(jr(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 Qk(e){jr(e);let t=e.length,n=-1,r=0,i=-1,o=0,s;for(;t--;){const a=e.codePointAt(t);if(a===47){if(s){r=t+1;break}continue}n<0&&(s=!0,n=t+1),a===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Zk(...e){let t=-1,n;for(;++t<e.length;)jr(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":Jk(n)}function Jk(e){jr(e);const t=e.codePointAt(0)===47;let n=Xk(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Xk(e,t){let n="",r=0,i=-1,o=0,s=-1,a,l;for(;++s<=e.length;){if(s<e.length)a=e.codePointAt(s);else{if(a===47)break;a=47}if(a===47){if(!(i===s-1||o===1))if(i!==s-1&&o===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=s,o=0;continue}}else if(n.length>0){n="",r=0,i=s,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1;i=s,o=0}else a===46&&o>-1?o++:o=-1}return n}function jr(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const eE={cwd:tE};function tE(){return"/"}function ma(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function nE(e){if(typeof e=="string")e=new URL(e);else if(!ma(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 rE(e)}function rE(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 ga=["history","path","basename","stem","extname","dirname"];class yh{constructor(t){let n;t?ma(t)?n={path:t}:typeof t=="string"||iE(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":eE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<ga.length;){const o=ga[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let i;for(i in n)ga.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?$t.basename(this.path):void 0}set basename(t){va(t,"basename"),ya(t,"basename"),this.path=$t.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?$t.dirname(this.path):void 0}set dirname(t){vh(this.basename,"dirname"),this.path=$t.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?$t.extname(this.path):void 0}set extname(t){if(ya(t,"extname"),vh(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=$t.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ma(t)&&(t=nE(t)),va(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?$t.basename(this.path,this.extname):void 0}set stem(t){va(t,"stem"),ya(t,"stem"),this.path=$t.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 et(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 ya(e,t){if(e&&e.includes($t.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+$t.sep+"`")}function va(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function vh(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function iE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const oE=function(e){const r=this.constructor.prototype,i=r[e],o=function(){return i.apply(o,arguments)};return Object.setPrototypeOf(o,r),o},sE={}.hasOwnProperty;class ba extends oE{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=qk()}copy(){const t=new ba;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(ha(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(xa("data",this.frozen),this.namespace[t]=n,this):sE.call(this.namespace,t)&&this.namespace[t]||void 0:t?(xa("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=Gi(t),r=this.parser||this.Parser;return wa("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),wa("process",this.parser||this.Parser),Sa("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(o,s){const a=Gi(t),l=r.parse(a);r.run(l,a,function(f,c,h){if(f||!c||!h)return u(f);const d=c,m=r.stringify(d,h);uE(m)?h.value=m:h.result=m,u(f,h)});function u(f,c){f||!c?s(f):o?o(c):n(void 0,c)}}}processSync(t){let n=!1,r;return this.freeze(),wa("processSync",this.parser||this.Parser),Sa("processSync",this.compiler||this.Compiler),this.process(t,i),wh("processSync","process",n),r;function i(o,s){n=!0,uh(o),r=s}}run(t,n,r){bh(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(s,a){const l=Gi(n);i.run(t,l,u);function u(f,c,h){const d=c||t;f?a(f):s?s(d):r(void 0,d,h)}}}runSync(t,n){let r=!1,i;return this.run(t,n,o),wh("runSync","run",r),i;function o(s,a){uh(s),i=a,r=!0}}stringify(t,n){this.freeze();const r=Gi(n),i=this.compiler||this.Compiler;return Sa("stringify",i),bh(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(xa("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):s(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[f,...c]=u;l(f,c)}else s(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function s(u){if(!("plugins"in u)&&!("settings"in u))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(u.plugins),u.settings&&(i.settings=ha(!0,i.settings,u.settings))}function a(u){let f=-1;if(u!=null)if(Array.isArray(u))for(;++f<u.length;){const c=u[f];o(c)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,f){let c=-1,h=-1;for(;++c<r.length;)if(r[c][0]===u){h=c;break}if(h===-1)r.push([u,...f]);else if(f.length>0){let[d,...m]=f;const p=r[h][1];pa(p)&&pa(d)&&(d=ha(!0,p,d)),r[h]=[u,d,...m]}}}}const aE=new ba().freeze();function wa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Sa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function xa(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 bh(e){if(!pa(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function wh(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Gi(e){return lE(e)?e:new yh(e)}function lE(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function uE(e){return typeof e=="string"||cE(e)}function cE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const fE="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Sh=[],xh={allowDangerousHtml:!0},dE=/^(https?|ircs?|mailto|xmpp)$/i,hE=[{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 kh(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,s=e.disallowedElements,a=e.rehypePlugins||Sh,l=e.remarkPlugins||Sh,u=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...xh}:xh,f=e.skipHtml,c=e.unwrapDisallowed,h=e.urlTransform||Eh,d=aE().use(Qx).use(l).use(Vk,u).use(a),m=new yh;typeof r=="string"&&(m.value=r);for(const y of hE)Object.hasOwn(e,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+fE+y.id,void 0);const p=d.parse(m);let g=d.runSync(p,m);return i&&(g={type:"element",tagName:"div",properties:{className:i},children:g.type==="root"?g.children:[g]}),fa(g,v),H1(g,{Fragment:x.Fragment,components:o,ignoreInvalidStyle:!0,jsx:x.jsx,jsxs:x.jsxs,passKeys:!0,passNode:!0});function v(y,w,C){if(y.type==="raw"&&C&&typeof w=="number")return f?C.children.splice(w,1):C.children[w]={type:"text",value:y.value},w;if(y.type==="element"){let k;for(k in Js)if(Object.hasOwn(Js,k)&&Object.hasOwn(y.properties,k)){const E=y.properties[k],I=Js[k];(I===null||I.includes(y.tagName))&&(y.properties[k]=h(String(E||""),k,y))}}if(y.type==="element"){let k=t?!t.includes(y.tagName):s?s.includes(y.tagName):!1;if(!k&&n&&typeof w=="number"&&(k=!n(y,w,C)),k&&C&&typeof w=="number")return c&&y.children?C.children.splice(w,1,...y.children):C.children.splice(w,1),w}}}function Eh(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||dE.test(e.slice(0,t))?e:""}function pE(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Ch(e,t,n){const i=qi((n||{}).ignore||[]),o=mE(t);let s=-1;for(;++s<o.length;)sh(e,"text",a);function a(u,f){let c=-1,h;for(;++c<f.length;){const d=f[c],m=h?h.children:void 0;if(i(d,m?m.indexOf(d):void 0,h))return;h=d}if(h)return l(u,f)}function l(u,f){const c=f[f.length-1],h=o[s][0],d=o[s][1];let m=0;const g=c.children.indexOf(u);let v=!1,y=[];h.lastIndex=0;let w=h.exec(u.value);for(;w;){const C=w.index,k={index:w.index,input:w.input,stack:[...f,u]};let E=d(...w,k);if(typeof E=="string"&&(E=E.length>0?{type:"text",value:E}:void 0),E===!1?h.lastIndex=C+1:(m!==C&&y.push({type:"text",value:u.value.slice(m,C)}),Array.isArray(E)?y.push(...E):E&&y.push(E),m=C+w[0].length,v=!0),!h.global)break;w=h.exec(u.value)}return v?(m<u.value.length&&y.push({type:"text",value:u.value.slice(m)}),c.children.splice(g,1,...y)):y=[u],g+y.length}}function mE(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([gE(i[0]),yE(i[1])])}return t}function gE(e){return typeof e=="string"?new RegExp(pE(e),"g"):e}function yE(e){return typeof e=="function"?e:function(){return e}}function vE(e){Ch(e,[/\r?\n|\r/g,bE])}function bE(){return{type:"break"}}function wE(){return function(e){vE(e)}}function Ah(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 ka="phrasing",Ea=["autolink","link","image","label"];function SE(){return{transforms:[IE],enter:{literalAutolink:kE,literalAutolinkEmail:Ca,literalAutolinkHttp:Ca,literalAutolinkWww:Ca},exit:{literalAutolink:TE,literalAutolinkEmail:AE,literalAutolinkHttp:EE,literalAutolinkWww:CE}}}function xE(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ka,notInConstruct:Ea},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ka,notInConstruct:Ea},{character:":",before:"[ps]",after:"\\/",inConstruct:ka,notInConstruct:Ea}]}}function kE(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ca(e){this.config.enter.autolinkProtocol.call(this,e)}function EE(e){this.config.exit.autolinkProtocol.call(this,e)}function CE(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 AE(e){this.config.exit.autolinkEmail.call(this,e)}function TE(e){this.exit(e)}function IE(e){Ch(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,OE],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),ME]],{ignore:["link","linkReference"]})}function OE(e,t,n,r,i){let o="";if(!Th(i)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!DE(n)))return!1;const s=NE(n+r);if(!s[0])return!1;const a={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[a,{type:"text",value:s[1]}]:a}function ME(e,t,n,r){return!Th(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function DE(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 NE(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=Ah(e,"(");let o=Ah(e,")");for(;r!==-1&&i>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Th(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Tn(n)||$i(n))&&(!t||n!==47)}Ih.peek=UE;function _E(){this.buffer()}function PE(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function LE(){this.buffer()}function FE(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function RE(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Mt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $E(e){this.exit(e)}function BE(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Mt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function zE(e){this.exit(e)}function UE(){return"["}function Ih(e,t,n,r){const i=n.createTracker(r);let o=i.move("[^");const s=n.enter("footnoteReference"),a=n.enter("reference");return o+=i.move(n.safe(n.associationId(e),{after:"]",before:o})),a(),s(),o+=i.move("]"),o}function HE(){return{enter:{gfmFootnoteCallString:_E,gfmFootnoteCall:PE,gfmFootnoteDefinitionLabelString:LE,gfmFootnoteDefinition:FE},exit:{gfmFootnoteCallString:RE,gfmFootnoteCall:$E,gfmFootnoteDefinitionLabelString:BE,gfmFootnoteDefinition:zE}}}function jE(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ih},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,o,s){const a=o.createTracker(s);let l=a.move("[^");const u=o.enter("footnoteDefinition"),f=o.enter("label");return l+=a.move(o.safe(o.associationId(r),{before:l,after:"]"})),f(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
40
+ `:" ")+o.indentLines(o.containerFlow(r,a.current()),t?Oh:VE))),u(),l}}function VE(e,t,n){return t===0?e:Oh(e,t,n)}function Oh(e,t,n){return(n?"":" ")+e}const WE=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Mh.peek=QE;function qE(){return{canContainEols:["delete"],enter:{strikethrough:KE},exit:{strikethrough:GE}}}function YE(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:WE}],handlers:{delete:Mh}}}function KE(e){this.enter({type:"delete",children:[]},e)}function GE(e){this.exit(e)}function Mh(e,t,n,r){const i=n.createTracker(r),o=n.enter("strikethrough");let s=i.move("~~");return s+=n.containerPhrasing(e,{...i.current(),before:s,after:"~"}),s+=i.move("~~"),o(),s}function QE(){return"~"}function ZE(e){return e.length}function JE(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||ZE,o=[],s=[],a=[],l=[];let u=0,f=-1;for(;++f<e.length;){const p=[],g=[];let v=-1;for(e[f].length>u&&(u=e[f].length);++v<e[f].length;){const y=XE(e[f][v]);if(n.alignDelimiters!==!1){const w=i(y);g[v]=w,(l[v]===void 0||w>l[v])&&(l[v]=w)}p.push(y)}s[f]=p,a[f]=g}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<u;)o[c]=Dh(r[c]);else{const p=Dh(r);for(;++c<u;)o[c]=p}c=-1;const h=[],d=[];for(;++c<u;){const p=o[c];let g="",v="";p===99?(g=":",v=":"):p===108?g=":":p===114&&(v=":");let y=n.alignDelimiters===!1?1:Math.max(1,l[c]-g.length-v.length);const w=g+"-".repeat(y)+v;n.alignDelimiters!==!1&&(y=g.length+y+v.length,y>l[c]&&(l[c]=y),d[c]=y),h[c]=w}s.splice(1,0,h),a.splice(1,0,d),f=-1;const m=[];for(;++f<s.length;){const p=s[f],g=a[f];c=-1;const v=[];for(;++c<u;){const y=p[c]||"";let w="",C="";if(n.alignDelimiters!==!1){const k=l[c]-(g[c]||0),E=o[c];E===114?w=" ".repeat(k):E===99?k%2?(w=" ".repeat(k/2+.5),C=" ".repeat(k/2-.5)):(w=" ".repeat(k/2),C=w):C=" ".repeat(k)}n.delimiterStart!==!1&&!c&&v.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&y==="")&&(n.delimiterStart!==!1||c)&&v.push(" "),n.alignDelimiters!==!1&&v.push(w),v.push(y),n.alignDelimiters!==!1&&v.push(C),n.padding!==!1&&v.push(" "),(n.delimiterEnd!==!1||c!==u-1)&&v.push("|")}m.push(n.delimiterEnd===!1?v.join("").replace(/ +$/,""):v.join(""))}return m.join(`
41
+ `)}function XE(e){return e==null?"":String(e)}function Dh(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 eC(e,t,n,r){const i=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const s=n.indentLines(n.containerFlow(e,o.current()),tC);return i(),s}function tC(e,t,n){return">"+(n?"":" ")+e}function nC(e,t){return Nh(e,t.inConstruct,!0)&&!Nh(e,t.notInConstruct,!1)}function Nh(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
+ `&&nC(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
43
+ `}function rC(e,t){const n=String(e);let r=n.indexOf(t),i=r,o=0,s=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++o>s&&(s=o):o=1,i=r+t.length,r=n.indexOf(t,i);return s}function iC(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 oC(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=oC(n),o=e.value||"",s=i==="`"?"GraveAccent":"Tilde";if(iC(e,n)){const c=n.enter("codeIndented"),h=n.indentLines(o,aC);return c(),h}const a=n.createTracker(r),l=i.repeat(Math.max(rC(o,i)+1,3)),u=n.enter("codeFenced");let f=a.move(l);if(e.lang){const c=n.enter(`codeFencedLang${s}`);f+=a.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),c()}if(e.lang&&e.meta){const c=n.enter(`codeFencedMeta${s}`);f+=a.move(" "),f+=a.move(n.safe(e.meta,{before:f,after:`
44
44
  `,encode:["`"],...a.current()})),c()}return f+=a.move(`
45
45
  `),o&&(f+=a.move(o+`
46
- `)),f+=a.move(l),u(),f}function sC(e,t,n){return(n?"":" ")+e}function Aa(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=Aa(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
47
- `,...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),s(),u}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}function Vr(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Qi(e,t,n){const r=qn(e),i=qn(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Nh.peek=uC;function Nh(e,t,n,r){const i=lC(n),o=n.enter("emphasis"),s=n.createTracker(r),a=s.move(i);let l=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const u=l.charCodeAt(0),f=Qi(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(l=Vr(u)+l.slice(1));const c=l.charCodeAt(l.length-1),h=Qi(r.after.charCodeAt(0),c,i);h.inside&&(l=l.slice(0,-1)+Vr(c));const d=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},a+l+d}function uC(e,t,n){return n.options.emphasis||"*"}function cC(e,t){let n=!1;return fa(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,ca}),!!((!e.depth||e.depth<3)&&Xs(e)&&(t.options.setext||n))}function fC(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(cC(e,n)){const f=n.enter("headingSetext"),c=n.enter("phrasing"),h=n.containerPhrasing(e,{...o.current(),before:`
46
+ `)),f+=a.move(l),u(),f}function aC(e,t,n){return(n?"":" ")+e}function Aa(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 lC(e,t,n,r){const i=Aa(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
47
+ `,...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),s(),u}function uC(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Vr(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Qi(e,t,n){const r=qn(e),i=qn(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Ph.peek=cC;function Ph(e,t,n,r){const i=uC(n),o=n.enter("emphasis"),s=n.createTracker(r),a=s.move(i);let l=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const u=l.charCodeAt(0),f=Qi(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(l=Vr(u)+l.slice(1));const c=l.charCodeAt(l.length-1),h=Qi(r.after.charCodeAt(0),c,i);h.inside&&(l=l.slice(0,-1)+Vr(c));const d=s.move(i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},a+l+d}function cC(e,t,n){return n.options.emphasis||"*"}function fC(e,t){let n=!1;return fa(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,ca}),!!((!e.depth||e.depth<3)&&Xs(e)&&(t.options.setext||n))}function dC(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(fC(e,n)){const f=n.enter("headingSetext"),c=n.enter("phrasing"),h=n.containerPhrasing(e,{...o.current(),before:`
48
48
  `,after:`
49
49
  `});return c(),f(),h+`
50
50
  `+(i===1?"=":"-").repeat(h.length-(Math.max(h.lastIndexOf("\r"),h.lastIndexOf(`
51
51
  `))+1))}const s="#".repeat(i),a=n.enter("headingAtx"),l=n.enter("phrasing");o.move(s+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
52
- `,...o.current()});return/^[\t ]/.test(u)&&(u=Vr(u.charCodeAt(0))+u.slice(1)),u=u?s+" "+u:s,n.options.closeAtx&&(u+=" "+s),l(),a(),u}_h.peek=dC;function _h(e){return e.value||""}function dC(){return"<"}Ph.peek=hC;function Ph(e,t,n,r){const i=Aa(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),u+=l.move(")"),s(),u}function hC(){return"!"}Lh.peek=pC;function Lh(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const u=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=f,o(),i==="full"||!u||u!==c?l+=a.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function pC(){return"!"}Fh.peek=mC;function Fh(e,t,n){let r=e.value||"",i="`",o=-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+" ");++o<n.unsafe.length;){const s=n.unsafe[o],a=n.compilePattern(s);let l;if(s.atBreak)for(;l=a.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return i+r+i}function mC(){return"`"}function Rh(e,t){const n=Xs(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))}$h.peek=gC;function $h(e,t,n,r){const i=Aa(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let a,l;if(Rh(e,n)){const f=n.stack;n.stack=[],a=n.enter("autolink");let c=s.move("<");return c+=s.move(n.containerPhrasing(e,{before:c,after:">",...s.current()})),c+=s.move(">"),a(),n.stack=f,c}a=n.enter("link"),l=n.enter("label");let u=s.move("[");return u+=s.move(n.containerPhrasing(e,{before:u,after:"](",...s.current()})),u+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(n.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(l=n.enter("destinationRaw"),u+=s.move(n.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${o}`),u+=s.move(" "+i),u+=s.move(n.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),l()),u+=s.move(")"),a(),u}function gC(e,t,n){return Rh(e,n)?"<":"["}Bh.peek=yC;function Bh(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=f,o(),i==="full"||!u||u!==c?l+=a.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function yC(){return"["}function Ta(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=Ta(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 zh(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"),o=n.bulletCurrent;let s=e.ordered?bC(n):Ta(n);const a=e.ordered?s==="."?")":".":vC(n);let l=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&f&&(!f.children||!f.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),zh(n)===s&&f){let c=-1;for(;++c<e.children.length;){const h=e.children[c];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(s=a),n.bulletCurrent=s;const u=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),u}function SC(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 xC(e,t,n,r){const i=SC(n);let o=n.bulletCurrent||Ta(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=n.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,a.current()),f);return l(),u;function f(c,h,d){return h?(d?"":" ".repeat(s))+c:(d?o:o+" ".repeat(s-o.length))+c}}function kC(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const EC=qi(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function CC(e,t,n,r){return(e.children.some(function(s){return EC(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function AC(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Uh.peek=TC;function Uh(e,t,n,r){const i=AC(n),o=n.enter("strong"),s=n.createTracker(r),a=s.move(i+i);let l=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const u=l.charCodeAt(0),f=Qi(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(l=Vr(u)+l.slice(1));const c=l.charCodeAt(l.length-1),h=Qi(r.after.charCodeAt(0),c,i);h.inside&&(l=l.slice(0,-1)+Vr(c));const d=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},a+l+d}function TC(e,t,n){return n.options.strong||"*"}function IC(e,t,n,r){return n.safe(e.value,r)}function OC(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 MC(e,t,n){const r=(zh(n)+(n.options.ruleSpaces?" ":"")).repeat(OC(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Hh={blockquote:XE,break:Dh,code:oC,definition:aC,emphasis:Nh,hardBreak:Dh,heading:fC,html:_h,image:Ph,imageReference:Lh,inlineCode:Fh,link:$h,linkReference:Bh,list:wC,listItem:xC,paragraph:kC,root:CC,strong:Uh,text:IC,thematicBreak:MC};function DC(){return{enter:{table:NC,tableData:jh,tableHeader:jh,tableRow:PC},exit:{codeText:LC,table:_C,tableData:Ia,tableHeader:Ia,tableRow:Ia}}}function NC(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 PC(e){this.enter({type:"tableRow",children:[]},e)}function Ia(e){this.exit(e)}function jh(e){this.enter({type:"tableCell",children:[]},e)}function LC(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,FC));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function FC(e,t){return t==="|"?t:e}function RC(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
52
+ `,...o.current()});return/^[\t ]/.test(u)&&(u=Vr(u.charCodeAt(0))+u.slice(1)),u=u?s+" "+u:s,n.options.closeAtx&&(u+=" "+s),l(),a(),u}Lh.peek=hC;function Lh(e){return e.value||""}function hC(){return"<"}Fh.peek=pC;function Fh(e,t,n,r){const i=Aa(n),o=i==='"'?"Quote":"Apostrophe",s=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${o}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),u+=l.move(")"),s(),u}function pC(){return"!"}Rh.peek=mC;function Rh(e,t,n,r){const i=e.referenceType,o=n.enter("imageReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const u=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=f,o(),i==="full"||!u||u!==c?l+=a.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function mC(){return"!"}$h.peek=gC;function $h(e,t,n){let r=e.value||"",i="`",o=-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+" ");++o<n.unsafe.length;){const s=n.unsafe[o],a=n.compilePattern(s);let l;if(s.atBreak)for(;l=a.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return i+r+i}function gC(){return"`"}function Bh(e,t){const n=Xs(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))}zh.peek=yC;function zh(e,t,n,r){const i=Aa(n),o=i==='"'?"Quote":"Apostrophe",s=n.createTracker(r);let a,l;if(Bh(e,n)){const f=n.stack;n.stack=[],a=n.enter("autolink");let c=s.move("<");return c+=s.move(n.containerPhrasing(e,{before:c,after:">",...s.current()})),c+=s.move(">"),a(),n.stack=f,c}a=n.enter("link"),l=n.enter("label");let u=s.move("[");return u+=s.move(n.containerPhrasing(e,{before:u,after:"](",...s.current()})),u+=s.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=s.move("<"),u+=s.move(n.safe(e.url,{before:u,after:">",...s.current()})),u+=s.move(">")):(l=n.enter("destinationRaw"),u+=s.move(n.safe(e.url,{before:u,after:e.title?" ":")",...s.current()}))),l(),e.title&&(l=n.enter(`title${o}`),u+=s.move(" "+i),u+=s.move(n.safe(e.title,{before:u,after:i,...s.current()})),u+=s.move(i),l()),u+=s.move(")"),a(),u}function yC(e,t,n){return Bh(e,n)?"<":"["}Uh.peek=vC;function Uh(e,t,n,r){const i=e.referenceType,o=n.enter("linkReference");let s=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),s();const f=n.stack;n.stack=[],s=n.enter("reference");const c=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return s(),n.stack=f,o(),i==="full"||!u||u!==c?l+=a.move(c+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function vC(){return"["}function Ta(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 bC(e){const t=Ta(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 wC(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 Hh(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 SC(e,t,n,r){const i=n.enter("list"),o=n.bulletCurrent;let s=e.ordered?wC(n):Ta(n);const a=e.ordered?s==="."?")":".":bC(n);let l=t&&n.bulletLastUsed?s===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((s==="*"||s==="-")&&f&&(!f.children||!f.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),Hh(n)===s&&f){let c=-1;for(;++c<e.children.length;){const h=e.children[c];if(h&&h.type==="listItem"&&h.children&&h.children[0]&&h.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(s=a),n.bulletCurrent=s;const u=n.containerFlow(e,r);return n.bulletLastUsed=s,n.bulletCurrent=o,i(),u}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 kC(e,t,n,r){const i=xC(n);let o=n.bulletCurrent||Ta(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const a=n.createTracker(r);a.move(o+" ".repeat(s-o.length)),a.shift(s);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,a.current()),f);return l(),u;function f(c,h,d){return h?(d?"":" ".repeat(s))+c:(d?o:o+" ".repeat(s-o.length))+c}}function EC(e,t,n,r){const i=n.enter("paragraph"),o=n.enter("phrasing"),s=n.containerPhrasing(e,r);return o(),i(),s}const CC=qi(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function AC(e,t,n,r){return(e.children.some(function(s){return CC(s)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function TC(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}jh.peek=IC;function jh(e,t,n,r){const i=TC(n),o=n.enter("strong"),s=n.createTracker(r),a=s.move(i+i);let l=s.move(n.containerPhrasing(e,{after:i,before:a,...s.current()}));const u=l.charCodeAt(0),f=Qi(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(l=Vr(u)+l.slice(1));const c=l.charCodeAt(l.length-1),h=Qi(r.after.charCodeAt(0),c,i);h.inside&&(l=l.slice(0,-1)+Vr(c));const d=s.move(i+i);return o(),n.attentionEncodeSurroundingInfo={after:h.outside,before:f.outside},a+l+d}function IC(e,t,n){return n.options.strong||"*"}function OC(e,t,n,r){return n.safe(e.value,r)}function MC(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 DC(e,t,n){const r=(Hh(n)+(n.options.ruleSpaces?" ":"")).repeat(MC(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Vh={blockquote:eC,break:_h,code:sC,definition:lC,emphasis:Ph,hardBreak:_h,heading:dC,html:Lh,image:Fh,imageReference:Rh,inlineCode:$h,link:zh,linkReference:Uh,list:SC,listItem:kC,paragraph:EC,root:AC,strong:jh,text:OC,thematicBreak:DC};function NC(){return{enter:{table:_C,tableData:Wh,tableHeader:Wh,tableRow:LC},exit:{codeText:FC,table:PC,tableData:Ia,tableHeader:Ia,tableRow:Ia}}}function _C(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 PC(e){this.exit(e),this.data.inTable=void 0}function LC(e){this.enter({type:"tableRow",children:[]},e)}function Ia(e){this.exit(e)}function Wh(e){this.enter({type:"tableCell",children:[]},e)}function FC(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,RC));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function RC(e,t){return t==="|"?t:e}function $C(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,o=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:s,tableCell:l,tableRow:a}};function s(d,m,p,g){return u(f(d,p,g),d.align)}function a(d,m,p,g){const v=c(d,p,g),y=u([v]);return y.slice(0,y.indexOf(`
54
- `))}function l(d,m,p,g){const v=p.enter("tableCell"),y=p.enter("phrasing"),w=p.containerPhrasing(d,{...g,before:o,after:o});return y(),v(),w}function u(d,m){return ZE(d,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function f(d,m,p){const g=d.children;let v=-1;const y=[],w=m.enter("table");for(;++v<g.length;)y[v]=c(g[v],m,p);return w(),y}function c(d,m,p){const g=d.children;let v=-1;const y=[],w=m.enter("tableRow");for(;++v<g.length;)y[v]=l(g[v],d,m,p);return w(),y}function h(d,m,p){let g=Hh.inlineCode(d,m,p);return p.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function $C(){return{exit:{taskListCheckValueChecked:Vh,taskListCheckValueUnchecked:Vh,paragraph:zC}}}function BC(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:UC}}}function Vh(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function zC(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 o=-1,s;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){s=a;break}}s===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 UC(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(s);let l=Hh.listItem(e,t,n,{...r,...a.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(f){return f+s}}function HC(){return[wE(),UE(),WE(),DC(),$C()]}function jC(e){return{extensions:[SE(),HE(e),qE(),RC(e),BC()]}}const VC={tokenize:QC,partial:!0},Wh={tokenize:ZC,partial:!0},qh={tokenize:JC,partial:!0},Yh={tokenize:XC,partial:!0},WC={tokenize:eA,partial:!0},Kh={name:"wwwAutolink",tokenize:KC,previous:Qh},Gh={name:"protocolAutolink",tokenize:GC,previous:Zh},Kt={name:"emailAutolink",tokenize:YC,previous:Jh},Bt={};function qC(){return{text:Bt}}let In=48;for(;In<123;)Bt[In]=Kt,In++,In===58?In=65:In===91&&(In=97);Bt[43]=Kt,Bt[45]=Kt,Bt[46]=Kt,Bt[95]=Kt,Bt[72]=[Kt,Gh],Bt[104]=[Kt,Gh],Bt[87]=[Kt,Kh],Bt[119]=[Kt,Kh];function YC(e,t,n){const r=this;let i,o;return s;function s(c){return!Oa(c)||!Jh.call(r,r.previous)||Ma(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return Oa(c)?(e.consume(c),a):c===64?(e.consume(c),l):n(c)}function l(c){return c===46?e.check(WC,f,u)(c):c===45||c===95||tt(c)?(o=!0,e.consume(c),l):f(c)}function u(c){return e.consume(c),i=!0,l}function f(c){return o&&i&&ot(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function KC(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!Qh.call(r,r.previous)||Ma(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(VC,e.attempt(Wh,e.attempt(qh,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function GC(e,t,n){const r=this;let i="",o=!1;return s;function s(c){return(c===72||c===104)&&Zh.call(r,r.previous)&&!Ma(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):n(c)}function a(c){if(ot(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(c),l}return n(c)}function l(c){return c===47?(e.consume(c),o?u:(o=!0,l)):n(c)}function u(c){return c===null||Ri(c)||De(c)||Tn(c)||$i(c)?n(c):e.attempt(Wh,e.attempt(qh,f),n)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function QC(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function ZC(e,t,n){let r,i,o;return s;function s(u){return u===46||u===95?e.check(Yh,l,a)(u):u===null||De(u)||Tn(u)||u!==45&&$i(u)?l(u):(o=!0,e.consume(u),s)}function a(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),s}function l(u){return i||r||!o?n(u):t(u)}}function JC(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(Yh,t,o)(s):s===null||De(s)||Tn(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),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),o):a===93?(e.consume(a),i):a===60||a===null||De(a)||Tn(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||De(a)||Tn(a)?t(a):r(a)}function o(a){return ot(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):ot(a)?(e.consume(a),s):n(a)}}function eA(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return tt(o)?n(o):t(o)}}function Qh(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||De(e)}function Zh(e){return!ot(e)}function Jh(e){return!(e===47||Oa(e))}function Oa(e){return e===43||e===45||e===46||e===95||tt(e)}function Ma(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 tA={tokenize:uA,partial:!0};function nA(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:sA,continuation:{tokenize:aA},exit:lA}},text:{91:{name:"gfmFootnoteCall",tokenize:oA},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:rA,resolveTo:iA}}}}function rA(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){s=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(!s||!s._balanced)return n(l);const u=Mt(r.sliceSerialize({start:s.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function iA(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 o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function oA(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),l}function l(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(o>999||c===93&&!s||c===null||c===91||De(c))return n(c);if(c===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Mt(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return De(c)||(s=!0),o++,e.consume(c),c===92?f:u}function f(c){return c===91||c===92||c===93?(e.consume(c),o++,u):u(c)}}function sA(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,a;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(m)}function f(m){if(s>999||m===93&&!a||m===null||m===91||De(m))return n(m);if(m===93){e.exit("chunkString");const p=e.exit("gfmFootnoteDefinitionLabelString");return o=Mt(r.sliceSerialize(p)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return De(m)||(a=!0),s++,e.consume(m),m===92?c:f}function c(m){return m===91||m===92||m===93?(e.consume(m),s++,f):f(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(o)||i.push(o),ke(e,d,"gfmFootnoteDefinitionWhitespace")):n(m)}function d(m){return t(m)}}function aA(e,t,n){return e.check($r,t,e.attempt(tA,t,n))}function lA(e){e.exit("gfmFootnoteDefinition")}function uA(e,t,n){const r=this;return ke(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function cA(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let u=l;for(;u--;)if(s[u][0]==="exit"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[u][1].end.offset-s[u][1].start.offset){s[l][1].type="strikethroughSequence",s[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[u][1].start),end:Object.assign({},s[l][1].end)},c={type:"strikethroughText",start:Object.assign({},s[u][1].end),end:Object.assign({},s[l][1].start)},h=[["enter",f,a],["enter",s[u][1],a],["exit",s[u][1],a],["enter",c,a]],d=a.parser.constructs.insideSpan.null;d&&mt(h,h.length,0,Bi(d,s.slice(u+1,l),a)),mt(h,h.length,0,[["exit",c,a],["enter",s[l][1],a],["exit",s[l][1],a],["exit",f,a]]),mt(s,u-1,l-u+3,h),l=u+h.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function o(s,a,l){const u=this.previous,f=this.events;let c=0;return h;function h(m){return u===126&&f[f.length-1][1].type!=="characterEscape"?l(m):(s.enter("strikethroughSequenceTemporary"),d(m))}function d(m){const p=qn(u);if(m===126)return c>1?l(m):(s.consume(m),c++,d);if(c<2&&!n)return l(m);const g=s.exit("strikethroughSequenceTemporary"),v=qn(m);return g._open=!v||v===2&&!!p,g._close=!p||p===2&&!!v,a(m)}}}class fA{constructor(){this.map=[]}add(t,n,r){dA(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[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.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function dA(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 hA(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 o=r.length-1;r[o]=r[o]==="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 pA(){return{flow:{null:{name:"table",tokenize:mA,resolveAll:gA}}}}function mA(e,t,n){const r=this;let i=0,o=0,s;return a;function a(T){let O=r.events.length-1;for(;O>-1;){const F=r.events[O][1].type;if(F==="lineEnding"||F==="linePrefix")O--;else break}const B=O>-1?r.events[O][1].type:null,L=B==="tableHead"||B==="tableRow"?E:l;return L===E&&r.parser.lazy[r.now().line]?n(T):L(T)}function l(T){return e.enter("tableHead"),e.enter("tableRow"),u(T)}function u(T){return T===124||(s=!0,o+=1),f(T)}function f(T){return T===null?n(T):ce(T)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),d):n(T):ve(T)?ke(e,f,"whitespace")(T):(o+=1,s&&(s=!1,i+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),s=!0,f):(e.enter("data"),c(T)))}function c(T){return T===null||T===124||De(T)?(e.exit("data"),f(T)):(e.consume(T),T===92?h:c)}function h(T){return T===92||T===124?(e.consume(T),c):c(T)}function d(T){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(T):(e.enter("tableDelimiterRow"),s=!1,ve(T)?ke(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):m(T))}function m(T){return T===45||T===58?g(T):T===124?(s=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),p):k(T)}function p(T){return ve(T)?ke(e,g,"whitespace")(T):g(T)}function g(T){return T===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),v):T===45?(o+=1,v(T)):T===null||ce(T)?A(T):k(T)}function v(T){return T===45?(e.enter("tableDelimiterFiller"),y(T)):k(T)}function y(T){return T===45?(e.consume(T),y):T===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(T))}function w(T){return ve(T)?ke(e,A,"whitespace")(T):A(T)}function A(T){return T===124?m(T):T===null||ce(T)?!s||i!==o?k(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):k(T)}function k(T){return n(T)}function E(T){return e.enter("tableRow"),I(T)}function I(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),I):T===null||ce(T)?(e.exit("tableRow"),t(T)):ve(T)?ke(e,I,"whitespace")(T):(e.enter("data"),D(T))}function D(T){return T===null||T===124||De(T)?(e.exit("data"),I(T)):(e.consume(T),T===92?P:D)}function P(T){return T===92||T===124?(e.consume(T),D):D(T)}}function gA(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,l=0,u,f,c;const h=new fA;for(;++n<e.length;){const d=e[n],m=d[1];d[0]==="enter"?m.type==="tableHead"?(a=!1,l!==0&&(Xh(h,t,l,u,f),f=void 0,l=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",f,t]])),i=m.type==="tableDelimiterRow"?2:f?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],c=Zi(h,t,o,i,void 0,c),o=[0,0,0,0]),s[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],c=Zi(h,t,o,i,void 0,c)),o=s,s=[o[1],n,0,0])):m.type==="tableHead"?(a=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,o[1]!==0?(s[0]=s[1],c=Zi(h,t,o,i,n,c)):s[1]!==0&&(c=Zi(h,t,s,i,n,c)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&Xh(h,t,l,u,f),h.consume(t.events),n=-1;++n<t.events.length;){const d=t.events[n];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=hA(t.events,n))}return e}function Zi(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},Kn(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=Kn(t.events,n[1]);if(o={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const u=Kn(t.events,n[2]),f=Kn(t.events,n[3]),c={type:a,start:Object.assign({},u),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",c,t]]),r!==2){const h=t.events[n[2]],d=t.events[n[3]];if(h[1].end=Object.assign({},d[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,p=n[3]-n[2]-1;e.add(m,p,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(o.end=Object.assign({},Kn(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function Xh(e,t,n,r,i){const o=[],s=Kn(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function Kn(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const yA={name:"tasklistCheck",tokenize:bA};function vA(){return{text:{91:yA}}}function bA(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"),o)}function o(l){return De(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return ce(l)?t(l):ve(l)?e.check({tokenize:wA},t,n)(l):n(l)}}function wA(e,t,n){return ke(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function SA(e){return Cd([qC(),nA(),cA(e),pA(),vA()])}const xA={};function kA(e){const t=this,n=e||xA,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(SA(n)),o.push(HC()),s.push(jC(n))}const ye={container:{className:"bpReset bpContainer bpFont",dropzone:{overlay:{className:"bpDropzoneOverlay"}}},loader:{className:"bpReset bpLoader"},modal:{overlay:{className:"bpModalOverlay"},dialog:{container:{className:"bpReset bpModalContainer"},title:{className:"bpModalTitle"},description:{className:"bpModalDescription"},content:{container:{className:"bpModalContentContainer"},textarea:{className:"bpModalContentTextArea"}},button:{container:{className:"bpModalButtonContainer"},confirm:{className:"bpModalButtonConfirm"},cancel:{className:"bpModalButtonCancel"}}}},messagePreview:{container:{className:"bpMessagePreviewContainer"},message:{className:"bpMessagePreviewMessage"},description:{className:"bpMessagePreviewDescription"},closeButton:{className:"bpMessagePreviewCloseButton"},avatar:{container:{className:"bpMessagePreviewAvatarContainer"},image:{className:"bpMessagePreviewAvatarImage"},fallback:{className:"bpMessagePreviewAvatarFallback"}}},fab:{container:{className:"bpReset bpFabContainer"},icon:{className:"bpFabIcon"},image:{className:"bpFabImage"}},notification:{container:{className:"bpReset bpNotificationContainer"},title:{className:"bpNotificationTitle"},description:{className:"bpNotificationDescription"},icon:{className:"bpNotificationIcon"},closeIcon:{className:"bpNotificationCloseIcon"}},header:{container:{className:"bpReset bpHeaderContainer bpFont"},content:{container:{className:"bpReset bpHeaderContentContainer"},conversationHistory:{className:"bpHeaderConversationHistoryButton"},title:{className:"bpHeaderContentTitle"},description:{className:"bpHeaderContentDescription"},avatar:{container:{className:"bpReset bpHeaderContentAvatarContainer"},image:{className:"bpHeaderContentAvatarImage"},fallback:{className:"bpHeaderContentAvatarFallback"}},toggleSound:{className:"bpHeaderSoundToggleButton"},actions:{container:{className:"bpReset bpHeaderContentActionsContainer"},icons:{className:"bpHeaderContentActionsIcons"}}},expandedContent:{container:{className:"bpReset bpHeaderExpandedContentContainer"},descriptionItems:{container:{className:"bpReset bpHeaderExpandedContentDescriptionItemsContainer"},icon:{className:"bpHeaderExpandedContentDescriptionItemsIcon"},text:{className:"bpHeaderExpandedContentDescriptionItemsText"},link:{className:"bpHeaderExpandedContentDescriptionItemsLink"}},group:{className:"bpHeaderExpandedContentGroup"}},newConversationIcon:{className:"bpHeaderNewConversationIcon"}},composer:{wrapper:{className:"bpReset bpComposerWrapper"},container:{className:"bpReset bpComposerContainer bpFont"},footer:{className:"bpComposerFooter"},inputContainer:{className:"bpComposerInputContainer"},input:{className:"bpComposerInput"},inputLoader:{className:"bpComposerInputLoader"},sendbutton:{className:"bpComposerSendButton"},uploadButton:{className:"bpComposerUploadButton"},voiceButton:{className:"bpComposerVoiceButton"},fileContainer:{className:"bpComposerFileContainer"},fileWidget:{container:{className:"bpComposerFileAttachement"},loader:{className:"bpComposerFileLoader"},fileIcon:{container:{className:"bpComposerFileIconWrapper"},icon:{className:"bpComposerFileIcon"}},metadata:{container:{className:"bpComposerFileMetadata"},name:{className:"bpComposerFileName"},type:{className:"bpComposerFileExtension"}},removeIcon:{className:"bpComposerFileRemoveIcon"},errorIcon:{className:"bpComposerFileErrorIcon"},previewImage:{className:"bpComposerFilePreviewImage"}}},messageList:{scrollDownButton:{className:"bpMessageListScrollDownButton"},container:{className:"bpReset bpMessageListContainer bpFont"},viewPort:{className:"bpMessageListViewport"},marquee:{container:{className:"bpReset bpMessageListMarqueeContainer"},content:{className:"bpMessageListMarqueeContent"},title:{className:"bpMessageListMarqueeTitle"},description:{className:"bpMessageListMarqueeDescription"},avatar:{container:{className:"bpReset bpMessageListMarqueeAvatarContainer"},image:{className:"bpMessageListMarqueeAvatarImage"},fallback:{className:"bpMessageListMarqueeAvatarFallback"}}},headerMessage:{className:"bpMessageListHeaderMessage"}},message:{container:{className:"bpReset bpMessageContainer"},avatar:{container:{className:"bpReset bpMessageAvatarContainer"},image:{className:"bpMessageAvatarImage"},fallback:{className:"bpMessageAvatarFallback"}},deliveryStatus:{className:"bpMessageDeliveryStatus"},blocks:{text:{heading1:{className:"bpMessageBlocksTextHeading1"},heading2:{className:"bpMessageBlocksTextHeading2"},heading3:{className:"bpMessageBlocksTextHeading3"},heading4:{className:"bpMessageBlocksTextHeading4"},unorderedList:{className:"bpMessageBlocksTextUnorderedList"},orderedList:{className:"bpMessageBlocksTextOrderedList"},listItem:{className:"bpMessageBlocksTextListItem"},link:{className:"bpMessageBlocksTextLink"},italic:{className:"bpMessageBlocksTextItalic"},bold:{className:"bpMessageBlocksTextBold"},text:{className:"bpMessageBlocksTextText"},image:{className:"bpMessageBlocksTextImage"},imageError:{className:"bpMessageBlocksTextImageError"},horizontalRule:{className:"bpMessageBlocksTextHorizontalRule"},lineBreak:{className:"bpMessageBlocksTextLineBreak"},input:{className:"bpMessageBlocksTextInput"},codeBlockContainer:{className:"bpMessageBlocksTextCodeBlockContainer"},codeBlockTitle:{className:"bpMessageBlocksTextCodeBlockTitle"},codeBlockCopyIcon:{className:"bpMessageBlocksTextCodeBlockCopyIcon"},codeBlock:{className:"bpMessageBlocksTextCodeBlock"},code:{className:"bpMessageBlocksTextCode"},tableContainer:{className:"bpMessageBlocksTextTableContainer"},table:{className:"bpMessageBlocksTextTable"},tableHeader:{className:"bpMessageBlocksTextTableHeader"},tableData:{className:"bpMessageBlocksTextTableData"},tableRow:{className:"bpMessageBlocksTextTableRow"}},audio:{className:"bpMessageBlocksAudio"},image:{image:{className:"bpMessageBlocksImageImage"},placeholder:{className:"bpMessageBlocksImagePlaceholder"},skeleton:{className:"bpSkeleton"}},video:{className:"bpMessageBlocksVideo"},location:{container:{className:"bpMessageBlocksLocationContainer"},title:{className:"bpMessageBlocksLocationTitle"},icon:{className:"bpMessageBlocksLocationIcon"}},file:{container:{className:"bpMessageBlocksFileContainer"},title:{className:"bpMessageBlocksFileTitle"},icon:{className:"bpMessageBlocksFileIcon"}},row:{className:"bpMessageBlocksRow"},column:{className:"bpMessageBlocksColumn"},bubble:{container:{className:"bpMessageBlocksBubble"},feedbackContainer:{className:"bpMessageBlocksBubbleFeedbackContainer"},feedbackIcon:{className:"bpMessageBlocksBubbleFeedbackIcon"}},carousel:{container:{className:"bpMessageBlocksCarouselContainer"},slidesContainer:{className:"bpMessageBlocksCarouselSlidesContainer"},backButton:{className:"bpMessageBlocksCarouselBackButton"},nextButton:{className:"bpMessageBlocksCarouselNextButton"}},dropdown:{button:{container:{className:"bpMessageBlocksDropdownButtonContainer"},text:{className:"bpMessageBlocksDropdownButtonText"},icon:{className:"bpMessageBlocksDropdownButtonIcon"}},content:{container:{className:"bpMessageBlocksDropdownContentContainer"},item:{className:"bpMessageBlocksDropdownContentItem"}}},button:{className:"bpMessageBlocksButton"}}},error:{container:{className:"bpReset bpErrorContainer"},id:{className:"bpErrorId"},header:{container:{className:"bpErrorHeader"},actions:{className:"bpErrorHeaderActions"}},content:{className:"bpErrorContent"},errorTitle:{className:"bpErrorTitle"},errorMessage:{className:"bpErrorMessage"},icon:{className:"bpErrorIcon"}},typingIndicator:{container:{className:"bpTypingIndicatorContainer"},loader:{className:"bpTypingIndicatorLoader"}},proactiveBubble:{container:{className:"bpProactiveBubbleContainer"},content:{className:"bpProactiveBubbleContent"},layout:{className:"bpProactiveBubbleLayout"},icon:{className:"bpProactiveBubbleIcon"},message:{className:"bpProactiveBubbleMessage"},closeButton:{className:"bpProactiveBubbleCloseButton"},arrow:{className:"bpProactiveBubbleArrow"}},conversationHistory:{container:{className:"bpReset bpConversationHistoryContainer bpFont"},header:{className:"bpConversationHistoryHeader"},closeButton:{className:"bpConversationHistoryCloseButton"},scrollContainer:{className:"bpConversationHistoryScrollContainer"},loaderContainer:{className:"bpConversationHistoryLoaderContainer"},conversation:{container:{className:"bpConversationHistoryConversationContainer"},chevron:{className:"bpConversationHistoryConversationChevron"},userAvatar:{className:{className:"bpConversationHistoryConversationUserAvatarFallback"}},avatar:{container:{className:"bpReset bpConversationHistoryConversationAvatarContainer"},image:{className:"bpConversationHistoryConversationAvatarImage"},fallback:{className:"bpConversationHistoryConversationAvatarFallback"}},content:{className:"bpConversationHistoryConversationContent"},name:{className:"bpConversationHistoryConversationName"},timestamp:{className:"bpConversationHistoryConversationTimestamp"}},newConversation:{button:{className:"bpConversationHistoryNewConversationButton"},icon:{className:"bpConversationHistoryNewConversationButtonIcon"}}}};/**
54
+ `))}function l(d,m,p,g){const v=p.enter("tableCell"),y=p.enter("phrasing"),w=p.containerPhrasing(d,{...g,before:o,after:o});return y(),v(),w}function u(d,m){return JE(d,{align:m,alignDelimiters:r,padding:n,stringLength:i})}function f(d,m,p){const g=d.children;let v=-1;const y=[],w=m.enter("table");for(;++v<g.length;)y[v]=c(g[v],m,p);return w(),y}function c(d,m,p){const g=d.children;let v=-1;const y=[],w=m.enter("tableRow");for(;++v<g.length;)y[v]=l(g[v],d,m,p);return w(),y}function h(d,m,p){let g=Vh.inlineCode(d,m,p);return p.stack.includes("tableCell")&&(g=g.replace(/\|/g,"\\$&")),g}}function BC(){return{exit:{taskListCheckValueChecked:qh,taskListCheckValueUnchecked:qh,paragraph:UC}}}function zC(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:HC}}}function qh(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function UC(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 o=-1,s;for(;++o<i.length;){const a=i[o];if(a.type==="paragraph"){s=a;break}}s===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 HC(e,t,n,r){const i=e.children[0],o=typeof e.checked=="boolean"&&i&&i.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);o&&a.move(s);let l=Vh.listItem(e,t,n,{...r,...a.current()});return o&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(f){return f+s}}function jC(){return[SE(),HE(),qE(),NC(),BC()]}function VC(e){return{extensions:[xE(),jE(e),YE(),$C(e),zC()]}}const WC={tokenize:ZC,partial:!0},Yh={tokenize:JC,partial:!0},Kh={tokenize:XC,partial:!0},Gh={tokenize:eA,partial:!0},qC={tokenize:tA,partial:!0},Qh={name:"wwwAutolink",tokenize:GC,previous:Jh},Zh={name:"protocolAutolink",tokenize:QC,previous:Xh},Kt={name:"emailAutolink",tokenize:KC,previous:ep},Bt={};function YC(){return{text:Bt}}let In=48;for(;In<123;)Bt[In]=Kt,In++,In===58?In=65:In===91&&(In=97);Bt[43]=Kt,Bt[45]=Kt,Bt[46]=Kt,Bt[95]=Kt,Bt[72]=[Kt,Zh],Bt[104]=[Kt,Zh],Bt[87]=[Kt,Qh],Bt[119]=[Kt,Qh];function KC(e,t,n){const r=this;let i,o;return s;function s(c){return!Oa(c)||!ep.call(r,r.previous)||Ma(r.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(c))}function a(c){return Oa(c)?(e.consume(c),a):c===64?(e.consume(c),l):n(c)}function l(c){return c===46?e.check(qC,f,u)(c):c===45||c===95||tt(c)?(o=!0,e.consume(c),l):f(c)}function u(c){return e.consume(c),i=!0,l}function f(c){return o&&i&&ot(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):n(c)}}function GC(e,t,n){const r=this;return i;function i(s){return s!==87&&s!==119||!Jh.call(r,r.previous)||Ma(r.events)?n(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(WC,e.attempt(Yh,e.attempt(Kh,o),n),n)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function QC(e,t,n){const r=this;let i="",o=!1;return s;function s(c){return(c===72||c===104)&&Xh.call(r,r.previous)&&!Ma(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(c),e.consume(c),a):n(c)}function a(c){if(ot(c)&&i.length<5)return i+=String.fromCodePoint(c),e.consume(c),a;if(c===58){const h=i.toLowerCase();if(h==="http"||h==="https")return e.consume(c),l}return n(c)}function l(c){return c===47?(e.consume(c),o?u:(o=!0,l)):n(c)}function u(c){return c===null||Ri(c)||De(c)||Tn(c)||$i(c)?n(c):e.attempt(Yh,e.attempt(Kh,f),n)(c)}function f(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function ZC(e,t,n){let r=0;return i;function i(s){return(s===87||s===119)&&r<3?(r++,e.consume(s),i):s===46&&r===3?(e.consume(s),o):n(s)}function o(s){return s===null?n(s):t(s)}}function JC(e,t,n){let r,i,o;return s;function s(u){return u===46||u===95?e.check(Gh,l,a)(u):u===null||De(u)||Tn(u)||u!==45&&$i(u)?l(u):(o=!0,e.consume(u),s)}function a(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),s}function l(u){return i||r||!o?n(u):t(u)}}function XC(e,t){let n=0,r=0;return i;function i(s){return s===40?(n++,e.consume(s),i):s===41&&r<n?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(Gh,t,o)(s):s===null||De(s)||Tn(s)?t(s):(e.consume(s),i)}function o(s){return s===41&&r++,e.consume(s),i}}function eA(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),o):a===93?(e.consume(a),i):a===60||a===null||De(a)||Tn(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||De(a)||Tn(a)?t(a):r(a)}function o(a){return ot(a)?s(a):n(a)}function s(a){return a===59?(e.consume(a),r):ot(a)?(e.consume(a),s):n(a)}}function tA(e,t,n){return r;function r(o){return e.consume(o),i}function i(o){return tt(o)?n(o):t(o)}}function Jh(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||De(e)}function Xh(e){return!ot(e)}function ep(e){return!(e===47||Oa(e))}function Oa(e){return e===43||e===45||e===46||e===95||tt(e)}function Ma(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 nA={tokenize:cA,partial:!0};function rA(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:aA,continuation:{tokenize:lA},exit:uA}},text:{91:{name:"gfmFootnoteCall",tokenize:sA},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:iA,resolveTo:oA}}}}function iA(e,t,n){const r=this;let i=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){s=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(!s||!s._balanced)return n(l);const u=Mt(r.sliceSerialize({start:s.end,end:r.now()}));return u.codePointAt(0)!==94||!o.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function oA(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 o={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function sA(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,s;return a;function a(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),l}function l(c){return c!==94?n(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(c){if(o>999||c===93&&!s||c===null||c===91||De(c))return n(c);if(c===93){e.exit("chunkString");const h=e.exit("gfmFootnoteCallString");return i.includes(Mt(r.sliceSerialize(h)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(c)}return De(c)||(s=!0),o++,e.consume(c),c===92?f:u}function f(c){return c===91||c===92||c===93?(e.consume(c),o++,u):u(c)}}function aA(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,s=0,a;return l;function l(m){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(m){return m===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(m)}function f(m){if(s>999||m===93&&!a||m===null||m===91||De(m))return n(m);if(m===93){e.exit("chunkString");const p=e.exit("gfmFootnoteDefinitionLabelString");return o=Mt(r.sliceSerialize(p)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(m),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),h}return De(m)||(a=!0),s++,e.consume(m),m===92?c:f}function c(m){return m===91||m===92||m===93?(e.consume(m),s++,f):f(m)}function h(m){return m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),i.includes(o)||i.push(o),ke(e,d,"gfmFootnoteDefinitionWhitespace")):n(m)}function d(m){return t(m)}}function lA(e,t,n){return e.check($r,t,e.attempt(nA,t,n))}function uA(e){e.exit("gfmFootnoteDefinition")}function cA(e,t,n){const r=this;return ke(e,i,"gfmFootnoteDefinitionIndent",5);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):n(o)}}function fA(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(s,a){let l=-1;for(;++l<s.length;)if(s[l][0]==="enter"&&s[l][1].type==="strikethroughSequenceTemporary"&&s[l][1]._close){let u=l;for(;u--;)if(s[u][0]==="exit"&&s[u][1].type==="strikethroughSequenceTemporary"&&s[u][1]._open&&s[l][1].end.offset-s[l][1].start.offset===s[u][1].end.offset-s[u][1].start.offset){s[l][1].type="strikethroughSequence",s[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},s[u][1].start),end:Object.assign({},s[l][1].end)},c={type:"strikethroughText",start:Object.assign({},s[u][1].end),end:Object.assign({},s[l][1].start)},h=[["enter",f,a],["enter",s[u][1],a],["exit",s[u][1],a],["enter",c,a]],d=a.parser.constructs.insideSpan.null;d&&mt(h,h.length,0,Bi(d,s.slice(u+1,l),a)),mt(h,h.length,0,[["exit",c,a],["enter",s[l][1],a],["exit",s[l][1],a],["exit",f,a]]),mt(s,u-1,l-u+3,h),l=u+h.length-2;break}}for(l=-1;++l<s.length;)s[l][1].type==="strikethroughSequenceTemporary"&&(s[l][1].type="data");return s}function o(s,a,l){const u=this.previous,f=this.events;let c=0;return h;function h(m){return u===126&&f[f.length-1][1].type!=="characterEscape"?l(m):(s.enter("strikethroughSequenceTemporary"),d(m))}function d(m){const p=qn(u);if(m===126)return c>1?l(m):(s.consume(m),c++,d);if(c<2&&!n)return l(m);const g=s.exit("strikethroughSequenceTemporary"),v=qn(m);return g._open=!v||v===2&&!!p,g._close=!p||p===2&&!!v,a(m)}}}class dA{constructor(){this.map=[]}add(t,n,r){hA(this,t,n,r)}consume(t){if(this.map.sort(function(o,s){return o[0]-s[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.slice()),t.length=0;let i=r.pop();for(;i;){for(const o of i)t.push(o);i=r.pop()}this.map.length=0}}function hA(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 pA(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 o=r.length-1;r[o]=r[o]==="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 mA(){return{flow:{null:{name:"table",tokenize:gA,resolveAll:yA}}}}function gA(e,t,n){const r=this;let i=0,o=0,s;return a;function a(T){let O=r.events.length-1;for(;O>-1;){const F=r.events[O][1].type;if(F==="lineEnding"||F==="linePrefix")O--;else break}const U=O>-1?r.events[O][1].type:null,L=U==="tableHead"||U==="tableRow"?E:l;return L===E&&r.parser.lazy[r.now().line]?n(T):L(T)}function l(T){return e.enter("tableHead"),e.enter("tableRow"),u(T)}function u(T){return T===124||(s=!0,o+=1),f(T)}function f(T){return T===null?n(T):ce(T)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),d):n(T):ve(T)?ke(e,f,"whitespace")(T):(o+=1,s&&(s=!1,i+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),s=!0,f):(e.enter("data"),c(T)))}function c(T){return T===null||T===124||De(T)?(e.exit("data"),f(T)):(e.consume(T),T===92?h:c)}function h(T){return T===92||T===124?(e.consume(T),c):c(T)}function d(T){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(T):(e.enter("tableDelimiterRow"),s=!1,ve(T)?ke(e,m,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):m(T))}function m(T){return T===45||T===58?g(T):T===124?(s=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),p):k(T)}function p(T){return ve(T)?ke(e,g,"whitespace")(T):g(T)}function g(T){return T===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),v):T===45?(o+=1,v(T)):T===null||ce(T)?C(T):k(T)}function v(T){return T===45?(e.enter("tableDelimiterFiller"),y(T)):k(T)}function y(T){return T===45?(e.consume(T),y):T===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),w):(e.exit("tableDelimiterFiller"),w(T))}function w(T){return ve(T)?ke(e,C,"whitespace")(T):C(T)}function C(T){return T===124?m(T):T===null||ce(T)?!s||i!==o?k(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(T)):k(T)}function k(T){return n(T)}function E(T){return e.enter("tableRow"),I(T)}function I(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),I):T===null||ce(T)?(e.exit("tableRow"),t(T)):ve(T)?ke(e,I,"whitespace")(T):(e.enter("data"),D(T))}function D(T){return T===null||T===124||De(T)?(e.exit("data"),I(T)):(e.consume(T),T===92?P:D)}function P(T){return T===92||T===124?(e.consume(T),D):D(T)}}function yA(e,t){let n=-1,r=!0,i=0,o=[0,0,0,0],s=[0,0,0,0],a=!1,l=0,u,f,c;const h=new dA;for(;++n<e.length;){const d=e[n],m=d[1];d[0]==="enter"?m.type==="tableHead"?(a=!1,l!==0&&(tp(h,t,l,u,f),f=void 0,l=0),u={type:"table",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",u,t]])):m.type==="tableRow"||m.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],s=[0,n+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},m.start),end:Object.assign({},m.end)},h.add(n,0,[["enter",f,t]])),i=m.type==="tableDelimiterRow"?2:f?3:1):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")?(r=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],c=Zi(h,t,o,i,void 0,c),o=[0,0,0,0]),s[2]=n)):m.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(s[0]=s[1],c=Zi(h,t,o,i,void 0,c)),o=s,s=[o[1],n,0,0])):m.type==="tableHead"?(a=!0,l=n):m.type==="tableRow"||m.type==="tableDelimiterRow"?(l=n,o[1]!==0?(s[0]=s[1],c=Zi(h,t,o,i,n,c)):s[1]!==0&&(c=Zi(h,t,s,i,n,c)),i=0):i&&(m.type==="data"||m.type==="tableDelimiterMarker"||m.type==="tableDelimiterFiller")&&(s[3]=n)}for(l!==0&&tp(h,t,l,u,f),h.consume(t.events),n=-1;++n<t.events.length;){const d=t.events[n];d[0]==="enter"&&d[1].type==="table"&&(d[1]._align=pA(t.events,n))}return e}function Zi(e,t,n,r,i,o){const s=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(o.end=Object.assign({},Kn(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const l=Kn(t.events,n[1]);if(o={type:s,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const u=Kn(t.events,n[2]),f=Kn(t.events,n[3]),c={type:a,start:Object.assign({},u),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",c,t]]),r!==2){const h=t.events[n[2]],d=t.events[n[3]];if(h[1].end=Object.assign({},d[1].end),h[1].type="chunkText",h[1].contentType="text",n[3]>n[2]+1){const m=n[2]+1,p=n[3]-n[2]-1;e.add(m,p,[])}}e.add(n[3]+1,0,[["exit",c,t]])}return i!==void 0&&(o.end=Object.assign({},Kn(t.events,i)),e.add(i,0,[["exit",o,t]]),o=void 0),o}function tp(e,t,n,r,i){const o=[],s=Kn(t.events,n);i&&(i.end=Object.assign({},s),o.push(["exit",i,t])),r.end=Object.assign({},s),o.push(["exit",r,t]),e.add(n+1,0,o)}function Kn(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const vA={name:"tasklistCheck",tokenize:wA};function bA(){return{text:{91:vA}}}function wA(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"),o)}function o(l){return De(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),s):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),s):n(l)}function s(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return ce(l)?t(l):ve(l)?e.check({tokenize:SA},t,n)(l):n(l)}}function SA(e,t,n){return ke(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function xA(e){return Td([YC(),rA(),fA(e),mA(),bA()])}const kA={};function EA(e){const t=this,n=e||kA,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),s=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(xA(n)),o.push(jC()),s.push(VC(n))}const ye={container:{className:"bpReset bpContainer bpFont",dropzone:{overlay:{className:"bpDropzoneOverlay"}}},loader:{className:"bpReset bpLoader"},modal:{overlay:{className:"bpModalOverlay"},dialog:{container:{className:"bpReset bpModalContainer"},title:{className:"bpModalTitle"},description:{className:"bpModalDescription"},content:{container:{className:"bpModalContentContainer"},textarea:{className:"bpModalContentTextArea"}},button:{container:{className:"bpModalButtonContainer"},confirm:{className:"bpModalButtonConfirm"},cancel:{className:"bpModalButtonCancel"}}}},messagePreview:{container:{className:"bpMessagePreviewContainer"},message:{className:"bpMessagePreviewMessage"},description:{className:"bpMessagePreviewDescription"},closeButton:{className:"bpMessagePreviewCloseButton"},avatar:{container:{className:"bpMessagePreviewAvatarContainer"},image:{className:"bpMessagePreviewAvatarImage"},fallback:{className:"bpMessagePreviewAvatarFallback"}}},fab:{container:{className:"bpReset bpFabContainer"},icon:{className:"bpFabIcon"},image:{className:"bpFabImage"}},notification:{container:{className:"bpReset bpNotificationContainer"},title:{className:"bpNotificationTitle"},description:{className:"bpNotificationDescription"},icon:{className:"bpNotificationIcon"},closeIcon:{className:"bpNotificationCloseIcon"}},header:{container:{className:"bpReset bpHeaderContainer bpFont"},content:{container:{className:"bpReset bpHeaderContentContainer"},conversationHistory:{className:"bpHeaderConversationHistoryButton"},title:{className:"bpHeaderContentTitle"},description:{className:"bpHeaderContentDescription"},avatar:{container:{className:"bpReset bpHeaderContentAvatarContainer"},image:{className:"bpHeaderContentAvatarImage"},fallback:{className:"bpHeaderContentAvatarFallback"}},toggleSound:{className:"bpHeaderSoundToggleButton"},actions:{container:{className:"bpReset bpHeaderContentActionsContainer"},icons:{className:"bpHeaderContentActionsIcons"}}},expandedContent:{container:{className:"bpReset bpHeaderExpandedContentContainer"},descriptionItems:{container:{className:"bpReset bpHeaderExpandedContentDescriptionItemsContainer"},icon:{className:"bpHeaderExpandedContentDescriptionItemsIcon"},text:{className:"bpHeaderExpandedContentDescriptionItemsText"},link:{className:"bpHeaderExpandedContentDescriptionItemsLink"}},group:{className:"bpHeaderExpandedContentGroup"}},newConversationIcon:{className:"bpHeaderNewConversationIcon"}},composer:{wrapper:{className:"bpReset bpComposerWrapper"},container:{className:"bpReset bpComposerContainer bpFont"},footer:{className:"bpComposerFooter"},inputContainer:{className:"bpComposerInputContainer"},input:{className:"bpComposerInput"},inputLoader:{className:"bpComposerInputLoader"},sendbutton:{className:"bpComposerSendButton"},uploadButton:{className:"bpComposerUploadButton"},voiceButton:{className:"bpComposerVoiceButton"},fileContainer:{className:"bpComposerFileContainer"},fileWidget:{container:{className:"bpComposerFileAttachement"},loader:{className:"bpComposerFileLoader"},fileIcon:{container:{className:"bpComposerFileIconWrapper"},icon:{className:"bpComposerFileIcon"}},metadata:{container:{className:"bpComposerFileMetadata"},name:{className:"bpComposerFileName"},type:{className:"bpComposerFileExtension"}},removeIcon:{className:"bpComposerFileRemoveIcon"},errorIcon:{className:"bpComposerFileErrorIcon"},previewImage:{className:"bpComposerFilePreviewImage"}}},messageList:{scrollDownButton:{className:"bpMessageListScrollDownButton"},container:{className:"bpReset bpMessageListContainer bpFont"},viewPort:{className:"bpMessageListViewport"},marquee:{container:{className:"bpReset bpMessageListMarqueeContainer"},content:{className:"bpMessageListMarqueeContent"},title:{className:"bpMessageListMarqueeTitle"},description:{className:"bpMessageListMarqueeDescription"},avatar:{container:{className:"bpReset bpMessageListMarqueeAvatarContainer"},image:{className:"bpMessageListMarqueeAvatarImage"},fallback:{className:"bpMessageListMarqueeAvatarFallback"}}},headerMessage:{className:"bpMessageListHeaderMessage"}},message:{container:{className:"bpReset bpMessageContainer"},avatar:{container:{className:"bpReset bpMessageAvatarContainer"},image:{className:"bpMessageAvatarImage"},fallback:{className:"bpMessageAvatarFallback"}},deliveryStatus:{className:"bpMessageDeliveryStatus"},blocks:{text:{heading1:{className:"bpMessageBlocksTextHeading1"},heading2:{className:"bpMessageBlocksTextHeading2"},heading3:{className:"bpMessageBlocksTextHeading3"},heading4:{className:"bpMessageBlocksTextHeading4"},unorderedList:{className:"bpMessageBlocksTextUnorderedList"},orderedList:{className:"bpMessageBlocksTextOrderedList"},listItem:{className:"bpMessageBlocksTextListItem"},link:{className:"bpMessageBlocksTextLink"},italic:{className:"bpMessageBlocksTextItalic"},bold:{className:"bpMessageBlocksTextBold"},text:{className:"bpMessageBlocksTextText"},image:{className:"bpMessageBlocksTextImage"},imageError:{className:"bpMessageBlocksTextImageError"},horizontalRule:{className:"bpMessageBlocksTextHorizontalRule"},lineBreak:{className:"bpMessageBlocksTextLineBreak"},input:{className:"bpMessageBlocksTextInput"},codeBlockContainer:{className:"bpMessageBlocksTextCodeBlockContainer"},codeBlockTitle:{className:"bpMessageBlocksTextCodeBlockTitle"},codeBlockCopyIcon:{className:"bpMessageBlocksTextCodeBlockCopyIcon"},codeBlock:{className:"bpMessageBlocksTextCodeBlock"},code:{className:"bpMessageBlocksTextCode"},tableContainer:{className:"bpMessageBlocksTextTableContainer"},table:{className:"bpMessageBlocksTextTable"},tableHeader:{className:"bpMessageBlocksTextTableHeader"},tableData:{className:"bpMessageBlocksTextTableData"},tableRow:{className:"bpMessageBlocksTextTableRow"}},audio:{className:"bpMessageBlocksAudio"},image:{image:{className:"bpMessageBlocksImageImage"},placeholder:{className:"bpMessageBlocksImagePlaceholder"},skeleton:{className:"bpSkeleton"}},video:{className:"bpMessageBlocksVideo"},location:{container:{className:"bpMessageBlocksLocationContainer"},title:{className:"bpMessageBlocksLocationTitle"},icon:{className:"bpMessageBlocksLocationIcon"}},file:{container:{className:"bpMessageBlocksFileContainer"},title:{className:"bpMessageBlocksFileTitle"},icon:{className:"bpMessageBlocksFileIcon"}},row:{className:"bpMessageBlocksRow"},column:{className:"bpMessageBlocksColumn"},bubble:{container:{className:"bpMessageBlocksBubble"},feedbackContainer:{className:"bpMessageBlocksBubbleFeedbackContainer"},feedbackIcon:{className:"bpMessageBlocksBubbleFeedbackIcon"}},carousel:{container:{className:"bpMessageBlocksCarouselContainer"},slidesContainer:{className:"bpMessageBlocksCarouselSlidesContainer"},backButton:{className:"bpMessageBlocksCarouselBackButton"},nextButton:{className:"bpMessageBlocksCarouselNextButton"}},dropdown:{button:{container:{className:"bpMessageBlocksDropdownButtonContainer"},text:{className:"bpMessageBlocksDropdownButtonText"},icon:{className:"bpMessageBlocksDropdownButtonIcon"}},content:{container:{className:"bpMessageBlocksDropdownContentContainer"},item:{className:"bpMessageBlocksDropdownContentItem"}}},button:{className:"bpMessageBlocksButton"}}},error:{container:{className:"bpReset bpErrorContainer"},id:{className:"bpErrorId"},header:{container:{className:"bpErrorHeader"},actions:{className:"bpErrorHeaderActions"}},content:{className:"bpErrorContent"},errorTitle:{className:"bpErrorTitle"},errorMessage:{className:"bpErrorMessage"},icon:{className:"bpErrorIcon"}},typingIndicator:{container:{className:"bpTypingIndicatorContainer"},loader:{className:"bpTypingIndicatorLoader"}},proactiveBubble:{container:{className:"bpProactiveBubbleContainer"},content:{className:"bpProactiveBubbleContent"},layout:{className:"bpProactiveBubbleLayout"},icon:{className:"bpProactiveBubbleIcon"},message:{className:"bpProactiveBubbleMessage"},closeButton:{className:"bpProactiveBubbleCloseButton"},arrow:{className:"bpProactiveBubbleArrow"}},conversationHistory:{container:{className:"bpReset bpConversationHistoryContainer bpFont"},header:{className:"bpConversationHistoryHeader"},closeButton:{className:"bpConversationHistoryCloseButton"},scrollContainer:{className:"bpConversationHistoryScrollContainer"},loaderContainer:{className:"bpConversationHistoryLoaderContainer"},conversation:{container:{className:"bpConversationHistoryConversationContainer"},chevron:{className:"bpConversationHistoryConversationChevron"},userAvatar:{className:{className:"bpConversationHistoryConversationUserAvatarFallback"}},avatar:{container:{className:"bpReset bpConversationHistoryConversationAvatarContainer"},image:{className:"bpConversationHistoryConversationAvatarImage"},fallback:{className:"bpConversationHistoryConversationAvatarFallback"}},content:{className:"bpConversationHistoryConversationContent"},name:{className:"bpConversationHistoryConversationName"},timestamp:{className:"bpConversationHistoryConversationTimestamp"}},newConversation:{button:{className:"bpConversationHistoryNewConversationButton"},icon:{className:"bpConversationHistoryNewConversationButtonIcon"}}}};/**
55
55
  * @license lucide-react v0.554.0 - ISC
56
56
  *
57
57
  * This source code is licensed under the ISC license.
58
58
  * See the LICENSE file in the root directory of this source tree.
59
- */const EA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),CA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),ep=e=>{const t=CA(e);return t.charAt(0).toUpperCase()+t.slice(1)},tp=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),AA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
59
+ */const CA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),AA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),np=e=>{const t=AA(e);return t.charAt(0).toUpperCase()+t.slice(1)},rp=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),TA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
60
60
  * @license lucide-react v0.554.0 - ISC
61
61
  *
62
62
  * This source code is licensed under the ISC license.
63
63
  * See the LICENSE file in the root directory of this source tree.
64
- */var TA={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
64
+ */var IA={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
65
65
  * @license lucide-react v0.554.0 - ISC
66
66
  *
67
67
  * This source code is licensed under the ISC license.
68
68
  * See the LICENSE file in the root directory of this source tree.
69
- */const IA=M.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...a},l)=>M.createElement("svg",{ref:l,...TA,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:tp("lucide",i),...!o&&!AA(a)&&{"aria-hidden":"true"},...a},[...s.map(([u,f])=>M.createElement(u,f)),...Array.isArray(o)?o:[o]]));/**
69
+ */const OA=M.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...a},l)=>M.createElement("svg",{ref:l,...IA,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:rp("lucide",i),...!o&&!TA(a)&&{"aria-hidden":"true"},...a},[...s.map(([u,f])=>M.createElement(u,f)),...Array.isArray(o)?o:[o]]));/**
70
70
  * @license lucide-react v0.554.0 - ISC
71
71
  *
72
72
  * This source code is licensed under the ISC license.
73
73
  * See the LICENSE file in the root directory of this source tree.
74
- */const Se=(e,t)=>{const n=M.forwardRef(({className:r,...i},o)=>M.createElement(IA,{ref:o,iconNode:t,className:tp(`lucide-${EA(ep(e))}`,`lucide-${e}`,r),...i}));return n.displayName=ep(e),n};/**
74
+ */const Se=(e,t)=>{const n=M.forwardRef(({className:r,...i},o)=>M.createElement(OA,{ref:o,iconNode:t,className:rp(`lucide-${CA(np(e))}`,`lucide-${e}`,r),...i}));return n.displayName=np(e),n};/**
75
75
  * @license lucide-react v0.554.0 - ISC
76
76
  *
77
77
  * This source code is licensed under the ISC license.
78
78
  * See the LICENSE file in the root directory of this source tree.
79
- */const OA=Se("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
79
+ */const MA=Se("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
80
80
  * @license lucide-react v0.554.0 - ISC
81
81
  *
82
82
  * This source code is licensed under the ISC license.
83
83
  * See the LICENSE file in the root directory of this source tree.
84
- */const np=Se("bot-off",[["path",{d:"M13.67 8H18a2 2 0 0 1 2 2v4.33",key:"7az073"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M22 22 2 2",key:"1r8tn9"}],["path",{d:"M8 8H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 1.414-.586",key:"s09a7a"}],["path",{d:"M9 13v2",key:"rq6x2g"}],["path",{d:"M9.67 4H12v2.33",key:"110xot"}]]);/**
84
+ */const ip=Se("bot-off",[["path",{d:"M13.67 8H18a2 2 0 0 1 2 2v4.33",key:"7az073"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M22 22 2 2",key:"1r8tn9"}],["path",{d:"M8 8H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 1.414-.586",key:"s09a7a"}],["path",{d:"M9 13v2",key:"rq6x2g"}],["path",{d:"M9.67 4H12v2.33",key:"110xot"}]]);/**
85
85
  * @license lucide-react v0.554.0 - ISC
86
86
  *
87
87
  * This source code is licensed under the ISC license.
88
88
  * See the LICENSE file in the root directory of this source tree.
89
- */const MA=Se("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
89
+ */const DA=Se("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
90
90
  * @license lucide-react v0.554.0 - ISC
91
91
  *
92
92
  * This source code is licensed under the ISC license.
93
93
  * See the LICENSE file in the root directory of this source tree.
94
- */const DA=Se("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
94
+ */const NA=Se("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
95
95
  * @license lucide-react v0.554.0 - ISC
96
96
  *
97
97
  * This source code is licensed under the ISC license.
98
98
  * See the LICENSE file in the root directory of this source tree.
99
- */const rp=Se("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
99
+ */const op=Se("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
100
100
  * @license lucide-react v0.554.0 - ISC
101
101
  *
102
102
  * This source code is licensed under the ISC license.
103
103
  * See the LICENSE file in the root directory of this source tree.
104
- */const ip=Se("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
104
+ */const sp=Se("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
105
105
  * @license lucide-react v0.554.0 - ISC
106
106
  *
107
107
  * This source code is licensed under the ISC license.
108
108
  * See the LICENSE file in the root directory of this source tree.
109
- */const NA=Se("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
109
+ */const _A=Se("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
110
110
  * @license lucide-react v0.554.0 - ISC
111
111
  *
112
112
  * This source code is licensed under the ISC license.
113
113
  * See the LICENSE file in the root directory of this source tree.
114
- */const op=Se("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
114
+ */const ap=Se("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
115
115
  * @license lucide-react v0.554.0 - ISC
116
116
  *
117
117
  * This source code is licensed under the ISC license.
118
118
  * See the LICENSE file in the root directory of this source tree.
119
- */const _A=Se("cloud-upload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);/**
119
+ */const PA=Se("cloud-upload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]]);/**
120
120
  * @license lucide-react v0.554.0 - ISC
121
121
  *
122
122
  * This source code is licensed under the ISC license.
123
123
  * See the LICENSE file in the root directory of this source tree.
124
- */const PA=Se("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
124
+ */const LA=Se("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
125
125
  * @license lucide-react v0.554.0 - ISC
126
126
  *
127
127
  * This source code is licensed under the ISC license.
128
128
  * See the LICENSE file in the root directory of this source tree.
129
- */const LA=Se("file-down",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/**
129
+ */const FA=Se("file-down",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/**
130
130
  * @license lucide-react v0.554.0 - ISC
131
131
  *
132
132
  * This source code is licensed under the ISC license.
133
133
  * See the LICENSE file in the root directory of this source tree.
134
- */const sp=Se("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
134
+ */const lp=Se("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
135
135
  * @license lucide-react v0.554.0 - ISC
136
136
  *
137
137
  * This source code is licensed under the ISC license.
138
138
  * See the LICENSE file in the root directory of this source tree.
139
- */const FA=Se("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]);/**
139
+ */const RA=Se("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]);/**
140
140
  * @license lucide-react v0.554.0 - ISC
141
141
  *
142
142
  * This source code is licensed under the ISC license.
143
143
  * See the LICENSE file in the root directory of this source tree.
144
- */const RA=Se("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
144
+ */const $A=Se("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
145
145
  * @license lucide-react v0.554.0 - ISC
146
146
  *
147
147
  * This source code is licensed under the ISC license.
148
148
  * See the LICENSE file in the root directory of this source tree.
149
- */const ap=Se("image-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]);/**
149
+ */const up=Se("image-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]);/**
150
150
  * @license lucide-react v0.554.0 - ISC
151
151
  *
152
152
  * This source code is licensed under the ISC license.
153
153
  * See the LICENSE file in the root directory of this source tree.
154
- */const $A=Se("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
154
+ */const BA=Se("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
155
155
  * @license lucide-react v0.554.0 - ISC
156
156
  *
157
157
  * This source code is licensed under the ISC license.
158
158
  * See the LICENSE file in the root directory of this source tree.
159
- */const BA=Se("loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/**
159
+ */const zA=Se("loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);/**
160
160
  * @license lucide-react v0.554.0 - ISC
161
161
  *
162
162
  * This source code is licensed under the ISC license.
163
163
  * See the LICENSE file in the root directory of this source tree.
164
- */const zA=Se("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
164
+ */const UA=Se("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
165
165
  * @license lucide-react v0.554.0 - ISC
166
166
  *
167
167
  * This source code is licensed under the ISC license.
168
168
  * See the LICENSE file in the root directory of this source tree.
169
- */const UA=Se("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);/**
169
+ */const HA=Se("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]]);/**
170
170
  * @license lucide-react v0.554.0 - ISC
171
171
  *
172
172
  * This source code is licensed under the ISC license.
173
173
  * See the LICENSE file in the root directory of this source tree.
174
- */const HA=Se("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
174
+ */const jA=Se("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
175
175
  * @license lucide-react v0.554.0 - ISC
176
176
  *
177
177
  * This source code is licensed under the ISC license.
178
178
  * See the LICENSE file in the root directory of this source tree.
179
- */const jA=Se("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]);/**
179
+ */const VA=Se("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]);/**
180
180
  * @license lucide-react v0.554.0 - ISC
181
181
  *
182
182
  * This source code is licensed under the ISC license.
183
183
  * See the LICENSE file in the root directory of this source tree.
184
- */const VA=Se("monitor-cog",[["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"m14.305 7.53.923-.382",key:"1mlnsw"}],["path",{d:"m15.228 4.852-.923-.383",key:"82mpwg"}],["path",{d:"m16.852 3.228-.383-.924",key:"ln4sir"}],["path",{d:"m16.852 8.772-.383.923",key:"1dejw0"}],["path",{d:"m19.148 3.228.383-.924",key:"192kgf"}],["path",{d:"m19.53 9.696-.382-.924",key:"fiavlr"}],["path",{d:"m20.772 4.852.924-.383",key:"1j8mgp"}],["path",{d:"m20.772 7.148.924.383",key:"zix9be"}],["path",{d:"M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7",key:"1tnzv8"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}]]);/**
184
+ */const WA=Se("monitor-cog",[["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"m14.305 7.53.923-.382",key:"1mlnsw"}],["path",{d:"m15.228 4.852-.923-.383",key:"82mpwg"}],["path",{d:"m16.852 3.228-.383-.924",key:"ln4sir"}],["path",{d:"m16.852 8.772-.383.923",key:"1dejw0"}],["path",{d:"m19.148 3.228.383-.924",key:"192kgf"}],["path",{d:"m19.53 9.696-.382-.924",key:"fiavlr"}],["path",{d:"m20.772 4.852.924-.383",key:"1j8mgp"}],["path",{d:"m20.772 7.148.924.383",key:"zix9be"}],["path",{d:"M22 13v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7",key:"1tnzv8"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}]]);/**
185
185
  * @license lucide-react v0.554.0 - ISC
186
186
  *
187
187
  * This source code is licensed under the ISC license.
188
188
  * See the LICENSE file in the root directory of this source tree.
189
- */const WA=Se("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]);/**
189
+ */const qA=Se("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]);/**
190
190
  * @license lucide-react v0.554.0 - ISC
191
191
  *
192
192
  * This source code is licensed under the ISC license.
193
193
  * See the LICENSE file in the root directory of this source tree.
194
- */const qA=Se("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
194
+ */const YA=Se("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
195
195
  * @license lucide-react v0.554.0 - ISC
196
196
  *
197
197
  * This source code is licensed under the ISC license.
198
198
  * See the LICENSE file in the root directory of this source tree.
199
- */const YA=Se("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
199
+ */const KA=Se("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
200
200
  * @license lucide-react v0.554.0 - ISC
201
201
  *
202
202
  * This source code is licensed under the ISC license.
203
203
  * See the LICENSE file in the root directory of this source tree.
204
- */const KA=Se("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
204
+ */const GA=Se("square-pen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
205
205
  * @license lucide-react v0.554.0 - ISC
206
206
  *
207
207
  * This source code is licensed under the ISC license.
208
208
  * See the LICENSE file in the root directory of this source tree.
209
- */const GA=Se("thumbs-down",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]]);/**
209
+ */const QA=Se("thumbs-down",[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]]);/**
210
210
  * @license lucide-react v0.554.0 - ISC
211
211
  *
212
212
  * This source code is licensed under the ISC license.
213
213
  * See the LICENSE file in the root directory of this source tree.
214
- */const QA=Se("thumbs-up",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
214
+ */const ZA=Se("thumbs-up",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/**
215
215
  * @license lucide-react v0.554.0 - ISC
216
216
  *
217
217
  * This source code is licensed under the ISC license.
218
218
  * See the LICENSE file in the root directory of this source tree.
219
- */const ZA=Se("unplug",[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]);/**
219
+ */const JA=Se("unplug",[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]);/**
220
220
  * @license lucide-react v0.554.0 - ISC
221
221
  *
222
222
  * This source code is licensed under the ISC license.
223
223
  * See the LICENSE file in the root directory of this source tree.
224
- */const JA=Se("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
224
+ */const XA=Se("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
225
225
  * @license lucide-react v0.554.0 - ISC
226
226
  *
227
227
  * This source code is licensed under the ISC license.
228
228
  * See the LICENSE file in the root directory of this source tree.
229
- */const XA=Se("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
229
+ */const eT=Se("video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/**
230
230
  * @license lucide-react v0.554.0 - ISC
231
231
  *
232
232
  * This source code is licensed under the ISC license.
233
233
  * See the LICENSE file in the root directory of this source tree.
234
- */const lp=Se("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
234
+ */const cp=Se("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
235
235
  * @license lucide-react v0.554.0 - ISC
236
236
  *
237
237
  * This source code is licensed under the ISC license.
238
238
  * See the LICENSE file in the root directory of this source tree.
239
- */const eT=Se("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/**
239
+ */const tT=Se("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);/**
240
240
  * @license lucide-react v0.554.0 - ISC
241
241
  *
242
242
  * This source code is licensed under the ISC license.
243
243
  * See the LICENSE file in the root directory of this source tree.
244
- */const tT=Se("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
244
+ */const nT=Se("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
245
245
  * @license lucide-react v0.554.0 - ISC
246
246
  *
247
247
  * This source code is licensed under the ISC license.
248
248
  * See the LICENSE file in the root directory of this source tree.
249
- */const up=Se("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),nT=({text:e})=>{const{message:{blocks:{text:t}}}=ye,[n,r]=M.useState(new Map);function i(s){if(n.has(s))return;const a=new Image;a.src=s,a.onerror=()=>{r(l=>new Map(l).set(s,!0))},a.onload=()=>{r(l=>new Map(l).set(s,!1))}}M.useEffect(()=>{const s=/!\[.*?\]\((.*?)\)/g,a=[];let l;for(;(l=s.exec(e))!==null;){const u=l[1];u&&!a.includes(u)&&a.push(u)}a.forEach(u=>{i(u)})},[e]);const o={h1:({node:s,...a})=>x.jsx("h1",{...a,...t.heading1}),h2:({node:s,...a})=>x.jsx("h2",{...a,...t.heading2}),h3:({node:s,...a})=>x.jsx("h3",{...a,...t.heading3}),h4:({node:s,...a})=>x.jsx("h4",{...a,...t.heading4}),h5:"h4",h6:"h4",em:({node:s,...a})=>x.jsx("em",{...a,...t.italic}),strong:({node:s,...a})=>x.jsx("strong",{...a,...t.bold}),p:({node:s,...a})=>x.jsx("p",{...a,...t.text}),hr:({node:s,...a})=>x.jsx("hr",{...a,...t.horizontalRule}),a:({node:s,href:a,children:l,...u})=>x.jsx("a",{...u,...t.link,onMouseUp:f=>{window.open(a,"_blank","noopener,noreferrer")},children:l}),img:({node:s,...a})=>{const l=a.src;return n.get(l)||!1?x.jsx("div",{"data-error":!0,...t.image,children:x.jsx(ap,{strokeWidth:"1"})}):x.jsx("img",{...a,...t.image})},ol:({node:s,...a})=>x.jsx("ol",{...a,...t.orderedList}),ul:({node:s,...a})=>x.jsx("ul",{...a,...t.unorderedList}),li:({node:s,...a})=>x.jsx("li",{...a,...t.listItem}),br:({node:s,...a})=>x.jsx("br",{...a,...t.lineBreak}),pre:({node:s,...a})=>{var m,p;const l=s==null?void 0:s.children[0],u=rT(((p=(m=l==null?void 0:l.properties)==null?void 0:m.className)==null?void 0:p[0])||""),[f,c]=M.useState(!1),h=M.useRef(null),d=()=>{if(!h.current)return;const g=h.current.textContent||"";navigator.clipboard.writeText(g).then(()=>{c(!0),setTimeout(()=>{c(!1)},1500)}).catch(v=>{console.error("Failed to copy code to clipboard:",v)})};return x.jsxs("div",{...t.codeBlockContainer,children:[x.jsxs("div",{...t.codeBlockTitle,children:[u?x.jsx("span",{children:u}):"Code",f?x.jsx(MA,{...t.codeBlockCopyIcon}):x.jsx(FA,{...t.codeBlockCopyIcon,onClick:d})]}),x.jsx("pre",{ref:h,...a,...t.codeBlock})]})},input:({node:s,...a})=>x.jsx("input",{...a,...t.input,disabled:!1}),code:({node:s,...a})=>x.jsx("code",{...a,...t.code}),table:({node:s,...a})=>x.jsx("div",{...t.tableContainer,children:x.jsx("table",{...a,...t.table})}),th:({node:s,...a})=>x.jsx("th",{...a,...t.tableHeader}),tr:({node:s,...a})=>x.jsx("tr",{...a,...t.tableRow}),td:({node:s,...a})=>x.jsx("td",{...a,...t.tableData})};return x.jsx(Sh,{urlTransform:s=>s.startsWith("tel:")?s:xh(s),components:o,remarkPlugins:[kA,bE],children:e})},rT=e=>{if(!e)return"";const t=e.match(/language-(\w+)/);return t?t[1]:""},iT={},cp=e=>{let t;const n=new Set,r=(l,u)=>{const f=typeof l=="function"?l(t):l;if(!Object.is(f,t)){const c=t;t=u??typeof f!="object"?f:Object.assign({},t,f),n.forEach(h=>h(t,c))}},i=()=>t,a={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(iT?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,i,a),a},oT=e=>e?cp(e):cp;var Da={exports:{}},Na={},Ji={exports:{}},_a={};/**
249
+ */const fp=Se("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function rT(){const e=this.data();e.micromarkExtensions??(e.micromarkExtensions=[]),e.micromarkExtensions.push({disable:{null:["codeIndented"]}})}const iT=({text:e})=>{const{message:{blocks:{text:t}}}=ye,[n,r]=M.useState(new Map);function i(s){if(n.has(s))return;const a=new Image;a.src=s,a.onerror=()=>{r(l=>new Map(l).set(s,!0))},a.onload=()=>{r(l=>new Map(l).set(s,!1))}}M.useEffect(()=>{const s=/!\[.*?\]\((.*?)\)/g,a=[];let l;for(;(l=s.exec(e))!==null;){const u=l[1];u&&!a.includes(u)&&a.push(u)}a.forEach(u=>{i(u)})},[e]);const o={h1:({node:s,...a})=>x.jsx("h1",{...a,...t.heading1}),h2:({node:s,...a})=>x.jsx("h2",{...a,...t.heading2}),h3:({node:s,...a})=>x.jsx("h3",{...a,...t.heading3}),h4:({node:s,...a})=>x.jsx("h4",{...a,...t.heading4}),h5:"h4",h6:"h4",em:({node:s,...a})=>x.jsx("em",{...a,...t.italic}),strong:({node:s,...a})=>x.jsx("strong",{...a,...t.bold}),p:({node:s,...a})=>x.jsx("p",{...a,...t.text}),hr:({node:s,...a})=>x.jsx("hr",{...a,...t.horizontalRule}),a:({node:s,href:a,children:l,...u})=>x.jsx("a",{...u,...t.link,onMouseUp:f=>{window.open(a,"_blank","noopener,noreferrer")},children:l}),img:({node:s,...a})=>{const l=a.src;return n.get(l)||!1?x.jsx("div",{"data-error":!0,...t.image,children:x.jsx(up,{strokeWidth:"1"})}):x.jsx("img",{...a,...t.image})},ol:({node:s,...a})=>x.jsx("ol",{...a,...t.orderedList}),ul:({node:s,...a})=>x.jsx("ul",{...a,...t.unorderedList}),li:({node:s,...a})=>x.jsx("li",{...a,...t.listItem}),br:({node:s,...a})=>x.jsx("br",{...a,...t.lineBreak}),pre:({node:s,...a})=>{var m,p;const l=s==null?void 0:s.children[0],u=oT(((p=(m=l==null?void 0:l.properties)==null?void 0:m.className)==null?void 0:p[0])||""),[f,c]=M.useState(!1),h=M.useRef(null),d=()=>{if(!h.current)return;const g=h.current.textContent||"";navigator.clipboard.writeText(g).then(()=>{c(!0),setTimeout(()=>{c(!1)},1500)}).catch(v=>{console.error("Failed to copy code to clipboard:",v)})};return x.jsxs("div",{...t.codeBlockContainer,children:[x.jsxs("div",{...t.codeBlockTitle,children:[u?x.jsx("span",{children:u}):"Code",f?x.jsx(DA,{...t.codeBlockCopyIcon}):x.jsx(RA,{...t.codeBlockCopyIcon,onClick:d})]}),x.jsx("pre",{ref:h,...a,...t.codeBlock})]})},input:({node:s,...a})=>x.jsx("input",{...a,...t.input,disabled:!1}),code:({node:s,...a})=>x.jsx("code",{...a,...t.code}),table:({node:s,...a})=>x.jsx("div",{...t.tableContainer,children:x.jsx("table",{...a,...t.table})}),th:({node:s,...a})=>x.jsx("th",{...a,...t.tableHeader}),tr:({node:s,...a})=>x.jsx("tr",{...a,...t.tableRow}),td:({node:s,...a})=>x.jsx("td",{...a,...t.tableData})};return x.jsx(kh,{urlTransform:s=>s.startsWith("tel:")?s:Eh(s),components:o,remarkPlugins:[rT,EA,wE],children:e})},oT=e=>{if(!e)return"";const t=e.match(/language-(\w+)/);return t?t[1]:""},sT={},dp=e=>{let t;const n=new Set,r=(l,u)=>{const f=typeof l=="function"?l(t):l;if(!Object.is(f,t)){const c=t;t=u??typeof f!="object"?f:Object.assign({},t,f),n.forEach(h=>h(t,c))}},i=()=>t,a={setState:r,getState:i,subscribe:l=>(n.add(l),()=>n.delete(l)),destroy:()=>{(sT?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,i,a),a},aT=e=>e?dp(e):dp;var Da={exports:{}},Na={},Ji={exports:{}},_a={};/**
250
250
  * @license React
251
251
  * use-sync-external-store-shim.production.min.js
252
252
  *
@@ -254,7 +254,7 @@ Please start a new conversation.`,Rs={ResourceNotFound:{type:"configuration",mes
254
254
  *
255
255
  * This source code is licensed under the MIT license found in the
256
256
  * LICENSE file in the root directory of this source tree.
257
- */var fp;function sT(){if(fp)return _a;fp=1;var e=M;function t(c,h){return c===h&&(c!==0||1/c===1/h)||c!==c&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(c,h){var d=h(),m=r({inst:{value:d,getSnapshot:h}}),p=m[0].inst,g=m[1];return o(function(){p.value=d,p.getSnapshot=h,l(p)&&g({inst:p})},[c,d,h]),i(function(){return l(p)&&g({inst:p}),c(function(){l(p)&&g({inst:p})})},[c]),s(d),d}function l(c){var h=c.getSnapshot;c=c.value;try{var d=h();return!n(c,d)}catch{return!0}}function u(c,h){return h()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return _a.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,_a}var Pa={};/**
257
+ */var hp;function lT(){if(hp)return _a;hp=1;var e=M;function t(c,h){return c===h&&(c!==0||1/c===1/h)||c!==c&&h!==h}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function a(c,h){var d=h(),m=r({inst:{value:d,getSnapshot:h}}),p=m[0].inst,g=m[1];return o(function(){p.value=d,p.getSnapshot=h,l(p)&&g({inst:p})},[c,d,h]),i(function(){return l(p)&&g({inst:p}),c(function(){l(p)&&g({inst:p})})},[c]),s(d),d}function l(c){var h=c.getSnapshot;c=c.value;try{var d=h();return!n(c,d)}catch{return!0}}function u(c,h){return h()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return _a.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,_a}var Pa={};/**
258
258
  * @license React
259
259
  * use-sync-external-store-shim.development.js
260
260
  *
@@ -262,7 +262,7 @@ Please start a new conversation.`,Rs={ResourceNotFound:{type:"configuration",mes
262
262
  *
263
263
  * This source code is licensed under the MIT license found in the
264
264
  * LICENSE file in the root directory of this source tree.
265
- */var dp;function aT(){return dp||(dp=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=M,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(w){{for(var A=arguments.length,k=new Array(A>1?A-1:0),E=1;E<A;E++)k[E-1]=arguments[E];r("error",w,k)}}function r(w,A,k){{var E=t.ReactDebugCurrentFrame,I=E.getStackAddendum();I!==""&&(A+="%s",k=k.concat([I]));var D=k.map(function(P){return String(P)});D.unshift("Warning: "+A),Function.prototype.apply.call(console[w],console,D)}}function i(w,A){return w===A&&(w!==0||1/w===1/A)||w!==w&&A!==A}var o=typeof Object.is=="function"?Object.is:i,s=e.useState,a=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue,f=!1,c=!1;function h(w,A,k){f||e.startTransition!==void 0&&(f=!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 E=A();if(!c){var I=A();o(E,I)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var D=s({inst:{value:E,getSnapshot:A}}),P=D[0].inst,T=D[1];return l(function(){P.value=E,P.getSnapshot=A,d(P)&&T({inst:P})},[w,E,A]),a(function(){d(P)&&T({inst:P});var O=function(){d(P)&&T({inst:P})};return w(O)},[w]),u(E),E}function d(w){var A=w.getSnapshot,k=w.value;try{var E=A();return!o(k,E)}catch{return!0}}function m(w,A,k){return A()}var p=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=!p,v=g?m:h,y=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v;Pa.useSyncExternalStore=y,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Pa}var hp;function pp(){return hp||(hp=1,process.env.NODE_ENV==="production"?Ji.exports=sT():Ji.exports=aT()),Ji.exports}/**
265
+ */var pp;function uT(){return pp||(pp=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=M,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(w){{for(var C=arguments.length,k=new Array(C>1?C-1:0),E=1;E<C;E++)k[E-1]=arguments[E];r("error",w,k)}}function r(w,C,k){{var E=t.ReactDebugCurrentFrame,I=E.getStackAddendum();I!==""&&(C+="%s",k=k.concat([I]));var D=k.map(function(P){return String(P)});D.unshift("Warning: "+C),Function.prototype.apply.call(console[w],console,D)}}function i(w,C){return w===C&&(w!==0||1/w===1/C)||w!==w&&C!==C}var o=typeof Object.is=="function"?Object.is:i,s=e.useState,a=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue,f=!1,c=!1;function h(w,C,k){f||e.startTransition!==void 0&&(f=!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 E=C();if(!c){var I=C();o(E,I)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var D=s({inst:{value:E,getSnapshot:C}}),P=D[0].inst,T=D[1];return l(function(){P.value=E,P.getSnapshot=C,d(P)&&T({inst:P})},[w,E,C]),a(function(){d(P)&&T({inst:P});var O=function(){d(P)&&T({inst:P})};return w(O)},[w]),u(E),E}function d(w){var C=w.getSnapshot,k=w.value;try{var E=C();return!o(k,E)}catch{return!0}}function m(w,C,k){return C()}var p=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",g=!p,v=g?m:h,y=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v;Pa.useSyncExternalStore=y,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Pa}var mp;function gp(){return mp||(mp=1,process.env.NODE_ENV==="production"?Ji.exports=lT():Ji.exports=uT()),Ji.exports}/**
266
266
  * @license React
267
267
  * use-sync-external-store-shim/with-selector.production.min.js
268
268
  *
@@ -270,7 +270,7 @@ Please start a new conversation.`,Rs={ResourceNotFound:{type:"configuration",mes
270
270
  *
271
271
  * This source code is licensed under the MIT license found in the
272
272
  * LICENSE file in the root directory of this source tree.
273
- */var mp;function lT(){if(mp)return Na;mp=1;var e=M,t=pp();function n(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Na.useSyncExternalStoreWithSelector=function(u,f,c,h,d){var m=o(null);if(m.current===null){var p={hasValue:!1,value:null};m.current=p}else p=m.current;m=a(function(){function v(E){if(!y){if(y=!0,w=E,E=h(E),d!==void 0&&p.hasValue){var I=p.value;if(d(I,E))return A=I}return A=E}if(I=A,r(w,E))return I;var D=h(E);return d!==void 0&&d(I,D)?I:(w=E,A=D)}var y=!1,w,A,k=c===void 0?null:c;return[function(){return v(f())},k===null?void 0:function(){return v(k())}]},[f,c,h,d]);var g=i(u,m[0],m[1]);return s(function(){p.hasValue=!0,p.value=g},[g]),l(g),g},Na}var La={};/**
273
+ */var yp;function cT(){if(yp)return Na;yp=1;var e=M,t=gp();function n(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;return Na.useSyncExternalStoreWithSelector=function(u,f,c,h,d){var m=o(null);if(m.current===null){var p={hasValue:!1,value:null};m.current=p}else p=m.current;m=a(function(){function v(E){if(!y){if(y=!0,w=E,E=h(E),d!==void 0&&p.hasValue){var I=p.value;if(d(I,E))return C=I}return C=E}if(I=C,r(w,E))return I;var D=h(E);return d!==void 0&&d(I,D)?I:(w=E,C=D)}var y=!1,w,C,k=c===void 0?null:c;return[function(){return v(f())},k===null?void 0:function(){return v(k())}]},[f,c,h,d]);var g=i(u,m[0],m[1]);return s(function(){p.hasValue=!0,p.value=g},[g]),l(g),g},Na}var La={};/**
274
274
  * @license React
275
275
  * use-sync-external-store-shim/with-selector.development.js
276
276
  *
@@ -278,50 +278,50 @@ Please start a new conversation.`,Rs={ResourceNotFound:{type:"configuration",mes
278
278
  *
279
279
  * This source code is licensed under the MIT license found in the
280
280
  * LICENSE file in the root directory of this source tree.
281
- */var gp;function uT(){return gp||(gp=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=M,t=pp();function n(f,c){return f===c&&(f!==0||1/f===1/c)||f!==f&&c!==c}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;function u(f,c,h,d,m){var p=o(null),g;p.current===null?(g={hasValue:!1,value:null},p.current=g):g=p.current;var v=a(function(){var k=!1,E,I,D=function(B){if(!k){k=!0,E=B;var L=d(B);if(m!==void 0&&g.hasValue){var F=g.value;if(m(F,L))return I=F,F}return I=L,L}var R=E,N=I;if(r(R,B))return N;var H=d(B);return m!==void 0&&m(N,H)?N:(E=B,I=H,H)},P=h===void 0?null:h,T=function(){return D(c())},O=P===null?void 0:function(){return D(P())};return[T,O]},[c,h,d,m]),y=v[0],w=v[1],A=i(f,y,w);return s(function(){g.hasValue=!0,g.value=A},[A]),l(A),A}La.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),La}process.env.NODE_ENV==="production"?Da.exports=lT():Da.exports=uT();var cT=Da.exports;const fT=vn(cT),yp={},{useSyncExternalStoreWithSelector:dT}=fT;let vp=!1;function hT(e,t=e.getState,n){(yp?"production":void 0)!=="production"&&n&&!vp&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),vp=!0);const r=dT(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return M.useDebugValue(r),r}const pT=e=>{(yp?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?oT(e):e,n=(r,i)=>hT(t,r,i);return Object.assign(n,t),n},ln=e=>pT,Xi={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Fa=new Map,eo=e=>{const t=Fa.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([n,r])=>[n,r.getState()])):{}},mT=(e,t,n)=>{if(e===void 0)return{type:"untracked",connection:t.connect(n)};const r=Fa.get(n.name);if(r)return{type:"tracked",store:e,...r};const i={connection:t.connect(n),stores:{}};return Fa.set(n.name,i),{type:"tracked",store:e,...i}},Gn=(e,t={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:s,store:a,...l}=t;let u;try{u=(o??(Xi?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!u)return(Xi?"production":void 0)!=="production"&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,r,i);const{connection:f,...c}=mT(a,u,l);let h=!0;i.setState=(p,g,v)=>{const y=n(p,g);if(!h)return y;const w=v===void 0?{type:s||"anonymous"}:typeof v=="string"?{type:v}:v;return a===void 0?(f==null||f.send(w,r()),y):(f==null||f.send({...w,type:`${a}/${w.type}`},{...eo(l.name),[a]:i.getState()}),y)};const d=(...p)=>{const g=h;h=!1,n(...p),h=g},m=e(i.setState,r,i);if(c.type==="untracked"?f==null||f.init(m):(c.stores[c.store]=i,f==null||f.init(Object.fromEntries(Object.entries(c.stores).map(([p,g])=>[p,p===c.store?m:g.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let p=!1;const g=i.dispatch;i.dispatch=(...v)=>{(Xi?"production":void 0)!=="production"&&v[0].type==="__setState"&&!p&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),p=!0),g(...v)}}return f.subscribe(p=>{var g;switch(p.type){case"ACTION":if(typeof p.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Ra(p.payload,v=>{if(v.type==="__setState"){if(a===void 0){d(v.state);return}Object.keys(v.state).length!==1&&console.error(`
281
+ */var vp;function fT(){return vp||(vp=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=M,t=gp();function n(f,c){return f===c&&(f!==0||1/f===1/c)||f!==f&&c!==c}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,o=e.useRef,s=e.useEffect,a=e.useMemo,l=e.useDebugValue;function u(f,c,h,d,m){var p=o(null),g;p.current===null?(g={hasValue:!1,value:null},p.current=g):g=p.current;var v=a(function(){var k=!1,E,I,D=function(U){if(!k){k=!0,E=U;var L=d(U);if(m!==void 0&&g.hasValue){var F=g.value;if(m(F,L))return I=F,F}return I=L,L}var R=E,N=I;if(r(R,U))return N;var j=d(U);return m!==void 0&&m(N,j)?N:(E=U,I=j,j)},P=h===void 0?null:h,T=function(){return D(c())},O=P===null?void 0:function(){return D(P())};return[T,O]},[c,h,d,m]),y=v[0],w=v[1],C=i(f,y,w);return s(function(){g.hasValue=!0,g.value=C},[C]),l(C),C}La.useSyncExternalStoreWithSelector=u,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),La}process.env.NODE_ENV==="production"?Da.exports=cT():Da.exports=fT();var dT=Da.exports;const hT=vn(dT),bp={},{useSyncExternalStoreWithSelector:pT}=hT;let wp=!1;function mT(e,t=e.getState,n){(bp?"production":void 0)!=="production"&&n&&!wp&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),wp=!0);const r=pT(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return M.useDebugValue(r),r}const gT=e=>{(bp?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?aT(e):e,n=(r,i)=>mT(t,r,i);return Object.assign(n,t),n},ln=e=>gT,Xi={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Fa=new Map,eo=e=>{const t=Fa.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([n,r])=>[n,r.getState()])):{}},yT=(e,t,n)=>{if(e===void 0)return{type:"untracked",connection:t.connect(n)};const r=Fa.get(n.name);if(r)return{type:"tracked",store:e,...r};const i={connection:t.connect(n),stores:{}};return Fa.set(n.name,i),{type:"tracked",store:e,...i}},Gn=(e,t={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:s,store:a,...l}=t;let u;try{u=(o??(Xi?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!u)return(Xi?"production":void 0)!=="production"&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,r,i);const{connection:f,...c}=yT(a,u,l);let h=!0;i.setState=(p,g,v)=>{const y=n(p,g);if(!h)return y;const w=v===void 0?{type:s||"anonymous"}:typeof v=="string"?{type:v}:v;return a===void 0?(f==null||f.send(w,r()),y):(f==null||f.send({...w,type:`${a}/${w.type}`},{...eo(l.name),[a]:i.getState()}),y)};const d=(...p)=>{const g=h;h=!1,n(...p),h=g},m=e(i.setState,r,i);if(c.type==="untracked"?f==null||f.init(m):(c.stores[c.store]=i,f==null||f.init(Object.fromEntries(Object.entries(c.stores).map(([p,g])=>[p,p===c.store?m:g.getState()])))),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let p=!1;const g=i.dispatch;i.dispatch=(...v)=>{(Xi?"production":void 0)!=="production"&&v[0].type==="__setState"&&!p&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),p=!0),g(...v)}}return f.subscribe(p=>{var g;switch(p.type){case"ACTION":if(typeof p.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Ra(p.payload,v=>{if(v.type==="__setState"){if(a===void 0){d(v.state);return}Object.keys(v.state).length!==1&&console.error(`
282
282
  [zustand devtools middleware] Unsupported __setState action format.
283
283
  When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
284
284
  and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
285
- `);const y=v.state[a];if(y==null)return;JSON.stringify(i.getState())!==JSON.stringify(y)&&d(y);return}i.dispatchFromDevtools&&typeof i.dispatch=="function"&&i.dispatch(v)});case"DISPATCH":switch(p.payload.type){case"RESET":return d(m),a===void 0?f==null?void 0:f.init(i.getState()):f==null?void 0:f.init(eo(l.name));case"COMMIT":if(a===void 0){f==null||f.init(i.getState());return}return f==null?void 0:f.init(eo(l.name));case"ROLLBACK":return Ra(p.state,v=>{if(a===void 0){d(v),f==null||f.init(i.getState());return}d(v[a]),f==null||f.init(eo(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Ra(p.state,v=>{if(a===void 0){d(v);return}JSON.stringify(i.getState())!==JSON.stringify(v[a])&&d(v[a])});case"IMPORT_STATE":{const{nextLiftedState:v}=p.payload,y=(g=v.computedStates.slice(-1)[0])==null?void 0:g.state;if(!y)return;d(a===void 0?y:y[a]),f==null||f.send(null,v);return}case"PAUSE_RECORDING":return h=!h}return}}),m},Ra=(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 to(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var o;const s=l=>l===null?null:JSON.parse(l,void 0),a=(o=n.getItem(i))!=null?o:null;return a instanceof Promise?a.then(s):s(a)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>n.removeItem(i)}}const Wr=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Wr(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Wr(r)(n)}}}},gT=(e,t)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:g=>g,version:0,merge:(g,v)=>({...v,...g}),...t},s=!1;const a=new Set,l=new Set;let u;try{u=o.getStorage()}catch{}if(!u)return e((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...g)},r,i);const f=Wr(o.serialize),c=()=>{const g=o.partialize({...r()});let v;const y=f({state:g,version:o.version}).then(w=>u.setItem(o.name,w)).catch(w=>{v=w});if(v)throw v;return y},h=i.setState;i.setState=(g,v)=>{h(g,v),c()};const d=e((...g)=>{n(...g),c()},r,i);let m;const p=()=>{var g;if(!u)return;s=!1,a.forEach(y=>y(r()));const v=((g=o.onRehydrateStorage)==null?void 0:g.call(o,r()))||void 0;return Wr(u.getItem.bind(u))(o.name).then(y=>{if(y)return o.deserialize(y)}).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==o.version){if(o.migrate)return o.migrate(y.state,y.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return y.state}).then(y=>{var w;return m=o.merge(y,(w=r())!=null?w:d),n(m,!0),c()}).then(()=>{v==null||v(m,void 0),s=!0,l.forEach(y=>y(m))}).catch(y=>{v==null||v(void 0,y)})};return i.persist={setOptions:g=>{o={...o,...g},g.getStorage&&(u=g.getStorage())},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>p(),hasHydrated:()=>s,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(l.add(g),()=>{l.delete(g)})},p(),m||d},yT=(e,t)=>(n,r,i)=>{let o={storage:to(()=>localStorage),partialize:p=>p,version:0,merge:(p,g)=>({...g,...p}),...t},s=!1;const a=new Set,l=new Set;let u=o.storage;if(!u)return e((...p)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...p)},r,i);const f=()=>{const p=o.partialize({...r()});return u.setItem(o.name,{state:p,version:o.version})},c=i.setState;i.setState=(p,g)=>{c(p,g),f()};const h=e((...p)=>{n(...p),f()},r,i);let d;const m=()=>{var p,g;if(!u)return;s=!1,a.forEach(y=>{var w;return y((w=r())!=null?w:h)});const v=((g=o.onRehydrateStorage)==null?void 0:g.call(o,(p=r())!=null?p:h))||void 0;return Wr(u.getItem.bind(u))(o.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==o.version){if(o.migrate)return o.migrate(y.state,y.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return y.state}).then(y=>{var w;return d=o.merge(y,(w=r())!=null?w:h),n(d,!0),f()}).then(()=>{v==null||v(d,void 0),d=r(),s=!0,l.forEach(y=>y(d))}).catch(y=>{v==null||v(void 0,y)})};return i.persist={setOptions:p=>{o={...o,...p},p.storage&&(u=p.storage)},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:p=>(a.add(p),()=>{a.delete(p)}),onFinishHydration:p=>(l.add(p),()=>{l.delete(p)})},o.skipHydration||m(),d||h},no=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((Xi?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),gT(e,t)):yT(e,t),vT=(e,t)=>ln()(Gn(no(n=>({messageHistory:[],addMessageToHistory:r=>n(i=>({...i,messageHistory:[r,...(i.messageHistory??[]).slice(0,100).filter(String)]})),clearHistory:()=>n(()=>({messageHistory:[]}))}),{name:e,storage:to(()=>t==="sessionStorage"?sessionStorage:localStorage)}))),$a={},bp=(e,t,n)=>{const i=`${t||"bp-webchat"}-message-history-${e}`;return $a[i]||($a[i]=vT(i,n)),$a[i]},bT=e=>ln()(Gn(t=>({messages:[],setMessages:n=>t({messages:n}),saveMessage:n=>t(({messages:r})=>{var s;const i=(s=n.metadata)==null?void 0:s.clientMessageId;let o=-1;return i&&(o=r.findIndex(a=>{var l;return((l=a.metadata)==null?void 0:l.clientMessageId)===i})),o===-1&&(o=r.findIndex(a=>a.id===n.id)),o!==-1?{messages:[...r.slice(0,o),{...r[o],...n},...r.slice(o+1)]}:{messages:[...r,n]}}),updateMessage:(n,r)=>t(({messages:i})=>({messages:i.map(o=>o.id===n?{...o,...r}:o)})),removeMessage:n=>t(({messages:r})=>({messages:r.filter(i=>i.id!==n)})),clearMessages:()=>t({messages:[]})}),{name:e})),Ba={},wp=e=>{const t=`messages-${e}`;return Ba[t]||(Ba[t]=bT(t)),Ba[t]},wT=(e,t)=>ln()(Gn(no(n=>({setUser:r=>n(i=>({...i,user:r})),setConversationId:r=>n(i=>({...i,conversationId:r})),clearAll:()=>{n(r=>({...r,user:void 0,conversationId:void 0}))}}),{name:e,storage:to(()=>t==="sessionStorage"?sessionStorage:localStorage)}))),za={},Sp=(e="bp-webchat",t)=>{const n=`${e}-client`;return za[n]||(za[n]=wT(n,t)),za[n]},Qn=ln()(Gn(e=>({eventEmitter:nc(),messageContainerRef:M.createRef(),setMessageContainerRef:t=>e({messageContainerRef:t}),portalContainer:null,setPortalContainer:t=>e({portalContainer:t})}),{name:"webchatStore"})),ST=8,xT=e=>ln()(no((t,n)=>({files:[],setFiles:r=>t({files:r}),upsertFile:r=>t(({files:i})=>({files:i.some(a=>a.name===r.name)?i.map(a=>a.name===r.name?{...a,...r}:a):[...i,{...r}]})),uploadFile:async(r,i)=>{if(n().files.length===ST)return;const o=r.name.lastIndexOf("."),s=o>0&&o<r.name.length-1,a=s?r.name.substring(0,o):r.name,l=s?r.name.substring(o):"",u=_w(a,n().files,h=>h.name),f=u+l,c=new File([r],f,{type:r.type});n().upsertFile({name:u,type:"file",instance:c,status:"loading"});try{const{fileUrl:h,type:d,fileId:m}=await i(c);n().upsertFile({fileId:m,name:u,type:d,url:h,instance:c,status:"uploaded"})}catch{n().upsertFile({name:u,type:"file",instance:c,status:"error"})}},deleteFile:r=>t(({files:i})=>({files:i.filter(o=>o.name!=r)}))}),{name:e,storage:to(()=>sessionStorage)})),Ua={},xp=(e,t)=>{const r=`${t||"bp-webchat"}-composer-files-${e}`;return Ua[r]||(Ua[r]=xT(r)),Ua[r]},kT=e=>ln()(Gn(t=>({participants:[],setParticipants:n=>t({participants:n}),addParticipant:n=>t(r=>({participants:[...r.participants,n]})),removeParticipant:n=>t(r=>({participants:r.participants.filter(i=>i.id!==n)})),clearParticipants:()=>t({participants:[]})}),{name:e})),Ha={},kp=e=>{const t=`participants-${e}`;return Ha[t]||(Ha[t]=kT(t)),Ha[t]},ET=e=>ln()(Gn(no((t,n)=>({soundOn:!0,setSoundEnabled:r=>t({soundOn:r}),toggleSound:()=>t({soundOn:!n().soundOn})}),{name:e}))),ja={},Ep=(e="bp-webchat")=>{const t=`${e}-sound`;return ja[t]||(ja[t]=ET(t)),ja[t]},CT=({text:e,buttonValue:t,variant:n,groupId:r,reusable:i,sendMessage:o,isReadOnly:s,...a})=>{const l=Qn(w=>w.eventEmitter),[u,f]=M.useState(!1),[c,h]=M.useState(!1),[d,m]=M.useState(!1),{message:{blocks:{button:p}}}=ye;M.useEffect(()=>{if(r)return l.on(`button-group-${r}-click`,()=>{h(!0),i||m(!0)})},[l,r,i]);const v={...a,onClick:w=>{if((d||s)&&n==="link"){w.preventDefault();return}f(!0),i||m(!0),r&&l.emit(`button-group-${r}-click`),n!=="link"&&o&&(o==null||o({type:"text",text:e,value:t}))},"data-activated":u?"":void 0,"data-group-activated":c?"":void 0,"data-type":n,...p},y=d||s;return n==="link"?x.jsx("a",{...v,style:s?{pointerEvents:"none"}:void 0,href:t,target:"_blank",rel:"noopener noreferrer",children:e}):x.jsx("button",{...v,style:s?{pointerEvents:"none"}:void 0,disabled:y,children:e})},Va=M.createContext(null);function Cp(){const e=M.useContext(Va);if(!e)throw new Error("useMessageContext must be used within a Message");return e}const Wa=M.createContext({showInputModal:void 0});function qa(){return M.useContext(Wa)}const Ap=M.forwardRef(({block:e,direction:t,sender:n,timestamp:r,messageId:i,feedback:o,metadata:s,isReadOnly:a,sendMessage:l,addMessageFeedback:u,...f},c)=>{const{showInputModal:h}=qa(),{message:{blocks:{bubble:{container:d,feedbackContainer:m,feedbackIcon:p}}}}=ye;return t=="incoming"?x.jsxs("div",{"data-direction":"incoming","data-feedback":!!o,...f,...d,ref:c,children:[x.jsx(Dn,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:a,metadata:s,sendMessage:l}}),u&&h&&e.type==="text"&&x.jsxs("div",{...m,children:[x.jsx(QA,{...p,"data-selected":o==="positive",onClick:()=>u(i,{value:"positive"})}),x.jsx(GA,{...p,"data-selected":o==="negative",onClick:async()=>{const g=await h({title:"Help us improve",description:"Please provide feedback to help us improve.",confirmButtonText:"Send feedback",cancelButtonText:"Cancel",Content:AT});u(i,{value:"negative",comment:g})}})]})]}):x.jsx("div",{"data-direction":"outgoing",...f,...d,ref:c,children:x.jsx(Dn,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:a,metadata:s,sendMessage:l,addMessageFeedback:u}})})});Ap.displayName="Bubble";const AT=({setValue:e})=>{const{modal:{dialog:{content:t}}}=ye;return x.jsx("textarea",{...t.textarea,placeholder:"Let us know what went wrong...",onChange:n=>e(n.target.value)})},Tp=({className:e,...t})=>x.jsx("div",{"data-slot":"skeleton",className:`bpSkeleton ${e||""}`,...t});Tp.displayName="Skeleton";var xt=function(){return xt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},xt.apply(this,arguments)};function Ip(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 Zn(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(f){try{u(r.next(f))}catch(c){s(c)}}function l(f){try{u(r.throw(f))}catch(c){s(c)}}function u(f){f.done?o(f.value):i(f.value).then(a,l)}u((r=r.apply(e,t||[])).next())})}function Jn(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(f){return l([u,f])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(f){u=[6,f],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Op(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],s;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o}function Ya(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function TT(){var e=M.useRef(!1),t=M.useCallback(function(){return e.current},[]);return M.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}function IT(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=M.useRef(0),i=TT(),o=M.useState(n),s=o[0],a=o[1],l=M.useCallback(function(){for(var u=[],f=0;f<arguments.length;f++)u[f]=arguments[f];var c=++r.current;return s.loading||a(function(h){return xt(xt({},h),{loading:!0})}),e.apply(void 0,u).then(function(h){return i()&&c===r.current&&a({value:h,loading:!1}),h},function(h){return i()&&c===r.current&&a({error:h,loading:!1}),h})},t);return[s,l]}function OT(e,t){t===void 0&&(t=[]);var n=IT(e,t,{loading:!0}),r=n[0],i=n[1];return M.useEffect(function(){i()},[i]),r}const Mp=M.forwardRef(({url:e,type:t,orientation:n="auto",...r},i)=>{const o=M.useId(),{setIsLoading:s}=Cp(),[a,l]=M.useState(n==="auto"?"square":n),[u,f]=M.useState("initial"),{message:{blocks:{image:c}}}=ye;return M.useLayoutEffect(()=>(s(h=>[...h,o]),()=>{s(h=>h.filter(d=>d!==o))}),[o,s]),OT(async()=>{if(!e)return;const h=new Image;try{const{width:d,height:m}=await sb(e);n==="auto"&&l(MT(d,m)),h.onload=()=>{f("loaded"),s(p=>p.filter(g=>g!==o))},h.onerror=()=>{f("error"),l("square"),s(p=>p.filter(g=>g!==o))},h.src=e,h.complete&&(h.naturalWidth>0?(f("loaded"),s(p=>p.filter(g=>g!==o))):(f("error"),l("square"),s(p=>p.filter(g=>g!==o))))}catch(d){console.error(d),f("error"),s(m=>m.filter(p=>p!==o))}return()=>{h.onload=null,h.onerror=null}},[e,o,s,n]),e?u==="error"?x.jsx("div",{"data-error":"true","data-orientation":a,...r,...c.image,ref:i,children:x.jsx(ap,{size:"25%",strokeWidth:"5%"})}):u==="initial"?x.jsx(Tp,{"data-orientation":a,...c.placeholder}):x.jsx("img",{"data-orientation":a,"data-loaded":u==="loaded",...r,...c.image,src:e,alt:"",ref:i}):null});Mp.displayName="Image";function MT(e,t){const n={square:1,portrait:.75,landscape:1.3333333333333333},r=e/t;return Object.keys(n).reduce((o,s)=>Math.abs(n[s]-r)<Math.abs(n[o]-r)?s:o)}const Dp=M.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{video:i}}}=ye;return x.jsx("div",{children:x.jsx("video",{...n,"data-chromatic":"ignore",style:t?{pointerEvents:"none"}:void 0,controls:!0,src:e,...i,ref:r})})});Dp.displayName="Video";const Np=M.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{audio:i}}}=ye;return x.jsx("div",{children:x.jsx("audio",{...n,controls:!0,style:t?{pointerEvents:"none"}:void 0,src:e,...i,ref:r})})});Np.displayName="Audio";const _p=M.forwardRef(({latitude:e,longitude:t,title:n,isReadOnly:r,...i},o)=>{const s=`https://www.google.com/maps/search/?api=1&query=${e},${t}`,{message:{blocks:{location:a}}}=ye;return x.jsxs("a",{...i,...a.container,style:r?{pointerEvents:"none"}:void 0,href:s,type:"_blank",rel:"noopener",ref:o,children:[x.jsx("p",{...a.title,children:n}),x.jsx(HA,{...a.icon})]})});_p.displayName="Location";const Pp=M.forwardRef(({blocks:e,horizontalAlignment:t,verticalAlignment:n,direction:r,sender:i,timestamp:o,messageId:s,isReadOnly:a,sendMessage:l,...u},f)=>{const{message:{blocks:{column:c}}}=ye;return x.jsx("div",{"data-horizontal":t,"data-vertical":n,...u,...c,ref:f,children:e.map((h,d)=>x.jsx(Dn,{block:{...h,direction:r,timestamp:o,sender:i,messageId:s,isReadOnly:a,sendMessage:l}},d))})});Pp.displayName="Column";const Lp=M.forwardRef(({blocks:e,horizontalAlignment:t,verticalAlignment:n,direction:r,sender:i,timestamp:o,metadata:s,messageId:a,isReadOnly:l,sendMessage:u,...f},c)=>{const{message:{blocks:{row:h}}}=ye;return x.jsx("div",{"data-horizontal":t,"data-vertical":n,...f,...h,ref:c,children:e.map((d,m)=>x.jsx(Dn,{block:{...d,direction:r,timestamp:o,sender:i,messageId:a,isReadOnly:l,sendMessage:u}},m))})});Lp.displayName="Row";function DT(e){return Object.prototype.toString.call(e)==="[object Object]"}function Fp(e){return DT(e)||Array.isArray(e)}function NT(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Ka(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||{})),o=JSON.stringify(Object.keys(t.breakpoints||{}));return i!==o?!1:n.every(s=>{const a=e[s],l=t[s];return typeof a=="function"?`${a}`==`${l}`:!Fp(a)||!Fp(l)?a===l:Ka(a,l)})}function Rp(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function _T(e,t){if(e.length!==t.length)return!1;const n=Rp(e),r=Rp(t);return n.every((i,o)=>{const s=r[o];return Ka(i,s)})}function Ga(e){return typeof e=="number"}function Qa(e){return typeof e=="string"}function ro(e){return typeof e=="boolean"}function $p(e){return Object.prototype.toString.call(e)==="[object Object]"}function $e(e){return Math.abs(e)}function Za(e){return Math.sign(e)}function qr(e,t){return $e(e-t)}function PT(e,t){if(e===0||t===0||$e(e)<=$e(t))return 0;const n=qr($e(e),$e(t));return $e(n/e)}function LT(e){return Math.round(e*100)/100}function Yr(e){return Gr(e).map(Number)}function Dt(e){return e[Kr(e)]}function Kr(e){return Math.max(0,e.length-1)}function Ja(e,t){return t===Kr(e)}function Bp(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function Gr(e){return Object.keys(e)}function zp(e,t){return[e,t].reduce((n,r)=>(Gr(r).forEach(i=>{const o=n[i],s=r[i],a=$p(o)&&$p(s);n[i]=a?zp(o,s):s}),n),{})}function Xa(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function FT(e,t){const n={start:r,center:i,end:o};function r(){return 0}function i(l){return o(l)/2}function o(l){return t-l}function s(l,u){return Qa(e)?n[e](l):e(t,l,u)}return{measure:s}}function Qr(){let e=[];function t(i,o,s,a={passive:!0}){let l;if("addEventListener"in i)i.addEventListener(o,s,a),l=()=>i.removeEventListener(o,s,a);else{const u=i;u.addListener(s),l=()=>u.removeListener(s)}return e.push(l),r}function n(){e=e.filter(i=>i())}const r={add:t,clear:n};return r}function RT(e,t,n,r){const i=Qr(),o=1e3/60;let s=null,a=0,l=0;function u(){i.add(e,"visibilitychange",()=>{e.hidden&&m()})}function f(){d(),i.clear()}function c(g){if(!l)return;s||(s=g,n(),n());const v=g-s;for(s=g,a+=v;a>=o;)n(),a-=o;const y=a/o;r(y),l&&(l=t.requestAnimationFrame(c))}function h(){l||(l=t.requestAnimationFrame(c))}function d(){t.cancelAnimationFrame(l),s=null,a=0,l=0}function m(){s=null,a=0}return{init:u,destroy:f,start:h,stop:d,update:n,render:r}}function $T(e,t){const n=t==="rtl",r=e==="y",i=r?"y":"x",o=r?"x":"y",s=!r&&n?-1:1,a=f(),l=c();function u(m){const{height:p,width:g}=m;return r?p:g}function f(){return r?"top":n?"right":"left"}function c(){return r?"bottom":n?"left":"right"}function h(m){return m*s}return{scroll:i,cross:o,startEdge:a,endEdge:l,measureSize:u,direction:h}}function On(e=0,t=0){const n=$e(e-t);function r(u){return u<e}function i(u){return u>t}function o(u){return r(u)||i(u)}function s(u){return o(u)?r(u)?e:t:u}function a(u){return n?u-n*Math.ceil((u-t)/n):u}return{length:n,max:t,min:e,constrain:s,reachedAny:o,reachedMax:i,reachedMin:r,removeOffset:a}}function Up(e,t,n){const{constrain:r}=On(0,e),i=e+1;let o=s(t);function s(h){return n?$e((i+h)%i):r(h)}function a(){return o}function l(h){return o=s(h),c}function u(h){return f().set(a()+h)}function f(){return Up(e,a(),n)}const c={get:a,set:l,add:u,clone:f};return c}function BT(e,t,n,r,i,o,s,a,l,u,f,c,h,d,m,p,g,v,y){const{cross:w,direction:A}=e,k=["INPUT","SELECT","TEXTAREA"],E={passive:!1},I=Qr(),D=Qr(),P=On(50,225).constrain(d.measure(20)),T={mouse:300,touch:400},O={mouse:500,touch:600},B=m?43:25;let L=!1,F=0,R=0,N=!1,H=!1,z=!1,W=!1;function b($){if(!y)return;function ne(Oe){(ro(y)||y($,Oe))&&q(Oe)}const me=t;I.add(me,"dragstart",Oe=>Oe.preventDefault(),E).add(me,"touchmove",()=>{},E).add(me,"touchend",()=>{}).add(me,"touchstart",ne).add(me,"mousedown",ne).add(me,"touchcancel",X).add(me,"contextmenu",X).add(me,"click",se,!0)}function _(){I.clear(),D.clear()}function j(){const $=W?n:t;D.add($,"touchmove",Q,E).add($,"touchend",X).add($,"mousemove",Q,E).add($,"mouseup",X)}function S($){const ne=$.nodeName||"";return k.includes(ne)}function V(){return(m?O:T)[W?"mouse":"touch"]}function Y($,ne){const me=c.add(Za($)*-1),Oe=f.byDistance($,!m).distance;return m||$e($)<P?Oe:g&&ne?Oe*.5:f.byIndex(me.get(),0).distance}function q($){const ne=Xa($,r);W=ne,z=m&&ne&&!$.buttons&&L,L=qr(i.get(),s.get())>=2,!(ne&&$.button!==0)&&(S($.target)||(N=!0,o.pointerDown($),u.useFriction(0).useDuration(0),i.set(s),j(),F=o.readPoint($),R=o.readPoint($,w),h.emit("pointerDown")))}function Q($){if(!Xa($,r)&&$.touches.length>=2)return X($);const me=o.readPoint($),Oe=o.readPoint($,w),J=qr(me,F),ue=qr(Oe,R);if(!H&&!W&&(!$.cancelable||(H=J>ue,!H)))return X($);const de=o.pointerMove($);J>p&&(z=!0),u.useFriction(.3).useDuration(.75),a.start(),i.add(A(de)),$.preventDefault()}function X($){const me=f.byDistance(0,!1).index!==c.get(),Oe=o.pointerUp($)*V(),J=Y(A(Oe),me),ue=PT(Oe,J),de=B-10*ue,fe=v+ue/50;H=!1,N=!1,D.clear(),u.useDuration(de).useFriction(fe),l.distance(J,!m),W=!1,h.emit("pointerUp")}function se($){z&&($.stopPropagation(),$.preventDefault(),z=!1)}function G(){return N}return{init:b,destroy:_,pointerDown:G}}function zT(e,t){let r,i;function o(c){return c.timeStamp}function s(c,h){const m=`client${(h||e.scroll)==="x"?"X":"Y"}`;return(Xa(c,t)?c:c.touches[0])[m]}function a(c){return r=c,i=c,s(c)}function l(c){const h=s(c)-s(i),d=o(c)-o(r)>170;return i=c,d&&(r=c),h}function u(c){if(!r||!i)return 0;const h=s(i)-s(r),d=o(c)-o(r),m=o(c)-o(i)>170,p=h/d;return d&&!m&&$e(p)>.1?p:0}return{pointerDown:a,pointerMove:l,pointerUp:u,readPoint:s}}function UT(){function e(n){const{offsetTop:r,offsetLeft:i,offsetWidth:o,offsetHeight:s}=n;return{top:r,right:i+o,bottom:r+s,left:i,width:o,height:s}}return{measure:e}}function HT(e){function t(r){return e*(r/100)}return{measure:t}}function jT(e,t,n,r,i,o,s){const a=[e].concat(r);let l,u,f=[],c=!1;function h(g){return i.measureSize(s.measure(g))}function d(g){if(!o)return;u=h(e),f=r.map(h);function v(y){for(const w of y){if(c)return;const A=w.target===e,k=r.indexOf(w.target),E=A?u:f[k],I=h(A?e:r[k]);if($e(I-E)>=.5){g.reInit(),t.emit("resize");break}}}l=new ResizeObserver(y=>{(ro(o)||o(g,y))&&v(y)}),n.requestAnimationFrame(()=>{a.forEach(y=>l.observe(y))})}function m(){c=!0,l&&l.disconnect()}return{init:d,destroy:m}}function VT(e,t,n,r,i,o){let s=0,a=0,l=i,u=o,f=e.get(),c=0;function h(){const E=r.get()-e.get(),I=!l;let D=0;return I?(s=0,n.set(r),e.set(r),D=E):(n.set(e),s+=E/l,s*=u,f+=s,e.add(s),D=f-c),a=Za(D),c=f,k}function d(){const E=r.get()-t.get();return $e(E)<.001}function m(){return l}function p(){return a}function g(){return s}function v(){return w(i)}function y(){return A(o)}function w(E){return l=E,k}function A(E){return u=E,k}const k={direction:p,duration:m,velocity:g,seek:h,settled:d,useBaseFriction:y,useBaseDuration:v,useFriction:A,useDuration:w};return k}function WT(e,t,n,r,i){const o=i.measure(10),s=i.measure(50),a=On(.1,.99);let l=!1;function u(){return!(l||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function f(d){if(!u())return;const m=e.reachedMin(t.get())?"min":"max",p=$e(e[m]-t.get()),g=n.get()-t.get(),v=a.constrain(p/s);n.subtract(g*v),!d&&$e(g)<o&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function c(d){l=!d}return{shouldConstrain:u,constrain:f,toggleActive:c}}function qT(e,t,n,r,i){const o=On(-t+e,0),s=c(),a=f(),l=h();function u(m,p){return qr(m,p)<=1}function f(){const m=s[0],p=Dt(s),g=s.lastIndexOf(m),v=s.indexOf(p)+1;return On(g,v)}function c(){return n.map((m,p)=>{const{min:g,max:v}=o,y=o.constrain(m),w=!p,A=Ja(n,p);return w?v:A||u(g,y)?g:u(v,y)?v:y}).map(m=>parseFloat(m.toFixed(3)))}function h(){if(t<=e+i)return[o.max];if(r==="keepSnaps")return s;const{min:m,max:p}=a;return s.slice(m,p)}return{snapsContained:l,scrollContainLimit:a}}function YT(e,t,n){const r=t[0],i=n?r-e:Dt(t);return{limit:On(i,r)}}function KT(e,t,n,r){const o=t.min+.1,s=t.max+.1,{reachedMin:a,reachedMax:l}=On(o,s);function u(h){return h===1?l(n.get()):h===-1?a(n.get()):!1}function f(h){if(!u(h))return;const d=e*(h*-1);r.forEach(m=>m.add(d))}return{loop:f}}function GT(e){const{max:t,length:n}=e;function r(o){const s=o-t;return n?s/-n:0}return{get:r}}function QT(e,t,n,r,i){const{startEdge:o,endEdge:s}=e,{groupSlides:a}=i,l=c().map(t.measure),u=h(),f=d();function c(){return a(r).map(p=>Dt(p)[s]-p[0][o]).map($e)}function h(){return r.map(p=>n[o]-p[o]).map(p=>-$e(p))}function d(){return a(u).map(p=>p[0]).map((p,g)=>p+l[g])}return{snaps:u,snapsAligned:f}}function ZT(e,t,n,r,i,o){const{groupSlides:s}=i,{min:a,max:l}=r,u=f();function f(){const h=s(o),d=!e||t==="keepSnaps";return n.length===1?[o]:d?h:h.slice(a,l).map((m,p,g)=>{const v=!p,y=Ja(g,p);if(v){const w=Dt(g[0])+1;return Bp(w)}if(y){const w=Kr(o)-Dt(g)[0]+1;return Bp(w,Dt(g)[0])}return m})}return{slideRegistry:u}}function JT(e,t,n,r,i){const{reachedAny:o,removeOffset:s,constrain:a}=r;function l(m){return m.concat().sort((p,g)=>$e(p)-$e(g))[0]}function u(m){const p=e?s(m):a(m),g=t.map((y,w)=>({diff:f(y-p,0),index:w})).sort((y,w)=>$e(y.diff)-$e(w.diff)),{index:v}=g[0];return{index:v,distance:p}}function f(m,p){const g=[m,m+n,m-n];if(!e)return m;if(!p)return l(g);const v=g.filter(y=>Za(y)===p);return v.length?l(v):Dt(g)-n}function c(m,p){const g=t[m]-i.get(),v=f(g,p);return{index:m,distance:v}}function h(m,p){const g=i.get()+m,{index:v,distance:y}=u(g),w=!e&&o(g);if(!p||w)return{index:v,distance:m};const A=t[v]-y,k=m+f(A,0);return{index:v,distance:k}}return{byDistance:h,byIndex:c,shortcut:f}}function XT(e,t,n,r,i,o,s){function a(c){const h=c.distance,d=c.index!==t.get();o.add(h),h&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),d&&(n.set(t.get()),t.set(c.index),s.emit("select"))}function l(c,h){const d=i.byDistance(c,h);a(d)}function u(c,h){const d=t.clone().set(c),m=i.byIndex(d.get(),h);a(m)}return{distance:l,index:u}}function eI(e,t,n,r,i,o,s,a){const l={passive:!0,capture:!0};let u=0;function f(d){if(!a)return;function m(p){if(new Date().getTime()-u>10)return;s.emit("slideFocusStart"),e.scrollLeft=0;const y=n.findIndex(w=>w.includes(p));Ga(y)&&(i.useDuration(0),r.index(y,0),s.emit("slideFocus"))}o.add(document,"keydown",c,!1),t.forEach((p,g)=>{o.add(p,"focus",v=>{(ro(a)||a(d,v))&&m(g)},l)})}function c(d){d.code==="Tab"&&(u=new Date().getTime())}return{init:f}}function Zr(e){let t=e;function n(){return t}function r(l){t=s(l)}function i(l){t+=s(l)}function o(l){t-=s(l)}function s(l){return Ga(l)?l:l.get()}return{get:n,set:r,add:i,subtract:o}}function Hp(e,t){const n=e.scroll==="x"?s:a,r=t.style;let i=null,o=!1;function s(h){return`translate3d(${h}px,0px,0px)`}function a(h){return`translate3d(0px,${h}px,0px)`}function l(h){if(o)return;const d=LT(e.direction(h));d!==i&&(r.transform=n(d),i=d)}function u(h){o=!h}function f(){o||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:f,to:l,toggleActive:u}}function tI(e,t,n,r,i,o,s,a,l){const f=Yr(i),c=Yr(i).reverse(),h=v().concat(y());function d(I,D){return I.reduce((P,T)=>P-i[T],D)}function m(I,D){return I.reduce((P,T)=>d(P,D)>0?P.concat([T]):P,[])}function p(I){return o.map((D,P)=>({start:D-r[P]+.5+I,end:D+t-.5+I}))}function g(I,D,P){const T=p(D);return I.map(O=>{const B=P?0:-n,L=P?n:0,F=P?"end":"start",R=T[O][F];return{index:O,loopPoint:R,slideLocation:Zr(-1),translate:Hp(e,l[O]),target:()=>a.get()>R?B:L}})}function v(){const I=s[0],D=m(c,I);return g(D,n,!1)}function y(){const I=t-s[0]-1,D=m(f,I);return g(D,-n,!0)}function w(){return h.every(({index:I})=>{const D=f.filter(P=>P!==I);return d(D,t)<=.1})}function A(){h.forEach(I=>{const{target:D,translate:P,slideLocation:T}=I,O=D();O!==T.get()&&(P.to(O),T.set(O))})}function k(){h.forEach(I=>I.translate.clear())}return{canLoop:w,clear:k,loop:A,loopPoints:h}}function nI(e,t,n){let r,i=!1;function o(l){if(!n)return;function u(f){for(const c of f)if(c.type==="childList"){l.reInit(),t.emit("slidesChanged");break}}r=new MutationObserver(f=>{i||(ro(n)||n(l,f))&&u(f)}),r.observe(e,{childList:!0})}function s(){r&&r.disconnect(),i=!0}return{init:o,destroy:s}}function rI(e,t,n,r){const i={};let o=null,s=null,a,l=!1;function u(){a=new IntersectionObserver(m=>{l||(m.forEach(p=>{const g=t.indexOf(p.target);i[g]=p}),o=null,s=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(m=>a.observe(m))}function f(){a&&a.disconnect(),l=!0}function c(m){return Gr(i).reduce((p,g)=>{const v=parseInt(g),{isIntersecting:y}=i[v];return(m&&y||!m&&!y)&&p.push(v),p},[])}function h(m=!0){if(m&&o)return o;if(!m&&s)return s;const p=c(m);return m&&(o=p),m||(s=p),p}return{init:u,destroy:f,get:h}}function iI(e,t,n,r,i,o){const{measureSize:s,startEdge:a,endEdge:l}=e,u=n[0]&&i,f=m(),c=p(),h=n.map(s),d=g();function m(){if(!u)return 0;const y=n[0];return $e(t[a]-y[a])}function p(){if(!u)return 0;const y=o.getComputedStyle(Dt(r));return parseFloat(y.getPropertyValue(`margin-${l}`))}function g(){return n.map((y,w,A)=>{const k=!w,E=Ja(A,w);return k?h[w]+f:E?h[w]+c:A[w+1][a]-y[a]}).map($e)}return{slideSizes:h,slideSizesWithGaps:d,startGap:f,endGap:c}}function oI(e,t,n,r,i,o,s,a,l){const{startEdge:u,endEdge:f,direction:c}=e,h=Ga(n);function d(v,y){return Yr(v).filter(w=>w%y===0).map(w=>v.slice(w,w+y))}function m(v){return v.length?Yr(v).reduce((y,w,A)=>{const k=Dt(y)||0,E=k===0,I=w===Kr(v),D=i[u]-o[k][u],P=i[u]-o[w][f],T=!r&&E?c(s):0,O=!r&&I?c(a):0,B=$e(P-O-(D+T));return A&&B>t+l&&y.push(w),I&&y.push(v.length),y},[]).map((y,w,A)=>{const k=Math.max(A[w-1]||0);return v.slice(k,y)}):[]}function p(v){return h?d(v,n):m(v)}return{groupSlides:p}}function sI(e,t,n,r,i,o,s){const{align:a,axis:l,direction:u,startIndex:f,loop:c,duration:h,dragFree:d,dragThreshold:m,inViewThreshold:p,slidesToScroll:g,skipSnaps:v,containScroll:y,watchResize:w,watchSlides:A,watchDrag:k,watchFocus:E}=o,I=2,D=UT(),P=D.measure(t),T=n.map(D.measure),O=$T(l,u),B=O.measureSize(P),L=HT(B),F=FT(a,B),R=!c&&!!y,N=c||!!y,{slideSizes:H,slideSizesWithGaps:z,startGap:W,endGap:b}=iI(O,P,T,n,N,i),_=oI(O,B,g,c,P,T,W,b,I),{snaps:j,snapsAligned:S}=QT(O,F,P,T,_),V=-Dt(j)+Dt(z),{snapsContained:Y,scrollContainLimit:q}=qT(B,V,S,y,I),Q=R?Y:S,{limit:X}=YT(V,Q,c),se=Up(Kr(Q),f,c),G=se.clone(),te=Yr(n),$=({dragHandler:he,scrollBody:je,scrollBounds:Ge,options:{loop:Ze}})=>{Ze||Ge.constrain(he.pointerDown()),je.seek()},ne=({scrollBody:he,translate:je,location:Ge,offsetLocation:Ze,previousLocation:Et,scrollLooper:Rt,slideLooper:Qe,dragHandler:Ct,animation:at,eventHandler:es,scrollBounds:bP,options:{loop:Rv}},$v)=>{const Bv=he.settled(),wP=!bP.shouldConstrain(),zv=Rv?Bv:Bv&&wP,Uv=zv&&!Ct.pointerDown();Uv&&at.stop();const SP=Ge.get()*$v+Et.get()*(1-$v);Ze.set(SP),Rv&&(Rt.loop(he.direction()),Qe.loop()),je.to(Ze.get()),Uv&&es.emit("settle"),zv||es.emit("scroll")},me=RT(r,i,()=>$(le),he=>ne(le,he)),Oe=.68,J=Q[se.get()],ue=Zr(J),de=Zr(J),fe=Zr(J),Ae=Zr(J),Fe=VT(ue,fe,de,Ae,h,Oe),Me=JT(c,Q,V,X,Ae),He=XT(me,se,G,Fe,Me,Ae,s),ee=GT(X),ae=Qr(),U=rI(t,n,s,p),{slideRegistry:K}=ZT(R,y,Q,q,_,te),oe=eI(e,n,K,He,Fe,ae,s,E),le={ownerDocument:r,ownerWindow:i,eventHandler:s,containerRect:P,slideRects:T,animation:me,axis:O,dragHandler:BT(O,e,r,i,Ae,zT(O,i),ue,me,He,Fe,Me,se,s,L,d,m,v,Oe,k),eventStore:ae,percentOfView:L,index:se,indexPrevious:G,limit:X,location:ue,offsetLocation:fe,previousLocation:de,options:o,resizeHandler:jT(t,s,i,n,O,w,D),scrollBody:Fe,scrollBounds:WT(X,fe,Ae,Fe,L),scrollLooper:KT(V,X,fe,[ue,fe,de,Ae]),scrollProgress:ee,scrollSnapList:Q.map(ee.get),scrollSnaps:Q,scrollTarget:Me,scrollTo:He,slideLooper:tI(O,B,V,H,z,j,Q,fe,n),slideFocus:oe,slidesHandler:nI(t,s,A),slidesInView:U,slideIndexes:te,slideRegistry:K,slidesToScroll:_,target:Ae,translate:Hp(O,t)};return le}function aI(){let e={},t;function n(u){t=u}function r(u){return e[u]||[]}function i(u){return r(u).forEach(f=>f(t,u)),l}function o(u,f){return e[u]=r(u).concat([f]),l}function s(u,f){return e[u]=r(u).filter(c=>c!==f),l}function a(){e={}}const l={init:n,emit:i,off:s,on:o,clear:a};return l}const lI={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function uI(e){function t(o,s){return zp(o,s||{})}function n(o){const s=o.breakpoints||{},a=Gr(s).filter(l=>e.matchMedia(l).matches).map(l=>s[l]).reduce((l,u)=>t(l,u),{});return t(o,a)}function r(o){return o.map(s=>Gr(s.breakpoints||{})).reduce((s,a)=>s.concat(a),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function cI(e){let t=[];function n(o,s){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(o=>o.destroy())}return{init:n,destroy:r}}function io(e,t,n){const r=e.ownerDocument,i=r.defaultView,o=uI(i),s=cI(o),a=Qr(),l=aI(),{mergeOptions:u,optionsAtMedia:f,optionsMediaQueries:c}=o,{on:h,off:d,emit:m}=l,p=O;let g=!1,v,y=u(lI,io.globalOptions),w=u(y),A=[],k,E,I;function D(){const{container:te,slides:$}=w;E=(Qa(te)?e.querySelector(te):te)||e.children[0];const me=Qa($)?E.querySelectorAll($):$;I=[].slice.call(me||E.children)}function P(te){const $=sI(e,E,I,r,i,te,l);if(te.loop&&!$.slideLooper.canLoop()){const ne=Object.assign({},te,{loop:!1});return P(ne)}return $}function T(te,$){g||(y=u(y,te),w=f(y),A=$||A,D(),v=P(w),c([y,...A.map(({options:ne})=>ne)]).forEach(ne=>a.add(ne,"change",O)),w.active&&(v.translate.to(v.location.get()),v.animation.init(),v.slidesInView.init(),v.slideFocus.init(G),v.eventHandler.init(G),v.resizeHandler.init(G),v.slidesHandler.init(G),v.options.loop&&v.slideLooper.loop(),E.offsetParent&&I.length&&v.dragHandler.init(G),k=s.init(G,A)))}function O(te,$){const ne=_();B(),T(u({startIndex:ne},te),$),l.emit("reInit")}function B(){v.dragHandler.destroy(),v.eventStore.clear(),v.translate.clear(),v.slideLooper.clear(),v.resizeHandler.destroy(),v.slidesHandler.destroy(),v.slidesInView.destroy(),v.animation.destroy(),s.destroy(),a.clear()}function L(){g||(g=!0,a.clear(),B(),l.emit("destroy"),l.clear())}function F(te,$,ne){!w.active||g||(v.scrollBody.useBaseFriction().useDuration($===!0?0:w.duration),v.scrollTo.index(te,ne||0))}function R(te){const $=v.index.add(1).get();F($,te,-1)}function N(te){const $=v.index.add(-1).get();F($,te,1)}function H(){return v.index.add(1).get()!==_()}function z(){return v.index.add(-1).get()!==_()}function W(){return v.scrollSnapList}function b(){return v.scrollProgress.get(v.offsetLocation.get())}function _(){return v.index.get()}function j(){return v.indexPrevious.get()}function S(){return v.slidesInView.get()}function V(){return v.slidesInView.get(!1)}function Y(){return k}function q(){return v}function Q(){return e}function X(){return E}function se(){return I}const G={canScrollNext:H,canScrollPrev:z,containerNode:X,internalEngine:q,destroy:L,off:d,on:h,emit:m,plugins:Y,previousScrollSnap:j,reInit:p,rootNode:Q,scrollNext:R,scrollPrev:N,scrollProgress:b,scrollSnapList:W,scrollTo:F,selectedScrollSnap:_,slideNodes:se,slidesInView:S,slidesNotInView:V};return T(t,n),setTimeout(()=>l.emit("init"),0),G}io.globalOptions=void 0;function el(e={},t=[]){const n=M.useRef(e),r=M.useRef(t),[i,o]=M.useState(),[s,a]=M.useState(),l=M.useCallback(()=>{i&&i.reInit(n.current,r.current)},[i]);return M.useEffect(()=>{Ka(n.current,e)||(n.current=e,l())},[e,l]),M.useEffect(()=>{_T(r.current,t)||(r.current=t,l())},[t,l]),M.useEffect(()=>{if(NT()&&s){io.globalOptions=el.globalOptions;const u=io(s,n.current,r.current);return o(u),()=>u.destroy()}else o(void 0)},[s,o]),[a,i]}el.globalOptions=void 0;const jp=M.forwardRef(({blocks:e,direction:t,sender:n,timestamp:r,messageId:i,isReadOnly:o,sendMessage:s},a)=>{const[l,u]=el({skipSnaps:!0,loop:!0}),[f,c]=M.useState(!0),[h,d]=M.useState(!0),m=M.useCallback(()=>u==null?void 0:u.scrollPrev(),[u]),p=M.useCallback(()=>u==null?void 0:u.scrollNext(),[u]),{message:{blocks:{carousel:g}}}=ye,v=M.useCallback(y=>{c(!(y!=null&&y.canScrollPrev())),d(!(y!=null&&y.canScrollNext()))},[]);return M.useEffect(()=>{u&&(v(u),u.on("reInit",v),u.on("select",v))},[u,v]),x.jsxs("div",{...g==null?void 0:g.container,"data-container":"carousel",ref:l,children:[x.jsx("div",{ref:a,...g==null?void 0:g.slidesContainer,children:e.map((y,w)=>x.jsx(Dn,{block:{...y,direction:t,timestamp:r,sender:n,messageId:i,sendMessage:s,isReadOnly:o}},w))}),e.length>1&&x.jsxs(x.Fragment,{children:[x.jsx(rp,{...g==null?void 0:g.backButton,"data-disabled":f?"":void 0,onClick:m}),x.jsx(ip,{...g==null?void 0:g.nextButton,"data-disabled":h?"":void 0,onClick:p})]})]})});jp.displayName="Carousel";const Vp=Math.floor;function Wp(e){return qp(e)?(e.nodeName||"").toLowerCase():"#document"}function Jr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fI(e){var t;return(t=(qp(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function qp(e){return e instanceof Node||e instanceof Jr(e).Node}function kt(e){return e instanceof Element||e instanceof Jr(e).Element}function Xn(e){return e instanceof HTMLElement||e instanceof Jr(e).HTMLElement}function tl(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Jr(e).ShadowRoot}function dI(e){return["html","body","#document"].includes(Wp(e))}function hI(e){return Jr(e).getComputedStyle(e)}function pI(e){if(Wp(e)==="html")return e;const t=e.assignedSlot||e.parentNode||tl(e)&&e.host||fI(e);return tl(t)?t.host:t}function un(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 ft(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&tl(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Yp(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function mI(){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 Kp(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(Yp())||t.test(mI()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Gp(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 Qp(){return/apple/i.test(navigator.vendor)}function gI(){return Yp().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Zp(e,t){return["mouse","pen"].includes(e)}function yI(e){return"nativeEvent"in e}function vI(e){return e.matches("html,body")}function Nt(e){return(e==null?void 0:e.ownerDocument)||document}function nl(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 Jp(e){return"composedPath"in e?e.composedPath()[0]:e.target}const bI="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Xp(e){return Xn(e)&&e.matches(bI)}function Je(e){e.preventDefault(),e.stopPropagation()}const er=Math.min,gt=Math.max,oo=Math.round,so=Math.floor,zt=e=>({x:e,y:e});function em(e,t,n){return gt(e,er(t,n))}function ao(e,t){return typeof e=="function"?e(t):e}function Xr(e){return e.split("-")[0]}function rl(e){return e.split("-")[1]}function tm(e){return e==="x"?"y":"x"}function wI(e){return e==="y"?"height":"width"}const SI=new Set(["top","bottom"]);function ei(e){return SI.has(Xr(e))?"y":"x"}function xI(e){return tm(ei(e))}function kI(e){return{top:0,right:0,bottom:0,left:0,...e}}function EI(e){return typeof e!="number"?kI(e):{top:e,right:e,bottom:e,left:e}}function lo(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function nm(e,t,n){let{reference:r,floating:i}=e;const o=ei(t),s=xI(t),a=wI(s),l=Xr(t),u=o==="y",f=r.x+r.width/2-i.width/2,c=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let d;switch(l){case"top":d={x:f,y:r.y-i.height};break;case"bottom":d={x:f,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:c};break;case"left":d={x:r.x-i.width,y:c};break;default:d={x:r.x,y:r.y}}switch(rl(t)){case"start":d[s]-=h*(n&&u?-1:1);break;case"end":d[s]+=h*(n&&u?-1:1);break}return d}const CI=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:c}=nm(u,r,l),h=r,d={},m=0;for(let p=0;p<a.length;p++){const{name:g,fn:v}=a[p],{x:y,y:w,data:A,reset:k}=await v({x:f,y:c,initialPlacement:r,placement:h,strategy:i,middlewareData:d,rects:u,platform:s,elements:{reference:e,floating:t}});f=y??f,c=w??c,d={...d,[g]:{...d[g],...A}},k&&m<=50&&(m++,typeof k=="object"&&(k.placement&&(h=k.placement),k.rects&&(u=k.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):k.rects),{x:f,y:c}=nm(u,h,l)),p=-1)}return{x:f,y:c,placement:h,strategy:i,middlewareData:d}};async function rm(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:c="floating",altBoundary:h=!1,padding:d=0}=ao(t,e),m=EI(d),g=a[h?c==="floating"?"reference":"floating":c],v=lo(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(g)))==null||n?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:l})),y=c==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),A=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},k=lo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:w,strategy:l}):y);return{top:(v.top-k.top+m.top)/A.y,bottom:(k.bottom-v.bottom+m.bottom)/A.y,left:(v.left-k.left+m.left)/A.x,right:(k.right-v.right+m.right)/A.x}}const AI=new Set(["left","top"]);async function TI(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Xr(n),a=rl(n),l=ei(n)==="y",u=AI.has(s)?-1:1,f=o&&l?-1:1,c=ao(t,e);let{mainAxis:h,crossAxis:d,alignmentAxis:m}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return a&&typeof m=="number"&&(d=a==="end"?m*-1:m),l?{x:d*f,y:h*u}:{x:h*u,y:d*f}}const II=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,l=await TI(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},OI=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:g=>{let{x:v,y}=g;return{x:v,y}}},...l}=ao(e,t),u={x:n,y:r},f=await rm(t,l),c=ei(Xr(i)),h=tm(c);let d=u[h],m=u[c];if(o){const g=h==="y"?"top":"left",v=h==="y"?"bottom":"right",y=d+f[g],w=d-f[v];d=em(y,d,w)}if(s){const g=c==="y"?"top":"left",v=c==="y"?"bottom":"right",y=m+f[g],w=m-f[v];m=em(y,m,w)}const p=a.fn({...t,[h]:d,[c]:m});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[h]:o,[c]:s}}}}}},MI=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:a}=t,{apply:l=()=>{},...u}=ao(e,t),f=await rm(t,u),c=Xr(i),h=rl(i),d=ei(i)==="y",{width:m,height:p}=o.floating;let g,v;c==="top"||c==="bottom"?(g=c,v=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=c,g=h==="end"?"top":"bottom");const y=p-f.top-f.bottom,w=m-f.left-f.right,A=er(p-f[g],y),k=er(m-f[v],w),E=!t.middlewareData.shift;let I=A,D=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(I=y),E&&!h){const T=gt(f.left,0),O=gt(f.right,0),B=gt(f.top,0),L=gt(f.bottom,0);d?D=m-2*(T!==0||O!==0?T+O:gt(f.left,f.right)):I=p-2*(B!==0||L!==0?B+L:gt(f.top,f.bottom))}await l({...t,availableWidth:D,availableHeight:I});const P=await s.getDimensions(a.floating);return m!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function uo(){return typeof window<"u"}function tr(e){return im(e)?(e.nodeName||"").toLowerCase():"#document"}function yt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ut(e){var t;return(t=(im(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function im(e){return uo()?e instanceof Node||e instanceof yt(e).Node:!1}function _t(e){return uo()?e instanceof Element||e instanceof yt(e).Element:!1}function Ht(e){return uo()?e instanceof HTMLElement||e instanceof yt(e).HTMLElement:!1}function om(e){return!uo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof yt(e).ShadowRoot}const DI=new Set(["inline","contents"]);function ti(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Pt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!DI.has(i)}const NI=new Set(["table","td","th"]);function _I(e){return NI.has(tr(e))}const PI=[":popover-open",":modal"];function co(e){return PI.some(t=>{try{return e.matches(t)}catch{return!1}})}const LI=["transform","translate","scale","rotate","perspective"],FI=["transform","translate","scale","rotate","perspective","filter"],RI=["paint","layout","strict","content"];function il(e){const t=ol(),n=_t(e)?Pt(e):e;return LI.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||FI.some(r=>(n.willChange||"").includes(r))||RI.some(r=>(n.contain||"").includes(r))}function $I(e){let t=cn(e);for(;Ht(t)&&!nr(t);){if(il(t))return t;if(co(t))return null;t=cn(t)}return null}function ol(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const BI=new Set(["html","body","#document"]);function nr(e){return BI.has(tr(e))}function Pt(e){return yt(e).getComputedStyle(e)}function fo(e){return _t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function cn(e){if(tr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||om(e)&&e.host||Ut(e);return om(t)?t.host:t}function sm(e){const t=cn(e);return nr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ht(t)&&ti(t)?t:sm(t)}function fn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=sm(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=yt(i);if(o){const a=sl(s);return t.concat(s,s.visualViewport||[],ti(i)?i:[],a&&n?fn(a):[])}return t.concat(i,fn(i,[],n))}function sl(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function am(e){const t=Pt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Ht(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=oo(n)!==o||oo(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function al(e){return _t(e)?e:e.contextElement}function rr(e){const t=al(e);if(!Ht(t))return zt(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=am(t);let s=(o?oo(n.width):n.width)/r,a=(o?oo(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const zI=zt(0);function lm(e){const t=yt(e);return!ol()||!t.visualViewport?zI:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function UI(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==yt(e)?!1:t}function Mn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=al(e);let s=zt(1);t&&(r?_t(r)&&(s=rr(r)):s=rr(e));const a=UI(o,n,r)?lm(o):zt(0);let l=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,f=i.width/s.x,c=i.height/s.y;if(o){const h=yt(o),d=r&&_t(r)?yt(r):r;let m=h,p=sl(m);for(;p&&r&&d!==m;){const g=rr(p),v=p.getBoundingClientRect(),y=Pt(p),w=v.left+(p.clientLeft+parseFloat(y.paddingLeft))*g.x,A=v.top+(p.clientTop+parseFloat(y.paddingTop))*g.y;l*=g.x,u*=g.y,f*=g.x,c*=g.y,l+=w,u+=A,m=yt(p),p=sl(m)}}return lo({width:f,height:c,x:l,y:u})}function ho(e,t){const n=fo(e).scrollLeft;return t?t.left+n:Mn(Ut(e)).left+n}function um(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ho(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function HI(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=Ut(r),a=t?co(t.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=zt(1);const f=zt(0),c=Ht(r);if((c||!c&&!o)&&((tr(r)!=="body"||ti(s))&&(l=fo(r)),Ht(r))){const d=Mn(r);u=rr(r),f.x=d.x+r.clientLeft,f.y=d.y+r.clientTop}const h=s&&!c&&!o?um(s,l):zt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+h.x,y:n.y*u.y-l.scrollTop*u.y+f.y+h.y}}function jI(e){return Array.from(e.getClientRects())}function VI(e){const t=Ut(e),n=fo(e),r=e.ownerDocument.body,i=gt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=gt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+ho(e);const a=-n.scrollTop;return Pt(r).direction==="rtl"&&(s+=gt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}const cm=25;function WI(e,t){const n=yt(e),r=Ut(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const f=ol();(!f||f&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=ho(r);if(u<=0){const f=r.ownerDocument,c=f.body,h=getComputedStyle(c),d=f.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(r.clientWidth-c.clientWidth-d);m<=cm&&(o-=m)}else u<=cm&&(o+=u);return{width:o,height:s,x:a,y:l}}const qI=new Set(["absolute","fixed"]);function YI(e,t){const n=Mn(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Ht(e)?rr(e):zt(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,u=r*o.y;return{width:s,height:a,x:l,y:u}}function fm(e,t,n){let r;if(t==="viewport")r=WI(e,n);else if(t==="document")r=VI(Ut(e));else if(_t(t))r=YI(t,n);else{const i=lm(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return lo(r)}function dm(e,t){const n=cn(e);return n===t||!_t(n)||nr(n)?!1:Pt(n).position==="fixed"||dm(n,t)}function KI(e,t){const n=t.get(e);if(n)return n;let r=fn(e,[],!1).filter(a=>_t(a)&&tr(a)!=="body"),i=null;const o=Pt(e).position==="fixed";let s=o?cn(e):e;for(;_t(s)&&!nr(s);){const a=Pt(s),l=il(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&qI.has(i.position)||ti(s)&&!l&&dm(e,s))?r=r.filter(f=>f!==s):i=a,s=cn(s)}return t.set(e,r),r}function GI(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?co(t)?[]:KI(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,f)=>{const c=fm(t,f,i);return u.top=gt(c.top,u.top),u.right=er(c.right,u.right),u.bottom=er(c.bottom,u.bottom),u.left=gt(c.left,u.left),u},fm(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function QI(e){const{width:t,height:n}=am(e);return{width:t,height:n}}function ZI(e,t,n){const r=Ht(t),i=Ut(t),o=n==="fixed",s=Mn(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=zt(0);function u(){l.x=ho(i)}if(r||!r&&!o)if((tr(t)!=="body"||ti(i))&&(a=fo(t)),r){const d=Mn(t,!0,o,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&u();o&&!r&&i&&u();const f=i&&!r&&!o?um(i,a):zt(0),c=s.left+a.scrollLeft-l.x-f.x,h=s.top+a.scrollTop-l.y-f.y;return{x:c,y:h,width:s.width,height:s.height}}function ll(e){return Pt(e).position==="static"}function hm(e,t){if(!Ht(e)||Pt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ut(e)===n&&(n=n.ownerDocument.body),n}function pm(e,t){const n=yt(e);if(co(e))return n;if(!Ht(e)){let i=cn(e);for(;i&&!nr(i);){if(_t(i)&&!ll(i))return i;i=cn(i)}return n}let r=hm(e,t);for(;r&&_I(r)&&ll(r);)r=hm(r,t);return r&&nr(r)&&ll(r)&&!il(r)?n:r||$I(e)||n}const JI=async function(e){const t=this.getOffsetParent||pm,n=this.getDimensions,r=await n(e.floating);return{reference:ZI(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function XI(e){return Pt(e).direction==="rtl"}const eO={convertOffsetParentRelativeRectToViewportRelativeRect:HI,getDocumentElement:Ut,getClippingRect:GI,getOffsetParent:pm,getElementRects:JI,getClientRects:jI,getDimensions:QI,getScale:rr,isElement:_t,isRTL:XI};function mm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tO(e,t){let n=null,r;const i=Ut(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const u=e.getBoundingClientRect(),{left:f,top:c,width:h,height:d}=u;if(a||t(),!h||!d)return;const m=so(c),p=so(i.clientWidth-(f+h)),g=so(i.clientHeight-(c+d)),v=so(f),w={rootMargin:-m+"px "+-p+"px "+-g+"px "+-v+"px",threshold:gt(0,er(1,l))||1};let A=!0;function k(E){const I=E[0].intersectionRatio;if(I!==l){if(!A)return s();I?s(!1,I):r=setTimeout(()=>{s(!1,1e-7)},1e3)}I===1&&!mm(u,e.getBoundingClientRect())&&s(),A=!1}try{n=new IntersectionObserver(k,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(k,w)}n.observe(e)}return s(!0),o}function nO(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=al(e),f=i||o?[...u?fn(u):[],...fn(t)]:[];f.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const c=u&&a?tO(u,n):null;let h=-1,d=null;s&&(d=new ResizeObserver(v=>{let[y]=v;y&&y.target===u&&d&&(d.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=d)==null||w.observe(t)})),n()}),u&&!l&&d.observe(u),d.observe(t));let m,p=l?Mn(e):null;l&&g();function g(){const v=Mn(e);p&&!mm(p,v)&&n(),p=v,m=requestAnimationFrame(g)}return n(),()=>{var v;f.forEach(y=>{i&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),c==null||c(),(v=d)==null||v.disconnect(),d=null,l&&cancelAnimationFrame(m)}}const rO=II,iO=OI,oO=MI,sO=(e,t,n)=>{const r=new Map,i={platform:eO,...n},o={...i.platform,_c:r};return CI(e,t,{...i,platform:o})};var aO=typeof document<"u",lO=function(){},po=aO?M.useLayoutEffect:lO;function mo(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(!mo(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 o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!mo(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function gm(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ym(e,t){const n=gm(e);return Math.round(t*n)/n}function ul(e){const t=C.useRef(e);return po(()=>{t.current=e}),t}function uO(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[f,c]=C.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,d]=C.useState(r);mo(h,r)||d(r);const[m,p]=C.useState(null),[g,v]=C.useState(null),y=C.useCallback(z=>{z!==E.current&&(E.current=z,p(z))},[]),w=C.useCallback(z=>{z!==I.current&&(I.current=z,v(z))},[]),A=o||m,k=s||g,E=C.useRef(null),I=C.useRef(null),D=C.useRef(f),P=l!=null,T=ul(l),O=ul(i),B=ul(u),L=C.useCallback(()=>{if(!E.current||!I.current)return;const z={placement:t,strategy:n,middleware:h};O.current&&(z.platform=O.current),sO(E.current,I.current,z).then(W=>{const b={...W,isPositioned:B.current!==!1};F.current&&!mo(D.current,b)&&(D.current=b,$u.flushSync(()=>{c(b)}))})},[h,t,n,O,B]);po(()=>{u===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,c(z=>({...z,isPositioned:!1})))},[u]);const F=C.useRef(!1);po(()=>(F.current=!0,()=>{F.current=!1}),[]),po(()=>{if(A&&(E.current=A),k&&(I.current=k),A&&k){if(T.current)return T.current(A,k,L);L()}},[A,k,L,T,P]);const R=C.useMemo(()=>({reference:E,floating:I,setReference:y,setFloating:w}),[y,w]),N=C.useMemo(()=>({reference:A,floating:k}),[A,k]),H=C.useMemo(()=>{const z={position:n,left:0,top:0};if(!N.floating)return z;const W=ym(N.floating,f.x),b=ym(N.floating,f.y);return a?{...z,transform:"translate("+W+"px, "+b+"px)",...gm(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:b}},[n,a,N.floating,f.x,f.y]);return C.useMemo(()=>({...f,update:L,refs:R,elements:N,floatingStyles:H}),[f,L,R,N,H])}const cO=(e,t)=>({...rO(e),options:[e,t]}),fO=(e,t)=>({...iO(e),options:[e,t]}),dO=(e,t)=>({...oO(e),options:[e,t]});/*!
285
+ `);const y=v.state[a];if(y==null)return;JSON.stringify(i.getState())!==JSON.stringify(y)&&d(y);return}i.dispatchFromDevtools&&typeof i.dispatch=="function"&&i.dispatch(v)});case"DISPATCH":switch(p.payload.type){case"RESET":return d(m),a===void 0?f==null?void 0:f.init(i.getState()):f==null?void 0:f.init(eo(l.name));case"COMMIT":if(a===void 0){f==null||f.init(i.getState());return}return f==null?void 0:f.init(eo(l.name));case"ROLLBACK":return Ra(p.state,v=>{if(a===void 0){d(v),f==null||f.init(i.getState());return}d(v[a]),f==null||f.init(eo(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Ra(p.state,v=>{if(a===void 0){d(v);return}JSON.stringify(i.getState())!==JSON.stringify(v[a])&&d(v[a])});case"IMPORT_STATE":{const{nextLiftedState:v}=p.payload,y=(g=v.computedStates.slice(-1)[0])==null?void 0:g.state;if(!y)return;d(a===void 0?y:y[a]),f==null||f.send(null,v);return}case"PAUSE_RECORDING":return h=!h}return}}),m},Ra=(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 to(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var o;const s=l=>l===null?null:JSON.parse(l,void 0),a=(o=n.getItem(i))!=null?o:null;return a instanceof Promise?a.then(s):s(a)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>n.removeItem(i)}}const Wr=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Wr(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Wr(r)(n)}}}},vT=(e,t)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:g=>g,version:0,merge:(g,v)=>({...v,...g}),...t},s=!1;const a=new Set,l=new Set;let u;try{u=o.getStorage()}catch{}if(!u)return e((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...g)},r,i);const f=Wr(o.serialize),c=()=>{const g=o.partialize({...r()});let v;const y=f({state:g,version:o.version}).then(w=>u.setItem(o.name,w)).catch(w=>{v=w});if(v)throw v;return y},h=i.setState;i.setState=(g,v)=>{h(g,v),c()};const d=e((...g)=>{n(...g),c()},r,i);let m;const p=()=>{var g;if(!u)return;s=!1,a.forEach(y=>y(r()));const v=((g=o.onRehydrateStorage)==null?void 0:g.call(o,r()))||void 0;return Wr(u.getItem.bind(u))(o.name).then(y=>{if(y)return o.deserialize(y)}).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==o.version){if(o.migrate)return o.migrate(y.state,y.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return y.state}).then(y=>{var w;return m=o.merge(y,(w=r())!=null?w:d),n(m,!0),c()}).then(()=>{v==null||v(m,void 0),s=!0,l.forEach(y=>y(m))}).catch(y=>{v==null||v(void 0,y)})};return i.persist={setOptions:g=>{o={...o,...g},g.getStorage&&(u=g.getStorage())},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>p(),hasHydrated:()=>s,onHydrate:g=>(a.add(g),()=>{a.delete(g)}),onFinishHydration:g=>(l.add(g),()=>{l.delete(g)})},p(),m||d},bT=(e,t)=>(n,r,i)=>{let o={storage:to(()=>localStorage),partialize:p=>p,version:0,merge:(p,g)=>({...g,...p}),...t},s=!1;const a=new Set,l=new Set;let u=o.storage;if(!u)return e((...p)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...p)},r,i);const f=()=>{const p=o.partialize({...r()});return u.setItem(o.name,{state:p,version:o.version})},c=i.setState;i.setState=(p,g)=>{c(p,g),f()};const h=e((...p)=>{n(...p),f()},r,i);let d;const m=()=>{var p,g;if(!u)return;s=!1,a.forEach(y=>{var w;return y((w=r())!=null?w:h)});const v=((g=o.onRehydrateStorage)==null?void 0:g.call(o,(p=r())!=null?p:h))||void 0;return Wr(u.getItem.bind(u))(o.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==o.version){if(o.migrate)return o.migrate(y.state,y.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return y.state}).then(y=>{var w;return d=o.merge(y,(w=r())!=null?w:h),n(d,!0),f()}).then(()=>{v==null||v(d,void 0),d=r(),s=!0,l.forEach(y=>y(d))}).catch(y=>{v==null||v(void 0,y)})};return i.persist={setOptions:p=>{o={...o,...p},p.storage&&(u=p.storage)},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:p=>(a.add(p),()=>{a.delete(p)}),onFinishHydration:p=>(l.add(p),()=>{l.delete(p)})},o.skipHydration||m(),d||h},no=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?((Xi?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),vT(e,t)):bT(e,t),wT=(e,t)=>ln()(Gn(no(n=>({messageHistory:[],addMessageToHistory:r=>n(i=>({...i,messageHistory:[r,...(i.messageHistory??[]).slice(0,100).filter(String)]})),clearHistory:()=>n(()=>({messageHistory:[]}))}),{name:e,storage:to(()=>t==="sessionStorage"?sessionStorage:localStorage)}))),$a={},Sp=(e,t,n)=>{const i=`${t||"bp-webchat"}-message-history-${e}`;return $a[i]||($a[i]=wT(i,n)),$a[i]},ST=e=>ln()(Gn(t=>({messages:[],setMessages:n=>t({messages:n}),saveMessage:n=>t(({messages:r})=>({messages:xp(r,n)})),saveMessages:n=>{n.length&&t(({messages:r})=>({messages:n.reduce(xp,r)}))},updateMessage:(n,r)=>t(({messages:i})=>({messages:i.map(o=>o.id===n?{...o,...r}:o)})),removeMessage:n=>t(({messages:r})=>({messages:r.filter(i=>i.id!==n)})),clearMessages:()=>t({messages:[]})}),{name:e}));function xp(e,t){var i;const n=(i=t.metadata)==null?void 0:i.clientMessageId;let r=-1;return n&&(r=e.findIndex(o=>{var s;return((s=o.metadata)==null?void 0:s.clientMessageId)===n})),r===-1&&(r=e.findIndex(o=>o.id===t.id)),r!==-1?[...e.slice(0,r),{...e[r],...t},...e.slice(r+1)]:[...e,t]}const Ba={},za=e=>{const t=`messages-${e}`;return Ba[t]||(Ba[t]=ST(t)),Ba[t]},xT=(e,t)=>ln()(Gn(no(n=>({setUser:r=>n(i=>({...i,user:r})),setConversationId:r=>n(i=>({...i,conversationId:r})),clearAll:()=>{n(r=>({...r,user:void 0,conversationId:void 0}))}}),{name:e,storage:to(()=>t==="sessionStorage"?sessionStorage:localStorage)}))),Ua={},kp=(e="bp-webchat",t)=>{const n=`${e}-client`;return Ua[n]||(Ua[n]=xT(n,t)),Ua[n]},Qn=ln()(Gn(e=>({eventEmitter:ic(),messageContainerRef:M.createRef(),setMessageContainerRef:t=>e({messageContainerRef:t}),portalContainer:null,setPortalContainer:t=>e({portalContainer:t})}),{name:"webchatStore"})),kT=8,ET=e=>ln()(no((t,n)=>({files:[],setFiles:r=>t({files:r}),upsertFile:r=>t(({files:i})=>({files:i.some(a=>a.name===r.name)?i.map(a=>a.name===r.name?{...a,...r}:a):[...i,{...r}]})),uploadFile:async(r,i)=>{if(n().files.length===kT)return;const o=r.name.lastIndexOf("."),s=o>0&&o<r.name.length-1,a=s?r.name.substring(0,o):r.name,l=s?r.name.substring(o):"",u=Pw(a,n().files,h=>h.name),f=u+l,c=new File([r],f,{type:r.type});n().upsertFile({name:u,type:"file",instance:c,status:"loading"});try{const{fileUrl:h,type:d,fileId:m}=await i(c);n().upsertFile({fileId:m,name:u,type:d,url:h,instance:c,status:"uploaded"})}catch{n().upsertFile({name:u,type:"file",instance:c,status:"error"})}},deleteFile:r=>t(({files:i})=>({files:i.filter(o=>o.name!=r)}))}),{name:e,storage:to(()=>sessionStorage)})),Ha={},Ep=(e,t)=>{const r=`${t||"bp-webchat"}-composer-files-${e}`;return Ha[r]||(Ha[r]=ET(r)),Ha[r]},CT=e=>ln()(Gn(t=>({participants:[],setParticipants:n=>t({participants:n}),addParticipant:n=>t(r=>({participants:[...r.participants,n]})),removeParticipant:n=>t(r=>({participants:r.participants.filter(i=>i.id!==n)})),clearParticipants:()=>t({participants:[]})}),{name:e})),ja={},Va=e=>{const t=`participants-${e}`;return ja[t]||(ja[t]=CT(t)),ja[t]},AT=e=>ln()(Gn(no((t,n)=>({soundOn:!0,setSoundEnabled:r=>t({soundOn:r}),toggleSound:()=>t({soundOn:!n().soundOn})}),{name:e}))),Wa={},Cp=(e="bp-webchat")=>{const t=`${e}-sound`;return Wa[t]||(Wa[t]=AT(t)),Wa[t]},TT=({text:e,buttonValue:t,variant:n,groupId:r,reusable:i,sendMessage:o,isReadOnly:s,...a})=>{const l=Qn(w=>w.eventEmitter),[u,f]=M.useState(!1),[c,h]=M.useState(!1),[d,m]=M.useState(!1),{message:{blocks:{button:p}}}=ye;M.useEffect(()=>{if(r)return l.on(`button-group-${r}-click`,()=>{h(!0),i||m(!0)})},[l,r,i]);const v={...a,onClick:w=>{if((d||s)&&n==="link"){w.preventDefault();return}f(!0),i||m(!0),r&&l.emit(`button-group-${r}-click`),n!=="link"&&o&&(o==null||o({type:"text",text:e,value:t}))},"data-activated":u?"":void 0,"data-group-activated":c?"":void 0,"data-type":n,...p},y=d||s;return n==="link"?x.jsx("a",{...v,style:s?{pointerEvents:"none"}:void 0,href:t,target:"_blank",rel:"noopener noreferrer",children:e}):x.jsx("button",{...v,style:s?{pointerEvents:"none"}:void 0,disabled:y,children:e})},qa=M.createContext(null);function Ap(){const e=M.useContext(qa);if(!e)throw new Error("useMessageContext must be used within a Message");return e}const Ya=M.createContext({showInputModal:void 0});function Ka(){return M.useContext(Ya)}const Tp=M.forwardRef(({block:e,direction:t,sender:n,timestamp:r,messageId:i,feedback:o,metadata:s,isReadOnly:a,sendMessage:l,addMessageFeedback:u,...f},c)=>{const{showInputModal:h}=Ka(),{message:{blocks:{bubble:{container:d,feedbackContainer:m,feedbackIcon:p}}}}=ye;return t=="incoming"?x.jsxs("div",{"data-direction":"incoming","data-feedback":!!o,...f,...d,ref:c,children:[x.jsx(Dn,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:a,metadata:s,sendMessage:l}}),u&&h&&e.type==="text"&&x.jsxs("div",{...m,children:[x.jsx(ZA,{...p,"data-selected":o==="positive",onClick:()=>u(i,{value:"positive"})}),x.jsx(QA,{...p,"data-selected":o==="negative",onClick:async()=>{const g=await h({title:"Help us improve",description:"Please provide feedback to help us improve.",confirmButtonText:"Send feedback",cancelButtonText:"Cancel",Content:IT});u(i,{value:"negative",comment:g})}})]})]}):x.jsx("div",{"data-direction":"outgoing",...f,...d,ref:c,children:x.jsx(Dn,{block:{...e,direction:t,timestamp:r,sender:n,messageId:i,isReadOnly:a,metadata:s,sendMessage:l,addMessageFeedback:u}})})});Tp.displayName="Bubble";const IT=({setValue:e})=>{const{modal:{dialog:{content:t}}}=ye;return x.jsx("textarea",{...t.textarea,placeholder:"Let us know what went wrong...",onChange:n=>e(n.target.value)})},Ip=({className:e,...t})=>x.jsx("div",{"data-slot":"skeleton",className:`bpSkeleton ${e||""}`,...t});Ip.displayName="Skeleton";var xt=function(){return xt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},xt.apply(this,arguments)};function Op(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 Zn(e,t,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(f){try{u(r.next(f))}catch(c){s(c)}}function l(f){try{u(r.throw(f))}catch(c){s(c)}}function u(f){f.done?o(f.value):i(f.value).then(a,l)}u((r=r.apply(e,t||[])).next())})}function Jn(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(f){return l([u,f])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(o=u[0]&2?i.return:u[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,u[1])).done)return o;switch(i=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(f){u=[6,f],i=0}finally{r=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function Mp(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],s;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return o}function Ga(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;function OT(){var e=M.useRef(!1),t=M.useCallback(function(){return e.current},[]);return M.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}function MT(e,t,n){t===void 0&&(t=[]),n===void 0&&(n={loading:!1});var r=M.useRef(0),i=OT(),o=M.useState(n),s=o[0],a=o[1],l=M.useCallback(function(){for(var u=[],f=0;f<arguments.length;f++)u[f]=arguments[f];var c=++r.current;return s.loading||a(function(h){return xt(xt({},h),{loading:!0})}),e.apply(void 0,u).then(function(h){return i()&&c===r.current&&a({value:h,loading:!1}),h},function(h){return i()&&c===r.current&&a({error:h,loading:!1}),h})},t);return[s,l]}function DT(e,t){t===void 0&&(t=[]);var n=MT(e,t,{loading:!0}),r=n[0],i=n[1];return M.useEffect(function(){i()},[i]),r}const Dp=M.forwardRef(({url:e,type:t,orientation:n="auto",...r},i)=>{const o=M.useId(),{setIsLoading:s}=Ap(),[a,l]=M.useState(n==="auto"?"square":n),[u,f]=M.useState("initial"),{message:{blocks:{image:c}}}=ye;return M.useLayoutEffect(()=>(s(h=>[...h,o]),()=>{s(h=>h.filter(d=>d!==o))}),[o,s]),DT(async()=>{if(!e)return;const h=new Image;try{const{width:d,height:m}=await ab(e);n==="auto"&&l(NT(d,m)),h.onload=()=>{f("loaded"),s(p=>p.filter(g=>g!==o))},h.onerror=()=>{f("error"),l("square"),s(p=>p.filter(g=>g!==o))},h.src=e,h.complete&&(h.naturalWidth>0?(f("loaded"),s(p=>p.filter(g=>g!==o))):(f("error"),l("square"),s(p=>p.filter(g=>g!==o))))}catch(d){console.error(d),f("error"),s(m=>m.filter(p=>p!==o))}return()=>{h.onload=null,h.onerror=null}},[e,o,s,n]),e?u==="error"?x.jsx("div",{"data-error":"true","data-orientation":a,...r,...c.image,ref:i,children:x.jsx(up,{size:"25%",strokeWidth:"5%"})}):u==="initial"?x.jsx(Ip,{"data-orientation":a,...c.placeholder}):x.jsx("img",{"data-orientation":a,"data-loaded":u==="loaded",...r,...c.image,src:e,alt:"",ref:i}):null});Dp.displayName="Image";function NT(e,t){const n={square:1,portrait:.75,landscape:1.3333333333333333},r=e/t;return Object.keys(n).reduce((o,s)=>Math.abs(n[s]-r)<Math.abs(n[o]-r)?s:o)}const Np=M.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{video:i}}}=ye;return x.jsx("div",{children:x.jsx("video",{...n,"data-chromatic":"ignore",style:t?{pointerEvents:"none"}:void 0,controls:!0,src:e,...i,ref:r})})});Np.displayName="Video";const _p=M.forwardRef(({url:e,isReadOnly:t,...n},r)=>{const{message:{blocks:{audio:i}}}=ye;return x.jsx("div",{children:x.jsx("audio",{...n,controls:!0,style:t?{pointerEvents:"none"}:void 0,src:e,...i,ref:r})})});_p.displayName="Audio";const Pp=M.forwardRef(({latitude:e,longitude:t,title:n,isReadOnly:r,...i},o)=>{const s=`https://www.google.com/maps/search/?api=1&query=${e},${t}`,{message:{blocks:{location:a}}}=ye;return x.jsxs("a",{...i,...a.container,style:r?{pointerEvents:"none"}:void 0,href:s,type:"_blank",rel:"noopener",ref:o,children:[x.jsx("p",{...a.title,children:n}),x.jsx(jA,{...a.icon})]})});Pp.displayName="Location";const Lp=M.forwardRef(({blocks:e,horizontalAlignment:t,verticalAlignment:n,direction:r,sender:i,timestamp:o,messageId:s,isReadOnly:a,sendMessage:l,...u},f)=>{const{message:{blocks:{column:c}}}=ye;return x.jsx("div",{"data-horizontal":t,"data-vertical":n,...u,...c,ref:f,children:e.map((h,d)=>x.jsx(Dn,{block:{...h,direction:r,timestamp:o,sender:i,messageId:s,isReadOnly:a,sendMessage:l}},d))})});Lp.displayName="Column";const Fp=M.forwardRef(({blocks:e,horizontalAlignment:t,verticalAlignment:n,direction:r,sender:i,timestamp:o,metadata:s,messageId:a,isReadOnly:l,sendMessage:u,...f},c)=>{const{message:{blocks:{row:h}}}=ye;return x.jsx("div",{"data-horizontal":t,"data-vertical":n,...f,...h,ref:c,children:e.map((d,m)=>x.jsx(Dn,{block:{...d,direction:r,timestamp:o,sender:i,messageId:a,isReadOnly:l,sendMessage:u}},m))})});Fp.displayName="Row";function _T(e){return Object.prototype.toString.call(e)==="[object Object]"}function Rp(e){return _T(e)||Array.isArray(e)}function PT(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Qa(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||{})),o=JSON.stringify(Object.keys(t.breakpoints||{}));return i!==o?!1:n.every(s=>{const a=e[s],l=t[s];return typeof a=="function"?`${a}`==`${l}`:!Rp(a)||!Rp(l)?a===l:Qa(a,l)})}function $p(e){return e.concat().sort((t,n)=>t.name>n.name?1:-1).map(t=>t.options)}function LT(e,t){if(e.length!==t.length)return!1;const n=$p(e),r=$p(t);return n.every((i,o)=>{const s=r[o];return Qa(i,s)})}function Za(e){return typeof e=="number"}function Ja(e){return typeof e=="string"}function ro(e){return typeof e=="boolean"}function Bp(e){return Object.prototype.toString.call(e)==="[object Object]"}function $e(e){return Math.abs(e)}function Xa(e){return Math.sign(e)}function qr(e,t){return $e(e-t)}function FT(e,t){if(e===0||t===0||$e(e)<=$e(t))return 0;const n=qr($e(e),$e(t));return $e(n/e)}function RT(e){return Math.round(e*100)/100}function Yr(e){return Gr(e).map(Number)}function Dt(e){return e[Kr(e)]}function Kr(e){return Math.max(0,e.length-1)}function el(e,t){return t===Kr(e)}function zp(e,t=0){return Array.from(Array(e),(n,r)=>t+r)}function Gr(e){return Object.keys(e)}function Up(e,t){return[e,t].reduce((n,r)=>(Gr(r).forEach(i=>{const o=n[i],s=r[i],a=Bp(o)&&Bp(s);n[i]=a?Up(o,s):s}),n),{})}function tl(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function $T(e,t){const n={start:r,center:i,end:o};function r(){return 0}function i(l){return o(l)/2}function o(l){return t-l}function s(l,u){return Ja(e)?n[e](l):e(t,l,u)}return{measure:s}}function Qr(){let e=[];function t(i,o,s,a={passive:!0}){let l;if("addEventListener"in i)i.addEventListener(o,s,a),l=()=>i.removeEventListener(o,s,a);else{const u=i;u.addListener(s),l=()=>u.removeListener(s)}return e.push(l),r}function n(){e=e.filter(i=>i())}const r={add:t,clear:n};return r}function BT(e,t,n,r){const i=Qr(),o=1e3/60;let s=null,a=0,l=0;function u(){i.add(e,"visibilitychange",()=>{e.hidden&&m()})}function f(){d(),i.clear()}function c(g){if(!l)return;s||(s=g,n(),n());const v=g-s;for(s=g,a+=v;a>=o;)n(),a-=o;const y=a/o;r(y),l&&(l=t.requestAnimationFrame(c))}function h(){l||(l=t.requestAnimationFrame(c))}function d(){t.cancelAnimationFrame(l),s=null,a=0,l=0}function m(){s=null,a=0}return{init:u,destroy:f,start:h,stop:d,update:n,render:r}}function zT(e,t){const n=t==="rtl",r=e==="y",i=r?"y":"x",o=r?"x":"y",s=!r&&n?-1:1,a=f(),l=c();function u(m){const{height:p,width:g}=m;return r?p:g}function f(){return r?"top":n?"right":"left"}function c(){return r?"bottom":n?"left":"right"}function h(m){return m*s}return{scroll:i,cross:o,startEdge:a,endEdge:l,measureSize:u,direction:h}}function On(e=0,t=0){const n=$e(e-t);function r(u){return u<e}function i(u){return u>t}function o(u){return r(u)||i(u)}function s(u){return o(u)?r(u)?e:t:u}function a(u){return n?u-n*Math.ceil((u-t)/n):u}return{length:n,max:t,min:e,constrain:s,reachedAny:o,reachedMax:i,reachedMin:r,removeOffset:a}}function Hp(e,t,n){const{constrain:r}=On(0,e),i=e+1;let o=s(t);function s(h){return n?$e((i+h)%i):r(h)}function a(){return o}function l(h){return o=s(h),c}function u(h){return f().set(a()+h)}function f(){return Hp(e,a(),n)}const c={get:a,set:l,add:u,clone:f};return c}function UT(e,t,n,r,i,o,s,a,l,u,f,c,h,d,m,p,g,v,y){const{cross:w,direction:C}=e,k=["INPUT","SELECT","TEXTAREA"],E={passive:!1},I=Qr(),D=Qr(),P=On(50,225).constrain(d.measure(20)),T={mouse:300,touch:400},O={mouse:500,touch:600},U=m?43:25;let L=!1,F=0,R=0,N=!1,j=!1,z=!1,V=!1;function b($){if(!y)return;function ne(Oe){(ro(y)||y($,Oe))&&Y(Oe)}const me=t;I.add(me,"dragstart",Oe=>Oe.preventDefault(),E).add(me,"touchmove",()=>{},E).add(me,"touchend",()=>{}).add(me,"touchstart",ne).add(me,"mousedown",ne).add(me,"touchcancel",X).add(me,"contextmenu",X).add(me,"click",se,!0)}function _(){I.clear(),D.clear()}function B(){const $=V?n:t;D.add($,"touchmove",G,E).add($,"touchend",X).add($,"mousemove",G,E).add($,"mouseup",X)}function S($){const ne=$.nodeName||"";return k.includes(ne)}function W(){return(m?O:T)[V?"mouse":"touch"]}function J($,ne){const me=c.add(Xa($)*-1),Oe=f.byDistance($,!m).distance;return m||$e($)<P?Oe:g&&ne?Oe*.5:f.byIndex(me.get(),0).distance}function Y($){const ne=tl($,r);V=ne,z=m&&ne&&!$.buttons&&L,L=qr(i.get(),s.get())>=2,!(ne&&$.button!==0)&&(S($.target)||(N=!0,o.pointerDown($),u.useFriction(0).useDuration(0),i.set(s),B(),F=o.readPoint($),R=o.readPoint($,w),h.emit("pointerDown")))}function G($){if(!tl($,r)&&$.touches.length>=2)return X($);const me=o.readPoint($),Oe=o.readPoint($,w),Z=qr(me,F),ue=qr(Oe,R);if(!j&&!V&&(!$.cancelable||(j=Z>ue,!j)))return X($);const de=o.pointerMove($);Z>p&&(z=!0),u.useFriction(.3).useDuration(.75),a.start(),i.add(C(de)),$.preventDefault()}function X($){const me=f.byDistance(0,!1).index!==c.get(),Oe=o.pointerUp($)*W(),Z=J(C(Oe),me),ue=FT(Oe,Z),de=U-10*ue,fe=v+ue/50;j=!1,N=!1,D.clear(),u.useDuration(de).useFriction(fe),l.distance(Z,!m),V=!1,h.emit("pointerUp")}function se($){z&&($.stopPropagation(),$.preventDefault(),z=!1)}function K(){return N}return{init:b,destroy:_,pointerDown:K}}function HT(e,t){let r,i;function o(c){return c.timeStamp}function s(c,h){const m=`client${(h||e.scroll)==="x"?"X":"Y"}`;return(tl(c,t)?c:c.touches[0])[m]}function a(c){return r=c,i=c,s(c)}function l(c){const h=s(c)-s(i),d=o(c)-o(r)>170;return i=c,d&&(r=c),h}function u(c){if(!r||!i)return 0;const h=s(i)-s(r),d=o(c)-o(r),m=o(c)-o(i)>170,p=h/d;return d&&!m&&$e(p)>.1?p:0}return{pointerDown:a,pointerMove:l,pointerUp:u,readPoint:s}}function jT(){function e(n){const{offsetTop:r,offsetLeft:i,offsetWidth:o,offsetHeight:s}=n;return{top:r,right:i+o,bottom:r+s,left:i,width:o,height:s}}return{measure:e}}function VT(e){function t(r){return e*(r/100)}return{measure:t}}function WT(e,t,n,r,i,o,s){const a=[e].concat(r);let l,u,f=[],c=!1;function h(g){return i.measureSize(s.measure(g))}function d(g){if(!o)return;u=h(e),f=r.map(h);function v(y){for(const w of y){if(c)return;const C=w.target===e,k=r.indexOf(w.target),E=C?u:f[k],I=h(C?e:r[k]);if($e(I-E)>=.5){g.reInit(),t.emit("resize");break}}}l=new ResizeObserver(y=>{(ro(o)||o(g,y))&&v(y)}),n.requestAnimationFrame(()=>{a.forEach(y=>l.observe(y))})}function m(){c=!0,l&&l.disconnect()}return{init:d,destroy:m}}function qT(e,t,n,r,i,o){let s=0,a=0,l=i,u=o,f=e.get(),c=0;function h(){const E=r.get()-e.get(),I=!l;let D=0;return I?(s=0,n.set(r),e.set(r),D=E):(n.set(e),s+=E/l,s*=u,f+=s,e.add(s),D=f-c),a=Xa(D),c=f,k}function d(){const E=r.get()-t.get();return $e(E)<.001}function m(){return l}function p(){return a}function g(){return s}function v(){return w(i)}function y(){return C(o)}function w(E){return l=E,k}function C(E){return u=E,k}const k={direction:p,duration:m,velocity:g,seek:h,settled:d,useBaseFriction:y,useBaseDuration:v,useFriction:C,useDuration:w};return k}function YT(e,t,n,r,i){const o=i.measure(10),s=i.measure(50),a=On(.1,.99);let l=!1;function u(){return!(l||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function f(d){if(!u())return;const m=e.reachedMin(t.get())?"min":"max",p=$e(e[m]-t.get()),g=n.get()-t.get(),v=a.constrain(p/s);n.subtract(g*v),!d&&$e(g)<o&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function c(d){l=!d}return{shouldConstrain:u,constrain:f,toggleActive:c}}function KT(e,t,n,r,i){const o=On(-t+e,0),s=c(),a=f(),l=h();function u(m,p){return qr(m,p)<=1}function f(){const m=s[0],p=Dt(s),g=s.lastIndexOf(m),v=s.indexOf(p)+1;return On(g,v)}function c(){return n.map((m,p)=>{const{min:g,max:v}=o,y=o.constrain(m),w=!p,C=el(n,p);return w?v:C||u(g,y)?g:u(v,y)?v:y}).map(m=>parseFloat(m.toFixed(3)))}function h(){if(t<=e+i)return[o.max];if(r==="keepSnaps")return s;const{min:m,max:p}=a;return s.slice(m,p)}return{snapsContained:l,scrollContainLimit:a}}function GT(e,t,n){const r=t[0],i=n?r-e:Dt(t);return{limit:On(i,r)}}function QT(e,t,n,r){const o=t.min+.1,s=t.max+.1,{reachedMin:a,reachedMax:l}=On(o,s);function u(h){return h===1?l(n.get()):h===-1?a(n.get()):!1}function f(h){if(!u(h))return;const d=e*(h*-1);r.forEach(m=>m.add(d))}return{loop:f}}function ZT(e){const{max:t,length:n}=e;function r(o){const s=o-t;return n?s/-n:0}return{get:r}}function JT(e,t,n,r,i){const{startEdge:o,endEdge:s}=e,{groupSlides:a}=i,l=c().map(t.measure),u=h(),f=d();function c(){return a(r).map(p=>Dt(p)[s]-p[0][o]).map($e)}function h(){return r.map(p=>n[o]-p[o]).map(p=>-$e(p))}function d(){return a(u).map(p=>p[0]).map((p,g)=>p+l[g])}return{snaps:u,snapsAligned:f}}function XT(e,t,n,r,i,o){const{groupSlides:s}=i,{min:a,max:l}=r,u=f();function f(){const h=s(o),d=!e||t==="keepSnaps";return n.length===1?[o]:d?h:h.slice(a,l).map((m,p,g)=>{const v=!p,y=el(g,p);if(v){const w=Dt(g[0])+1;return zp(w)}if(y){const w=Kr(o)-Dt(g)[0]+1;return zp(w,Dt(g)[0])}return m})}return{slideRegistry:u}}function eI(e,t,n,r,i){const{reachedAny:o,removeOffset:s,constrain:a}=r;function l(m){return m.concat().sort((p,g)=>$e(p)-$e(g))[0]}function u(m){const p=e?s(m):a(m),g=t.map((y,w)=>({diff:f(y-p,0),index:w})).sort((y,w)=>$e(y.diff)-$e(w.diff)),{index:v}=g[0];return{index:v,distance:p}}function f(m,p){const g=[m,m+n,m-n];if(!e)return m;if(!p)return l(g);const v=g.filter(y=>Xa(y)===p);return v.length?l(v):Dt(g)-n}function c(m,p){const g=t[m]-i.get(),v=f(g,p);return{index:m,distance:v}}function h(m,p){const g=i.get()+m,{index:v,distance:y}=u(g),w=!e&&o(g);if(!p||w)return{index:v,distance:m};const C=t[v]-y,k=m+f(C,0);return{index:v,distance:k}}return{byDistance:h,byIndex:c,shortcut:f}}function tI(e,t,n,r,i,o,s){function a(c){const h=c.distance,d=c.index!==t.get();o.add(h),h&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),d&&(n.set(t.get()),t.set(c.index),s.emit("select"))}function l(c,h){const d=i.byDistance(c,h);a(d)}function u(c,h){const d=t.clone().set(c),m=i.byIndex(d.get(),h);a(m)}return{distance:l,index:u}}function nI(e,t,n,r,i,o,s,a){const l={passive:!0,capture:!0};let u=0;function f(d){if(!a)return;function m(p){if(new Date().getTime()-u>10)return;s.emit("slideFocusStart"),e.scrollLeft=0;const y=n.findIndex(w=>w.includes(p));Za(y)&&(i.useDuration(0),r.index(y,0),s.emit("slideFocus"))}o.add(document,"keydown",c,!1),t.forEach((p,g)=>{o.add(p,"focus",v=>{(ro(a)||a(d,v))&&m(g)},l)})}function c(d){d.code==="Tab"&&(u=new Date().getTime())}return{init:f}}function Zr(e){let t=e;function n(){return t}function r(l){t=s(l)}function i(l){t+=s(l)}function o(l){t-=s(l)}function s(l){return Za(l)?l:l.get()}return{get:n,set:r,add:i,subtract:o}}function jp(e,t){const n=e.scroll==="x"?s:a,r=t.style;let i=null,o=!1;function s(h){return`translate3d(${h}px,0px,0px)`}function a(h){return`translate3d(0px,${h}px,0px)`}function l(h){if(o)return;const d=RT(e.direction(h));d!==i&&(r.transform=n(d),i=d)}function u(h){o=!h}function f(){o||(r.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:f,to:l,toggleActive:u}}function rI(e,t,n,r,i,o,s,a,l){const f=Yr(i),c=Yr(i).reverse(),h=v().concat(y());function d(I,D){return I.reduce((P,T)=>P-i[T],D)}function m(I,D){return I.reduce((P,T)=>d(P,D)>0?P.concat([T]):P,[])}function p(I){return o.map((D,P)=>({start:D-r[P]+.5+I,end:D+t-.5+I}))}function g(I,D,P){const T=p(D);return I.map(O=>{const U=P?0:-n,L=P?n:0,F=P?"end":"start",R=T[O][F];return{index:O,loopPoint:R,slideLocation:Zr(-1),translate:jp(e,l[O]),target:()=>a.get()>R?U:L}})}function v(){const I=s[0],D=m(c,I);return g(D,n,!1)}function y(){const I=t-s[0]-1,D=m(f,I);return g(D,-n,!0)}function w(){return h.every(({index:I})=>{const D=f.filter(P=>P!==I);return d(D,t)<=.1})}function C(){h.forEach(I=>{const{target:D,translate:P,slideLocation:T}=I,O=D();O!==T.get()&&(P.to(O),T.set(O))})}function k(){h.forEach(I=>I.translate.clear())}return{canLoop:w,clear:k,loop:C,loopPoints:h}}function iI(e,t,n){let r,i=!1;function o(l){if(!n)return;function u(f){for(const c of f)if(c.type==="childList"){l.reInit(),t.emit("slidesChanged");break}}r=new MutationObserver(f=>{i||(ro(n)||n(l,f))&&u(f)}),r.observe(e,{childList:!0})}function s(){r&&r.disconnect(),i=!0}return{init:o,destroy:s}}function oI(e,t,n,r){const i={};let o=null,s=null,a,l=!1;function u(){a=new IntersectionObserver(m=>{l||(m.forEach(p=>{const g=t.indexOf(p.target);i[g]=p}),o=null,s=null,n.emit("slidesInView"))},{root:e.parentElement,threshold:r}),t.forEach(m=>a.observe(m))}function f(){a&&a.disconnect(),l=!0}function c(m){return Gr(i).reduce((p,g)=>{const v=parseInt(g),{isIntersecting:y}=i[v];return(m&&y||!m&&!y)&&p.push(v),p},[])}function h(m=!0){if(m&&o)return o;if(!m&&s)return s;const p=c(m);return m&&(o=p),m||(s=p),p}return{init:u,destroy:f,get:h}}function sI(e,t,n,r,i,o){const{measureSize:s,startEdge:a,endEdge:l}=e,u=n[0]&&i,f=m(),c=p(),h=n.map(s),d=g();function m(){if(!u)return 0;const y=n[0];return $e(t[a]-y[a])}function p(){if(!u)return 0;const y=o.getComputedStyle(Dt(r));return parseFloat(y.getPropertyValue(`margin-${l}`))}function g(){return n.map((y,w,C)=>{const k=!w,E=el(C,w);return k?h[w]+f:E?h[w]+c:C[w+1][a]-y[a]}).map($e)}return{slideSizes:h,slideSizesWithGaps:d,startGap:f,endGap:c}}function aI(e,t,n,r,i,o,s,a,l){const{startEdge:u,endEdge:f,direction:c}=e,h=Za(n);function d(v,y){return Yr(v).filter(w=>w%y===0).map(w=>v.slice(w,w+y))}function m(v){return v.length?Yr(v).reduce((y,w,C)=>{const k=Dt(y)||0,E=k===0,I=w===Kr(v),D=i[u]-o[k][u],P=i[u]-o[w][f],T=!r&&E?c(s):0,O=!r&&I?c(a):0,U=$e(P-O-(D+T));return C&&U>t+l&&y.push(w),I&&y.push(v.length),y},[]).map((y,w,C)=>{const k=Math.max(C[w-1]||0);return v.slice(k,y)}):[]}function p(v){return h?d(v,n):m(v)}return{groupSlides:p}}function lI(e,t,n,r,i,o,s){const{align:a,axis:l,direction:u,startIndex:f,loop:c,duration:h,dragFree:d,dragThreshold:m,inViewThreshold:p,slidesToScroll:g,skipSnaps:v,containScroll:y,watchResize:w,watchSlides:C,watchDrag:k,watchFocus:E}=o,I=2,D=jT(),P=D.measure(t),T=n.map(D.measure),O=zT(l,u),U=O.measureSize(P),L=VT(U),F=$T(a,U),R=!c&&!!y,N=c||!!y,{slideSizes:j,slideSizesWithGaps:z,startGap:V,endGap:b}=sI(O,P,T,n,N,i),_=aI(O,U,g,c,P,T,V,b,I),{snaps:B,snapsAligned:S}=JT(O,F,P,T,_),W=-Dt(B)+Dt(z),{snapsContained:J,scrollContainLimit:Y}=KT(U,W,S,y,I),G=R?J:S,{limit:X}=GT(W,G,c),se=Hp(Kr(G),f,c),K=se.clone(),te=Yr(n),$=({dragHandler:he,scrollBody:je,scrollBounds:Ge,options:{loop:Ze}})=>{Ze||Ge.constrain(he.pointerDown()),je.seek()},ne=({scrollBody:he,translate:je,location:Ge,offsetLocation:Ze,previousLocation:Et,scrollLooper:Rt,slideLooper:Qe,dragHandler:Ct,animation:at,eventHandler:es,scrollBounds:SP,options:{loop:$v}},Bv)=>{const zv=he.settled(),xP=!SP.shouldConstrain(),Uv=$v?zv:zv&&xP,Hv=Uv&&!Ct.pointerDown();Hv&&at.stop();const kP=Ge.get()*Bv+Et.get()*(1-Bv);Ze.set(kP),$v&&(Rt.loop(he.direction()),Qe.loop()),je.to(Ze.get()),Hv&&es.emit("settle"),Uv||es.emit("scroll")},me=BT(r,i,()=>$(le),he=>ne(le,he)),Oe=.68,Z=G[se.get()],ue=Zr(Z),de=Zr(Z),fe=Zr(Z),Ae=Zr(Z),Fe=qT(ue,fe,de,Ae,h,Oe),Me=eI(c,G,W,X,Ae),He=tI(me,se,K,Fe,Me,Ae,s),ee=ZT(X),ae=Qr(),H=oI(t,n,s,p),{slideRegistry:q}=XT(R,y,G,Y,_,te),oe=nI(e,n,q,He,Fe,ae,s,E),le={ownerDocument:r,ownerWindow:i,eventHandler:s,containerRect:P,slideRects:T,animation:me,axis:O,dragHandler:UT(O,e,r,i,Ae,HT(O,i),ue,me,He,Fe,Me,se,s,L,d,m,v,Oe,k),eventStore:ae,percentOfView:L,index:se,indexPrevious:K,limit:X,location:ue,offsetLocation:fe,previousLocation:de,options:o,resizeHandler:WT(t,s,i,n,O,w,D),scrollBody:Fe,scrollBounds:YT(X,fe,Ae,Fe,L),scrollLooper:QT(W,X,fe,[ue,fe,de,Ae]),scrollProgress:ee,scrollSnapList:G.map(ee.get),scrollSnaps:G,scrollTarget:Me,scrollTo:He,slideLooper:rI(O,U,W,j,z,B,G,fe,n),slideFocus:oe,slidesHandler:iI(t,s,C),slidesInView:H,slideIndexes:te,slideRegistry:q,slidesToScroll:_,target:Ae,translate:jp(O,t)};return le}function uI(){let e={},t;function n(u){t=u}function r(u){return e[u]||[]}function i(u){return r(u).forEach(f=>f(t,u)),l}function o(u,f){return e[u]=r(u).concat([f]),l}function s(u,f){return e[u]=r(u).filter(c=>c!==f),l}function a(){e={}}const l={init:n,emit:i,off:s,on:o,clear:a};return l}const cI={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function fI(e){function t(o,s){return Up(o,s||{})}function n(o){const s=o.breakpoints||{},a=Gr(s).filter(l=>e.matchMedia(l).matches).map(l=>s[l]).reduce((l,u)=>t(l,u),{});return t(o,a)}function r(o){return o.map(s=>Gr(s.breakpoints||{})).reduce((s,a)=>s.concat(a),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function dI(e){let t=[];function n(o,s){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(o=>o.destroy())}return{init:n,destroy:r}}function io(e,t,n){const r=e.ownerDocument,i=r.defaultView,o=fI(i),s=dI(o),a=Qr(),l=uI(),{mergeOptions:u,optionsAtMedia:f,optionsMediaQueries:c}=o,{on:h,off:d,emit:m}=l,p=O;let g=!1,v,y=u(cI,io.globalOptions),w=u(y),C=[],k,E,I;function D(){const{container:te,slides:$}=w;E=(Ja(te)?e.querySelector(te):te)||e.children[0];const me=Ja($)?E.querySelectorAll($):$;I=[].slice.call(me||E.children)}function P(te){const $=lI(e,E,I,r,i,te,l);if(te.loop&&!$.slideLooper.canLoop()){const ne=Object.assign({},te,{loop:!1});return P(ne)}return $}function T(te,$){g||(y=u(y,te),w=f(y),C=$||C,D(),v=P(w),c([y,...C.map(({options:ne})=>ne)]).forEach(ne=>a.add(ne,"change",O)),w.active&&(v.translate.to(v.location.get()),v.animation.init(),v.slidesInView.init(),v.slideFocus.init(K),v.eventHandler.init(K),v.resizeHandler.init(K),v.slidesHandler.init(K),v.options.loop&&v.slideLooper.loop(),E.offsetParent&&I.length&&v.dragHandler.init(K),k=s.init(K,C)))}function O(te,$){const ne=_();U(),T(u({startIndex:ne},te),$),l.emit("reInit")}function U(){v.dragHandler.destroy(),v.eventStore.clear(),v.translate.clear(),v.slideLooper.clear(),v.resizeHandler.destroy(),v.slidesHandler.destroy(),v.slidesInView.destroy(),v.animation.destroy(),s.destroy(),a.clear()}function L(){g||(g=!0,a.clear(),U(),l.emit("destroy"),l.clear())}function F(te,$,ne){!w.active||g||(v.scrollBody.useBaseFriction().useDuration($===!0?0:w.duration),v.scrollTo.index(te,ne||0))}function R(te){const $=v.index.add(1).get();F($,te,-1)}function N(te){const $=v.index.add(-1).get();F($,te,1)}function j(){return v.index.add(1).get()!==_()}function z(){return v.index.add(-1).get()!==_()}function V(){return v.scrollSnapList}function b(){return v.scrollProgress.get(v.offsetLocation.get())}function _(){return v.index.get()}function B(){return v.indexPrevious.get()}function S(){return v.slidesInView.get()}function W(){return v.slidesInView.get(!1)}function J(){return k}function Y(){return v}function G(){return e}function X(){return E}function se(){return I}const K={canScrollNext:j,canScrollPrev:z,containerNode:X,internalEngine:Y,destroy:L,off:d,on:h,emit:m,plugins:J,previousScrollSnap:B,reInit:p,rootNode:G,scrollNext:R,scrollPrev:N,scrollProgress:b,scrollSnapList:V,scrollTo:F,selectedScrollSnap:_,slideNodes:se,slidesInView:S,slidesNotInView:W};return T(t,n),setTimeout(()=>l.emit("init"),0),K}io.globalOptions=void 0;function nl(e={},t=[]){const n=M.useRef(e),r=M.useRef(t),[i,o]=M.useState(),[s,a]=M.useState(),l=M.useCallback(()=>{i&&i.reInit(n.current,r.current)},[i]);return M.useEffect(()=>{Qa(n.current,e)||(n.current=e,l())},[e,l]),M.useEffect(()=>{LT(r.current,t)||(r.current=t,l())},[t,l]),M.useEffect(()=>{if(PT()&&s){io.globalOptions=nl.globalOptions;const u=io(s,n.current,r.current);return o(u),()=>u.destroy()}else o(void 0)},[s,o]),[a,i]}nl.globalOptions=void 0;const Vp=M.forwardRef(({blocks:e,direction:t,sender:n,timestamp:r,messageId:i,isReadOnly:o,sendMessage:s},a)=>{const[l,u]=nl({skipSnaps:!0,loop:!0}),[f,c]=M.useState(!0),[h,d]=M.useState(!0),m=M.useCallback(()=>u==null?void 0:u.scrollPrev(),[u]),p=M.useCallback(()=>u==null?void 0:u.scrollNext(),[u]),{message:{blocks:{carousel:g}}}=ye,v=M.useCallback(y=>{c(!(y!=null&&y.canScrollPrev())),d(!(y!=null&&y.canScrollNext()))},[]);return M.useEffect(()=>{u&&(v(u),u.on("reInit",v),u.on("select",v))},[u,v]),x.jsxs("div",{...g==null?void 0:g.container,"data-container":"carousel",ref:l,children:[x.jsx("div",{ref:a,...g==null?void 0:g.slidesContainer,children:e.map((y,w)=>x.jsx(Dn,{block:{...y,direction:t,timestamp:r,sender:n,messageId:i,sendMessage:s,isReadOnly:o}},w))}),e.length>1&&x.jsxs(x.Fragment,{children:[x.jsx(op,{...g==null?void 0:g.backButton,"data-disabled":f?"":void 0,onClick:m}),x.jsx(sp,{...g==null?void 0:g.nextButton,"data-disabled":h?"":void 0,onClick:p})]})]})});Vp.displayName="Carousel";const Wp=Math.floor;function qp(e){return Yp(e)?(e.nodeName||"").toLowerCase():"#document"}function Jr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function hI(e){var t;return(t=(Yp(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Yp(e){return e instanceof Node||e instanceof Jr(e).Node}function kt(e){return e instanceof Element||e instanceof Jr(e).Element}function Xn(e){return e instanceof HTMLElement||e instanceof Jr(e).HTMLElement}function rl(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Jr(e).ShadowRoot}function pI(e){return["html","body","#document"].includes(qp(e))}function mI(e){return Jr(e).getComputedStyle(e)}function gI(e){if(qp(e)==="html")return e;const t=e.assignedSlot||e.parentNode||rl(e)&&e.host||hI(e);return rl(t)?t.host:t}function un(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 ft(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&rl(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Kp(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function yI(){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 Gp(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(Kp())||t.test(yI()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Qp(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 Zp(){return/apple/i.test(navigator.vendor)}function vI(){return Kp().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Jp(e,t){return["mouse","pen"].includes(e)}function bI(e){return"nativeEvent"in e}function wI(e){return e.matches("html,body")}function Nt(e){return(e==null?void 0:e.ownerDocument)||document}function il(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 Xp(e){return"composedPath"in e?e.composedPath()[0]:e.target}const SI="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function em(e){return Xn(e)&&e.matches(SI)}function Je(e){e.preventDefault(),e.stopPropagation()}const er=Math.min,gt=Math.max,oo=Math.round,so=Math.floor,zt=e=>({x:e,y:e});function tm(e,t,n){return gt(e,er(t,n))}function ao(e,t){return typeof e=="function"?e(t):e}function Xr(e){return e.split("-")[0]}function ol(e){return e.split("-")[1]}function nm(e){return e==="x"?"y":"x"}function xI(e){return e==="y"?"height":"width"}const kI=new Set(["top","bottom"]);function ei(e){return kI.has(Xr(e))?"y":"x"}function EI(e){return nm(ei(e))}function CI(e){return{top:0,right:0,bottom:0,left:0,...e}}function AI(e){return typeof e!="number"?CI(e):{top:e,right:e,bottom:e,left:e}}function lo(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function rm(e,t,n){let{reference:r,floating:i}=e;const o=ei(t),s=EI(t),a=xI(s),l=Xr(t),u=o==="y",f=r.x+r.width/2-i.width/2,c=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let d;switch(l){case"top":d={x:f,y:r.y-i.height};break;case"bottom":d={x:f,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:c};break;case"left":d={x:r.x-i.width,y:c};break;default:d={x:r.x,y:r.y}}switch(ol(t)){case"start":d[s]-=h*(n&&u?-1:1);break;case"end":d[s]+=h*(n&&u?-1:1);break}return d}const TI=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:c}=rm(u,r,l),h=r,d={},m=0;for(let p=0;p<a.length;p++){const{name:g,fn:v}=a[p],{x:y,y:w,data:C,reset:k}=await v({x:f,y:c,initialPlacement:r,placement:h,strategy:i,middlewareData:d,rects:u,platform:s,elements:{reference:e,floating:t}});f=y??f,c=w??c,d={...d,[g]:{...d[g],...C}},k&&m<=50&&(m++,typeof k=="object"&&(k.placement&&(h=k.placement),k.rects&&(u=k.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):k.rects),{x:f,y:c}=rm(u,h,l)),p=-1)}return{x:f,y:c,placement:h,strategy:i,middlewareData:d}};async function im(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:c="floating",altBoundary:h=!1,padding:d=0}=ao(t,e),m=AI(d),g=a[h?c==="floating"?"reference":"floating":c],v=lo(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(g)))==null||n?g:g.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:l})),y=c==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),C=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},k=lo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:w,strategy:l}):y);return{top:(v.top-k.top+m.top)/C.y,bottom:(k.bottom-v.bottom+m.bottom)/C.y,left:(v.left-k.left+m.left)/C.x,right:(k.right-v.right+m.right)/C.x}}const II=new Set(["left","top"]);async function OI(e,t){const{placement:n,platform:r,elements:i}=e,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Xr(n),a=ol(n),l=ei(n)==="y",u=II.has(s)?-1:1,f=o&&l?-1:1,c=ao(t,e);let{mainAxis:h,crossAxis:d,alignmentAxis:m}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return a&&typeof m=="number"&&(d=a==="end"?m*-1:m),l?{x:d*f,y:h*u}:{x:h*u,y:d*f}}const MI=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=t,l=await OI(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},DI=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:g=>{let{x:v,y}=g;return{x:v,y}}},...l}=ao(e,t),u={x:n,y:r},f=await im(t,l),c=ei(Xr(i)),h=nm(c);let d=u[h],m=u[c];if(o){const g=h==="y"?"top":"left",v=h==="y"?"bottom":"right",y=d+f[g],w=d-f[v];d=tm(y,d,w)}if(s){const g=c==="y"?"top":"left",v=c==="y"?"bottom":"right",y=m+f[g],w=m-f[v];m=tm(y,m,w)}const p=a.fn({...t,[h]:d,[c]:m});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[h]:o,[c]:s}}}}}},NI=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:a}=t,{apply:l=()=>{},...u}=ao(e,t),f=await im(t,u),c=Xr(i),h=ol(i),d=ei(i)==="y",{width:m,height:p}=o.floating;let g,v;c==="top"||c==="bottom"?(g=c,v=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(v=c,g=h==="end"?"top":"bottom");const y=p-f.top-f.bottom,w=m-f.left-f.right,C=er(p-f[g],y),k=er(m-f[v],w),E=!t.middlewareData.shift;let I=C,D=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(I=y),E&&!h){const T=gt(f.left,0),O=gt(f.right,0),U=gt(f.top,0),L=gt(f.bottom,0);d?D=m-2*(T!==0||O!==0?T+O:gt(f.left,f.right)):I=p-2*(U!==0||L!==0?U+L:gt(f.top,f.bottom))}await l({...t,availableWidth:D,availableHeight:I});const P=await s.getDimensions(a.floating);return m!==P.width||p!==P.height?{reset:{rects:!0}}:{}}}};function uo(){return typeof window<"u"}function tr(e){return om(e)?(e.nodeName||"").toLowerCase():"#document"}function yt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ut(e){var t;return(t=(om(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function om(e){return uo()?e instanceof Node||e instanceof yt(e).Node:!1}function _t(e){return uo()?e instanceof Element||e instanceof yt(e).Element:!1}function Ht(e){return uo()?e instanceof HTMLElement||e instanceof yt(e).HTMLElement:!1}function sm(e){return!uo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof yt(e).ShadowRoot}const _I=new Set(["inline","contents"]);function ti(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Pt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!_I.has(i)}const PI=new Set(["table","td","th"]);function LI(e){return PI.has(tr(e))}const FI=[":popover-open",":modal"];function co(e){return FI.some(t=>{try{return e.matches(t)}catch{return!1}})}const RI=["transform","translate","scale","rotate","perspective"],$I=["transform","translate","scale","rotate","perspective","filter"],BI=["paint","layout","strict","content"];function sl(e){const t=al(),n=_t(e)?Pt(e):e;return RI.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||$I.some(r=>(n.willChange||"").includes(r))||BI.some(r=>(n.contain||"").includes(r))}function zI(e){let t=cn(e);for(;Ht(t)&&!nr(t);){if(sl(t))return t;if(co(t))return null;t=cn(t)}return null}function al(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const UI=new Set(["html","body","#document"]);function nr(e){return UI.has(tr(e))}function Pt(e){return yt(e).getComputedStyle(e)}function fo(e){return _t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function cn(e){if(tr(e)==="html")return e;const t=e.assignedSlot||e.parentNode||sm(e)&&e.host||Ut(e);return sm(t)?t.host:t}function am(e){const t=cn(e);return nr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ht(t)&&ti(t)?t:am(t)}function fn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=am(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=yt(i);if(o){const a=ll(s);return t.concat(s,s.visualViewport||[],ti(i)?i:[],a&&n?fn(a):[])}return t.concat(i,fn(i,[],n))}function ll(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lm(e){const t=Pt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Ht(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=oo(n)!==o||oo(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function ul(e){return _t(e)?e:e.contextElement}function rr(e){const t=ul(e);if(!Ht(t))return zt(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=lm(t);let s=(o?oo(n.width):n.width)/r,a=(o?oo(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const HI=zt(0);function um(e){const t=yt(e);return!al()||!t.visualViewport?HI:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function jI(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==yt(e)?!1:t}function Mn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=ul(e);let s=zt(1);t&&(r?_t(r)&&(s=rr(r)):s=rr(e));const a=jI(o,n,r)?um(o):zt(0);let l=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,f=i.width/s.x,c=i.height/s.y;if(o){const h=yt(o),d=r&&_t(r)?yt(r):r;let m=h,p=ll(m);for(;p&&r&&d!==m;){const g=rr(p),v=p.getBoundingClientRect(),y=Pt(p),w=v.left+(p.clientLeft+parseFloat(y.paddingLeft))*g.x,C=v.top+(p.clientTop+parseFloat(y.paddingTop))*g.y;l*=g.x,u*=g.y,f*=g.x,c*=g.y,l+=w,u+=C,m=yt(p),p=ll(m)}}return lo({width:f,height:c,x:l,y:u})}function ho(e,t){const n=fo(e).scrollLeft;return t?t.left+n:Mn(Ut(e)).left+n}function cm(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-ho(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function VI(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=Ut(r),a=t?co(t.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},u=zt(1);const f=zt(0),c=Ht(r);if((c||!c&&!o)&&((tr(r)!=="body"||ti(s))&&(l=fo(r)),Ht(r))){const d=Mn(r);u=rr(r),f.x=d.x+r.clientLeft,f.y=d.y+r.clientTop}const h=s&&!c&&!o?cm(s,l):zt(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+h.x,y:n.y*u.y-l.scrollTop*u.y+f.y+h.y}}function WI(e){return Array.from(e.getClientRects())}function qI(e){const t=Ut(e),n=fo(e),r=e.ownerDocument.body,i=gt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=gt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+ho(e);const a=-n.scrollTop;return Pt(r).direction==="rtl"&&(s+=gt(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}const fm=25;function YI(e,t){const n=yt(e),r=Ut(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const f=al();(!f||f&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}const u=ho(r);if(u<=0){const f=r.ownerDocument,c=f.body,h=getComputedStyle(c),d=f.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(r.clientWidth-c.clientWidth-d);m<=fm&&(o-=m)}else u<=fm&&(o+=u);return{width:o,height:s,x:a,y:l}}const KI=new Set(["absolute","fixed"]);function GI(e,t){const n=Mn(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=Ht(e)?rr(e):zt(1),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,u=r*o.y;return{width:s,height:a,x:l,y:u}}function dm(e,t,n){let r;if(t==="viewport")r=YI(e,n);else if(t==="document")r=qI(Ut(e));else if(_t(t))r=GI(t,n);else{const i=um(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return lo(r)}function hm(e,t){const n=cn(e);return n===t||!_t(n)||nr(n)?!1:Pt(n).position==="fixed"||hm(n,t)}function QI(e,t){const n=t.get(e);if(n)return n;let r=fn(e,[],!1).filter(a=>_t(a)&&tr(a)!=="body"),i=null;const o=Pt(e).position==="fixed";let s=o?cn(e):e;for(;_t(s)&&!nr(s);){const a=Pt(s),l=sl(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&KI.has(i.position)||ti(s)&&!l&&hm(e,s))?r=r.filter(f=>f!==s):i=a,s=cn(s)}return t.set(e,r),r}function ZI(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?co(t)?[]:QI(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,f)=>{const c=dm(t,f,i);return u.top=gt(c.top,u.top),u.right=er(c.right,u.right),u.bottom=er(c.bottom,u.bottom),u.left=gt(c.left,u.left),u},dm(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function JI(e){const{width:t,height:n}=lm(e);return{width:t,height:n}}function XI(e,t,n){const r=Ht(t),i=Ut(t),o=n==="fixed",s=Mn(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=zt(0);function u(){l.x=ho(i)}if(r||!r&&!o)if((tr(t)!=="body"||ti(i))&&(a=fo(t)),r){const d=Mn(t,!0,o,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&u();o&&!r&&i&&u();const f=i&&!r&&!o?cm(i,a):zt(0),c=s.left+a.scrollLeft-l.x-f.x,h=s.top+a.scrollTop-l.y-f.y;return{x:c,y:h,width:s.width,height:s.height}}function cl(e){return Pt(e).position==="static"}function pm(e,t){if(!Ht(e)||Pt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ut(e)===n&&(n=n.ownerDocument.body),n}function mm(e,t){const n=yt(e);if(co(e))return n;if(!Ht(e)){let i=cn(e);for(;i&&!nr(i);){if(_t(i)&&!cl(i))return i;i=cn(i)}return n}let r=pm(e,t);for(;r&&LI(r)&&cl(r);)r=pm(r,t);return r&&nr(r)&&cl(r)&&!sl(r)?n:r||zI(e)||n}const eO=async function(e){const t=this.getOffsetParent||mm,n=this.getDimensions,r=await n(e.floating);return{reference:XI(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function tO(e){return Pt(e).direction==="rtl"}const nO={convertOffsetParentRelativeRectToViewportRelativeRect:VI,getDocumentElement:Ut,getClippingRect:ZI,getOffsetParent:mm,getElementRects:eO,getClientRects:WI,getDimensions:JI,getScale:rr,isElement:_t,isRTL:tO};function gm(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function rO(e,t){let n=null,r;const i=Ut(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const u=e.getBoundingClientRect(),{left:f,top:c,width:h,height:d}=u;if(a||t(),!h||!d)return;const m=so(c),p=so(i.clientWidth-(f+h)),g=so(i.clientHeight-(c+d)),v=so(f),w={rootMargin:-m+"px "+-p+"px "+-g+"px "+-v+"px",threshold:gt(0,er(1,l))||1};let C=!0;function k(E){const I=E[0].intersectionRatio;if(I!==l){if(!C)return s();I?s(!1,I):r=setTimeout(()=>{s(!1,1e-7)},1e3)}I===1&&!gm(u,e.getBoundingClientRect())&&s(),C=!1}try{n=new IntersectionObserver(k,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(k,w)}n.observe(e)}return s(!0),o}function iO(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=ul(e),f=i||o?[...u?fn(u):[],...fn(t)]:[];f.forEach(v=>{i&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const c=u&&a?rO(u,n):null;let h=-1,d=null;s&&(d=new ResizeObserver(v=>{let[y]=v;y&&y.target===u&&d&&(d.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=d)==null||w.observe(t)})),n()}),u&&!l&&d.observe(u),d.observe(t));let m,p=l?Mn(e):null;l&&g();function g(){const v=Mn(e);p&&!gm(p,v)&&n(),p=v,m=requestAnimationFrame(g)}return n(),()=>{var v;f.forEach(y=>{i&&y.removeEventListener("scroll",n),o&&y.removeEventListener("resize",n)}),c==null||c(),(v=d)==null||v.disconnect(),d=null,l&&cancelAnimationFrame(m)}}const oO=MI,sO=DI,aO=NI,lO=(e,t,n)=>{const r=new Map,i={platform:nO,...n},o={...i.platform,_c:r};return TI(e,t,{...i,platform:o})};var uO=typeof document<"u",cO=function(){},po=uO?M.useLayoutEffect:cO;function mo(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(!mo(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 o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!mo(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function ym(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vm(e,t){const n=ym(e);return Math.round(t*n)/n}function fl(e){const t=A.useRef(e);return po(()=>{t.current=e}),t}function fO(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[f,c]=A.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,d]=A.useState(r);mo(h,r)||d(r);const[m,p]=A.useState(null),[g,v]=A.useState(null),y=A.useCallback(z=>{z!==E.current&&(E.current=z,p(z))},[]),w=A.useCallback(z=>{z!==I.current&&(I.current=z,v(z))},[]),C=o||m,k=s||g,E=A.useRef(null),I=A.useRef(null),D=A.useRef(f),P=l!=null,T=fl(l),O=fl(i),U=fl(u),L=A.useCallback(()=>{if(!E.current||!I.current)return;const z={placement:t,strategy:n,middleware:h};O.current&&(z.platform=O.current),lO(E.current,I.current,z).then(V=>{const b={...V,isPositioned:U.current!==!1};F.current&&!mo(D.current,b)&&(D.current=b,zu.flushSync(()=>{c(b)}))})},[h,t,n,O,U]);po(()=>{u===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,c(z=>({...z,isPositioned:!1})))},[u]);const F=A.useRef(!1);po(()=>(F.current=!0,()=>{F.current=!1}),[]),po(()=>{if(C&&(E.current=C),k&&(I.current=k),C&&k){if(T.current)return T.current(C,k,L);L()}},[C,k,L,T,P]);const R=A.useMemo(()=>({reference:E,floating:I,setReference:y,setFloating:w}),[y,w]),N=A.useMemo(()=>({reference:C,floating:k}),[C,k]),j=A.useMemo(()=>{const z={position:n,left:0,top:0};if(!N.floating)return z;const V=vm(N.floating,f.x),b=vm(N.floating,f.y);return a?{...z,transform:"translate("+V+"px, "+b+"px)",...ym(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:b}},[n,a,N.floating,f.x,f.y]);return A.useMemo(()=>({...f,update:L,refs:R,elements:N,floatingStyles:j}),[f,L,R,N,j])}const dO=(e,t)=>({...oO(e),options:[e,t]}),hO=(e,t)=>({...sO(e),options:[e,t]}),pO=(e,t)=>({...aO(e),options:[e,t]});/*!
286
286
  * tabbable 6.3.0
287
287
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
288
- */var hO=["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])"],cl=hO.join(","),vm=typeof Element>"u",ni=vm?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,go=!vm&&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},ri=function(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"),o=i===""||i==="true",s=o||n&&t&&ri(t.parentNode);return s},pO=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},mO=function(t,n,r){if(ri(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(cl));return n&&ni.call(t,cl)&&i.unshift(t),i=i.filter(r),i},fl=function(t,n,r){for(var i=[],o=Array.from(t);o.length;){var s=o.shift();if(!ri(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,u=fl(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:s,candidates:u})}else{var f=ni.call(s,cl);f&&r.filter(s)&&(n||!t.includes(s))&&i.push(s);var c=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),h=!ri(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(c&&h){var d=fl(c===!0?s.children:c.children,!0,r);r.flatten?i.push.apply(i,d):i.push({scopeParent:s,candidates:d})}else o.unshift.apply(o,s.children)}}return i},bm=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},wm=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||pO(t))&&!bm(t)?0:t.tabIndex},gO=function(t,n){var r=wm(t);return r<0&&n&&!bm(t)?0:r},yO=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Sm=function(t){return t.tagName==="INPUT"},vO=function(t){return Sm(t)&&t.type==="hidden"},bO=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},wO=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},SO=function(t){if(!t.name)return!0;var n=t.form||go(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(s){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",s.message),!1}var o=wO(i,t.form);return!o||o===t},xO=function(t){return Sm(t)&&t.type==="radio"},kO=function(t){return xO(t)&&!SO(t)},EO=function(t){var n,r=t&&go(t),i=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var s,a,l;for(o=!!((s=i)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&i;){var u,f,c;r=go(i),i=(u=r)===null||u===void 0?void 0:u.host,o=!!((f=i)!==null&&f!==void 0&&(c=f.ownerDocument)!==null&&c!==void 0&&c.contains(i))}}return o},xm=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},CO=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}if(getComputedStyle(t).visibility==="hidden")return!0;var s=ni.call(t,"details>summary:first-of-type"),a=s?t.parentElement:t;if(ni.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var l=t;t;){var u=t.parentElement,f=go(t);if(u&&!u.shadowRoot&&i(u)===!0)return xm(t);t.assignedSlot?t=t.assignedSlot:!u&&f!==t.ownerDocument?t=f.host:t=u}t=l}if(EO(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return xm(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 ni.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},TO=function(t,n){return!(n.disabled||ri(n)||vO(n)||CO(n,t)||bO(n)||AO(n))},km=function(t,n){return!(kO(n)||wm(n)<0||!TO(t,n))},IO=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Em=function(t){var n=[],r=[];return t.forEach(function(i,o){var s=!!i.scopeParent,a=s?i.scopeParent:i,l=gO(a,s),u=s?Em(i.candidates):a;l===0?s?n.push.apply(n,u):n.push(a):r.push({documentOrder:o,tabIndex:l,item:i,isScope:s,content:u})}),r.sort(yO).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},dl=function(t,n){n=n||{};var r;return n.getShadowRoot?r=fl([t],n.includeContainer,{filter:km.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:IO}):r=mO(t,n.includeContainer,km.bind(null,n)),Em(r)};const hl="ArrowUp",yo="ArrowDown",ir="ArrowLeft",ii="ArrowRight";function vo(e,t,n){return Math.floor(e/t)!==n}function oi(e,t){return t<0||t>=e.current.length}function pl(e,t){return nt(e,{disabledIndices:t})}function Cm(e,t){return nt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function nt(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const s=e.current;let a=n;do{var l,u;a=a+(r?-o:o)}while(a>=0&&a<=s.length-1&&(i?i.includes(a):s[a]==null||(l=s[a])!=null&&l.hasAttribute("disabled")||((u=s[a])==null?void 0:u.getAttribute("aria-disabled"))==="true"));return a}function OO(e,t){let{event:n,orientation:r,loop:i,cols:o,disabledIndices:s,minIndex:a,maxIndex:l,prevIndex:u,stopEvent:f=!1}=t,c=u;if(n.key===hl){if(f&&Je(n),u===-1)c=l;else if(c=nt(e,{startingIndex:c,amount:o,decrement:!0,disabledIndices:s}),i&&(u-o<a||c<0)){const h=u%o,d=l%o,m=l-(d-h);d===h?c=l:c=d>h?m:m-o}oi(e,c)&&(c=u)}if(n.key===yo&&(f&&Je(n),u===-1?c=a:(c=nt(e,{startingIndex:u,amount:o,disabledIndices:s}),i&&u+o>l&&(c=nt(e,{startingIndex:u%o-o,amount:o,disabledIndices:s}))),oi(e,c)&&(c=u)),r==="both"){const h=Vp(u/o);n.key===ii&&(f&&Je(n),u%o!==o-1?(c=nt(e,{startingIndex:u,disabledIndices:s}),i&&vo(c,o,h)&&(c=nt(e,{startingIndex:u-u%o-1,disabledIndices:s}))):i&&(c=nt(e,{startingIndex:u-u%o-1,disabledIndices:s})),vo(c,o,h)&&(c=u)),n.key===ir&&(f&&Je(n),u%o!==0?(c=nt(e,{startingIndex:u,disabledIndices:s,decrement:!0}),i&&vo(c,o,h)&&(c=nt(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}))):i&&(c=nt(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s})),vo(c,o,h)&&(c=u));const d=Vp(l/o)===h;oi(e,c)&&(i&&d?c=n.key===ir?l:nt(e,{startingIndex:u-u%o-1,disabledIndices:s}):c=u)}return c}let Am=0;function Gt(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Am);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():Am=requestAnimationFrame(o)}var Ye=typeof document<"u"?M.useLayoutEffect:M.useEffect;function bo(){return bo=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},bo.apply(this,arguments)}let ml=!1,MO=0;const Tm=()=>"floating-ui-"+MO++;function DO(){const[e,t]=C.useState(()=>ml?Tm():void 0);return Ye(()=>{e==null&&t(Tm())},[]),C.useEffect(()=>{ml||(ml=!0)},[]),e}const gl=C.useId||DO;function NO(){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 _O=C.createContext(null),PO=C.createContext(null),Im=()=>{var e;return((e=C.useContext(_O))==null?void 0:e.id)||null},wo=()=>C.useContext(PO);function si(e){return"data-floating-ui-"+e}function dn(e){const t=M.useRef(e);return Ye(()=>{t.current=e}),t}function LO(e,t){var n;let r=[],i=(n=e.find(o=>o.id===t))==null?void 0:n.parentId;for(;i;){const o=e.find(s=>s.id===i);i=o==null?void 0:o.parentId,o&&(r=r.concat(o))}return r}function or(e,t){let n=e.filter(i=>{var o;return i.parentId===t&&((o=i.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=e.filter(i=>{var o;return(o=r)==null?void 0:o.some(s=>{var a;return i.parentId===s.id&&((a=i.context)==null?void 0:a.open)})}),n=n.concat(r);return n}function FO(e,t){let n,r=-1;function i(o,s){s>r&&(n=o,r=s),or(e,o).forEach(l=>{i(l.id,s+1)})}return i(t,0),e.find(o=>o.id===n)}let sr=new WeakMap,So=new WeakSet,xo={},yl=0;const RO=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Om=e=>e&&(e.host||Om(e.parentNode)),$O=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Om(n);return e.contains(r)?r:null}).filter(n=>n!=null);function BO(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,s=$O(t,e),a=new Set,l=new Set(s),u=[];xo[i]||(xo[i]=new WeakMap);const f=xo[i];s.forEach(c),h(t),a.clear();function c(d){!d||a.has(d)||(a.add(d),d.parentNode&&c(d.parentNode))}function h(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,m=>{if(a.has(m))h(m);else{const p=o?m.getAttribute(o):null,g=p!==null&&p!=="false",v=(sr.get(m)||0)+1,y=(f.get(m)||0)+1;sr.set(m,v),f.set(m,y),u.push(m),v===1&&g&&So.add(m),y===1&&m.setAttribute(i,""),!g&&o&&m.setAttribute(o,"true")}})}return yl++,()=>{u.forEach(d=>{const m=(sr.get(d)||0)-1,p=(f.get(d)||0)-1;sr.set(d,m),f.set(d,p),m||(!So.has(d)&&o&&d.removeAttribute(o),So.delete(d)),p||d.removeAttribute(i)}),yl--,yl||(sr=new WeakMap,sr=new WeakMap,So=new WeakSet,xo={})}}function Mm(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Nt(e[0]).body;return BO(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const vl=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Dm(e,t){const n=dl(e,vl());t==="prev"&&n.reverse();const r=n.indexOf(un(Nt(e)));return n.slice(r+1)[0]}function Nm(){return Dm(document.body,"next")}function _m(){return Dm(document.body,"prev")}function ai(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!ft(n,r)}function zO(e){dl(e,vl()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function UO(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 bl={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 HO;function Pm(e){e.key==="Tab"&&(e.target,clearTimeout(HO))}const ko=C.forwardRef(function(t,n){const[r,i]=C.useState();Ye(()=>(Qp()&&i("button"),document.addEventListener("keydown",Pm),()=>{document.removeEventListener("keydown",Pm)}),[]);const o={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[si("focus-guard")]:"",style:bl};return C.createElement("span",bo({},t,o))}),Lm=C.createContext(null);function jO(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=C.useState(null),o=gl(),s=Fm(),a=C.useMemo(()=>({id:t,root:n,portalContext:s,uniqueId:o}),[t,n,s,o]),l=C.useRef();return Ye(()=>()=>{r==null||r.remove()},[r,a]),Ye(()=>{if(l.current===a)return;l.current=a;const{id:u,root:f,portalContext:c,uniqueId:h}=a,d=u?document.getElementById(u):null,m=si("portal");if(d){const p=document.createElement("div");p.id=h,p.setAttribute(m,""),d.appendChild(p),i(p)}else{let p=f||(c==null?void 0:c.portalNode);p&&!kt(p)&&(p=p.current),p=p||document.body;let g=null;u&&(g=document.createElement("div"),g.id=u,p.appendChild(g));const v=document.createElement("div");v.id=h,v.setAttribute(m,""),p=g||p,p.appendChild(v),i(v)}},[a]),r}function VO(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=jO({id:n,root:r}),[s,a]=C.useState(null),l=C.useRef(null),u=C.useRef(null),f=C.useRef(null),c=C.useRef(null),h=!!s&&!s.modal&&s.open&&i&&!!(r||o);return C.useEffect(()=>{if(!o||!i||s!=null&&s.modal)return;function d(m){o&&ai(m)&&(m.type==="focusin"?UO:zO)(o)}return o.addEventListener("focusin",d,!0),o.addEventListener("focusout",d,!0),()=>{o.removeEventListener("focusin",d,!0),o.removeEventListener("focusout",d,!0)}},[o,i,s==null?void 0:s.modal]),C.createElement(Lm.Provider,{value:C.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:c,portalNode:o,setFocusManagerState:a}),[i,o])},h&&o&&C.createElement(ko,{"data-type":"outside",ref:l,onFocus:d=>{if(ai(d,o)){var m;(m=f.current)==null||m.focus()}else{const p=_m()||(s==null?void 0:s.refs.domReference.current);p==null||p.focus()}}}),h&&o&&C.createElement("span",{"aria-owns":o.id,style:bl}),o&&Fu.createPortal(t,o),h&&o&&C.createElement(ko,{"data-type":"outside",ref:u,onFocus:d=>{if(ai(d,o)){var m;(m=c.current)==null||m.focus()}else{const p=Nm()||(s==null?void 0:s.refs.domReference.current);p==null||p.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1,d.nativeEvent))}}}))}const Fm=()=>C.useContext(Lm),WO=C.forwardRef(function(t,n){return C.createElement("button",bo({},t,{type:"button",ref:n,tabIndex:-1,style:bl}))});function qO(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:o=!0,initialFocus:s=0,returnFocus:a=!0,modal:l=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:f=!0}=e,{open:c,refs:h,nodeId:d,onOpenChange:m,events:p,dataRef:g,elements:{domReference:v,floating:y}}=t,w=RO()?o:!0,A=dn(i),k=dn(s),E=dn(a),I=wo(),D=Fm(),P=typeof s=="number"&&s<0,T=C.useRef(null),O=C.useRef(null),B=C.useRef(!1),L=C.useRef(null),F=C.useRef(!1),R=D!=null,N=v&&v.getAttribute("role")==="combobox"&&Xp(v)&&P,H=C.useCallback(function(_){return _===void 0&&(_=y),_?dl(_,vl()):[]},[y]),z=C.useCallback(_=>{const j=H(_);return A.current.map(S=>v&&S==="reference"?v:y&&S==="floating"?y:j).filter(Boolean).flat()},[v,y,A,H]);C.useEffect(()=>{if(r||!l)return;function _(S){if(S.key==="Tab"){ft(y,un(Nt(y)))&&H().length===0&&!N&&Je(S);const V=z(),Y=Jp(S);A.current[0]==="reference"&&Y===v&&(Je(S),S.shiftKey?Gt(V[V.length-1]):Gt(V[1])),A.current[1]==="floating"&&Y===y&&S.shiftKey&&(Je(S),Gt(V[0]))}}const j=Nt(y);return j.addEventListener("keydown",_),()=>{j.removeEventListener("keydown",_)}},[r,v,y,l,A,h,N,H,z]),C.useEffect(()=>{if(r||!f)return;function _(){F.current=!0,setTimeout(()=>{F.current=!1})}function j(S){const V=S.relatedTarget;queueMicrotask(()=>{const Y=!(ft(v,V)||ft(y,V)||ft(V,y)||ft(D==null?void 0:D.portalNode,V)||V!=null&&V.hasAttribute(si("focus-guard"))||I&&(or(I.nodesRef.current,d).find(q=>{var Q,X;return ft((Q=q.context)==null?void 0:Q.elements.floating,V)||ft((X=q.context)==null?void 0:X.elements.domReference,V)})||LO(I.nodesRef.current,d).find(q=>{var Q,X;return((Q=q.context)==null?void 0:Q.elements.floating)===V||((X=q.context)==null?void 0:X.elements.domReference)===V})));V&&Y&&!F.current&&V!==L.current&&(B.current=!0,m(!1,S))})}if(y&&Xn(v))return v.addEventListener("focusout",j),v.addEventListener("pointerdown",_),!l&&y.addEventListener("focusout",j),()=>{v.removeEventListener("focusout",j),v.removeEventListener("pointerdown",_),!l&&y.removeEventListener("focusout",j)}},[r,v,y,l,d,I,D,m,f]),C.useEffect(()=>{var _;if(r)return;const j=Array.from((D==null||(_=D.portalNode)==null?void 0:_.querySelectorAll("["+si("portal")+"]"))||[]);if(y){const S=[y,...j,T.current,O.current,A.current.includes("reference")||N?v:null].filter(Y=>Y!=null),V=l?Mm(S,w,!w):Mm(S);return()=>{V()}}},[r,v,y,l,A,D,N,w]),Ye(()=>{if(r||!y)return;const _=Nt(y),j=un(_);queueMicrotask(()=>{const S=z(y),V=k.current,Y=(typeof V=="number"?S[V]:V.current)||y,q=ft(y,j);!P&&!q&&c&&Gt(Y,{preventScroll:Y===y})})},[r,c,y,P,z,k]),Ye(()=>{if(r||!y)return;let _=!1;const j=Nt(y),S=un(j),V=g.current;L.current=S;function Y(q){if(q.type==="escapeKey"&&h.domReference.current&&(L.current=h.domReference.current),["referencePress","escapeKey"].includes(q.type))return;const Q=q.data.returnFocus;typeof Q=="object"?(B.current=!1,_=Q.preventScroll):B.current=!Q}return p.on("dismiss",Y),()=>{p.off("dismiss",Y);const q=un(j);(ft(y,q)||I&&or(I.nodesRef.current,d).some(X=>{var se;return ft((se=X.context)==null?void 0:se.elements.floating,q)})||V.openEvent&&["click","mousedown"].includes(V.openEvent.type))&&h.domReference.current&&(L.current=h.domReference.current),E.current&&Xn(L.current)&&!B.current&&Gt(L.current,{cancelPrevious:!1,preventScroll:_})}},[r,y,E,g,h,p,I,d]),Ye(()=>{if(!(r||!D))return D.setFocusManagerState({modal:l,closeOnFocusOut:f,open:c,onOpenChange:m,refs:h}),()=>{D.setFocusManagerState(null)}},[r,D,l,c,m,h,f]),Ye(()=>{if(!r&&y&&typeof MutationObserver=="function"&&!P){const _=()=>{const S=y.getAttribute("tabindex");A.current.includes("floating")||un(Nt(y))!==h.domReference.current&&H().length===0?S!=="0"&&y.setAttribute("tabindex","0"):S!=="-1"&&y.setAttribute("tabindex","-1")};_();const j=new MutationObserver(_);return j.observe(y,{childList:!0,subtree:!0,attributes:!0}),()=>{j.disconnect()}}},[r,y,h,A,H,P]);function W(_){return r||!u||!l?null:C.createElement(WO,{ref:_==="start"?T:O,onClick:j=>m(!1,j.nativeEvent)},typeof u=="string"?u:"Dismiss")}const b=!r&&w&&!N&&(R||l);return C.createElement(C.Fragment,null,b&&C.createElement(ko,{"data-type":"inside",ref:D==null?void 0:D.beforeInsideRef,onFocus:_=>{if(l){const S=z();Gt(i[0]==="reference"?S[0]:S[S.length-1])}else if(D!=null&&D.preserveTabOrder&&D.portalNode)if(B.current=!1,ai(_,D.portalNode)){const S=Nm()||v;S==null||S.focus()}else{var j;(j=D.beforeOutsideRef.current)==null||j.focus()}}}),!N&&W("start"),n,W("end"),b&&C.createElement(ko,{"data-type":"inside",ref:D==null?void 0:D.afterInsideRef,onFocus:_=>{if(l)Gt(z()[0]);else if(D!=null&&D.preserveTabOrder&&D.portalNode)if(f&&(B.current=!0),ai(_,D.portalNode)){const S=_m()||v;S==null||S.focus()}else{var j;(j=D.afterOutsideRef.current)==null||j.focus()}}}))}function Rm(e){return Xn(e.target)&&e.target.tagName==="BUTTON"}function $m(e){return Xp(e)}function YO(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=e,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:f=!0}=t,c=C.useRef(),h=C.useRef(!1);return C.useMemo(()=>s?{reference:{onPointerDown(d){c.current=d.pointerType},onMouseDown(d){d.button===0&&(Zp(c.current)&&u||a!=="click"&&(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,d.nativeEvent):(d.preventDefault(),r(!0,d.nativeEvent))))},onClick(d){if(a==="mousedown"&&c.current){c.current=void 0;return}Zp(c.current)&&u||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,d.nativeEvent):r(!0,d.nativeEvent))},onKeyDown(d){c.current=void 0,!(d.defaultPrevented||!f||Rm(d))&&(d.key===" "&&!$m(o)&&(d.preventDefault(),h.current=!0),d.key==="Enter"&&r(!(n&&l),d.nativeEvent))},onKeyUp(d){d.defaultPrevented||!f||Rm(d)||$m(o)||d.key===" "&&h.current&&(h.current=!1,r(!(n&&l),d.nativeEvent))}}}:{},[s,i,a,u,f,o,l,n,r])}const KO=C.useInsertionEffect||(e=>e());function hn(e){const t=C.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return KO(()=>{t.current=e}),C.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 GO={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},QO={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},ZO=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 JO(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,nodeId:o,elements:{reference:s,domReference:a,floating:l},dataRef:u}=e,{enabled:f=!0,escapeKey:c=!0,outsidePress:h=!0,outsidePressEvent:d="pointerdown",referencePress:m=!1,referencePressEvent:p="pointerdown",ancestorScroll:g=!1,bubbles:v}=t,y=wo(),w=Im()!=null,A=hn(typeof h=="function"?h:()=>!1),k=typeof h=="function"?A:h,E=C.useRef(!1),{escapeKeyBubbles:I,outsidePressBubbles:D}=ZO(v),P=hn(O=>{if(!n||!f||!c||O.key!=="Escape")return;const B=y?or(y.nodesRef.current,o):[];if(!I&&(O.stopPropagation(),B.length>0)){let L=!0;if(B.forEach(F=>{var R;if((R=F.context)!=null&&R.open&&!F.context.dataRef.current.__escapeKeyBubbles){L=!1;return}}),!L)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1,yI(O)?O.nativeEvent:O)}),T=hn(O=>{const B=E.current;if(E.current=!1,B||typeof k=="function"&&!k(O))return;const L=Jp(O),F="["+si("inert")+"]",R=Nt(l).querySelectorAll(F);let N=kt(L)?L:null;for(;N&&!dI(N);){const W=pI(N);if(W===Nt(l).body||!kt(W))break;N=W}if(R.length&&kt(L)&&!vI(L)&&!ft(L,l)&&Array.from(R).every(W=>!ft(N,W)))return;if(Xn(L)&&l){const W=L.clientWidth>0&&L.scrollWidth>L.clientWidth,b=L.clientHeight>0&&L.scrollHeight>L.clientHeight;let _=b&&O.offsetX>L.clientWidth;if(b&&hI(L).direction==="rtl"&&(_=O.offsetX<=L.offsetWidth-L.clientWidth),_||W&&O.offsetY>L.clientHeight)return}const H=y&&or(y.nodesRef.current,o).some(W=>{var b;return nl(O,(b=W.context)==null?void 0:b.elements.floating)});if(nl(O,l)||nl(O,a)||H)return;const z=y?or(y.nodesRef.current,o):[];if(z.length>0){let W=!0;if(z.forEach(b=>{var _;if((_=b.context)!=null&&_.open&&!b.context.dataRef.current.__outsidePressBubbles){W=!1;return}}),!W)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:w?{preventScroll:!0}:Kp(O)||Gp(O)}}),r(!1,O)});return C.useEffect(()=>{if(!n||!f)return;u.current.__escapeKeyBubbles=I,u.current.__outsidePressBubbles=D;function O(F){r(!1,F)}const B=Nt(l);c&&B.addEventListener("keydown",P),k&&B.addEventListener(d,T);let L=[];return g&&(kt(a)&&(L=fn(a)),kt(l)&&(L=L.concat(fn(l))),!kt(s)&&s&&s.contextElement&&(L=L.concat(fn(s.contextElement)))),L=L.filter(F=>{var R;return F!==((R=B.defaultView)==null?void 0:R.visualViewport)}),L.forEach(F=>{F.addEventListener("scroll",O,{passive:!0})}),()=>{c&&B.removeEventListener("keydown",P),k&&B.removeEventListener(d,T),L.forEach(F=>{F.removeEventListener("scroll",O)})}},[u,l,a,s,c,k,d,n,r,g,f,I,D,P,T]),C.useEffect(()=>{E.current=!1},[k,d]),C.useMemo(()=>f?{reference:{onKeyDown:P,[GO[p]]:O=>{m&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1,O.nativeEvent))}},floating:{onKeyDown:P,[QO[d]]:()=>{E.current=!0}}}:{},[f,i,m,d,p,r,P])}let wl;process.env.NODE_ENV!=="production"&&(wl=new Set);function XO(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e;if(process.env.NODE_ENV!=="production"){var o;const I="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((o=e.elements)!=null&&o.reference&&!kt(e.elements.reference)){var s;if(!((s=wl)!=null&&s.has(I))){var a;(a=wl)==null||a.add(I),console.error(I)}}}const[l,u]=C.useState(null),f=((t=e.elements)==null?void 0:t.reference)||l,c=uO(e),h=wo(),d=hn((I,D)=>{I&&(p.current.openEvent=D),r==null||r(I,D)}),m=C.useRef(null),p=C.useRef({}),g=C.useState(()=>NO())[0],v=gl(),y=C.useCallback(I=>{const D=kt(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),contextElement:I}:I;c.refs.setReference(D)},[c.refs]),w=C.useCallback(I=>{(kt(I)||I===null)&&(m.current=I,u(I)),(kt(c.refs.reference.current)||c.refs.reference.current===null||I!==null&&!kt(I))&&c.refs.setReference(I)},[c.refs]),A=C.useMemo(()=>({...c.refs,setReference:w,setPositionReference:y,domReference:m}),[c.refs,w,y]),k=C.useMemo(()=>({...c.elements,domReference:f}),[c.elements,f]),E=C.useMemo(()=>({...c,refs:A,elements:k,dataRef:p,nodeId:i,floatingId:v,events:g,open:n,onOpenChange:d}),[c,i,v,g,n,d,A,k]);return Ye(()=>{const I=h==null?void 0:h.nodesRef.current.find(D=>D.id===i);I&&(I.context=E)}),C.useMemo(()=>({...c,context:E,refs:A,elements:k}),[c,A,k,E])}function Sl(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,o)=>(o&&Object.entries(o).forEach(s=>{let[a,l]=s;if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof l=="function"){var u;(u=r.get(a))==null||u.push(l),i[a]=function(){for(var f,c=arguments.length,h=new Array(c),d=0;d<c;d++)h[d]=arguments[d];return(f=r.get(a))==null?void 0:f.map(m=>m(...h)).find(m=>m!==void 0)}}}else i[a]=l}),i),{})}}function eM(e){e===void 0&&(e=[]);const t=e,n=C.useCallback(o=>Sl(o,e,"reference"),t),r=C.useCallback(o=>Sl(o,e,"floating"),t),i=C.useCallback(o=>Sl(o,e,"item"),e.map(o=>o==null?void 0:o.item));return C.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])}let Bm=!1;function Eo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function zm(e,t){return Eo(t,e===hl||e===yo,e===ir||e===ii)}function xl(e,t,n){return Eo(t,e===yo,n?e===ir:e===ii)||e==="Enter"||e==" "||e===""}function tM(e,t,n){return Eo(t,n?e===ir:e===ii,e===yo)}function Um(e,t,n){return Eo(t,n?e===ii:e===ir,e===hl)}function nM(e,t){const{open:n,onOpenChange:r,refs:i,elements:{domReference:o,floating:s}}=e,{listRef:a,activeIndex:l,onNavigate:u=()=>{},enabled:f=!0,selectedIndex:c=null,allowEscape:h=!1,loop:d=!1,nested:m=!1,rtl:p=!1,virtual:g=!1,focusItemOnOpen:v="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:w=!0,disabledIndices:A=void 0,orientation:k="vertical",cols:E=1,scrollItemIntoView:I=!0,virtualItemRef:D}=t;process.env.NODE_ENV!=="production"&&(h&&(d||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),g||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),k==="vertical"&&E>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const P=Im(),T=wo(),O=hn(u),B=C.useRef(v),L=C.useRef(c??-1),F=C.useRef(null),R=C.useRef(!0),N=C.useRef(O),H=C.useRef(!!s),z=C.useRef(!1),W=C.useRef(!1),b=dn(A),_=dn(n),j=dn(I),[S,V]=C.useState(),[Y,q]=C.useState(),Q=hn(function(G,te,$){$===void 0&&($=!1);const ne=G.current[te.current];ne&&(g?(V(ne.id),T==null||T.events.emit("virtualfocus",ne),D&&(D.current=ne)):Gt(ne,{preventScroll:!0,sync:gI()&&Qp()?Bm||z.current:!1}),requestAnimationFrame(()=>{const me=j.current;me&&ne&&($||!R.current)&&(ne.scrollIntoView==null||ne.scrollIntoView(typeof me=="boolean"?{block:"nearest",inline:"nearest"}:me))}))});Ye(()=>{document.createElement("div").focus({get preventScroll(){return Bm=!0,!1}})},[]),Ye(()=>{f&&(n&&s?B.current&&c!=null&&(W.current=!0,O(c)):H.current&&(L.current=-1,N.current(null)))},[f,n,s,c,O]),Ye(()=>{if(f&&n&&s)if(l==null){if(z.current=!1,c!=null)return;if(H.current&&(L.current=-1,Q(a,L)),!H.current&&B.current&&(F.current!=null||B.current===!0&&F.current==null)){let G=0;const te=()=>{a.current[0]==null?(G<2&&(G?requestAnimationFrame:queueMicrotask)(te),G++):(L.current=F.current==null||xl(F.current,k,p)||m?pl(a,b.current):Cm(a,b.current),F.current=null,O(L.current))};te()}}else oi(a,l)||(L.current=l,Q(a,L,W.current),W.current=!1)},[f,n,s,l,c,m,a,k,p,O,Q,b]),Ye(()=>{var G,te;if(!f||s||!T||g||!H.current)return;const $=T.nodesRef.current,ne=(G=$.find(J=>J.id===P))==null||(te=G.context)==null?void 0:te.elements.floating,me=un(Nt(s)),Oe=$.some(J=>J.context&&ft(J.context.elements.floating,me));ne&&!Oe&&R.current&&ne.focus({preventScroll:!0})},[f,s,T,P,g]),Ye(()=>{if(!f||!T||!g||P)return;function G(te){q(te.id),D&&(D.current=te)}return T.events.on("virtualfocus",G),()=>{T.events.off("virtualfocus",G)}},[f,T,g,P,D]),Ye(()=>{N.current=O,H.current=!!s}),Ye(()=>{n||(F.current=null)},[n]);const X=l!=null,se=C.useMemo(()=>{function G($){if(!n)return;const ne=a.current.indexOf($);ne!==-1&&O(ne)}return{onFocus($){let{currentTarget:ne}=$;G(ne)},onClick:$=>{let{currentTarget:ne}=$;return ne.focus({preventScroll:!0})},...y&&{onMouseMove($){let{currentTarget:ne}=$;G(ne)},onPointerLeave($){let{pointerType:ne}=$;!R.current||ne==="touch"||(L.current=-1,Q(a,L),O(null),g||Gt(i.floating.current,{preventScroll:!0}))}}}},[n,i,Q,y,a,O,g]);return C.useMemo(()=>{if(!f)return{};const G=b.current;function te(J){if(R.current=!1,z.current=!0,!_.current&&J.currentTarget===i.floating.current)return;if(m&&Um(J.key,k,p)){Je(J),r(!1,J.nativeEvent),Xn(o)&&!g&&o.focus();return}const ue=L.current,de=pl(a,G),fe=Cm(a,G);if(J.key==="Home"&&(Je(J),L.current=de,O(L.current)),J.key==="End"&&(Je(J),L.current=fe,O(L.current)),!(E>1&&(L.current=OO(a,{event:J,orientation:k,loop:d,cols:E,disabledIndices:G,minIndex:de,maxIndex:fe,prevIndex:L.current,stopEvent:!0}),O(L.current),k==="both"))&&zm(J.key,k)){if(Je(J),n&&!g&&un(J.currentTarget.ownerDocument)===J.currentTarget){L.current=xl(J.key,k,p)?de:fe,O(L.current);return}xl(J.key,k,p)?d?L.current=ue>=fe?h&&ue!==a.current.length?-1:de:nt(a,{startingIndex:ue,disabledIndices:G}):L.current=Math.min(fe,nt(a,{startingIndex:ue,disabledIndices:G})):d?L.current=ue<=de?h&&ue!==-1?a.current.length:fe:nt(a,{startingIndex:ue,decrement:!0,disabledIndices:G}):L.current=Math.max(de,nt(a,{startingIndex:ue,decrement:!0,disabledIndices:G})),oi(a,L.current)?O(null):O(L.current)}}function $(J){v==="auto"&&Kp(J.nativeEvent)&&(B.current=!0)}function ne(J){B.current=v,v==="auto"&&Gp(J.nativeEvent)&&(B.current=!0)}const me=g&&n&&X&&{"aria-activedescendant":Y||S},Oe=a.current.find(J=>(J==null?void 0:J.id)===S);return{reference:{...me,onKeyDown(J){R.current=!1;const ue=J.key.indexOf("Arrow")===0,de=tM(J.key,k,p),fe=Um(J.key,k,p),Ae=zm(J.key,k),Fe=(m?de:Ae)||J.key==="Enter"||J.key.trim()==="";if(g&&n){const ae=T==null?void 0:T.nodesRef.current.find(K=>K.parentId==null),U=T&&ae?FO(T.nodesRef.current,ae.id):null;if(ue&&U&&D){const K=new KeyboardEvent("keydown",{key:J.key,bubbles:!0});if(de||fe){var Me,He;const oe=((Me=U.context)==null?void 0:Me.elements.domReference)===J.currentTarget,le=fe&&!oe?(He=U.context)==null?void 0:He.elements.domReference:de?Oe:null;le&&(Je(J),le.dispatchEvent(K),q(void 0))}if(Ae&&U.context&&U.context.open&&U.parentId&&J.currentTarget!==U.context.elements.domReference){var ee;Je(J),(ee=U.context.elements.domReference)==null||ee.dispatchEvent(K);return}}return te(J)}if(!(!n&&!w&&ue)){if(Fe&&(F.current=m&&Ae?null:J.key),m){de&&(Je(J),n?(L.current=pl(a,G),O(L.current)):r(!0,J.nativeEvent));return}Ae&&(c!=null&&(L.current=c),Je(J),!n&&w?r(!0,J.nativeEvent):te(J),n&&O(L.current))}},onFocus(){n&&O(null)},onPointerDown:ne,onMouseDown:$,onClick:$},floating:{"aria-orientation":k==="both"?void 0:k,...me,onKeyDown:te,onPointerMove(){R.current=!0}},item:se}},[o,i,S,Y,b,_,a,f,k,p,g,n,X,m,c,w,h,E,d,v,O,r,se,T,D])}function rM(e,t){t===void 0&&(t={});const{open:n,floatingId:r}=e,{enabled:i=!0,role:o="dialog"}=t,s=gl();return C.useMemo(()=>{const a={id:r,role:o};return i?o==="tooltip"?{reference:{"aria-describedby":n?r:void 0},floating:a}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":n?r:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:s}},floating:{...a,...o==="menu"&&{"aria-labelledby":s}}}:{}},[i,o,n,r,s])}function iM(e,t){var n;const{open:r,dataRef:i}=e,{listRef:o,activeIndex:s,onMatch:a,onTypingChange:l,enabled:u=!0,findMatch:f=null,resetMs:c=750,ignoreKeys:h=[],selectedIndex:d=null}=t,m=C.useRef(),p=C.useRef(""),g=C.useRef((n=d??s)!=null?n:-1),v=C.useRef(null),y=hn(a),w=hn(l),A=dn(f),k=dn(h);return Ye(()=>{r&&(clearTimeout(m.current),v.current=null,p.current="")},[r]),Ye(()=>{if(r&&p.current===""){var E;g.current=(E=d??s)!=null?E:-1}},[r,d,s]),C.useMemo(()=>{if(!u)return{};function E(P){P?i.current.typing||(i.current.typing=P,w(P)):i.current.typing&&(i.current.typing=P,w(P))}function I(P,T,O){const B=A.current?A.current(T,O):T.find(L=>(L==null?void 0:L.toLocaleLowerCase().indexOf(O.toLocaleLowerCase()))===0);return B?P.indexOf(B):-1}function D(P){const T=o.current;if(p.current.length>0&&p.current[0]!==" "&&(I(T,T,p.current)===-1?E(!1):P.key===" "&&Je(P)),T==null||k.current.includes(P.key)||P.key.length!==1||P.ctrlKey||P.metaKey||P.altKey)return;r&&P.key!==" "&&(Je(P),E(!0)),T.every(F=>{var R,N;return F?((R=F[0])==null?void 0:R.toLocaleLowerCase())!==((N=F[1])==null?void 0:N.toLocaleLowerCase()):!0})&&p.current===P.key&&(p.current="",g.current=v.current),p.current+=P.key,clearTimeout(m.current),m.current=setTimeout(()=>{p.current="",g.current=v.current,E(!1)},c);const B=g.current,L=I(T,[...T.slice((B||0)+1),...T.slice(0,(B||0)+1)],p.current);L!==-1?(y(L),v.current=L):P.key!==" "&&(p.current="",E(!1))}return{reference:{onKeyDown:D},floating:{onKeyDown:D,onKeyUp(P){P.key===" "&&E(!1)}}}},[u,r,i,o,c,k,A,y,w])}const oM=({options:e,reusable:t,sendMessage:n,isReadOnly:r})=>{var R,N,H,z,W;const i=Qn(b=>b.messageContainerRef),o=Qn(b=>b.portalContainer),[s,a]=C.useState(!1),[l,u]=C.useState(null),[f,c]=C.useState(null),{message:{blocks:{dropdown:h}}}=ye,d=e.reduce((b,_)=>(b[_.label]=_.value,b),{}),m=d?Object.keys(d):[],p=b=>{a(f!==null&&!t?!1:b)},{refs:g,floatingStyles:v,context:y}=XO({placement:"bottom-start",open:s,onOpenChange:p,whileElementsMounted:nO,middleware:[cO(5),fO({padding:10,boundary:(i==null?void 0:i.current)??void 0,crossAxis:!0}),dO({apply({rects:b,elements:_,availableHeight:j}){Object.assign(_.floating.style,{maxHeight:`${j}px`,minWidth:`${b.reference.width}px`})},padding:10})]}),w=C.useRef([]),A=C.useRef(m),k=C.useRef(!1),E=YO(y,{event:"mousedown"}),I=JO(y),D=rM(y,{role:"listbox"}),P=nM(y,{listRef:w,activeIndex:l,selectedIndex:f,onNavigate:u,loop:!0}),T=iM(y,{listRef:A,activeIndex:l,selectedIndex:f,onMatch:s?u:c,onTypingChange(b){k.current=b}}),{getReferenceProps:O,getFloatingProps:B,getItemProps:L}=eM([I,D,P,T,E]),F=b=>{c(b),m[b]!==void 0&&(n==null||n({type:"text",text:m[b]??"",value:d[m[b]]??""})),a(!1)};return x.jsxs(x.Fragment,{children:[x.jsxs("div",{tabIndex:0,ref:g.setReference,"aria-labelledby":"select-label","aria-autocomplete":"none","data-disabled":f!==null&&!t?"":void 0,style:r?{pointerEvents:"none"}:void 0,...(R=h.button)==null?void 0:R.container,...O(),children:[x.jsx("span",{...(N=h.button)==null?void 0:N.text,children:f?m[f]:"Select..."}),x.jsx(DA,{...(H=h.button)==null?void 0:H.icon})]}),s&&x.jsx(VO,{root:o??void 0,children:x.jsx(qO,{context:y,modal:!1,children:x.jsx("div",{ref:g.setFloating,className:(W=(z=h.content)==null?void 0:z.container)==null?void 0:W.className,style:{...v,pointerEvents:"auto"},...B(),children:m.map((b,_)=>{var j;return x.jsx("div",{ref:S=>{w.current[_]=S},role:"option",tabIndex:_===l?0:-1,"aria-selected":_===f&&_===l,"data-active":_===l?"":void 0,...(j=h.content)==null?void 0:j.item,...L({onClick(){F(_)},onKeyDown(S){S.key==="Enter"&&(S.preventDefault(),F(_)),S.key===" "&&!k.current&&(S.preventDefault(),F(_))}}),children:b},b)})})})})]})},Hm=M.forwardRef(({title:e,url:t,isReadOnly:n,...r},i)=>{const{message:{blocks:{file:o}}}=ye;return x.jsxs("a",{...r,...o.container,href:t,style:n?{pointerEvents:"none"}:void 0,download:!0,ref:i,target:"_blank",rel:"noreferrer",children:[x.jsx("p",{...o.title,children:e||t}),x.jsx(LA,{...o.icon})]})});Hm.displayName="File";const sM=ln()((e,t)=>({components:{},getCustomComponent:async n=>{const r=t().components[n];if(r)return r;const i=await fetch(n).then(u=>u.text()),o=new Blob([i],{type:"application/javascript"}),a=await import(URL.createObjectURL(o)),l=()=>a.default;return e(u=>({components:{...u.components,[n]:l}})),l}}));globalThis.React=M;const jm={audio:Np,bubble:Ap,button:CT,carousel:jp,column:Pp,dropdown:oM,file:Hm,image:Mp,location:_p,row:Lp,text:nT,video:Dp,custom:({url:e,name:t,data:n,...r})=>{const i=sM(u=>u.getCustomComponent),[o,s]=M.useState(null),[a,l]=M.useState(null);return M.useEffect(()=>{i(e).then(s).catch(u=>{l(u.message)})},[e]),a?x.jsx("div",{style:{color:"red"},children:a}):o?x.jsx(o,{...n,...r}):null}},Dn=({block:e,renderers:t,...n})=>{const r=(t==null?void 0:t[e.type])??jm[e.type],i={...n,...e};return x.jsx(r,{...i})};function Vm(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Vm(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ar(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Vm(e))&&(r&&(r+=" "),r+=t);return r}const aM=({disabled:e,onFileSelected:t})=>{const n=M.useRef(null),{uploadButton:r}=ye.composer,i=()=>{n.current&&n.current.click()},o=s=>{const a=s.target.files;a&&a.length>0&&Array.from(a).forEach(l=>{t(l)})};return x.jsxs(x.Fragment,{children:[x.jsx(qA,{...r,role:"button",tabIndex:0,"aria-label":"Upload File Button","data-disabled":e,onClick:i}),x.jsx("input",{value:"",multiple:!0,type:"file",ref:n,style:{display:"none"},onChange:o})]})},lM=({name:e,type:t,instance:n,status:r,removeFile:i})=>{const{loader:o,fileIcon:s,removeIcon:a,errorIcon:l,previewImage:u}=ye.composer.fileWidget,f=["PNG","JPEG","JPG"].includes(Ao(n.name));return r==="loading"?x.jsx(Co,{name:e,status:r,removeButton:x.jsx("div",{...o}),extension:Ao(n.name),children:x.jsx("div",{...s.container,children:x.jsx(kl,{type:t,...s.icon})})}):r==="error"?x.jsx(Co,{name:e,status:r,removeButton:x.jsx(Wm,{removeFile:()=>i(e)}),extension:"Upload Error",children:x.jsxs("div",{...s.container,children:[x.jsx(NA,{...l}),x.jsx(kl,{type:t,...s.icon})]})}):r=="uploaded"&&f?x.jsx(Co,{name:e,status:r,removeButton:x.jsx(Wm,{removeFile:()=>i(e)}),extension:Ao(n.name),children:x.jsx("div",{...s.container,children:x.jsx("img",{src:URL.createObjectURL(n),alt:e,...u})})}):x.jsx(Co,{name:e,status:r,removeButton:x.jsx(op,{onClick:()=>i(e),...a}),extension:Ao(n.name),children:x.jsx("div",{...s.container,children:x.jsx(kl,{type:t,...s.icon})})})},Co=({name:e,status:t,removeButton:n,children:r,extension:i})=>{const{container:o,metadata:s}=ye.composer.fileWidget;return x.jsxs("div",{"data-status":t,title:e,...o,children:[n,r,x.jsxs("div",{...s.container,children:[x.jsx("div",{...s.name,children:e}),x.jsx("div",{...s.type,children:i})]})]})},kl=({type:e,...t})=>e==="image"?x.jsx($A,{...t}):e==="video"?x.jsx(XA,{...t}):e==="audio"?x.jsx(lp,{...t}):x.jsx(sp,{...t}),Ao=e=>{if(!e)return"File";const t=e.split(".").pop();return t?t.toUpperCase():"File"},Wm=({removeFile:e})=>{const{composer:{fileWidget:{removeIcon:t}}}=ye;return x.jsx(op,{role:"button",tabIndex:0,"aria-label":"Remove File Button",onClick:()=>e(),...t})};function El(){return El=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},El.apply(null,arguments)}function uM(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var cM=M.useLayoutEffect,fM=function(t){var n=M.useRef(t);return cM(function(){n.current=t}),n},qm=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},dM=function(t,n){var r=M.useRef();return M.useCallback(function(i){t.current=i,r.current&&qm(r.current,null),r.current=n,n&&qm(n,i)},[n])},Ym={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},hM=function(t){Object.keys(Ym).forEach(function(n){t.style.setProperty(n,Ym[n],"important")})},Km=hM,st=null,Gm=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function pM(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),st||(st=document.createElement("textarea"),st.setAttribute("tabindex","-1"),st.setAttribute("aria-hidden","true"),Km(st)),st.parentNode===null&&document.body.appendChild(st);var i=e.paddingSize,o=e.borderSize,s=e.sizingStyle,a=s.boxSizing;Object.keys(s).forEach(function(h){var d=h;st.style[d]=s[d]}),Km(st),st.value=t;var l=Gm(st,e);st.value=t,l=Gm(st,e),st.value="x";var u=st.scrollHeight-i,f=u*n;a==="border-box"&&(f=f+i+o),l=Math.max(f,l);var c=u*r;return a==="border-box"&&(c=c+i+o),l=Math.min(c,l),[l,u]}var Qm=function(){},mM=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},gM=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],yM=!!document.documentElement.currentStyle,vM=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=mM(gM,n),i=r.boxSizing;if(i==="")return null;yM&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var o=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),s=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:o,borderSize:s}},bM=vM;function Zm(e,t,n){var r=fM(n);C.useLayoutEffect(function(){var i=function(s){return r.current(s)};if(e)return e.addEventListener(t,i),function(){return e.removeEventListener(t,i)}},[])}var wM=function(t){Zm(window,"resize",t)},SM=function(t){Zm(document.fonts,"loadingdone",t)},xM=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],kM=function(t,n){var r=t.cacheMeasurements,i=t.maxRows,o=t.minRows,s=t.onChange,a=s===void 0?Qm:s,l=t.onHeightChange,u=l===void 0?Qm:l,f=uM(t,xM),c=f.value!==void 0,h=C.useRef(null),d=dM(h,n),m=C.useRef(0),p=C.useRef(),g=function(){var w=h.current,A=r&&p.current?p.current:bM(w);if(A){p.current=A;var k=pM(A,w.value||w.placeholder||"x",o,i),E=k[0],I=k[1];m.current!==E&&(m.current=E,w.style.setProperty("height",E+"px","important"),u(E,{rowHeight:I}))}},v=function(w){c||g(),a(w)};return C.useLayoutEffect(g),wM(g),SM(g),C.createElement("textarea",El({},f,{onChange:v,ref:d}))},EM=C.forwardRef(kM);const CM=({inputRef:e,composerPlaceholder:t,composerDisabled:n,textInput:r,historyIndex:i,setTextInput:o,setHistoryIndex:s,sendComposerMessage:a,allowFileUpload:l,onFilePasted:u,conversationId:f,storageKey:c})=>{const d=bp(f||"default",c)(A=>A.messageHistory),[m,p]=M.useState(""),[g,v]=M.useState(!1),{input:y}=ye.composer,w=A=>{if(!l||!u||!A.clipboardData)return;const k=Array.from(A.clipboardData.files);k.length>0&&(A.preventDefault(),k.forEach(E=>{u(E)}))};return x.jsx(EM,{...y,"aria-label":"Message Input",ref:e,placeholder:t??"Type your message...",disabled:n,value:r,"data-has-value":!!r,onChange:A=>{const k=A.target.value;o(k),d.includes(k)||s(-1)},onPaste:w,maxRows:5,onKeyDown:A=>{if(n)return;const k=A.nativeEvent;if(!(k.isComposing||k.keyCode===229)&&(r.length===0&&v(!1),A.key!=="ArrowUp"&&A.key!=="ArrowDown"&&A.key!=="ArrowLeft"&&A.key!=="ArrowRight"&&v(!0),A.key==="Enter"&&A.shiftKey?(A.preventDefault(),o(`${r}
289
- `)):A.key==="Enter"&&(A.preventDefault(),a()),!(r.length>0&&g))){if(A.key==="ArrowUp"){A.preventDefault(),i===-1&&r.trim()!==""&&p(r);const E=Math.min(i+1,d.length-1);s(E),o(d[E]??"")}if(A.key==="ArrowDown"){A.preventDefault();const E=Math.max(i-1,-1);o(i===-1?r.trim():E===-1?m:d[E]??""),s(E)}}}})},AM=({disabled:e,setTextInput:t})=>{const[n,r]=M.useState(!1),i=M.useRef(null),{voiceButton:o}=ye.composer,s=window.SpeechRecognition||window.webkitSpeechRecognition,a=()=>{i.current||(i.current=new s);const l=i.current;l&&(l.continuous=!0,l.onresult=u=>{var c,h,d;const f=((d=(h=(c=u.results)==null?void 0:c[0])==null?void 0:h[0])==null?void 0:d.transcript)??"";t(f??""),l.stop(),r(!1)},n?(l.stop(),r(!1)):(l.start(),r(!0)))};if(s)return x.jsx(jA,{...o,tabIndex:0,"aria-label":"Voice Input Button",role:"button","data-show":!e,"data-listens":!!n,onClick:a})},Jm=M.memo(M.forwardRef(({className:e,inputRef:t,disableComposer:n,isReadOnly:r,allowFileUpload:i,disableSendButton:o,connected:s,composerPlaceholder:a,footer:l,sendMessage:u,uploadFile:f,storageKey:c,conversationId:h,children:d,...m},p)=>{const{composer:g}=ye,v=n||r||!s,[y,w]=M.useState(""),[A,k]=M.useState(-1),E=xp(h||"default"),I=bp(h||"default",c),D=E(N=>N.files),P=E(N=>N.setFiles),T=E(N=>N.deleteFile),O=E(N=>N.uploadFile),B=I(N=>N.addMessageToHistory),L=D.filter(N=>N.status==="uploaded"),F=!!y.trim()||L.length>0,R=()=>{if(o||!F)return;const N=L.map(z=>{const W=z.url,b=z.type,_=z.fileId;return{video:{type:"video",videoUrl:W,fileId:_},audio:{type:"audio",audioUrl:W,fileId:_},image:{type:"image",imageUrl:W,fileId:_}}[b]??{title:z.name,type:"file",fileUrl:W,fileId:_}})??[];y&&N.push({type:"text",text:y});let H;N.length==1?H=N[0]:H={type:"bloc",items:N.map(W=>{const{type:b,..._}=W;return{type:b,payload:_}})},w(""),u==null||u(H),P([]),B(y),k(-1)};return r?null:x.jsxs(x.Fragment,{children:[x.jsxs("div",{"data-disabled":v,"data-waiting":o,className:ar(g.container.className,e),ref:p,...m,children:[d,D.length>0&&x.jsx("div",{...g==null?void 0:g.fileContainer,children:D.map(N=>x.jsx(lM,{...N,removeFile:T},N.name))}),x.jsxs("div",{...g.inputContainer,onClick:()=>{t&&"current"in t&&t.current&&t.current.focus()},children:[i&&x.jsx(aM,{disabled:v,onFileSelected:N=>{f&&O(N,f)}}),x.jsx(CM,{inputRef:t,composerPlaceholder:a,composerDisabled:v,textInput:y,historyIndex:A,setTextInput:w,setHistoryIndex:k,sendComposerMessage:R,allowFileUpload:i,onFilePasted:N=>{f&&O(N,f)},conversationId:h,storageKey:c}),o&&x.jsx(BA,{...g.inputLoader,role:"status","data-show":o}),!v&&!o&&x.jsxs(x.Fragment,{children:[x.jsx(OA,{...g.sendbutton,role:"button",tabIndex:0,"aria-label":"Send Message Button","data-show":F,onClick:()=>R()}),x.jsx(AM,{disabled:F,setTextInput:w})]})]})]}),x.jsx(Sh,{components:{a:({node:N,...H})=>x.jsx("a",{...H,target:"_blank",rel:"noreferrer noopener"})},allowedElements:["a","strong","code","em","p","span"],...g.footer,children:l})]})}));var Cl={exports:{}},To={exports:{}},Te={};/** @license React v16.13.1
288
+ */var mO=["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])"],dl=mO.join(","),bm=typeof Element>"u",ni=bm?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,go=!bm&&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},ri=function(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"),o=i===""||i==="true",s=o||n&&t&&ri(t.parentNode);return s},gO=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},yO=function(t,n,r){if(ri(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(dl));return n&&ni.call(t,dl)&&i.unshift(t),i=i.filter(r),i},hl=function(t,n,r){for(var i=[],o=Array.from(t);o.length;){var s=o.shift();if(!ri(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,u=hl(l,!0,r);r.flatten?i.push.apply(i,u):i.push({scopeParent:s,candidates:u})}else{var f=ni.call(s,dl);f&&r.filter(s)&&(n||!t.includes(s))&&i.push(s);var c=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),h=!ri(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(c&&h){var d=hl(c===!0?s.children:c.children,!0,r);r.flatten?i.push.apply(i,d):i.push({scopeParent:s,candidates:d})}else o.unshift.apply(o,s.children)}}return i},wm=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Sm=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||gO(t))&&!wm(t)?0:t.tabIndex},vO=function(t,n){var r=Sm(t);return r<0&&n&&!wm(t)?0:r},bO=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},xm=function(t){return t.tagName==="INPUT"},wO=function(t){return xm(t)&&t.type==="hidden"},SO=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]},kO=function(t){if(!t.name)return!0;var n=t.form||go(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(s){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",s.message),!1}var o=xO(i,t.form);return!o||o===t},EO=function(t){return xm(t)&&t.type==="radio"},CO=function(t){return EO(t)&&!kO(t)},AO=function(t){var n,r=t&&go(t),i=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var s,a,l;for(o=!!((s=i)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(i)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!o&&i;){var u,f,c;r=go(i),i=(u=r)===null||u===void 0?void 0:u.host,o=!!((f=i)!==null&&f!==void 0&&(c=f.ownerDocument)!==null&&c!==void 0&&c.contains(i))}}return o},km=function(t){var n=t.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},TO=function(t,n){var r=n.displayCheck,i=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}if(getComputedStyle(t).visibility==="hidden")return!0;var s=ni.call(t,"details>summary:first-of-type"),a=s?t.parentElement:t;if(ni.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var l=t;t;){var u=t.parentElement,f=go(t);if(u&&!u.shadowRoot&&i(u)===!0)return km(t);t.assignedSlot?t=t.assignedSlot:!u&&f!==t.ownerDocument?t=f.host:t=u}t=l}if(AO(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return km(t);return!1},IO=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 ni.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},OO=function(t,n){return!(n.disabled||ri(n)||wO(n)||TO(n,t)||SO(n)||IO(n))},Em=function(t,n){return!(CO(n)||Sm(n)<0||!OO(t,n))},MO=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Cm=function(t){var n=[],r=[];return t.forEach(function(i,o){var s=!!i.scopeParent,a=s?i.scopeParent:i,l=vO(a,s),u=s?Cm(i.candidates):a;l===0?s?n.push.apply(n,u):n.push(a):r.push({documentOrder:o,tabIndex:l,item:i,isScope:s,content:u})}),r.sort(bO).reduce(function(i,o){return o.isScope?i.push.apply(i,o.content):i.push(o.content),i},[]).concat(n)},pl=function(t,n){n=n||{};var r;return n.getShadowRoot?r=hl([t],n.includeContainer,{filter:Em.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:MO}):r=yO(t,n.includeContainer,Em.bind(null,n)),Cm(r)};const ml="ArrowUp",yo="ArrowDown",ir="ArrowLeft",ii="ArrowRight";function vo(e,t,n){return Math.floor(e/t)!==n}function oi(e,t){return t<0||t>=e.current.length}function gl(e,t){return nt(e,{disabledIndices:t})}function Am(e,t){return nt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function nt(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const s=e.current;let a=n;do{var l,u;a=a+(r?-o:o)}while(a>=0&&a<=s.length-1&&(i?i.includes(a):s[a]==null||(l=s[a])!=null&&l.hasAttribute("disabled")||((u=s[a])==null?void 0:u.getAttribute("aria-disabled"))==="true"));return a}function DO(e,t){let{event:n,orientation:r,loop:i,cols:o,disabledIndices:s,minIndex:a,maxIndex:l,prevIndex:u,stopEvent:f=!1}=t,c=u;if(n.key===ml){if(f&&Je(n),u===-1)c=l;else if(c=nt(e,{startingIndex:c,amount:o,decrement:!0,disabledIndices:s}),i&&(u-o<a||c<0)){const h=u%o,d=l%o,m=l-(d-h);d===h?c=l:c=d>h?m:m-o}oi(e,c)&&(c=u)}if(n.key===yo&&(f&&Je(n),u===-1?c=a:(c=nt(e,{startingIndex:u,amount:o,disabledIndices:s}),i&&u+o>l&&(c=nt(e,{startingIndex:u%o-o,amount:o,disabledIndices:s}))),oi(e,c)&&(c=u)),r==="both"){const h=Wp(u/o);n.key===ii&&(f&&Je(n),u%o!==o-1?(c=nt(e,{startingIndex:u,disabledIndices:s}),i&&vo(c,o,h)&&(c=nt(e,{startingIndex:u-u%o-1,disabledIndices:s}))):i&&(c=nt(e,{startingIndex:u-u%o-1,disabledIndices:s})),vo(c,o,h)&&(c=u)),n.key===ir&&(f&&Je(n),u%o!==0?(c=nt(e,{startingIndex:u,disabledIndices:s,decrement:!0}),i&&vo(c,o,h)&&(c=nt(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}))):i&&(c=nt(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s})),vo(c,o,h)&&(c=u));const d=Wp(l/o)===h;oi(e,c)&&(i&&d?c=n.key===ir?l:nt(e,{startingIndex:u-u%o-1,disabledIndices:s}):c=u)}return c}let Tm=0;function Gt(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Tm);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():Tm=requestAnimationFrame(o)}var Ye=typeof document<"u"?M.useLayoutEffect:M.useEffect;function bo(){return bo=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},bo.apply(this,arguments)}let yl=!1,NO=0;const Im=()=>"floating-ui-"+NO++;function _O(){const[e,t]=A.useState(()=>yl?Im():void 0);return Ye(()=>{e==null&&t(Im())},[]),A.useEffect(()=>{yl||(yl=!0)},[]),e}const vl=A.useId||_O;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 LO=A.createContext(null),FO=A.createContext(null),Om=()=>{var e;return((e=A.useContext(LO))==null?void 0:e.id)||null},wo=()=>A.useContext(FO);function si(e){return"data-floating-ui-"+e}function dn(e){const t=M.useRef(e);return Ye(()=>{t.current=e}),t}function RO(e,t){var n;let r=[],i=(n=e.find(o=>o.id===t))==null?void 0:n.parentId;for(;i;){const o=e.find(s=>s.id===i);i=o==null?void 0:o.parentId,o&&(r=r.concat(o))}return r}function or(e,t){let n=e.filter(i=>{var o;return i.parentId===t&&((o=i.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=e.filter(i=>{var o;return(o=r)==null?void 0:o.some(s=>{var a;return i.parentId===s.id&&((a=i.context)==null?void 0:a.open)})}),n=n.concat(r);return n}function $O(e,t){let n,r=-1;function i(o,s){s>r&&(n=o,r=s),or(e,o).forEach(l=>{i(l.id,s+1)})}return i(t,0),e.find(o=>o.id===n)}let sr=new WeakMap,So=new WeakSet,xo={},bl=0;const BO=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Mm=e=>e&&(e.host||Mm(e.parentNode)),zO=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Mm(n);return e.contains(r)?r:null}).filter(n=>n!=null);function UO(e,t,n,r){const i="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,s=zO(t,e),a=new Set,l=new Set(s),u=[];xo[i]||(xo[i]=new WeakMap);const f=xo[i];s.forEach(c),h(t),a.clear();function c(d){!d||a.has(d)||(a.add(d),d.parentNode&&c(d.parentNode))}function h(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,m=>{if(a.has(m))h(m);else{const p=o?m.getAttribute(o):null,g=p!==null&&p!=="false",v=(sr.get(m)||0)+1,y=(f.get(m)||0)+1;sr.set(m,v),f.set(m,y),u.push(m),v===1&&g&&So.add(m),y===1&&m.setAttribute(i,""),!g&&o&&m.setAttribute(o,"true")}})}return bl++,()=>{u.forEach(d=>{const m=(sr.get(d)||0)-1,p=(f.get(d)||0)-1;sr.set(d,m),f.set(d,p),m||(!So.has(d)&&o&&d.removeAttribute(o),So.delete(d)),p||d.removeAttribute(i)}),bl--,bl||(sr=new WeakMap,sr=new WeakMap,So=new WeakSet,xo={})}}function Dm(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Nt(e[0]).body;return UO(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const wl=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Nm(e,t){const n=pl(e,wl());t==="prev"&&n.reverse();const r=n.indexOf(un(Nt(e)));return n.slice(r+1)[0]}function _m(){return Nm(document.body,"next")}function Pm(){return Nm(document.body,"prev")}function ai(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!ft(n,r)}function HO(e){pl(e,wl()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function jO(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 Sl={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 VO;function Lm(e){e.key==="Tab"&&(e.target,clearTimeout(VO))}const ko=A.forwardRef(function(t,n){const[r,i]=A.useState();Ye(()=>(Zp()&&i("button"),document.addEventListener("keydown",Lm),()=>{document.removeEventListener("keydown",Lm)}),[]);const o={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[si("focus-guard")]:"",style:Sl};return A.createElement("span",bo({},t,o))}),Fm=A.createContext(null);function WO(e){let{id:t,root:n}=e===void 0?{}:e;const[r,i]=A.useState(null),o=vl(),s=Rm(),a=A.useMemo(()=>({id:t,root:n,portalContext:s,uniqueId:o}),[t,n,s,o]),l=A.useRef();return Ye(()=>()=>{r==null||r.remove()},[r,a]),Ye(()=>{if(l.current===a)return;l.current=a;const{id:u,root:f,portalContext:c,uniqueId:h}=a,d=u?document.getElementById(u):null,m=si("portal");if(d){const p=document.createElement("div");p.id=h,p.setAttribute(m,""),d.appendChild(p),i(p)}else{let p=f||(c==null?void 0:c.portalNode);p&&!kt(p)&&(p=p.current),p=p||document.body;let g=null;u&&(g=document.createElement("div"),g.id=u,p.appendChild(g));const v=document.createElement("div");v.id=h,v.setAttribute(m,""),p=g||p,p.appendChild(v),i(v)}},[a]),r}function qO(e){let{children:t,id:n,root:r=null,preserveTabOrder:i=!0}=e;const o=WO({id:n,root:r}),[s,a]=A.useState(null),l=A.useRef(null),u=A.useRef(null),f=A.useRef(null),c=A.useRef(null),h=!!s&&!s.modal&&s.open&&i&&!!(r||o);return A.useEffect(()=>{if(!o||!i||s!=null&&s.modal)return;function d(m){o&&ai(m)&&(m.type==="focusin"?jO:HO)(o)}return o.addEventListener("focusin",d,!0),o.addEventListener("focusout",d,!0),()=>{o.removeEventListener("focusin",d,!0),o.removeEventListener("focusout",d,!0)}},[o,i,s==null?void 0:s.modal]),A.createElement(Fm.Provider,{value:A.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:l,afterOutsideRef:u,beforeInsideRef:f,afterInsideRef:c,portalNode:o,setFocusManagerState:a}),[i,o])},h&&o&&A.createElement(ko,{"data-type":"outside",ref:l,onFocus:d=>{if(ai(d,o)){var m;(m=f.current)==null||m.focus()}else{const p=Pm()||(s==null?void 0:s.refs.domReference.current);p==null||p.focus()}}}),h&&o&&A.createElement("span",{"aria-owns":o.id,style:Sl}),o&&$u.createPortal(t,o),h&&o&&A.createElement(ko,{"data-type":"outside",ref:u,onFocus:d=>{if(ai(d,o)){var m;(m=c.current)==null||m.focus()}else{const p=_m()||(s==null?void 0:s.refs.domReference.current);p==null||p.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1,d.nativeEvent))}}}))}const Rm=()=>A.useContext(Fm),YO=A.forwardRef(function(t,n){return A.createElement("button",bo({},t,{type:"button",ref:n,tabIndex:-1,style:Sl}))});function KO(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:o=!0,initialFocus:s=0,returnFocus:a=!0,modal:l=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:f=!0}=e,{open:c,refs:h,nodeId:d,onOpenChange:m,events:p,dataRef:g,elements:{domReference:v,floating:y}}=t,w=BO()?o:!0,C=dn(i),k=dn(s),E=dn(a),I=wo(),D=Rm(),P=typeof s=="number"&&s<0,T=A.useRef(null),O=A.useRef(null),U=A.useRef(!1),L=A.useRef(null),F=A.useRef(!1),R=D!=null,N=v&&v.getAttribute("role")==="combobox"&&em(v)&&P,j=A.useCallback(function(_){return _===void 0&&(_=y),_?pl(_,wl()):[]},[y]),z=A.useCallback(_=>{const B=j(_);return C.current.map(S=>v&&S==="reference"?v:y&&S==="floating"?y:B).filter(Boolean).flat()},[v,y,C,j]);A.useEffect(()=>{if(r||!l)return;function _(S){if(S.key==="Tab"){ft(y,un(Nt(y)))&&j().length===0&&!N&&Je(S);const W=z(),J=Xp(S);C.current[0]==="reference"&&J===v&&(Je(S),S.shiftKey?Gt(W[W.length-1]):Gt(W[1])),C.current[1]==="floating"&&J===y&&S.shiftKey&&(Je(S),Gt(W[0]))}}const B=Nt(y);return B.addEventListener("keydown",_),()=>{B.removeEventListener("keydown",_)}},[r,v,y,l,C,h,N,j,z]),A.useEffect(()=>{if(r||!f)return;function _(){F.current=!0,setTimeout(()=>{F.current=!1})}function B(S){const W=S.relatedTarget;queueMicrotask(()=>{const J=!(ft(v,W)||ft(y,W)||ft(W,y)||ft(D==null?void 0:D.portalNode,W)||W!=null&&W.hasAttribute(si("focus-guard"))||I&&(or(I.nodesRef.current,d).find(Y=>{var G,X;return ft((G=Y.context)==null?void 0:G.elements.floating,W)||ft((X=Y.context)==null?void 0:X.elements.domReference,W)})||RO(I.nodesRef.current,d).find(Y=>{var G,X;return((G=Y.context)==null?void 0:G.elements.floating)===W||((X=Y.context)==null?void 0:X.elements.domReference)===W})));W&&J&&!F.current&&W!==L.current&&(U.current=!0,m(!1,S))})}if(y&&Xn(v))return v.addEventListener("focusout",B),v.addEventListener("pointerdown",_),!l&&y.addEventListener("focusout",B),()=>{v.removeEventListener("focusout",B),v.removeEventListener("pointerdown",_),!l&&y.removeEventListener("focusout",B)}},[r,v,y,l,d,I,D,m,f]),A.useEffect(()=>{var _;if(r)return;const B=Array.from((D==null||(_=D.portalNode)==null?void 0:_.querySelectorAll("["+si("portal")+"]"))||[]);if(y){const S=[y,...B,T.current,O.current,C.current.includes("reference")||N?v:null].filter(J=>J!=null),W=l?Dm(S,w,!w):Dm(S);return()=>{W()}}},[r,v,y,l,C,D,N,w]),Ye(()=>{if(r||!y)return;const _=Nt(y),B=un(_);queueMicrotask(()=>{const S=z(y),W=k.current,J=(typeof W=="number"?S[W]:W.current)||y,Y=ft(y,B);!P&&!Y&&c&&Gt(J,{preventScroll:J===y})})},[r,c,y,P,z,k]),Ye(()=>{if(r||!y)return;let _=!1;const B=Nt(y),S=un(B),W=g.current;L.current=S;function J(Y){if(Y.type==="escapeKey"&&h.domReference.current&&(L.current=h.domReference.current),["referencePress","escapeKey"].includes(Y.type))return;const G=Y.data.returnFocus;typeof G=="object"?(U.current=!1,_=G.preventScroll):U.current=!G}return p.on("dismiss",J),()=>{p.off("dismiss",J);const Y=un(B);(ft(y,Y)||I&&or(I.nodesRef.current,d).some(X=>{var se;return ft((se=X.context)==null?void 0:se.elements.floating,Y)})||W.openEvent&&["click","mousedown"].includes(W.openEvent.type))&&h.domReference.current&&(L.current=h.domReference.current),E.current&&Xn(L.current)&&!U.current&&Gt(L.current,{cancelPrevious:!1,preventScroll:_})}},[r,y,E,g,h,p,I,d]),Ye(()=>{if(!(r||!D))return D.setFocusManagerState({modal:l,closeOnFocusOut:f,open:c,onOpenChange:m,refs:h}),()=>{D.setFocusManagerState(null)}},[r,D,l,c,m,h,f]),Ye(()=>{if(!r&&y&&typeof MutationObserver=="function"&&!P){const _=()=>{const S=y.getAttribute("tabindex");C.current.includes("floating")||un(Nt(y))!==h.domReference.current&&j().length===0?S!=="0"&&y.setAttribute("tabindex","0"):S!=="-1"&&y.setAttribute("tabindex","-1")};_();const B=new MutationObserver(_);return B.observe(y,{childList:!0,subtree:!0,attributes:!0}),()=>{B.disconnect()}}},[r,y,h,C,j,P]);function V(_){return r||!u||!l?null:A.createElement(YO,{ref:_==="start"?T:O,onClick:B=>m(!1,B.nativeEvent)},typeof u=="string"?u:"Dismiss")}const b=!r&&w&&!N&&(R||l);return A.createElement(A.Fragment,null,b&&A.createElement(ko,{"data-type":"inside",ref:D==null?void 0:D.beforeInsideRef,onFocus:_=>{if(l){const S=z();Gt(i[0]==="reference"?S[0]:S[S.length-1])}else if(D!=null&&D.preserveTabOrder&&D.portalNode)if(U.current=!1,ai(_,D.portalNode)){const S=_m()||v;S==null||S.focus()}else{var B;(B=D.beforeOutsideRef.current)==null||B.focus()}}}),!N&&V("start"),n,V("end"),b&&A.createElement(ko,{"data-type":"inside",ref:D==null?void 0:D.afterInsideRef,onFocus:_=>{if(l)Gt(z()[0]);else if(D!=null&&D.preserveTabOrder&&D.portalNode)if(f&&(U.current=!0),ai(_,D.portalNode)){const S=Pm()||v;S==null||S.focus()}else{var B;(B=D.afterOutsideRef.current)==null||B.focus()}}}))}function $m(e){return Xn(e.target)&&e.target.tagName==="BUTTON"}function Bm(e){return em(e)}function GO(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=e,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:f=!0}=t,c=A.useRef(),h=A.useRef(!1);return A.useMemo(()=>s?{reference:{onPointerDown(d){c.current=d.pointerType},onMouseDown(d){d.button===0&&(Jp(c.current)&&u||a!=="click"&&(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?r(!1,d.nativeEvent):(d.preventDefault(),r(!0,d.nativeEvent))))},onClick(d){if(a==="mousedown"&&c.current){c.current=void 0;return}Jp(c.current)&&u||(n&&l&&(!i.current.openEvent||i.current.openEvent.type==="click")?r(!1,d.nativeEvent):r(!0,d.nativeEvent))},onKeyDown(d){c.current=void 0,!(d.defaultPrevented||!f||$m(d))&&(d.key===" "&&!Bm(o)&&(d.preventDefault(),h.current=!0),d.key==="Enter"&&r(!(n&&l),d.nativeEvent))},onKeyUp(d){d.defaultPrevented||!f||$m(d)||Bm(o)||d.key===" "&&h.current&&(h.current=!1,r(!(n&&l),d.nativeEvent))}}}:{},[s,i,a,u,f,o,l,n,r])}const QO=A.useInsertionEffect||(e=>e());function hn(e){const t=A.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return QO(()=>{t.current=e}),A.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 ZO={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},JO={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},XO=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 eM(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,nodeId:o,elements:{reference:s,domReference:a,floating:l},dataRef:u}=e,{enabled:f=!0,escapeKey:c=!0,outsidePress:h=!0,outsidePressEvent:d="pointerdown",referencePress:m=!1,referencePressEvent:p="pointerdown",ancestorScroll:g=!1,bubbles:v}=t,y=wo(),w=Om()!=null,C=hn(typeof h=="function"?h:()=>!1),k=typeof h=="function"?C:h,E=A.useRef(!1),{escapeKeyBubbles:I,outsidePressBubbles:D}=XO(v),P=hn(O=>{if(!n||!f||!c||O.key!=="Escape")return;const U=y?or(y.nodesRef.current,o):[];if(!I&&(O.stopPropagation(),U.length>0)){let L=!0;if(U.forEach(F=>{var R;if((R=F.context)!=null&&R.open&&!F.context.dataRef.current.__escapeKeyBubbles){L=!1;return}}),!L)return}i.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),r(!1,bI(O)?O.nativeEvent:O)}),T=hn(O=>{const U=E.current;if(E.current=!1,U||typeof k=="function"&&!k(O))return;const L=Xp(O),F="["+si("inert")+"]",R=Nt(l).querySelectorAll(F);let N=kt(L)?L:null;for(;N&&!pI(N);){const V=gI(N);if(V===Nt(l).body||!kt(V))break;N=V}if(R.length&&kt(L)&&!wI(L)&&!ft(L,l)&&Array.from(R).every(V=>!ft(N,V)))return;if(Xn(L)&&l){const V=L.clientWidth>0&&L.scrollWidth>L.clientWidth,b=L.clientHeight>0&&L.scrollHeight>L.clientHeight;let _=b&&O.offsetX>L.clientWidth;if(b&&mI(L).direction==="rtl"&&(_=O.offsetX<=L.offsetWidth-L.clientWidth),_||V&&O.offsetY>L.clientHeight)return}const j=y&&or(y.nodesRef.current,o).some(V=>{var b;return il(O,(b=V.context)==null?void 0:b.elements.floating)});if(il(O,l)||il(O,a)||j)return;const z=y?or(y.nodesRef.current,o):[];if(z.length>0){let V=!0;if(z.forEach(b=>{var _;if((_=b.context)!=null&&_.open&&!b.context.dataRef.current.__outsidePressBubbles){V=!1;return}}),!V)return}i.emit("dismiss",{type:"outsidePress",data:{returnFocus:w?{preventScroll:!0}:Gp(O)||Qp(O)}}),r(!1,O)});return A.useEffect(()=>{if(!n||!f)return;u.current.__escapeKeyBubbles=I,u.current.__outsidePressBubbles=D;function O(F){r(!1,F)}const U=Nt(l);c&&U.addEventListener("keydown",P),k&&U.addEventListener(d,T);let L=[];return g&&(kt(a)&&(L=fn(a)),kt(l)&&(L=L.concat(fn(l))),!kt(s)&&s&&s.contextElement&&(L=L.concat(fn(s.contextElement)))),L=L.filter(F=>{var R;return F!==((R=U.defaultView)==null?void 0:R.visualViewport)}),L.forEach(F=>{F.addEventListener("scroll",O,{passive:!0})}),()=>{c&&U.removeEventListener("keydown",P),k&&U.removeEventListener(d,T),L.forEach(F=>{F.removeEventListener("scroll",O)})}},[u,l,a,s,c,k,d,n,r,g,f,I,D,P,T]),A.useEffect(()=>{E.current=!1},[k,d]),A.useMemo(()=>f?{reference:{onKeyDown:P,[ZO[p]]:O=>{m&&(i.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),r(!1,O.nativeEvent))}},floating:{onKeyDown:P,[JO[d]]:()=>{E.current=!0}}}:{},[f,i,m,d,p,r,P])}let xl;process.env.NODE_ENV!=="production"&&(xl=new Set);function tM(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:i}=e;if(process.env.NODE_ENV!=="production"){var o;const I="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((o=e.elements)!=null&&o.reference&&!kt(e.elements.reference)){var s;if(!((s=xl)!=null&&s.has(I))){var a;(a=xl)==null||a.add(I),console.error(I)}}}const[l,u]=A.useState(null),f=((t=e.elements)==null?void 0:t.reference)||l,c=fO(e),h=wo(),d=hn((I,D)=>{I&&(p.current.openEvent=D),r==null||r(I,D)}),m=A.useRef(null),p=A.useRef({}),g=A.useState(()=>PO())[0],v=vl(),y=A.useCallback(I=>{const D=kt(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),contextElement:I}:I;c.refs.setReference(D)},[c.refs]),w=A.useCallback(I=>{(kt(I)||I===null)&&(m.current=I,u(I)),(kt(c.refs.reference.current)||c.refs.reference.current===null||I!==null&&!kt(I))&&c.refs.setReference(I)},[c.refs]),C=A.useMemo(()=>({...c.refs,setReference:w,setPositionReference:y,domReference:m}),[c.refs,w,y]),k=A.useMemo(()=>({...c.elements,domReference:f}),[c.elements,f]),E=A.useMemo(()=>({...c,refs:C,elements:k,dataRef:p,nodeId:i,floatingId:v,events:g,open:n,onOpenChange:d}),[c,i,v,g,n,d,C,k]);return Ye(()=>{const I=h==null?void 0:h.nodesRef.current.find(D=>D.id===i);I&&(I.context=E)}),A.useMemo(()=>({...c,context:E,refs:C,elements:k}),[c,C,k,E])}function kl(e,t,n){const r=new Map;return{...n==="floating"&&{tabIndex:-1},...e,...t.map(i=>i?i[n]:null).concat(e).reduce((i,o)=>(o&&Object.entries(o).forEach(s=>{let[a,l]=s;if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof l=="function"){var u;(u=r.get(a))==null||u.push(l),i[a]=function(){for(var f,c=arguments.length,h=new Array(c),d=0;d<c;d++)h[d]=arguments[d];return(f=r.get(a))==null?void 0:f.map(m=>m(...h)).find(m=>m!==void 0)}}}else i[a]=l}),i),{})}}function nM(e){e===void 0&&(e=[]);const t=e,n=A.useCallback(o=>kl(o,e,"reference"),t),r=A.useCallback(o=>kl(o,e,"floating"),t),i=A.useCallback(o=>kl(o,e,"item"),e.map(o=>o==null?void 0:o.item));return A.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:i}),[n,r,i])}let zm=!1;function Eo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Um(e,t){return Eo(t,e===ml||e===yo,e===ir||e===ii)}function El(e,t,n){return Eo(t,e===yo,n?e===ir:e===ii)||e==="Enter"||e==" "||e===""}function rM(e,t,n){return Eo(t,n?e===ir:e===ii,e===yo)}function Hm(e,t,n){return Eo(t,n?e===ii:e===ir,e===ml)}function iM(e,t){const{open:n,onOpenChange:r,refs:i,elements:{domReference:o,floating:s}}=e,{listRef:a,activeIndex:l,onNavigate:u=()=>{},enabled:f=!0,selectedIndex:c=null,allowEscape:h=!1,loop:d=!1,nested:m=!1,rtl:p=!1,virtual:g=!1,focusItemOnOpen:v="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:w=!0,disabledIndices:C=void 0,orientation:k="vertical",cols:E=1,scrollItemIntoView:I=!0,virtualItemRef:D}=t;process.env.NODE_ENV!=="production"&&(h&&(d||console.warn(["Floating UI: `useListNavigation` looping must be enabled to allow","escaping."].join(" ")),g||console.warn(["Floating UI: `useListNavigation` must be virtual to allow","escaping."].join(" "))),k==="vertical"&&E>1&&console.warn(["Floating UI: In grid list navigation mode (`cols` > 1), the",'`orientation` should be either "horizontal" or "both".'].join(" ")));const P=Om(),T=wo(),O=hn(u),U=A.useRef(v),L=A.useRef(c??-1),F=A.useRef(null),R=A.useRef(!0),N=A.useRef(O),j=A.useRef(!!s),z=A.useRef(!1),V=A.useRef(!1),b=dn(C),_=dn(n),B=dn(I),[S,W]=A.useState(),[J,Y]=A.useState(),G=hn(function(K,te,$){$===void 0&&($=!1);const ne=K.current[te.current];ne&&(g?(W(ne.id),T==null||T.events.emit("virtualfocus",ne),D&&(D.current=ne)):Gt(ne,{preventScroll:!0,sync:vI()&&Zp()?zm||z.current:!1}),requestAnimationFrame(()=>{const me=B.current;me&&ne&&($||!R.current)&&(ne.scrollIntoView==null||ne.scrollIntoView(typeof me=="boolean"?{block:"nearest",inline:"nearest"}:me))}))});Ye(()=>{document.createElement("div").focus({get preventScroll(){return zm=!0,!1}})},[]),Ye(()=>{f&&(n&&s?U.current&&c!=null&&(V.current=!0,O(c)):j.current&&(L.current=-1,N.current(null)))},[f,n,s,c,O]),Ye(()=>{if(f&&n&&s)if(l==null){if(z.current=!1,c!=null)return;if(j.current&&(L.current=-1,G(a,L)),!j.current&&U.current&&(F.current!=null||U.current===!0&&F.current==null)){let K=0;const te=()=>{a.current[0]==null?(K<2&&(K?requestAnimationFrame:queueMicrotask)(te),K++):(L.current=F.current==null||El(F.current,k,p)||m?gl(a,b.current):Am(a,b.current),F.current=null,O(L.current))};te()}}else oi(a,l)||(L.current=l,G(a,L,V.current),V.current=!1)},[f,n,s,l,c,m,a,k,p,O,G,b]),Ye(()=>{var K,te;if(!f||s||!T||g||!j.current)return;const $=T.nodesRef.current,ne=(K=$.find(Z=>Z.id===P))==null||(te=K.context)==null?void 0:te.elements.floating,me=un(Nt(s)),Oe=$.some(Z=>Z.context&&ft(Z.context.elements.floating,me));ne&&!Oe&&R.current&&ne.focus({preventScroll:!0})},[f,s,T,P,g]),Ye(()=>{if(!f||!T||!g||P)return;function K(te){Y(te.id),D&&(D.current=te)}return T.events.on("virtualfocus",K),()=>{T.events.off("virtualfocus",K)}},[f,T,g,P,D]),Ye(()=>{N.current=O,j.current=!!s}),Ye(()=>{n||(F.current=null)},[n]);const X=l!=null,se=A.useMemo(()=>{function K($){if(!n)return;const ne=a.current.indexOf($);ne!==-1&&O(ne)}return{onFocus($){let{currentTarget:ne}=$;K(ne)},onClick:$=>{let{currentTarget:ne}=$;return ne.focus({preventScroll:!0})},...y&&{onMouseMove($){let{currentTarget:ne}=$;K(ne)},onPointerLeave($){let{pointerType:ne}=$;!R.current||ne==="touch"||(L.current=-1,G(a,L),O(null),g||Gt(i.floating.current,{preventScroll:!0}))}}}},[n,i,G,y,a,O,g]);return A.useMemo(()=>{if(!f)return{};const K=b.current;function te(Z){if(R.current=!1,z.current=!0,!_.current&&Z.currentTarget===i.floating.current)return;if(m&&Hm(Z.key,k,p)){Je(Z),r(!1,Z.nativeEvent),Xn(o)&&!g&&o.focus();return}const ue=L.current,de=gl(a,K),fe=Am(a,K);if(Z.key==="Home"&&(Je(Z),L.current=de,O(L.current)),Z.key==="End"&&(Je(Z),L.current=fe,O(L.current)),!(E>1&&(L.current=DO(a,{event:Z,orientation:k,loop:d,cols:E,disabledIndices:K,minIndex:de,maxIndex:fe,prevIndex:L.current,stopEvent:!0}),O(L.current),k==="both"))&&Um(Z.key,k)){if(Je(Z),n&&!g&&un(Z.currentTarget.ownerDocument)===Z.currentTarget){L.current=El(Z.key,k,p)?de:fe,O(L.current);return}El(Z.key,k,p)?d?L.current=ue>=fe?h&&ue!==a.current.length?-1:de:nt(a,{startingIndex:ue,disabledIndices:K}):L.current=Math.min(fe,nt(a,{startingIndex:ue,disabledIndices:K})):d?L.current=ue<=de?h&&ue!==-1?a.current.length:fe:nt(a,{startingIndex:ue,decrement:!0,disabledIndices:K}):L.current=Math.max(de,nt(a,{startingIndex:ue,decrement:!0,disabledIndices:K})),oi(a,L.current)?O(null):O(L.current)}}function $(Z){v==="auto"&&Gp(Z.nativeEvent)&&(U.current=!0)}function ne(Z){U.current=v,v==="auto"&&Qp(Z.nativeEvent)&&(U.current=!0)}const me=g&&n&&X&&{"aria-activedescendant":J||S},Oe=a.current.find(Z=>(Z==null?void 0:Z.id)===S);return{reference:{...me,onKeyDown(Z){R.current=!1;const ue=Z.key.indexOf("Arrow")===0,de=rM(Z.key,k,p),fe=Hm(Z.key,k,p),Ae=Um(Z.key,k),Fe=(m?de:Ae)||Z.key==="Enter"||Z.key.trim()==="";if(g&&n){const ae=T==null?void 0:T.nodesRef.current.find(q=>q.parentId==null),H=T&&ae?$O(T.nodesRef.current,ae.id):null;if(ue&&H&&D){const q=new KeyboardEvent("keydown",{key:Z.key,bubbles:!0});if(de||fe){var Me,He;const oe=((Me=H.context)==null?void 0:Me.elements.domReference)===Z.currentTarget,le=fe&&!oe?(He=H.context)==null?void 0:He.elements.domReference:de?Oe:null;le&&(Je(Z),le.dispatchEvent(q),Y(void 0))}if(Ae&&H.context&&H.context.open&&H.parentId&&Z.currentTarget!==H.context.elements.domReference){var ee;Je(Z),(ee=H.context.elements.domReference)==null||ee.dispatchEvent(q);return}}return te(Z)}if(!(!n&&!w&&ue)){if(Fe&&(F.current=m&&Ae?null:Z.key),m){de&&(Je(Z),n?(L.current=gl(a,K),O(L.current)):r(!0,Z.nativeEvent));return}Ae&&(c!=null&&(L.current=c),Je(Z),!n&&w?r(!0,Z.nativeEvent):te(Z),n&&O(L.current))}},onFocus(){n&&O(null)},onPointerDown:ne,onMouseDown:$,onClick:$},floating:{"aria-orientation":k==="both"?void 0:k,...me,onKeyDown:te,onPointerMove(){R.current=!0}},item:se}},[o,i,S,J,b,_,a,f,k,p,g,n,X,m,c,w,h,E,d,v,O,r,se,T,D])}function oM(e,t){t===void 0&&(t={});const{open:n,floatingId:r}=e,{enabled:i=!0,role:o="dialog"}=t,s=vl();return A.useMemo(()=>{const a={id:r,role:o};return i?o==="tooltip"?{reference:{"aria-describedby":n?r:void 0},floating:a}:{reference:{"aria-expanded":n?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":n?r:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:s}},floating:{...a,...o==="menu"&&{"aria-labelledby":s}}}:{}},[i,o,n,r,s])}function sM(e,t){var n;const{open:r,dataRef:i}=e,{listRef:o,activeIndex:s,onMatch:a,onTypingChange:l,enabled:u=!0,findMatch:f=null,resetMs:c=750,ignoreKeys:h=[],selectedIndex:d=null}=t,m=A.useRef(),p=A.useRef(""),g=A.useRef((n=d??s)!=null?n:-1),v=A.useRef(null),y=hn(a),w=hn(l),C=dn(f),k=dn(h);return Ye(()=>{r&&(clearTimeout(m.current),v.current=null,p.current="")},[r]),Ye(()=>{if(r&&p.current===""){var E;g.current=(E=d??s)!=null?E:-1}},[r,d,s]),A.useMemo(()=>{if(!u)return{};function E(P){P?i.current.typing||(i.current.typing=P,w(P)):i.current.typing&&(i.current.typing=P,w(P))}function I(P,T,O){const U=C.current?C.current(T,O):T.find(L=>(L==null?void 0:L.toLocaleLowerCase().indexOf(O.toLocaleLowerCase()))===0);return U?P.indexOf(U):-1}function D(P){const T=o.current;if(p.current.length>0&&p.current[0]!==" "&&(I(T,T,p.current)===-1?E(!1):P.key===" "&&Je(P)),T==null||k.current.includes(P.key)||P.key.length!==1||P.ctrlKey||P.metaKey||P.altKey)return;r&&P.key!==" "&&(Je(P),E(!0)),T.every(F=>{var R,N;return F?((R=F[0])==null?void 0:R.toLocaleLowerCase())!==((N=F[1])==null?void 0:N.toLocaleLowerCase()):!0})&&p.current===P.key&&(p.current="",g.current=v.current),p.current+=P.key,clearTimeout(m.current),m.current=setTimeout(()=>{p.current="",g.current=v.current,E(!1)},c);const U=g.current,L=I(T,[...T.slice((U||0)+1),...T.slice(0,(U||0)+1)],p.current);L!==-1?(y(L),v.current=L):P.key!==" "&&(p.current="",E(!1))}return{reference:{onKeyDown:D},floating:{onKeyDown:D,onKeyUp(P){P.key===" "&&E(!1)}}}},[u,r,i,o,c,k,C,y,w])}const aM=({options:e,reusable:t,sendMessage:n,isReadOnly:r})=>{var R,N,j,z,V;const i=Qn(b=>b.messageContainerRef),o=Qn(b=>b.portalContainer),[s,a]=A.useState(!1),[l,u]=A.useState(null),[f,c]=A.useState(null),{message:{blocks:{dropdown:h}}}=ye,d=e.reduce((b,_)=>(b[_.label]=_.value,b),{}),m=d?Object.keys(d):[],p=b=>{a(f!==null&&!t?!1:b)},{refs:g,floatingStyles:v,context:y}=tM({placement:"bottom-start",open:s,onOpenChange:p,whileElementsMounted:iO,middleware:[dO(5),hO({padding:10,boundary:(i==null?void 0:i.current)??void 0,crossAxis:!0}),pO({apply({rects:b,elements:_,availableHeight:B}){Object.assign(_.floating.style,{maxHeight:`${B}px`,minWidth:`${b.reference.width}px`})},padding:10})]}),w=A.useRef([]),C=A.useRef(m),k=A.useRef(!1),E=GO(y,{event:"mousedown"}),I=eM(y),D=oM(y,{role:"listbox"}),P=iM(y,{listRef:w,activeIndex:l,selectedIndex:f,onNavigate:u,loop:!0}),T=sM(y,{listRef:C,activeIndex:l,selectedIndex:f,onMatch:s?u:c,onTypingChange(b){k.current=b}}),{getReferenceProps:O,getFloatingProps:U,getItemProps:L}=nM([I,D,P,T,E]),F=b=>{c(b),m[b]!==void 0&&(n==null||n({type:"text",text:m[b]??"",value:d[m[b]]??""})),a(!1)};return x.jsxs(x.Fragment,{children:[x.jsxs("div",{tabIndex:0,ref:g.setReference,"aria-labelledby":"select-label","aria-autocomplete":"none","data-disabled":f!==null&&!t?"":void 0,style:r?{pointerEvents:"none"}:void 0,...(R=h.button)==null?void 0:R.container,...O(),children:[x.jsx("span",{...(N=h.button)==null?void 0:N.text,children:f?m[f]:"Select..."}),x.jsx(NA,{...(j=h.button)==null?void 0:j.icon})]}),s&&x.jsx(qO,{root:o??void 0,children:x.jsx(KO,{context:y,modal:!1,children:x.jsx("div",{ref:g.setFloating,className:(V=(z=h.content)==null?void 0:z.container)==null?void 0:V.className,style:{...v,pointerEvents:"auto"},...U(),children:m.map((b,_)=>{var B;return x.jsx("div",{ref:S=>{w.current[_]=S},role:"option",tabIndex:_===l?0:-1,"aria-selected":_===f&&_===l,"data-active":_===l?"":void 0,...(B=h.content)==null?void 0:B.item,...L({onClick(){F(_)},onKeyDown(S){S.key==="Enter"&&(S.preventDefault(),F(_)),S.key===" "&&!k.current&&(S.preventDefault(),F(_))}}),children:b},b)})})})})]})},jm=M.forwardRef(({title:e,url:t,isReadOnly:n,...r},i)=>{const{message:{blocks:{file:o}}}=ye;return x.jsxs("a",{...r,...o.container,href:t,style:n?{pointerEvents:"none"}:void 0,download:!0,ref:i,target:"_blank",rel:"noreferrer",children:[x.jsx("p",{...o.title,children:e||t}),x.jsx(FA,{...o.icon})]})});jm.displayName="File";const lM=ln()((e,t)=>({components:{},getCustomComponent:async n=>{const r=t().components[n];if(r)return r;const i=await fetch(n).then(u=>u.text()),o=new Blob([i],{type:"application/javascript"}),a=await import(URL.createObjectURL(o)),l=()=>a.default;return e(u=>({components:{...u.components,[n]:l}})),l}}));globalThis.React=M;const Vm={audio:_p,bubble:Tp,button:TT,carousel:Vp,column:Lp,dropdown:aM,file:jm,image:Dp,location:Pp,row:Fp,text:iT,video:Np,custom:({url:e,name:t,data:n,...r})=>{const i=lM(u=>u.getCustomComponent),[o,s]=M.useState(null),[a,l]=M.useState(null);return M.useEffect(()=>{i(e).then(s).catch(u=>{l(u.message)})},[e]),a?x.jsx("div",{style:{color:"red"},children:a}):o?x.jsx(o,{...n,...r}):null}},Dn=({block:e,renderers:t,...n})=>{const r=(t==null?void 0:t[e.type])??Vm[e.type],i={...n,...e};return x.jsx(r,{...i})};function Wm(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Wm(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ar(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Wm(e))&&(r&&(r+=" "),r+=t);return r}const uM=({disabled:e,onFileSelected:t})=>{const n=M.useRef(null),{uploadButton:r}=ye.composer,i=()=>{n.current&&n.current.click()},o=s=>{const a=s.target.files;a&&a.length>0&&Array.from(a).forEach(l=>{t(l)})};return x.jsxs(x.Fragment,{children:[x.jsx(YA,{...r,role:"button",tabIndex:0,"aria-label":"Upload File Button","data-disabled":e,onClick:i}),x.jsx("input",{value:"",multiple:!0,type:"file",ref:n,style:{display:"none"},onChange:o})]})},cM=({name:e,type:t,instance:n,status:r,removeFile:i})=>{const{loader:o,fileIcon:s,removeIcon:a,errorIcon:l,previewImage:u}=ye.composer.fileWidget,f=["PNG","JPEG","JPG"].includes(Ao(n.name));return r==="loading"?x.jsx(Co,{name:e,status:r,removeButton:x.jsx("div",{...o}),extension:Ao(n.name),children:x.jsx("div",{...s.container,children:x.jsx(Cl,{type:t,...s.icon})})}):r==="error"?x.jsx(Co,{name:e,status:r,removeButton:x.jsx(qm,{removeFile:()=>i(e)}),extension:"Upload Error",children:x.jsxs("div",{...s.container,children:[x.jsx(_A,{...l}),x.jsx(Cl,{type:t,...s.icon})]})}):r=="uploaded"&&f?x.jsx(Co,{name:e,status:r,removeButton:x.jsx(qm,{removeFile:()=>i(e)}),extension:Ao(n.name),children:x.jsx("div",{...s.container,children:x.jsx("img",{src:URL.createObjectURL(n),alt:e,...u})})}):x.jsx(Co,{name:e,status:r,removeButton:x.jsx(ap,{onClick:()=>i(e),...a}),extension:Ao(n.name),children:x.jsx("div",{...s.container,children:x.jsx(Cl,{type:t,...s.icon})})})},Co=({name:e,status:t,removeButton:n,children:r,extension:i})=>{const{container:o,metadata:s}=ye.composer.fileWidget;return x.jsxs("div",{"data-status":t,title:e,...o,children:[n,r,x.jsxs("div",{...s.container,children:[x.jsx("div",{...s.name,children:e}),x.jsx("div",{...s.type,children:i})]})]})},Cl=({type:e,...t})=>e==="image"?x.jsx(BA,{...t}):e==="video"?x.jsx(eT,{...t}):e==="audio"?x.jsx(cp,{...t}):x.jsx(lp,{...t}),Ao=e=>{if(!e)return"File";const t=e.split(".").pop();return t?t.toUpperCase():"File"},qm=({removeFile:e})=>{const{composer:{fileWidget:{removeIcon:t}}}=ye;return x.jsx(ap,{role:"button",tabIndex:0,"aria-label":"Remove File Button",onClick:()=>e(),...t})};function Al(){return Al=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Al.apply(null,arguments)}function fM(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var dM=M.useLayoutEffect,hM=function(t){var n=M.useRef(t);return dM(function(){n.current=t}),n},Ym=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},pM=function(t,n){var r=M.useRef();return M.useCallback(function(i){t.current=i,r.current&&Ym(r.current,null),r.current=n,n&&Ym(n,i)},[n])},Km={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},mM=function(t){Object.keys(Km).forEach(function(n){t.style.setProperty(n,Km[n],"important")})},Gm=mM,st=null,Qm=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function gM(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),st||(st=document.createElement("textarea"),st.setAttribute("tabindex","-1"),st.setAttribute("aria-hidden","true"),Gm(st)),st.parentNode===null&&document.body.appendChild(st);var i=e.paddingSize,o=e.borderSize,s=e.sizingStyle,a=s.boxSizing;Object.keys(s).forEach(function(h){var d=h;st.style[d]=s[d]}),Gm(st),st.value=t;var l=Qm(st,e);st.value=t,l=Qm(st,e),st.value="x";var u=st.scrollHeight-i,f=u*n;a==="border-box"&&(f=f+i+o),l=Math.max(f,l);var c=u*r;return a==="border-box"&&(c=c+i+o),l=Math.min(c,l),[l,u]}var Zm=function(){},yM=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},vM=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],bM=!!document.documentElement.currentStyle,wM=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=yM(vM,n),i=r.boxSizing;if(i==="")return null;bM&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var o=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),s=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:o,borderSize:s}},SM=wM;function Jm(e,t,n){var r=hM(n);A.useLayoutEffect(function(){var i=function(s){return r.current(s)};if(e)return e.addEventListener(t,i),function(){return e.removeEventListener(t,i)}},[])}var xM=function(t){Jm(window,"resize",t)},kM=function(t){Jm(document.fonts,"loadingdone",t)},EM=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],CM=function(t,n){var r=t.cacheMeasurements,i=t.maxRows,o=t.minRows,s=t.onChange,a=s===void 0?Zm:s,l=t.onHeightChange,u=l===void 0?Zm:l,f=fM(t,EM),c=f.value!==void 0,h=A.useRef(null),d=pM(h,n),m=A.useRef(0),p=A.useRef(),g=function(){var w=h.current,C=r&&p.current?p.current:SM(w);if(C){p.current=C;var k=gM(C,w.value||w.placeholder||"x",o,i),E=k[0],I=k[1];m.current!==E&&(m.current=E,w.style.setProperty("height",E+"px","important"),u(E,{rowHeight:I}))}},v=function(w){c||g(),a(w)};return A.useLayoutEffect(g),xM(g),kM(g),A.createElement("textarea",Al({},f,{onChange:v,ref:d}))},AM=A.forwardRef(CM);const TM=({inputRef:e,composerPlaceholder:t,composerDisabled:n,textInput:r,historyIndex:i,setTextInput:o,setHistoryIndex:s,sendComposerMessage:a,allowFileUpload:l,onFilePasted:u,conversationId:f,storageKey:c})=>{const d=Sp(f||"default",c)(C=>C.messageHistory),[m,p]=M.useState(""),[g,v]=M.useState(!1),{input:y}=ye.composer,w=C=>{if(!l||!u||!C.clipboardData)return;const k=Array.from(C.clipboardData.files);k.length>0&&(C.preventDefault(),k.forEach(E=>{u(E)}))};return x.jsx(AM,{...y,"aria-label":"Message Input",ref:e,placeholder:t??"Type your message...",disabled:n,value:r,"data-has-value":!!r,onChange:C=>{const k=C.target.value;o(k),d.includes(k)||s(-1)},onPaste:w,maxRows:5,onKeyDown:C=>{if(n)return;const k=C.nativeEvent;if(!(k.isComposing||k.keyCode===229)&&(r.length===0&&v(!1),C.key!=="ArrowUp"&&C.key!=="ArrowDown"&&C.key!=="ArrowLeft"&&C.key!=="ArrowRight"&&v(!0),C.key==="Enter"&&C.shiftKey?(C.preventDefault(),o(`${r}
289
+ `)):C.key==="Enter"&&(C.preventDefault(),a()),!(r.length>0&&g))){if(C.key==="ArrowUp"){C.preventDefault(),i===-1&&r.trim()!==""&&p(r);const E=Math.min(i+1,d.length-1);s(E),o(d[E]??"")}if(C.key==="ArrowDown"){C.preventDefault();const E=Math.max(i-1,-1);o(i===-1?r.trim():E===-1?m:d[E]??""),s(E)}}}})},IM=({disabled:e,setTextInput:t})=>{const[n,r]=M.useState(!1),i=M.useRef(null),{voiceButton:o}=ye.composer,s=window.SpeechRecognition||window.webkitSpeechRecognition,a=()=>{i.current||(i.current=new s);const l=i.current;l&&(l.continuous=!0,l.onresult=u=>{var c,h,d;const f=((d=(h=(c=u.results)==null?void 0:c[0])==null?void 0:h[0])==null?void 0:d.transcript)??"";t(f??""),l.stop(),r(!1)},n?(l.stop(),r(!1)):(l.start(),r(!0)))};if(s)return x.jsx(VA,{...o,tabIndex:0,"aria-label":"Voice Input Button",role:"button","data-show":!e,"data-listens":!!n,onClick:a})},Xm=M.memo(M.forwardRef(({className:e,inputRef:t,disableComposer:n,isReadOnly:r,allowFileUpload:i,disableSendButton:o,connected:s,composerPlaceholder:a,footer:l,sendMessage:u,uploadFile:f,storageKey:c,conversationId:h,children:d,...m},p)=>{const{composer:g}=ye,v=n||r||!s,[y,w]=M.useState(""),[C,k]=M.useState(-1),E=Ep(h||"default"),I=Sp(h||"default",c),D=E(N=>N.files),P=E(N=>N.setFiles),T=E(N=>N.deleteFile),O=E(N=>N.uploadFile),U=I(N=>N.addMessageToHistory),L=D.filter(N=>N.status==="uploaded"),F=!!y.trim()||L.length>0,R=()=>{if(o||!F)return;const N=L.map(z=>{const V=z.url,b=z.type,_=z.fileId;return{video:{type:"video",videoUrl:V,fileId:_},audio:{type:"audio",audioUrl:V,fileId:_},image:{type:"image",imageUrl:V,fileId:_}}[b]??{title:z.name,type:"file",fileUrl:V,fileId:_}})??[];y&&N.push({type:"text",text:y});let j;N.length==1?j=N[0]:j={type:"bloc",items:N.map(V=>{const{type:b,..._}=V;return{type:b,payload:_}})},w(""),u==null||u(j),P([]),U(y),k(-1)};return r?null:x.jsxs(x.Fragment,{children:[x.jsxs("div",{"data-disabled":v,"data-waiting":o,className:ar(g.container.className,e),ref:p,...m,children:[d,D.length>0&&x.jsx("div",{...g==null?void 0:g.fileContainer,children:D.map(N=>x.jsx(cM,{...N,removeFile:T},N.name))}),x.jsxs("div",{...g.inputContainer,onClick:()=>{t&&"current"in t&&t.current&&t.current.focus()},children:[i&&x.jsx(uM,{disabled:v,onFileSelected:N=>{f&&O(N,f)}}),x.jsx(TM,{inputRef:t,composerPlaceholder:a,composerDisabled:v,textInput:y,historyIndex:C,setTextInput:w,setHistoryIndex:k,sendComposerMessage:R,allowFileUpload:i,onFilePasted:N=>{f&&O(N,f)},conversationId:h,storageKey:c}),o&&x.jsx(zA,{...g.inputLoader,role:"status","data-show":o}),!v&&!o&&x.jsxs(x.Fragment,{children:[x.jsx(MA,{...g.sendbutton,role:"button",tabIndex:0,"aria-label":"Send Message Button","data-show":F,onClick:()=>R()}),x.jsx(IM,{disabled:F,setTextInput:w})]})]})]}),x.jsx(kh,{components:{a:({node:N,...j})=>x.jsx("a",{...j,target:"_blank",rel:"noreferrer noopener"})},allowedElements:["a","strong","code","em","p","span"],...g.footer,children:l})]})}));var Tl={exports:{}},To={exports:{}},Te={};/** @license React v16.13.1
290
290
  * react-is.production.min.js
291
291
  *
292
292
  * Copyright (c) Facebook, Inc. and its affiliates.
293
293
  *
294
294
  * This source code is licensed under the MIT license found in the
295
295
  * LICENSE file in the root directory of this source tree.
296
- */var Xm;function TM(){if(Xm)return Te;Xm=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,c=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function w(k){if(typeof k=="object"&&k!==null){var E=k.$$typeof;switch(E){case t:switch(k=k.type,k){case l:case u:case r:case o:case i:case c:return k;default:switch(k=k&&k.$$typeof,k){case a:case f:case m:case d:case s:return k;default:return E}}case n:return E}}}function A(k){return w(k)===u}return Te.AsyncMode=l,Te.ConcurrentMode=u,Te.ContextConsumer=a,Te.ContextProvider=s,Te.Element=t,Te.ForwardRef=f,Te.Fragment=r,Te.Lazy=m,Te.Memo=d,Te.Portal=n,Te.Profiler=o,Te.StrictMode=i,Te.Suspense=c,Te.isAsyncMode=function(k){return A(k)||w(k)===l},Te.isConcurrentMode=A,Te.isContextConsumer=function(k){return w(k)===a},Te.isContextProvider=function(k){return w(k)===s},Te.isElement=function(k){return typeof k=="object"&&k!==null&&k.$$typeof===t},Te.isForwardRef=function(k){return w(k)===f},Te.isFragment=function(k){return w(k)===r},Te.isLazy=function(k){return w(k)===m},Te.isMemo=function(k){return w(k)===d},Te.isPortal=function(k){return w(k)===n},Te.isProfiler=function(k){return w(k)===o},Te.isStrictMode=function(k){return w(k)===i},Te.isSuspense=function(k){return w(k)===c},Te.isValidElementType=function(k){return typeof k=="string"||typeof k=="function"||k===r||k===u||k===o||k===i||k===c||k===h||typeof k=="object"&&k!==null&&(k.$$typeof===m||k.$$typeof===d||k.$$typeof===s||k.$$typeof===a||k.$$typeof===f||k.$$typeof===g||k.$$typeof===v||k.$$typeof===y||k.$$typeof===p)},Te.typeOf=w,Te}var Ie={};/** @license React v16.13.1
296
+ */var eg;function OM(){if(eg)return Te;eg=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,c=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function w(k){if(typeof k=="object"&&k!==null){var E=k.$$typeof;switch(E){case t:switch(k=k.type,k){case l:case u:case r:case o:case i:case c:return k;default:switch(k=k&&k.$$typeof,k){case a:case f:case m:case d:case s:return k;default:return E}}case n:return E}}}function C(k){return w(k)===u}return Te.AsyncMode=l,Te.ConcurrentMode=u,Te.ContextConsumer=a,Te.ContextProvider=s,Te.Element=t,Te.ForwardRef=f,Te.Fragment=r,Te.Lazy=m,Te.Memo=d,Te.Portal=n,Te.Profiler=o,Te.StrictMode=i,Te.Suspense=c,Te.isAsyncMode=function(k){return C(k)||w(k)===l},Te.isConcurrentMode=C,Te.isContextConsumer=function(k){return w(k)===a},Te.isContextProvider=function(k){return w(k)===s},Te.isElement=function(k){return typeof k=="object"&&k!==null&&k.$$typeof===t},Te.isForwardRef=function(k){return w(k)===f},Te.isFragment=function(k){return w(k)===r},Te.isLazy=function(k){return w(k)===m},Te.isMemo=function(k){return w(k)===d},Te.isPortal=function(k){return w(k)===n},Te.isProfiler=function(k){return w(k)===o},Te.isStrictMode=function(k){return w(k)===i},Te.isSuspense=function(k){return w(k)===c},Te.isValidElementType=function(k){return typeof k=="string"||typeof k=="function"||k===r||k===u||k===o||k===i||k===c||k===h||typeof k=="object"&&k!==null&&(k.$$typeof===m||k.$$typeof===d||k.$$typeof===s||k.$$typeof===a||k.$$typeof===f||k.$$typeof===g||k.$$typeof===v||k.$$typeof===y||k.$$typeof===p)},Te.typeOf=w,Te}var Ie={};/** @license React v16.13.1
297
297
  * react-is.development.js
298
298
  *
299
299
  * Copyright (c) Facebook, Inc. and its affiliates.
300
300
  *
301
301
  * This source code is licensed under the MIT license found in the
302
302
  * LICENSE file in the root directory of this source tree.
303
- */var eg;function IM(){return eg||(eg=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,c=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function w($){return typeof $=="string"||typeof $=="function"||$===r||$===u||$===o||$===i||$===c||$===h||typeof $=="object"&&$!==null&&($.$$typeof===m||$.$$typeof===d||$.$$typeof===s||$.$$typeof===a||$.$$typeof===f||$.$$typeof===g||$.$$typeof===v||$.$$typeof===y||$.$$typeof===p)}function A($){if(typeof $=="object"&&$!==null){var ne=$.$$typeof;switch(ne){case t:var me=$.type;switch(me){case l:case u:case r:case o:case i:case c:return me;default:var Oe=me&&me.$$typeof;switch(Oe){case a:case f:case m:case d:case s:return Oe;default:return ne}}case n:return ne}}}var k=l,E=u,I=a,D=s,P=t,T=f,O=r,B=m,L=d,F=n,R=o,N=i,H=c,z=!1;function W($){return z||(z=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),b($)||A($)===l}function b($){return A($)===u}function _($){return A($)===a}function j($){return A($)===s}function S($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function V($){return A($)===f}function Y($){return A($)===r}function q($){return A($)===m}function Q($){return A($)===d}function X($){return A($)===n}function se($){return A($)===o}function G($){return A($)===i}function te($){return A($)===c}Ie.AsyncMode=k,Ie.ConcurrentMode=E,Ie.ContextConsumer=I,Ie.ContextProvider=D,Ie.Element=P,Ie.ForwardRef=T,Ie.Fragment=O,Ie.Lazy=B,Ie.Memo=L,Ie.Portal=F,Ie.Profiler=R,Ie.StrictMode=N,Ie.Suspense=H,Ie.isAsyncMode=W,Ie.isConcurrentMode=b,Ie.isContextConsumer=_,Ie.isContextProvider=j,Ie.isElement=S,Ie.isForwardRef=V,Ie.isFragment=Y,Ie.isLazy=q,Ie.isMemo=Q,Ie.isPortal=X,Ie.isProfiler=se,Ie.isStrictMode=G,Ie.isSuspense=te,Ie.isValidElementType=w,Ie.typeOf=A}()),Ie}var tg;function ng(){return tg||(tg=1,process.env.NODE_ENV==="production"?To.exports=TM():To.exports=IM()),To.exports}/*
303
+ */var tg;function MM(){return tg||(tg=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,i=e?Symbol.for("react.strict_mode"):60108,o=e?Symbol.for("react.profiler"):60114,s=e?Symbol.for("react.provider"):60109,a=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,f=e?Symbol.for("react.forward_ref"):60112,c=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,d=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,p=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,v=e?Symbol.for("react.responder"):60118,y=e?Symbol.for("react.scope"):60119;function w($){return typeof $=="string"||typeof $=="function"||$===r||$===u||$===o||$===i||$===c||$===h||typeof $=="object"&&$!==null&&($.$$typeof===m||$.$$typeof===d||$.$$typeof===s||$.$$typeof===a||$.$$typeof===f||$.$$typeof===g||$.$$typeof===v||$.$$typeof===y||$.$$typeof===p)}function C($){if(typeof $=="object"&&$!==null){var ne=$.$$typeof;switch(ne){case t:var me=$.type;switch(me){case l:case u:case r:case o:case i:case c:return me;default:var Oe=me&&me.$$typeof;switch(Oe){case a:case f:case m:case d:case s:return Oe;default:return ne}}case n:return ne}}}var k=l,E=u,I=a,D=s,P=t,T=f,O=r,U=m,L=d,F=n,R=o,N=i,j=c,z=!1;function V($){return z||(z=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),b($)||C($)===l}function b($){return C($)===u}function _($){return C($)===a}function B($){return C($)===s}function S($){return typeof $=="object"&&$!==null&&$.$$typeof===t}function W($){return C($)===f}function J($){return C($)===r}function Y($){return C($)===m}function G($){return C($)===d}function X($){return C($)===n}function se($){return C($)===o}function K($){return C($)===i}function te($){return C($)===c}Ie.AsyncMode=k,Ie.ConcurrentMode=E,Ie.ContextConsumer=I,Ie.ContextProvider=D,Ie.Element=P,Ie.ForwardRef=T,Ie.Fragment=O,Ie.Lazy=U,Ie.Memo=L,Ie.Portal=F,Ie.Profiler=R,Ie.StrictMode=N,Ie.Suspense=j,Ie.isAsyncMode=V,Ie.isConcurrentMode=b,Ie.isContextConsumer=_,Ie.isContextProvider=B,Ie.isElement=S,Ie.isForwardRef=W,Ie.isFragment=J,Ie.isLazy=Y,Ie.isMemo=G,Ie.isPortal=X,Ie.isProfiler=se,Ie.isStrictMode=K,Ie.isSuspense=te,Ie.isValidElementType=w,Ie.typeOf=C}()),Ie}var ng;function rg(){return ng||(ng=1,process.env.NODE_ENV==="production"?To.exports=OM():To.exports=MM()),To.exports}/*
304
304
  object-assign
305
305
  (c) Sindre Sorhus
306
306
  @license MIT
307
- */var Al,rg;function OM(){if(rg)return Al;rg=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(f){return s[f]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(f){u[f]=f}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Al=i()?Object.assign:function(o,s){for(var a,l=r(o),u,f=1;f<arguments.length;f++){a=Object(arguments[f]);for(var c in a)t.call(a,c)&&(l[c]=a[c]);if(e){u=e(a);for(var h=0;h<u.length;h++)n.call(a,u[h])&&(l[u[h]]=a[u[h]])}}return l},Al}var Tl,ig;function Il(){if(ig)return Tl;ig=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Tl=e,Tl}var Ol,og;function sg(){return og||(og=1,Ol=Function.call.bind(Object.prototype.hasOwnProperty)),Ol}var Ml,ag;function MM(){if(ag)return Ml;ag=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Il(),n={},r=sg();e=function(o){var s="Warning: "+o;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(o,s,a,l,u){if(process.env.NODE_ENV!=="production"){for(var f in o)if(r(o,f)){var c;try{if(typeof o[f]!="function"){var h=Error((l||"React class")+": "+a+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}c=o[f](s,f,l,a,null,t)}catch(m){c=m}if(c&&!(c instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in n)){n[c.message]=!0;var d=u?u():"";e("Failed "+a+" type: "+c.message+(d??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Ml=i,Ml}var Dl,lg;function DM(){if(lg)return Dl;lg=1;var e=ng(),t=OM(),n=Il(),r=sg(),i=MM(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return Dl=function(a,l){var u=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function c(b){var _=b&&(u&&b[u]||b[f]);if(typeof _=="function")return _}var h="<<anonymous>>",d={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:y(),arrayOf:w,element:A(),elementType:k(),instanceOf:E,node:T(),objectOf:D,oneOf:I,oneOfType:P,shape:B,exact:L};function m(b,_){return b===_?b!==0||1/b===1/_:b!==b&&_!==_}function p(b,_){this.message=b,this.data=_&&typeof _=="object"?_:{},this.stack=""}p.prototype=Error.prototype;function g(b){if(process.env.NODE_ENV!=="production")var _={},j=0;function S(Y,q,Q,X,se,G,te){if(X=X||h,G=G||Q,te!==n){if(l){var $=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw $.name="Invariant Violation",$}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ne=X+":"+Q;!_[ne]&&j<3&&(o("You are manually calling a React.PropTypes validation function for the `"+G+"` prop on `"+X+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),_[ne]=!0,j++)}}return q[Q]==null?Y?q[Q]===null?new p("The "+se+" `"+G+"` is marked as required "+("in `"+X+"`, but its value is `null`.")):new p("The "+se+" `"+G+"` is marked as required in "+("`"+X+"`, but its value is `undefined`.")):null:b(q,Q,X,se,G)}var V=S.bind(null,!1);return V.isRequired=S.bind(null,!0),V}function v(b){function _(j,S,V,Y,q,Q){var X=j[S],se=N(X);if(se!==b){var G=H(X);return new p("Invalid "+Y+" `"+q+"` of type "+("`"+G+"` supplied to `"+V+"`, expected ")+("`"+b+"`."),{expectedType:b})}return null}return g(_)}function y(){return g(s)}function w(b){function _(j,S,V,Y,q){if(typeof b!="function")return new p("Property `"+q+"` of component `"+V+"` has invalid PropType notation inside arrayOf.");var Q=j[S];if(!Array.isArray(Q)){var X=N(Q);return new p("Invalid "+Y+" `"+q+"` of type "+("`"+X+"` supplied to `"+V+"`, expected an array."))}for(var se=0;se<Q.length;se++){var G=b(Q,se,V,Y,q+"["+se+"]",n);if(G instanceof Error)return G}return null}return g(_)}function A(){function b(_,j,S,V,Y){var q=_[j];if(!a(q)){var Q=N(q);return new p("Invalid "+V+" `"+Y+"` of type "+("`"+Q+"` supplied to `"+S+"`, expected a single ReactElement."))}return null}return g(b)}function k(){function b(_,j,S,V,Y){var q=_[j];if(!e.isValidElementType(q)){var Q=N(q);return new p("Invalid "+V+" `"+Y+"` of type "+("`"+Q+"` supplied to `"+S+"`, expected a single ReactElement type."))}return null}return g(b)}function E(b){function _(j,S,V,Y,q){if(!(j[S]instanceof b)){var Q=b.name||h,X=W(j[S]);return new p("Invalid "+Y+" `"+q+"` of type "+("`"+X+"` supplied to `"+V+"`, expected ")+("instance of `"+Q+"`."))}return null}return g(_)}function I(b){if(!Array.isArray(b))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),s;function _(j,S,V,Y,q){for(var Q=j[S],X=0;X<b.length;X++)if(m(Q,b[X]))return null;var se=JSON.stringify(b,function(te,$){var ne=H($);return ne==="symbol"?String($):$});return new p("Invalid "+Y+" `"+q+"` of value `"+String(Q)+"` "+("supplied to `"+V+"`, expected one of "+se+"."))}return g(_)}function D(b){function _(j,S,V,Y,q){if(typeof b!="function")return new p("Property `"+q+"` of component `"+V+"` has invalid PropType notation inside objectOf.");var Q=j[S],X=N(Q);if(X!=="object")return new p("Invalid "+Y+" `"+q+"` of type "+("`"+X+"` supplied to `"+V+"`, expected an object."));for(var se in Q)if(r(Q,se)){var G=b(Q,se,V,Y,q+"."+se,n);if(G instanceof Error)return G}return null}return g(_)}function P(b){if(!Array.isArray(b))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var _=0;_<b.length;_++){var j=b[_];if(typeof j!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+z(j)+" at index "+_+"."),s}function S(V,Y,q,Q,X){for(var se=[],G=0;G<b.length;G++){var te=b[G],$=te(V,Y,q,Q,X,n);if($==null)return null;$.data&&r($.data,"expectedType")&&se.push($.data.expectedType)}var ne=se.length>0?", expected one of type ["+se.join(", ")+"]":"";return new p("Invalid "+Q+" `"+X+"` supplied to "+("`"+q+"`"+ne+"."))}return g(S)}function T(){function b(_,j,S,V,Y){return F(_[j])?null:new p("Invalid "+V+" `"+Y+"` supplied to "+("`"+S+"`, expected a ReactNode."))}return g(b)}function O(b,_,j,S,V){return new p((b||"React class")+": "+_+" type `"+j+"."+S+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+V+"`.")}function B(b){function _(j,S,V,Y,q){var Q=j[S],X=N(Q);if(X!=="object")return new p("Invalid "+Y+" `"+q+"` of type `"+X+"` "+("supplied to `"+V+"`, expected `object`."));for(var se in b){var G=b[se];if(typeof G!="function")return O(V,Y,q,se,H(G));var te=G(Q,se,V,Y,q+"."+se,n);if(te)return te}return null}return g(_)}function L(b){function _(j,S,V,Y,q){var Q=j[S],X=N(Q);if(X!=="object")return new p("Invalid "+Y+" `"+q+"` of type `"+X+"` "+("supplied to `"+V+"`, expected `object`."));var se=t({},j[S],b);for(var G in se){var te=b[G];if(r(b,G)&&typeof te!="function")return O(V,Y,q,G,H(te));if(!te)return new p("Invalid "+Y+" `"+q+"` key `"+G+"` supplied to `"+V+"`.\nBad object: "+JSON.stringify(j[S],null," ")+`
308
- Valid keys: `+JSON.stringify(Object.keys(b),null," "));var $=te(Q,G,V,Y,q+"."+G,n);if($)return $}return null}return g(_)}function F(b){switch(typeof b){case"number":case"string":case"undefined":return!0;case"boolean":return!b;case"object":if(Array.isArray(b))return b.every(F);if(b===null||a(b))return!0;var _=c(b);if(_){var j=_.call(b),S;if(_!==b.entries){for(;!(S=j.next()).done;)if(!F(S.value))return!1}else for(;!(S=j.next()).done;){var V=S.value;if(V&&!F(V[1]))return!1}}else return!1;return!0;default:return!1}}function R(b,_){return b==="symbol"?!0:_?_["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&_ instanceof Symbol:!1}function N(b){var _=typeof b;return Array.isArray(b)?"array":b instanceof RegExp?"object":R(_,b)?"symbol":_}function H(b){if(typeof b>"u"||b===null)return""+b;var _=N(b);if(_==="object"){if(b instanceof Date)return"date";if(b instanceof RegExp)return"regexp"}return _}function z(b){var _=H(b);switch(_){case"array":case"object":return"an "+_;case"boolean":case"date":case"regexp":return"a "+_;default:return _}}function W(b){return!b.constructor||!b.constructor.name?h:b.constructor.name}return d.checkPropTypes=i,d.resetWarningCache=i.resetWarningCache,d.PropTypes=d,d},Dl}var Nl,ug;function NM(){if(ug)return Nl;ug=1;var e=Il();function t(){}function n(){}return n.resetWarningCache=t,Nl=function(){function r(s,a,l,u,f,c){if(c!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Nl}if(process.env.NODE_ENV!=="production"){var _M=ng(),PM=!0;Cl.exports=DM()(_M.isElement,PM)}else Cl.exports=NM()();var LM=Cl.exports;const Ne=vn(LM);var FM=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function li(e,t){var n=RM(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function RM(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=FM.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var $M=[".DS_Store","Thumbs.db"];function BM(e){return Zn(this,void 0,void 0,function(){return Jn(this,function(t){return Io(e)&&zM(e.dataTransfer)?[2,VM(e.dataTransfer,e.type)]:UM(e)?[2,HM(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,jM(e)]:[2,[]]})})}function zM(e){return Io(e)}function UM(e){return Io(e)&&Io(e.target)}function Io(e){return typeof e=="object"&&e!==null}function HM(e){return _l(e.target.files).map(function(t){return li(t)})}function jM(e){return Zn(this,void 0,void 0,function(){var t;return Jn(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return li(r)})]}})})}function VM(e,t){return Zn(this,void 0,void 0,function(){var n,r;return Jn(this,function(i){switch(i.label){case 0:return e.items?(n=_l(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(WM))]):[3,2];case 1:return r=i.sent(),[2,cg(fg(r))];case 2:return[2,cg(_l(e.files).map(function(o){return li(o)}))]}})})}function cg(e){return e.filter(function(t){return $M.indexOf(t.name)===-1})}function _l(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function WM(e){if(typeof e.webkitGetAsEntry!="function")return dg(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?hg(t):dg(e)}function fg(e){return e.reduce(function(t,n){return Ya(Ya([],Op(t),!1),Op(Array.isArray(n)?fg(n):[n]),!1)},[])}function dg(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=li(t);return Promise.resolve(n)}function qM(e){return Zn(this,void 0,void 0,function(){return Jn(this,function(t){return[2,e.isDirectory?hg(e):YM(e)]})})}function hg(e){var t=e.createReader();return new Promise(function(n,r){var i=[];function o(){var s=this;t.readEntries(function(a){return Zn(s,void 0,void 0,function(){var l,u,f;return Jn(this,function(c){switch(c.label){case 0:if(a.length)return[3,5];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return l=c.sent(),n(l),[3,4];case 3:return u=c.sent(),r(u),[3,4];case 4:return[3,6];case 5:f=Promise.all(a.map(qM)),i.push(f),o(),c.label=6;case 6:return[2]}})})},function(a){r(a)})}o()})}function YM(e){return Zn(this,void 0,void 0,function(){return Jn(this,function(t){return[2,new Promise(function(n,r){e.file(function(i){var o=li(i,e.fullPath);n(o)},function(i){r(i)})})]})})}var KM=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(function(s){var a=s.trim().toLowerCase();return a.charAt(0)==="."?r.toLowerCase().endsWith(a):a.endsWith("/*")?o===a.replace(/\/.*$/,""):i===a})}return!0};function pg(e){return ZM(e)||QM(e)||vg(e)||GM()}function GM(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
309
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QM(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ZM(e){if(Array.isArray(e))return Pl(e)}function mg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mg(Object(n),!0).forEach(function(r){yg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function yg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ui(e,t){return eD(e)||XM(e,t)||vg(e,t)||JM()}function JM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
310
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vg(e,t){if(e){if(typeof e=="string")return Pl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pl(e,t)}}function Pl(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function XM(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function eD(e){if(Array.isArray(e))return e}var tD="file-invalid-type",nD="file-too-large",rD="file-too-small",iD="too-many-files",oD=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var n=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:tD,message:"File type must be ".concat(n)}},bg=function(t){return{code:nD,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},wg=function(t){return{code:rD,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},sD={code:iD,message:"Too many files"};function Sg(e,t){var n=e.type==="application/x-moz-file"||KM(e,t);return[n,n?null:oD(t)]}function xg(e,t,n){if(Nn(e.size))if(Nn(t)&&Nn(n)){if(e.size>n)return[!1,bg(n)];if(e.size<t)return[!1,wg(t)]}else{if(Nn(t)&&e.size<t)return[!1,wg(t)];if(Nn(n)&&e.size>n)return[!1,bg(n)]}return[!0,null]}function Nn(e){return e!=null}function aD(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,s=e.maxFiles,a=e.validator;return!o&&t.length>1||o&&s>=1&&t.length>s?!1:t.every(function(l){var u=Sg(l,n),f=ui(u,1),c=f[0],h=xg(l,r,i),d=ui(h,1),m=d[0],p=a?a(l):null;return c&&m&&!p})}function Oo(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Mo(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function kg(e){e.preventDefault()}function lD(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function uD(e){return e.indexOf("Edge/")!==-1}function cD(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return lD(e)||uD(e)}function jt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];return t.some(function(a){return!Oo(r)&&a&&a.apply(void 0,[r].concat(o)),Oo(r)})}}function fD(){return"showOpenFilePicker"in window}function dD(e){if(Nn(e)){var t=Object.entries(e).filter(function(n){var r=ui(n,2),i=r[0],o=r[1],s=!0;return Eg(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),s=!1),(!Array.isArray(o)||!o.every(Cg))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),s=!1),s}).reduce(function(n,r){var i=ui(r,2),o=i[0],s=i[1];return gg(gg({},n),{},yg({},o,s))},{});return[{description:"Files",accept:t}]}return e}function hD(e){if(Nn(e))return Object.entries(e).reduce(function(t,n){var r=ui(n,2),i=r[0],o=r[1];return[].concat(pg(t),[i],pg(o))},[]).filter(function(t){return Eg(t)||Cg(t)}).join(",")}function pD(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function mD(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function Eg(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function Cg(e){return/^.*\.[\w]+$/.test(e)}var gD=["children"],yD=["open"],vD=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],bD=["refKey","onChange","onClick"];function wD(e){return kD(e)||xD(e)||Ag(e)||SD()}function SD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
311
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xD(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kD(e){if(Array.isArray(e))return Fl(e)}function Ll(e,t){return AD(e)||CD(e,t)||Ag(e,t)||ED()}function ED(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
312
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ag(e,t){if(e){if(typeof e=="string")return Fl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fl(e,t)}}function Fl(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function CD(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function AD(e){if(Array.isArray(e))return e}function Tg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Be(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Tg(Object(n),!0).forEach(function(r){Rl(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Rl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Do(e,t){if(e==null)return{};var n=TD(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function TD(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var $l=M.forwardRef(function(e,t){var n=e.children,r=Do(e,gD),i=Og(r),o=i.open,s=Do(i,yD);return M.useImperativeHandle(t,function(){return{open:o}},[o]),M.createElement(M.Fragment,null,n(Be(Be({},s),{},{open:o})))});$l.displayName="Dropzone";var Ig={disabled:!1,getFilesFromEvent:BM,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};$l.defaultProps=Ig,$l.propTypes={children:Ne.func,accept:Ne.objectOf(Ne.arrayOf(Ne.string)),multiple:Ne.bool,preventDropOnDocument:Ne.bool,noClick:Ne.bool,noKeyboard:Ne.bool,noDrag:Ne.bool,noDragEventsBubbling:Ne.bool,minSize:Ne.number,maxSize:Ne.number,maxFiles:Ne.number,disabled:Ne.bool,getFilesFromEvent:Ne.func,onFileDialogCancel:Ne.func,onFileDialogOpen:Ne.func,useFsAccessApi:Ne.bool,autoFocus:Ne.bool,onDragEnter:Ne.func,onDragLeave:Ne.func,onDragOver:Ne.func,onDrop:Ne.func,onDropAccepted:Ne.func,onDropRejected:Ne.func,onError:Ne.func,validator:Ne.func};var Bl={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Og(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Be(Be({},Ig),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,s=t.minSize,a=t.multiple,l=t.maxFiles,u=t.onDragEnter,f=t.onDragLeave,c=t.onDragOver,h=t.onDrop,d=t.onDropAccepted,m=t.onDropRejected,p=t.onFileDialogCancel,g=t.onFileDialogOpen,v=t.useFsAccessApi,y=t.autoFocus,w=t.preventDropOnDocument,A=t.noClick,k=t.noKeyboard,E=t.noDrag,I=t.noDragEventsBubbling,D=t.onError,P=t.validator,T=M.useMemo(function(){return hD(n)},[n]),O=M.useMemo(function(){return dD(n)},[n]),B=M.useMemo(function(){return typeof g=="function"?g:Mg},[g]),L=M.useMemo(function(){return typeof p=="function"?p:Mg},[p]),F=M.useRef(null),R=M.useRef(null),N=M.useReducer(ID,Bl),H=Ll(N,2),z=H[0],W=H[1],b=z.isFocused,_=z.isFileDialogActive,j=M.useRef(typeof window<"u"&&window.isSecureContext&&v&&fD()),S=function(){!j.current&&_&&setTimeout(function(){if(R.current){var ae=R.current.files;ae.length||(W({type:"closeDialog"}),L())}},300)};M.useEffect(function(){return window.addEventListener("focus",S,!1),function(){window.removeEventListener("focus",S,!1)}},[R,_,L,j]);var V=M.useRef([]),Y=function(ae){F.current&&F.current.contains(ae.target)||(ae.preventDefault(),V.current=[])};M.useEffect(function(){return w&&(document.addEventListener("dragover",kg,!1),document.addEventListener("drop",Y,!1)),function(){w&&(document.removeEventListener("dragover",kg),document.removeEventListener("drop",Y))}},[F,w]),M.useEffect(function(){return!r&&y&&F.current&&F.current.focus(),function(){}},[F,y,r]);var q=M.useCallback(function(ee){D?D(ee):console.error(ee)},[D]),Q=M.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ae(ee),V.current=[].concat(wD(V.current),[ee.target]),Mo(ee)&&Promise.resolve(i(ee)).then(function(ae){if(!(Oo(ee)&&!I)){var U=ae.length,K=U>0&&aD({files:ae,accept:T,minSize:s,maxSize:o,multiple:a,maxFiles:l,validator:P}),oe=U>0&&!K;W({isDragAccept:K,isDragReject:oe,isDragActive:!0,type:"setDraggedFiles"}),u&&u(ee)}}).catch(function(ae){return q(ae)})},[i,u,q,I,T,s,o,a,l,P]),X=M.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ae(ee);var ae=Mo(ee);if(ae&&ee.dataTransfer)try{ee.dataTransfer.dropEffect="copy"}catch{}return ae&&c&&c(ee),!1},[c,I]),se=M.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ae(ee);var ae=V.current.filter(function(K){return F.current&&F.current.contains(K)}),U=ae.indexOf(ee.target);U!==-1&&ae.splice(U,1),V.current=ae,!(ae.length>0)&&(W({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Mo(ee)&&f&&f(ee))},[F,f,I]),G=M.useCallback(function(ee,ae){var U=[],K=[];ee.forEach(function(oe){var le=Sg(oe,T),he=Ll(le,2),je=he[0],Ge=he[1],Ze=xg(oe,s,o),Et=Ll(Ze,2),Rt=Et[0],Qe=Et[1],Ct=P?P(oe):null;if(je&&Rt&&!Ct)U.push(oe);else{var at=[Ge,Qe];Ct&&(at=at.concat(Ct)),K.push({file:oe,errors:at.filter(function(es){return es})})}}),(!a&&U.length>1||a&&l>=1&&U.length>l)&&(U.forEach(function(oe){K.push({file:oe,errors:[sD]})}),U.splice(0)),W({acceptedFiles:U,fileRejections:K,type:"setFiles"}),h&&h(U,K,ae),K.length>0&&m&&m(K,ae),U.length>0&&d&&d(U,ae)},[W,a,T,s,o,l,h,d,m,P]),te=M.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ae(ee),V.current=[],Mo(ee)&&Promise.resolve(i(ee)).then(function(ae){Oo(ee)&&!I||G(ae,ee)}).catch(function(ae){return q(ae)}),W({type:"reset"})},[i,G,q,I]),$=M.useCallback(function(){if(j.current){W({type:"openDialog"}),B();var ee={multiple:a,types:O};window.showOpenFilePicker(ee).then(function(ae){return i(ae)}).then(function(ae){G(ae,null),W({type:"closeDialog"})}).catch(function(ae){pD(ae)?(L(ae),W({type:"closeDialog"})):mD(ae)?(j.current=!1,R.current?(R.current.value=null,R.current.click()):q(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):q(ae)});return}R.current&&(W({type:"openDialog"}),B(),R.current.value=null,R.current.click())},[W,B,L,v,G,q,O,a]),ne=M.useCallback(function(ee){!F.current||!F.current.isEqualNode(ee.target)||(ee.key===" "||ee.key==="Enter"||ee.keyCode===32||ee.keyCode===13)&&(ee.preventDefault(),$())},[F,$]),me=M.useCallback(function(){W({type:"focus"})},[]),Oe=M.useCallback(function(){W({type:"blur"})},[]),J=M.useCallback(function(){A||(cD()?setTimeout($,0):$())},[A,$]),ue=function(ae){return r?null:ae},de=function(ae){return k?null:ue(ae)},fe=function(ae){return E?null:ue(ae)},Ae=function(ae){I&&ae.stopPropagation()},Fe=M.useMemo(function(){return function(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=ee.refKey,U=ae===void 0?"ref":ae,K=ee.role,oe=ee.onKeyDown,le=ee.onFocus,he=ee.onBlur,je=ee.onClick,Ge=ee.onDragEnter,Ze=ee.onDragOver,Et=ee.onDragLeave,Rt=ee.onDrop,Qe=Do(ee,vD);return Be(Be(Rl({onKeyDown:de(jt(oe,ne)),onFocus:de(jt(le,me)),onBlur:de(jt(he,Oe)),onClick:ue(jt(je,J)),onDragEnter:fe(jt(Ge,Q)),onDragOver:fe(jt(Ze,X)),onDragLeave:fe(jt(Et,se)),onDrop:fe(jt(Rt,te)),role:typeof K=="string"&&K!==""?K:"presentation"},U,F),!r&&!k?{tabIndex:0}:{}),Qe)}},[F,ne,me,Oe,J,Q,X,se,te,k,E,r]),Me=M.useCallback(function(ee){ee.stopPropagation()},[]),He=M.useMemo(function(){return function(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=ee.refKey,U=ae===void 0?"ref":ae,K=ee.onChange,oe=ee.onClick,le=Do(ee,bD),he=Rl({accept:T,multiple:a,type:"file",style:{display:"none"},onChange:ue(jt(K,te)),onClick:ue(jt(oe,Me)),tabIndex:-1},U,R);return Be(Be({},he),le)}},[R,n,a,te,r]);return Be(Be({},z),{},{isFocused:b&&!r,getRootProps:Fe,getInputProps:He,rootRef:F,inputRef:R,open:ue($)})}function ID(e,t){switch(t.type){case"focus":return Be(Be({},e),{},{isFocused:!0});case"blur":return Be(Be({},e),{},{isFocused:!1});case"openDialog":return Be(Be({},Bl),{},{isFileDialogActive:!0});case"closeDialog":return Be(Be({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Be(Be({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Be(Be({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Be({},Bl);default:return e}}function Mg(){}const Dg=({children:e})=>{const t=M.useRef(null),[n,r]=M.useState({open:!1}),i=({title:s,description:a,confirmButtonText:l,cancelButtonText:u,onConfirm:f,onCancel:c,initialValue:h,Content:d})=>new Promise((m,p)=>{t.current=h,r({open:!0,title:s,description:a,confirmButtonText:l,cancelButtonText:u,content:d?x.jsx(d,{value:h,setValue:g=>{t.current=g}}):null,onConfirm:()=>{f==null||f(),m(t.current),o()},onCancel:()=>{c==null||c(),p(),o()}})}),o=()=>{r(s=>({...s,open:!1}))};return x.jsxs(Wa.Provider,{value:{showInputModal:i},children:[x.jsx(br,{open:n.open,onOpenChange:s=>r(a=>({...a,open:s})),children:x.jsx(br.Content,{title:n.title,description:n.description,confirmButtonText:n.confirmButtonText,cancelButtonText:n.cancelButtonText,onConfirm:n.onConfirm,onCancel:n.onCancel,children:n.content})}),e]})},OD=(e,t)=>{const n=e.replace(/\s+/g,"+");if(!e.replace(/[^a-zA-Z0-9\s\-_]/g,"").trim())return;const i=t.filter(l=>/^\d+$/.test(l)).join(";"),o=`https://fonts.googleapis.com/css2?family=${n}:wght@${i}&display=swap`;if(document.querySelector(`link[href="${o}"]`))return;const a=document.createElement("link");a.rel="stylesheet",a.href=o,document.head.appendChild(a)},Ng=({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o,additionalStylesheetUrl:s})=>{M.useMemo(()=>{t&&OD(t,["100","200","300","400","500","600","700","800"])},[t]);const a=M.useMemo(()=>Nf({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o}),[e,t,n,r,i,o]);return x.jsxs(x.Fragment,{children:[s&&x.jsx("link",{rel:"stylesheet",href:s}),x.jsxs("style",{children:[a,`
307
+ */var Il,ig;function DM(){if(ig)return Il;ig=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(f){return s[f]});if(l.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(f){u[f]=f}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Il=i()?Object.assign:function(o,s){for(var a,l=r(o),u,f=1;f<arguments.length;f++){a=Object(arguments[f]);for(var c in a)t.call(a,c)&&(l[c]=a[c]);if(e){u=e(a);for(var h=0;h<u.length;h++)n.call(a,u[h])&&(l[u[h]]=a[u[h]])}}return l},Il}var Ol,og;function Ml(){if(og)return Ol;og=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ol=e,Ol}var Dl,sg;function ag(){return sg||(sg=1,Dl=Function.call.bind(Object.prototype.hasOwnProperty)),Dl}var Nl,lg;function NM(){if(lg)return Nl;lg=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=Ml(),n={},r=ag();e=function(o){var s="Warning: "+o;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}}}function i(o,s,a,l,u){if(process.env.NODE_ENV!=="production"){for(var f in o)if(r(o,f)){var c;try{if(typeof o[f]!="function"){var h=Error((l||"React class")+": "+a+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}c=o[f](s,f,l,a,null,t)}catch(m){c=m}if(c&&!(c instanceof Error)&&e((l||"React class")+": type specification of "+a+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof c+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),c instanceof Error&&!(c.message in n)){n[c.message]=!0;var d=u?u():"";e("Failed "+a+" type: "+c.message+(d??""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Nl=i,Nl}var _l,ug;function _M(){if(ug)return _l;ug=1;var e=rg(),t=DM(),n=Ml(),r=ag(),i=NM(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var l="Warning: "+a;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function s(){return null}return _l=function(a,l){var u=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function c(b){var _=b&&(u&&b[u]||b[f]);if(typeof _=="function")return _}var h="<<anonymous>>",d={array:v("array"),bigint:v("bigint"),bool:v("boolean"),func:v("function"),number:v("number"),object:v("object"),string:v("string"),symbol:v("symbol"),any:y(),arrayOf:w,element:C(),elementType:k(),instanceOf:E,node:T(),objectOf:D,oneOf:I,oneOfType:P,shape:U,exact:L};function m(b,_){return b===_?b!==0||1/b===1/_:b!==b&&_!==_}function p(b,_){this.message=b,this.data=_&&typeof _=="object"?_:{},this.stack=""}p.prototype=Error.prototype;function g(b){if(process.env.NODE_ENV!=="production")var _={},B=0;function S(J,Y,G,X,se,K,te){if(X=X||h,K=K||G,te!==n){if(l){var $=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw $.name="Invariant Violation",$}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ne=X+":"+G;!_[ne]&&B<3&&(o("You are manually calling a React.PropTypes validation function for the `"+K+"` prop on `"+X+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),_[ne]=!0,B++)}}return Y[G]==null?J?Y[G]===null?new p("The "+se+" `"+K+"` is marked as required "+("in `"+X+"`, but its value is `null`.")):new p("The "+se+" `"+K+"` is marked as required in "+("`"+X+"`, but its value is `undefined`.")):null:b(Y,G,X,se,K)}var W=S.bind(null,!1);return W.isRequired=S.bind(null,!0),W}function v(b){function _(B,S,W,J,Y,G){var X=B[S],se=N(X);if(se!==b){var K=j(X);return new p("Invalid "+J+" `"+Y+"` of type "+("`"+K+"` supplied to `"+W+"`, expected ")+("`"+b+"`."),{expectedType:b})}return null}return g(_)}function y(){return g(s)}function w(b){function _(B,S,W,J,Y){if(typeof b!="function")return new p("Property `"+Y+"` of component `"+W+"` has invalid PropType notation inside arrayOf.");var G=B[S];if(!Array.isArray(G)){var X=N(G);return new p("Invalid "+J+" `"+Y+"` of type "+("`"+X+"` supplied to `"+W+"`, expected an array."))}for(var se=0;se<G.length;se++){var K=b(G,se,W,J,Y+"["+se+"]",n);if(K instanceof Error)return K}return null}return g(_)}function C(){function b(_,B,S,W,J){var Y=_[B];if(!a(Y)){var G=N(Y);return new p("Invalid "+W+" `"+J+"` of type "+("`"+G+"` supplied to `"+S+"`, expected a single ReactElement."))}return null}return g(b)}function k(){function b(_,B,S,W,J){var Y=_[B];if(!e.isValidElementType(Y)){var G=N(Y);return new p("Invalid "+W+" `"+J+"` of type "+("`"+G+"` supplied to `"+S+"`, expected a single ReactElement type."))}return null}return g(b)}function E(b){function _(B,S,W,J,Y){if(!(B[S]instanceof b)){var G=b.name||h,X=V(B[S]);return new p("Invalid "+J+" `"+Y+"` of type "+("`"+X+"` supplied to `"+W+"`, expected ")+("instance of `"+G+"`."))}return null}return g(_)}function I(b){if(!Array.isArray(b))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),s;function _(B,S,W,J,Y){for(var G=B[S],X=0;X<b.length;X++)if(m(G,b[X]))return null;var se=JSON.stringify(b,function(te,$){var ne=j($);return ne==="symbol"?String($):$});return new p("Invalid "+J+" `"+Y+"` of value `"+String(G)+"` "+("supplied to `"+W+"`, expected one of "+se+"."))}return g(_)}function D(b){function _(B,S,W,J,Y){if(typeof b!="function")return new p("Property `"+Y+"` of component `"+W+"` has invalid PropType notation inside objectOf.");var G=B[S],X=N(G);if(X!=="object")return new p("Invalid "+J+" `"+Y+"` of type "+("`"+X+"` supplied to `"+W+"`, expected an object."));for(var se in G)if(r(G,se)){var K=b(G,se,W,J,Y+"."+se,n);if(K instanceof Error)return K}return null}return g(_)}function P(b){if(!Array.isArray(b))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var _=0;_<b.length;_++){var B=b[_];if(typeof B!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+z(B)+" at index "+_+"."),s}function S(W,J,Y,G,X){for(var se=[],K=0;K<b.length;K++){var te=b[K],$=te(W,J,Y,G,X,n);if($==null)return null;$.data&&r($.data,"expectedType")&&se.push($.data.expectedType)}var ne=se.length>0?", expected one of type ["+se.join(", ")+"]":"";return new p("Invalid "+G+" `"+X+"` supplied to "+("`"+Y+"`"+ne+"."))}return g(S)}function T(){function b(_,B,S,W,J){return F(_[B])?null:new p("Invalid "+W+" `"+J+"` supplied to "+("`"+S+"`, expected a ReactNode."))}return g(b)}function O(b,_,B,S,W){return new p((b||"React class")+": "+_+" type `"+B+"."+S+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+W+"`.")}function U(b){function _(B,S,W,J,Y){var G=B[S],X=N(G);if(X!=="object")return new p("Invalid "+J+" `"+Y+"` of type `"+X+"` "+("supplied to `"+W+"`, expected `object`."));for(var se in b){var K=b[se];if(typeof K!="function")return O(W,J,Y,se,j(K));var te=K(G,se,W,J,Y+"."+se,n);if(te)return te}return null}return g(_)}function L(b){function _(B,S,W,J,Y){var G=B[S],X=N(G);if(X!=="object")return new p("Invalid "+J+" `"+Y+"` of type `"+X+"` "+("supplied to `"+W+"`, expected `object`."));var se=t({},B[S],b);for(var K in se){var te=b[K];if(r(b,K)&&typeof te!="function")return O(W,J,Y,K,j(te));if(!te)return new p("Invalid "+J+" `"+Y+"` key `"+K+"` supplied to `"+W+"`.\nBad object: "+JSON.stringify(B[S],null," ")+`
308
+ Valid keys: `+JSON.stringify(Object.keys(b),null," "));var $=te(G,K,W,J,Y+"."+K,n);if($)return $}return null}return g(_)}function F(b){switch(typeof b){case"number":case"string":case"undefined":return!0;case"boolean":return!b;case"object":if(Array.isArray(b))return b.every(F);if(b===null||a(b))return!0;var _=c(b);if(_){var B=_.call(b),S;if(_!==b.entries){for(;!(S=B.next()).done;)if(!F(S.value))return!1}else for(;!(S=B.next()).done;){var W=S.value;if(W&&!F(W[1]))return!1}}else return!1;return!0;default:return!1}}function R(b,_){return b==="symbol"?!0:_?_["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&_ instanceof Symbol:!1}function N(b){var _=typeof b;return Array.isArray(b)?"array":b instanceof RegExp?"object":R(_,b)?"symbol":_}function j(b){if(typeof b>"u"||b===null)return""+b;var _=N(b);if(_==="object"){if(b instanceof Date)return"date";if(b instanceof RegExp)return"regexp"}return _}function z(b){var _=j(b);switch(_){case"array":case"object":return"an "+_;case"boolean":case"date":case"regexp":return"a "+_;default:return _}}function V(b){return!b.constructor||!b.constructor.name?h:b.constructor.name}return d.checkPropTypes=i,d.resetWarningCache=i.resetWarningCache,d.PropTypes=d,d},_l}var Pl,cg;function PM(){if(cg)return Pl;cg=1;var e=Ml();function t(){}function n(){}return n.resetWarningCache=t,Pl=function(){function r(s,a,l,u,f,c){if(c!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Pl}if(process.env.NODE_ENV!=="production"){var LM=rg(),FM=!0;Tl.exports=_M()(LM.isElement,FM)}else Tl.exports=PM()();var RM=Tl.exports;const Ne=vn(RM);var $M=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function li(e,t){var n=BM(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function BM(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=$M.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var zM=[".DS_Store","Thumbs.db"];function UM(e){return Zn(this,void 0,void 0,function(){return Jn(this,function(t){return Io(e)&&HM(e.dataTransfer)?[2,qM(e.dataTransfer,e.type)]:jM(e)?[2,VM(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,WM(e)]:[2,[]]})})}function HM(e){return Io(e)}function jM(e){return Io(e)&&Io(e.target)}function Io(e){return typeof e=="object"&&e!==null}function VM(e){return Ll(e.target.files).map(function(t){return li(t)})}function WM(e){return Zn(this,void 0,void 0,function(){var t;return Jn(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return li(r)})]}})})}function qM(e,t){return Zn(this,void 0,void 0,function(){var n,r;return Jn(this,function(i){switch(i.label){case 0:return e.items?(n=Ll(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(YM))]):[3,2];case 1:return r=i.sent(),[2,fg(dg(r))];case 2:return[2,fg(Ll(e.files).map(function(o){return li(o)}))]}})})}function fg(e){return e.filter(function(t){return zM.indexOf(t.name)===-1})}function Ll(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function YM(e){if(typeof e.webkitGetAsEntry!="function")return hg(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?pg(t):hg(e)}function dg(e){return e.reduce(function(t,n){return Ga(Ga([],Mp(t),!1),Mp(Array.isArray(n)?dg(n):[n]),!1)},[])}function hg(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=li(t);return Promise.resolve(n)}function KM(e){return Zn(this,void 0,void 0,function(){return Jn(this,function(t){return[2,e.isDirectory?pg(e):GM(e)]})})}function pg(e){var t=e.createReader();return new Promise(function(n,r){var i=[];function o(){var s=this;t.readEntries(function(a){return Zn(s,void 0,void 0,function(){var l,u,f;return Jn(this,function(c){switch(c.label){case 0:if(a.length)return[3,5];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return l=c.sent(),n(l),[3,4];case 3:return u=c.sent(),r(u),[3,4];case 4:return[3,6];case 5:f=Promise.all(a.map(KM)),i.push(f),o(),c.label=6;case 6:return[2]}})})},function(a){r(a)})}o()})}function GM(e){return Zn(this,void 0,void 0,function(){return Jn(this,function(t){return[2,new Promise(function(n,r){e.file(function(i){var o=li(i,e.fullPath);n(o)},function(i){r(i)})})]})})}var QM=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(function(s){var a=s.trim().toLowerCase();return a.charAt(0)==="."?r.toLowerCase().endsWith(a):a.endsWith("/*")?o===a.replace(/\/.*$/,""):i===a})}return!0};function mg(e){return XM(e)||JM(e)||bg(e)||ZM()}function ZM(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
309
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JM(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function XM(e){if(Array.isArray(e))return Fl(e)}function gg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function yg(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gg(Object(n),!0).forEach(function(r){vg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gg(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function vg(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ui(e,t){return nD(e)||tD(e,t)||bg(e,t)||eD()}function eD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
310
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bg(e,t){if(e){if(typeof e=="string")return Fl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fl(e,t)}}function Fl(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tD(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function nD(e){if(Array.isArray(e))return e}var rD="file-invalid-type",iD="file-too-large",oD="file-too-small",sD="too-many-files",aD=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var n=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:rD,message:"File type must be ".concat(n)}},wg=function(t){return{code:iD,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Sg=function(t){return{code:oD,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},lD={code:sD,message:"Too many files"};function xg(e,t){var n=e.type==="application/x-moz-file"||QM(e,t);return[n,n?null:aD(t)]}function kg(e,t,n){if(Nn(e.size))if(Nn(t)&&Nn(n)){if(e.size>n)return[!1,wg(n)];if(e.size<t)return[!1,Sg(t)]}else{if(Nn(t)&&e.size<t)return[!1,Sg(t)];if(Nn(n)&&e.size>n)return[!1,wg(n)]}return[!0,null]}function Nn(e){return e!=null}function uD(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,o=e.multiple,s=e.maxFiles,a=e.validator;return!o&&t.length>1||o&&s>=1&&t.length>s?!1:t.every(function(l){var u=xg(l,n),f=ui(u,1),c=f[0],h=kg(l,r,i),d=ui(h,1),m=d[0],p=a?a(l):null;return c&&m&&!p})}function Oo(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Mo(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function Eg(e){e.preventDefault()}function cD(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function fD(e){return e.indexOf("Edge/")!==-1}function dD(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return cD(e)||fD(e)}function jt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];return t.some(function(a){return!Oo(r)&&a&&a.apply(void 0,[r].concat(o)),Oo(r)})}}function hD(){return"showOpenFilePicker"in window}function pD(e){if(Nn(e)){var t=Object.entries(e).filter(function(n){var r=ui(n,2),i=r[0],o=r[1],s=!0;return Cg(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),s=!1),(!Array.isArray(o)||!o.every(Ag))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),s=!1),s}).reduce(function(n,r){var i=ui(r,2),o=i[0],s=i[1];return yg(yg({},n),{},vg({},o,s))},{});return[{description:"Files",accept:t}]}return e}function mD(e){if(Nn(e))return Object.entries(e).reduce(function(t,n){var r=ui(n,2),i=r[0],o=r[1];return[].concat(mg(t),[i],mg(o))},[]).filter(function(t){return Cg(t)||Ag(t)}).join(",")}function gD(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function yD(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function Cg(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function Ag(e){return/^.*\.[\w]+$/.test(e)}var vD=["children"],bD=["open"],wD=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],SD=["refKey","onChange","onClick"];function xD(e){return CD(e)||ED(e)||Tg(e)||kD()}function kD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
311
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ED(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function CD(e){if(Array.isArray(e))return $l(e)}function Rl(e,t){return ID(e)||TD(e,t)||Tg(e,t)||AD()}function AD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
312
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tg(e,t){if(e){if(typeof e=="string")return $l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $l(e,t)}}function $l(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function TD(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(e);!(i=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function ID(e){if(Array.isArray(e))return e}function Ig(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Be(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ig(Object(n),!0).forEach(function(r){Bl(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ig(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Bl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Do(e,t){if(e==null)return{};var n=OD(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function OD(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var zl=M.forwardRef(function(e,t){var n=e.children,r=Do(e,vD),i=Mg(r),o=i.open,s=Do(i,bD);return M.useImperativeHandle(t,function(){return{open:o}},[o]),M.createElement(M.Fragment,null,n(Be(Be({},s),{},{open:o})))});zl.displayName="Dropzone";var Og={disabled:!1,getFilesFromEvent:UM,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};zl.defaultProps=Og,zl.propTypes={children:Ne.func,accept:Ne.objectOf(Ne.arrayOf(Ne.string)),multiple:Ne.bool,preventDropOnDocument:Ne.bool,noClick:Ne.bool,noKeyboard:Ne.bool,noDrag:Ne.bool,noDragEventsBubbling:Ne.bool,minSize:Ne.number,maxSize:Ne.number,maxFiles:Ne.number,disabled:Ne.bool,getFilesFromEvent:Ne.func,onFileDialogCancel:Ne.func,onFileDialogOpen:Ne.func,useFsAccessApi:Ne.bool,autoFocus:Ne.bool,onDragEnter:Ne.func,onDragLeave:Ne.func,onDragOver:Ne.func,onDrop:Ne.func,onDropAccepted:Ne.func,onDropRejected:Ne.func,onError:Ne.func,validator:Ne.func};var Ul={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Mg(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Be(Be({},Og),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,o=t.maxSize,s=t.minSize,a=t.multiple,l=t.maxFiles,u=t.onDragEnter,f=t.onDragLeave,c=t.onDragOver,h=t.onDrop,d=t.onDropAccepted,m=t.onDropRejected,p=t.onFileDialogCancel,g=t.onFileDialogOpen,v=t.useFsAccessApi,y=t.autoFocus,w=t.preventDropOnDocument,C=t.noClick,k=t.noKeyboard,E=t.noDrag,I=t.noDragEventsBubbling,D=t.onError,P=t.validator,T=M.useMemo(function(){return mD(n)},[n]),O=M.useMemo(function(){return pD(n)},[n]),U=M.useMemo(function(){return typeof g=="function"?g:Dg},[g]),L=M.useMemo(function(){return typeof p=="function"?p:Dg},[p]),F=M.useRef(null),R=M.useRef(null),N=M.useReducer(MD,Ul),j=Rl(N,2),z=j[0],V=j[1],b=z.isFocused,_=z.isFileDialogActive,B=M.useRef(typeof window<"u"&&window.isSecureContext&&v&&hD()),S=function(){!B.current&&_&&setTimeout(function(){if(R.current){var ae=R.current.files;ae.length||(V({type:"closeDialog"}),L())}},300)};M.useEffect(function(){return window.addEventListener("focus",S,!1),function(){window.removeEventListener("focus",S,!1)}},[R,_,L,B]);var W=M.useRef([]),J=function(ae){F.current&&F.current.contains(ae.target)||(ae.preventDefault(),W.current=[])};M.useEffect(function(){return w&&(document.addEventListener("dragover",Eg,!1),document.addEventListener("drop",J,!1)),function(){w&&(document.removeEventListener("dragover",Eg),document.removeEventListener("drop",J))}},[F,w]),M.useEffect(function(){return!r&&y&&F.current&&F.current.focus(),function(){}},[F,y,r]);var Y=M.useCallback(function(ee){D?D(ee):console.error(ee)},[D]),G=M.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ae(ee),W.current=[].concat(xD(W.current),[ee.target]),Mo(ee)&&Promise.resolve(i(ee)).then(function(ae){if(!(Oo(ee)&&!I)){var H=ae.length,q=H>0&&uD({files:ae,accept:T,minSize:s,maxSize:o,multiple:a,maxFiles:l,validator:P}),oe=H>0&&!q;V({isDragAccept:q,isDragReject:oe,isDragActive:!0,type:"setDraggedFiles"}),u&&u(ee)}}).catch(function(ae){return Y(ae)})},[i,u,Y,I,T,s,o,a,l,P]),X=M.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ae(ee);var ae=Mo(ee);if(ae&&ee.dataTransfer)try{ee.dataTransfer.dropEffect="copy"}catch{}return ae&&c&&c(ee),!1},[c,I]),se=M.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ae(ee);var ae=W.current.filter(function(q){return F.current&&F.current.contains(q)}),H=ae.indexOf(ee.target);H!==-1&&ae.splice(H,1),W.current=ae,!(ae.length>0)&&(V({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Mo(ee)&&f&&f(ee))},[F,f,I]),K=M.useCallback(function(ee,ae){var H=[],q=[];ee.forEach(function(oe){var le=xg(oe,T),he=Rl(le,2),je=he[0],Ge=he[1],Ze=kg(oe,s,o),Et=Rl(Ze,2),Rt=Et[0],Qe=Et[1],Ct=P?P(oe):null;if(je&&Rt&&!Ct)H.push(oe);else{var at=[Ge,Qe];Ct&&(at=at.concat(Ct)),q.push({file:oe,errors:at.filter(function(es){return es})})}}),(!a&&H.length>1||a&&l>=1&&H.length>l)&&(H.forEach(function(oe){q.push({file:oe,errors:[lD]})}),H.splice(0)),V({acceptedFiles:H,fileRejections:q,type:"setFiles"}),h&&h(H,q,ae),q.length>0&&m&&m(q,ae),H.length>0&&d&&d(H,ae)},[V,a,T,s,o,l,h,d,m,P]),te=M.useCallback(function(ee){ee.preventDefault(),ee.persist(),Ae(ee),W.current=[],Mo(ee)&&Promise.resolve(i(ee)).then(function(ae){Oo(ee)&&!I||K(ae,ee)}).catch(function(ae){return Y(ae)}),V({type:"reset"})},[i,K,Y,I]),$=M.useCallback(function(){if(B.current){V({type:"openDialog"}),U();var ee={multiple:a,types:O};window.showOpenFilePicker(ee).then(function(ae){return i(ae)}).then(function(ae){K(ae,null),V({type:"closeDialog"})}).catch(function(ae){gD(ae)?(L(ae),V({type:"closeDialog"})):yD(ae)?(B.current=!1,R.current?(R.current.value=null,R.current.click()):Y(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):Y(ae)});return}R.current&&(V({type:"openDialog"}),U(),R.current.value=null,R.current.click())},[V,U,L,v,K,Y,O,a]),ne=M.useCallback(function(ee){!F.current||!F.current.isEqualNode(ee.target)||(ee.key===" "||ee.key==="Enter"||ee.keyCode===32||ee.keyCode===13)&&(ee.preventDefault(),$())},[F,$]),me=M.useCallback(function(){V({type:"focus"})},[]),Oe=M.useCallback(function(){V({type:"blur"})},[]),Z=M.useCallback(function(){C||(dD()?setTimeout($,0):$())},[C,$]),ue=function(ae){return r?null:ae},de=function(ae){return k?null:ue(ae)},fe=function(ae){return E?null:ue(ae)},Ae=function(ae){I&&ae.stopPropagation()},Fe=M.useMemo(function(){return function(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=ee.refKey,H=ae===void 0?"ref":ae,q=ee.role,oe=ee.onKeyDown,le=ee.onFocus,he=ee.onBlur,je=ee.onClick,Ge=ee.onDragEnter,Ze=ee.onDragOver,Et=ee.onDragLeave,Rt=ee.onDrop,Qe=Do(ee,wD);return Be(Be(Bl({onKeyDown:de(jt(oe,ne)),onFocus:de(jt(le,me)),onBlur:de(jt(he,Oe)),onClick:ue(jt(je,Z)),onDragEnter:fe(jt(Ge,G)),onDragOver:fe(jt(Ze,X)),onDragLeave:fe(jt(Et,se)),onDrop:fe(jt(Rt,te)),role:typeof q=="string"&&q!==""?q:"presentation"},H,F),!r&&!k?{tabIndex:0}:{}),Qe)}},[F,ne,me,Oe,Z,G,X,se,te,k,E,r]),Me=M.useCallback(function(ee){ee.stopPropagation()},[]),He=M.useMemo(function(){return function(){var ee=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},ae=ee.refKey,H=ae===void 0?"ref":ae,q=ee.onChange,oe=ee.onClick,le=Do(ee,SD),he=Bl({accept:T,multiple:a,type:"file",style:{display:"none"},onChange:ue(jt(q,te)),onClick:ue(jt(oe,Me)),tabIndex:-1},H,R);return Be(Be({},he),le)}},[R,n,a,te,r]);return Be(Be({},z),{},{isFocused:b&&!r,getRootProps:Fe,getInputProps:He,rootRef:F,inputRef:R,open:ue($)})}function MD(e,t){switch(t.type){case"focus":return Be(Be({},e),{},{isFocused:!0});case"blur":return Be(Be({},e),{},{isFocused:!1});case"openDialog":return Be(Be({},Ul),{},{isFileDialogActive:!0});case"closeDialog":return Be(Be({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Be(Be({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Be(Be({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Be({},Ul);default:return e}}function Dg(){}const Ng=({children:e})=>{const t=M.useRef(null),[n,r]=M.useState({open:!1}),i=({title:s,description:a,confirmButtonText:l,cancelButtonText:u,onConfirm:f,onCancel:c,initialValue:h,Content:d})=>new Promise((m,p)=>{t.current=h,r({open:!0,title:s,description:a,confirmButtonText:l,cancelButtonText:u,content:d?x.jsx(d,{value:h,setValue:g=>{t.current=g}}):null,onConfirm:()=>{f==null||f(),m(t.current),o()},onCancel:()=>{c==null||c(),p(),o()}})}),o=()=>{r(s=>({...s,open:!1}))};return x.jsxs(Ya.Provider,{value:{showInputModal:i},children:[x.jsx(br,{open:n.open,onOpenChange:s=>r(a=>({...a,open:s})),children:x.jsx(br.Content,{title:n.title,description:n.description,confirmButtonText:n.confirmButtonText,cancelButtonText:n.cancelButtonText,onConfirm:n.onConfirm,onCancel:n.onCancel,children:n.content})}),e]})},DD=(e,t)=>{const n=e.replace(/\s+/g,"+");if(!e.replace(/[^a-zA-Z0-9\s\-_]/g,"").trim())return;const i=t.filter(l=>/^\d+$/.test(l)).join(";"),o=`https://fonts.googleapis.com/css2?family=${n}:wght@${i}&display=swap`;if(document.querySelector(`link[href="${o}"]`))return;const a=document.createElement("link");a.rel="stylesheet",a.href=o,document.head.appendChild(a)},_g=({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o,additionalStylesheetUrl:s})=>{M.useMemo(()=>{t&&DD(t,["100","200","300","400","500","600","700","800"])},[t]);const a=M.useMemo(()=>Pf({color:e,fontFamily:t,radius:n,themeMode:r,variant:i,headerVariant:o}),[e,t,n,r,i,o]);return x.jsxs(x.Fragment,{children:[s&&x.jsx("link",{rel:"stylesheet",href:s}),x.jsxs("style",{children:[a,`
313
313
  .bpWebchat {
314
314
  border-radius: ${.375*(n??1)}rem;
315
315
  }
316
316
  .bpMessagePreview {
317
317
  border-radius: ${.125*(n??1)}rem;
318
318
  }
319
- `]})]})};let No;const MD=new Uint8Array(16);function DD(){if(!No&&(No=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!No))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return No(MD)}const Xe=[];for(let e=0;e<256;++e)Xe.push((e+256).toString(16).slice(1));function ND(e,t=0){return Xe[e[t+0]]+Xe[e[t+1]]+Xe[e[t+2]]+Xe[e[t+3]]+"-"+Xe[e[t+4]]+Xe[e[t+5]]+"-"+Xe[e[t+6]]+Xe[e[t+7]]+"-"+Xe[e[t+8]]+Xe[e[t+9]]+"-"+Xe[e[t+10]]+Xe[e[t+11]]+Xe[e[t+12]]+Xe[e[t+13]]+Xe[e[t+14]]+Xe[e[t+15]]}const _g={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function _D(e,t,n){if(_g.randomUUID&&!e)return _g.randomUUID();e=e||{};const r=e.random||(e.rng||DD)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,ND(r)}function lr(e){var s;const{metadata:t,conversationId:n,userId:r}=e,{payload:i,disableInput:o}=Pg(e.payload);return{id:e.id,conversationId:n,authorId:r,timestamp:new Date(e.createdAt),block:i,feedback:(s=e.feedback)==null?void 0:s.value,disableInput:o,metadata:t}}const Pg=e=>{switch(e.type){case"audio":return Lg(e);case"card":return PD(e);case"carousel":return LD(e);case"choice":return FD(e);case"dropdown":return RD(e);case"file":return Fg(e);case"image":return Rg(e);case"location":return $g(e);case"markdown":return Bg(e);case"text":return zg(e);case"video":return Ug(e);case"bloc":return $D(e);case"custom":return{payload:e};default:{const t=e;throw new Error(`Unsuported message type ${t}`)}}},ci=e=>({block:e,type:"bubble"}),Lg=e=>({payload:{type:"audio",url:e.audioUrl}}),PD=e=>({payload:ci(Hg(e))}),LD=e=>({payload:{type:"carousel",blocks:e.items.map(t=>Hg({...t}))}}),FD=e=>{const t=e.options.map(o=>({title:o.label,value:o.value})),n=e.text,r=_D(),i=ci({type:"text",text:n});return t.length===0?{disableInput:e.disableFreeText,payload:i}:{disableInput:e.disableFreeText,payload:{type:"column",blocks:[i,{type:"row",blocks:t.map(({title:o,value:s})=>({type:"button",variant:"action",text:o,buttonValue:s,groupId:r}))}]}}},RD=e=>{const t=e.options.map(i=>({label:i.label,value:i.value})),n=e.text,r=[{type:"dropdown",label:n??"Select an option",options:t}];return n&&r.unshift({type:"text",text:n}),{disableInput:!0,payload:ci({type:"column",blocks:r})}},Fg=e=>({payload:{type:"file",url:e.fileUrl,title:e.title}}),Rg=e=>({payload:{type:"image",url:e.imageUrl}}),$g=e=>({payload:{type:"location",latitude:e.latitude,longitude:e.longitude,title:e.title??e.address??"View on map"}}),Bg=e=>({payload:ci({type:"text",text:e.markdown})}),zg=e=>({payload:ci({type:"text",text:e.text,value:e.value})}),Ug=e=>({payload:{type:"video",url:e.videoUrl}}),$D=e=>({payload:{type:"column",blocks:e.items.map(n=>{switch(n.type){case"audio":return Lg({...n.payload,type:n.type}).payload;case"file":return Fg({...n.payload,type:n.type}).payload;case"image":return Rg({...n.payload,type:n.type}).payload;case"location":return $g({...n.payload,type:n.type}).payload;case"markdown":return Bg({...n.payload,type:n.type}).payload;case"text":return zg({...n.payload,type:n.type}).payload;case"video":return Ug({...n.payload,type:n.type}).payload;default:throw new Error("Unsuported message type")}})}}),Hg=e=>{const t=e.title,n=e.subtitle,r=e.imageUrl,i=e.actions.map(s=>{switch(s.action){case"postback":return{type:"button",variant:"action",text:s.label,buttonValue:s.value,reusable:!0};case"url":return{type:"button",variant:"link",text:s.label,buttonValue:s.value,reusable:!0};case"say":return{type:"button",variant:"action",text:s.label,buttonValue:s.value,reusable:!0};default:throw new Error(`Unknown action type ${s.action}`)}}),o=[];return r&&o.push({type:"image",url:r}),t&&o.push({type:"text",text:`#### ${t}`}),n&&o.push({type:"text",text:n}),i.length>0&&o.push({type:"row",blocks:i}),{type:"column",horizontalAlignment:"center",blocks:[...o]}};var BD=Object.defineProperty,zD=(e,t,n)=>t in e?BD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,UD=(e,t,n)=>zD(e,t+"",n),HD=async(e,t)=>{let n=typeof t=="function"?await t(e):t;if(n)return e.scheme==="bearer"?`Bearer ${n}`:e.scheme==="basic"?`Basic ${btoa(n)}`:n},jD={bodySerializer:e=>JSON.stringify(e,(t,n)=>typeof n=="bigint"?n.toString():n)},VD=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},WD=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},qD=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},jg=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(!t){let a=(e?i:i.map(l=>encodeURIComponent(l))).join(WD(r));switch(r){case"label":return`.${a}`;case"matrix":return`;${n}=${a}`;case"simple":return a;default:return`${n}=${a}`}}let o=VD(r),s=i.map(a=>r==="label"||r==="simple"?e?a:encodeURIComponent(a):_o({allowReserved:e,name:n,value:a})).join(o);return r==="label"||r==="matrix"?o+s:s},_o=({allowReserved:e,name:t,value:n})=>{if(n==null)return"";if(typeof n=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?n:encodeURIComponent(n)}`},Vg=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(i instanceof Date)return`${n}=${i.toISOString()}`;if(r!=="deepObject"&&!t){let a=[];Object.entries(i).forEach(([u,f])=>{a=[...a,u,e?f:encodeURIComponent(f)]});let l=a.join(",");switch(r){case"form":return`${n}=${l}`;case"label":return`.${l}`;case"matrix":return`;${n}=${l}`;default:return l}}let o=qD(r),s=Object.entries(i).map(([a,l])=>_o({allowReserved:e,name:r==="deepObject"?`${n}[${a}]`:a,value:l})).join(o);return r==="label"||r==="matrix"?o+s:s},YD=/\{[^{}]+\}/g,KD=({path:e,url:t})=>{let n=t,r=t.match(YD);if(r)for(let i of r){let o=!1,s=i.substring(1,i.length-1),a="simple";s.endsWith("*")&&(o=!0,s=s.substring(0,s.length-1)),s.startsWith(".")?(s=s.substring(1),a="label"):s.startsWith(";")&&(s=s.substring(1),a="matrix");let l=e[s];if(l==null)continue;if(Array.isArray(l)){n=n.replace(i,jg({explode:o,name:s,style:a,value:l}));continue}if(typeof l=="object"){n=n.replace(i,Vg({explode:o,name:s,style:a,value:l}));continue}if(a==="matrix"){n=n.replace(i,`;${_o({name:s,value:l})}`);continue}let u=encodeURIComponent(a==="label"?`.${l}`:l);n=n.replace(i,u)}return n},Wg=({allowReserved:e,array:t,object:n}={})=>r=>{let i=[];if(r&&typeof r=="object")for(let o in r){let s=r[o];if(s!=null){if(Array.isArray(s)){i=[...i,jg({allowReserved:e,explode:!0,name:o,style:"form",value:s,...t})];continue}if(typeof s=="object"){i=[...i,Vg({allowReserved:e,explode:!0,name:o,style:"deepObject",value:s,...n})];continue}i=[...i,_o({allowReserved:e,name:o,value:s})]}}return i.join("&")},GD=e=>{var t;if(!e)return"stream";let n=(t=e.split(";")[0])==null?void 0:t.trim();if(n){if(n.startsWith("application/json")||n.endsWith("+json"))return"json";if(n==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(r=>n.startsWith(r)))return"blob";if(n.startsWith("text/"))return"text"}},QD=async({security:e,...t})=>{for(let n of e){let r=await HD(n,t.auth);if(!r)continue;let i=n.name??"Authorization";switch(n.in){case"query":t.query||(t.query={}),t.query[i]=r;break;case"cookie":t.headers.append("Cookie",`${i}=${r}`);break;case"header":default:t.headers.set(i,r);break}return}},qg=e=>ZD({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:Wg(e.querySerializer),url:e.url}),ZD=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let o=i.startsWith("/")?i:`/${i}`,s=(e??"")+o;t&&(s=KD({path:t,url:s}));let a=n?r(n):"";return a.startsWith("?")&&(a=a.substring(1)),a&&(s+=`?${a}`),s},Yg=(e,t)=>{var n;let r={...e,...t};return(n=r.baseUrl)!=null&&n.endsWith("/")&&(r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1)),r.headers=Kg(e.headers,t.headers),r},Kg=(...e)=>{let t=new Headers;for(let n of e){if(!n||typeof n!="object")continue;let r=n instanceof Headers?n.entries():Object.entries(n);for(let[i,o]of r)if(o===null)t.delete(i);else if(Array.isArray(o))for(let s of o)t.append(i,s);else o!==void 0&&t.set(i,typeof o=="object"?JSON.stringify(o):o)}return t},zl=class{constructor(){UD(this,"_fns"),this._fns=[]}clear(){this._fns=[]}exists(t){return this._fns.indexOf(t)!==-1}eject(t){let n=this._fns.indexOf(t);n!==-1&&(this._fns=[...this._fns.slice(0,n),...this._fns.slice(n+1)])}use(t){this._fns=[...this._fns,t]}},JD=()=>({error:new zl,request:new zl,response:new zl}),XD=Wg({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),eN={"Content-Type":"application/json"},Gg=(e={})=>({...jD,headers:eN,parseAs:"auto",querySerializer:XD,...e}),tN=(e={})=>{let t=Yg(Gg(),e),n=()=>({...t}),r=s=>(t=Yg(t,s),n()),i=JD(),o=async s=>{let a={...t,...s,fetch:s.fetch??t.fetch??globalThis.fetch,headers:Kg(t.headers,s.headers)};a.security&&await QD({...a,security:a.security}),a.body&&a.bodySerializer&&(a.body=a.bodySerializer(a.body)),(a.body===void 0||a.body==="")&&a.headers.delete("Content-Type");let l=qg(a),u={redirect:"follow",...a},f=new Request(l,u);for(let g of i.request._fns)f=await g(f,a);let c=a.fetch,h=await c(f);for(let g of i.response._fns)h=await g(h,f,a);let d={request:f,response:h};if(h.ok){if(h.status===204||h.headers.get("Content-Length")==="0")return{data:{},...d};let g=(a.parseAs==="auto"?GD(h.headers.get("Content-Type")):a.parseAs)??"json";if(g==="stream")return{data:h.body,...d};let v=await h[g]();return g==="json"&&(a.responseValidator&&await a.responseValidator(v),a.responseTransformer&&(v=await a.responseTransformer(v))),{data:v,...d}}let m=await h.text();try{m=JSON.parse(m)}catch{}let p=m;for(let g of i.error._fns)p=await g(m,h,f,a);if(p=p||{},a.throwOnError)throw p;return{error:p,...d}};return{buildUrl:qg,connect:s=>o({...s,method:"CONNECT"}),delete:s=>o({...s,method:"DELETE"}),get:s=>o({...s,method:"GET"}),getConfig:n,head:s=>o({...s,method:"HEAD"}),interceptors:i,options:s=>o({...s,method:"OPTIONS"}),patch:s=>o({...s,method:"PATCH"}),post:s=>o({...s,method:"POST"}),put:s=>o({...s,method:"PUT"}),request:o,setConfig:r,trace:s=>o({...s,method:"TRACE"})}},nN=tN,rN=Gg;const Pe=nN((e=>({...e,withCredentials:!0,timeout:6e4,maxBodyLength:104857600,maxContentLength:104857600,throwOnError:!0,parseAs:"json"}))(rN({baseUrl:"https://webchat.botpress.cloud/"}))),iN=e=>(e.client??Pe).delete({url:"/conversations/{id}",...e}),oN=e=>(e.client??Pe).get({url:"/conversations/{id}",...e}),sN=e=>(e.client??Pe).get({url:"/conversations",...e}),aN=e=>(e.client??Pe).post({url:"/conversations",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),lN=e=>(e.client??Pe).get({url:"/conversations/{id}/messages",...e}),uN=e=>(e.client??Pe).get({url:"/conversations/{id}/participants",...e}),cN=e=>(e.client??Pe).post({url:"/conversations/{id}/participants",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),fN=e=>(e.client??Pe).delete({url:"/conversations/{id}/participants/{userId}",...e}),dN=e=>(e.client??Pe).get({url:"/conversations/{id}/participants/{userId}",...e}),hN=e=>(e.client??Pe).delete({url:"/messages/{id}",...e}),pN=e=>(e.client??Pe).get({url:"/messages/{id}",...e}),mN=e=>(e.client??Pe).put({url:"/messages/{id}",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),gN=e=>(e.client??Pe).post({url:"/messages",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),yN=e=>(e.client??Pe).delete({url:"/messages/{id}/feedback",...e}),vN=e=>(e.client??Pe).put({url:"/messages/{id}/feedback",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),bN=e=>(e.client??Pe).delete({url:"/users/me",...e}),wN=e=>(e.client??Pe).get({url:"/users/me",...e}),SN=e=>(e.client??Pe).put({url:"/users/me",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),xN=e=>((e==null?void 0:e.client)??Pe).post({url:"/users/key",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),kN=e=>(e.client??Pe).get({url:"/events/{id}",...e}),EN=e=>(e.client??Pe).post({url:"/events",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),CN=e=>(e.client??Pe).post({url:"/files",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}});let Qg=class extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}};function Ul(e){}function AN(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=Ul,onError:n=Ul,onRetry:r=Ul,onComment:i}=e;let o="",s=!0,a,l="",u="";function f(p){const g=s?p.replace(/^\xEF\xBB\xBF/,""):p,[v,y]=TN(`${o}${g}`);for(const w of v)c(w);o=y,s=!1}function c(p){if(p===""){d();return}if(p.startsWith(":")){i&&i(p.slice(p.startsWith(": ")?2:1));return}const g=p.indexOf(":");if(g!==-1){const v=p.slice(0,g),y=p[g+1]===" "?2:1,w=p.slice(g+y);h(v,w,p);return}h(p,"",p)}function h(p,g,v){switch(p){case"event":u=g;break;case"data":l=`${l}${g}
320
- `;break;case"id":a=g.includes("\0")?void 0:g;break;case"retry":/^\d+$/.test(g)?r(parseInt(g,10)):n(new Qg(`Invalid \`retry\` value: "${g}"`,{type:"invalid-retry",value:g,line:v}));break;default:n(new Qg(`Unknown field "${p.length>20?`${p.slice(0,20)}…`:p}"`,{type:"unknown-field",field:p,value:g,line:v}));break}}function d(){l.length>0&&t({id:a,event:u||void 0,data:l.endsWith(`
321
- `)?l.slice(0,-1):l}),a=void 0,l="",u=""}function m(p={}){o&&p.consume&&c(o),s=!0,a=void 0,l="",u="",o=""}return{feed:f,reset:m}}function TN(e){const t=[];let n="",r=0;for(;r<e.length;){const i=e.indexOf("\r",r),o=e.indexOf(`
319
+ `]})]})};let No;const ND=new Uint8Array(16);function _D(){if(!No&&(No=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!No))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return No(ND)}const Xe=[];for(let e=0;e<256;++e)Xe.push((e+256).toString(16).slice(1));function PD(e,t=0){return Xe[e[t+0]]+Xe[e[t+1]]+Xe[e[t+2]]+Xe[e[t+3]]+"-"+Xe[e[t+4]]+Xe[e[t+5]]+"-"+Xe[e[t+6]]+Xe[e[t+7]]+"-"+Xe[e[t+8]]+Xe[e[t+9]]+"-"+Xe[e[t+10]]+Xe[e[t+11]]+Xe[e[t+12]]+Xe[e[t+13]]+Xe[e[t+14]]+Xe[e[t+15]]}const Pg={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function LD(e,t,n){if(Pg.randomUUID&&!e)return Pg.randomUUID();e=e||{};const r=e.random||(e.rng||_D)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,PD(r)}function lr(e){var s;const{metadata:t,conversationId:n,userId:r}=e,{payload:i,disableInput:o}=Lg(e.payload);return{id:e.id,conversationId:n,authorId:r,timestamp:new Date(e.createdAt),block:i,feedback:(s=e.feedback)==null?void 0:s.value,disableInput:o,metadata:t}}const Lg=e=>{switch(e.type){case"audio":return Fg(e);case"card":return FD(e);case"carousel":return RD(e);case"choice":return $D(e);case"dropdown":return BD(e);case"file":return Rg(e);case"image":return $g(e);case"location":return Bg(e);case"markdown":return zg(e);case"text":return Ug(e);case"video":return Hg(e);case"bloc":return zD(e);case"custom":return{payload:e};default:{const t=e;throw new Error(`Unsuported message type ${t}`)}}},ci=e=>({block:e,type:"bubble"}),Fg=e=>({payload:{type:"audio",url:e.audioUrl}}),FD=e=>({payload:ci(jg(e))}),RD=e=>({payload:{type:"carousel",blocks:e.items.map(t=>jg({...t}))}}),$D=e=>{const t=e.options.map(o=>({title:o.label,value:o.value})),n=e.text,r=LD(),i=ci({type:"text",text:n});return t.length===0?{disableInput:e.disableFreeText,payload:i}:{disableInput:e.disableFreeText,payload:{type:"column",blocks:[i,{type:"row",blocks:t.map(({title:o,value:s})=>({type:"button",variant:"action",text:o,buttonValue:s,groupId:r}))}]}}},BD=e=>{const t=e.options.map(i=>({label:i.label,value:i.value})),n=e.text,r=[{type:"dropdown",label:n??"Select an option",options:t}];return n&&r.unshift({type:"text",text:n}),{disableInput:!0,payload:ci({type:"column",blocks:r})}},Rg=e=>({payload:{type:"file",url:e.fileUrl,title:e.title}}),$g=e=>({payload:{type:"image",url:e.imageUrl}}),Bg=e=>({payload:{type:"location",latitude:e.latitude,longitude:e.longitude,title:e.title??e.address??"View on map"}}),zg=e=>({payload:ci({type:"text",text:e.markdown})}),Ug=e=>({payload:ci({type:"text",text:e.text,value:e.value})}),Hg=e=>({payload:{type:"video",url:e.videoUrl}}),zD=e=>({payload:{type:"column",blocks:e.items.map(n=>{switch(n.type){case"audio":return Fg({...n.payload,type:n.type}).payload;case"file":return Rg({...n.payload,type:n.type}).payload;case"image":return $g({...n.payload,type:n.type}).payload;case"location":return Bg({...n.payload,type:n.type}).payload;case"markdown":return zg({...n.payload,type:n.type}).payload;case"text":return Ug({...n.payload,type:n.type}).payload;case"video":return Hg({...n.payload,type:n.type}).payload;default:throw new Error("Unsuported message type")}})}}),jg=e=>{const t=e.title,n=e.subtitle,r=e.imageUrl,i=e.actions.map(s=>{switch(s.action){case"postback":return{type:"button",variant:"action",text:s.label,buttonValue:s.value,reusable:!0};case"url":return{type:"button",variant:"link",text:s.label,buttonValue:s.value,reusable:!0};case"say":return{type:"button",variant:"action",text:s.label,buttonValue:s.value,reusable:!0};default:throw new Error(`Unknown action type ${s.action}`)}}),o=[];return r&&o.push({type:"image",url:r}),t&&o.push({type:"text",text:`#### ${t}`}),n&&o.push({type:"text",text:n}),i.length>0&&o.push({type:"row",blocks:i}),{type:"column",horizontalAlignment:"center",blocks:[...o]}};var UD=Object.defineProperty,HD=(e,t,n)=>t in e?UD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jD=(e,t,n)=>HD(e,t+"",n),VD=async(e,t)=>{let n=typeof t=="function"?await t(e):t;if(n)return e.scheme==="bearer"?`Bearer ${n}`:e.scheme==="basic"?`Basic ${btoa(n)}`:n},WD={bodySerializer:e=>JSON.stringify(e,(t,n)=>typeof n=="bigint"?n.toString():n)},qD=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},YD=e=>{switch(e){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},KD=e=>{switch(e){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},Vg=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(!t){let a=(e?i:i.map(l=>encodeURIComponent(l))).join(YD(r));switch(r){case"label":return`.${a}`;case"matrix":return`;${n}=${a}`;case"simple":return a;default:return`${n}=${a}`}}let o=qD(r),s=i.map(a=>r==="label"||r==="simple"?e?a:encodeURIComponent(a):_o({allowReserved:e,name:n,value:a})).join(o);return r==="label"||r==="matrix"?o+s:s},_o=({allowReserved:e,name:t,value:n})=>{if(n==null)return"";if(typeof n=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${e?n:encodeURIComponent(n)}`},Wg=({allowReserved:e,explode:t,name:n,style:r,value:i})=>{if(i instanceof Date)return`${n}=${i.toISOString()}`;if(r!=="deepObject"&&!t){let a=[];Object.entries(i).forEach(([u,f])=>{a=[...a,u,e?f:encodeURIComponent(f)]});let l=a.join(",");switch(r){case"form":return`${n}=${l}`;case"label":return`.${l}`;case"matrix":return`;${n}=${l}`;default:return l}}let o=KD(r),s=Object.entries(i).map(([a,l])=>_o({allowReserved:e,name:r==="deepObject"?`${n}[${a}]`:a,value:l})).join(o);return r==="label"||r==="matrix"?o+s:s},GD=/\{[^{}]+\}/g,QD=({path:e,url:t})=>{let n=t,r=t.match(GD);if(r)for(let i of r){let o=!1,s=i.substring(1,i.length-1),a="simple";s.endsWith("*")&&(o=!0,s=s.substring(0,s.length-1)),s.startsWith(".")?(s=s.substring(1),a="label"):s.startsWith(";")&&(s=s.substring(1),a="matrix");let l=e[s];if(l==null)continue;if(Array.isArray(l)){n=n.replace(i,Vg({explode:o,name:s,style:a,value:l}));continue}if(typeof l=="object"){n=n.replace(i,Wg({explode:o,name:s,style:a,value:l}));continue}if(a==="matrix"){n=n.replace(i,`;${_o({name:s,value:l})}`);continue}let u=encodeURIComponent(a==="label"?`.${l}`:l);n=n.replace(i,u)}return n},qg=({allowReserved:e,array:t,object:n}={})=>r=>{let i=[];if(r&&typeof r=="object")for(let o in r){let s=r[o];if(s!=null){if(Array.isArray(s)){i=[...i,Vg({allowReserved:e,explode:!0,name:o,style:"form",value:s,...t})];continue}if(typeof s=="object"){i=[...i,Wg({allowReserved:e,explode:!0,name:o,style:"deepObject",value:s,...n})];continue}i=[...i,_o({allowReserved:e,name:o,value:s})]}}return i.join("&")},ZD=e=>{var t;if(!e)return"stream";let n=(t=e.split(";")[0])==null?void 0:t.trim();if(n){if(n.startsWith("application/json")||n.endsWith("+json"))return"json";if(n==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(r=>n.startsWith(r)))return"blob";if(n.startsWith("text/"))return"text"}},JD=async({security:e,...t})=>{for(let n of e){let r=await VD(n,t.auth);if(!r)continue;let i=n.name??"Authorization";switch(n.in){case"query":t.query||(t.query={}),t.query[i]=r;break;case"cookie":t.headers.append("Cookie",`${i}=${r}`);break;case"header":default:t.headers.set(i,r);break}return}},Yg=e=>XD({baseUrl:e.baseUrl,path:e.path,query:e.query,querySerializer:typeof e.querySerializer=="function"?e.querySerializer:qg(e.querySerializer),url:e.url}),XD=({baseUrl:e,path:t,query:n,querySerializer:r,url:i})=>{let o=i.startsWith("/")?i:`/${i}`,s=(e??"")+o;t&&(s=QD({path:t,url:s}));let a=n?r(n):"";return a.startsWith("?")&&(a=a.substring(1)),a&&(s+=`?${a}`),s},Kg=(e,t)=>{var n;let r={...e,...t};return(n=r.baseUrl)!=null&&n.endsWith("/")&&(r.baseUrl=r.baseUrl.substring(0,r.baseUrl.length-1)),r.headers=Gg(e.headers,t.headers),r},Gg=(...e)=>{let t=new Headers;for(let n of e){if(!n||typeof n!="object")continue;let r=n instanceof Headers?n.entries():Object.entries(n);for(let[i,o]of r)if(o===null)t.delete(i);else if(Array.isArray(o))for(let s of o)t.append(i,s);else o!==void 0&&t.set(i,typeof o=="object"?JSON.stringify(o):o)}return t},Hl=class{constructor(){jD(this,"_fns"),this._fns=[]}clear(){this._fns=[]}exists(t){return this._fns.indexOf(t)!==-1}eject(t){let n=this._fns.indexOf(t);n!==-1&&(this._fns=[...this._fns.slice(0,n),...this._fns.slice(n+1)])}use(t){this._fns=[...this._fns,t]}},eN=()=>({error:new Hl,request:new Hl,response:new Hl}),tN=qg({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),nN={"Content-Type":"application/json"},Qg=(e={})=>({...WD,headers:nN,parseAs:"auto",querySerializer:tN,...e}),rN=(e={})=>{let t=Kg(Qg(),e),n=()=>({...t}),r=s=>(t=Kg(t,s),n()),i=eN(),o=async s=>{let a={...t,...s,fetch:s.fetch??t.fetch??globalThis.fetch,headers:Gg(t.headers,s.headers)};a.security&&await JD({...a,security:a.security}),a.body&&a.bodySerializer&&(a.body=a.bodySerializer(a.body)),(a.body===void 0||a.body==="")&&a.headers.delete("Content-Type");let l=Yg(a),u={redirect:"follow",...a},f=new Request(l,u);for(let g of i.request._fns)f=await g(f,a);let c=a.fetch,h=await c(f);for(let g of i.response._fns)h=await g(h,f,a);let d={request:f,response:h};if(h.ok){if(h.status===204||h.headers.get("Content-Length")==="0")return{data:{},...d};let g=(a.parseAs==="auto"?ZD(h.headers.get("Content-Type")):a.parseAs)??"json";if(g==="stream")return{data:h.body,...d};let v=await h[g]();return g==="json"&&(a.responseValidator&&await a.responseValidator(v),a.responseTransformer&&(v=await a.responseTransformer(v))),{data:v,...d}}let m=await h.text();try{m=JSON.parse(m)}catch{}let p=m;for(let g of i.error._fns)p=await g(m,h,f,a);if(p=p||{},a.throwOnError)throw p;return{error:p,...d}};return{buildUrl:Yg,connect:s=>o({...s,method:"CONNECT"}),delete:s=>o({...s,method:"DELETE"}),get:s=>o({...s,method:"GET"}),getConfig:n,head:s=>o({...s,method:"HEAD"}),interceptors:i,options:s=>o({...s,method:"OPTIONS"}),patch:s=>o({...s,method:"PATCH"}),post:s=>o({...s,method:"POST"}),put:s=>o({...s,method:"PUT"}),request:o,setConfig:r,trace:s=>o({...s,method:"TRACE"})}},iN=rN,oN=Qg;const Pe=iN((e=>({...e,withCredentials:!0,timeout:6e4,maxBodyLength:104857600,maxContentLength:104857600,throwOnError:!0,parseAs:"json"}))(oN({baseUrl:"https://webchat.botpress.cloud/"}))),sN=e=>(e.client??Pe).delete({url:"/conversations/{id}",...e}),aN=e=>(e.client??Pe).get({url:"/conversations/{id}",...e}),lN=e=>(e.client??Pe).get({url:"/conversations",...e}),uN=e=>(e.client??Pe).post({url:"/conversations",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),cN=e=>(e.client??Pe).get({url:"/conversations/{id}/messages",...e}),fN=e=>(e.client??Pe).get({url:"/conversations/{id}/participants",...e}),dN=e=>(e.client??Pe).post({url:"/conversations/{id}/participants",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),hN=e=>(e.client??Pe).delete({url:"/conversations/{id}/participants/{userId}",...e}),pN=e=>(e.client??Pe).get({url:"/conversations/{id}/participants/{userId}",...e}),mN=e=>(e.client??Pe).delete({url:"/messages/{id}",...e}),gN=e=>(e.client??Pe).get({url:"/messages/{id}",...e}),yN=e=>(e.client??Pe).put({url:"/messages/{id}",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),vN=e=>(e.client??Pe).post({url:"/messages",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),bN=e=>(e.client??Pe).delete({url:"/messages/{id}/feedback",...e}),wN=e=>(e.client??Pe).put({url:"/messages/{id}/feedback",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),SN=e=>(e.client??Pe).delete({url:"/users/me",...e}),xN=e=>(e.client??Pe).get({url:"/users/me",...e}),kN=e=>(e.client??Pe).put({url:"/users/me",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),EN=e=>((e==null?void 0:e.client)??Pe).post({url:"/users/key",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),CN=e=>(e.client??Pe).get({url:"/events/{id}",...e}),AN=e=>(e.client??Pe).post({url:"/events",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}}),TN=e=>(e.client??Pe).post({url:"/files",...e,headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}});let Zg=class extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}};function jl(e){}function IN(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=jl,onError:n=jl,onRetry:r=jl,onComment:i}=e;let o="",s=!0,a,l="",u="";function f(p){const g=s?p.replace(/^\xEF\xBB\xBF/,""):p,[v,y]=ON(`${o}${g}`);for(const w of v)c(w);o=y,s=!1}function c(p){if(p===""){d();return}if(p.startsWith(":")){i&&i(p.slice(p.startsWith(": ")?2:1));return}const g=p.indexOf(":");if(g!==-1){const v=p.slice(0,g),y=p[g+1]===" "?2:1,w=p.slice(g+y);h(v,w,p);return}h(p,"",p)}function h(p,g,v){switch(p){case"event":u=g;break;case"data":l=`${l}${g}
320
+ `;break;case"id":a=g.includes("\0")?void 0:g;break;case"retry":/^\d+$/.test(g)?r(parseInt(g,10)):n(new Zg(`Invalid \`retry\` value: "${g}"`,{type:"invalid-retry",value:g,line:v}));break;default:n(new Zg(`Unknown field "${p.length>20?`${p.slice(0,20)}…`:p}"`,{type:"unknown-field",field:p,value:g,line:v}));break}}function d(){l.length>0&&t({id:a,event:u||void 0,data:l.endsWith(`
321
+ `)?l.slice(0,-1):l}),a=void 0,l="",u=""}function m(p={}){o&&p.consume&&c(o),s=!0,a=void 0,l="",u="",o=""}return{feed:f,reset:m}}function ON(e){const t=[];let n="",r=0;for(;r<e.length;){const i=e.indexOf("\r",r),o=e.indexOf(`
322
322
  `,r);let s=-1;if(i!==-1&&o!==-1?s=Math.min(i,o):i!==-1?i===e.length-1?s=-1:s=i:o!==-1&&(s=o),s===-1){n=e.slice(r);break}else{const a=e.slice(r,s);t.push(a),r=s+1,e[r-1]==="\r"&&e[r]===`
323
- `&&r++}}return[t,n]}class Zg extends Event{constructor(t,n){var r,i;super(t),this.code=(r=n==null?void 0:n.code)!=null?r:void 0,this.message=(i=n==null?void 0:n.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(Jg(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(Jg(this),n)}}function IN(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function Hl(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(Hl).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${Hl(e.cause)}`:e.message:`${e}`}function Jg(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var Xg=e=>{throw TypeError(e)},jl=(e,t,n)=>t.has(e)||Xg("Cannot "+n),be=(e,t,n)=>(jl(e,t,"read from private field"),n?n.call(e):t.get(e)),Ke=(e,t,n)=>t.has(e)?Xg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Le=(e,t,n,r)=>(jl(e,t,"write to private field"),t.set(e,n),n),Qt=(e,t,n)=>(jl(e,t,"access private method"),n),dt,_n,ur,Po,Lo,fi,cr,di,pn,fr,dr,hr,hi,Lt,Vl,Wl,ql,ey,Yl,Kl,pi,Gl,Ql;class Fo extends EventTarget{constructor(t,n){var r,i;super(),Ke(this,Lt),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Ke(this,dt),Ke(this,_n),Ke(this,ur),Ke(this,Po),Ke(this,Lo),Ke(this,fi),Ke(this,cr),Ke(this,di,null),Ke(this,pn),Ke(this,fr),Ke(this,dr,null),Ke(this,hr,null),Ke(this,hi,null),Ke(this,Wl,async o=>{var s;be(this,fr).reset();const{body:a,redirected:l,status:u,headers:f}=o;if(u===204){Qt(this,Lt,pi).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?Le(this,ur,new URL(o.url)):Le(this,ur,void 0),u!==200){Qt(this,Lt,pi).call(this,`Non-200 status code (${u})`,u);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){Qt(this,Lt,pi).call(this,'Invalid content type, expected "text/event-stream"',u);return}if(be(this,dt)===this.CLOSED)return;Le(this,dt,this.OPEN);const c=new Event("open");if((s=be(this,hi))==null||s.call(this,c),this.dispatchEvent(c),typeof a!="object"||!a||!("getReader"in a)){Qt(this,Lt,pi).call(this,"Invalid response body, expected a web ReadableStream",u),this.close();return}const h=new TextDecoder,d=a.getReader();let m=!0;do{const{done:p,value:g}=await d.read();g&&be(this,fr).feed(h.decode(g,{stream:!p})),p&&(m=!1,be(this,fr).reset(),Qt(this,Lt,Gl).call(this))}while(m)}),Ke(this,ql,o=>{Le(this,pn,void 0),!(o.name==="AbortError"||o.type==="aborted")&&Qt(this,Lt,Gl).call(this,Hl(o))}),Ke(this,Yl,o=>{typeof o.id=="string"&&Le(this,di,o.id);const s=new MessageEvent(o.event||"message",{data:o.data,origin:be(this,ur)?be(this,ur).origin:be(this,_n).origin,lastEventId:o.id||""});be(this,hr)&&(!o.event||o.event==="message")&&be(this,hr).call(this,s),this.dispatchEvent(s)}),Ke(this,Kl,o=>{Le(this,fi,o)}),Ke(this,Ql,()=>{Le(this,cr,void 0),be(this,dt)===this.CONNECTING&&Qt(this,Lt,Vl).call(this)});try{if(t instanceof URL)Le(this,_n,t);else if(typeof t=="string")Le(this,_n,new URL(t,ON()));else throw new Error("Invalid URL")}catch{throw IN("An invalid or illegal string was specified")}Le(this,fr,AN({onEvent:be(this,Yl),onRetry:be(this,Kl)})),Le(this,dt,this.CONNECTING),Le(this,fi,3e3),Le(this,Lo,(r=n==null?void 0:n.fetch)!=null?r:globalThis.fetch),Le(this,Po,(i=n==null?void 0:n.withCredentials)!=null?i:!1),Qt(this,Lt,Vl).call(this)}get readyState(){return be(this,dt)}get url(){return be(this,_n).href}get withCredentials(){return be(this,Po)}get onerror(){return be(this,dr)}set onerror(t){Le(this,dr,t)}get onmessage(){return be(this,hr)}set onmessage(t){Le(this,hr,t)}get onopen(){return be(this,hi)}set onopen(t){Le(this,hi,t)}addEventListener(t,n,r){const i=n;super.addEventListener(t,i,r)}removeEventListener(t,n,r){const i=n;super.removeEventListener(t,i,r)}close(){be(this,cr)&&clearTimeout(be(this,cr)),be(this,dt)!==this.CLOSED&&(be(this,pn)&&be(this,pn).abort(),Le(this,dt,this.CLOSED),Le(this,pn,void 0))}}dt=new WeakMap,_n=new WeakMap,ur=new WeakMap,Po=new WeakMap,Lo=new WeakMap,fi=new WeakMap,cr=new WeakMap,di=new WeakMap,pn=new WeakMap,fr=new WeakMap,dr=new WeakMap,hr=new WeakMap,hi=new WeakMap,Lt=new WeakSet,Vl=function(){Le(this,dt,this.CONNECTING),Le(this,pn,new AbortController),be(this,Lo)(be(this,_n),Qt(this,Lt,ey).call(this)).then(be(this,Wl)).catch(be(this,ql))},Wl=new WeakMap,ql=new WeakMap,ey=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...be(this,di)?{"Last-Event-ID":be(this,di)}:void 0},cache:"no-store",signal:(e=be(this,pn))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},Yl=new WeakMap,Kl=new WeakMap,pi=function(e,t){var n;be(this,dt)!==this.CLOSED&&Le(this,dt,this.CLOSED);const r=new Zg("error",{code:t,message:e});(n=be(this,dr))==null||n.call(this,r),this.dispatchEvent(r)},Gl=function(e,t){var n;if(be(this,dt)===this.CLOSED)return;Le(this,dt,this.CONNECTING);const r=new Zg("error",{code:t,message:e});(n=be(this,dr))==null||n.call(this,r),this.dispatchEvent(r),Le(this,cr,setTimeout(be(this,Ql),be(this,fi)))},Ql=new WeakMap,Fo.CONNECTING=0,Fo.OPEN=1,Fo.CLOSED=2;function ON(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}async function MN(e){var t;const n=await e.clone().json();if((t=n==null?void 0:n.id)!=null&&t.startsWith("err_")){const r=new Error(n.message);throw r.id=n.id,r.code=n.code,r.type=n.type,r}return e}const ty=()=>{const e={};return{on:(t,n)=>{var r;return e[t]||(e[t]=new Set),(r=e[t])==null||r.add(n),()=>{var i;return(i=e[t])==null?void 0:i.delete(n)}},emit:(t,n)=>{var r,i;(r=e[t])==null||r.forEach(o=>o(n)),(i=e["*"])==null||i.forEach(o=>o({type:t,payload:n}))}}},Ue=e=>e.data,ny=10,ry=3e3,DN="60000",NN={throwOnError:!0},_N=({conversationId:e,userToken:t,clientId:n,apiUrl:r,adminSecret:i})=>{let o=0,s=null;const a=ty(),l=()=>{s&&s.close();const u=`${`${r||Pe.getConfig().baseUrl}/${n}`}/initialize${e?`?conversationId=${e}`:""}`,f={...i?{"x-admin-secret":i}:{},...t?{"x-user-key":t}:{}};s=oy(u,f),s.addEventListener("open",()=>a.emit("open")),s.addEventListener("error",c=>{o<ny?(o++,setTimeout(()=>l(),ry)):a.emit("error",c)}),s.addEventListener("message",c=>{const h=iy(c.data);a.emit(h.type,h.data)})};return l(),a.on},PN=({userKey:e,clientId:t,apiUrl:n,customHeaders:r,advancedOptions:i})=>{const o={"x-user-key":e,...r},s=`${n||Pe.getConfig().baseUrl}/${t}`,a={...NN,baseUrl:s};return Pe.interceptors.response._fns.length===0&&Pe.interceptors.response.use(MN),{createConversation:()=>aN({...a,headers:o,body:{}}).then(Ue),getConversation:({conversationId:l})=>oN({...a,headers:o,path:{id:l}}).then(Ue),deleteConversation:({conversationId:l})=>iN({...a,headers:o,path:{id:l}}).then(Ue),listConversations:({nextToken:l})=>sN({...a,headers:o,query:{nextToken:l}}).then(Ue),listConversationMessages:({conversationId:l,nextToken:u})=>lN({...a,headers:o,path:{id:l},query:{nextToken:u}}).then(Ue),addParticipant:({conversationId:l,userId:u})=>cN({...a,headers:o,path:{id:l},body:{userId:u}}).then(Ue),removeParticipant:({conversationId:l,userId:u})=>fN({...a,headers:o,path:{id:l,userId:u}}).then(Ue),getParticipant:({conversationId:l,userId:u})=>dN({...a,headers:o,path:{id:l,userId:u}}).then(Ue),listParticipants:({conversationId:l,nextToken:u})=>uN({...a,headers:o,path:{id:l},query:{nextToken:u}}).then(Ue),createMessage:l=>gN({...a,headers:o,body:l}).then(Ue),updateMessage:({messageId:l,...u})=>mN({...a,headers:o,path:{id:l},body:u}).then(Ue),getMessage:({messageId:l})=>pN({...a,headers:o,path:{id:l}}).then(Ue),deleteMessage:({messageId:l})=>hN({...a,headers:o,path:{id:l}}).then(Ue),createFile:l=>CN({...a,headers:o,body:l}).then(Ue),getUser:()=>wN({...a,headers:o}).then(Ue),updateUser:l=>SN({...a,headers:o,body:l}).then(Ue),deleteUser:()=>bN({...a,headers:o}).then(Ue),createEvent:l=>EN({...a,headers:o,body:l}).then(Ue),getEvent:({eventId:l})=>kN({...a,headers:o,path:{id:l}}).then(Ue),addMessageFeedback:({messageId:l,...u})=>vN({...a,headers:o,path:{id:l},body:u}).then(Ue),removeMessageFeedback:({messageId:l})=>yN({...a,headers:o,path:{id:l}}).then(Ue),generateUserKey:({adminSecret:l,...u})=>xN({...a,headers:{"x-admin-secret":l},body:u}).then(Ue),listenConversation:({conversationId:l})=>{let u=0,f=null;const c=ty(),h=()=>{f&&f.close();const d=`${s}/conversations/${l}/listen`,m=i==null?void 0:i.eventSource;f=m?m({url:d,headers:o}):oy(d,o),f.addEventListener("open",()=>c.emit("open")),f.addEventListener("error",p=>{u<ny?(u++,setTimeout(()=>h(),ry)):c.emit("error",p)}),f.addEventListener("message",p=>{const g=iy(p.data);c.emit(g.type,g.data)})};return h(),c.on}}},iy=e=>{try{return JSON.parse(e)}catch{return e}},oy=(e,t)=>new Fo(e,{fetch:(n,r)=>fetch(n,{...r,headers:{...r==null?void 0:r.headers,...t,timeout:DN}})}),LN=async({apiUrl:e,clientId:t,adminSecret:n,clientHeaders:r,emitter:i,conversationId:o,userToken:s})=>new Promise(a=>{const l=_N({apiUrl:e,clientId:t,userToken:s,conversationId:o,adminSecret:n}),u=l("init",({conversation:f,messages:c,participants:h,user:d})=>{const m=PN({clientId:t,apiUrl:e,userKey:d.userKey,customHeaders:r});m.createEvent({conversationId:f.id,payload:{type:"conversation_started",data:{}}}).then(({event:p})=>{var g,v;(v=(g=p.payload.data)==null?void 0:g.status)!=null&&v.isInitial&&i.emit("conversation",f.id)}),a({on:l,conversation:f,messages:c,participants:h,user:d,client:m,onCleanup:()=>{u()}})})}),FN={webchat:"#9C27B0",client:"#2196F3",store:"#4CAF50",events:"#00BCD4"},RN={debug:"#9E9E9E",info:"#2196F3",warn:"#FF9800",error:"#F44336"};let sy=!1,Zl=null,ay=Date.now();const $N=e=>{sy=e,ay=Date.now()},BN=e=>{Zl=e},zN=()=>{const e=Date.now()-ay,t=Math.floor(e/1e3),n=e%1e3;return`+${t}.${n.toString().padStart(3,"0")}s`},UN=e=>e===void 0?"undefined":e===null?"null":e instanceof Error?{error:e.message,stack:e.stack}:e,Ro=e=>{const t=FN[e]||"#666",n=(r,...i)=>{if(!sy&&r!=="warn"&&r!=="error")return;const o=zN(),s=`%c[bp:${e}]%c ${o} %c${r.toUpperCase()}%c`,a=[`color: ${t}; font-weight: bold;`,"color: #999; font-size: 10px;",`color: ${RN[r]}; font-weight: bold;`,"color: inherit;"],l=i.map(UN);if(console[r](s,...a,...l),Zl){const[u,f]=i;Zl(`debug:${e}:${r}`,{message:typeof u=="string"?u:void 0,...typeof f=="object"&&f!==null?f:{}})}};return{debug:(...r)=>n("debug",...r),info:(...r)=>n("info",...r),warn:(...r)=>n("warn",...r),error:(...r)=>n("error",...r)}},ly={webchat:Ro("webchat"),client:Ro("client"),store:Ro("store"),events:Ro("events")};function uy(){const[e,t]=M.useState(!1),n=M.useRef(null);return{state:e,setState:(r,i)=>{if(t(r),!r)return()=>{};if(n.current=new Date,!i)return()=>{};const o=setTimeout(()=>{const s=n.current;s&&new Date().getTime()-s.getTime()>i&&t(!1)},i+100);return()=>clearTimeout(o)}}}const mi=ly.webchat;function cy({apiUrl:e="https://webchat.botpress.cloud",clientId:t,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:o,playNotificationSound:s,...a}){const l=Sp(n,r),u=l(O=>O.conversationId),f=l(O=>O.user),c=l(O=>O.setConversationId),h=l(O=>O.setUser),{state:d,setState:m}=uy(),{state:p,setState:g}=uy(),v=M.useMemo(()=>nc(),[]),[y,w]=M.useState("connecting"),[A,k]=M.useState(void 0),[E,I]=M.useState(void 0),D=M.useRef(null),P=Vw(a.conversationId,a.userToken,u,f==null?void 0:f.userToken);M.useEffect(()=>{let O=!1;mi.info("starting initialization",{clientId:t,apiUrl:e,storageKey:n});const B=async()=>{var F;await T(P),O&&(mi.debug("initialization completed but effect was cleaned up, tearing down"),(F=D.current)==null||F.call(D),D.current=null)},L=Hw(t,e);if(L){mi.error("configuration error",L),I(L),w("error");return}return B(),()=>{O=!0,D.current&&(D.current(),D.current=null)}},[a.conversationId,a.userToken,t,e]);const T=async({conversationId:O,userToken:B})=>{var V;(V=D.current)==null||V.call(D),I(void 0),m(!1),g(!1),w("connecting");const{on:L,conversation:F,messages:R,participants:N,user:H,client:z,onCleanup:W}=await LN({apiUrl:e,clientId:t,clientHeaders:o,emitter:v,adminSecret:i,conversationId:O,userToken:B});k(z),c(F.id),h({userId:H.id,userToken:H.userKey});const b=wp(F.id),_=R.reverse().map(lr).filter(Boolean);b.getState().setMessages(_);const j=kp(F.id);j.getState().setParticipants(N);const S=[W,L("open",()=>{I(void 0),w("connected")}),L("error",Y=>{mi.error("connection error",{error:Y,conversationId:F.id}),I(q=>q||Pr(Y)),w("error"),v.emit("error",new Error(`Connection to conversation lost: ${Y==null?void 0:Y.message}`))}),L("message_created",Y=>{const q=lr(Y);b.getState().saveMessage(q),H.id!==q.authorId&&(s==null||s(),m(!1),g(!1),v.emit("isTyping",{isTyping:!1,timeout:0})),v.emit("message",q)}),L("message_updated",Y=>{const q=lr(Y);b.getState().saveMessage(q)}),L("message_status_changed",Y=>{var q;Y.newStatus==="processing"&&b.getState().updateMessage((q=Y.message.metadata)==null?void 0:q.clientMessageId,{status:Y.newStatus})}),L("typing_stopped",()=>{m(!1),g(!1)}),L("typing_started",()=>{m(!0,5e3),g(!0,5e3),v.emit("isTyping",{isTyping:!0,timeout:5e3})}),L("participant_added",Y=>{j.getState().addParticipant(Y.participant),v.emit("participantAdded",Y.participant)}),L("participant_removed",Y=>{j.getState().removeParticipant(Y.participantId),v.emit("participantRemoved",Y.participantId)}),L("webchat_visibility",Y=>v.emit("webchatVisibility",Y.visibility)),L("webchat_config",Y=>v.emit("webchatConfig",Y.config)),L("custom",Y=>v.emit("customEvent",Y.event))];w("connected"),mi.info("client fully connected with event handlers ready",{conversationId:F.id}),D.current=()=>{S.forEach(Y=>Y())}};return{clientState:y,httpClient:A,error:E,activeConversationId:u,userCredentials:f,isTyping:d,isAwaitingResponse:p,openConversation:T,setAwaitingResponse:g,emitter:v,setError:I,setClientState:w}}const fy=M.createContext(null);function $o(){const e=M.useContext(fy);if(!e)throw new Error("useWebchatContext must be used inside <WebchatProvider>");return e}function dy({clientId:e,apiUrl:t,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:o,children:s,...a}){var k;const{clientState:l,httpClient:u,error:f,activeConversationId:c,userCredentials:h,isTyping:d,isAwaitingResponse:m,openConversation:p,setClientState:g,setError:v,setAwaitingResponse:y,emitter:w}=cy({apiUrl:t,clientId:e,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:o,conversationId:a.conversationId,userToken:(k=a.userCredentials)==null?void 0:k.userToken}),A={client:u,clientState:l,setClientState:g,conversationId:c,userCredentials:h,error:f,setError:v,isTyping:d,isAwaitingResponse:m,openConversation:p,setAwaitingResponse:y,emitter:w};return x.jsx(fy.Provider,{value:A,children:s})}const Jl=({children:e,className:t,uploadFile:n,allowFileUpload:r,storageKey:i,conversationId:o,...s})=>{const{container:a}=ye,l=Qn(g=>g.setMessageContainerRef),f=xp(o||"default",i)(g=>g.uploadFile),[c,h]=M.useState(0),d=M.useRef(null);M.useEffect(()=>{l(d)},[d,l]);const m=M.useCallback(g=>{n&&(g.forEach(v=>f(v,n)),h(0))},[f,n]),{getRootProps:p}=Og({noClick:!0,noKeyboard:!0,onDrop:m,disabled:!(r&&n),onDragEnter:()=>h(g=>g+1),onDragLeave:()=>h(g=>g-1)});return x.jsxs("div",{...s,className:ar(a.className,t),...p(),ref:d,children:[x.jsxs("div",{"data-hover":c>0,...a.dropzone.overlay,children:["Drop files to upload",x.jsx(_A,{style:{width:"50px"}})]}),x.jsx(Dg,{children:e})]})};Jl.displayName="Container";const hy=M.forwardRef(({onClick:e,imgUrl:t,...n},r)=>{const{fab:i}=ye,{container:o,icon:s,image:a}=i??{};return t?x.jsx("img",{src:t,role:"button",tabIndex:0,...a,draggable:"false",onClick:e}):x.jsx("div",{...n,...o,ref:r,onClick:e,children:x.jsx("div",{...s})})});hy.displayName="Fab";function Zt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function HN(e,t){const n=C.createContext(t),r=o=>{const{children:s,...a}=o,l=C.useMemo(()=>a,Object.values(a));return x.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function i(o){const s=C.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function py(e,t=[]){let n=[];function r(o,s){const a=C.createContext(s),l=n.length;n=[...n,s];const u=c=>{var v;const{scope:h,children:d,...m}=c,p=((v=h==null?void 0:h[e])==null?void 0:v[l])||a,g=C.useMemo(()=>m,Object.values(m));return x.jsx(p.Provider,{value:g,children:d})};u.displayName=o+"Provider";function f(c,h){var p;const d=((p=h==null?void 0:h[e])==null?void 0:p[l])||a,m=C.useContext(d);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[u,f]}const i=()=>{const o=n.map(s=>C.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return C.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,jN(i,...t)]}function jN(...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(o){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(o)[`__scope${u}`];return{...a,...c}},{});return C.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var VN=C[" useInsertionEffect ".trim().toString()]||en;function my({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,s]=WN({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:i;{const f=C.useRef(e!==void 0);C.useEffect(()=>{const c=f.current;c!==a&&console.warn(`${r} is changing from ${c?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const u=C.useCallback(f=>{var c;if(a){const h=qN(f)?f(e):f;h!==e&&((c=s.current)==null||c.call(s,h))}else o(f)},[a,e,o,s]);return[l,u]}function WN({defaultProp:e,onChange:t}){const[n,r]=C.useState(e),i=C.useRef(n),o=C.useRef(t);return VN(()=>{o.current=t},[t]),C.useEffect(()=>{var s;i.current!==n&&((s=o.current)==null||s.call(o,n),i.current=n)},[n,i]),[n,r,o]}function qN(e){return typeof e=="function"}function gy(e){const t=YN(e),n=C.forwardRef((r,i)=>{const{children:o,...s}=r,a=C.Children.toArray(o),l=a.find(GN);if(l){const u=l.props.children,f=a.map(c=>c===l?C.Children.count(u)>1?C.Children.only(null):C.isValidElement(u)?u.props.children:null:c);return x.jsx(t,{...s,ref:i,children:C.isValidElement(u)?C.cloneElement(u,void 0,f):null})}return x.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function YN(e){const t=C.forwardRef((n,r)=>{const{children:i,...o}=n;if(C.isValidElement(i)){const s=ZN(i),a=QN(o,i.props);return i.type!==C.Fragment&&(a.ref=r?ns(r,s):s),C.cloneElement(i,a)}return C.Children.count(i)>1?C.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var KN=Symbol("radix.slottable");function GN(e){return C.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===KN}function QN(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const l=o(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function ZN(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var JN=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ft=JN.reduce((e,t)=>{const n=gy(`Primitive.${t}`),r=C.forwardRef((i,o)=>{const{asChild:s,...a}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function XN(e,t){e&&$u.flushSync(()=>e.dispatchEvent(t))}function e2(e,t){return C.useReducer((n,r)=>t[n][r]??n,e)}var Bo=e=>{const{present:t,children:n}=e,r=t2(t),i=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),o=tn(r.ref,n2(i));return typeof n=="function"||r.isPresent?C.cloneElement(i,{ref:o}):null};Bo.displayName="Presence";function t2(e){const[t,n]=C.useState(),r=C.useRef(null),i=C.useRef(e),o=C.useRef("none"),s=e?"mounted":"unmounted",[a,l]=e2(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const u=zo(r.current);o.current=a==="mounted"?u:"none"},[a]),en(()=>{const u=r.current,f=i.current;if(f!==e){const h=o.current,d=zo(u);e?l("MOUNT"):d==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&h!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),en(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,c=d=>{const p=zo(r.current).includes(CSS.escape(d.animationName));if(d.target===t&&p&&(l("ANIMATION_END"),!i.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=d=>{d.target===t&&(o.current=zo(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:C.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function zo(e){return(e==null?void 0:e.animationName)||"none"}function n2(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var r2=C[" useId ".trim().toString()]||(()=>{}),i2=0;function Uo(e){const[t,n]=C.useState(r2());return en(()=>{n(r=>r??String(i2++))},[e]),e||(t?`radix-${t}`:"")}var Ho="Collapsible",[o2]=py(Ho),[s2,Xl]=o2(Ho),yy=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:s,...a}=e,[l,u]=my({prop:r,defaultProp:i??!1,onChange:s,caller:Ho});return x.jsx(s2,{scope:n,disabled:o,contentId:Uo(),open:l,onOpenToggle:C.useCallback(()=>u(f=>!f),[u]),children:x.jsx(Ft.div,{"data-state":tu(l),"data-disabled":o?"":void 0,...a,ref:t})})});yy.displayName=Ho;var vy="CollapsibleTrigger",by=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=Xl(vy,n);return x.jsx(Ft.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":tu(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Zt(e.onClick,i.onOpenToggle)})});by.displayName=vy;var eu="CollapsibleContent",wy=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=Xl(eu,e.__scopeCollapsible);return x.jsx(Bo,{present:n||i.open,children:({present:o})=>x.jsx(a2,{...r,ref:t,present:o})})});wy.displayName=eu;var a2=C.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,s=Xl(eu,n),[a,l]=C.useState(r),u=C.useRef(null),f=tn(t,u),c=C.useRef(0),h=c.current,d=C.useRef(0),m=d.current,p=s.open||a,g=C.useRef(p),v=C.useRef(void 0);return C.useEffect(()=>{const y=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(y)},[]),en(()=>{const y=u.current;if(y){v.current=v.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const w=y.getBoundingClientRect();c.current=w.height,d.current=w.width,g.current||(y.style.transitionDuration=v.current.transitionDuration,y.style.animationName=v.current.animationName),l(r)}},[s.open,r]),x.jsx(Ft.div,{"data-state":tu(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!p,...o,ref:f,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:p&&i})});function tu(e){return e?"open":"closed"}var l2=yy,u2=wy;const nu=({restartConversation:e,...t})=>{var o,s;const{header:n}=ye,{showInputModal:r}=qa(),i=async a=>{a.stopPropagation(),r?r({title:"Create New Conversation",description:"This will clear the current conversation and start a new one.",confirmButtonText:"New conversation",cancelButtonText:"Cancel"}).then(()=>e()):e()};return x.jsx(YA,{...t,...(s=(o=n==null?void 0:n.content)==null?void 0:o.actions)==null?void 0:s.icons,"aria-label":"Restart Conversation Button",tabIndex:0,role:"button",onClick:i})},ru=({onClick:e,...t})=>{const{header:n}=ye,r=i=>{i.stopPropagation(),e==null||e()};return x.jsx(up,{...t,...n.content.actions.icons,role:"button",tabIndex:0,"aria-label":"Close Chatbot Button",onClick:r,onKeyDown:i=>{i.key==="Enter"&&r(i)}})},c2=({onClick:e,...t})=>{const{header:n}=ye,r=i=>{i.stopPropagation(),e==null||e()};return x.jsx(rp,{...t,...n.content.actions.icons,role:"button",tabIndex:0,"aria-label":"Show Recent Conversations Button",onClick:r,onKeyDown:i=>{i.key==="Enter"&&r(i)}})},gi=({icon:e,title:t,link:n,...r})=>{var s,a,l,u,f,c,h,d,m,p,g,v;const{header:i}=ye,o=e??PA;return t?n?x.jsxs("a",{...r,...(a=(s=i.expandedContent)==null?void 0:s.descriptionItems)==null?void 0:a.container,href:n,target:"_blank",rel:"noreferrer noopener",children:[x.jsx(o,{...(u=(l=i.expandedContent)==null?void 0:l.descriptionItems)==null?void 0:u.icon}),x.jsx("p",{...(c=(f=i.expandedContent)==null?void 0:f.descriptionItems)==null?void 0:c.link,children:t})]}):x.jsxs("div",{...r,...(d=(h=i.expandedContent)==null?void 0:h.descriptionItems)==null?void 0:d.container,children:[x.jsx(o,{...(p=(m=i.expandedContent)==null?void 0:m.descriptionItems)==null?void 0:p.icon}),x.jsx("p",{...(v=(g=i.expandedContent)==null?void 0:g.descriptionItems)==null?void 0:v.text,children:t})]}):null},f2=({soundOn:e,toggleSound:t})=>{const n=o=>{o.stopPropagation(),t==null||t()},{header:r}=ye,i=e?lp:eT;return x.jsx("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),n(o))},title:e?"Disable chat sounds":"Enable chat sounds",...r.content.actions.icons,children:x.jsx(i,{size:16})})},Sy=({defaultOpen:e,closeWindow:t,configuration:n,restartConversation:r,showConversationHistory:i,disabled:o,soundOn:s,toggleSound:a,clientId:l,...u})=>{var p,g,v,y,w,A,k,E,I,D,P,T,O,B,L,F,R,N,H,z,W,b,_,j;const{header:f}=ye,[c,h]=M.useState(e),d=!!((p=n.email)!=null&&p.title)||!!((g=n.phone)!=null&&g.title)||!!((v=n.website)!=null&&v.title)||!!((y=n.termsOfService)!=null&&y.link)||!!((w=n.privacyPolicy)!=null&&w.link),m=d&&!o;return x.jsxs(l2,{open:m?c:!1,onOpenChange:m?h:void 0,"data-disabled":m?void 0:"",...f.container,...u,children:[x.jsxs(by,{"aria-label":"Expand Header Button",...f.content.container,children:[x.jsx("div",{...f.content.conversationHistory,children:i&&!c&&x.jsx(c2,{onClick:i})}),x.jsx(En,{userId:l,src:n.botAvatar,...f.content.avatar,children:n.botName||"Bot"}),x.jsx("h2",{...f.content.title,children:n.botName||"Bot"}),n.botDescription&&x.jsx("p",{...f.content.description,children:n.botDescription}),x.jsxs("div",{...f.content.actions.container,children:[n.soundEnabled&&s!==void 0&&a&&x.jsx(f2,{soundOn:s,toggleSound:a}),r&&x.jsx(nu,{restartConversation:r}),t&&x.jsx(ru,{onClick:t})]})]}),d&&x.jsxs(u2,{...f.expandedContent.container,children:[x.jsxs("div",{"data-links":"",...f.expandedContent.group,children:[x.jsx(gi,{"data-email":"",icon:UA,title:(A=n.email)==null?void 0:A.title,link:(E=(k=n.email)==null?void 0:k.link)!=null&&E.startsWith("mailto:")?(I=n.email)==null?void 0:I.link:`mailto:${(D=n.email)==null?void 0:D.link}`}),x.jsx(gi,{"data-phone":"",icon:WA,title:(P=n.phone)==null?void 0:P.title,link:(O=(T=n.phone)==null?void 0:T.link)!=null&&O.startsWith("tel:")?(B=n.phone)==null?void 0:B.link:`tel:${(L=n.phone)==null?void 0:L.link}`}),x.jsx(gi,{"data-website":"",link:(F=n.website)==null?void 0:F.link,icon:RA,title:(R=n.website)==null?void 0:R.title})]}),x.jsxs("div",{"data-legal":"",...(N=f.expandedContent)==null?void 0:N.group,children:[((H=n.termsOfService)==null?void 0:H.link)&&x.jsx(gi,{"data-terms":"",link:(z=n.termsOfService)==null?void 0:z.link,icon:sp,title:(W=n.termsOfService)==null?void 0:W.title}),((b=n.privacyPolicy)==null?void 0:b.link)&&x.jsx(gi,{"data-privacy":"",link:(_=n.privacyPolicy)==null?void 0:_.link,icon:zA,title:(j=n.privacyPolicy)==null?void 0:j.title})]})]})]})},iu=M.memo(({...e})=>{const{typingIndicator:t}=ye;return x.jsx("div",{...e,...t==null?void 0:t.container,children:x.jsx("div",{...t==null?void 0:t.loader})})});iu.displayName="TypingIndicator";const ou=M.memo(M.forwardRef(({direction:e,block:t,disableInput:n,children:r,sender:i,id:o,authorId:s,status:a,renderers:l,isReadOnly:u,isLastDeliveredMessage:f,feedback:c,timestamp:h,metadata:d,sendMessage:m,addMessageFeedback:p,showAvatar:g},v)=>{const[y,w]=M.useState([]),{message:{container:A,deliveryStatus:k}}=ye;return g=g??e==="incoming",x.jsx(Va.Provider,{value:{isLoading:y,setIsLoading:w},children:x.jsxs("div",{...A,className:ar(A==null?void 0:A.className,f&&(k==null?void 0:k.className)),"data-loaded":y.length===0,"data-disable-input":!!n,"data-direction":e,dir:"auto",ref:v,children:[e==="incoming"&&g&&x.jsx(xy,{authorId:s,sender:i}),t&&x.jsx(Dn,{block:{...t,isReadOnly:u,direction:e,timestamp:h,sender:i,feedback:c,messageId:o,status:a,metadata:d,sendMessage:m,addMessageFeedback:p},renderers:l}),e==="outgoing"&&g&&x.jsx(xy,{authorId:s,sender:i}),r]})})})),xy=({authorId:e,sender:t})=>{const{message:{avatar:n}}=ye,[r,i]=M.useState("idle"),o=Ku(e??"",15);return x.jsxs(us,{"data-color":o,"data-loading-status":r,...n==null?void 0:n.container,children:[x.jsx(cs,{...n==null?void 0:n.image,onLoadingStatusChange:i,src:t==null?void 0:t.avatar}),x.jsxs(fs,{...n==null?void 0:n.fallback,children:[t==null?void 0:t.name[0]," "]})]})};function d2({botAvatar:e,botDescription:t,botName:n}){const{messageList:{marquee:r}}=ye;return x.jsxs("li",{...r.container,children:[x.jsx(En,{src:e,...r.avatar,children:(n||"Bot").slice(0,1)}),x.jsxs("div",{...r.content,children:[x.jsx("h1",{...r.title,children:n||"Bot"}),x.jsx("p",{...r.description,children:t})]})]})}let su=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");const h2=70,p2=300;function m2(e,t={}){const n=t.nearBottomThreshold??h2,[r,i]=M.useState(!0),o=M.useRef(null),s=M.useRef(0),a=M.useRef(!0),l=M.useRef(!1),u=M.useRef(!1),f=M.useRef(0),c=M.useCallback(y=>y.scrollHeight-y.clientHeight-y.scrollTop<n,[n]),h=M.useCallback((y,w=p2)=>{cancelAnimationFrame(f.current);const A=y.scrollTop,k=performance.now(),E=()=>{const I=performance.now()-k,D=Math.min(I/w,1),P=1-Math.pow(1-D,3),T=y.scrollHeight-y.clientHeight;y.scrollTop=A+(T-A)*P,s.current=y.scrollTop,D<1&&u.current?f.current=requestAnimationFrame(E):(y.scrollTop=y.scrollHeight-y.clientHeight,s.current=y.scrollTop,u.current=!1,a.current=!0,i(!0))};u.current=!0,f.current=requestAnimationFrame(E)},[]),d=M.useCallback(()=>{const y=o.current;y&&(a.current=!0,i(!0),h(y))},[h]),m=M.useCallback(()=>{const y=o.current;if(!y)return;if(l.current){l.current=!1,s.current=y.scrollTop,a.current=c(y);return}if(u.current){s.current=y.scrollTop,c(y)&&(u.current=!1,l.current=!0,y.scrollTop=y.scrollHeight-y.clientHeight,s.current=y.scrollTop,a.current=!0,i(!0));return}s.current=y.scrollTop;const w=c(y);a.current=w,i(w)},[c]),p=M.useCallback(y=>{y.deltaY<0&&(cancelAnimationFrame(f.current),u.current=!1,a.current=!1,i(!1))},[]),g=M.useCallback(()=>{u.current&&(cancelAnimationFrame(f.current),u.current=!1)},[]),v=M.useCallback(y=>{const w=o.current;w&&(w.removeEventListener("scroll",m),w.removeEventListener("wheel",p),w.removeEventListener("touchstart",g)),o.current=y,y&&(y.addEventListener("scroll",m,{passive:!0}),y.addEventListener("wheel",p,{passive:!0}),y.addEventListener("touchstart",g,{passive:!0}),s.current=y.scrollTop)},[m,p,g]);return M.useLayoutEffect(()=>{const y=o.current;if(y)if(a.current){const w=y.scrollHeight-y.clientHeight,A=w-y.scrollTop;A>0&&A<=y.clientHeight&&y.clientHeight>0?(u.current=!0,y.scrollTo({top:w,behavior:"smooth"}),cancelAnimationFrame(f.current),f.current=requestAnimationFrame(()=>{u.current&&o.current&&c(o.current)&&(u.current=!1,a.current=!0,i(!0))})):(cancelAnimationFrame(f.current),u.current=!1,y.scrollTop=w),s.current=w,a.current=!0}else l.current=!0,y.scrollTop=s.current},[e,c]),M.useEffect(()=>{const y=o.current;if(!y)return;const w=y.firstElementChild;if(!w)return;const A=new ResizeObserver(()=>{o.current&&(u.current||(a.current?(l.current=!0,o.current.scrollTop=o.current.scrollHeight-o.current.clientHeight,s.current=o.current.scrollTop):o.current.scrollTop=s.current))});return A.observe(w),()=>A.disconnect()},[]),M.useEffect(()=>{const y=window.visualViewport;if(!y)return;const w=()=>{const A=o.current;A&&(u.current||a.current&&(l.current=!0,A.scrollTop=A.scrollHeight-A.clientHeight,s.current=A.scrollTop))};return y.addEventListener("resize",w),()=>y.removeEventListener("resize",w)},[]),M.useEffect(()=>{const y=o.current;if(!y)return;let w=!1;const A=new IntersectionObserver(k=>{var E,I;(E=k[0])!=null&&E.isIntersecting&&w&&a.current&&(y.scrollTop=y.scrollHeight-y.clientHeight,s.current=y.scrollTop),w=!((I=k[0])!=null&&I.isIntersecting)});return A.observe(y),()=>A.disconnect()},[]),M.useEffect(()=>()=>cancelAnimationFrame(f.current),[]),{scrollRef:v,isAtBottom:r,scrollToBottom:d}}const g2={height:"100%",width:"100%",overflowY:"auto",scrollbarWidth:"none",overscrollBehaviorY:"contain"},au=M.memo(({className:e,messages:t=[],isTyping:n,headerMessage:r,renderers:i,botAvatar:o,botDescription:s,botName:a,sendMessage:l,addMessageFeedback:u,showMarquee:f=!0,showDateSystemMessage:c=!0,showMessageStatus:h=!0,showIncomingMessageAvatar:d=!0,showOutgoingMessageAvatar:m=!1,...p})=>{var T;const{messageList:g}=ye,v=M.useMemo(()=>c?db(t):t,[t]),y=M.useMemo(()=>{var B;const O=v.filter(L=>L.direction==="outgoing"&&L.status!=="pending");return(B=O[O.length-1])==null?void 0:B.id},[v]),w=v[v.length-1],A=(w==null?void 0:w.id)??"",k=`${v.length}:${A}:${n}`,{scrollRef:E,isAtBottom:I,scrollToBottom:D}=m2(k);M.useEffect(()=>{(w==null?void 0:w.direction)==="outgoing"&&D()},[A]);const P=O=>{if(O.direction==="incoming")return d;if(O.direction==="outgoing")return m};return x.jsxs("div",{...p,className:ar(g.container.className,e),children:[x.jsx("div",{ref:E,style:g2,children:x.jsxs("div",{className:g.viewPort.className,children:[r&&x.jsx("span",{...g.headerMessage,children:r}),f&&x.jsx(d2,{botAvatar:o,botDescription:s,botName:a}),v.map(O=>{var B;return x.jsx(ou,{renderers:i,sendMessage:l,addMessageFeedback:u,isLastDeliveredMessage:h&&O.id===y,showAvatar:P(O),...O},((B=O.metadata)==null?void 0:B.clientMessageId)||O.id)}),n&&x.jsx(ou,{id:su(),renderers:i,sendMessage:l,direction:"incoming",timestamp:new Date,showAvatar:d,block:void 0,sender:((T=t.filter(O=>O.direction==="incoming").at(-1))==null?void 0:T.sender)??{name:a||"Bot",avatar:o},children:x.jsx(iu,{})})]})}),!I&&x.jsx("button",{className:g.scrollDownButton.className,onClick:()=>D()})]})});au.displayName="MessageList";const ky=({className:e,...t})=>{const{className:n}=ye.loader;return x.jsx("div",{...t,className:ar(e,n)})};function Ey({error:e,restartConversation:t,closeWindow:n}){let r,i;const{error:o}=ye;return e.type==="configuration"?(r="Configuration error",i=x.jsx(VA,{...o.icon})):e.type==="bot"?(r="Bot error",i=x.jsx(np,{...o.icon})):e.type==="network"?(r="Network error",i=x.jsx(tT,{...o.icon})):e.type==="disconnected"?(r="Disconnected",i=x.jsx(ZA,{...o.icon})):(r="Unexpected error",i=x.jsx(np,{...o.icon})),x.jsx(y2,{error:e,title:r,icon:i,restartConversation:t,closeWindow:n})}function y2({error:e,title:t,icon:n,restartConversation:r,closeWindow:i}){const{error:o}=ye;return x.jsxs("div",{...o.container,children:[x.jsxs("div",{...o.header.container,children:[`Webchat ${e.type} error`,x.jsxs("div",{...o.header.actions,children:[r&&x.jsx(nu,{restartConversation:r,style:{color:"white",backgroundColor:"transparent"}}),i&&x.jsx(ru,{onClick:i,style:{color:"white",backgroundColor:"transparent"}})]})]}),x.jsxs("div",{...o.content,children:[n,x.jsx("div",{...o.errorTitle,children:t}),x.jsx("div",{...o.errorMessage,children:e.message}),e.id&&x.jsx("div",{...o.id,children:e.id})]})]})}const yi=ly.webchat;async function v2(e,t){const{userId:n,conversationId:r,userToken:i,openConversation:o,setClientState:s,setError:a,emitter:l}=t;yi.warn("handleWebchatError",{userId:n,conversationId:r,type:e.type,message:e.message});const f=[{name:"startNewConversation",predicate:c=>c.message===Fs||c.type==="ResourceNotFound",recover:async()=>o({userToken:i})},{name:"reopenConversation",predicate:c=>c.type==="network",recover:async()=>o({userToken:i,conversationId:r})}].find(c=>c.predicate(e));if(!f){yi.error("no recovery strategy found, setting error state",{userId:n,conversationId:r}),s("error"),a(e);return}yi.info("attempting recovery",{userId:n,conversationId:r,strategy:f.name});try{await Kf(f.recover,3,5e3),yi.info("recovery successful",{userId:n,conversationId:r}),a(void 0),s("connected")}catch(c){yi.error("recovery failed",{error:c,userId:n,conversationId:r}),a(Pr(c)),s("error"),l.emit("error",c)}}function b2(e,t){return async(...n)=>{try{return await e(...n)}catch(r){await v2(Pr(r),t)}}}function Cy(e,t){const n={};for(const[r,i]of Object.entries(e))n[r]=b2(i,t);return n}function Ay({client:e,conversationId:t}){return{sendEvent:async(r,i)=>{if(!e||!t)throw new Error("Cannot send event: client or conversationId not available");await e.createEvent({conversationId:t,payload:{type:"custom",data:r},bindConversation:(i==null?void 0:i.bindConversation)??!0,bindUser:(i==null?void 0:i.bindUser)??!0})}}}function Ty({client:e,conversationId:t,user:n}){return{uploadFile:async i=>{if(!e)throw new Error("Client not initialized");if(!t)throw new Error("No active conversation");if(!n)throw new Error("User not authenticated");const{size:o,name:s}=i,a=await jw(i),l=new Date;l.setDate(l.getDate()+30);const{file:{uploadUrl:u,contentType:f,url:c,id:h}}=await e.createFile({size:o,key:`${su(6)}-${i.name}`,accessPolicies:["public_content"],index:!1,tags:{source:"integration",integrationName:"webchat",conversation:t,user:n.userId},expiresAt:l.toISOString()});await fetch(u,{method:"PUT",headers:{"x-amz-tagging":"public=true","content-type":f},body:a});const d=f.split("/").shift()??"",m=Lf(d)?d:"file";return{fileUrl:c,name:s,type:m,fileId:h}}}}function Iy({client:e,conversationId:t,userId:n,setAwaitingResponse:r}){const i=wp(t||"default"),o=i(d=>d.messages),s=i(d=>d.saveMessage),a=i(d=>d.updateMessage),l=i(d=>d.setMessages),u=i(d=>d.clearMessages);return{messages:o,sendMessage:async d=>{if(!e||!t||!n)throw console.log("Cannot send message: client, conversationId, or userId not available",e,t,n),new Error("Cannot send message: client, conversationId, or userId not available");r==null||r(!0);const m=su(),p={id:m,createdAt:new Date().toISOString(),userId:n,conversationId:t,payload:d,metadata:{clientMessageId:m,delivered:!1}},g=lr(p);g.status="pending",s(g),await e.createMessage({conversationId:t,payload:d,metadata:{clientMessageId:m}})},setMessages:d=>{const m=d.map(p=>lr(p)).filter(Boolean);l(m)},clearMessages:u,saveMessageFeedback:async(d,m)=>{if(!e)throw new Error("Cannot update feedback: client not available");a(d,{feedback:m.value}),await e.addMessageFeedback({messageId:d,...m})}}}function Oy({client:e,conversationId:t}){const n=kp(t||"default"),r=n(u=>u.participants),i=n(u=>u.setParticipants),o=n(u=>u.addParticipant),s=n(u=>u.removeParticipant),a=n(u=>u.clearParticipants);return{participants:r,setParticipants:i,fetchParticipants:async()=>{if(!e||!t)return;const{participants:u}=await e.listParticipants({conversationId:t});i(u)},clearParticipants:a,addParticipant:o,removeParticipant:s}}const My={chatMessageNotification:new URL("data:audio/ogg;base64,T2dnUwACAAAAAAAAAAAVJAEzAAAAAOU+A6UBHgF2b3JiaXMAAAAAASJWAAD/////AH0AAP////+pAU9nZ1MAAAAAAAAAAAAAFSQBMwEAAAD3T/UfDpz////////////////FA3ZvcmJpcwwAAABMYXZmNjEuNy4xMDAEAAAAHwAAAGVuY29kZXI9TGF2YzYxLjE5LjEwMSBsaWJ2b3JiaXMrAAAAZW5jb2RlZF9ieT1BZG9iZSBQcmVtaWVyZSBQcm8gMjAyNS4wIChNYWNpbhcAAAB0aW1lX3JlZmVyZW5jZT0xMjExMDQwMA8AAABkYXRlPTIwMjUtMDgtMDUBBXZvcmJpcyJCQ1YBAEAAABhCECoFrWOOOsgVIYwZoqBCyinHHULQIaMkQ4g6xjXHGGNHuWSKQsmB0JBVAABAAACkHFdQckkt55xzoxhXzHHoIOecc+UgZ8xxCSXnnHOOOeeSco4x55xzoxhXDnIpLeecc4EUR4pxpxjnnHOkHEeKcagY55xzbTG3knLOOeecc+Ygh1JyrjXnnHOkGGcOcgsl55xzxiBnzHHrIOecc4w1t9RyzjnnnHPOOeecc84555xzjDHnnHPOOeecc24x5xZzrjnnnHPOOeccc84555xzIDRkFQCQAACgoSiK4igOEBqyCgDIAAAQQHEUR5EUS7Ecy9EkDQgNWQUAAAEACAAAoEiGpEiKpViOZmmeJnqiKJqiKquyacqyLMuy67ouEBqyCgBIAABQURTFcBQHCA1ZBQBkAAAIYCiKoziO5FiSpVmeB4SGrAIAgAAABAAAUAxHsRRN8STP8jzP8zzP8zzP8zzP8zzP8zzP8zwNCA1ZBQAgAAAAgihkGANCQ1YBAEAAAAghGhlDnVISXAoWQhwRQx1CzkOppYPgKYUlY9JTrEEIIXzvPffee++B0JBVAAAQAABhFDiIgcckCCGEYhQnRHGmIAghhOUkWMp56CQI3YMQQrice8u59957IDRkFQAACADAIIQQQgghhBBCCCmklFJIKaaYYoopxxxzzDHHIIMMMuigk046yaSSTjrKJKOOUmsptRRTTLHlFmOttdacc69BKWOMMcYYY4wxxhhjjDHGGCMIDVkFAIAAABAGGWSQQQghhBRSSCmmmHLMMcccA0JDVgEAgAAAAgAAABxFUiRHciRHkiTJkixJkzzLszzLszxN1ERNFVXVVW3X9m1f9m3f1WXf9mXb1WVdlmXdtW1d1l1d13Vd13Vd13Vd13Vd13Vd14HQkFUAgAQAgI7kOI7kOI7kSI6kSAoQGrIKAJABABAAgKM4iuNIjuRYjiVZkiZplmd5lqd5mqiJHhAasgoAAAQAEAAAAAAAgKIoiqM4jiRZlqZpnqd6oiiaqqqKpqmqqmqapmmapmmapmmapmmapmmapmmapmmapmmapmmapmmapmkCoSGrAAAJAAAdx3EcR3Ecx3EkR5IkIDRkFQAgAwAgAABDURxFcizHkjRLszzL00TP9FxRNnVTV20gNGQVAAAIACAAAAAAAADHczzHczzJkzzLczzHkzxJ0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRNA0JDVgIAZAAAEJOQSk6xV0YpxiS0XiqkFJPUe6iYYkw67alCBikHuYdKIaWg094ypZBSDHunmELIGOqhg5AxhbDX2nPPvfceCA1ZEQBEAQAAxiDGEGPIMSYlgxIxxyRkUiLnnJROSialpFZazKSEmEqLkXNOSiclk1JaC6llkkprJaYCAAACHAAAAiyEQkNWBABRAACIMUgppBRSSjGnmENKKceUY0gp5ZxyTjnHmHQQKucYdA5KpJRyjjmnnHMSMgeVcw5CJp0AAIAABwCAAAuh0JAVAUCcAACAkHOKMQgRYxBCCSmFUFKqnJPSQUmpg5JSSanFklKMlXNSOgkpdRJSKinFWFKKLaRUY2kt19JSjS3GnFuMvYaUYi2p1Vpaq7nFWHOLNffIOUqdlNY6Ka2l1mpNrdXaSWktpNZiaS3G1mLNKcacMymthZZiK6nF2GLLNbWYc2kt1xRjzynGnmusucecgzCt1ZxayznFmHvMseeYcw+Sc5Q6Ka11UlpLrdWaWqs1k9Jaaa3GkFqLLcacW4sxZ1JaLKnFWFqKMcWYc4st19BarinGnFOLOcdag5Kx9l5aqznFmHuKreeYczA2x547SrmW1nourfVecy5C1tyLaC3n1GoPKsaec87B2NyDEK3lnGrsPcXYe+45GNtz8K3W4FvNRcicg9C5+KZ7MEbV2oPMtQiZcxA66CJ08Ml4lGoureVcWus91hp8zTkI0VruKcbeU4u9156bsL0HIVrLPcXYg4ox+JpzMDrnYlStwcecg5C1FqF7L0rnIJSqtQeZa1Ay1yJ08MXooIsvAABgwAEAIMCEMlBoyIoAIE4AgEHIOaUYhEopCKGElEIoKVWMSciYg5IxJ6WUUloIJbWKMQiZY1Iyx6SEEloqJbQSSmmplNJaKKW1llqMKbUWQymphVJaK6W0llqqMbVWY8SYlMw5KZljUkoprZVSWqsck5IxKKmDkEopKcVSUouVc1Iy6Kh0EEoqqcRUUmmtpNJSKaXFklJsKcVUW4u1hlJaLKnEVlJqMbVUW4sx14gxKRlzUjLnpJRSUiultJY5J6WDjkrmoKSSUmulpBQz5qR0DkrKIKNSUootpRJTKKW1klJspaTWWoy1ptRaLSW1VlJqsZQSW4sx1xZLTZ2U1koqMYZSWmsx5ppaizGUElspKcaSSmytxZpbbDmGUlosqcRWSmqx1ZZja7Hm1FKNKbWaW2y5xpRTj7X2nFqrNbVUY2ux5lhbb7XWnDsprYVSWislxZhai7HFWHMoJbaSUmylpBhbbLm2FmMPobRYSmqxpBJjazHmGFuOqbVaW2y5ptRirbX2HFtuPaUWa4ux5tJSjTXX3mNNORUAADDgAAAQYEIZKDRkJQAQBQAAGMMYYxAapZxzTkqDlHPOScmcgxBCSplzEEJIKXNOQkotZc5BSKm1UEpKrcUWSkmptRYLAAAocAAACLBBU2JxgEJDVgIAUQAAiDFKMQahMUYp5yA0xijFGIRKKcack1ApxZhzUDLHnINQSuaccxBKCSGUUkpKIYRSSkmpAACAAgcAgAAbNCUWByg0ZEUAEAUAABhjnDPOIQqdpc5SJKmj1lFrKKUaS4ydxlZ767nTGnttuTeUSo2p1o5ry7nV3mlNPbccCwAAO3AAADuwEAoNWQkA5AEAEMYoxZhzzhmFGHPOOecMUow555xzijHnnIMQQsWYc85BCCFzzjkIoYSSOecchBBK6JyDUEoppXTOQQihlFI65yCEUkopnXMQSimllAIAgAocAAACbBTZnGAkqNCQlQBAHgAAYAxCzklprWHMOQgt1dgwxhyUlGKLnIOQUou5RsxBSCnGoDsoKbUYbPCdhJRaizkHk1KLNefeg0iptZqDzj3VVnPPvfecYqw1595zLwAAd8EBAOzARpHNCUaCCg1ZCQDkAQAQCCnFmHPOGaUYc8w554xSjDHmnHOKMcacc85BxRhjzjkHIWPMOecghJAx5pxzEELonHMOQgghdM45ByGEEDrnoIMQQgidcxBCCCGEAgCAChwAAAJsFNmcYCSo0JCVAEA4AAAAIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEELonHPOOeecc84555xzzjnnnHPOOScAyLfCAcD/wcYZVpLOCkeDCw1ZCQCEAwAACkEopWIQSiklkk46KZ2TUEopkYNSSumklFJKCaWUUkoIpZRSSggdlFJCKaWUUkoppZRSSimllFI6KaWUUkoppZTKOSmlk1JKKaVEzkkpIZRSSimlhFJKKaWUUkoppZRSSimllFJKKaWEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQCALgbHAAgEmycYSXprHA0uNCQlQBASAAAoBRzjkoIKZSQUqiYoo5CKSmkUkoKEWPOSeochVBSKKmDyjkIpaSUQiohdc5BByWFkFIJIZWOOugolFBSKiWU0jkopYQUSkoplZBCSKl0lFIoJZWUQiohlVJKSCWVEEoKnaRUSgqppFRSCJ10kEInJaSSSgqpk5RSKiWllEpKJXRSQioppRBCSqmUEEpIKaVOUkmppBRCKCGFlFJKJaWSSkohlVRCCaWklFIooaRUUkoppZJSKQAA4MABACDACDrJqLIIG0248AAUGrISACADAECUdNZpp0kiCDFFmScNKcYgtaQswxBTkonxFGOMOShGQw4x5JQYF0oIoYNiPCaVQ8pQUbm31DkFxRZjfO+xFwEAAAgCAASEBAAYICiYAQAGBwgjBwIdAQQObQCAgQiZCQwKocFBJgA8QERIBQCJCYrShS4IIYJ0EWTxwIUTN5644YQObRAAAAAAABAA8AEAkFAAERHRzFVYXGBkaGxwdHh8gIQEAAAAAAAIAHwAACQiQERENHMVFhcYGRobHB0eHyAhAQAAAAAAAAAAQEBAAAAAAAAgAAAAQEBPZ2dTAASuMwAAAAAAABUkATMCAAAACYS6sR4BAUQxGR89NxobGiEkKCknJiYmJSUhISEaFgwBAQEAAnyfvULHAlAEJgh2vpgQBMHIyMjIyNhIQOjz+ePz58+fL89xAwYBAFaH//3//7/xNw0MBoNB6qlPfWrUKQng+/0FABAAhLEjKuHFBwA4AHC9Fx4Oh7EwDEOgvnJ3RtV+Op0+nU6n5cyzEwAoltTpwed5dgVKMPoru90zNHGA7F0CP98BAAAAAHl9ePviAgCW+3rugPIDwC6BbWoTAFEAAADh5GpCCACgc+0zxlAAVKddkjDsA14GDoJtf7R+NkE4W23hI5mF3d74iVGvzg9PpA4cCQs66joePTmOfhgl7vNZzYzQADDyz30FAGSvVUZ6wJ4MAKbCGeb4+v5NLIdK3YvrLkCu98uV//FpXQNyKAKAV7r186fTktcJJgjAlVp1fUmaGgtrdAAuDXYJSPs/AAAAAHDnAeHxciEUAB76CvfarGjDzIjALoEd+/0EAAAAQNYeMrkBAF6ZKm8xuw94NtgloHDUCAAAAIAMJ5Qz2iUAvjhKL8lkfmA6wi6BWfNHgiAAAABq4eeqGgCg8+LAAXQAfhgqz2RKHzAVYJeAynEAIQEAALwq6tFbIQAEEIIO8iULngMAXhgajrw3D5iFWhe7BLZNrwCVKAAA0t2TfT8mADx0aMfS4CULeACvA14YWnasNht80ZpdAhv8BEiiAADgcbm4jo0JANAVCTRV6JqQS0OTADoAXhg6zWy+AZ3GsiDRAYJzgiQAAICnb9FLAQAUNQFd44AioMNJICUAfhi67ZRjA2IMSHTAJK0KkgAAAG7W0uLlEgC6KnQdDkgBlAAdJAB+GHpL40hATAASHSC5CZIAAAAGZ3J60ioBoKsBTQKE5KFJIJFAAp4Y+jp7cg4qINEBi+MASQAAAM8rmdZcAKApwFhNPHQkQEBRQwIAnhj6OZ8KIBwDiQ4Q9ApIFAAAQHRFd6FEALA0NaApQAegnPrDA54Y+nN+AYAIJDoAfgIkCgAAcLRlPVsLALqmKqFpHIwUwQEJCwCeKPpzEQA8kOgAyTlBAgAAgPnK3q8jAWAuJFBYOsbAAgCeKPolEQA8rMFCohQAAMxD2BdSAJYFdNThKcCkBQCOgwKeGPpzEQA8rEEhCQAAoCz4MRGA41gaQMBRjACexHugAACeGPqFCAAeugQAAHryFgBdRYGFhGeow8x7AJ4Y+iURADyIigIAliFAAcYWCQC11gGeGPolEQA8UAAAABoODg4=",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:ts&&ts.tagName.toUpperCase()==="SCRIPT"&&ts.src||new URL("index.umd.cjs",document.baseURI).href).href};function Dy({storageKey:e,soundEnabled:t}){const n=Ep(e||"bp-webchat"),r=n(u=>u.soundOn),i=n(u=>u.toggleSound),o=M.useRef(null),s=M.useRef(t??!1),a=M.useRef(r);M.useEffect(()=>{try{o.current=new Audio,o.current.preload="auto",o.current.src=My.chatMessageNotification,o.current.volume=.9}catch(u){console.error("Error loading sound effect:",u),o.current=null}},[]),M.useEffect(()=>{s.current=t??!1},[t]),M.useEffect(()=>{a.current=r},[r]);const l=M.useCallback(()=>{s.current&&a.current&&o.current&&o.current.play().catch(()=>{})},[]);return{soundOn:r,toggleSound:i,playNotificationSound:l}}function w2({apiUrl:e="https://webchat.botpress.cloud",clientId:t,storageKey:n,storageLocation:r,adminSecret:i,soundEnabled:o,clientHeaders:s,...a}){var N;const{soundOn:l,toggleSound:u,playNotificationSound:f}=Dy({storageKey:n,soundEnabled:o}),{clientState:c,httpClient:h,error:d,activeConversationId:m,userCredentials:p,isTyping:g,isAwaitingResponse:v,openConversation:y,setAwaitingResponse:w,emitter:A,setError:k,setClientState:E}=cy({apiUrl:e,clientId:t,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:s,conversationId:a.conversationId,userToken:(N=a.user)==null?void 0:N.userToken,playNotificationSound:f}),{messages:I,sendMessage:D,saveMessageFeedback:P}=Iy({client:h,conversationId:m,userId:p==null?void 0:p.userId,setAwaitingResponse:w}),{participants:T}=Oy({client:h,conversationId:m}),{uploadFile:O}=Ty({client:h,conversationId:m,user:p}),{sendEvent:B}=Ay({client:h,conversationId:m});if(c!=="connected"||!p||!m||!h)return{clientState:c,on:A.on,client:void 0,messages:[],conversationId:void 0,newConversation:H=>{y({conversationId:H,userToken:p==null?void 0:p.userToken}).catch(z=>{A.emit("error",z)})},user:void 0,isTyping:void 0,participants:[],toggleSound:u,soundOn:l,error:d,disableSendButton:v};const L={userId:p==null?void 0:p.userId,conversationId:m,userToken:p==null?void 0:p.userToken,openConversation:y,setClientState:E,setError:k,emitter:A},R={...Cy({sendMessage:async H=>D(H),sendEvent:B,uploadFile:O,addMessageFeedback:P},L),getUser:async()=>{const{user:H}=await h.getUser();return H},updateUser:async H=>{const{user:z}=await h.updateUser({name:H.name,pictureUrl:H.pictureUrl,userData:H.data});return z},listConversations:async()=>h.listConversations({})};return{clientState:"connected",on:A.on,client:R,messages:I,conversationId:m,newConversation:H=>{y({conversationId:H,userToken:p.userToken}).catch(z=>{A.emit("error",z)})},user:p,isTyping:g,participants:T,error:d,soundOn:l,toggleSound:u,disableSendButton:v}}const Ny=()=>{const{client:e,userCredentials:t}=$o();return e?{userCredentials:t,getUser:async()=>(await e.getUser()).user,updateUser:async i=>(await e.updateUser(i)).user}:{userCredentials:t,getUser:void 0,updateUser:void 0}};function _y(){const{client:e,conversationId:t,userCredentials:n,setAwaitingResponse:r,emitter:i,clientState:o,setClientState:s,setError:a,openConversation:l,error:u,isAwaitingResponse:f,isTyping:c}=$o(),{messages:h,sendMessage:d,saveMessageFeedback:m}=Iy({client:e,conversationId:t,userId:n==null?void 0:n.userId,setAwaitingResponse:r}),{participants:p}=Oy({client:e,conversationId:t}),{sendEvent:g}=Ay({client:e,conversationId:t}),{uploadFile:v}=Ty({client:e,conversationId:t,user:n}),y={userId:n==null?void 0:n.userId,userToken:n==null?void 0:n.userToken,conversationId:t,openConversation:l,setClientState:s,setError:a,emitter:i},w=Cy({sendMessage:d,saveMessageFeedback:m,sendEvent:g,uploadFile:v},y);return{conversationId:t,messages:h,participants:p,sendMessage:w.sendMessage,saveMessageFeedback:w.saveMessageFeedback,sendEvent:w.sendEvent,uploadFile:w.uploadFile,on:i.on,status:o,error:u,isAwaitingResponse:f,isTyping:c}}function Py(){const{client:e,openConversation:t,userCredentials:n}=$o();return e?{listConversations:async()=>e.listConversations({}),openConversation:i=>t({conversationId:i,userToken:n==null?void 0:n.userToken})}:{listConversations:void 0,openConversation:i=>t({conversationId:i,userToken:n==null?void 0:n.userToken})}}const Ly=0,Fy=1,Ry=2,$y=3;var By=Object.prototype.hasOwnProperty;function lu(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&lu(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(By.call(e,n)&&++r&&!By.call(t,n)||!(n in t)||!lu(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const Jt=new WeakMap,Xt=()=>{},rt=Xt(),uu=Object,we=e=>e===rt,Vt=e=>typeof e=="function",mn=(e,t)=>({...e,...t}),zy=e=>Vt(e.then),cu={},jo={},fu="undefined",vi=typeof window!=fu,du=typeof document!=fu,S2=vi&&"Deno"in window,x2=()=>vi&&typeof window.requestAnimationFrame!=fu,Uy=(e,t)=>{const n=Jt.get(e);return[()=>!we(t)&&e.get(t)||cu,r=>{if(!we(t)){const i=e.get(t);t in jo||(jo[t]=i),n[5](t,mn(i,r),i||cu)}},n[6],()=>!we(t)&&t in jo?jo[t]:!we(t)&&e.get(t)||cu]};let hu=!0;const k2=()=>hu,[pu,mu]=vi&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Xt,Xt],E2=()=>{const e=du&&document.visibilityState;return we(e)||e!=="hidden"},C2=e=>(du&&document.addEventListener("visibilitychange",e),pu("focus",e),()=>{du&&document.removeEventListener("visibilitychange",e),mu("focus",e)}),A2=e=>{const t=()=>{hu=!0,e()},n=()=>{hu=!1};return pu("online",t),pu("offline",n),()=>{mu("online",t),mu("offline",n)}},T2={isOnline:k2,isVisible:E2},I2={initFocus:C2,initReconnect:A2},Hy=!M.useId,pr=!vi||S2,O2=e=>x2()?window.requestAnimationFrame(e):setTimeout(e,1),gu=pr?M.useEffect:M.useLayoutEffect,yu=typeof navigator<"u"&&navigator.connection,jy=!pr&&yu&&(["slow-2g","2g"].includes(yu.effectiveType)||yu.saveData),Vo=new WeakMap,M2=e=>uu.prototype.toString.call(e),vu=(e,t)=>e===`[object ${t}]`;let D2=0;const bu=e=>{const t=typeof e,n=M2(e),r=vu(n,"Date"),i=vu(n,"RegExp"),o=vu(n,"Object");let s,a;if(uu(e)===e&&!r&&!i){if(s=Vo.get(e),s)return s;if(s=++D2+"~",Vo.set(e,s),Array.isArray(e)){for(s="@",a=0;a<e.length;a++)s+=bu(e[a])+",";Vo.set(e,s)}if(o){s="#";const l=uu.keys(e).sort();for(;!we(a=l.pop());)we(e[a])||(s+=a+":"+bu(e[a])+",");Vo.set(e,s)}}else s=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return s},wu=e=>{if(Vt(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?bu(e):"",[e,t]};let N2=0;const Su=()=>++N2;async function Vy(...e){const[t,n,r,i]=e,o=mn({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let s=o.populateCache;const a=o.rollbackOnError;let l=o.optimisticData;const u=h=>typeof a=="function"?a(h):a!==!1,f=o.throwOnError;if(Vt(n)){const h=n,d=[],m=t.keys();for(const p of m)!/^\$(inf|sub)\$/.test(p)&&h(t.get(p)._k)&&d.push(p);return Promise.all(d.map(c))}return c(n);async function c(h){const[d]=wu(h);if(!d)return;const[m,p]=Uy(t,d),[g,v,y,w]=Jt.get(t),A=()=>{const F=g[d];return(Vt(o.revalidate)?o.revalidate(m().data,h):o.revalidate!==!1)&&(delete y[d],delete w[d],F&&F[0])?F[0](Ry).then(()=>m().data):m().data};if(e.length<3)return A();let k=r,E,I=!1;const D=Su();v[d]=[D,0];const P=!we(l),T=m(),O=T.data,B=T._c,L=we(B)?O:B;if(P&&(l=Vt(l)?l(L,O):l,p({data:l,_c:L})),Vt(k))try{k=k(L)}catch(F){E=F,I=!0}if(k&&zy(k))if(k=await k.catch(F=>{E=F,I=!0}),D!==v[d][0]){if(I)throw E;return k}else I&&P&&u(E)&&(s=!0,p({data:L,_c:rt}));if(s&&!I)if(Vt(s)){const F=s(k,L);p({data:F,error:rt,_c:rt})}else p({data:k,error:rt,_c:rt});if(v[d][1]=Su(),Promise.resolve(A()).then(()=>{p({_c:rt})}),I){if(f)throw E;return}return k}}const Wy=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},_2=(e,t)=>{if(!Jt.has(e)){const n=mn(I2,t),r=Object.create(null),i=Vy.bind(rt,e);let o=Xt;const s=Object.create(null),a=(f,c)=>{const h=s[f]||[];return s[f]=h,h.push(c),()=>h.splice(h.indexOf(c),1)},l=(f,c,h)=>{e.set(f,c);const d=s[f];if(d)for(const m of d)m(c,h)},u=()=>{if(!Jt.has(e)&&(Jt.set(e,[r,Object.create(null),Object.create(null),Object.create(null),i,l,a]),!pr)){const f=n.initFocus(setTimeout.bind(rt,Wy.bind(rt,r,Ly))),c=n.initReconnect(setTimeout.bind(rt,Wy.bind(rt,r,Fy)));o=()=>{f&&f(),c&&c(),Jt.delete(e)}}};return u(),[e,i,u,o]}return[e,Jt.get(e)[4]]},P2=(e,t,n,r,i)=>{const o=n.errorRetryCount,s=i.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!we(o)&&s>o||setTimeout(r,a,i)},L2=lu,[qy,F2]=_2(new Map),R2=mn({onLoadingSlow:Xt,onSuccess:Xt,onError:Xt,onErrorRetry:P2,onDiscarded:Xt,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:jy?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:jy?5e3:3e3,compare:L2,isPaused:()=>!1,cache:qy,mutate:F2,fallback:{}},T2),$2=(e,t)=>{const n=mn(e,t);if(t){const{use:r,fallback:i}=e,{use:o,fallback:s}=t;r&&o&&(n.use=r.concat(o)),i&&s&&(n.fallback=mn(i,s))}return n},B2=M.createContext({}),z2="$inf$",Yy=vi&&window.__SWR_DEVTOOLS_USE__,U2=Yy?window.__SWR_DEVTOOLS_USE__:[],H2=()=>{Yy&&(window.__SWR_DEVTOOLS_REACT__=M)},j2=e=>Vt(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],V2=()=>{const e=M.useContext(B2);return M.useMemo(()=>mn(R2,e),[e])},W2=e=>(t,n,r)=>e(t,n&&((...o)=>{const[s]=wu(t),[,,,a]=Jt.get(qy);if(s.startsWith(z2))return n(...o);const l=a[s];return we(l)?n(...o):(delete a[s],l)}),r),q2=U2.concat(W2),Y2=e=>function(...n){const r=V2(),[i,o,s]=j2(n),a=$2(r,s);let l=e;const{use:u}=a,f=(u||[]).concat(q2);for(let c=f.length;c--;)l=f[c](l);return l(i,o||a.fetcher||null,a)},K2=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i>=0&&(r[i]=r[r.length-1],r.pop())}};H2();const xu=M.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),ku={dedupe:!0},Ky=Promise.resolve(rt),G2=()=>Xt,Q2=Y2((e,t,n)=>{const{cache:r,compare:i,suspense:o,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:f,refreshWhenOffline:c,keepPreviousData:h,strictServerPrefetchWarning:d}=n,[m,p,g,v]=Jt.get(r),[y,w]=wu(e),A=M.useRef(!1),k=M.useRef(!1),E=M.useRef(y),I=M.useRef(t),D=M.useRef(n),P=()=>D.current,T=()=>P().isVisible()&&P().isOnline(),[O,B,L,F]=Uy(r,y),R=M.useRef({}).current,N=we(s)?we(n.fallback)?rt:n.fallback[y]:s,H=(J,ue)=>{for(const de in R){const fe=de;if(fe==="data"){if(!i(J[fe],ue[fe])&&(!we(J[fe])||!i(q,ue[fe])))return!1}else if(ue[fe]!==J[fe])return!1}return!0},z=!A.current,W=M.useMemo(()=>{const J=O(),ue=F(),de=Me=>{const He=mn(Me);return delete He._k,(()=>{if(!y||!t||P().isPaused())return!1;if(z&&!we(a))return a;const ae=we(N)?He.data:N;return we(ae)||l})()?{isValidating:!0,isLoading:!0,...He}:He},fe=de(J),Ae=J===ue?fe:de(ue);let Fe=fe;return[()=>{const Me=de(O());return H(Me,Fe)?(Fe.data=Me.data,Fe.isLoading=Me.isLoading,Fe.isValidating=Me.isValidating,Fe.error=Me.error,Fe):(Fe=Me,Me)},()=>Ae]},[r,y]),b=as.useSyncExternalStore(M.useCallback(J=>L(y,(ue,de)=>{H(de,ue)||J()}),[r,y]),W[0],W[1]),_=m[y]&&m[y].length>0,j=b.data,S=we(j)?N&&zy(N)?xu(N):N:j,V=b.error,Y=M.useRef(S),q=h?we(j)?we(Y.current)?S:Y.current:j:S,Q=y&&we(S),X=M.useRef(null);!pr&&as.useSyncExternalStore(G2,()=>(X.current=!1,X),()=>(X.current=!0,X));const se=X.current;d&&se&&!o&&Q&&console.warn(`Missing pre-initiated data for serialized key "${y}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const G=!y||!t||P().isPaused()||_&&!we(V)?!1:z&&!we(a)?a:o?we(S)?!1:l:we(S)||l,te=we(b.isValidating)?G:b.isValidating,$=we(b.isLoading)?G:b.isLoading,ne=M.useCallback(async J=>{const ue=I.current;if(!y||!ue||k.current||P().isPaused())return!1;let de,fe,Ae=!0;const Fe=J||{},Me=!g[y]||!Fe.dedupe,He=()=>Hy?!k.current&&y===E.current&&A.current:y===E.current,ee={isValidating:!1,isLoading:!1},ae=()=>{B(ee)},U=()=>{const oe=g[y];oe&&oe[1]===fe&&delete g[y]},K={isValidating:!0};we(O().data)&&(K.isLoading=!0);try{if(Me&&(B(K),n.loadingTimeout&&we(O().data)&&setTimeout(()=>{Ae&&He()&&P().onLoadingSlow(y,n)},n.loadingTimeout),g[y]=[ue(w),Su()]),[de,fe]=g[y],de=await de,Me&&setTimeout(U,n.dedupingInterval),!g[y]||g[y][1]!==fe)return Me&&He()&&P().onDiscarded(y),!1;ee.error=rt;const oe=p[y];if(!we(oe)&&(fe<=oe[0]||fe<=oe[1]||oe[1]===0))return ae(),Me&&He()&&P().onDiscarded(y),!1;const le=O().data;ee.data=i(le,de)?le:de,Me&&He()&&P().onSuccess(de,y,n)}catch(oe){U();const le=P(),{shouldRetryOnError:he}=le;le.isPaused()||(ee.error=oe,Me&&He()&&(le.onError(oe,y,le),(he===!0||Vt(he)&&he(oe))&&(!P().revalidateOnFocus||!P().revalidateOnReconnect||T())&&le.onErrorRetry(oe,y,le,je=>{const Ge=m[y];Ge&&Ge[0]&&Ge[0]($y,je)},{retryCount:(Fe.retryCount||0)+1,dedupe:!0})))}return Ae=!1,ae(),!0},[y,r]),me=M.useCallback((...J)=>Vy(r,E.current,...J),[]);if(gu(()=>{I.current=t,D.current=n,we(j)||(Y.current=j)}),gu(()=>{if(!y)return;const J=ne.bind(rt,ku);let ue=0;P().revalidateOnFocus&&(ue=Date.now()+P().focusThrottleInterval);const fe=K2(y,m,(Ae,Fe={})=>{if(Ae==Ly){const Me=Date.now();P().revalidateOnFocus&&Me>ue&&T()&&(ue=Me+P().focusThrottleInterval,J())}else if(Ae==Fy)P().revalidateOnReconnect&&T()&&J();else{if(Ae==Ry)return ne();if(Ae==$y)return ne(Fe)}});return k.current=!1,E.current=y,A.current=!0,B({_k:w}),G&&(g[y]||(we(S)||pr?J():O2(J))),()=>{k.current=!0,fe()}},[y]),gu(()=>{let J;function ue(){const fe=Vt(u)?u(O().data):u;fe&&J!==-1&&(J=setTimeout(de,fe))}function de(){!O().error&&(f||P().isVisible())&&(c||P().isOnline())?ne(ku).then(ue):ue()}return ue(),()=>{J&&(clearTimeout(J),J=-1)}},[u,f,c,y]),M.useDebugValue(q),o){if(!Hy&&pr&&Q)throw new Error("Fallback data is required when using Suspense in SSR.");Q&&(I.current=t,D.current=n,k.current=!1);const J=v[y],ue=!we(J)&&Q?me(J):Ky;if(xu(ue),!we(V)&&Q)throw V;const de=Q?ne(ku):Ky;!we(q)&&Q&&(de.status="fulfilled",de.value=!0),xu(de)}return{mutate:me,get data(){return R.data=!0,q},get error(){return R.error=!0,V},get isValidating(){return R.isValidating=!0,te},get isLoading(){return R.isLoading=!0,$}}});function Gy({userCredentials:e,listConversations:t,clientId:n}){const r=!!e&&n&&t,{data:i,error:o,isValidating:s,mutate:a}=Q2(r?[n,"conversations",e==null?void 0:e.userId]:null,async()=>(await t({})).conversations.filter(Z2).sort((u,f)=>new Date(f.updatedAt).getTime()-new Date(u.updatedAt).getTime()).map(u=>({...u,lastMessage:{...u.lastMessage,author:{type:u.lastMessage.userId===(e==null?void 0:e.userId)?"user":"bot"}}})),{revalidateOnFocus:!1,revalidateOnReconnect:!0,dedupingInterval:2e3});return{conversations:i??[],isLoading:s,error:o&&Pr(o),refresh:async()=>await a()}}const Z2=e=>!!e.lastMessage,J2=e=>e==null||e.length===0?"":e.charAt(0).toUpperCase()+e.slice(1),Eu=({className:e,onConversationClick:t,onNewConversation:n,onClose:r,currentConversationId:i,isLoading:o,conversations:s,botAvatar:a,botName:l,...u})=>{const{conversationHistory:f}=ye;return x.jsxs("div",{...u,...f.container,className:ar(f.container.className,e),children:[x.jsxs("div",{...f.header,children:["Conversations",r&&x.jsx("div",{...f.closeButton,children:x.jsx(ru,{onClick:r})})]}),o?x.jsx("div",{...f.loaderContainer,children:x.jsx(ky,{})}):x.jsx("div",{...f.scrollContainer,children:s.length===0?x.jsx("div",{...f.loaderContainer,children:"No conversation started yet"}):s.map(({id:c,lastMessage:h})=>{let d="";if(h.payload.type==="text")d=h.payload.text;else if(h.payload.type==="bloc"&&h.payload.items.some(m=>m.type==="text")){const m=h.payload.items.find(p=>p.type==="text");d=(m==null?void 0:m.payload.text)??""}else d="Sent an attachment";return x.jsxs("button",{...f.conversation.container,onClick:()=>t==null?void 0:t(c),"data-active":i===c?"":void 0,children:[h.author.type==="bot"?x.jsx(En,{userId:h.userId,src:a,...f.conversation.avatar,children:l??"Bot"}):x.jsx(En,{userId:h.userId,...f.conversation.avatar,fallback:f.conversation.userAvatar.className,children:x.jsx(JA,{strokeWidth:1.5})}),x.jsxs("div",{...f.conversation.content,children:[x.jsx("span",{...f.conversation.name,children:d}),x.jsx("span",{...f.conversation.timestamp,children:J2(gw(h.createdAt))})]}),x.jsx(ip,{strokeWidth:1.5,...f.conversation.chevron})]},c)})}),x.jsxs("button",{...f.newConversation.button,onClick:n,children:[x.jsx(KA,{...f.newConversation.icon}),"New conversation"]})]})};Eu.displayName="ConversationHistory";const Qy=({connected:e,configuration:t,isTyping:n,messages:r,user:i,isLoading:o,renderers:s,isReadOnly:a,disableComposer:l,error:u,participants:f,closeWindow:c,sendMessage:h,uploadFile:d,addMessageFeedback:m,listConversations:p,restartConversation:g,clientId:v,storageKey:y,soundOn:w,toggleSound:A,disableSendButton:k,conversationId:E,...I})=>{const{color:D,fontFamily:P,radius:T,themeMode:O,variant:B,headerVariant:L,botAvatar:F,botDescription:R,botName:N,composerPlaceholder:H,footer:z,feedbackEnabled:W,additionalStylesheetUrl:b,allowFileUpload:_,conversationHistory:j}=t,S={color:D,fontFamily:P,radius:T,themeMode:O,variant:B,headerVariant:L,additionalStylesheetUrl:b},[V,Y]=M.useState("chat"),q=Gy({clientId:v,listConversations:p,userCredentials:i});M.useEffect(()=>{V==="conversations"&&q.refresh()},[V]),W||(m=void 0);const Q=M.useMemo(()=>i?Ju(r,f,i.userId,N,F):[],[F,N,r,i,f]),X=M.useMemo(()=>{var te,$;return(($=(te=r.at(-1))==null?void 0:te.metadata)==null?void 0:$.conversationStatus)==="closed"},[r]),se=M.useRef(null),G=Qn(te=>te.setPortalContainer);return M.useEffect(()=>(G(se.current),()=>{G(null)}),[G]),x.jsxs(x.Fragment,{children:[x.jsx(Ng,{...S}),x.jsx("div",{ref:se,style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}}),x.jsx(Jl,{connected:e,allowFileUpload:_,uploadFile:d,storageKey:y,conversationId:E,...I,children:u||q.error?x.jsx(Ey,{error:u||q.error,restartConversation:g,closeWindow:c}):V==="conversations"?x.jsx(Eu,{onClose:c,conversations:q.conversations,isLoading:q.isLoading,onNewConversation:()=>{g==null||g(),Y("chat")},onConversationClick:te=>{g==null||g(te),Y("chat")},botAvatar:F,botName:N}):x.jsxs(x.Fragment,{children:[x.jsx(Sy,{showConversationHistory:j?()=>Y("conversations"):void 0,closeWindow:c,configuration:t,restartConversation:g,clientId:v,soundOn:w,toggleSound:A}),o?x.jsx(ky,{}):x.jsx(au,{botAvatar:F,botDescription:R,botName:N,renderers:s,isTyping:n,sendMessage:h,addMessageFeedback:m,messages:Q},E),!X&&x.jsx(Jm,{sendMessage:h,uploadFile:d,connected:e,isReadOnly:a,disableComposer:l,footer:z,composerPlaceholder:H,allowFileUpload:_,storageKey:y,disableSendButton:k,conversationId:E})]})})]})};function X2({configuration:e,storageKey:t,clientId:n,...r}){const i=t||`bp-webchat-${n}`,{messages:o,participants:s,sendMessage:a,uploadFile:l,saveMessageFeedback:u,conversationId:f,status:c,error:h,isTyping:d,isAwaitingResponse:m}=_y(),{openConversation:p,listConversations:g}=Py(),{userCredentials:v}=Ny(),{soundOn:y,toggleSound:w}=Dy({storageKey:i,soundEnabled:e==null?void 0:e.soundEnabled});return x.jsx(Qy,{configuration:e??{},user:v,isLoading:c==="connecting",isTyping:d,connected:c==="connected"?!0:c==="disconnected"?!1:void 0,messages:o,sendMessage:a,uploadFile:l,addMessageFeedback:u,listConversations:g,restartConversation:p,participants:s,error:h,clientId:n,soundOn:y,toggleSound:w,disableSendButton:m,conversationId:f,storageKey:i,...r})}const e_=({clientId:e,storageKey:t,configuration:n,apiUrl:r,user:i,conversationId:o,...s})=>{const a=t||`bp-webchat-${e}`;return x.jsx(dy,{clientId:e,apiUrl:r,userCredentials:i,conversationId:o,storageKey:a,storageLocation:n==null?void 0:n.storageLocation,adminSecret:n==null?void 0:n.adminSecret,children:x.jsx(X2,{configuration:n,storageKey:t,clientId:e,...s})})};function t_(e,t=globalThis==null?void 0:globalThis.document){const n=Ln(e);C.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var n_="DismissableLayer",Cu="dismissableLayer.update",r_="dismissableLayer.pointerDownOutside",i_="dismissableLayer.focusOutside",Zy,Jy=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Xy=C.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...l}=e,u=C.useContext(Jy),[f,c]=C.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,d]=C.useState({}),m=tn(t,I=>c(I)),p=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=p.indexOf(g),y=f?p.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,A=y>=v,k=a_(I=>{const D=I.target,P=[...u.branches].some(T=>T.contains(D));!A||P||(i==null||i(I),s==null||s(I),I.defaultPrevented||a==null||a())},h),E=l_(I=>{const D=I.target;[...u.branches].some(T=>T.contains(D))||(o==null||o(I),s==null||s(I),I.defaultPrevented||a==null||a())},h);return t_(I=>{y===u.layers.size-1&&(r==null||r(I),!I.defaultPrevented&&a&&(I.preventDefault(),a()))},h),C.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Zy=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),ev(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Zy)}},[f,h,n,u]),C.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),ev())},[f,u]),C.useEffect(()=>{const I=()=>d({});return document.addEventListener(Cu,I),()=>document.removeEventListener(Cu,I)},[]),x.jsx(Ft.div,{...l,ref:m,style:{pointerEvents:w?A?"auto":"none":void 0,...e.style},onFocusCapture:Zt(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Zt(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Zt(e.onPointerDownCapture,k.onPointerDownCapture)})});Xy.displayName=n_;var o_="DismissableLayerBranch",s_=C.forwardRef((e,t)=>{const n=C.useContext(Jy),r=C.useRef(null),i=tn(t,r);return C.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),x.jsx(Ft.div,{...e,ref:i})});s_.displayName=o_;function a_(e,t=globalThis==null?void 0:globalThis.document){const n=Ln(e),r=C.useRef(!1),i=C.useRef(()=>{});return C.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let l=function(){tv(r_,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function l_(e,t=globalThis==null?void 0:globalThis.document){const n=Ln(e),r=C.useRef(!1);return C.useEffect(()=>{const i=o=>{o.target&&!r.current&&tv(i_,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ev(){const e=new CustomEvent(Cu);document.dispatchEvent(e)}function tv(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?XN(i,o):i.dispatchEvent(o)}var Au="focusScope.autoFocusOnMount",Tu="focusScope.autoFocusOnUnmount",nv={bubbles:!1,cancelable:!0},u_="FocusScope",rv=C.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,l]=C.useState(null),u=Ln(i),f=Ln(o),c=C.useRef(null),h=tn(t,p=>l(p)),d=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(r){let p=function(w){if(d.paused||!a)return;const A=w.target;a.contains(A)?c.current=A:gn(c.current,{select:!0})},g=function(w){if(d.paused||!a)return;const A=w.relatedTarget;A!==null&&(a.contains(A)||gn(c.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const k of w)k.removedNodes.length>0&&gn(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",g);const y=new MutationObserver(v);return a&&y.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",g),y.disconnect()}}},[r,a,d.paused]),C.useEffect(()=>{if(a){sv.add(d);const p=document.activeElement;if(!a.contains(p)){const v=new CustomEvent(Au,nv);a.addEventListener(Au,u),a.dispatchEvent(v),v.defaultPrevented||(c_(m_(iv(a)),{select:!0}),document.activeElement===p&&gn(a))}return()=>{a.removeEventListener(Au,u),setTimeout(()=>{const v=new CustomEvent(Tu,nv);a.addEventListener(Tu,f),a.dispatchEvent(v),v.defaultPrevented||gn(p??document.body,{select:!0}),a.removeEventListener(Tu,f),sv.remove(d)},0)}}},[a,u,f,d]);const m=C.useCallback(p=>{if(!n&&!r||d.paused)return;const g=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,v=document.activeElement;if(g&&v){const y=p.currentTarget,[w,A]=f_(y);w&&A?!p.shiftKey&&v===A?(p.preventDefault(),n&&gn(w,{select:!0})):p.shiftKey&&v===w&&(p.preventDefault(),n&&gn(A,{select:!0})):v===y&&p.preventDefault()}},[n,r,d.paused]);return x.jsx(Ft.div,{tabIndex:-1,...s,ref:h,onKeyDown:m})});rv.displayName=u_;function c_(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(gn(r,{select:t}),document.activeElement!==n)return}function f_(e){const t=iv(e),n=ov(t,e),r=ov(t.reverse(),e);return[n,r]}function iv(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 ov(e,t){for(const n of e)if(!d_(n,{upTo:t}))return n}function d_(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 h_(e){return e instanceof HTMLInputElement&&"select"in e}function gn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&h_(e)&&t&&e.select()}}var sv=p_();function p_(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=av(e,t),e.unshift(t)},remove(t){var n;e=av(e,t),(n=e[0])==null||n.resume()}}}function av(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function m_(e){return e.filter(t=>t.tagName!=="A")}var Iu=0;function g_(){C.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??lv()),document.body.insertAdjacentElement("beforeend",e[1]??lv()),Iu++,()=>{Iu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Iu--}},[])}function lv(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Wo="right-scroll-bar-position",qo="width-before-scroll-bar",y_="with-scroll-bars-hidden",v_="--removed-body-scroll-bar-size";function Ou(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function b_(e,t){var n=M.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}var w_=typeof window<"u"?C.useLayoutEffect:C.useEffect,uv=new WeakMap;function S_(e,t){var n=b_(null,function(r){return e.forEach(function(i){return Ou(i,r)})});return w_(function(){var r=uv.get(n);if(r){var i=new Set(r),o=new Set(e),s=n.current;i.forEach(function(a){o.has(a)||Ou(a,null)}),o.forEach(function(a){i.has(a)||Ou(a,s)})}uv.set(n,e)},[e]),n}function x_(e){return e}function k_(e,t){t===void 0&&(t=x_);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(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var l=function(){var f=s;s=[],f.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(f){s.push(f),u()},filter:function(f){return s=s.filter(f),n}}}};return i}function E_(e){e===void 0&&(e={});var t=k_(null);return t.options=xt({async:!0,ssr:!1},e),t}var cv=function(e){var t=e.sideCar,n=Ip(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 C.createElement(r,xt({},n))};cv.isSideCarExport=!0;function C_(e,t){return e.useMedium(t),cv}var fv=E_(),Mu=function(){},Yo=C.forwardRef(function(e,t){var n=C.useRef(null),r=C.useState({onScrollCapture:Mu,onWheelCapture:Mu,onTouchMoveCapture:Mu}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,f=e.enabled,c=e.shards,h=e.sideCar,d=e.noRelative,m=e.noIsolation,p=e.inert,g=e.allowPinchZoom,v=e.as,y=v===void 0?"div":v,w=e.gapMode,A=Ip(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=h,E=S_([n,t]),I=xt(xt({},A),i);return C.createElement(C.Fragment,null,f&&C.createElement(k,{sideCar:fv,removeScrollBar:u,shards:c,noRelative:d,noIsolation:m,inert:p,setCallbacks:o,allowPinchZoom:!!g,lockRef:n,gapMode:w}),s?C.cloneElement(C.Children.only(a),xt(xt({},I),{ref:E})):C.createElement(y,xt({},I,{className:l,ref:E}),a))});Yo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Yo.classNames={fullWidth:qo,zeroRight:Wo};var A_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function T_(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=A_();return t&&e.setAttribute("nonce",t),e}function I_(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function O_(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var M_=function(){var e=0,t=null;return{add:function(n){e==0&&(t=T_())&&(I_(t,n),O_(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},D_=function(){var e=M_();return function(t,n){C.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},dv=function(){var e=D_(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},N_={left:0,top:0,right:0,gap:0},Du=function(e){return parseInt(e||"",10)||0},__=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[Du(n),Du(r),Du(i)]},P_=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return N_;var t=__(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])}},L_=dv(),mr="data-scroll-locked",F_=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
324
- .`.concat(y_,` {
323
+ `&&r++}}return[t,n]}class Jg extends Event{constructor(t,n){var r,i;super(t),this.code=(r=n==null?void 0:n.code)!=null?r:void 0,this.message=(i=n==null?void 0:n.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](t,n,r){return r(Xg(this),n)}[Symbol.for("Deno.customInspect")](t,n){return t(Xg(this),n)}}function MN(e){const t=globalThis.DOMException;return typeof t=="function"?new t(e,"SyntaxError"):new SyntaxError(e)}function Vl(e){return e instanceof Error?"errors"in e&&Array.isArray(e.errors)?e.errors.map(Vl).join(", "):"cause"in e&&e.cause instanceof Error?`${e}: ${Vl(e.cause)}`:e.message:`${e}`}function Xg(e){return{type:e.type,message:e.message,code:e.code,defaultPrevented:e.defaultPrevented,cancelable:e.cancelable,timeStamp:e.timeStamp}}var ey=e=>{throw TypeError(e)},Wl=(e,t,n)=>t.has(e)||ey("Cannot "+n),be=(e,t,n)=>(Wl(e,t,"read from private field"),n?n.call(e):t.get(e)),Ke=(e,t,n)=>t.has(e)?ey("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Le=(e,t,n,r)=>(Wl(e,t,"write to private field"),t.set(e,n),n),Qt=(e,t,n)=>(Wl(e,t,"access private method"),n),dt,_n,ur,Po,Lo,fi,cr,di,pn,fr,dr,hr,hi,Lt,ql,Yl,Kl,ty,Gl,Ql,pi,Zl,Jl;class Fo extends EventTarget{constructor(t,n){var r,i;super(),Ke(this,Lt),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Ke(this,dt),Ke(this,_n),Ke(this,ur),Ke(this,Po),Ke(this,Lo),Ke(this,fi),Ke(this,cr),Ke(this,di,null),Ke(this,pn),Ke(this,fr),Ke(this,dr,null),Ke(this,hr,null),Ke(this,hi,null),Ke(this,Yl,async o=>{var s;be(this,fr).reset();const{body:a,redirected:l,status:u,headers:f}=o;if(u===204){Qt(this,Lt,pi).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(l?Le(this,ur,new URL(o.url)):Le(this,ur,void 0),u!==200){Qt(this,Lt,pi).call(this,`Non-200 status code (${u})`,u);return}if(!(f.get("content-type")||"").startsWith("text/event-stream")){Qt(this,Lt,pi).call(this,'Invalid content type, expected "text/event-stream"',u);return}if(be(this,dt)===this.CLOSED)return;Le(this,dt,this.OPEN);const c=new Event("open");if((s=be(this,hi))==null||s.call(this,c),this.dispatchEvent(c),typeof a!="object"||!a||!("getReader"in a)){Qt(this,Lt,pi).call(this,"Invalid response body, expected a web ReadableStream",u),this.close();return}const h=new TextDecoder,d=a.getReader();let m=!0;do{const{done:p,value:g}=await d.read();g&&be(this,fr).feed(h.decode(g,{stream:!p})),p&&(m=!1,be(this,fr).reset(),Qt(this,Lt,Zl).call(this))}while(m)}),Ke(this,Kl,o=>{Le(this,pn,void 0),!(o.name==="AbortError"||o.type==="aborted")&&Qt(this,Lt,Zl).call(this,Vl(o))}),Ke(this,Gl,o=>{typeof o.id=="string"&&Le(this,di,o.id);const s=new MessageEvent(o.event||"message",{data:o.data,origin:be(this,ur)?be(this,ur).origin:be(this,_n).origin,lastEventId:o.id||""});be(this,hr)&&(!o.event||o.event==="message")&&be(this,hr).call(this,s),this.dispatchEvent(s)}),Ke(this,Ql,o=>{Le(this,fi,o)}),Ke(this,Jl,()=>{Le(this,cr,void 0),be(this,dt)===this.CONNECTING&&Qt(this,Lt,ql).call(this)});try{if(t instanceof URL)Le(this,_n,t);else if(typeof t=="string")Le(this,_n,new URL(t,DN()));else throw new Error("Invalid URL")}catch{throw MN("An invalid or illegal string was specified")}Le(this,fr,IN({onEvent:be(this,Gl),onRetry:be(this,Ql)})),Le(this,dt,this.CONNECTING),Le(this,fi,3e3),Le(this,Lo,(r=n==null?void 0:n.fetch)!=null?r:globalThis.fetch),Le(this,Po,(i=n==null?void 0:n.withCredentials)!=null?i:!1),Qt(this,Lt,ql).call(this)}get readyState(){return be(this,dt)}get url(){return be(this,_n).href}get withCredentials(){return be(this,Po)}get onerror(){return be(this,dr)}set onerror(t){Le(this,dr,t)}get onmessage(){return be(this,hr)}set onmessage(t){Le(this,hr,t)}get onopen(){return be(this,hi)}set onopen(t){Le(this,hi,t)}addEventListener(t,n,r){const i=n;super.addEventListener(t,i,r)}removeEventListener(t,n,r){const i=n;super.removeEventListener(t,i,r)}close(){be(this,cr)&&clearTimeout(be(this,cr)),be(this,dt)!==this.CLOSED&&(be(this,pn)&&be(this,pn).abort(),Le(this,dt,this.CLOSED),Le(this,pn,void 0))}}dt=new WeakMap,_n=new WeakMap,ur=new WeakMap,Po=new WeakMap,Lo=new WeakMap,fi=new WeakMap,cr=new WeakMap,di=new WeakMap,pn=new WeakMap,fr=new WeakMap,dr=new WeakMap,hr=new WeakMap,hi=new WeakMap,Lt=new WeakSet,ql=function(){Le(this,dt,this.CONNECTING),Le(this,pn,new AbortController),be(this,Lo)(be(this,_n),Qt(this,Lt,ty).call(this)).then(be(this,Yl)).catch(be(this,Kl))},Yl=new WeakMap,Kl=new WeakMap,ty=function(){var e;const t={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...be(this,di)?{"Last-Event-ID":be(this,di)}:void 0},cache:"no-store",signal:(e=be(this,pn))==null?void 0:e.signal};return"window"in globalThis&&(t.credentials=this.withCredentials?"include":"same-origin"),t},Gl=new WeakMap,Ql=new WeakMap,pi=function(e,t){var n;be(this,dt)!==this.CLOSED&&Le(this,dt,this.CLOSED);const r=new Jg("error",{code:t,message:e});(n=be(this,dr))==null||n.call(this,r),this.dispatchEvent(r)},Zl=function(e,t){var n;if(be(this,dt)===this.CLOSED)return;Le(this,dt,this.CONNECTING);const r=new Jg("error",{code:t,message:e});(n=be(this,dr))==null||n.call(this,r),this.dispatchEvent(r),Le(this,cr,setTimeout(be(this,Jl),be(this,fi)))},Jl=new WeakMap,Fo.CONNECTING=0,Fo.OPEN=1,Fo.CLOSED=2;function DN(){const e="document"in globalThis?globalThis.document:void 0;return e&&typeof e=="object"&&"baseURI"in e&&typeof e.baseURI=="string"?e.baseURI:void 0}async function NN(e){var t;const n=await e.clone().json();if((t=n==null?void 0:n.id)!=null&&t.startsWith("err_")){const r=new Error(n.message);throw r.id=n.id,r.code=n.code,r.type=n.type,r}return e}const ny=()=>{const e={};return{on:(t,n)=>{var r;return e[t]||(e[t]=new Set),(r=e[t])==null||r.add(n),()=>{var i;return(i=e[t])==null?void 0:i.delete(n)}},emit:(t,n)=>{var r,i;(r=e[t])==null||r.forEach(o=>o(n)),(i=e["*"])==null||i.forEach(o=>o({type:t,payload:n}))}}},Ue=e=>e.data,ry=10,iy=3e3,_N="60000",PN={throwOnError:!0},LN=({conversationId:e,userToken:t,clientId:n,apiUrl:r,adminSecret:i})=>{let o=0,s=null;const a=ny();let l=e;const u=()=>{s&&s.close();const f=`${`${r||Pe.getConfig().baseUrl}/${n}`}/initialize${l?`?conversationId=${l}`:""}`,c={...i?{"x-admin-secret":i}:{},...t?{"x-user-key":t}:{}};s=sy(f,c),s.addEventListener("open",()=>a.emit("open")),s.addEventListener("error",h=>{o<ry?(o++,setTimeout(()=>u(),iy)):a.emit("error",h)}),s.addEventListener("message",h=>{const d=oy(h.data);d.type==="init"&&(l=d.data.conversation.id??l),a.emit(d.type,d.data)})};return u(),a.on},FN=({userKey:e,clientId:t,apiUrl:n,customHeaders:r,advancedOptions:i})=>{const o={"x-user-key":e,...r},s=`${n||Pe.getConfig().baseUrl}/${t}`,a={...PN,baseUrl:s};return Pe.interceptors.response._fns.length===0&&Pe.interceptors.response.use(NN),{createConversation:()=>uN({...a,headers:o,body:{}}).then(Ue),getConversation:({conversationId:l})=>aN({...a,headers:o,path:{id:l}}).then(Ue),deleteConversation:({conversationId:l})=>sN({...a,headers:o,path:{id:l}}).then(Ue),listConversations:({nextToken:l})=>lN({...a,headers:o,query:{nextToken:l}}).then(Ue),listConversationMessages:({conversationId:l,nextToken:u})=>cN({...a,headers:o,path:{id:l},query:{nextToken:u}}).then(Ue),addParticipant:({conversationId:l,userId:u})=>dN({...a,headers:o,path:{id:l},body:{userId:u}}).then(Ue),removeParticipant:({conversationId:l,userId:u})=>hN({...a,headers:o,path:{id:l,userId:u}}).then(Ue),getParticipant:({conversationId:l,userId:u})=>pN({...a,headers:o,path:{id:l,userId:u}}).then(Ue),listParticipants:({conversationId:l,nextToken:u})=>fN({...a,headers:o,path:{id:l},query:{nextToken:u}}).then(Ue),createMessage:l=>vN({...a,headers:o,body:l}).then(Ue),updateMessage:({messageId:l,...u})=>yN({...a,headers:o,path:{id:l},body:u}).then(Ue),getMessage:({messageId:l})=>gN({...a,headers:o,path:{id:l}}).then(Ue),deleteMessage:({messageId:l})=>mN({...a,headers:o,path:{id:l}}).then(Ue),createFile:l=>TN({...a,headers:o,body:l}).then(Ue),getUser:()=>xN({...a,headers:o}).then(Ue),updateUser:l=>kN({...a,headers:o,body:l}).then(Ue),deleteUser:()=>SN({...a,headers:o}).then(Ue),createEvent:l=>AN({...a,headers:o,body:l}).then(Ue),getEvent:({eventId:l})=>CN({...a,headers:o,path:{id:l}}).then(Ue),addMessageFeedback:({messageId:l,...u})=>wN({...a,headers:o,path:{id:l},body:u}).then(Ue),removeMessageFeedback:({messageId:l})=>bN({...a,headers:o,path:{id:l}}).then(Ue),generateUserKey:({adminSecret:l,...u})=>EN({...a,headers:{"x-admin-secret":l},body:u}).then(Ue),listenConversation:({conversationId:l})=>{let u=0,f=null;const c=ny(),h=()=>{f&&f.close();const d=`${s}/conversations/${l}/listen`,m=i==null?void 0:i.eventSource;f=m?m({url:d,headers:o}):sy(d,o),f.addEventListener("open",()=>c.emit("open")),f.addEventListener("error",p=>{u<ry?(u++,setTimeout(()=>h(),iy)):c.emit("error",p)}),f.addEventListener("message",p=>{const g=oy(p.data);c.emit(g.type,g.data)})};return h(),c.on}}},oy=e=>{try{return JSON.parse(e)}catch{return e}},sy=(e,t)=>new Fo(e,{fetch:(n,r)=>fetch(n,{...r,headers:{...r==null?void 0:r.headers,...t,timeout:_N}})}),RN=async({apiUrl:e,clientId:t,adminSecret:n,clientHeaders:r,emitter:i,conversationId:o,userToken:s})=>new Promise(a=>{const l=LN({apiUrl:e,clientId:t,userToken:s,conversationId:o,adminSecret:n}),u=l("init",({conversation:f,messages:c,participants:h,user:d})=>{const m=za(f.id),p=c.reverse().map(lr).filter(Boolean);m.getState().setMessages(p),Va(f.id).getState().setParticipants(h);const v=FN({clientId:t,apiUrl:e,userKey:d.userKey,customHeaders:r});v.createEvent({conversationId:f.id,payload:{type:"conversation_started",data:{}}}).then(({event:y})=>{var w,C;(C=(w=y.payload.data)==null?void 0:w.status)!=null&&C.isInitial&&i.emit("conversation",f.id)}),a({on:l,conversation:f,messages:c,participants:h,user:d,client:v,onCleanup:()=>{u()}})})}),$N={webchat:"#9C27B0",client:"#2196F3",store:"#4CAF50",events:"#00BCD4"},BN={debug:"#9E9E9E",info:"#2196F3",warn:"#FF9800",error:"#F44336"};let ay=!1,Xl=null,ly=Date.now();const zN=e=>{ay=e,ly=Date.now()},UN=e=>{Xl=e},HN=()=>{const e=Date.now()-ly,t=Math.floor(e/1e3),n=e%1e3;return`+${t}.${n.toString().padStart(3,"0")}s`},jN=e=>e===void 0?"undefined":e===null?"null":e instanceof Error?{error:e.message,stack:e.stack}:e,Ro=e=>{const t=$N[e]||"#666",n=(r,...i)=>{if(!ay&&r!=="warn"&&r!=="error")return;const o=HN(),s=`%c[bp:${e}]%c ${o} %c${r.toUpperCase()}%c`,a=[`color: ${t}; font-weight: bold;`,"color: #999; font-size: 10px;",`color: ${BN[r]}; font-weight: bold;`,"color: inherit;"],l=i.map(jN);if(console[r](s,...a,...l),Xl){const[u,f]=i;Xl(`debug:${e}:${r}`,{message:typeof u=="string"?u:void 0,...typeof f=="object"&&f!==null?f:{}})}};return{debug:(...r)=>n("debug",...r),info:(...r)=>n("info",...r),warn:(...r)=>n("warn",...r),error:(...r)=>n("error",...r)}},uy={webchat:Ro("webchat"),client:Ro("client"),store:Ro("store"),events:Ro("events")};function cy(){const[e,t]=M.useState(!1),n=M.useRef(null);return{state:e,setState:(r,i)=>{if(t(r),!r)return()=>{};if(n.current=new Date,!i)return()=>{};const o=setTimeout(()=>{const s=n.current;s&&new Date().getTime()-s.getTime()>i&&t(!1)},i+100);return()=>clearTimeout(o)}}}const mi=uy.webchat;function fy({apiUrl:e="https://webchat.botpress.cloud",clientId:t,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:o,playNotificationSound:s,...a}){const l=kp(n,r),u=l(O=>O.conversationId),f=l(O=>O.user),c=l(O=>O.setConversationId),h=l(O=>O.setUser),{state:d,setState:m}=cy(),{state:p,setState:g}=cy(),v=M.useMemo(()=>ic(),[]),[y,w]=M.useState("connecting"),[C,k]=M.useState(void 0),[E,I]=M.useState(void 0),D=M.useRef(null),P=Ww(a.conversationId,a.userToken,u,f==null?void 0:f.userToken);M.useEffect(()=>{let O=!1;mi.info("starting initialization",{clientId:t,apiUrl:e,storageKey:n});const U=async()=>{var F;await T(P),O&&(mi.debug("initialization completed but effect was cleaned up, tearing down"),(F=D.current)==null||F.call(D),D.current=null)},L=jw(t,e);if(L){mi.error("configuration error",L),I(L),w("error");return}return U(),()=>{O=!0,D.current&&(D.current(),D.current=null)}},[a.conversationId,a.userToken,t,e]);const T=async({conversationId:O,userToken:U})=>{var _;(_=D.current)==null||_.call(D),I(void 0),m(!1),g(!1),w("connecting");const{on:L,conversation:F,user:R,client:N,onCleanup:j}=await RN({apiUrl:e,clientId:t,clientHeaders:o,emitter:v,adminSecret:i,conversationId:O,userToken:U});k(N),c(F.id),h({userId:R.id,userToken:R.userKey});const z=za(F.id),V=Va(F.id),b=[j,L("open",()=>{I(void 0),w("connected")}),L("error",B=>{mi.error("connection error",{error:B,conversationId:F.id}),I(S=>S||Pr(B)),w("error"),v.emit("error",new Error(`Connection to conversation lost: ${B==null?void 0:B.message}`))}),L("message_created",B=>{const S=lr(B);z.getState().saveMessage(S),R.id!==S.authorId&&(s==null||s(),m(!1),g(!1),v.emit("isTyping",{isTyping:!1,timeout:0})),v.emit("message",S)}),L("message_updated",B=>{const S=lr(B);z.getState().saveMessage(S)}),L("message_status_changed",B=>{var S;B.newStatus==="processing"&&z.getState().updateMessage((S=B.message.metadata)==null?void 0:S.clientMessageId,{status:B.newStatus})}),L("typing_stopped",()=>{m(!1),g(!1)}),L("typing_started",()=>{m(!0,5e3),g(!0,5e3),v.emit("isTyping",{isTyping:!0,timeout:5e3})}),L("participant_added",B=>{V.getState().addParticipant(B.participant),v.emit("participantAdded",B.participant)}),L("participant_removed",B=>{V.getState().removeParticipant(B.participantId),v.emit("participantRemoved",B.participantId)}),L("webchat_visibility",B=>v.emit("webchatVisibility",B.visibility)),L("webchat_config",B=>v.emit("webchatConfig",B.config)),L("custom",B=>v.emit("customEvent",B.event))];w("connected"),mi.info("client fully connected with event handlers ready",{conversationId:F.id}),D.current=()=>{b.forEach(B=>B())}};return{clientState:y,httpClient:C,error:E,activeConversationId:u,userCredentials:f,isTyping:d,isAwaitingResponse:p,openConversation:T,setAwaitingResponse:g,emitter:v,setError:I,setClientState:w}}const dy=M.createContext(null);function $o(){const e=M.useContext(dy);if(!e)throw new Error("useWebchatContext must be used inside <WebchatProvider>");return e}function hy({clientId:e,apiUrl:t,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:o,children:s,...a}){var k;const{clientState:l,httpClient:u,error:f,activeConversationId:c,userCredentials:h,isTyping:d,isAwaitingResponse:m,openConversation:p,setClientState:g,setError:v,setAwaitingResponse:y,emitter:w}=fy({apiUrl:t,clientId:e,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:o,conversationId:a.conversationId,userToken:(k=a.userCredentials)==null?void 0:k.userToken}),C={client:u,clientState:l,setClientState:g,conversationId:c,userCredentials:h,error:f,setError:v,isTyping:d,isAwaitingResponse:m,openConversation:p,setAwaitingResponse:y,emitter:w};return x.jsx(dy.Provider,{value:C,children:s})}const eu=({children:e,className:t,uploadFile:n,allowFileUpload:r,storageKey:i,conversationId:o,...s})=>{const{container:a}=ye,l=Qn(g=>g.setMessageContainerRef),f=Ep(o||"default",i)(g=>g.uploadFile),[c,h]=M.useState(0),d=M.useRef(null);M.useEffect(()=>{l(d)},[d,l]);const m=M.useCallback(g=>{n&&(g.forEach(v=>f(v,n)),h(0))},[f,n]),{getRootProps:p}=Mg({noClick:!0,noKeyboard:!0,onDrop:m,disabled:!(r&&n),onDragEnter:()=>h(g=>g+1),onDragLeave:()=>h(g=>g-1)});return x.jsxs("div",{...s,className:ar(a.className,t),...p(),ref:d,children:[x.jsxs("div",{"data-hover":c>0,...a.dropzone.overlay,children:["Drop files to upload",x.jsx(PA,{style:{width:"50px"}})]}),x.jsx(Ng,{children:e})]})};eu.displayName="Container";const py=M.forwardRef(({onClick:e,imgUrl:t,...n},r)=>{const{fab:i}=ye,{container:o,icon:s,image:a}=i??{};return t?x.jsx("img",{src:t,role:"button",tabIndex:0,...a,draggable:"false",onClick:e}):x.jsx("div",{...n,...o,ref:r,onClick:e,children:x.jsx("div",{...s})})});py.displayName="Fab";function Zt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function VN(e,t){const n=A.createContext(t),r=o=>{const{children:s,...a}=o,l=A.useMemo(()=>a,Object.values(a));return x.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function i(o){const s=A.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,i]}function my(e,t=[]){let n=[];function r(o,s){const a=A.createContext(s),l=n.length;n=[...n,s];const u=c=>{var v;const{scope:h,children:d,...m}=c,p=((v=h==null?void 0:h[e])==null?void 0:v[l])||a,g=A.useMemo(()=>m,Object.values(m));return x.jsx(p.Provider,{value:g,children:d})};u.displayName=o+"Provider";function f(c,h){var p;const d=((p=h==null?void 0:h[e])==null?void 0:p[l])||a,m=A.useContext(d);if(m)return m;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${o}\``)}return[u,f]}const i=()=>{const o=n.map(s=>A.createContext(s));return function(a){const l=(a==null?void 0:a[e])||o;return A.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,WN(i,...t)]}function WN(...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(o){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(o)[`__scope${u}`];return{...a,...c}},{});return A.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var qN=A[" useInsertionEffect ".trim().toString()]||en;function gy({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,o,s]=YN({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:i;{const f=A.useRef(e!==void 0);A.useEffect(()=>{const c=f.current;c!==a&&console.warn(`${r} is changing from ${c?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=a},[a,r])}const u=A.useCallback(f=>{var c;if(a){const h=KN(f)?f(e):f;h!==e&&((c=s.current)==null||c.call(s,h))}else o(f)},[a,e,o,s]);return[l,u]}function YN({defaultProp:e,onChange:t}){const[n,r]=A.useState(e),i=A.useRef(n),o=A.useRef(t);return qN(()=>{o.current=t},[t]),A.useEffect(()=>{var s;i.current!==n&&((s=o.current)==null||s.call(o,n),i.current=n)},[n,i]),[n,r,o]}function KN(e){return typeof e=="function"}function yy(e){const t=GN(e),n=A.forwardRef((r,i)=>{const{children:o,...s}=r,a=A.Children.toArray(o),l=a.find(ZN);if(l){const u=l.props.children,f=a.map(c=>c===l?A.Children.count(u)>1?A.Children.only(null):A.isValidElement(u)?u.props.children:null:c);return x.jsx(t,{...s,ref:i,children:A.isValidElement(u)?A.cloneElement(u,void 0,f):null})}return x.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}function GN(e){const t=A.forwardRef((n,r)=>{const{children:i,...o}=n;if(A.isValidElement(i)){const s=XN(i),a=JN(o,i.props);return i.type!==A.Fragment&&(a.ref=r?ns(r,s):s),A.cloneElement(i,a)}return A.Children.count(i)>1?A.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var QN=Symbol("radix.slottable");function ZN(e){return A.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===QN}function JN(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...a)=>{const l=o(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function XN(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var e2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ft=e2.reduce((e,t)=>{const n=yy(`Primitive.${t}`),r=A.forwardRef((i,o)=>{const{asChild:s,...a}=i,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function t2(e,t){e&&zu.flushSync(()=>e.dispatchEvent(t))}function n2(e,t){return A.useReducer((n,r)=>t[n][r]??n,e)}var Bo=e=>{const{present:t,children:n}=e,r=r2(t),i=typeof n=="function"?n({present:r.isPresent}):A.Children.only(n),o=tn(r.ref,i2(i));return typeof n=="function"||r.isPresent?A.cloneElement(i,{ref:o}):null};Bo.displayName="Presence";function r2(e){const[t,n]=A.useState(),r=A.useRef(null),i=A.useRef(e),o=A.useRef("none"),s=e?"mounted":"unmounted",[a,l]=n2(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return A.useEffect(()=>{const u=zo(r.current);o.current=a==="mounted"?u:"none"},[a]),en(()=>{const u=r.current,f=i.current;if(f!==e){const h=o.current,d=zo(u);e?l("MOUNT"):d==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(f&&h!==d?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),en(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,c=d=>{const p=zo(r.current).includes(CSS.escape(d.animationName));if(d.target===t&&p&&(l("ANIMATION_END"),!i.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},h=d=>{d.target===t&&(o.current=zo(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:A.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function zo(e){return(e==null?void 0:e.animationName)||"none"}function i2(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var o2=A[" useId ".trim().toString()]||(()=>{}),s2=0;function Uo(e){const[t,n]=A.useState(o2());return en(()=>{n(r=>r??String(s2++))},[e]),e||(t?`radix-${t}`:"")}var Ho="Collapsible",[a2]=my(Ho),[l2,tu]=a2(Ho),vy=A.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:s,...a}=e,[l,u]=gy({prop:r,defaultProp:i??!1,onChange:s,caller:Ho});return x.jsx(l2,{scope:n,disabled:o,contentId:Uo(),open:l,onOpenToggle:A.useCallback(()=>u(f=>!f),[u]),children:x.jsx(Ft.div,{"data-state":ru(l),"data-disabled":o?"":void 0,...a,ref:t})})});vy.displayName=Ho;var by="CollapsibleTrigger",wy=A.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,i=tu(by,n);return x.jsx(Ft.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":ru(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...r,ref:t,onClick:Zt(e.onClick,i.onOpenToggle)})});wy.displayName=by;var nu="CollapsibleContent",Sy=A.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=tu(nu,e.__scopeCollapsible);return x.jsx(Bo,{present:n||i.open,children:({present:o})=>x.jsx(u2,{...r,ref:t,present:o})})});Sy.displayName=nu;var u2=A.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:i,...o}=e,s=tu(nu,n),[a,l]=A.useState(r),u=A.useRef(null),f=tn(t,u),c=A.useRef(0),h=c.current,d=A.useRef(0),m=d.current,p=s.open||a,g=A.useRef(p),v=A.useRef(void 0);return A.useEffect(()=>{const y=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(y)},[]),en(()=>{const y=u.current;if(y){v.current=v.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const w=y.getBoundingClientRect();c.current=w.height,d.current=w.width,g.current||(y.style.transitionDuration=v.current.transitionDuration,y.style.animationName=v.current.animationName),l(r)}},[s.open,r]),x.jsx(Ft.div,{"data-state":ru(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!p,...o,ref:f,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:p&&i})});function ru(e){return e?"open":"closed"}var c2=vy,f2=Sy;const iu=({restartConversation:e,...t})=>{var o,s;const{header:n}=ye,{showInputModal:r}=Ka(),i=async a=>{a.stopPropagation(),r?r({title:"Create New Conversation",description:"This will clear the current conversation and start a new one.",confirmButtonText:"New conversation",cancelButtonText:"Cancel"}).then(()=>e()):e()};return x.jsx(KA,{...t,...(s=(o=n==null?void 0:n.content)==null?void 0:o.actions)==null?void 0:s.icons,"aria-label":"Restart Conversation Button",tabIndex:0,role:"button",onClick:i})},ou=({onClick:e,...t})=>{const{header:n}=ye,r=i=>{i.stopPropagation(),e==null||e()};return x.jsx(fp,{...t,...n.content.actions.icons,role:"button",tabIndex:0,"aria-label":"Close Chatbot Button",onClick:r,onKeyDown:i=>{i.key==="Enter"&&r(i)}})},d2=({onClick:e,...t})=>{const{header:n}=ye,r=i=>{i.stopPropagation(),e==null||e()};return x.jsx(op,{...t,...n.content.actions.icons,role:"button",tabIndex:0,"aria-label":"Show Recent Conversations Button",onClick:r,onKeyDown:i=>{i.key==="Enter"&&r(i)}})},gi=({icon:e,title:t,link:n,...r})=>{var s,a,l,u,f,c,h,d,m,p,g,v;const{header:i}=ye,o=e??LA;return t?n?x.jsxs("a",{...r,...(a=(s=i.expandedContent)==null?void 0:s.descriptionItems)==null?void 0:a.container,href:n,target:"_blank",rel:"noreferrer noopener",children:[x.jsx(o,{...(u=(l=i.expandedContent)==null?void 0:l.descriptionItems)==null?void 0:u.icon}),x.jsx("p",{...(c=(f=i.expandedContent)==null?void 0:f.descriptionItems)==null?void 0:c.link,children:t})]}):x.jsxs("div",{...r,...(d=(h=i.expandedContent)==null?void 0:h.descriptionItems)==null?void 0:d.container,children:[x.jsx(o,{...(p=(m=i.expandedContent)==null?void 0:m.descriptionItems)==null?void 0:p.icon}),x.jsx("p",{...(v=(g=i.expandedContent)==null?void 0:g.descriptionItems)==null?void 0:v.text,children:t})]}):null},h2=({soundOn:e,toggleSound:t})=>{const n=o=>{o.stopPropagation(),t==null||t()},{header:r}=ye,i=e?cp:tT;return x.jsx("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),n(o))},title:e?"Disable chat sounds":"Enable chat sounds",...r.content.actions.icons,children:x.jsx(i,{size:16})})},xy=({defaultOpen:e,closeWindow:t,configuration:n,restartConversation:r,showConversationHistory:i,disabled:o,soundOn:s,toggleSound:a,clientId:l,...u})=>{var p,g,v,y,w,C,k,E,I,D,P,T,O,U,L,F,R,N,j,z,V,b,_,B;const{header:f}=ye,[c,h]=M.useState(e),d=!!((p=n.email)!=null&&p.title)||!!((g=n.phone)!=null&&g.title)||!!((v=n.website)!=null&&v.title)||!!((y=n.termsOfService)!=null&&y.link)||!!((w=n.privacyPolicy)!=null&&w.link),m=d&&!o;return x.jsxs(c2,{open:m?c:!1,onOpenChange:m?h:void 0,"data-disabled":m?void 0:"",...f.container,...u,children:[x.jsxs(wy,{"aria-label":"Expand Header Button",...f.content.container,children:[x.jsx("div",{...f.content.conversationHistory,children:i&&!c&&x.jsx(d2,{onClick:i})}),x.jsx(En,{userId:l,src:n.botAvatar,...f.content.avatar,children:n.botName||"Bot"}),x.jsx("h2",{...f.content.title,children:n.botName||"Bot"}),n.botDescription&&x.jsx("p",{...f.content.description,children:n.botDescription}),x.jsxs("div",{...f.content.actions.container,children:[n.soundEnabled&&s!==void 0&&a&&x.jsx(h2,{soundOn:s,toggleSound:a}),r&&x.jsx(iu,{restartConversation:r}),t&&x.jsx(ou,{onClick:t})]})]}),d&&x.jsxs(f2,{...f.expandedContent.container,children:[x.jsxs("div",{"data-links":"",...f.expandedContent.group,children:[x.jsx(gi,{"data-email":"",icon:HA,title:(C=n.email)==null?void 0:C.title,link:(E=(k=n.email)==null?void 0:k.link)!=null&&E.startsWith("mailto:")?(I=n.email)==null?void 0:I.link:`mailto:${(D=n.email)==null?void 0:D.link}`}),x.jsx(gi,{"data-phone":"",icon:qA,title:(P=n.phone)==null?void 0:P.title,link:(O=(T=n.phone)==null?void 0:T.link)!=null&&O.startsWith("tel:")?(U=n.phone)==null?void 0:U.link:`tel:${(L=n.phone)==null?void 0:L.link}`}),x.jsx(gi,{"data-website":"",link:(F=n.website)==null?void 0:F.link,icon:$A,title:(R=n.website)==null?void 0:R.title})]}),x.jsxs("div",{"data-legal":"",...(N=f.expandedContent)==null?void 0:N.group,children:[((j=n.termsOfService)==null?void 0:j.link)&&x.jsx(gi,{"data-terms":"",link:(z=n.termsOfService)==null?void 0:z.link,icon:lp,title:(V=n.termsOfService)==null?void 0:V.title}),((b=n.privacyPolicy)==null?void 0:b.link)&&x.jsx(gi,{"data-privacy":"",link:(_=n.privacyPolicy)==null?void 0:_.link,icon:UA,title:(B=n.privacyPolicy)==null?void 0:B.title})]})]})]})},su=M.memo(({...e})=>{const{typingIndicator:t}=ye;return x.jsx("div",{...e,...t==null?void 0:t.container,children:x.jsx("div",{...t==null?void 0:t.loader})})});su.displayName="TypingIndicator";const au=M.memo(M.forwardRef(({direction:e,block:t,disableInput:n,children:r,sender:i,id:o,authorId:s,status:a,renderers:l,isReadOnly:u,isLastDeliveredMessage:f,feedback:c,timestamp:h,metadata:d,sendMessage:m,addMessageFeedback:p,showAvatar:g},v)=>{const[y,w]=M.useState([]),{message:{container:C,deliveryStatus:k}}=ye;return g=g??e==="incoming",x.jsx(qa.Provider,{value:{isLoading:y,setIsLoading:w},children:x.jsxs("div",{...C,className:ar(C==null?void 0:C.className,f&&(k==null?void 0:k.className)),"data-loaded":y.length===0,"data-disable-input":!!n,"data-direction":e,dir:"auto",ref:v,children:[e==="incoming"&&g&&x.jsx(ky,{authorId:s,sender:i}),t&&x.jsx(Dn,{block:{...t,isReadOnly:u,direction:e,timestamp:h,sender:i,feedback:c,messageId:o,status:a,metadata:d,sendMessage:m,addMessageFeedback:p},renderers:l}),e==="outgoing"&&g&&x.jsx(ky,{authorId:s,sender:i}),r]})})})),ky=({authorId:e,sender:t})=>{const{message:{avatar:n}}=ye,[r,i]=M.useState("idle"),o=Qu(e??"",15);return x.jsxs(us,{"data-color":o,"data-loading-status":r,...n==null?void 0:n.container,children:[x.jsx(cs,{...n==null?void 0:n.image,onLoadingStatusChange:i,src:t==null?void 0:t.avatar}),x.jsxs(fs,{...n==null?void 0:n.fallback,children:[t==null?void 0:t.name[0]," "]})]})};function p2({botAvatar:e,botDescription:t,botName:n}){const{messageList:{marquee:r}}=ye;return x.jsxs("li",{...r.container,children:[x.jsx(En,{src:e,...r.avatar,children:(n||"Bot").slice(0,1)}),x.jsxs("div",{...r.content,children:[x.jsx("h1",{...r.title,children:n||"Bot"}),x.jsx("p",{...r.description,children:t})]})]})}let lu=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");const m2=70,g2=300;function y2(e,t={}){const n=t.nearBottomThreshold??m2,[r,i]=M.useState(!0),o=M.useRef(null),s=M.useRef(0),a=M.useRef(!0),l=M.useRef(!1),u=M.useRef(!1),f=M.useRef(0),c=M.useCallback(y=>y.scrollHeight-y.clientHeight-y.scrollTop<n,[n]),h=M.useCallback((y,w=g2)=>{cancelAnimationFrame(f.current);const C=y.scrollTop,k=performance.now(),E=()=>{const I=performance.now()-k,D=Math.min(I/w,1),P=1-Math.pow(1-D,3),T=y.scrollHeight-y.clientHeight;y.scrollTop=C+(T-C)*P,s.current=y.scrollTop,D<1&&u.current?f.current=requestAnimationFrame(E):(y.scrollTop=y.scrollHeight-y.clientHeight,s.current=y.scrollTop,u.current=!1,a.current=!0,i(!0))};u.current=!0,f.current=requestAnimationFrame(E)},[]),d=M.useCallback(()=>{const y=o.current;y&&(a.current=!0,i(!0),h(y))},[h]),m=M.useCallback(()=>{const y=o.current;if(!y)return;if(l.current){l.current=!1,s.current=y.scrollTop,a.current=c(y);return}if(u.current){s.current=y.scrollTop,c(y)&&(u.current=!1,l.current=!0,y.scrollTop=y.scrollHeight-y.clientHeight,s.current=y.scrollTop,a.current=!0,i(!0));return}s.current=y.scrollTop;const w=c(y);a.current=w,i(w)},[c]),p=M.useCallback(y=>{y.deltaY<0&&(cancelAnimationFrame(f.current),u.current=!1,a.current=!1,i(!1))},[]),g=M.useCallback(()=>{u.current&&(cancelAnimationFrame(f.current),u.current=!1)},[]),v=M.useCallback(y=>{const w=o.current;w&&(w.removeEventListener("scroll",m),w.removeEventListener("wheel",p),w.removeEventListener("touchstart",g)),o.current=y,y&&(y.addEventListener("scroll",m,{passive:!0}),y.addEventListener("wheel",p,{passive:!0}),y.addEventListener("touchstart",g,{passive:!0}),s.current=y.scrollTop)},[m,p,g]);return M.useLayoutEffect(()=>{const y=o.current;if(y)if(a.current){const w=y.scrollHeight-y.clientHeight,C=w-y.scrollTop;C>0&&C<=y.clientHeight&&y.clientHeight>0?(u.current=!0,y.scrollTo({top:w,behavior:"smooth"}),cancelAnimationFrame(f.current),f.current=requestAnimationFrame(()=>{u.current&&o.current&&c(o.current)&&(u.current=!1,a.current=!0,i(!0))})):(cancelAnimationFrame(f.current),u.current=!1,y.scrollTop=w),s.current=w,a.current=!0}else l.current=!0,y.scrollTop=s.current},[e,c]),M.useEffect(()=>{const y=o.current;if(!y)return;const w=y.firstElementChild;if(!w)return;const C=new ResizeObserver(()=>{o.current&&(u.current||(a.current?(l.current=!0,o.current.scrollTop=o.current.scrollHeight-o.current.clientHeight,s.current=o.current.scrollTop):o.current.scrollTop=s.current))});return C.observe(w),()=>C.disconnect()},[]),M.useEffect(()=>{const y=window.visualViewport;if(!y)return;const w=()=>{const C=o.current;C&&(u.current||a.current&&(l.current=!0,C.scrollTop=C.scrollHeight-C.clientHeight,s.current=C.scrollTop))};return y.addEventListener("resize",w),()=>y.removeEventListener("resize",w)},[]),M.useEffect(()=>{const y=o.current;if(!y)return;let w=!1;const C=new IntersectionObserver(k=>{var E,I;(E=k[0])!=null&&E.isIntersecting&&w&&a.current&&(y.scrollTop=y.scrollHeight-y.clientHeight,s.current=y.scrollTop),w=!((I=k[0])!=null&&I.isIntersecting)});return C.observe(y),()=>C.disconnect()},[]),M.useEffect(()=>()=>cancelAnimationFrame(f.current),[]),{scrollRef:v,isAtBottom:r,scrollToBottom:d}}const v2={height:"100%",width:"100%",overflowY:"auto",scrollbarWidth:"none",overscrollBehaviorY:"contain"},uu=M.memo(({className:e,messages:t=[],isTyping:n,headerMessage:r,renderers:i,botAvatar:o,botDescription:s,botName:a,sendMessage:l,addMessageFeedback:u,showMarquee:f=!0,showDateSystemMessage:c=!0,showMessageStatus:h=!0,showIncomingMessageAvatar:d=!0,showOutgoingMessageAvatar:m=!1,...p})=>{var T;const{messageList:g}=ye,v=M.useMemo(()=>c?hb(t):t,[t]),y=M.useMemo(()=>{var U;const O=v.filter(L=>L.direction==="outgoing"&&L.status!=="pending");return(U=O[O.length-1])==null?void 0:U.id},[v]),w=v[v.length-1],C=(w==null?void 0:w.id)??"",k=`${v.length}:${C}:${n}`,{scrollRef:E,isAtBottom:I,scrollToBottom:D}=y2(k);M.useEffect(()=>{(w==null?void 0:w.direction)==="outgoing"&&D()},[C]);const P=O=>{if(O.direction==="incoming")return d;if(O.direction==="outgoing")return m};return x.jsxs("div",{...p,className:ar(g.container.className,e),children:[x.jsx("div",{ref:E,style:v2,children:x.jsxs("div",{className:g.viewPort.className,children:[r&&x.jsx("span",{...g.headerMessage,children:r}),f&&x.jsx(p2,{botAvatar:o,botDescription:s,botName:a}),v.map(O=>{var U;return x.jsx(au,{renderers:i,sendMessage:l,addMessageFeedback:u,isLastDeliveredMessage:h&&O.id===y,showAvatar:P(O),...O},((U=O.metadata)==null?void 0:U.clientMessageId)||O.id)}),n&&x.jsx(au,{id:lu(),renderers:i,sendMessage:l,direction:"incoming",timestamp:new Date,showAvatar:d,block:void 0,sender:((T=t.filter(O=>O.direction==="incoming").at(-1))==null?void 0:T.sender)??{name:a||"Bot",avatar:o},children:x.jsx(su,{})})]})}),!I&&x.jsx("button",{className:g.scrollDownButton.className,onClick:()=>D()})]})});uu.displayName="MessageList";const Ey=({className:e,...t})=>{const{className:n}=ye.loader;return x.jsx("div",{...t,className:ar(e,n)})};function Cy({error:e,restartConversation:t,closeWindow:n}){let r,i;const{error:o}=ye;return e.type==="configuration"?(r="Configuration error",i=x.jsx(WA,{...o.icon})):e.type==="bot"?(r="Bot error",i=x.jsx(ip,{...o.icon})):e.type==="network"?(r="Network error",i=x.jsx(nT,{...o.icon})):e.type==="disconnected"?(r="Disconnected",i=x.jsx(JA,{...o.icon})):(r="Unexpected error",i=x.jsx(ip,{...o.icon})),x.jsx(b2,{error:e,title:r,icon:i,restartConversation:t,closeWindow:n})}function b2({error:e,title:t,icon:n,restartConversation:r,closeWindow:i}){const{error:o}=ye;return x.jsxs("div",{...o.container,children:[x.jsxs("div",{...o.header.container,children:[`Webchat ${e.type} error`,x.jsxs("div",{...o.header.actions,children:[r&&x.jsx(iu,{restartConversation:r,style:{color:"white",backgroundColor:"transparent"}}),i&&x.jsx(ou,{onClick:i,style:{color:"white",backgroundColor:"transparent"}})]})]}),x.jsxs("div",{...o.content,children:[n,x.jsx("div",{...o.errorTitle,children:t}),x.jsx("div",{...o.errorMessage,children:e.message}),e.id&&x.jsx("div",{...o.id,children:e.id})]})]})}const yi=uy.webchat;async function w2(e,t){const{userId:n,conversationId:r,userToken:i,openConversation:o,setClientState:s,setError:a,emitter:l}=t;yi.warn("handleWebchatError",{userId:n,conversationId:r,type:e.type,message:e.message});const f=[{name:"startNewConversation",predicate:c=>c.message===Fs||c.type==="ResourceNotFound",recover:async()=>o({userToken:i})},{name:"reopenConversation",predicate:c=>c.type==="network",recover:async()=>o({userToken:i,conversationId:r})}].find(c=>c.predicate(e));if(!f){yi.error("no recovery strategy found, setting error state",{userId:n,conversationId:r}),s("error"),a(e);return}yi.info("attempting recovery",{userId:n,conversationId:r,strategy:f.name});try{await Qf(f.recover,3,5e3),yi.info("recovery successful",{userId:n,conversationId:r}),a(void 0),s("connected")}catch(c){yi.error("recovery failed",{error:c,userId:n,conversationId:r}),a(Pr(c)),s("error"),l.emit("error",c)}}function S2(e,t){return async(...n)=>{try{return await e(...n)}catch(r){await w2(Pr(r),t)}}}function Ay(e,t){const n={};for(const[r,i]of Object.entries(e))n[r]=S2(i,t);return n}function Ty({client:e,conversationId:t}){return{sendEvent:async(r,i)=>{if(!e||!t)throw new Error("Cannot send event: client or conversationId not available");await e.createEvent({conversationId:t,payload:{type:"custom",data:r},bindConversation:(i==null?void 0:i.bindConversation)??!0,bindUser:(i==null?void 0:i.bindUser)??!0})}}}function Iy({client:e,conversationId:t,user:n}){return{uploadFile:async i=>{if(!e)throw new Error("Client not initialized");if(!t)throw new Error("No active conversation");if(!n)throw new Error("User not authenticated");const{size:o,name:s}=i,a=await Vw(i),l=new Date;l.setDate(l.getDate()+30);const{file:{uploadUrl:u,contentType:f,url:c,id:h}}=await e.createFile({size:o,key:`${lu(6)}-${i.name}`,accessPolicies:["public_content"],index:!1,tags:{source:"integration",integrationName:"webchat",conversation:t,user:n.userId},expiresAt:l.toISOString()});await fetch(u,{method:"PUT",headers:{"x-amz-tagging":"public=true","content-type":f},body:a});const d=f.split("/").shift()??"",m=Rf(d)?d:"file";return{fileUrl:c,name:s,type:m,fileId:h}}}}function Oy({client:e,conversationId:t,userId:n,setAwaitingResponse:r}){const i=za(t||"default"),o=i(d=>d.messages),s=i(d=>d.saveMessage),a=i(d=>d.updateMessage),l=i(d=>d.setMessages),u=i(d=>d.clearMessages);return{messages:o,sendMessage:async d=>{if(!e||!t||!n)throw console.log("Cannot send message: client, conversationId, or userId not available",e,t,n),new Error("Cannot send message: client, conversationId, or userId not available");r==null||r(!0);const m=lu(),p={id:m,createdAt:new Date().toISOString(),userId:n,conversationId:t,payload:d,metadata:{clientMessageId:m,delivered:!1}},g=lr(p);g.status="pending",s(g),await e.createMessage({conversationId:t,payload:d,metadata:{clientMessageId:m}})},setMessages:d=>{const m=d.map(p=>lr(p)).filter(Boolean);l(m)},clearMessages:u,saveMessageFeedback:async(d,m)=>{if(!e)throw new Error("Cannot update feedback: client not available");a(d,{feedback:m.value}),await e.addMessageFeedback({messageId:d,...m})}}}function My({client:e,conversationId:t}){const n=Va(t||"default"),r=n(u=>u.participants),i=n(u=>u.setParticipants),o=n(u=>u.addParticipant),s=n(u=>u.removeParticipant),a=n(u=>u.clearParticipants);return{participants:r,setParticipants:i,fetchParticipants:async()=>{if(!e||!t)return;const{participants:u}=await e.listParticipants({conversationId:t});i(u)},clearParticipants:a,addParticipant:o,removeParticipant:s}}const Dy={chatMessageNotification:new URL("data:audio/ogg;base64,T2dnUwACAAAAAAAAAAAVJAEzAAAAAOU+A6UBHgF2b3JiaXMAAAAAASJWAAD/////AH0AAP////+pAU9nZ1MAAAAAAAAAAAAAFSQBMwEAAAD3T/UfDpz////////////////FA3ZvcmJpcwwAAABMYXZmNjEuNy4xMDAEAAAAHwAAAGVuY29kZXI9TGF2YzYxLjE5LjEwMSBsaWJ2b3JiaXMrAAAAZW5jb2RlZF9ieT1BZG9iZSBQcmVtaWVyZSBQcm8gMjAyNS4wIChNYWNpbhcAAAB0aW1lX3JlZmVyZW5jZT0xMjExMDQwMA8AAABkYXRlPTIwMjUtMDgtMDUBBXZvcmJpcyJCQ1YBAEAAABhCECoFrWOOOsgVIYwZoqBCyinHHULQIaMkQ4g6xjXHGGNHuWSKQsmB0JBVAABAAACkHFdQckkt55xzoxhXzHHoIOecc+UgZ8xxCSXnnHOOOeeSco4x55xzoxhXDnIpLeecc4EUR4pxpxjnnHOkHEeKcagY55xzbTG3knLOOeecc+Ygh1JyrjXnnHOkGGcOcgsl55xzxiBnzHHrIOecc4w1t9RyzjnnnHPOOeecc84555xzjDHnnHPOOeecc24x5xZzrjnnnHPOOeccc84555xzIDRkFQCQAACgoSiK4igOEBqyCgDIAAAQQHEUR5EUS7Ecy9EkDQgNWQUAAAEACAAAoEiGpEiKpViOZmmeJnqiKJqiKquyacqyLMuy67ouEBqyCgBIAABQURTFcBQHCA1ZBQBkAAAIYCiKoziO5FiSpVmeB4SGrAIAgAAABAAAUAxHsRRN8STP8jzP8zzP8zzP8zzP8zzP8zzP8zwNCA1ZBQAgAAAAgihkGANCQ1YBAEAAAAghGhlDnVISXAoWQhwRQx1CzkOppYPgKYUlY9JTrEEIIXzvPffee++B0JBVAAAQAABhFDiIgcckCCGEYhQnRHGmIAghhOUkWMp56CQI3YMQQrice8u59957IDRkFQAACADAIIQQQgghhBBCCCmklFJIKaaYYoopxxxzzDHHIIMMMuigk046yaSSTjrKJKOOUmsptRRTTLHlFmOttdacc69BKWOMMcYYY4wxxhhjjDHGGCMIDVkFAIAAABAGGWSQQQghhBRSSCmmmHLMMcccA0JDVgEAgAAAAgAAABxFUiRHciRHkiTJkixJkzzLszzLszxN1ERNFVXVVW3X9m1f9m3f1WXf9mXb1WVdlmXdtW1d1l1d13Vd13Vd13Vd13Vd13Vd14HQkFUAgAQAgI7kOI7kOI7kSI6kSAoQGrIKAJABABAAgKM4iuNIjuRYjiVZkiZplmd5lqd5mqiJHhAasgoAAAQAEAAAAAAAgKIoiqM4jiRZlqZpnqd6oiiaqqqKpqmqqmqapmmapmmapmmapmmapmmapmmapmmapmmapmmapmmapmkCoSGrAAAJAAAdx3EcR3Ecx3EkR5IkIDRkFQAgAwAgAABDURxFcizHkjRLszzL00TP9FxRNnVTV20gNGQVAAAIACAAAAAAAADHczzHczzJkzzLczzHkzxJ0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRN0zRNA0JDVgIAZAAAEJOQSk6xV0YpxiS0XiqkFJPUe6iYYkw67alCBikHuYdKIaWg094ypZBSDHunmELIGOqhg5AxhbDX2nPPvfceCA1ZEQBEAQAAxiDGEGPIMSYlgxIxxyRkUiLnnJROSialpFZazKSEmEqLkXNOSiclk1JaC6llkkprJaYCAAACHAAAAiyEQkNWBABRAACIMUgppBRSSjGnmENKKceUY0gp5ZxyTjnHmHQQKucYdA5KpJRyjjmnnHMSMgeVcw5CJp0AAIAABwCAAAuh0JAVAUCcAACAkHOKMQgRYxBCCSmFUFKqnJPSQUmpg5JSSanFklKMlXNSOgkpdRJSKinFWFKKLaRUY2kt19JSjS3GnFuMvYaUYi2p1Vpaq7nFWHOLNffIOUqdlNY6Ka2l1mpNrdXaSWktpNZiaS3G1mLNKcacMymthZZiK6nF2GLLNbWYc2kt1xRjzynGnmusucecgzCt1ZxayznFmHvMseeYcw+Sc5Q6Ka11UlpLrdWaWqs1k9Jaaa3GkFqLLcacW4sxZ1JaLKnFWFqKMcWYc4st19BarinGnFOLOcdag5Kx9l5aqznFmHuKreeYczA2x547SrmW1nourfVecy5C1tyLaC3n1GoPKsaec87B2NyDEK3lnGrsPcXYe+45GNtz8K3W4FvNRcicg9C5+KZ7MEbV2oPMtQiZcxA66CJ08Ml4lGoureVcWus91hp8zTkI0VruKcbeU4u9156bsL0HIVrLPcXYg4ox+JpzMDrnYlStwcecg5C1FqF7L0rnIJSqtQeZa1Ay1yJ08MXooIsvAABgwAEAIMCEMlBoyIoAIE4AgEHIOaUYhEopCKGElEIoKVWMSciYg5IxJ6WUUloIJbWKMQiZY1Iyx6SEEloqJbQSSmmplNJaKKW1llqMKbUWQymphVJaK6W0llqqMbVWY8SYlMw5KZljUkoprZVSWqsck5IxKKmDkEopKcVSUouVc1Iy6Kh0EEoqqcRUUmmtpNJSKaXFklJsKcVUW4u1hlJaLKnEVlJqMbVUW4sx14gxKRlzUjLnpJRSUiultJY5J6WDjkrmoKSSUmulpBQz5qR0DkrKIKNSUootpRJTKKW1klJspaTWWoy1ptRaLSW1VlJqsZQSW4sx1xZLTZ2U1koqMYZSWmsx5ppaizGUElspKcaSSmytxZpbbDmGUlosqcRWSmqx1ZZja7Hm1FKNKbWaW2y5xpRTj7X2nFqrNbVUY2ux5lhbb7XWnDsprYVSWislxZhai7HFWHMoJbaSUmylpBhbbLm2FmMPobRYSmqxpBJjazHmGFuOqbVaW2y5ptRirbX2HFtuPaUWa4ux5tJSjTXX3mNNORUAADDgAAAQYEIZKDRkJQAQBQAAGMMYYxAapZxzTkqDlHPOScmcgxBCSplzEEJIKXNOQkotZc5BSKm1UEpKrcUWSkmptRYLAAAocAAACLBBU2JxgEJDVgIAUQAAiDFKMQahMUYp5yA0xijFGIRKKcack1ApxZhzUDLHnINQSuaccxBKCSGUUkpKIYRSSkmpAACAAgcAgAAbNCUWByg0ZEUAEAUAABhjnDPOIQqdpc5SJKmj1lFrKKUaS4ydxlZ767nTGnttuTeUSo2p1o5ry7nV3mlNPbccCwAAO3AAADuwEAoNWQkA5AEAEMYoxZhzzhmFGHPOOecMUow555xzijHnnIMQQsWYc85BCCFzzjkIoYSSOecchBBK6JyDUEoppXTOQQihlFI65yCEUkopnXMQSimllAIAgAocAAACbBTZnGAkqNCQlQBAHgAAYAxCzklprWHMOQgt1dgwxhyUlGKLnIOQUou5RsxBSCnGoDsoKbUYbPCdhJRaizkHk1KLNefeg0iptZqDzj3VVnPPvfecYqw1595zLwAAd8EBAOzARpHNCUaCCg1ZCQDkAQAQCCnFmHPOGaUYc8w554xSjDHmnHOKMcacc85BxRhjzjkHIWPMOecghJAx5pxzEELonHMOQgghdM45ByGEEDrnoIMQQgidcxBCCCGEAgCAChwAAAJsFNmcYCSo0JCVAEA4AAAAIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEELonHPOOeecc84555xzzjnnnHPOOScAyLfCAcD/wcYZVpLOCkeDCw1ZCQCEAwAACkEopWIQSiklkk46KZ2TUEopkYNSSumklFJKCaWUUkoIpZRSSggdlFJCKaWUUkoppZRSSimllFI6KaWUUkoppZTKOSmlk1JKKaVEzkkpIZRSSimlhFJKKaWUUkoppZRSSimllFJKKaWEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQCALgbHAAgEmycYSXprHA0uNCQlQBASAAAoBRzjkoIKZSQUqiYoo5CKSmkUkoKEWPOSeochVBSKKmDyjkIpaSUQiohdc5BByWFkFIJIZWOOugolFBSKiWU0jkopYQUSkoplZBCSKl0lFIoJZWUQiohlVJKSCWVEEoKnaRUSgqppFRSCJ10kEInJaSSSgqpk5RSKiWllEpKJXRSQioppRBCSqmUEEpIKaVOUkmppBRCKCGFlFJKJaWSSkohlVRCCaWklFIooaRUUkoppZJSKQAA4MABACDACDrJqLIIG0248AAUGrISACADAECUdNZpp0kiCDFFmScNKcYgtaQswxBTkonxFGOMOShGQw4x5JQYF0oIoYNiPCaVQ8pQUbm31DkFxRZjfO+xFwEAAAgCAASEBAAYICiYAQAGBwgjBwIdAQQObQCAgQiZCQwKocFBJgA8QERIBQCJCYrShS4IIYJ0EWTxwIUTN5644YQObRAAAAAAABAA8AEAkFAAERHRzFVYXGBkaGxwdHh8gIQEAAAAAAAIAHwAACQiQERENHMVFhcYGRobHB0eHyAhAQAAAAAAAAAAQEBAAAAAAAAgAAAAQEBPZ2dTAASuMwAAAAAAABUkATMCAAAACYS6sR4BAUQxGR89NxobGiEkKCknJiYmJSUhISEaFgwBAQEAAnyfvULHAlAEJgh2vpgQBMHIyMjIyNhIQOjz+ePz58+fL89xAwYBAFaH//3//7/xNw0MBoNB6qlPfWrUKQng+/0FABAAhLEjKuHFBwA4AHC9Fx4Oh7EwDEOgvnJ3RtV+Op0+nU6n5cyzEwAoltTpwed5dgVKMPoru90zNHGA7F0CP98BAAAAAHl9ePviAgCW+3rugPIDwC6BbWoTAFEAAADh5GpCCACgc+0zxlAAVKddkjDsA14GDoJtf7R+NkE4W23hI5mF3d74iVGvzg9PpA4cCQs66joePTmOfhgl7vNZzYzQADDyz30FAGSvVUZ6wJ4MAKbCGeb4+v5NLIdK3YvrLkCu98uV//FpXQNyKAKAV7r186fTktcJJgjAlVp1fUmaGgtrdAAuDXYJSPs/AAAAAHDnAeHxciEUAB76CvfarGjDzIjALoEd+/0EAAAAQNYeMrkBAF6ZKm8xuw94NtgloHDUCAAAAIAMJ5Qz2iUAvjhKL8lkfmA6wi6BWfNHgiAAAABq4eeqGgCg8+LAAXQAfhgqz2RKHzAVYJeAynEAIQEAALwq6tFbIQAEEIIO8iULngMAXhgajrw3D5iFWhe7BLZNrwCVKAAA0t2TfT8mADx0aMfS4CULeACvA14YWnasNht80ZpdAhv8BEiiAADgcbm4jo0JANAVCTRV6JqQS0OTADoAXhg6zWy+AZ3GsiDRAYJzgiQAAICnb9FLAQAUNQFd44AioMNJICUAfhi67ZRjA2IMSHTAJK0KkgAAAG7W0uLlEgC6KnQdDkgBlAAdJAB+GHpL40hATAASHSC5CZIAAAAGZ3J60ioBoKsBTQKE5KFJIJFAAp4Y+jp7cg4qINEBi+MASQAAAM8rmdZcAKApwFhNPHQkQEBRQwIAnhj6OZ8KIBwDiQ4Q9ApIFAAAQHRFd6FEALA0NaApQAegnPrDA54Y+nN+AYAIJDoAfgIkCgAAcLRlPVsLALqmKqFpHIwUwQEJCwCeKPpzEQA8kOgAyTlBAgAAgPnK3q8jAWAuJFBYOsbAAgCeKPolEQA8rMFCohQAAMxD2BdSAJYFdNThKcCkBQCOgwKeGPpzEQA8rEEhCQAAoCz4MRGA41gaQMBRjACexHugAACeGPqFCAAeugQAAHryFgBdRYGFhGeow8x7AJ4Y+iURADyIigIAliFAAcYWCQC11gGeGPolEQA8UAAAABoODg4=",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:ts&&ts.tagName.toUpperCase()==="SCRIPT"&&ts.src||new URL("index.umd.cjs",document.baseURI).href).href};function Ny({storageKey:e,soundEnabled:t}){const n=Cp(e||"bp-webchat"),r=n(u=>u.soundOn),i=n(u=>u.toggleSound),o=M.useRef(null),s=M.useRef(t??!1),a=M.useRef(r);M.useEffect(()=>{try{o.current=new Audio,o.current.preload="auto",o.current.src=Dy.chatMessageNotification,o.current.volume=.9}catch(u){console.error("Error loading sound effect:",u),o.current=null}},[]),M.useEffect(()=>{s.current=t??!1},[t]),M.useEffect(()=>{a.current=r},[r]);const l=M.useCallback(()=>{s.current&&a.current&&o.current&&o.current.play().catch(()=>{})},[]);return{soundOn:r,toggleSound:i,playNotificationSound:l}}function x2({apiUrl:e="https://webchat.botpress.cloud",clientId:t,storageKey:n,storageLocation:r,adminSecret:i,soundEnabled:o,clientHeaders:s,...a}){var N;const{soundOn:l,toggleSound:u,playNotificationSound:f}=Ny({storageKey:n,soundEnabled:o}),{clientState:c,httpClient:h,error:d,activeConversationId:m,userCredentials:p,isTyping:g,isAwaitingResponse:v,openConversation:y,setAwaitingResponse:w,emitter:C,setError:k,setClientState:E}=fy({apiUrl:e,clientId:t,storageKey:n,storageLocation:r,adminSecret:i,clientHeaders:s,conversationId:a.conversationId,userToken:(N=a.user)==null?void 0:N.userToken,playNotificationSound:f}),{messages:I,sendMessage:D,saveMessageFeedback:P}=Oy({client:h,conversationId:m,userId:p==null?void 0:p.userId,setAwaitingResponse:w}),{participants:T}=My({client:h,conversationId:m}),{uploadFile:O}=Iy({client:h,conversationId:m,user:p}),{sendEvent:U}=Ty({client:h,conversationId:m});if(c!=="connected"||!p||!m||!h)return{clientState:c,on:C.on,client:void 0,messages:[],conversationId:void 0,newConversation:j=>{y({conversationId:j,userToken:p==null?void 0:p.userToken}).catch(z=>{C.emit("error",z)})},user:void 0,isTyping:void 0,participants:[],toggleSound:u,soundOn:l,error:d,disableSendButton:v};const L={userId:p==null?void 0:p.userId,conversationId:m,userToken:p==null?void 0:p.userToken,openConversation:y,setClientState:E,setError:k,emitter:C},R={...Ay({sendMessage:async j=>D(j),sendEvent:U,uploadFile:O,addMessageFeedback:P},L),getUser:async()=>{const{user:j}=await h.getUser();return j},updateUser:async j=>{const{user:z}=await h.updateUser({name:j.name,pictureUrl:j.pictureUrl,userData:j.data});return z},listConversations:async()=>h.listConversations({})};return{clientState:"connected",on:C.on,client:R,messages:I,conversationId:m,newConversation:j=>{y({conversationId:j,userToken:p.userToken}).catch(z=>{C.emit("error",z)})},user:p,isTyping:g,participants:T,error:d,soundOn:l,toggleSound:u,disableSendButton:v}}const _y=()=>{const{client:e,userCredentials:t}=$o();return e?{userCredentials:t,getUser:async()=>(await e.getUser()).user,updateUser:async i=>(await e.updateUser(i)).user}:{userCredentials:t,getUser:void 0,updateUser:void 0}};function Py(){const{client:e,conversationId:t,userCredentials:n,setAwaitingResponse:r,emitter:i,clientState:o,setClientState:s,setError:a,openConversation:l,error:u,isAwaitingResponse:f,isTyping:c}=$o(),{messages:h,sendMessage:d,saveMessageFeedback:m}=Oy({client:e,conversationId:t,userId:n==null?void 0:n.userId,setAwaitingResponse:r}),{participants:p}=My({client:e,conversationId:t}),{sendEvent:g}=Ty({client:e,conversationId:t}),{uploadFile:v}=Iy({client:e,conversationId:t,user:n}),y={userId:n==null?void 0:n.userId,userToken:n==null?void 0:n.userToken,conversationId:t,openConversation:l,setClientState:s,setError:a,emitter:i},w=Ay({sendMessage:d,saveMessageFeedback:m,sendEvent:g,uploadFile:v},y);return{conversationId:t,messages:h,participants:p,sendMessage:w.sendMessage,saveMessageFeedback:w.saveMessageFeedback,sendEvent:w.sendEvent,uploadFile:w.uploadFile,on:i.on,status:o,error:u,isAwaitingResponse:f,isTyping:c}}function Ly(){const{client:e,openConversation:t,userCredentials:n}=$o();return e?{listConversations:async()=>e.listConversations({}),openConversation:i=>t({conversationId:i,userToken:n==null?void 0:n.userToken})}:{listConversations:void 0,openConversation:i=>t({conversationId:i,userToken:n==null?void 0:n.userToken})}}const Fy=0,Ry=1,$y=2,By=3;var zy=Object.prototype.hasOwnProperty;function cu(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&cu(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(zy.call(e,n)&&++r&&!zy.call(t,n)||!(n in t)||!cu(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const Jt=new WeakMap,Xt=()=>{},rt=Xt(),fu=Object,we=e=>e===rt,Vt=e=>typeof e=="function",mn=(e,t)=>({...e,...t}),Uy=e=>Vt(e.then),du={},jo={},hu="undefined",vi=typeof window!=hu,pu=typeof document!=hu,k2=vi&&"Deno"in window,E2=()=>vi&&typeof window.requestAnimationFrame!=hu,Hy=(e,t)=>{const n=Jt.get(e);return[()=>!we(t)&&e.get(t)||du,r=>{if(!we(t)){const i=e.get(t);t in jo||(jo[t]=i),n[5](t,mn(i,r),i||du)}},n[6],()=>!we(t)&&t in jo?jo[t]:!we(t)&&e.get(t)||du]};let mu=!0;const C2=()=>mu,[gu,yu]=vi&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Xt,Xt],A2=()=>{const e=pu&&document.visibilityState;return we(e)||e!=="hidden"},T2=e=>(pu&&document.addEventListener("visibilitychange",e),gu("focus",e),()=>{pu&&document.removeEventListener("visibilitychange",e),yu("focus",e)}),I2=e=>{const t=()=>{mu=!0,e()},n=()=>{mu=!1};return gu("online",t),gu("offline",n),()=>{yu("online",t),yu("offline",n)}},O2={isOnline:C2,isVisible:A2},M2={initFocus:T2,initReconnect:I2},jy=!M.useId,pr=!vi||k2,D2=e=>E2()?window.requestAnimationFrame(e):setTimeout(e,1),vu=pr?M.useEffect:M.useLayoutEffect,bu=typeof navigator<"u"&&navigator.connection,Vy=!pr&&bu&&(["slow-2g","2g"].includes(bu.effectiveType)||bu.saveData),Vo=new WeakMap,N2=e=>fu.prototype.toString.call(e),wu=(e,t)=>e===`[object ${t}]`;let _2=0;const Su=e=>{const t=typeof e,n=N2(e),r=wu(n,"Date"),i=wu(n,"RegExp"),o=wu(n,"Object");let s,a;if(fu(e)===e&&!r&&!i){if(s=Vo.get(e),s)return s;if(s=++_2+"~",Vo.set(e,s),Array.isArray(e)){for(s="@",a=0;a<e.length;a++)s+=Su(e[a])+",";Vo.set(e,s)}if(o){s="#";const l=fu.keys(e).sort();for(;!we(a=l.pop());)we(e[a])||(s+=a+":"+Su(e[a])+",");Vo.set(e,s)}}else s=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return s},xu=e=>{if(Vt(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Su(e):"",[e,t]};let P2=0;const ku=()=>++P2;async function Wy(...e){const[t,n,r,i]=e,o=mn({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let s=o.populateCache;const a=o.rollbackOnError;let l=o.optimisticData;const u=h=>typeof a=="function"?a(h):a!==!1,f=o.throwOnError;if(Vt(n)){const h=n,d=[],m=t.keys();for(const p of m)!/^\$(inf|sub)\$/.test(p)&&h(t.get(p)._k)&&d.push(p);return Promise.all(d.map(c))}return c(n);async function c(h){const[d]=xu(h);if(!d)return;const[m,p]=Hy(t,d),[g,v,y,w]=Jt.get(t),C=()=>{const F=g[d];return(Vt(o.revalidate)?o.revalidate(m().data,h):o.revalidate!==!1)&&(delete y[d],delete w[d],F&&F[0])?F[0]($y).then(()=>m().data):m().data};if(e.length<3)return C();let k=r,E,I=!1;const D=ku();v[d]=[D,0];const P=!we(l),T=m(),O=T.data,U=T._c,L=we(U)?O:U;if(P&&(l=Vt(l)?l(L,O):l,p({data:l,_c:L})),Vt(k))try{k=k(L)}catch(F){E=F,I=!0}if(k&&Uy(k))if(k=await k.catch(F=>{E=F,I=!0}),D!==v[d][0]){if(I)throw E;return k}else I&&P&&u(E)&&(s=!0,p({data:L,_c:rt}));if(s&&!I)if(Vt(s)){const F=s(k,L);p({data:F,error:rt,_c:rt})}else p({data:k,error:rt,_c:rt});if(v[d][1]=ku(),Promise.resolve(C()).then(()=>{p({_c:rt})}),I){if(f)throw E;return}return k}}const qy=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},L2=(e,t)=>{if(!Jt.has(e)){const n=mn(M2,t),r=Object.create(null),i=Wy.bind(rt,e);let o=Xt;const s=Object.create(null),a=(f,c)=>{const h=s[f]||[];return s[f]=h,h.push(c),()=>h.splice(h.indexOf(c),1)},l=(f,c,h)=>{e.set(f,c);const d=s[f];if(d)for(const m of d)m(c,h)},u=()=>{if(!Jt.has(e)&&(Jt.set(e,[r,Object.create(null),Object.create(null),Object.create(null),i,l,a]),!pr)){const f=n.initFocus(setTimeout.bind(rt,qy.bind(rt,r,Fy))),c=n.initReconnect(setTimeout.bind(rt,qy.bind(rt,r,Ry)));o=()=>{f&&f(),c&&c(),Jt.delete(e)}}};return u(),[e,i,u,o]}return[e,Jt.get(e)[4]]},F2=(e,t,n,r,i)=>{const o=n.errorRetryCount,s=i.retryCount,a=~~((Math.random()+.5)*(1<<(s<8?s:8)))*n.errorRetryInterval;!we(o)&&s>o||setTimeout(r,a,i)},R2=cu,[Yy,$2]=L2(new Map),B2=mn({onLoadingSlow:Xt,onSuccess:Xt,onError:Xt,onErrorRetry:F2,onDiscarded:Xt,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:Vy?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:Vy?5e3:3e3,compare:R2,isPaused:()=>!1,cache:Yy,mutate:$2,fallback:{}},O2),z2=(e,t)=>{const n=mn(e,t);if(t){const{use:r,fallback:i}=e,{use:o,fallback:s}=t;r&&o&&(n.use=r.concat(o)),i&&s&&(n.fallback=mn(i,s))}return n},U2=M.createContext({}),H2="$inf$",Ky=vi&&window.__SWR_DEVTOOLS_USE__,j2=Ky?window.__SWR_DEVTOOLS_USE__:[],V2=()=>{Ky&&(window.__SWR_DEVTOOLS_REACT__=M)},W2=e=>Vt(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],q2=()=>{const e=M.useContext(U2);return M.useMemo(()=>mn(B2,e),[e])},Y2=e=>(t,n,r)=>e(t,n&&((...o)=>{const[s]=xu(t),[,,,a]=Jt.get(Yy);if(s.startsWith(H2))return n(...o);const l=a[s];return we(l)?n(...o):(delete a[s],l)}),r),K2=j2.concat(Y2),G2=e=>function(...n){const r=q2(),[i,o,s]=W2(n),a=z2(r,s);let l=e;const{use:u}=a,f=(u||[]).concat(K2);for(let c=f.length;c--;)l=f[c](l);return l(i,o||a.fetcher||null,a)},Q2=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i>=0&&(r[i]=r[r.length-1],r.pop())}};V2();const Eu=M.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),Cu={dedupe:!0},Gy=Promise.resolve(rt),Z2=()=>Xt,J2=G2((e,t,n)=>{const{cache:r,compare:i,suspense:o,fallbackData:s,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:f,refreshWhenOffline:c,keepPreviousData:h,strictServerPrefetchWarning:d}=n,[m,p,g,v]=Jt.get(r),[y,w]=xu(e),C=M.useRef(!1),k=M.useRef(!1),E=M.useRef(y),I=M.useRef(t),D=M.useRef(n),P=()=>D.current,T=()=>P().isVisible()&&P().isOnline(),[O,U,L,F]=Hy(r,y),R=M.useRef({}).current,N=we(s)?we(n.fallback)?rt:n.fallback[y]:s,j=(Z,ue)=>{for(const de in R){const fe=de;if(fe==="data"){if(!i(Z[fe],ue[fe])&&(!we(Z[fe])||!i(Y,ue[fe])))return!1}else if(ue[fe]!==Z[fe])return!1}return!0},z=!C.current,V=M.useMemo(()=>{const Z=O(),ue=F(),de=Me=>{const He=mn(Me);return delete He._k,(()=>{if(!y||!t||P().isPaused())return!1;if(z&&!we(a))return a;const ae=we(N)?He.data:N;return we(ae)||l})()?{isValidating:!0,isLoading:!0,...He}:He},fe=de(Z),Ae=Z===ue?fe:de(ue);let Fe=fe;return[()=>{const Me=de(O());return j(Me,Fe)?(Fe.data=Me.data,Fe.isLoading=Me.isLoading,Fe.isValidating=Me.isValidating,Fe.error=Me.error,Fe):(Fe=Me,Me)},()=>Ae]},[r,y]),b=as.useSyncExternalStore(M.useCallback(Z=>L(y,(ue,de)=>{j(de,ue)||Z()}),[r,y]),V[0],V[1]),_=m[y]&&m[y].length>0,B=b.data,S=we(B)?N&&Uy(N)?Eu(N):N:B,W=b.error,J=M.useRef(S),Y=h?we(B)?we(J.current)?S:J.current:B:S,G=y&&we(S),X=M.useRef(null);!pr&&as.useSyncExternalStore(Z2,()=>(X.current=!1,X),()=>(X.current=!0,X));const se=X.current;d&&se&&!o&&G&&console.warn(`Missing pre-initiated data for serialized key "${y}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const K=!y||!t||P().isPaused()||_&&!we(W)?!1:z&&!we(a)?a:o?we(S)?!1:l:we(S)||l,te=we(b.isValidating)?K:b.isValidating,$=we(b.isLoading)?K:b.isLoading,ne=M.useCallback(async Z=>{const ue=I.current;if(!y||!ue||k.current||P().isPaused())return!1;let de,fe,Ae=!0;const Fe=Z||{},Me=!g[y]||!Fe.dedupe,He=()=>jy?!k.current&&y===E.current&&C.current:y===E.current,ee={isValidating:!1,isLoading:!1},ae=()=>{U(ee)},H=()=>{const oe=g[y];oe&&oe[1]===fe&&delete g[y]},q={isValidating:!0};we(O().data)&&(q.isLoading=!0);try{if(Me&&(U(q),n.loadingTimeout&&we(O().data)&&setTimeout(()=>{Ae&&He()&&P().onLoadingSlow(y,n)},n.loadingTimeout),g[y]=[ue(w),ku()]),[de,fe]=g[y],de=await de,Me&&setTimeout(H,n.dedupingInterval),!g[y]||g[y][1]!==fe)return Me&&He()&&P().onDiscarded(y),!1;ee.error=rt;const oe=p[y];if(!we(oe)&&(fe<=oe[0]||fe<=oe[1]||oe[1]===0))return ae(),Me&&He()&&P().onDiscarded(y),!1;const le=O().data;ee.data=i(le,de)?le:de,Me&&He()&&P().onSuccess(de,y,n)}catch(oe){H();const le=P(),{shouldRetryOnError:he}=le;le.isPaused()||(ee.error=oe,Me&&He()&&(le.onError(oe,y,le),(he===!0||Vt(he)&&he(oe))&&(!P().revalidateOnFocus||!P().revalidateOnReconnect||T())&&le.onErrorRetry(oe,y,le,je=>{const Ge=m[y];Ge&&Ge[0]&&Ge[0](By,je)},{retryCount:(Fe.retryCount||0)+1,dedupe:!0})))}return Ae=!1,ae(),!0},[y,r]),me=M.useCallback((...Z)=>Wy(r,E.current,...Z),[]);if(vu(()=>{I.current=t,D.current=n,we(B)||(J.current=B)}),vu(()=>{if(!y)return;const Z=ne.bind(rt,Cu);let ue=0;P().revalidateOnFocus&&(ue=Date.now()+P().focusThrottleInterval);const fe=Q2(y,m,(Ae,Fe={})=>{if(Ae==Fy){const Me=Date.now();P().revalidateOnFocus&&Me>ue&&T()&&(ue=Me+P().focusThrottleInterval,Z())}else if(Ae==Ry)P().revalidateOnReconnect&&T()&&Z();else{if(Ae==$y)return ne();if(Ae==By)return ne(Fe)}});return k.current=!1,E.current=y,C.current=!0,U({_k:w}),K&&(g[y]||(we(S)||pr?Z():D2(Z))),()=>{k.current=!0,fe()}},[y]),vu(()=>{let Z;function ue(){const fe=Vt(u)?u(O().data):u;fe&&Z!==-1&&(Z=setTimeout(de,fe))}function de(){!O().error&&(f||P().isVisible())&&(c||P().isOnline())?ne(Cu).then(ue):ue()}return ue(),()=>{Z&&(clearTimeout(Z),Z=-1)}},[u,f,c,y]),M.useDebugValue(Y),o){if(!jy&&pr&&G)throw new Error("Fallback data is required when using Suspense in SSR.");G&&(I.current=t,D.current=n,k.current=!1);const Z=v[y],ue=!we(Z)&&G?me(Z):Gy;if(Eu(ue),!we(W)&&G)throw W;const de=G?ne(Cu):Gy;!we(Y)&&G&&(de.status="fulfilled",de.value=!0),Eu(de)}return{mutate:me,get data(){return R.data=!0,Y},get error(){return R.error=!0,W},get isValidating(){return R.isValidating=!0,te},get isLoading(){return R.isLoading=!0,$}}});function Qy({userCredentials:e,listConversations:t,clientId:n}){const r=!!e&&n&&t,{data:i,error:o,isValidating:s,mutate:a}=J2(r?[n,"conversations",e==null?void 0:e.userId]:null,async()=>(await t({})).conversations.filter(X2).sort((u,f)=>new Date(f.updatedAt).getTime()-new Date(u.updatedAt).getTime()).map(u=>({...u,lastMessage:{...u.lastMessage,author:{type:u.lastMessage.userId===(e==null?void 0:e.userId)?"user":"bot"}}})),{revalidateOnFocus:!1,revalidateOnReconnect:!0,dedupingInterval:2e3});return{conversations:i??[],isLoading:s,error:o&&Pr(o),refresh:async()=>await a()}}const X2=e=>!!e.lastMessage,e_=e=>e==null||e.length===0?"":e.charAt(0).toUpperCase()+e.slice(1),Au=({className:e,onConversationClick:t,onNewConversation:n,onClose:r,currentConversationId:i,isLoading:o,conversations:s,botAvatar:a,botName:l,...u})=>{const{conversationHistory:f}=ye;return x.jsxs("div",{...u,...f.container,className:ar(f.container.className,e),children:[x.jsxs("div",{...f.header,children:["Conversations",r&&x.jsx("div",{...f.closeButton,children:x.jsx(ou,{onClick:r})})]}),o?x.jsx("div",{...f.loaderContainer,children:x.jsx(Ey,{})}):x.jsx("div",{...f.scrollContainer,children:s.length===0?x.jsx("div",{...f.loaderContainer,children:"No conversation started yet"}):s.map(({id:c,lastMessage:h})=>{let d="";if(h.payload.type==="text")d=h.payload.text;else if(h.payload.type==="bloc"&&h.payload.items.some(m=>m.type==="text")){const m=h.payload.items.find(p=>p.type==="text");d=(m==null?void 0:m.payload.text)??""}else d="Sent an attachment";return x.jsxs("button",{...f.conversation.container,onClick:()=>t==null?void 0:t(c),"data-active":i===c?"":void 0,children:[h.author.type==="bot"?x.jsx(En,{userId:h.userId,src:a,...f.conversation.avatar,children:l??"Bot"}):x.jsx(En,{userId:h.userId,...f.conversation.avatar,fallback:f.conversation.userAvatar.className,children:x.jsx(XA,{strokeWidth:1.5})}),x.jsxs("div",{...f.conversation.content,children:[x.jsx("span",{...f.conversation.name,children:d}),x.jsx("span",{...f.conversation.timestamp,children:e_(yw(h.createdAt))})]}),x.jsx(sp,{strokeWidth:1.5,...f.conversation.chevron})]},c)})}),x.jsxs("button",{...f.newConversation.button,onClick:n,children:[x.jsx(GA,{...f.newConversation.icon}),"New conversation"]})]})};Au.displayName="ConversationHistory";const Zy=({connected:e,configuration:t,isTyping:n,messages:r,user:i,isLoading:o,renderers:s,isReadOnly:a,disableComposer:l,error:u,participants:f,closeWindow:c,sendMessage:h,uploadFile:d,addMessageFeedback:m,listConversations:p,restartConversation:g,clientId:v,storageKey:y,soundOn:w,toggleSound:C,disableSendButton:k,conversationId:E,...I})=>{const{color:D,fontFamily:P,radius:T,themeMode:O,variant:U,headerVariant:L,botAvatar:F,botDescription:R,botName:N,composerPlaceholder:j,footer:z,feedbackEnabled:V,additionalStylesheetUrl:b,allowFileUpload:_,conversationHistory:B}=t,S={color:D,fontFamily:P,radius:T,themeMode:O,variant:U,headerVariant:L,additionalStylesheetUrl:b},[W,J]=M.useState("chat"),Y=Qy({clientId:v,listConversations:p,userCredentials:i});M.useEffect(()=>{W==="conversations"&&Y.refresh()},[W]),V||(m=void 0);const G=M.useMemo(()=>i?ec(r,f,i.userId,N,F):[],[F,N,r,i,f]),X=M.useMemo(()=>{var te,$;return(($=(te=r.at(-1))==null?void 0:te.metadata)==null?void 0:$.conversationStatus)==="closed"},[r]),se=M.useRef(null),K=Qn(te=>te.setPortalContainer);return M.useEffect(()=>(K(se.current),()=>{K(null)}),[K]),x.jsxs(x.Fragment,{children:[x.jsx(_g,{...S}),x.jsx("div",{ref:se,style:{position:"fixed",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",zIndex:10}}),x.jsx(eu,{connected:e,allowFileUpload:_,uploadFile:d,storageKey:y,conversationId:E,...I,children:u||Y.error?x.jsx(Cy,{error:u||Y.error,restartConversation:g,closeWindow:c}):W==="conversations"?x.jsx(Au,{onClose:c,conversations:Y.conversations,isLoading:Y.isLoading,onNewConversation:()=>{g==null||g(),J("chat")},onConversationClick:te=>{g==null||g(te),J("chat")},botAvatar:F,botName:N}):x.jsxs(x.Fragment,{children:[x.jsx(xy,{showConversationHistory:B?()=>J("conversations"):void 0,closeWindow:c,configuration:t,restartConversation:g,clientId:v,soundOn:w,toggleSound:C}),o?x.jsx(Ey,{}):x.jsx(uu,{botAvatar:F,botDescription:R,botName:N,renderers:s,isTyping:n,sendMessage:h,addMessageFeedback:m,messages:G},E),!X&&x.jsx(Xm,{sendMessage:h,uploadFile:d,connected:e,isReadOnly:a,disableComposer:l,footer:z,composerPlaceholder:j,allowFileUpload:_,storageKey:y,disableSendButton:k,conversationId:E})]})})]})};function t_({configuration:e,storageKey:t,clientId:n,...r}){const i=t||`bp-webchat-${n}`,{messages:o,participants:s,sendMessage:a,uploadFile:l,saveMessageFeedback:u,conversationId:f,status:c,error:h,isTyping:d,isAwaitingResponse:m}=Py(),{openConversation:p,listConversations:g}=Ly(),{userCredentials:v}=_y(),{soundOn:y,toggleSound:w}=Ny({storageKey:i,soundEnabled:e==null?void 0:e.soundEnabled});return x.jsx(Zy,{configuration:e??{},user:v,isLoading:c==="connecting",isTyping:d,connected:c==="connected"?!0:c==="disconnected"?!1:void 0,messages:o,sendMessage:a,uploadFile:l,addMessageFeedback:u,listConversations:g,restartConversation:p,participants:s,error:h,clientId:n,soundOn:y,toggleSound:w,disableSendButton:m,conversationId:f,storageKey:i,...r})}const n_=({clientId:e,storageKey:t,configuration:n,apiUrl:r,user:i,conversationId:o,...s})=>{const a=t||`bp-webchat-${e}`;return x.jsx(hy,{clientId:e,apiUrl:r,userCredentials:i,conversationId:o,storageKey:a,storageLocation:n==null?void 0:n.storageLocation,adminSecret:n==null?void 0:n.adminSecret,children:x.jsx(t_,{configuration:n,storageKey:t,clientId:e,...s})})};function r_(e,t=globalThis==null?void 0:globalThis.document){const n=Ln(e);A.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var i_="DismissableLayer",Tu="dismissableLayer.update",o_="dismissableLayer.pointerDownOutside",s_="dismissableLayer.focusOutside",Jy,Xy=A.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ev=A.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:a,...l}=e,u=A.useContext(Xy),[f,c]=A.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,d]=A.useState({}),m=tn(t,I=>c(I)),p=Array.from(u.layers),[g]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=p.indexOf(g),y=f?p.indexOf(f):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,C=y>=v,k=u_(I=>{const D=I.target,P=[...u.branches].some(T=>T.contains(D));!C||P||(i==null||i(I),s==null||s(I),I.defaultPrevented||a==null||a())},h),E=c_(I=>{const D=I.target;[...u.branches].some(T=>T.contains(D))||(o==null||o(I),s==null||s(I),I.defaultPrevented||a==null||a())},h);return r_(I=>{y===u.layers.size-1&&(r==null||r(I),!I.defaultPrevented&&a&&(I.preventDefault(),a()))},h),A.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Jy=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),tv(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Jy)}},[f,h,n,u]),A.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),tv())},[f,u]),A.useEffect(()=>{const I=()=>d({});return document.addEventListener(Tu,I),()=>document.removeEventListener(Tu,I)},[]),x.jsx(Ft.div,{...l,ref:m,style:{pointerEvents:w?C?"auto":"none":void 0,...e.style},onFocusCapture:Zt(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Zt(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Zt(e.onPointerDownCapture,k.onPointerDownCapture)})});ev.displayName=i_;var a_="DismissableLayerBranch",l_=A.forwardRef((e,t)=>{const n=A.useContext(Xy),r=A.useRef(null),i=tn(t,r);return A.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),x.jsx(Ft.div,{...e,ref:i})});l_.displayName=a_;function u_(e,t=globalThis==null?void 0:globalThis.document){const n=Ln(e),r=A.useRef(!1),i=A.useRef(()=>{});return A.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let l=function(){nv(o_,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function c_(e,t=globalThis==null?void 0:globalThis.document){const n=Ln(e),r=A.useRef(!1);return A.useEffect(()=>{const i=o=>{o.target&&!r.current&&nv(s_,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function tv(){const e=new CustomEvent(Tu);document.dispatchEvent(e)}function nv(e,t,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?t2(i,o):i.dispatchEvent(o)}var Iu="focusScope.autoFocusOnMount",Ou="focusScope.autoFocusOnUnmount",rv={bubbles:!1,cancelable:!0},f_="FocusScope",iv=A.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[a,l]=A.useState(null),u=Ln(i),f=Ln(o),c=A.useRef(null),h=tn(t,p=>l(p)),d=A.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;A.useEffect(()=>{if(r){let p=function(w){if(d.paused||!a)return;const C=w.target;a.contains(C)?c.current=C:gn(c.current,{select:!0})},g=function(w){if(d.paused||!a)return;const C=w.relatedTarget;C!==null&&(a.contains(C)||gn(c.current,{select:!0}))},v=function(w){if(document.activeElement===document.body)for(const k of w)k.removedNodes.length>0&&gn(a)};document.addEventListener("focusin",p),document.addEventListener("focusout",g);const y=new MutationObserver(v);return a&&y.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",g),y.disconnect()}}},[r,a,d.paused]),A.useEffect(()=>{if(a){av.add(d);const p=document.activeElement;if(!a.contains(p)){const v=new CustomEvent(Iu,rv);a.addEventListener(Iu,u),a.dispatchEvent(v),v.defaultPrevented||(d_(y_(ov(a)),{select:!0}),document.activeElement===p&&gn(a))}return()=>{a.removeEventListener(Iu,u),setTimeout(()=>{const v=new CustomEvent(Ou,rv);a.addEventListener(Ou,f),a.dispatchEvent(v),v.defaultPrevented||gn(p??document.body,{select:!0}),a.removeEventListener(Ou,f),av.remove(d)},0)}}},[a,u,f,d]);const m=A.useCallback(p=>{if(!n&&!r||d.paused)return;const g=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,v=document.activeElement;if(g&&v){const y=p.currentTarget,[w,C]=h_(y);w&&C?!p.shiftKey&&v===C?(p.preventDefault(),n&&gn(w,{select:!0})):p.shiftKey&&v===w&&(p.preventDefault(),n&&gn(C,{select:!0})):v===y&&p.preventDefault()}},[n,r,d.paused]);return x.jsx(Ft.div,{tabIndex:-1,...s,ref:h,onKeyDown:m})});iv.displayName=f_;function d_(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(gn(r,{select:t}),document.activeElement!==n)return}function h_(e){const t=ov(e),n=sv(t,e),r=sv(t.reverse(),e);return[n,r]}function ov(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 sv(e,t){for(const n of e)if(!p_(n,{upTo:t}))return n}function p_(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 m_(e){return e instanceof HTMLInputElement&&"select"in e}function gn(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&m_(e)&&t&&e.select()}}var av=g_();function g_(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=lv(e,t),e.unshift(t)},remove(t){var n;e=lv(e,t),(n=e[0])==null||n.resume()}}}function lv(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function y_(e){return e.filter(t=>t.tagName!=="A")}var Mu=0;function v_(){A.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??uv()),document.body.insertAdjacentElement("beforeend",e[1]??uv()),Mu++,()=>{Mu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Mu--}},[])}function uv(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Wo="right-scroll-bar-position",qo="width-before-scroll-bar",b_="with-scroll-bars-hidden",w_="--removed-body-scroll-bar-size";function Du(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function S_(e,t){var n=M.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}var x_=typeof window<"u"?A.useLayoutEffect:A.useEffect,cv=new WeakMap;function k_(e,t){var n=S_(null,function(r){return e.forEach(function(i){return Du(i,r)})});return x_(function(){var r=cv.get(n);if(r){var i=new Set(r),o=new Set(e),s=n.current;i.forEach(function(a){o.has(a)||Du(a,null)}),o.forEach(function(a){i.has(a)||Du(a,s)})}cv.set(n,e)},[e]),n}function E_(e){return e}function C_(e,t){t===void 0&&(t=E_);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(o){var s=t(o,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(o){for(r=!0;n.length;){var s=n;n=[],s.forEach(o)}n={push:function(a){return o(a)},filter:function(){return n}}},assignMedium:function(o){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(o),s=n}var l=function(){var f=s;s=[],f.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(f){s.push(f),u()},filter:function(f){return s=s.filter(f),n}}}};return i}function A_(e){e===void 0&&(e={});var t=C_(null);return t.options=xt({async:!0,ssr:!1},e),t}var fv=function(e){var t=e.sideCar,n=Op(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 A.createElement(r,xt({},n))};fv.isSideCarExport=!0;function T_(e,t){return e.useMedium(t),fv}var dv=A_(),Nu=function(){},Yo=A.forwardRef(function(e,t){var n=A.useRef(null),r=A.useState({onScrollCapture:Nu,onWheelCapture:Nu,onTouchMoveCapture:Nu}),i=r[0],o=r[1],s=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,f=e.enabled,c=e.shards,h=e.sideCar,d=e.noRelative,m=e.noIsolation,p=e.inert,g=e.allowPinchZoom,v=e.as,y=v===void 0?"div":v,w=e.gapMode,C=Op(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=h,E=k_([n,t]),I=xt(xt({},C),i);return A.createElement(A.Fragment,null,f&&A.createElement(k,{sideCar:dv,removeScrollBar:u,shards:c,noRelative:d,noIsolation:m,inert:p,setCallbacks:o,allowPinchZoom:!!g,lockRef:n,gapMode:w}),s?A.cloneElement(A.Children.only(a),xt(xt({},I),{ref:E})):A.createElement(y,xt({},I,{className:l,ref:E}),a))});Yo.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Yo.classNames={fullWidth:qo,zeroRight:Wo};var I_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function O_(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=I_();return t&&e.setAttribute("nonce",t),e}function M_(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function D_(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var N_=function(){var e=0,t=null;return{add:function(n){e==0&&(t=O_())&&(M_(t,n),D_(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},__=function(){var e=N_();return function(t,n){A.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},hv=function(){var e=__(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},P_={left:0,top:0,right:0,gap:0},_u=function(e){return parseInt(e||"",10)||0},L_=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[_u(n),_u(r),_u(i)]},F_=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return P_;var t=L_(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])}},R_=hv(),mr="data-scroll-locked",$_=function(e,t,n,r){var i=e.left,o=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
324
+ .`.concat(b_,` {
325
325
  overflow: hidden `).concat(r,`;
326
326
  padding-right: `).concat(a,"px ").concat(r,`;
327
327
  }
@@ -355,13 +355,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
355
355
  }
356
356
 
357
357
  body[`).concat(mr,`] {
358
- `).concat(v_,": ").concat(a,`px;
358
+ `).concat(w_,": ").concat(a,`px;
359
359
  }
360
- `)},hv=function(){var e=parseInt(document.body.getAttribute(mr)||"0",10);return isFinite(e)?e:0},R_=function(){C.useEffect(function(){return document.body.setAttribute(mr,(hv()+1).toString()),function(){var e=hv()-1;e<=0?document.body.removeAttribute(mr):document.body.setAttribute(mr,e.toString())}},[])},$_=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;R_();var o=C.useMemo(function(){return P_(i)},[i]);return C.createElement(L_,{styles:F_(o,!t,i,n?"":"!important")})},Nu=!1;if(typeof window<"u")try{var Ko=Object.defineProperty({},"passive",{get:function(){return Nu=!0,!0}});window.addEventListener("test",Ko,Ko),window.removeEventListener("test",Ko,Ko)}catch{Nu=!1}var gr=Nu?{passive:!1}:!1,B_=function(e){return e.tagName==="TEXTAREA"},pv=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!B_(e)&&n[t]==="visible")},z_=function(e){return pv(e,"overflowY")},U_=function(e){return pv(e,"overflowX")},mv=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=gv(e,r);if(i){var o=yv(e,r),s=o[1],a=o[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},H_=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},j_=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},gv=function(e,t){return e==="v"?z_(t):U_(t)},yv=function(e,t){return e==="v"?H_(t):j_(t)},V_=function(e,t){return e==="h"&&t==="rtl"?-1:1},W_=function(e,t,n,r,i){var o=V_(e,window.getComputedStyle(t).direction),s=o*r,a=n.target,l=t.contains(a),u=!1,f=s>0,c=0,h=0;do{if(!a)break;var d=yv(e,a),m=d[0],p=d[1],g=d[2],v=p-g-o*m;(m||v)&&gv(e,a)&&(c+=v,h+=m);var y=a.parentNode;a=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(f&&Math.abs(c)<1||!f&&Math.abs(h)<1)&&(u=!0),u},Go=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},vv=function(e){return[e.deltaX,e.deltaY]},bv=function(e){return e&&"current"in e?e.current:e},q_=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Y_=function(e){return`
360
+ `)},pv=function(){var e=parseInt(document.body.getAttribute(mr)||"0",10);return isFinite(e)?e:0},B_=function(){A.useEffect(function(){return document.body.setAttribute(mr,(pv()+1).toString()),function(){var e=pv()-1;e<=0?document.body.removeAttribute(mr):document.body.setAttribute(mr,e.toString())}},[])},z_=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;B_();var o=A.useMemo(function(){return F_(i)},[i]);return A.createElement(R_,{styles:$_(o,!t,i,n?"":"!important")})},Pu=!1;if(typeof window<"u")try{var Ko=Object.defineProperty({},"passive",{get:function(){return Pu=!0,!0}});window.addEventListener("test",Ko,Ko),window.removeEventListener("test",Ko,Ko)}catch{Pu=!1}var gr=Pu?{passive:!1}:!1,U_=function(e){return e.tagName==="TEXTAREA"},mv=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!U_(e)&&n[t]==="visible")},H_=function(e){return mv(e,"overflowY")},j_=function(e){return mv(e,"overflowX")},gv=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=yv(e,r);if(i){var o=vv(e,r),s=o[1],a=o[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},V_=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},W_=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},yv=function(e,t){return e==="v"?H_(t):j_(t)},vv=function(e,t){return e==="v"?V_(t):W_(t)},q_=function(e,t){return e==="h"&&t==="rtl"?-1:1},Y_=function(e,t,n,r,i){var o=q_(e,window.getComputedStyle(t).direction),s=o*r,a=n.target,l=t.contains(a),u=!1,f=s>0,c=0,h=0;do{if(!a)break;var d=vv(e,a),m=d[0],p=d[1],g=d[2],v=p-g-o*m;(m||v)&&yv(e,a)&&(c+=v,h+=m);var y=a.parentNode;a=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(f&&Math.abs(c)<1||!f&&Math.abs(h)<1)&&(u=!0),u},Go=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},bv=function(e){return[e.deltaX,e.deltaY]},wv=function(e){return e&&"current"in e?e.current:e},K_=function(e,t){return e[0]===t[0]&&e[1]===t[1]},G_=function(e){return`
361
361
  .block-interactivity-`.concat(e,` {pointer-events: none;}
362
362
  .allow-interactivity-`).concat(e,` {pointer-events: all;}
363
- `)},K_=0,yr=[];function G_(e){var t=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),i=C.useState(K_++)[0],o=C.useState(dv)[0],s=C.useRef(e);C.useEffect(function(){s.current=e},[e]),C.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var p=Ya([e.lockRef.current],(e.shards||[]).map(bv),!0).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=C.useCallback(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!s.current.allowPinchZoom;var v=Go(p),y=n.current,w="deltaX"in p?p.deltaX:y[0]-v[0],A="deltaY"in p?p.deltaY:y[1]-v[1],k,E=p.target,I=Math.abs(w)>Math.abs(A)?"h":"v";if("touches"in p&&I==="h"&&E.type==="range")return!1;var D=mv(I,E);if(!D)return!0;if(D?k=I:(k=I==="v"?"h":"v",D=mv(I,E)),!D)return!1;if(!r.current&&"changedTouches"in p&&(w||A)&&(r.current=k),!k)return!0;var P=r.current||k;return W_(P,g,p,P==="h"?w:A)},[]),l=C.useCallback(function(p){var g=p;if(!(!yr.length||yr[yr.length-1]!==o)){var v="deltaY"in g?vv(g):Go(g),y=t.current.filter(function(k){return k.name===g.type&&(k.target===g.target||g.target===k.shadowParent)&&q_(k.delta,v)})[0];if(y&&y.should){g.cancelable&&g.preventDefault();return}if(!y){var w=(s.current.shards||[]).map(bv).filter(Boolean).filter(function(k){return k.contains(g.target)}),A=w.length>0?a(g,w[0]):!s.current.noIsolation;A&&g.cancelable&&g.preventDefault()}}},[]),u=C.useCallback(function(p,g,v,y){var w={name:p,delta:g,target:v,should:y,shadowParent:Q_(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(A){return A!==w})},1)},[]),f=C.useCallback(function(p){n.current=Go(p),r.current=void 0},[]),c=C.useCallback(function(p){u(p.type,vv(p),p.target,a(p,e.lockRef.current))},[]),h=C.useCallback(function(p){u(p.type,Go(p),p.target,a(p,e.lockRef.current))},[]);C.useEffect(function(){return yr.push(o),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:h}),document.addEventListener("wheel",l,gr),document.addEventListener("touchmove",l,gr),document.addEventListener("touchstart",f,gr),function(){yr=yr.filter(function(p){return p!==o}),document.removeEventListener("wheel",l,gr),document.removeEventListener("touchmove",l,gr),document.removeEventListener("touchstart",f,gr)}},[]);var d=e.removeScrollBar,m=e.inert;return C.createElement(C.Fragment,null,m?C.createElement(o,{styles:Y_(i)}):null,d?C.createElement($_,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Q_(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Z_=C_(fv,G_);var wv=C.forwardRef(function(e,t){return C.createElement(Yo,xt({},e,{ref:t,sideCar:Z_}))});wv.classNames=Yo.classNames;var J_=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},vr=new WeakMap,Qo=new WeakMap,Zo={},_u=0,Sv=function(e){return e&&(e.host||Sv(e.parentNode))},X_=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Sv(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})},eP=function(e,t,n,r){var i=X_(t,Array.isArray(e)?e:[e]);Zo[n]||(Zo[n]=new WeakMap);var o=Zo[n],s=[],a=new Set,l=new Set(i),u=function(c){!c||a.has(c)||(a.add(c),u(c.parentNode))};i.forEach(u);var f=function(c){!c||l.has(c)||Array.prototype.forEach.call(c.children,function(h){if(a.has(h))f(h);else try{var d=h.getAttribute(r),m=d!==null&&d!=="false",p=(vr.get(h)||0)+1,g=(o.get(h)||0)+1;vr.set(h,p),o.set(h,g),s.push(h),p===1&&m&&Qo.set(h,!0),g===1&&h.setAttribute(n,"true"),m||h.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",h,v)}})};return f(t),a.clear(),_u++,function(){s.forEach(function(c){var h=vr.get(c)-1,d=o.get(c)-1;vr.set(c,h),o.set(c,d),h||(Qo.has(c)||c.removeAttribute(r),Qo.delete(c)),d||c.removeAttribute(n)}),_u--,_u||(vr=new WeakMap,vr=new WeakMap,Qo=new WeakMap,Zo={})}},tP=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=J_(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),eP(r,i,n,"aria-hidden")):function(){return null}},Jo="Dialog",[xv]=py(Jo),[nP,Wt]=xv(Jo),kv=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=C.useRef(null),l=C.useRef(null),[u,f]=my({prop:r,defaultProp:i??!1,onChange:o,caller:Jo});return x.jsx(nP,{scope:t,triggerRef:a,contentRef:l,contentId:Uo(),titleId:Uo(),descriptionId:Uo(),open:u,onOpenChange:f,onOpenToggle:C.useCallback(()=>f(c=>!c),[f]),modal:s,children:n})};kv.displayName=Jo;var Ev="DialogTrigger",Cv=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Ev,n),o=tn(t,i.triggerRef);return x.jsx(Ft.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Lu(i.open),...r,ref:o,onClick:Zt(e.onClick,i.onOpenToggle)})});Cv.displayName=Ev;var rP="DialogPortal",[EL,Av]=xv(rP,{forceMount:void 0}),Xo="DialogOverlay",iP=C.forwardRef((e,t)=>{const n=Av(Xo,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Wt(Xo,e.__scopeDialog);return o.modal?x.jsx(Bo,{present:r||o.open,children:x.jsx(sP,{...i,ref:t})}):null});iP.displayName=Xo;var oP=gy("DialogOverlay.RemoveScroll"),sP=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Xo,n);return x.jsx(wv,{as:oP,allowPinchZoom:!0,shards:[i.contentRef],children:x.jsx(Ft.div,{"data-state":Lu(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Pn="DialogContent",Tv=C.forwardRef((e,t)=>{const n=Av(Pn,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Wt(Pn,e.__scopeDialog);return x.jsx(Bo,{present:r||o.open,children:o.modal?x.jsx(aP,{...i,ref:t}):x.jsx(lP,{...i,ref:t})})});Tv.displayName=Pn;var aP=C.forwardRef((e,t)=>{const n=Wt(Pn,e.__scopeDialog),r=C.useRef(null),i=tn(t,n.contentRef,r);return C.useEffect(()=>{const o=r.current;if(o)return tP(o)},[]),x.jsx(Iv,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Zt(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Zt(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:Zt(e.onFocusOutside,o=>o.preventDefault())})}),lP=C.forwardRef((e,t)=>{const n=Wt(Pn,e.__scopeDialog),r=C.useRef(!1),i=C.useRef(!1);return x.jsx(Iv,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),Iv=C.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=Wt(Pn,n),l=C.useRef(null),u=tn(t,l);return g_(),x.jsxs(x.Fragment,{children:[x.jsx(rv,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:x.jsx(Xy,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Lu(a.open),...s,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),x.jsxs(x.Fragment,{children:[x.jsx(uP,{titleId:a.titleId}),x.jsx(fP,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Pu="DialogTitle",Ov=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Pu,n);return x.jsx(Ft.h2,{id:i.titleId,...r,ref:t})});Ov.displayName=Pu;var Mv="DialogDescription",Dv=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Mv,n);return x.jsx(Ft.p,{id:i.descriptionId,...r,ref:t})});Dv.displayName=Mv;var Nv="DialogClose",_v=C.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Nv,n);return x.jsx(Ft.button,{type:"button",...r,ref:t,onClick:Zt(e.onClick,()=>i.onOpenChange(!1))})});_v.displayName=Nv;function Lu(e){return e?"open":"closed"}var Pv="DialogTitleWarning",[CL,Lv]=HN(Pv,{contentName:Pn,titleName:Pu,docsSlug:"dialog"}),uP=({titleId:e})=>{const t=Lv(Pv),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
363
+ `)},Q_=0,yr=[];function Z_(e){var t=A.useRef([]),n=A.useRef([0,0]),r=A.useRef(),i=A.useState(Q_++)[0],o=A.useState(hv)[0],s=A.useRef(e);A.useEffect(function(){s.current=e},[e]),A.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var p=Ga([e.lockRef.current],(e.shards||[]).map(wv),!0).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=A.useCallback(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!s.current.allowPinchZoom;var v=Go(p),y=n.current,w="deltaX"in p?p.deltaX:y[0]-v[0],C="deltaY"in p?p.deltaY:y[1]-v[1],k,E=p.target,I=Math.abs(w)>Math.abs(C)?"h":"v";if("touches"in p&&I==="h"&&E.type==="range")return!1;var D=gv(I,E);if(!D)return!0;if(D?k=I:(k=I==="v"?"h":"v",D=gv(I,E)),!D)return!1;if(!r.current&&"changedTouches"in p&&(w||C)&&(r.current=k),!k)return!0;var P=r.current||k;return Y_(P,g,p,P==="h"?w:C)},[]),l=A.useCallback(function(p){var g=p;if(!(!yr.length||yr[yr.length-1]!==o)){var v="deltaY"in g?bv(g):Go(g),y=t.current.filter(function(k){return k.name===g.type&&(k.target===g.target||g.target===k.shadowParent)&&K_(k.delta,v)})[0];if(y&&y.should){g.cancelable&&g.preventDefault();return}if(!y){var w=(s.current.shards||[]).map(wv).filter(Boolean).filter(function(k){return k.contains(g.target)}),C=w.length>0?a(g,w[0]):!s.current.noIsolation;C&&g.cancelable&&g.preventDefault()}}},[]),u=A.useCallback(function(p,g,v,y){var w={name:p,delta:g,target:v,should:y,shadowParent:J_(v)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(C){return C!==w})},1)},[]),f=A.useCallback(function(p){n.current=Go(p),r.current=void 0},[]),c=A.useCallback(function(p){u(p.type,bv(p),p.target,a(p,e.lockRef.current))},[]),h=A.useCallback(function(p){u(p.type,Go(p),p.target,a(p,e.lockRef.current))},[]);A.useEffect(function(){return yr.push(o),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:h}),document.addEventListener("wheel",l,gr),document.addEventListener("touchmove",l,gr),document.addEventListener("touchstart",f,gr),function(){yr=yr.filter(function(p){return p!==o}),document.removeEventListener("wheel",l,gr),document.removeEventListener("touchmove",l,gr),document.removeEventListener("touchstart",f,gr)}},[]);var d=e.removeScrollBar,m=e.inert;return A.createElement(A.Fragment,null,m?A.createElement(o,{styles:G_(i)}):null,d?A.createElement(z_,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function J_(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const X_=T_(dv,Z_);var Sv=A.forwardRef(function(e,t){return A.createElement(Yo,xt({},e,{ref:t,sideCar:X_}))});Sv.classNames=Yo.classNames;var eP=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},vr=new WeakMap,Qo=new WeakMap,Zo={},Lu=0,xv=function(e){return e&&(e.host||xv(e.parentNode))},tP=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=xv(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})},nP=function(e,t,n,r){var i=tP(t,Array.isArray(e)?e:[e]);Zo[n]||(Zo[n]=new WeakMap);var o=Zo[n],s=[],a=new Set,l=new Set(i),u=function(c){!c||a.has(c)||(a.add(c),u(c.parentNode))};i.forEach(u);var f=function(c){!c||l.has(c)||Array.prototype.forEach.call(c.children,function(h){if(a.has(h))f(h);else try{var d=h.getAttribute(r),m=d!==null&&d!=="false",p=(vr.get(h)||0)+1,g=(o.get(h)||0)+1;vr.set(h,p),o.set(h,g),s.push(h),p===1&&m&&Qo.set(h,!0),g===1&&h.setAttribute(n,"true"),m||h.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",h,v)}})};return f(t),a.clear(),Lu++,function(){s.forEach(function(c){var h=vr.get(c)-1,d=o.get(c)-1;vr.set(c,h),o.set(c,d),h||(Qo.has(c)||c.removeAttribute(r),Qo.delete(c)),d||c.removeAttribute(n)}),Lu--,Lu||(vr=new WeakMap,vr=new WeakMap,Qo=new WeakMap,Zo={})}},rP=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=eP(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),nP(r,i,n,"aria-hidden")):function(){return null}},Jo="Dialog",[kv]=my(Jo),[iP,Wt]=kv(Jo),Ev=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,a=A.useRef(null),l=A.useRef(null),[u,f]=gy({prop:r,defaultProp:i??!1,onChange:o,caller:Jo});return x.jsx(iP,{scope:t,triggerRef:a,contentRef:l,contentId:Uo(),titleId:Uo(),descriptionId:Uo(),open:u,onOpenChange:f,onOpenToggle:A.useCallback(()=>f(c=>!c),[f]),modal:s,children:n})};Ev.displayName=Jo;var Cv="DialogTrigger",Av=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Cv,n),o=tn(t,i.triggerRef);return x.jsx(Ft.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Ru(i.open),...r,ref:o,onClick:Zt(e.onClick,i.onOpenToggle)})});Av.displayName=Cv;var oP="DialogPortal",[AL,Tv]=kv(oP,{forceMount:void 0}),Xo="DialogOverlay",sP=A.forwardRef((e,t)=>{const n=Tv(Xo,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Wt(Xo,e.__scopeDialog);return o.modal?x.jsx(Bo,{present:r||o.open,children:x.jsx(lP,{...i,ref:t})}):null});sP.displayName=Xo;var aP=yy("DialogOverlay.RemoveScroll"),lP=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Xo,n);return x.jsx(Sv,{as:aP,allowPinchZoom:!0,shards:[i.contentRef],children:x.jsx(Ft.div,{"data-state":Ru(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Pn="DialogContent",Iv=A.forwardRef((e,t)=>{const n=Tv(Pn,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,o=Wt(Pn,e.__scopeDialog);return x.jsx(Bo,{present:r||o.open,children:o.modal?x.jsx(uP,{...i,ref:t}):x.jsx(cP,{...i,ref:t})})});Iv.displayName=Pn;var uP=A.forwardRef((e,t)=>{const n=Wt(Pn,e.__scopeDialog),r=A.useRef(null),i=tn(t,n.contentRef,r);return A.useEffect(()=>{const o=r.current;if(o)return rP(o)},[]),x.jsx(Ov,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Zt(e.onCloseAutoFocus,o=>{var s;o.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:Zt(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&o.preventDefault()}),onFocusOutside:Zt(e.onFocusOutside,o=>o.preventDefault())})}),cP=A.forwardRef((e,t)=>{const n=Wt(Pn,e.__scopeDialog),r=A.useRef(!1),i=A.useRef(!1);return x.jsx(Ov,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,o),o.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),Ov=A.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,a=Wt(Pn,n),l=A.useRef(null),u=tn(t,l);return v_(),x.jsxs(x.Fragment,{children:[x.jsx(iv,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:x.jsx(ev,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":Ru(a.open),...s,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),x.jsxs(x.Fragment,{children:[x.jsx(fP,{titleId:a.titleId}),x.jsx(hP,{contentRef:l,descriptionId:a.descriptionId})]})]})}),Fu="DialogTitle",Mv=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Fu,n);return x.jsx(Ft.h2,{id:i.titleId,...r,ref:t})});Mv.displayName=Fu;var Dv="DialogDescription",Nv=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(Dv,n);return x.jsx(Ft.p,{id:i.descriptionId,...r,ref:t})});Nv.displayName=Dv;var _v="DialogClose",Pv=A.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Wt(_v,n);return x.jsx(Ft.button,{type:"button",...r,ref:t,onClick:Zt(e.onClick,()=>i.onOpenChange(!1))})});Pv.displayName=_v;function Ru(e){return e?"open":"closed"}var Lv="DialogTitleWarning",[TL,Fv]=VN(Lv,{contentName:Pn,titleName:Fu,docsSlug:"dialog"}),fP=({titleId:e})=>{const t=Fv(Lv),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
364
364
 
365
365
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
366
366
 
367
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return C.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},cP="DialogDescriptionWarning",fP=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Lv(cP).contentName}}.`;return C.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},dP=kv,hP=Cv,pP=Tv,mP=Ov,gP=Dv,yP=_v;function br({open:e,onOpenChange:t,children:n}){const{modal:r}=ye;return x.jsxs(dP,{open:e,modal:!1,onOpenChange:t,children:[e&&x.jsx("div",{...r==null?void 0:r.overlay}),n]})}function vP({title:e,description:t,onConfirm:n,onCancel:r,confirmButtonText:i,cancelButtonText:o,children:s}){const{modal:a}=ye;return x.jsx(x.Fragment,{children:x.jsxs(pP,{...a.dialog.container,children:[x.jsx(mP,{...a.dialog.title,children:e}),x.jsx(gP,{...a.dialog.description,children:t}),x.jsx("div",{...a.dialog.content.container,children:s}),x.jsxs("div",{...a.dialog.button.container,children:[i&&x.jsx("button",{...a.dialog.button.confirm,type:"button",onClick:n,children:i}),o&&x.jsx("button",{...a.dialog.button.cancel,type:"button",onClick:r,children:o})]})]})})}br.Button=hP,br.Close=yP,br.Content=vP;const Fv=M.forwardRef(({children:e,onClick:t,avatarUrl:n,botName:r,description:i,onClose:o,...s},a)=>{const{messagePreview:l}=ye,{container:u,closeButton:f,message:c,avatar:h,description:d}=l??{};return x.jsxs("div",{...s,...u,ref:a,onClick:t,children:[x.jsx(En,{src:n,...h,children:r||"Bot"}),x.jsx("p",{...c,children:e}),x.jsx("p",{...d,children:i}),x.jsx(up,{...f,onClick:m=>{m.stopPropagation(),o==null||o()}})]})});Fv.displayName="MessagePreview",re.Avatar=En,re.BOT_IS_BLOCKED=zf,re.Block=Dn,re.CONFIG_ACCESS_DENIED=zw,re.Chat=Qy,re.Composer=Jm,re.Container=Jl,re.ConversationHistory=Eu,re.ErrorState=Ey,re.Fab=hy,re.Header=Sy,re.INVALID_API_URL=Rf,re.INVALID_BOTPRESS_URL=Bf,re.INVALID_CLIENT_ID=$f,re.INVALID_CONFIGURATION=Bw,re.INVALID_CONFIG_URL=$w,re.INVALID_MESSAGE_CONTENT_TYPE=jf,re.MISSING_API_URL=Lw,re.MISSING_BOT_ID=Fw,re.MISSING_CLIENT_ID=Ff,re.MISSING_CONFIG_URL=Rw,re.Message=ou,re.MessageContext=Va,re.MessageList=au,re.MessagePreview=Fv,re.Modal=br,re.ModalContext=Wa,re.ModalProvider=Dg,re.NETWORK_ERROR=Li,re.NOT_A_PARTICIPANT=Fs,re.QUOTA_EXCEEDED=Uf,re.RestartConversationButton=nu,re.SOUND_EFFECTS=My,re.SSE_DISCONNECTED_ERROR=Hf,re.StylesheetProvider=Ng,re.TypingIndicator=iu,re.Webchat=e_,re.WebchatProvider=dy,re._setDebugEnabled=$N,re._setTrackFn=BN,re.commonApiErrorMap=$s,re.enrichMessage=Ju,re.fileTypes=Pf,re.generateThemeOverride=_f,re.generateThemeStylesheet=Nf,re.getUseChatSoundStore=Ep,re.getUseWebchatClientStore=Sp,re.integrationMessagePayloadToBlockPayload=Pg,re.integrationMessageToBlockMessage=lr,re.isCommonApiErrorType=Wf,re.isEventError=Yf,re.isFileType=Lf,re.isIntegrationError=qf,re.isWebhookHandlerErrorType=Vf,re.mapToWebchatError=Pr,re.renderers=jm,re.retryWithBackoff=Kf,re.useActiveConversation=_y,re.useConversationList=Gy,re.useConversations=Py,re.useMessageContext=Cp,re.useModalContext=qa,re.useUser=Ny,re.useWebchat=w2,re.useWebchatContext=$o,re.useWebchatStore=Qn,re.webchatClasses=ye,re.webhookHandlerErrorMap=Rs,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"})});
367
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return A.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},dP="DialogDescriptionWarning",hP=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Fv(dP).contentName}}.`;return A.useEffect(()=>{var o;const i=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},pP=Ev,mP=Av,gP=Iv,yP=Mv,vP=Nv,bP=Pv;function br({open:e,onOpenChange:t,children:n}){const{modal:r}=ye;return x.jsxs(pP,{open:e,modal:!1,onOpenChange:t,children:[e&&x.jsx("div",{...r==null?void 0:r.overlay}),n]})}function wP({title:e,description:t,onConfirm:n,onCancel:r,confirmButtonText:i,cancelButtonText:o,children:s}){const{modal:a}=ye;return x.jsx(x.Fragment,{children:x.jsxs(gP,{...a.dialog.container,children:[x.jsx(yP,{...a.dialog.title,children:e}),x.jsx(vP,{...a.dialog.description,children:t}),x.jsx("div",{...a.dialog.content.container,children:s}),x.jsxs("div",{...a.dialog.button.container,children:[i&&x.jsx("button",{...a.dialog.button.confirm,type:"button",onClick:n,children:i}),o&&x.jsx("button",{...a.dialog.button.cancel,type:"button",onClick:r,children:o})]})]})})}br.Button=mP,br.Close=bP,br.Content=wP;const Rv=M.forwardRef(({children:e,onClick:t,avatarUrl:n,botName:r,description:i,onClose:o,...s},a)=>{const{messagePreview:l}=ye,{container:u,closeButton:f,message:c,avatar:h,description:d}=l??{};return x.jsxs("div",{...s,...u,ref:a,onClick:t,children:[x.jsx(En,{src:n,...h,children:r||"Bot"}),x.jsx("p",{...c,children:e}),x.jsx("p",{...d,children:i}),x.jsx(fp,{...f,onClick:m=>{m.stopPropagation(),o==null||o()}})]})});Rv.displayName="MessagePreview",re.Avatar=En,re.BOT_IS_BLOCKED=Hf,re.Block=Dn,re.CONFIG_ACCESS_DENIED=Uw,re.Chat=Zy,re.Composer=Xm,re.Container=eu,re.ConversationHistory=Au,re.ErrorState=Cy,re.Fab=py,re.Header=xy,re.INVALID_API_URL=Bf,re.INVALID_BOTPRESS_URL=Uf,re.INVALID_CLIENT_ID=zf,re.INVALID_CONFIGURATION=zw,re.INVALID_CONFIG_URL=Bw,re.INVALID_MESSAGE_CONTENT_TYPE=Wf,re.MISSING_API_URL=Fw,re.MISSING_BOT_ID=Rw,re.MISSING_CLIENT_ID=$f,re.MISSING_CONFIG_URL=$w,re.Message=au,re.MessageContext=qa,re.MessageList=uu,re.MessagePreview=Rv,re.Modal=br,re.ModalContext=Ya,re.ModalProvider=Ng,re.NETWORK_ERROR=Li,re.NOT_A_PARTICIPANT=Fs,re.QUOTA_EXCEEDED=jf,re.RestartConversationButton=iu,re.SOUND_EFFECTS=Dy,re.SSE_DISCONNECTED_ERROR=Vf,re.StylesheetProvider=_g,re.TypingIndicator=su,re.Webchat=n_,re.WebchatProvider=hy,re._setDebugEnabled=zN,re._setTrackFn=UN,re.commonApiErrorMap=$s,re.enrichMessage=ec,re.fileTypes=Ff,re.generateThemeOverride=Lf,re.generateThemeStylesheet=Pf,re.getUseChatSoundStore=Cp,re.getUseWebchatClientStore=kp,re.integrationMessagePayloadToBlockPayload=Lg,re.integrationMessageToBlockMessage=lr,re.isCommonApiErrorType=Yf,re.isEventError=Gf,re.isFileType=Rf,re.isIntegrationError=Kf,re.isWebhookHandlerErrorType=qf,re.mapToWebchatError=Pr,re.renderers=Vm,re.retryWithBackoff=Qf,re.useActiveConversation=Py,re.useConversationList=Qy,re.useConversations=Ly,re.useMessageContext=Ap,re.useModalContext=Ka,re.useUser=_y,re.useWebchat=x2,re.useWebchatContext=$o,re.useWebchatStore=Qn,re.webchatClasses=ye,re.webhookHandlerErrorMap=Rs,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"})});