@urbiport/js 0.0.14 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/web.d.ts +16 -1
- package/dist/web.d.ts.map +1 -1
- package/dist/web.js +2 -2
- package/package.json +1 -1
package/dist/web.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// v0.0.
|
|
1
|
+
// v0.0.14
|
|
2
2
|
function e(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(e)}function t(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];var i;return t[n]=Object.assign({},r),o(r.value)&&(i=r.value,"[object Function]"!==Object.prototype.toString.call(i))&&!Array.isArray(r.value)&&(t[n].value=Object.assign({},r.value)),Array.isArray(r.value)&&(t[n].value=r.value.slice(0)),t},{})}function n(e){if(e)try{return JSON.parse(e)}catch(t){return e}}function r(e,t,n,r){if(null==n||!1===n)return e.removeAttribute(t);let o=r?JSON.stringify(n):n;e.__updating[t]=!0,"true"===o&&(o=""),e.setAttribute(t,o),Promise.resolve().then(()=>delete e.__updating[t])}function o(e){return null!=e&&("object"==typeof e||"function"==typeof e)}let i;function a(e,o){const a=Object.keys(o);return class extends e{static get observedAttributes(){return a.map(e=>o[e].attribute)}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={};for(let e of a)this[e]=void 0}connectedCallback(){if(this.__initialized)return;this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=function(e,o){const i=t(o);return Object.keys(o).forEach(t=>{const o=i[t],a=e.getAttribute(o.attribute),s=e[t];null!=a&&(o.value=o.parse?n(a):a),null!=s&&(o.value=Array.isArray(s)?s.slice(0):s),o.reflect&&r(e,o.attribute,o.value,!!o.parse),Object.defineProperty(e,t,{get:()=>o.value,set(e){const n=o.value;o.value=e,o.reflect&&r(this,o.attribute,o.value,!!o.parse);for(let r=0,o=this.__propertyChangedCallbacks.length;r<o;r++)this.__propertyChangedCallbacks[r](t,e,n)},enumerable:!0,configurable:!0})}),i}(this,o);const e=function(e){return Object.keys(e).reduce((t,n)=>(t[n]=e[n].value,t),{})}(this.props),a=this.Component,s=i;try{i=this,this.__initialized=!0,!function(e){return"function"==typeof e&&0===e.toString().indexOf("class")}(a)?a(e,{element:this}):new a(e,{element:this})}finally{i=s}}async disconnectedCallback(){if(await Promise.resolve(),this.isConnected)return;this.__propertyChangedCallbacks.length=0;let e=null;for(;e=this.__releaseCallbacks.pop();)e(this);delete this.__initialized,this.__released=!0}attributeChangedCallback(e,t,r){if(this.__initialized&&!this.__updating[e]&&(e=this.lookupProp(e))in o){if(null==r&&!this[e])return;this[e]=o[e].parse?n(r):r}}lookupProp(e){if(o)return a.find(t=>e===t||e===o[t].attribute)}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(e){this.__releaseCallbacks.push(e)}addPropertyChangedCallback(e){this.__propertyChangedCallbacks.push(e)}}}function s(e,t={},n={}){const{BaseElement:r=HTMLElement,extension:i,customElements:s=window.customElements}=n;return n=>{if(!e)throw new Error("tag is required to register a Component");let l=s.get(e);return l?(l.prototype.Component=n,l):(l=a(r,function(e){return e?Object.keys(e).reduce((t,n)=>{const r=e[n];return t[n]=o(r)&&"value"in r?r:{value:r},t[n].attribute||(t[n].attribute=n.replace(/\.?([A-Z]+)/g,(e,t)=>"-"+t.toLowerCase()).replace("_","-").replace(/^-/,"")),t[n].parse="parse"in t[n]?t[n].parse:"string"!=typeof t[n].value,t},{}):{}}(t)),l.prototype.Component=n,l.prototype.registeredTag=e,s.define(e,l,i),l)}}const l={context:void 0},u=Symbol("solid-proxy"),c=Symbol("solid-track"),d=Symbol("solid-dev-component"),p={equals:(e,t)=>e===t};let f=V;const h=1,g=2,m={owned:null,cleanups:null,context:null,owner:null};var v=null;let y=null,b=null,w=null,E=null,_=0;const[x,k]=S(!1);function C(e,t){const n=b,r=v,o=0===e.length,i=o?m:{owned:null,cleanups:null,context:null,owner:void 0===t?r:t},a=o?e:()=>e(()=>O(()=>K(i)));v=i,b=null;try{return H(a,!0)}finally{b=n,v=r}}function S(e,t){const n={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},p,t):p).equals||void 0};return[M.bind(n),e=>("function"==typeof e&&(e=e(n.value)),U(n,e))]}function T(e,t,n){j($(e,t,!1,h))}function D(e,t,n){f=W;const r=$(e,t,!1,h);n&&n.render||(r.user=!0),E?E.push(r):j(r)}function A(e,t,n){n=n?Object.assign({},p,n):p;const r=$(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,j(r),M.bind(r)}function O(e){if(null===b)return e();const t=b;b=null;try{return e()}finally{b=t}}function P(e){D(()=>O(e))}function I(e){return null===v||(null===v.cleanups?v.cleanups=[e]:v.cleanups.push(e)),e}function N(){return b}function R(){return v}function B(e,t){const n=Symbol("context");return{id:n,Provider:Q(n),defaultValue:e}}function F(e){let t;return void 0!==(t=Z(v,e.id))?t:e.defaultValue}function L(e){const t=A(e),n=A(()=>X(t()));return n.toArray=()=>{const e=n();return Array.isArray(e)?e:null!=e?[e]:[]},n}function M(){if(this.sources&&this.state)if(this.state===h)j(this);else{const e=w;w=null,H(()=>q(this),!1),w=e}if(b){const e=this.observers?this.observers.length:0;b.sources?(b.sources.push(this),b.sourceSlots.push(e)):(b.sources=[this],b.sourceSlots=[e]),this.observers?(this.observers.push(b),this.observerSlots.push(b.sources.length-1)):(this.observers=[b],this.observerSlots=[b.sources.length-1])}return this.value}function U(e,t,n){let r=e.value;return e.comparator&&e.comparator(r,t)||(e.value=t,e.observers&&e.observers.length&&H(()=>{for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t],r=y&&y.running;r&&y.disposed.has(n),(r?n.tState:n.state)||(n.pure?w.push(n):E.push(n),n.observers&&G(n)),r||(n.state=h)}if(w.length>1e6)throw w=[],new Error},!1)),t}function j(e){if(!e.fn)return;K(e);const t=v,n=b,r=_;b=v=e,function(e,t,n){let r;try{r=e.fn(t)}catch(t){return e.pure&&(e.state=h,e.owned&&e.owned.forEach(K),e.owned=null),e.updatedAt=n+1,Y(t)}(!e.updatedAt||e.updatedAt<=n)&&(null!=e.updatedAt&&"observers"in e?U(e,r):e.value=r,e.updatedAt=n)}(e,e.value,r),b=n,v=t}function $(e,t,n,r=h,o){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:v,context:null,pure:n};return null===v||v!==m&&(v.owned?v.owned.push(i):v.owned=[i]),i}function z(e){if(0===e.state)return;if(e.state===g)return q(e);if(e.suspense&&O(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<_);)e.state&&t.push(e);for(let n=t.length-1;n>=0;n--)if((e=t[n]).state===h)j(e);else if(e.state===g){const n=w;w=null,H(()=>q(e,t[0]),!1),w=n}}function H(e,t){if(w)return e();let n=!1;t||(w=[]),E?n=!0:E=[],_++;try{const t=e();return function(e){w&&(V(w),w=null);if(e)return;const t=E;E=null,t.length&&H(()=>f(t),!1)}(n),t}catch(e){n||(E=null),w=null,Y(e)}}function V(e){for(let t=0;t<e.length;t++)z(e[t])}function W(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:z(r)}for(t=0;t<n;t++)z(e[t])}function q(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){const r=e.sources[n];if(r.sources){const e=r.state;e===h?r!==t&&(!r.updatedAt||r.updatedAt<_)&&z(r):e===g&&q(r,t)}}}function G(e){for(let t=0;t<e.observers.length;t+=1){const n=e.observers[t];n.state||(n.state=g,n.pure?w.push(n):E.push(n),n.observers&&G(n))}}function K(e){let t;if(e.sources)for(;e.sources.length;){const t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){const e=r.pop(),o=t.observerSlots.pop();n<r.length&&(e.sourceSlots[o]=n,r[n]=e,t.observerSlots[n]=o)}}if(e.owned){for(t=e.owned.length-1;t>=0;t--)K(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function Y(e,t=v){const n=function(e){return e instanceof Error?e:new Error("string"==typeof e?e:"Unknown error",{cause:e})}(e);throw n}function Z(e,t){return e?e.context&&void 0!==e.context[t]?e.context[t]:Z(e.owner,t):void 0}function X(e){if("function"==typeof e&&!e.length)return X(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=X(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function Q(e,t){return function(t){let n;return T(()=>n=O(()=>(v.context={[e]:t.value},L(()=>t.children))),void 0),n}}const J=Symbol("fallback");function ee(e){for(let t=0;t<e.length;t++)e[t]()}function te(e,t){return O(()=>e(t||{}))}function ne(){return!0}const re={get:(e,t,n)=>t===u?n:e.get(t),has:(e,t)=>t===u||e.has(t),set:ne,deleteProperty:ne,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:ne,deleteProperty:ne}),ownKeys:e=>e.keys()};function oe(e){return(e="function"==typeof e?e():e)?e:{}}function ie(){for(let e=0,t=this.length;e<t;++e){const t=this[e]();if(void 0!==t)return t}}function ae(...e){let t=!1;for(let n=0;n<e.length;n++){const r=e[n];t=t||!!r&&u in r,e[n]="function"==typeof r?(t=!0,A(r)):r}if(t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){const r=oe(e[n])[t];if(void 0!==r)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in oe(e[n]))return!0;return!1},keys(){const t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(oe(e[n])));return[...new Set(t)]}},re);const n={},r={},o=new Set;for(let t=e.length-1;t>=0;t--){const i=e[t];if(!i)continue;const a=Object.getOwnPropertyNames(i);for(let e=0,t=a.length;e<t;e++){const t=a[e];if("__proto__"===t||"constructor"===t)continue;const s=Object.getOwnPropertyDescriptor(i,t);if(o.has(t)){const e=r[t];e?s.get?e.push(s.get.bind(i)):void 0!==s.value&&e.push(()=>s.value):void 0===n[t]&&(n[t]=s.value)}else s.get?(o.add(t),Object.defineProperty(n,t,{enumerable:!0,configurable:!0,get:ie.bind(r[t]=[s.get.bind(i)])})):(void 0!==s.value&&o.add(t),n[t]=s.value)}}return n}function se(e,...t){if(u in e){const n=new Set(t.length>1?t.flat():t[0]),r=t.map(t=>new Proxy({get:n=>t.includes(n)?e[n]:void 0,has:n=>t.includes(n)&&n in e,keys:()=>t.filter(t=>t in e)},re));return r.push(new Proxy({get:t=>n.has(t)?void 0:e[t],has:t=>!n.has(t)&&t in e,keys:()=>Object.keys(e).filter(e=>!n.has(e))},re)),r}const n={},r=t.map(()=>({}));for(const o of Object.getOwnPropertyNames(e)){const i=Object.getOwnPropertyDescriptor(e,o),a=!i.get&&!i.set&&i.enumerable&&i.writable&&i.configurable;let s=!1,l=0;for(const e of t)e.includes(o)&&(s=!0,a?r[l][o]=i.value:Object.defineProperty(r[l],o,i)),++l;s||(a?n[o]=i.value:Object.defineProperty(n,o,i))}return[...r,n]}let le=0;function ue(){const e=l.context;return e?`${e.id}${e.count++}`:"cl-"+le++}const ce=e=>`Stale read from <${e}>.`;function de(e){const t="fallback"in e&&{fallback:()=>e.fallback};return A(function(e,t,n={}){let r=[],o=[],i=[],a=0,s=t.length>1?[]:null;return I(()=>ee(i)),()=>{let l,u,d=e()||[];return d[c],O(()=>{let e,t,c,f,h,g,m,v,y,b=d.length;if(0===b)0!==a&&(ee(i),i=[],r=[],o=[],a=0,s&&(s=[])),n.fallback&&(r=[J],o[0]=C(e=>(i[0]=e,n.fallback())),a=1);else if(0===a){for(o=new Array(b),u=0;u<b;u++)r[u]=d[u],o[u]=C(p);a=b}else{for(c=new Array(b),f=new Array(b),s&&(h=new Array(b)),g=0,m=Math.min(a,b);g<m&&r[g]===d[g];g++);for(m=a-1,v=b-1;m>=g&&v>=g&&r[m]===d[v];m--,v--)c[v]=o[m],f[v]=i[m],s&&(h[v]=s[m]);for(e=new Map,t=new Array(v+1),u=v;u>=g;u--)y=d[u],l=e.get(y),t[u]=void 0===l?-1:l,e.set(y,u);for(l=g;l<=m;l++)y=r[l],u=e.get(y),void 0!==u&&-1!==u?(c[u]=o[l],f[u]=i[l],s&&(h[u]=s[l]),u=t[u],e.set(y,u)):i[l]();for(u=g;u<b;u++)u in c?(o[u]=c[u],i[u]=f[u],s&&(s[u]=h[u],s[u](u))):o[u]=C(p);o=o.slice(0,a=b),r=d.slice(0)}return o});function p(e){if(i[u]=e,s){const[e,n]=S(u);return s[u]=n,t(d[u],e)}return t(d[u])}}}(()=>e.each,e.children,t||void 0))}function pe(e){const t="fallback"in e&&{fallback:()=>e.fallback};return A(function(e,t,n={}){let r,o=[],i=[],a=[],s=[],l=0;return I(()=>ee(a)),()=>{const u=e()||[];return u[c],O(()=>{if(0===u.length)return 0!==l&&(ee(a),a=[],o=[],i=[],l=0,s=[]),n.fallback&&(o=[J],i[0]=C(e=>(a[0]=e,n.fallback())),l=1),i;for(o[0]===J&&(a[0](),a=[],o=[],i=[],l=0),r=0;r<u.length;r++)r<o.length&&o[r]!==u[r]?s[r](()=>u[r]):r>=o.length&&(i[r]=C(d));for(;r<o.length;r++)a[r]();return l=s.length=a.length=u.length,o=u.slice(0),i=i.slice(0,l)});function d(e){a[r]=e;const[n,o]=S(u[r]);return s[r]=o,t(n,r)}}}(()=>e.each,e.children,t||void 0))}function fe(e){const t=e.keyed,n=A(()=>e.when,void 0,{equals:(e,n)=>t?e===n:!e==!n});return A(()=>{const r=n();if(r){const o=e.children;return"function"==typeof o&&o.length>0?O(()=>o(t?r:()=>{if(!O(n))throw ce("Show");return e.when})):o}return e.fallback},void 0,void 0)}function he(e){let t=!1;const n=L(()=>e.children),r=A(()=>{let e=n();Array.isArray(e)||(e=[e]);for(let n=0;n<e.length;n++){const r=e[n].when;if(r)return t=!!e[n].keyed,[n,r,e[n]]}return[-1]},void 0,{equals:(e,n)=>e[0]===n[0]&&(t?e[1]===n[1]:!e[1]==!n[1])&&e[2]===n[2]});return A(()=>{const[n,o,i]=r();if(n<0)return e.fallback;const a=i.children;return"function"==typeof a&&a.length>0?O(()=>a(t?o:()=>{if(O(r)[0]!==n)throw ce("Match");return i.when})):a},void 0,void 0)}function ge(e){return e}const me=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline","allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"]),ve=new Set(["innerHTML","textContent","innerText","children"]),ye=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),be=Object.assign(Object.create(null),{class:"className",formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1}});const we=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),Ee=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),_e={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};const xe="_$DX_DELEGATE";function ke(e,t,n){let r;const o=()=>{const t=document.createElement("template");return t.innerHTML=e,n?t.content.firstChild.firstChild:t.content.firstChild},i=t?()=>O(()=>document.importNode(r||(r=o()),!0)):()=>(r||(r=o())).cloneNode(!0);return i.cloneNode=i,i}function Ce(e,t=window.document){const n=t[xe]||(t[xe]=new Set);for(let r=0,o=e.length;r<o;r++){const o=e[r];n.has(o)||(n.add(o),t.addEventListener(o,Re))}}function Se(e,t,n){null==n?e.removeAttribute(t):e.setAttribute(t,n)}function Te(e,t){null==t?e.removeAttribute("class"):e.className=t}function De(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n)}function Ae(e,t={},n,r){const o={};return r||T(()=>o.children=Be(e,t.children,o.children)),T(()=>t.ref&&t.ref(e)),T(()=>function(e,t,n,r,o={},i=!1){t||(t={});for(const r in o)if(!(r in t)){if("children"===r)continue;o[r]=Ne(e,r,null,o[r],n,i)}for(const r in t){if("children"===r)continue;const a=t[r];o[r]=Ne(e,r,a,o[r],n,i)}}(e,t,n,0,o,!0)),o}function Oe(e,t,n){return O(()=>e(t,n))}function Pe(e,t,n,r){if(void 0===n||r||(r=[]),"function"!=typeof t)return Be(e,t,r,n);T(r=>Be(e,t(),r,n),r)}function Ie(e,t,n){const r=t.trim().split(/\s+/);for(let t=0,o=r.length;t<o;t++)e.classList.toggle(r[t],n)}function Ne(e,t,n,r,o,i){let a,s,l,u,c;if("style"===t)return function(e,t,n){if(!t)return n?Se(e,"style"):t;const r=e.style;if("string"==typeof t)return r.cssText=t;let o,i;for(i in"string"==typeof n&&(r.cssText=n=void 0),n||(n={}),t||(t={}),n)null==t[i]&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}(e,n,r);if("classList"===t)return function(e,t,n={}){const r=Object.keys(t||{}),o=Object.keys(n);let i,a;for(i=0,a=o.length;i<a;i++){const r=o[i];r&&"undefined"!==r&&!t[r]&&(Ie(e,r,!1),delete n[r])}for(i=0,a=r.length;i<a;i++){const o=r[i],a=!!t[o];o&&"undefined"!==o&&n[o]!==a&&a&&(Ie(e,o,!0),n[o]=a)}return n}(e,n,r);if(n===r)return r;if("ref"===t)i||n(e);else if("on:"===t.slice(0,3)){const o=t.slice(3);r&&e.removeEventListener(o,r),n&&e.addEventListener(o,n)}else if("oncapture:"===t.slice(0,10)){const o=t.slice(10);r&&e.removeEventListener(o,r,!0),n&&e.addEventListener(o,n,!0)}else if("on"===t.slice(0,2)){const o=t.slice(2).toLowerCase(),i=we.has(o);if(!i&&r){const t=Array.isArray(r)?r[0]:r;e.removeEventListener(o,t)}(i||n)&&(De(e,o,n,i),i&&Ce([o]))}else if("attr:"===t.slice(0,5))Se(e,t.slice(5),n);else if((c="prop:"===t.slice(0,5))||(l=ve.has(t))||!o&&((u=function(e,t){const n=be[e];return"object"==typeof n?n[t]?n.$:void 0:n}(t,e.tagName))||(s=me.has(t)))||(a=e.nodeName.includes("-")))c&&(t=t.slice(5),s=!0),"class"===t||"className"===t?Te(e,n):!a||s||l?e[u||t]=n:e[(d=t,d.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase()))]=n;else{const r=o&&t.indexOf(":")>-1&&_e[t.split(":")[0]];r?function(e,t,n,r){null==r?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r)}(e,r,t,n):Se(e,ye[t]||t,n)}var d;return n}function Re(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get:()=>n||document});n;){const r=n[t];if(r&&!n.disabled){const o=n[`${t}Data`];if(void 0!==o?r.call(n,o,e):r.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function Be(e,t,n,r,o){for(;"function"==typeof n;)n=n();if(t===n)return n;const i=typeof t,a=void 0!==r;if(e=a&&n[0]&&n[0].parentNode||e,"string"===i||"number"===i)if("number"===i&&(t=t.toString()),a){let o=n[0];o&&3===o.nodeType?o.data=t:o=document.createTextNode(t),n=Me(e,n,r,o)}else n=""!==n&&"string"==typeof n?e.firstChild.data=t:e.textContent=t;else if(null==t||"boolean"===i)n=Me(e,n,r);else{if("function"===i)return T(()=>{let o=t();for(;"function"==typeof o;)o=o();n=Be(e,o,n,r)}),()=>n;if(Array.isArray(t)){const i=[],s=n&&Array.isArray(n);if(Fe(i,t,n,o))return T(()=>n=Be(e,i,n,r,!0)),()=>n;if(0===i.length){if(n=Me(e,n,r),a)return n}else s?0===n.length?Le(e,i,r):function(e,t,n){let r=n.length,o=t.length,i=r,a=0,s=0,l=t[o-1].nextSibling,u=null;for(;a<o||s<i;)if(t[a]!==n[s]){for(;t[o-1]===n[i-1];)o--,i--;if(o===a){const t=i<r?s?n[s-1].nextSibling:n[i-s]:l;for(;s<i;)e.insertBefore(n[s++],t)}else if(i===s)for(;a<o;)u&&u.has(t[a])||t[a].remove(),a++;else if(t[a]===n[i-1]&&n[s]===t[o-1]){const r=t[--o].nextSibling;e.insertBefore(n[s++],t[a++].nextSibling),e.insertBefore(n[--i],r),t[o]=n[i]}else{if(!u){u=new Map;let e=s;for(;e<i;)u.set(n[e],e++)}const r=u.get(t[a]);if(null!=r)if(s<r&&r<i){let l,c=a,d=1;for(;++c<o&&c<i&&null!=(l=u.get(t[c]))&&l===r+d;)d++;if(d>r-s){const o=t[a];for(;s<r;)e.insertBefore(n[s++],o)}else e.replaceChild(n[s++],t[a++])}else a++;else t[a++].remove()}}else a++,s++}(e,n,i):(n&&Me(e),Le(e,i));n=i}else if(t.nodeType){if(Array.isArray(n)){if(a)return n=Me(e,n,r,t);Me(e,n,null,t)}else null!=n&&""!==n&&e.firstChild?e.replaceChild(t,e.firstChild):e.appendChild(t);n=t}else console.warn("Unrecognized value. Skipped inserting",t)}return n}function Fe(e,t,n,r){let o=!1;for(let i=0,a=t.length;i<a;i++){let a,s=t[i],l=n&&n[i];if(null==s||!0===s||!1===s);else if("object"==(a=typeof s)&&s.nodeType)e.push(s);else if(Array.isArray(s))o=Fe(e,s,l)||o;else if("function"===a)if(r){for(;"function"==typeof s;)s=s();o=Fe(e,Array.isArray(s)?s:[s],Array.isArray(l)?l:[l])||o}else e.push(s),o=!0;else{const t=String(s);l&&3===l.nodeType&&l.data===t?e.push(l):e.push(document.createTextNode(t))}}return o}function Le(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n)}function Me(e,t,n,r){if(void 0===n)return e.textContent="";const o=r||document.createTextNode("");if(t.length){let r=!1;for(let i=t.length-1;i>=0;i--){const a=t[i];if(o!==a){const t=a.parentNode===e;r||i?t&&a.remove():t?e.replaceChild(o,a):e.insertBefore(o,n)}else r=!0}}else e.insertBefore(o,n);return[o]}function Ue(e,t=!1){return t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e)}function je(e){const{useShadow:t}=e,n=document.createTextNode(""),r=R();let o;return D(()=>{o||(o=function(e,t){const n=v,r=b;v=e,b=null;try{return H(t,!0)}catch(e){Y(e)}finally{v=n,b=r}}(r,()=>A(()=>e.children)));const i=e.mount||document.body;if(i instanceof HTMLHeadElement){const[e,t]=S(!1),n=()=>t(!0);C(t=>Pe(i,()=>e()?t():o(),null)),I(n)}else{const r=Ue(e.isSVG?"g":"div",e.isSVG),a=t&&r.attachShadow?r.attachShadow({mode:"open"}):r;Object.defineProperty(r,"_$host",{get:()=>n.parentNode,configurable:!0}),Pe(a,o),i.appendChild(r),e.ref&&e.ref(r),I(()=>i.removeChild(r))}},void 0,{render:!0}),n}function $e(e){const[t,n]=se(e,["component"]),r=A(()=>t.component);return A(()=>{const e=r();switch(typeof e){case"function":return Object.assign(e,{[d]:!0}),O(()=>e(n));case"string":const t=Ee.has(e),r=Ue(e,t);return Ae(r,n,t),r}})}function ze(e){return(t,n)=>{const{element:r}=n;return C(o=>{const i=function(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const[o,i]=S(e[t[r]]);Object.defineProperty(n,t[r],{get:o,set(e){i(()=>e)}})}return n}(t);r.addPropertyChangedCallback((e,t)=>i[e]=t),r.addReleaseCallback(()=>{r.renderRoot.textContent="",o()});const a=e(i,n);return Pe(r.renderRoot,a)},function(e){if(e.assignedSlot&&e.assignedSlot._$owner)return e.assignedSlot._$owner;let t=e.parentNode;for(;t&&!t._$owner&&(!t.assignedSlot||!t.assignedSlot._$owner);)t=t.parentNode;return t&&t.assignedSlot?t.assignedSlot._$owner:e._$owner}(r))}}function He(e,t,n){return 2===arguments.length&&(n=t,t={}),s(e,t)(ze(n))}const Ve={bot:void 0,onNewBlock:void 0,onAnswer:void 0,onEnd:void 0,onInit:void 0,onNewLogs:void 0,isPreview:void 0,startFrom:void 0,prefilledVariables:void 0,apiHost:void 0,resultId:void 0,sessionId:void 0},We={...Ve,onClose:void 0,onOpen:void 0,theme:void 0,autoShowDelay:void 0,isOpen:void 0,defaultOpen:void 0},qe={...Ve,onClose:void 0,onOpen:void 0,theme:void 0,previewMessage:void 0,onPreviewMessageClick:void 0,autoShowDelay:void 0};var Ge='/*! tailwindcss v3.3.3 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-feature-settings:normal;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.\\!visible{visibility:visible!important}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.-right-2{right:-8px}.-top-2{top:-8px}.bottom-5{bottom:20px}.left-0{left:0}.left-1\\/2{left:50%}.left-5{left:20px}.right-0{right:0}.right-2{right:8px}.right-5{right:20px}.top-0{top:0}.top-1\\/2{top:50%}.top-2{top:8px}.\\!z-50{z-index:50!important}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\\[42424242\\]{z-index:42424242}.m-auto{margin:auto}.-mr-1{margin-right:-4px}.-mt-1{margin-top:-4px}.ml-2{margin-left:8px}.mt-0{margin-top:0}.mt-0\\.5{margin-top:2px}.mt-2{margin-top:8px}.mt-4{margin-top:16px}.\\!block{display:block!important}.block{display:block}.\\!flex{display:flex!important}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.\\!h-10{height:40px!important}.h-10{height:40px}.h-2{height:8px}.h-2\\.5{height:10px}.h-3{height:12px}.h-4{height:16px}.h-5{height:20px}.h-6{height:24px}.h-8{height:32px}.h-\\[25px\\]{height:25px}.h-\\[48px\\]{height:48px}.h-\\[56px\\]{height:56px}.h-\\[58px\\]{height:58px}.h-\\[60\\%\\]{height:60%}.h-\\[80vh\\]{height:80vh}.h-full{height:100%}.h-screen{height:100vh}.max-h-80{max-height:320px}.max-h-\\[150px\\]{max-height:150px}.max-h-\\[200px\\]{max-height:200px}.min-h-full{min-height:100%}.w-10{width:40px}.w-2{width:8px}.w-3{width:12px}.w-4{width:16px}.w-5{width:20px}.w-6{width:24px}.w-8{width:32px}.w-\\[35px\\]{width:35px}.w-\\[48px\\]{width:48px}.w-\\[58px\\]{width:58px}.w-\\[60\\%\\]{width:60%}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0}.min-w-\\[200px\\]{min-width:200px}.min-w-\\[250px\\]{min-width:250px}.max-w-\\[256px\\]{max-width:256px}.max-w-\\[350px\\]{max-width:350px}.max-w-\\[90\\%\\]{max-width:90%}.max-w-full{max-width:100%}.max-w-lg{max-width:512px}.max-w-xs{max-width:320px}.flex-1{flex:1 1 0%}.flex-\\[9\\]{flex:9}.flex-none{flex:none}.flex-shrink-0{flex-shrink:0}.-translate-x-1\\/2{--tw-translate-x:-50%}.-translate-x-1\\/2,.-translate-y-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-y-1\\/2{--tw-translate-y:-50%}.-rotate-180{--tw-rotate:-180deg}.-rotate-180,.rotate-0{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-0{--tw-rotate:0deg}.scale-0{--tw-scale-x:0;--tw-scale-y:0}.scale-0,.scale-100{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x:1;--tw-scale-y:1}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.animate-fade-in{animation:fade-in .3s ease-out}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.\\!items-center{align-items:center!important}.items-center{align-items:center}.justify-end{justify-content:flex-end}.\\!justify-center{justify-content:center!important}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.\\!gap-2{gap:8px!important}.gap-1{gap:4px}.gap-2{gap:8px}.gap-3{gap:12px}.gap-4{gap:16px}.gap-6{gap:24px}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-y-scroll{overflow-y:scroll}.scroll-smooth{scroll-behavior:smooth}.text-ellipsis{text-overflow:ellipsis}.whitespace-pre-wrap{white-space:pre-wrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:8px}.rounded-md{border-radius:6px}.rounded-t-\\[var\\(--quickbot-button-border-radius\\)\\]{border-top-left-radius:var(--quickbot-button-border-radius);border-top-right-radius:var(--quickbot-button-border-radius)}.border{border-width:1px}.border-2{border-width:2px}.\\!border-t{border-top-width:1px!important}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.\\!border-black\\/\\[0\\.08\\]{border-color:rgba(0,0,0,.08)!important}.border-gray-100{--tw-border-opacity:1;border-color:rgb(243 244 246/var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity))}.border-gray-400{--tw-border-opacity:1;border-color:rgb(156 163 175/var(--tw-border-opacity))}.\\!bg-black\\/\\[0\\.04\\]{background-color:rgba(0,0,0,.04)!important}.bg-\\[rgba\\(0\\2c 0\\2c 0\\2c 0\\.5\\)\\]{background-color:rgba(0,0,0,.5)}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}.bg-black\\/20{background-color:rgba(0,0,0,.2)}.bg-blue-400{--tw-bg-opacity:1;background-color:rgb(96 165 250/var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity))}.bg-green-400{--tw-bg-opacity:1;background-color:rgb(74 222 128/var(--tw-bg-opacity))}.bg-orange-400{--tw-bg-opacity:1;background-color:rgb(251 146 60/var(--tw-bg-opacity))}.bg-pink-400{--tw-bg-opacity:1;background-color:rgb(244 114 182/var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity:0.5}.fill-transparent{fill:transparent}.stroke-2{stroke-width:2}.object-cover{-o-object-fit:cover;object-fit:cover}.\\!p-3{padding:12px!important}.p-0{padding:0}.p-0\\.5{padding:2px}.p-1{padding:4px}.p-2{padding:8px}.p-3{padding:12px}.p-4{padding:16px}.px-2{padding-left:8px;padding-right:8px}.px-3{padding-left:12px;padding-right:12px}.px-4{padding-left:16px;padding-right:16px}.px-5{padding-left:20px;padding-right:20px}.px-8{padding-left:32px;padding-right:32px}.py-10{padding-bottom:40px;padding-top:40px}.py-2{padding-bottom:8px;padding-top:8px}.py-3{padding-bottom:12px;padding-top:12px}.py-4{padding-bottom:16px;padding-top:16px}.py-6{padding-bottom:24px;padding-top:24px}.pb-0{padding-bottom:0}.pl-2{padding-left:8px}.pr-1{padding-right:4px}.pr-2{padding-right:8px}.pr-4{padding-right:16px}.pt-2{padding-top:8px}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.\\!text-xs{font-size:12px!important;line-height:16px!important}.text-2xl{font-size:24px;line-height:32px}.text-4xl{font-size:36px;line-height:40px}.text-sm{font-size:14px;line-height:20px}.text-xl{font-size:20px;line-height:28px}.text-xs{font-size:12px;line-height:16px}.\\!font-normal{font-weight:400!important}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.\\!leading-3{line-height:12px!important}.leading-relaxed{line-height:1.625}.\\!text-black\\/60{color:rgba(0,0,0,.6)!important}.text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}.text-orange-500{--tw-text-opacity:1;color:rgb(249 115 22/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.underline{text-decoration-line:underline}.\\!no-underline{text-decoration-line:none!important}.\\!opacity-100{opacity:1!important}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-75{opacity:.75}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.shadow-md,.shadow-xl{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color)}.blur{--tw-blur:blur(8px)}.blur,.brightness-150{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.brightness-150{--tw-brightness:brightness(1.5)}.brightness-200{--tw-brightness:brightness(2)}.brightness-200,.brightness-95{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.brightness-95{--tw-brightness:brightness(.95)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-\\[width\\]{transition-duration:.15s;transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.delay-200{transition-delay:.2s}.duration-100{transition-duration:.1s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-\\[250ms\\]{transition-duration:.25s}.duration-\\[400ms\\]{transition-duration:.4s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}:root{--quickbot-host-bubble-color:#202020;--quickbot-host-bubble-bg-rgb:245,245,245;--quickbot-host-bubble-opacity:1;--quickbot-host-bubble-border-width:0;--quickbot-host-bubble-border-rgb:0,0,0;--quickbot-host-bubble-border-opacity:0;--quickbot-host-bubble-border-radius:20px;--quickbot-host-bubble-box-shadow:0 0 #0000;--quickbot-host-bubble-blur:0px}@keyframes chatBubbles{0%{transform:translateY(2.5)}50%{transform:translateY(-2.5px)}to{transform:translateY(0)}}@keyframes fadeInFromTop{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes fadeOutFromTop{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-4px)}}@keyframes fadeInFromBottom{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@keyframes fadeOutFromBottom{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(4px)}}.quickbot{background-color:#fff;font-family:var(--quickbot-container-font-family),-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"}.conversation-container{backdrop-filter:blur(var(--quickbot-chat-container-blur));background-color:rgba(var(--quickbot-chat-container-bg-rgb),var(--quickbot-chat-container-opacity));background-image:var(--quickbot-chat-container-bg-image);background-position:50%;background-repeat:no-repeat;background-size:cover;border-color:rgba(var(--quickbot-chat-container-border-rgb),var(--quickbot-chat-container-border-opacity));border-width:var(--quickbot-chat-container-border-width);box-shadow:var(--quickbot-chat-container-box-shadow);color:rgb(var(--quickbot-chat-container-color))}.conversation-container__body::-webkit-scrollbar{display:none}.conversation-container__body{-ms-overflow-style:none;scrollbar-width:none}.bubble{border-radius:var(--quickbot-host-bubble-border-radius);max-height:70vh;max-width:100%;min-height:2rem;min-width:2.5rem;overflow:auto;padding:8px 16px;transition-delay:.2s;transition-duration:.4s;transition-property:opacity;transition-timing-function:ease-in;will-change:opacity;z-index:10}.bubble--host{backdrop-filter:blur(var(--quickbot-host-bubble-blur));background-color:rgba(var(--quickbot-host-bubble-bg-rgb),var(--quickbot-host-bubble-opacity));border-color:rgba(var(--quickbot-host-bubble-border-rgb),var(--quickbot-host-bubble-border-opacity));border-radius:var(--quickbot-host-bubble-border-radius);border-width:var(--quickbot-host-bubble-border-width);box-shadow:var(--quickbot-host-bubble-box-shadow);color:var(--quickbot-host-bubble-color);height:100%;width:100%}.bubble--typing{align-items:center;display:flex;height:2rem!important;justify-content:center;min-width:64px!important;overflow:visible!important;width:auto!important}.bubble--guest{backdrop-filter:blur(var(--quickbot-guest-bubble-blur));background-color:rgba(var(--quickbot-guest-bubble-bg-rgb),var(--quickbot-guest-bubble-opacity));border-color:rgba(var(--quickbot-guest-bubble-border-rgb),var(--quickbot-guest-bubble-border-opacity));border-radius:var(--quickbot-guest-bubble-border-radius);border-width:var(--quickbot-guest-bubble-border-width);box-shadow:var(--quickbot-guest-bubble-box-shadow);color:var(--quickbot-guest-bubble-color)}.button{backdrop-filter:blur(var(--quickbot-button-blur));background-color:rgba(var(--quickbot-button-bg-rgb),var(--quickbot-button-opacity));border-color:rgba(var(--quickbot-button-border-rgb),var(--quickbot-button-border-opacity));border-radius:var(--quickbot-host-bubble-border-radius);border-radius:var(--quickbot-button-border-radius);border-width:var(--quickbot-button-border-width);box-shadow:var(--quickbot-button-box-shadow);color:var(--quickbot-button-color);height:auto;max-height:70vh;max-height:none;max-width:100%;min-height:2rem;min-height:auto;min-width:2.5rem;overflow:auto;overflow:visible;padding:8px 16px;transition-delay:.2s;transition-duration:.4s;transition-property:opacity;transition-timing-function:ease-in;will-change:opacity;z-index:10}.button--selectable:hover{background-color:rgba(var(--quickbot-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.15));border-color:rgba(var(--quickbot-button-border-rgb),calc(var(--selectable-alpha-ratio)*.35));box-shadow:0 2px 4px rgba(0,0,0,.1)}.button--selectable:active{box-shadow:0 1px 2px rgba(0,0,0,.1)}.button--selected{background-color:rgba(var(--quickbot-button-bg-rgb),calc(var(--selectable-alpha-ratio)*.25));border-color:rgba(var(--quickbot-button-border-rgb),calc(var(--selectable-alpha-ratio)*.45));box-shadow:0 2px 6px rgba(var(--quickbot-button-bg-rgb),.2)}.button__checkbox{background-color:rgba(var(--quickbot-checkbox-bg-rgb));color:var(--quickbot-button-color);padding:1px;transition:all .3s ease}.button__checkbox--checked{background-color:rgb(var(--quickbot-button-bg-rgb))}.button--has-image{display:flex;filter:none;flex-direction:column;justify-content:space-between;padding:0;transition:all .3s;width:236px}.button--has-image:focus{outline:none}.button--has-image:hover{filter:brightness(.9)}.button--has-image:active{filter:brightness(.75)}.slate-bold{font-weight:700}.slate-italic{font-style:oblique}.slate-html-container u,.slate-underline{text-decoration:underline}.bubble__dot--1,.bubble__dot--2,.bubble__dot--3{background-color:var(--quickbot-host-bubble-color);opacity:.5}.bubble__dot--1,.bubble__dot--2{animation:chatBubbles 1s ease-in-out infinite}.bubble__dot--2{animation-delay:.3s}.bubble__dot--3{animation:chatBubbles 1s ease-in-out infinite;animation-delay:.5s}.input__field{backdrop-filter:blur(var(--quickbot-input-blur));background-color:rgba(var(--quickbot-input-bg-rgb),var(--quickbot-input-opacity));box-shadow:var(--quickbot-input-box-shadow);color:var(--quickbot-input-color)}.input__field::-moz-placeholder{color:var(--quickbot-input-placeholder-color)!important;opacity:1!important}.input__field::placeholder{color:var(--quickbot-input-placeholder-color)!important;opacity:1!important}.input__field--date{border-radius:var(--quickbot-input-border-radius);color-scheme:light}.input__field--date,.input__field--phone{background-color:var(--quickbot-input-bg-color);color:var(--quickbot-input-color)}.input__field--phone{border-radius:var(--quickbot-button-border-radius)}.input__field--rating{align-items:center;border-radius:50%;display:flex;justify-content:center;padding:6px;transition:all .2s ease}.input__field--rating:hover{background-color:rgba(var(--quickbot-button-bg-rgb),.06)}.input__field--rating svg{stroke:rgb(var(--quickbot-button-bg-rgb));stroke-width:2;fill:transparent;height:32px;transition:fill .2s ease;width:32px}.input__field--rating:hover svg{fill:rgba(var(--quickbot-button-bg-rgb),.15)}.input__field--rating--selected{background-color:rgba(var(--quickbot-button-bg-rgb),.04)}.input__field--rating--selected svg{fill:rgb(var(--quickbot-button-bg-rgb))}.input__field--error{color:var(--quickbot-input-color)}.input__field--upload{border-radius:var(--quickbot-input-border-radius);transition:border-color .1s ease-out}.input__field--upload--dragging{border-color:rgb(var(--quickbot-button-bg-rgb))}.input__field--upload__progress-bar{background-color:rgb(var(--quickbot-button-bg-rgb))}.input__field--upload__progress-bar,.toast--popup-blocked{border-radius:var(--quickbot-input-border-radius)}select option{background-color:var(--quickbot-input-bg-color);color:var(--quickbot-input-color)}.progress-bar{background-color:rgba(var(--quickbot-progress-bar-bg-rgb),calc(var(--selectable-alpha-ratio)*.12));bottom:var(--quickbot-progress-bar-bottom);height:var(--quickbot-progress-bar-height);position:var(--quickbot-progress-bar-position);top:var(--quickbot-progress-bar-top)}.progress-bar>.progress-bar__fill{background-color:var(--quickbot-progress-bar-color)}.recorder .recorder__left-gradient{background-image:linear-gradient(to right,rgba(var(--quickbot-input-bg-rgb),1),rgba(var(--quickbot-input-bg-rgb),0))}.recorder .recorder__right-gradient{background-image:linear-gradient(to left,rgba(var(--quickbot-input-bg-rgb),1),rgba(var(--quickbot-input-bg-rgb),0))}.recorder button{background-color:rgba(var(--quickbot-button-bg-rgb),.3);color:rgba(var(--quickbot-button-bg-rgb))}[data-scope=menu][data-part=content]{backdrop-filter:blur(var(--quickbot-input-blur));border-color:rgba(var(--quickbot-input-border-rgb),var(--quickbot-input-border-opacity));border-width:var(--quickbot-input-border-width);box-shadow:var(--quickbot-input-box-shadow);color:var(--quickbot-input-color)}[data-scope=menu][data-part=content],[data-scope=menu][data-part=item]{background-color:rgba(var(--quickbot-input-bg-rgb),var(--quickbot-input-opacity));border-radius:var(--quickbot-input-border-radius)}[data-scope=menu][data-part=item]{cursor:pointer}[data-scope=menu][data-part=content][data-state=open]{animation:fadeInFromTop .15s ease-out forwards}[data-scope=menu][data-part=content][data-state=closed]{animation:fadeOutFromTop 50ms ease-out forwards}[data-scope=toast][data-part=group]{width:100%}[data-scope=toast][data-part=root]{background-color:rgba(var(--quickbot-input-bg-rgb),var(--quickbot-input-opacity));border-radius:var(--quickbot-chat-container-border-radius);box-shadow:var(--quickbot-input-box-shadow);color:var(--quickbot-input-color);display:flex;flex-direction:column;gap:4px;max-width:60vw;padding:16px 32px 16px 16px}[data-scope=toast][data-part=title]{font-weight:600}[data-scope=toast][data-part=description]{font-size:14px;line-height:20px}[data-scope=toast][data-part=root][data-state=open]{animation:fadeInFromBottom .15s ease-out forwards}[data-scope=toast][data-part=root][data-state=closed]{animation:fadeOutFromBottom 50ms ease-out forwards}[data-scope=progress][data-part=root]{height:100%;width:100%}[data-scope=progress][data-part=circle]{--size:40px;--thickness:4px;--radius:18px;--circomference:113.09724px}[data-scope=progress][data-part=circle-range]{stroke:#fff;--transition-prop:stroke-dasharray,stroke,stroke-dashoffset;--transition-duration:0.2s;transition-duration:.2s;transition-property:stroke-dasharray,stroke,stroke-dashoffset}[data-scope=progress][data-part=circle-track]{stroke:rgba(0,0,0,.5)}.empty\\:hidden:empty{display:none}.hover\\:scale-110:hover{--tw-scale-x:1.1;--tw-scale-y:1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:\\!bg-\\[\\#f7f8ff\\]:hover{--tw-bg-opacity:1!important;background-color:rgb(247 248 255/var(--tw-bg-opacity))!important}.hover\\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.hover\\:\\!opacity-80:hover{opacity:.8!important}.hover\\:opacity-90:hover{opacity:.9}.hover\\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\\:brightness-90:hover{--tw-brightness:brightness(.9)}.hover\\:brightness-90:hover,.hover\\:brightness-95:hover{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:brightness-95:hover{--tw-brightness:brightness(.95)}.hover\\:backdrop-brightness-95:hover{--tw-backdrop-brightness:brightness(.95);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px}.active\\:scale-95:active{--tw-scale-x:.95;--tw-scale-y:.95}.active\\:scale-95:active,.active\\:scale-\\[0\\.98\\]:active{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\\:scale-\\[0\\.98\\]:active{--tw-scale-x:0.98;--tw-scale-y:0.98}.active\\:brightness-75:active{--tw-brightness:brightness(.75)}.active\\:brightness-75:active,.active\\:brightness-90:active{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.active\\:brightness-90:active{--tw-brightness:brightness(.9)}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.disabled\\:brightness-100:disabled{--tw-brightness:brightness(1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.group:hover .group-hover\\:opacity-0{opacity:0}.group:hover .group-hover\\:opacity-100{opacity:1}.data-\\[state\\=open\\]\\:backdrop-brightness-90[data-state=open]{--tw-backdrop-brightness:brightness(.9);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}@media (prefers-color-scheme:dark){.dark\\:text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}}@media (min-width:640px){.sm\\:right-5{right:20px}.sm\\:my-8{margin-bottom:32px;margin-top:32px}.sm\\:p-0{padding:0}.sm\\:opacity-0{opacity:0}}.\\[\\&_svg\\]\\:\\!h-4 svg{height:16px!important}.\\[\\&_svg\\]\\:\\!w-4 svg{width:16px!important}';const Ke=async e=>{let t;try{const n="string"==typeof e?e:e.url;t=await fetch(n,{method:"string"==typeof e?"GET":e.method,mode:"cors",headers:"string"!=typeof e&&Ye(e.body)?{"Content-Type":"application/json"}:void 0,body:"string"!=typeof e&&Ye(e.body)?JSON.stringify(e.body):void 0});const r=await t.json();if(!t.ok)throw"error"in r?r.error:r;return{data:r,response:t}}catch(e){return console.error(e),{error:e,response:t}}},Ye=e=>null!=e,Ze=e=>null==e,Xe=e=>null==e||""===e,Qe=e=>null!=e&&""!==e,Je=e=>e?.startsWith("data:image/svg")||e?.endsWith(".svg");function et(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=et(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function tt(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=et(e))&&(r&&(r+=" "),r+=t);return r}const nt=ke('<svg part="button-icon" viewBox="0 0 24 24"><path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z">'),rt=ke('<div part="button-icon">'),ot=ke('<img part="button-icon" alt="Bubble button icon">'),it=ke('<span part="button-icon">'),at=ke('<svg part="button-icon" viewBox="0 0 24 24"><path fill-rule="evenodd" clip-rule="evenodd" d="M18.601 8.39897C18.269 8.06702 17.7309 8.06702 17.3989 8.39897L12 13.7979L6.60099 8.39897C6.26904 8.06702 5.73086 8.06702 5.39891 8.39897C5.06696 8.73091 5.06696 9.2691 5.39891 9.60105L11.3989 15.601C11.7309 15.933 12.269 15.933 12.601 15.601L18.601 9.60105C18.9329 9.2691 18.9329 8.73091 18.601 8.39897Z">'),st=ke('<img part="button-icon" alt="Bubble button close icon">'),lt=ke('<button part="button" aria-label="Open chatbot">'),ut="#fff",ct=e=>e.startsWith("http")||e.startsWith("data:image/svg+xml"),dt=e=>(()=>{const t=lt();return t.$$click=()=>e.toggleBot(),t.style.setProperty("z-index","42424242"),Pe(t,te(fe,{get when(){return Ze(e.customIconSrc)},keyed:!0,get children(){const t=nt();return T(n=>{const r=e.iconColor??ut,o=tt("stroke-2 fill-transparent absolute duration-200 transition w-[60%]",e.isBotOpened?"scale-0 opacity-0":"scale-100 opacity-100");return r!==n._v$&&(null!=(n._v$=r)?t.style.setProperty("stroke",r):t.style.removeProperty("stroke")),o!==n._v$2&&Se(t,"class",n._v$2=o),n},{_v$:void 0,_v$2:void 0}),t}}),null),Pe(t,te(fe,{get when(){return A(()=>!!e.customIconSrc)()&&e.customIconSrc.startsWith("data:image/svg+xml")},get children(){const t=rt();return T(n=>{const r=tt("flex items-center justify-center","duration-200 transition",e.isBotOpened?"scale-0 opacity-0":"scale-100 opacity-100","w-[60%] h-[60%]"),o=e.iconColor??ut,i=(e=>{if(!e.startsWith("data:image/svg+xml"))return null;let t=decodeURIComponent(e.replace("data:image/svg+xml;utf8,","")).replace(/(\w+)='([^']*)'/g,'$1="$2"').replace(/fill=['"]?bg['"]?/gi,'fill="currentColor"').replace(/fill=['"]#[0-9a-fA-F]{3,6}['"]?/gi,'fill="currentColor"').replace(/fill=['"]rgba?\([^)]+\)['"]?/gi,'fill="currentColor"').replace(/fill=['"](?:black|white|red|blue|green|yellow|orange|purple|pink|brown|gray|grey)['"]?/gi,'fill="currentColor"').replace(/stroke=['"]#[0-9a-fA-F]{3,6}['"]?/gi,'stroke="currentColor"').replace(/stroke=['"]rgba?\([^)]+\)['"]?/gi,'stroke="currentColor"').replace(/stroke=['"](?:black|white|red|blue|green|yellow|orange|purple|pink|brown|gray|grey)['"]?/gi,'stroke="currentColor"');return/<svg[^>]+fill=/i.test(t)||(t=t.replace("<svg ",'<svg fill="currentColor" ')),t})(e.customIconSrc);return r!==n._v$3&&Te(t,n._v$3=r),o!==n._v$4&&(null!=(n._v$4=o)?t.style.setProperty("color",o):t.style.removeProperty("color")),i!==n._v$5&&(t.innerHTML=n._v$5=i),n},{_v$3:void 0,_v$4:void 0,_v$5:void 0}),t}}),null),Pe(t,te(fe,{get when(){return A(()=>!(!e.customIconSrc||!ct(e.customIconSrc)))()&&!e.customIconSrc.startsWith("data:image/svg+xml")},get children(){const t=ot();return T(n=>{const r=e.customIconSrc,o=tt("duration-200 transition",e.isBotOpened?"scale-0 opacity-0":"scale-100 opacity-100",Je(e.customIconSrc)?"w-[60%]":"w-full h-full",Je(e.customIconSrc)?"":"object-cover rounded-full");return r!==n._v$6&&Se(t,"src",n._v$6=r),o!==n._v$7&&Te(t,n._v$7=o),n},{_v$6:void 0,_v$7:void 0}),t}}),null),Pe(t,te(fe,{get when(){return A(()=>!!e.customIconSrc)()&&!ct(e.customIconSrc)},get children(){const t=it();return t.style.setProperty("font-family","-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'"),Pe(t,()=>e.customIconSrc),T(n=>{const r=tt("text-4xl duration-200 transition",e.isBotOpened?"scale-0 opacity-0":"scale-100 opacity-100"),o=e.iconColor??ut;return r!==n._v$8&&Te(t,n._v$8=r),o!==n._v$9&&(null!=(n._v$9=o)?t.style.setProperty("color",o):t.style.removeProperty("color")),n},{_v$8:void 0,_v$9:void 0}),t}}),null),Pe(t,te(fe,{get when(){return Ze(e.customCloseIconSrc)},get children(){const t=at();return T(n=>{const r=e.iconColor??ut,o=tt("absolute duration-200 transition w-[60%]",e.isBotOpened?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0");return r!==n._v$0&&(null!=(n._v$0=r)?t.style.setProperty("fill",r):t.style.removeProperty("fill")),o!==n._v$1&&Se(t,"class",n._v$1=o),n},{_v$0:void 0,_v$1:void 0}),t}}),null),Pe(t,te(fe,{get when(){return A(()=>!!e.customCloseIconSrc)()&&ct(e.customCloseIconSrc)},get children(){const t=st();return T(n=>{const r=e.customCloseIconSrc,o=tt("absolute duration-200 transition",e.isBotOpened?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0",Je(e.customCloseIconSrc)?"w-[60%]":"w-full h-full",Je(e.customCloseIconSrc)?"":"object-cover rounded-full");return r!==n._v$10&&Se(t,"src",n._v$10=r),o!==n._v$11&&Te(t,n._v$11=o),n},{_v$10:void 0,_v$11:void 0}),t}}),null),Pe(t,te(fe,{get when(){return A(()=>!!e.customCloseIconSrc)()&&!ct(e.customCloseIconSrc)},get children(){const t=it();return t.style.setProperty("font-family","-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'"),Pe(t,()=>e.customCloseIconSrc),T(n=>{const r=tt("absolute text-4xl duration-200 transition",e.isBotOpened?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0"),o=e.iconColor??ut;return r!==n._v$12&&Te(t,n._v$12=r),o!==n._v$13&&(null!=(n._v$13=o)?t.style.setProperty("color",o):t.style.removeProperty("color")),n},{_v$12:void 0,_v$13:void 0}),t}}),null),T(n=>{const r=tt("fixed bottom-5 shadow-md rounded-full hover:scale-110 active:scale-95 transition-transform duration-200 flex justify-center items-center animate-fade-in","left"===e.placement?" left-5":" right-5"),o=e.backgroundColor??"#01a952",i=e.buttonSize,a=e.buttonSize;return r!==n._v$14&&Te(t,n._v$14=r),o!==n._v$15&&(null!=(n._v$15=o)?t.style.setProperty("background-color",o):t.style.removeProperty("background-color")),i!==n._v$16&&(null!=(n._v$16=i)?t.style.setProperty("width",i):t.style.removeProperty("width")),a!==n._v$17&&(null!=(n._v$17=a)?t.style.setProperty("height",a):t.style.removeProperty("height")),n},{_v$14:void 0,_v$15:void 0,_v$16:void 0,_v$17:void 0}),t})();Ce(["click"]);const pt=ke('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2px" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18">'),ft=e=>(()=>{const t=pt();return Ae(t,e,!0,!0),t})(),ht=ke('<div part="bubble-message"><p>'),gt=ke('<img class="rounded-full w-8 h-8 object-cover" alt="Bot avatar" elementtiming="Bot avatar" fetchpriority="high">'),mt=ke('<button part="bubble-message-close-button" aria-label="Close">'),vt="#F7F8FF",yt="#303235",bt=e=>{const[t,n]=S(!1),[r,o]=S({x:0,y:0}),i=e=>{o({x:e.touches[0].clientX,y:e.touches[0].clientY})},a=t=>{const n=t.changedTouches[0].clientX,i=t.changedTouches[0].clientY;(Math.abs(n-r().x)>10||i-r().y>10)&&e.onCloseClick(),o({x:0,y:0})};return(()=>{const r=ht(),o=r.firstChild;return r.$$touchend=a,r.$$touchstart=i,r.addEventListener("mouseleave",()=>n(!1)),r.addEventListener("mouseenter",()=>n(!0)),r.$$click=()=>e.onClick(),r.style.setProperty("z-index","42424242"),Pe(r,te(wt,{get isHovered(){return t()},get previewMessageTheme(){return e.previewMessageTheme},get onClick(){return e.onCloseClick}}),o),Pe(r,te(fe,{get when(){return e.avatarUrl},keyed:!0,children:e=>(()=>{const t=gt();return Se(t,"src",e),t})()}),o),Pe(o,()=>e.message),T(t=>{const n="fixed max-w-[256px] rounded-md duration-200 flex items-center gap-4 shadow-md animate-fade-in cursor-pointer hover:shadow-lg p-4"+("left"===e.placement?" left-5":" right-5"),o=e.previewMessageTheme?.backgroundColor??vt,i=e.previewMessageTheme?.textColor??yt,a=`calc(${e.buttonSize} + 32px)`;return n!==t._v$&&Te(r,t._v$=n),o!==t._v$2&&(null!=(t._v$2=o)?r.style.setProperty("background-color",o):r.style.removeProperty("background-color")),i!==t._v$3&&(null!=(t._v$3=i)?r.style.setProperty("color",i):r.style.removeProperty("color")),a!==t._v$4&&(null!=(t._v$4=a)?r.style.setProperty("bottom",a):r.style.removeProperty("bottom")),t},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),r})()},wt=e=>(()=>{const t=mt();return t.$$click=t=>(t.stopPropagation(),e.onClick()),Pe(t,te(ft,{class:"w-4"})),T(n=>{const r="absolute -top-2 -right-2 rounded-full w-6 h-6 p-1 hover:brightness-95 active:brightness-90 transition-all border "+(e.isHovered?"opacity-100":"opacity-0"),o=e.previewMessageTheme?.closeButtonBackgroundColor??vt,i=e.previewMessageTheme?.closeButtonIconColor??yt;return r!==n._v$5&&Te(t,n._v$5=r),o!==n._v$6&&(null!=(n._v$6=o)?t.style.setProperty("background-color",o):t.style.removeProperty("background-color")),i!==n._v$7&&(null!=(n._v$7=i)?t.style.setProperty("color",i):t.style.removeProperty("color")),n},{_v$5:void 0,_v$6:void 0,_v$7:void 0}),t})();Ce(["click","touchstart","touchend"]);const Et=(e,t)=>"undefined"!=typeof window?window.__ENV?window.__ENV[e]??t:void 0:"undefined"!=typeof process?process.env[e]??t:void 0,_t=({ignoreChatApiUrl:e}={ignoreChatApiUrl:!1})=>{const t=Et("NEXT_PUBLIC_CHAT_API_URL"),n=Et("NEXT_PUBLIC_USE_EXPERIMENTAL_CHAT_API_ON")?.split(",");if(!e&&t&&(!n||n.some(e=>e===window.location.href)))return t;const r=Et("NEXT_PUBLIC_VIEWER_URL")?.split(","),o=r?.find(e=>window.location.href.startsWith(e));return o??r?.[0]??"https://quick.bot"},xt=()=>sessionStorage.getItem("botPaymentInProgress"),kt=()=>{sessionStorage.removeItem("botPaymentInProgress")};class Ct extends Error{constructor(e,t,n){const r=`${e.status||0===e.status?e.status:""} ${e.statusText||""}`.trim();super(`Request failed with ${r?`status code ${r}`:"an unknown error"}`),Object.defineProperty(this,"response",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="HTTPError",this.response=e,this.request=t,this.options=n}}class St extends Error{constructor(e){super("Request timed out"),Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="TimeoutError",this.request=e}}const Tt=e=>null!==e&&"object"==typeof e,Dt=(...e)=>{for(const t of e)if((!Tt(t)||Array.isArray(t))&&void 0!==t)throw new TypeError("The `options` argument must be an object");return Ot({},...e)},At=(e={},t={})=>{const n=new globalThis.Headers(e),r=t instanceof globalThis.Headers,o=new globalThis.Headers(t);for(const[e,t]of o.entries())r&&"undefined"===t||void 0===t?n.delete(e):n.set(e,t);return n},Ot=(...e)=>{let t={},n={};for(const r of e)if(Array.isArray(r))Array.isArray(t)||(t=[]),t=[...t,...r];else if(Tt(r)){for(let[e,n]of Object.entries(r))Tt(n)&&e in t&&(n=Ot(t[e],n)),t={...t,[e]:n};Tt(r.headers)&&(n=At(n,r.headers),t.headers=n)}return t},Pt=(()=>{let e=!1,t=!1;const n="function"==typeof globalThis.ReadableStream,r="function"==typeof globalThis.Request;return n&&r&&(t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")),e&&!t})(),It="function"==typeof globalThis.AbortController,Nt="function"==typeof globalThis.ReadableStream,Rt="function"==typeof globalThis.FormData,Bt=["get","post","put","patch","head","delete"],Ft={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*"},Lt=2147483647,Mt=Symbol("stop"),Ut={json:!0,parseJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,fetch:!0},jt={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,dispatcher:!0,duplex:!0,priority:!0},$t=e=>Bt.includes(e)?e.toUpperCase():e,zt=[413,429,503],Ht={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:zt,maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3},Vt=(e={})=>{if("number"==typeof e)return{...Ht,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");return{...Ht,...e,afterStatusCodes:zt}};class Wt{static create(e,t){const n=new Wt(e,t),r=async()=>{if("number"==typeof n._options.timeout&&n._options.timeout>Lt)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let e=await n._fetch();for(const t of n._options.hooks.afterResponse){const r=await t(n.request,n._options,n._decorateResponse(e.clone()));r instanceof globalThis.Response&&(e=r)}if(n._decorateResponse(e),!e.ok&&n._options.throwHttpErrors){let t=new Ct(e,n.request,n._options);for(const e of n._options.hooks.beforeError)t=await e(t);throw t}if(n._options.onDownloadProgress){if("function"!=typeof n._options.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!Nt)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");return n._stream(e.clone(),n._options.onDownloadProgress)}return e},o=n._options.retry.methods.includes(n.request.method.toLowerCase())?n._retry(r):r();for(const[e,r]of Object.entries(Ft))o[e]=async()=>{n.request.headers.set("accept",n.request.headers.get("accept")||r);const i=(await o).clone();if("json"===e){if(204===i.status)return"";if(0===(await i.clone().arrayBuffer()).byteLength)return"";if(t.parseJson)return t.parseJson(await i.text())}return i[e]()};return o}constructor(e,t={}){Object.defineProperty(this,"request",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"abortController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_input",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._input=e;const n=this._input instanceof Request&&"credentials"in Request.prototype?this._input.credentials:void 0;if(this._options={...n&&{credentials:n},...t,headers:At(this._input.headers,t.headers),hooks:Ot({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},t.hooks),method:$t(t.method??this._input.method),prefixUrl:String(t.prefixUrl||""),retry:Vt(t.retry),throwHttpErrors:!1!==t.throwHttpErrors,timeout:t.timeout??1e4,fetch:t.fetch??globalThis.fetch.bind(globalThis)},"string"!=typeof this._input&&!(this._input instanceof URL||this._input instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this._options.prefixUrl&&"string"==typeof this._input){if(this._input.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this._options.prefixUrl.endsWith("/")||(this._options.prefixUrl+="/"),this._input=this._options.prefixUrl+this._input}if(It){if(this.abortController=new globalThis.AbortController,this._options.signal){const e=this._options.signal;this._options.signal.addEventListener("abort",()=>{this.abortController.abort(e.reason)})}this._options.signal=this.abortController.signal}if(Pt&&(this._options.duplex="half"),this.request=new globalThis.Request(this._input,this._options),this._options.searchParams){const e="?"+("string"==typeof this._options.searchParams?this._options.searchParams.replace(/^\?/,""):new URLSearchParams(this._options.searchParams).toString()),t=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,e);!(Rt&&this._options.body instanceof globalThis.FormData||this._options.body instanceof URLSearchParams)||this._options.headers&&this._options.headers["content-type"]||this.request.headers.delete("content-type"),this.request=new globalThis.Request(new globalThis.Request(t,{...this.request}),this._options)}void 0!==this._options.json&&(this._options.body=JSON.stringify(this._options.json),this.request.headers.set("content-type",this._options.headers.get("content-type")??"application/json"),this.request=new globalThis.Request(this.request,{body:this._options.body}))}_calculateRetryDelay(e){if(this._retryCount++,this._retryCount<=this._options.retry.limit&&!(e instanceof St)){if(e instanceof Ct){if(!this._options.retry.statusCodes.includes(e.response.status))return 0;const t=e.response.headers.get("Retry-After");if(t&&this._options.retry.afterStatusCodes.includes(e.response.status)){let e=Number(t);return Number.isNaN(e)?e=Date.parse(t)-Date.now():e*=1e3,void 0!==this._options.retry.maxRetryAfter&&e>this._options.retry.maxRetryAfter?0:e}if(413===e.response.status)return 0}const t=this._options.retry.delay(this._retryCount);return Math.min(this._options.retry.backoffLimit,t)}return 0}_decorateResponse(e){return this._options.parseJson&&(e.json=async()=>this._options.parseJson(await e.text())),e}async _retry(e){try{return await e()}catch(t){const n=Math.min(this._calculateRetryDelay(t),Lt);if(0!==n&&this._retryCount>0){await async function(e,{signal:t}){return new Promise((n,r)=>{function o(){clearTimeout(i),r(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",o,{once:!0}));const i=setTimeout(()=>{t?.removeEventListener("abort",o),n()},e)})}(n,{signal:this._options.signal});for(const e of this._options.hooks.beforeRetry){if(await e({request:this.request,options:this._options,error:t,retryCount:this._retryCount})===Mt)return}return this._retry(e)}throw t}}async _fetch(){for(const e of this._options.hooks.beforeRequest){const t=await e(this.request,this._options);if(t instanceof Request){this.request=t;break}if(t instanceof Response)return t}const e=((e,t)=>{const n={};for(const r in t)r in jt||r in Ut||r in e||(n[r]=t[r]);return n})(this.request,this._options);return!1===this._options.timeout?this._options.fetch(this.request.clone(),e):async function(e,t,n,r){return new Promise((o,i)=>{const a=setTimeout(()=>{n&&n.abort(),i(new St(e))},r.timeout);r.fetch(e,t).then(o).catch(i).then(()=>{clearTimeout(a)})})}(this.request.clone(),e,this.abortController,this._options)}_stream(e,t){const n=Number(e.headers.get("content-length"))||0;let r=0;return 204===e.status?(t&&t({percent:1,totalBytes:n,transferredBytes:r},new Uint8Array),new globalThis.Response(null,{status:e.status,statusText:e.statusText,headers:e.headers})):new globalThis.Response(new globalThis.ReadableStream({async start(o){const i=e.body.getReader();t&&t({percent:0,transferredBytes:0,totalBytes:n},new Uint8Array),await async function e(){const{done:a,value:s}=await i.read();if(a)o.close();else{if(t){r+=s.byteLength;t({percent:0===n?0:r/n,transferredBytes:r,totalBytes:n},s)}o.enqueue(s),await e()}}()}}),{status:e.status,statusText:e.statusText,headers:e.headers})}}
|
|
3
3
|
/*! MIT License © Sindre Sorhus */const qt=e=>{const t=(t,n)=>Wt.create(t,Dt(e,n));for(const n of Bt)t[n]=(t,r)=>Wt.create(t,Dt(e,r,{method:n}));return t.create=e=>qt(Dt(e)),t.extend=t=>qt(Dt(e,t)),t.stop=Mt,t},Gt=qt();class Kt extends Error{constructor(e){super("This bot can only be executed on "+e)}}const Yt=({apiHost:e,apiEndpoint:t})=>{let n;return n=`${Qe(e)?e:_t()}`,t&&(n+=t),"preview"===process.env.NEXT_PUBLIC_VERCEL_ENV&&process.env.NEXT_PUBLIC_VERCEL_AUTOMATION_BYPASS_SECRET&&(n+=`?x-vercel-protection-bypass=${process.env.NEXT_PUBLIC_VERCEL_AUTOMATION_BYPASS_SECRET}`),n};function Zt(e){const t=(e||"").toLowerCase(),n=/ipad|tablet|kindle|silk|playbook/.test(t)||/android/.test(t)&&!/mobile/.test(t),r=/mobi|iphone|ipod|android.*mobile|blackberry|phone|windows phone/.test(t);return n?"tablet":r?"mobile":/macintosh|windows nt|linux|x11|cros/.test(t)?"desktop":"unknown"}const Xt=e=>"text"===e.type?e.label??e.value:e.url,Qt=async({apiHost:e,sessionId:t,clientLogs:n})=>{try{await Gt.post(`${Qe(e)?e:_t()}/api/v1/sessions/${t}/clientLogs`,{json:{clientLogs:n}})}catch(e){console.log(e)}},[Jt,en]=S([]),tn=e=>{if(e)return"text"===e.type?{type:"text",text:e.value,attachedFileUrls:e.attachments?.map(e=>e.url)}:"recording"===e.type?{type:"audio",url:e.url}:void 0},nn=(e,t,n=0,r=.6,o=128)=>{if(!e)return;const i=e.clientHeight*r-o;e.scrollTop+e.clientHeight>=e.scrollHeight-i&&setTimeout(()=>{e?.scrollTo(0,t?t.offsetTop-n:e.scrollHeight)},50)},rn={isInputPrefillEnabled:!1,rememberUser:{isEnabled:!1,storage:"session"}},on={enabled:!0,speed:400,maxDelay:3,delayBetweenBubbles:0,isDisabledOnFirstMessage:!0};[{value:"session",label:"Session"},{value:"local",label:"Local"}].map(e=>e.value);const an=Symbol("store-raw"),sn=Symbol("store-node");function ln(e){let t=e[u];if(!t&&(Object.defineProperty(e,u,{value:t=new Proxy(e,gn)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=n.length;o<i;o++){const i=n[o];r[i].get&&Object.defineProperty(e,i,{enumerable:r[i].enumerable,get:r[i].get.bind(t)})}}return t}function un(e){let t;return null!=e&&"object"==typeof e&&(e[u]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function cn(e,t=new Set){let n,r,o,i;if(n=null!=e&&e[an])return n;if(!un(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let n=0,i=e.length;n<i;n++)o=e[n],(r=cn(o,t))!==o&&(e[n]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const n=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let s=0,l=n.length;s<l;s++)i=n[s],a[i].get||(o=e[i],(r=cn(o,t))!==o&&(e[i]=r))}return e}function dn(e){let t=e[sn];return t||Object.defineProperty(e,sn,{value:t=Object.create(null)}),t}function pn(e,t,n){return e[t]||(e[t]=hn(n))}function fn(e){if(N()){const t=dn(e);(t._||(t._=hn()))()}}function hn(e){const[t,n]=S(e,{equals:!1,internal:!0});return t.$=n,t}const gn={get(e,t,n){if(t===an)return e;if(t===u)return n;if(t===c)return fn(e),n;const r=dn(e),o=r[t];let i=o?o():e[t];if(t===sn||"__proto__"===t)return i;if(!o){const n=Object.getOwnPropertyDescriptor(e,t);!N()||"function"==typeof i&&!e.hasOwnProperty(t)||n&&n.get||(i=pn(r,t,i)())}return un(i)?ln(i):i},has(e,t){return t===an||t===u||t===c||t===sn||"__proto__"===t||(this.get(e,t,e),t in e)},set:()=>!0,deleteProperty:()=>!0,ownKeys:function(e){return fn(e),Reflect.ownKeys(e)},getOwnPropertyDescriptor:function(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return n&&!n.get&&n.configurable&&t!==u&&t!==sn?(delete n.value,delete n.writable,n.get=()=>e[u][t],n):n}};function mn(e,t,n,r=!1){if(!r&&e[t]===n)return;const o=e[t],i=e.length;void 0===n?delete e[t]:e[t]=n;let a,s=dn(e);if((a=pn(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let t=e.length;t<i;t++)(a=s[t])&&a.$();(a=pn(s,"length",i))&&a.$(e.length)}(a=s._)&&a.$()}function vn(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const o=n[r];mn(e,o,t[o])}}function yn(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();const i=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let o=0;o<r.length;o++)yn(e,[r[o]].concat(t),n);return}if(a&&"function"===i){for(let o=0;o<e.length;o++)r(e[o],o)&&yn(e,[o].concat(t),n);return}if(a&&"object"===i){const{from:o=0,to:i=e.length-1,by:a=1}=r;for(let r=o;r<=i;r+=a)yn(e,[r].concat(t),n);return}if(t.length>1)return void yn(e[r],t,[r].concat(n));o=e[r],n=[r].concat(n)}let i=t[0];"function"==typeof i&&(i=i(o,n),i===o)||void 0===r&&null==i||(i=cn(i),void 0===r||un(o)&&un(i)&&!Array.isArray(i)?vn(o,i):mn(e,r,i))}function bn(...[e,t]){const n=cn(e||{}),r=Array.isArray(n);return[ln(n),function(...e){var t;t=()=>{r&&1===e.length?function(e,t){if("function"==typeof t&&(t=t(e)),t=cn(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const r=t[n];e[n]!==r&&mn(e,n,r)}mn(e,"length",r)}else vn(e,t)}(n,e[0]):yn(n,e)},H(t,!1)}]}const wn=Symbol("store-root");function En(e,t,n,r,o){const i=t[n];if(e===i)return;if(n!==wn&&(!un(e)||!un(i)||o&&e[o]!==i[o]))return void mn(t,n,e);if(Array.isArray(e)){if(e.length&&i.length&&(!r||o&&e[0]&&null!=e[0][o])){let t,n,a,s,l,u,c,d;for(a=0,s=Math.min(i.length,e.length);a<s&&(i[a]===e[a]||o&&i[a]&&e[a]&&i[a][o]===e[a][o]);a++)En(e[a],i,a,r,o);const p=new Array(e.length),f=new Map;for(s=i.length-1,l=e.length-1;s>=a&&l>=a&&(i[s]===e[l]||o&&i[a]&&e[a]&&i[s][o]===e[l][o]);s--,l--)p[l]=i[s];if(a>l||a>s){for(n=a;n<=l;n++)mn(i,n,e[n]);for(;n<e.length;n++)mn(i,n,p[n]),En(e[n],i,n,r,o);return void(i.length>e.length&&mn(i,"length",e.length))}for(c=new Array(l+1),n=l;n>=a;n--)u=e[n],d=o&&u?u[o]:u,t=f.get(d),c[n]=void 0===t?-1:t,f.set(d,n);for(t=a;t<=s;t++)u=i[t],d=o&&u?u[o]:u,n=f.get(d),void 0!==n&&-1!==n&&(p[n]=i[t],n=c[n],f.set(d,n));for(n=a;n<e.length;n++)n in p?(mn(i,n,p[n]),En(e[n],i,n,r,o)):mn(i,n,e[n])}else for(let t=0,n=e.length;t<n;t++)En(e[t],i,t,r,o);return void(i.length>e.length&&mn(i,"length",e.length))}const a=Object.keys(e);for(let t=0,n=a.length;t<n;t++)En(e[a[t]],i,a[t],r,o);const s=Object.keys(i);for(let t=0,n=s.length;t<n;t++)void 0===e[s[t]]&&mn(i,s[t],void 0)}function _n(e,t={}){const{merge:n,key:r="id"}=t,o=cn(e);return e=>{if(!un(e)||!un(o))return o;const t=En(o,{[wn]:e},wn,n,r);return void 0===t?e:t}}function xn(e,t){const[n,r]=S(!1);if(!t.storage)return[...e,n,r];const o=kn(t.storage||rn.rememberUser.storage),i=JSON.stringify.bind(JSON),a=JSON.parse.bind(JSON),s=o.getItem(t.key),l="function"==typeof e[0]?t=>e[1](()=>a(t)):t=>e[1](_n(a(t)));return s&&(l(s),r(!0),t.onRecovered?.()),[e[0],"function"==typeof e[0]?n=>{r(!1);const a=e[1](n);return n?o.setItem(t.key,i(a)):o.removeItem(t.key),a}:(...n)=>{r(!1),e[1](...n);const a=i(O(()=>e[0]));o.setItem(t.key,a)},n,r]}const kn=e=>"session"===(e??rn.rememberUser.storage)?sessionStorage:localStorage,Cn=e=>"string"==typeof e?e:e instanceof Error?e.name+": "+e.message:JSON.stringify(e),Sn=Object.getPrototypeOf(async function(){}).constructor,Tn=async({content:e,args:t})=>{try{const n=Sn(...t.map(e=>e.id),Dn(e));await n(...t.map(e=>e.value))}catch(e){return{logs:[{status:"error",description:"Script block failed to execute",details:Cn(e)}]}}},Dn=e=>e.replace(/<script>/g,"").replace(/<\/script>/g,""),An=async({args:e,content:t})=>{try{const n=Sn(...Object.keys(e),t);await n(...Object.keys(e).map(t=>e[t]))}catch(e){console.warn("Script threw an error:",e)}};var On="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Pn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var In={exports:{}};const Nn="undefined"!=typeof Buffer,Rn=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,Bn=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function Fn(e,t,n){null==n&&null!==t&&"object"==typeof t&&(n=t,t=void 0),Nn&&Buffer.isBuffer(e)&&(e=e.toString()),e&&65279===e.charCodeAt(0)&&(e=e.slice(1));const r=JSON.parse(e,t);if(null===r||"object"!=typeof r)return r;const o=n&&n.protoAction||"error",i=n&&n.constructorAction||"error";if("ignore"===o&&"ignore"===i)return r;if("ignore"!==o&&"ignore"!==i){if(!1===Rn.test(e)&&!1===Bn.test(e))return r}else if("ignore"!==o&&"ignore"===i){if(!1===Rn.test(e))return r}else if(!1===Bn.test(e))return r;return Ln(r,{protoAction:o,constructorAction:i,safe:n&&n.safe})}function Ln(e,{protoAction:t="error",constructorAction:n="error",safe:r}={}){let o=[e];for(;o.length;){const e=o;o=[];for(const i of e){if("ignore"!==t&&Object.prototype.hasOwnProperty.call(i,"__proto__")){if(!0===r)return null;if("error"===t)throw new SyntaxError("Object contains forbidden prototype property");delete i.__proto__}if("ignore"!==n&&Object.prototype.hasOwnProperty.call(i,"constructor")&&Object.prototype.hasOwnProperty.call(i.constructor,"prototype")){if(!0===r)return null;if("error"===n)throw new SyntaxError("Object contains forbidden prototype property");delete i.constructor}for(const e in i){const t=i[e];t&&"object"==typeof t&&o.push(t)}}}return e}function Mn(e,t,n){const r=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return Fn(e,t,n)}finally{Error.stackTraceLimit=r}}var Un,jn;In.exports=Mn,In.exports.default=Mn,In.exports.parse=Mn,In.exports.safeParse=function(e,t){const n=Error.stackTraceLimit;Error.stackTraceLimit=0;try{return Fn(e,t,{safe:!0})}catch(e){return null}finally{Error.stackTraceLimit=n}},In.exports.scan=Ln,function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(Un||(Un={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(jn||(jn={}));const $n=Un.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),zn=e=>{switch(typeof e){case"undefined":return $n.undefined;case"string":return $n.string;case"number":return isNaN(e)?$n.nan:$n.number;case"boolean":return $n.boolean;case"function":return $n.function;case"bigint":return $n.bigint;case"symbol":return $n.symbol;case"object":return Array.isArray(e)?$n.array:null===e?$n.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?$n.promise:"undefined"!=typeof Map&&e instanceof Map?$n.map:"undefined"!=typeof Set&&e instanceof Set?$n.set:"undefined"!=typeof Date&&e instanceof Date?$n.date:$n.object;default:return $n.unknown}},Hn=Un.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Vn extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const o of e.issues)if("invalid_union"===o.code)o.unionErrors.map(r);else if("invalid_return_type"===o.code)r(o.returnTypeError);else if("invalid_arguments"===o.code)r(o.argumentsError);else if(0===o.path.length)n._errors.push(t(o));else{let e=n,r=0;for(;r<o.path.length;){const n=o.path[r];r===o.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(o))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(e){if(!(e instanceof Vn))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Un.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}Vn.create=e=>new Vn(e);const Wn=(e,t)=>{let n;switch(e.code){case Hn.invalid_type:n=e.received===$n.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case Hn.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Un.jsonStringifyReplacer)}`;break;case Hn.unrecognized_keys:n=`Unrecognized key(s) in object: ${Un.joinValues(e.keys,", ")}`;break;case Hn.invalid_union:n="Invalid input";break;case Hn.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Un.joinValues(e.options)}`;break;case Hn.invalid_enum_value:n=`Invalid enum value. Expected ${Un.joinValues(e.options)}, received '${e.received}'`;break;case Hn.invalid_arguments:n="Invalid function arguments";break;case Hn.invalid_return_type:n="Invalid function return type";break;case Hn.invalid_date:n="Invalid date";break;case Hn.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Un.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case Hn.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case Hn.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case Hn.custom:n="Invalid input";break;case Hn.invalid_intersection_types:n="Intersection results could not be merged";break;case Hn.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Hn.not_finite:n="Number must be finite";break;default:n=t.defaultError,Un.assertNever(e)}return{message:n}};let qn=Wn;function Gn(){return qn}const Kn=e=>{const{data:t,path:n,errorMaps:r,issueData:o}=e,i=[...n,...o.path||[]],a={...o,path:i};if(void 0!==o.message)return{...o,path:i,message:o.message};let s="";const l=r.filter(e=>!!e).slice().reverse();for(const e of l)s=e(a,{data:t,defaultError:s}).message;return{...o,path:i,message:s}};function Yn(e,t){const n=Gn(),r=Kn({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Wn?void 0:Wn].filter(e=>!!e)});e.common.issues.push(r)}class Zn{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return Xn;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t){const t=await e.key,r=await e.value;n.push({key:t,value:r})}return Zn.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:o}=r;if("aborted"===t.status)return Xn;if("aborted"===o.status)return Xn;"dirty"===t.status&&e.dirty(),"dirty"===o.status&&e.dirty(),"__proto__"===t.value||void 0===o.value&&!r.alwaysSet||(n[t.value]=o.value)}return{status:e.value,value:n}}}const Xn=Object.freeze({status:"aborted"}),Qn=e=>({status:"dirty",value:e}),Jn=e=>({status:"valid",value:e}),er=e=>"aborted"===e.status,tr=e=>"dirty"===e.status,nr=e=>"valid"===e.status,rr=e=>"undefined"!=typeof Promise&&e instanceof Promise;function or(e,t,n,r){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function ir(e,t,n,r,o){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var ar,sr,lr;"function"==typeof SuppressedError&&SuppressedError,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(ar||(ar={}));class ur{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const cr=(e,t)=>{if(nr(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new Vn(e.common.issues);return this._error=t,this._error}}};function dr(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:o};return{errorMap:(t,o)=>{var i,a;const{message:s}=e;return"invalid_enum_value"===t.code?{message:null!=s?s:o.defaultError}:void 0===o.data?{message:null!==(i=null!=s?s:r)&&void 0!==i?i:o.defaultError}:"invalid_type"!==t.code?{message:o.defaultError}:{message:null!==(a=null!=s?s:n)&&void 0!==a?a:o.defaultError}},description:o}}class pr{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return zn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:zn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Zn,ctx:{common:e.parent.common,data:e.data,parsedType:zn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(rr(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:zn(e)},o=this._parseSync({data:e,path:r.path,parent:r});return cr(r,o)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:zn(e)},r=this._parse({data:e,path:n.path,parent:n}),o=await(rr(r)?r:Promise.resolve(r));return cr(n,o)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,r)=>{const o=e(t),i=()=>r.addIssue({code:Hn.custom,...n(t)});return"undefined"!=typeof Promise&&o instanceof Promise?o.then(e=>!!e||(i(),!1)):!!o||(i(),!1)})}refinement(e,t){return this._refinement((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1))}_refinement(e){return new lo({schema:this,typeName:Eo.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return uo.create(this,this._def)}nullable(){return co.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Hr.create(this,this._def)}promise(){return so.create(this,this._def)}or(e){return qr.create([this,e],this._def)}and(e){return Zr.create(this,e,this._def)}transform(e){return new lo({...dr(this._def),schema:this,typeName:Eo.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new po({...dr(this._def),innerType:this,defaultValue:t,typeName:Eo.ZodDefault})}brand(){return new mo({typeName:Eo.ZodBranded,type:this,...dr(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new fo({...dr(this._def),innerType:this,catchValue:t,typeName:Eo.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return vo.create(this,e)}readonly(){return yo.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const fr=/^c[^\s-]{8,}$/i,hr=/^[0-9a-z]+$/,gr=/^[0-9A-HJKMNP-TV-Z]{26}$/,mr=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,vr=/^[a-z0-9_-]{21}$/i,yr=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,br=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let wr;const Er=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,_r=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,xr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,kr="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Cr=new RegExp(`^${kr}$`);function Sr(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function Tr(e){return new RegExp(`^${Sr(e)}$`)}function Dr(e){let t=`${kr}T${Sr(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Ar(e,t){return!("v4"!==t&&t||!Er.test(e))||!("v6"!==t&&t||!_r.test(e))}class Or extends pr{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==$n.string){const t=this._getOrReturnCtx(e);return Yn(t,{code:Hn.invalid_type,expected:$n.string,received:t.parsedType}),Xn}const t=new Zn;let n;for(const r of this._def.checks)if("min"===r.kind)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),Yn(n,{code:Hn.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("max"===r.kind)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),Yn(n,{code:Hn.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("length"===r.kind){const o=e.data.length>r.value,i=e.data.length<r.value;(o||i)&&(n=this._getOrReturnCtx(e,n),o?Yn(n,{code:Hn.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):i&&Yn(n,{code:Hn.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if("email"===r.kind)br.test(e.data)||(n=this._getOrReturnCtx(e,n),Yn(n,{validation:"email",code:Hn.invalid_string,message:r.message}),t.dirty());else if("emoji"===r.kind)wr||(wr=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),wr.test(e.data)||(n=this._getOrReturnCtx(e,n),Yn(n,{validation:"emoji",code:Hn.invalid_string,message:r.message}),t.dirty());else if("uuid"===r.kind)mr.test(e.data)||(n=this._getOrReturnCtx(e,n),Yn(n,{validation:"uuid",code:Hn.invalid_string,message:r.message}),t.dirty());else if("nanoid"===r.kind)vr.test(e.data)||(n=this._getOrReturnCtx(e,n),Yn(n,{validation:"nanoid",code:Hn.invalid_string,message:r.message}),t.dirty());else if("cuid"===r.kind)fr.test(e.data)||(n=this._getOrReturnCtx(e,n),Yn(n,{validation:"cuid",code:Hn.invalid_string,message:r.message}),t.dirty());else if("cuid2"===r.kind)hr.test(e.data)||(n=this._getOrReturnCtx(e,n),Yn(n,{validation:"cuid2",code:Hn.invalid_string,message:r.message}),t.dirty());else if("ulid"===r.kind)gr.test(e.data)||(n=this._getOrReturnCtx(e,n),Yn(n,{validation:"ulid",code:Hn.invalid_string,message:r.message}),t.dirty());else if("url"===r.kind)try{new URL(e.data)}catch(o){n=this._getOrReturnCtx(e,n),Yn(n,{validation:"url",code:Hn.invalid_string,message:r.message}),t.dirty()}else if("regex"===r.kind){r.regex.lastIndex=0;r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),Yn(n,{validation:"regex",code:Hn.invalid_string,message:r.message}),t.dirty())}else if("trim"===r.kind)e.data=e.data.trim();else if("includes"===r.kind)e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),Yn(n,{code:Hn.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty());else if("toLowerCase"===r.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===r.kind)e.data=e.data.toUpperCase();else if("startsWith"===r.kind)e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),Yn(n,{code:Hn.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty());else if("endsWith"===r.kind)e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),Yn(n,{code:Hn.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty());else if("datetime"===r.kind){Dr(r).test(e.data)||(n=this._getOrReturnCtx(e,n),Yn(n,{code:Hn.invalid_string,validation:"datetime",message:r.message}),t.dirty())}else if("date"===r.kind){Cr.test(e.data)||(n=this._getOrReturnCtx(e,n),Yn(n,{code:Hn.invalid_string,validation:"date",message:r.message}),t.dirty())}else if("time"===r.kind){Tr(r).test(e.data)||(n=this._getOrReturnCtx(e,n),Yn(n,{code:Hn.invalid_string,validation:"time",message:r.message}),t.dirty())}else"duration"===r.kind?yr.test(e.data)||(n=this._getOrReturnCtx(e,n),Yn(n,{validation:"duration",code:Hn.invalid_string,message:r.message}),t.dirty()):"ip"===r.kind?Ar(e.data,r.version)||(n=this._getOrReturnCtx(e,n),Yn(n,{validation:"ip",code:Hn.invalid_string,message:r.message}),t.dirty()):"base64"===r.kind?xr.test(e.data)||(n=this._getOrReturnCtx(e,n),Yn(n,{validation:"base64",code:Hn.invalid_string,message:r.message}),t.dirty()):Un.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:Hn.invalid_string,...ar.errToObj(n)})}_addCheck(e){return new Or({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ar.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ar.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ar.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ar.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ar.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ar.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ar.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ar.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ar.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ar.errToObj(e)})}datetime(e){var t,n;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(n=null==e?void 0:e.local)&&void 0!==n&&n,...ar.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...ar.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...ar.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...ar.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...ar.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...ar.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...ar.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...ar.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...ar.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...ar.errToObj(t)})}nonempty(e){return this.min(1,ar.errToObj(e))}trim(){return new Or({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Or({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Or({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function Pr(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r;return parseInt(e.toFixed(o).replace(".",""))%parseInt(t.toFixed(o).replace(".",""))/Math.pow(10,o)}Or.create=e=>{var t;return new Or({checks:[],typeName:Eo.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...dr(e)})};class Ir extends pr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==$n.number){const t=this._getOrReturnCtx(e);return Yn(t,{code:Hn.invalid_type,expected:$n.number,received:t.parsedType}),Xn}let t;const n=new Zn;for(const r of this._def.checks)if("int"===r.kind)Un.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Yn(t,{code:Hn.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty());else if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),Yn(t,{code:Hn.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Yn(t,{code:Hn.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==Pr(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),Yn(t,{code:Hn.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Yn(t,{code:Hn.not_finite,message:r.message}),n.dirty()):Un.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,ar.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ar.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ar.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ar.toString(t))}setLimit(e,t,n,r){return new Ir({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:ar.toString(r)}]})}_addCheck(e){return new Ir({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ar.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ar.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ar.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ar.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ar.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ar.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:ar.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ar.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ar.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&Un.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Ir.create=e=>new Ir({checks:[],typeName:Eo.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...dr(e)});class Nr extends pr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){this._def.coerce&&(e.data=BigInt(e.data));if(this._getType(e)!==$n.bigint){const t=this._getOrReturnCtx(e);return Yn(t,{code:Hn.invalid_type,expected:$n.bigint,received:t.parsedType}),Xn}let t;const n=new Zn;for(const r of this._def.checks)if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),Yn(t,{code:Hn.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Yn(t,{code:Hn.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty())}else"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),Yn(t,{code:Hn.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):Un.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,ar.toString(t))}gt(e,t){return this.setLimit("min",e,!1,ar.toString(t))}lte(e,t){return this.setLimit("max",e,!0,ar.toString(t))}lt(e,t){return this.setLimit("max",e,!1,ar.toString(t))}setLimit(e,t,n,r){return new Nr({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:ar.toString(r)}]})}_addCheck(e){return new Nr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ar.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ar.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ar.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ar.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:ar.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}Nr.create=e=>{var t;return new Nr({checks:[],typeName:Eo.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...dr(e)})};class Rr extends pr{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==$n.boolean){const t=this._getOrReturnCtx(e);return Yn(t,{code:Hn.invalid_type,expected:$n.boolean,received:t.parsedType}),Xn}return Jn(e.data)}}Rr.create=e=>new Rr({typeName:Eo.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...dr(e)});class Br extends pr{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==$n.date){const t=this._getOrReturnCtx(e);return Yn(t,{code:Hn.invalid_type,expected:$n.date,received:t.parsedType}),Xn}if(isNaN(e.data.getTime())){return Yn(this._getOrReturnCtx(e),{code:Hn.invalid_date}),Xn}const t=new Zn;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),Yn(n,{code:Hn.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),Yn(n,{code:Hn.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):Un.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Br({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:ar.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:ar.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}Br.create=e=>new Br({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Eo.ZodDate,...dr(e)});class Fr extends pr{_parse(e){if(this._getType(e)!==$n.symbol){const t=this._getOrReturnCtx(e);return Yn(t,{code:Hn.invalid_type,expected:$n.symbol,received:t.parsedType}),Xn}return Jn(e.data)}}Fr.create=e=>new Fr({typeName:Eo.ZodSymbol,...dr(e)});class Lr extends pr{_parse(e){if(this._getType(e)!==$n.undefined){const t=this._getOrReturnCtx(e);return Yn(t,{code:Hn.invalid_type,expected:$n.undefined,received:t.parsedType}),Xn}return Jn(e.data)}}Lr.create=e=>new Lr({typeName:Eo.ZodUndefined,...dr(e)});class Mr extends pr{_parse(e){if(this._getType(e)!==$n.null){const t=this._getOrReturnCtx(e);return Yn(t,{code:Hn.invalid_type,expected:$n.null,received:t.parsedType}),Xn}return Jn(e.data)}}Mr.create=e=>new Mr({typeName:Eo.ZodNull,...dr(e)});class Ur extends pr{constructor(){super(...arguments),this._any=!0}_parse(e){return Jn(e.data)}}Ur.create=e=>new Ur({typeName:Eo.ZodAny,...dr(e)});class jr extends pr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Jn(e.data)}}jr.create=e=>new jr({typeName:Eo.ZodUnknown,...dr(e)});class $r extends pr{_parse(e){const t=this._getOrReturnCtx(e);return Yn(t,{code:Hn.invalid_type,expected:$n.never,received:t.parsedType}),Xn}}$r.create=e=>new $r({typeName:Eo.ZodNever,...dr(e)});class zr extends pr{_parse(e){if(this._getType(e)!==$n.undefined){const t=this._getOrReturnCtx(e);return Yn(t,{code:Hn.invalid_type,expected:$n.void,received:t.parsedType}),Xn}return Jn(e.data)}}zr.create=e=>new zr({typeName:Eo.ZodVoid,...dr(e)});class Hr extends pr{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==$n.array)return Yn(t,{code:Hn.invalid_type,expected:$n.array,received:t.parsedType}),Xn;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,o=t.data.length<r.exactLength.value;(e||o)&&(Yn(t,{code:e?Hn.too_big:Hn.too_small,minimum:o?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(Yn(t,{code:Hn.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(Yn(t,{code:Hn.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new ur(t,e,t.path,n)))).then(e=>Zn.mergeArray(n,e));const o=[...t.data].map((e,n)=>r.type._parseSync(new ur(t,e,t.path,n)));return Zn.mergeArray(n,o)}get element(){return this._def.type}min(e,t){return new Hr({...this._def,minLength:{value:e,message:ar.toString(t)}})}max(e,t){return new Hr({...this._def,maxLength:{value:e,message:ar.toString(t)}})}length(e,t){return new Hr({...this._def,exactLength:{value:e,message:ar.toString(t)}})}nonempty(e){return this.min(1,e)}}function Vr(e){if(e instanceof Wr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=uo.create(Vr(r))}return new Wr({...e._def,shape:()=>t})}return e instanceof Hr?new Hr({...e._def,type:Vr(e.element)}):e instanceof uo?uo.create(Vr(e.unwrap())):e instanceof co?co.create(Vr(e.unwrap())):e instanceof Xr?Xr.create(e.items.map(e=>Vr(e))):e}Hr.create=(e,t)=>new Hr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Eo.ZodArray,...dr(t)});class Wr extends pr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=Un.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==$n.object){const t=this._getOrReturnCtx(e);return Yn(t,{code:Hn.invalid_type,expected:$n.object,received:t.parsedType}),Xn}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:o}=this._getCached(),i=[];if(!(this._def.catchall instanceof $r&&"strip"===this._def.unknownKeys))for(const e in n.data)o.includes(e)||i.push(e);const a=[];for(const e of o){const t=r[e],o=n.data[e];a.push({key:{status:"valid",value:e},value:t._parse(new ur(n,o,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof $r){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of i)a.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)i.length>0&&(Yn(n,{code:Hn.unrecognized_keys,keys:i}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of i){const r=n.data[t];a.push({key:{status:"valid",value:t},value:e._parse(new ur(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of a){const n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>Zn.mergeObjectSync(t,e)):Zn.mergeObjectSync(t,a)}get shape(){return this._def.shape()}strict(e){return ar.errToObj,new Wr({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,o,i,a;const s=null!==(i=null===(o=(r=this._def).errorMap)||void 0===o?void 0:o.call(r,t,n).message)&&void 0!==i?i:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(a=ar.errToObj(e).message)&&void 0!==a?a:s}:{message:s}}}:{}})}strip(){return new Wr({...this._def,unknownKeys:"strip"})}passthrough(){return new Wr({...this._def,unknownKeys:"passthrough"})}extend(e){return new Wr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Wr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Eo.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Wr({...this._def,catchall:e})}pick(e){const t={};return Un.objectKeys(e).forEach(n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])}),new Wr({...this._def,shape:()=>t})}omit(e){const t={};return Un.objectKeys(this.shape).forEach(n=>{e[n]||(t[n]=this.shape[n])}),new Wr({...this._def,shape:()=>t})}deepPartial(){return Vr(this)}partial(e){const t={};return Un.objectKeys(this.shape).forEach(n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()}),new Wr({...this._def,shape:()=>t})}required(e){const t={};return Un.objectKeys(this.shape).forEach(n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof uo;)e=e._def.innerType;t[n]=e}}),new Wr({...this._def,shape:()=>t})}keyof(){return oo(Un.objectKeys(this.shape))}}Wr.create=(e,t)=>new Wr({shape:()=>e,unknownKeys:"strip",catchall:$r.create(),typeName:Eo.ZodObject,...dr(t)}),Wr.strictCreate=(e,t)=>new Wr({shape:()=>e,unknownKeys:"strict",catchall:$r.create(),typeName:Eo.ZodObject,...dr(t)}),Wr.lazycreate=(e,t)=>new Wr({shape:e,unknownKeys:"strip",catchall:$r.create(),typeName:Eo.ZodObject,...dr(t)});class qr extends pr{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map(async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map(e=>new Vn(e.ctx.common.issues));return Yn(t,{code:Hn.invalid_union,unionErrors:n}),Xn});{let e;const r=[];for(const o of n){const n={...t,common:{...t.common,issues:[]},parent:null},i=o._parseSync({data:t.data,path:t.path,parent:n});if("valid"===i.status)return i;"dirty"!==i.status||e||(e={result:i,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const o=r.map(e=>new Vn(e));return Yn(t,{code:Hn.invalid_union,unionErrors:o}),Xn}}get options(){return this._def.options}}qr.create=(e,t)=>new qr({options:e,typeName:Eo.ZodUnion,...dr(t)});const Gr=e=>e instanceof no?Gr(e.schema):e instanceof lo?Gr(e.innerType()):e instanceof ro?[e.value]:e instanceof io?e.options:e instanceof ao?Un.objectValues(e.enum):e instanceof po?Gr(e._def.innerType):e instanceof Lr?[void 0]:e instanceof Mr?[null]:e instanceof uo?[void 0,...Gr(e.unwrap())]:e instanceof co?[null,...Gr(e.unwrap())]:e instanceof mo||e instanceof yo?Gr(e.unwrap()):e instanceof fo?Gr(e._def.innerType):[];class Kr extends pr{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==$n.object)return Yn(t,{code:Hn.invalid_type,expected:$n.object,received:t.parsedType}),Xn;const n=this.discriminator,r=t.data[n],o=this.optionsMap.get(r);return o?t.common.async?o._parseAsync({data:t.data,path:t.path,parent:t}):o._parseSync({data:t.data,path:t.path,parent:t}):(Yn(t,{code:Hn.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Xn)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const n of t){const t=Gr(n.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of t){if(r.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);r.set(o,n)}}return new Kr({typeName:Eo.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...dr(n)})}}function Yr(e,t){const n=zn(e),r=zn(t);if(e===t)return{valid:!0,data:e};if(n===$n.object&&r===$n.object){const n=Un.objectKeys(t),r=Un.objectKeys(e).filter(e=>-1!==n.indexOf(e)),o={...e,...t};for(const n of r){const r=Yr(e[n],t[n]);if(!r.valid)return{valid:!1};o[n]=r.data}return{valid:!0,data:o}}if(n===$n.array&&r===$n.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const o=Yr(e[r],t[r]);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}return n===$n.date&&r===$n.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}class Zr extends pr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(er(e)||er(r))return Xn;const o=Yr(e.value,r.value);return o.valid?((tr(e)||tr(r))&&t.dirty(),{status:t.value,value:o.data}):(Yn(n,{code:Hn.invalid_intersection_types}),Xn)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Zr.create=(e,t,n)=>new Zr({left:e,right:t,typeName:Eo.ZodIntersection,...dr(n)});class Xr extends pr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==$n.array)return Yn(n,{code:Hn.invalid_type,expected:$n.array,received:n.parsedType}),Xn;if(n.data.length<this._def.items.length)return Yn(n,{code:Hn.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Xn;!this._def.rest&&n.data.length>this._def.items.length&&(Yn(n,{code:Hn.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new ur(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>Zn.mergeArray(t,e)):Zn.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Xr({...this._def,rest:e})}}Xr.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Xr({items:e,typeName:Eo.ZodTuple,rest:null,...dr(t)})};class Qr extends pr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==$n.object)return Yn(n,{code:Hn.invalid_type,expected:$n.object,received:n.parsedType}),Xn;const r=[],o=this._def.keyType,i=this._def.valueType;for(const e in n.data)r.push({key:o._parse(new ur(n,e,n.path,e)),value:i._parse(new ur(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?Zn.mergeObjectAsync(t,r):Zn.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Qr(t instanceof pr?{keyType:e,valueType:t,typeName:Eo.ZodRecord,...dr(n)}:{keyType:Or.create(),valueType:e,typeName:Eo.ZodRecord,...dr(t)})}}class Jr extends pr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==$n.map)return Yn(n,{code:Hn.invalid_type,expected:$n.map,received:n.parsedType}),Xn;const r=this._def.keyType,o=this._def.valueType,i=[...n.data.entries()].map(([e,t],i)=>({key:r._parse(new ur(n,e,n.path,[i,"key"])),value:o._parse(new ur(n,t,n.path,[i,"value"]))}));if(n.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const n of i){const r=await n.key,o=await n.value;if("aborted"===r.status||"aborted"===o.status)return Xn;"dirty"!==r.status&&"dirty"!==o.status||t.dirty(),e.set(r.value,o.value)}return{status:t.value,value:e}})}{const e=new Map;for(const n of i){const r=n.key,o=n.value;if("aborted"===r.status||"aborted"===o.status)return Xn;"dirty"!==r.status&&"dirty"!==o.status||t.dirty(),e.set(r.value,o.value)}return{status:t.value,value:e}}}}Jr.create=(e,t,n)=>new Jr({valueType:t,keyType:e,typeName:Eo.ZodMap,...dr(n)});class eo extends pr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==$n.set)return Yn(n,{code:Hn.invalid_type,expected:$n.set,received:n.parsedType}),Xn;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(Yn(n,{code:Hn.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(Yn(n,{code:Hn.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const o=this._def.valueType;function i(e){const n=new Set;for(const r of e){if("aborted"===r.status)return Xn;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const a=[...n.data.values()].map((e,t)=>o._parse(new ur(n,e,n.path,t)));return n.common.async?Promise.all(a).then(e=>i(e)):i(a)}min(e,t){return new eo({...this._def,minSize:{value:e,message:ar.toString(t)}})}max(e,t){return new eo({...this._def,maxSize:{value:e,message:ar.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}eo.create=(e,t)=>new eo({valueType:e,minSize:null,maxSize:null,typeName:Eo.ZodSet,...dr(t)});class to extends pr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==$n.function)return Yn(t,{code:Hn.invalid_type,expected:$n.function,received:t.parsedType}),Xn;function n(e,n){return Kn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Gn(),Wn].filter(e=>!!e),issueData:{code:Hn.invalid_arguments,argumentsError:n}})}function r(e,n){return Kn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Gn(),Wn].filter(e=>!!e),issueData:{code:Hn.invalid_return_type,returnTypeError:n}})}const o={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof so){const e=this;return Jn(async function(...t){const a=new Vn([]),s=await e._def.args.parseAsync(t,o).catch(e=>{throw a.addIssue(n(t,e)),a}),l=await Reflect.apply(i,this,s),u=await e._def.returns._def.type.parseAsync(l,o).catch(e=>{throw a.addIssue(r(l,e)),a});return u})}{const e=this;return Jn(function(...t){const a=e._def.args.safeParse(t,o);if(!a.success)throw new Vn([n(t,a.error)]);const s=Reflect.apply(i,this,a.data),l=e._def.returns.safeParse(s,o);if(!l.success)throw new Vn([r(s,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new to({...this._def,args:Xr.create(e).rest(jr.create())})}returns(e){return new to({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new to({args:e||Xr.create([]).rest(jr.create()),returns:t||jr.create(),typeName:Eo.ZodFunction,...dr(n)})}}class no extends pr{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}no.create=(e,t)=>new no({getter:e,typeName:Eo.ZodLazy,...dr(t)});class ro extends pr{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return Yn(t,{received:t.data,code:Hn.invalid_literal,expected:this._def.value}),Xn}return{status:"valid",value:e.data}}get value(){return this._def.value}}function oo(e,t){return new io({values:e,typeName:Eo.ZodEnum,...dr(t)})}ro.create=(e,t)=>new ro({value:e,typeName:Eo.ZodLiteral,...dr(t)});class io extends pr{constructor(){super(...arguments),sr.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return Yn(t,{expected:Un.joinValues(n),received:t.parsedType,code:Hn.invalid_type}),Xn}if(or(this,sr)||ir(this,sr,new Set(this._def.values)),!or(this,sr).has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return Yn(t,{received:t.data,code:Hn.invalid_enum_value,options:n}),Xn}return Jn(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return io.create(e,{...this._def,...t})}exclude(e,t=this._def){return io.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}sr=new WeakMap,io.create=oo;class ao extends pr{constructor(){super(...arguments),lr.set(this,void 0)}_parse(e){const t=Un.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==$n.string&&n.parsedType!==$n.number){const e=Un.objectValues(t);return Yn(n,{expected:Un.joinValues(e),received:n.parsedType,code:Hn.invalid_type}),Xn}if(or(this,lr)||ir(this,lr,new Set(Un.getValidEnumValues(this._def.values))),!or(this,lr).has(e.data)){const e=Un.objectValues(t);return Yn(n,{received:n.data,code:Hn.invalid_enum_value,options:e}),Xn}return Jn(e.data)}get enum(){return this._def.values}}lr=new WeakMap,ao.create=(e,t)=>new ao({values:e,typeName:Eo.ZodNativeEnum,...dr(t)});class so extends pr{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==$n.promise&&!1===t.common.async)return Yn(t,{code:Hn.invalid_type,expected:$n.promise,received:t.parsedType}),Xn;const n=t.parsedType===$n.promise?t.data:Promise.resolve(t.data);return Jn(n.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}so.create=(e,t)=>new so({type:e,typeName:Eo.ZodPromise,...dr(t)});class lo extends pr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Eo.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:e=>{Yn(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),"preprocess"===r.type){const e=r.transform(n.data,o);if(n.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return Xn;const r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===r.status?Xn:"dirty"===r.status||"dirty"===t.value?Qn(r.value):r});{if("aborted"===t.value)return Xn;const r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===r.status?Xn:"dirty"===r.status||"dirty"===t.value?Qn(r.value):r}}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,o);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?Xn:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>"aborted"===n.status?Xn:("dirty"===n.status&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!nr(e))return e;const i=r.transform(e.value,o);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>nr(e)?Promise.resolve(r.transform(e.value,o)).then(e=>({status:t.value,value:e})):e)}Un.assertNever(r)}}lo.create=(e,t,n)=>new lo({schema:e,typeName:Eo.ZodEffects,effect:t,...dr(n)}),lo.createWithPreprocess=(e,t,n)=>new lo({schema:t,effect:{type:"preprocess",transform:e},typeName:Eo.ZodEffects,...dr(n)});class uo extends pr{_parse(e){return this._getType(e)===$n.undefined?Jn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}uo.create=(e,t)=>new uo({innerType:e,typeName:Eo.ZodOptional,...dr(t)});class co extends pr{_parse(e){return this._getType(e)===$n.null?Jn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}co.create=(e,t)=>new co({innerType:e,typeName:Eo.ZodNullable,...dr(t)});class po extends pr{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===$n.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}po.create=(e,t)=>new po({innerType:e,typeName:Eo.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...dr(t)});class fo extends pr{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return rr(r)?r.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new Vn(n.common.issues)},input:n.data})})):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new Vn(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}fo.create=(e,t)=>new fo({innerType:e,typeName:Eo.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...dr(t)});class ho extends pr{_parse(e){if(this._getType(e)!==$n.nan){const t=this._getOrReturnCtx(e);return Yn(t,{code:Hn.invalid_type,expected:$n.nan,received:t.parsedType}),Xn}return{status:"valid",value:e.data}}}ho.create=e=>new ho({typeName:Eo.ZodNaN,...dr(e)});const go=Symbol("zod_brand");class mo extends pr{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class vo extends pr{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?Xn:"dirty"===e.status?(t.dirty(),Qn(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?Xn:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new vo({in:e,out:t,typeName:Eo.ZodPipeline})}}class yo extends pr{_parse(e){const t=this._def.innerType._parse(e),n=e=>(nr(e)&&(e.value=Object.freeze(e.value)),e);return rr(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}}function bo(e,t={},n){return e?Ur.create().superRefine((r,o)=>{var i,a;if(!e(r)){const e="function"==typeof t?t(r):"string"==typeof t?{message:t}:t,s=null===(a=null!==(i=e.fatal)&&void 0!==i?i:n)||void 0===a||a,l="string"==typeof e?{message:e}:e;o.addIssue({code:"custom",...l,fatal:s})}}):Ur.create()}yo.create=(e,t)=>new yo({innerType:e,typeName:Eo.ZodReadonly,...dr(t)});const wo={object:Wr.lazycreate};var Eo;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Eo||(Eo={}));const _o=Or.create,xo=Ir.create,ko=ho.create,Co=Nr.create,So=Rr.create,To=Br.create,Do=Fr.create,Ao=Lr.create,Oo=Mr.create,Po=Ur.create,Io=jr.create,No=$r.create,Ro=zr.create,Bo=Hr.create,Fo=Wr.create,Lo=Wr.strictCreate,Mo=qr.create,Uo=Kr.create,jo=Zr.create,$o=Xr.create,zo=Qr.create,Ho=Jr.create,Vo=eo.create,Wo=to.create,qo=no.create,Go=ro.create,Ko=io.create,Yo=ao.create,Zo=so.create,Xo=lo.create,Qo=uo.create,Jo=co.create,ei=lo.createWithPreprocess,ti=vo.create,ni={string:e=>Or.create({...e,coerce:!0}),number:e=>Ir.create({...e,coerce:!0}),boolean:e=>Rr.create({...e,coerce:!0}),bigint:e=>Nr.create({...e,coerce:!0}),date:e=>Br.create({...e,coerce:!0})},ri=Xn;var oi=Object.freeze({__proto__:null,defaultErrorMap:Wn,setErrorMap:function(e){qn=e},getErrorMap:Gn,makeIssue:Kn,EMPTY_PATH:[],addIssueToContext:Yn,ParseStatus:Zn,INVALID:Xn,DIRTY:Qn,OK:Jn,isAborted:er,isDirty:tr,isValid:nr,isAsync:rr,get util(){return Un},get objectUtil(){return jn},ZodParsedType:$n,getParsedType:zn,ZodType:pr,datetimeRegex:Dr,ZodString:Or,ZodNumber:Ir,ZodBigInt:Nr,ZodBoolean:Rr,ZodDate:Br,ZodSymbol:Fr,ZodUndefined:Lr,ZodNull:Mr,ZodAny:Ur,ZodUnknown:jr,ZodNever:$r,ZodVoid:zr,ZodArray:Hr,ZodObject:Wr,ZodUnion:qr,ZodDiscriminatedUnion:Kr,ZodIntersection:Zr,ZodTuple:Xr,ZodRecord:Qr,ZodMap:Jr,ZodSet:eo,ZodFunction:to,ZodLazy:no,ZodLiteral:ro,ZodEnum:io,ZodNativeEnum:ao,ZodPromise:so,ZodEffects:lo,ZodTransformer:lo,ZodOptional:uo,ZodNullable:co,ZodDefault:po,ZodCatch:fo,ZodNaN:ho,BRAND:go,ZodBranded:mo,ZodPipeline:vo,ZodReadonly:yo,custom:bo,Schema:pr,ZodSchema:pr,late:wo,get ZodFirstPartyTypeKind(){return Eo},coerce:ni,any:Po,array:Bo,bigint:Co,boolean:So,date:To,discriminatedUnion:Uo,effect:Xo,enum:Ko,function:Wo,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>bo(t=>t instanceof e,t),intersection:jo,lazy:qo,literal:Go,map:Ho,nan:ko,nativeEnum:Yo,never:No,null:Oo,nullable:Jo,number:xo,object:Fo,oboolean:()=>So().optional(),onumber:()=>xo().optional(),optional:Qo,ostring:()=>_o().optional(),pipeline:ti,preprocess:ei,promise:Zo,record:zo,set:Vo,strictObject:Lo,string:_o,symbol:Do,transformer:Xo,tuple:$o,undefined:Ao,union:Mo,unknown:Io,void:Ro,NEVER:ri,ZodIssueCode:Hn,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:Vn});new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");var ii={code:"0",name:"text",parse:e=>{if("string"!=typeof e)throw new Error('"text" parts expect a string value.');return{type:"text",value:e}}},ai={code:"1",name:"function_call",parse:e=>{if(null==e||"object"!=typeof e||!("function_call"in e)||"object"!=typeof e.function_call||null==e.function_call||!("name"in e.function_call)||!("arguments"in e.function_call)||"string"!=typeof e.function_call.name||"string"!=typeof e.function_call.arguments)throw new Error('"function_call" parts expect an object with a "function_call" property.');return{type:"function_call",value:e}}},si={code:"2",name:"data",parse:e=>{if(!Array.isArray(e))throw new Error('"data" parts expect an array value.');return{type:"data",value:e}}},li={code:"3",name:"error",parse:e=>{if("string"!=typeof e)throw new Error('"error" parts expect a string value.');return{type:"error",value:e}}},ui={code:"4",name:"assistant_message",parse:e=>{if(!(null!=e&&"object"==typeof e&&"id"in e&&"role"in e&&"content"in e&&"string"==typeof e.id&&"string"==typeof e.role&&"assistant"===e.role&&Array.isArray(e.content)&&e.content.every(e=>null!=e&&"object"==typeof e&&"type"in e&&"text"===e.type&&"text"in e&&null!=e.text&&"object"==typeof e.text&&"value"in e.text&&"string"==typeof e.text.value)))throw new Error('"assistant_message" parts expect an object with an "id", "role", and "content" property.');return{type:"assistant_message",value:e}}},ci={code:"5",name:"assistant_control_data",parse:e=>{if(null==e||"object"!=typeof e||!("threadId"in e)||!("messageId"in e)||"string"!=typeof e.threadId||"string"!=typeof e.messageId)throw new Error('"assistant_control_data" parts expect an object with a "threadId" and "messageId" property.');return{type:"assistant_control_data",value:{threadId:e.threadId,messageId:e.messageId}}}},di={code:"6",name:"data_message",parse:e=>{if(null==e||"object"!=typeof e||!("role"in e)||!("data"in e)||"string"!=typeof e.role||"data"!==e.role)throw new Error('"data_message" parts expect an object with a "role" and "data" property.');return{type:"data_message",value:e}}},pi={code:"7",name:"tool_calls",parse:e=>{if(null==e||"object"!=typeof e||!("tool_calls"in e)||"object"!=typeof e.tool_calls||null==e.tool_calls||!Array.isArray(e.tool_calls)||e.tool_calls.some(e=>!(null!=e&&"object"==typeof e&&"id"in e&&"string"==typeof e.id&&"type"in e&&"string"==typeof e.type&&"function"in e&&null!=e.function&&"object"==typeof e.function&&"arguments"in e.function&&"string"==typeof e.function.name&&"string"==typeof e.function.arguments)))throw new Error('"tool_calls" parts expect an object with a ToolCallPayload.');return{type:"tool_calls",value:e}}},fi={code:"8",name:"message_annotations",parse:e=>{if(!Array.isArray(e))throw new Error('"message_annotations" parts expect an array value.');return{type:"message_annotations",value:e}}},hi={code:"9",name:"tool_call",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("toolName"in e)||"string"!=typeof e.toolName||!("args"in e)||"object"!=typeof e.args)throw new Error('"tool_call" parts expect an object with a "toolCallId", "toolName", and "args" property.');return{type:"tool_call",value:e}}},gi={code:"a",name:"tool_result",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("result"in e))throw new Error('"tool_result" parts expect an object with a "toolCallId" and a "result" property.');return{type:"tool_result",value:e}}},mi={code:"b",name:"tool_call_streaming_start",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("toolName"in e)||"string"!=typeof e.toolName)throw new Error('"tool_call_streaming_start" parts expect an object with a "toolCallId" and "toolName" property.');return{type:"tool_call_streaming_start",value:e}}},vi={code:"c",name:"tool_call_delta",parse:e=>{if(null==e||"object"!=typeof e||!("toolCallId"in e)||"string"!=typeof e.toolCallId||!("argsTextDelta"in e)||"string"!=typeof e.argsTextDelta)throw new Error('"tool_call_delta" parts expect an object with a "toolCallId" and "argsTextDelta" property.');return{type:"tool_call_delta",value:e}}},yi={code:"d",name:"finish_message",parse:e=>{if(!(null!=e&&"object"==typeof e&&"finishReason"in e&&"string"==typeof e.finishReason&&"usage"in e&&null!=e.usage&&"object"==typeof e.usage&&"promptTokens"in e.usage&&"completionTokens"in e.usage))throw new Error('"finish_message" parts expect an object with a "finishReason" and "usage" property.');return"number"!=typeof e.usage.promptTokens&&(e.usage.promptTokens=Number.NaN),"number"!=typeof e.usage.completionTokens&&(e.usage.completionTokens=Number.NaN),{type:"finish_message",value:e}}},bi=[ii,ai,si,li,ui,ci,di,pi,fi,hi,gi,mi,vi,yi],wi={[ii.code]:ii,[ai.code]:ai,[si.code]:si,[li.code]:li,[ui.code]:ui,[ci.code]:ci,[di.code]:di,[pi.code]:pi,[fi.code]:fi,[hi.code]:hi,[gi.code]:gi,[mi.code]:mi,[vi.code]:vi,[yi.code]:yi},Ei=bi.map(e=>e.code),_i=e=>{const t=e.indexOf(":");if(-1===t)throw new Error("Failed to parse stream string. No separator found.");const n=e.slice(0,t);if(!Ei.includes(n))throw new Error(`Failed to parse stream string. Invalid code ${n}.`);const r=n,o=e.slice(t+1),i=JSON.parse(o);return wi[r].parse(i)},xi="\n".charCodeAt(0);function ki(e,t){const n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return e.length=0,n}let Ci=null;const Si=e=>async({messages:t,onMessageStream:n})=>{try{Ci=new AbortController;const r=e.apiHost,o=await fetch((Qe(r)?r:_t())+`/api/v2/sessions/${e.sessionId}/streamMessage`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:t}),signal:Ci.signal});if(!o.ok){if((e.retryAttempt??0)<1&&(403===o.status||500===o.status||503===o.status))return await new Promise(e=>setTimeout(e,3e3)),Si({...e,retryAttempt:(e.retryAttempt??0)+1})({messages:t,onMessageStream:n});try{return{error:await o.json()||"Failed to fetch the chat response."}}catch{return{error:{message:"Failed to fetch the chat response."}}}}if(!o.body)throw new Error("The response body is empty.");let i="";const a=o.body.getReader(),s=ue();for await(const{type:e,value:t}of async function*(e,{isAborted:t}={}){const n=new TextDecoder,r=[];let o=0;for(;;){const{value:i}=await e.read();if(i&&(r.push(i),o+=i.length,i[i.length-1]!==xi))continue;if(0===r.length)break;const a=ki(r,o);o=0;const s=n.decode(a,{stream:!0}).split("\n").filter(e=>""!==e).map(_i);for(const e of s)yield e;if(null==t?void 0:t()){e.cancel();break}}}(a,{isAborted:()=>null===Ci}))if("text"===e)i+=t,n&&n({id:s,message:i});else if("error"===e)return{error:{message:t}};return Ci=null,{message:i}}catch(e){return console.error(e),"AbortError"===e.name?(Ci=null,{error:{message:"Request aborted"}}):e instanceof Error?{error:{message:e.message}}:{error:{message:"Failed to fetch the chat response."}}}},Ti=e=>{if(!Ze(e)){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch{console.warn("Failed to safely stringify variable value",e)}}},Di=Object.getPrototypeOf(async function(){}).constructor,Ai=async e=>{Xe(e?.pixelId)||(e=>{if(!e?.eventType||!e.pixelId)return;if(!window.fbq)return void console.error("Facebook Pixel was not properly initialized");const t=e.params?.length?e.params.reduce((e,t)=>t.key&&t.value?{...e,[t.key]:t.value}:e,{}):void 0;if("Custom"===e.eventType){if(!e.name)return;window.fbq("trackSingleCustom",e.pixelId,e.name,t)}window.fbq("trackSingle",e.pixelId,e.eventType,t)})(e)},Oi=async e=>{const t=e.customHeadCode;Qe(t)&&(e=>{e.split("</noscript>").forEach(e=>{const[t,n]=e.split("<noscript>"),r=document.createRange().createContextualFragment(t);if(document.head.append(r),Ze(n))return;const o=document.createElement("noscript"),i=document.createRange().createContextualFragment(n);o.append(i),document.head.append(o)})})(t);const n=e.gtmId;Qe(n)&&document.body.prepend((e=>{if(document.getElementById("gtm-noscript"))return"";const t=document.createElement("noscript");t.id="gtm-noscript";const n=document.createElement("iframe");return n.src=`https://www.googletagmanager.com/ns.html?id=${e}`,n.height="0",n.width="0",n.style.display="none",n.style.visibility="hidden",t.appendChild(n),t})(n));const r=e.pixelIds;Ye(r)&&(e=>{const t=document.createElement("script");t.innerHTML=`!function(f,b,e,v,n,t,s)\n {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n n.queue=[];t=b.createElement(e);t.async=!0;\n t.src=v;s=b.getElementsByTagName(e)[0];\n s.parentNode.insertBefore(t,s)}(window, document,'script',\n 'https://connect.facebook.net/en_US/fbevents.js');\n ${e.map(e=>`fbq('init', '${e}');`).join("\n")}\n fbq('track', 'PageView');`,document.head.appendChild(t)})(r)},Pi=async({clientSideAction:e,context:t,onMessageStream:n})=>{if("chatwoot"in e)return r=e.chatwoot,void Tn(r.scriptToExecute);var r;if("scriptToExecute"in e)return Tn(e.scriptToExecute);if("redirect"in e)return(({url:e,isNewTab:t}={})=>{if(!e)return;if(!t)return void(window.location.href=e);const n=window.open(e,"_blank");if(!n)return{blockedPopupUrl:e};try{if(n.closed)return{blockedPopupUrl:e};if(!n.opener)return n.close(),{blockedPopupUrl:e}}catch{return{blockedPopupUrl:e}}})(e.redirect);if("wait"in e)return await(async({secondsToWaitFor:e})=>{await new Promise(t=>setTimeout(t,1e3*e))})(e.wait),e.expectsDedicatedReply?{replyToSend:void 0}:void 0;if("setVariable"in e)return(async({content:e,args:t,isCode:n})=>{try{if(!isNaN(e)&&/0[^.].+/.test(e))return{replyToSend:e};const n=Di(...t.map(e=>e.id),e.includes("return ")?e:`return ${e}`),r=await n(...t.map(e=>e.value));return{replyToSend:Ti(r)??void 0}}catch(t){return console.error(t),{replyToSend:Ti(e)??void 0,logs:n?[{status:"error",description:"Failed to execute Variable code",details:Cn(t)}]:void 0}}})(e.setVariable.scriptToExecute);if("streamOpenAiChatCompletion"in e||"stream"in e){const{error:r,message:o}=await Si(t)({messages:"streamOpenAiChatCompletion"in e?e.streamOpenAiChatCompletion?.messages:void 0,onMessageStream:n});return r?{replyToSend:void 0,logs:[{status:"error",description:"Message streaming returned an error",details:JSON.stringify(r,null,2)}]}:{replyToSend:o}}if("webhookToExecute"in e){return{replyToSend:await(async e=>{const{url:t,method:n,body:r,headers:o}=e;try{const e=await fetch(t,{method:n,body:"GET"!==n&&r?JSON.stringify(r):void 0,headers:o}),i=e.status,a=await e.json();return JSON.stringify({statusCode:i,data:a})}catch(e){return console.error(e),JSON.stringify({statusCode:500,data:"An error occured while executing the webhook on the client"})}})(e.webhookToExecute)}}return"startPropsToInject"in e?Oi(e.startPropsToInject):"pixel"in e?Ai(e.pixel):"codeToExecute"in e?An(e.codeToExecute):void 0},[Ii,Ni]=S(),Ri=B(),Bi=e=>{const[t,n]=S({}),[r,o]=S(e.initialChatReply.bot.theme),[i,a]=S(!1),[s,l]=S(!1),[u,c]=S(),[d,p]=S(e.initialChatReply.dynamicTheme),[f,h]=S([]);const[g,m,v,y]=xn(S([{input:e.initialChatReply.input,messages:e.initialChatReply.messages,clientSideActions:e.initialChatReply.clientSideActions}]),{key:`bot-${e.context.bot.id}-chatChunks`,storage:e.context.storage,onRecovered:()=>{}});D(()=>{if(v()){const e=[...g()].reverse().find(e=>e.input);e?.input&&h([e.input])}else e.initialChatReply.input&&h([e.initialChatReply.input])});const[b,w]=S({}),E=()=>[...g()].pop(),_=async t=>{y(!1),a(!1);const n=E()?.input;t&&m(e=>{const n=e.length-1;if(n<0)return e;const r=e[n];return r.input?[...e.slice(0,n),{...r,input:{...r.input,answer:t}}]:e}),n?.id&&e.onAnswer&&t&&e.onAnswer({message:Xt(t),blockId:n.id});const r=n?.id&&t?{inputBlockId:n.id,inputType:n.type}:void 0,o=setTimeout(()=>{l(!0)},1e3),{data:i,error:s}=await(async({apiHost:e,message:t,sessionId:n,messageMetadata:r})=>{try{return{data:await Gt.post(`${Qe(e)?e:_t()}/api/v1/sessions/${n}/continueChat`,{json:{message:t,messageMetadata:r},timeout:!1}).json()}}catch(e){return{error:e}}})({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,message:tn(t),messageMetadata:r});if(clearTimeout(o),l(!1),s){a(!0);const t=[{description:"Failed to send the reply",details:s instanceof Ct?{status:s.response.status,body:await s.response.json()}:s,status:"error"}];return await Qt({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,clientLogs:t}),void e.onNewLogs?.(t)}if(i){if(i.progress&&e.onProgressUpdate?.(i.progress),i.lastMessageNewFormat&&(en([...Jt(),{inputIndex:[...g()].length-1,formattedMessage:i.lastMessageNewFormat}]),m(e=>{const t=e.length-1;if(t<0)return e;const n=e[t];return n.input?.answer&&"text"===n.input.answer.type?[...e.slice(0,t),{...n,input:{...n.input,answer:{...n.input.answer,label:i.lastMessageNewFormat}}}]:e})),i.logs&&e.onNewLogs?.(i.logs),i.dynamicTheme&&p(i.dynamicTheme),i.input&&h([...f(),i.input]),i.clientSideActions){const e=i.clientSideActions.filter(e=>Ze(e.lastBubbleBlockId));if(await C(e),1===i.clientSideActions.length&&"stream"===i.clientSideActions[0].type&&0===i.messages.length&&void 0===i.input)return}m(e=>[...e,{input:i.input,messages:i.messages,clientSideActions:i.clientSideActions}])}},x=({id:e,message:t})=>{l(!1);const n=[...g()].pop();n&&(n.streamingMessageId!==e&&m(t=>[...t,{messages:[],streamingMessageId:e}]),Ni({id:e,content:t}))},k=async t=>{t&&(e.onNewLogs?.(t),e.context.isPreview||await Qt({apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId,clientLogs:t}))},C=async t=>{if(!v())for(const n of t){("streamOpenAiChatCompletion"in n||"webhookToExecute"in n||"stream"in n)&&l(!0);const t=await Pi({clientSideAction:n,context:{apiHost:e.context.apiHost,sessionId:e.initialChatReply.sessionId},onMessageStream:x});if(t&&"logs"in t&&k(t.logs),t&&"replyToSend"in t)return l(!1),void _(t.replyToSend?{type:"text",value:t.replyToSend}:void 0);t&&"blockedPopupUrl"in t&&c(t.blockedPopupUrl)}};return D(()=>{o(((e,t)=>({...e,chat:{...e.chat,hostAvatar:e.chat?.hostAvatar&&t?.hostAvatarUrl?{...e.chat.hostAvatar,url:t.hostAvatarUrl}:e.chat?.hostAvatar,guestAvatar:e.chat?.guestAvatar&&t?.guestAvatarUrl?{...e.chat.guestAvatar,url:t?.guestAvatarUrl}:e.chat?.guestAvatar}}))(e.initialChatReply.bot.theme,d()))}),I(()=>{Ni(void 0),en([])}),te(Ri.Provider,{value:{chatChunks:g,theme:r,dynamicTheme:d,setTheme:o,answers:t,setAnswer:(e,t)=>{n(n=>({...n,[e]:t}))},getAnswer:e=>t()[e],hasError:i,setHasError:a,blockRef:void 0,currentBlock:E,blockedPopupUrl:u,setBlockedPopupUrl:c,isSending:s,displayedMessageIndexes:b,setDisplayedMessageIndex:(e,t)=>{w(n=>({...n,[e]:t}))},getDisplayedMessageIndex:e=>b()[e]??0,sendMessage:_,processClientSideActions:C,onBubblesDisplayed:()=>{const t=f();if(t.length>0){const[n,...r]=t;e.onNewBlock?.({id:n.id,type:n.type}),h(r)}}},get children(){return e.children}})},Fi=()=>{const e=F(Ri);if(!e)throw new Error("useInputAnswer must be used within an InputAnswerProvider");return e},[Li,Mi]=S(),Ui=ke('<div class="flex items-center gap-1"><div class="w-2 h-2 rounded-full bubble__dot--1"></div><div class="w-2 h-2 rounded-full bubble__dot--2"></div><div class="w-2 h-2 rounded-full bubble__dot--3">'),ji=()=>Ui(),$i=!0,zi=ke('<div><div class="flex w-full items-center"><div class="flex z-10 items-start w-full max-w-full"><div>'),Hi=ke('<audio class="w-full animate-fade-in" controls>');let Vi;const Wi=e=>{let t,n,r=!1;const[o,i]=S(!!e.onTransitionEnd);return P(()=>{Vi=setTimeout(()=>{r||(r=!0,i(!1),setTimeout(()=>e.onTransitionEnd?.(t),400))},100)}),I(()=>{Vi&&clearTimeout(Vi)}),(()=>{const r=zi(),i=r.firstChild.firstChild.firstChild;return"function"==typeof t?Oe(t,r):t=r,Pe(i,(()=>{const t=A(()=>!!o());return()=>t()?te(ji,{}):(()=>{const t=Hi();return"function"==typeof n?Oe(n,t):n=t,T(n=>{const r=e.content?.url,o=!!e.onTransitionEnd&&(e.content?.isAutoplayEnabled??$i);return r!==n._v$3&&Se(t,"src",n._v$3=r),o!==n._v$4&&(t.autoplay=n._v$4=o),n},{_v$3:void 0,_v$4:void 0}),t})()})()),T(t=>{const n=tt("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),a=tt("bubble bubble--host relative transition-all duration-300",o()&&"bubble--typing");return n!==t._v$&&Te(r,t._v$=n),a!==t._v$2&&Te(i,t._v$2=a),t},{_v$:void 0,_v$2:void 0}),r})()},[qi,Gi]=S("100%"),Ki=ke('<div><div class="flex w-full items-center"><div class="flex z-10 items-start w-full max-w-full"><div>'),Yi=ke('<div class="w-full overflow-y-auto">'),Zi=ke('<div class="animate-fade-in w-full">'),Xi=ke('<iframe id="bubble--embed" class="w-full h-full rounded-md">');let Qi;const Ji=e=>{let t,n;const[r,o]=S(!!e.onTransitionEnd),i=e.content?.initFunction,a=t=>{e.content?.waitForEvent?.isEnabled&&Qe(t.data.name)&&t.data.name===e.content?.waitForEvent.name&&(e.onCompleted?.(e.content.waitForEvent.saveDataInVariableId&&t.data.data?{type:"text",value:t.data.data}:void 0),window.removeEventListener("message",a))};return P(()=>{if(i){An({args:{...i.args,botElement:n},content:i.content});const t=e.content?.waitForEventFunction;t&&An({args:{...t.args,continueFlow:t=>e.onCompleted?.(t?{type:"text",value:t}:void 0)},content:t.content})}Qi=setTimeout(()=>{o(!1),!i&&e.content?.waitForEvent?.isEnabled&&window.addEventListener("message",a),setTimeout(()=>{e.onTransitionEnd?.(t)},400)},2e3)}),I(()=>{Qi&&clearTimeout(Qi),window.removeEventListener("message",a)}),(()=>{const o=Ki(),a=o.firstChild.firstChild.firstChild;return"function"==typeof t?Oe(t,o):t=o,Pe(a,(()=>{const t=A(()=>!!r());return()=>t()?te(ji,{}):(()=>{const t=Zi();return Pe(t,te(fe,{when:i,get fallback(){return(()=>{const t=Xi();return T(()=>Se(t,"src",e.content?.url)),t})()},get children(){const e=Yi();return"function"==typeof n?Oe(n,e):n=e,T(()=>null!=`calc(${qi()} - 100px)`?e.style.setProperty("max-height",`calc(${qi()} - 100px)`):e.style.removeProperty("max-height")),e}})),t})()})()),T(t=>{const n=tt("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),i=tt("bubble bubble--host relative transition-all duration-300 z-20 w-full",r()&&"bubble--typing");return n!==t._v$&&Te(o,t._v$=n),i!==t._v$2&&Te(a,t._v$2=i),t},{_v$:void 0,_v$2:void 0}),o})()},ea={alt:"Bubble image"},ta=ke('<img elementtiming="Bubble image" fetchpriority="high">'),na=ke('<div><div class="flex w-full items-center"><div class="flex z-10 items-start max-w-full"><div>'),ra=ke('<div class="animate-fade-in w-full">'),oa=ke('<a target="_blank" class="z-10 bubble">'),ia=ke('<figure class="z-10 w-full">');let aa;const sa=e=>{let t,n;const[r,o]=S(!!e.onTransitionEnd),i=()=>{r()&&(o(!1),setTimeout(()=>{e.onTransitionEnd?.(t)},400))};P(()=>{n&&(aa=setTimeout(i,5e3),n.onload=()=>{clearTimeout(aa),i()})}),I(()=>{aa&&clearTimeout(aa)});const a=(()=>{const t=ta();return"function"==typeof n?Oe(n,t):n=t,t.style.setProperty("max-height","512px"),T(n=>{const r=e.content?.url,o=e.content?.clickLink?.alt??ea.alt,i=tt(e.onTransitionEnd?"transition-opacity duration-[400ms] ease-in delay-200":void 0,e.content?.url?.endsWith(".svg")?"w-full":void 0,"rounded-md");return r!==n._v$&&Se(t,"src",n._v$=r),o!==n._v$2&&Se(t,"alt",n._v$2=o),i!==n._v$3&&Te(t,n._v$3=i),n},{_v$:void 0,_v$2:void 0,_v$3:void 0}),t})();return(()=>{const n=na(),o=n.firstChild.firstChild.firstChild;return"function"==typeof t?Oe(t,n):t=n,Pe(o,(()=>{const t=A(()=>!!r());return()=>t()?te(ji,{}):(()=>{const t=ra();return Pe(t,(()=>{const t=A(()=>!!e.content?.clickLink);return()=>t()?(()=>{const t=oa();return Pe(t,a),T(()=>Se(t,"href",e.content.clickLink.url)),t})():(()=>{const e=ia();return Pe(e,a),e})()})()),t})()})()),T(t=>{const i=tt("flex flex-col w-full",e.onTransitionEnd?"animate-fade-in":void 0),a=tt("bubble bubble--host relative transition-all duration-300",r()&&"bubble--typing");return i!==t._v$4&&Te(n,t._v$4=i),a!==t._v$5&&Te(o,t._v$5=a),t},{_v$4:void 0,_v$5:void 0}),n})()},la=ke("<br>"),ua=ke("<span>"),ca=e=>(()=>{const t=ua();return Pe(t,()=>e.text,null),Pe(t,te(fe,{get when(){return A(()=>!!e.isUniqueChild)()&&Xe(e.text)},get children(){return la()}}),null),T(()=>Te(t,((e,t,n)=>{let r="";return e&&(r+="slate-bold"),t&&(r+=" slate-italic"),n&&(r+=" slate-underline"),r})(e.bold,e.italic,e.underline))),t})(),da=ke('<a target="_blank" rel="noopener noreferrer">'),pa=ke("<ol>"),fa=ke("<ul>"),ha=ke("<li>"),ga=ke("<span>"),ma=ke("<div>"),va=e=>te(he,{get children(){return[te(ge,{get when(){return Ye(e.element.text)},get children(){return te(ca,ae(()=>e.element,{get isUniqueChild(){return e.isUniqueChild??!1}}))}}),te(ge,{when:!0,get children(){return te(he,{get children(){return[te(ge,{get when(){return"a"===e.element.type},get children(){const t=da();return Pe(t,te(de,{get each(){return e.element.children},children:t=>te(va,{element:t,get isUniqueChild(){return 1===e.element.children?.length}})})),T(()=>Se(t,"href",e.element.url)),t}}),te(ge,{get when(){return"ol"===e.element.type},get children(){const t=pa();return Pe(t,te(de,{get each(){return e.element.children},children:t=>te(va,{element:t,get isUniqueChild(){return 1===e.element.children?.length}})})),t}}),te(ge,{get when(){return"ul"===e.element.type},get children(){const t=fa();return Pe(t,te(de,{get each(){return e.element.children},children:t=>te(va,{element:t,get isUniqueChild(){return 1===e.element.children?.length}})})),t}}),te(ge,{get when(){return"li"===e.element.type},get children(){const t=ha();return Pe(t,te(de,{get each(){return e.element.children},children:t=>te(va,{element:t,get isUniqueChild(){return 1===e.element.children?.length}})})),t}}),te(ge,{when:!0,get children(){return te(ya,{get element(){return e.element},get insideInlineVariable(){return e.insideInlineVariable??!1},get children(){return te(de,{get each(){return e.element.children},children:t=>te(va,{element:t,get isUniqueChild(){return 1===e.element.children?.length},get insideInlineVariable(){return"inline-variable"===e.element.type}})})}})}})]}})}})]}}),ya=e=>te(he,{get children(){return[te(ge,{get when(){return"inline-variable"===e.element.type||e.insideInlineVariable},get children(){const t=ga();return Pe(t,()=>e.children),T(()=>Se(t,"data-element-type",e.element.type)),t}}),te(ge,{when:!0,get children(){const t=ma();return Pe(t,()=>e.children),T(()=>Se(t,"data-element-type",e.element.type)),t}})]}});var ba,wa={exports:{}},Ea={};wa.exports=function(){if(ba)return Ea;ba=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),a=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),d=Symbol.iterator,p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f=Object.assign,h={};function g(e,t,n){this.props=e,this.context=t,this.refs=h,this.updater=n||p}function m(){}function v(e,t,n){this.props=e,this.context=t,this.refs=h,this.updater=n||p}g.prototype.isReactComponent={},g.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},g.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},m.prototype=g.prototype;var y=v.prototype=new m;y.constructor=v,f(y,g.prototype),y.isPureReactComponent=!0;var b=Array.isArray,w=Object.prototype.hasOwnProperty,E={current:null},_={key:!0,ref:!0,__self:!0,__source:!0};function x(t,n,r){var o,i={},a=null,s=null;if(null!=n)for(o in void 0!==n.ref&&(s=n.ref),void 0!==n.key&&(a=""+n.key),n)w.call(n,o)&&!_.hasOwnProperty(o)&&(i[o]=n[o]);var l=arguments.length-2;if(1===l)i.children=r;else if(1<l){for(var u=Array(l),c=0;c<l;c++)u[c]=arguments[c+2];i.children=u}if(t&&t.defaultProps)for(o in l=t.defaultProps)void 0===i[o]&&(i[o]=l[o]);return{$$typeof:e,type:t,key:a,ref:s,props:i,_owner:E.current}}function k(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var C=/\/+/g;function S(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function T(n,r,o,i,a){var s=typeof n;"undefined"!==s&&"boolean"!==s||(n=null);var l=!1;if(null===n)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(n.$$typeof){case e:case t:l=!0}}if(l)return a=a(l=n),n=""===i?"."+S(l,0):i,b(a)?(o="",null!=n&&(o=n.replace(C,"$&/")+"/"),T(a,r,o,"",function(e){return e})):null!=a&&(k(a)&&(a=function(t,n){return{$$typeof:e,type:t.type,key:n,ref:t.ref,props:t.props,_owner:t._owner}}(a,o+(!a.key||l&&l.key===a.key?"":(""+a.key).replace(C,"$&/")+"/")+n)),r.push(a)),1;if(l=0,i=""===i?".":i+":",b(n))for(var u=0;u<n.length;u++){var c=i+S(s=n[u],u);l+=T(s,r,o,c,a)}else if(c=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=d&&e[d]||e["@@iterator"])?e:null}(n),"function"==typeof c)for(n=c.call(n),u=0;!(s=n.next()).done;)l+=T(s=s.value,r,o,c=i+S(s,u++),a);else if("object"===s)throw r=String(n),Error("Objects are not valid as a React child (found: "+("[object Object]"===r?"object with keys {"+Object.keys(n).join(", ")+"}":r)+"). If you meant to render a collection of children, use an array instead.");return l}function D(e,t,n){if(null==e)return e;var r=[],o=0;return T(e,r,"","",function(e){return t.call(n,e,o++)}),r}function A(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var O={current:null},P={transition:null},I={ReactCurrentDispatcher:O,ReactCurrentBatchConfig:P,ReactCurrentOwner:E};return Ea.Children={map:D,forEach:function(e,t,n){D(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return D(e,function(){t++}),t},toArray:function(e){return D(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},Ea.Component=g,Ea.Fragment=n,Ea.Profiler=o,Ea.PureComponent=v,Ea.StrictMode=r,Ea.Suspense=l,Ea.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,Ea.cloneElement=function(t,n,r){if(null==t)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var o=f({},t.props),i=t.key,a=t.ref,s=t._owner;if(null!=n){if(void 0!==n.ref&&(a=n.ref,s=E.current),void 0!==n.key&&(i=""+n.key),t.type&&t.type.defaultProps)var l=t.type.defaultProps;for(u in n)w.call(n,u)&&!_.hasOwnProperty(u)&&(o[u]=void 0===n[u]&&void 0!==l?l[u]:n[u])}var u=arguments.length-2;if(1===u)o.children=r;else if(1<u){l=Array(u);for(var c=0;c<u;c++)l[c]=arguments[c+2];o.children=l}return{$$typeof:e,type:t.type,key:i,ref:a,props:o,_owner:s}},Ea.createContext=function(e){return(e={$$typeof:a,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:i,_context:e},e.Consumer=e},Ea.createElement=x,Ea.createFactory=function(e){var t=x.bind(null,e);return t.type=e,t},Ea.createRef=function(){return{current:null}},Ea.forwardRef=function(e){return{$$typeof:s,render:e}},Ea.isValidElement=k,Ea.lazy=function(e){return{$$typeof:c,_payload:{_status:-1,_result:e},_init:A}},Ea.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},Ea.startTransition=function(e){var t=P.transition;P.transition={};try{e()}finally{P.transition=t}},Ea.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},Ea.useCallback=function(e,t){return O.current.useCallback(e,t)},Ea.useContext=function(e){return O.current.useContext(e)},Ea.useDebugValue=function(){},Ea.useDeferredValue=function(e){return O.current.useDeferredValue(e)},Ea.useEffect=function(e,t){return O.current.useEffect(e,t)},Ea.useId=function(){return O.current.useId()},Ea.useImperativeHandle=function(e,t,n){return O.current.useImperativeHandle(e,t,n)},Ea.useInsertionEffect=function(e,t){return O.current.useInsertionEffect(e,t)},Ea.useLayoutEffect=function(e,t){return O.current.useLayoutEffect(e,t)},Ea.useMemo=function(e,t){return O.current.useMemo(e,t)},Ea.useReducer=function(e,t,n){return O.current.useReducer(e,t,n)},Ea.useRef=function(e){return O.current.useRef(e)},Ea.useState=function(e){return O.current.useState(e)},Ea.useSyncExternalStore=function(e,t,n){return O.current.useSyncExternalStore(e,t,n)},Ea.useTransition=function(){return O.current.useTransition()},Ea.version="18.2.0",Ea}();var _a=wa.exports,xa=Pn(_a),ka=e({__proto__:null,default:xa},[_a]);function Ca(e){return"init"in e}function Sa(e){return!!e.write}function Ta(e){return"v"in e||"e"in e}function Da(e){if("e"in e)throw e.e;if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v}const Aa=new WeakMap;function Oa(e){var t;return Ia(e)&&!!(null==(t=Aa.get(e))?void 0:t[0])}function Pa(e,t){let n=Aa.get(e);if(!n){n=[!0,new Set],Aa.set(e,n);const t=()=>{n[0]=!1};e.then(t,t)}n[1].add(t)}function Ia(e){return"function"==typeof(null==e?void 0:e.then)}function Na(e,t,n){if(!n.p.has(e)){n.p.add(e);const r=()=>n.p.delete(e);t.then(r,r)}}function Ra(e,t,n){var r;const o=new Set;for(const t of(null==(r=n.get(e))?void 0:r.t)||[])o.add(t);for(const e of t.p)o.add(e);return o}const Ba=(e,t,...n)=>t.read(...n),Fa=(e,t,...n)=>t.write(...n),La=(e,t)=>{var n;return null==(n=t.INTERNAL_onInit)?void 0:n.call(t,e)},Ma=(e,t,n)=>{var r;return null==(r=t.onMount)?void 0:r.call(t,n)},Ua=(e,t)=>{var n;const r=es(e),o=r[0],i=r[6],a=r[9];if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!t)throw new Error("Atom is undefined or null");let s=o.get(t);return s||(s={d:new Map,p:new Set,n:0},o.set(t,s),null==(n=i.i)||n.call(i,t),null==a||a(e,t)),s},ja=e=>{const t=es(e),n=t[1],r=t[3],o=t[4],i=t[5],a=t[6],s=t[13],l=[],u=e=>{try{e()}catch(e){l.push(e)}};do{a.f&&u(a.f);const t=new Set,l=t.add.bind(t);r.forEach(e=>{var t;return null==(t=n.get(e))?void 0:t.l.forEach(l)}),r.clear(),i.forEach(l),i.clear(),o.forEach(l),o.clear(),t.forEach(u),r.size&&s(e)}while(r.size||i.size||o.size);if(l.length)throw new AggregateError(l)},$a=e=>{const t=es(e),n=t[1],r=t[2],o=t[3],i=t[11],a=t[14],s=t[17],l=[],u=new WeakSet,c=new WeakSet,d=Array.from(o);for(;d.length;){const t=d[d.length-1],o=i(e,t);if(c.has(t))d.pop();else if(u.has(t)){if(r.get(t)===o.n)l.push([t,o]);else if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&r.has(t))throw new Error("[Bug] invalidated atom exists");c.add(t),d.pop()}else{u.add(t);for(const e of Ra(t,o,n))u.has(e)||d.push(e)}}for(let t=l.length-1;t>=0;--t){const[n,i]=l[t];let u=!1;for(const e of i.d.keys())if(e!==n&&o.has(e)){u=!0;break}u&&(a(e,n),s(e,n)),r.delete(n)}},za=new WeakSet,Ha=(e,t)=>{var n,r;const o=es(e),i=o[1],a=o[2],s=o[3],l=o[6],u=o[7],c=o[11],d=o[12],p=o[13],f=o[14],h=o[16],g=o[17],m=o[20],v=c(e,t);if(Ta(v)){if(i.has(t)&&a.get(t)!==v.n)return v;let n=!1;for(const[t,r]of v.d)if(f(e,t).n!==r){n=!0;break}if(!n)return v}v.d.clear();let y,b,w=!0;function E(){i.has(t)&&(g(e,t),p(e),d(e))}const _={get signal(){return y||(y=new AbortController),y.signal},get setSelf(){return"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),"production"===(import.meta.env?import.meta.env.MODE:void 0)||Sa(t)||console.warn("setSelf function cannot be used with read-only atom"),!b&&Sa(t)&&(b=(...n)=>{if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&w&&console.warn("setSelf function cannot be called in sync"),!w)try{return h(e,t,...n)}finally{p(e),d(e)}}),b}},x=v.n;try{"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&za.delete(e);const r=u(e,t,function(n){var r;if(n===t){const t=c(e,n);if(!Ta(t)){if(!Ca(n))throw new Error("no atom init");m(e,n,n.init)}return Da(t)}const o=f(e,n);try{return Da(o)}finally{v.d.set(n,o.n),Oa(v.v)&&Na(t,v.v,o),i.has(t)&&(null==(r=i.get(n))||r.t.add(t)),w||E()}},_);return"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&za.has(e)&&console.warn("Detected store mutation during atom read. This is not supported."),m(e,t,r),Ia(r)&&(Pa(r,()=>null==y?void 0:y.abort()),r.then(E,E)),null==(n=l.r)||n.call(l,t),v}catch(e){return delete v.v,v.e=e,++v.n,v}finally{w=!1,x!==v.n&&a.get(t)===x&&(a.set(t,v.n),s.add(t),null==(r=l.c)||r.call(l,t))}},Va=(e,t)=>{const n=es(e),r=n[1],o=n[2],i=n[11],a=[t];for(;a.length;){const t=a.pop(),n=i(e,t);for(const s of Ra(t,n,r)){const t=i(e,s);o.set(s,t.n),a.push(s)}}},Wa=(e,t,...n)=>{const r=es(e),o=r[3],i=r[6],a=r[8],s=r[11],l=r[12],u=r[13],c=r[14],d=r[15],p=r[16],f=r[17],h=r[20];let g=!0;const m=t=>Da(c(e,t)),v=(n,...r)=>{var a;const c=s(e,n);try{if(n===t){if(!Ca(n))throw new Error("atom not writable");"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&za.add(e);const t=c.n,s=r[0];return h(e,n,s),f(e,n),void(t!==c.n&&(o.add(n),d(e,n),null==(a=i.c)||a.call(i,n)))}return p(e,n,...r)}finally{g||(u(e),l(e))}};try{return a(e,t,m,v,...n)}finally{g=!1}},qa=(e,t)=>{var n;const r=es(e),o=r[1],i=r[3],a=r[6],s=r[11],l=r[15],u=r[18],c=r[19],d=s(e,t),p=o.get(t);if(p&&!Oa(d.v)){for(const[r,o]of d.d)if(!p.d.has(r)){const c=s(e,r);u(e,r).t.add(t),p.d.add(r),o!==c.n&&(i.add(r),l(e,r),null==(n=a.c)||n.call(a,r))}for(const n of p.d)if(!d.d.has(n)){p.d.delete(n);const r=c(e,n);null==r||r.t.delete(t)}}},Ga=(e,t)=>{var n;const r=es(e),o=r[1],i=r[4],a=r[6],s=r[10],l=r[11],u=r[12],c=r[13],d=r[14],p=r[16],f=r[18],h=l(e,t);let g=o.get(t);if(!g){d(e,t);for(const n of h.d.keys()){f(e,n).t.add(t)}if(g={l:new Set,d:new Set(h.d.keys()),t:new Set},o.set(t,g),Sa(t)){const n=()=>{let n=!0;const r=(...r)=>{try{return p(e,t,...r)}finally{n||(c(e),u(e))}};try{const o=s(e,t,r);o&&(g.u=()=>{n=!0;try{o()}finally{n=!1}})}finally{n=!1}};i.add(n)}null==(n=a.m)||n.call(a,t)}return g},Ka=(e,t)=>{var n,r;const o=es(e),i=o[1],a=o[5],s=o[6],l=o[11],u=o[19],c=l(e,t);let d=i.get(t);if(!d||d.l.size)return d;let p=!1;for(const e of d.t)if(null==(n=i.get(e))?void 0:n.d.has(t)){p=!0;break}if(p)return d;d.u&&a.add(d.u),d=void 0,i.delete(t);for(const n of c.d.keys()){const r=u(e,n);null==r||r.t.delete(t)}null==(r=s.u)||r.call(s,t)},Ya=(e,t,n)=>{const r=es(e)[11],o=r(e,t),i="v"in o,a=o.v;if(Ia(n))for(const i of o.d.keys())Na(t,n,r(e,i));o.v=n,delete o.e,i&&Object.is(a,o.v)||(++o.n,Ia(a)&&function(e){const t=Aa.get(e);(null==t?void 0:t[0])&&(t[0]=!1,t[1].forEach(e=>e()))}(a))},Za=(e,t)=>Da((0,es(e)[14])(e,t)),Xa=(e,t,...n)=>{const r=es(e),o=r[12],i=r[13],a=r[16];try{return a(e,t,...n)}finally{i(e),o(e)}},Qa=(e,t,n)=>{const r=es(e),o=r[12],i=r[18],a=r[19],s=i(e,t).l;return s.add(n),o(e),()=>{s.delete(n),a(e,t),o(e)}},Ja=new WeakMap,es=e=>{const t=Ja.get(e);if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!t)throw new Error("Store must be created by buildStore to read its building blocks");return t};let ts,ns=0;function rs(e,t){const n="atom"+ ++ns,r={toString(){return"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&this.debugLabel?n+":"+this.debugLabel:n}};return"function"==typeof e?r.read=e:(r.init=e,r.read=os,r.write=is),t&&(r.write=t),r}function os(e){return e(this)}function is(e,t,n){return t(this,"function"==typeof n?n(e(this)):n)}function as(){return function(...e){const t={get:e=>(0,es(t)[21])(t,e),set:(e,...n)=>(0,es(t)[22])(t,e,...n),sub:(e,n)=>(0,es(t)[23])(t,e,n)},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},Ba,Fa,La,Ma,Ua,ja,$a,Ha,Va,Wa,qa,Ga,Ka,Ya,Za,Xa,Qa,void 0].map((t,n)=>e[n]||t);return Ja.set(t,Object.freeze(n)),t}()}const ss=_a.createContext(void 0);function ls(e){const t=_a.useContext(ss);return(null==e?void 0:e.store)||t||(ts||(ts=as(),"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=ts),globalThis.__JOTAI_DEFAULT_STORE__!==ts&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),ts)}const us=e=>"function"==typeof(null==e?void 0:e.then),cs=e=>{e.status||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}))},ds=xa.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;throw"rejected"===e.status?e.reason:(cs(e),e)}),ps=new WeakMap,fs=(e,t)=>{let n=ps.get(e);return n||(n=new Promise((r,o)=>{let i=e;const a=e=>t=>{i===e&&r(t)},s=e=>t=>{i===e&&o(t)},l=()=>{try{const e=t();us(e)?(ps.set(e,n),i=e,e.then(a(e),s(e)),Pa(e,l)):r(e)}catch(e){o(e)}};e.then(a(e),s(e)),Pa(e,l)}),ps.set(e,n)),n};function hs(e,t){const{delay:n,unstable_promiseStatus:r=!xa.use}=t||{},o=ls(t),[[i,a,s],l]=_a.useReducer(t=>{const n=o.get(e);return Object.is(t[0],n)&&t[1]===o&&t[2]===e?t:[n,o,e]},void 0,()=>[o.get(e),o,e]);let u=i;if(a===o&&s===e||(l(),u=o.get(e)),_a.useEffect(()=>{const t=o.sub(e,()=>{if(r)try{const t=o.get(e);us(t)&&cs(fs(t,()=>o.get(e)))}catch(e){}"number"!=typeof n?l():setTimeout(l,n)});return l(),t},[o,e,n,r]),_a.useDebugValue(u),us(u)){const t=fs(u,()=>o.get(e));return r&&cs(t),ds(t)}return u}function gs(e,t){const n=ls(t);return _a.useCallback((...t)=>{if("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&!("write"in e))throw new Error("not writable atom");return n.set(e,...t)},[n,e])}import.meta.env&&import.meta.env.MODE;!function(e=()=>{try{return window.localStorage}catch(e){return void("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&"undefined"!=typeof window&&console.warn(e))}},t){var n;let r,o;const i={getItem:(n,i)=>{var a,s;const l=e=>{if(r!==(e=e||"")){try{o=JSON.parse(e,null==t?void 0:t.reviver)}catch(e){return i}r=e}return o},u=null!=(s=null==(a=e())?void 0:a.getItem(n))?s:null;return"function"==typeof(null==(c=u)?void 0:c.then)?u.then(l):l(u);var c},setItem:(t,n)=>{var r;return null==(r=e())?void 0:r.setItem(t,JSON.stringify(n,void 0))},removeItem:t=>{var n;return null==(n=e())?void 0:n.removeItem(t)}};let a;try{a=null==(n=e())?void 0:n.subscribe}catch(e){}var s;!a&&"undefined"!=typeof window&&"function"==typeof window.addEventListener&&window.Storage&&(a=(t,n)=>{if(!(e()instanceof window.Storage))return()=>{};const r=r=>{r.storageArea===e()&&r.key===t&&n(r.newValue)};return window.addEventListener("storage",r),()=>{window.removeEventListener("storage",r)}}),a&&(i.subscribe=(s=a,(e,t,n)=>s(e,e=>{let r;try{r=JSON.parse(e||"")}catch(e){r=n}t(r)})))}();const ms=new WeakMap;const vs=e=>{let t=ms.get(e);return t||(t=new WeakSet,ms.set(e,t)),t};var ys,bs=Object.defineProperty,ws=Object.defineProperties,Es=Object.getOwnPropertyDescriptors,_s=Object.getOwnPropertySymbols,xs=Object.prototype.hasOwnProperty,ks=Object.prototype.propertyIsEnumerable,Cs=(e,t,n)=>t in e?bs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ss=(e,t)=>{for(var n in t||(t={}))xs.call(t,n)&&Cs(e,n,t[n]);if(_s)for(var n of _s(t))ks.call(t,n)&&Cs(e,n,t[n]);return e},Ts=(e,t)=>ws(e,Es(t)),Ds=(e,t)=>{var n={};for(var r in e)xs.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&_s)for(var r of _s(e))t.indexOf(r)<0&&ks.call(e,r)&&(n[r]=e[r]);return n},As=e=>"function"==typeof e?{__fn:e}:e,Os=e=>{const t=rs(As(e));return rs(e=>{return(n=e(t))&&"object"==typeof n&&"__fn"in n?n.__fn:n;var n},(e,n,r)=>n(t,As(r)))},Ps=(e,t,n={})=>{const r=[];for(const n of Object.keys(e)){const o=t[n];void 0!==o&&r.push([e[n],o])}!function(e,t){const n=ls(t),r=vs(n);for(const[o,...i]of e)r.has(o)&&!(null==t?void 0:t.dangerouslyForceHydrate)||(r.add(o),n.set(o,...i))}(r,n)},Is=(e,t)=>`${e}:${t}`,Ns="provider",Rs=xa.createContext(new Map),Bs=e=>{var t=e,{initialValues:n,children:r,store:o,atoms:i}=t,a=Ds(t,["initialValues","children","store","atoms"]);return Ps(i,Ss(Ss({},n),a),{store:o}),((e,t,{store:n}={})=>{for(const r of Object.keys(e)){const o=t[r],i=gs(e[r],{store:n});xa.useEffect(()=>{null!=o&&i(o)},[i,o])}})(i,a,{store:o}),xa.createElement(xa.Fragment,null,r)},Fs=(e="")=>e.length>0?e[0].toUpperCase()+e.slice(1):"",Ls=e=>!!e&&"object"==typeof e&&"read"in e&&"function"==typeof e.read,Ms=(e,t)=>Object.fromEntries(Object.entries(e).map(([e,n])=>[e,(e={})=>n(Ss(Ss({},t),e))])),Us=(e={})=>"string"==typeof e?{scope:e}:e,js=(e,{name:t,delay:n,effect:r,extend:o})=>{const i=((e="")=>`${Fs(e)}Provider`)(t),a=((e="")=>`use${Fs(e)}Store`)(t),s=((e="")=>e.length>0?`${e}Store`:"store")(t),l={},u={},c={};for(const[t,n]of Object.entries(e)){const e=Ls(n)?n:Os(n);l[t]=e;const r="write"in e;c[t]=r,r&&(u[t]=e)}const d=Ss({},l);if(o){const e=o(l);for(const[t,n]of Object.entries(e))d[t]=n,c[t]="write"in n}const p={},f={},h={},g=(e={})=>{const{scope:n,store:r,warnIfNoStore:o=!0}=Us(e),i=((e,t=Ns,n=!0)=>{var r;const o=xa.useContext(Rs),i=null!=(r=o.get(Is(e,t)))?r:o.get(Is(e,Ns));return!i&&n&&console.warn(`Tried to access jotai store '${e}' outside of a matching provider.`),i})(t,n,!r&&o);return null!=r?r:i},m=(e,t)=>{var r;const o=Us(t);return hs(e,{store:g(Ss({warnIfNoStore:!1},o)),delay:null!=(r=o.delay)?r:n})},v=(e,t)=>gs(e,{store:g(t)}),y=(e,t)=>{const r=g(t),{delay:o=n}=Us(t);return function(e,t){return[hs(e,t),gs(e,t)]}(e,{store:r,delay:o})};for(const e of Object.keys(d)){const t=d[e],n=c[e];p[e]=(e={})=>m(t,e),n&&(f[e]=(e={})=>v(t,e),h[e]=(e={})=>y(t,e))}const b=((e,t,n={})=>{const r=n.effect;return n=>{var o=n,{store:i,scope:a,children:s,resetKey:l}=o,u=Ds(o,["store","scope","children","resetKey"]);const[c,d]=xa.useState(as());xa.useEffect(()=>{l&&d(as())},[l]);const p=xa.useContext(Rs),f=xa.useMemo(()=>{const t=new Map(p);return a&&t.set(Is(e,a),c),t.set(Is(e,Ns),c),t},[p,a,c]);return xa.createElement(Rs.Provider,{value:f},xa.createElement(Bs,Ss({store:c,atoms:t},u),!!r&&xa.createElement(r,null),s))}})(t,u,{effect:r}),w={atom:d,name:t};return{[i]:b,[a]:(e={})=>({get:Ts(Ss({},Ms(p,Us(e))),{atom:(t,n)=>m(t,Ss(Ss({},Us(e)),Us(n)))}),set:Ts(Ss({},Ms(f,Us(e))),{atom:(t,n)=>v(t,Ss(Ss({},Us(e)),Us(n)))}),use:Ts(Ss({},Ms(h,Us(e))),{atom:(t,n)=>y(t,Ss(Ss({},Us(e)),Us(n)))}),store:t=>g(Ss(Ss({},Us(e)),Us(t)))}),[s]:w,name:t}},$s={exports:{}},zs={};$s.exports=function(){if(ys)return zs;ys=1;var e=_a,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function a(e,n,a){var s,l={},u=null,c=null;for(s in void 0!==a&&(u=""+a),void 0!==n.key&&(u=""+n.key),void 0!==n.ref&&(c=n.ref),n)r.call(n,s)&&!i.hasOwnProperty(s)&&(l[s]=n[s]);if(e&&e.defaultProps)for(s in n=e.defaultProps)void 0===l[s]&&(l[s]=n[s]);return{$$typeof:t,type:e,key:u,ref:c,props:l,_owner:o.current}}return zs.Fragment=n,zs.jsx=a,zs.jsxs=a,zs}();var Hs=$s.exports;function Vs(){return Vs=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},Vs.apply(null,arguments)}var Ws=["shift","alt","meta","mod","ctrl"],qs={esc:"escape",return:"enter",".":"period",",":"comma","-":"slash"," ":"space","`":"backquote","#":"backslash","+":"bracketright",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function Gs(e){return(e&&qs[e]||e||"").trim().toLowerCase().replace(/key|digit|numpad|arrow/,"")}function Ks(e,t){return void 0===t&&(t=","),e.split(t)}function Ys(e,t,n){void 0===t&&(t="+");var r=e.toLocaleLowerCase().split(t).map(function(e){return Gs(e)});return Vs({},{alt:r.includes("alt"),ctrl:r.includes("ctrl")||r.includes("control"),shift:r.includes("shift"),meta:r.includes("meta"),mod:r.includes("mod")},{keys:r.filter(function(e){return!Ws.includes(e)}),description:n,hotkey:e})}"undefined"!=typeof document&&(document.addEventListener("keydown",function(e){void 0!==e.key&&Qs([Gs(e.key),Gs(e.code)])}),document.addEventListener("keyup",function(e){void 0!==e.key&&Js([Gs(e.key),Gs(e.code)])})),"undefined"!=typeof window&&window.addEventListener("blur",function(){Zs.clear()});var Zs=new Set;function Xs(e){return Array.isArray(e)}function Qs(e){var t=Array.isArray(e)?e:[e];Zs.has("meta")&&Zs.forEach(function(e){return!function(e){return Ws.includes(e)}(e)&&Zs.delete(e.toLowerCase())}),t.forEach(function(e){return Zs.add(e.toLowerCase())})}function Js(e){var t=Array.isArray(e)?e:[e];"meta"===e?Zs.clear():t.forEach(function(e){return Zs.delete(e.toLowerCase())})}function el(e,t){void 0===t&&(t=!1);var n=e.target,r=e.composed,o=null;return o=function(e){return!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-")}(n)&&r?e.composedPath()[0]&&e.composedPath()[0].tagName:n&&n.tagName,Xs(t)?Boolean(o&&t&&t.some(function(e){var t;return e.toLowerCase()===(null==(t=o)?void 0:t.toLowerCase())})):Boolean(o&&t&&t)}var tl=function(e,t,n){void 0===n&&(n=!1);var r,o,i=t.alt,a=t.meta,s=t.mod,l=t.shift,u=t.ctrl,c=t.keys,d=e.key,p=e.code,f=e.ctrlKey,h=e.metaKey,g=e.shiftKey,m=e.altKey,v=Gs(p),y=d.toLowerCase();if(!(null!=c&&c.includes(v)||null!=c&&c.includes(y)||["ctrl","control","unknown","meta","alt","shift","os"].includes(v)))return!1;if(!n){if(i===!m&&"alt"!==y)return!1;if(l===!g&&"shift"!==y)return!1;if(s){if(!h&&!f)return!1}else{if(a===!h&&"meta"!==y&&"os"!==y)return!1;if(u===!f&&"ctrl"!==y&&"control"!==y)return!1}}return!(!c||1!==c.length||!c.includes(y)&&!c.includes(v))||(c?(void 0===o&&(o=","),(Xs(r=c)?r:r.split(o)).every(function(e){return Zs.has(e.trim().toLowerCase())})):!c)},nl=_a.createContext(void 0);function rl(e,t){return e&&t&&"object"==typeof e&&"object"==typeof t?Object.keys(e).length===Object.keys(t).length&&Object.keys(e).reduce(function(n,r){return n&&rl(e[r],t[r])},!0):e===t}var ol=_a.createContext({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}});function il(e){var t=_a.useRef(void 0);return rl(t.current,e)||(t.current=e),t.current}var al=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},sl="undefined"!=typeof window?_a.useLayoutEffect:_a.useEffect;function ll(e,t,n,r){var o=_a.useState(null),i=o[0],a=o[1],s=_a.useRef(!1),l=n instanceof Array?r instanceof Array?void 0:r:n,u=Xs(e)?e.join(null==l?void 0:l.splitKey):e,c=n instanceof Array?n:r instanceof Array?r:void 0,d=_a.useCallback(t,null!=c?c:[]),p=_a.useRef(d);p.current=c?d:t;var f=il(l),h=_a.useContext(ol).enabledScopes,g=_a.useContext(nl);return sl(function(){if(!1!==(null==f?void 0:f.enabled)&&(e=h,t=null==f?void 0:f.scopes,0===e.length&&t?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),1):!t||e.some(function(e){return t.includes(e)})||e.includes("*"))){var e,t,n=function(e,t){var n;if(void 0===t&&(t=!1),!el(e,["input","textarea","select"])||el(e,null==f?void 0:f.enableOnFormTags)){if(null!==i){var r=i.getRootNode();if((r instanceof Document||r instanceof ShadowRoot)&&r.activeElement!==i&&!i.contains(r.activeElement))return void al(e)}(null==(n=e.target)||!n.isContentEditable||null!=f&&f.enableOnContentEditable)&&Ks(u,null==f?void 0:f.splitKey).forEach(function(n){var r,o=Ys(n,null==f?void 0:f.combinationKey);if(tl(e,o,null==f?void 0:f.ignoreModifiers)||null!=(r=o.keys)&&r.includes("*")){if(null!=f&&null!=f.ignoreEventWhen&&f.ignoreEventWhen(e))return;if(t&&s.current)return;if(function(e,t,n){("function"==typeof n&&n(e,t)||!0===n)&&e.preventDefault()}(e,o,null==f?void 0:f.preventDefault),!function(e,t,n){return"function"==typeof n?n(e,t):!0===n||void 0===n}(e,o,null==f?void 0:f.enabled))return void al(e);p.current(e,o),t||(s.current=!0)}})}},r=function(e){void 0!==e.key&&(Qs(Gs(e.code)),(void 0===(null==f?void 0:f.keydown)&&!0!==(null==f?void 0:f.keyup)||null!=f&&f.keydown)&&n(e))},o=function(e){void 0!==e.key&&(Js(Gs(e.code)),s.current=!1,null!=f&&f.keyup&&n(e,!0))},a=i||(null==l?void 0:l.document)||document;return a.addEventListener("keyup",o,null==l?void 0:l.eventListenerOptions),a.addEventListener("keydown",r,null==l?void 0:l.eventListenerOptions),g&&Ks(u,null==f?void 0:f.splitKey).forEach(function(e){return g.addHotkey(Ys(e,null==f?void 0:f.combinationKey,null==f?void 0:f.description))}),function(){a.removeEventListener("keyup",o,null==l?void 0:l.eventListenerOptions),a.removeEventListener("keydown",r,null==l?void 0:l.eventListenerOptions),g&&Ks(u,null==f?void 0:f.splitKey).forEach(function(e){return g.removeHotkey(Ys(e,null==f?void 0:f.combinationKey,null==f?void 0:f.description))})}}},[i,u,f,h]),a}var ul=Symbol.for("immer-nothing"),cl=Symbol.for("immer-draftable"),dl=Symbol.for("immer-state");function pl(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var fl=Object.getPrototypeOf;function hl(e){return!!e&&!!e[dl]}function gl(e){return!!e&&(yl(e)||Array.isArray(e)||!!e[cl]||!!e.constructor?.[cl]||xl(e)||kl(e))}var ml=Object.prototype.constructor.toString(),vl=new WeakMap;function yl(e){if(!e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);if(null===t||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if("function"!=typeof n)return!1;let r=vl.get(n);return void 0===r&&(r=Function.toString.call(n),vl.set(n,r)),r===ml}function bl(e,t,n=!0){if(0===wl(e)){(n?Reflect.ownKeys(e):Object.keys(e)).forEach(n=>{t(n,e[n],e)})}else e.forEach((n,r)=>t(r,n,e))}function wl(e){const t=e[dl];return t?t.type_:Array.isArray(e)?1:xl(e)?2:kl(e)?3:0}function El(e,t){return 2===wl(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function _l(e,t,n){const r=wl(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function xl(e){return e instanceof Map}function kl(e){return e instanceof Set}function Cl(e){return e.copy_||e.base_}function Sl(e,t){if(xl(e))return new Map(e);if(kl(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=yl(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[dl];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const o=n[r],i=t[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(fl(e),t)}{const t=fl(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function Tl(e,t=!1){return Al(e)||hl(e)||!gl(e)||(wl(e)>1&&Object.defineProperties(e,{set:Dl,add:Dl,clear:Dl,delete:Dl}),Object.freeze(e),t&&Object.values(e).forEach(e=>Tl(e,!0))),e}var Dl={value:function(){pl(2)}};function Al(e){return null===e||"object"!=typeof e||Object.isFrozen(e)}var Ol,Pl={};function Il(e){const t=Pl[e];return t||pl(0),t}function Nl(){return Ol}function Rl(e,t){t&&(Il("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Bl(e){Fl(e),e.drafts_.forEach(Ml),e.drafts_=null}function Fl(e){e===Ol&&(Ol=e.parent_)}function Ll(e){return Ol={drafts_:[],parent_:Ol,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Ml(e){const t=e[dl];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Ul(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[dl].modified_&&(Bl(t),pl(4)),gl(e)&&(e=jl(t,e),t.parent_||zl(t,e)),t.patches_&&Il("Patches").generateReplacementPatches_(n[dl].base_,e,t.patches_,t.inversePatches_)):e=jl(t,n,[]),Bl(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ul?e:void 0}function jl(e,t,n){if(Al(t))return t;const r=e.immer_.shouldUseStrictIteration(),o=t[dl];if(!o)return bl(t,(r,i)=>$l(e,o,t,r,i,n),r),t;if(o.scope_!==e)return t;if(!o.modified_)return zl(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const t=o.copy_;let i=t,a=!1;3===o.type_&&(i=new Set(t),t.clear(),a=!0),bl(i,(r,i)=>$l(e,o,t,r,i,n,a),r),zl(e,t,!1),n&&e.patches_&&Il("Patches").generatePatches_(o,n,e.patches_,e.inversePatches_)}return o.copy_}function $l(e,t,n,r,o,i,a){if(null==o)return;if("object"!=typeof o&&!a)return;const s=Al(o);if(!s||a){if(hl(o)){const a=jl(e,o,i&&t&&3!==t.type_&&!El(t.assigned_,r)?i.concat(r):void 0);if(_l(n,r,a),!hl(a))return;e.canAutoFreeze_=!1}else a&&n.add(o);if(gl(o)&&!s){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;if(t&&t.base_&&t.base_[r]===o&&s)return;jl(e,o),t&&t.scope_.parent_||"symbol"==typeof r||!(xl(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))||zl(e,o)}}}function zl(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Tl(t,n)}var Hl={get(e,t){if(t===dl)return e;const n=Cl(e);if(!El(n,t))return function(e,t,n){const r=ql(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!gl(r)?r:r===Wl(e.base_,t)?(Kl(e),e.copy_[t]=Yl(r,e)):r},has:(e,t)=>t in Cl(e),ownKeys:e=>Reflect.ownKeys(Cl(e)),set(e,t,n){const r=ql(Cl(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=Wl(Cl(e),t),a=r?.[dl];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((o=n)===(i=r)?0!==o||1/o==1/i:o!=o&&i!=i)&&(void 0!==n||El(e.base_,t)))return!0;Kl(e),Gl(e)}var o,i;return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:(e,t)=>(void 0!==Wl(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Kl(e),Gl(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=Cl(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){pl(11)},getPrototypeOf:e=>fl(e.base_),setPrototypeOf(){pl(12)}},Vl={};function Wl(e,t){const n=e[dl];return(n?Cl(n):e)[t]}function ql(e,t){if(!(t in e))return;let n=fl(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=fl(n)}}function Gl(e){e.modified_||(e.modified_=!0,e.parent_&&Gl(e.parent_))}function Kl(e){e.copy_||(e.copy_=Sl(e.base_,e.scope_.immer_.useStrictShallowCopy_))}bl(Hl,(e,t)=>{Vl[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Vl.deleteProperty=function(e,t){return Vl.set.call(this,e,t,void 0)},Vl.set=function(e,t,n){return Hl.set.call(this,e[0],t,n,e[0])};function Yl(e,t){const n=xl(e)?Il("MapSet").proxyMap_(e,t):kl(e)?Il("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Nl(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=Hl;n&&(o=[r],i=Vl);const{revoke:a,proxy:s}=Proxy.revocable(o,i);return r.draft_=s,r.revoke_=a,s}(e,t);return(t?t.scope_:Nl()).drafts_.push(n),n}function Zl(e){if(!gl(e)||Al(e))return e;const t=e[dl];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Sl(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Sl(e,!0);return bl(n,(e,t)=>{_l(n,e,Zl(t))},r),t&&(t.finalized_=!1),n}function Xl(){class e extends Map{constructor(e,t){super(),this[dl]={type_:2,parent_:t,scope_:t?t.scope_:Nl(),modified_:!1,finalized_:!1,copy_:void 0,assigned_:void 0,base_:e,draft_:this,isManual_:!1,revoked_:!1}}get size(){return Cl(this[dl]).size}has(e){return Cl(this[dl]).has(e)}set(e,n){const r=this[dl];return o(r),Cl(r).has(e)&&Cl(r).get(e)===n||(t(r),Gl(r),r.assigned_.set(e,!0),r.copy_.set(e,n),r.assigned_.set(e,!0)),this}delete(e){if(!this.has(e))return!1;const n=this[dl];return o(n),t(n),Gl(n),n.base_.has(e)?n.assigned_.set(e,!1):n.assigned_.delete(e),n.copy_.delete(e),!0}clear(){const e=this[dl];o(e),Cl(e).size&&(t(e),Gl(e),e.assigned_=new Map,bl(e.base_,t=>{e.assigned_.set(t,!1)}),e.copy_.clear())}forEach(e,t){Cl(this[dl]).forEach((n,r,o)=>{e.call(t,this.get(r),r,this)})}get(e){const n=this[dl];o(n);const r=Cl(n).get(e);if(n.finalized_||!gl(r))return r;if(r!==n.base_.get(e))return r;const i=Yl(r,n);return t(n),n.copy_.set(e,i),i}keys(){return Cl(this[dl]).keys()}values(){const e=this.keys();return{[Symbol.iterator]:()=>this.values(),next:()=>{const t=e.next();if(t.done)return t;return{done:!1,value:this.get(t.value)}}}}entries(){const e=this.keys();return{[Symbol.iterator]:()=>this.entries(),next:()=>{const t=e.next();if(t.done)return t;const n=this.get(t.value);return{done:!1,value:[t.value,n]}}}}[Symbol.iterator](){return this.entries()}}function t(e){e.copy_||(e.assigned_=new Map,e.copy_=new Map(e.base_))}class n extends Set{constructor(e,t){super(),this[dl]={type_:3,parent_:t,scope_:t?t.scope_:Nl(),modified_:!1,finalized_:!1,copy_:void 0,base_:e,draft_:this,drafts_:new Map,revoked_:!1,isManual_:!1}}get size(){return Cl(this[dl]).size}has(e){const t=this[dl];return o(t),t.copy_?!!t.copy_.has(e)||!(!t.drafts_.has(e)||!t.copy_.has(t.drafts_.get(e))):t.base_.has(e)}add(e){const t=this[dl];return o(t),this.has(e)||(r(t),Gl(t),t.copy_.add(e)),this}delete(e){if(!this.has(e))return!1;const t=this[dl];return o(t),r(t),Gl(t),t.copy_.delete(e)||!!t.drafts_.has(e)&&t.copy_.delete(t.drafts_.get(e))}clear(){const e=this[dl];o(e),Cl(e).size&&(r(e),Gl(e),e.copy_.clear())}values(){const e=this[dl];return o(e),r(e),e.copy_.values()}entries(){const e=this[dl];return o(e),r(e),e.copy_.entries()}keys(){return this.values()}[Symbol.iterator](){return this.values()}forEach(e,t){const n=this.values();let r=n.next();for(;!r.done;)e.call(t,r.value,r.value,this),r=n.next()}}function r(e){e.copy_||(e.copy_=new Set,e.base_.forEach(t=>{if(gl(t)){const n=Yl(t,e);e.drafts_.set(t,n),e.copy_.add(n)}else e.copy_.add(t)}))}function o(e){e.revoked_&&pl(3,JSON.stringify(Cl(e)))}var i,a;a={proxyMap_:function(t,n){return new e(t,n)},proxySet_:function(e,t){return new n(e,t)}},Pl[i="MapSet"]||(Pl[i]=a)}var Ql,Jl,eu=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const r=this;return function(e=n,...o){return r.produce(e,e=>t.call(this,e,...o))}}let r;if("function"!=typeof t&&pl(6),void 0!==n&&"function"!=typeof n&&pl(7),gl(e)){const o=Ll(this),i=Yl(e,void 0);let a=!0;try{r=t(i),a=!1}finally{a?Bl(o):Fl(o)}return Rl(o,n),Ul(r,o)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===ul&&(r=void 0),this.autoFreeze_&&Tl(r,!0),n){const t=[],o=[];Il("Patches").generateReplacementPatches_(e,r,t,o),n(t,o)}return r}pl(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,t=>e(t,...n));let n,r;return[this.produce(e,t,(e,t)=>{n=e,r=t}),n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),"boolean"==typeof e?.useStrictIteration&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){gl(e)||pl(8),hl(e)&&(e=function(e){hl(e)||pl(10);return Zl(e)}(e));const t=Ll(this),n=Yl(e,void 0);return n[dl].isManual_=!0,Fl(t),n}finishDraft(e,t){const n=e&&e[dl];n&&n.isManual_||pl(9);const{scope_:r}=n;return Rl(r,t),Ul(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=Il("Patches").applyPatches_;return hl(e)?r(e,t):this.produce(e,e=>r(e,t))}},tu=eu.produce,nu=eu.setAutoFreeze.bind(eu),ru={exports:{}},ou={};function iu(){return Jl||(Jl=1,ru.exports=(Ql||(Ql=1,function(e){function t(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,i=e[r];if(!(0<o(i,t)))break e;e[r]=t,e[n]=i,n=r}}function n(e){return 0===e.length?null:e[0]}function r(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length,a=i>>>1;r<a;){var s=2*(r+1)-1,l=e[s],u=s+1,c=e[u];if(0>o(l,n))u<i&&0>o(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[s]=n,r=s);else{if(!(u<i&&0>o(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function o(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if("object"==typeof performance&&"function"==typeof performance.now){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,d=null,p=3,f=!1,h=!1,g=!1,m="function"==typeof setTimeout?setTimeout:null,v="function"==typeof clearTimeout?clearTimeout:null,y="undefined"!=typeof setImmediate?setImmediate:null;function b(e){for(var o=n(u);null!==o;){if(null===o.callback)r(u);else{if(!(o.startTime<=e))break;r(u),o.sortIndex=o.expirationTime,t(l,o)}o=n(u)}}function w(e){if(g=!1,b(e),!h)if(null!==n(l))h=!0,I(E);else{var t=n(u);null!==t&&N(w,t.startTime-e)}}function E(t,o){h=!1,g&&(g=!1,v(C),C=-1),f=!0;var i=p;try{for(b(o),d=n(l);null!==d&&(!(d.expirationTime>o)||t&&!D());){var a=d.callback;if("function"==typeof a){d.callback=null,p=d.priorityLevel;var s=a(d.expirationTime<=o);o=e.unstable_now(),"function"==typeof s?d.callback=s:d===n(l)&&r(l),b(o)}else r(l);d=n(l)}if(null!==d)var c=!0;else{var m=n(u);null!==m&&N(w,m.startTime-o),c=!1}return c}finally{d=null,p=i,f=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var _,x=!1,k=null,C=-1,S=5,T=-1;function D(){return!(e.unstable_now()-T<S)}function A(){if(null!==k){var t=e.unstable_now();T=t;var n=!0;try{n=k(!0,t)}finally{n?_():(x=!1,k=null)}}else x=!1}if("function"==typeof y)_=function(){y(A)};else if("undefined"!=typeof MessageChannel){var O=new MessageChannel,P=O.port2;O.port1.onmessage=A,_=function(){P.postMessage(null)}}else _=function(){m(A,0)};function I(e){k=e,x||(x=!0,_())}function N(t,n){C=m(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){h||f||(h=!0,I(E))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):S=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},e.unstable_scheduleCallback=function(r,o,i){var a=e.unstable_now();switch(i="object"==typeof i&&null!==i&&"number"==typeof(i=i.delay)&&0<i?a+i:a,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return r={id:c++,callback:o,priorityLevel:r,startTime:i,expirationTime:s=i+s,sortIndex:-1},i>a?(r.sortIndex=i,t(u,r),null===n(l)&&r===n(u)&&(g?(v(C),C=-1):g=!0,N(w,i-a))):(r.sortIndex=s,t(l,r),h||f||(h=!0,I(E))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}}(ou)),ou)),ru.exports}var au,su={exports:{}},lu={};!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),su.exports=function(){if(au)return lu;au=1;var e=_a,t=iu();function n(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,o={};function i(e,t){a(e,t),a(e+"Capture",t)}function a(e,t){for(o[e]=t,e=0;e<t.length;e++)r.add(t[e])}var s=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),l=Object.prototype.hasOwnProperty,u=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,c={},d={};function p(e,t,n,r,o,i,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var f={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){f[e]=new p(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];f[t]=new p(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){f[e]=new p(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){f[e]=new p(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){f[e]=new p(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){f[e]=new p(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){f[e]=new p(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){f[e]=new p(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){f[e]=new p(e,5,!1,e.toLowerCase(),null,!1,!1)});var h=/[\-:]([a-z])/g;function g(e){return e[1].toUpperCase()}function m(e,t,n,r){var o=f.hasOwnProperty(t)?f[t]:null;(null!==o?0!==o.type:r||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,n,r){if(null==t||function(e,t,n,r){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!r&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!l.call(d,e)||!l.call(c,e)&&(u.test(e)?d[e]=!0:(c[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(h,g);f[t]=new p(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(h,g);f[t]=new p(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(h,g);f[t]=new p(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){f[e]=new p(e,1,!1,e.toLowerCase(),null,!1,!1)}),f.xlinkHref=new p("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){f[e]=new p(e,1,!1,e.toLowerCase(),null,!0,!0)});var v=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,y=Symbol.for("react.element"),b=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),k=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),S=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),P=Symbol.iterator;function I(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=P&&e[P]||e["@@iterator"])?e:null}var N,R=Object.assign;function B(e){if(void 0===N)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);N=t&&t[1]||""}return"\n"+N+e}var F=!1;function L(e,t){if(!e||F)return"";F=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var o=t.stack.split("\n"),i=r.stack.split("\n"),a=o.length-1,s=i.length-1;1<=a&&0<=s&&o[a]!==i[s];)s--;for(;1<=a&&0<=s;a--,s--)if(o[a]!==i[s]){if(1!==a||1!==s)do{if(a--,0>--s||o[a]!==i[s]){var l="\n"+o[a].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}}while(1<=a&&0<=s);break}}}finally{F=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?B(e):""}function M(e){switch(e.tag){case 5:return B(e.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 2:case 15:return L(e.type,!1);case 11:return L(e.type.render,!1);case 1:return L(e.type,!0);default:return""}}function U(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case w:return"Fragment";case b:return"Portal";case _:return"Profiler";case E:return"StrictMode";case S:return"Suspense";case T:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case k:return(e.displayName||"Context")+".Consumer";case x:return(e._context.displayName||"Context")+".Provider";case C:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case D:return null!==(t=e.displayName||null)?t:U(e.type)||"Memo";case A:t=e._payload,e=e._init;try{return U(e(t))}catch(e){}}return null}function j(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return U(t);case 8:return t===E?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof t)return t.displayName||t.name||null;if("string"==typeof t)return t}return null}function $(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function z(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function H(e){e._valueTracker||(e._valueTracker=function(e){var t=z(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){r=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function V(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=z(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function W(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function q(e,t){var n=t.checked;return R({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function G(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=$(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function K(e,t){null!=(t=t.checked)&&m(e,"checked",t,!1)}function Y(e,t){K(e,t);var n=$(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?X(e,t.type,n):t.hasOwnProperty("defaultValue")&&X(e,t.type,$(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Z(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function X(e,t,n){"number"===t&&W(e.ownerDocument)===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Q=Array.isArray;function J(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+$(n),t=null,o=0;o<e.length;o++){if(e[o].value===n)return e[o].selected=!0,void(r&&(e[o].defaultSelected=!0));null!==t||e[o].disabled||(t=e[o])}null!==t&&(t.selected=!0)}}function ee(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(n(91));return R({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function te(e,t){var r=t.value;if(null==r){if(r=t.children,t=t.defaultValue,null!=r){if(null!=t)throw Error(n(92));if(Q(r)){if(1<r.length)throw Error(n(93));r=r[0]}t=r}null==t&&(t=""),r=t}e._wrapperState={initialValue:$(r)}}function ne(e,t){var n=$(t.value),r=$(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function re(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function oe(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ie(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?oe(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ae,se,le=(se=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ae=ae||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ae.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return se(e,t)})}:se);function ue(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var ce={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},de=["Webkit","ms","Moz","O"];function pe(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||ce.hasOwnProperty(e)&&ce[e]?(""+t).trim():t+"px"}function fe(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=pe(n,t[n],r);"float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(ce).forEach(function(e){de.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ce[t]=ce[e]})});var he=R({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ge(e,t){if(t){if(he[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(n(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(n(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(n(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(n(62))}}function me(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ve=null;function ye(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var be=null,we=null,Ee=null;function _e(e){if(e=ho(e)){if("function"!=typeof be)throw Error(n(280));var t=e.stateNode;t&&(t=mo(t),be(e.stateNode,e.type,t))}}function xe(e){we?Ee?Ee.push(e):Ee=[e]:we=e}function ke(){if(we){var e=we,t=Ee;if(Ee=we=null,_e(e),t)for(e=0;e<t.length;e++)_e(t[e])}}function Ce(e,t){return e(t)}function Se(){}var Te=!1;function De(e,t,n){if(Te)return e(t,n);Te=!0;try{return Ce(e,t,n)}finally{Te=!1,(null!==we||null!==Ee)&&(Se(),ke())}}function Ae(e,t){var r=e.stateNode;if(null===r)return null;var o=mo(r);if(null===o)return null;r=o[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(o=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!o;break e;default:e=!1}if(e)return null;if(r&&"function"!=typeof r)throw Error(n(231,t,typeof r));return r}var Oe=!1;if(s)try{var Pe={};Object.defineProperty(Pe,"passive",{get:function(){Oe=!0}}),window.addEventListener("test",Pe,Pe),window.removeEventListener("test",Pe,Pe)}catch(se){Oe=!1}function Ie(e,t,n,r,o,i,a,s,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(e){this.onError(e)}}var Ne=!1,Re=null,Be=!1,Fe=null,Le={onError:function(e){Ne=!0,Re=e}};function Me(e,t,n,r,o,i,a,s,l){Ne=!1,Re=null,Ie.apply(Le,arguments)}function Ue(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{!!(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function je(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&null!==(e=e.alternate)&&(t=e.memoizedState),null!==t)return t.dehydrated}return null}function $e(e){if(Ue(e)!==e)throw Error(n(188))}function ze(e){return e=function(e){var t=e.alternate;if(!t){if(null===(t=Ue(e)))throw Error(n(188));return t!==e?null:e}for(var r=e,o=t;;){var i=r.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(o=i.return)){r=o;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===r)return $e(i),e;if(a===o)return $e(i),t;a=a.sibling}throw Error(n(188))}if(r.return!==o.return)r=i,o=a;else{for(var s=!1,l=i.child;l;){if(l===r){s=!0,r=i,o=a;break}if(l===o){s=!0,o=i,r=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===r){s=!0,r=a,o=i;break}if(l===o){s=!0,o=a,r=i;break}l=l.sibling}if(!s)throw Error(n(189))}}if(r.alternate!==o)throw Error(n(190))}if(3!==r.tag)throw Error(n(188));return r.stateNode.current===r?e:t}(e),null!==e?He(e):null}function He(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=He(e);if(null!==t)return t;e=e.sibling}return null}var Ve=t.unstable_scheduleCallback,We=t.unstable_cancelCallback,qe=t.unstable_shouldYield,Ge=t.unstable_requestPaint,Ke=t.unstable_now,Ye=t.unstable_getCurrentPriorityLevel,Ze=t.unstable_ImmediatePriority,Xe=t.unstable_UserBlockingPriority,Qe=t.unstable_NormalPriority,Je=t.unstable_LowPriority,et=t.unstable_IdlePriority,tt=null,nt=null,rt=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(ot(e)/it|0)|0},ot=Math.log,it=Math.LN2,at=64,st=4194304;function lt(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ut(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=268435455&n;if(0!==a){var s=a&~o;0!==s?r=lt(s):0!==(i&=a)&&(r=lt(i))}else 0!==(a=n&~o)?r=lt(a):0!==i&&(r=lt(i));if(0===r)return 0;if(0!==t&&t!==r&&0===(t&o)&&((o=r&-r)>=(i=t&-t)||16===o&&4194240&i))return t;if(4&r&&(r|=16&n),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=r;0<t;)o=1<<(n=31-rt(t)),r|=e[n],t&=~o;return r}function ct(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function dt(e){return 0!=(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function pt(){var e=at;return!(4194240&(at<<=1))&&(at=64),e}function ft(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ht(e,t,n){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-rt(t)]=n}function gt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-rt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var mt=0;function vt(e){return 1<(e&=-e)?4<e?268435455&e?16:536870912:4:1}var yt,bt,wt,Et,_t,xt=!1,kt=[],Ct=null,St=null,Tt=null,Dt=new Map,At=new Map,Ot=[],Pt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function It(e,t){switch(e){case"focusin":case"focusout":Ct=null;break;case"dragenter":case"dragleave":St=null;break;case"mouseover":case"mouseout":Tt=null;break;case"pointerover":case"pointerout":Dt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":At.delete(t.pointerId)}}function Nt(e,t,n,r,o,i){return null===e||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},null!==t&&null!==(t=ho(t))&&bt(t),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==o&&-1===t.indexOf(o)&&t.push(o),e)}function Rt(e){var t=fo(e.target);if(null!==t){var n=Ue(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=je(n)))return e.blockedOn=t,void _t(e.priority,function(){wt(n)})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Bt(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=qt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==n)return null!==(t=ho(n))&&bt(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);ve=r,n.target.dispatchEvent(r),ve=null,t.shift()}return!0}function Ft(e,t,n){Bt(e)&&n.delete(t)}function Lt(){xt=!1,null!==Ct&&Bt(Ct)&&(Ct=null),null!==St&&Bt(St)&&(St=null),null!==Tt&&Bt(Tt)&&(Tt=null),Dt.forEach(Ft),At.forEach(Ft)}function Mt(e,n){e.blockedOn===n&&(e.blockedOn=null,xt||(xt=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Lt)))}function Ut(e){function t(t){return Mt(t,e)}if(0<kt.length){Mt(kt[0],e);for(var n=1;n<kt.length;n++){var r=kt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(null!==Ct&&Mt(Ct,e),null!==St&&Mt(St,e),null!==Tt&&Mt(Tt,e),Dt.forEach(t),At.forEach(t),n=0;n<Ot.length;n++)(r=Ot[n]).blockedOn===e&&(r.blockedOn=null);for(;0<Ot.length&&null===(n=Ot[0]).blockedOn;)Rt(n),null===n.blockedOn&&Ot.shift()}var jt=v.ReactCurrentBatchConfig,$t=!0;function zt(e,t,n,r){var o=mt,i=jt.transition;jt.transition=null;try{mt=1,Vt(e,t,n,r)}finally{mt=o,jt.transition=i}}function Ht(e,t,n,r){var o=mt,i=jt.transition;jt.transition=null;try{mt=4,Vt(e,t,n,r)}finally{mt=o,jt.transition=i}}function Vt(e,t,n,r){if($t){var o=qt(e,t,n,r);if(null===o)Mr(e,t,r,Wt,n),It(e,r);else if(function(e,t,n,r,o){switch(t){case"focusin":return Ct=Nt(Ct,e,t,n,r,o),!0;case"dragenter":return St=Nt(St,e,t,n,r,o),!0;case"mouseover":return Tt=Nt(Tt,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Dt.set(i,Nt(Dt.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,At.set(i,Nt(At.get(i)||null,e,t,n,r,o)),!0}return!1}(o,e,t,n,r))r.stopPropagation();else if(It(e,r),4&t&&-1<Pt.indexOf(e)){for(;null!==o;){var i=ho(o);if(null!==i&&yt(i),null===(i=qt(e,t,n,r))&&Mr(e,t,r,Wt,n),i===o)break;o=i}null!==o&&r.stopPropagation()}else Mr(e,t,r,null,n)}}var Wt=null;function qt(e,t,n,r){if(Wt=null,null!==(e=fo(e=ye(r))))if(null===(t=Ue(e)))e=null;else if(13===(n=t.tag)){if(null!==(e=je(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Wt=e,null}function Gt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Ye()){case Ze:return 1;case Xe:return 4;case Qe:case Je:return 16;case et:return 536870912;default:return 16}default:return 16}}var Kt=null,Yt=null,Zt=null;function Xt(){if(Zt)return Zt;var e,t,n=Yt,r=n.length,o="value"in Kt?Kt.value:Kt.textContent,i=o.length;for(e=0;e<r&&n[e]===o[e];e++);var a=r-e;for(t=1;t<=a&&n[r-t]===o[i-t];t++);return Zt=o.slice(e,1<t?1-t:void 0)}function Qt(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Jt(){return!0}function en(){return!1}function tn(e){function t(t,n,r,o,i){for(var a in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=o,this.target=i,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(o):o[a]);return this.isDefaultPrevented=(null!=o.defaultPrevented?o.defaultPrevented:!1===o.returnValue)?Jt:en,this.isPropagationStopped=en,this}return R(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Jt)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Jt)},persist:function(){},isPersistent:Jt}),t}var nn,rn,on,an={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sn=tn(an),ln=R({},an,{view:0,detail:0}),un=tn(ln),cn=R({},ln,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:En,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==on&&(on&&"mousemove"===e.type?(nn=e.screenX-on.screenX,rn=e.screenY-on.screenY):rn=nn=0,on=e),nn)},movementY:function(e){return"movementY"in e?e.movementY:rn}}),dn=tn(cn),pn=tn(R({},cn,{dataTransfer:0})),fn=tn(R({},ln,{relatedTarget:0})),hn=tn(R({},an,{animationName:0,elapsedTime:0,pseudoElement:0})),gn=tn(R({},an,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),mn=tn(R({},an,{data:0})),vn={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},bn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=bn[e])&&!!t[e]}function En(){return wn}var _n=tn(R({},ln,{key:function(e){if(e.key){var t=vn[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Qt(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?yn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:En,charCode:function(e){return"keypress"===e.type?Qt(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Qt(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),xn=tn(R({},cn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),kn=tn(R({},ln,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:En})),Cn=tn(R({},an,{propertyName:0,elapsedTime:0,pseudoElement:0})),Sn=tn(R({},cn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Tn=[9,13,27,32],Dn=s&&"CompositionEvent"in window,An=null;s&&"documentMode"in document&&(An=document.documentMode);var On=s&&"TextEvent"in window&&!An,Pn=s&&(!Dn||An&&8<An&&11>=An),In=String.fromCharCode(32),Nn=!1;function Rn(e,t){switch(e){case"keyup":return-1!==Tn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bn(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Fn=!1,Ln={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Mn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Ln[e.type]:"textarea"===t}function Un(e,t,n,r){xe(r),0<(t=jr(t,"onChange")).length&&(n=new sn("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var jn=null,$n=null;function zn(e){Ir(e,0)}function Hn(e){if(V(go(e)))return e}function Vn(e,t){if("change"===e)return t}var Wn=!1;if(s){var qn;if(s){var Gn="oninput"in document;if(!Gn){var Kn=document.createElement("div");Kn.setAttribute("oninput","return;"),Gn="function"==typeof Kn.oninput}qn=Gn}else qn=!1;Wn=qn&&(!document.documentMode||9<document.documentMode)}function Yn(){jn&&(jn.detachEvent("onpropertychange",Zn),$n=jn=null)}function Zn(e){if("value"===e.propertyName&&Hn($n)){var t=[];Un(t,$n,e,ye(e)),De(zn,t)}}function Xn(e,t,n){"focusin"===e?(Yn(),$n=n,(jn=t).attachEvent("onpropertychange",Zn)):"focusout"===e&&Yn()}function Qn(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Hn($n)}function Jn(e,t){if("click"===e)return Hn(t)}function er(e,t){if("input"===e||"change"===e)return Hn(t)}var tr="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t};function nr(e,t){if(tr(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!l.call(t,o)||!tr(e[o],t[o]))return!1}return!0}function rr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function or(e,t){var n,r=rr(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=rr(r)}}function ir(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?ir(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function ar(){for(var e=window,t=W();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=W((e=t.contentWindow).document)}return t}function sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function lr(e){var t=ar(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ir(n.ownerDocument.documentElement,n)){if(null!==r&&sr(n))if(t=r.start,void 0===(e=r.end)&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if((e=(t=n.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=void 0===r.end?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=or(n,i);var a=or(n,r);o&&a&&(1!==e.rangeCount||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&((t=t.createRange()).setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;n<t.length;n++)(e=t[n]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var ur=s&&"documentMode"in document&&11>=document.documentMode,cr=null,dr=null,pr=null,fr=!1;function hr(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;fr||null==cr||cr!==W(r)||(r="selectionStart"in(r=cr)&&sr(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},pr&&nr(pr,r)||(pr=r,0<(r=jr(dr,"onSelect")).length&&(t=new sn("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=cr)))}function gr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var mr={animationend:gr("Animation","AnimationEnd"),animationiteration:gr("Animation","AnimationIteration"),animationstart:gr("Animation","AnimationStart"),transitionend:gr("Transition","TransitionEnd")},vr={},yr={};function br(e){if(vr[e])return vr[e];if(!mr[e])return e;var t,n=mr[e];for(t in n)if(n.hasOwnProperty(t)&&t in yr)return vr[e]=n[t];return e}s&&(yr=document.createElement("div").style,"AnimationEvent"in window||(delete mr.animationend.animation,delete mr.animationiteration.animation,delete mr.animationstart.animation),"TransitionEvent"in window||delete mr.transitionend.transition);var wr=br("animationend"),Er=br("animationiteration"),_r=br("animationstart"),xr=br("transitionend"),kr=new Map,Cr="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Sr(e,t){kr.set(e,t),i(t,[e])}for(var Tr=0;Tr<Cr.length;Tr++){var Dr=Cr[Tr];Sr(Dr.toLowerCase(),"on"+(Dr[0].toUpperCase()+Dr.slice(1)))}Sr(wr,"onAnimationEnd"),Sr(Er,"onAnimationIteration"),Sr(_r,"onAnimationStart"),Sr("dblclick","onDoubleClick"),Sr("focusin","onFocus"),Sr("focusout","onBlur"),Sr(xr,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ar="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Or=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ar));function Pr(e,t,r){var o=e.type||"unknown-event";e.currentTarget=r,function(e,t,r,o,i,a,s,l,u){if(Me.apply(this,arguments),Ne){if(!Ne)throw Error(n(198));var c=Re;Ne=!1,Re=null,Be||(Be=!0,Fe=c)}}(o,t,void 0,e),e.currentTarget=null}function Ir(e,t){t=!!(4&t);for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var s=r[a],l=s.instance,u=s.currentTarget;if(s=s.listener,l!==i&&o.isPropagationStopped())break e;Pr(o,s,u),i=l}else for(a=0;a<r.length;a++){if(l=(s=r[a]).instance,u=s.currentTarget,s=s.listener,l!==i&&o.isPropagationStopped())break e;Pr(o,s,u),i=l}}}if(Be)throw e=Fe,Be=!1,Fe=null,e}function Nr(e,t){var n=t[uo];void 0===n&&(n=t[uo]=new Set);var r=e+"__bubble";n.has(r)||(Lr(t,e,2,!1),n.add(r))}function Rr(e,t,n){var r=0;t&&(r|=4),Lr(n,e,r,t)}var Br="_reactListening"+Math.random().toString(36).slice(2);function Fr(e){if(!e[Br]){e[Br]=!0,r.forEach(function(t){"selectionchange"!==t&&(Or.has(t)||Rr(t,!1,e),Rr(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Br]||(t[Br]=!0,Rr("selectionchange",!1,t))}}function Lr(e,t,n,r){switch(Gt(t)){case 1:var o=zt;break;case 4:o=Ht;break;default:o=Vt}n=o.bind(null,t,n,e),o=void 0,!Oe||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(o=!0),r?void 0!==o?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):void 0!==o?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Mr(e,t,n,r,o){var i=r;if(!(1&t||2&t||null===r))e:for(;;){if(null===r)return;var a=r.tag;if(3===a||4===a){var s=r.stateNode.containerInfo;if(s===o||8===s.nodeType&&s.parentNode===o)break;if(4===a)for(a=r.return;null!==a;){var l=a.tag;if((3===l||4===l)&&((l=a.stateNode.containerInfo)===o||8===l.nodeType&&l.parentNode===o))return;a=a.return}for(;null!==s;){if(null===(a=fo(s)))return;if(5===(l=a.tag)||6===l){r=i=a;continue e}s=s.parentNode}}r=r.return}De(function(){var r=i,o=ye(n),a=[];e:{var s=kr.get(e);if(void 0!==s){var l=sn,u=e;switch(e){case"keypress":if(0===Qt(n))break e;case"keydown":case"keyup":l=_n;break;case"focusin":u="focus",l=fn;break;case"focusout":u="blur",l=fn;break;case"beforeblur":case"afterblur":l=fn;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":l=dn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":l=pn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":l=kn;break;case wr:case Er:case _r:l=hn;break;case xr:l=Cn;break;case"scroll":l=un;break;case"wheel":l=Sn;break;case"copy":case"cut":case"paste":l=gn;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":l=xn}var c=!!(4&t),d=!c&&"scroll"===e,p=c?null!==s?s+"Capture":null:s;c=[];for(var f,h=r;null!==h;){var g=(f=h).stateNode;if(5===f.tag&&null!==g&&(f=g,null!==p&&null!=(g=Ae(h,p))&&c.push(Ur(h,g,f))),d)break;h=h.return}0<c.length&&(s=new l(s,u,null,n,o),a.push({event:s,listeners:c}))}}if(!(7&t)){if(l="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||n===ve||!(u=n.relatedTarget||n.fromElement)||!fo(u)&&!u[lo])&&(l||s)&&(s=o.window===o?o:(s=o.ownerDocument)?s.defaultView||s.parentWindow:window,l?(l=r,null!==(u=(u=n.relatedTarget||n.toElement)?fo(u):null)&&(u!==(d=Ue(u))||5!==u.tag&&6!==u.tag)&&(u=null)):(l=null,u=r),l!==u)){if(c=dn,g="onMouseLeave",p="onMouseEnter",h="mouse","pointerout"!==e&&"pointerover"!==e||(c=xn,g="onPointerLeave",p="onPointerEnter",h="pointer"),d=null==l?s:go(l),f=null==u?s:go(u),(s=new c(g,h+"leave",l,n,o)).target=d,s.relatedTarget=f,g=null,fo(o)===r&&((c=new c(p,h+"enter",u,n,o)).target=f,c.relatedTarget=d,g=c),d=g,l&&u)e:{for(p=u,h=0,f=c=l;f;f=$r(f))h++;for(f=0,g=p;g;g=$r(g))f++;for(;0<h-f;)c=$r(c),h--;for(;0<f-h;)p=$r(p),f--;for(;h--;){if(c===p||null!==p&&c===p.alternate)break e;c=$r(c),p=$r(p)}c=null}else c=null;null!==l&&zr(a,s,l,c,!1),null!==u&&null!==d&&zr(a,d,u,c,!0)}if("select"===(l=(s=r?go(r):window).nodeName&&s.nodeName.toLowerCase())||"input"===l&&"file"===s.type)var m=Vn;else if(Mn(s))if(Wn)m=er;else{m=Qn;var v=Xn}else(l=s.nodeName)&&"input"===l.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(m=Jn);switch(m&&(m=m(e,r))?Un(a,m,n,o):(v&&v(e,s,r),"focusout"===e&&(v=s._wrapperState)&&v.controlled&&"number"===s.type&&X(s,"number",s.value)),v=r?go(r):window,e){case"focusin":(Mn(v)||"true"===v.contentEditable)&&(cr=v,dr=r,pr=null);break;case"focusout":pr=dr=cr=null;break;case"mousedown":fr=!0;break;case"contextmenu":case"mouseup":case"dragend":fr=!1,hr(a,n,o);break;case"selectionchange":if(ur)break;case"keydown":case"keyup":hr(a,n,o)}var y;if(Dn)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else Fn?Rn(e,n)&&(b="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(b="onCompositionStart");b&&(Pn&&"ko"!==n.locale&&(Fn||"onCompositionStart"!==b?"onCompositionEnd"===b&&Fn&&(y=Xt()):(Yt="value"in(Kt=o)?Kt.value:Kt.textContent,Fn=!0)),0<(v=jr(r,b)).length&&(b=new mn(b,e,null,n,o),a.push({event:b,listeners:v}),(y||null!==(y=Bn(n)))&&(b.data=y))),(y=On?function(e,t){switch(e){case"compositionend":return Bn(t);case"keypress":return 32!==t.which?null:(Nn=!0,In);case"textInput":return(e=t.data)===In&&Nn?null:e;default:return null}}(e,n):function(e,t){if(Fn)return"compositionend"===e||!Dn&&Rn(e,t)?(e=Xt(),Zt=Yt=Kt=null,Fn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Pn&&"ko"!==t.locale?null:t.data}}(e,n))&&0<(r=jr(r,"onBeforeInput")).length&&(o=new mn("onBeforeInput","beforeinput",null,n,o),a.push({event:o,listeners:r}),o.data=y)}Ir(a,t)})}function Ur(e,t,n){return{instance:e,listener:t,currentTarget:n}}function jr(e,t){for(var n=t+"Capture",r=[];null!==e;){var o=e,i=o.stateNode;5===o.tag&&null!==i&&(o=i,null!=(i=Ae(e,n))&&r.unshift(Ur(e,i,o)),null!=(i=Ae(e,t))&&r.push(Ur(e,i,o))),e=e.return}return r}function $r(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function zr(e,t,n,r,o){for(var i=t._reactName,a=[];null!==n&&n!==r;){var s=n,l=s.alternate,u=s.stateNode;if(null!==l&&l===r)break;5===s.tag&&null!==u&&(s=u,o?null!=(l=Ae(n,i))&&a.unshift(Ur(n,l,s)):o||null!=(l=Ae(n,i))&&a.push(Ur(n,l,s))),n=n.return}0!==a.length&&e.push({event:t,listeners:a})}var Hr=/\r\n?/g,Vr=/\u0000|\uFFFD/g;function Wr(e){return("string"==typeof e?e:""+e).replace(Hr,"\n").replace(Vr,"")}function qr(e,t,r){if(t=Wr(t),Wr(e)!==t&&r)throw Error(n(425))}function Gr(){}var Kr=null,Yr=null;function Zr(e,t){return"textarea"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Xr="function"==typeof setTimeout?setTimeout:void 0,Qr="function"==typeof clearTimeout?clearTimeout:void 0,Jr="function"==typeof Promise?Promise:void 0,eo="function"==typeof queueMicrotask?queueMicrotask:void 0!==Jr?function(e){return Jr.resolve(null).then(e).catch(to)}:Xr;function to(e){setTimeout(function(){throw e})}function no(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&8===o.nodeType)if("/$"===(n=o.data)){if(0===r)return e.removeChild(o),void Ut(t);r--}else"$"!==n&&"$?"!==n&&"$!"!==n||r++;n=o}while(n);Ut(t)}function ro(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function oo(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var io=Math.random().toString(36).slice(2),ao="__reactFiber$"+io,so="__reactProps$"+io,lo="__reactContainer$"+io,uo="__reactEvents$"+io,co="__reactListeners$"+io,po="__reactHandles$"+io;function fo(e){var t=e[ao];if(t)return t;for(var n=e.parentNode;n;){if(t=n[lo]||n[ao]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=oo(e);null!==e;){if(n=e[ao])return n;e=oo(e)}return t}n=(e=n).parentNode}return null}function ho(e){return!(e=e[ao]||e[lo])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function go(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(n(33))}function mo(e){return e[so]||null}var vo=[],yo=-1;function bo(e){return{current:e}}function wo(e){0>yo||(e.current=vo[yo],vo[yo]=null,yo--)}function Eo(e,t){yo++,vo[yo]=e.current,e.current=t}var _o={},xo=bo(_o),ko=bo(!1),Co=_o;function So(e,t){var n=e.type.contextTypes;if(!n)return _o;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o,i={};for(o in n)i[o]=t[o];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function To(e){return null!=e.childContextTypes}function Do(){wo(ko),wo(xo)}function Ao(e,t,r){if(xo.current!==_o)throw Error(n(168));Eo(xo,t),Eo(ko,r)}function Oo(e,t,r){var o=e.stateNode;if(t=t.childContextTypes,"function"!=typeof o.getChildContext)return r;for(var i in o=o.getChildContext())if(!(i in t))throw Error(n(108,j(e)||"Unknown",i));return R({},r,o)}function Po(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||_o,Co=xo.current,Eo(xo,e),Eo(ko,ko.current),!0}function Io(e,t,r){var o=e.stateNode;if(!o)throw Error(n(169));r?(e=Oo(e,t,Co),o.__reactInternalMemoizedMergedChildContext=e,wo(ko),wo(xo),Eo(xo,e)):wo(ko),Eo(ko,r)}var No=null,Ro=!1,Bo=!1;function Fo(e){null===No?No=[e]:No.push(e)}function Lo(){if(!Bo&&null!==No){Bo=!0;var e=0,t=mt;try{var n=No;for(mt=1;e<n.length;e++){var r=n[e];do{r=r(!0)}while(null!==r)}No=null,Ro=!1}catch(t){throw null!==No&&(No=No.slice(e+1)),Ve(Ze,Lo),t}finally{mt=t,Bo=!1}}return null}var Mo=[],Uo=0,jo=null,$o=0,zo=[],Ho=0,Vo=null,Wo=1,qo="";function Go(e,t){Mo[Uo++]=$o,Mo[Uo++]=jo,jo=e,$o=t}function Ko(e,t,n){zo[Ho++]=Wo,zo[Ho++]=qo,zo[Ho++]=Vo,Vo=e;var r=Wo;e=qo;var o=32-rt(r)-1;r&=~(1<<o),n+=1;var i=32-rt(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,Wo=1<<32-rt(t)+o|n<<o|r,qo=i+e}else Wo=1<<i|n<<o|r,qo=e}function Yo(e){null!==e.return&&(Go(e,1),Ko(e,1,0))}function Zo(e){for(;e===jo;)jo=Mo[--Uo],Mo[Uo]=null,$o=Mo[--Uo],Mo[Uo]=null;for(;e===Vo;)Vo=zo[--Ho],zo[Ho]=null,qo=zo[--Ho],zo[Ho]=null,Wo=zo[--Ho],zo[Ho]=null}var Xo=null,Qo=null,Jo=!1,ei=null;function ti(e,t){var n=Ou(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,null===(t=e.deletions)?(e.deletions=[n],e.flags|=16):t.push(n)}function ni(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,Xo=e,Qo=ro(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,Xo=e,Qo=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(n=null!==Vo?{id:Wo,overflow:qo}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},(n=Ou(18,null,null,0)).stateNode=t,n.return=e,e.child=n,Xo=e,Qo=null,!0);default:return!1}}function ri(e){return!(!(1&e.mode)||128&e.flags)}function oi(e){if(Jo){var t=Qo;if(t){var r=t;if(!ni(e,t)){if(ri(e))throw Error(n(418));t=ro(r.nextSibling);var o=Xo;t&&ni(e,t)?ti(o,r):(e.flags=-4097&e.flags|2,Jo=!1,Xo=e)}}else{if(ri(e))throw Error(n(418));e.flags=-4097&e.flags|2,Jo=!1,Xo=e}}}function ii(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;Xo=e}function ai(e){if(e!==Xo)return!1;if(!Jo)return ii(e),Jo=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!Zr(e.type,e.memoizedProps)),t&&(t=Qo)){if(ri(e))throw si(),Error(n(418));for(;t;)ti(e,t),t=ro(t.nextSibling)}if(ii(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(n(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var r=e.data;if("/$"===r){if(0===t){Qo=ro(e.nextSibling);break e}t--}else"$"!==r&&"$!"!==r&&"$?"!==r||t++}e=e.nextSibling}Qo=null}}else Qo=Xo?ro(e.stateNode.nextSibling):null;return!0}function si(){for(var e=Qo;e;)e=ro(e.nextSibling)}function li(){Qo=Xo=null,Jo=!1}function ui(e){null===ei?ei=[e]:ei.push(e)}var ci=v.ReactCurrentBatchConfig;function di(e,t){if(e&&e.defaultProps){for(var n in t=R({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}return t}var pi=bo(null),fi=null,hi=null,gi=null;function mi(){gi=hi=fi=null}function vi(e){var t=pi.current;wo(pi),e._currentValue=t}function yi(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function bi(e,t){fi=e,gi=hi=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(gs=!0),e.firstContext=null)}function wi(e){var t=e._currentValue;if(gi!==e)if(e={context:e,memoizedValue:t,next:null},null===hi){if(null===fi)throw Error(n(308));hi=e,fi.dependencies={lanes:0,firstContext:e}}else hi=hi.next=e;return t}var Ei=null;function _i(e){null===Ei?Ei=[e]:Ei.push(e)}function xi(e,t,n,r){var o=t.interleaved;return null===o?(n.next=n,_i(t)):(n.next=o.next,o.next=n),t.interleaved=n,ki(e,r)}function ki(e,t){e.lanes|=t;var n=e.alternate;for(null!==n&&(n.lanes|=t),n=e,e=e.return;null!==e;)e.childLanes|=t,null!==(n=e.alternate)&&(n.childLanes|=t),n=e,e=e.return;return 3===n.tag?n.stateNode:null}var Ci=!1;function Si(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ti(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Di(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ai(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,2&kl){var o=r.pending;return null===o?t.next=t:(t.next=o.next,o.next=t),r.pending=t,ki(e,n)}return null===(o=r.interleaved)?(t.next=t,_i(r)):(t.next=o.next,o.next=t),r.interleaved=t,ki(e,n)}function Oi(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,4194240&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,gt(e,n)}}function Pi(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var o=null,i=null;if(null!==(n=n.firstBaseUpdate)){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};null===i?o=i=a:i=i.next=a,n=n.next}while(null!==n);null===i?o=i=t:i=i.next=t}else o=i=t;return n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ii(e,t,n,r){var o=e.updateQueue;Ci=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,s=o.shared.pending;if(null!==s){o.shared.pending=null;var l=s,u=l.next;l.next=null,null===a?i=u:a.next=u,a=l;var c=e.alternate;null!==c&&(s=(c=c.updateQueue).lastBaseUpdate)!==a&&(null===s?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l)}if(null!==i){var d=o.baseState;for(a=0,c=u=l=null,s=i;;){var p=s.lane,f=s.eventTime;if((r&p)===p){null!==c&&(c=c.next={eventTime:f,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var h=e,g=s;switch(p=t,f=n,g.tag){case 1:if("function"==typeof(h=g.payload)){d=h.call(f,d,p);break e}d=h;break e;case 3:h.flags=-65537&h.flags|128;case 0:if(null==(p="function"==typeof(h=g.payload)?h.call(f,d,p):h))break e;d=R({},d,p);break e;case 2:Ci=!0}}null!==s.callback&&0!==s.lane&&(e.flags|=64,null===(p=o.effects)?o.effects=[s]:p.push(s))}else f={eventTime:f,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===c?(u=c=f,l=d):c=c.next=f,a|=p;if(null===(s=s.next)){if(null===(s=o.shared.pending))break;s=(p=s).next,p.next=null,o.lastBaseUpdate=p,o.shared.pending=null}}if(null===c&&(l=d),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=c,null!==(t=o.shared.interleaved)){o=t;do{a|=o.lane,o=o.next}while(o!==t)}else null===i&&(o.shared.lanes=0);Il|=a,e.lanes=a,e.memoizedState=d}}function Ni(e,t,r){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var o=e[t],i=o.callback;if(null!==i){if(o.callback=null,o=r,"function"!=typeof i)throw Error(n(191,i));i.call(o)}}}var Ri=(new e.Component).refs;function Bi(e,t,n,r){n=null==(n=n(r,t=e.memoizedState))?t:R({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var Fi={isMounted:function(e){return!!(e=e._reactInternals)&&Ue(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Zl(),o=Xl(e),i=Di(r,o);i.payload=t,null!=n&&(i.callback=n),null!==(t=Ai(e,i,o))&&(Ql(t,e,o,r),Oi(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Zl(),o=Xl(e),i=Di(r,o);i.tag=1,i.payload=t,null!=n&&(i.callback=n),null!==(t=Ai(e,i,o))&&(Ql(t,e,o,r),Oi(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Zl(),r=Xl(e),o=Di(n,r);o.tag=2,null!=t&&(o.callback=t),null!==(t=Ai(e,o,r))&&(Ql(t,e,r,n),Oi(t,e,r))}};function Li(e,t,n,r,o,i,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,i,a):!(t.prototype&&t.prototype.isPureReactComponent&&nr(n,r)&&nr(o,i))}function Mi(e,t,n){var r=!1,o=_o,i=t.contextType;return"object"==typeof i&&null!==i?i=wi(i):(o=To(t)?Co:xo.current,i=(r=null!=(r=t.contextTypes))?So(e,o):_o),t=new t(n,i),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=Fi,e.stateNode=t,t._reactInternals=e,r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function Ui(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Fi.enqueueReplaceState(t,t.state,null)}function ji(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=Ri,Si(e);var i=t.contextType;"object"==typeof i&&null!==i?o.context=wi(i):(i=To(t)?Co:xo.current,o.context=So(e,i)),o.state=e.memoizedState,"function"==typeof(i=t.getDerivedStateFromProps)&&(Bi(e,t,i,n),o.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(t=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),t!==o.state&&Fi.enqueueReplaceState(o,o.state,null),Ii(e,n,o,r),o.state=e.memoizedState),"function"==typeof o.componentDidMount&&(e.flags|=4194308)}function $i(e,t,r){if(null!==(e=r.ref)&&"function"!=typeof e&&"object"!=typeof e){if(r._owner){if(r=r._owner){if(1!==r.tag)throw Error(n(309));var o=r.stateNode}if(!o)throw Error(n(147,e));var i=o,a=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===a?t.ref:(t=function(e){var t=i.refs;t===Ri&&(t=i.refs={}),null===e?delete t[a]:t[a]=e},t._stringRef=a,t)}if("string"!=typeof e)throw Error(n(284));if(!r._owner)throw Error(n(290,e))}return e}function zi(e,t){throw e=Object.prototype.toString.call(t),Error(n(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Hi(e){return(0,e._init)(e._payload)}function Vi(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function r(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function o(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=Iu(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=2,n):r:(t.flags|=2,n):(t.flags|=1048576,n)}function s(t){return e&&null===t.alternate&&(t.flags|=2),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Fu(n,e.mode,r)).return=e,t):((t=i(t,n)).return=e,t)}function u(e,t,n,r){var o=n.type;return o===w?d(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===o||"object"==typeof o&&null!==o&&o.$$typeof===A&&Hi(o)===t.type)?((r=i(t,n.props)).ref=$i(e,t,n),r.return=e,r):((r=Nu(n.type,n.key,n.props,null,e.mode,r)).ref=$i(e,t,n),r.return=e,r)}function c(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Lu(n,e.mode,r)).return=e,t):((t=i(t,n.children||[])).return=e,t)}function d(e,t,n,r,o){return null===t||7!==t.tag?((t=Ru(n,e.mode,r,o)).return=e,t):((t=i(t,n)).return=e,t)}function p(e,t,n){if("string"==typeof t&&""!==t||"number"==typeof t)return(t=Fu(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case y:return(n=Nu(t.type,t.key,t.props,null,e.mode,n)).ref=$i(e,null,t),n.return=e,n;case b:return(t=Lu(t,e.mode,n)).return=e,t;case A:return p(e,(0,t._init)(t._payload),n)}if(Q(t)||I(t))return(t=Ru(t,e.mode,n,null)).return=e,t;zi(e,t)}return null}function f(e,t,n,r){var o=null!==t?t.key:null;if("string"==typeof n&&""!==n||"number"==typeof n)return null!==o?null:l(e,t,""+n,r);if("object"==typeof n&&null!==n){switch(n.$$typeof){case y:return n.key===o?u(e,t,n,r):null;case b:return n.key===o?c(e,t,n,r):null;case A:return f(e,t,(o=n._init)(n._payload),r)}if(Q(n)||I(n))return null!==o?null:d(e,t,n,r,null);zi(e,n)}return null}function h(e,t,n,r,o){if("string"==typeof r&&""!==r||"number"==typeof r)return l(t,e=e.get(n)||null,""+r,o);if("object"==typeof r&&null!==r){switch(r.$$typeof){case y:return u(t,e=e.get(null===r.key?n:r.key)||null,r,o);case b:return c(t,e=e.get(null===r.key?n:r.key)||null,r,o);case A:return h(e,t,n,(0,r._init)(r._payload),o)}if(Q(r)||I(r))return d(t,e=e.get(n)||null,r,o,null);zi(t,r)}return null}function g(n,i,s,l){for(var u=null,c=null,d=i,g=i=0,m=null;null!==d&&g<s.length;g++){d.index>g?(m=d,d=null):m=d.sibling;var v=f(n,d,s[g],l);if(null===v){null===d&&(d=m);break}e&&d&&null===v.alternate&&t(n,d),i=a(v,i,g),null===c?u=v:c.sibling=v,c=v,d=m}if(g===s.length)return r(n,d),Jo&&Go(n,g),u;if(null===d){for(;g<s.length;g++)null!==(d=p(n,s[g],l))&&(i=a(d,i,g),null===c?u=d:c.sibling=d,c=d);return Jo&&Go(n,g),u}for(d=o(n,d);g<s.length;g++)null!==(m=h(d,n,g,s[g],l))&&(e&&null!==m.alternate&&d.delete(null===m.key?g:m.key),i=a(m,i,g),null===c?u=m:c.sibling=m,c=m);return e&&d.forEach(function(e){return t(n,e)}),Jo&&Go(n,g),u}function m(i,s,l,u){var c=I(l);if("function"!=typeof c)throw Error(n(150));if(null==(l=c.call(l)))throw Error(n(151));for(var d=c=null,g=s,m=s=0,v=null,y=l.next();null!==g&&!y.done;m++,y=l.next()){g.index>m?(v=g,g=null):v=g.sibling;var b=f(i,g,y.value,u);if(null===b){null===g&&(g=v);break}e&&g&&null===b.alternate&&t(i,g),s=a(b,s,m),null===d?c=b:d.sibling=b,d=b,g=v}if(y.done)return r(i,g),Jo&&Go(i,m),c;if(null===g){for(;!y.done;m++,y=l.next())null!==(y=p(i,y.value,u))&&(s=a(y,s,m),null===d?c=y:d.sibling=y,d=y);return Jo&&Go(i,m),c}for(g=o(i,g);!y.done;m++,y=l.next())null!==(y=h(g,i,m,y.value,u))&&(e&&null!==y.alternate&&g.delete(null===y.key?m:y.key),s=a(y,s,m),null===d?c=y:d.sibling=y,d=y);return e&&g.forEach(function(e){return t(i,e)}),Jo&&Go(i,m),c}return function e(n,o,a,l){if("object"==typeof a&&null!==a&&a.type===w&&null===a.key&&(a=a.props.children),"object"==typeof a&&null!==a){switch(a.$$typeof){case y:e:{for(var u=a.key,c=o;null!==c;){if(c.key===u){if((u=a.type)===w){if(7===c.tag){r(n,c.sibling),(o=i(c,a.props.children)).return=n,n=o;break e}}else if(c.elementType===u||"object"==typeof u&&null!==u&&u.$$typeof===A&&Hi(u)===c.type){r(n,c.sibling),(o=i(c,a.props)).ref=$i(n,c,a),o.return=n,n=o;break e}r(n,c);break}t(n,c),c=c.sibling}a.type===w?((o=Ru(a.props.children,n.mode,l,a.key)).return=n,n=o):((l=Nu(a.type,a.key,a.props,null,n.mode,l)).ref=$i(n,o,a),l.return=n,n=l)}return s(n);case b:e:{for(c=a.key;null!==o;){if(o.key===c){if(4===o.tag&&o.stateNode.containerInfo===a.containerInfo&&o.stateNode.implementation===a.implementation){r(n,o.sibling),(o=i(o,a.children||[])).return=n,n=o;break e}r(n,o);break}t(n,o),o=o.sibling}(o=Lu(a,n.mode,l)).return=n,n=o}return s(n);case A:return e(n,o,(c=a._init)(a._payload),l)}if(Q(a))return g(n,o,a,l);if(I(a))return m(n,o,a,l);zi(n,a)}return"string"==typeof a&&""!==a||"number"==typeof a?(a=""+a,null!==o&&6===o.tag?(r(n,o.sibling),(o=i(o,a)).return=n,n=o):(r(n,o),(o=Fu(a,n.mode,l)).return=n,n=o),s(n)):r(n,o)}}var Wi=Vi(!0),qi=Vi(!1),Gi={},Ki=bo(Gi),Yi=bo(Gi),Zi=bo(Gi);function Xi(e){if(e===Gi)throw Error(n(174));return e}function Qi(e,t){switch(Eo(Zi,t),Eo(Yi,e),Eo(Ki,Gi),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ie(null,"");break;default:t=ie(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}wo(Ki),Eo(Ki,t)}function Ji(){wo(Ki),wo(Yi),wo(Zi)}function ea(e){Xi(Zi.current);var t=Xi(Ki.current),n=ie(t,e.type);t!==n&&(Eo(Yi,e),Eo(Ki,n))}function ta(e){Yi.current===e&&(wo(Ki),wo(Yi))}var na=bo(0);function ra(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(128&t.flags)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var oa=[];function ia(){for(var e=0;e<oa.length;e++)oa[e]._workInProgressVersionPrimary=null;oa.length=0}var aa=v.ReactCurrentDispatcher,sa=v.ReactCurrentBatchConfig,la=0,ua=null,ca=null,da=null,pa=!1,fa=!1,ha=0,ga=0;function ma(){throw Error(n(321))}function va(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!tr(e[n],t[n]))return!1;return!0}function ya(e,t,r,o,i,a){if(la=a,ua=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,aa.current=null===e||null===e.memoizedState?ns:rs,e=r(o,i),fa){a=0;do{if(fa=!1,ha=0,25<=a)throw Error(n(301));a+=1,da=ca=null,t.updateQueue=null,aa.current=os,e=r(o,i)}while(fa)}if(aa.current=ts,t=null!==ca&&null!==ca.next,la=0,da=ca=ua=null,pa=!1,t)throw Error(n(300));return e}function ba(){var e=0!==ha;return ha=0,e}function wa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===da?ua.memoizedState=da=e:da=da.next=e,da}function Ea(){if(null===ca){var e=ua.alternate;e=null!==e?e.memoizedState:null}else e=ca.next;var t=null===da?ua.memoizedState:da.next;if(null!==t)da=t,ca=e;else{if(null===e)throw Error(n(310));e={memoizedState:(ca=e).memoizedState,baseState:ca.baseState,baseQueue:ca.baseQueue,queue:ca.queue,next:null},null===da?ua.memoizedState=da=e:da=da.next=e}return da}function xa(e,t){return"function"==typeof t?t(e):t}function ka(e){var t=Ea(),r=t.queue;if(null===r)throw Error(n(311));r.lastRenderedReducer=e;var o=ca,i=o.baseQueue,a=r.pending;if(null!==a){if(null!==i){var s=i.next;i.next=a.next,a.next=s}o.baseQueue=i=a,r.pending=null}if(null!==i){a=i.next,o=o.baseState;var l=s=null,u=null,c=a;do{var d=c.lane;if((la&d)===d)null!==u&&(u=u.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),o=c.hasEagerState?c.eagerState:e(o,c.action);else{var p={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};null===u?(l=u=p,s=o):u=u.next=p,ua.lanes|=d,Il|=d}c=c.next}while(null!==c&&c!==a);null===u?s=o:u.next=l,tr(o,t.memoizedState)||(gs=!0),t.memoizedState=o,t.baseState=s,t.baseQueue=u,r.lastRenderedState=o}if(null!==(e=r.interleaved)){i=e;do{a=i.lane,ua.lanes|=a,Il|=a,i=i.next}while(i!==e)}else null===i&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Ca(e){var t=Ea(),r=t.queue;if(null===r)throw Error(n(311));r.lastRenderedReducer=e;var o=r.dispatch,i=r.pending,a=t.memoizedState;if(null!==i){r.pending=null;var s=i=i.next;do{a=e(a,s.action),s=s.next}while(s!==i);tr(a,t.memoizedState)||(gs=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),r.lastRenderedState=a}return[a,o]}function Sa(){}function Ta(e,t){var r=ua,o=Ea(),i=t(),a=!tr(o.memoizedState,i);if(a&&(o.memoizedState=i,gs=!0),o=o.queue,Ua(Oa.bind(null,r,o,e),[e]),o.getSnapshot!==t||a||null!==da&&1&da.memoizedState.tag){if(r.flags|=2048,Ra(9,Aa.bind(null,r,o,i,t),void 0,null),null===Cl)throw Error(n(349));30&la||Da(r,t,i)}return i}function Da(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=ua.updateQueue)?(t={lastEffect:null,stores:null},ua.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Aa(e,t,n,r){t.value=n,t.getSnapshot=r,Pa(t)&&Ia(e)}function Oa(e,t,n){return n(function(){Pa(t)&&Ia(e)})}function Pa(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!tr(e,n)}catch(e){return!0}}function Ia(e){var t=ki(e,1);null!==t&&Ql(t,e,1,-1)}function Na(e){var t=wa();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:e},t.queue=e,e=e.dispatch=Xa.bind(null,ua,e),[t.memoizedState,e]}function Ra(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===(t=ua.updateQueue)?(t={lastEffect:null,stores:null},ua.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ba(){return Ea().memoizedState}function Fa(e,t,n,r){var o=wa();ua.flags|=e,o.memoizedState=Ra(1|t,n,void 0,void 0===r?null:r)}function La(e,t,n,r){var o=Ea();r=void 0===r?null:r;var i=void 0;if(null!==ca){var a=ca.memoizedState;if(i=a.destroy,null!==r&&va(r,a.deps))return void(o.memoizedState=Ra(t,n,i,r))}ua.flags|=e,o.memoizedState=Ra(1|t,n,i,r)}function Ma(e,t){return Fa(8390656,8,e,t)}function Ua(e,t){return La(2048,8,e,t)}function ja(e,t){return La(4,2,e,t)}function $a(e,t){return La(4,4,e,t)}function za(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Ha(e,t,n){return n=null!=n?n.concat([e]):null,La(4,4,za.bind(null,t,e),n)}function Va(){}function Wa(e,t){var n=Ea();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&va(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function qa(e,t){var n=Ea();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&va(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Ga(e,t,n){return 21&la?(tr(n,t)||(n=pt(),ua.lanes|=n,Il|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,gs=!0),e.memoizedState=n)}function Ka(e,t){var n=mt;mt=0!==n&&4>n?n:4,e(!0);var r=sa.transition;sa.transition={};try{e(!1),t()}finally{mt=n,sa.transition=r}}function Ya(){return Ea().memoizedState}function Za(e,t,n){var r=Xl(e);n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Qa(e)?Ja(t,n):null!==(n=xi(e,t,n,r))&&(Ql(n,e,r,Zl()),es(n,t,r))}function Xa(e,t,n){var r=Xl(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Qa(e))Ja(t,o);else{var i=e.alternate;if(0===e.lanes&&(null===i||0===i.lanes)&&null!==(i=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,tr(s,a)){var l=t.interleaved;return null===l?(o.next=o,_i(t)):(o.next=l.next,l.next=o),void(t.interleaved=o)}}catch(e){}null!==(n=xi(e,t,o,r))&&(Ql(n,e,r,o=Zl()),es(n,t,r))}}function Qa(e){var t=e.alternate;return e===ua||null!==t&&t===ua}function Ja(e,t){fa=pa=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function es(e,t,n){if(4194240&n){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,gt(e,n)}}var ts={readContext:wi,useCallback:ma,useContext:ma,useEffect:ma,useImperativeHandle:ma,useInsertionEffect:ma,useLayoutEffect:ma,useMemo:ma,useReducer:ma,useRef:ma,useState:ma,useDebugValue:ma,useDeferredValue:ma,useTransition:ma,useMutableSource:ma,useSyncExternalStore:ma,useId:ma,unstable_isNewReconciler:!1},ns={readContext:wi,useCallback:function(e,t){return wa().memoizedState=[e,void 0===t?null:t],e},useContext:wi,useEffect:Ma,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Fa(4194308,4,za.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Fa(4194308,4,e,t)},useInsertionEffect:function(e,t){return Fa(4,2,e,t)},useMemo:function(e,t){var n=wa();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=wa();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Za.bind(null,ua,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},wa().memoizedState=e},useState:Na,useDebugValue:Va,useDeferredValue:function(e){return wa().memoizedState=e},useTransition:function(){var e=Na(!1),t=e[0];return e=Ka.bind(null,e[1]),wa().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var o=ua,i=wa();if(Jo){if(void 0===r)throw Error(n(407));r=r()}else{if(r=t(),null===Cl)throw Error(n(349));30&la||Da(o,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,Ma(Oa.bind(null,o,a,e),[e]),o.flags|=2048,Ra(9,Aa.bind(null,o,a,r,t),void 0,null),r},useId:function(){var e=wa(),t=Cl.identifierPrefix;if(Jo){var n=qo;t=":"+t+"R"+(n=(Wo&~(1<<32-rt(Wo)-1)).toString(32)+n),0<(n=ha++)&&(t+="H"+n.toString(32)),t+=":"}else t=":"+t+"r"+(n=ga++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},rs={readContext:wi,useCallback:Wa,useContext:wi,useEffect:Ua,useImperativeHandle:Ha,useInsertionEffect:ja,useLayoutEffect:$a,useMemo:qa,useReducer:ka,useRef:Ba,useState:function(){return ka(xa)},useDebugValue:Va,useDeferredValue:function(e){return Ga(Ea(),ca.memoizedState,e)},useTransition:function(){return[ka(xa)[0],Ea().memoizedState]},useMutableSource:Sa,useSyncExternalStore:Ta,useId:Ya,unstable_isNewReconciler:!1},os={readContext:wi,useCallback:Wa,useContext:wi,useEffect:Ua,useImperativeHandle:Ha,useInsertionEffect:ja,useLayoutEffect:$a,useMemo:qa,useReducer:Ca,useRef:Ba,useState:function(){return Ca(xa)},useDebugValue:Va,useDeferredValue:function(e){var t=Ea();return null===ca?t.memoizedState=e:Ga(t,ca.memoizedState,e)},useTransition:function(){return[Ca(xa)[0],Ea().memoizedState]},useMutableSource:Sa,useSyncExternalStore:Ta,useId:Ya,unstable_isNewReconciler:!1};function is(e,t){try{var n="",r=t;do{n+=M(r),r=r.return}while(r);var o=n}catch(e){o="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:t,stack:o,digest:null}}function as(e,t,n){return{value:e,source:null,stack:null!=n?n:null,digest:null!=t?t:null}}function ss(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var ls="function"==typeof WeakMap?WeakMap:Map;function us(e,t,n){(n=Di(-1,n)).tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){jl||(jl=!0,$l=r),ss(0,t)},n}function cs(e,t,n){(n=Di(-1,n)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){ss(0,t)}}var i=e.stateNode;return null!==i&&"function"==typeof i.componentDidCatch&&(n.callback=function(){ss(0,t),"function"!=typeof r&&(null===zl?zl=new Set([this]):zl.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),n}function ds(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new ls;var o=new Set;r.set(t,o)}else void 0===(o=r.get(t))&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=ku.bind(null,e,t,n),t.then(e,e))}function ps(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function fs(e,t,n,r,o){return 1&e.mode?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,1===n.tag&&(null===n.alternate?n.tag=17:((t=Di(-1,1)).tag=2,Ai(n,t,1))),n.lanes|=1),e)}var hs=v.ReactCurrentOwner,gs=!1;function ms(e,t,n,r){t.child=null===e?qi(t,null,n,r):Wi(t,e.child,n,r)}function vs(e,t,n,r,o){n=n.render;var i=t.ref;return bi(t,o),r=ya(e,t,n,r,i,o),n=ba(),null===e||gs?(Jo&&n&&Yo(t),t.flags|=1,ms(e,t,r,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,js(e,t,o))}function ys(e,t,n,r,o){if(null===e){var i=n.type;return"function"!=typeof i||Pu(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Nu(n.type,null,r,t,t.mode,o)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,bs(e,t,i,r,o))}if(i=e.child,0===(e.lanes&o)){var a=i.memoizedProps;if((n=null!==(n=n.compare)?n:nr)(a,r)&&e.ref===t.ref)return js(e,t,o)}return t.flags|=1,(e=Iu(i,r)).ref=t.ref,e.return=t,t.child=e}function bs(e,t,n,r,o){if(null!==e){var i=e.memoizedProps;if(nr(i,r)&&e.ref===t.ref){if(gs=!1,t.pendingProps=r=i,0===(e.lanes&o))return t.lanes=e.lanes,js(e,t,o);131072&e.flags&&(gs=!0)}}return _s(e,t,n,r,o)}function ws(e,t,n){var r=t.pendingProps,o=r.children,i=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(1&t.mode){if(!(1073741824&n))return e=null!==i?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Eo(Al,Dl),Dl|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==i?i.baseLanes:n,Eo(Al,Dl),Dl|=r}else t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Eo(Al,Dl),Dl|=n;else null!==i?(r=i.baseLanes|n,t.memoizedState=null):r=n,Eo(Al,Dl),Dl|=r;return ms(e,t,o,n),t.child}function Es(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function _s(e,t,n,r,o){var i=To(n)?Co:xo.current;return i=So(t,i),bi(t,o),n=ya(e,t,n,r,i,o),r=ba(),null===e||gs?(Jo&&r&&Yo(t),t.flags|=1,ms(e,t,n,o),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,js(e,t,o))}function xs(e,t,n,r,o){if(To(n)){var i=!0;Po(t)}else i=!1;if(bi(t,o),null===t.stateNode)Us(e,t),Mi(t,n,r),ji(t,n,r,o),r=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var l=a.context,u=n.contextType;u="object"==typeof u&&null!==u?wi(u):So(t,u=To(n)?Co:xo.current);var c=n.getDerivedStateFromProps,d="function"==typeof c||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==r||l!==u)&&Ui(t,a,r,u),Ci=!1;var p=t.memoizedState;a.state=p,Ii(t,r,a,o),l=t.memoizedState,s!==r||p!==l||ko.current||Ci?("function"==typeof c&&(Bi(t,n,c,r),l=t.memoizedState),(s=Ci||Li(t,n,s,r,p,l,u))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.flags|=4194308)):("function"==typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=u,r=s):("function"==typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ti(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:di(t.type,s),a.props=u,d=t.pendingProps,p=a.context,l="object"==typeof(l=n.contextType)&&null!==l?wi(l):So(t,l=To(n)?Co:xo.current);var f=n.getDerivedStateFromProps;(c="function"==typeof f||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(s!==d||p!==l)&&Ui(t,a,r,l),Ci=!1,p=t.memoizedState,a.state=p,Ii(t,r,a,o);var h=t.memoizedState;s!==d||p!==h||ko.current||Ci?("function"==typeof f&&(Bi(t,n,f,r),h=t.memoizedState),(u=Ci||Li(t,n,u,r,p,h,l)||!1)?(c||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(r,h,l),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,h,l)),"function"==typeof a.componentDidUpdate&&(t.flags|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),a.props=r,a.state=h,a.context=l,r=u):("function"!=typeof a.componentDidUpdate||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),"function"!=typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return ks(e,t,n,r,i,o)}function ks(e,t,n,r,o,i){Es(e,t);var a=!!(128&t.flags);if(!r&&!a)return o&&Io(t,n,!1),js(e,t,i);r=t.stateNode,hs.current=t;var s=a&&"function"!=typeof n.getDerivedStateFromError?null:r.render();return t.flags|=1,null!==e&&a?(t.child=Wi(t,e.child,null,i),t.child=Wi(t,null,s,i)):ms(e,t,s,i),t.memoizedState=r.state,o&&Io(t,n,!0),t.child}function Cs(e){var t=e.stateNode;t.pendingContext?Ao(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Ao(0,t.context,!1),Qi(e,t.containerInfo)}function Ss(e,t,n,r,o){return li(),ui(o),t.flags|=256,ms(e,t,n,r),t.child}var Ts,Ds,As,Os,Ps={dehydrated:null,treeContext:null,retryLane:0};function Is(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ns(e,t,r){var o,i=t.pendingProps,a=na.current,s=!1,l=!!(128&t.flags);if((o=l)||(o=(null===e||null!==e.memoizedState)&&!!(2&a)),o?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),Eo(na,1&a),null===e)return oi(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(1&t.mode?"$!"===e.data?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(l=i.children,e=i.fallback,s?(i=t.mode,s=t.child,l={mode:"hidden",children:l},1&i||null===s?s=Bu(l,i,0,null):(s.childLanes=0,s.pendingProps=l),e=Ru(e,i,r,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Is(r),t.memoizedState=Ps,e):Rs(t,l));if(null!==(a=e.memoizedState)&&null!==(o=a.dehydrated))return function(e,t,r,o,i,a,s){if(r)return 256&t.flags?(t.flags&=-257,Bs(e,t,s,o=as(Error(n(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(a=o.fallback,i=t.mode,o=Bu({mode:"visible",children:o.children},i,0,null),(a=Ru(a,i,s,null)).flags|=2,o.return=t,a.return=t,o.sibling=a,t.child=o,1&t.mode&&Wi(t,e.child,null,s),t.child.memoizedState=Is(s),t.memoizedState=Ps,a);if(!(1&t.mode))return Bs(e,t,s,null);if("$!"===i.data){if(o=i.nextSibling&&i.nextSibling.dataset)var l=o.dgst;return o=l,Bs(e,t,s,o=as(a=Error(n(419)),o,void 0))}if(l=0!==(s&e.childLanes),gs||l){if(null!==(o=Cl)){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}0!==(i=0!==(i&(o.suspendedLanes|s))?0:i)&&i!==a.retryLane&&(a.retryLane=i,ki(e,i),Ql(o,e,i,-1))}return hu(),Bs(e,t,s,o=as(Error(n(421))))}return"$?"===i.data?(t.flags|=128,t.child=e.child,t=Su.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,Qo=ro(i.nextSibling),Xo=t,Jo=!0,ei=null,null!==e&&(zo[Ho++]=Wo,zo[Ho++]=qo,zo[Ho++]=Vo,Wo=e.id,qo=e.overflow,Vo=t),(t=Rs(t,o.children)).flags|=4096,t)}(e,t,l,i,o,a,r);if(s){s=i.fallback,l=t.mode,o=(a=e.child).sibling;var u={mode:"hidden",children:i.children};return 1&l||t.child===a?(i=Iu(a,u)).subtreeFlags=14680064&a.subtreeFlags:((i=t.child).childLanes=0,i.pendingProps=u,t.deletions=null),null!==o?s=Iu(o,s):(s=Ru(s,l,r,null)).flags|=2,s.return=t,i.return=t,i.sibling=s,t.child=i,i=s,s=t.child,l=null===(l=e.child.memoizedState)?Is(r):{baseLanes:l.baseLanes|r,cachePool:null,transitions:l.transitions},s.memoizedState=l,s.childLanes=e.childLanes&~r,t.memoizedState=Ps,i}return e=(s=e.child).sibling,i=Iu(s,{mode:"visible",children:i.children}),!(1&t.mode)&&(i.lanes=r),i.return=t,i.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function Rs(e,t){return(t=Bu({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Bs(e,t,n,r){return null!==r&&ui(r),Wi(t,e.child,null,n),(e=Rs(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Fs(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),yi(e.return,t,n)}function Ls(e,t,n,r,o){var i=e.memoizedState;null===i?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function Ms(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(ms(e,t,r.children,n),2&(r=na.current))r=1&r|2,t.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Fs(e,n,t);else if(19===e.tag)Fs(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Eo(na,r),1&t.mode)switch(o){case"forwards":for(n=t.child,o=null;null!==n;)null!==(e=n.alternate)&&null===ra(e)&&(o=n),n=n.sibling;null===(n=o)?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Ls(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;null!==o;){if(null!==(e=o.alternate)&&null===ra(e)){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Ls(t,!0,n,null,i);break;case"together":Ls(t,!1,null,null,void 0);break;default:t.memoizedState=null}else t.memoizedState=null;return t.child}function Us(e,t){!(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function js(e,t,r){if(null!==e&&(t.dependencies=e.dependencies),Il|=t.lanes,0===(r&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(n(153));if(null!==t.child){for(r=Iu(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=Iu(e,e.pendingProps)).return=t;r.sibling=null}return t.child}function $s(e,t){if(!Jo)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function zs(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=14680064&o.subtreeFlags,r|=14680064&o.flags,o.return=e,o=o.sibling;else for(o=e.child;null!==o;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Hs(e,t,r){var i=t.pendingProps;switch(Zo(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zs(t),null;case 1:case 17:return To(t.type)&&Do(),zs(t),null;case 3:return i=t.stateNode,Ji(),wo(ko),wo(xo),ia(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),null!==e&&null!==e.child||(ai(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,null!==ei&&(nu(ei),ei=null))),Ds(e,t),zs(t),null;case 5:ta(t);var a=Xi(Zi.current);if(r=t.type,null!==e&&null!=t.stateNode)As(e,t,r,i,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(null===t.stateNode)throw Error(n(166));return zs(t),null}if(e=Xi(Ki.current),ai(t)){i=t.stateNode,r=t.type;var s=t.memoizedProps;switch(i[ao]=t,i[so]=s,e=!!(1&t.mode),r){case"dialog":Nr("cancel",i),Nr("close",i);break;case"iframe":case"object":case"embed":Nr("load",i);break;case"video":case"audio":for(a=0;a<Ar.length;a++)Nr(Ar[a],i);break;case"source":Nr("error",i);break;case"img":case"image":case"link":Nr("error",i),Nr("load",i);break;case"details":Nr("toggle",i);break;case"input":G(i,s),Nr("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!s.multiple},Nr("invalid",i);break;case"textarea":te(i,s),Nr("invalid",i)}for(var l in ge(r,s),a=null,s)if(s.hasOwnProperty(l)){var u=s[l];"children"===l?"string"==typeof u?i.textContent!==u&&(!0!==s.suppressHydrationWarning&&qr(i.textContent,u,e),a=["children",u]):"number"==typeof u&&i.textContent!==""+u&&(!0!==s.suppressHydrationWarning&&qr(i.textContent,u,e),a=["children",""+u]):o.hasOwnProperty(l)&&null!=u&&"onScroll"===l&&Nr("scroll",i)}switch(r){case"input":H(i),Z(i,s,!0);break;case"textarea":H(i),re(i);break;case"select":case"option":break;default:"function"==typeof s.onClick&&(i.onclick=Gr)}i=a,t.updateQueue=i,null!==i&&(t.flags|=4)}else{l=9===a.nodeType?a:a.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=oe(r)),"http://www.w3.org/1999/xhtml"===e?"script"===r?((e=l.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof i.is?e=l.createElement(r,{is:i.is}):(e=l.createElement(r),"select"===r&&(l=e,i.multiple?l.multiple=!0:i.size&&(l.size=i.size))):e=l.createElementNS(e,r),e[ao]=t,e[so]=i,Ts(e,t,!1,!1),t.stateNode=e;e:{switch(l=me(r,i),r){case"dialog":Nr("cancel",e),Nr("close",e),a=i;break;case"iframe":case"object":case"embed":Nr("load",e),a=i;break;case"video":case"audio":for(a=0;a<Ar.length;a++)Nr(Ar[a],e);a=i;break;case"source":Nr("error",e),a=i;break;case"img":case"image":case"link":Nr("error",e),Nr("load",e),a=i;break;case"details":Nr("toggle",e),a=i;break;case"input":G(e,i),a=q(e,i),Nr("invalid",e);break;case"option":default:a=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},a=R({},i,{value:void 0}),Nr("invalid",e);break;case"textarea":te(e,i),a=ee(e,i),Nr("invalid",e)}for(s in ge(r,a),u=a)if(u.hasOwnProperty(s)){var c=u[s];"style"===s?fe(e,c):"dangerouslySetInnerHTML"===s?null!=(c=c?c.__html:void 0)&&le(e,c):"children"===s?"string"==typeof c?("textarea"!==r||""!==c)&&ue(e,c):"number"==typeof c&&ue(e,""+c):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(o.hasOwnProperty(s)?null!=c&&"onScroll"===s&&Nr("scroll",e):null!=c&&m(e,s,c,l))}switch(r){case"input":H(e),Z(e,i,!1);break;case"textarea":H(e),re(e);break;case"option":null!=i.value&&e.setAttribute("value",""+$(i.value));break;case"select":e.multiple=!!i.multiple,null!=(s=i.value)?J(e,!!i.multiple,s,!1):null!=i.defaultValue&&J(e,!!i.multiple,i.defaultValue,!0);break;default:"function"==typeof a.onClick&&(e.onclick=Gr)}switch(r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return zs(t),null;case 6:if(e&&null!=t.stateNode)Os(e,t,e.memoizedProps,i);else{if("string"!=typeof i&&null===t.stateNode)throw Error(n(166));if(r=Xi(Zi.current),Xi(Ki.current),ai(t)){if(i=t.stateNode,r=t.memoizedProps,i[ao]=t,(s=i.nodeValue!==r)&&null!==(e=Xo))switch(e.tag){case 3:qr(i.nodeValue,r,!!(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&qr(i.nodeValue,r,!!(1&e.mode))}s&&(t.flags|=4)}else(i=(9===r.nodeType?r:r.ownerDocument).createTextNode(i))[ao]=t,t.stateNode=i}return zs(t),null;case 13:if(wo(na),i=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(Jo&&null!==Qo&&1&t.mode&&!(128&t.flags))si(),li(),t.flags|=98560,s=!1;else if(s=ai(t),null!==i&&null!==i.dehydrated){if(null===e){if(!s)throw Error(n(318));if(!(s=null!==(s=t.memoizedState)?s.dehydrated:null))throw Error(n(317));s[ao]=t}else li(),!(128&t.flags)&&(t.memoizedState=null),t.flags|=4;zs(t),s=!1}else null!==ei&&(nu(ei),ei=null),s=!0;if(!s)return 65536&t.flags?t:null}return 128&t.flags?(t.lanes=r,t):((i=null!==i)!=(null!==e&&null!==e.memoizedState)&&i&&(t.child.flags|=8192,1&t.mode&&(null===e||1&na.current?0===Ol&&(Ol=3):hu())),null!==t.updateQueue&&(t.flags|=4),zs(t),null);case 4:return Ji(),Ds(e,t),null===e&&Fr(t.stateNode.containerInfo),zs(t),null;case 10:return vi(t.type._context),zs(t),null;case 19:if(wo(na),null===(s=t.memoizedState))return zs(t),null;if(i=!!(128&t.flags),null===(l=s.rendering))if(i)$s(s,!1);else{if(0!==Ol||null!==e&&128&e.flags)for(e=t.child;null!==e;){if(null!==(l=ra(e))){for(t.flags|=128,$s(s,!1),null!==(i=l.updateQueue)&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;null!==r;)e=i,(s=r).flags&=14680066,null===(l=s.alternate)?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=l.childLanes,s.lanes=l.lanes,s.child=l.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=l.memoizedProps,s.memoizedState=l.memoizedState,s.updateQueue=l.updateQueue,s.type=l.type,e=l.dependencies,s.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Eo(na,1&na.current|2),t.child}e=e.sibling}null!==s.tail&&Ke()>Ml&&(t.flags|=128,i=!0,$s(s,!1),t.lanes=4194304)}else{if(!i)if(null!==(e=ra(l))){if(t.flags|=128,i=!0,null!==(r=e.updateQueue)&&(t.updateQueue=r,t.flags|=4),$s(s,!0),null===s.tail&&"hidden"===s.tailMode&&!l.alternate&&!Jo)return zs(t),null}else 2*Ke()-s.renderingStartTime>Ml&&1073741824!==r&&(t.flags|=128,i=!0,$s(s,!1),t.lanes=4194304);s.isBackwards?(l.sibling=t.child,t.child=l):(null!==(r=s.last)?r.sibling=l:t.child=l,s.last=l)}return null!==s.tail?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Ke(),t.sibling=null,r=na.current,Eo(na,i?1&r|2:1&r),t):(zs(t),null);case 22:case 23:return cu(),i=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==i&&(t.flags|=8192),i&&1&t.mode?!!(1073741824&Dl)&&(zs(t),6&t.subtreeFlags&&(t.flags|=8192)):zs(t),null;case 24:case 25:return null}throw Error(n(156,t.tag))}function Vs(e,t){switch(Zo(t),t.tag){case 1:return To(t.type)&&Do(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return Ji(),wo(ko),wo(xo),ia(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 5:return ta(t),null;case 13:if(wo(na),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(n(340));li()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return wo(na),null;case 4:return Ji(),null;case 10:return vi(t.type._context),null;case 22:case 23:return cu(),null;default:return null}}Ts=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ds=function(){},As=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,Xi(Ki.current);var a,s=null;switch(n){case"input":i=q(e,i),r=q(e,r),s=[];break;case"select":i=R({},i,{value:void 0}),r=R({},r,{value:void 0}),s=[];break;case"textarea":i=ee(e,i),r=ee(e,r),s=[];break;default:"function"!=typeof i.onClick&&"function"==typeof r.onClick&&(e.onclick=Gr)}for(c in ge(n,r),n=null,i)if(!r.hasOwnProperty(c)&&i.hasOwnProperty(c)&&null!=i[c])if("style"===c){var l=i[c];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else"dangerouslySetInnerHTML"!==c&&"children"!==c&&"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&"autoFocus"!==c&&(o.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var u=r[c];if(l=null!=i?i[c]:void 0,r.hasOwnProperty(c)&&u!==l&&(null!=u||null!=l))if("style"===c)if(l){for(a in l)!l.hasOwnProperty(a)||u&&u.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in u)u.hasOwnProperty(a)&&l[a]!==u[a]&&(n||(n={}),n[a]=u[a])}else n||(s||(s=[]),s.push(c,n)),n=u;else"dangerouslySetInnerHTML"===c?(u=u?u.__html:void 0,l=l?l.__html:void 0,null!=u&&l!==u&&(s=s||[]).push(c,u)):"children"===c?"string"!=typeof u&&"number"!=typeof u||(s=s||[]).push(c,""+u):"suppressContentEditableWarning"!==c&&"suppressHydrationWarning"!==c&&(o.hasOwnProperty(c)?(null!=u&&"onScroll"===c&&Nr("scroll",e),s||l===u||(s=[])):(s=s||[]).push(c,u))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}},Os=function(e,t,n,r){n!==r&&(t.flags|=4)};var Ws=!1,qs=!1,Gs="function"==typeof WeakSet?WeakSet:Set,Ks=null;function Ys(e,t){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){xu(e,t,n)}else n.current=null}function Zs(e,t,n){try{n()}catch(n){xu(e,t,n)}}var Xs=!1;function Qs(e,t,n){var r=t.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,void 0!==i&&Zs(t,n,i)}o=o.next}while(o!==r)}}function Js(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function el(e){var t=e.ref;if(null!==t){var n=e.stateNode;e.tag,e=n,"function"==typeof t?t(e):t.current=e}}function tl(e){var t=e.alternate;null!==t&&(e.alternate=null,tl(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(t=e.stateNode)&&(delete t[ao],delete t[so],delete t[uo],delete t[co],delete t[po]),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function nl(e){return 5===e.tag||3===e.tag||4===e.tag}function rl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||nl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function ol(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Gr));else if(4!==r&&null!==(e=e.child))for(ol(e,t,n),e=e.sibling;null!==e;)ol(e,t,n),e=e.sibling}function il(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&null!==(e=e.child))for(il(e,t,n),e=e.sibling;null!==e;)il(e,t,n),e=e.sibling}var al=null,sl=!1;function ll(e,t,n){for(n=n.child;null!==n;)ul(e,t,n),n=n.sibling}function ul(e,t,n){if(nt&&"function"==typeof nt.onCommitFiberUnmount)try{nt.onCommitFiberUnmount(tt,n)}catch(e){}switch(n.tag){case 5:qs||Ys(n,t);case 6:var r=al,o=sl;al=null,ll(e,t,n),sl=o,null!==(al=r)&&(sl?(e=al,n=n.stateNode,8===e.nodeType?e.parentNode.removeChild(n):e.removeChild(n)):al.removeChild(n.stateNode));break;case 18:null!==al&&(sl?(e=al,n=n.stateNode,8===e.nodeType?no(e.parentNode,n):1===e.nodeType&&no(e,n),Ut(e)):no(al,n.stateNode));break;case 4:r=al,o=sl,al=n.stateNode.containerInfo,sl=!0,ll(e,t,n),al=r,sl=o;break;case 0:case 11:case 14:case 15:if(!qs&&null!==(r=n.updateQueue)&&null!==(r=r.lastEffect)){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,void 0!==a&&(2&i||4&i)&&Zs(n,t,a),o=o.next}while(o!==r)}ll(e,t,n);break;case 1:if(!qs&&(Ys(n,t),"function"==typeof(r=n.stateNode).componentWillUnmount))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){xu(n,t,e)}ll(e,t,n);break;case 21:ll(e,t,n);break;case 22:1&n.mode?(qs=(r=qs)||null!==n.memoizedState,ll(e,t,n),qs=r):ll(e,t,n);break;default:ll(e,t,n)}}function cl(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Gs),t.forEach(function(t){var r=Tu.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function dl(e,t){var r=t.deletions;if(null!==r)for(var o=0;o<r.length;o++){var i=r[o];try{var a=e,s=t,l=s;e:for(;null!==l;){switch(l.tag){case 5:al=l.stateNode,sl=!1;break e;case 3:case 4:al=l.stateNode.containerInfo,sl=!0;break e}l=l.return}if(null===al)throw Error(n(160));ul(a,s,i),al=null,sl=!1;var u=i.alternate;null!==u&&(u.return=null),i.return=null}catch(e){xu(i,t,e)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)pl(t,e),t=t.sibling}function pl(e,t){var r=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(dl(t,e),fl(e),4&o){try{Qs(3,e,e.return),Js(3,e)}catch(t){xu(e,e.return,t)}try{Qs(5,e,e.return)}catch(t){xu(e,e.return,t)}}break;case 1:dl(t,e),fl(e),512&o&&null!==r&&Ys(r,r.return);break;case 5:if(dl(t,e),fl(e),512&o&&null!==r&&Ys(r,r.return),32&e.flags){var i=e.stateNode;try{ue(i,"")}catch(t){xu(e,e.return,t)}}if(4&o&&null!=(i=e.stateNode)){var a=e.memoizedProps,s=null!==r?r.memoizedProps:a,l=e.type,u=e.updateQueue;if(e.updateQueue=null,null!==u)try{"input"===l&&"radio"===a.type&&null!=a.name&&K(i,a),me(l,s);var c=me(l,a);for(s=0;s<u.length;s+=2){var d=u[s],p=u[s+1];"style"===d?fe(i,p):"dangerouslySetInnerHTML"===d?le(i,p):"children"===d?ue(i,p):m(i,d,p,c)}switch(l){case"input":Y(i,a);break;case"textarea":ne(i,a);break;case"select":var f=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var h=a.value;null!=h?J(i,!!a.multiple,h,!1):f!==!!a.multiple&&(null!=a.defaultValue?J(i,!!a.multiple,a.defaultValue,!0):J(i,!!a.multiple,a.multiple?[]:"",!1))}i[so]=a}catch(t){xu(e,e.return,t)}}break;case 6:if(dl(t,e),fl(e),4&o){if(null===e.stateNode)throw Error(n(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(t){xu(e,e.return,t)}}break;case 3:if(dl(t,e),fl(e),4&o&&null!==r&&r.memoizedState.isDehydrated)try{Ut(t.containerInfo)}catch(t){xu(e,e.return,t)}break;case 4:default:dl(t,e),fl(e);break;case 13:dl(t,e),fl(e),8192&(i=e.child).flags&&(a=null!==i.memoizedState,i.stateNode.isHidden=a,!a||null!==i.alternate&&null!==i.alternate.memoizedState||(Ll=Ke())),4&o&&cl(e);break;case 22:if(d=null!==r&&null!==r.memoizedState,1&e.mode?(qs=(c=qs)||d,dl(t,e),qs=c):dl(t,e),fl(e),8192&o){if(c=null!==e.memoizedState,(e.stateNode.isHidden=c)&&!d&&1&e.mode)for(Ks=e,d=e.child;null!==d;){for(p=Ks=d;null!==Ks;){switch(h=(f=Ks).child,f.tag){case 0:case 11:case 14:case 15:Qs(4,f,f.return);break;case 1:Ys(f,f.return);var g=f.stateNode;if("function"==typeof g.componentWillUnmount){o=f,r=f.return;try{t=o,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(e){xu(o,r,e)}}break;case 5:Ys(f,f.return);break;case 22:if(null!==f.memoizedState){vl(p);continue}}null!==h?(h.return=f,Ks=h):vl(p)}d=d.sibling}e:for(d=null,p=e;;){if(5===p.tag){if(null===d){d=p;try{i=p.stateNode,c?"function"==typeof(a=i.style).setProperty?a.setProperty("display","none","important"):a.display="none":(l=p.stateNode,s=null!=(u=p.memoizedProps.style)&&u.hasOwnProperty("display")?u.display:null,l.style.display=pe("display",s))}catch(t){xu(e,e.return,t)}}}else if(6===p.tag){if(null===d)try{p.stateNode.nodeValue=c?"":p.memoizedProps}catch(t){xu(e,e.return,t)}}else if((22!==p.tag&&23!==p.tag||null===p.memoizedState||p===e)&&null!==p.child){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;null===p.sibling;){if(null===p.return||p.return===e)break e;d===p&&(d=null),p=p.return}d===p&&(d=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:dl(t,e),fl(e),4&o&&cl(e);case 21:}}function fl(e){var t=e.flags;if(2&t){try{e:{for(var r=e.return;null!==r;){if(nl(r)){var o=r;break e}r=r.return}throw Error(n(160))}switch(o.tag){case 5:var i=o.stateNode;32&o.flags&&(ue(i,""),o.flags&=-33),il(e,rl(e),i);break;case 3:case 4:var a=o.stateNode.containerInfo;ol(e,rl(e),a);break;default:throw Error(n(161))}}catch(t){xu(e,e.return,t)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function hl(e,t,n){Ks=e,gl(e)}function gl(e,t,n){for(var r=!!(1&e.mode);null!==Ks;){var o=Ks,i=o.child;if(22===o.tag&&r){var a=null!==o.memoizedState||Ws;if(!a){var s=o.alternate,l=null!==s&&null!==s.memoizedState||qs;s=Ws;var u=qs;if(Ws=a,(qs=l)&&!u)for(Ks=o;null!==Ks;)l=(a=Ks).child,22===a.tag&&null!==a.memoizedState?yl(o):null!==l?(l.return=a,Ks=l):yl(o);for(;null!==i;)Ks=i,gl(i),i=i.sibling;Ks=o,Ws=s,qs=u}ml(e)}else 8772&o.subtreeFlags&&null!==i?(i.return=o,Ks=i):ml(e)}}function ml(e){for(;null!==Ks;){var t=Ks;if(8772&t.flags){var r=t.alternate;try{if(8772&t.flags)switch(t.tag){case 0:case 11:case 15:qs||Js(5,t);break;case 1:var o=t.stateNode;if(4&t.flags&&!qs)if(null===r)o.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:di(t.type,r.memoizedProps);o.componentDidUpdate(i,r.memoizedState,o.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;null!==a&&Ni(t,a,o);break;case 3:var s=t.updateQueue;if(null!==s){if(r=null,null!==t.child)switch(t.child.tag){case 5:case 1:r=t.child.stateNode}Ni(t,s,r)}break;case 5:var l=t.stateNode;if(null===r&&4&t.flags){r=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&r.focus();break;case"img":u.src&&(r.src=u.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var c=t.alternate;if(null!==c){var d=c.memoizedState;if(null!==d){var p=d.dehydrated;null!==p&&Ut(p)}}}break;default:throw Error(n(163))}qs||512&t.flags&&el(t)}catch(e){xu(t,t.return,e)}}if(t===e){Ks=null;break}if(null!==(r=t.sibling)){r.return=t.return,Ks=r;break}Ks=t.return}}function vl(e){for(;null!==Ks;){var t=Ks;if(t===e){Ks=null;break}var n=t.sibling;if(null!==n){n.return=t.return,Ks=n;break}Ks=t.return}}function yl(e){for(;null!==Ks;){var t=Ks;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Js(4,t)}catch(e){xu(t,n,e)}break;case 1:var r=t.stateNode;if("function"==typeof r.componentDidMount){var o=t.return;try{r.componentDidMount()}catch(e){xu(t,o,e)}}var i=t.return;try{el(t)}catch(e){xu(t,i,e)}break;case 5:var a=t.return;try{el(t)}catch(e){xu(t,a,e)}}}catch(e){xu(t,t.return,e)}if(t===e){Ks=null;break}var s=t.sibling;if(null!==s){s.return=t.return,Ks=s;break}Ks=t.return}}var bl,wl=Math.ceil,El=v.ReactCurrentDispatcher,_l=v.ReactCurrentOwner,xl=v.ReactCurrentBatchConfig,kl=0,Cl=null,Sl=null,Tl=0,Dl=0,Al=bo(0),Ol=0,Pl=null,Il=0,Nl=0,Rl=0,Bl=null,Fl=null,Ll=0,Ml=1/0,Ul=null,jl=!1,$l=null,zl=null,Hl=!1,Vl=null,Wl=0,ql=0,Gl=null,Kl=-1,Yl=0;function Zl(){return 6&kl?Ke():-1!==Kl?Kl:Kl=Ke()}function Xl(e){return 1&e.mode?2&kl&&0!==Tl?Tl&-Tl:null!==ci.transition?(0===Yl&&(Yl=pt()),Yl):0!==(e=mt)?e:e=void 0===(e=window.event)?16:Gt(e.type):1}function Ql(e,t,r,o){if(50<ql)throw ql=0,Gl=null,Error(n(185));ht(e,r,o),2&kl&&e===Cl||(e===Cl&&(!(2&kl)&&(Nl|=r),4===Ol&&ru(e,Tl)),Jl(e,o),1===r&&0===kl&&!(1&t.mode)&&(Ml=Ke()+500,Ro&&Lo()))}function Jl(e,t){var n=e.callbackNode;!function(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-rt(i),s=1<<a,l=o[a];-1===l?0!==(s&n)&&0===(s&r)||(o[a]=ct(s,t)):l<=t&&(e.expiredLanes|=s),i&=~s}}(e,t);var r=ut(e,e===Cl?Tl:0);if(0===r)null!==n&&We(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(null!=n&&We(n),1===t)0===e.tag?function(e){Ro=!0,Fo(e)}(ou.bind(null,e)):Fo(ou.bind(null,e)),eo(function(){!(6&kl)&&Lo()}),n=null;else{switch(vt(r)){case 1:n=Ze;break;case 4:n=Xe;break;case 16:default:n=Qe;break;case 536870912:n=et}n=Du(n,eu.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function eu(e,t){if(Kl=-1,Yl=0,6&kl)throw Error(n(327));var r=e.callbackNode;if(Eu()&&e.callbackNode!==r)return null;var o=ut(e,e===Cl?Tl:0);if(0===o)return null;if(30&o||0!==(o&e.expiredLanes)||t)t=gu(e,o);else{t=o;var i=kl;kl|=2;var a=fu();for(Cl===e&&Tl===t||(Ul=null,Ml=Ke()+500,du(e,t));;)try{vu();break}catch(t){pu(e,t)}mi(),El.current=a,kl=i,null!==Sl?t=0:(Cl=null,Tl=0,t=Ol)}if(0!==t){if(2===t&&0!==(i=dt(e))&&(o=i,t=tu(e,i)),1===t)throw r=Pl,du(e,0),ru(e,o),Jl(e,Ke()),r;if(6===t)ru(e,o);else{if(i=e.current.alternate,!(30&o||function(e){for(var t=e;;){if(16384&t.flags){var n=t.updateQueue;if(null!==n&&null!==(n=n.stores))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!tr(i(),o))return!1}catch(e){return!1}}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(i)||(t=gu(e,o),2===t&&(a=dt(e),0!==a&&(o=a,t=tu(e,a))),1!==t)))throw r=Pl,du(e,0),ru(e,o),Jl(e,Ke()),r;switch(e.finishedWork=i,e.finishedLanes=o,t){case 0:case 1:throw Error(n(345));case 2:case 5:wu(e,Fl,Ul);break;case 3:if(ru(e,o),(130023424&o)===o&&10<(t=Ll+500-Ke())){if(0!==ut(e,0))break;if(((i=e.suspendedLanes)&o)!==o){Zl(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=Xr(wu.bind(null,e,Fl,Ul),t);break}wu(e,Fl,Ul);break;case 4:if(ru(e,o),(4194240&o)===o)break;for(t=e.eventTimes,i=-1;0<o;){var s=31-rt(o);a=1<<s,(s=t[s])>i&&(i=s),o&=~a}if(o=i,10<(o=(120>(o=Ke()-o)?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*wl(o/1960))-o)){e.timeoutHandle=Xr(wu.bind(null,e,Fl,Ul),o);break}wu(e,Fl,Ul);break;default:throw Error(n(329))}}}return Jl(e,Ke()),e.callbackNode===r?eu.bind(null,e):null}function tu(e,t){var n=Bl;return e.current.memoizedState.isDehydrated&&(du(e,t).flags|=256),2!==(e=gu(e,t))&&(t=Fl,Fl=n,null!==t&&nu(t)),e}function nu(e){null===Fl?Fl=e:Fl.push.apply(Fl,e)}function ru(e,t){for(t&=~Rl,t&=~Nl,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-rt(t),r=1<<n;e[n]=-1,t&=~r}}function ou(e){if(6&kl)throw Error(n(327));Eu();var t=ut(e,0);if(!(1&t))return Jl(e,Ke()),null;var r=gu(e,t);if(0!==e.tag&&2===r){var o=dt(e);0!==o&&(t=o,r=tu(e,o))}if(1===r)throw r=Pl,du(e,0),ru(e,t),Jl(e,Ke()),r;if(6===r)throw Error(n(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,wu(e,Fl,Ul),Jl(e,Ke()),null}function su(e,t){var n=kl;kl|=1;try{return e(t)}finally{0===(kl=n)&&(Ml=Ke()+500,Ro&&Lo())}}function uu(e){null!==Vl&&0===Vl.tag&&!(6&kl)&&Eu();var t=kl;kl|=1;var n=xl.transition,r=mt;try{if(xl.transition=null,mt=1,e)return e()}finally{mt=r,xl.transition=n,!(6&(kl=t))&&Lo()}}function cu(){Dl=Al.current,wo(Al)}function du(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,Qr(n)),null!==Sl)for(n=Sl.return;null!==n;){var r=n;switch(Zo(r),r.tag){case 1:null!=(r=r.type.childContextTypes)&&Do();break;case 3:Ji(),wo(ko),wo(xo),ia();break;case 5:ta(r);break;case 4:Ji();break;case 13:case 19:wo(na);break;case 10:vi(r.type._context);break;case 22:case 23:cu()}n=n.return}if(Cl=e,Sl=e=Iu(e.current,null),Tl=Dl=t,Ol=0,Pl=null,Rl=Nl=Il=0,Fl=Bl=null,null!==Ei){for(t=0;t<Ei.length;t++)if(null!==(r=(n=Ei[t]).interleaved)){n.interleaved=null;var o=r.next,i=n.pending;if(null!==i){var a=i.next;i.next=o,r.next=a}n.pending=r}Ei=null}return e}function pu(e,t){for(;;){var r=Sl;try{if(mi(),aa.current=ts,pa){for(var o=ua.memoizedState;null!==o;){var i=o.queue;null!==i&&(i.pending=null),o=o.next}pa=!1}if(la=0,da=ca=ua=null,fa=!1,ha=0,_l.current=null,null===r||null===r.return){Ol=1,Pl=t,Sl=null;break}e:{var a=e,s=r.return,l=r,u=t;if(t=Tl,l.flags|=32768,null!==u&&"object"==typeof u&&"function"==typeof u.then){var c=u,d=l,p=d.tag;if(!(1&d.mode||0!==p&&11!==p&&15!==p)){var f=d.alternate;f?(d.updateQueue=f.updateQueue,d.memoizedState=f.memoizedState,d.lanes=f.lanes):(d.updateQueue=null,d.memoizedState=null)}var h=ps(s);if(null!==h){h.flags&=-257,fs(h,s,l,0,t),1&h.mode&&ds(a,c,t),u=c;var g=(t=h).updateQueue;if(null===g){var m=new Set;m.add(u),t.updateQueue=m}else g.add(u);break e}if(!(1&t)){ds(a,c,t),hu();break e}u=Error(n(426))}else if(Jo&&1&l.mode){var v=ps(s);if(null!==v){!(65536&v.flags)&&(v.flags|=256),fs(v,s,l,0,t),ui(is(u,l));break e}}a=u=is(u,l),4!==Ol&&(Ol=2),null===Bl?Bl=[a]:Bl.push(a),a=s;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t,Pi(a,us(0,u,t));break e;case 1:l=u;var y=a.type,b=a.stateNode;if(!(128&a.flags||"function"!=typeof y.getDerivedStateFromError&&(null===b||"function"!=typeof b.componentDidCatch||null!==zl&&zl.has(b)))){a.flags|=65536,t&=-t,a.lanes|=t,Pi(a,cs(a,l,t));break e}}a=a.return}while(null!==a)}bu(r)}catch(e){t=e,Sl===r&&null!==r&&(Sl=r=r.return);continue}break}}function fu(){var e=El.current;return El.current=ts,null===e?ts:e}function hu(){0!==Ol&&3!==Ol&&2!==Ol||(Ol=4),null===Cl||!(268435455&Il)&&!(268435455&Nl)||ru(Cl,Tl)}function gu(e,t){var r=kl;kl|=2;var o=fu();for(Cl===e&&Tl===t||(Ul=null,du(e,t));;)try{mu();break}catch(t){pu(e,t)}if(mi(),kl=r,El.current=o,null!==Sl)throw Error(n(261));return Cl=null,Tl=0,Ol}function mu(){for(;null!==Sl;)yu(Sl)}function vu(){for(;null!==Sl&&!qe();)yu(Sl)}function yu(e){var t=bl(e.alternate,e,Dl);e.memoizedProps=e.pendingProps,null===t?bu(e):Sl=t,_l.current=null}function bu(e){var t=e;do{var n=t.alternate;if(e=t.return,32768&t.flags){if(null!==(n=Vs(n,t)))return n.flags&=32767,void(Sl=n);if(null===e)return Ol=6,void(Sl=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}else if(null!==(n=Hs(n,t,Dl)))return void(Sl=n);if(null!==(t=t.sibling))return void(Sl=t);Sl=t=e}while(null!==t);0===Ol&&(Ol=5)}function wu(e,t,r){var o=mt,i=xl.transition;try{xl.transition=null,mt=1,function(e,t,r,o){do{Eu()}while(null!==Vl);if(6&kl)throw Error(n(327));r=e.finishedWork;var i=e.finishedLanes;if(null===r)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(n(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(function(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-rt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}(e,a),e===Cl&&(Sl=Cl=null,Tl=0),!(2064&r.subtreeFlags)&&!(2064&r.flags)||Hl||(Hl=!0,Du(Qe,function(){return Eu(),null})),a=!!(15990&r.flags),15990&r.subtreeFlags||a){a=xl.transition,xl.transition=null;var s=mt;mt=1;var l=kl;kl|=4,_l.current=null,function(e,t){if(Kr=$t,sr(e=ar())){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{var o=(r=(r=e.ownerDocument)&&r.defaultView||window).getSelection&&r.getSelection();if(o&&0!==o.rangeCount){r=o.anchorNode;var i=o.anchorOffset,a=o.focusNode;o=o.focusOffset;try{r.nodeType,a.nodeType}catch(e){r=null;break e}var s=0,l=-1,u=-1,c=0,d=0,p=e,f=null;t:for(;;){for(var h;p!==r||0!==i&&3!==p.nodeType||(l=s+i),p!==a||0!==o&&3!==p.nodeType||(u=s+o),3===p.nodeType&&(s+=p.nodeValue.length),null!==(h=p.firstChild);)f=p,p=h;for(;;){if(p===e)break t;if(f===r&&++c===i&&(l=s),f===a&&++d===o&&(u=s),null!==(h=p.nextSibling))break;f=(p=f).parentNode}p=h}r=-1===l||-1===u?null:{start:l,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(Yr={focusedElem:e,selectionRange:r},$t=!1,Ks=t;null!==Ks;)if(e=(t=Ks).child,1028&t.subtreeFlags&&null!==e)e.return=t,Ks=e;else for(;null!==Ks;){t=Ks;try{var g=t.alternate;if(1024&t.flags)switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==g){var m=g.memoizedProps,v=g.memoizedState,y=t.stateNode,b=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:di(t.type,m),v);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var w=t.stateNode.containerInfo;1===w.nodeType?w.textContent="":9===w.nodeType&&w.documentElement&&w.removeChild(w.documentElement);break;default:throw Error(n(163))}}catch(e){xu(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,Ks=e;break}Ks=t.return}g=Xs,Xs=!1}(e,r),pl(r,e),lr(Yr),$t=!!Kr,Yr=Kr=null,e.current=r,hl(r),Ge(),kl=l,mt=s,xl.transition=a}else e.current=r;if(Hl&&(Hl=!1,Vl=e,Wl=i),0===(a=e.pendingLanes)&&(zl=null),function(e){if(nt&&"function"==typeof nt.onCommitFiberRoot)try{nt.onCommitFiberRoot(tt,e,void 0,!(128&~e.current.flags))}catch(e){}}(r.stateNode),Jl(e,Ke()),null!==t)for(o=e.onRecoverableError,r=0;r<t.length;r++)o((i=t[r]).value,{componentStack:i.stack,digest:i.digest});if(jl)throw jl=!1,e=$l,$l=null,e;!!(1&Wl)&&0!==e.tag&&Eu(),1&(a=e.pendingLanes)?e===Gl?ql++:(ql=0,Gl=e):ql=0,Lo()}(e,t,r,o)}finally{xl.transition=i,mt=o}return null}function Eu(){if(null!==Vl){var e=vt(Wl),t=xl.transition,r=mt;try{if(xl.transition=null,mt=16>e?16:e,null===Vl)var o=!1;else{if(e=Vl,Vl=null,Wl=0,6&kl)throw Error(n(331));var i=kl;for(kl|=4,Ks=e.current;null!==Ks;){var a=Ks,s=a.child;if(16&Ks.flags){var l=a.deletions;if(null!==l){for(var u=0;u<l.length;u++){var c=l[u];for(Ks=c;null!==Ks;){var d=Ks;switch(d.tag){case 0:case 11:case 15:Qs(8,d,a)}var p=d.child;if(null!==p)p.return=d,Ks=p;else for(;null!==Ks;){var f=(d=Ks).sibling,h=d.return;if(tl(d),d===c){Ks=null;break}if(null!==f){f.return=h,Ks=f;break}Ks=h}}}var g=a.alternate;if(null!==g){var m=g.child;if(null!==m){g.child=null;do{var v=m.sibling;m.sibling=null,m=v}while(null!==m)}}Ks=a}}if(2064&a.subtreeFlags&&null!==s)s.return=a,Ks=s;else e:for(;null!==Ks;){if(2048&(a=Ks).flags)switch(a.tag){case 0:case 11:case 15:Qs(9,a,a.return)}var y=a.sibling;if(null!==y){y.return=a.return,Ks=y;break e}Ks=a.return}}var b=e.current;for(Ks=b;null!==Ks;){var w=(s=Ks).child;if(2064&s.subtreeFlags&&null!==w)w.return=s,Ks=w;else e:for(s=b;null!==Ks;){if(2048&(l=Ks).flags)try{switch(l.tag){case 0:case 11:case 15:Js(9,l)}}catch(e){xu(l,l.return,e)}if(l===s){Ks=null;break e}var E=l.sibling;if(null!==E){E.return=l.return,Ks=E;break e}Ks=l.return}}if(kl=i,Lo(),nt&&"function"==typeof nt.onPostCommitFiberRoot)try{nt.onPostCommitFiberRoot(tt,e)}catch(e){}o=!0}return o}finally{mt=r,xl.transition=t}}return!1}function _u(e,t,n){e=Ai(e,t=us(0,t=is(n,t),1),1),t=Zl(),null!==e&&(ht(e,1,t),Jl(e,t))}function xu(e,t,n){if(3===e.tag)_u(e,e,n);else for(;null!==t;){if(3===t.tag){_u(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===zl||!zl.has(r))){t=Ai(t,e=cs(t,e=is(n,e),1),1),e=Zl(),null!==t&&(ht(t,1,e),Jl(t,e));break}}t=t.return}}function ku(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),t=Zl(),e.pingedLanes|=e.suspendedLanes&n,Cl===e&&(Tl&n)===n&&(4===Ol||3===Ol&&(130023424&Tl)===Tl&&500>Ke()-Ll?du(e,0):Rl|=n),Jl(e,t)}function Cu(e,t){0===t&&(1&e.mode?(t=st,!(130023424&(st<<=1))&&(st=4194304)):t=1);var n=Zl();null!==(e=ki(e,t))&&(ht(e,t,n),Jl(e,n))}function Su(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),Cu(e,n)}function Tu(e,t){var r=0;switch(e.tag){case 13:var o=e.stateNode,i=e.memoizedState;null!==i&&(r=i.retryLane);break;case 19:o=e.stateNode;break;default:throw Error(n(314))}null!==o&&o.delete(t),Cu(e,r)}function Du(e,t){return Ve(e,t)}function Au(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ou(e,t,n,r){return new Au(e,t,n,r)}function Pu(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Iu(e,t){var n=e.alternate;return null===n?((n=Ou(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=14680064&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Nu(e,t,r,o,i,a){var s=2;if(o=e,"function"==typeof e)Pu(e)&&(s=1);else if("string"==typeof e)s=5;else e:switch(e){case w:return Ru(r.children,i,a,t);case E:s=8,i|=8;break;case _:return(e=Ou(12,r,t,2|i)).elementType=_,e.lanes=a,e;case S:return(e=Ou(13,r,t,i)).elementType=S,e.lanes=a,e;case T:return(e=Ou(19,r,t,i)).elementType=T,e.lanes=a,e;case O:return Bu(r,i,a,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case x:s=10;break e;case k:s=9;break e;case C:s=11;break e;case D:s=14;break e;case A:s=16,o=null;break e}throw Error(n(130,null==e?e:typeof e,""))}return(t=Ou(s,r,t,i)).elementType=e,t.type=o,t.lanes=a,t}function Ru(e,t,n,r){return(e=Ou(7,e,r,t)).lanes=n,e}function Bu(e,t,n,r){return(e=Ou(22,e,r,t)).elementType=O,e.lanes=n,e.stateNode={isHidden:!1},e}function Fu(e,t,n){return(e=Ou(6,e,null,t)).lanes=n,e}function Lu(e,t,n){return(t=Ou(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Mu(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ft(0),this.expirationTimes=ft(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ft(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Uu(e,t,n,r,o,i,a,s,l){return e=new Mu(e,t,n,s,l),1===t?(t=1,!0===i&&(t|=8)):t=0,i=Ou(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Si(i),e}function ju(e){if(!e)return _o;e:{if(Ue(e=e._reactInternals)!==e||1!==e.tag)throw Error(n(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(To(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(n(171))}if(1===e.tag){var r=e.type;if(To(r))return Oo(e,r,t)}return t}function $u(e,t,n,r,o,i,a,s,l){return(e=Uu(n,r,!0,e,0,i,0,s,l)).context=ju(null),n=e.current,(i=Di(r=Zl(),o=Xl(n))).callback=null!=t?t:null,Ai(n,i,o),e.current.lanes=o,ht(e,o,r),Jl(e,r),e}function zu(e,t,n,r){var o=t.current,i=Zl(),a=Xl(o);return n=ju(n),null===t.context?t.context=n:t.pendingContext=n,(t=Di(i,a)).payload={element:e},null!==(r=void 0===r?null:r)&&(t.callback=r),null!==(e=Ai(o,t,a))&&(Ql(e,o,a,i),Oi(e,o,a)),a}function Hu(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Vu(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function Wu(e,t){Vu(e,t),(e=e.alternate)&&Vu(e,t)}bl=function(e,t,r){if(null!==e)if(e.memoizedProps!==t.pendingProps||ko.current)gs=!0;else{if(0===(e.lanes&r)&&!(128&t.flags))return gs=!1,function(e,t,n){switch(t.tag){case 3:Cs(t),li();break;case 5:ea(t);break;case 1:To(t.type)&&Po(t);break;case 4:Qi(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Eo(pi,r._currentValue),r._currentValue=o;break;case 13:if(null!==(r=t.memoizedState))return null!==r.dehydrated?(Eo(na,1&na.current),t.flags|=128,null):0!==(n&t.child.childLanes)?Ns(e,t,n):(Eo(na,1&na.current),null!==(e=js(e,t,n))?e.sibling:null);Eo(na,1&na.current);break;case 19:if(r=0!==(n&t.childLanes),128&e.flags){if(r)return Ms(e,t,n);t.flags|=128}if(null!==(o=t.memoizedState)&&(o.rendering=null,o.tail=null,o.lastEffect=null),Eo(na,na.current),r)break;return null;case 22:case 23:return t.lanes=0,ws(e,t,n)}return js(e,t,n)}(e,t,r);gs=!!(131072&e.flags)}else gs=!1,Jo&&1048576&t.flags&&Ko(t,$o,t.index);switch(t.lanes=0,t.tag){case 2:var o=t.type;Us(e,t),e=t.pendingProps;var i=So(t,xo.current);bi(t,r),i=ya(null,t,o,e,i,r);var a=ba();return t.flags|=1,"object"==typeof i&&null!==i&&"function"==typeof i.render&&void 0===i.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,To(o)?(a=!0,Po(t)):a=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,Si(t),i.updater=Fi,t.stateNode=i,i._reactInternals=t,ji(t,o,e,r),t=ks(null,t,o,!0,a,r)):(t.tag=0,Jo&&a&&Yo(t),ms(null,t,i,r),t=t.child),t;case 16:o=t.elementType;e:{switch(Us(e,t),e=t.pendingProps,o=(i=o._init)(o._payload),t.type=o,i=t.tag=function(e){if("function"==typeof e)return Pu(e)?1:0;if(null!=e){if((e=e.$$typeof)===C)return 11;if(e===D)return 14}return 2}(o),e=di(o,e),i){case 0:t=_s(null,t,o,e,r);break e;case 1:t=xs(null,t,o,e,r);break e;case 11:t=vs(null,t,o,e,r);break e;case 14:t=ys(null,t,o,di(o.type,e),r);break e}throw Error(n(306,o,""))}return t;case 0:return o=t.type,i=t.pendingProps,_s(e,t,o,i=t.elementType===o?i:di(o,i),r);case 1:return o=t.type,i=t.pendingProps,xs(e,t,o,i=t.elementType===o?i:di(o,i),r);case 3:e:{if(Cs(t),null===e)throw Error(n(387));o=t.pendingProps,i=(a=t.memoizedState).element,Ti(e,t),Ii(t,o,null,r);var s=t.memoizedState;if(o=s.element,a.isDehydrated){if(a={element:o,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){t=Ss(e,t,o,r,i=is(Error(n(423)),t));break e}if(o!==i){t=Ss(e,t,o,r,i=is(Error(n(424)),t));break e}for(Qo=ro(t.stateNode.containerInfo.firstChild),Xo=t,Jo=!0,ei=null,r=qi(t,null,o,r),t.child=r;r;)r.flags=-3&r.flags|4096,r=r.sibling}else{if(li(),o===i){t=js(e,t,r);break e}ms(e,t,o,r)}t=t.child}return t;case 5:return ea(t),null===e&&oi(t),o=t.type,i=t.pendingProps,a=null!==e?e.memoizedProps:null,s=i.children,Zr(o,i)?s=null:null!==a&&Zr(o,a)&&(t.flags|=32),Es(e,t),ms(e,t,s,r),t.child;case 6:return null===e&&oi(t),null;case 13:return Ns(e,t,r);case 4:return Qi(t,t.stateNode.containerInfo),o=t.pendingProps,null===e?t.child=Wi(t,null,o,r):ms(e,t,o,r),t.child;case 11:return o=t.type,i=t.pendingProps,vs(e,t,o,i=t.elementType===o?i:di(o,i),r);case 7:return ms(e,t,t.pendingProps,r),t.child;case 8:case 12:return ms(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(o=t.type._context,i=t.pendingProps,a=t.memoizedProps,s=i.value,Eo(pi,o._currentValue),o._currentValue=s,null!==a)if(tr(a.value,s)){if(a.children===i.children&&!ko.current){t=js(e,t,r);break e}}else for(null!==(a=t.child)&&(a.return=t);null!==a;){var l=a.dependencies;if(null!==l){s=a.child;for(var u=l.firstContext;null!==u;){if(u.context===o){if(1===a.tag){(u=Di(-1,r&-r)).tag=2;var c=a.updateQueue;if(null!==c){var d=(c=c.shared).pending;null===d?u.next=u:(u.next=d.next,d.next=u),c.pending=u}}a.lanes|=r,null!==(u=a.alternate)&&(u.lanes|=r),yi(a.return,r,t),l.lanes|=r;break}u=u.next}}else if(10===a.tag)s=a.type===t.type?null:a.child;else if(18===a.tag){if(null===(s=a.return))throw Error(n(341));s.lanes|=r,null!==(l=s.alternate)&&(l.lanes|=r),yi(s,r,t),s=a.sibling}else s=a.child;if(null!==s)s.return=a;else for(s=a;null!==s;){if(s===t){s=null;break}if(null!==(a=s.sibling)){a.return=s.return,s=a;break}s=s.return}a=s}ms(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,o=t.pendingProps.children,bi(t,r),o=o(i=wi(i)),t.flags|=1,ms(e,t,o,r),t.child;case 14:return i=di(o=t.type,t.pendingProps),ys(e,t,o,i=di(o.type,i),r);case 15:return bs(e,t,t.type,t.pendingProps,r);case 17:return o=t.type,i=t.pendingProps,i=t.elementType===o?i:di(o,i),Us(e,t),t.tag=1,To(o)?(e=!0,Po(t)):e=!1,bi(t,r),Mi(t,o,i),ji(t,o,i,r),ks(null,t,o,!0,e,r);case 19:return Ms(e,t,r);case 22:return ws(e,t,r)}throw Error(n(156,t.tag))};var qu="function"==typeof reportError?reportError:function(e){console.error(e)};function Gu(e){this._internalRoot=e}function Ku(e){this._internalRoot=e}function Yu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Zu(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Xu(){}function Qu(e,t,n,r,o){var i=n._reactRootContainer;if(i){var a=i;if("function"==typeof o){var s=o;o=function(){var e=Hu(a);s.call(e)}}zu(t,a,e,o)}else a=function(e,t,n,r,o){if(o){if("function"==typeof r){var i=r;r=function(){var e=Hu(a);i.call(e)}}var a=$u(t,r,e,0,null,!1,0,"",Xu);return e._reactRootContainer=a,e[lo]=a.current,Fr(8===e.nodeType?e.parentNode:e),uu(),a}for(;o=e.lastChild;)e.removeChild(o);if("function"==typeof r){var s=r;r=function(){var e=Hu(l);s.call(e)}}var l=Uu(e,0,!1,null,0,!1,0,"",Xu);return e._reactRootContainer=l,e[lo]=l.current,Fr(8===e.nodeType?e.parentNode:e),uu(function(){zu(t,l,n,r)}),l}(n,t,e,o,r);return Hu(a)}Ku.prototype.render=Gu.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(n(409));zu(e,t,null,null)},Ku.prototype.unmount=Gu.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;uu(function(){zu(null,e,null,null)}),t[lo]=null}},Ku.prototype.unstable_scheduleHydration=function(e){if(e){var t=Et();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ot.length&&0!==t&&t<Ot[n].priority;n++);Ot.splice(n,0,e),0===n&&Rt(e)}},yt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=lt(t.pendingLanes);0!==n&&(gt(t,1|n),Jl(t,Ke()),!(6&kl)&&(Ml=Ke()+500,Lo()))}break;case 13:uu(function(){var t=ki(e,1);if(null!==t){var n=Zl();Ql(t,e,1,n)}}),Wu(e,1)}},bt=function(e){if(13===e.tag){var t=ki(e,134217728);null!==t&&Ql(t,e,134217728,Zl()),Wu(e,134217728)}},wt=function(e){if(13===e.tag){var t=Xl(e),n=ki(e,t);null!==n&&Ql(n,e,t,Zl()),Wu(e,t)}},Et=function(){return mt},_t=function(e,t){var n=mt;try{return mt=e,t()}finally{mt=n}},be=function(e,t,r){switch(t){case"input":if(Y(e,r),t=r.name,"radio"===r.type&&null!=t){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var o=r[t];if(o!==e&&o.form===e.form){var i=mo(o);if(!i)throw Error(n(90));V(o),Y(o,i)}}}break;case"textarea":ne(e,r);break;case"select":null!=(t=r.value)&&J(e,!!r.multiple,t,!1)}},Ce=su,Se=uu;var Ju={usingClientEntryPoint:!1,Events:[ho,go,mo,xe,ke,su]},ec={findFiberByHostInstance:fo,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},tc={bundleType:ec.bundleType,version:ec.version,rendererPackageName:ec.rendererPackageName,rendererConfig:ec.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:v.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=ze(e))?null:e.stateNode},findFiberByHostInstance:ec.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var nc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!nc.isDisabled&&nc.supportsFiber)try{tt=nc.inject(tc),nt=nc}catch(se){}}return lu.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ju,lu.createPortal=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Yu(t))throw Error(n(200));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:b,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,r)},lu.createRoot=function(e,t){if(!Yu(e))throw Error(n(299));var r=!1,o="",i=qu;return null!=t&&(!0===t.unstable_strictMode&&(r=!0),void 0!==t.identifierPrefix&&(o=t.identifierPrefix),void 0!==t.onRecoverableError&&(i=t.onRecoverableError)),t=Uu(e,1,!1,null,0,r,0,o,i),e[lo]=t.current,Fr(8===e.nodeType?e.parentNode:e),new Gu(t)},lu.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"==typeof e.render)throw Error(n(188));throw e=Object.keys(e).join(","),Error(n(268,e))}return null===(e=ze(t))?null:e.stateNode},lu.flushSync=function(e){return uu(e)},lu.hydrate=function(e,t,r){if(!Zu(t))throw Error(n(200));return Qu(null,e,t,!0,r)},lu.hydrateRoot=function(e,t,r){if(!Yu(e))throw Error(n(405));var o=null!=r&&r.hydratedSources||null,i=!1,a="",s=qu;if(null!=r&&(!0===r.unstable_strictMode&&(i=!0),void 0!==r.identifierPrefix&&(a=r.identifierPrefix),void 0!==r.onRecoverableError&&(s=r.onRecoverableError)),t=$u(t,null,e,1,null!=r?r:null,i,0,a,s),e[lo]=t.current,Fr(e),o)for(e=0;e<o.length;e++)i=(i=(r=o[e])._getVersion)(r._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new Ku(t)},lu.render=function(e,t,r){if(!Zu(t))throw Error(n(200));return Qu(null,e,t,!1,r)},lu.unmountComponentAtNode=function(e){if(!Zu(e))throw Error(n(40));return!!e._reactRootContainer&&(uu(function(){Qu(null,null,e,!1,function(){e._reactRootContainer=null,e[lo]=null})}),!0)},lu.unstable_batchedUpdates=su,lu.unstable_renderSubtreeIntoContainer=function(e,t,r,o){if(!Zu(r))throw Error(n(200));if(null==e||void 0===e._reactInternals)throw Error(n(38));return Qu(e,t,r,!1,o)},lu.version="18.2.0-next-9e3b772b8-20220608",lu}();var uu=Pn(su.exports);const cu=Symbol(),du=Symbol(),pu="a",fu="f",hu="n",gu="g",mu="w";const vu=Object.getPrototypeOf,yu=new WeakMap,bu=e=>e&&(yu.has(e)?yu.get(e):vu(e)===Object.prototype||vu(e)===Array.prototype),wu=e=>"object"==typeof e&&null!==e,Eu=e=>{if(Array.isArray(e))return Array.from(e);const t=Object.getOwnPropertyDescriptors(e);return Object.values(t).forEach(e=>{e.configurable=!0}),Object.create(vu(e),t)},_u=(e,t)=>{const n={[fu]:t};let r=!1;const o=(t,o)=>{if(!r){let r=n[pu].get(e);if(r||(r={},n[pu].set(e,r)),t===mu)r[mu]=!0;else{let e=r[t];e||(e=new Set,r[t]=e),e.add(o)}}},i={get:(t,r)=>r===du?e:(o("k",r),ku(Reflect.get(t,r),n[pu],n.c,n.t)),has:(t,i)=>i===cu?(r=!0,n[pu].delete(e),!0):(o("h",i),Reflect.has(t,i)),getOwnPropertyDescriptor:(e,t)=>(o("o",t),Reflect.getOwnPropertyDescriptor(e,t)),ownKeys:e=>(o(mu),Reflect.ownKeys(e))};return t&&(i.set=i.deleteProperty=()=>!1),[i,n]},xu=e=>e[du]||e,ku=(e,t,n,r)=>{if(!bu(e))return e;let o=r&&r.get(e);if(!o){const t=xu(e);o=(e=>Object.values(Object.getOwnPropertyDescriptors(e)).some(e=>!e.configurable&&!e.writable))(t)?[t,Eu(t)]:[t],null==r||r.set(e,o)}const[i,a]=o;let s=n&&n.get(i);return s&&s[1].f===!!a||(s=_u(i,!!a),s[1].p=((e,t)=>new Proxy(e,t))(a||i,s[0]),n&&n.set(i,s)),s[1][pu]=t,s[1].c=n,s[1].t=r,s[1].p},Cu=(e,t,n,r,o=Object.is)=>{if(o(e,t))return!1;if(!wu(e)||!wu(t))return!0;const i=n.get(xu(e));if(!i)return!0;if(r){const n=r.get(e);if(n&&n.n===t)return n.g;r.set(e,{[hu]:t,[gu]:!1})}let a=null;try{for(const n of i.h||[])if(a=Reflect.has(e,n)!==Reflect.has(t,n),a)return a;if(!0===i[mu]){if(a=((e,t)=>{const n=Reflect.ownKeys(e),r=Reflect.ownKeys(t);return n.length!==r.length||n.some((e,t)=>e!==r[t])})(e,t),a)return a}else for(const n of i.o||[]){const r=!!Reflect.getOwnPropertyDescriptor(e,n);if(a=r!==!!Reflect.getOwnPropertyDescriptor(t,n),a)return a}for(const s of i.k||[])if(a=Cu(e[s],t[s],n,r,o),a)return a;return null===a&&(a=!0),a}finally{r&&r.set(e,{[hu]:t,[gu]:a})}},Su=(e,t=!0)=>{yu.set(e,t)},Tu=new Map,Du=e=>{const t=Tu.get(e);return t?Object.fromEntries(Object.entries(t.stores).map(([e,t])=>[e,t.getState()])):{}},Au=(e,t={})=>(n,r,o)=>{const{enabled:i,anonymousActionType:a,store:s,...l}=t;let u;try{u=(null!=i?i:"production"!==(import.meta.env?import.meta.env.MODE:void 0))&&window.__REDUX_DEVTOOLS_EXTENSION__}catch(e){}if(!u)return"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&i&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,r,o);const{connection:c,...d}=((e,t,n)=>{if(void 0===e)return{type:"untracked",connection:t.connect(n)};const r=Tu.get(n.name);if(r)return{type:"tracked",store:e,...r};const o={connection:t.connect(n),stores:{}};return Tu.set(n.name,o),{type:"tracked",store:e,...o}})(s,u,l);let p=!0;o.setState=(e,t,i)=>{const u=n(e,t);if(!p)return u;const d=void 0===i?{type:a||"anonymous"}:"string"==typeof i?{type:i}:i;return void 0===s?(null==c||c.send(d,r()),u):(null==c||c.send({...d,type:`${s}/${d.type}`},{...Du(l.name),[s]:o.getState()}),u)};const f=(...e)=>{const t=p;p=!1,n(...e),p=t},h=e(o.setState,r,o);if("untracked"===d.type?null==c||c.init(h):(d.stores[d.store]=o,null==c||c.init(Object.fromEntries(Object.entries(d.stores).map(([e,t])=>[e,e===d.store?h:t.getState()])))),o.dispatchFromDevtools&&"function"==typeof o.dispatch){let e=!1;const t=o.dispatch;o.dispatch=(...n)=>{"production"===(import.meta.env?import.meta.env.MODE:void 0)||"__setState"!==n[0].type||e||(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),e=!0),t(...n)}}return c.subscribe(e=>{var t;switch(e.type){case"ACTION":return"string"!=typeof e.payload?void console.error("[zustand devtools middleware] Unsupported action format"):Ou(e.payload,e=>{if("__setState"===e.type){if(void 0===s)return void f(e.state);1!==Object.keys(e.state).length&&console.error('\n [zustand devtools middleware] Unsupported __setState action format. \n When using \'store\' option in devtools(), the \'state\' should have only one key, which is a value of \'store\' that was passed in devtools(),\n and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }\n ');const t=e.state[s];if(null==t)return;return void(JSON.stringify(o.getState())!==JSON.stringify(t)&&f(t))}o.dispatchFromDevtools&&"function"==typeof o.dispatch&&o.dispatch(e)});case"DISPATCH":switch(e.payload.type){case"RESET":return f(h),void 0===s?null==c?void 0:c.init(o.getState()):null==c?void 0:c.init(Du(l.name));case"COMMIT":return void 0===s?void(null==c||c.init(o.getState())):null==c?void 0:c.init(Du(l.name));case"ROLLBACK":return Ou(e.state,e=>{if(void 0===s)return f(e),void(null==c||c.init(o.getState()));f(e[s]),null==c||c.init(Du(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Ou(e.state,e=>{void 0!==s?JSON.stringify(o.getState())!==JSON.stringify(e[s])&&f(e[s]):f(e)});case"IMPORT_STATE":{const{nextLiftedState:n}=e.payload,r=null==(t=n.computedStates.slice(-1)[0])?void 0:t.state;if(!r)return;return f(void 0===s?r:r[s]),void(null==c||c.send(null,n))}case"PAUSE_RECORDING":return p=!p}return}}),h},Ou=(e,t)=>{let n;try{n=JSON.parse(e)}catch(e){console.error("[zustand devtools middleware] Could not parse the received json",e)}void 0!==n&&t(n)};function Pu(e,t){let n;try{n=e()}catch(e){return}const r={getItem:e=>{var t;const r=e=>null===e?null:JSON.parse(e,void 0),o=null!=(t=n.getItem(e))?t:null;return o instanceof Promise?o.then(r):r(o)},setItem:(e,t)=>n.setItem(e,JSON.stringify(t,void 0)),removeItem:e=>n.removeItem(e)};return r}const Iu=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then:e=>Iu(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>Iu(t)(e)}}},Nu=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?("production"!==(import.meta.env?import.meta.env.MODE:void 0)&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),((e,t)=>(n,r,o)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},a=!1;const s=new Set,l=new Set;let u;try{u=i.getStorage()}catch(e){}if(!u)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...e)},r,o);const c=Iu(i.serialize),d=()=>{const e=i.partialize({...r()});let t;const n=c({state:e,version:i.version}).then(e=>u.setItem(i.name,e)).catch(e=>{t=e});if(t)throw t;return n},p=o.setState;o.setState=(e,t)=>{p(e,t),d()};const f=e((...e)=>{n(...e),d()},r,o);let h;const g=()=>{var e;if(!u)return;a=!1,s.forEach(e=>e(r()));const t=(null==(e=i.onRehydrateStorage)?void 0:e.call(i,r()))||void 0;return Iu(u.getItem.bind(u))(i.name).then(e=>{if(e)return i.deserialize(e)}).then(e=>{if(e){if("number"!=typeof e.version||e.version===i.version)return e.state;if(i.migrate)return i.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(e=>{var t;return h=i.merge(e,null!=(t=r())?t:f),n(h,!0),d()}).then(()=>{null==t||t(h,void 0),a=!0,l.forEach(e=>e(h))}).catch(e=>{null==t||t(void 0,e)})};return o.persist={setOptions:e=>{i={...i,...e},e.getStorage&&(u=e.getStorage())},clearStorage:()=>{null==u||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>g(),hasHydrated:()=>a,onHydrate:e=>(s.add(e),()=>{s.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},g(),h||f})(e,t)):((e,t)=>(n,r,o)=>{let i={storage:Pu(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},a=!1;const s=new Set,l=new Set;let u=i.storage;if(!u)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...e)},r,o);const c=()=>{const e=i.partialize({...r()});return u.setItem(i.name,{state:e,version:i.version})},d=o.setState;o.setState=(e,t)=>{d(e,t),c()};const p=e((...e)=>{n(...e),c()},r,o);let f;o.getInitialState=()=>p;const h=()=>{var e,t;if(!u)return;a=!1,s.forEach(e=>{var t;return e(null!=(t=r())?t:p)});const o=(null==(t=i.onRehydrateStorage)?void 0:t.call(i,null!=(e=r())?e:p))||void 0;return Iu(u.getItem.bind(u))(i.name).then(e=>{if(e){if("number"!=typeof e.version||e.version===i.version)return e.state;if(i.migrate)return i.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}}).then(e=>{var t;return f=i.merge(e,null!=(t=r())?t:p),n(f,!0),c()}).then(()=>{null==o||o(f,void 0),f=r(),a=!0,l.forEach(e=>e(f))}).catch(e=>{null==o||o(void 0,e)})};return o.persist={setOptions:e=>{i={...i,...e},e.storage&&(u=e.storage)},clearStorage:()=>{null==u||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>h(),hasHydrated:()=>a,onHydrate:e=>(s.add(e),()=>{s.delete(e)}),onFinishHydration:e=>(l.add(e),()=>{l.delete(e)})},i.skipHydration||h(),f||p})(e,t);var Ru,Bu,Fu,Lu={exports:{}},Mu={},Uu={exports:{}},ju={};function $u(){return Bu||(Bu=1,Uu.exports=function(){if(Ru)return ju;Ru=1;var e=_a,t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=e.useState,r=e.useEffect,o=e.useLayoutEffect,i=e.useDebugValue;function a(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!t(e,r)}catch(e){return!0}}var s="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var s=t(),l=n({inst:{value:s,getSnapshot:t}}),u=l[0].inst,c=l[1];return o(function(){u.value=s,u.getSnapshot=t,a(u)&&c({inst:u})},[e,s,t]),r(function(){return a(u)&&c({inst:u}),e(function(){a(u)&&c({inst:u})})},[e]),i(s),s};return ju.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:s,ju}()),Uu.exports}
|
|
4
4
|
/**
|
|
@@ -34,4 +34,4 @@ function wp(e){return"[object Object]"===Object.prototype.toString.call(e)}funct
|
|
|
34
34
|
* focus-trap 7.5.4
|
|
35
35
|
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
|
|
36
36
|
*/
|
|
37
|
-
function z$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function H$(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z$(Object(n),!0).forEach(function(t){V$(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function V$(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}U$()(["closeOnSelect","dir","disabled","fixedWeeks","focusedValue","format","getRootNode","id","ids","isDateUnavailable","isDateUnavailable","locale","max","min","modal","name","numOfMonths","onFocusChange","onOpenChange","onValueChange","onViewChange","open","open.controlled","positioning","readOnly","selectionMode","startOfWeek","timeZone","translations","value","view"]),U$()(["index"]),U$()(["value"]),U$()(["columns","id","view"]),U$()(["disabled","value","columns"]),U$()(["view"]),j$.extendWith("view");var W$=function(e,t){if(e.length>0){var n=e[e.length-1];n!==t&&n.pause()}var r=e.indexOf(t);-1===r||e.splice(r,1),e.push(t)},q$=function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()},G$=function(e){return"Tab"===(null==e?void 0:e.key)||9===(null==e?void 0:e.keyCode)},K$=function(e){return G$(e)&&!e.shiftKey},Y$=function(e){return G$(e)&&e.shiftKey},Z$=function(e){return setTimeout(e,0)},X$=function(e,t){var n=-1;return e.every(function(e,r){return!t(e)||(n=r,!1)}),n},Q$=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"function"==typeof e?e.apply(void 0,n):e},J$=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},ez=[],tz=function(e,t){var n,r=(null==t?void 0:t.document)||document,o=(null==t?void 0:t.trapStack)||ez,i=H$({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:K$,isKeyBackward:Y$},t),a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},s=function(e,t,n){return e&&void 0!==e[t]?e[t]:i[n||t]},l=function(e,t){var n="function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():void 0;return a.containerGroups.findIndex(function(t){var r=t.container,o=t.tabbableNodes;return r.contains(e)||(null==n?void 0:n.includes(r))||o.find(function(t){return t===e})})},u=function(e){var t=i[e];if("function"==typeof t){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];t=t.apply(void 0,o)}if(!0===t&&(t=void 0),!t){if(void 0===t||!1===t)return t;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var s=t;if("string"==typeof t&&!(s=r.querySelector(t)))throw new Error("`".concat(e,"` as selector refers to no known node"));return s},c=function(){var e=u("initialFocus");if(!1===e)return!1;if(void 0===e||!XF(e,i.tabbableOptions))if(l(r.activeElement)>=0)e=r.activeElement;else{var t=a.tabbableGroups[0];e=t&&t.firstTabbableNode||u("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},d=function(){if(a.containerGroups=a.containers.map(function(e){var t=function(e,t){var n;return n=(t=t||{}).getShadowRoot?LF([e],t.includeContainer,{filter:qF.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:GF}):FF(e,t.includeContainer,qF.bind(null,t)),KF(n)}(e,i.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?LF([e],t.includeContainer,{filter:WF.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):FF(e,t.includeContainer,WF.bind(null,t))}(e,i.tabbableOptions),r=t.length>0?t[0]:void 0,o=t.length>0?t[t.length-1]:void 0,a=n.find(function(e){return YF(e)}),s=n.slice().reverse().find(function(e){return YF(e)}),l=!!t.find(function(e){return UF(e)>0});return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:l,firstTabbableNode:r,lastTabbableNode:o,firstDomTabbableNode:a,lastDomTabbableNode:s,nextTabbableNode:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=t.indexOf(e);return o<0?r?n.slice(n.indexOf(e)+1).find(function(e){return YF(e)}):n.slice(0,n.indexOf(e)).reverse().find(function(e){return YF(e)}):t[o+(r?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(e){return e.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find(function(e){return e.posTabIndexesFound})&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function e(t){var n=t.activeElement;if(n)return n.shadowRoot&&null!==n.shadowRoot.activeElement?e(n.shadowRoot):n},f=function e(t){!1!==t&&t!==p(document)&&(t&&t.focus?(t.focus({preventScroll:!!i.preventScroll}),a.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(c()))},h=function(e){var t=u("setReturnFocus",e);return t||!1!==t&&e},g=function(e){var t=e.target,n=e.event,r=e.isBackward,o=void 0!==r&&r;t=t||J$(n),d();var s=null;if(a.tabbableGroups.length>0){var c=l(t,n),p=c>=0?a.containerGroups[c]:void 0;if(c<0)s=o?a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:a.tabbableGroups[0].firstTabbableNode;else if(o){var f=X$(a.tabbableGroups,function(e){var n=e.firstTabbableNode;return t===n});if(f<0&&(p.container===t||XF(t,i.tabbableOptions)&&!YF(t,i.tabbableOptions)&&!p.nextTabbableNode(t,!1))&&(f=c),f>=0){var h=0===f?a.tabbableGroups.length-1:f-1,g=a.tabbableGroups[h];s=UF(t)>=0?g.lastTabbableNode:g.lastDomTabbableNode}else G$(n)||(s=p.nextTabbableNode(t,!1))}else{var m=X$(a.tabbableGroups,function(e){var n=e.lastTabbableNode;return t===n});if(m<0&&(p.container===t||XF(t,i.tabbableOptions)&&!YF(t,i.tabbableOptions)&&!p.nextTabbableNode(t))&&(m=c),m>=0){var v=m===a.tabbableGroups.length-1?0:m+1,y=a.tabbableGroups[v];s=UF(t)>=0?y.firstTabbableNode:y.firstDomTabbableNode}else G$(n)||(s=p.nextTabbableNode(t))}}else s=u("fallbackFocus");return s},m=function(e){var t=J$(e);l(t,e)>=0||(Q$(i.clickOutsideDeactivates,e)?n.deactivate({returnFocus:i.returnFocusOnDeactivate}):Q$(i.allowOutsideClick,e)||e.preventDefault())},v=function(e){var t=J$(e),n=l(t,e)>=0;if(n||t instanceof Document)n&&(a.mostRecentlyFocusedNode=t);else{var r;e.stopImmediatePropagation();var o=!0;if(a.mostRecentlyFocusedNode)if(UF(a.mostRecentlyFocusedNode)>0){var s=l(a.mostRecentlyFocusedNode),u=a.containerGroups[s].tabbableNodes;if(u.length>0){var d=u.findIndex(function(e){return e===a.mostRecentlyFocusedNode});d>=0&&(i.isKeyForward(a.recentNavEvent)?d+1<u.length&&(r=u[d+1],o=!1):d-1>=0&&(r=u[d-1],o=!1))}}else a.containerGroups.some(function(e){return e.tabbableNodes.some(function(e){return UF(e)>0})})||(o=!1);else o=!1;o&&(r=g({target:a.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(a.recentNavEvent)})),f(r||(a.mostRecentlyFocusedNode||c()))}a.recentNavEvent=void 0},y=function(e){if(function(e){return"Escape"===(null==e?void 0:e.key)||"Esc"===(null==e?void 0:e.key)||27===(null==e?void 0:e.keyCode)}(e)&&!1!==Q$(i.escapeDeactivates,e))return e.preventDefault(),void n.deactivate();(i.isKeyForward(e)||i.isKeyBackward(e))&&function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];a.recentNavEvent=e;var n=g({event:e,isBackward:t});n&&(G$(e)&&e.preventDefault(),f(n))}(e,i.isKeyBackward(e))},b=function(e){var t=J$(e);l(t,e)>=0||Q$(i.clickOutsideDeactivates,e)||Q$(i.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},w=function(){if(a.active)return W$(o,n),a.delayInitialFocusTimer=i.delayInitialFocus?Z$(function(){f(c())}):f(c()),r.addEventListener("focusin",v,!0),r.addEventListener("mousedown",m,{capture:!0,passive:!1}),r.addEventListener("touchstart",m,{capture:!0,passive:!1}),r.addEventListener("click",b,{capture:!0,passive:!1}),r.addEventListener("keydown",y,{capture:!0,passive:!1}),n},E=function(){if(a.active)return r.removeEventListener("focusin",v,!0),r.removeEventListener("mousedown",m,!0),r.removeEventListener("touchstart",m,!0),r.removeEventListener("click",b,!0),r.removeEventListener("keydown",y,!0),n},_="undefined"!=typeof window&&"MutationObserver"in window?new MutationObserver(function(e){var t=e.some(function(e){return Array.from(e.removedNodes).some(function(e){return e===a.mostRecentlyFocusedNode})});t&&f(c())}):void 0,x=function(){_&&(_.disconnect(),a.active&&!a.paused&&a.containers.map(function(e){_.observe(e,{subtree:!0,childList:!0})}))};return n={get active(){return a.active},get paused(){return a.paused},activate:function(e){if(a.active)return this;var t=s(e,"onActivate"),n=s(e,"onPostActivate"),o=s(e,"checkCanFocusTrap");o||d(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=r.activeElement,null==t||t();var i=function(){o&&d(),w(),x(),null==n||n()};return o?(o(a.containers.concat()).then(i,i),this):(i(),this)},deactivate:function(e){if(!a.active)return this;var t=H$({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},e);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,E(),a.active=!1,a.paused=!1,x(),q$(o,n);var r=s(t,"onDeactivate"),l=s(t,"onPostDeactivate"),u=s(t,"checkCanReturnFocus"),c=s(t,"returnFocus","returnFocusOnDeactivate");null==r||r();var d=function(){Z$(function(){c&&f(h(a.nodeFocusedBeforeActivation)),null==l||l()})};return c&&u?(u(h(a.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(e){if(a.paused||!a.active)return this;var t=s(e,"onPause"),n=s(e,"onPostPause");return a.paused=!0,null==t||t(),E(),x(),null==n||n(),this},unpause:function(e){if(!a.paused||!a.active)return this;var t=s(e,"onUnpause"),n=s(e,"onPostUnpause");return a.paused=!1,null==t||t(),d(),w(),x(),null==n||n(),this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return a.containers=t.map(function(e){return"string"==typeof e?r.querySelector(e):e}),a.active&&d(),x(),this}},n.updateContainerElements(e),n};E$("field").parts("root","errorText","helperText","input","label","select","textarea"),E$("fieldset").parts("root","errorText","helperText","legend");function nz(e){return(e=>e.nodeType===Node.DOCUMENT_NODE)(e)?e:(e=>null!=e&&e===e.window)(e)?e.document:e?.ownerDocument??document}var rz=()=>e=>Array.from(new Set(e)),oz=E$("radio-group").parts("root","label","item","itemText","itemControl","indicator");oz.build();var iz=function(e){const t={getRootNode:e=>e.getRootNode?.()??document,getDoc:e=>nz(t.getRootNode(e)),getWin:e=>t.getDoc(e).defaultView??window,getActiveElement:e=>t.getRootNode(e).activeElement,isActiveElement:(e,n)=>n===t.getActiveElement(e),getById:(e,n)=>t.getRootNode(e).getElementById(n),setValue:(e,t)=>{if(null==e||null==t)return;const n=t.toString();e.value!==n&&(e.value=t.toString())}};return{...t,...e}}({getRootId:e=>e.ids?.root??`radio-group:${e.id}`,getLabelId:e=>e.ids?.label??`radio-group:${e.id}:label`,getItemId:(e,t)=>e.ids?.item?.(t)??`radio-group:${e.id}:radio:${t}`,getItemHiddenInputId:(e,t)=>e.ids?.itemHiddenInput?.(t)??`radio-group:${e.id}:radio:input:${t}`,getItemControlId:(e,t)=>e.ids?.itemControl?.(t)??`radio-group:${e.id}:radio:control:${t}`,getItemLabelId:(e,t)=>e.ids?.itemLabel?.(t)??`radio-group:${e.id}:radio:label:${t}`,getIndicatorId:e=>e.ids?.indicator??`radio-group:${e.id}:indicator`,getRootEl:e=>iz.getById(e,iz.getRootId(e)),getItemHiddenInputEl:(e,t)=>iz.getById(e,iz.getItemHiddenInputId(e,t)),getIndicatorEl:e=>iz.getById(e,iz.getIndicatorId(e)),getFirstEnabledInputEl:e=>iz.getRootEl(e)?.querySelector("input:not(:disabled)"),getFirstEnabledAndCheckedInputEl:e=>iz.getRootEl(e)?.querySelector("input:not(:disabled):checked"),getInputEls:e=>{const t=`input[type=radio][data-ownedby='${CSS.escape(iz.getRootId(e))}']:not([disabled])`;return function(e,t){return Array.from(e?.querySelectorAll(t)??[])}(iz.getRootEl(e),t)},getActiveRadioEl:e=>{if(e.value)return iz.getById(e,iz.getItemId(e,e.value))},getOffsetRect:e=>({left:e?.offsetLeft??0,top:e?.offsetTop??0,width:e?.offsetWidth??0,height:e?.offsetHeight??0}),getRectById:(e,t)=>{const n=iz.getById(e,iz.getItemId(e,t));if(n)return iz.resolveRect(iz.getOffsetRect(n))},resolveRect:e=>({width:`${e.width}px`,height:`${e.height}px`,left:`${e.left}px`,top:`${e.top}px`})});function az(e){const t=CF(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=cF(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=IB(n)!==i||IB(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function sz(e){return uF(e)?e:e.contextElement}function lz(e){const t=sz(e);if(!cF(t))return RB(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=az(t);let a=(i?IB(n.width):n.width)/r,s=(i?IB(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}rz()(["dir","disabled","form","getRootNode","id","ids","name","onValueChange","orientation","readOnly","value"]),rz()(["value","disabled","invalid"]),oz.rename("segment-group");const uz=RB(0);function cz(e){const t=aF(e);return _F()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:uz}function dz(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=sz(e);let a=RB(1);t&&(r?uF(r)&&(a=lz(r)):a=lz(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==aF(e))&&t}(i,n,r)?cz(i):RB(0);let l=(o.left+s.x)/a.x,u=(o.top+s.y)/a.y,c=o.width/a.x,d=o.height/a.y;if(i){const e=aF(i),t=r&&uF(r)?aF(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=lz(o),t=o.getBoundingClientRect(),r=CF(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,u*=e.y,c*=e.x,d*=e.y,l+=i,u+=a,n=aF(o),o=n.frameElement}}return eF({width:c,height:d,x:l,y:u})}const pz=[":popover-open",":modal"];function fz(e){return pz.some(t=>{try{return e.matches(t)}catch(e){return!1}})}function hz(e){return dz(sF(e)).left+SF(e).scrollLeft}function gz(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=aF(e),r=sF(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=_F();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=sF(e),n=SF(e),r=e.ownerDocument.body,o=PB(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=PB(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+hz(e);const s=-n.scrollTop;return"rtl"===CF(r).direction&&(a+=PB(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(sF(e));else if(uF(t))r=function(e,t){const n=dz(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=cF(e)?lz(e):RB(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=cz(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return eF(r)}function mz(e,t){const n=TF(e);return!(n===t||!uF(n)||kF(n))&&("fixed"===CF(n).position||mz(n,t))}function vz(e,t,n){const r=cF(t),o=sF(t),i="fixed"===n,a=dz(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=RB(0);if(r||!r&&!i)if(("body"!==iF(t)||fF(o))&&(s=SF(t)),r){const e=dz(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=hz(o));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function yz(e){return"static"===CF(e).position}function bz(e,t){return cF(e)&&"fixed"!==CF(e).position?t?t(e):e.offsetParent:null}function wz(e,t){const n=aF(e);if(fz(e))return n;if(!cF(e)){let t=TF(e);for(;t&&!kF(t);){if(uF(t)&&!yz(t))return t;t=TF(t)}return n}let r=bz(e,t);for(;r&&gF(r)&&yz(r);)r=bz(r,t);return r&&kF(r)&&yz(r)&&!EF(r)?n:r||function(e){let t=TF(e);for(;cF(t)&&!kF(t);){if(EF(t))return t;if(vF(t))return null;t=TF(t)}return null}(e)||n}const Ez={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=sF(r),s=!!t&&fz(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},u=RB(1);const c=RB(0),d=cF(r);if((d||!d&&!i)&&(("body"!==iF(r)||fF(a))&&(l=SF(r)),cF(r))){const e=dz(r);u=lz(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x,y:n.y*u.y-l.scrollTop*u.y+c.y}},getDocumentElement:sF,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?fz(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=AF(e,[],!1).filter(e=>uF(e)&&"body"!==iF(e)),o=null;const i="fixed"===CF(e).position;let a=i?TF(e):e;for(;uF(a)&&!kF(a);){const t=CF(a),n=EF(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||fF(a)&&!n&&mz(e,a))?r=r.filter(e=>e!==a):o=t,a=TF(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...i,r],s=a[0],l=a.reduce((e,n)=>{const r=gz(t,n,o);return e.top=PB(r.top,e.top),e.right=OB(r.right,e.right),e.bottom=OB(r.bottom,e.bottom),e.left=PB(r.left,e.left),e},gz(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:wz,getElementRects:async function(e){const t=this.getOffsetParent||wz,n=this.getDimensions,r=await n(e.floating);return{reference:vz(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=az(e);return{width:t,height:n}},getScale:lz,isElement:uF,isRTL:function(e){return"rtl"===CF(e).direction}};function _z(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,u=sz(e),c=o||i?[...u?AF(u):[],...AF(t)]:[];c.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=u&&s?function(e,t){let n,r=null;const o=sF(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const{left:u,top:c,width:d,height:p}=e.getBoundingClientRect();if(s||t(),!d||!p)return;const f={rootMargin:-NB(c)+"px "+-NB(o.clientWidth-(u+d))+"px "+-NB(o.clientHeight-(c+p))+"px "+-NB(u)+"px",threshold:PB(0,OB(1,l))||1};let h=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return a();t?a(!1,t):n=setTimeout(()=>{a(!1,1e-7)},1e3)}h=!1}try{r=new IntersectionObserver(g,{...f,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,f)}r.observe(e)}(!0),i}(u,n):null;let p,f=-1,h=null;a&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let g=l?dz(e):null;return l&&function t(){const r=dz(e);!g||r.x===g.x&&r.y===g.y&&r.width===g.width&&r.height===g.height||n();g=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const xz=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=UB(n),s=jB(n),l="y"===VB(n),u=rF.has(a)?-1:1,c=i&&l?-1:1,d=MB(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(f="end"===s?-1*h:h),l?{x:f*c,y:p*u}:{x:p*u,y:f*c}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},kz=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=MB(e,t),c={x:n,y:r},d=await i.detectOverflow(t,u),p=VB(UB(o)),f=$B(p);let h=c[f],g=c[p];if(a){const e="y"===f?"bottom":"right";h=LB(h+d["y"===f?"top":"left"],h,h-d[e])}if(s){const e="y"===p?"bottom":"right";g=LB(g+d["y"===p?"top":"left"],g,g-d[e])}const m=l.fn({...t,[f]:h,[p]:g});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[f]:a,[p]:s}}}}}},Cz=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...m}=MB(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=UB(o),y=VB(s),b=UB(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(u.floating)),E=p||(b||!g?[QB(s)]:function(e){const t=QB(e);return[qB(e),t,qB(t)]}(s)),_="none"!==h;!p&&_&&E.push(...XB(s,g,h,w));const x=[s,...E],k=await l.detectOverflow(t,m),C=[];let S=(null==(r=i.flip)?void 0:r.overflows)||[];if(c&&C.push(k[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=jB(e),o=WB(e),i=zB(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=QB(a)),[a,QB(a)]}(o,a,w);C.push(k[e[0]],k[e[1]])}if(S=[...S,{placement:o,overflows:C}],!C.every(e=>e<=0)){var T,D;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=x[e];if(t){if(!("alignment"===d&&y!==VB(t))||S.every(e=>VB(e.placement)!==y||e.overflows[0]>0))return{data:{index:e,overflows:S},reset:{placement:t}}}let n=null==(D=S.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:D.placement;if(!n)switch(f){case"bestFit":{var A;const e=null==(A=S.filter(e=>{if(_){const t=VB(e.placement);return t===y||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:A[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},Sz=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...u}=MB(e,t),c=await a.detectOverflow(t,u),d=UB(o),p=jB(o),f="y"===VB(o),{width:h,height:g}=i.floating;let m,v;"top"===d||"bottom"===d?(m=d,v=p===(await(null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,m="end"===p?"top":"bottom");const y=g-c.top-c.bottom,b=h-c.left-c.right,w=OB(g-c[m],y),E=OB(h-c[v],b),_=!t.middlewareData.shift;let x=w,k=E;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(k=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(x=y),_&&!p){const e=PB(c.left,0),t=PB(c.right,0),n=PB(c.top,0),r=PB(c.bottom,0);f?k=h-2*(0!==e||0!==t?e+t:PB(c.left,c.right)):x=g-2*(0!==n||0!==r?n+r:PB(c.top,c.bottom))}await l({...t,availableWidth:k,availableHeight:x});const C=await a.getDimensions(s.floating);return h!==C.width||g!==C.height?{reset:{rects:!0}}:{}}}},Tz=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:u,padding:c=0}=MB(e,t)||{};if(null==u)return{};const d=JB(c),p={x:n,y:r},f=WB(o),h=zB(f),g=await a.getDimensions(u),m="y"===f,v=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[f]-p[f]-i.floating[h],E=p[f]-i.reference[f],_=await(null==a.getOffsetParent?void 0:a.getOffsetParent(u));let x=_?_[b]:0;x&&await(null==a.isElement?void 0:a.isElement(_))||(x=s.floating[b]||i.floating[h]);const k=w/2-E/2,C=x/2-g[h]/2-1,S=OB(d[v],C),T=OB(d[y],C),D=S,A=x-g[h]-T,O=x/2-g[h]/2+k,P=LB(D,O,A),I=!l.arrow&&null!=jB(o)&&O!==P&&i.reference[h]/2-(O<D?S:T)-g[h]/2<0,N=I?O<D?O-D:O-A:0;return{[f]:p[f]+N,data:{[f]:P,centerOffset:O-P-N,...I&&{alignmentOffset:N}},reset:I}}}),Dz=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=MB(e,t),c={x:n,y:r},d=VB(o),p=$B(d);let f=c[p],h=c[d];const g=MB(s,t),m="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const e="y"===p?"height":"width",t=i.reference[p]-i.floating[e]+m.mainAxis,n=i.reference[p]+i.reference[e]-m.mainAxis;f<t?f=t:f>n&&(f=n)}if(u){var v,y;const e="y"===p?"width":"height",t=rF.has(UB(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=a.offset)?void 0:v[d])||0)+(t?0:m.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[d])||0)-(t?m.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[p]:f,[d]:h}}}},Az=(e,t,n)=>{const r=new Map,o={platform:Ez,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=tF(u,r,l),p=r,f={},h=0;for(let n=0;n<s.length;n++){var g;const{name:i,fn:m}=s[n],{x:v,y:y,data:b,reset:w}=await m({x:c,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:u,platform:{...a,detectOverflow:null!=(g=a.detectOverflow)?g:nF},elements:{reference:e,floating:t}});c=null!=v?v:c,d=null!=y?y:d,f={...f,[i]:{...f[i],...b}},w&&h<=50&&(h++,"object"==typeof w&&(w.placement&&(p=w.placement),w.rects&&(u=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:c,y:d}=tF(u,p,l))),n=-1)}return{x:c,y:d,placement:p,strategy:o,middlewareData:f}})(e,t,{...o,platform:i})};function Oz(e=0,t=0,n=0,r=0){if("function"==typeof DOMRect)return new DOMRect(e,t,n,r);const o={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...o,toJSON:()=>o}}function Pz(e,t){return{contextElement:Ej(e)?e:void 0,getBoundingClientRect:()=>{const n=e,r=t?.(n);return r||!n?function(e){if(!e)return Oz();const{x:t,y:n,width:r,height:o}=e;return Oz(t,n,r,o)}(r):n.getBoundingClientRect()}}}var Iz=e=>({variable:e,reference:`var(${e})`}),Nz={arrowSize:Iz("--arrow-size"),arrowSizeHalf:Iz("--arrow-size-half"),arrowBg:Iz("--arrow-background"),transformOrigin:Iz("--transform-origin"),arrowOffset:Iz("--arrow-offset")},Rz={name:"transformOrigin",fn({placement:e,elements:t,middlewareData:n}){const{arrow:r}=n,o=(e=>({top:"bottom center","top-start":e?`${e.x}px bottom`:"left bottom","top-end":e?`${e.x}px bottom`:"right bottom",bottom:"top center","bottom-start":e?`${e.x}px top`:"top left","bottom-end":e?`${e.x}px top`:"top right",left:"right center","left-start":e?`right ${e.y}px`:"right top","left-end":e?`right ${e.y}px`:"right bottom",right:"left center","right-start":e?`left ${e.y}px`:"left top","right-end":e?`left ${e.y}px`:"left bottom"}))(r)[e],{floating:i}=t;return i.style.setProperty(Nz.transformOrigin.variable,o),{data:{transformOrigin:o}}}},Bz={name:"rects",fn:({rects:e})=>({data:e})},Fz=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:r,y:o}=n.arrow,i=t.split("-")[0];return Object.assign(e.style,{left:null!=r?`${r}px`:"",top:null!=o?`${o}px`:"",[i]:`calc(100% + ${Nz.arrowOffset.reference})`}),{}}}};var Lz={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function Mz(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function Uz(e){return r$(e.boundary)}function jz(e,t){if(e)return Tz({element:e,padding:t.arrowPadding})}function $z(e,t){if(null!=(t.offset??t.gutter))return xz(({placement:n})=>{const r=(e?.clientHeight||0)/2,o=t.offset?.mainAxis??t.gutter,i="number"==typeof o?o+r:o??r,{hasAlign:a}=function(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:null!=n}}(n),s=a?void 0:t.shift;return u$({crossAxis:t.offset?.crossAxis??s,mainAxis:i,alignmentAxis:t.shift})})}function zz(e){if(e.flip)return Cz({boundary:Uz(e),padding:e.overflowPadding,fallbackPlacements:!0===e.flip?void 0:e.flip})}function Hz(e){if(e.slide||e.overlap)return kz({boundary:Uz(e),mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:Dz()})}function Vz(e){return Sz({padding:e.overflowPadding,apply({elements:e,rects:t,availableHeight:n,availableWidth:r}){const o=e.floating,i=Math.round(t.reference.width);r=Math.floor(r),n=Math.floor(n),o.style.setProperty("--reference-width",`${i}px`),o.style.setProperty("--available-width",`${r}px`),o.style.setProperty("--available-height",`${n}px`)}})}function Wz(e,t,n={}){const{defer:r,...o}=n,i=r?qj:e=>e(),a=[];return a.push(i(()=>{const n="function"==typeof e?e():e,r="function"==typeof t?t():t;a.push(function(e,t,n={}){const r=Pz(e,n.getAnchorRect);if(!t||!r)return;const o=Object.assign({},Lz,n),i=t.querySelector("[data-part=arrow]"),a=[$z(i,o),zz(o),Hz(o),jz(i,o),Fz(i),Rz,Vz(o),Bz],{placement:s,strategy:l,onComplete:u,onPositioned:c}=o,d=async()=>{if(!r||!t)return;const e=await Az(r,t,{placement:s,middleware:a,strategy:l});u?.(e),c?.({placed:!0});const n=Cj(t),o=Mz(n,e.x),i=Mz(n,e.y);t.style.setProperty("--x",`${o}px`),t.style.setProperty("--y",`${i}px`);const d=t.firstElementChild;if(d){const e=n.getComputedStyle(d).zIndex;t.style.setProperty("--z-index",e)}},p=async()=>{n.updatePosition?(await n.updatePosition({updatePosition:d}),c?.({placed:!0})):await d()},f=function(e){return e?!0===e?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}(o.listeners),h=o.listeners?_z(r,t,p,f):o$;return p(),()=>{h?.(),c?.({placed:!1})}}(n,r,o))})),()=>{a.forEach(e=>e?.())}}var qz={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};var Gz="pointerdown.outside",Kz="focus.outside";function Yz(e){for(const t of e)if(Ej(t)&&Uj(t))return!0;return!1}var Zz=e=>"clientY"in e;function Xz(e,t){const{exclude:n,onFocusOutside:r,onPointerDownOutside:o,onInteractOutside:i,defer:a}=t;if(!e)return;const s=kj(e),l=function(e){const t={each(t){for(let n=0;n<e.frames?.length;n+=1){const r=e.frames[n];r&&t(r)}},addEventListener:(e,n,r)=>(t.each(t=>{try{t.document.addEventListener(e,n,r)}catch{}}),()=>{try{t.removeEventListener(e,n,r)}catch{}}),removeEventListener(e,n,r){t.each(t=>{try{t.document.removeEventListener(e,n,r)}catch{}})}};return t}(Cj(e));function u(t){const r=Aj(t);return!!Ej(r)&&(!xj(e,r)&&(!function(e,t){if(!Zz(t)||!e)return!1;const n=e.getBoundingClientRect();return 0!==n.width&&0!==n.height&&n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}(e,t)&&(!function(e){const t=Aj(e);if(!t||!Zz(e))return!1;const n=t.scrollHeight>t.clientHeight&&e.clientX>t.clientWidth,r=t.scrollWidth>t.clientWidth&&e.clientY>t.clientHeight;return n||r}(t)&&!n?.(r))))}let c;function d(t){function n(){const n=a?qj:e=>e(),r=t.composedPath?.()??[t.target];n(()=>{if(e&&u(t)){if(o||i){const t=i$(o,i);e.addEventListener(Gz,t,{once:!0})}m$(e,Gz,{bubbles:!1,cancelable:!0,detail:{originalEvent:t,contextmenu:h$(t),focusable:Yz(r)}})}})}"touch"===t.pointerType?(l.removeEventListener("click",n),s.removeEventListener("click",n),c=n,s.addEventListener("click",n,{once:!0}),l.addEventListener("click",n,{once:!0})):n()}const p=new Set,f=setTimeout(()=>{p.add(l.addEventListener("pointerdown",d,!0)),p.add(p$(s,"pointerdown",d,!0))},0);function h(t){(a?qj:e=>e())(()=>{if(e&&u(t)){if(r||i){const t=i$(r,i);e.addEventListener(Kz,t,{once:!0})}m$(e,Kz,{bubbles:!1,cancelable:!0,detail:{originalEvent:t,contextmenu:!1,focusable:Uj(Aj(t))}})}})}return p.add(p$(s,"focusin",h,!0)),p.add(l.addEventListener("focusin",h,!0)),()=>{clearTimeout(f),c&&(l.removeEventListener("click",c),s.removeEventListener("click",c)),p.forEach(e=>e())}}function Qz(e,t){const{defer:n}=t,r=n?qj:e=>e(),o=[];return o.push(r(()=>{const n="function"==typeof e?e():e;o.push(Xz(n,t))})),()=>{o.forEach(e=>e?.())}}function Jz(e,t){return p$(kj(e),"keydown",e=>{"Escape"===e.key&&(e.isComposing||t?.(e))},{capture:!0})}var eH,tH={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){return this.indexOf(e)<(this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1)},isTopMost(e){const t=this.layers[this.count()-1];return t?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},isInNestedLayer(e,t){return this.getNestedLayers(e).some(e=>xj(e.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>xj(t,e))},add(e){const t=this.layers.push(e);e.node.style.setProperty("--layer-index",`${t}`)},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);if(!(t<0)){if(t<this.count()-1){this.getNestedLayers(e).forEach(e=>e.dismiss())}this.layers.splice(t,1),e.style.removeProperty("--layer-index")}},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e){this.layers[this.indexOf(e)]?.dismiss()},clear(){this.remove(this.layers[0].node)}};function nH(){tH.layers.forEach(({node:e})=>{e.style.pointerEvents=tH.isBelowPointerBlockingLayer(e)?"none":"auto"})}function rH(e,t){const n=kj(e),r=[];if(tH.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(eH=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),t){const e=e$(t,e=>{r.push(Qj(e,{pointerEvents:"auto"}))});r.push(e)}return()=>{tH.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=eH,n.body.removeAttribute("data-inert"),0===n.body.style.length&&n.body.removeAttribute("style")}),r.forEach(e=>e()))}}function oH(e,t){const{defer:n}=t,r=n?qj:e=>e(),o=[];return o.push(r(()=>{const n=l$(e)?e():e;o.push(function(e,t){if(!e)return void d$("[@zag-js/dismissable] node is `null` or `undefined`");const{onDismiss:n,pointerBlocking:r,exclude:o,debug:i}=t,a={dismiss:n,node:e,pointerBlocking:r};tH.add(a),nH();const s=[r?rH(e,t.persistentElements):void 0,Jz(e,function(r){tH.isTopMost(e)&&(t.onEscapeKeyDown?.(r),!r.defaultPrevented&&n&&(r.preventDefault(),n()))}),Qz(e,{exclude:function(n){if(!e)return!1;const r="function"==typeof o?o():o,i=Array.isArray(r)?r:[r],a=t.persistentElements?.map(e=>e()).filter(Ej);return a&&i.push(...a),i.some(e=>xj(e,n))||tH.isInNestedLayer(e,n)},onFocusOutside:function(e){const r=Aj(e.detail.originalEvent);tH.isInBranch(r)||(t.onFocusOutside?.(e),t.onInteractOutside?.(e),e.defaultPrevented||(i&&console.log("onFocusOutside:",e.detail.originalEvent),n?.()))},onPointerDownOutside:function(r){const o=Aj(r.detail.originalEvent);tH.isBelowPointerBlockingLayer(e)||tH.isInBranch(o)||(t.onPointerDownOutside?.(r),t.onInteractOutside?.(r),r.defaultPrevented||(i&&console.log("onPointerDownOutside:",r.detail.originalEvent),n?.()))},defer:t.defer})];return()=>{tH.remove(e),nH(),function(e){e.style.pointerEvents=""}(e),s.forEach(e=>e?.())}}(n,t))})),()=>{o.forEach(e=>e?.())}}function iH(e){return e?.animationName||"none"}rj()(["onExitComplete","present","immediate"]);var aH=new WeakMap,sH=[];function lH(e,t={}){const{defer:n}=t,r=n?qj:e=>e(),o=[];return o.push(r(()=>{const n="function"==typeof e?e():e;o.push(function(e,t={}){const{rootEl:n}=t,r=e.filter(Boolean);if(0===r.length)return;const o=r[0].ownerDocument||document,i=o.defaultView??window,a=new Set(r),s=new Set,l=n??o.body;let u=e=>{for(let t of e.querySelectorAll("[data-live-announcer], [data-zag-top-layer]"))a.add(t);let t=e=>{if(a.has(e)||s.has(e.parentElement)&&"row"!==e.parentElement.getAttribute("role"))return NodeFilter.FILTER_REJECT;for(let t of a)if(e.contains(t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},n=o.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),r=t(e);if(r===NodeFilter.FILTER_ACCEPT&&c(e),r!==NodeFilter.FILTER_REJECT){let e=n.nextNode();for(;null!=e;)c(e),e=n.nextNode()}},c=e=>{let t=aH.get(e)??0;"true"===e.getAttribute("aria-hidden")&&0===t||(0===t&&e.setAttribute("aria-hidden","true"),s.add(e),aH.set(e,t+1))};sH.length&&sH[sH.length-1].disconnect(),u(l);const d=new i.MutationObserver(e=>{for(let t of e)if("childList"===t.type&&0!==t.addedNodes.length&&![...a,...s].some(e=>e.contains(t.target))){for(let e of t.removedNodes)e instanceof i.Element&&(a.delete(e),s.delete(e));for(let e of t.addedNodes)!(e instanceof i.HTMLElement||e instanceof i.SVGElement)||"true"!==e.dataset.liveAnnouncer&&"true"!==e.dataset.zagTopLayer?e instanceof i.Element&&u(e):a.add(e)}});d.observe(l,{childList:!0,subtree:!0});let p={observe(){d.observe(l,{childList:!0,subtree:!0})},disconnect(){d.disconnect()}};return sH.push(p),()=>{d.disconnect();for(let e of s){let t=aH.get(e);1===t?(e.removeAttribute("aria-hidden"),aH.delete(e)):aH.set(e,t-1)}p===sH[sH.length-1]?(sH.pop(),sH.length&&sH[sH.length-1].observe()):sH.splice(sH.indexOf(p),1)}}(n,t))})),()=>{o.forEach(e=>e?.())}}var uH=(e,t=[])=>({parts:(...n)=>{if(dH(t))return uH(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>uH(e,[...t,...n]),rename:e=>uH(e,t),keys:()=>t,build:()=>[...new Set(t)].reduce((t,n)=>Object.assign(t,{[n]:{selector:[`&[data-scope="${cH(e)}"][data-part="${cH(n)}"]`,`& [data-scope="${cH(e)}"][data-part="${cH(n)}"]`].join(", "),attrs:{"data-scope":cH(e),"data-part":cH(n)}}}),{})}),cH=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),dH=e=>0===e.length,pH="data-zag-scroll-lock";function fH(e,t){if(!e)return;const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function hH(e){const t=e??document,n=t.defaultView??window,{documentElement:r,body:o}=t;if(o.hasAttribute(pH))return;o.setAttribute(pH,"");const i=n.innerWidth-r.clientWidth,a=function(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}(r),s=[function(e,t,n){if(!e)return;const r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{r?e.style.setProperty(t,r):e.style.removeProperty(t)}}(r,"--scrollbar-width",`${i}px`),Tj(/iP(hone|ad|od)|iOS/)?(()=>{const{scrollX:e,scrollY:t,visualViewport:r}=n,s=r?.offsetLeft??0,l=r?.offsetTop??0,u=fH(o,{position:"fixed",overflow:"hidden",top:-(t-Math.floor(l))+"px",left:-(e-Math.floor(s))+"px",right:"0",[a]:`${i}px`});return()=>{u?.(),n.scrollTo({left:e,top:t,behavior:"instant"})}})():fH(o,{overflow:"hidden",[a]:`${i}px`})];return()=>{s.forEach(e=>e?.()),o.removeAttribute(pH)}}var gH=uH("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger").build(),mH=Yj({getPositionerId:e=>e.ids?.positioner??`dialog:${e.id}:positioner`,getBackdropId:e=>e.ids?.backdrop??`dialog:${e.id}:backdrop`,getContentId:e=>e.ids?.content??`dialog:${e.id}:content`,getTriggerId:e=>e.ids?.trigger??`dialog:${e.id}:trigger`,getTitleId:e=>e.ids?.title??`dialog:${e.id}:title`,getDescriptionId:e=>e.ids?.description??`dialog:${e.id}:description`,getCloseTriggerId:e=>e.ids?.closeTrigger??`dialog:${e.id}:close`,getContentEl:e=>mH.getById(e,mH.getContentId(e)),getPositionerEl:e=>mH.getById(e,mH.getPositionerId(e)),getBackdropEl:e=>mH.getById(e,mH.getBackdropId(e)),getTriggerEl:e=>mH.getById(e,mH.getTriggerId(e)),getTitleEl:e=>mH.getById(e,mH.getTitleId(e)),getDescriptionEl:e=>mH.getById(e,mH.getDescriptionId(e)),getCloseTriggerEl:e=>mH.getById(e,mH.getCloseTriggerId(e))});function vH(e){const t=u$(e);return XU({id:"dialog",initial:t.open?"open":"closed",context:{role:"dialog",renderedElements:{title:!0,description:!0},modal:!0,trapFocus:!0,preventScroll:!0,closeOnInteractOutside:!0,closeOnEscape:!0,restoreFocus:!0,...t},created:["checkInitialFocusEl"],watch:{open:["toggleVisibility"]},states:{open:{entry:["checkRenderedElements","syncZIndex"],activities:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed",actions:["setFinalFocus"]},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose","setFinalFocus"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose","setFinalFocus"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}}},{guards:{isOpenControlled:e=>!!e["open.controlled"]},activities:{trackDismissableElement:(e,t,{send:n})=>oH(()=>mH.getContentEl(e),{defer:!0,pointerBlocking:e.modal,exclude:[mH.getTriggerEl(e)],onInteractOutside(t){e.onInteractOutside?.(t),e.closeOnInteractOutside&&"alertdialog"!==e.role||t.preventDefault()},persistentElements:e.persistentElements,onFocusOutside:e.onFocusOutside,onPointerDownOutside:e.onPointerDownOutside,onEscapeKeyDown(t){e.onEscapeKeyDown?.(t),e.closeOnEscape?n({type:"CLOSE",src:"escape-key"}):t.preventDefault()},onDismiss(){n({type:"CLOSE",src:"interact-outside"})}}),preventScroll(e){if(e.preventScroll)return hH(mH.getDoc(e))},trapFocus(e){if(!e.trapFocus||!e.modal)return;let t;const n=function(e){const t=new Set;function n(e){const n=globalThis.requestAnimationFrame(e);t.add(()=>globalThis.cancelAnimationFrame(n))}return n(()=>n(e)),function(){t.forEach(e=>e())}}(()=>{const n=mH.getContentEl(e);if(n){t=tz(n,{document:mH.getDoc(e),escapeDeactivates:!1,preventScroll:!0,returnFocusOnDeactivate:!1,fallbackFocus:n,allowOutsideClick:!0,initialFocus:zj({root:n,getInitialEl:e.initialFocusEl})});try{t.activate()}catch{}}});return()=>{t?.deactivate(),n()}},hideContentBelow(e){if(!e.modal)return;return lH(()=>[mH.getContentEl(e)],{defer:!0})}},actions:{checkInitialFocusEl(e){e.initialFocusEl||"alertdialog"!==e.role||(e.initialFocusEl=()=>mH.getCloseTriggerEl(e))},checkRenderedElements(e){qj(()=>{e.renderedElements.title=!!mH.getTitleEl(e),e.renderedElements.description=!!mH.getDescriptionEl(e)})},syncZIndex(e){qj(()=>{const t=mH.getContentEl(e);if(!t)return;const n=mH.getWin(e).getComputedStyle(t);[mH.getPositionerEl(e),mH.getBackdropEl(e)].forEach(e=>{e?.style.setProperty("--z-index",n.zIndex)})})},invokeOnClose(e){e.onOpenChange?.({open:!1})},invokeOnOpen(e){e.onOpenChange?.({open:!0})},toggleVisibility(e,t,{send:n}){n({type:e.open?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:t})},setFinalFocus(e){e.restoreFocus&&queueMicrotask(()=>{const t=e.finalFocusEl?.()??mH.getTriggerEl(e);t?.focus({preventScroll:!0})})}}})}rj()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open.controlled","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);var yH=(e,t=[])=>({parts:(...n)=>{if(wH(t))return yH(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>yH(e,[...t,...n]),rename:e=>yH(e,t),keys:()=>t,build:()=>[...new Set(t)].reduce((t,n)=>Object.assign(t,{[n]:{selector:[`&[data-scope="${bH(e)}"][data-part="${bH(n)}"]`,`& [data-scope="${bH(e)}"][data-part="${bH(n)}"]`].join(", "),attrs:{"data-scope":bH(e),"data-part":bH(n)}}}),{})}),bH=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),wH=e=>0===e.length,EH=(e,t)=>({x:e,y:t});function _H(e,t){const n=function(e){const{x:t,y:n,width:r,height:o}=e,i=t+r/2,a=n+o/2;return{x:t,y:n,width:r,height:o,minX:t,minY:n,maxX:t+r,maxY:n+o,midX:i,midY:a,center:EH(i,a)}}(e),{top:r,right:o,left:i,bottom:a}={top:EH((s=n).minX,s.minY),right:EH(s.maxX,s.minY),bottom:EH(s.maxX,s.maxY),left:EH(s.minX,s.maxY)};var s;const[l]=t.split("-");return{top:[i,r,o,a],right:[r,o,a,i],bottom:[r,i,a,o],left:[o,r,i,a]}[l]}var xH=yH("menu").parts("arrow","arrowTip","content","contextTrigger","indicator","item","itemGroup","itemGroupLabel","itemIndicator","itemText","positioner","separator","trigger","triggerItem").build(),kH=Yj({getTriggerId:e=>e.ids?.trigger??`menu:${e.id}:trigger`,getContextTriggerId:e=>e.ids?.contextTrigger??`menu:${e.id}:ctx-trigger`,getContentId:e=>e.ids?.content??`menu:${e.id}:content`,getArrowId:e=>e.ids?.arrow??`menu:${e.id}:arrow`,getPositionerId:e=>e.ids?.positioner??`menu:${e.id}:popper`,getGroupId:(e,t)=>e.ids?.group?.(t)??`menu:${e.id}:group:${t}`,getGroupLabelId:(e,t)=>e.ids?.label?.(t)??`menu:${e.id}:label:${t}`,getContentEl:e=>kH.getById(e,kH.getContentId(e)),getPositionerEl:e=>kH.getById(e,kH.getPositionerId(e)),getTriggerEl:e=>kH.getById(e,kH.getTriggerId(e)),getHighlightedItemEl:e=>e.highlightedValue?kH.getById(e,e.highlightedValue):null,getArrowEl:e=>kH.getById(e,kH.getArrowId(e)),getElements:e=>{const t=`[role^="menuitem"][data-ownedby=${CSS.escape(kH.getContentId(e))}]:not([data-disabled])`;return Kj(kH.getContentEl(e),t)},getFirstEl:e=>kH.getElements(e)[0],getLastEl:e=>{return(t=kH.getElements(e))[t.length-1];var t},getNextEl:(e,t)=>function(e,t,n=!0){let r=Nj(e,t);return r=n?(r+1)%e.length:Math.min(r+1,e.length-1),e[r]}(kH.getElements(e),e.highlightedValue,t??e.loopFocus),getPrevEl:(e,t)=>function(e,t,n=!0){let r=Nj(e,t);return-1===r?n?e[e.length-1]:null:(r=n?(r-1+e.length)%e.length:Math.max(0,r-1),e[r])}(kH.getElements(e),e.highlightedValue,t??e.loopFocus),getElemByKey:(e,t)=>Fj(kH.getElements(e),{state:e.typeaheadState,key:t,activeId:e.highlightedValue}),isTargetDisabled:e=>Ej(e)&&(""===e.dataset.disabled||e.hasAttribute("disabled")),isTriggerItem:e=>!!e?.getAttribute("role")?.startsWith("menuitem")&&!!e?.hasAttribute("aria-controls"),getOptionFromItemEl:e=>({id:e.id,name:e.dataset.name,value:e.dataset.value,valueText:e.dataset.valueText,type:e.dataset.type})});function CH(e,t,n){const r=e.context.isSubmenu,o=e.context.isTypingAhead,i=e.context.composite,a=e.hasTag("open"),s=function(e={}){const{placement:t,sameWidth:n,fitViewport:r,strategy:o="absolute"}=e;return{arrow:{position:"absolute",width:Nz.arrowSize.reference,height:Nz.arrowSize.reference,[Nz.arrowSizeHalf.variable]:`calc(${Nz.arrowSize.reference} / 2)`,[Nz.arrowOffset.variable]:`calc(${Nz.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?qz[t.split("-")[0]]:void 0,background:Nz.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:o,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}({...e.context.positioning,placement:e.context.anchorPoint?"bottom":e.context.currentPlacement});function l(t){return{disabled:!!t.disabled,highlighted:e.context.highlightedValue===t.value}}function u(e){const t=e.valueText??e.value;return{...e,id:e.value,valueText:t}}function c(e){return{...l(u(e)),checked:!!e.checked}}function d(r){const{value:o,closeOnSelect:i,valueText:a}=r,s=l(r);return n.element({...xH.item.attrs,id:o,role:"menuitem","aria-disabled":s.disabled,"data-disabled":wj(s.disabled),"data-ownedby":kH.getContentId(e.context),"data-highlighted":wj(s.highlighted),"data-valuetext":a,onDragStart(e){e.currentTarget.matches("a[href]")&&e.preventDefault()},onPointerMove(e){if(s.disabled)return;if("mouse"!==e.pointerType)return;const n=e.currentTarget;s.highlighted||t({type:"ITEM_POINTERMOVE",id:o,target:n,closeOnSelect:i})},onPointerLeave(n){if(s.disabled)return;if("mouse"!==n.pointerType)return;if(!e.previousEvent.type.includes("POINTER"))return;const r=n.currentTarget;t({type:"ITEM_POINTERLEAVE",id:o,target:r,closeOnSelect:i})},onPointerDown(e){if(s.disabled)return;const n=e.currentTarget;t({type:"ITEM_POINTERDOWN",target:n,id:o,closeOnSelect:i})},onPointerUp(e){if(Pj(e))return;if(Oj(e))return;if(s.disabled)return;if(!f$(e))return;const n=e.currentTarget;t({type:"ITEM_CLICK",src:"pointerup",target:n,id:o,closeOnSelect:i}),"touch"===e.pointerType&&g$(n)},onTouchEnd(e){e.preventDefault(),e.stopPropagation()}})}return{highlightedValue:e.context.highlightedValue,open:a,setOpen(e){e!==a&&t(e?"OPEN":"CLOSE")},setHighlightedValue(e){t({type:"HIGHLIGHTED.SET",id:e})},setParent(e){t({type:"PARENT.SET",value:e,id:e.state.context.id})},setChild(e){t({type:"CHILD.SET",value:e,id:e.state.context.id})},reposition(e={}){t({type:"POSITIONING.SET",options:e})},getContextTriggerProps:()=>n.element({...xH.contextTrigger.attrs,dir:e.context.dir,id:kH.getContextTriggerId(e.context),onPointerDown(e){if("mouse"===e.pointerType)return;const n=w$(e);t({type:"CONTEXT_MENU_START",point:n})},onPointerCancel(e){"mouse"!==e.pointerType&&t("CONTEXT_MENU_CANCEL")},onPointerMove(e){"mouse"!==e.pointerType&&t("CONTEXT_MENU_CANCEL")},onPointerUp(e){"mouse"!==e.pointerType&&t("CONTEXT_MENU_CANCEL")},onContextMenu(e){const n=w$(e);t({type:"CONTEXT_MENU",point:n}),e.preventDefault()},style:{WebkitTouchCallout:"none",userSelect:"none"}}),getTriggerItemProps:e=>nj(d({value:e.getTriggerProps().id}),e.getTriggerProps()),getTriggerProps:()=>n.button({...r?xH.triggerItem.attrs:xH.trigger.attrs,"data-placement":e.context.currentPlacement,type:"button",dir:e.context.dir,id:kH.getTriggerId(e.context),"data-uid":e.context.id,"aria-haspopup":i?"menu":"dialog","aria-controls":kH.getContentId(e.context),"aria-expanded":a||void 0,"data-state":a?"open":"closed",onPointerMove(e){if("mouse"!==e.pointerType)return;!kH.isTargetDisabled(e.currentTarget)&&r&&t({type:"TRIGGER_POINTERMOVE",target:e.currentTarget})},onPointerLeave(e){if("mouse"!==e.pointerType)return;if(kH.isTargetDisabled(e.currentTarget)||!r)return;const n=w$(e);t({type:"TRIGGER_POINTERLEAVE",target:e.currentTarget,point:n})},onClick(e){kH.isTriggerItem(e.currentTarget)&&t({type:"TRIGGER_CLICK",target:e.currentTarget})},onPointerDown(e){const n=kH.isTargetDisabled(e.currentTarget);!f$(e)||n||h$(e)||(e.preventDefault(),kH.isTriggerItem(e.currentTarget)||t({type:"TRIGGER_CLICK",target:e.currentTarget}))},onBlur(){t("TRIGGER_BLUR")},onFocus(){t("TRIGGER_FOCUS")},onKeyDown(n){if(n.defaultPrevented)return;const r={ArrowDown(){t("ARROW_DOWN")},ArrowUp(){t("ARROW_UP")},Enter(){t({type:"ARROW_DOWN",src:"enter"})},Space(){t({type:"ARROW_DOWN",src:"space"})}}[b$(n,e.context)];r&&(n.preventDefault(),r(n))}}),getIndicatorProps:()=>n.element({...xH.indicator.attrs,dir:e.context.dir,"data-state":a?"open":"closed"}),getPositionerProps:()=>n.element({...xH.positioner.attrs,dir:e.context.dir,id:kH.getPositionerId(e.context),style:s.floating}),getArrowProps:()=>n.element({id:kH.getArrowId(e.context),...xH.arrow.attrs,dir:e.context.dir,style:s.arrow}),getArrowTipProps:()=>n.element({...xH.arrowTip.attrs,dir:e.context.dir,style:s.arrowTip}),getContentProps:()=>n.element({...xH.content.attrs,id:kH.getContentId(e.context),"aria-label":e.context["aria-label"],hidden:!a,"data-state":a?"open":"closed",role:i?"menu":"dialog",tabIndex:0,dir:e.context.dir,"aria-activedescendant":e.context.highlightedValue??void 0,"aria-labelledby":kH.getTriggerId(e.context),"data-placement":e.context.currentPlacement,onPointerEnter(e){"mouse"===e.pointerType&&t("MENU_POINTERENTER")},onKeyDown(n){if(n.defaultPrevented)return;if(!(e=>xj(e.currentTarget,Aj(e)))(n))return;const r=Aj(n);if(!(r?.closest("[role=menu]")===n.currentTarget||r===n.currentTarget))return;if("Tab"===n.key){if(!Hj(n))return void n.preventDefault()}const i=kH.getHighlightedItemEl(e.context),a={ArrowDown(){t("ARROW_DOWN")},ArrowUp(){t("ARROW_UP")},ArrowLeft(){t("ARROW_LEFT")},ArrowRight(){t("ARROW_RIGHT")},Enter(){t("ENTER"),g$(i)},Space(e){o?t({type:"TYPEAHEAD",key:e.key}):a.Enter?.(e)},Home(){t("HOME")},End(){t("END")}},s=b$(n,{dir:e.context.dir}),l=a[s];if(l)return l(n),n.stopPropagation(),void n.preventDefault();e.context.typeahead&&function(e){return 1===e.key.length&&!e.ctrlKey&&!e.metaKey}(n)&&((e=>e.ctrlKey||e.altKey||e.metaKey)(n)||Vj(r)||(t({type:"TYPEAHEAD",key:n.key}),n.preventDefault()))}}),getSeparatorProps:()=>n.element({...xH.separator.attrs,role:"separator",dir:e.context.dir,"aria-orientation":"horizontal"}),getItemState:l,getItemProps:d,getOptionItemState:c,getOptionItemProps(r){const{type:o,disabled:i,onCheckedChange:a,closeOnSelect:s}=r,l=u(r),p=c(r);return{...d(l),...n.element({"data-type":o,...xH.item.attrs,dir:e.context.dir,"data-value":l.value,role:`menuitem${o}`,"aria-checked":!!p.checked,"data-state":p.checked?"checked":"unchecked",onPointerUp(e){if(!f$(e)||i)return;if(Pj(e))return;if(Oj(e))return;const n=e.currentTarget;t({type:"ITEM_CLICK",src:"pointerup",target:n,option:l,closeOnSelect:s}),a?.(!p.checked)}})}},getItemIndicatorProps(t){const r=c(t);return n.element({...xH.itemIndicator.attrs,dir:e.context.dir,"data-disabled":wj(r.disabled),"data-highlighted":wj(r.highlighted),"data-state":r.checked?"checked":"unchecked",hidden:!r.checked})},getItemTextProps(t){const r=c(t);return n.element({...xH.itemText.attrs,dir:e.context.dir,"data-disabled":wj(r.disabled),"data-highlighted":wj(r.highlighted),"data-state":r.checked?"checked":"unchecked"})},getItemGroupLabelProps:t=>n.element({id:kH.getGroupLabelId(e.context,t.htmlFor),dir:e.context.dir,...xH.itemGroupLabel.attrs}),getItemGroupProps:t=>n.element({id:kH.getGroupId(e.context,t.id),...xH.itemGroup.attrs,dir:e.context.dir,"aria-labelledby":kH.getGroupLabelId(e.context,t.id),role:"group"})}}var{not:SH,and:TH,or:DH}=WU;function AH(e){let t=e.parent;for(;t&&t.state.context.isSubmenu;)t=t.state.context.parent;t?.send("CLOSE")}var OH={highlighted(e,t){n$(e.highlightedValue,t)||(e.highlightedValue=t,e.onHighlightChange?.({highlightedValue:t}))}};rj()(["anchorPoint","aria-label","closeOnSelect","dir","getRootNode","highlightedValue","id","ids","loopFocus","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onEscapeKeyDown","onSelect","onHighlightChange","open","open.controlled","positioning","typeahead","composite"]),rj()(["closeOnSelect","disabled","value","valueText"]),rj()(["htmlFor"]),rj()(["id"]),rj()(["disabled","valueText","closeOnSelect","type","value","checked","onCheckedChange"]);var PH=(e,t=[])=>({parts:(...n)=>{if(NH(t))return PH(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>PH(e,[...t,...n]),rename:e=>PH(e,t),keys:()=>t,build:()=>[...new Set(t)].reduce((t,n)=>Object.assign(t,{[n]:{selector:[`&[data-scope="${IH(e)}"][data-part="${IH(n)}"]`,`& [data-scope="${IH(e)}"][data-part="${IH(n)}"]`].join(", "),attrs:{"data-scope":IH(e),"data-part":IH(n)}}}),{})}),IH=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),NH=e=>0===e.length,RH=PH("progress").parts("root","label","track","range","valueText","view","circle","circleTrack","circleRange").build(),BH=Yj({getRootId:e=>e.ids?.root??`progress-${e.id}`,getTrackId:e=>e.ids?.track??`progress-${e.id}-track`,getLabelId:e=>e.ids?.label??`progress-${e.id}-label`,getCircleId:e=>e.ids?.circle??`progress-${e.id}-circle`});function FH(e,t){return e+(t-e)/2}function LH(e){const t=u$(e);return XU({id:"progress",initial:"idle",context:{max:t.max??100,min:t.min??0,value:FH(t.min??0,t.max??100),orientation:"horizontal",translations:{value:({percent:e})=>-1===e?"loading...":`${e} percent`,...t.translations},...t},created:["validateContext"],computed:{isIndeterminate:e=>null===e.value,percent:e=>s$(e.value)?Math.round((e.value-e.min)/(e.max-e.min)*100):-1,isAtMax:e=>e.value===e.max,isHorizontal:e=>"horizontal"===e.orientation,isRtl:e=>"rtl"===e.dir},states:{idle:{on:{"VALUE.SET":{actions:["setValue"]}}}}},{actions:{setValue:(e,t)=>{e.value=null===t.value?null:Math.max(0,Math.min(t.value,e.max))},validateContext:e=>{if(null!=e.value){if(!MH(e.max))throw new Error(`[progress] The max value passed \`${e.max}\` is not a valid number`);if(!function(e,t){return MH(e)&&e<=t}(e.value,e.max))throw new Error(`[progress] The value passed \`${e.value}\` exceeds the max value \`${e.max}\``);if(!function(e,t){return MH(e)&&e>=t}(e.value,e.min))throw new Error(`[progress] The value passed \`${e.value}\` exceeds the min value \`${e.min}\``)}}}})}function MH(e){return s$(e)&&!isNaN(e)}rj()(["dir","getRootNode","id","ids","max","min","orientation","translations","value"]);var UH=(e,t=[])=>({parts:(...n)=>{if($H(t))return UH(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>UH(e,[...t,...n]),rename:e=>UH(e,t),keys:()=>t,build:()=>[...new Set(t)].reduce((t,n)=>Object.assign(t,{[n]:{selector:[`&[data-scope="${jH(e)}"][data-part="${jH(n)}"]`,`& [data-scope="${jH(e)}"][data-part="${jH(n)}"]`].join(", "),attrs:{"data-scope":jH(e),"data-part":jH(n)}}}),{})}),jH=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),$H=e=>0===e.length,zH=UH("toast").parts("group","root","title","description","actionTrigger","closeTrigger").build(),HH=Yj({getRegionId:e=>`toast-group:${e}`,getRegionEl:(e,t)=>HH.getById(e,`toast-group:${t}`),getRootId:e=>`toast:${e.id}`,getRootEl:e=>HH.getById(e,HH.getRootId(e)),getTitleId:e=>`toast:${e.id}:title`,getDescriptionId:e=>`toast:${e.id}:description`,getCloseTriggerId:e=>`toast${e.id}:close`});function VH(e,t){return e.filter(e=>e.state.context.placement===t)}var WH={info:5e3,error:5e3,success:2e3,loading:1/0,DEFAULT:5e3};function qH(e,t){return e??WH[t]??WH.DEFAULT}function GH(e,t){const n=e.offsets,r="string"==typeof n?{left:n,right:n,bottom:n,top:n}:n,o="rtl"===e.dir,i=t.replace("-start",o?"-right":"-left").replace("-end",o?"-left":"-right"),a=i.includes("right"),s=i.includes("left"),l={position:"fixed",pointerEvents:e.count>0?void 0:"none",display:"flex",flexDirection:"column","--gap":`${e.gap}px`,"--first-height":`${e.heights[0]?.height||0}px`,zIndex:2147483647};let u="center";if(a&&(u="flex-end"),s&&(u="flex-start"),l.alignItems=u,i.includes("top")){const e=r.top;l.top=`max(env(safe-area-inset-top, 0px), ${e})`}if(i.includes("bottom")){const e=r.bottom;l.bottom=`max(env(safe-area-inset-bottom, 0px), ${e})`}if(!i.includes("left")){const e=r.right;l.insetInlineEnd=`calc(env(safe-area-inset-right, 0px) + ${e})`}if(!i.includes("right")){const e=r.left;l.insetInlineStart=`calc(env(safe-area-inset-left, 0px) + ${e})`}return l}function KH(e,t){const[n]=e.placement.split("-"),r=!e.frontmost,o=!e.stacked,i={position:"absolute",pointerEvents:"auto","--opacity":"0","--remove-delay":`${e.removeDelay}ms`,"--duration":`${"loading"===e.type?Number.MAX_SAFE_INTEGER:e.duration}ms`,"--initial-height":`${e.height}px`,"--offset":`${e.offset}px`,"--index":e.index,"--z-index":e.zIndex,"--lift-amount":"calc(var(--lift) * var(--gap))","--y":"100%","--x":"0"},a=e=>Object.assign(i,e);return"top"===n?a({top:"0","--sign":"-1","--y":"-100%","--lift":"1"}):"bottom"===n&&a({bottom:"0","--sign":"1","--y":"100%","--lift":"-1"}),e.mounted&&(a({"--y":"0","--opacity":"1"}),e.stacked&&a({"--y":"calc(var(--lift) * var(--offset))","--height":"var(--initial-height)"})),t||a({"--opacity":"0",pointerEvents:"none"}),r&&o&&(a({"--base-scale":"var(--index) * 0.05 + 1","--y":"calc(var(--lift-amount) * var(--index))","--scale":"calc(-1 * var(--base-scale))","--height":"var(--first-height)"}),t||a({"--y":"calc(var(--sign) * 40%)"})),r&&e.stacked&&!t&&a({"--y":"calc(var(--lift) * var(--offset) + var(--lift) * -100%)"}),e.frontmost&&!t&&a({"--y":"calc(var(--lift) * -100%)"}),i}function YH(e,t){const n={position:"absolute",inset:"0",scale:"1 2",pointerEvents:t?"none":"auto"};var r;return e.frontmost&&!t&&(r={height:"calc(var(--initial-height) + 80%)"},Object.assign(n,r)),n}var{not:ZH,and:XH,or:QH}=WU;function JH(e,t){VH(e.toasts,e.placement).forEach(t)}var eV={connect:function(e,t,n){function r(){var t;return(t=e)instanceof ZU||"machine"===t?.type?e.getState():e}function o(e){return VH(r().context.toasts,e)}function i(e){const t=r().context.toasts;return!!t.length&&!!t.find(t=>t.id==e)}function a(e){const n=`toast:${a$()}`,r=e.id?e.id:n;return i(r)||t({type:"ADD_TOAST",toast:{...e,id:r}}),r}function s(e,n){return i(e)?(t({type:"UPDATE_TOAST",id:e,toast:n}),e):e}function l(e){const{id:t}=e;return!!t&&i(t)&&null!=t?s(t,e):a(e)}function u(e){null==e?t("DISMISS_ALL"):i(e)&&t({type:"DISMISS_TOAST",id:e})}return{getCount:()=>r().context.count,getPlacements(){const e=r().context.toasts.map(e=>e.state.context.placement);return Array.from(new Set(e))},getToastsByPlacement:o,isVisible:i,create:a,update:s,upsert:l,dismiss:u,remove(e){null==e?t("REMOVE_ALL"):i(e)&&t({type:"REMOVE_TOAST",id:e})},dismissByPlacement(e){o(e).forEach(e=>u(e.id))},loading:e=>l({...e,type:"loading"}),success:e=>l({...e,type:"success"}),error:e=>l({...e,type:"error"}),promise(e,t,n={}){const r=l({...n,...t.loading,type:"loading"});return r$(e).then(e=>{const o=r$(t.success,e);l({...n,...o,id:r,type:"success"})}).catch(e=>{const o=r$(t.error,e);l({...n,...o,id:r,type:"error"})}).finally(()=>{t.finally?.()}),r},pause(e){null==e?t("PAUSE_ALL"):i(e)&&t({type:"PAUSE_TOAST",id:e})},resume(e){null==e?t("RESUME_ALL"):i(e)&&t({type:"RESUME_TOAST",id:e})},getGroupProps(e){const{placement:o,label:i="Notifications"}=e,a=r(),s=a.context.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,""),[l,u="center"]=o.split("-");return n.element({...zH.group.attrs,dir:a.context.dir,tabIndex:-1,"aria-label":`${o} ${i} ${s}`,id:HH.getRegionId(o),"data-placement":o,"data-side":l,"data-align":u,"aria-live":"polite",role:"region",style:GH(a.context,o),onMouseMove(){t({type:"REGION.POINTER_ENTER",placement:o})},onMouseLeave(){t({type:"REGION.POINTER_LEAVE",placement:o})},onFocus(e){t({type:"REGION.FOCUS",target:e.relatedTarget})},onBlur(e){a.context.isFocusWithin&&!xj(e.currentTarget,e.relatedTarget)&&t({type:"REGION.BLUR"})}})},subscribe(e){const t=r();return yU(t.context.toasts,()=>{const n=o(t.context.placement).map(e=>e.getState().context);e(n)})}}},machine:function(e){const t=u$(e);return XU({id:"toaster",initial:t.overlap?"overlap":"stack",context:{dir:"ltr",max:Number.MAX_SAFE_INTEGER,gap:16,pauseOnPageIdle:!1,hotkey:["altKey","KeyT"],offsets:"1rem",placement:"bottom",removeDelay:200,...t,toasts:[],lastFocusedEl:null,isFocusWithin:!1,heights:[]},computed:{count:e=>e.toasts.length},activities:["trackDocumentVisibility","trackHotKeyPress"],watch:{toasts:["collapsedIfEmpty","setDismissableBranch"]},exit:["removeToasts","clearDismissableBranch","clearLastFocusedEl"],on:{PAUSE_TOAST:{actions:["pauseToast"]},PAUSE_ALL:{actions:["pauseToasts"]},RESUME_TOAST:{actions:["resumeToast"]},RESUME_ALL:{actions:["resumeToasts"]},ADD_TOAST:{guard:"isWithinRange",actions:["createToast","syncToastIndex"]},UPDATE_TOAST:{actions:["updateToast"]},DISMISS_TOAST:{actions:["dismissToast"]},DISMISS_ALL:{actions:["dismissToasts"]},REMOVE_TOAST:{actions:["removeToast","syncToastIndex","syncToastOffset"]},REMOVE_ALL:{actions:["removeToasts"]},UPDATE_HEIGHT:{actions:["syncHeights","syncToastOffset"]},"DOC.HOTKEY":{actions:["focusRegionEl"]},"REGION.BLUR":[{guard:"isOverlapping",target:"overlap",actions:["resumeToasts","restoreLastFocusedEl"]},{actions:["resumeToasts","restoreLastFocusedEl"]}]},states:{stack:{entry:["expandToasts"],on:{"REGION.POINTER_LEAVE":[{guard:"isOverlapping",target:"overlap",actions:["resumeToasts"]},{actions:["resumeToasts"]}],"REGION.OVERLAP":{target:"overlap"},"REGION.FOCUS":{actions:["setLastFocusedEl","pauseToasts"]},"REGION.POINTER_ENTER":{actions:["pauseToasts"]}}},overlap:{entry:["collapseToasts"],on:{"REGION.STACK":{target:"stack"},"REGION.POINTER_ENTER":{target:"stack",actions:["pauseToasts"]},"REGION.FOCUS":{target:"stack",actions:["setLastFocusedEl","pauseToasts"]}}}}},{guards:{isWithinRange:e=>e.toasts.length<e.max,isOverlapping:e=>!!e.overlap},activities:{trackHotKeyPress:(e,t,{send:n})=>p$(document,"keydown",t=>{e.hotkey.every(e=>t[e]||t.code===e)&&n({type:"DOC.HOTKEY"})},{capture:!0}),trackDocumentVisibility(e,t,{send:n}){if(!e.pauseOnPageIdle)return;const r=HH.getDoc(e);return p$(r,"visibilitychange",()=>{n("hidden"===r.visibilityState?"PAUSE_ALL":"RESUME_ALL")})}},actions:{setDismissableBranch(e){const t=VH(e.toasts,e.placement).length>0;if(!t)return void e._cleanup?.();if(t&&e._cleanup)return;e._cleanup=function(e,t={}){const{defer:n}=t,r=n?qj:e=>e(),o=[];return o.push(r(()=>{const t=l$(e)?e():e;t?(tH.addBranch(t),o.push(()=>{tH.removeBranch(t)})):d$("[@zag-js/dismissable] branch node is `null` or `undefined`")})),()=>{o.forEach(e=>e?.())}}(()=>HH.getRegionEl(e,e.placement),{defer:!0})},clearDismissableBranch(e){e._cleanup?.()},focusRegionEl(e){queueMicrotask(()=>{HH.getRegionEl(e,e.placement)?.focus()})},expandToasts(e){JH(e,e=>{e.state.context.stacked=!0})},collapseToasts(e){JH(e,e=>{e.state.context.stacked=!1})},collapsedIfEmpty(e,t,{send:n}){!e.overlap||e.toasts.length>1||n("REGION.OVERLAP")},pauseToast(e,t,{self:n}){n.sendChild("PAUSE",t.id)},pauseToasts(e){e.toasts.forEach(e=>e.send("PAUSE"))},resumeToast(e,t,{self:n}){n.sendChild("RESUME",t.id)},resumeToasts(e){e.toasts.forEach(e=>e.send("RESUME"))},measureToasts(e){e.toasts.forEach(e=>e.send("MEASURE"))},createToast(e,t,{self:n,getState:r}){const o=function(e){const{type:t="info",duration:n,id:r="1",placement:o="bottom",removeDelay:i=200,...a}=e,s=u$(a),l=qH(n,t);return XU({id:r,context:{id:r,type:t,remaining:l,duration:l,removeDelay:i,createdAt:Date.now(),placement:o,...s,height:0,offset:0,frontmost:!1,mounted:!1,index:-1,zIndex:0},initial:"loading"===t?"visible:persist":"visible",on:{UPDATE:[{guard:XH("hasTypeChanged","isChangingToLoading"),target:"visible:persist",actions:["setContext"]},{guard:QH("hasDurationChanged","hasTypeChanged"),target:"visible:updating",actions:["setContext"]},{actions:["setContext"]}],MEASURE:{actions:["measureHeight"]}},entry:["invokeOnVisible"],activities:["trackHeight"],states:{"visible:updating":{tags:["visible","updating"],after:{0:"visible"}},"visible:persist":{tags:["visible","paused"],on:{RESUME:{guard:ZH("isLoadingType"),target:"visible",actions:["setCreatedAt"]},DISMISS:"dismissing"}},visible:{tags:["visible"],after:{VISIBLE_DURATION:"dismissing"},on:{DISMISS:"dismissing",PAUSE:{target:"visible:persist",actions:"setRemainingDuration"}}},dismissing:{entry:"invokeOnDismiss",after:{REMOVE_DELAY:{target:"unmounted",actions:"notifyParentToRemove"}}},unmounted:{entry:"invokeOnUnmount",type:"final"}}},{activities:{trackHeight(e,t,{self:n}){let r;return qj(()=>{const t=HH.getRootEl(e);if(!t)return;e.mounted=!0,d$(2!==Kj(t,"[data-ghost]").length,"[toast] No ghost element found in toast. Render the `ghostBefore` and `ghostAfter` elements");const o=()=>{const r=t.style.height;t.style.height="auto";const o=t.getBoundingClientRect().height;t.style.height=r,e.height=o,n.sendParent({type:"UPDATE_HEIGHT",id:n.id,height:o,placement:e.placement})};o();const i=new(HH.getWin(e).MutationObserver)(o);i.observe(t,{childList:!0,subtree:!0,characterData:!0}),r=()=>i.disconnect()}),()=>r?.()}},guards:{isChangingToLoading:(e,t)=>"loading"===t.toast?.type,isLoadingType:e=>"loading"===e.type,hasTypeChanged:(e,t)=>null!=t.toast?.type&&t.toast.type!==e.type,hasDurationChanged:(e,t)=>null!=t.toast?.duration&&t.toast.duration!==e.duration},delays:{VISIBLE_DURATION:e=>e.remaining,REMOVE_DELAY:e=>e.removeDelay},actions:{measureHeight(e,t,{self:n}){qj(()=>{const t=HH.getRootEl(e);if(!t)return;e.mounted=!0;const r=t.style.height;t.style.height="auto";const o=t.getBoundingClientRect().height;t.style.height=r,e.height=o,n.sendParent({type:"UPDATE_HEIGHT",id:n.id,height:o,placement:e.placement})})},setRemainingDuration(e){e.remaining-=Date.now()-e.createdAt},setCreatedAt(e){e.createdAt=Date.now()},notifyParentToRemove(e,t,{self:n}){n.sendParent({type:"REMOVE_TOAST",id:n.id})},invokeOnDismiss(e){e.onStatusChange?.({status:"dismissing"})},invokeOnUnmount(e){e.onStatusChange?.({status:"unmounted"})},invokeOnVisible(e){e.onStatusChange?.({status:"visible"})},setContext(e,t){const n=t.toast?.duration,r=qH(n,t.toast?.type??e.type);Object.assign(e,{...t.toast,duration:r,remaining:r})}}})}({placement:e.placement,duration:e.duration,removeDelay:e.removeDelay,...t.toast,dir:e.dir,getRootNode:e.getRootNode,stacked:r().matches("stack")}),i=n.spawn(o);e.toasts=[i,...e.toasts]},updateToast(e,t,{self:n}){n.sendChild({type:"UPDATE",toast:t.toast},t.id)},dismissToast(e,t,{self:n}){n.sendChild("DISMISS",t.id)},dismissToasts(e){e.toasts.forEach(e=>e.send("DISMISS"))},removeToast(e,t,{self:n}){n.stopChild(t.id),e.toasts=e.toasts.filter(e=>e.id!==t.id),e.heights=e.heights.filter(e=>e.id!==t.id)},removeToasts(e,t,{self:n}){e.toasts.forEach(e=>n.stopChild(e.id)),e.toasts=[],e.heights=[]},syncHeights(e,t){const n=e.heights.find(e=>e.id===t.id);if(n)n.height=t.height,n.placement=t.placement;else{const n={id:t.id,height:t.height,placement:t.placement};e.heights=[n,...e.heights]}},syncToastIndex(e){JH(e,(e,t,n)=>{e.state.context.index=t,e.state.context.frontmost=0===t,e.state.context.zIndex=n.length-t})},syncToastOffset(e,t){const n=t.placement??e.placement;JH({...e,placement:n},t=>{const n=Math.max(e.heights.findIndex(e=>e.id===t.id),0),r=e.heights.reduce((e,t,r)=>r>=n?e:e+t.height,0);t.state.context.offset=n*e.gap+r})},setLastFocusedEl(e,t){!e.isFocusWithin&&t.target&&(e.isFocusWithin=!0,e.lastFocusedEl=wU(t.target))},restoreLastFocusedEl(e){e.isFocusWithin=!1,e.lastFocusedEl&&(e.lastFocusedEl.focus({preventScroll:!0}),e.lastFocusedEl=null)},clearLastFocusedEl(e){e.lastFocusedEl&&(e.lastFocusedEl.focus({preventScroll:!0}),e.lastFocusedEl=null,e.isFocusWithin=!1)}}})}};function tV(e={}){const{strict:t=!0,hookName:n="useContext",providerName:r="Provider",errorMessage:o,defaultValue:i}=e,a=B(i);return[a.Provider,function e(){const i=F(a);if(!i&&t){const t=new Error(o??`${n} returned \`undefined\`. Seems you forgot to wrap component within ${r}`);throw t.name="ContextError",Error.captureStackTrace?.(t,e),t}return i},a]}tV({hookName:"useAccordionContext",providerName:"<AccordionProvider />"});const nV=()=>(e,t)=>se(e,t),[rV,oV]=tV({hookName:"useRenderStrategyContext",providerName:"<RenderStrategyProvider />"}),iV=e=>nV()(e,["lazyMount","unmountOnExit"]),aV=e=>t=>{const[n,r]=se(t,["asChild"]);if(n.asChild){const e=e=>{const[,t]=se(r,["ref"]);return oj(t,e)};return n.asChild(e)}return te($e,ae({component:e},r))};const sV=function(){const e=new Map;return new Proxy(aV,{apply:(e,t,n)=>aV(n[0]),get(t,n){const r=n;return e.has(r)||e.set(r,aV(r)),e.get(r)}})}();tV({hookName:"useCollapsibleContext",providerName:"<CollapsibleProvider />"});const[lV,uV]=tV({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})});var cV=ke("<span hidden>");const dV=e=>{const[t,n]=S(),r=()=>((e,...t)=>"function"==typeof e?e(...t):e)(e.value)??t()?.ownerDocument??document,o=A(()=>({getRootNode:r,getDocument:()=>kj(r()),getWindow:()=>Cj(r())}));return te(lV,{value:o,get children(){return[A(()=>e.children),te(fe,{get when(){return!e.value},get children(){var e=cV();return Oe(n,e),e}})]}})},[pV,fV]=tV({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({dir:"ltr",locale:"en-US"})});tV({hookName:"useAccordionItemContext",providerName:"<AccordionItemProvider />"}),tV({hookName:"useAccordionItemPropsContext",providerName:"<AccordionItemPropsProvider />"}),tV({hookName:"useAvatarContext",providerName:"<AvatarProvider />"}),tV({hookName:"useCarouselContext",providerName:"<CarouselProvider />"}),tV({hookName:"useCheckboxContext",providerName:"<CheckboxProvider />"}),tV({hookName:"useCheckboxGroupContext",providerName:"<CheckboxGroupProvider />",strict:!1}),tV({hookName:"useClipboardContext",providerName:"<ClipboardProvider />"}),tV({hookName:"useColorPickerAreaContext",providerName:"<ColorPickerAreaProvider />"}),tV({hookName:"useColorPickerContext",providerName:"<ColorPickerProvider />"}),tV({hookName:"useColorPickerChannelSliderContext",providerName:"<ColorPickerChannelSliderProvider />"});const hV=e=>nV()(e,["immediate","lazyMount","onExitComplete","present","unmountOnExit"]),gV=e=>{const[t,n]=iV(e),[r,o]=S(!1),[i,a]=bj(XU({initial:(s=n).present?"mounted":"unmounted",context:{node:null,styles:null,unmountAnimationName:null,prevAnimationName:null,present:!1,initial:!1,...s},exit:["clearInitial"],watch:{present:["setInitial","syncPresence"]},on:{"NODE.SET":{actions:["setNode","setStyles"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["invokeOnExitComplete"]},"UNMOUNT.SUSPEND":"unmountSuspended"}},unmountSuspended:{activities:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},"ANIMATION.END":{target:"unmounted",actions:["invokeOnExitComplete"]},UNMOUNT:{target:"unmounted",actions:["invokeOnExitComplete"]}}},unmounted:{entry:["clearPrevAnimationName"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}}},{actions:{setInitial(e){e.initial=!0},clearInitial(e){e.initial=!1},invokeOnExitComplete(e){e.onExitComplete?.()},setNode(e,t){e.node=wU(t.node)},setStyles(e,t){const n=t.node.ownerDocument.defaultView||window;e.styles=wU(n.getComputedStyle(t.node))},syncPresence(e,t,{send:n}){if(e.present)return void n({type:"MOUNT",src:"presence.changed"});const r=iH(e.styles);(e.immediate?queueMicrotask:requestAnimationFrame)(()=>{e.unmountAnimationName=r,"none"===r||r===e.prevAnimationName||"none"===e.styles?.display?n({type:"UNMOUNT",src:"presence.changed"}):n({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName(e){(e.immediate?queueMicrotask:requestAnimationFrame)(()=>{e.prevAnimationName=iH(e.styles)})},clearPrevAnimationName(e){e.prevAnimationName=null}},activities:{trackAnimationEvents(e,t,{send:n}){const r=e.node;if(!r)return;const o=t=>{t.target===r&&(e.prevAnimationName=iH(e.styles))},i=t=>{const o=iH(e.styles);t.target===r&&o===e.unmountAnimationName&&n({type:"UNMOUNT",src:"animationend"})};return r.addEventListener("animationstart",o),r.addEventListener("animationcancel",i),r.addEventListener("animationend",i),()=>{r.removeEventListener("animationstart",o),r.removeEventListener("animationcancel",i),r.removeEventListener("animationend",i)}}}}),{context:n});var s;const l=A(()=>function(e,t){const n=e.matches("mounted","unmountSuspended");return{skip:!e.context.initial&&n,present:n,setNode(e){e&&t({type:"NODE.SET",node:e})},unmount(){t({type:"UNMOUNT"})}}}(i,a));return D(()=>{l().present&&o(!0)}),A(()=>({unmounted:!l().present&&!r()&&t.lazyMount||t.unmountOnExit&&!l().present&&r(),present:l().present,presenceProps:{ref:l().setNode,hidden:!l().present,"data-state":n.present?"open":"closed"}}))},[mV,vV]=tV({hookName:"usePresenceContext",providerName:"<PresenceProvider />"});tV({hookName:"useColorPickerSwatchContext",providerName:"<ColorPickerSwatchProvider />"}),tV({hookName:"useComboboxContext",providerName:"<ComboboxProvider />"}),tV({hookName:"useComboboxItemContext",providerName:"<ComboboxItemProvider />"}),tV({hookName:"useComboboxItemPropsContext",providerName:"<ComboboxItemPropsProvider />"}),tV({hookName:"useComboboxItemGroupPropsContext",providerName:"<ComboboxItemGroupPropsProvider />"}),tV({hookName:"useDatePickerContext",providerName:"<DatePickerProvider />"}),tV({hookName:"useDatePickerViewContext",providerName:"<DatePickerViewProvider />",strict:!1,defaultValue:{view:"day"}}),tV({hookName:"useDatePickerTableContext",providerName:"<DatePickerTableProvider />"}),tV({hookName:"useDatePickerTableCellContext",providerName:"<DatePickerTableCellProvider />"});const[yV,bV]=tV({hookName:"useDialogContext",providerName:"<DialogProvider />"}),wV=e=>{const t=fV(),n=uV(),r=ue(),o=A(()=>({id:r,dir:t().dir,getRootNode:n().getRootNode,open:e.defaultOpen,"open.controlled":void 0!==e.open,...e})),[i,a]=bj(vH(o()),{context:o});return A(()=>function(e,t,n){const r=e.context["aria-label"],o=e.matches("open"),i=e.context.renderedElements;return{open:o,setOpen(e){e!==o&&t(e?"OPEN":"CLOSE")},getTriggerProps:()=>n.button({...gH.trigger.attrs,dir:e.context.dir,id:mH.getTriggerId(e.context),"aria-haspopup":"dialog",type:"button","aria-expanded":o,"data-state":o?"open":"closed","aria-controls":mH.getContentId(e.context),onClick(e){e.defaultPrevented||t("TOGGLE")}}),getBackdropProps:()=>n.element({...gH.backdrop.attrs,dir:e.context.dir,hidden:!o,id:mH.getBackdropId(e.context),"data-state":o?"open":"closed"}),getPositionerProps:()=>n.element({...gH.positioner.attrs,dir:e.context.dir,id:mH.getPositionerId(e.context),style:{pointerEvents:o?void 0:"none"}}),getContentProps:()=>n.element({...gH.content.attrs,dir:e.context.dir,role:e.context.role,hidden:!o,id:mH.getContentId(e.context),tabIndex:-1,"data-state":o?"open":"closed","aria-modal":!0,"aria-label":r||void 0,"aria-labelledby":r||!i.title?void 0:mH.getTitleId(e.context),"aria-describedby":i.description?mH.getDescriptionId(e.context):void 0}),getTitleProps:()=>n.element({...gH.title.attrs,dir:e.context.dir,id:mH.getTitleId(e.context)}),getDescriptionProps:()=>n.element({...gH.description.attrs,dir:e.context.dir,id:mH.getDescriptionId(e.context)}),getCloseTriggerProps:()=>n.button({...gH.closeTrigger.attrs,dir:e.context.dir,id:mH.getCloseTriggerId(e.context),type:"button",onClick(e){e.defaultPrevented||(e.stopPropagation(),t("CLOSE"))}})}}(i,a,pj))};var EV=Object.freeze({__proto__:null,Backdrop:e=>{const t=bV(),n=oV(),r=gV(oj(n,()=>({present:t().open}))),o=oj(()=>t().getBackdropProps(),()=>r().presenceProps,e);return te(fe,{get when(){return!r().unmounted},get children(){return te(sV.div,o)}})},CloseTrigger:e=>{const t=bV(),n=oj(()=>t().getCloseTriggerProps(),e);return te(sV.button,n)},Content:e=>{const t=bV(),n=vV(),r=oj(()=>t().getContentProps(),()=>n().presenceProps,e);return te(fe,{get when(){return!n().unmounted},get children(){return te(sV.div,r)}})},Context:e=>e.children(bV()),Description:e=>{const t=bV(),n=oj(()=>t().getDescriptionProps(),e);return te(sV.div,n)},Positioner:e=>{const t=bV(),n=vV(),r=oj(()=>t().getPositionerProps(),e);return te(fe,{get when(){return!n().unmounted},get children(){return te(sV.div,r)}})},Root:e=>{const[t,n]=hV(e),[r]=iV(t),[o,i]=nV()(n,["aria-label","closeOnEscape","closeOnInteractOutside","defaultOpen","finalFocusEl","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]),a=wV(o),s=gV(oj(t,()=>({present:a().open})));return te(yV,{value:a,get children(){return te(rV,{value:r,get children(){return te(mV,{value:s,get children(){return i.children}})}})}})},RootProvider:e=>{const[t,n]=hV(e),[r]=iV(t),o=gV(oj(t,()=>({present:n.value().open})));return te(yV,{get value(){return n.value},get children(){return te(rV,{value:r,get children(){return te(mV,{value:o,get children(){return n.children}})}})}})},Title:e=>{const t=bV(),n=oj(()=>t().getTitleProps(),e);return te(sV.h2,n)},Trigger:e=>{const t=bV(),n=vV(),r=oj(()=>t().getTriggerProps(),()=>({"aria-controls":n().unmounted&&null}),e);return te(sV.button,r)}});tV({hookName:"useEditableContext",providerName:"<EditableProvider />"}),tV({hookName:"useFileUploadContext",providerName:"<FileUploadProvider />"}),tV({hookName:"useFileUploadItemPropsContext",providerName:"<FileUploadItemPropsProvider />"}),tV({hookName:"useHoverCardContext",providerName:"<HoverCardProvider />"});const[_V,xV]=tV({hookName:"useMenuContext",providerName:"<MenuProvider />",strict:!1}),[kV,CV]=tV({hookName:"useMenuItemContext",providerName:"<MenuItemProvider />"}),[SV,TV]=tV({hookName:"useMenuOptionItemPropsContext",providerName:"<MenuOptionItemPropsProvider />"}),[DV,AV]=tV({hookName:"useMenuItemGroupContext",providerName:"<MenuItemGroupProvider />"}),OV=e=>{const t=fV(),n=uV(),r=ue(),o=A(()=>({id:r,dir:t().dir,getRootNode:n().getRootNode,open:e.defaultOpen,"open.controlled":void 0!==e.open,...e})),[i,a,s]=bj(function(e){const t=u$(e);return XU({id:"menu",initial:t.open?"open":"idle",context:{highlightedValue:null,loopFocus:!1,anchorPoint:null,closeOnSelect:!0,typeahead:!0,composite:!0,...t,positioning:{placement:"bottom-start",gutter:8,...t.positioning},intentPolygon:null,parent:null,lastHighlightedValue:null,children:wU({}),suspendPointer:!1,restoreFocus:!0,typeaheadState:Fj.defaultOptions},computed:{isSubmenu:e=>null!==e.parent,isRtl:e=>"rtl"===e.dir,isTypingAhead:e=>""!==e.typeaheadState.keysSoFar},watch:{isSubmenu:"setSubmenuPlacement",anchorPoint:"reposition",open:"toggleVisibility"},on:{"PARENT.SET":{actions:"setParentMenu"},"CHILD.SET":{actions:"setChildMenu"},OPEN:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}],OPEN_AUTOFOCUS:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{internal:!0,target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],CLOSE:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}],"HIGHLIGHTED.RESTORE":{actions:"restoreHighlightedItem"},"HIGHLIGHTED.SET":{actions:"setHighlightedItem"}},states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":"closed",CONTEXT_MENU_START:{target:"opening:contextmenu",actions:"setAnchorPoint"},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}],TRIGGER_FOCUS:{guard:SH("isSubmenu"),target:"closed"},TRIGGER_POINTERMOVE:{guard:"isSubmenu",target:"opening"}}},"opening:contextmenu":{tags:["closed"],after:{LONG_PRESS_DELAY:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}]},on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":"closed",CONTEXT_MENU_CANCEL:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}]}},opening:{tags:["closed"],after:{SUBMENU_OPEN_DELAY:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}]},on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":"closed",BLUR:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}],TRIGGER_POINTERLEAVE:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}]}},closing:{tags:["open"],activities:["trackPointerMove","trackInteractOutside"],after:{SUBMENU_CLOSE_DELAY:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["focusParentMenu","restoreParentHiglightedItem","invokeOnClose"]}]},on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":{target:"closed",actions:["focusParentMenu","restoreParentHiglightedItem"]},MENU_POINTERENTER:{target:"open",actions:"clearIntentPolygon"},POINTER_MOVED_AWAY_FROM_SUBMENU:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:["focusParentMenu","restoreParentHiglightedItem"]}]}},closed:{tags:["closed"],entry:["clearHighlightedItem","focusTrigger","clearAnchorPoint","resumePointer"],on:{"CONTROLLED.OPEN":[{guard:DH("isOpenAutoFocusEvent","isArrowDownEvent"),target:"open",actions:"highlightFirstItem"},{guard:"isArrowUpEvent",target:"open",actions:"highlightLastItem"},{target:"open"}],CONTEXT_MENU_START:{target:"opening:contextmenu",actions:"setAnchorPoint"},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}],TRIGGER_POINTERMOVE:{guard:"isTriggerItem",target:"opening"},TRIGGER_BLUR:"idle",ARROW_DOWN:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],ARROW_UP:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:["highlightLastItem","invokeOnOpen"]}]}},open:{tags:["open"],activities:["trackInteractOutside","trackPositioning","scrollToHighlightedItem"],entry:["focusMenu","resumePointer"],on:{"CONTROLLED.CLOSE":[{target:"closed",guard:"isArrowLeftEvent",actions:["focusParentMenu"]},{target:"closed"}],TRIGGER_CLICK:[{guard:TH(SH("isTriggerItem"),"isOpenControlled"),actions:"invokeOnClose"},{guard:SH("isTriggerItem"),target:"closed",actions:"invokeOnClose"}],ARROW_UP:{actions:["highlightPrevItem","focusMenu"]},ARROW_DOWN:{actions:["highlightNextItem","focusMenu"]},ARROW_LEFT:[{guard:TH("isSubmenu","isOpenControlled"),actions:"invokeOnClose"},{guard:"isSubmenu",target:"closed",actions:["focusParentMenu","invokeOnClose"]}],HOME:{actions:["highlightFirstItem","focusMenu"]},END:{actions:["highlightLastItem","focusMenu"]},ARROW_RIGHT:{guard:"isTriggerItemHighlighted",actions:"openSubmenu"},ENTER:[{guard:"isTriggerItemHighlighted",actions:"openSubmenu"},{guard:TH("closeOnSelect","isOpenControlled"),actions:["clickHighlightedItem","invokeOnClose"]},{guard:"closeOnSelect",target:"closed",actions:"clickHighlightedItem"},{actions:"clickHighlightedItem"}],ITEM_POINTERMOVE:[{guard:SH("suspendPointer"),actions:["setHighlightedItem","focusMenu"]},{actions:"setLastHighlightedItem"}],ITEM_POINTERLEAVE:{guard:TH(SH("suspendPointer"),SH("isTriggerItem")),actions:"clearHighlightedItem"},ITEM_CLICK:[{guard:TH(SH("isTriggerItemHighlighted"),SH("isHighlightedItemEditable"),"closeOnSelect","isOpenControlled"),actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:TH(SH("isTriggerItemHighlighted"),SH("isHighlightedItemEditable"),"closeOnSelect"),target:"closed",actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:TH(SH("isTriggerItemHighlighted"),SH("isHighlightedItemEditable")),actions:["invokeOnSelect","setOptionState"]},{actions:"setHighlightedItem"}],TRIGGER_POINTERLEAVE:{target:"closing",actions:"setIntentPolygon"},ITEM_POINTERDOWN:{actions:"setHighlightedItem"},TYPEAHEAD:{actions:"highlightMatchedItem"},FOCUS_MENU:{actions:"focusMenu"},"POSITIONING.SET":{actions:"reposition"}}}}},{delays:{LONG_PRESS_DELAY:700,SUBMENU_OPEN_DELAY:100,SUBMENU_CLOSE_DELAY:100},guards:{closeOnSelect:(e,t)=>!!(t?.closeOnSelect??e.closeOnSelect),isTriggerItem:(e,t)=>kH.isTriggerItem(t.target),isTriggerItemHighlighted:(e,t)=>{const n=t.target??kH.getHighlightedItemEl(e);return!!n?.hasAttribute("aria-controls")},isSubmenu:e=>e.isSubmenu,suspendPointer:e=>e.suspendPointer,isHighlightedItemEditable:e=>Vj(kH.getHighlightedItemEl(e)),isWithinPolygon:(e,t)=>!!e.intentPolygon&&function(e,t){const{x:n,y:r}=t;let o=!1;for(let t=0,i=e.length-1;t<e.length;i=t++){const a=e[t].x,s=e[t].y,l=e[i].x,u=e[i].y;s>r!=u>r&&n<(l-a)*(r-s)/(u-s)+a&&(o=!o)}return o}(e.intentPolygon,t.point),isOpenControlled:e=>!!e["open.controlled"],isArrowLeftEvent:(e,t)=>"ARROW_LEFT"===t.previousEvent?.type,isArrowUpEvent:(e,t)=>"ARROW_UP"===t.previousEvent?.type,isArrowDownEvent:(e,t)=>"ARROW_DOWN"===t.previousEvent?.type,isOpenAutoFocusEvent:(e,t)=>"OPEN_AUTOFOCUS"===t.previousEvent?.type},activities:{trackPositioning(e){if(!e.anchorPoint)return e.currentPlacement=e.positioning.placement,Wz(kH.getTriggerEl(e),()=>kH.getPositionerEl(e),{...e.positioning,defer:!0,onComplete(t){e.currentPlacement=t.placement}})},trackInteractOutside:(e,t,{send:n})=>oH(()=>kH.getContentEl(e),{defer:!0,exclude:[kH.getTriggerEl(e)],onInteractOutside:e.onInteractOutside,onFocusOutside:e.onFocusOutside,onEscapeKeyDown(t){e.onEscapeKeyDown?.(t),e.isSubmenu&&t.preventDefault(),AH(e)},onPointerDownOutside(t){e.restoreFocus=!t.detail.focusable,e.onPointerDownOutside?.(t)},onDismiss(){n({type:"CLOSE",src:"interact-outside"})}}),trackPointerMove(e,t,{guards:n,send:r}){const{isWithinPolygon:o}=n;e.parent.state.context.suspendPointer=!0;const i=kH.getDoc(e);return p$(i,"pointermove",t=>{const n={x:t.clientX,y:t.clientY};o(e,{point:n})||(r("POINTER_MOVED_AWAY_FROM_SUBMENU"),e.parent.state.context.suspendPointer=!1)})},scrollToHighlightedItem(e,t,{getState:n}){const r=()=>{n().event.type.startsWith("ITEM_POINTER")||Zj(kH.getHighlightedItemEl(e),{rootEl:kH.getContentEl(e),block:"nearest"})};return qj(()=>r()),Gj(()=>kH.getContentEl(e),{attributes:["aria-activedescendant"],callback:r})}},actions:{setAnchorPoint(e,t){e.anchorPoint=t.point},clearAnchorPoint(e){e.anchorPoint=null},setSubmenuPlacement(e){e.isSubmenu&&(e.positioning.placement=e.isRtl?"left-start":"right-start",e.positioning.gutter=0)},reposition(e,t){const n=e.anchorPoint?()=>({width:0,height:0,...e.anchorPoint}):void 0;Wz(kH.getTriggerEl(e),()=>kH.getPositionerEl(e),{...e.positioning,getAnchorRect:n,...t.options??{},listeners:!1,onComplete(t){e.currentPlacement=t.placement}})},setOptionState(e,t){if(!t.option)return;const{checked:n,onCheckedChange:r,type:o}=t.option;"radio"===o?r?.(!0):"checkbox"===o&&r?.(!n)},clickHighlightedItem(e,t,{send:n}){const r=kH.getHighlightedItemEl(e);if(!r||r.dataset.disabled)return;const o=kH.getOptionFromItemEl(r);n({type:"ITEM_CLICK",src:"enter",target:r,id:o.id,option:o,closeOnSelect:e.closeOnSelect})},setIntentPolygon(e,t){const n=kH.getContentEl(e),r=e.currentPlacement;if(!n||!r)return;const o=_H(n.getBoundingClientRect(),r);if(!o)return;const i="right"===function(e){return e.split("-")[0]}(r),a=i?-5:5;e.intentPolygon=[{...t.point,x:t.point.x+a},...o]},clearIntentPolygon(e){e.intentPolygon=null},resumePointer(e){e.parent&&(e.parent.state.context.suspendPointer=!1)},setHighlightedItem(e,t){OH.highlighted(e,t.id)},clearHighlightedItem(e){OH.highlighted(e,null)},focusMenu(e){qj(()=>{const t=kH.getContentEl(e),n=zj({root:t,enabled:!xj(t,kH.getActiveElement(e)),filter:e=>!e.role?.startsWith("menuitem")});n?.focus({preventScroll:!0})})},highlightFirstItem(e){const t=kH.getFirstEl(e);t&&OH.highlighted(e,t.id)},highlightLastItem(e){const t=kH.getLastEl(e);t&&OH.highlighted(e,t.id)},highlightNextItem(e,t){const n=kH.getNextEl(e,t.loop);OH.highlighted(e,n?.id??null)},highlightPrevItem(e,t){const n=kH.getPrevEl(e,t.loop);OH.highlighted(e,n?.id??null)},invokeOnSelect(e){e.highlightedValue&&e.onSelect?.({value:e.highlightedValue})},focusTrigger(e){e.isSubmenu||e.anchorPoint||!e.restoreFocus||qj(()=>kH.getTriggerEl(e)?.focus({preventScroll:!0}))},highlightMatchedItem(e,t){const n=kH.getElemByKey(e,t.key);n&&OH.highlighted(e,n.id)},setParentMenu(e,t){e.parent=wU(t.value)},setChildMenu(e,t){e.children[t.id]=wU(t.value)},closeRootMenu(e){AH(e)},openSubmenu(e){const t=kH.getHighlightedItemEl(e),n=t?.getAttribute("data-uid"),r=n?e.children[n]:null;r?.send("OPEN_AUTOFOCUS")},focusParentMenu(e){e.parent?.send("FOCUS_MENU")},setLastHighlightedItem(e,t){e.lastHighlightedValue=t.id},restoreHighlightedItem(e){e.lastHighlightedValue&&(OH.highlighted(e,e.lastHighlightedValue),e.lastHighlightedValue=null)},restoreParentHiglightedItem(e){e.parent?.send("HIGHLIGHTED.RESTORE")},invokeOnOpen(e){e.onOpenChange?.({open:!0})},invokeOnClose(e){e.onOpenChange?.({open:!1})},toggleVisibility(e,t,{send:n}){n({type:e.open?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:t})}}})}(o()),{context:o});return{api:A(()=>CH(i,a,pj)),machine:s}},[PV,IV]=tV({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:!1}),[NV,RV]=tV({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:!1});var BV=Object.freeze({__proto__:null,Arrow:e=>{const t=xV(),n=oj(()=>t().getArrowProps(),e);return te(sV.div,n)},ArrowTip:e=>{const t=xV(),n=oj(()=>t().getArrowTipProps(),e);return te(sV.div,n)},CheckboxItem:e=>{const[t,n]=nV()(e,["checked","closeOnSelect","disabled","onCheckedChange","value","valueText"]),r=oj(t,{type:"checkbox"}),o=xV(),i=oj(()=>o().getOptionItemProps(r),n),a=A(()=>o().getItemState(r));return te(SV,{value:r,get children(){return te(kV,{value:a,get children(){return te(sV.div,i)}})}})},Content:e=>{const t=xV(),n=vV(),r=oj(()=>t().getContentProps(),()=>n().presenceProps,e);return te(fe,{get when(){return!n().unmounted},get children(){return te(sV.div,r)}})},Context:e=>e.children(xV()),ContextTrigger:e=>{const t=xV(),n=oj(()=>t().getContextTriggerProps(),e);return te(sV.button,n)},Indicator:e=>{const t=xV(),n=oj(()=>t().getIndicatorProps(),e);return te(sV.div,n)},Item:e=>{const[t,n]=nV()(e,["closeOnSelect","disabled","value","valueText"]),r=xV(),o=oj(()=>r().getItemProps(t),n),i=A(()=>r().getItemState(t));return te(kV,{value:i,get children(){return te(sV.div,o)}})},ItemContext:e=>e.children(CV()),ItemGroup:e=>{const[t,n]=nV()(e,["id"]),r=oj({id:ue()},t),o=xV(),i=oj(()=>o().getItemGroupProps(r),n);return te(DV,{value:r,get children(){return te(sV.div,i)}})},ItemGroupLabel:e=>{const t=xV(),n=AV(),r=oj(t().getItemGroupLabelProps({htmlFor:n.id}),e);return te(sV.div,r)},ItemIndicator:e=>{const t=xV(),n=TV(),r=oj(()=>t().getItemIndicatorProps(n),e);return te(sV.div,r)},ItemText:e=>{const t=xV(),n=TV(),r=oj(()=>t().getItemTextProps(n),e);return te(sV.div,r)},Positioner:e=>{const t=xV(),n=vV(),r=oj(()=>t().getPositionerProps(),e);return te(fe,{get when(){return!n().unmounted},get children(){return te(sV.div,r)}})},RadioItem:e=>{const[t,n]=nV()(e,["closeOnSelect","disabled","value","valueText"]),r=xV(),o=AV(),i=oj(t,()=>({type:"radio",checked:o.value===t.value,onCheckedChange:()=>o.onValueChange?.({value:t.value})})),a=oj(()=>r().getOptionItemProps(i),n),s=A(()=>r().getItemState(i));return te(SV,{value:i,get children(){return te(kV,{value:s,get children(){return te(sV.div,a)}})}})},RadioItemGroup:e=>{const[t,n]=nV()(e,["id","onValueChange","value"]),r=xV(),o=oj({id:ue()},t),i=oj(()=>r().getItemGroupProps(o),n);return te(DV,{value:o,get children(){return te(sV.div,i)}})},Root:e=>{const[t,n]=hV(e),[r,o]=nV()(n,["anchorPoint","aria-label","closeOnSelect","composite","defaultOpen","highlightedValue","id","ids","loopFocus","onEscapeKeyDown","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","open","positioning","typeahead"]),i=xV(),a=IV(),s=OV(r),l=gV(oj(t,()=>({present:s.api().open})));D(()=>{a&&(i?.().setChild(s.machine),s.api().setParent(a))});return te(NV,{value:()=>i?.().getTriggerItemProps(s.api()),get children(){return te(PV,{get value(){return s.machine},get children(){return te(_V,{get value(){return s.api},get children(){return te(mV,{value:l,get children(){return o.children}})}})}})}})},RootProvider:e=>{const t=xV(),n=IV(),[r,o]=hV(e),i=gV(oj(r,()=>({present:o.value.api().open})));D(()=>{n&&(t?.().setChild(o.value.machine),o.value.api().setParent(n))});return te(NV,{value:()=>t?.().getTriggerItemProps(o.value.api()),get children(){return te(PV,{get value(){return o.value.machine},get children(){return te(_V,{get value(){return o.value.api},get children(){return te(mV,{value:i,get children(){return o.children}})}})}})}})},Separator:e=>{const t=xV(),n=oj(()=>t().getSeparatorProps(),e);return te(sV.hr,n)},Trigger:e=>{const t=xV(),n=vV(),r=oj(()=>t().getTriggerProps(),()=>({"aria-controls":n().unmounted&&null}),e);return te(sV.button,r)},TriggerItem:e=>{const t=RV(),n=oj(()=>t?.(),e);return te(sV.div,n)}});tV({hookName:"useNumberInputContext",providerName:"<NumberInputProvider />"}),tV({hookName:"usePaginationContext",providerName:"<PaginationProvider />"}),tV({hookName:"usePinInputContext",providerName:"<PinInputProvider />"}),tV({hookName:"usePopoverContext",providerName:"<PopoverProvider />"});const[FV,LV]=tV({hookName:"useProgressContext",providerName:"<ProgressProvider />"}),MV=e=>{const t=fV(),n=uV(),r=ue(),o=A(()=>({id:r,dir:t().dir,getRootNode:n().getRootNode,...e})),[i,a]=bj(LH(o()),{context:o});return A(()=>function(e,t,n){const r=e.context.percent,o=e.context.max,i=e.context.min,a=e.context.orientation,s=e.context.translations,l=e.context.isIndeterminate,u=e.context.value,c=s.value({value:u,max:o,percent:r,min:i}),d=function(e,t){return null==e?"indeterminate":e===t?"complete":"loading"}(u,o),p={role:"progressbar","aria-label":c,"data-max":o,"aria-valuemin":i,"aria-valuemax":o,"aria-valuenow":u??void 0,"data-orientation":a,"data-state":d},f=function(e){const t={style:{"--radius":"calc(var(--size) / 2 - var(--thickness) / 2)",cx:"calc(var(--size) / 2)",cy:"calc(var(--size) / 2)",r:"var(--radius)",fill:"transparent",strokeWidth:"var(--thickness)"}};return{root:{viewBox:"0 0 var(--size) var(--size)",style:{width:"var(--size)",height:"var(--size)"}},track:t,range:{opacity:0===e.value?0:void 0,style:{...t.style,"--percent":e.percent,"--circumference":"calc(2 * 3.14159 * var(--radius))","--offset":"calc(var(--circumference) * (100 - var(--percent)) / 100}))",strokeDashoffset:"calc(var(--circumference) * ((100 - var(--percent)) / 100))",strokeDasharray:e.isIndeterminate?void 0:"var(--circumference)",transformOrigin:"center",transform:"rotate(-90deg)"}}}}(e.context);return{value:u,valueAsString:c,setValue(e){t({type:"VALUE.SET",value:e})},setToMax(){t({type:"VALUE.SET",value:o})},getRootProps:()=>n.element({dir:e.context.dir,...RH.root.attrs,id:BH.getRootId(e.context),"data-max":o,"data-value":u??void 0,"data-state":d,"data-orientation":a,style:{"--percent":l?void 0:r}}),getLabelProps:()=>n.element({dir:e.context.dir,id:BH.getLabelId(e.context),...RH.label.attrs,"data-orientation":a}),getValueTextProps:()=>n.element({dir:e.context.dir,"aria-live":"polite",...RH.valueText.attrs}),getTrackProps:()=>n.element({dir:e.context.dir,id:BH.getTrackId(e.context),...RH.track.attrs,...p}),getRangeProps:()=>n.element({dir:e.context.dir,...RH.range.attrs,"data-orientation":a,"data-state":d,style:{[e.context.isHorizontal?"width":"height"]:l?void 0:`${r}%`}}),getCircleProps:()=>n.element({dir:e.context.dir,id:BH.getCircleId(e.context),...RH.circle.attrs,...p,...f.root}),getCircleTrackProps:()=>n.element({dir:e.context.dir,"data-orientation":a,...RH.circleTrack.attrs,...f.track}),getCircleRangeProps:()=>n.element({dir:e.context.dir,...RH.circleRange.attrs,...f.range,"data-state":d}),getViewProps:t=>n.element({dir:e.context.dir,...RH.view.attrs,"data-state":t.state,hidden:t.state!==d})}}(i,a,pj))};var UV=Object.freeze({__proto__:null,Circle:e=>{const t=LV(),n=oj(()=>t().getCircleProps(),e);return te(sV.svg,n)},CircleRange:e=>{const t=LV(),n=oj(()=>t().getCircleRangeProps(),e);return te(sV.circle,n)},CircleTrack:e=>{const t=LV(),n=oj(()=>t().getCircleTrackProps(),e);return te(sV.circle,n)},Context:e=>e.children(LV()),Label:e=>{const t=LV(),n=oj(()=>t().getLabelProps(),e);return te(sV.label,n)},Range:e=>{const t=LV(),n=oj(()=>t().getRangeProps(),e);return te(sV.div,n)},Root:e=>{const[t,n]=nV()(e,["id","ids","max","min","orientation","translations","value"]),r=MV(t),o=oj(()=>r().getRootProps(),n);return te(FV,{value:r,get children(){return te(sV.div,o)}})},RootProvider:e=>{const[{value:t},n]=nV()(e,["value"]),r=oj(()=>t().getRootProps(),n);return te(FV,{value:t,get children(){return te(sV.div,r)}})},Track:e=>{const t=LV(),n=oj(()=>t().getTrackProps(),e);return te(sV.div,n)},ValueText:e=>{const t=LV(),n=oj(()=>t().getValueTextProps(),e);return te(sV.span,ae(n,{get children(){return e.children||t().valueAsString}}))},View:e=>{const[t,n]=nV()(e,["state"]),r=LV(),o=oj(()=>r().getViewProps(t),n);return te(sV.span,o)}});tV({hookName:"useQrCodeContext",providerName:"<QrCodeProvider />"}),tV({hookName:"useRadioGroupContext",providerName:"<RadioGroupProvider />"}),tV({hookName:"useRadioGroupItemContext",providerName:"<RadioGroupItemProvider />"}),tV({hookName:"useRadioGroupItemPropsContext",providerName:"<RadioGroupItemPropsProvider />"}),tV({hookName:"useRatingGroupContext",providerName:"<RatingGroupProvider />"}),tV({hookName:"useRatingGroupItemContext",providerName:"<RatingGroupItemProvider />"}),tV({hookName:"useSegmentGroupContext",providerName:"<SegmentGroupProvider />"}),tV({hookName:"useSegmentGroupItemContext",providerName:"<SegmentGroupItemProvider />"}),tV({hookName:"useSegmentGroupItemPropsContext",providerName:"<SegmentGroupItemPropsProvider />"}),tV({hookName:"useSelectContext",providerName:"<SelectProvider />"}),tV({hookName:"useSelectItemContext",providerName:"<SelectItemProvider />"}),tV({hookName:"useSelectItemPropsContext",providerName:"<SelectItemPropsProvider />"}),tV({hookName:"useSelectItemGroupPropsContext",providerName:"<SelectItemGroupPropsProvider />"}),tV({hookName:"useSignaturePadContext",providerName:"<SignaturePadProvider />"});var jV=(e,t=[])=>({parts:(...n)=>{if(zV(t))return jV(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>jV(e,[...t,...n]),rename:e=>jV(e,t),keys:()=>t,build:()=>[...new Set(t)].reduce((t,n)=>Object.assign(t,{[n]:{selector:[`&[data-scope="${$V(e)}"][data-part="${$V(n)}"]`,`& [data-scope="${$V(e)}"][data-part="${$V(n)}"]`].join(", "),attrs:{"data-scope":$V(e),"data-part":$V(n)}}}),{})}),$V=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),zV=e=>0===e.length;function HV(e,t){const n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0;return n?(n[e]||(n[e]=t()),n[e]):t()}HV("__zag__proxyStateMap",()=>new WeakMap),HV("__zag__refSet",()=>new WeakSet),jV("signature-pad").parts("root","control","segment","segmentPath","guide","clearTrigger","label").build();var VV=Yj({getRootId:e=>e.ids?.root??`signature-${e.id}`,getControlId:e=>e.ids?.control??`signature-control-${e.id}`,getHiddenInputId:e=>e.ids?.hiddenInput??`signature-input-${e.id}`,getControlEl:e=>VV.getById(e,VV.getControlId(e)),getSegmentEl:e=>function(e,t){return e?.querySelector(t)??null}(VV.getControlEl(e),"[data-part=segment]"),getHiddenInputEl:e=>VV.getById(e,VV.getHiddenInputId(e)),getDataUrl:(e,t)=>e.isEmpty?Promise.resolve(""):function(e,t){const{type:n,quality:r=.92}=t;if(!e)throw new Error("[get-data-url]: could not find the svg element");const o=Cj(e),i=o.document,a='<?xml version="1.0" standalone="no"?>\r\n'+(new o.XMLSerializer).serializeToString(e),s="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(a);if("image/svg+xml"===n)return Promise.resolve(s);const l=e.getBoundingClientRect(),u=o.devicePixelRatio||1,c=i.createElement("canvas"),d=new o.Image;d.src=s,c.width=l.width*u,c.height=l.height*u;const p=c.getContext("2d");return p.scale(u,u),new Promise(e=>{d.onload=()=>{p.drawImage(d,0,0),e(c.toDataURL(n,r))}})}(VV.getSegmentEl(e),t)});rj()(["dir","disabled","getRootNode","id","ids","onDraw","onDrawEnd","readOnly","drawing","name"]),tV({hookName:"useSliderContext",providerName:"<SliderProvider />"}),tV({hookName:"useSliderThumbPropsContext",providerName:"<SliderThumbPropsProvider />"}),tV({hookName:"useSplitterContext",providerName:"<SplitterProvider />"}),tV({hookName:"useSwitchContext",providerName:"<SwitchProvider />"}),tV({hookName:"useTabsContext",providerName:"<TabsProvider />"}),tV({hookName:"useTagsInputContext",providerName:"<TagsInputProvider />"}),tV({hookName:"useTagsInputItemContext",providerName:"<TagsInputItemProvider />"}),tV({hookName:"useTagsInputItemPropsContext",providerName:"<TagsInputItemPropsProvider />"});const[WV,qV]=tV({hookName:"useToastContext",providerName:"<ToastProvider />"});var GV=ke("<div><div></div><div>");const KV=e=>{const[t,n]=se(e,["toaster","children"]),[r,o]=bj(t.toaster.machine),i=r.context.placement,a=A(()=>eV.connect(r,o,pj)),s=A(()=>a().getToastsByPlacement(i)),l=oj(a().getGroupProps({placement:i}),n);return te(sV.div,ae(l,{get children(){return te(de,{get each(){return s()},children:e=>te(YV,{value:e,children:e=>t.children(e)})})}}))},YV=e=>{const[t,n]=[yj(r=e.value),r.send];var r;const o=A(()=>function(e,t,n){const r=e.hasTag("visible"),o=e.hasTag("paused"),i=e.context.placement,a=e.context.type,[s,l="center"]=i.split("-");return{type:a,title:e.context.title,description:e.context.description,placement:i,visible:r,paused:o,pause(){t("PAUSE")},resume(){t("RESUME")},dismiss(){t("DISMISS")},getRootProps:()=>n.element({...zH.root.attrs,dir:e.context.dir,id:HH.getRootId(e.context),"data-state":r?"open":"closed","data-type":a,"data-placement":i,"data-align":l,"data-side":s,"data-mounted":wj(e.context.mounted),"data-paused":wj(o),"data-first":wj(e.context.frontmost),"data-sibling":wj(!e.context.frontmost),"data-stack":wj(e.context.stacked),"data-overlap":wj(!e.context.stacked),role:"status","aria-atomic":"true",tabIndex:0,style:KH(e.context,r),onKeyDown(e){e.defaultPrevented||"Escape"==e.key&&(t("DISMISS"),e.preventDefault())}}),getGhostBeforeProps:()=>n.element({"data-ghost":"before",style:YH(e.context,r)}),getGhostAfterProps:()=>n.element({"data-ghost":"after",style:(e.context,{position:"absolute",left:"0",height:"calc(var(--gap) + 2px)",bottom:"100%",width:"100%"})}),getTitleProps:()=>n.element({...zH.title.attrs,id:HH.getTitleId(e.context)}),getDescriptionProps:()=>n.element({...zH.description.attrs,id:HH.getDescriptionId(e.context)}),getActionTriggerProps:()=>n.button({...zH.actionTrigger.attrs,type:"button",onClick(e){e.defaultPrevented||t("DISMISS")}}),getCloseTriggerProps:()=>n.button({id:HH.getCloseTriggerId(e.context),...zH.closeTrigger.attrs,type:"button","aria-label":"Dismiss notification",onClick(e){e.defaultPrevented||t("DISMISS")}})}}(t,n,pj)),i=A(()=>t.context);return te(WV,{value:o,get children(){return e.children(i)}})};var ZV=Object.freeze({__proto__:null,ActionTrigger:e=>{const t=qV(),n=oj(()=>t().getActionTriggerProps(),e);return te(sV.button,n)},CloseTrigger:e=>{const t=qV(),n=oj(()=>t().getCloseTriggerProps(),e);return te(sV.button,n)},Context:e=>e.children(qV()),Description:e=>{const t=qV(),n=oj(()=>t().getDescriptionProps(),e);return te(sV.div,n)},Root:e=>{const t=qV(),n=oj(()=>t().getRootProps(),e);return r=GV(),o=r.firstChild,i=o.nextSibling,Ae(r,n,!1,!0),Ae(o,ae(()=>t().getGhostBeforeProps()),!1,!1),Pe(r,()=>e.children,i),Ae(i,ae(()=>t().getGhostAfterProps()),!1,!1),r;var r,o,i},Title:e=>{const t=qV(),n=oj(()=>t().getTitleProps(),e);return te(sV.div,n)}});tV({hookName:"useToggleGroupContext",providerName:"<ToggleGroupProvider />"}),tV({hookName:"useTooltipContext",providerName:"<TooltipProvider />"}),tV({hookName:"useTreeViewBranchContext",providerName:"<TreeViewBranchProvider />"}),tV({hookName:"useTreeViewContext",providerName:"<TreeViewProvider />"}),tV({hookName:"useTreeViewDepthContext",providerName:"<TreeViewDepthProvider />"}),tV({hookName:"useTreeViewItemContext",providerName:"<TreeViewItemProvider />"}),tV({hookName:"useTreeViewItemPropsContext",providerName:"<TreeViewItemProvider />"});const XV=e=>te(EV.Root,{get open(){return e.isOpen},lazyMount:!0,unmountOnExit:!0,onOpenChange:t=>t.open?void 0:e.onClose?.(),get children(){return[te(EV.Backdrop,{class:"fixed inset-0 bg-[rgba(0,0,0,0.5)] h-screen z-50"}),te(EV.Positioner,{class:"fixed inset-0 z-50 flex items-center justify-center px-2",get children(){return[te(EV.Content,{get children(){return e.children}}),te(EV.CloseTrigger,{class:"fixed top-2 right-2 z-50 rounded-md bg-white p-2 text-black",get children(){return te(ft,{class:"w-4"})}})]}})]}}),QV=ke('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2px" stroke-linecap="round" stroke-linejoin="round"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4">'),JV=e=>(()=>{const t=QV();return Ae(t,e,!0,!0),t})(),eW=ke('<div class="flex items-center gap-4 border bg-white border-gray-200 rounded-md p-2 text-gray-900 min-w-[250px]"><div></div><div class="flex flex-col"><span class="text-md font-normal text-sm"></span><span class="text-gray-500 text-xs">'),tW=e=>{const t=rW(e.file);return(()=>{const n=eW(),r=n.firstChild,o=r.nextSibling.firstChild,i=o.nextSibling;return Pe(r,te(JV,{class:"w-6 h-6"})),Pe(o,()=>e.file.name),Pe(i,()=>nW(e.file)),T(()=>Te(r,tt("rounded-md text-white p-2 flex items-center","pink"===t&&"bg-pink-400","blue"===t&&"bg-blue-400","green"===t&&"bg-green-400","gray"===t&&"bg-gray-400","orange"===t&&"bg-orange-400"))),n})()},nW=e=>{switch(e.name.split(".").pop()){case"pdf":return"PDF";case"doc":case"docx":return"Word";case"xls":case"xlsx":case"csv":return"Sheet";case"json":return"JSON";case"md":return"Markdown";default:return"DOCUMENT"}},rW=e=>{const t=e.name.split(".").pop();if(!t)return"gray";switch(t){case"pdf":return"pink";case"doc":case"docx":return"blue";case"xls":case"xlsx":case"csv":return"green";case"json":return"orange";default:return"gray"}},oW=ke('<div class="flex justify-end items-end animate-fade-in gap-2">'),iW=ke("<div>"),aW=ke("<span>"),sW=ke('<img alt="Attachment">'),lW=ke('<div class="flex flex-col gap-1 items-end w-full"><div class="bubble bubble--guest whitespace-pre-wrap flex flex-col" data-testid="guest-bubble">'),uW=ke("<img>"),cW=ke('<div class="flex flex-col gap-1 items-end"><div class="bubble bubble--guest w-full w-whitespace-pre-wrap flex flex-col" data-testid="guest-bubble"><audio controls>'),dW=e=>(()=>{const t=oW();return Pe(t,te(he,{get children(){return[te(ge,{get when(){return"text"===e.answer?.type},get children(){return te(pW,{get answer(){return e.answer}})}}),te(ge,{get when(){return"recording"===e.answer?.type},get children(){return te(fW,{get answer(){return e.answer}})}})]}}),null),Pe(t,te(fe,{get when(){return e.showAvatar},get children(){return te(dU,{get initialAvatarSrc(){return e.avatarSrc}})}}),null),T(()=>null!=(e.hasHostAvatar?Li()?"28px":"50px":void 0)?t.style.setProperty("margin-left",e.hasHostAvatar?Li()?"28px":"50px":void 0):t.style.removeProperty("margin-left")),t})(),pW=e=>{const[t,n]=S();return(()=>{const r=lW(),o=r.firstChild;return Pe(r,te(fe,{get when(){return(e.answer.attachments??[]).length>0},get children(){return[(()=>{const t=iW();return Pe(t,te(de,{get each(){return e.answer.attachments?.filter(e=>e.type.startsWith("image"))},children:(t,r)=>(()=>{const o=uW();return o.$$click=()=>n(t.url),T(n=>{const i=t.url,a=`Attached image ${r()+1}`,s=tt("bubble bubble--guest cursor-pointer",e.answer.attachments.filter(e=>e.type.startsWith("image")).length>1&&"max-w-[90%]");return i!==n._v$&&Se(o,"src",n._v$=i),a!==n._v$2&&Se(o,"alt",n._v$2=a),s!==n._v$3&&Te(o,n._v$3=s),n},{_v$:void 0,_v$2:void 0,_v$3:void 0}),o})()})),T(()=>Te(t,tt("flex gap-1 overflow-auto max-w-[350px]",Li()?"flex-wrap justify-end":"items-center"))),t})(),(()=>{const t=iW();return Pe(t,te(de,{get each(){return e.answer.attachments?.filter(e=>!e.type.startsWith("image"))},children:e=>te(tW,{get file(){return{name:e.url.split("/").at(-1)}}})})),T(()=>Te(t,tt("flex gap-1 overflow-auto max-w-[350px]",Li()?"flex-wrap justify-end":"items-center"))),t})()]}}),o),Pe(o,te(fe,{get when(){return Qe(e.answer.label??e.answer.value)},get children(){const t=aW();return t.style.setProperty("overflow-wrap","break-word"),Pe(t,()=>e.answer.label??e.answer.value),t}})),Pe(r,te(XV,{get isOpen(){return void 0!==t()},onClose:()=>n(void 0),get children(){const e=sW();return e.style.setProperty("border-radius","6px"),T(()=>Se(e,"src",t())),e}}),null),r})()},fW=e=>(()=>{const t=cW(),n=t.firstChild.firstChild;return T(()=>Se(n,"src",e.answer.url)),t})();Ce(["click"]);let hW=function(e){return e.COLOR="Color",e.IMAGE="Image",e.NONE="None",e}({});[{label:"Top",value:"top"},{label:"Bottom",value:"bottom"}].map(e=>e.value),[{label:"Fixed",value:"fixed"},{label:"Absolute",value:"absolute"}].map(e=>e.value);[{label:"None",value:"none"},{label:"M",value:"medium"},{label:"L",value:"large"},{label:"10",value:"custom"}].map(e=>e.value);const gW="Open Sans",mW="absolute",vW="large",yW="transparent",bW="#01a952",wW=!0,EW=!1,_W=e=>{const{chatChunks:t}=Fi(),n=()=>t()[e.chunkIndex]?.input?.answer;return te(fe,{get when(){return n()&&!e.hasError},get children(){return te(dW,{get answer(){return n()},get showAvatar(){return e.guestAvatar?.isEnabled??EW},get avatarSrc(){return e.guestAvatar?.url&&e.guestAvatar.url},get hasHostAvatar(){return e.hasHostAvatar}})}})},xW=ke("<div><div>"),kW=e=>{let t;const[n,r]=S(0),o=new ResizeObserver(e=>r(e[0].target.clientHeight-(Li()?24:40)));return P(()=>{t&&o.observe(t)}),I(()=>{t&&o.unobserve(t)}),(()=>{const r=xW(),o=r.firstChild;return"function"==typeof t?Oe(t,r):t=r,Pe(o,te(dU,{get initialAvatarSrc(){return e.hostAvatarSrc}})),T(t=>{const i="flex flex-shrink-0 items-center relative bot-avatar-container "+(Li()?"w-6":"w-10"),a="absolute flex items-center top-0"+(Li()?" w-6 h-6":" w-10 h-10")+(e.hideAvatar?" opacity-0":" opacity-100"),s=`${n()}px`,l=e.isTransitionDisabled?void 0:"top 350ms ease-out, opacity 250ms ease-out";return i!==t._v$&&Te(r,t._v$=i),a!==t._v$2&&Te(o,t._v$2=a),s!==t._v$3&&(null!=(t._v$3=s)?o.style.setProperty("top",s):o.style.removeProperty("top")),l!==t._v$4&&(null!=(t._v$4=l)?o.style.setProperty("transition",l):o.style.removeProperty("transition")),t},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),r})()},CW=ke('<div class="flex flex-col animate-fade-in"><div class="flex w-full items-center"><div class="flex relative items-start max-w-full"><div class="bubble bubble--host flex items-center absolute" data-testid="host-bubble"></div><div class="bubble flex flex-col overflow-hidden relative text-ellipsis h-full gap-6">'),SW=ke("<span>"),TW=e=>{const[t,n]=xn(S([]),{key:`bot-streaming-message-${e.streamingMessageId}`,storage:e.context.storage});return D(()=>{if(Ii()?.id!==e.streamingMessageId)return[];n(Ii()?.content.split("```").map((e,t)=>t%2==0?e.split("\n\n").map(e=>eM(e.replace(/【.+】/g,""),{format:"html",enableCodeBlocksMode:!1})):[eM("```"+e+"```",{format:"html",enableCodeBlocksMode:!1})]).flat().filter(Qe)??[])}),(()=>{const e=CW(),n=e.firstChild.firstChild.firstChild,r=n.nextSibling;return n.style.setProperty("width","100%"),n.style.setProperty("height","100%"),Pe(r,te(de,{get each(){return t()},children:e=>(()=>{const t=SW();return t.innerHTML=e,t})()})),e})()},DW=ke('<div class="flex flex-col w-full min-w-0 gap-2"><div><div class="flex flex-col flex-1 gap-2 w-10">'),AW=ke("<div>"),OW=e=>{let t;const{getDisplayedMessageIndex:n,setDisplayedMessageIndex:r}=Fi(),[o,i]=S(),[a,s]=S(!1);D(()=>{e.isTransitionDisabled?(r(e.index,e.messages.length),s(!0)):a()||(r(e.index,0),s(!0))});const l=()=>n(e.index);P(()=>{e.streamingMessageId||(0===e.messages.length&&e.onAllBubblesDisplayed(),e.onScrollToBottom(t,50))});const u=async t=>{(e.settings.typingEmulation?.delayBetweenBubbles??on.delayBetweenBubbles)>0&&l()<e.messages.length-1&&await new Promise(t=>setTimeout(t,1e3*(e.settings.typingEmulation?.delayBetweenBubbles??on.delayBetweenBubbles)));const n=e.messages[l()].id;await e.onNewBubbleDisplayed(n),r(e.index,l()===e.messages.length?l():l()+1),e.onScrollToBottom(t),l()===e.messages.length&&(i(t),e.onAllBubblesDisplayed())};return(()=>{const n=DW(),r=n.firstChild,i=r.firstChild;return Pe(r,te(fe,{get when(){return(e.theme.chat?.hostAvatar?.isEnabled??wW)&&(e.messages.length>0||e.streamingMessageId)},get children(){return te(kW,{get hostAvatarSrc(){return e.theme.chat?.hostAvatar?.url},get hideAvatar(){return e.hideAvatar},get isTransitionDisabled(){return e.isTransitionDisabled}})}}),i),Pe(i,te(fe,{get when(){return e.messages.length>0},get children(){return te(de,{get each(){return e.messages.slice(0,l()+1)},children:(t,n)=>te(aU,{message:t,get typingEmulation(){return e.settings.typingEmulation},get isTypingSkipped(){return A(()=>!(!(e.settings.typingEmulation?.isDisabledOnFirstMessage??on.isDisabledOnFirstMessage)||0!==e.index))()&&0===n()},get onTransitionEnd(){return e.isTransitionDisabled?void 0:u},get onCompleted(){return e.onSubmit}})})}}),null),Pe(i,te(fe,{get when(){return e.streamingMessageId},keyed:!0,children:t=>(()=>{const n=AW(),r=e.blockRef;return"function"==typeof r?Oe(r,n):e.blockRef=n,Pe(n,te(TW,{streamingMessageId:t,get context(){return e.context}})),T(()=>null!=(e.theme.chat?.guestAvatar?.isEnabled?Li()?"calc(100% - 60px)":"calc(100% - 48px - 48px)":"100%")?n.style.setProperty("max-width",e.theme.chat?.guestAvatar?.isEnabled?Li()?"calc(100% - 60px)":"calc(100% - 48px - 48px)":"100%"):n.style.removeProperty("max-width")),n})()}),null),Pe(n,te(fe,{get when(){return l()===e.messages.length&&e.input},children:n=>te(_W,{ref(e){"function"==typeof t?t(e):t=e},get block(){return n()},get chunkIndex(){return e.index},get hasHostAvatar(){return e.theme.chat?.hostAvatar?.isEnabled??wW},get guestAvatar(){return e.theme.chat?.guestAvatar},get context(){return e.context},get isInputPrefillEnabled(){return e.settings.general?.isInputPrefillEnabled??rn.isInputPrefillEnabled},get hasError(){return e.hasError},onTransitionEnd:()=>e.onScrollToBottom(o()),get onSubmit(){return e.onSubmit},get onSkip(){return e.onSkip}})}),null),T(()=>Te(r,tt("flex",Li()?"gap-1":"gap-2"))),n})()},PW=ke('<div class="w-full max-w-xs p-4 bg-white shadow-lg rounded-lg flex flex-col gap-3 toast--popup-blocked border border-gray-200" role="alert"><div class="flex items-start gap-2"><div class="flex flex-col gap-1 flex-1"><div class="flex-shrink-0 mt-0.5"><svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-orange-500" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd"></path></svg></div><span class="text-sm font-semibold text-gray-900">Popup blocked</span><div class="text-sm font-normal text-gray-600 leading-relaxed">The bot wants to open a new tab but it was blocked by your browser. It needs a manual approval.</div></div></div><a target="_blank" class="button justify-center text-sm font-medium focus:outline-none focus:ring-2 focus:ring-offset-2 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 rounded-lg hover:opacity-90 active:scale-[0.98]" rel="noreferrer"><span>Continue in new tab</span><svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" viewBox="0 0 20 20" fill="currentColor"><path d="M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"></path><path d="M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z">'),IW=e=>(()=>{const t=PW(),n=t.firstChild.nextSibling;return n.$$click=()=>e.onLinkClick(),T(()=>Se(n,"href",e.url)),t})();Ce(["click"]);const NW=ke('<div class="conversation-container__body flex flex-col overflow-y-auto w-full px-5 py-10 relative scroll-smooth gap-2 flex-[9]">'),RW=ke('<div class="flex justify-end">'),BW=e=>{const{chatChunks:t,theme:n,hasError:r,blockRef:o,blockedPopupUrl:i,setBlockedPopupUrl:a,isSending:s,sendMessage:l,processClientSideActions:u,onBubblesDisplayed:c}=Fi();let d,p;P(()=>{(async()=>{const e=t()[0];if(!e.clientSideActions)return;const n=e.clientSideActions.filter(e=>Ze(e.lastBubbleBlockId));await u(n)})()}),I(()=>{p&&clearTimeout(p)});const f=async()=>{const n=[...t()].pop();n&&(p&&clearTimeout(p),p=setTimeout(()=>{c(),p=void 0},300),Ze(n.input)&&e.onEnd?.())},h=async n=>{const r=[...t()].pop();if(!r)return;const o=r.messages.find(e=>e.id===n);if(o){if(e.onNewBlock&&e.onNewBlock({id:o.id,type:o.type}),r.clientSideActions){const e=r.clientSideActions.filter(e=>e.lastBubbleBlockId===n);await u(e)}}else console.warn(`Block with id "${n}" not found in messages`,{blockId:n,availableMessageIds:r.messages.map(e=>e.id),chunkIndex:t().length-1})},g=()=>l(void 0);return(()=>{const u=NW();return"function"==typeof d?Oe(d,u):d=u,Pe(u,te(pe,{get each(){return t()},children:(i,a)=>te(OW,{blockRef:o,index:a,get messages(){return i().messages},get input(){return i().input},get theme(){return n()},get settings(){return e.initialChatReply.bot.settings},get streamingMessageId(){return i().streamingMessageId},get context(){return e.context},get hideAvatar(){return A(()=>!i().input)()&&((t()[a+1]?.messages??0).length>0||void 0!==t()[a+1]?.streamingMessageId||i().messages.length>0&&s())},get hasError(){return A(()=>!!r())()&&a===t().length-1},get isTransitionDisabled(){return a!==t().length-1},onNewBubbleDisplayed:h,onAllBubblesDisplayed:f,onSubmit:l,onScrollToBottom:(e,t)=>nn(d,e,t),onSkip:g})}),null),Pe(u,te(fe,{get when(){return i()},keyed:!0,children:e=>(()=>{const t=RW();return Pe(t,te(IW,{url:e,onLinkClick:()=>a(void 0)})),t})()}),null),u})()},FW=ke('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_7660_13477)"><path d="M24 0H0V24H24V0Z" fill="#5DDE8A"></path><path d="M0 0L7.00328 7.00328L8.30164 6.25574L10.9377 5.23279H12.8262L15.8951 5.98033L17.5475 8.18361L18.0984 9.83607L18.3738 12.3541L18.4918 13.6525L17.0754 16.6426H16.6426L24 24V0H0Z" fill="#5BCB82"></path><path d="M14.0853 18.2951H5.27222V9.67872C5.27222 7.12134 7.35746 5.07544 9.87549 5.07544H14.046C16.6034 5.07544 18.6493 7.16069 18.6493 9.67872V13.6918C18.6886 16.2099 16.6427 18.2951 14.0853 18.2951ZM6.49189 17.1148H14.1247C16.0132 17.1148 17.5476 15.5804 17.5476 13.6918V9.67872C17.5476 7.79019 16.0132 6.25577 14.1247 6.25577H9.91484C8.02631 6.25577 6.49189 7.79019 6.49189 9.67872V17.1148Z" fill="white"></path><path d="M11.9609 12.6295C12.4824 12.6295 12.9051 12.2067 12.9051 11.6852C12.9051 11.1637 12.4824 10.741 11.9609 10.741C11.4394 10.741 11.0166 11.1637 11.0166 11.6852C11.0166 12.2067 11.4394 12.6295 11.9609 12.6295Z" fill="white"></path><path d="M8.97063 12.6295C9.49213 12.6295 9.91489 12.2067 9.91489 11.6852C9.91489 11.1637 9.49213 10.741 8.97063 10.741C8.44913 10.741 8.02637 11.1637 8.02637 11.6852C8.02637 12.2067 8.44913 12.6295 8.97063 12.6295Z" fill="white"></path><path d="M15.0297 12.6295C15.5512 12.6295 15.974 12.2067 15.974 11.6852C15.974 11.1637 15.5512 10.741 15.0297 10.741C14.5082 10.741 14.0854 11.1637 14.0854 11.6852C14.0854 12.2067 14.5082 12.6295 15.0297 12.6295Z" fill="white"></path></g><defs><clipPath id="clip0_7660_13477"><path d="M0 1.62712C0 0.728487 0.728486 0 1.62712 0H22.3729C23.2715 0 24 0.728486 24 1.62712V22.3729C24 23.2715 23.2715 24 22.3729 24H1.62712C0.728487 24 0 23.2715 0 22.3729V1.62712Z" fill="white">'),LW=()=>FW(),MW=ke('<a href="https://quick.bot/?utm_source=litebadge" target="_blank" rel="noopener noreferrer" class="!p-3 !bg-black/[0.04] !z-50 !border-t !border-black/[0.08] !text-black/60 !gap-2 !text-xs !leading-3 !h-10 !font-normal !opacity-100 !visible !flex !items-center !justify-center !no-underline hover:!bg-[#f7f8ff] [&_svg]:!w-4 [&_svg]:!h-4" id="lite-badge"><span>Powered by quick.bot'),UW=e=>{let t,n;const r=n=>{n.forEach(n=>{n.removedNodes.forEach(n=>{"id"in n&&t&&"lite-badge"==n.id&&(console.log("Sorry, you can't remove the brand 😅"),e.botContainer?.append(t))})})};return P(()=>{document&&e.botContainer&&(n=new MutationObserver(r),n.observe(e.botContainer,{subtree:!1,childList:!0}))}),I(()=>{n&&n.disconnect()}),(()=>{const e=MW(),n=e.firstChild;return"function"==typeof t?Oe(t,e):t=e,Pe(e,te(LW,{}),n),e})()},jW=ke('<div class="!p-3 !z-50 !text-black/60 !gap-2 !leading-3 !h-10 !font-normal !opacity-100 !visible !flex !items-center !justify-center !no-underline hover:!opacity-80"><span>The conversation has ended.'),$W=()=>jW(),zW=ke('<textarea id="user-input" class="focus:outline-none bg-transparent flex-1 w-full resize-none overflow-hidden h-[25px]" data-testid="textarea" required>'),HW=e=>{const[t,n]=se(e,["ref","onInput","containerRef"]),r=e=>{const n=e.currentTarget;n.style.height="25px";const r=Math.max(25,Math.min(n.scrollHeight,150));n.style.height=`${r}px`,n.style.overflow=n.scrollHeight>150?"auto":"hidden",t.onInput(n.value)};return(()=>{const e=zW();e.$$input=r;const o=t.ref;return"function"==typeof o?Oe(o,e):t.ref=e,Ae(e,ae({get autofocus(){return!Li()}},n),!1,!1),e})()};Ce(["input"]);const VW=ke('<img class="rounded-md object-cover w-[58px] h-[58px]">'),WW=ke('<div class="relative group flex-shrink-0"><button class="absolute -right-2 p-0.5 -top-2 rounded-full bg-gray-200 text-black border border-gray-400 opacity-1 sm:opacity-0 group-hover:opacity-100 transition-opacity" aria-label="Remove attachment">'),qW=ke('<div class="absolute w-full h-full inset-0 bg-black/20 rounded-md">'),GW=e=>(()=>{const t=WW(),n=t.firstChild;return Pe(t,te(he,{get children(){return[te(ge,{get when(){return e.file.type.startsWith("image")},get children(){const t=VW();return T(n=>{const r=URL.createObjectURL(e.file),o=e.file.name;return r!==n._v$&&Se(t,"src",n._v$=r),o!==n._v$2&&Se(t,"alt",n._v$2=o),n},{_v$:void 0,_v$2:void 0}),t}}),te(ge,{when:!0,get children(){return te(tW,{get file(){return e.file}})}})]}}),n),n.addEventListener("click",e.onRemoveClick),Pe(n,te(ft,{class:"w-4"})),Pe(t,te(fe,{get when(){return Ye(e.uploadProgressPercent)&&100!==e.uploadProgressPercent},get children(){return te(KW,{get progressPercent(){return e.uploadProgressPercent}})}}),null),t})(),KW=e=>{const[t,n]=S(e.progressPercent??0);let r;return D(()=>{if(20===e.progressPercent){r=setInterval(()=>{t()<100&&n(e=>e+(Math.floor(10*Math.random())+1))},1e3)}}),I(()=>{clearInterval(r)}),(()=>{const e=qW();return Pe(e,te(UV.Root,{get value(){return t()},class:"flex items-center justify-center",get children(){return te(UV.Circle,{get children(){return[te(UV.CircleTrack,{}),te(UV.CircleRange,{})]}})}})),e})()},YW=ke('<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M8.99992 16V6.41407L5.70696 9.70704C5.31643 10.0976 4.68342 10.0976 4.29289 9.70704C3.90237 9.31652 3.90237 8.6835 4.29289 8.29298L9.29289 3.29298L9.36907 3.22462C9.76184 2.90427 10.3408 2.92686 10.707 3.29298L15.707 8.29298L15.7753 8.36915C16.0957 8.76192 16.0731 9.34092 15.707 9.70704C15.3408 10.0732 14.7618 10.0958 14.3691 9.7754L14.2929 9.70704L10.9999 6.41407V16C10.9999 16.5523 10.5522 17 9.99992 17C9.44764 17 8.99992 16.5523 8.99992 16Z">'),ZW=e=>(()=>{const t=YW();return Ae(t,e,!0,!0),t})(),XW=ke('<svg><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">'),QW=e=>(()=>{const t=XW();return Ae(t,ae(e,{get class(){return tt("animate-spin h-6 w-6",e.class)},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","data-testid":"loading-spinner"}),!0,!0),t})(),JW=ke("<button>"),eq=e=>{const t=L(()=>e.children),[n,r]=se(e,["disabled","class"]),o=e.isDisabled||e.isLoading;return(()=>{const i=JW();return Ae(i,ae(r,{disabled:o,get class(){return tt("button focus:outline-none filter hover:brightness-90 active:brightness-75 disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 flex justify-center transition-all duration-300 w-auto",n.class)}}),!1,!0),Pe(i,te(fe,{get when(){return!e.isLoading},get fallback(){return te(QW,{})},get children(){return t()}})),i})()},tq=e=>{const t=zM.NEXT_PUBLIC_BETA_ENV&&!!e?.children;return te(eq,ae({type:"submit","aria-label":t?void 0:"Send",get class(){return tt(t?"px-4":void 0,e.class)}},e,{get children(){return te(he,{get children(){return[te(ge,{when:!t,get children(){return te(ZW,{})}}),te(ge,{when:t,get children(){return e.children}})]}})}}))},nq=ke('<form><div class="flex w-full h-full transition-all duration-100"></div><div class="flex-shrink-0">'),rq=e=>{const{children:t,onSubmit:n,buttonLabel:r,isDisabled:o=!1,class:i,customButton:a,isInputDisabled:s,hasError:l}=e;return(()=>{const e=nq(),u=e.firstChild,c=u.nextSibling;return e.addEventListener("submit",e=>{e.preventDefault(),n()}),Pe(u,t),Pe(c,te(fe,{when:a,get fallback(){return te(tq,{isDisabled:o,children:r})},children:a})),T(()=>Te(e,tt("input__field w-full flex gap-2 items-center border rounded-full px-5 py-2 pr-2 overflow-hidden",s?.()&&!l&&"opacity-50 pointer-events-none",i))),e})()},oq=e=>{const t=t=>{const{data:n}=t;n.isFromBot&&e(t)};P(()=>{window.addEventListener("message",t)}),I(()=>{window.removeEventListener("message",t)})},iq="Send";let aq=function(e){return e.TEXT="text input",e.NUMBER="number input",e.EMAIL="email input",e.URL="url input",e.DATE="date input",e.PHONE="phone number input",e.CHOICE="buttons input",e.RATING="rating input",e.FILE="file input",e}({});const sq={placeholder:"Type your answer..."},lq={isEnabled:!1},uq=ke('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2px" stroke-linecap="round" stroke-linejoin="round"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><circle cx="10" cy="12" r="2"></circle><path d="m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22">'),cq=e=>(()=>{const t=uq();return Ae(t,e,!0,!0),t})(),dq=ke('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48">'),pq=e=>(()=>{const t=dq();return Ae(t,e,!0,!0),t})(),fq=ke('<input type="file" id="document-upload" multiple class="hidden">'),hq=ke('<input type="file" id="photos-upload" accept="image/*, video/*" multiple class="hidden">'),gq=ke('<label aria-label="Add attachments" for="document-upload">'),mq=ke("<label> Document"),vq=ke("<label> Photos & videos"),yq=e=>[(()=>{const t=fq();return t.addEventListener("change",t=>{t.currentTarget.files&&e.onNewFiles(t.currentTarget.files)}),t})(),(()=>{const t=hq();return t.addEventListener("change",t=>{t.currentTarget.files&&e.onNewFiles(t.currentTarget.files)}),t})(),te(he,{get children(){return[te(ge,{get when(){return Li()},get children(){const t=gq();return Pe(t,te(pq,{class:"w-5"})),T(()=>Te(t,tt("filter data-[state=open]:backdrop-brightness-90 hover:backdrop-brightness-95 transition rounded-md p-2 focus:outline-none",e.class))),t}}),te(ge,{when:!0,get children(){return te(BV.Root,{get children(){return[te(BV.Trigger,{get class(){return tt("filter data-[state=open]:backdrop-brightness-90 hover:backdrop-brightness-95 transition rounded-md p-2 focus:outline-none",e.class)},"aria-label":"Add attachments",get children(){return te(pq,{class:"w-5"})}}),te(BV.Positioner,{get children(){return te(BV.Content,{class:"p-3 gap-2 focus:outline-none",get children(){return[te(BV.Item,{value:"document",asChild:e=>(()=>{const t=mq(),n=t.firstChild;return Ae(t,ae(e,{for:"document-upload",class:"p-2 filter hover:brightness-95 flex gap-3 items-center"}),!1,!0),Pe(t,te(JV,{class:"w-4"}),n),t})()}),te(BV.Item,{value:"photos",asChild:e=>(()=>{const t=vq(),n=t.firstChild;return Ae(t,ae(e,{for:"photos-upload",class:"p-2 filter hover:brightness-95 flex gap-3 items-center"}),!1,!0),Pe(t,te(cq,{class:"w-4"}),n),t})()})]}})}})]}})}})]}})],bq=({newFile:e,existingFiles:t,onError:n})=>{const r=Et("NEXT_PUBLIC_BOT_FILE_UPLOAD_MAX_SIZE");if(r&&e.size>1024*r*1024)return void n({title:"File too large",description:`${e.name} is larger than ${r}MB`});if(0===t.length)return e;let o=e.name,i=1;for(;t.some(e=>e.name===o);){const t=e.name.lastIndexOf("."),n=-1!==t?e.name.slice(t):"";o=`${e.name.slice(0,t)}(${i})${n}`,i++}return new File([e],o,{type:e.type})},wq=(e=>{const t=eV.machine({id:"1",...e});return{...eV.connect(t,t.send,pj),machine:t}})({placement:"bottom-end",gap:24}),Eq=async({apiHost:e,files:t,onUploadProgress:n})=>{const r=[];let o=0;for(const{input:i,file:a}of t){n&&n({progress:o/t.length*100,fileIndex:o}),o+=1;const{data:s}=await Ke({method:"POST",url:`${e}/api/v2/generate-upload-url`,body:{fileName:i.fileName,sessionId:i.sessionId,fileType:a.type}});if(s?.presignedUrl){const e=new FormData;Object.entries(s.formData).forEach(([t,n])=>{e.append(t,n)}),e.append("file",a);if(!(await fetch(s.presignedUrl,{method:"POST",body:e})).ok)continue;r.push({url:s.fileUrl,type:a.type})}}return r},_q=e=>{e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(e,t,n,r)=>t+t+n+n+r+r);const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:[0,0,0]},xq=e=>{if(!e)return[0,0,0];if(e.startsWith("#"))return _q(e);if(e.startsWith("rgba")||e.startsWith("rgb")){const t=e.match(/\d+(\.\d+)?/g);if(t&&t.length>=3)return[parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10)]}return _q(e)},kq=e=>{if(!e)return 1;if(e.startsWith("rgba")){const t=e.match(/\d+(\.\d+)?/g);if(t&&t.length>=4)return parseFloat(t[3])}return 1},Cq=e=>({rgb:xq(e),alpha:kq(e)}),Sq=ke('<div><button class="p-0.5 rounded-full" aria-label="Stop recording"></button><div class="relative flex w-full"><canvas class="w-full h-[56px]"></canvas><div class="absolute w-2 left-0 h-[56px] recorder__left-gradient"></div><div class="absolute w-3 right-0 h-[56px] recorder__right-gradient"></div></div><span class="flex-none w-[35px] font-bold text-sm">'),Tq=e=>{const[t,n]=S(0);let r,o,i,a,s,l,u,c,d,p=[],f=0;const h=_q(e.buttonsTheme?.backgroundColor??bW).join(", "),g=()=>{if(!i||!r||!d)return;const e=performance.now(),t=e-d;d=e,i.clearRect(0,0,r.width,r.height),i.fillStyle=`rgba(${h}, 0.2)`;for(let e=0;e<(r.width+3)/6;e++){const t=6*e-f,n=.1*r.height,o=(r.height-n)/2;i.beginPath(),i.roundRect(t,o,3,n,5),i.fill()}i.fillStyle=`rgba(${h}, 1)`;for(let e=0;e<p.length;e++){const t=r.width+6*(e+1)-f,n=r.height*(p[e]/100),o=(r.height-n)/2;i.beginPath(),i.roundRect(t,o,3,n,5),i.fill()}f+=t/1e3*60,o=requestAnimationFrame(g)},m=()=>{i&&r&&i.clearRect(0,0,r.width,r.height),f=0,s?.disconnect(),s=void 0,l?.disconnect(),l=void 0,a?.close(),a=void 0,u?.getTracks().forEach(e=>e.stop()),u=void 0,p=[],clearTimeout(c),n(0),cancelAnimationFrame(o),e.onAbortRecording()};return D(()=>{"asking"===e.recordingStatus?(async()=>{r&&(u=await navigator.mediaDevices.getUserMedia({audio:!0}),e.onRecordingConfirmed(u),i||(i=r.getContext("2d")??void 0),c=setInterval(()=>{n(e=>e+1)},1e3),a=new AudioContext,s=await Dq(a),l=a.createMediaStreamSource(u),l.connect(s),s.connect(a.destination),s.port.onmessage=e=>{6*((r.width+3)/6+p.length)<r.width+f&&p.push(Math.min(Math.max(e.data,5),90))},d=performance.now(),o=requestAnimationFrame(g))})():"stopped"===e.recordingStatus&&m()}),I(()=>{m()}),(()=>{const n=Sq(),o=n.firstChild,i=o.nextSibling,a=i.firstChild,s=i.nextSibling;o.addEventListener("click",m),Pe(o,te(ft,{class:"w-4"}));return"function"==typeof r?Oe(r,a):r=a,Pe(s,()=>Aq(t())),T(()=>Te(n,tt("w-full gap-2 items-center transition-opacity px-2 recorder","started"===e.recordingStatus?"opacity-1 flex":"opacity-0 hidden"))),n})()},Dq=async e=>{const t=new Blob(['\nconst gainFactor = 3;\n\nclass VolumeProcessor extends AudioWorkletProcessor {\n constructor() {\n super();\n }\n\n process(inputs) {\n const input = inputs[0];\n if (input.length > 0) {\n const channelData = input[0];\n let sum = 0;\n for (let i = 0; i < channelData.length; i++) {\n sum += channelData[i] * channelData[i];\n }\n const rms = Math.sqrt(sum / channelData.length);\n this.port.postMessage(rms * 100 * gainFactor)\n }\n return true;\n }\n}\n\nregisterProcessor("volume-processor", VolumeProcessor);\n\n'],{type:"application/javascript"}),n=URL.createObjectURL(t);return await e.audioWorklet.addModule(n),new AudioWorkletNode(e,"volume-processor")},Aq=e=>`${Math.floor(e/60)}:${(e%60).toString().padStart(2,"0")}`,Oq=ke('<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M15.7806 10.1963C16.1326 10.3011 16.3336 10.6714 16.2288 11.0234L16.1487 11.2725C15.3429 13.6262 13.2236 15.3697 10.6644 15.6299L10.6653 16.835H12.0833L12.2171 16.8486C12.5202 16.9106 12.7484 17.1786 12.7484 17.5C12.7484 17.8214 12.5202 18.0894 12.2171 18.1514L12.0833 18.165H7.91632C7.5492 18.1649 7.25128 17.8672 7.25128 17.5C7.25128 17.1328 7.5492 16.8351 7.91632 16.835H9.33527L9.33429 15.6299C6.775 15.3697 4.6558 13.6262 3.84992 11.2725L3.76984 11.0234L3.74445 10.8906C3.71751 10.5825 3.91011 10.2879 4.21808 10.1963C4.52615 10.1047 4.84769 10.2466 4.99347 10.5195L5.04523 10.6436L5.10871 10.8418C5.8047 12.8745 7.73211 14.335 9.99933 14.335C12.3396 14.3349 14.3179 12.7789 14.9534 10.6436L15.0052 10.5195C15.151 10.2466 15.4725 10.1046 15.7806 10.1963ZM12.2513 5.41699C12.2513 4.17354 11.2437 3.16521 10.0003 3.16504C8.75675 3.16504 7.74835 4.17343 7.74835 5.41699V9.16699C7.74853 10.4104 8.75685 11.418 10.0003 11.418C11.2436 11.4178 12.2511 10.4103 12.2513 9.16699V5.41699ZM13.5814 9.16699C13.5812 11.1448 11.9781 12.7479 10.0003 12.748C8.02232 12.748 6.41845 11.1449 6.41828 9.16699V5.41699C6.41828 3.43889 8.02221 1.83496 10.0003 1.83496C11.9783 1.83514 13.5814 3.439 13.5814 5.41699V9.16699Z">'),Pq=e=>(()=>{const t=Oq();return Ae(t,e,!0,!0),t})();var Iq={},Nq=function(e,t){return Nq=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Nq(e,t)};function Rq(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Nq(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Bq=function(){return Bq=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Bq.apply(this,arguments)};function Fq(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function Lq(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function Mq(e,t){return function(n,r){t(n,r,e)}}function Uq(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function jq(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}function $q(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}var zq=Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function Hq(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||zq(t,e,n)}function Vq(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Wq(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function qq(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Wq(arguments[t]));return e}function Gq(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r}function Kq(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function Yq(e){return this instanceof Yq?(this.v=e,this):new Yq(e)}function Zq(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise(function(n,r){i.push([e,t,n,r])>1||s(e,t)})})}function s(e,t){try{!function(e){e.value instanceof Yq?Promise.resolve(e.value.v).then(l,u):c(i[0][2],e)}(o[e](t))}catch(e){c(i[0][3],e)}}function l(e){s("next",e)}function u(e){s("throw",e)}function c(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}function Xq(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:Yq(e[r](t)),done:!1}:o?o(t):t}:o}}function Qq(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=Vq(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,o){(function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)})(r,o,(t=e[n](t)).done,t.value)})}}}function Jq(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var eG=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function tG(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&zq(t,e,n);return eG(t,e),t}function nG(e){return e&&e.__esModule?e:{default:e}}function rG(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function oG(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}function iG(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function aG(e,t,n){if(null!=t){if("object"!=typeof t)throw new TypeError("Object expected.");var r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose]}if("function"!=typeof r)throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}var sG="function"==typeof SuppressedError?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function lG(e){function t(t){e.error=e.hasError?new sG(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function n(){for(;e.stack.length;){var r=e.stack.pop();try{var o=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(o).then(n,function(e){return t(e),n()})}catch(e){t(e)}}if(e.hasError)throw e.error}()}var uG,cG={__extends:Rq,__assign:Bq,__rest:Fq,__decorate:Lq,__param:Mq,__metadata:Uq,__awaiter:jq,__generator:$q,__createBinding:zq,__exportStar:Hq,__values:Vq,__read:Wq,__spread:qq,__spreadArrays:Gq,__spreadArray:Kq,__await:Yq,__asyncGenerator:Zq,__asyncDelegator:Xq,__asyncValues:Qq,__makeTemplateObject:Jq,__importStar:tG,__importDefault:nG,__classPrivateFieldGet:rG,__classPrivateFieldSet:oG,__classPrivateFieldIn:iG,__addDisposableResource:aG,__disposeResources:lG},dG=Object.freeze({__proto__:null,__addDisposableResource:aG,get __assign(){return Bq},__asyncDelegator:Xq,__asyncGenerator:Zq,__asyncValues:Qq,__await:Yq,__awaiter:jq,__classPrivateFieldGet:rG,__classPrivateFieldIn:iG,__classPrivateFieldSet:oG,__createBinding:zq,__decorate:Lq,__disposeResources:lG,__esDecorate:function(e,t,n,r,o,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,l=r.kind,u="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,d=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),p=!1,f=n.length-1;f>=0;f--){var h={};for(var g in r)h[g]="access"===g?{}:r[g];for(var g in r.access)h.access[g]=r.access[g];h.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var m=(0,n[f])("accessor"===l?{get:d.get,set:d.set}:d[u],h);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(s=a(m.get))&&(d.get=s),(s=a(m.set))&&(d.set=s),(s=a(m.init))&&o.unshift(s)}else(s=a(m))&&("field"===l?o.unshift(s):d[u]=s)}c&&Object.defineProperty(c,r.name,d),p=!0},__exportStar:Hq,__extends:Rq,__generator:$q,__importDefault:nG,__importStar:tG,__makeTemplateObject:Jq,__metadata:Uq,__param:Mq,__propKey:function(e){return"symbol"==typeof e?e:"".concat(e)},__read:Wq,__rest:Fq,__runInitializers:function(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0},__setFunctionName:function(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})},__spread:qq,__spreadArray:Kq,__spreadArrays:Gq,__values:Vq,default:cG}),pG={},fG={},hG={};function gG(){if(uG)return hG;uG=1,Object.defineProperty(hG,"__esModule",{value:!0}),hG.WebmBase=void 0;return hG.WebmBase=class{constructor(e="Unknown",t=0){this.name=e,this.start=t}getType(){return"Unknown"}updateBySource(){}setSource(e){this.source=e,this.updateBySource()}updateByData(){}setData(e){this.data=e,this.updateByData()}getValue(){return this.data}setValue(e){this.setData(e)}},hG}var mG,vG,yG={},bG={},wG={};function EG(){return mG||(mG=1,Object.defineProperty(wG,"__esModule",{value:!0}),wG.SectionType=void 0,function(e){e.Container="Container",e.Uint="Uint",e.Int="Int",e.Float="Float",e.String="String",e.Date="Date",e.Binary="Binary"}(e||(wG.SectionType=e={}))),wG;var e}function _G(){if(vG)return bG;vG=1,Object.defineProperty(bG,"__esModule",{value:!0}),bG.sections=void 0;const e=EG();return bG.sections={172351395:{name:"EBML",type:e.SectionType.Container},646:{name:"EBMLVersion",type:e.SectionType.Uint},759:{name:"EBMLReadVersion",type:e.SectionType.Uint},754:{name:"EBMLMaxIDLength",type:e.SectionType.Uint},755:{name:"EBMLMaxSizeLength",type:e.SectionType.Uint},642:{name:"DocType",type:e.SectionType.String},647:{name:"DocTypeVersion",type:e.SectionType.Uint},645:{name:"DocTypeReadVersion",type:e.SectionType.Uint},108:{name:"Void",type:e.SectionType.Binary},63:{name:"CRC-32",type:e.SectionType.Binary},190023271:{name:"SignatureSlot",type:e.SectionType.Container},16010:{name:"SignatureAlgo",type:e.SectionType.Uint},16026:{name:"SignatureHash",type:e.SectionType.Uint},16037:{name:"SignaturePublicKey",type:e.SectionType.Binary},16053:{name:"Signature",type:e.SectionType.Binary},15963:{name:"SignatureElements",type:e.SectionType.Container},15995:{name:"SignatureElementList",type:e.SectionType.Container},9522:{name:"SignedElement",type:e.SectionType.Binary},139690087:{name:"Segment",type:e.SectionType.Container},21863284:{name:"SeekHead",type:e.SectionType.Container},3515:{name:"Seek",type:e.SectionType.Container},5035:{name:"SeekID",type:e.SectionType.Binary},5036:{name:"SeekPosition",type:e.SectionType.Uint},88713574:{name:"Info",type:e.SectionType.Container},13220:{name:"SegmentUID",type:e.SectionType.Binary},13188:{name:"SegmentFilename",type:e.SectionType.String},1882403:{name:"PrevUID",type:e.SectionType.Binary},1868715:{name:"PrevFilename",type:e.SectionType.String},2013475:{name:"NextUID",type:e.SectionType.Binary},1999803:{name:"NextFilename",type:e.SectionType.String},1092:{name:"SegmentFamily",type:e.SectionType.Binary},10532:{name:"ChapterTranslate",type:e.SectionType.Container},10748:{name:"ChapterTranslateEditionUID",type:e.SectionType.Uint},10687:{name:"ChapterTranslateCodec",type:e.SectionType.Uint},10661:{name:"ChapterTranslateID",type:e.SectionType.Binary},710577:{name:"TimecodeScale",type:e.SectionType.Uint},1161:{name:"Duration",type:e.SectionType.Float},1121:{name:"DateUTC",type:e.SectionType.Date},15273:{name:"Title",type:e.SectionType.String},3456:{name:"MuxingApp",type:e.SectionType.String},5953:{name:"WritingApp",type:e.SectionType.String},103:{name:"Timecode",type:e.SectionType.Uint},6228:{name:"SilentTracks",type:e.SectionType.Container},6359:{name:"SilentTrackNumber",type:e.SectionType.Uint},39:{name:"Position",type:e.SectionType.Uint},43:{name:"PrevSize",type:e.SectionType.Uint},35:{name:"SimpleBlock",type:e.SectionType.Binary},32:{name:"BlockGroup",type:e.SectionType.Container},33:{name:"Block",type:e.SectionType.Binary},34:{name:"BlockVirtual",type:e.SectionType.Binary},13729:{name:"BlockAdditions",type:e.SectionType.Container},38:{name:"BlockMore",type:e.SectionType.Container},110:{name:"BlockAddID",type:e.SectionType.Uint},37:{name:"BlockAdditional",type:e.SectionType.Binary},27:{name:"BlockDuration",type:e.SectionType.Uint},122:{name:"ReferencePriority",type:e.SectionType.Uint},123:{name:"ReferenceBlock",type:e.SectionType.Int},125:{name:"ReferenceVirtual",type:e.SectionType.Int},36:{name:"CodecState",type:e.SectionType.Binary},13730:{name:"DiscardPadding",type:e.SectionType.Int},14:{name:"Slices",type:e.SectionType.Container},104:{name:"TimeSlice",type:e.SectionType.Container},76:{name:"LaceNumber",type:e.SectionType.Uint},77:{name:"FrameNumber",type:e.SectionType.Uint},75:{name:"BlockAdditionID",type:e.SectionType.Uint},78:{name:"Delay",type:e.SectionType.Uint},79:{name:"SliceDuration",type:e.SectionType.Uint},72:{name:"ReferenceFrame",type:e.SectionType.Container},73:{name:"ReferenceOffset",type:e.SectionType.Uint},74:{name:"ReferenceTimeCode",type:e.SectionType.Uint},47:{name:"EncryptedBlock",type:e.SectionType.Binary},106212971:{name:"Tracks",type:e.SectionType.Container},46:{name:"TrackEntry",type:e.SectionType.Container},87:{name:"TrackNumber",type:e.SectionType.Uint},13253:{name:"TrackUID",type:e.SectionType.Uint},3:{name:"TrackType",type:e.SectionType.Uint},57:{name:"FlagEnabled",type:e.SectionType.Uint},8:{name:"FlagDefault",type:e.SectionType.Uint},5546:{name:"FlagForced",type:e.SectionType.Uint},28:{name:"FlagLacing",type:e.SectionType.Uint},11751:{name:"MinCache",type:e.SectionType.Uint},11768:{name:"MaxCache",type:e.SectionType.Uint},254851:{name:"DefaultDuration",type:e.SectionType.Uint},216698:{name:"DefaultDecodedFieldDuration",type:e.SectionType.Uint},209231:{name:"TrackTimecodeScale",type:e.SectionType.Float},4991:{name:"TrackOffset",type:e.SectionType.Int},5614:{name:"MaxBlockAdditionID",type:e.SectionType.Uint},4974:{name:"Name",type:e.SectionType.String},177564:{name:"Language",type:e.SectionType.String},6:{name:"CodecID",type:e.SectionType.String},9122:{name:"CodecPrivate",type:e.SectionType.Binary},362120:{name:"CodecName",type:e.SectionType.String},13382:{name:"AttachmentLink",type:e.SectionType.Uint},1742487:{name:"CodecSettings",type:e.SectionType.String},1785920:{name:"CodecInfoURL",type:e.SectionType.String},438848:{name:"CodecDownloadURL",type:e.SectionType.String},42:{name:"CodecDecodeAll",type:e.SectionType.Uint},12203:{name:"TrackOverlay",type:e.SectionType.Uint},5802:{name:"CodecDelay",type:e.SectionType.Uint},5819:{name:"SeekPreRoll",type:e.SectionType.Uint},9764:{name:"TrackTranslate",type:e.SectionType.Container},9980:{name:"TrackTranslateEditionUID",type:e.SectionType.Uint},9919:{name:"TrackTranslateCodec",type:e.SectionType.Uint},9893:{name:"TrackTranslateTrackID",type:e.SectionType.Binary},96:{name:"Video",type:e.SectionType.Container},26:{name:"FlagInterlaced",type:e.SectionType.Uint},5048:{name:"StereoMode",type:e.SectionType.Uint},5056:{name:"AlphaMode",type:e.SectionType.Uint},5049:{name:"OldStereoMode",type:e.SectionType.Uint},48:{name:"PixelWidth",type:e.SectionType.Uint},58:{name:"PixelHeight",type:e.SectionType.Uint},5290:{name:"PixelCropBottom",type:e.SectionType.Uint},5307:{name:"PixelCropTop",type:e.SectionType.Uint},5324:{name:"PixelCropLeft",type:e.SectionType.Uint},5341:{name:"PixelCropRight",type:e.SectionType.Uint},5296:{name:"DisplayWidth",type:e.SectionType.Uint},5306:{name:"DisplayHeight",type:e.SectionType.Uint},5298:{name:"DisplayUnit",type:e.SectionType.Uint},5299:{name:"AspectRatioType",type:e.SectionType.Uint},963876:{name:"ColourSpace",type:e.SectionType.Binary},1029411:{name:"GammaValue",type:e.SectionType.Float},230371:{name:"FrameRate",type:e.SectionType.Float},97:{name:"Audio",type:e.SectionType.Container},53:{name:"SamplingFrequency",type:e.SectionType.Float},14517:{name:"OutputSamplingFrequency",type:e.SectionType.Float},31:{name:"Channels",type:e.SectionType.Uint},15739:{name:"ChannelPositions",type:e.SectionType.Binary},8804:{name:"BitDepth",type:e.SectionType.Uint},98:{name:"TrackOperation",type:e.SectionType.Container},99:{name:"TrackCombinePlanes",type:e.SectionType.Container},100:{name:"TrackPlane",type:e.SectionType.Container},101:{name:"TrackPlaneUID",type:e.SectionType.Uint},102:{name:"TrackPlaneType",type:e.SectionType.Uint},105:{name:"TrackJoinBlocks",type:e.SectionType.Container},109:{name:"TrackJoinUID",type:e.SectionType.Uint},64:{name:"TrickTrackUID",type:e.SectionType.Uint},65:{name:"TrickTrackSegmentUID",type:e.SectionType.Binary},70:{name:"TrickTrackFlag",type:e.SectionType.Uint},71:{name:"TrickMasterTrackUID",type:e.SectionType.Uint},68:{name:"TrickMasterTrackSegmentUID",type:e.SectionType.Binary},11648:{name:"ContentEncodings",type:e.SectionType.Container},8768:{name:"ContentEncoding",type:e.SectionType.Container},4145:{name:"ContentEncodingOrder",type:e.SectionType.Uint},4146:{name:"ContentEncodingScope",type:e.SectionType.Uint},4147:{name:"ContentEncodingType",type:e.SectionType.Uint},4148:{name:"ContentCompression",type:e.SectionType.Container},596:{name:"ContentCompAlgo",type:e.SectionType.Uint},597:{name:"ContentCompSettings",type:e.SectionType.Binary},4149:{name:"ContentEncryption",type:e.SectionType.Container},2017:{name:"ContentEncAlgo",type:e.SectionType.Uint},2018:{name:"ContentEncKeyID",type:e.SectionType.Binary},2019:{name:"ContentSignature",type:e.SectionType.Binary},2020:{name:"ContentSigKeyID",type:e.SectionType.Binary},2021:{name:"ContentSigAlgo",type:e.SectionType.Uint},2022:{name:"ContentSigHashAlgo",type:e.SectionType.Uint},206814059:{name:"Cues",type:e.SectionType.Container},59:{name:"CuePoint",type:e.SectionType.Container},51:{name:"CueTime",type:e.SectionType.Uint},55:{name:"CueTrackPositions",type:e.SectionType.Container},119:{name:"CueTrack",type:e.SectionType.Uint},113:{name:"CueClusterPosition",type:e.SectionType.Uint},112:{name:"CueRelativePosition",type:e.SectionType.Uint},50:{name:"CueDuration",type:e.SectionType.Uint},4984:{name:"CueBlockNumber",type:e.SectionType.Uint},106:{name:"CueCodecState",type:e.SectionType.Uint},91:{name:"CueReference",type:e.SectionType.Container},22:{name:"CueRefTime",type:e.SectionType.Uint},23:{name:"CueRefCluster",type:e.SectionType.Uint},4959:{name:"CueRefNumber",type:e.SectionType.Uint},107:{name:"CueRefCodecState",type:e.SectionType.Uint},155296873:{name:"Attachments",type:e.SectionType.Container},8615:{name:"AttachedFile",type:e.SectionType.Container},1662:{name:"FileDescription",type:e.SectionType.String},1646:{name:"FileName",type:e.SectionType.String},1632:{name:"FileMimeType",type:e.SectionType.String},1628:{name:"FileData",type:e.SectionType.Binary},1710:{name:"FileUID",type:e.SectionType.Uint},1653:{name:"FileReferral",type:e.SectionType.Binary},1633:{name:"FileUsedStartTime",type:e.SectionType.Uint},1634:{name:"FileUsedEndTime",type:e.SectionType.Uint},4433776:{name:"Chapters",type:e.SectionType.Container},1465:{name:"EditionEntry",type:e.SectionType.Container},1468:{name:"EditionUID",type:e.SectionType.Uint},1469:{name:"EditionFlagHidden",type:e.SectionType.Uint},1499:{name:"EditionFlagDefault",type:e.SectionType.Uint},1501:{name:"EditionFlagOrdered",type:e.SectionType.Uint},54:{name:"ChapterAtom",type:e.SectionType.Container},13252:{name:"ChapterUID",type:e.SectionType.Uint},5716:{name:"ChapterStringUID",type:e.SectionType.String},17:{name:"ChapterTimeStart",type:e.SectionType.Uint},18:{name:"ChapterTimeEnd",type:e.SectionType.Uint},24:{name:"ChapterFlagHidden",type:e.SectionType.Uint},1432:{name:"ChapterFlagEnabled",type:e.SectionType.Uint},11879:{name:"ChapterSegmentUID",type:e.SectionType.Binary},11964:{name:"ChapterSegmentEditionUID",type:e.SectionType.Uint},9155:{name:"ChapterPhysicalEquiv",type:e.SectionType.Uint},15:{name:"ChapterTrack",type:e.SectionType.Container},9:{name:"ChapterTrackNumber",type:e.SectionType.Uint},0:{name:"ChapterDisplay",type:e.SectionType.Container},5:{name:"ChapString",type:e.SectionType.String},892:{name:"ChapLanguage",type:e.SectionType.String},894:{name:"ChapCountry",type:e.SectionType.String},10564:{name:"ChapProcess",type:e.SectionType.Container},10581:{name:"ChapProcessCodecID",type:e.SectionType.Uint},1293:{name:"ChapProcessPrivate",type:e.SectionType.Binary},10513:{name:"ChapProcessCommand",type:e.SectionType.Container},10530:{name:"ChapProcessTime",type:e.SectionType.Uint},10547:{name:"ChapProcessData",type:e.SectionType.Binary},39109479:{name:"Tags",type:e.SectionType.Container},13171:{name:"Tag",type:e.SectionType.Container},9152:{name:"Targets",type:e.SectionType.Container},10442:{name:"TargetTypeValue",type:e.SectionType.Uint},9162:{name:"TargetType",type:e.SectionType.String},9157:{name:"TagTrackUID",type:e.SectionType.Uint},9161:{name:"TagEditionUID",type:e.SectionType.Uint},9156:{name:"TagChapterUID",type:e.SectionType.Uint},9158:{name:"TagAttachmentUID",type:e.SectionType.Uint},10184:{name:"SimpleTag",type:e.SectionType.Container},1443:{name:"TagName",type:e.SectionType.String},1146:{name:"TagLanguage",type:e.SectionType.String},1156:{name:"TagDefault",type:e.SectionType.Uint},1159:{name:"TagString",type:e.SectionType.String},1157:{name:"TagBinary",type:e.SectionType.Binary},5552:{name:"Colour",type:e.SectionType.Container},5553:{name:"MatrixCoefficients",type:e.SectionType.Uint},5554:{name:"BitsPerChannel",type:e.SectionType.Uint},5555:{name:"ChromaSubsamplingHorz",type:e.SectionType.Uint},5556:{name:"ChromaSubsamplingVert",type:e.SectionType.Uint},5557:{name:"CbSubsamplingHorz",type:e.SectionType.Uint},5558:{name:"CbSubsamplingVert",type:e.SectionType.Uint},5559:{name:"ChromaSitingHorz",type:e.SectionType.Uint},5560:{name:"ChromaSitingVert",type:e.SectionType.Uint},5561:{name:"Range",type:e.SectionType.Uint},5562:{name:"TransferCharacteristics",type:e.SectionType.Uint},5563:{name:"Primaries",type:e.SectionType.Uint},5564:{name:"MaxCLL",type:e.SectionType.Uint},5565:{name:"MaxFALL",type:e.SectionType.Uint}},bG}var xG,kG={};function CG(){if(xG)return kG;xG=1,Object.defineProperty(kG,"__esModule",{value:!0}),kG.WebmUint=void 0;const e=gG();function t(e){return e.length%2==1?"0"+e:e}let n=class extends e.WebmBase{constructor(e,t=0){super(e,t)}getType(){return"Uint"}updateBySource(){this.data="";for(let e=0;e<this.source.length;e++){const n=this.source[e].toString(16);this.data+=t(n)}}updateByData(){const e=this.data.length/2;this.source=new Uint8Array(e);for(let t=0;t<e;t++){const e=this.data.substring(2*t,2*t+2);this.source[t]=parseInt(e,16)}}getValue(){return parseInt(this.data,16)}setValue(e){this.setData(t(e.toString(16)))}};return kG.WebmUint=n,kG}var SG,TG={};function DG(){if(SG)return TG;SG=1,Object.defineProperty(TG,"__esModule",{value:!0}),TG.WebmFloat=void 0;const e=gG();let t=class extends e.WebmBase{constructor(e,t=0){super(e,t)}getType(){return"Float"}getFloatArrayType(){return this.source&&4===this.source.length?Float32Array:Float64Array}updateBySource(){const e=this.source.reverse(),t=new(this.getFloatArrayType())(e.buffer);this.data=t[0]}updateByData(){const e=new(this.getFloatArrayType())([this.data]),t=new Uint8Array(e.buffer);this.source=t.reverse()}};return TG.WebmFloat=t,TG}var AG,OG,PG={};function IG(){if(AG)return PG;AG=1,Object.defineProperty(PG,"__esModule",{value:!0}),PG.WebmString=void 0;const e=gG();let t=class extends e.WebmBase{constructor(e,t=0){super(e,t)}getType(){return"String"}updateBySource(){this.data=this.source}updateByData(){this.source=this.data}getValue(){let e="";return this.source.forEach(t=>{e+=String.fromCharCode(t)}),e}};return PG.WebmString=t,PG}function NG(){if(OG)return yG;OG=1,Object.defineProperty(yG,"__esModule",{value:!0}),yG.WebmContainer=void 0;const e=gG(),t=_G(),n=EG(),r=CG(),o=DG(),i=IG();let a=class a extends e.WebmBase{constructor(e,t=!1,n=0){super(e,n),this.isInfinite=t,this.offset=0}getType(){return"Container"}readByte(){return this.source[this.offset++]}readUint(){const e=this.readByte(),t=8-e.toString(2).length;let n=e-(1<<7-t);for(let e=0;e<t;e++)n<<=8,n|=this.readByte();return n}updateBySource(){var s;let l;for(this.data=[],this.offset=0;this.offset<this.source.length;this.offset=l){const u=this.offset,c=this.readUint(),{name:d,type:p}=null!==(s=t.sections[c])&&void 0!==s?s:{},f=this.readUint();l=this.source.length,f>=0&&(l=Math.min(this.offset+f,l));const h=this.source.slice(this.offset,l);let g;switch(p){case n.SectionType.Container:g=new a(d,f<0,u);break;case n.SectionType.Uint:g=new r.WebmUint(d,u);break;case n.SectionType.Float:g=new o.WebmFloat(d,u);break;case n.SectionType.String:g=new i.WebmString(d,u);break;default:g=new e.WebmBase(d,u)}g.setSource(h),this.data.push({id:c,idHex:c.toString(16),data:g})}}writeUint(e,t=!1){let n;for(n=1;(e<0||e>=1<<7*n)&&n<8;n++);if(!t){for(let t=0;t<n;t++)this.source[this.offset+t]=e>>8*(n-1-t)&255;this.source[this.offset]&=(1<<8-n)-1,this.source[this.offset]|=1<<8-n}this.offset+=n}writeSections(e=!1){this.offset=0;for(let t=0;t<this.data.length;t++){const n=this.data[t],r=n.data.source,o=r.length;this.writeUint(n.id,e),this.writeUint(n.data instanceof a&&n.data.isInfinite?-1:o,e),e||this.source.set(r,this.offset),this.offset+=o}return this.offset}updateByData(){const e=this.writeSections(!0);this.source=new Uint8Array(e),this.writeSections()}getSectionById(e){for(let t=0;t<this.data.length;t++){const n=this.data[t];if(n.id===e)return n.data}return null}};return yG.WebmContainer=a,yG}var RG,BG={};var FG,LG,MG={};function UG(){return LG||(LG=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=dG;t.__exportStar(gG(),e),t.__exportStar(NG(),e),t.__exportStar(function(){if(RG)return BG;RG=1,Object.defineProperty(BG,"__esModule",{value:!0}),BG.WebmFile=void 0;const e=dG,t=NG();let n=class n extends t.WebmContainer{constructor(e){super("File"),this.setSource(e)}getType(){return"File"}toBlob(e="video/webm"){return new Blob([this.source.buffer],{type:e})}static blobToArray(e){return new Promise((t,n)=>{try{const r=new FileReader;r.onloadend=()=>{try{t(new Uint8Array(r.result))}catch(e){n(e)}},r.readAsArrayBuffer(e)}catch(e){n(e)}})}static fromBlob(t){return e.__awaiter(this,void 0,void 0,function*(){const e=yield n.blobToArray(t);return new n(e)})}};return BG.WebmFile=n,BG}(),e),t.__exportStar(DG(),e),t.__exportStar(IG(),e),t.__exportStar(CG(),e),t.__exportStar(EG(),e),t.__exportStar((FG||(FG=1,Object.defineProperty(MG,"__esModule",{value:!0})),MG),e),t.__exportStar(_G(),e)}(fG)),fG}var jG,$G,zG={};function HG(){if(jG)return zG;jG=1,Object.defineProperty(zG,"__esModule",{value:!0}),zG.fixParsedWebmDuration=void 0;const e=UG();return zG.fixParsedWebmDuration=(t,n,r={})=>{let o=r.logger;void 0===o?o=e=>console.debug(e):o||(o=()=>{});const i=t.getSectionById(139690087);if(!i)return o("[fix-webm-duration] Segment section is missing"),!1;const a=i.getSectionById(88713574);if(!a)return o("[fix-webm-duration] Info section is missing"),!1;const s=a.getSectionById(710577);if(!s)return o("[fix-webm-duration] TimecodeScale section is missing"),!1;let l=a.getSectionById(1161);if(l){if(!(l.getValue()<=0))return o(`[fix-webm-duration] Duration section is present, and the value is ${l.getValue()}`),!1;o(`[fix-webm-duration] Duration section is present, but the value is ${l.getValue()}`),l.setValue(n)}else o("[fix-webm-duration] Duration section is missing"),l=new e.WebmFloat("Duration"),l.setValue(n),a.data.push({id:1161,data:l});return s.setValue(1e6),a.updateByData(),i.updateByData(),t.updateByData(),!0},zG}!function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=dG;t.__exportStar(function(){if($G)return pG;$G=1,Object.defineProperty(pG,"__esModule",{value:!0}),pG.fixWebmDuration=void 0;const e=dG,t=UG(),n=HG();return pG.fixWebmDuration=(r,o,i)=>e.__awaiter(void 0,void 0,void 0,function*(){try{const e=yield t.WebmFile.fromBlob(r);if((0,n.fixParsedWebmDuration)(e,o,i))return e.toBlob(r.type)}catch(e){}return r}),pG}(),e),t.__exportStar(HG(),e)}(Iq);const VG=ke('<div class="p-2 flex gap-2 border-gray-100 overflow-auto">'),WG=ke('<div class="flex justify-between h-full max-h-[150px] items-center">'),qG=ke("<div>"),GG=e=>{const[t,n]=S(e.defaultValue??""),[r,o]=S([]),[i,a]=S(void 0),[s,l]=S(!1),[u,c]=S("stopped");let d,p,f,h=[];const g=e=>n(e),m=async()=>{if("started"===u()&&f)f.stop();else if(""!==d?.value&&d?.reportValidity()){let n;if(r().length>0){a(void 0);const t=await Eq({apiHost:e.context.apiHost??_t({ignoreChatApiUrl:!0}),files:r().map(t=>({file:t,input:{sessionId:e.context.sessionId,fileName:t.name}})),onUploadProgress:a});n=t?.filter(Ye)}e.onSubmit({type:"text",value:d?.value??t(),attachments:n})}else d?.focus()},v=e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),m())};P(()=>{!Li()&&d&&d.focus({preventScroll:!0})}),oq(e=>{const{data:t}=e;"setInputValue"===t.command&&n(t.value)});const y=e=>{e.preventDefault(),l(!0)},b=()=>l(!1),w=e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer?.files&&E(e.dataTransfer.files)},E=e=>{const t=Array.from(e).map(e=>bq({existingFiles:r(),newFile:e,onError:({description:e,title:t})=>{wq.create({description:e,title:t})}})).filter(Ye);0!==t.length&&o(e=>[...t,...e])},_=()=>{c("asking")},x=t=>{let n;const r=MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":"video/mp4";f=new MediaRecorder(t,{mimeType:r}),f.ondataavailable=e=>{0!==e.data.size&&h.push(e.data)},f.onstart=()=>{n=Date.now()},f.onstop=async()=>{if("started"!==u()||0===h.length)return;const t=Date.now()-n,o=await Iq.fixWebmDuration(new Blob(h,{type:r}),t),i=new File([o],`rec-${e.block.id}-${Date.now()}.${"audio/webm"===r?"webm":"mp4"}`,{type:r});a(void 0);const s=(await Eq({apiHost:e.context.apiHost??_t({ignoreChatApiUrl:!0}),files:[{file:i,input:{sessionId:e.context.sessionId,fileName:i.name}}],onUploadProgress:a})).filter(Ye).map(e=>e.url);e.onSubmit({type:"recording",url:s[0]})},f.start(),c("started")},k=()=>{f?.stop(),c("stopped"),f=void 0,h=[]},C=Boolean(i()),D=te(he,{get children(){return[te(ge,{get when(){return!t()&&"started"!==u()&&e.block.options?.audioClip?.isEnabled},get children(){return te(eq,{"on:click":_,"aria-label":"Record voice",get children(){return te(Pq,{})}})}}),te(ge,{when:!0,get children(){return te(tq,{isDisabled:C,get children(){return e.block.options?.labels?.button}})}})]}});return te(rq,{onSubmit:m,customButton:D,class:"items-end",get isInputDisabled(){return e.isInputDisabled},get hasError(){return e.hasError},get children(){const n=qG();return n.addEventListener("dragleave",b),n.addEventListener("dragover",y),n.addEventListener("drop",w),Pe(n,te(Tq,{get recordingStatus(){return u()},get buttonsTheme(){return e.context.bot.theme.chat?.buttons},onRecordingConfirmed:x,onAbortRecording:k}),null),Pe(n,te(fe,{get when(){return"started"!==u()},get children(){return[te(fe,{get when(){return r().length},get children(){const e=VG();return e.style.setProperty("border-bottom-width","1px"),Pe(e,te(de,{get each(){return r()},children:(e,t)=>te(GW,{file:e,get uploadProgressPercent(){return A(()=>!!i())()?A(()=>i()?.fileIndex===t())()?20:t()<(i()?.fileIndex??0)?100:0:void 0},onRemoveClick:()=>(e=>{o(t=>t.filter((t,n)=>n!==e))})(t())})})),e}}),(()=>{const n=WG();return"function"==typeof p?Oe(p,n):p=n,Pe(n,te(HW,{containerRef:p,ref(e){"function"==typeof d?d(e):d=e},onInput:g,onKeyDown:v,get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??sq.placeholder}}),null),Pe(n,te(fe,{get when(){return(e.block.options?.attachments?.isEnabled??lq.isEnabled)&&e.block.options?.attachments?.saveVariableId},get children(){return te(yq,{onNewFiles:E,class:"ml-2"})}}),null),n})()]}}),null),T(()=>Te(n,tt("flex-col w-full relative",s()&&"filter brightness-95"))),n}})},KG={placeholder:"Type a number..."},YG=ke('<input class="focus:outline-none bg-transparent flex-1 w-full" type="number">'),ZG=e=>{const[t,n]=S(e.defaultValue??""),[r,o,i]=[O(a=()=>t()),function(e){D(function(){const t=a();if(null==t)return void(e.value=t);const n=e.value;(0===t&&""===n||t!=n)&&(e.value=t+"")})},function(e){return e.validity.badInput?a():""!=e.value?e.valueAsNumber:void 0}];var a;let s;const l=()=>{""!==s?.value&&s?.reportValidity()?e.onSubmit({type:"text",value:s?.value??t().toString()}):s?.focus()},u=e=>{"Enter"===e.key&&(e.preventDefault(),l())};return oq(e=>{const{data:t}=e;"setInputValue"===t.command&&n(t.value)}),P(()=>{!Li()&&s&&s.focus({preventScroll:!0})}),te(rq,{onSubmit:l,get buttonLabel(){return e.block.options?.labels?.button},get children(){const t=YG();t.$$keydown=u,t.$$input=e=>{n(i(e.currentTarget))},Oe(o,t,()=>!0);return"function"==typeof s?Oe(s,t):s=t,t.style.setProperty("font-size","16px"),t.style.setProperty("appearance","auto"),t.value=r,T(n=>{const r=e.block.options?.labels?.placeholder??KG.placeholder,o=e.block.options?.min,i=e.block.options?.max,a=e.block.options?.step??"any";return r!==n._v$&&Se(t,"placeholder",n._v$=r),o!==n._v$2&&Se(t,"min",n._v$2=o),i!==n._v$3&&Se(t,"max",n._v$3=i),a!==n._v$4&&Se(t,"step",n._v$4=a),n},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),t}})};Ce(["input","keydown"]);const XG=ke('<input class="focus:outline-none bg-transparent flex-1 w-full" type="text">'),QG=e=>{const[t,n]=se(e,["ref","onInput"]);return(()=>{const r=XG();r.$$input=e=>t.onInput(e.currentTarget.value);const o=e.ref;return"function"==typeof o?Oe(o,r):e.ref=r,r.style.setProperty("font-size","16px"),Ae(r,n,!1,!1),r})()};Ce(["input"]);const JG={placeholder:"Type your email..."},eK=e=>{const[t,n]=S(e.defaultValue??"");let r;const o=e=>n(e),i=()=>{""!==r?.value&&r?.reportValidity()?e.onSubmit({type:"text",value:r?.value??t()}):r?.focus()},a=e=>{"Enter"===e.key&&(e.preventDefault(),i())};return oq(e=>{const{data:t}=e;"setInputValue"===t.command&&n(t.value)}),P(()=>{!Li()&&r&&r.focus({preventScroll:!0})}),te(rq,{onSubmit:i,get buttonLabel(){return e.block.options?.labels?.button},get isInputDisabled(){return e.isInputDisabled},get hasError(){return e.hasError},get children(){return te(QG,{ref(e){"function"==typeof r?r(e):r=e},type:"email",autocomplete:"email",get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??JG.placeholder},onInput:o,onKeyDown:a})}})},tK={placeholder:"Type a URL..."},nK=e=>{const[t,n]=S(e.defaultValue??"");let r;const o=e=>{n(e)},i=()=>{r&&!r?.value.startsWith("http")&&(r.value=`https://${r.value}`),""!==r?.value&&r?.reportValidity()?e.onSubmit({type:"text",value:r?.value??t()}):r?.focus()},a=e=>{"Enter"===e.key&&(e.preventDefault(),i())};return oq(e=>{const{data:t}=e;"setInputValue"===t.command&&n(t.value)}),P(()=>{!Li()&&r&&r.focus({preventScroll:!0})}),te(rq,{onSubmit:i,get buttonLabel(){return e.block.options?.labels?.button},get isInputDisabled(){return e.isInputDisabled},get hasError(){return e.hasError},get children(){return te(QG,{ref(e){"function"==typeof r?r(e):r=e},get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??tK.placeholder},onInput:o,onKeyDown:a,type:"url",autocomplete:"url"})}})},rK=ke('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2px" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9">'),oK=e=>(()=>{const t=rK();return Ae(t,e,!0,!0),t})(),iK=[{name:"International",flag:"🌐",code:"INT",dial_code:null},{name:"Afghanistan",flag:"🇦🇫",code:"AF",dial_code:"+93"},{name:"Åland Islands",flag:"🇦🇽",code:"AX",dial_code:"+358"},{name:"Albania",flag:"🇦🇱",code:"AL",dial_code:"+355"},{name:"Algeria",flag:"🇩🇿",code:"DZ",dial_code:"+213"},{name:"American Samoa",flag:"🇦🇸",code:"AS",dial_code:"+1684"},{name:"Andorra",flag:"🇦🇩",code:"AD",dial_code:"+376"},{name:"Angola",flag:"🇦🇴",code:"AO",dial_code:"+244"},{name:"Anguilla",flag:"🇦🇮",code:"AI",dial_code:"+1264"},{name:"Antarctica",flag:"🇦🇶",code:"AQ",dial_code:"+672"},{name:"Antigua and Barbuda",flag:"🇦🇬",code:"AG",dial_code:"+1268"},{name:"Argentina",flag:"🇦🇷",code:"AR",dial_code:"+54"},{name:"Armenia",flag:"🇦🇲",code:"AM",dial_code:"+374"},{name:"Aruba",flag:"🇦🇼",code:"AW",dial_code:"+297"},{name:"Australia",flag:"🇦🇺",code:"AU",dial_code:"+61"},{name:"Austria",flag:"🇦🇹",code:"AT",dial_code:"+43"},{name:"Azerbaijan",flag:"🇦🇿",code:"AZ",dial_code:"+994"},{name:"Bahamas",flag:"🇧🇸",code:"BS",dial_code:"+1242"},{name:"Bahrain",flag:"🇧🇭",code:"BH",dial_code:"+973"},{name:"Bangladesh",flag:"🇧🇩",code:"BD",dial_code:"+880"},{name:"Barbados",flag:"🇧🇧",code:"BB",dial_code:"+1246"},{name:"Belarus",flag:"🇧🇾",code:"BY",dial_code:"+375"},{name:"Belgium",flag:"🇧🇪",code:"BE",dial_code:"+32"},{name:"Belize",flag:"🇧🇿",code:"BZ",dial_code:"+501"},{name:"Benin",flag:"🇧🇯",code:"BJ",dial_code:"+229"},{name:"Bermuda",flag:"🇧🇲",code:"BM",dial_code:"+1441"},{name:"Bhutan",flag:"🇧🇹",code:"BT",dial_code:"+975"},{name:"Bolivia, Plurinational State of bolivia",flag:"🇧🇴",code:"BO",dial_code:"+591"},{name:"Bosnia and Herzegovina",flag:"🇧🇦",code:"BA",dial_code:"+387"},{name:"Botswana",flag:"🇧🇼",code:"BW",dial_code:"+267"},{name:"Bouvet Island",flag:"🇧🇻",code:"BV",dial_code:"+47"},{name:"Brazil",flag:"🇧🇷",code:"BR",dial_code:"+55"},{name:"British Indian Ocean Territory",flag:"🇮🇴",code:"IO",dial_code:"+246"},{name:"Brunei Darussalam",flag:"🇧🇳",code:"BN",dial_code:"+673"},{name:"Bulgaria",flag:"🇧🇬",code:"BG",dial_code:"+359"},{name:"Burkina Faso",flag:"🇧🇫",code:"BF",dial_code:"+226"},{name:"Burundi",flag:"🇧🇮",code:"BI",dial_code:"+257"},{name:"Cambodia",flag:"🇰🇭",code:"KH",dial_code:"+855"},{name:"Cameroon",flag:"🇨🇲",code:"CM",dial_code:"+237"},{name:"Canada",flag:"🇨🇦",code:"CA",dial_code:"+1"},{name:"Cape Verde",flag:"🇨🇻",code:"CV",dial_code:"+238"},{name:"Cayman Islands",flag:"🇰🇾",code:"KY",dial_code:"+345"},{name:"Central African Republic",flag:"🇨🇫",code:"CF",dial_code:"+236"},{name:"Chad",flag:"🇹🇩",code:"TD",dial_code:"+235"},{name:"Chile",flag:"🇨🇱",code:"CL",dial_code:"+56"},{name:"China",flag:"🇨🇳",code:"CN",dial_code:"+86"},{name:"Christmas Island",flag:"🇨🇽",code:"CX",dial_code:"+61"},{name:"Cocos (Keeling) Islands",flag:"🇨🇨",code:"CC",dial_code:"+61"},{name:"Colombia",flag:"🇨🇴",code:"CO",dial_code:"+57"},{name:"Comoros",flag:"🇰🇲",code:"KM",dial_code:"+269"},{name:"Congo",flag:"🇨🇬",code:"CG",dial_code:"+242"},{name:"Congo, The Democratic Republic of the Congo",flag:"🇨🇩",code:"CD",dial_code:"+243"},{name:"Cook Islands",flag:"🇨🇰",code:"CK",dial_code:"+682"},{name:"Costa Rica",flag:"🇨🇷",code:"CR",dial_code:"+506"},{name:"Cote d'Ivoire",flag:"🇨🇮",code:"CI",dial_code:"+225"},{name:"Croatia",flag:"🇭🇷",code:"HR",dial_code:"+385"},{name:"Cuba",flag:"🇨🇺",code:"CU",dial_code:"+53"},{name:"Cyprus",flag:"🇨🇾",code:"CY",dial_code:"+357"},{name:"Czech Republic",flag:"🇨🇿",code:"CZ",dial_code:"+420"},{name:"Denmark",flag:"🇩🇰",code:"DK",dial_code:"+45"},{name:"Djibouti",flag:"🇩🇯",code:"DJ",dial_code:"+253"},{name:"Dominica",flag:"🇩🇲",code:"DM",dial_code:"+1767"},{name:"Dominican Republic",flag:"🇩🇴",code:"DO",dial_code:"+1849"},{name:"Dominican Republic",flag:"🇩🇴",code:"DO",dial_code:"+1829"},{name:"Dominican Republic",flag:"🇩🇴",code:"DO",dial_code:"+1809"},{name:"Ecuador",flag:"🇪🇨",code:"EC",dial_code:"+593"},{name:"Egypt",flag:"🇪🇬",code:"EG",dial_code:"+20"},{name:"El Salvador",flag:"🇸🇻",code:"SV",dial_code:"+503"},{name:"Equatorial Guinea",flag:"🇬🇶",code:"GQ",dial_code:"+240"},{name:"Eritrea",flag:"🇪🇷",code:"ER",dial_code:"+291"},{name:"Estonia",flag:"🇪🇪",code:"EE",dial_code:"+372"},{name:"Ethiopia",flag:"🇪🇹",code:"ET",dial_code:"+251"},{name:"Falkland Islands (Malvinas)",flag:"🇫🇰",code:"FK",dial_code:"+500"},{name:"Faroe Islands",flag:"🇫🇴",code:"FO",dial_code:"+298"},{name:"Fiji",flag:"🇫🇯",code:"FJ",dial_code:"+679"},{name:"Finland",flag:"🇫🇮",code:"FI",dial_code:"+358"},{name:"France",flag:"🇫🇷",code:"FR",dial_code:"+33"},{name:"French Guiana",flag:"🇬🇫",code:"GF",dial_code:"+594"},{name:"French Polynesia",flag:"🇵🇫",code:"PF",dial_code:"+689"},{name:"French Southern Territories",flag:"🇹🇫",code:"TF",dial_code:"+262"},{name:"Gabon",flag:"🇬🇦",code:"GA",dial_code:"+241"},{name:"Gambia",flag:"🇬🇲",code:"GM",dial_code:"+220"},{name:"Georgia",flag:"🇬🇪",code:"GE",dial_code:"+995"},{name:"Germany",flag:"🇩🇪",code:"DE",dial_code:"+49"},{name:"Ghana",flag:"🇬🇭",code:"GH",dial_code:"+233"},{name:"Gibraltar",flag:"🇬🇮",code:"GI",dial_code:"+350"},{name:"Greece",flag:"🇬🇷",code:"GR",dial_code:"+30"},{name:"Greenland",flag:"🇬🇱",code:"GL",dial_code:"+299"},{name:"Grenada",flag:"🇬🇩",code:"GD",dial_code:"+1473"},{name:"Guadeloupe",flag:"🇬🇵",code:"GP",dial_code:"+590"},{name:"Guam",flag:"🇬🇺",code:"GU",dial_code:"+1671"},{name:"Guatemala",flag:"🇬🇹",code:"GT",dial_code:"+502"},{name:"Guernsey",flag:"🇬🇬",code:"GG",dial_code:"+44"},{name:"Guinea",flag:"🇬🇳",code:"GN",dial_code:"+224"},{name:"Guinea-Bissau",flag:"🇬🇼",code:"GW",dial_code:"+245"},{name:"Guyana",flag:"🇬🇾",code:"GY",dial_code:"+592"},{name:"Haiti",flag:"🇭🇹",code:"HT",dial_code:"+509"},{name:"Heard Island and Mcdonald Islands",flag:"🇭🇲",code:"HM",dial_code:"+672"},{name:"Holy See (Vatican City State)",flag:"🇻🇦",code:"VA",dial_code:"+379"},{name:"Honduras",flag:"🇭🇳",code:"HN",dial_code:"+504"},{name:"Hong Kong",flag:"🇭🇰",code:"HK",dial_code:"+852"},{name:"Hungary",flag:"🇭🇺",code:"HU",dial_code:"+36"},{name:"Iceland",flag:"🇮🇸",code:"IS",dial_code:"+354"},{name:"India",flag:"🇮🇳",code:"IN",dial_code:"+91"},{name:"Indonesia",flag:"🇮🇩",code:"ID",dial_code:"+62"},{name:"Iran, Islamic Republic of Persian Gulf",flag:"🇮🇷",code:"IR",dial_code:"+98"},{name:"Iraq",flag:"🇮🇶",code:"IQ",dial_code:"+964"},{name:"Ireland",flag:"🇮🇪",code:"IE",dial_code:"+353"},{name:"Isle of Man",flag:"🇮🇲",code:"IM",dial_code:"+44"},{name:"Israel",flag:"🇮🇱",code:"IL",dial_code:"+972"},{name:"Italy",flag:"🇮🇹",code:"IT",dial_code:"+39"},{name:"Jamaica",flag:"🇯🇲",code:"JM",dial_code:"+1876"},{name:"Japan",flag:"🇯🇵",code:"JP",dial_code:"+81"},{name:"Jersey",flag:"🇯🇪",code:"JE",dial_code:"+44"},{name:"Jordan",flag:"🇯🇴",code:"JO",dial_code:"+962"},{name:"Kazakhstan",flag:"🇰🇿",code:"KZ",dial_code:"+7"},{name:"Kenya",flag:"🇰🇪",code:"KE",dial_code:"+254"},{name:"Kiribati",flag:"🇰🇮",code:"KI",dial_code:"+686"},{name:"Korea, Democratic People's Republic of Korea",flag:"🇰🇵",code:"KP",dial_code:"+850"},{name:"Korea, Republic of South Korea",flag:"🇰🇷",code:"KR",dial_code:"+82"},{name:"Kosovo",flag:"🇽🇰",code:"XK",dial_code:"+383"},{name:"Kuwait",flag:"🇰🇼",code:"KW",dial_code:"+965"},{name:"Kyrgyzstan",flag:"🇰🇬",code:"KG",dial_code:"+996"},{name:"Laos",flag:"🇱🇦",code:"LA",dial_code:"+856"},{name:"Latvia",flag:"🇱🇻",code:"LV",dial_code:"+371"},{name:"Lebanon",flag:"🇱🇧",code:"LB",dial_code:"+961"},{name:"Lesotho",flag:"🇱🇸",code:"LS",dial_code:"+266"},{name:"Liberia",flag:"🇱🇷",code:"LR",dial_code:"+231"},{name:"Libyan Arab Jamahiriya",flag:"🇱🇾",code:"LY",dial_code:"+218"},{name:"Liechtenstein",flag:"🇱🇮",code:"LI",dial_code:"+423"},{name:"Lithuania",flag:"🇱🇹",code:"LT",dial_code:"+370"},{name:"Luxembourg",flag:"🇱🇺",code:"LU",dial_code:"+352"},{name:"Macao",flag:"🇲🇴",code:"MO",dial_code:"+853"},{name:"Macedonia",flag:"🇲🇰",code:"MK",dial_code:"+389"},{name:"Madagascar",flag:"🇲🇬",code:"MG",dial_code:"+261"},{name:"Malawi",flag:"🇲🇼",code:"MW",dial_code:"+265"},{name:"Malaysia",flag:"🇲🇾",code:"MY",dial_code:"+60"},{name:"Maldives",flag:"🇲🇻",code:"MV",dial_code:"+960"},{name:"Mali",flag:"🇲🇱",code:"ML",dial_code:"+223"},{name:"Malta",flag:"🇲🇹",code:"MT",dial_code:"+356"},{name:"Marshall Islands",flag:"🇲🇭",code:"MH",dial_code:"+692"},{name:"Martinique",flag:"🇲🇶",code:"MQ",dial_code:"+596"},{name:"Mauritania",flag:"🇲🇷",code:"MR",dial_code:"+222"},{name:"Mauritius",flag:"🇲🇺",code:"MU",dial_code:"+230"},{name:"Mayotte",flag:"🇾🇹",code:"YT",dial_code:"+262"},{name:"Mexico",flag:"🇲🇽",code:"MX",dial_code:"+52"},{name:"Micronesia, Federated States of Micronesia",flag:"🇫🇲",code:"FM",dial_code:"+691"},{name:"Moldova",flag:"🇲🇩",code:"MD",dial_code:"+373"},{name:"Monaco",flag:"🇲🇨",code:"MC",dial_code:"+377"},{name:"Mongolia",flag:"🇲🇳",code:"MN",dial_code:"+976"},{name:"Montenegro",flag:"🇲🇪",code:"ME",dial_code:"+382"},{name:"Montserrat",flag:"🇲🇸",code:"MS",dial_code:"+1664"},{name:"Morocco",flag:"🇲🇦",code:"MA",dial_code:"+212"},{name:"Mozambique",flag:"🇲🇿",code:"MZ",dial_code:"+258"},{name:"Myanmar",flag:"🇲🇲",code:"MM",dial_code:"+95"},{name:"Namibia",flag:"🇳🇦",code:"NA",dial_code:"+264"},{name:"Nauru",flag:"🇳🇷",code:"NR",dial_code:"+674"},{name:"Nepal",flag:"🇳🇵",code:"NP",dial_code:"+977"},{name:"Netherlands",flag:"🇳🇱",code:"NL",dial_code:"+31"},{name:"Netherlands Antilles",flag:"",code:"AN",dial_code:"+599"},{name:"New Caledonia",flag:"🇳🇨",code:"NC",dial_code:"+687"},{name:"New Zealand",flag:"🇳🇿",code:"NZ",dial_code:"+64"},{name:"Nicaragua",flag:"🇳🇮",code:"NI",dial_code:"+505"},{name:"Niger",flag:"🇳🇪",code:"NE",dial_code:"+227"},{name:"Nigeria",flag:"🇳🇬",code:"NG",dial_code:"+234"},{name:"Niue",flag:"🇳🇺",code:"NU",dial_code:"+683"},{name:"Norfolk Island",flag:"🇳🇫",code:"NF",dial_code:"+672"},{name:"Northern Mariana Islands",flag:"🇲🇵",code:"MP",dial_code:"+1670"},{name:"Norway",flag:"🇳🇴",code:"NO",dial_code:"+47"},{name:"Oman",flag:"🇴🇲",code:"OM",dial_code:"+968"},{name:"Pakistan",flag:"🇵🇰",code:"PK",dial_code:"+92"},{name:"Palau",flag:"🇵🇼",code:"PW",dial_code:"+680"},{name:"Palestinian Territory, Occupied",flag:"🇵🇸",code:"PS",dial_code:"+970"},{name:"Panama",flag:"🇵🇦",code:"PA",dial_code:"+507"},{name:"Papua New Guinea",flag:"🇵🇬",code:"PG",dial_code:"+675"},{name:"Paraguay",flag:"🇵🇾",code:"PY",dial_code:"+595"},{name:"Peru",flag:"🇵🇪",code:"PE",dial_code:"+51"},{name:"Philippines",flag:"🇵🇭",code:"PH",dial_code:"+63"},{name:"Pitcairn",flag:"🇵🇳",code:"PN",dial_code:"+64"},{name:"Poland",flag:"🇵🇱",code:"PL",dial_code:"+48"},{name:"Portugal",flag:"🇵🇹",code:"PT",dial_code:"+351"},{name:"Puerto Rico",flag:"🇵🇷",code:"PR",dial_code:"+1939"},{name:"Qatar",flag:"🇶🇦",code:"QA",dial_code:"+974"},{name:"Romania",flag:"🇷🇴",code:"RO",dial_code:"+40"},{name:"Russia",flag:"🇷🇺",code:"RU",dial_code:"+7"},{name:"Rwanda",flag:"🇷🇼",code:"RW",dial_code:"+250"},{name:"Reunion",flag:"🇷🇪",code:"RE",dial_code:"+262"},{name:"Saint Barthelemy",flag:"🇧🇱",code:"BL",dial_code:"+590"},{name:"Saint Helena, Ascension and Tristan Da Cunha",flag:"🇸🇭",code:"SH",dial_code:"+290"},{name:"Saint Kitts and Nevis",flag:"🇰🇳",code:"KN",dial_code:"+1869"},{name:"Saint Lucia",flag:"🇱🇨",code:"LC",dial_code:"+1758"},{name:"Saint Martin",flag:"🇲🇫",code:"MF",dial_code:"+590"},{name:"Saint Pierre and Miquelon",flag:"🇵🇲",code:"PM",dial_code:"+508"},{name:"Saint Vincent and the Grenadines",flag:"🇻🇨",code:"VC",dial_code:"+1784"},{name:"Samoa",flag:"🇼🇸",code:"WS",dial_code:"+685"},{name:"San Marino",flag:"🇸🇲",code:"SM",dial_code:"+378"},{name:"Sao Tome and Principe",flag:"🇸🇹",code:"ST",dial_code:"+239"},{name:"Saudi Arabia",flag:"🇸🇦",code:"SA",dial_code:"+966"},{name:"Senegal",flag:"🇸🇳",code:"SN",dial_code:"+221"},{name:"Serbia",flag:"🇷🇸",code:"RS",dial_code:"+381"},{name:"Seychelles",flag:"🇸🇨",code:"SC",dial_code:"+248"},{name:"Sierra Leone",flag:"🇸🇱",code:"SL",dial_code:"+232"},{name:"Singapore",flag:"🇸🇬",code:"SG",dial_code:"+65"},{name:"Slovakia",flag:"🇸🇰",code:"SK",dial_code:"+421"},{name:"Slovenia",flag:"🇸🇮",code:"SI",dial_code:"+386"},{name:"Solomon Islands",flag:"🇸🇧",code:"SB",dial_code:"+677"},{name:"Somalia",flag:"🇸🇴",code:"SO",dial_code:"+252"},{name:"South Africa",flag:"🇿🇦",code:"ZA",dial_code:"+27"},{name:"South Sudan",flag:"🇸🇸",code:"SS",dial_code:"+211"},{name:"South Georgia and the South Sandwich Islands",flag:"🇬🇸",code:"GS",dial_code:"+500"},{name:"Spain",flag:"🇪🇸",code:"ES",dial_code:"+34"},{name:"Sri Lanka",flag:"🇱🇰",code:"LK",dial_code:"+94"},{name:"Sudan",flag:"🇸🇩",code:"SD",dial_code:"+249"},{name:"Suriname",flag:"🇸🇷",code:"SR",dial_code:"+597"},{name:"Svalbard and Jan Mayen",flag:"🇸🇯",code:"SJ",dial_code:"+47"},{name:"Swaziland",flag:"🇸🇿",code:"SZ",dial_code:"+268"},{name:"Sweden",flag:"🇸🇪",code:"SE",dial_code:"+46"},{name:"Switzerland",flag:"🇨🇭",code:"CH",dial_code:"+41"},{name:"Syrian Arab Republic",flag:"🇸🇾",code:"SY",dial_code:"+963"},{name:"Taiwan",flag:"🇹🇼",code:"TW",dial_code:"+886"},{name:"Tajikistan",flag:"🇹🇯",code:"TJ",dial_code:"+992"},{name:"Tanzania, United Republic of Tanzania",flag:"🇹🇿",code:"TZ",dial_code:"+255"},{name:"Thailand",flag:"🇹🇭",code:"TH",dial_code:"+66"},{name:"Timor-Leste",flag:"🇹🇱",code:"TL",dial_code:"+670"},{name:"Togo",flag:"🇹🇬",code:"TG",dial_code:"+228"},{name:"Tokelau",flag:"🇹🇰",code:"TK",dial_code:"+690"},{name:"Tonga",flag:"🇹🇴",code:"TO",dial_code:"+676"},{name:"Trinidad and Tobago",flag:"🇹🇹",code:"TT",dial_code:"+1868"},{name:"Tunisia",flag:"🇹🇳",code:"TN",dial_code:"+216"},{name:"Turkey",flag:"🇹🇷",code:"TR",dial_code:"+90"},{name:"Turkmenistan",flag:"🇹🇲",code:"TM",dial_code:"+993"},{name:"Turks and Caicos Islands",flag:"🇹🇨",code:"TC",dial_code:"+1649"},{name:"Tuvalu",flag:"🇹🇻",code:"TV",dial_code:"+688"},{name:"Uganda",flag:"🇺🇬",code:"UG",dial_code:"+256"},{name:"Ukraine",flag:"🇺🇦",code:"UA",dial_code:"+380"},{name:"United Arab Emirates",flag:"🇦🇪",code:"AE",dial_code:"+971"},{name:"United Kingdom",flag:"🇬🇧",code:"GB",dial_code:"+44"},{name:"United States",flag:"🇺🇸",code:"US",dial_code:"+1"},{name:"Uruguay",flag:"🇺🇾",code:"UY",dial_code:"+598"},{name:"Uzbekistan",flag:"🇺🇿",code:"UZ",dial_code:"+998"},{name:"Vanuatu",flag:"🇻🇺",code:"VU",dial_code:"+678"},{name:"Venezuela, Bolivarian Republic of Venezuela",flag:"🇻🇪",code:"VE",dial_code:"+58"},{name:"Vietnam",flag:"🇻🇳",code:"VN",dial_code:"+84"},{name:"Virgin Islands, British",flag:"🇻🇬",code:"VG",dial_code:"+1284"},{name:"Virgin Islands, U.S.",flag:"🇻🇮",code:"VI",dial_code:"+1340"},{name:"Wallis and Futuna",flag:"🇼🇫",code:"WF",dial_code:"+681"},{name:"Yemen",flag:"🇾🇪",code:"YE",dial_code:"+967"},{name:"Zambia",flag:"🇿🇲",code:"ZM",dial_code:"+260"},{name:"Zimbabwe",flag:"🇿🇼",code:"ZW",dial_code:"+263"}],aK={placeholder:"Type your phone number..."},sK=ke('<div class="input__field--phone relative flex justify-center items-center"><div class="pl-2 pr-1 flex items-center gap-2"><span></span></div><select class="absolute top-0 left-0 w-full h-full cursor-pointer opacity-0">'),lK=ke("<option> "),uK=e=>{const[t,n]=S(Xe(e.defaultCountryCode)?"INT":e.defaultCountryCode),[r,o]=S(e.defaultValue??"");let i;const a=e=>{o(e),""!==e&&"+"!==e||"INT"===t()||n("INT");const r=e?.startsWith("+")&&e.length>2&&iK.reduce((t,n)=>!n?.dial_code||null!==t&&!t.dial_code?t:e?.startsWith(n.dial_code)&&n.dial_code.length>(t?.dial_code.length??0)?n:t,null);r&&n(r.code)},s=()=>{const n=iK.find(e=>e.code===t())?.dial_code;if(""!==i?.value&&i?.reportValidity()){const t=i?.value??r();e.onSubmit({type:"text",value:t.startsWith("+")?t:`${n??""}${t}`})}else i?.focus()},l=e=>{"Enter"===e.key&&(e.preventDefault(),s())},u=e=>{const t=e.currentTarget.value;n(t);const a=iK.find(e=>e.code===t)?.dial_code;""===r()&&a&&o(a),i?.focus()};return oq(e=>{const{data:t}=e;"setInputValue"===t.command&&o(t.value)}),P(()=>{!Li()&&i&&i.focus({preventScroll:!0})}),te(rq,{onSubmit:s,get buttonLabel(){return e.labels?.button},get isInputDisabled(){return e.isInputDisabled},get hasError(){return e.hasError},get children(){return[(()=>{const e=sK(),n=e.firstChild,r=n.firstChild,o=n.nextSibling;return Pe(r,()=>iK.find(e=>t()===e.code)?.flag),Pe(n,te(oK,{class:"w-3"}),null),o.addEventListener("change",u),Pe(o,te(de,{each:iK,children:e=>(()=>{const n=lK(),r=n.firstChild;return Pe(n,()=>e.name,r),Pe(n,()=>e.dial_code?`(${e.dial_code})`:"",null),T(()=>n.selected=e.code===t()),T(()=>n.value=e.code),n})()})),e})(),te(QG,{ref(e){"function"==typeof i?i(e):i=e},type:"tel",get value(){return r()},onInput:a,onKeyDown:l,get placeholder(){return e.labels?.placeholder??aK.placeholder},get autofocus(){return!Li()}})]}})},cK={button:iq,from:"From:",to:"To:"},dK="dd/MM/yyyy",pK="dd/MM/yyyy HH:mm";function fK(e){return fK="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fK(e)}function hK(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function gK(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function mK(e){gK(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===fK(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}var vK={};function yK(){return vK}function bK(e){if(gK(1,arguments),!function(e){return gK(1,arguments),e instanceof Date||"object"===fK(e)&&"[object Date]"===Object.prototype.toString.call(e)}(e)&&"number"!=typeof e)return!1;var t=mK(e);return!isNaN(Number(t))}function wK(e,t){return gK(2,arguments),function(e,t){gK(2,arguments);var n=mK(e).getTime(),r=hK(t);return new Date(n+r)}(e,-hK(t))}function EK(e){gK(1,arguments);var t=mK(e),n=t.getUTCDay(),r=(n<1?7:0)+n-1;return t.setUTCDate(t.getUTCDate()-r),t.setUTCHours(0,0,0,0),t}function _K(e){gK(1,arguments);var t=mK(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=EK(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var a=EK(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function xK(e){gK(1,arguments);var t=mK(e),n=EK(t).getTime()-function(e){gK(1,arguments);var t=_K(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),EK(n)}(t).getTime();return Math.round(n/6048e5)+1}function kK(e,t){var n,r,o,i,a,s,l,u;gK(1,arguments);var c=yK(),d=hK(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(a=t.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==o?o:c.weekStartsOn)&&void 0!==r?r:null===(l=c.locale)||void 0===l||null===(u=l.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=mK(e),f=p.getUTCDay(),h=(f<d?7:0)+f-d;return p.setUTCDate(p.getUTCDate()-h),p.setUTCHours(0,0,0,0),p}function CK(e,t){var n,r,o,i,a,s,l,u;gK(1,arguments);var c=mK(e),d=c.getUTCFullYear(),p=yK(),f=hK(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(a=t.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==o?o:p.firstWeekContainsDate)&&void 0!==r?r:null===(l=p.locale)||void 0===l||null===(u=l.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var h=new Date(0);h.setUTCFullYear(d+1,0,f),h.setUTCHours(0,0,0,0);var g=kK(h,t),m=new Date(0);m.setUTCFullYear(d,0,f),m.setUTCHours(0,0,0,0);var v=kK(m,t);return c.getTime()>=g.getTime()?d+1:c.getTime()>=v.getTime()?d:d-1}function SK(e,t){gK(1,arguments);var n=mK(e),r=kK(n,t).getTime()-function(e,t){var n,r,o,i,a,s,l,u;gK(1,arguments);var c=yK(),d=hK(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(a=t.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==o?o:c.firstWeekContainsDate)&&void 0!==r?r:null===(l=c.locale)||void 0===l||null===(u=l.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==n?n:1),p=CK(e,t),f=new Date(0);return f.setUTCFullYear(p,0,d),f.setUTCHours(0,0,0,0),kK(f,t)}(n,t).getTime();return Math.round(r/6048e5)+1}function TK(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var DK=function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return TK("yy"===t?r%100:r,t.length)},AK=function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):TK(n+1,2)},OK=function(e,t){return TK(e.getUTCDate(),t.length)},PK=function(e,t){return TK(e.getUTCHours()%12||12,t.length)},IK=function(e,t){return TK(e.getUTCHours(),t.length)},NK=function(e,t){return TK(e.getUTCMinutes(),t.length)},RK=function(e,t){return TK(e.getUTCSeconds(),t.length)},BK=function(e,t){var n=t.length,r=e.getUTCMilliseconds();return TK(Math.floor(r*Math.pow(10,n-3)),t.length)},FK="midnight",LK="noon",MK="morning",UK="afternoon",jK="evening",$K="night",zK={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return DK(e,t)},Y:function(e,t,n,r){var o=CK(e,r),i=o>0?o:1-o;return"YY"===t?TK(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):TK(i,t.length)},R:function(e,t){return TK(_K(e),t.length)},u:function(e,t){return TK(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return TK(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return TK(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return AK(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return TK(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=SK(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):TK(o,t.length)},I:function(e,t,n){var r=xK(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):TK(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):OK(e,t)},D:function(e,t,n){var r=function(e){gK(1,arguments);var t=mK(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=n-t.getTime();return Math.floor(r/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):TK(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return TK(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return TK(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return TK(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?LK:0===o?FK:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?jK:o>=12?UK:o>=4?MK:$K,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return PK(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):IK(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):TK(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):TK(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):NK(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):RK(e,t)},S:function(e,t){return BK(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return VK(o);case"XXXX":case"XX":return WK(o);default:return WK(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return VK(o);case"xxxx":case"xx":return WK(o);default:return WK(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+HK(o,":");default:return"GMT"+WK(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+HK(o,":");default:return"GMT"+WK(o,":")}},t:function(e,t,n,r){var o=r._originalDate||e;return TK(Math.floor(o.getTime()/1e3),t.length)},T:function(e,t,n,r){return TK((r._originalDate||e).getTime(),t.length)}};function HK(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(0===i)return n+String(o);var a=t;return n+String(o)+a+TK(i,2)}function VK(e,t){return e%60==0?(e>0?"-":"+")+TK(Math.abs(e)/60,2):WK(e,t)}function WK(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+TK(Math.floor(o/60),2)+n+TK(o%60,2)}var qK=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},GK=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},KK={p:GK,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return qK(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",qK(o,t)).replace("{{time}}",GK(i,t))}},YK=["D","DD"],ZK=["YY","YYYY"];function XK(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var QK={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function JK(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var eY={date:JK({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:JK({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:JK({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},tY={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function nY(e){return function(t,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,i=null!=n&&n.width?String(n.width):o;r=e.formattingValues[i]||e.formattingValues[o]}else{var a=e.defaultWidth,s=null!=n&&n.width?String(n.width):e.defaultWidth;r=e.values[s]||e.values[a]}return r[e.argumentCallback?e.argumentCallback(t):t]}}var rY={ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:nY({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:nY({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:nY({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:nY({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:nY({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function oY(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;var a,s=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return}(l,function(e){return e.test(s)}):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n;return}(l,function(e){return e.test(s)});return a=e.valueCallback?e.valueCallback(u):u,{value:a=n.valueCallback?n.valueCallback(a):a,rest:t.slice(s.length)}}}var iY,aY={ordinalNumber:(iY={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(iY.matchPattern);if(!n)return null;var r=n[0],o=e.match(iY.parsePattern);if(!o)return null;var i=iY.valueCallback?iY.valueCallback(o[0]):o[0];return{value:i=t.valueCallback?t.valueCallback(i):i,rest:e.slice(r.length)}}),era:oY({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:oY({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:oY({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:oY({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:oY({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},sY={code:"en-US",formatDistance:function(e,t,n){var r,o=QK[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:eY,formatRelative:function(e,t,n,r){return tY[e]},localize:rY,match:aY,options:{weekStartsOn:0,firstWeekContainsDate:1}},lY=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,uY=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cY=/^'([^]*?)'?$/,dY=/''/g,pY=/[a-zA-Z]/;function fY(e,t,n){var r,o,i,a,s,l,u,c,d,p,f;gK(2,arguments);var h=String(t),g=yK(),m=null!==(r=g.locale)&&void 0!==r?r:sY,v=hK(null!==(o=null!==(i=null!==(a=void 0)&&void 0!==a?a:g.firstWeekContainsDate)&&void 0!==i?i:null===(s=g.locale)||void 0===s||null===(l=s.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:1);if(!(v>=1&&v<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var y=hK(null!==(u=null!==(c=null!==(d=void 0)&&void 0!==d?d:g.weekStartsOn)&&void 0!==c?c:null===(p=g.locale)||void 0===p||null===(f=p.options)||void 0===f?void 0:f.weekStartsOn)&&void 0!==u?u:0);if(!(y>=0&&y<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!m.localize)throw new RangeError("locale must contain localize property");if(!m.formatLong)throw new RangeError("locale must contain formatLong property");var b=mK(e);if(!bK(b))throw new RangeError("Invalid time value");var w=function(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}(b),E=wK(b,w),_={firstWeekContainsDate:v,weekStartsOn:y,locale:m,_originalDate:b};return h.match(uY).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,KK[t])(e,m.formatLong):e}).join("").match(lY).map(function(n){if("''"===n)return"'";var r=n[0];if("'"===r)return function(e){var t=e.match(cY);if(!t)return e;return t[1].replace(dY,"'")}(n);var o,i=zK[r];if(i)return o=n,-1!==ZK.indexOf(o)&&XK(n,t,String(e)),function(e){return-1!==YK.indexOf(e)}(n)&&XK(n,t,String(e)),i(E,n,m.localize,_);if(r.match(pY))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");return n}).join("")}function hY(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gY(e,t){return gY=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gY(e,t)}function mY(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gY(e,t)}function vY(e){return vY=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vY(e)}function yY(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(yY=function(){return!!e})()}function bY(e){var t=yY();return function(){var n,r=vY(e);if(t){var o=vY(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"==fK(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return hY(e)}(this,n)}}function wY(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function EY(e){var t=function(e,t){if("object"!=fK(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=fK(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==fK(t)?t:t+""}function _Y(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,EY(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function xY(e,t,n){return(t=EY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var kY=function(){function e(){wY(this,e),xY(this,"priority",void 0),xY(this,"subPriority",0)}return _Y(e,[{key:"validate",value:function(e,t){return!0}}]),e}(),CY=function(){mY(t,kY);var e=bY(t);function t(n,r,o,i,a){var s;return wY(this,t),(s=e.call(this)).value=n,s.validateValue=r,s.setValue=o,s.priority=i,a&&(s.subPriority=a),s}return _Y(t,[{key:"validate",value:function(e,t){return this.validateValue(e,this.value,t)}},{key:"set",value:function(e,t,n){return this.setValue(e,t,this.value,n)}}]),t}(),SY=function(){function e(){wY(this,e),xY(this,"incompatibleTokens",void 0),xY(this,"priority",void 0),xY(this,"subPriority",void 0)}return _Y(e,[{key:"run",value:function(e,t,n,r){var o=this.parse(e,t,n,r);return o?{setter:new CY(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}},{key:"validate",value:function(e,t,n){return!0}}]),e}(),TY=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",140),xY(hY(n),"incompatibleTokens",["R","u","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"G":case"GG":case"GGG":return n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"});case"GGGGG":return n.era(e,{width:"narrow"});default:return n.era(e,{width:"wide"})||n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"})}}},{key:"set",value:function(e,t,n){return t.era=n,e.setUTCFullYear(n,0,1),e.setUTCHours(0,0,0,0),e}}]),t}(),DY=/^(1[0-2]|0?\d)/,AY=/^(3[0-1]|[0-2]?\d)/,OY=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,PY=/^(5[0-3]|[0-4]?\d)/,IY=/^(2[0-3]|[0-1]?\d)/,NY=/^(2[0-4]|[0-1]?\d)/,RY=/^(1[0-1]|0?\d)/,BY=/^(1[0-2]|0?\d)/,FY=/^[0-5]?\d/,LY=/^[0-5]?\d/,MY=/^\d/,UY=/^\d{1,2}/,jY=/^\d{1,3}/,$Y=/^\d{1,4}/,zY=/^-?\d+/,HY=/^-?\d/,VY=/^-?\d{1,2}/,WY=/^-?\d{1,3}/,qY=/^-?\d{1,4}/,GY=/^([+-])(\d{2})(\d{2})?|Z/,KY=/^([+-])(\d{2})(\d{2})|Z/,YY=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,ZY=/^([+-])(\d{2}):(\d{2})|Z/,XY=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function QY(e,t){return e?{value:t(e.value),rest:e.rest}:e}function JY(e,t){var n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function eZ(e,t){var n=t.match(e);return n?"Z"===n[0]?{value:0,rest:t.slice(1)}:{value:("+"===n[1]?1:-1)*(36e5*(n[2]?parseInt(n[2],10):0)+6e4*(n[3]?parseInt(n[3],10):0)+1e3*(n[5]?parseInt(n[5],10):0)),rest:t.slice(n[0].length)}:null}function tZ(e){return JY(zY,e)}function nZ(e,t){switch(e){case 1:return JY(MY,t);case 2:return JY(UY,t);case 3:return JY(jY,t);case 4:return JY($Y,t);default:return JY(new RegExp("^\\d{1,"+e+"}"),t)}}function rZ(e,t){switch(e){case 1:return JY(HY,t);case 2:return JY(VY,t);case 3:return JY(WY,t);case 4:return JY(qY,t);default:return JY(new RegExp("^-?\\d{1,"+e+"}"),t)}}function oZ(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function iZ(e,t){var n,r=t>0,o=r?t:1-t;if(o<=50)n=e||100;else{var i=o+50;n=e+100*Math.floor(i/100)-(e>=i%100?100:0)}return r?n:1-n}function aZ(e){return e%400==0||e%4==0&&e%100!=0}var sZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",130),xY(hY(n),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){var r=function(e){return{year:e,isTwoDigitYear:"yy"===t}};switch(t){case"y":return QY(nZ(4,e),r);case"yo":return QY(n.ordinalNumber(e,{unit:"year"}),r);default:return QY(nZ(t.length,e),r)}}},{key:"validate",value:function(e,t){return t.isTwoDigitYear||t.year>0}},{key:"set",value:function(e,t,n){var r=e.getUTCFullYear();if(n.isTwoDigitYear){var o=iZ(n.year,r);return e.setUTCFullYear(o,0,1),e.setUTCHours(0,0,0,0),e}var i="era"in t&&1!==t.era?1-n.year:n.year;return e.setUTCFullYear(i,0,1),e.setUTCHours(0,0,0,0),e}}]),t}(),lZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",130),xY(hY(n),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){var r=function(e){return{year:e,isTwoDigitYear:"YY"===t}};switch(t){case"Y":return QY(nZ(4,e),r);case"Yo":return QY(n.ordinalNumber(e,{unit:"year"}),r);default:return QY(nZ(t.length,e),r)}}},{key:"validate",value:function(e,t){return t.isTwoDigitYear||t.year>0}},{key:"set",value:function(e,t,n,r){var o=CK(e,r);if(n.isTwoDigitYear){var i=iZ(n.year,o);return e.setUTCFullYear(i,0,r.firstWeekContainsDate),e.setUTCHours(0,0,0,0),kK(e,r)}var a="era"in t&&1!==t.era?1-n.year:n.year;return e.setUTCFullYear(a,0,r.firstWeekContainsDate),e.setUTCHours(0,0,0,0),kK(e,r)}}]),t}(),uZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",130),xY(hY(n),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t){return rZ("R"===t?4:t.length,e)}},{key:"set",value:function(e,t,n){var r=new Date(0);return r.setUTCFullYear(n,0,4),r.setUTCHours(0,0,0,0),EK(r)}}]),t}(),cZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",130),xY(hY(n),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t){return rZ("u"===t?4:t.length,e)}},{key:"set",value:function(e,t,n){return e.setUTCFullYear(n,0,1),e.setUTCHours(0,0,0,0),e}}]),t}(),dZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",120),xY(hY(n),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"Q":case"QQ":return nZ(t.length,e);case"Qo":return n.ordinalNumber(e,{unit:"quarter"});case"QQQ":return n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(e,{width:"narrow",context:"formatting"});default:return n.quarter(e,{width:"wide",context:"formatting"})||n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(e,t){return t>=1&&t<=4}},{key:"set",value:function(e,t,n){return e.setUTCMonth(3*(n-1),1),e.setUTCHours(0,0,0,0),e}}]),t}(),pZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",120),xY(hY(n),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"q":case"qq":return nZ(t.length,e);case"qo":return n.ordinalNumber(e,{unit:"quarter"});case"qqq":return n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(e,{width:"narrow",context:"standalone"});default:return n.quarter(e,{width:"wide",context:"standalone"})||n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(e,t){return t>=1&&t<=4}},{key:"set",value:function(e,t,n){return e.setUTCMonth(3*(n-1),1),e.setUTCHours(0,0,0,0),e}}]),t}(),fZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),xY(hY(n),"priority",110),n}return _Y(t,[{key:"parse",value:function(e,t,n){var r=function(e){return e-1};switch(t){case"M":return QY(JY(DY,e),r);case"MM":return QY(nZ(2,e),r);case"Mo":return QY(n.ordinalNumber(e,{unit:"month"}),r);case"MMM":return n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(e,{width:"narrow",context:"formatting"});default:return n.month(e,{width:"wide",context:"formatting"})||n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=11}},{key:"set",value:function(e,t,n){return e.setUTCMonth(n,1),e.setUTCHours(0,0,0,0),e}}]),t}(),hZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",110),xY(hY(n),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){var r=function(e){return e-1};switch(t){case"L":return QY(JY(DY,e),r);case"LL":return QY(nZ(2,e),r);case"Lo":return QY(n.ordinalNumber(e,{unit:"month"}),r);case"LLL":return n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(e,{width:"narrow",context:"standalone"});default:return n.month(e,{width:"wide",context:"standalone"})||n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=11}},{key:"set",value:function(e,t,n){return e.setUTCMonth(n,1),e.setUTCHours(0,0,0,0),e}}]),t}();var gZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",100),xY(hY(n),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"w":return JY(PY,e);case"wo":return n.ordinalNumber(e,{unit:"week"});default:return nZ(t.length,e)}}},{key:"validate",value:function(e,t){return t>=1&&t<=53}},{key:"set",value:function(e,t,n,r){return kK(function(e,t,n){gK(2,arguments);var r=mK(e),o=hK(t),i=SK(r,n)-o;return r.setUTCDate(r.getUTCDate()-7*i),r}(e,n,r),r)}}]),t}();var mZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",100),xY(hY(n),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"I":return JY(PY,e);case"Io":return n.ordinalNumber(e,{unit:"week"});default:return nZ(t.length,e)}}},{key:"validate",value:function(e,t){return t>=1&&t<=53}},{key:"set",value:function(e,t,n){return EK(function(e,t){gK(2,arguments);var n=mK(e),r=hK(t),o=xK(n)-r;return n.setUTCDate(n.getUTCDate()-7*o),n}(e,n))}}]),t}(),vZ=[31,28,31,30,31,30,31,31,30,31,30,31],yZ=[31,29,31,30,31,30,31,31,30,31,30,31],bZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",90),xY(hY(n),"subPriority",1),xY(hY(n),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"d":return JY(AY,e);case"do":return n.ordinalNumber(e,{unit:"date"});default:return nZ(t.length,e)}}},{key:"validate",value:function(e,t){var n=aZ(e.getUTCFullYear()),r=e.getUTCMonth();return n?t>=1&&t<=yZ[r]:t>=1&&t<=vZ[r]}},{key:"set",value:function(e,t,n){return e.setUTCDate(n),e.setUTCHours(0,0,0,0),e}}]),t}(),wZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",90),xY(hY(n),"subpriority",1),xY(hY(n),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"D":case"DD":return JY(OY,e);case"Do":return n.ordinalNumber(e,{unit:"date"});default:return nZ(t.length,e)}}},{key:"validate",value:function(e,t){return aZ(e.getUTCFullYear())?t>=1&&t<=366:t>=1&&t<=365}},{key:"set",value:function(e,t,n){return e.setUTCMonth(0,n),e.setUTCHours(0,0,0,0),e}}]),t}();function EZ(e,t,n){var r,o,i,a,s,l,u,c;gK(2,arguments);var d=yK(),p=hK(null!==(r=null!==(o=null!==(i=null!==(a=null==n?void 0:n.weekStartsOn)&&void 0!==a?a:null==n||null===(s=n.locale)||void 0===s||null===(l=s.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==i?i:d.weekStartsOn)&&void 0!==o?o:null===(u=d.locale)||void 0===u||null===(c=u.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==r?r:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=mK(e),h=hK(t),g=((h%7+7)%7<p?7:0)+h-f.getUTCDay();return f.setUTCDate(f.getUTCDate()+g),f}var _Z=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",90),xY(hY(n),"incompatibleTokens",["D","i","e","c","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"E":case"EE":case"EEE":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=6}},{key:"set",value:function(e,t,n,r){return(e=EZ(e,n,r)).setUTCHours(0,0,0,0),e}}]),t}(),xZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",90),xY(hY(n),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n,r){var o=function(e){var t=7*Math.floor((e-1)/7);return(e+r.weekStartsOn+6)%7+t};switch(t){case"e":case"ee":return QY(nZ(t.length,e),o);case"eo":return QY(n.ordinalNumber(e,{unit:"day"}),o);case"eee":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeeee":return n.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=6}},{key:"set",value:function(e,t,n,r){return(e=EZ(e,n,r)).setUTCHours(0,0,0,0),e}}]),t}(),kZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",90),xY(hY(n),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n,r){var o=function(e){var t=7*Math.floor((e-1)/7);return(e+r.weekStartsOn+6)%7+t};switch(t){case"c":case"cc":return QY(nZ(t.length,e),o);case"co":return QY(n.ordinalNumber(e,{unit:"day"}),o);case"ccc":return n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"ccccc":return n.day(e,{width:"narrow",context:"standalone"});case"cccccc":return n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});default:return n.day(e,{width:"wide",context:"standalone"})||n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=6}},{key:"set",value:function(e,t,n,r){return(e=EZ(e,n,r)).setUTCHours(0,0,0,0),e}}]),t}();var CZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",90),xY(hY(n),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){var r=function(e){return 0===e?7:e};switch(t){case"i":case"ii":return nZ(t.length,e);case"io":return n.ordinalNumber(e,{unit:"day"});case"iii":return QY(n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return QY(n.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return QY(n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r);default:return QY(n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r)}}},{key:"validate",value:function(e,t){return t>=1&&t<=7}},{key:"set",value:function(e,t,n){return e=function(e,t){gK(2,arguments);var n=hK(t);n%7==0&&(n-=7);var r=mK(e),o=((n%7+7)%7<1?7:0)+n-r.getUTCDay();return r.setUTCDate(r.getUTCDate()+o),r}(e,n),e.setUTCHours(0,0,0,0),e}}]),t}(),SZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",80),xY(hY(n),"incompatibleTokens",["b","B","H","k","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(e,t,n){return e.setUTCHours(oZ(n),0,0,0),e}}]),t}(),TZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",80),xY(hY(n),"incompatibleTokens",["a","B","H","k","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"b":case"bb":case"bbb":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(e,t,n){return e.setUTCHours(oZ(n),0,0,0),e}}]),t}(),DZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",80),xY(hY(n),"incompatibleTokens",["a","b","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"B":case"BB":case"BBB":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(e,t,n){return e.setUTCHours(oZ(n),0,0,0),e}}]),t}(),AZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",70),xY(hY(n),"incompatibleTokens",["H","K","k","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"h":return JY(BY,e);case"ho":return n.ordinalNumber(e,{unit:"hour"});default:return nZ(t.length,e)}}},{key:"validate",value:function(e,t){return t>=1&&t<=12}},{key:"set",value:function(e,t,n){var r=e.getUTCHours()>=12;return r&&n<12?e.setUTCHours(n+12,0,0,0):r||12!==n?e.setUTCHours(n,0,0,0):e.setUTCHours(0,0,0,0),e}}]),t}(),OZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",70),xY(hY(n),"incompatibleTokens",["a","b","h","K","k","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"H":return JY(IY,e);case"Ho":return n.ordinalNumber(e,{unit:"hour"});default:return nZ(t.length,e)}}},{key:"validate",value:function(e,t){return t>=0&&t<=23}},{key:"set",value:function(e,t,n){return e.setUTCHours(n,0,0,0),e}}]),t}(),PZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",70),xY(hY(n),"incompatibleTokens",["h","H","k","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"K":return JY(RY,e);case"Ko":return n.ordinalNumber(e,{unit:"hour"});default:return nZ(t.length,e)}}},{key:"validate",value:function(e,t){return t>=0&&t<=11}},{key:"set",value:function(e,t,n){return e.getUTCHours()>=12&&n<12?e.setUTCHours(n+12,0,0,0):e.setUTCHours(n,0,0,0),e}}]),t}(),IZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",70),xY(hY(n),"incompatibleTokens",["a","b","h","H","K","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"k":return JY(NY,e);case"ko":return n.ordinalNumber(e,{unit:"hour"});default:return nZ(t.length,e)}}},{key:"validate",value:function(e,t){return t>=1&&t<=24}},{key:"set",value:function(e,t,n){var r=n<=24?n%24:n;return e.setUTCHours(r,0,0,0),e}}]),t}(),NZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",60),xY(hY(n),"incompatibleTokens",["t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"m":return JY(FY,e);case"mo":return n.ordinalNumber(e,{unit:"minute"});default:return nZ(t.length,e)}}},{key:"validate",value:function(e,t){return t>=0&&t<=59}},{key:"set",value:function(e,t,n){return e.setUTCMinutes(n,0,0),e}}]),t}(),RZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",50),xY(hY(n),"incompatibleTokens",["t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"s":return JY(LY,e);case"so":return n.ordinalNumber(e,{unit:"second"});default:return nZ(t.length,e)}}},{key:"validate",value:function(e,t){return t>=0&&t<=59}},{key:"set",value:function(e,t,n){return e.setUTCSeconds(n,0),e}}]),t}(),BZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",30),xY(hY(n),"incompatibleTokens",["t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t){return QY(nZ(t.length,e),function(e){return Math.floor(e*Math.pow(10,3-t.length))})}},{key:"set",value:function(e,t,n){return e.setUTCMilliseconds(n),e}}]),t}(),FZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",10),xY(hY(n),"incompatibleTokens",["t","T","x"]),n}return _Y(t,[{key:"parse",value:function(e,t){switch(t){case"X":return eZ(GY,e);case"XX":return eZ(KY,e);case"XXXX":return eZ(YY,e);case"XXXXX":return eZ(XY,e);default:return eZ(ZY,e)}}},{key:"set",value:function(e,t,n){return t.timestampIsSet?e:new Date(e.getTime()-n)}}]),t}(),LZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",10),xY(hY(n),"incompatibleTokens",["t","T","X"]),n}return _Y(t,[{key:"parse",value:function(e,t){switch(t){case"x":return eZ(GY,e);case"xx":return eZ(KY,e);case"xxxx":return eZ(YY,e);case"xxxxx":return eZ(XY,e);default:return eZ(ZY,e)}}},{key:"set",value:function(e,t,n){return t.timestampIsSet?e:new Date(e.getTime()-n)}}]),t}(),MZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",40),xY(hY(n),"incompatibleTokens","*"),n}return _Y(t,[{key:"parse",value:function(e){return tZ(e)}},{key:"set",value:function(e,t,n){return[new Date(1e3*n),{timestampIsSet:!0}]}}]),t}(),UZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",20),xY(hY(n),"incompatibleTokens","*"),n}return _Y(t,[{key:"parse",value:function(e){return tZ(e)}},{key:"set",value:function(e,t,n){return[new Date(n),{timestampIsSet:!0}]}}]),t}();new TY,new sZ,new lZ,new uZ,new cZ,new dZ,new pZ,new fZ,new hZ,new gZ,new mZ,new bZ,new wZ,new _Z,new xZ,new kZ,new CZ,new SZ,new TZ,new DZ,new AZ,new OZ,new PZ,new IZ,new NZ,new RZ,new BZ,new FZ,new LZ,new MZ,new UZ;const jZ=ke('<div><div><input class="input__field--date focus:outline-none flex-1 w-full" data-testid="from-date">'),$Z=ke('<p class="font-normal">'),zZ=ke('<div class="flex items-center p-4 h-full"><input class="input__field--date focus:outline-none flex-1 w-full ml-2 h-full" data-testid="to-date">'),HZ=ke('<div class="w-full mt-2 px-3 py-2 text-sm rounded-md">'),VZ=e=>{const[t,n]=S(WZ(e.defaultValue??"")),[r,o]=S(null),i=t=>{if(!t)return"";try{let n;if(e.options?.hasTime)n=new Date(t);else{if(/T|(\s+\d{1,2}:\d{2})/.test(t))n=new Date(t);else{const e=`${t.split(/[T\s]/)[0]}T12:00:00`;n=new Date(e),isNaN(n.getTime())&&(n=new Date(t))}}if(isNaN(n.getTime()))return t;return fY(n,e.options?.format??(e.options?.hasTime?pK:dK))}catch(e){return console.error("Error formatting date:",e),t}},a=t=>{if(t)return e.options?.hasTime?t:t.split(/[T\s]/)[0]},s=(t,n)=>{if(!e.options?.isRange)return o(null),!0;if(!t||!n)return t||n?(o("Please provide both start and end dates for the date range."),!1):(o(null),!0);const r=new Date(t),i=new Date(n);return isNaN(r.getTime())||isNaN(i.getTime())?(o(null),!0):r>i?(o(e.options?.retryMessageContent||"The start date cannot be after the end date. Please select a valid date range."),!1):(o(null),!0)};return te(rq,{onSubmit:()=>{const n=t().from,r=t().to;if(e.options?.isRange){if(!n||!r)return void o("Please provide both start and end dates for the date range.")}else if(!n)return void o("Please select a date.");if(!s(n,r))return;const a=i(t().from),l=t().to?i(t().to):"",u=e.options?.isRange?`${a} to ${l}`:a,c=`${t().from}${e.options?.isRange?` to ${t().to}`:""}`;e.onSubmit({type:"text",value:c,label:u})},get buttonLabel(){return e.options?.labels?.button},get children(){const o=jZ(),i=o.firstChild,l=i.firstChild;return Pe(i,(()=>{const t=A(()=>!!e.options?.isRange);return()=>t()&&(()=>{const t=$Z();return Pe(t,()=>e.options.labels?.from??cK.from),t})()})(),l),l.addEventListener("change",e=>{const r={...t(),from:e.currentTarget.value};n(r),s(r.from,r.to)}),l.style.setProperty("min-height","32px"),l.style.setProperty("min-width","100px"),l.style.setProperty("font-size","16px"),Pe(o,(()=>{const r=A(()=>!!e.options?.isRange);return()=>r()&&(()=>{const r=zZ(),o=r.firstChild;return Pe(r,(()=>{const t=A(()=>!!e.options.isRange);return()=>t()&&(()=>{const t=$Z();return Pe(t,()=>e.options.labels?.to??cK.to),t})()})(),o),o.addEventListener("change",e=>{const r={...t(),to:e.currentTarget.value};n(r),s(r.from,r.to)}),o.style.setProperty("min-height","32px"),o.style.setProperty("min-width","100px"),o.style.setProperty("font-size","16px"),T(n=>{const r=e.options.hasTime?"datetime-local":"date",i=(()=>{const n=a(e.options?.min),r=t().from;return r?n?new Date(r)>new Date(n)?r:n:r:n})(),s=a(e.options?.max);return r!==n._v$6&&Se(o,"type",n._v$6=r),i!==n._v$7&&Se(o,"min",n._v$7=i),s!==n._v$8&&Se(o,"max",n._v$8=s),n},{_v$6:void 0,_v$7:void 0,_v$8:void 0}),T(()=>o.value=t().to),r})()})(),null),Pe(o,(()=>{const e=A(()=>!!r());return()=>e()&&(()=>{const e=HZ();return e.style.setProperty("color","#c53030"),e.style.setProperty("background-color","#fff5f5"),e.style.setProperty("border","1px solid #feb2b2"),Pe(e,r),e})()})(),null),T(n=>{const r=tt("flex flex-col w-full",e.options?.isRange?"items-end":"items-center"),s=tt("flex items-center",e.options?.isRange&&"pb-0 gap-2"),u=e.options?.hasTime?"datetime-local":"date",c=a(e.options?.min),d=(()=>{const n=a(e.options?.max),r=t().to;return r?n?new Date(r)<new Date(n)?r:n:r:n})();return r!==n._v$&&Te(o,n._v$=r),s!==n._v$2&&Te(i,n._v$2=s),u!==n._v$3&&Se(l,"type",n._v$3=u),c!==n._v$4&&Se(l,"min",n._v$4=c),d!==n._v$5&&Se(l,"max",n._v$5=d),n},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0}),T(()=>l.value=t().from),o}})},WZ=e=>{if(!e.includes("to"))return{from:e,to:""};const[t,n]=e.split(" to ");return{from:t,to:n}},qZ="Numbers",GZ=10,KZ={button:iq},YZ=1,ZZ=ke('<form class="flex flex-col gap-3"><div class="flex flex-wrap justify-center gap-2 py-2">'),XZ=ke('<span class="text-sm w-full text-gray-600 dark:text-gray-400">'),QZ=ke('<span class="text-sm w-full text-right pr-2 text-gray-600 dark:text-gray-400">'),JZ=ke('<div class="flex justify-end pt-2">'),eX=ke('<div role="checkbox">'),tX=ke("<div>"),nX=e=>{const[t,n]=S(e.defaultValue?Number(e.defaultValue):void 0),r=n=>{n.preventDefault();const r=t();Ze(r)||e.onSubmit({type:"text",value:r.toString()})},o=t=>{e.block.options?.isOneClickSubmitEnabled&&e.onSubmit({type:"text",value:t.toString()}),n(t)};return(()=>{const n=ZZ(),i=n.firstChild;return n.addEventListener("submit",r),Pe(n,(()=>{const t=A(()=>!!e.block.options?.labels?.left);return()=>t()&&(()=>{const t=XZ();return Pe(t,()=>e.block.options.labels.left),t})()})(),i),Pe(i,te(de,{get each(){return Array.from(Array((e.block.options?.length??GZ)+("Numbers"===(e.block.options?.buttonType??qZ)?-((e.block.options?.startsAt??YZ)-1):0)))},children:(n,r)=>te(rX,ae(()=>e.block.options,{get rating(){return t()},get idx(){return r()+("Numbers"===(e.block.options?.buttonType??qZ)?e.block.options?.startsAt??YZ:1)},onClick:o}))})),Pe(n,(()=>{const t=A(()=>!!e.block.options?.labels?.right);return()=>t()&&(()=>{const t=QZ();return Pe(t,()=>e.block.options.labels.right),t})()})(),null),Pe(n,(()=>{const n=A(()=>!!Ye(t()));return()=>n()&&(()=>{const t=JZ();return Pe(t,te(tq,{get children(){return e.block.options?.labels?.button??KZ.button}})),t})()})(),null),n})()},rX=e=>{const t=t=>{t.preventDefault(),e.onClick(e.idx)};return te(he,{get children(){return[te(ge,{get when(){return"Numbers"===(e.buttonType??qZ)},get children(){return[te(fe,{get when(){return e.isOneClickSubmitEnabled},get children(){return te(eq,{"on:click":t,get children(){return e.idx}})}}),te(fe,{get when(){return!e.isOneClickSubmitEnabled},get children(){const n=eX();return n.addEventListener("click",t),Pe(n,()=>e.idx),T(t=>{const r=Ye(e.rating)&&e.idx<=e.rating,o=tt("button button--selectable flex items-center justify-center font-medium focus:outline-none cursor-pointer select-none",Ye(e.rating)&&e.idx<=e.rating&&" button--selected");return r!==t._v$&&Se(n,"aria-checked",t._v$=r),o!==t._v$2&&Te(n,t._v$2=o),t},{_v$:void 0,_v$2:void 0}),n}})]}}),te(ge,{get when(){return"Numbers"!==(e.buttonType??qZ)},get children(){const t=tX();return t.addEventListener("click",()=>e.onClick(e.idx)),T(n=>{const r="input__field--rating flex justify-center items-center cursor-pointer w-[48px] h-[48px]"+(Ye(e.rating)&&e.idx<=e.rating?" input__field--rating--selected":""),o=e.customIcon?.isEnabled&&!Xe(e.customIcon.svg)?e.customIcon.svg:oX;return r!==n._v$3&&Te(t,n._v$3=r),o!==n._v$4&&(t.innerHTML=n._v$4=o),n},{_v$3:void 0,_v$4:void 0}),t}})]}})},oX='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-star"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg>',iX={isMultipleAllowed:!1,labels:{placeholder:"<strong>\n Click to upload\n </strong> or drag and drop<br>\n (size limit: 10MB)",button:"Upload",clear:"Clear",skip:"Skip",success:{single:"File uploaded",multiple:"{total} files uploaded"}}},aX=ke('<div class="w-full bg-gray-200 rounded-full h-2.5"><div class="h-2.5 rounded-full input__field--upload__progress-bar">'),sX=ke('<div class="p-4 flex gap-2 border-gray-200 border overflow-auto bg-white rounded-md w-full">'),lX=ke('<div class="flex flex-col justify-center items-center gap-4 max-w-[90%]"><p class="text-sm text-gray-500 text-center">'),uX=ke('<input id="dropzone-file" type="file" class="hidden">'),cX=ke('<div class="flex justify-end">'),dX=ke('<div class="flex justify-end"><div class="flex gap-2">'),pX=ke('<form class="flex flex-col w-full gap-2"><label for="dropzone-file">'),fX=ke('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-gray-500"><polyline points="16 16 12 12 8 16"></polyline><line x1="12" y1="12" x2="12" y2="21"></line><path d="M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"></path><polyline points="16 16 12 12 8 16">'),hX=e=>{const[t,n]=S([]),[r,o]=S(!1),[i,a]=S(0),[s,l]=S(!1),u=r=>{const o=Array.from(r).map(e=>bq({existingFiles:t(),newFile:e,onError:({description:e,title:t})=>wq.create({title:t,description:e})})).filter(Ye);if(0!==o.length)return e.block.options?.isMultipleAllowed?void n([...t(),...o]):d(o[0])},c=async e=>{e.preventDefault(),0!==t().length&&p(t())},d=async t=>{o(!0);const n=await Eq({apiHost:e.context.apiHost??_t({ignoreChatApiUrl:!0}),files:[{file:t,input:{sessionId:e.context.sessionId,fileName:t.name}}]});if(o(!1),n.length&&n[0])return e.onSubmit({type:"text",label:e.block.options?.labels?.success?.single??iX.labels.success.single,value:n[0]?mX(n[0].url):"",attachments:[{type:t.type,url:n[0].url}]});wq.create({description:"An error occured while uploading the file"})},p=async t=>{o(!0);const n=await Eq({apiHost:e.context.apiHost??_t({ignoreChatApiUrl:!0}),files:t.map(t=>({file:t,input:{sessionId:e.context.sessionId,fileName:t.name}})),onUploadProgress:a});if(o(!1),a(0),n.length!==t.length)return wq.create({description:"An error occured while uploading the files"});e.onSubmit({type:"text",label:n.length>1?(e.block.options?.labels?.success?.multiple??iX.labels.success.multiple).replaceAll("{total}",n.length.toString()):e.block.options?.labels?.success?.single??iX.labels.success.single,value:n.filter(Ye).map(({url:e})=>mX(e)).join(", "),attachments:n.filter(Ye)})},f=e=>{e.preventDefault(),l(!0)},h=()=>l(!1),g=e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer?.files&&u(e.dataTransfer.files)},m=()=>n([]),v=()=>e.onSkip(e.block.options?.labels?.skip??iX.labels.skip);return(()=>{const o=pX(),a=o.firstChild;return o.addEventListener("submit",c),a.addEventListener("drop",g),a.addEventListener("dragleave",h),a.addEventListener("dragover",f),Pe(a,te(he,{get children(){return[te(ge,{get when(){return r()},get children(){return te(fe,{get when(){return t().length>1},get fallback(){return te(QW,{})},get children(){const e=aX(),t=e.firstChild;return t.style.setProperty("transition","width 150ms cubic-bezier(0.4, 0, 0.2, 1)"),T(()=>null!=`${i()>0?i:10}%`?t.style.setProperty("width",`${i()>0?i:10}%`):t.style.removeProperty("width")),e}})}}),te(ge,{get when(){return!r()},get children(){return[(()=>{const r=lX(),o=r.firstChild;return Pe(r,te(fe,{get when(){return t().length},get fallback(){return te(gX,{})},get children(){const e=sX();return e.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation()}),Pe(e,te(de,{get each(){return t()},children:(e,t)=>te(GW,{file:e,onRemoveClick:()=>(e=>{n(t=>t.filter((t,n)=>n!==e))})(t())})})),e}}),o),T(()=>o.innerHTML=e.block.options?.labels?.placeholder??iX.labels.placeholder),r})(),(()=>{const t=uX();return t.addEventListener("change",e=>{e.currentTarget.files&&u(e.currentTarget.files)}),T(()=>t.multiple=e.block.options?.isMultipleAllowed??iX.isMultipleAllowed),t})()]}})]}})),Pe(o,te(fe,{get when(){return 0===t().length&&!1===e.block.options?.isRequired},get children(){const t=cX();return Pe(t,te(eq,{"on:click":v,get children(){return e.block.options?.labels?.skip??iX.labels.skip}})),t}}),null),Pe(o,te(fe,{get when(){return A(()=>!!(e.block.options?.isMultipleAllowed&&t().length>0))()&&!r()},get children(){const n=dX(),r=n.firstChild;return Pe(r,te(fe,{get when(){return t().length},get children(){return te(eq,{"on:click":m,get children(){return e.block.options?.labels?.clear??iX.labels.clear}})}}),null),Pe(r,te(tq,{get children(){return A(()=>(e.block.options?.labels?.button??iX.labels.button)===iX.labels.button)()?`Upload ${t().length} file${t().length>1?"s":""}`:e.block.options?.labels?.button}}),null),n}}),null),T(()=>Te(a,"input__field--upload py-6 flex flex-col justify-center items-center w-full bg-gray-50 border-2 border-gray-300 border-dashed cursor-pointer hover:bg-gray-100 px-8"+(s()?"input__upload--dragging":""))),o})()},gX=()=>fX(),mX=e=>{const t=e.split("/"),n=t.pop();if(!n)return e;let r=n;try{r=decodeURIComponent(n)}catch{}const o=encodeURIComponent(r);return[...t,o].join("/")},vX=iq,yX="Filter the options...",bX=ke('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3px" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12">'),wX=e=>(()=>{const t=bX();return Ae(t,e,!0,!0),t})(),EX=ke('<button class="w-5 h-5">'),_X=ke('<div class="flex justify-between items-center gap-2 w-full pr-4"><input class="input__field focus:outline-none bg-transparent px-4 py-4 flex-1 w-full" type="text">'),xX=e=>{const[t,n]=S(""),[r,o]=se(e,["onInput","ref"]),i=()=>{n(""),e.onClear()};return(()=>{const a=_X(),s=a.firstChild;s.$$input=e=>(e=>{n(e),r.onInput(e)})(e.currentTarget.value);const l=e.ref;return"function"==typeof l?Oe(l,s):e.ref=s,s.style.setProperty("font-size","16px"),Ae(s,ae({get value(){return t()}},o),!1,!1),Pe(a,te(fe,{get when(){return t().length>0},get children(){const e=EX();return e.addEventListener("click",i),Pe(e,te(ft,{class:"w-4"})),e}}),null),a})()};Ce(["input"]);const kX=ke('<form class="flex flex-col gap-2 w-full items-end">'),CX=ke('<div class="flex flex-col gap-2 w-full items-end">'),SX=ke('<div class="flex items-end w-full">'),TX=ke("<div>"),DX=ke('<img fetchpriority="high" class="m-auto min-w-[200px] w-full max-h-[200px] h-full object-cover rounded-t-[var(--quickbot-button-border-radius)]">'),AX=ke('<span class="font-normal">'),OX=ke('<span class="text-sm whitespace-pre-wrap text-left">'),PX=ke('<div class="flex flex-col gap-1 flex-1">'),IX=ke("<span>"),NX=ke('<span class="flex h-3 w-3 absolute top-0 right-0 -mt-1 -mr-1 ping"><span class="animate-ping absolute inline-flex h-full w-full rounded-full brightness-200 opacity-75"></span><span class="relative inline-flex rounded-full h-3 w-3 brightness-150">'),RX=e=>{let t;const[n,r]=S(e.defaultItems),[o,i]=S([]),[a,s]=S(0);P(()=>{Li(),0});const l=t=>{const r=n()[t];if(r){if(!e.multiple){const t=r.content,n=r.value??r.content??r.id;return r.pictureSrc?e.onSubmit({type:"text",label:Qe(t)?t:r.pictureSrc??r.id,value:r.value??r.id}):e.onSubmit({type:"text",label:t,value:n})}u(r.id)}},u=e=>{const t=o().indexOf(e);i(-1!==t?t=>t.filter(t=>t!==e):t=>[...t,e])},c=t=>{t?.preventDefault(),e.onSubmit({type:"text",value:o().map(t=>{const n=e.defaultItems.find(e=>e.id===t);return n?n.pictureSrc?Qe(n.content)?n.content:n.pictureSrc:n.content:""}).join(", ")})},d=t=>{const n=(t??"").toLowerCase();r(e.defaultItems.filter(e=>{const t=e.content?.toLowerCase()??"";return e.pictureSrc?t.includes(n)||e.description?.toLowerCase().includes(n):t.includes(n)}))};D(()=>{a()===e.defaultItems.filter(e=>Ye(e.pictureSrc)).length&&e.onTransitionEnd()});const p=()=>{s(e=>e+1)},f=e=>o().includes(e),h=()=>{if(!e.multiple)return n();const t=o().filter(e=>!n().some(t=>t.id===e)).map(t=>e.defaultItems.find(e=>e.id===t)).filter(Ye);return[...n(),...t]};return te(he,{get children(){return[te(ge,{get when(){return e.multiple},get children(){const n=kX();return n.addEventListener("submit",c),Pe(n,te(BX,{get options(){return e.options},get multiple(){return e.multiple},inputRef:t,filterItems:d,get defaultItems(){return e.defaultItems},setFilteredItems:r,get itemsToRender(){return h()},isItemSelected:f,handleClick:l,onImageLoad:p,get chunkIndex(){return e.chunkIndex},get selectedItemIds(){return o()}})),n}}),te(ge,{get when(){return!e.multiple},get children(){const n=CX();return Pe(n,te(BX,{get options(){return e.options},get multiple(){return e.multiple},inputRef:t,filterItems:d,get defaultItems(){return e.defaultItems},setFilteredItems:r,get itemsToRender(){return h()},isItemSelected:f,handleClick:l,onImageLoad:p,get chunkIndex(){return e.chunkIndex},get selectedItemIds(){return o()}})),n}})]}})},BX=e=>[te(fe,{get when(){return e.options?.isSearchable},get children(){const t=SX();return Pe(t,te(xX,{ref(t){const n=e.inputRef;"function"==typeof n?n(t):e.inputRef=t},get onInput(){return e.filterItems},get placeholder(){return e.options?.searchInputPlaceholder??yX},onClear:()=>e.setFilteredItems(e.defaultItems)})),t}}),(()=>{const t=TX();return Pe(t,te(de,{get each(){return e.itemsToRender},children:(t,n)=>te(MX,{item:t,get index(){return n()},selected:()=>e.isItemSelected(t.id),onClick:()=>e.handleClick(n()),get onImageLoad(){return e.onImageLoad},get multiple(){return e.multiple},get showPingIndicator(){return 0===e.chunkIndex&&1===e.defaultItems.length}})})),T(()=>Te(t,tt("flex flex-wrap justify-end gap-2",e.options?.isSearchable&&"overflow-y-scroll max-h-80 rounded-md"))),t})(),te(fe,{get when(){return e.multiple&&e.selectedItemIds.length>0},get children(){return te(tq,{get children(){return e.options?.buttonLabel??vX}})}})],FX=e=>(()=>{const t=DX();return De(t,"load",e.onImageLoad),T(n=>{const r=e.item.pictureSrc,o=e.item.content??`Picture ${e.index+1}`,i=`Picture choice ${e.index+1}`;return r!==n._v$&&Se(t,"src",n._v$=r),o!==n._v$2&&Se(t,"alt",n._v$2=o),i!==n._v$3&&Se(t,"elementtiming",n._v$3=i),n},{_v$:void 0,_v$2:void 0,_v$3:void 0}),t})(),LX=e=>(()=>{const t=PX();return Pe(t,te(fe,{get when(){return e.item.content},get children(){const t=AX();return Pe(t,()=>e.item.content),t}}),null),Pe(t,te(fe,{get when(){return e.item.description},get children(){const t=OX();return Pe(t,()=>e.item.description),t}}),null),t})(),MX=e=>te(he,{get children(){return[te(ge,{get when(){return e.item.pictureSrc&&e.multiple},get children(){return te(eq,{type:"button",role:"checkbox",get"aria-checked"(){return e.selected()},get"on:click"(){return e.onClick},get class(){return tt("button--selectable","button--has-image",Je(e.item.pictureSrc)&&"button--has-svg")},get"data-itemid"(){return e.item.id},get children(){return[te(FX,{get item(){return e.item},get index(){return e.index},get onImageLoad(){return e.onImageLoad},get multiple(){return e.multiple}}),(()=>{const t=TX();return Pe(t,te(UX,{get isChecked(){return e.selected()},class:"flex-shrink-0"}),null),Pe(t,te(LX,{get item(){return e.item}}),null),T(()=>Te(t,tt("py-2 px-4 flex items-center gap-2",e.item.description&&"items-start"))),t})()]}})}}),te(ge,{get when(){return e.item.pictureSrc&&!e.multiple},get children(){return te(eq,{get"on:click"(){return e.onClick},get"data-itemid"(){return e.item.id},get class(){return tt("button--selectable","button--has-image",Je(e.item.pictureSrc)&&"button--has-svg")},get children(){return[te(FX,{get item(){return e.item},get index(){return e.index},get onImageLoad(){return e.onImageLoad},get multiple(){return e.multiple}}),(()=>{const t=TX();return Pe(t,te(LX,{get item(){return e.item}})),T(()=>Te(t,tt("py-2 px-4 flex items-center gap-2",e.item.description&&"items-start"))),t})()]}})}}),te(ge,{get when(){return!e.item.pictureSrc&&e.multiple},get children(){const t=IX();return Pe(t,te(eq,{type:"button",role:"checkbox",get"aria-checked"(){return e.selected()},get"on:click"(){return e.onClick},get class(){return tt("button--selectable",e.selected()&&"button--selected")},get"data-itemid"(){return e.item.id},get children(){const t=TX();return Pe(t,te(UX,{get isChecked(){return e.selected()},class:"flex-shrink-0"}),null),Pe(t,te(LX,{get item(){return e.item}}),null),T(()=>Te(t,tt("flex items-center gap-2",e.item.description&&"items-start"))),t}})),T(()=>Te(t,tt("relative",Li()&&"w-full"))),t}}),te(ge,{get when(){return!e.item.pictureSrc&&!e.multiple},get children(){const t=IX();return Pe(t,te(eq,{get"on:click"(){return e.onClick},get class(){return tt("button--selectable",e.selected()&&"button--selected")},get"data-itemid"(){return e.item.id},get children(){const t=TX();return Pe(t,te(LX,{get item(){return e.item}})),T(()=>Te(t,tt("flex items-center gap-2",e.item.description&&"items-start"))),t}}),null),Pe(t,te(fe,{get when(){return e.showPingIndicator},get children(){return NX()}}),null),T(()=>Te(t,tt("relative",Li()&&"w-full"))),t}})]}}),UX=e=>(()=>{const t=TX();return Pe(t,te(wX,{get classList(){return{"w-3":!0,"h-3":!0,"transition-opacity":!0,"duration-200":!0,"opacity-100":e.isChecked,"group-hover:opacity-0":e.isChecked,"opacity-0":!e.isChecked}}}),null),Pe(t,te(ft,{get classList(){return{absolute:!0,"top-1/2":!0,"left-1/2":!0,"-translate-x-1/2":!0,"-translate-y-1/2":!0,"w-3":!0,"h-3":!0,"transition-opacity":!0,"duration-200":!0,"opacity-0":!0,"group-hover:opacity-100":e.isChecked}}}),null),T(()=>Te(t,tt("button__checkbox","w-4 h-4 rounded-full relative flex items-center justify-center",e.isChecked&&"button__checkbox--checked",e.class))),t})(),jX={button:"Pay",success:"Success"},$X=ke('<div class="input__field--error mt-4 text-center animate-fade-in">'),zX=ke('<form id="payment-form" class="flex flex-col p-4 w-full items-center"><slot name="stripe-payment-form">');let HX,VX=null,WX=null;const qX=e=>{const[t,n]=S(),[r,o]=S(!1),[i,a]=S(!1);P(async()=>{if(GX(HX),!e.options?.publicKey)return n("Missing Stripe public key");var t;if(VX=await(t=e.options?.publicKey,new Promise(e=>{if(window.Stripe)return e(window.Stripe(t));const n=document.createElement("script");n.src="https://js.stripe.com/v3",document.body.appendChild(n),n.onload=()=>{if(!window.Stripe)throw new Error("Stripe.js failed to load.");e(window.Stripe(t))}})),!VX)return;WX=VX.elements({appearance:{theme:"stripe",variables:{colorPrimary:getComputedStyle(HX).getPropertyValue("--quickbot-button-bg-color")}},clientSecret:e.options.paymentIntentSecret});WX.create("payment",{layout:"tabs"}).mount("#payment-element"),setTimeout(()=>{o(!0),e.onTransitionEnd()},1e3)});const s=async t=>{if(t.preventDefault(),!VX||!WX)return;var r;a(!0),r={sessionId:e.context.sessionId,resultId:e.context.resultId,bot:e.context.bot},sessionStorage.setItem("botPaymentInProgress",JSON.stringify(r));const{postalCode:o,...i}=e.options?.additionalInformation?.address??{},{error:s,paymentIntent:l}=await VX.confirmPayment({elements:WX,confirmParams:{return_url:window.location.href,payment_method_data:{billing_details:{name:e.options?.additionalInformation?.name,email:e.options?.additionalInformation?.email,phone:e.options?.additionalInformation?.phoneNumber,address:{...i,postal_code:o}}}},redirect:"if_required"});return kt(),a(!1),"validation_error"!==s?.type?"card_error"===s?.type?n(s.message):s||"succeeded"!==l.status?void 0:e.onSuccess():void 0};return(()=>{const n=zX(),o=n.firstChild;n.addEventListener("submit",s);return"function"==typeof HX?Oe(HX,o):HX=o,o._$owner=R(),Pe(n,te(fe,{get when(){return r()},get children(){return te(tq,{get isLoading(){return i()},class:"mt-4 w-full max-w-lg animate-fade-in",get children(){return[A(()=>e.options?.labels?.button??jX.button)," ",A(()=>e.options?.amountLabel)]}})}}),null),Pe(n,te(fe,{get when(){return t()},get children(){const e=$X();return Pe(e,t),e}}),null),n})()},GX=e=>{const t=e.getRootNode().host,n=document.createElement("div");n.style.width="100%",n.slot="stripe-payment-form",t.appendChild(n);const r=document.createElement("div");r.id="payment-element",n.appendChild(r)},KX=e=>te(qX,{get onSuccess(){return e.onSuccess},get options(){return e.options},get context(){return e.context},get onTransitionEnd(){return e.onTransitionEnd}});let YX=function(e){return e.ZAPIER="Zapier",e.MAKE_COM="Make.com",e.PABBLY_CONNECT="Pabbly",e.CHATWOOT="Chatwoot",e.PIXEL="Pixel",e.PAYMENT="stripe",e}({});const ZX=ke("<div>"),XX=ke('<div class="transition-opacity duration-200 px-5 py-3">'),QX=e=>{const{setAnswer:t,isSending:n,getDisplayedMessageIndex:r,chatChunks:o}=Fi(),[i,a]=xn(S(),{key:`bot-${e.context.bot.id}-input-footer-${e.chunkIndex}`,storage:e.context.storage}),s=()=>o()[e.chunkIndex]?.input?.answer,l=()=>{const e=o(),t=!!e.at(-1)?.streamingMessageId||n(),i=e.some((e,t)=>0!==e.messages.length&&r(t)<e.messages.length);return!Ze(s())||t||i},u=async n=>{a(n),t(e.chunkIndex,n),e.onSubmit(n)},c=n=>{const r={type:"text",value:n};a(r),t(e.chunkIndex,r),e.onSkip()},d=()=>(e.hasError?(e=>{if(e)return"text"===e.type?e.value:e.url})(i()):void 0)??(e.isInputPrefillEnabled?e.block.prefilledValue:void 0),p=()=>u({type:"text",value:e.block.options?.labels?.success??jX.success});return D(()=>{if(e.block.type===aq.FILE)return;const n=Jt().findLast(t=>e.chunkIndex===t.inputIndex)?.formattedMessage;if(n){const r=s();if("text"===r?.type&&r.label!==n){if(e.block.type===aq.CHOICE&&r.label)return;a(e=>"text"===e?.type?{...e,label:n}:e),t(e.chunkIndex,{...r,label:n})}}}),(()=>{const t=XX();return Pe(t,te(fe,{get when(){return e.hasHostAvatar},get children(){const e=ZX();return T(()=>Te(e,tt("flex flex-shrink-0 items-center",Li()?"w-6 h-6":"w-10 h-10"))),e}}),null),Pe(t,te(he,{get children(){return[te(ge,{get when(){return e.block.type===aq.TEXT},get children(){return te(GG,{get block(){return e.block},get defaultValue(){return d()},get context(){return e.context},onSubmit:u,isInputDisabled:l,hasError:!1})}}),te(ge,{get when(){return e.block.type===aq.NUMBER},get children(){return te(ZG,{get block(){return e.block},get defaultValue(){return d()},onSubmit:u})}}),te(ge,{get when(){return e.block.type===aq.EMAIL},get children(){return te(eK,{get block(){return e.block},get defaultValue(){return d()},onSubmit:u,isInputDisabled:l,hasError:!1})}}),te(ge,{get when(){return e.block.type===aq.URL},get children(){return te(nK,{get block(){return e.block},get defaultValue(){return d()},onSubmit:u,isInputDisabled:l,hasError:!1})}}),te(ge,{get when(){return e.block.type===aq.PHONE},get children(){return te(uK,{get labels(){return e.block.options?.labels},get defaultCountryCode(){return e.block.options?.defaultCountryCode},get defaultValue(){return d()},onSubmit:u,isInputDisabled:l,hasError:!1})}}),te(ge,{get when(){return A(()=>e.block.type===aq.DATE)()&&!l()},get children(){return te(VZ,{get options(){return e.block.options},get defaultValue(){return d()},onSubmit:u})}}),te(ge,{get when(){return A(()=>e.block.type===aq.RATING)()&&!l()},get children(){return te(nX,{get block(){return e.block},get defaultValue(){return d()},onSubmit:u})}}),te(ge,{get when(){return A(()=>e.block.type===aq.FILE)()&&!l()},get children(){return te(hX,{get context(){return e.context},get block(){return e.block},onSubmit:u,onSkip:c})}}),te(ge,{get when(){return A(()=>e.block.type===YX.PAYMENT)()&&!l()},get children(){return te(KX,{get context(){return e.context},get options(){return{...e.block.options,...e.block.runtimeOptions}},onSuccess:p,get onTransitionEnd(){return e.onTransitionEnd}})}}),te(ge,{get when(){return e.block.type===aq.CHOICE&&!l()&&e.block},keyed:!0,children:t=>te(RX,{get chunkIndex(){return e.chunkIndex},get defaultItems(){return t.items},get options(){return t.options},onSubmit:u,get onTransitionEnd(){return e.onTransitionEnd},get multiple(){return!!t.options?.isMultipleChoice}})})]}}),null),T(()=>Se(t,"data-blockid",e.block.id)),t})()},JX=ke('<div class="conversation-container__footer transition-colors duration-200 border-t border-black/8 empty:hidden">'),eQ=e=>{const{chatChunks:t,theme:n,hasError:r,blockRef:o,currentBlock:i,sendMessage:a,isSending:s,getDisplayedMessageIndex:l}=Fi(),u=()=>a(void 0);return[(()=>{const c=JX();return Pe(c,te(fe,{get when(){return i()?.input},children:i=>te(QX,{get block(){return i()},get chunkIndex(){return t().length-1},get hasHostAvatar(){return n().chat?.hostAvatar?.isEnabled??!1},get guestAvatar(){return n().chat?.guestAvatar},get context(){return e.context},get isInputPrefillEnabled(){return e.initialChatReply.bot.settings.general?.isInputPrefillEnabled??rn.isInputPrefillEnabled},get hasError(){return r()},onSubmit:a,onTransitionEnd:()=>nn(o),onSkip:u})}),null),Pe(c,te(fe,{get when(){const e=i(),n=t(),r=!!n.at(-1)?.streamingMessageId||s(),o=n.some((e,t)=>0!==e.messages.length&&l(t)<e.messages.length);return!e?.input&&!r&&!o},get children(){return te($W,{})}}),null),c})(),te(fe,{get when(){return e.initialChatReply.bot.settings.general?.isBrandingEnabled},get children(){return te(UW,{get botContainer(){return e.botContainer}})}})]},tQ=ke('<div class="conversation-container flex flex-col h-full">'),nQ=e=>te(Bi,ae(e,{get children(){const t=tQ();return Pe(t,te(BW,e),null),Pe(t,te(eQ,e),null),t}})),rQ=ke('<div class="h-full flex justify-center items-center flex-col"><p class="text-2xl text-center"></p><pre>'),oQ=e=>(()=>{const t=rQ(),n=t.firstChild,r=n.nextSibling;return Pe(n,()=>e.error.message),Pe(r,()=>JSON.stringify(e.error.cause,null,2)),t})(),iQ="resultId",aQ=e=>{if(e)try{const t=sessionStorage.getItem(`bot-${e}-initialChatReply`)??localStorage.getItem(`bot-${e}-initialChatReply`);if(!t)return;return JSON.parse(t)}catch{}},sQ=(e,{botId:t,storage:n})=>{try{const r=JSON.stringify(e);dQ(n).setItem(`bot-${t}-initialChatReply`,r)}catch{}},lQ=()=>{try{sessionStorage.setItem("bot-botOpened","true")}catch{}},uQ=()=>{try{sessionStorage.removeItem("bot-botOpened")}catch{}},cQ=()=>{try{return"true"===sessionStorage.getItem("bot-botOpened")}catch{return!1}},dQ=e=>"session"===(e??rn.rememberUser.storage)?sessionStorage:localStorage,pQ=e=>{let t;try{const n=aQ(e);n?.bot?.id&&(t=n.bot.id)}catch{}const n=[`bot-${e}`,`resultId-${e}`];t&&t!==e&&(n.push(`bot-${t}`),n.push(`resultId-${t}`));[localStorage,sessionStorage].forEach(e=>{Object.keys(e).forEach(t=>{n.some(e=>t.startsWith(e))&&e.removeItem(t)})})},fQ={position:"--quickbot-progress-bar-position",color:"--quickbot-progress-bar-color",colorRgb:"--quickbot-progress-bar-bg-rgb",height:"--quickbot-progress-bar-height",top:"--quickbot-progress-bar-top",bottom:"--quickbot-progress-bar-bottom"},hQ={container:{fontFamily:"--quickbot-container-font-family",maxWidth:"--quickbot-chat-container-max-width",maxHeight:"--quickbot-chat-container-max-height",bgColor:"--quickbot-chat-container-bg-rgb",bgImage:"--quickbot-chat-container-bg-image",color:"--quickbot-chat-container-color",borderRadius:"--quickbot-chat-container-border-radius",borderWidth:"--quickbot-chat-container-border-width",borderColor:"--quickbot-chat-container-border-rgb",borderOpacity:"--quickbot-chat-container-border-opacity",opacity:"--quickbot-chat-container-opacity",blur:"--quickbot-chat-container-blur",boxShadow:"--quickbot-chat-container-box-shadow"},hostBubbles:{bgColor:"--quickbot-host-bubble-bg-rgb",color:"--quickbot-host-bubble-color",borderRadius:"--quickbot-host-bubble-border-radius",borderWidth:"--quickbot-host-bubble-border-width",borderColor:"--quickbot-host-bubble-border-rgb",borderOpacity:"--quickbot-host-bubble-border-opacity",opacity:"--quickbot-host-bubble-opacity",blur:"--quickbot-host-bubble-blur",boxShadow:"--quickbot-host-bubble-box-shadow"},guestBubbles:{bgColor:"--quickbot-guest-bubble-bg-rgb",color:"--quickbot-guest-bubble-color",borderRadius:"--quickbot-guest-bubble-border-radius",borderWidth:"--quickbot-guest-bubble-border-width",borderColor:"--quickbot-guest-bubble-border-rgb",borderOpacity:"--quickbot-guest-bubble-border-opacity",opacity:"--quickbot-guest-bubble-opacity",blur:"--quickbot-guest-bubble-blur",boxShadow:"--quickbot-guest-bubble-box-shadow"},inputs:{bgColor:"--quickbot-input-bg-rgb",color:"--quickbot-input-color",placeholderColor:"--quickbot-input-placeholder-color",borderRadius:"--quickbot-input-border-radius",borderWidth:"--quickbot-input-border-width",borderColor:"--quickbot-input-border-rgb",borderOpacity:"--quickbot-input-border-opacity",opacity:"--quickbot-input-opacity",blur:"--quickbot-input-blur",boxShadow:"--quickbot-input-box-shadow"},buttons:{bgRgb:"--quickbot-button-bg-rgb",color:"--quickbot-button-color",borderRadius:"--quickbot-button-border-radius",borderWidth:"--quickbot-button-border-width",borderColor:"--quickbot-button-border-rgb",borderOpacity:"--quickbot-button-border-opacity",opacity:"--quickbot-button-opacity",blur:"--quickbot-button-blur",boxShadow:"--quickbot-button-box-shadow"},checkbox:{bgRgb:"--quickbot-checkbox-bg-rgb",alphaRatio:"--selectable-alpha-ratio"}},gQ=(e,t,n)=>{const r=e?.position??mW;t.setProperty(fQ.position,"fixed"===r?n?"absolute":"fixed":r),t.setProperty(fQ.color,e?.color??"#01a952"),t.setProperty(fQ.colorRgb,xq(e?.backgroundColor??"#dffaeb").join(", ")),t.setProperty(fQ.height,`${e?.thickness??4}px`);const o=e?.placement??"top";t.setProperty(fQ.top,"Top"===o?"0":"auto"),t.setProperty(fQ.bottom,"Bottom"===o?"0":"auto")},mQ=(e,t)=>{vQ(e?.container,t,e?.roundness),yQ(e?.hostBubbles,t,e?.roundness),bQ(e?.guestBubbles,t,e?.roundness),wQ(e?.buttons,t,e?.roundness),EQ(e?.inputs,t,e?.roundness),_Q(e?.container,t)},vQ=(e,t,n)=>{const r=e?.font;t.setProperty(hQ.container.fontFamily,("string"==typeof r?r:r?.family)??gW);const o=e?.background,i=o?.type??hW.COLOR,a=o?.content;let s=e?.backgroundColor??yW;o&&i===hW.COLOR&&a?s=a:o&&i===hW.NONE&&(s="transparent");const l="transparent"===s||Xe(s),u=Cq(s);o&&i===hW.IMAGE&&a?t.setProperty(hQ.container.bgImage,`url(${a})`):t.setProperty(hQ.container.bgImage,"none"),t.setProperty(hQ.container.bgColor,l?"0, 0, 0":u.rgb.join(", ")),t.setProperty(hQ.container.color,_q(e?.color??"#303235").join(", ")),t.setProperty(hQ.container.maxWidth,e?.maxWidth??"800px"),t.setProperty(hQ.container.maxHeight,e?.maxHeight??"100%");const c=l?0:1!==u.alpha?u.alpha:e?.opacity??1;t.setProperty(hQ.container.opacity,l?"0":c.toString()),t.setProperty(hQ.container.blur,1===c||l?"0px":`${e?.blur??0}px`),kQ(e?.shadow,t,hQ.container.boxShadow),xQ(e?.border??{roundeness:n??vW},t,hQ.container.borderRadius),t.setProperty(hQ.container.borderWidth,Ye(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(hQ.container.borderOpacity,Ye(e?.border?.opacity)?e.border.opacity.toString():1..toString()),t.setProperty(hQ.container.borderColor,xq(e?.border?.color??"").join(", "))},yQ=(e,t,n)=>{const r=e?.backgroundColor??"#f5f5f5",o=Cq(r);t.setProperty(hQ.hostBubbles.bgColor,o.rgb.join(", ")),t.setProperty(hQ.hostBubbles.color,e?.color??"#202020"),xQ(e?.border??{roundeness:n??vW},t,hQ.hostBubbles.borderRadius),t.setProperty(hQ.hostBubbles.borderWidth,Ye(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(hQ.hostBubbles.borderColor,xq(e?.border?.color??"").join(", "));const i="transparent"===r?0:1!==o.alpha?o.alpha:e?.opacity??1;t.setProperty(hQ.hostBubbles.opacity,i.toString()),t.setProperty(hQ.hostBubbles.borderOpacity,Ye(e?.border?.opacity)?e.border.opacity.toString():1..toString()),t.setProperty(hQ.hostBubbles.blur,Ye(e?.blur)?`${e.blur??0}px`:"none"),kQ(e?.shadow,t,hQ.hostBubbles.boxShadow)},bQ=(e,t,n)=>{const r=e?.backgroundColor??"#dffaeb",o=Cq(r);t.setProperty(hQ.guestBubbles.bgColor,o.rgb.join(", ")),t.setProperty(hQ.guestBubbles.color,e?.color??"#1c201f"),xQ(e?.border??{roundeness:n??vW},t,hQ.guestBubbles.borderRadius),t.setProperty(hQ.guestBubbles.borderWidth,Ye(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(hQ.guestBubbles.borderColor,xq(e?.border?.color??"").join(", ")),t.setProperty(hQ.guestBubbles.borderOpacity,Ye(e?.border?.opacity)?e.border.opacity.toString():1..toString());const i="transparent"===r?0:1!==o.alpha?o.alpha:e?.opacity??1;t.setProperty(hQ.guestBubbles.opacity,i.toString()),t.setProperty(hQ.guestBubbles.blur,Ye(e?.blur)?`${e.blur??0}px`:"none"),kQ(e?.shadow,t,hQ.guestBubbles.boxShadow)},wQ=(e,t,n)=>{const r=e?.backgroundColor??bW,o=Cq(r);t.setProperty(hQ.buttons.bgRgb,o.rgb.join(", ")),t.setProperty(hQ.buttons.color,e?.color??"#ffffff"),xQ(e?.border??{roundeness:n??vW},t,hQ.buttons.borderRadius),t.setProperty(hQ.buttons.borderWidth,Ye(e?.border?.thickness)?`${e?.border?.thickness}px`:"0px"),t.setProperty(hQ.buttons.borderColor,xq(e?.border?.color??e?.backgroundColor??bW).join(", ")),t.setProperty(hQ.buttons.borderOpacity,Ye(e?.border?.opacity)?e.border.opacity.toString():1..toString());const i="transparent"===r?0:1!==o.alpha?o.alpha:e?.opacity??1;t.setProperty(hQ.buttons.opacity,i.toString()),t.setProperty(hQ.buttons.blur,Ye(e?.blur)?`${e.blur??0}px`:"none"),kQ(e?.shadow,t,hQ.buttons.boxShadow)},EQ=(e,t,n)=>{const r=e?.backgroundColor??"#FFFFFF",o=Cq(r);t.setProperty(hQ.inputs.bgColor,o.rgb.join(", ")),t.setProperty(hQ.inputs.color,e?.color??"#202020"),t.setProperty(hQ.inputs.placeholderColor,e?.placeholderColor??"#9095A0"),xQ(e?.border??{roundeness:n??vW},t,hQ.inputs.borderRadius),t.setProperty(hQ.inputs.borderWidth,Ye(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(hQ.inputs.borderColor,xq(e?.border?.color??"").join(", ")),t.setProperty(hQ.inputs.borderOpacity,Ye(e?.border?.opacity)?e.border.opacity.toString():1..toString());const i="transparent"===r?0:1!==o.alpha?o.alpha:e?.opacity??1;t.setProperty(hQ.inputs.opacity,i.toString()),t.setProperty(hQ.inputs.blur,Ye(e?.blur)?`${e.blur??0}px`:"none"),kQ(e?.shadow??"md",t,hQ.inputs.boxShadow)},_Q=(e,t)=>{const n=e?.backgroundColor??yW;"transparent"===n||Xe(n)||(e?.opacity??1)<=.2?(t.setProperty(hQ.checkbox.bgRgb,"255, 255, 255"),t.setProperty(hQ.checkbox.alphaRatio,"2")):(t.setProperty(hQ.checkbox.bgRgb,xq(n).concat(e?.opacity??1).join(", ")),t.setProperty(hQ.checkbox.alphaRatio,"2"))},xQ=(e,t,n)=>{switch(e?.roundeness??vW){case"none":t.setProperty(n,"0");break;case"medium":t.setProperty(n,"6px");break;case"large":t.setProperty(n,"20px");break;case"custom":t.setProperty(n,`${e.customRoundeness??6}px`)}},kQ=(e,t,n)=>{if(void 0!==e)switch(e){case"none":t.setProperty(n,"0 0 #0000");break;case"sm":t.setProperty(n,"0 1px 2px 0 rgb(0 0 0 / 0.05)");break;case"md":t.setProperty(n,"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)");break;case"lg":t.setProperty(n,"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)");break;case"xl":t.setProperty(n,"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)");break;case"2xl":t.setProperty(n,"0 25px 50px -12px rgb(0 0 0 / 0.25)")}else t.setProperty(n,"0 0 #0000")},CQ="bot-font",SQ=e=>{const t=document.getElementById(CQ);if("string"==typeof e||"Google"===e.type){const n=("string"==typeof e?e:e.family)??gW;if(t?.getAttribute("href")?.includes(n))return;t?.remove();const r=document.createElement("link");return r.href=`https://fonts.bunny.net/css2?family=${n}:ital,wght@0,300;0,400;0,600;1,300;1,400;1,600&display=swap`,r.rel="stylesheet",r.id=CQ,void document.head.appendChild(r)}if("Custom"===e.type){if(Qe(e.css)){if(t?.innerHTML===e.css)return;t?.remove();const n=document.createElement("style");n.innerHTML=e.css,n.id=CQ,document.head.appendChild(n)}if(Qe(e.url)){if(t?.getAttribute("href")===e.url)return;t?.remove();const n=document.createElement("link");n.href=e.url,n.rel="stylesheet",n.id=CQ,document.head.appendChild(n)}}},TQ=ke('<div class="left-0 w-full z-[42424242] progress-bar "><div class="absolute h-full transition-[width] duration-[250ms] ease-in-out progress-bar__fill">'),DQ=e=>(()=>{const t=TQ(),n=t.firstChild;return T(()=>null!=`${e.value}%`?n.style.setProperty("width",`${e.value}%`):n.style.removeProperty("width")),t})(),[,AQ]=S(),OQ=ke("<style>"),PQ=ke('<div class="flex items-center justify-center h-full w-full">'),IQ=ke("<div>"),NQ=e=>{const[t,n]=S(),[r,o]=S(""),[i,a]=S(!1),[s,l]=S(!1),[u,c]=S(),d=async()=>{e.font&&SQ(e.font),a(!0),l(!0);const t=new URLSearchParams(location.search);e.onInit?.();const r={};t.forEach((e,t)=>{r[t]=e});const i="string"==typeof e.bot?e.bot:void 0,s="string"!=typeof e.bot||(e.isPreview??!1),u=(e=>{if(e)try{return sessionStorage.getItem(`${iQ}-${e}`)??localStorage.getItem(`${iQ}-${e}`)??void 0}catch{}})(i),{data:d,error:p}=await async function({bot:e,isPreview:t,apiHost:n,prefilledVariables:r,resultId:o,stripeRedirectStatus:i,startFrom:a,sessionId:s}){if(Ze(e))throw new Error("Bot ID is required to get initial messages");const l=xt()??void 0,u=l?JSON.parse(l):void 0;if(u){kt();try{return{data:{...await Gt.post(Yt({apiHost:n,apiEndpoint:`/api/v1/sessions/${u.sessionId}/continueChat`}),{json:{message:u?"failed"===i?"fail":"Success":void 0},timeout:!1}).json(),...u}}}catch(e){return{error:e}}}const c="string"==typeof e?e:e.id;if(t)try{return{data:await Gt.post(Yt({apiHost:n,apiEndpoint:`/api/v1/bots/${c}/preview/startChat`}),{json:{isStreamEnabled:!0,startFrom:a,bot:e,prefilledVariables:{...r,system_device:Zt(navigator.userAgent),"Device type":Zt(navigator.userAgent)},sessionId:s},timeout:!1}).json()}}catch(e){return{error:e}}try{const e=parent!==window&&Qe(document.referrer)?new URL(document.referrer).origin:void 0,t=await Gt.post(Yt({apiHost:n,apiEndpoint:`/api/v1/bots/${c}/startChat`}),{headers:{"x-quickbot-iframe-referrer-origin":e},json:{isStreamEnabled:!0,prefilledVariables:{...r,system_device:Zt(navigator.userAgent),"Device type":Zt(navigator.userAgent)},resultId:o,isOnlyRegistering:!1},timeout:!1}),i=t.headers.get("access-control-allow-origin");if(e&&i&&"*"!==i&&!e.includes(i))throw new Kt(i);return{data:await t.json()}}catch(e){return{error:e}}}({stripeRedirectStatus:t.get("redirect_status")??void 0,bot:e.bot,apiHost:e.apiHost,isPreview:s,resultId:Qe(e.resultId)?e.resultId:u,prefilledVariables:{...r,...e.prefilledVariables},startFrom:e.startFrom,sessionId:e.sessionId});if(p instanceof Ct)return l(!1),s?c(new Error("An error occurred while loading the bot.",{cause:{status:p.response.status,body:await p.response.json()}})):400===p.response.status||403===p.response.status?c(new Error("This bot is now closed.")):404===p.response.status?c(new Error("The bot you're looking for doesn't exist.")):c(new Error(`Error! Couldn't initiate the chat. (${p.response.statusText})`));if(p instanceof Kt)return l(!1),c(new Error(p.message));if(!d)return l(!1),p&&(console.error(p),s)?c(new Error("Error! Could not reach server. Check your connection.",{cause:p})):c(new Error("Error! Could not reach server. Check your connection."));if(d.resultId&&i&&(d.bot.settings.general?.rememberUser?.isEnabled??rn.rememberUser.isEnabled)){u&&u!==d.resultId&&pQ(i);const t=d.bot.settings.general?.rememberUser?.storage??rn.rememberUser.storage;((e="session")=>(t,n)=>{try{dQ(e).setItem(`${iQ}-${t}`,n)}catch{}})(t)(i,d.resultId);const r=aQ(i);r&&r.bot.publishedAt&&d.bot.publishedAt?new Date(r.bot.publishedAt).getTime()===new Date(d.bot.publishedAt).getTime()?n(d):(pQ(i),n(d),sQ(d,{botId:i,storage:t})):(n(d),sQ(d,{botId:i,storage:t})),e.onChatStatePersisted?.(!0)}else pQ(i||d.bot.id),n(d),d.logs&&e.onNewLogs?.(d.logs),e.onChatStatePersisted?.(!1);o(d.bot.theme.customCss??""),l(!1)};return D(()=>{Ze(e.bot)||i()||d().then()}),D(()=>{Ze(e.bot)||"string"==typeof e.bot||(o(e.bot.theme.customCss??""),e.bot.theme.progressBar?.isEnabled&&t()&&!t()?.bot.theme.progressBar?.isEnabled&&(a(!1),d().then()))}),I(()=>{a(!1)}),[(()=>{const e=OQ();return Pe(e,r),e})(),te(fe,{get when(){return u()},keyed:!0,children:e=>te(oQ,{error:e})}),te(fe,{get when(){return A(()=>!!s())()&&!u()},get children(){const e=PQ();return Pe(e,te(QW,{class:"h-8 w-8 text-blue-500"})),e}}),te(fe,{get when(){return t()},keyed:!0,children:t=>te(RQ,{get class(){return e.class},get initialChatReply(){return{...t,bot:{...t.bot,settings:"string"==typeof e.bot?t.bot?.settings:e.bot?.settings,theme:"string"==typeof e.bot?t.bot?.theme:e.bot?.theme}}},get context(){return{apiHost:e.apiHost,isPreview:"string"!=typeof e.bot||(e.isPreview??!1),resultId:t.resultId,sessionId:t.sessionId,bot:t.bot,storage:t.bot.settings.general?.rememberUser?.isEnabled&&"string"==typeof e.bot&&!e.isPreview?t.bot.settings.general?.rememberUser?.storage??rn.rememberUser.storage:void 0}},get progressBarRef(){return e.progressBarRef},get onNewBlock(){return e.onNewBlock},get onNewLogs(){return e.onNewLogs},get onAnswer(){return e.onAnswer},get onEnd(){return e.onEnd},get onBubblesDisplayed(){return e.onBubblesDisplayed}})})]},RQ=e=>{const[t,n]=xn(S(e.initialChatReply.progress),{storage:e.context.storage,key:`bot-${e.context.bot.id}-progressValue`}),[r,o]=S(!1);let i;const a=new ResizeObserver(e=>Mi(e[0].target.clientWidth<400));return P(()=>{i&&(AQ(i),a.observe(i),Gi(`${i.clientHeight}px`),((e,t,n)=>{if(!e)return;const r=t?.style;r&&(gQ(e.progressBar,r,n),mQ(e.chat,r))})(e.initialChatReply.bot.theme,i,e.context.isPreview),o(!0))}),D(()=>{SQ(e.initialChatReply.bot.theme.chat?.container?.font??{type:"Google",family:gW})}),I(()=>{i&&a.unobserve(i)}),(()=>{const o=IQ();return"function"==typeof i?Oe(i,o):i=o,Pe(o,te(fe,{get when(){return Ye(t())&&e.initialChatReply.bot.theme.progressBar?.isEnabled},get children(){return te(fe,{get when(){return e.progressBarRef&&"fixed"===(e.initialChatReply.bot.theme.progressBar?.position??mW)},get fallback(){return te(DQ,{get value(){return t()}})},get children(){return te(je,{get mount(){return e.progressBarRef},get children(){return te(DQ,{get value(){return t()}})}})}})}}),null),Pe(o,te(fe,{get when(){return r()},get children(){return te(nQ,{botContainer:i,get context(){return e.context},get initialChatReply(){return e.initialChatReply},get onNewBlock(){return e.onNewBlock},get onAnswer(){return e.onAnswer},get onEnd(){return e.onEnd},get onNewLogs(){return e.onNewLogs},onProgressUpdate:n,get onBubblesDisplayed(){return e.onBubblesDisplayed}})}}),null),Pe(o,te(KV,{toaster:wq,children:e=>te(ZV.Root,{get children(){return[te(ZV.Title,{get children(){return e().title}}),te(ZV.Description,{get children(){return e().description}}),te(ZV.CloseTrigger,{class:"absolute right-2 top-2",get children(){return te(ft,{class:"w-4"})}})]}})}),null),T(()=>Te(o,tt("h-full w-full flex flex-col quickbot",e.class))),o})()},BQ=ke("<style>"),FQ=ke("<div>"),LQ=ke('<div part="bot">'),MQ=e=>{const[t,n]=se(e,["onOpen","onClose","previewMessage","onPreviewMessageClick","theme","autoShowDelay"]),[r,o]=S(!0),[i,a]=S(n.prefilledVariables),[s,l]=S(!1),[u,c]=S({message:t.previewMessage?.message??"",avatarUrl:t.previewMessage?.avatarUrl}),[d,p]=S(!1),[f,h]=S(!1),[g,m]=S(UQ(t.theme?.button?.size??"medium"));let v;D(()=>{m(UQ(t.theme?.button?.size??"medium"))}),oq(e=>{const{data:t}=e;"open"===t.command&&y(),"close"===t.command&&b(),"toggle"===t.command&&w(),"showPreviewMessage"===t.command&&_(t.message),"hidePreviewMessage"===t.command&&x(),"setPrefilledVariables"===t.command&&a(e=>({...e,...t.variables})),"unmount"===t.command&&k()}),P(()=>{const e=t.autoShowDelay,n=t.previewMessage?.autoShowDelay;(cQ()||xt())&&y(),Ye(e)&&setTimeout(()=>{y()},e),Ye(n)&&setTimeout(()=>{_()},n)}),D(()=>{e.prefilledVariables&&a(t=>({...t,...e.prefilledVariables}))});const y=()=>{f()||h(!0),x(),p(!0),d()&&t.onOpen?.()},b=()=>{p(!1),uQ(),d()&&t.onClose?.()},w=()=>{d()?b():y()},E=()=>{t.onPreviewMessageClick?.(),y()},_=e=>{e&&c(e),d()||l(!0)},x=()=>{l(!1)},k=()=>{d()?(b(),setTimeout(()=>{o(!1)},200)):o(!1)},C=e=>{n.onChatStatePersisted?.(e),e&&lQ()};return te(fe,{get when(){return r()},get children(){return te(dV,{get value(){return document.querySelector("bot-bubble")?.shadowRoot},get children(){return[(()=>{const e=BQ();return Pe(e,Ge),e})(),te(fe,{get when(){return s()},get children(){return te(bt,ae(u,{get placement(){return t.theme?.placement},get previewMessageTheme(){return t.theme?.previewMessage},get buttonSize(){return g()},onClick:E,onCloseClick:x}))}}),te(dt,ae(()=>t.theme?.button,{get placement(){return t.theme?.placement},toggleBot:w,get isBotOpened(){return d()},get buttonSize(){return g()}})),(()=>{const e=FQ();return"function"==typeof v?Oe(v,e):v=e,e})(),(()=>{const r=LQ();return r.style.setProperty("transition","transform 200ms cubic-bezier(0, 1.2, 1, 1), opacity 150ms ease-out"),r.style.setProperty("box-shadow","rgb(0 0 0 / 16%) 0px 5px 40px"),r.style.setProperty("z-index","42424242"),Pe(r,te(fe,{get when(){return f()},get children(){return te(NQ,ae(n,{onChatStatePersisted:C,get prefilledVariables(){return i()},class:"rounded-lg",progressBarRef:v}))}})),T(n=>{const o=`calc(100% - ${g()} - 32px)`,i=e.theme?.chatWindow?.maxHeight??"704px",a=e.theme?.chatWindow?.maxWidth??"400px",s="left"===e.theme?.placement?"bottom left":"bottom right",l=d()?"scale3d(1, 1, 1)":"scale3d(0, 0, 1)",u=t.theme?.chatWindow?.backgroundColor,c=`calc(${g()} + 32px)`,p="fixed rounded-lg w-full"+(d()?" opacity-1":" opacity-0 pointer-events-none")+("left"===e.theme?.placement?" left-5":" sm:right-5 right-0");return o!==n._v$&&(null!=(n._v$=o)?r.style.setProperty("height",o):r.style.removeProperty("height")),i!==n._v$2&&(null!=(n._v$2=i)?r.style.setProperty("max-height",i):r.style.removeProperty("max-height")),a!==n._v$3&&(null!=(n._v$3=a)?r.style.setProperty("max-width",a):r.style.removeProperty("max-width")),s!==n._v$4&&(null!=(n._v$4=s)?r.style.setProperty("transform-origin",s):r.style.removeProperty("transform-origin")),l!==n._v$5&&(null!=(n._v$5=l)?r.style.setProperty("transform",l):r.style.removeProperty("transform")),u!==n._v$6&&(null!=(n._v$6=u)?r.style.setProperty("background-color",u):r.style.removeProperty("background-color")),c!==n._v$7&&(null!=(n._v$7=c)?r.style.setProperty("bottom",c):r.style.removeProperty("bottom")),p!==n._v$8&&Te(r,n._v$8=p),n},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0,_v$6:void 0,_v$7:void 0,_v$8:void 0}),r})()]}})}})},UQ=e=>"medium"===e?"48px":"large"===e?"64px":e||"48px",jQ=ke("<style>"),$Q=ke('<div class="relative" aria-labelledby="modal-title" role="dialog" aria-modal="true"><style></style><div class="fixed inset-0 bg-black bg-opacity-50 transition-opacity animate-fade-in" part="overlay"></div><div class="fixed inset-0 z-10 overflow-y-auto"><div class="flex min-h-full items-center justify-center p-4 text-center sm:p-0"><div>'),zQ=e=>{const[t,n]=se(e,["onOpen","onClose","autoShowDelay","theme","isOpen","defaultOpen"]),[r,o]=S(n.prefilledVariables),[i,a]=S(t.isOpen??!1);oq(e=>{const{data:t}=e;"open"===t.command&&l(),"close"===t.command&&u(),"toggle"===t.command&&c(),"setPrefilledVariables"===t.command&&o(e=>({...e,...t.variables}))}),P(()=>{(t.defaultOpen||xt()||cQ())&&l();const e=t.autoShowDelay;Ye(e)&&setTimeout(()=>{l()},e)}),D(()=>{Ze(e.isOpen)||e.isOpen===i()||c()}),D(()=>{e.prefilledVariables&&o(t=>({...t,...e.prefilledVariables}))});const s=e=>{e.stopPropagation()},l=()=>{a(!0),t.onOpen?.(),document.body.style.setProperty("overflow","hidden","important"),document.addEventListener("pointerdown",u)},u=()=>{a(!1),t.onClose?.(),document.body.style.overflow="auto",document.removeEventListener("pointerdown",u),uQ()},c=()=>i()?u():l(),d=e=>{n.onChatStatePersisted?.(e),e&&lQ()};return te(fe,{get when(){return i()},get children(){return te(dV,{get value(){return document.querySelector("quickbot-popup")?.shadowRoot},get children(){return[(()=>{const e=jQ();return Pe(e,Ge),e})(),(()=>{const t=$Q(),o=t.firstChild,i=o.nextSibling.nextSibling.firstChild.firstChild;return Pe(o,Ge),i.addEventListener("pointerdown",s),Pe(i,te(NQ,ae(n,{get prefilledVariables(){return r()},onChatStatePersisted:d}))),T(n=>{const r=e.theme?.zIndex??42424242,o="relative h-[80vh] transform overflow-hidden rounded-lg text-left transition-all sm:my-8 w-full max-w-lg"+(e.theme?.backgroundColor?" shadow-xl":""),a=e.theme?.backgroundColor??"transparent",s=e.theme?.width??"512px";return r!==n._v$&&(null!=(n._v$=r)?t.style.setProperty("z-index",r):t.style.removeProperty("z-index")),o!==n._v$2&&Te(i,n._v$2=o),a!==n._v$3&&(null!=(n._v$3=a)?i.style.setProperty("background-color",a):i.style.removeProperty("background-color")),s!==n._v$4&&(null!=(n._v$4=s)?i.style.setProperty("max-width",s):i.style.removeProperty("max-width")),n},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),t})()]}})}})},HQ=ke("<style>\n:host {\n display: block;\n width: 100%;\n height: 100%;\n overflow-y: hidden;\n}\n"),VQ=(e,{element:t})=>{const[n,r]=S(!1),o=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&r(!0)});return oq(()=>{}),P(()=>{o.observe(t)}),I(()=>{o.disconnect()}),te(dV,{get value(){return document.querySelector("quickbot-standard")?.shadowRoot},get children(){return[(()=>{const e=HQ(),t=e.firstChild;return Pe(e,Ge,t),e})(),te(fe,{get when(){return n()},get children(){return te(NQ,e)}})]}})},WQ=()=>{window.postMessage({isFromBot:!0,command:"close"})},qQ=()=>{window.postMessage({isFromBot:!0,command:"hidePreviewMessage"})},GQ=()=>{window.postMessage({isFromBot:!0,command:"open"})},KQ=e=>{const t={isFromBot:!0,command:"setPrefilledVariables",variables:e};window.postMessage(t)},YQ=e=>{const t={isFromBot:!0,command:"showPreviewMessage",message:e};window.postMessage(t)},ZQ=()=>{window.postMessage({isFromBot:!0,command:"toggle"})},XQ=e=>{const t={isFromBot:!0,command:"setInputValue",value:e};window.postMessage(t)},QQ=()=>{window.postMessage({isFromBot:!0,command:"unmount"})},JQ=e=>{const t=e.id?document.getElementById(e.id):document.querySelector("quickbot-standard");if(!t)throw new Error("<quickbot-standard> element not found.");Object.assign(t,e)},eJ=e=>{const t=document.createElement("quickbot-popup");Object.assign(t,e),document.body.prepend(t)},tJ=e=>{const t=document.createElement("bot-bubble");Object.assign(t,e),document.body.prepend(t)};"undefined"!=typeof window&&(He("quickbot-standard",Ve,VQ),He("bot-bubble",qe,MQ),He("quickbot-popup",We,zQ));(e=>{"undefined"!=typeof window&&(window.Bot={...e})})({initStandard:JQ,initPopup:eJ,initBubble:tJ,close:WQ,hidePreviewMessage:qQ,open:GQ,setPrefilledVariables:KQ,showPreviewMessage:YQ,toggle:ZQ,setInputValue:XQ,unmount:QQ});
|
|
37
|
+
function z$(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function H$(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z$(Object(n),!0).forEach(function(t){V$(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z$(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function V$(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}U$()(["closeOnSelect","dir","disabled","fixedWeeks","focusedValue","format","getRootNode","id","ids","isDateUnavailable","isDateUnavailable","locale","max","min","modal","name","numOfMonths","onFocusChange","onOpenChange","onValueChange","onViewChange","open","open.controlled","positioning","readOnly","selectionMode","startOfWeek","timeZone","translations","value","view"]),U$()(["index"]),U$()(["value"]),U$()(["columns","id","view"]),U$()(["disabled","value","columns"]),U$()(["view"]),j$.extendWith("view");var W$=function(e,t){if(e.length>0){var n=e[e.length-1];n!==t&&n.pause()}var r=e.indexOf(t);-1===r||e.splice(r,1),e.push(t)},q$=function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()},G$=function(e){return"Tab"===(null==e?void 0:e.key)||9===(null==e?void 0:e.keyCode)},K$=function(e){return G$(e)&&!e.shiftKey},Y$=function(e){return G$(e)&&e.shiftKey},Z$=function(e){return setTimeout(e,0)},X$=function(e,t){var n=-1;return e.every(function(e,r){return!t(e)||(n=r,!1)}),n},Q$=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"function"==typeof e?e.apply(void 0,n):e},J$=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},ez=[],tz=function(e,t){var n,r=(null==t?void 0:t.document)||document,o=(null==t?void 0:t.trapStack)||ez,i=H$({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:K$,isKeyBackward:Y$},t),a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},s=function(e,t,n){return e&&void 0!==e[t]?e[t]:i[n||t]},l=function(e,t){var n="function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():void 0;return a.containerGroups.findIndex(function(t){var r=t.container,o=t.tabbableNodes;return r.contains(e)||(null==n?void 0:n.includes(r))||o.find(function(t){return t===e})})},u=function(e){var t=i[e];if("function"==typeof t){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];t=t.apply(void 0,o)}if(!0===t&&(t=void 0),!t){if(void 0===t||!1===t)return t;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var s=t;if("string"==typeof t&&!(s=r.querySelector(t)))throw new Error("`".concat(e,"` as selector refers to no known node"));return s},c=function(){var e=u("initialFocus");if(!1===e)return!1;if(void 0===e||!XF(e,i.tabbableOptions))if(l(r.activeElement)>=0)e=r.activeElement;else{var t=a.tabbableGroups[0];e=t&&t.firstTabbableNode||u("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},d=function(){if(a.containerGroups=a.containers.map(function(e){var t=function(e,t){var n;return n=(t=t||{}).getShadowRoot?LF([e],t.includeContainer,{filter:qF.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:GF}):FF(e,t.includeContainer,qF.bind(null,t)),KF(n)}(e,i.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?LF([e],t.includeContainer,{filter:WF.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):FF(e,t.includeContainer,WF.bind(null,t))}(e,i.tabbableOptions),r=t.length>0?t[0]:void 0,o=t.length>0?t[t.length-1]:void 0,a=n.find(function(e){return YF(e)}),s=n.slice().reverse().find(function(e){return YF(e)}),l=!!t.find(function(e){return UF(e)>0});return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:l,firstTabbableNode:r,lastTabbableNode:o,firstDomTabbableNode:a,lastDomTabbableNode:s,nextTabbableNode:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=t.indexOf(e);return o<0?r?n.slice(n.indexOf(e)+1).find(function(e){return YF(e)}):n.slice(0,n.indexOf(e)).reverse().find(function(e){return YF(e)}):t[o+(r?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(e){return e.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find(function(e){return e.posTabIndexesFound})&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function e(t){var n=t.activeElement;if(n)return n.shadowRoot&&null!==n.shadowRoot.activeElement?e(n.shadowRoot):n},f=function e(t){!1!==t&&t!==p(document)&&(t&&t.focus?(t.focus({preventScroll:!!i.preventScroll}),a.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(c()))},h=function(e){var t=u("setReturnFocus",e);return t||!1!==t&&e},g=function(e){var t=e.target,n=e.event,r=e.isBackward,o=void 0!==r&&r;t=t||J$(n),d();var s=null;if(a.tabbableGroups.length>0){var c=l(t,n),p=c>=0?a.containerGroups[c]:void 0;if(c<0)s=o?a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:a.tabbableGroups[0].firstTabbableNode;else if(o){var f=X$(a.tabbableGroups,function(e){var n=e.firstTabbableNode;return t===n});if(f<0&&(p.container===t||XF(t,i.tabbableOptions)&&!YF(t,i.tabbableOptions)&&!p.nextTabbableNode(t,!1))&&(f=c),f>=0){var h=0===f?a.tabbableGroups.length-1:f-1,g=a.tabbableGroups[h];s=UF(t)>=0?g.lastTabbableNode:g.lastDomTabbableNode}else G$(n)||(s=p.nextTabbableNode(t,!1))}else{var m=X$(a.tabbableGroups,function(e){var n=e.lastTabbableNode;return t===n});if(m<0&&(p.container===t||XF(t,i.tabbableOptions)&&!YF(t,i.tabbableOptions)&&!p.nextTabbableNode(t))&&(m=c),m>=0){var v=m===a.tabbableGroups.length-1?0:m+1,y=a.tabbableGroups[v];s=UF(t)>=0?y.firstTabbableNode:y.firstDomTabbableNode}else G$(n)||(s=p.nextTabbableNode(t))}}else s=u("fallbackFocus");return s},m=function(e){var t=J$(e);l(t,e)>=0||(Q$(i.clickOutsideDeactivates,e)?n.deactivate({returnFocus:i.returnFocusOnDeactivate}):Q$(i.allowOutsideClick,e)||e.preventDefault())},v=function(e){var t=J$(e),n=l(t,e)>=0;if(n||t instanceof Document)n&&(a.mostRecentlyFocusedNode=t);else{var r;e.stopImmediatePropagation();var o=!0;if(a.mostRecentlyFocusedNode)if(UF(a.mostRecentlyFocusedNode)>0){var s=l(a.mostRecentlyFocusedNode),u=a.containerGroups[s].tabbableNodes;if(u.length>0){var d=u.findIndex(function(e){return e===a.mostRecentlyFocusedNode});d>=0&&(i.isKeyForward(a.recentNavEvent)?d+1<u.length&&(r=u[d+1],o=!1):d-1>=0&&(r=u[d-1],o=!1))}}else a.containerGroups.some(function(e){return e.tabbableNodes.some(function(e){return UF(e)>0})})||(o=!1);else o=!1;o&&(r=g({target:a.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(a.recentNavEvent)})),f(r||(a.mostRecentlyFocusedNode||c()))}a.recentNavEvent=void 0},y=function(e){if(function(e){return"Escape"===(null==e?void 0:e.key)||"Esc"===(null==e?void 0:e.key)||27===(null==e?void 0:e.keyCode)}(e)&&!1!==Q$(i.escapeDeactivates,e))return e.preventDefault(),void n.deactivate();(i.isKeyForward(e)||i.isKeyBackward(e))&&function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];a.recentNavEvent=e;var n=g({event:e,isBackward:t});n&&(G$(e)&&e.preventDefault(),f(n))}(e,i.isKeyBackward(e))},b=function(e){var t=J$(e);l(t,e)>=0||Q$(i.clickOutsideDeactivates,e)||Q$(i.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},w=function(){if(a.active)return W$(o,n),a.delayInitialFocusTimer=i.delayInitialFocus?Z$(function(){f(c())}):f(c()),r.addEventListener("focusin",v,!0),r.addEventListener("mousedown",m,{capture:!0,passive:!1}),r.addEventListener("touchstart",m,{capture:!0,passive:!1}),r.addEventListener("click",b,{capture:!0,passive:!1}),r.addEventListener("keydown",y,{capture:!0,passive:!1}),n},E=function(){if(a.active)return r.removeEventListener("focusin",v,!0),r.removeEventListener("mousedown",m,!0),r.removeEventListener("touchstart",m,!0),r.removeEventListener("click",b,!0),r.removeEventListener("keydown",y,!0),n},_="undefined"!=typeof window&&"MutationObserver"in window?new MutationObserver(function(e){var t=e.some(function(e){return Array.from(e.removedNodes).some(function(e){return e===a.mostRecentlyFocusedNode})});t&&f(c())}):void 0,x=function(){_&&(_.disconnect(),a.active&&!a.paused&&a.containers.map(function(e){_.observe(e,{subtree:!0,childList:!0})}))};return n={get active(){return a.active},get paused(){return a.paused},activate:function(e){if(a.active)return this;var t=s(e,"onActivate"),n=s(e,"onPostActivate"),o=s(e,"checkCanFocusTrap");o||d(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=r.activeElement,null==t||t();var i=function(){o&&d(),w(),x(),null==n||n()};return o?(o(a.containers.concat()).then(i,i),this):(i(),this)},deactivate:function(e){if(!a.active)return this;var t=H$({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},e);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,E(),a.active=!1,a.paused=!1,x(),q$(o,n);var r=s(t,"onDeactivate"),l=s(t,"onPostDeactivate"),u=s(t,"checkCanReturnFocus"),c=s(t,"returnFocus","returnFocusOnDeactivate");null==r||r();var d=function(){Z$(function(){c&&f(h(a.nodeFocusedBeforeActivation)),null==l||l()})};return c&&u?(u(h(a.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(e){if(a.paused||!a.active)return this;var t=s(e,"onPause"),n=s(e,"onPostPause");return a.paused=!0,null==t||t(),E(),x(),null==n||n(),this},unpause:function(e){if(!a.paused||!a.active)return this;var t=s(e,"onUnpause"),n=s(e,"onPostUnpause");return a.paused=!1,null==t||t(),d(),w(),x(),null==n||n(),this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return a.containers=t.map(function(e){return"string"==typeof e?r.querySelector(e):e}),a.active&&d(),x(),this}},n.updateContainerElements(e),n};E$("field").parts("root","errorText","helperText","input","label","select","textarea"),E$("fieldset").parts("root","errorText","helperText","legend");function nz(e){return(e=>e.nodeType===Node.DOCUMENT_NODE)(e)?e:(e=>null!=e&&e===e.window)(e)?e.document:e?.ownerDocument??document}var rz=()=>e=>Array.from(new Set(e)),oz=E$("radio-group").parts("root","label","item","itemText","itemControl","indicator");oz.build();var iz=function(e){const t={getRootNode:e=>e.getRootNode?.()??document,getDoc:e=>nz(t.getRootNode(e)),getWin:e=>t.getDoc(e).defaultView??window,getActiveElement:e=>t.getRootNode(e).activeElement,isActiveElement:(e,n)=>n===t.getActiveElement(e),getById:(e,n)=>t.getRootNode(e).getElementById(n),setValue:(e,t)=>{if(null==e||null==t)return;const n=t.toString();e.value!==n&&(e.value=t.toString())}};return{...t,...e}}({getRootId:e=>e.ids?.root??`radio-group:${e.id}`,getLabelId:e=>e.ids?.label??`radio-group:${e.id}:label`,getItemId:(e,t)=>e.ids?.item?.(t)??`radio-group:${e.id}:radio:${t}`,getItemHiddenInputId:(e,t)=>e.ids?.itemHiddenInput?.(t)??`radio-group:${e.id}:radio:input:${t}`,getItemControlId:(e,t)=>e.ids?.itemControl?.(t)??`radio-group:${e.id}:radio:control:${t}`,getItemLabelId:(e,t)=>e.ids?.itemLabel?.(t)??`radio-group:${e.id}:radio:label:${t}`,getIndicatorId:e=>e.ids?.indicator??`radio-group:${e.id}:indicator`,getRootEl:e=>iz.getById(e,iz.getRootId(e)),getItemHiddenInputEl:(e,t)=>iz.getById(e,iz.getItemHiddenInputId(e,t)),getIndicatorEl:e=>iz.getById(e,iz.getIndicatorId(e)),getFirstEnabledInputEl:e=>iz.getRootEl(e)?.querySelector("input:not(:disabled)"),getFirstEnabledAndCheckedInputEl:e=>iz.getRootEl(e)?.querySelector("input:not(:disabled):checked"),getInputEls:e=>{const t=`input[type=radio][data-ownedby='${CSS.escape(iz.getRootId(e))}']:not([disabled])`;return function(e,t){return Array.from(e?.querySelectorAll(t)??[])}(iz.getRootEl(e),t)},getActiveRadioEl:e=>{if(e.value)return iz.getById(e,iz.getItemId(e,e.value))},getOffsetRect:e=>({left:e?.offsetLeft??0,top:e?.offsetTop??0,width:e?.offsetWidth??0,height:e?.offsetHeight??0}),getRectById:(e,t)=>{const n=iz.getById(e,iz.getItemId(e,t));if(n)return iz.resolveRect(iz.getOffsetRect(n))},resolveRect:e=>({width:`${e.width}px`,height:`${e.height}px`,left:`${e.left}px`,top:`${e.top}px`})});function az(e){const t=CF(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=cF(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=IB(n)!==i||IB(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function sz(e){return uF(e)?e:e.contextElement}function lz(e){const t=sz(e);if(!cF(t))return RB(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=az(t);let a=(i?IB(n.width):n.width)/r,s=(i?IB(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}rz()(["dir","disabled","form","getRootNode","id","ids","name","onValueChange","orientation","readOnly","value"]),rz()(["value","disabled","invalid"]),oz.rename("segment-group");const uz=RB(0);function cz(e){const t=aF(e);return _F()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:uz}function dz(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=sz(e);let a=RB(1);t&&(r?uF(r)&&(a=lz(r)):a=lz(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==aF(e))&&t}(i,n,r)?cz(i):RB(0);let l=(o.left+s.x)/a.x,u=(o.top+s.y)/a.y,c=o.width/a.x,d=o.height/a.y;if(i){const e=aF(i),t=r&&uF(r)?aF(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=lz(o),t=o.getBoundingClientRect(),r=CF(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,u*=e.y,c*=e.x,d*=e.y,l+=i,u+=a,n=aF(o),o=n.frameElement}}return eF({width:c,height:d,x:l,y:u})}const pz=[":popover-open",":modal"];function fz(e){return pz.some(t=>{try{return e.matches(t)}catch(e){return!1}})}function hz(e){return dz(sF(e)).left+SF(e).scrollLeft}function gz(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=aF(e),r=sF(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=_F();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=sF(e),n=SF(e),r=e.ownerDocument.body,o=PB(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=PB(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+hz(e);const s=-n.scrollTop;return"rtl"===CF(r).direction&&(a+=PB(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(sF(e));else if(uF(t))r=function(e,t){const n=dz(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=cF(e)?lz(e):RB(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=cz(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return eF(r)}function mz(e,t){const n=TF(e);return!(n===t||!uF(n)||kF(n))&&("fixed"===CF(n).position||mz(n,t))}function vz(e,t,n){const r=cF(t),o=sF(t),i="fixed"===n,a=dz(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=RB(0);if(r||!r&&!i)if(("body"!==iF(t)||fF(o))&&(s=SF(t)),r){const e=dz(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=hz(o));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function yz(e){return"static"===CF(e).position}function bz(e,t){return cF(e)&&"fixed"!==CF(e).position?t?t(e):e.offsetParent:null}function wz(e,t){const n=aF(e);if(fz(e))return n;if(!cF(e)){let t=TF(e);for(;t&&!kF(t);){if(uF(t)&&!yz(t))return t;t=TF(t)}return n}let r=bz(e,t);for(;r&&gF(r)&&yz(r);)r=bz(r,t);return r&&kF(r)&&yz(r)&&!EF(r)?n:r||function(e){let t=TF(e);for(;cF(t)&&!kF(t);){if(EF(t))return t;if(vF(t))return null;t=TF(t)}return null}(e)||n}const Ez={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=sF(r),s=!!t&&fz(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},u=RB(1);const c=RB(0),d=cF(r);if((d||!d&&!i)&&(("body"!==iF(r)||fF(a))&&(l=SF(r)),cF(r))){const e=dz(r);u=lz(r),c.x=e.x+r.clientLeft,c.y=e.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+c.x,y:n.y*u.y-l.scrollTop*u.y+c.y}},getDocumentElement:sF,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?fz(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=AF(e,[],!1).filter(e=>uF(e)&&"body"!==iF(e)),o=null;const i="fixed"===CF(e).position;let a=i?TF(e):e;for(;uF(a)&&!kF(a);){const t=CF(a),n=EF(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||fF(a)&&!n&&mz(e,a))?r=r.filter(e=>e!==a):o=t,a=TF(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...i,r],s=a[0],l=a.reduce((e,n)=>{const r=gz(t,n,o);return e.top=PB(r.top,e.top),e.right=OB(r.right,e.right),e.bottom=OB(r.bottom,e.bottom),e.left=PB(r.left,e.left),e},gz(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:wz,getElementRects:async function(e){const t=this.getOffsetParent||wz,n=this.getDimensions,r=await n(e.floating);return{reference:vz(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=az(e);return{width:t,height:n}},getScale:lz,isElement:uF,isRTL:function(e){return"rtl"===CF(e).direction}};function _z(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,u=sz(e),c=o||i?[...u?AF(u):[],...AF(t)]:[];c.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=u&&s?function(e,t){let n,r=null;const o=sF(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const{left:u,top:c,width:d,height:p}=e.getBoundingClientRect();if(s||t(),!d||!p)return;const f={rootMargin:-NB(c)+"px "+-NB(o.clientWidth-(u+d))+"px "+-NB(o.clientHeight-(c+p))+"px "+-NB(u)+"px",threshold:PB(0,OB(1,l))||1};let h=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return a();t?a(!1,t):n=setTimeout(()=>{a(!1,1e-7)},1e3)}h=!1}try{r=new IntersectionObserver(g,{...f,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,f)}r.observe(e)}(!0),i}(u,n):null;let p,f=-1,h=null;a&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),u&&!l&&h.observe(u),h.observe(t));let g=l?dz(e):null;return l&&function t(){const r=dz(e);!g||r.x===g.x&&r.y===g.y&&r.width===g.width&&r.height===g.height||n();g=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(p)}}const xz=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=UB(n),s=jB(n),l="y"===VB(n),u=rF.has(a)?-1:1,c=i&&l?-1:1,d=MB(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(f="end"===s?-1*h:h),l?{x:f*c,y:p*u}:{x:p*u,y:f*c}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},kz=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=MB(e,t),c={x:n,y:r},d=await i.detectOverflow(t,u),p=VB(UB(o)),f=$B(p);let h=c[f],g=c[p];if(a){const e="y"===f?"bottom":"right";h=LB(h+d["y"===f?"top":"left"],h,h-d[e])}if(s){const e="y"===p?"bottom":"right";g=LB(g+d["y"===p?"top":"left"],g,g-d[e])}const m=l.fn({...t,[f]:h,[p]:g});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[f]:a,[p]:s}}}}}},Cz=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:u}=t,{mainAxis:c=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...m}=MB(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const v=UB(o),y=VB(s),b=UB(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(u.floating)),E=p||(b||!g?[QB(s)]:function(e){const t=QB(e);return[qB(e),t,qB(t)]}(s)),_="none"!==h;!p&&_&&E.push(...XB(s,g,h,w));const x=[s,...E],k=await l.detectOverflow(t,m),C=[];let S=(null==(r=i.flip)?void 0:r.overflows)||[];if(c&&C.push(k[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=jB(e),o=WB(e),i=zB(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=QB(a)),[a,QB(a)]}(o,a,w);C.push(k[e[0]],k[e[1]])}if(S=[...S,{placement:o,overflows:C}],!C.every(e=>e<=0)){var T,D;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=x[e];if(t){if(!("alignment"===d&&y!==VB(t))||S.every(e=>VB(e.placement)!==y||e.overflows[0]>0))return{data:{index:e,overflows:S},reset:{placement:t}}}let n=null==(D=S.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:D.placement;if(!n)switch(f){case"bestFit":{var A;const e=null==(A=S.filter(e=>{if(_){const t=VB(e.placement);return t===y||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:A[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},Sz=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...u}=MB(e,t),c=await a.detectOverflow(t,u),d=UB(o),p=jB(o),f="y"===VB(o),{width:h,height:g}=i.floating;let m,v;"top"===d||"bottom"===d?(m=d,v=p===(await(null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(v=d,m="end"===p?"top":"bottom");const y=g-c.top-c.bottom,b=h-c.left-c.right,w=OB(g-c[m],y),E=OB(h-c[v],b),_=!t.middlewareData.shift;let x=w,k=E;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(k=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(x=y),_&&!p){const e=PB(c.left,0),t=PB(c.right,0),n=PB(c.top,0),r=PB(c.bottom,0);f?k=h-2*(0!==e||0!==t?e+t:PB(c.left,c.right)):x=g-2*(0!==n||0!==r?n+r:PB(c.top,c.bottom))}await l({...t,availableWidth:k,availableHeight:x});const C=await a.getDimensions(s.floating);return h!==C.width||g!==C.height?{reset:{rects:!0}}:{}}}},Tz=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:u,padding:c=0}=MB(e,t)||{};if(null==u)return{};const d=JB(c),p={x:n,y:r},f=WB(o),h=zB(f),g=await a.getDimensions(u),m="y"===f,v=m?"top":"left",y=m?"bottom":"right",b=m?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[f]-p[f]-i.floating[h],E=p[f]-i.reference[f],_=await(null==a.getOffsetParent?void 0:a.getOffsetParent(u));let x=_?_[b]:0;x&&await(null==a.isElement?void 0:a.isElement(_))||(x=s.floating[b]||i.floating[h]);const k=w/2-E/2,C=x/2-g[h]/2-1,S=OB(d[v],C),T=OB(d[y],C),D=S,A=x-g[h]-T,O=x/2-g[h]/2+k,P=LB(D,O,A),I=!l.arrow&&null!=jB(o)&&O!==P&&i.reference[h]/2-(O<D?S:T)-g[h]/2<0,N=I?O<D?O-D:O-A:0;return{[f]:p[f]+N,data:{[f]:P,centerOffset:O-P-N,...I&&{alignmentOffset:N}},reset:I}}}),Dz=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=MB(e,t),c={x:n,y:r},d=VB(o),p=$B(d);let f=c[p],h=c[d];const g=MB(s,t),m="number"==typeof g?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const e="y"===p?"height":"width",t=i.reference[p]-i.floating[e]+m.mainAxis,n=i.reference[p]+i.reference[e]-m.mainAxis;f<t?f=t:f>n&&(f=n)}if(u){var v,y;const e="y"===p?"width":"height",t=rF.has(UB(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(v=a.offset)?void 0:v[d])||0)+(t?0:m.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[d])||0)-(t?m.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[p]:f,[d]:h}}}},Az=(e,t,n)=>{const r=new Map,o={platform:Ez,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=tF(u,r,l),p=r,f={},h=0;for(let n=0;n<s.length;n++){var g;const{name:i,fn:m}=s[n],{x:v,y:y,data:b,reset:w}=await m({x:c,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:u,platform:{...a,detectOverflow:null!=(g=a.detectOverflow)?g:nF},elements:{reference:e,floating:t}});c=null!=v?v:c,d=null!=y?y:d,f={...f,[i]:{...f[i],...b}},w&&h<=50&&(h++,"object"==typeof w&&(w.placement&&(p=w.placement),w.rects&&(u=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:c,y:d}=tF(u,p,l))),n=-1)}return{x:c,y:d,placement:p,strategy:o,middlewareData:f}})(e,t,{...o,platform:i})};function Oz(e=0,t=0,n=0,r=0){if("function"==typeof DOMRect)return new DOMRect(e,t,n,r);const o={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...o,toJSON:()=>o}}function Pz(e,t){return{contextElement:Ej(e)?e:void 0,getBoundingClientRect:()=>{const n=e,r=t?.(n);return r||!n?function(e){if(!e)return Oz();const{x:t,y:n,width:r,height:o}=e;return Oz(t,n,r,o)}(r):n.getBoundingClientRect()}}}var Iz=e=>({variable:e,reference:`var(${e})`}),Nz={arrowSize:Iz("--arrow-size"),arrowSizeHalf:Iz("--arrow-size-half"),arrowBg:Iz("--arrow-background"),transformOrigin:Iz("--transform-origin"),arrowOffset:Iz("--arrow-offset")},Rz={name:"transformOrigin",fn({placement:e,elements:t,middlewareData:n}){const{arrow:r}=n,o=(e=>({top:"bottom center","top-start":e?`${e.x}px bottom`:"left bottom","top-end":e?`${e.x}px bottom`:"right bottom",bottom:"top center","bottom-start":e?`${e.x}px top`:"top left","bottom-end":e?`${e.x}px top`:"top right",left:"right center","left-start":e?`right ${e.y}px`:"right top","left-end":e?`right ${e.y}px`:"right bottom",right:"left center","right-start":e?`left ${e.y}px`:"left top","right-end":e?`left ${e.y}px`:"left bottom"}))(r)[e],{floating:i}=t;return i.style.setProperty(Nz.transformOrigin.variable,o),{data:{transformOrigin:o}}}},Bz={name:"rects",fn:({rects:e})=>({data:e})},Fz=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:r,y:o}=n.arrow,i=t.split("-")[0];return Object.assign(e.style,{left:null!=r?`${r}px`:"",top:null!=o?`${o}px`:"",[i]:`calc(100% + ${Nz.arrowOffset.reference})`}),{}}}};var Lz={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function Mz(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function Uz(e){return r$(e.boundary)}function jz(e,t){if(e)return Tz({element:e,padding:t.arrowPadding})}function $z(e,t){if(null!=(t.offset??t.gutter))return xz(({placement:n})=>{const r=(e?.clientHeight||0)/2,o=t.offset?.mainAxis??t.gutter,i="number"==typeof o?o+r:o??r,{hasAlign:a}=function(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:null!=n}}(n),s=a?void 0:t.shift;return u$({crossAxis:t.offset?.crossAxis??s,mainAxis:i,alignmentAxis:t.shift})})}function zz(e){if(e.flip)return Cz({boundary:Uz(e),padding:e.overflowPadding,fallbackPlacements:!0===e.flip?void 0:e.flip})}function Hz(e){if(e.slide||e.overlap)return kz({boundary:Uz(e),mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:Dz()})}function Vz(e){return Sz({padding:e.overflowPadding,apply({elements:e,rects:t,availableHeight:n,availableWidth:r}){const o=e.floating,i=Math.round(t.reference.width);r=Math.floor(r),n=Math.floor(n),o.style.setProperty("--reference-width",`${i}px`),o.style.setProperty("--available-width",`${r}px`),o.style.setProperty("--available-height",`${n}px`)}})}function Wz(e,t,n={}){const{defer:r,...o}=n,i=r?qj:e=>e(),a=[];return a.push(i(()=>{const n="function"==typeof e?e():e,r="function"==typeof t?t():t;a.push(function(e,t,n={}){const r=Pz(e,n.getAnchorRect);if(!t||!r)return;const o=Object.assign({},Lz,n),i=t.querySelector("[data-part=arrow]"),a=[$z(i,o),zz(o),Hz(o),jz(i,o),Fz(i),Rz,Vz(o),Bz],{placement:s,strategy:l,onComplete:u,onPositioned:c}=o,d=async()=>{if(!r||!t)return;const e=await Az(r,t,{placement:s,middleware:a,strategy:l});u?.(e),c?.({placed:!0});const n=Cj(t),o=Mz(n,e.x),i=Mz(n,e.y);t.style.setProperty("--x",`${o}px`),t.style.setProperty("--y",`${i}px`);const d=t.firstElementChild;if(d){const e=n.getComputedStyle(d).zIndex;t.style.setProperty("--z-index",e)}},p=async()=>{n.updatePosition?(await n.updatePosition({updatePosition:d}),c?.({placed:!0})):await d()},f=function(e){return e?!0===e?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}(o.listeners),h=o.listeners?_z(r,t,p,f):o$;return p(),()=>{h?.(),c?.({placed:!1})}}(n,r,o))})),()=>{a.forEach(e=>e?.())}}var qz={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};var Gz="pointerdown.outside",Kz="focus.outside";function Yz(e){for(const t of e)if(Ej(t)&&Uj(t))return!0;return!1}var Zz=e=>"clientY"in e;function Xz(e,t){const{exclude:n,onFocusOutside:r,onPointerDownOutside:o,onInteractOutside:i,defer:a}=t;if(!e)return;const s=kj(e),l=function(e){const t={each(t){for(let n=0;n<e.frames?.length;n+=1){const r=e.frames[n];r&&t(r)}},addEventListener:(e,n,r)=>(t.each(t=>{try{t.document.addEventListener(e,n,r)}catch{}}),()=>{try{t.removeEventListener(e,n,r)}catch{}}),removeEventListener(e,n,r){t.each(t=>{try{t.document.removeEventListener(e,n,r)}catch{}})}};return t}(Cj(e));function u(t){const r=Aj(t);return!!Ej(r)&&(!xj(e,r)&&(!function(e,t){if(!Zz(t)||!e)return!1;const n=e.getBoundingClientRect();return 0!==n.width&&0!==n.height&&n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}(e,t)&&(!function(e){const t=Aj(e);if(!t||!Zz(e))return!1;const n=t.scrollHeight>t.clientHeight&&e.clientX>t.clientWidth,r=t.scrollWidth>t.clientWidth&&e.clientY>t.clientHeight;return n||r}(t)&&!n?.(r))))}let c;function d(t){function n(){const n=a?qj:e=>e(),r=t.composedPath?.()??[t.target];n(()=>{if(e&&u(t)){if(o||i){const t=i$(o,i);e.addEventListener(Gz,t,{once:!0})}m$(e,Gz,{bubbles:!1,cancelable:!0,detail:{originalEvent:t,contextmenu:h$(t),focusable:Yz(r)}})}})}"touch"===t.pointerType?(l.removeEventListener("click",n),s.removeEventListener("click",n),c=n,s.addEventListener("click",n,{once:!0}),l.addEventListener("click",n,{once:!0})):n()}const p=new Set,f=setTimeout(()=>{p.add(l.addEventListener("pointerdown",d,!0)),p.add(p$(s,"pointerdown",d,!0))},0);function h(t){(a?qj:e=>e())(()=>{if(e&&u(t)){if(r||i){const t=i$(r,i);e.addEventListener(Kz,t,{once:!0})}m$(e,Kz,{bubbles:!1,cancelable:!0,detail:{originalEvent:t,contextmenu:!1,focusable:Uj(Aj(t))}})}})}return p.add(p$(s,"focusin",h,!0)),p.add(l.addEventListener("focusin",h,!0)),()=>{clearTimeout(f),c&&(l.removeEventListener("click",c),s.removeEventListener("click",c)),p.forEach(e=>e())}}function Qz(e,t){const{defer:n}=t,r=n?qj:e=>e(),o=[];return o.push(r(()=>{const n="function"==typeof e?e():e;o.push(Xz(n,t))})),()=>{o.forEach(e=>e?.())}}function Jz(e,t){return p$(kj(e),"keydown",e=>{"Escape"===e.key&&(e.isComposing||t?.(e))},{capture:!0})}var eH,tH={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){return this.indexOf(e)<(this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1)},isTopMost(e){const t=this.layers[this.count()-1];return t?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},isInNestedLayer(e,t){return this.getNestedLayers(e).some(e=>xj(e.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>xj(t,e))},add(e){const t=this.layers.push(e);e.node.style.setProperty("--layer-index",`${t}`)},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);if(!(t<0)){if(t<this.count()-1){this.getNestedLayers(e).forEach(e=>e.dismiss())}this.layers.splice(t,1),e.style.removeProperty("--layer-index")}},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e){this.layers[this.indexOf(e)]?.dismiss()},clear(){this.remove(this.layers[0].node)}};function nH(){tH.layers.forEach(({node:e})=>{e.style.pointerEvents=tH.isBelowPointerBlockingLayer(e)?"none":"auto"})}function rH(e,t){const n=kj(e),r=[];if(tH.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(eH=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),t){const e=e$(t,e=>{r.push(Qj(e,{pointerEvents:"auto"}))});r.push(e)}return()=>{tH.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=eH,n.body.removeAttribute("data-inert"),0===n.body.style.length&&n.body.removeAttribute("style")}),r.forEach(e=>e()))}}function oH(e,t){const{defer:n}=t,r=n?qj:e=>e(),o=[];return o.push(r(()=>{const n=l$(e)?e():e;o.push(function(e,t){if(!e)return void d$("[@zag-js/dismissable] node is `null` or `undefined`");const{onDismiss:n,pointerBlocking:r,exclude:o,debug:i}=t,a={dismiss:n,node:e,pointerBlocking:r};tH.add(a),nH();const s=[r?rH(e,t.persistentElements):void 0,Jz(e,function(r){tH.isTopMost(e)&&(t.onEscapeKeyDown?.(r),!r.defaultPrevented&&n&&(r.preventDefault(),n()))}),Qz(e,{exclude:function(n){if(!e)return!1;const r="function"==typeof o?o():o,i=Array.isArray(r)?r:[r],a=t.persistentElements?.map(e=>e()).filter(Ej);return a&&i.push(...a),i.some(e=>xj(e,n))||tH.isInNestedLayer(e,n)},onFocusOutside:function(e){const r=Aj(e.detail.originalEvent);tH.isInBranch(r)||(t.onFocusOutside?.(e),t.onInteractOutside?.(e),e.defaultPrevented||(i&&console.log("onFocusOutside:",e.detail.originalEvent),n?.()))},onPointerDownOutside:function(r){const o=Aj(r.detail.originalEvent);tH.isBelowPointerBlockingLayer(e)||tH.isInBranch(o)||(t.onPointerDownOutside?.(r),t.onInteractOutside?.(r),r.defaultPrevented||(i&&console.log("onPointerDownOutside:",r.detail.originalEvent),n?.()))},defer:t.defer})];return()=>{tH.remove(e),nH(),function(e){e.style.pointerEvents=""}(e),s.forEach(e=>e?.())}}(n,t))})),()=>{o.forEach(e=>e?.())}}function iH(e){return e?.animationName||"none"}rj()(["onExitComplete","present","immediate"]);var aH=new WeakMap,sH=[];function lH(e,t={}){const{defer:n}=t,r=n?qj:e=>e(),o=[];return o.push(r(()=>{const n="function"==typeof e?e():e;o.push(function(e,t={}){const{rootEl:n}=t,r=e.filter(Boolean);if(0===r.length)return;const o=r[0].ownerDocument||document,i=o.defaultView??window,a=new Set(r),s=new Set,l=n??o.body;let u=e=>{for(let t of e.querySelectorAll("[data-live-announcer], [data-zag-top-layer]"))a.add(t);let t=e=>{if(a.has(e)||s.has(e.parentElement)&&"row"!==e.parentElement.getAttribute("role"))return NodeFilter.FILTER_REJECT;for(let t of a)if(e.contains(t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},n=o.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),r=t(e);if(r===NodeFilter.FILTER_ACCEPT&&c(e),r!==NodeFilter.FILTER_REJECT){let e=n.nextNode();for(;null!=e;)c(e),e=n.nextNode()}},c=e=>{let t=aH.get(e)??0;"true"===e.getAttribute("aria-hidden")&&0===t||(0===t&&e.setAttribute("aria-hidden","true"),s.add(e),aH.set(e,t+1))};sH.length&&sH[sH.length-1].disconnect(),u(l);const d=new i.MutationObserver(e=>{for(let t of e)if("childList"===t.type&&0!==t.addedNodes.length&&![...a,...s].some(e=>e.contains(t.target))){for(let e of t.removedNodes)e instanceof i.Element&&(a.delete(e),s.delete(e));for(let e of t.addedNodes)!(e instanceof i.HTMLElement||e instanceof i.SVGElement)||"true"!==e.dataset.liveAnnouncer&&"true"!==e.dataset.zagTopLayer?e instanceof i.Element&&u(e):a.add(e)}});d.observe(l,{childList:!0,subtree:!0});let p={observe(){d.observe(l,{childList:!0,subtree:!0})},disconnect(){d.disconnect()}};return sH.push(p),()=>{d.disconnect();for(let e of s){let t=aH.get(e);1===t?(e.removeAttribute("aria-hidden"),aH.delete(e)):aH.set(e,t-1)}p===sH[sH.length-1]?(sH.pop(),sH.length&&sH[sH.length-1].observe()):sH.splice(sH.indexOf(p),1)}}(n,t))})),()=>{o.forEach(e=>e?.())}}var uH=(e,t=[])=>({parts:(...n)=>{if(dH(t))return uH(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>uH(e,[...t,...n]),rename:e=>uH(e,t),keys:()=>t,build:()=>[...new Set(t)].reduce((t,n)=>Object.assign(t,{[n]:{selector:[`&[data-scope="${cH(e)}"][data-part="${cH(n)}"]`,`& [data-scope="${cH(e)}"][data-part="${cH(n)}"]`].join(", "),attrs:{"data-scope":cH(e),"data-part":cH(n)}}}),{})}),cH=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),dH=e=>0===e.length,pH="data-zag-scroll-lock";function fH(e,t){if(!e)return;const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function hH(e){const t=e??document,n=t.defaultView??window,{documentElement:r,body:o}=t;if(o.hasAttribute(pH))return;o.setAttribute(pH,"");const i=n.innerWidth-r.clientWidth,a=function(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}(r),s=[function(e,t,n){if(!e)return;const r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{r?e.style.setProperty(t,r):e.style.removeProperty(t)}}(r,"--scrollbar-width",`${i}px`),Tj(/iP(hone|ad|od)|iOS/)?(()=>{const{scrollX:e,scrollY:t,visualViewport:r}=n,s=r?.offsetLeft??0,l=r?.offsetTop??0,u=fH(o,{position:"fixed",overflow:"hidden",top:-(t-Math.floor(l))+"px",left:-(e-Math.floor(s))+"px",right:"0",[a]:`${i}px`});return()=>{u?.(),n.scrollTo({left:e,top:t,behavior:"instant"})}})():fH(o,{overflow:"hidden",[a]:`${i}px`})];return()=>{s.forEach(e=>e?.()),o.removeAttribute(pH)}}var gH=uH("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger").build(),mH=Yj({getPositionerId:e=>e.ids?.positioner??`dialog:${e.id}:positioner`,getBackdropId:e=>e.ids?.backdrop??`dialog:${e.id}:backdrop`,getContentId:e=>e.ids?.content??`dialog:${e.id}:content`,getTriggerId:e=>e.ids?.trigger??`dialog:${e.id}:trigger`,getTitleId:e=>e.ids?.title??`dialog:${e.id}:title`,getDescriptionId:e=>e.ids?.description??`dialog:${e.id}:description`,getCloseTriggerId:e=>e.ids?.closeTrigger??`dialog:${e.id}:close`,getContentEl:e=>mH.getById(e,mH.getContentId(e)),getPositionerEl:e=>mH.getById(e,mH.getPositionerId(e)),getBackdropEl:e=>mH.getById(e,mH.getBackdropId(e)),getTriggerEl:e=>mH.getById(e,mH.getTriggerId(e)),getTitleEl:e=>mH.getById(e,mH.getTitleId(e)),getDescriptionEl:e=>mH.getById(e,mH.getDescriptionId(e)),getCloseTriggerEl:e=>mH.getById(e,mH.getCloseTriggerId(e))});function vH(e){const t=u$(e);return XU({id:"dialog",initial:t.open?"open":"closed",context:{role:"dialog",renderedElements:{title:!0,description:!0},modal:!0,trapFocus:!0,preventScroll:!0,closeOnInteractOutside:!0,closeOnEscape:!0,restoreFocus:!0,...t},created:["checkInitialFocusEl"],watch:{open:["toggleVisibility"]},states:{open:{entry:["checkRenderedElements","syncZIndex"],activities:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed",actions:["setFinalFocus"]},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose","setFinalFocus"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose","setFinalFocus"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}}},{guards:{isOpenControlled:e=>!!e["open.controlled"]},activities:{trackDismissableElement:(e,t,{send:n})=>oH(()=>mH.getContentEl(e),{defer:!0,pointerBlocking:e.modal,exclude:[mH.getTriggerEl(e)],onInteractOutside(t){e.onInteractOutside?.(t),e.closeOnInteractOutside&&"alertdialog"!==e.role||t.preventDefault()},persistentElements:e.persistentElements,onFocusOutside:e.onFocusOutside,onPointerDownOutside:e.onPointerDownOutside,onEscapeKeyDown(t){e.onEscapeKeyDown?.(t),e.closeOnEscape?n({type:"CLOSE",src:"escape-key"}):t.preventDefault()},onDismiss(){n({type:"CLOSE",src:"interact-outside"})}}),preventScroll(e){if(e.preventScroll)return hH(mH.getDoc(e))},trapFocus(e){if(!e.trapFocus||!e.modal)return;let t;const n=function(e){const t=new Set;function n(e){const n=globalThis.requestAnimationFrame(e);t.add(()=>globalThis.cancelAnimationFrame(n))}return n(()=>n(e)),function(){t.forEach(e=>e())}}(()=>{const n=mH.getContentEl(e);if(n){t=tz(n,{document:mH.getDoc(e),escapeDeactivates:!1,preventScroll:!0,returnFocusOnDeactivate:!1,fallbackFocus:n,allowOutsideClick:!0,initialFocus:zj({root:n,getInitialEl:e.initialFocusEl})});try{t.activate()}catch{}}});return()=>{t?.deactivate(),n()}},hideContentBelow(e){if(!e.modal)return;return lH(()=>[mH.getContentEl(e)],{defer:!0})}},actions:{checkInitialFocusEl(e){e.initialFocusEl||"alertdialog"!==e.role||(e.initialFocusEl=()=>mH.getCloseTriggerEl(e))},checkRenderedElements(e){qj(()=>{e.renderedElements.title=!!mH.getTitleEl(e),e.renderedElements.description=!!mH.getDescriptionEl(e)})},syncZIndex(e){qj(()=>{const t=mH.getContentEl(e);if(!t)return;const n=mH.getWin(e).getComputedStyle(t);[mH.getPositionerEl(e),mH.getBackdropEl(e)].forEach(e=>{e?.style.setProperty("--z-index",n.zIndex)})})},invokeOnClose(e){e.onOpenChange?.({open:!1})},invokeOnOpen(e){e.onOpenChange?.({open:!0})},toggleVisibility(e,t,{send:n}){n({type:e.open?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:t})},setFinalFocus(e){e.restoreFocus&&queueMicrotask(()=>{const t=e.finalFocusEl?.()??mH.getTriggerEl(e);t?.focus({preventScroll:!0})})}}})}rj()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open.controlled","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);var yH=(e,t=[])=>({parts:(...n)=>{if(wH(t))return yH(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>yH(e,[...t,...n]),rename:e=>yH(e,t),keys:()=>t,build:()=>[...new Set(t)].reduce((t,n)=>Object.assign(t,{[n]:{selector:[`&[data-scope="${bH(e)}"][data-part="${bH(n)}"]`,`& [data-scope="${bH(e)}"][data-part="${bH(n)}"]`].join(", "),attrs:{"data-scope":bH(e),"data-part":bH(n)}}}),{})}),bH=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),wH=e=>0===e.length,EH=(e,t)=>({x:e,y:t});function _H(e,t){const n=function(e){const{x:t,y:n,width:r,height:o}=e,i=t+r/2,a=n+o/2;return{x:t,y:n,width:r,height:o,minX:t,minY:n,maxX:t+r,maxY:n+o,midX:i,midY:a,center:EH(i,a)}}(e),{top:r,right:o,left:i,bottom:a}={top:EH((s=n).minX,s.minY),right:EH(s.maxX,s.minY),bottom:EH(s.maxX,s.maxY),left:EH(s.minX,s.maxY)};var s;const[l]=t.split("-");return{top:[i,r,o,a],right:[r,o,a,i],bottom:[r,i,a,o],left:[o,r,i,a]}[l]}var xH=yH("menu").parts("arrow","arrowTip","content","contextTrigger","indicator","item","itemGroup","itemGroupLabel","itemIndicator","itemText","positioner","separator","trigger","triggerItem").build(),kH=Yj({getTriggerId:e=>e.ids?.trigger??`menu:${e.id}:trigger`,getContextTriggerId:e=>e.ids?.contextTrigger??`menu:${e.id}:ctx-trigger`,getContentId:e=>e.ids?.content??`menu:${e.id}:content`,getArrowId:e=>e.ids?.arrow??`menu:${e.id}:arrow`,getPositionerId:e=>e.ids?.positioner??`menu:${e.id}:popper`,getGroupId:(e,t)=>e.ids?.group?.(t)??`menu:${e.id}:group:${t}`,getGroupLabelId:(e,t)=>e.ids?.label?.(t)??`menu:${e.id}:label:${t}`,getContentEl:e=>kH.getById(e,kH.getContentId(e)),getPositionerEl:e=>kH.getById(e,kH.getPositionerId(e)),getTriggerEl:e=>kH.getById(e,kH.getTriggerId(e)),getHighlightedItemEl:e=>e.highlightedValue?kH.getById(e,e.highlightedValue):null,getArrowEl:e=>kH.getById(e,kH.getArrowId(e)),getElements:e=>{const t=`[role^="menuitem"][data-ownedby=${CSS.escape(kH.getContentId(e))}]:not([data-disabled])`;return Kj(kH.getContentEl(e),t)},getFirstEl:e=>kH.getElements(e)[0],getLastEl:e=>{return(t=kH.getElements(e))[t.length-1];var t},getNextEl:(e,t)=>function(e,t,n=!0){let r=Nj(e,t);return r=n?(r+1)%e.length:Math.min(r+1,e.length-1),e[r]}(kH.getElements(e),e.highlightedValue,t??e.loopFocus),getPrevEl:(e,t)=>function(e,t,n=!0){let r=Nj(e,t);return-1===r?n?e[e.length-1]:null:(r=n?(r-1+e.length)%e.length:Math.max(0,r-1),e[r])}(kH.getElements(e),e.highlightedValue,t??e.loopFocus),getElemByKey:(e,t)=>Fj(kH.getElements(e),{state:e.typeaheadState,key:t,activeId:e.highlightedValue}),isTargetDisabled:e=>Ej(e)&&(""===e.dataset.disabled||e.hasAttribute("disabled")),isTriggerItem:e=>!!e?.getAttribute("role")?.startsWith("menuitem")&&!!e?.hasAttribute("aria-controls"),getOptionFromItemEl:e=>({id:e.id,name:e.dataset.name,value:e.dataset.value,valueText:e.dataset.valueText,type:e.dataset.type})});function CH(e,t,n){const r=e.context.isSubmenu,o=e.context.isTypingAhead,i=e.context.composite,a=e.hasTag("open"),s=function(e={}){const{placement:t,sameWidth:n,fitViewport:r,strategy:o="absolute"}=e;return{arrow:{position:"absolute",width:Nz.arrowSize.reference,height:Nz.arrowSize.reference,[Nz.arrowSizeHalf.variable]:`calc(${Nz.arrowSize.reference} / 2)`,[Nz.arrowOffset.variable]:`calc(${Nz.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?qz[t.split("-")[0]]:void 0,background:Nz.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:o,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}({...e.context.positioning,placement:e.context.anchorPoint?"bottom":e.context.currentPlacement});function l(t){return{disabled:!!t.disabled,highlighted:e.context.highlightedValue===t.value}}function u(e){const t=e.valueText??e.value;return{...e,id:e.value,valueText:t}}function c(e){return{...l(u(e)),checked:!!e.checked}}function d(r){const{value:o,closeOnSelect:i,valueText:a}=r,s=l(r);return n.element({...xH.item.attrs,id:o,role:"menuitem","aria-disabled":s.disabled,"data-disabled":wj(s.disabled),"data-ownedby":kH.getContentId(e.context),"data-highlighted":wj(s.highlighted),"data-valuetext":a,onDragStart(e){e.currentTarget.matches("a[href]")&&e.preventDefault()},onPointerMove(e){if(s.disabled)return;if("mouse"!==e.pointerType)return;const n=e.currentTarget;s.highlighted||t({type:"ITEM_POINTERMOVE",id:o,target:n,closeOnSelect:i})},onPointerLeave(n){if(s.disabled)return;if("mouse"!==n.pointerType)return;if(!e.previousEvent.type.includes("POINTER"))return;const r=n.currentTarget;t({type:"ITEM_POINTERLEAVE",id:o,target:r,closeOnSelect:i})},onPointerDown(e){if(s.disabled)return;const n=e.currentTarget;t({type:"ITEM_POINTERDOWN",target:n,id:o,closeOnSelect:i})},onPointerUp(e){if(Pj(e))return;if(Oj(e))return;if(s.disabled)return;if(!f$(e))return;const n=e.currentTarget;t({type:"ITEM_CLICK",src:"pointerup",target:n,id:o,closeOnSelect:i}),"touch"===e.pointerType&&g$(n)},onTouchEnd(e){e.preventDefault(),e.stopPropagation()}})}return{highlightedValue:e.context.highlightedValue,open:a,setOpen(e){e!==a&&t(e?"OPEN":"CLOSE")},setHighlightedValue(e){t({type:"HIGHLIGHTED.SET",id:e})},setParent(e){t({type:"PARENT.SET",value:e,id:e.state.context.id})},setChild(e){t({type:"CHILD.SET",value:e,id:e.state.context.id})},reposition(e={}){t({type:"POSITIONING.SET",options:e})},getContextTriggerProps:()=>n.element({...xH.contextTrigger.attrs,dir:e.context.dir,id:kH.getContextTriggerId(e.context),onPointerDown(e){if("mouse"===e.pointerType)return;const n=w$(e);t({type:"CONTEXT_MENU_START",point:n})},onPointerCancel(e){"mouse"!==e.pointerType&&t("CONTEXT_MENU_CANCEL")},onPointerMove(e){"mouse"!==e.pointerType&&t("CONTEXT_MENU_CANCEL")},onPointerUp(e){"mouse"!==e.pointerType&&t("CONTEXT_MENU_CANCEL")},onContextMenu(e){const n=w$(e);t({type:"CONTEXT_MENU",point:n}),e.preventDefault()},style:{WebkitTouchCallout:"none",userSelect:"none"}}),getTriggerItemProps:e=>nj(d({value:e.getTriggerProps().id}),e.getTriggerProps()),getTriggerProps:()=>n.button({...r?xH.triggerItem.attrs:xH.trigger.attrs,"data-placement":e.context.currentPlacement,type:"button",dir:e.context.dir,id:kH.getTriggerId(e.context),"data-uid":e.context.id,"aria-haspopup":i?"menu":"dialog","aria-controls":kH.getContentId(e.context),"aria-expanded":a||void 0,"data-state":a?"open":"closed",onPointerMove(e){if("mouse"!==e.pointerType)return;!kH.isTargetDisabled(e.currentTarget)&&r&&t({type:"TRIGGER_POINTERMOVE",target:e.currentTarget})},onPointerLeave(e){if("mouse"!==e.pointerType)return;if(kH.isTargetDisabled(e.currentTarget)||!r)return;const n=w$(e);t({type:"TRIGGER_POINTERLEAVE",target:e.currentTarget,point:n})},onClick(e){kH.isTriggerItem(e.currentTarget)&&t({type:"TRIGGER_CLICK",target:e.currentTarget})},onPointerDown(e){const n=kH.isTargetDisabled(e.currentTarget);!f$(e)||n||h$(e)||(e.preventDefault(),kH.isTriggerItem(e.currentTarget)||t({type:"TRIGGER_CLICK",target:e.currentTarget}))},onBlur(){t("TRIGGER_BLUR")},onFocus(){t("TRIGGER_FOCUS")},onKeyDown(n){if(n.defaultPrevented)return;const r={ArrowDown(){t("ARROW_DOWN")},ArrowUp(){t("ARROW_UP")},Enter(){t({type:"ARROW_DOWN",src:"enter"})},Space(){t({type:"ARROW_DOWN",src:"space"})}}[b$(n,e.context)];r&&(n.preventDefault(),r(n))}}),getIndicatorProps:()=>n.element({...xH.indicator.attrs,dir:e.context.dir,"data-state":a?"open":"closed"}),getPositionerProps:()=>n.element({...xH.positioner.attrs,dir:e.context.dir,id:kH.getPositionerId(e.context),style:s.floating}),getArrowProps:()=>n.element({id:kH.getArrowId(e.context),...xH.arrow.attrs,dir:e.context.dir,style:s.arrow}),getArrowTipProps:()=>n.element({...xH.arrowTip.attrs,dir:e.context.dir,style:s.arrowTip}),getContentProps:()=>n.element({...xH.content.attrs,id:kH.getContentId(e.context),"aria-label":e.context["aria-label"],hidden:!a,"data-state":a?"open":"closed",role:i?"menu":"dialog",tabIndex:0,dir:e.context.dir,"aria-activedescendant":e.context.highlightedValue??void 0,"aria-labelledby":kH.getTriggerId(e.context),"data-placement":e.context.currentPlacement,onPointerEnter(e){"mouse"===e.pointerType&&t("MENU_POINTERENTER")},onKeyDown(n){if(n.defaultPrevented)return;if(!(e=>xj(e.currentTarget,Aj(e)))(n))return;const r=Aj(n);if(!(r?.closest("[role=menu]")===n.currentTarget||r===n.currentTarget))return;if("Tab"===n.key){if(!Hj(n))return void n.preventDefault()}const i=kH.getHighlightedItemEl(e.context),a={ArrowDown(){t("ARROW_DOWN")},ArrowUp(){t("ARROW_UP")},ArrowLeft(){t("ARROW_LEFT")},ArrowRight(){t("ARROW_RIGHT")},Enter(){t("ENTER"),g$(i)},Space(e){o?t({type:"TYPEAHEAD",key:e.key}):a.Enter?.(e)},Home(){t("HOME")},End(){t("END")}},s=b$(n,{dir:e.context.dir}),l=a[s];if(l)return l(n),n.stopPropagation(),void n.preventDefault();e.context.typeahead&&function(e){return 1===e.key.length&&!e.ctrlKey&&!e.metaKey}(n)&&((e=>e.ctrlKey||e.altKey||e.metaKey)(n)||Vj(r)||(t({type:"TYPEAHEAD",key:n.key}),n.preventDefault()))}}),getSeparatorProps:()=>n.element({...xH.separator.attrs,role:"separator",dir:e.context.dir,"aria-orientation":"horizontal"}),getItemState:l,getItemProps:d,getOptionItemState:c,getOptionItemProps(r){const{type:o,disabled:i,onCheckedChange:a,closeOnSelect:s}=r,l=u(r),p=c(r);return{...d(l),...n.element({"data-type":o,...xH.item.attrs,dir:e.context.dir,"data-value":l.value,role:`menuitem${o}`,"aria-checked":!!p.checked,"data-state":p.checked?"checked":"unchecked",onPointerUp(e){if(!f$(e)||i)return;if(Pj(e))return;if(Oj(e))return;const n=e.currentTarget;t({type:"ITEM_CLICK",src:"pointerup",target:n,option:l,closeOnSelect:s}),a?.(!p.checked)}})}},getItemIndicatorProps(t){const r=c(t);return n.element({...xH.itemIndicator.attrs,dir:e.context.dir,"data-disabled":wj(r.disabled),"data-highlighted":wj(r.highlighted),"data-state":r.checked?"checked":"unchecked",hidden:!r.checked})},getItemTextProps(t){const r=c(t);return n.element({...xH.itemText.attrs,dir:e.context.dir,"data-disabled":wj(r.disabled),"data-highlighted":wj(r.highlighted),"data-state":r.checked?"checked":"unchecked"})},getItemGroupLabelProps:t=>n.element({id:kH.getGroupLabelId(e.context,t.htmlFor),dir:e.context.dir,...xH.itemGroupLabel.attrs}),getItemGroupProps:t=>n.element({id:kH.getGroupId(e.context,t.id),...xH.itemGroup.attrs,dir:e.context.dir,"aria-labelledby":kH.getGroupLabelId(e.context,t.id),role:"group"})}}var{not:SH,and:TH,or:DH}=WU;function AH(e){let t=e.parent;for(;t&&t.state.context.isSubmenu;)t=t.state.context.parent;t?.send("CLOSE")}var OH={highlighted(e,t){n$(e.highlightedValue,t)||(e.highlightedValue=t,e.onHighlightChange?.({highlightedValue:t}))}};rj()(["anchorPoint","aria-label","closeOnSelect","dir","getRootNode","highlightedValue","id","ids","loopFocus","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","onEscapeKeyDown","onSelect","onHighlightChange","open","open.controlled","positioning","typeahead","composite"]),rj()(["closeOnSelect","disabled","value","valueText"]),rj()(["htmlFor"]),rj()(["id"]),rj()(["disabled","valueText","closeOnSelect","type","value","checked","onCheckedChange"]);var PH=(e,t=[])=>({parts:(...n)=>{if(NH(t))return PH(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>PH(e,[...t,...n]),rename:e=>PH(e,t),keys:()=>t,build:()=>[...new Set(t)].reduce((t,n)=>Object.assign(t,{[n]:{selector:[`&[data-scope="${IH(e)}"][data-part="${IH(n)}"]`,`& [data-scope="${IH(e)}"][data-part="${IH(n)}"]`].join(", "),attrs:{"data-scope":IH(e),"data-part":IH(n)}}}),{})}),IH=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),NH=e=>0===e.length,RH=PH("progress").parts("root","label","track","range","valueText","view","circle","circleTrack","circleRange").build(),BH=Yj({getRootId:e=>e.ids?.root??`progress-${e.id}`,getTrackId:e=>e.ids?.track??`progress-${e.id}-track`,getLabelId:e=>e.ids?.label??`progress-${e.id}-label`,getCircleId:e=>e.ids?.circle??`progress-${e.id}-circle`});function FH(e,t){return e+(t-e)/2}function LH(e){const t=u$(e);return XU({id:"progress",initial:"idle",context:{max:t.max??100,min:t.min??0,value:FH(t.min??0,t.max??100),orientation:"horizontal",translations:{value:({percent:e})=>-1===e?"loading...":`${e} percent`,...t.translations},...t},created:["validateContext"],computed:{isIndeterminate:e=>null===e.value,percent:e=>s$(e.value)?Math.round((e.value-e.min)/(e.max-e.min)*100):-1,isAtMax:e=>e.value===e.max,isHorizontal:e=>"horizontal"===e.orientation,isRtl:e=>"rtl"===e.dir},states:{idle:{on:{"VALUE.SET":{actions:["setValue"]}}}}},{actions:{setValue:(e,t)=>{e.value=null===t.value?null:Math.max(0,Math.min(t.value,e.max))},validateContext:e=>{if(null!=e.value){if(!MH(e.max))throw new Error(`[progress] The max value passed \`${e.max}\` is not a valid number`);if(!function(e,t){return MH(e)&&e<=t}(e.value,e.max))throw new Error(`[progress] The value passed \`${e.value}\` exceeds the max value \`${e.max}\``);if(!function(e,t){return MH(e)&&e>=t}(e.value,e.min))throw new Error(`[progress] The value passed \`${e.value}\` exceeds the min value \`${e.min}\``)}}}})}function MH(e){return s$(e)&&!isNaN(e)}rj()(["dir","getRootNode","id","ids","max","min","orientation","translations","value"]);var UH=(e,t=[])=>({parts:(...n)=>{if($H(t))return UH(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>UH(e,[...t,...n]),rename:e=>UH(e,t),keys:()=>t,build:()=>[...new Set(t)].reduce((t,n)=>Object.assign(t,{[n]:{selector:[`&[data-scope="${jH(e)}"][data-part="${jH(n)}"]`,`& [data-scope="${jH(e)}"][data-part="${jH(n)}"]`].join(", "),attrs:{"data-scope":jH(e),"data-part":jH(n)}}}),{})}),jH=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),$H=e=>0===e.length,zH=UH("toast").parts("group","root","title","description","actionTrigger","closeTrigger").build(),HH=Yj({getRegionId:e=>`toast-group:${e}`,getRegionEl:(e,t)=>HH.getById(e,`toast-group:${t}`),getRootId:e=>`toast:${e.id}`,getRootEl:e=>HH.getById(e,HH.getRootId(e)),getTitleId:e=>`toast:${e.id}:title`,getDescriptionId:e=>`toast:${e.id}:description`,getCloseTriggerId:e=>`toast${e.id}:close`});function VH(e,t){return e.filter(e=>e.state.context.placement===t)}var WH={info:5e3,error:5e3,success:2e3,loading:1/0,DEFAULT:5e3};function qH(e,t){return e??WH[t]??WH.DEFAULT}function GH(e,t){const n=e.offsets,r="string"==typeof n?{left:n,right:n,bottom:n,top:n}:n,o="rtl"===e.dir,i=t.replace("-start",o?"-right":"-left").replace("-end",o?"-left":"-right"),a=i.includes("right"),s=i.includes("left"),l={position:"fixed",pointerEvents:e.count>0?void 0:"none",display:"flex",flexDirection:"column","--gap":`${e.gap}px`,"--first-height":`${e.heights[0]?.height||0}px`,zIndex:2147483647};let u="center";if(a&&(u="flex-end"),s&&(u="flex-start"),l.alignItems=u,i.includes("top")){const e=r.top;l.top=`max(env(safe-area-inset-top, 0px), ${e})`}if(i.includes("bottom")){const e=r.bottom;l.bottom=`max(env(safe-area-inset-bottom, 0px), ${e})`}if(!i.includes("left")){const e=r.right;l.insetInlineEnd=`calc(env(safe-area-inset-right, 0px) + ${e})`}if(!i.includes("right")){const e=r.left;l.insetInlineStart=`calc(env(safe-area-inset-left, 0px) + ${e})`}return l}function KH(e,t){const[n]=e.placement.split("-"),r=!e.frontmost,o=!e.stacked,i={position:"absolute",pointerEvents:"auto","--opacity":"0","--remove-delay":`${e.removeDelay}ms`,"--duration":`${"loading"===e.type?Number.MAX_SAFE_INTEGER:e.duration}ms`,"--initial-height":`${e.height}px`,"--offset":`${e.offset}px`,"--index":e.index,"--z-index":e.zIndex,"--lift-amount":"calc(var(--lift) * var(--gap))","--y":"100%","--x":"0"},a=e=>Object.assign(i,e);return"top"===n?a({top:"0","--sign":"-1","--y":"-100%","--lift":"1"}):"bottom"===n&&a({bottom:"0","--sign":"1","--y":"100%","--lift":"-1"}),e.mounted&&(a({"--y":"0","--opacity":"1"}),e.stacked&&a({"--y":"calc(var(--lift) * var(--offset))","--height":"var(--initial-height)"})),t||a({"--opacity":"0",pointerEvents:"none"}),r&&o&&(a({"--base-scale":"var(--index) * 0.05 + 1","--y":"calc(var(--lift-amount) * var(--index))","--scale":"calc(-1 * var(--base-scale))","--height":"var(--first-height)"}),t||a({"--y":"calc(var(--sign) * 40%)"})),r&&e.stacked&&!t&&a({"--y":"calc(var(--lift) * var(--offset) + var(--lift) * -100%)"}),e.frontmost&&!t&&a({"--y":"calc(var(--lift) * -100%)"}),i}function YH(e,t){const n={position:"absolute",inset:"0",scale:"1 2",pointerEvents:t?"none":"auto"};var r;return e.frontmost&&!t&&(r={height:"calc(var(--initial-height) + 80%)"},Object.assign(n,r)),n}var{not:ZH,and:XH,or:QH}=WU;function JH(e,t){VH(e.toasts,e.placement).forEach(t)}var eV={connect:function(e,t,n){function r(){var t;return(t=e)instanceof ZU||"machine"===t?.type?e.getState():e}function o(e){return VH(r().context.toasts,e)}function i(e){const t=r().context.toasts;return!!t.length&&!!t.find(t=>t.id==e)}function a(e){const n=`toast:${a$()}`,r=e.id?e.id:n;return i(r)||t({type:"ADD_TOAST",toast:{...e,id:r}}),r}function s(e,n){return i(e)?(t({type:"UPDATE_TOAST",id:e,toast:n}),e):e}function l(e){const{id:t}=e;return!!t&&i(t)&&null!=t?s(t,e):a(e)}function u(e){null==e?t("DISMISS_ALL"):i(e)&&t({type:"DISMISS_TOAST",id:e})}return{getCount:()=>r().context.count,getPlacements(){const e=r().context.toasts.map(e=>e.state.context.placement);return Array.from(new Set(e))},getToastsByPlacement:o,isVisible:i,create:a,update:s,upsert:l,dismiss:u,remove(e){null==e?t("REMOVE_ALL"):i(e)&&t({type:"REMOVE_TOAST",id:e})},dismissByPlacement(e){o(e).forEach(e=>u(e.id))},loading:e=>l({...e,type:"loading"}),success:e=>l({...e,type:"success"}),error:e=>l({...e,type:"error"}),promise(e,t,n={}){const r=l({...n,...t.loading,type:"loading"});return r$(e).then(e=>{const o=r$(t.success,e);l({...n,...o,id:r,type:"success"})}).catch(e=>{const o=r$(t.error,e);l({...n,...o,id:r,type:"error"})}).finally(()=>{t.finally?.()}),r},pause(e){null==e?t("PAUSE_ALL"):i(e)&&t({type:"PAUSE_TOAST",id:e})},resume(e){null==e?t("RESUME_ALL"):i(e)&&t({type:"RESUME_TOAST",id:e})},getGroupProps(e){const{placement:o,label:i="Notifications"}=e,a=r(),s=a.context.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,""),[l,u="center"]=o.split("-");return n.element({...zH.group.attrs,dir:a.context.dir,tabIndex:-1,"aria-label":`${o} ${i} ${s}`,id:HH.getRegionId(o),"data-placement":o,"data-side":l,"data-align":u,"aria-live":"polite",role:"region",style:GH(a.context,o),onMouseMove(){t({type:"REGION.POINTER_ENTER",placement:o})},onMouseLeave(){t({type:"REGION.POINTER_LEAVE",placement:o})},onFocus(e){t({type:"REGION.FOCUS",target:e.relatedTarget})},onBlur(e){a.context.isFocusWithin&&!xj(e.currentTarget,e.relatedTarget)&&t({type:"REGION.BLUR"})}})},subscribe(e){const t=r();return yU(t.context.toasts,()=>{const n=o(t.context.placement).map(e=>e.getState().context);e(n)})}}},machine:function(e){const t=u$(e);return XU({id:"toaster",initial:t.overlap?"overlap":"stack",context:{dir:"ltr",max:Number.MAX_SAFE_INTEGER,gap:16,pauseOnPageIdle:!1,hotkey:["altKey","KeyT"],offsets:"1rem",placement:"bottom",removeDelay:200,...t,toasts:[],lastFocusedEl:null,isFocusWithin:!1,heights:[]},computed:{count:e=>e.toasts.length},activities:["trackDocumentVisibility","trackHotKeyPress"],watch:{toasts:["collapsedIfEmpty","setDismissableBranch"]},exit:["removeToasts","clearDismissableBranch","clearLastFocusedEl"],on:{PAUSE_TOAST:{actions:["pauseToast"]},PAUSE_ALL:{actions:["pauseToasts"]},RESUME_TOAST:{actions:["resumeToast"]},RESUME_ALL:{actions:["resumeToasts"]},ADD_TOAST:{guard:"isWithinRange",actions:["createToast","syncToastIndex"]},UPDATE_TOAST:{actions:["updateToast"]},DISMISS_TOAST:{actions:["dismissToast"]},DISMISS_ALL:{actions:["dismissToasts"]},REMOVE_TOAST:{actions:["removeToast","syncToastIndex","syncToastOffset"]},REMOVE_ALL:{actions:["removeToasts"]},UPDATE_HEIGHT:{actions:["syncHeights","syncToastOffset"]},"DOC.HOTKEY":{actions:["focusRegionEl"]},"REGION.BLUR":[{guard:"isOverlapping",target:"overlap",actions:["resumeToasts","restoreLastFocusedEl"]},{actions:["resumeToasts","restoreLastFocusedEl"]}]},states:{stack:{entry:["expandToasts"],on:{"REGION.POINTER_LEAVE":[{guard:"isOverlapping",target:"overlap",actions:["resumeToasts"]},{actions:["resumeToasts"]}],"REGION.OVERLAP":{target:"overlap"},"REGION.FOCUS":{actions:["setLastFocusedEl","pauseToasts"]},"REGION.POINTER_ENTER":{actions:["pauseToasts"]}}},overlap:{entry:["collapseToasts"],on:{"REGION.STACK":{target:"stack"},"REGION.POINTER_ENTER":{target:"stack",actions:["pauseToasts"]},"REGION.FOCUS":{target:"stack",actions:["setLastFocusedEl","pauseToasts"]}}}}},{guards:{isWithinRange:e=>e.toasts.length<e.max,isOverlapping:e=>!!e.overlap},activities:{trackHotKeyPress:(e,t,{send:n})=>p$(document,"keydown",t=>{e.hotkey.every(e=>t[e]||t.code===e)&&n({type:"DOC.HOTKEY"})},{capture:!0}),trackDocumentVisibility(e,t,{send:n}){if(!e.pauseOnPageIdle)return;const r=HH.getDoc(e);return p$(r,"visibilitychange",()=>{n("hidden"===r.visibilityState?"PAUSE_ALL":"RESUME_ALL")})}},actions:{setDismissableBranch(e){const t=VH(e.toasts,e.placement).length>0;if(!t)return void e._cleanup?.();if(t&&e._cleanup)return;e._cleanup=function(e,t={}){const{defer:n}=t,r=n?qj:e=>e(),o=[];return o.push(r(()=>{const t=l$(e)?e():e;t?(tH.addBranch(t),o.push(()=>{tH.removeBranch(t)})):d$("[@zag-js/dismissable] branch node is `null` or `undefined`")})),()=>{o.forEach(e=>e?.())}}(()=>HH.getRegionEl(e,e.placement),{defer:!0})},clearDismissableBranch(e){e._cleanup?.()},focusRegionEl(e){queueMicrotask(()=>{HH.getRegionEl(e,e.placement)?.focus()})},expandToasts(e){JH(e,e=>{e.state.context.stacked=!0})},collapseToasts(e){JH(e,e=>{e.state.context.stacked=!1})},collapsedIfEmpty(e,t,{send:n}){!e.overlap||e.toasts.length>1||n("REGION.OVERLAP")},pauseToast(e,t,{self:n}){n.sendChild("PAUSE",t.id)},pauseToasts(e){e.toasts.forEach(e=>e.send("PAUSE"))},resumeToast(e,t,{self:n}){n.sendChild("RESUME",t.id)},resumeToasts(e){e.toasts.forEach(e=>e.send("RESUME"))},measureToasts(e){e.toasts.forEach(e=>e.send("MEASURE"))},createToast(e,t,{self:n,getState:r}){const o=function(e){const{type:t="info",duration:n,id:r="1",placement:o="bottom",removeDelay:i=200,...a}=e,s=u$(a),l=qH(n,t);return XU({id:r,context:{id:r,type:t,remaining:l,duration:l,removeDelay:i,createdAt:Date.now(),placement:o,...s,height:0,offset:0,frontmost:!1,mounted:!1,index:-1,zIndex:0},initial:"loading"===t?"visible:persist":"visible",on:{UPDATE:[{guard:XH("hasTypeChanged","isChangingToLoading"),target:"visible:persist",actions:["setContext"]},{guard:QH("hasDurationChanged","hasTypeChanged"),target:"visible:updating",actions:["setContext"]},{actions:["setContext"]}],MEASURE:{actions:["measureHeight"]}},entry:["invokeOnVisible"],activities:["trackHeight"],states:{"visible:updating":{tags:["visible","updating"],after:{0:"visible"}},"visible:persist":{tags:["visible","paused"],on:{RESUME:{guard:ZH("isLoadingType"),target:"visible",actions:["setCreatedAt"]},DISMISS:"dismissing"}},visible:{tags:["visible"],after:{VISIBLE_DURATION:"dismissing"},on:{DISMISS:"dismissing",PAUSE:{target:"visible:persist",actions:"setRemainingDuration"}}},dismissing:{entry:"invokeOnDismiss",after:{REMOVE_DELAY:{target:"unmounted",actions:"notifyParentToRemove"}}},unmounted:{entry:"invokeOnUnmount",type:"final"}}},{activities:{trackHeight(e,t,{self:n}){let r;return qj(()=>{const t=HH.getRootEl(e);if(!t)return;e.mounted=!0,d$(2!==Kj(t,"[data-ghost]").length,"[toast] No ghost element found in toast. Render the `ghostBefore` and `ghostAfter` elements");const o=()=>{const r=t.style.height;t.style.height="auto";const o=t.getBoundingClientRect().height;t.style.height=r,e.height=o,n.sendParent({type:"UPDATE_HEIGHT",id:n.id,height:o,placement:e.placement})};o();const i=new(HH.getWin(e).MutationObserver)(o);i.observe(t,{childList:!0,subtree:!0,characterData:!0}),r=()=>i.disconnect()}),()=>r?.()}},guards:{isChangingToLoading:(e,t)=>"loading"===t.toast?.type,isLoadingType:e=>"loading"===e.type,hasTypeChanged:(e,t)=>null!=t.toast?.type&&t.toast.type!==e.type,hasDurationChanged:(e,t)=>null!=t.toast?.duration&&t.toast.duration!==e.duration},delays:{VISIBLE_DURATION:e=>e.remaining,REMOVE_DELAY:e=>e.removeDelay},actions:{measureHeight(e,t,{self:n}){qj(()=>{const t=HH.getRootEl(e);if(!t)return;e.mounted=!0;const r=t.style.height;t.style.height="auto";const o=t.getBoundingClientRect().height;t.style.height=r,e.height=o,n.sendParent({type:"UPDATE_HEIGHT",id:n.id,height:o,placement:e.placement})})},setRemainingDuration(e){e.remaining-=Date.now()-e.createdAt},setCreatedAt(e){e.createdAt=Date.now()},notifyParentToRemove(e,t,{self:n}){n.sendParent({type:"REMOVE_TOAST",id:n.id})},invokeOnDismiss(e){e.onStatusChange?.({status:"dismissing"})},invokeOnUnmount(e){e.onStatusChange?.({status:"unmounted"})},invokeOnVisible(e){e.onStatusChange?.({status:"visible"})},setContext(e,t){const n=t.toast?.duration,r=qH(n,t.toast?.type??e.type);Object.assign(e,{...t.toast,duration:r,remaining:r})}}})}({placement:e.placement,duration:e.duration,removeDelay:e.removeDelay,...t.toast,dir:e.dir,getRootNode:e.getRootNode,stacked:r().matches("stack")}),i=n.spawn(o);e.toasts=[i,...e.toasts]},updateToast(e,t,{self:n}){n.sendChild({type:"UPDATE",toast:t.toast},t.id)},dismissToast(e,t,{self:n}){n.sendChild("DISMISS",t.id)},dismissToasts(e){e.toasts.forEach(e=>e.send("DISMISS"))},removeToast(e,t,{self:n}){n.stopChild(t.id),e.toasts=e.toasts.filter(e=>e.id!==t.id),e.heights=e.heights.filter(e=>e.id!==t.id)},removeToasts(e,t,{self:n}){e.toasts.forEach(e=>n.stopChild(e.id)),e.toasts=[],e.heights=[]},syncHeights(e,t){const n=e.heights.find(e=>e.id===t.id);if(n)n.height=t.height,n.placement=t.placement;else{const n={id:t.id,height:t.height,placement:t.placement};e.heights=[n,...e.heights]}},syncToastIndex(e){JH(e,(e,t,n)=>{e.state.context.index=t,e.state.context.frontmost=0===t,e.state.context.zIndex=n.length-t})},syncToastOffset(e,t){const n=t.placement??e.placement;JH({...e,placement:n},t=>{const n=Math.max(e.heights.findIndex(e=>e.id===t.id),0),r=e.heights.reduce((e,t,r)=>r>=n?e:e+t.height,0);t.state.context.offset=n*e.gap+r})},setLastFocusedEl(e,t){!e.isFocusWithin&&t.target&&(e.isFocusWithin=!0,e.lastFocusedEl=wU(t.target))},restoreLastFocusedEl(e){e.isFocusWithin=!1,e.lastFocusedEl&&(e.lastFocusedEl.focus({preventScroll:!0}),e.lastFocusedEl=null)},clearLastFocusedEl(e){e.lastFocusedEl&&(e.lastFocusedEl.focus({preventScroll:!0}),e.lastFocusedEl=null,e.isFocusWithin=!1)}}})}};function tV(e={}){const{strict:t=!0,hookName:n="useContext",providerName:r="Provider",errorMessage:o,defaultValue:i}=e,a=B(i);return[a.Provider,function e(){const i=F(a);if(!i&&t){const t=new Error(o??`${n} returned \`undefined\`. Seems you forgot to wrap component within ${r}`);throw t.name="ContextError",Error.captureStackTrace?.(t,e),t}return i},a]}tV({hookName:"useAccordionContext",providerName:"<AccordionProvider />"});const nV=()=>(e,t)=>se(e,t),[rV,oV]=tV({hookName:"useRenderStrategyContext",providerName:"<RenderStrategyProvider />"}),iV=e=>nV()(e,["lazyMount","unmountOnExit"]),aV=e=>t=>{const[n,r]=se(t,["asChild"]);if(n.asChild){const e=e=>{const[,t]=se(r,["ref"]);return oj(t,e)};return n.asChild(e)}return te($e,ae({component:e},r))};const sV=function(){const e=new Map;return new Proxy(aV,{apply:(e,t,n)=>aV(n[0]),get(t,n){const r=n;return e.has(r)||e.set(r,aV(r)),e.get(r)}})}();tV({hookName:"useCollapsibleContext",providerName:"<CollapsibleProvider />"});const[lV,uV]=tV({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window})});var cV=ke("<span hidden>");const dV=e=>{const[t,n]=S(),r=()=>((e,...t)=>"function"==typeof e?e(...t):e)(e.value)??t()?.ownerDocument??document,o=A(()=>({getRootNode:r,getDocument:()=>kj(r()),getWindow:()=>Cj(r())}));return te(lV,{value:o,get children(){return[A(()=>e.children),te(fe,{get when(){return!e.value},get children(){var e=cV();return Oe(n,e),e}})]}})},[pV,fV]=tV({hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:()=>({dir:"ltr",locale:"en-US"})});tV({hookName:"useAccordionItemContext",providerName:"<AccordionItemProvider />"}),tV({hookName:"useAccordionItemPropsContext",providerName:"<AccordionItemPropsProvider />"}),tV({hookName:"useAvatarContext",providerName:"<AvatarProvider />"}),tV({hookName:"useCarouselContext",providerName:"<CarouselProvider />"}),tV({hookName:"useCheckboxContext",providerName:"<CheckboxProvider />"}),tV({hookName:"useCheckboxGroupContext",providerName:"<CheckboxGroupProvider />",strict:!1}),tV({hookName:"useClipboardContext",providerName:"<ClipboardProvider />"}),tV({hookName:"useColorPickerAreaContext",providerName:"<ColorPickerAreaProvider />"}),tV({hookName:"useColorPickerContext",providerName:"<ColorPickerProvider />"}),tV({hookName:"useColorPickerChannelSliderContext",providerName:"<ColorPickerChannelSliderProvider />"});const hV=e=>nV()(e,["immediate","lazyMount","onExitComplete","present","unmountOnExit"]),gV=e=>{const[t,n]=iV(e),[r,o]=S(!1),[i,a]=bj(XU({initial:(s=n).present?"mounted":"unmounted",context:{node:null,styles:null,unmountAnimationName:null,prevAnimationName:null,present:!1,initial:!1,...s},exit:["clearInitial"],watch:{present:["setInitial","syncPresence"]},on:{"NODE.SET":{actions:["setNode","setStyles"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["invokeOnExitComplete"]},"UNMOUNT.SUSPEND":"unmountSuspended"}},unmountSuspended:{activities:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},"ANIMATION.END":{target:"unmounted",actions:["invokeOnExitComplete"]},UNMOUNT:{target:"unmounted",actions:["invokeOnExitComplete"]}}},unmounted:{entry:["clearPrevAnimationName"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}}},{actions:{setInitial(e){e.initial=!0},clearInitial(e){e.initial=!1},invokeOnExitComplete(e){e.onExitComplete?.()},setNode(e,t){e.node=wU(t.node)},setStyles(e,t){const n=t.node.ownerDocument.defaultView||window;e.styles=wU(n.getComputedStyle(t.node))},syncPresence(e,t,{send:n}){if(e.present)return void n({type:"MOUNT",src:"presence.changed"});const r=iH(e.styles);(e.immediate?queueMicrotask:requestAnimationFrame)(()=>{e.unmountAnimationName=r,"none"===r||r===e.prevAnimationName||"none"===e.styles?.display?n({type:"UNMOUNT",src:"presence.changed"}):n({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName(e){(e.immediate?queueMicrotask:requestAnimationFrame)(()=>{e.prevAnimationName=iH(e.styles)})},clearPrevAnimationName(e){e.prevAnimationName=null}},activities:{trackAnimationEvents(e,t,{send:n}){const r=e.node;if(!r)return;const o=t=>{t.target===r&&(e.prevAnimationName=iH(e.styles))},i=t=>{const o=iH(e.styles);t.target===r&&o===e.unmountAnimationName&&n({type:"UNMOUNT",src:"animationend"})};return r.addEventListener("animationstart",o),r.addEventListener("animationcancel",i),r.addEventListener("animationend",i),()=>{r.removeEventListener("animationstart",o),r.removeEventListener("animationcancel",i),r.removeEventListener("animationend",i)}}}}),{context:n});var s;const l=A(()=>function(e,t){const n=e.matches("mounted","unmountSuspended");return{skip:!e.context.initial&&n,present:n,setNode(e){e&&t({type:"NODE.SET",node:e})},unmount(){t({type:"UNMOUNT"})}}}(i,a));return D(()=>{l().present&&o(!0)}),A(()=>({unmounted:!l().present&&!r()&&t.lazyMount||t.unmountOnExit&&!l().present&&r(),present:l().present,presenceProps:{ref:l().setNode,hidden:!l().present,"data-state":n.present?"open":"closed"}}))},[mV,vV]=tV({hookName:"usePresenceContext",providerName:"<PresenceProvider />"});tV({hookName:"useColorPickerSwatchContext",providerName:"<ColorPickerSwatchProvider />"}),tV({hookName:"useComboboxContext",providerName:"<ComboboxProvider />"}),tV({hookName:"useComboboxItemContext",providerName:"<ComboboxItemProvider />"}),tV({hookName:"useComboboxItemPropsContext",providerName:"<ComboboxItemPropsProvider />"}),tV({hookName:"useComboboxItemGroupPropsContext",providerName:"<ComboboxItemGroupPropsProvider />"}),tV({hookName:"useDatePickerContext",providerName:"<DatePickerProvider />"}),tV({hookName:"useDatePickerViewContext",providerName:"<DatePickerViewProvider />",strict:!1,defaultValue:{view:"day"}}),tV({hookName:"useDatePickerTableContext",providerName:"<DatePickerTableProvider />"}),tV({hookName:"useDatePickerTableCellContext",providerName:"<DatePickerTableCellProvider />"});const[yV,bV]=tV({hookName:"useDialogContext",providerName:"<DialogProvider />"}),wV=e=>{const t=fV(),n=uV(),r=ue(),o=A(()=>({id:r,dir:t().dir,getRootNode:n().getRootNode,open:e.defaultOpen,"open.controlled":void 0!==e.open,...e})),[i,a]=bj(vH(o()),{context:o});return A(()=>function(e,t,n){const r=e.context["aria-label"],o=e.matches("open"),i=e.context.renderedElements;return{open:o,setOpen(e){e!==o&&t(e?"OPEN":"CLOSE")},getTriggerProps:()=>n.button({...gH.trigger.attrs,dir:e.context.dir,id:mH.getTriggerId(e.context),"aria-haspopup":"dialog",type:"button","aria-expanded":o,"data-state":o?"open":"closed","aria-controls":mH.getContentId(e.context),onClick(e){e.defaultPrevented||t("TOGGLE")}}),getBackdropProps:()=>n.element({...gH.backdrop.attrs,dir:e.context.dir,hidden:!o,id:mH.getBackdropId(e.context),"data-state":o?"open":"closed"}),getPositionerProps:()=>n.element({...gH.positioner.attrs,dir:e.context.dir,id:mH.getPositionerId(e.context),style:{pointerEvents:o?void 0:"none"}}),getContentProps:()=>n.element({...gH.content.attrs,dir:e.context.dir,role:e.context.role,hidden:!o,id:mH.getContentId(e.context),tabIndex:-1,"data-state":o?"open":"closed","aria-modal":!0,"aria-label":r||void 0,"aria-labelledby":r||!i.title?void 0:mH.getTitleId(e.context),"aria-describedby":i.description?mH.getDescriptionId(e.context):void 0}),getTitleProps:()=>n.element({...gH.title.attrs,dir:e.context.dir,id:mH.getTitleId(e.context)}),getDescriptionProps:()=>n.element({...gH.description.attrs,dir:e.context.dir,id:mH.getDescriptionId(e.context)}),getCloseTriggerProps:()=>n.button({...gH.closeTrigger.attrs,dir:e.context.dir,id:mH.getCloseTriggerId(e.context),type:"button",onClick(e){e.defaultPrevented||(e.stopPropagation(),t("CLOSE"))}})}}(i,a,pj))};var EV=Object.freeze({__proto__:null,Backdrop:e=>{const t=bV(),n=oV(),r=gV(oj(n,()=>({present:t().open}))),o=oj(()=>t().getBackdropProps(),()=>r().presenceProps,e);return te(fe,{get when(){return!r().unmounted},get children(){return te(sV.div,o)}})},CloseTrigger:e=>{const t=bV(),n=oj(()=>t().getCloseTriggerProps(),e);return te(sV.button,n)},Content:e=>{const t=bV(),n=vV(),r=oj(()=>t().getContentProps(),()=>n().presenceProps,e);return te(fe,{get when(){return!n().unmounted},get children(){return te(sV.div,r)}})},Context:e=>e.children(bV()),Description:e=>{const t=bV(),n=oj(()=>t().getDescriptionProps(),e);return te(sV.div,n)},Positioner:e=>{const t=bV(),n=vV(),r=oj(()=>t().getPositionerProps(),e);return te(fe,{get when(){return!n().unmounted},get children(){return te(sV.div,r)}})},Root:e=>{const[t,n]=hV(e),[r]=iV(t),[o,i]=nV()(n,["aria-label","closeOnEscape","closeOnInteractOutside","defaultOpen","finalFocusEl","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]),a=wV(o),s=gV(oj(t,()=>({present:a().open})));return te(yV,{value:a,get children(){return te(rV,{value:r,get children(){return te(mV,{value:s,get children(){return i.children}})}})}})},RootProvider:e=>{const[t,n]=hV(e),[r]=iV(t),o=gV(oj(t,()=>({present:n.value().open})));return te(yV,{get value(){return n.value},get children(){return te(rV,{value:r,get children(){return te(mV,{value:o,get children(){return n.children}})}})}})},Title:e=>{const t=bV(),n=oj(()=>t().getTitleProps(),e);return te(sV.h2,n)},Trigger:e=>{const t=bV(),n=vV(),r=oj(()=>t().getTriggerProps(),()=>({"aria-controls":n().unmounted&&null}),e);return te(sV.button,r)}});tV({hookName:"useEditableContext",providerName:"<EditableProvider />"}),tV({hookName:"useFileUploadContext",providerName:"<FileUploadProvider />"}),tV({hookName:"useFileUploadItemPropsContext",providerName:"<FileUploadItemPropsProvider />"}),tV({hookName:"useHoverCardContext",providerName:"<HoverCardProvider />"});const[_V,xV]=tV({hookName:"useMenuContext",providerName:"<MenuProvider />",strict:!1}),[kV,CV]=tV({hookName:"useMenuItemContext",providerName:"<MenuItemProvider />"}),[SV,TV]=tV({hookName:"useMenuOptionItemPropsContext",providerName:"<MenuOptionItemPropsProvider />"}),[DV,AV]=tV({hookName:"useMenuItemGroupContext",providerName:"<MenuItemGroupProvider />"}),OV=e=>{const t=fV(),n=uV(),r=ue(),o=A(()=>({id:r,dir:t().dir,getRootNode:n().getRootNode,open:e.defaultOpen,"open.controlled":void 0!==e.open,...e})),[i,a,s]=bj(function(e){const t=u$(e);return XU({id:"menu",initial:t.open?"open":"idle",context:{highlightedValue:null,loopFocus:!1,anchorPoint:null,closeOnSelect:!0,typeahead:!0,composite:!0,...t,positioning:{placement:"bottom-start",gutter:8,...t.positioning},intentPolygon:null,parent:null,lastHighlightedValue:null,children:wU({}),suspendPointer:!1,restoreFocus:!0,typeaheadState:Fj.defaultOptions},computed:{isSubmenu:e=>null!==e.parent,isRtl:e=>"rtl"===e.dir,isTypingAhead:e=>""!==e.typeaheadState.keysSoFar},watch:{isSubmenu:"setSubmenuPlacement",anchorPoint:"reposition",open:"toggleVisibility"},on:{"PARENT.SET":{actions:"setParentMenu"},"CHILD.SET":{actions:"setChildMenu"},OPEN:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}],OPEN_AUTOFOCUS:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{internal:!0,target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],CLOSE:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}],"HIGHLIGHTED.RESTORE":{actions:"restoreHighlightedItem"},"HIGHLIGHTED.SET":{actions:"setHighlightedItem"}},states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":"closed",CONTEXT_MENU_START:{target:"opening:contextmenu",actions:"setAnchorPoint"},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}],TRIGGER_FOCUS:{guard:SH("isSubmenu"),target:"closed"},TRIGGER_POINTERMOVE:{guard:"isSubmenu",target:"opening"}}},"opening:contextmenu":{tags:["closed"],after:{LONG_PRESS_DELAY:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}]},on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":"closed",CONTEXT_MENU_CANCEL:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}]}},opening:{tags:["closed"],after:{SUBMENU_OPEN_DELAY:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}]},on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":"closed",BLUR:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}],TRIGGER_POINTERLEAVE:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:"invokeOnClose"}]}},closing:{tags:["open"],activities:["trackPointerMove","trackInteractOutside"],after:{SUBMENU_CLOSE_DELAY:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["focusParentMenu","restoreParentHiglightedItem","invokeOnClose"]}]},on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":{target:"closed",actions:["focusParentMenu","restoreParentHiglightedItem"]},MENU_POINTERENTER:{target:"open",actions:"clearIntentPolygon"},POINTER_MOVED_AWAY_FROM_SUBMENU:[{guard:"isOpenControlled",actions:"invokeOnClose"},{target:"closed",actions:["focusParentMenu","restoreParentHiglightedItem"]}]}},closed:{tags:["closed"],entry:["clearHighlightedItem","focusTrigger","clearAnchorPoint","resumePointer"],on:{"CONTROLLED.OPEN":[{guard:DH("isOpenAutoFocusEvent","isArrowDownEvent"),target:"open",actions:"highlightFirstItem"},{guard:"isArrowUpEvent",target:"open",actions:"highlightLastItem"},{target:"open"}],CONTEXT_MENU_START:{target:"opening:contextmenu",actions:"setAnchorPoint"},CONTEXT_MENU:[{guard:"isOpenControlled",actions:["setAnchorPoint","invokeOnOpen"]},{target:"open",actions:["setAnchorPoint","invokeOnOpen"]}],TRIGGER_CLICK:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:"invokeOnOpen"}],TRIGGER_POINTERMOVE:{guard:"isTriggerItem",target:"opening"},TRIGGER_BLUR:"idle",ARROW_DOWN:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:["highlightFirstItem","invokeOnOpen"]}],ARROW_UP:[{guard:"isOpenControlled",actions:"invokeOnOpen"},{target:"open",actions:["highlightLastItem","invokeOnOpen"]}]}},open:{tags:["open"],activities:["trackInteractOutside","trackPositioning","scrollToHighlightedItem"],entry:["focusMenu","resumePointer"],on:{"CONTROLLED.CLOSE":[{target:"closed",guard:"isArrowLeftEvent",actions:["focusParentMenu"]},{target:"closed"}],TRIGGER_CLICK:[{guard:TH(SH("isTriggerItem"),"isOpenControlled"),actions:"invokeOnClose"},{guard:SH("isTriggerItem"),target:"closed",actions:"invokeOnClose"}],ARROW_UP:{actions:["highlightPrevItem","focusMenu"]},ARROW_DOWN:{actions:["highlightNextItem","focusMenu"]},ARROW_LEFT:[{guard:TH("isSubmenu","isOpenControlled"),actions:"invokeOnClose"},{guard:"isSubmenu",target:"closed",actions:["focusParentMenu","invokeOnClose"]}],HOME:{actions:["highlightFirstItem","focusMenu"]},END:{actions:["highlightLastItem","focusMenu"]},ARROW_RIGHT:{guard:"isTriggerItemHighlighted",actions:"openSubmenu"},ENTER:[{guard:"isTriggerItemHighlighted",actions:"openSubmenu"},{guard:TH("closeOnSelect","isOpenControlled"),actions:["clickHighlightedItem","invokeOnClose"]},{guard:"closeOnSelect",target:"closed",actions:"clickHighlightedItem"},{actions:"clickHighlightedItem"}],ITEM_POINTERMOVE:[{guard:SH("suspendPointer"),actions:["setHighlightedItem","focusMenu"]},{actions:"setLastHighlightedItem"}],ITEM_POINTERLEAVE:{guard:TH(SH("suspendPointer"),SH("isTriggerItem")),actions:"clearHighlightedItem"},ITEM_CLICK:[{guard:TH(SH("isTriggerItemHighlighted"),SH("isHighlightedItemEditable"),"closeOnSelect","isOpenControlled"),actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:TH(SH("isTriggerItemHighlighted"),SH("isHighlightedItemEditable"),"closeOnSelect"),target:"closed",actions:["invokeOnSelect","setOptionState","closeRootMenu","invokeOnClose"]},{guard:TH(SH("isTriggerItemHighlighted"),SH("isHighlightedItemEditable")),actions:["invokeOnSelect","setOptionState"]},{actions:"setHighlightedItem"}],TRIGGER_POINTERLEAVE:{target:"closing",actions:"setIntentPolygon"},ITEM_POINTERDOWN:{actions:"setHighlightedItem"},TYPEAHEAD:{actions:"highlightMatchedItem"},FOCUS_MENU:{actions:"focusMenu"},"POSITIONING.SET":{actions:"reposition"}}}}},{delays:{LONG_PRESS_DELAY:700,SUBMENU_OPEN_DELAY:100,SUBMENU_CLOSE_DELAY:100},guards:{closeOnSelect:(e,t)=>!!(t?.closeOnSelect??e.closeOnSelect),isTriggerItem:(e,t)=>kH.isTriggerItem(t.target),isTriggerItemHighlighted:(e,t)=>{const n=t.target??kH.getHighlightedItemEl(e);return!!n?.hasAttribute("aria-controls")},isSubmenu:e=>e.isSubmenu,suspendPointer:e=>e.suspendPointer,isHighlightedItemEditable:e=>Vj(kH.getHighlightedItemEl(e)),isWithinPolygon:(e,t)=>!!e.intentPolygon&&function(e,t){const{x:n,y:r}=t;let o=!1;for(let t=0,i=e.length-1;t<e.length;i=t++){const a=e[t].x,s=e[t].y,l=e[i].x,u=e[i].y;s>r!=u>r&&n<(l-a)*(r-s)/(u-s)+a&&(o=!o)}return o}(e.intentPolygon,t.point),isOpenControlled:e=>!!e["open.controlled"],isArrowLeftEvent:(e,t)=>"ARROW_LEFT"===t.previousEvent?.type,isArrowUpEvent:(e,t)=>"ARROW_UP"===t.previousEvent?.type,isArrowDownEvent:(e,t)=>"ARROW_DOWN"===t.previousEvent?.type,isOpenAutoFocusEvent:(e,t)=>"OPEN_AUTOFOCUS"===t.previousEvent?.type},activities:{trackPositioning(e){if(!e.anchorPoint)return e.currentPlacement=e.positioning.placement,Wz(kH.getTriggerEl(e),()=>kH.getPositionerEl(e),{...e.positioning,defer:!0,onComplete(t){e.currentPlacement=t.placement}})},trackInteractOutside:(e,t,{send:n})=>oH(()=>kH.getContentEl(e),{defer:!0,exclude:[kH.getTriggerEl(e)],onInteractOutside:e.onInteractOutside,onFocusOutside:e.onFocusOutside,onEscapeKeyDown(t){e.onEscapeKeyDown?.(t),e.isSubmenu&&t.preventDefault(),AH(e)},onPointerDownOutside(t){e.restoreFocus=!t.detail.focusable,e.onPointerDownOutside?.(t)},onDismiss(){n({type:"CLOSE",src:"interact-outside"})}}),trackPointerMove(e,t,{guards:n,send:r}){const{isWithinPolygon:o}=n;e.parent.state.context.suspendPointer=!0;const i=kH.getDoc(e);return p$(i,"pointermove",t=>{const n={x:t.clientX,y:t.clientY};o(e,{point:n})||(r("POINTER_MOVED_AWAY_FROM_SUBMENU"),e.parent.state.context.suspendPointer=!1)})},scrollToHighlightedItem(e,t,{getState:n}){const r=()=>{n().event.type.startsWith("ITEM_POINTER")||Zj(kH.getHighlightedItemEl(e),{rootEl:kH.getContentEl(e),block:"nearest"})};return qj(()=>r()),Gj(()=>kH.getContentEl(e),{attributes:["aria-activedescendant"],callback:r})}},actions:{setAnchorPoint(e,t){e.anchorPoint=t.point},clearAnchorPoint(e){e.anchorPoint=null},setSubmenuPlacement(e){e.isSubmenu&&(e.positioning.placement=e.isRtl?"left-start":"right-start",e.positioning.gutter=0)},reposition(e,t){const n=e.anchorPoint?()=>({width:0,height:0,...e.anchorPoint}):void 0;Wz(kH.getTriggerEl(e),()=>kH.getPositionerEl(e),{...e.positioning,getAnchorRect:n,...t.options??{},listeners:!1,onComplete(t){e.currentPlacement=t.placement}})},setOptionState(e,t){if(!t.option)return;const{checked:n,onCheckedChange:r,type:o}=t.option;"radio"===o?r?.(!0):"checkbox"===o&&r?.(!n)},clickHighlightedItem(e,t,{send:n}){const r=kH.getHighlightedItemEl(e);if(!r||r.dataset.disabled)return;const o=kH.getOptionFromItemEl(r);n({type:"ITEM_CLICK",src:"enter",target:r,id:o.id,option:o,closeOnSelect:e.closeOnSelect})},setIntentPolygon(e,t){const n=kH.getContentEl(e),r=e.currentPlacement;if(!n||!r)return;const o=_H(n.getBoundingClientRect(),r);if(!o)return;const i="right"===function(e){return e.split("-")[0]}(r),a=i?-5:5;e.intentPolygon=[{...t.point,x:t.point.x+a},...o]},clearIntentPolygon(e){e.intentPolygon=null},resumePointer(e){e.parent&&(e.parent.state.context.suspendPointer=!1)},setHighlightedItem(e,t){OH.highlighted(e,t.id)},clearHighlightedItem(e){OH.highlighted(e,null)},focusMenu(e){qj(()=>{const t=kH.getContentEl(e),n=zj({root:t,enabled:!xj(t,kH.getActiveElement(e)),filter:e=>!e.role?.startsWith("menuitem")});n?.focus({preventScroll:!0})})},highlightFirstItem(e){const t=kH.getFirstEl(e);t&&OH.highlighted(e,t.id)},highlightLastItem(e){const t=kH.getLastEl(e);t&&OH.highlighted(e,t.id)},highlightNextItem(e,t){const n=kH.getNextEl(e,t.loop);OH.highlighted(e,n?.id??null)},highlightPrevItem(e,t){const n=kH.getPrevEl(e,t.loop);OH.highlighted(e,n?.id??null)},invokeOnSelect(e){e.highlightedValue&&e.onSelect?.({value:e.highlightedValue})},focusTrigger(e){e.isSubmenu||e.anchorPoint||!e.restoreFocus||qj(()=>kH.getTriggerEl(e)?.focus({preventScroll:!0}))},highlightMatchedItem(e,t){const n=kH.getElemByKey(e,t.key);n&&OH.highlighted(e,n.id)},setParentMenu(e,t){e.parent=wU(t.value)},setChildMenu(e,t){e.children[t.id]=wU(t.value)},closeRootMenu(e){AH(e)},openSubmenu(e){const t=kH.getHighlightedItemEl(e),n=t?.getAttribute("data-uid"),r=n?e.children[n]:null;r?.send("OPEN_AUTOFOCUS")},focusParentMenu(e){e.parent?.send("FOCUS_MENU")},setLastHighlightedItem(e,t){e.lastHighlightedValue=t.id},restoreHighlightedItem(e){e.lastHighlightedValue&&(OH.highlighted(e,e.lastHighlightedValue),e.lastHighlightedValue=null)},restoreParentHiglightedItem(e){e.parent?.send("HIGHLIGHTED.RESTORE")},invokeOnOpen(e){e.onOpenChange?.({open:!0})},invokeOnClose(e){e.onOpenChange?.({open:!1})},toggleVisibility(e,t,{send:n}){n({type:e.open?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:t})}}})}(o()),{context:o});return{api:A(()=>CH(i,a,pj)),machine:s}},[PV,IV]=tV({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:!1}),[NV,RV]=tV({hookName:"useMenuMachineContext",providerName:"<MenuMachineProvider />",strict:!1});var BV=Object.freeze({__proto__:null,Arrow:e=>{const t=xV(),n=oj(()=>t().getArrowProps(),e);return te(sV.div,n)},ArrowTip:e=>{const t=xV(),n=oj(()=>t().getArrowTipProps(),e);return te(sV.div,n)},CheckboxItem:e=>{const[t,n]=nV()(e,["checked","closeOnSelect","disabled","onCheckedChange","value","valueText"]),r=oj(t,{type:"checkbox"}),o=xV(),i=oj(()=>o().getOptionItemProps(r),n),a=A(()=>o().getItemState(r));return te(SV,{value:r,get children(){return te(kV,{value:a,get children(){return te(sV.div,i)}})}})},Content:e=>{const t=xV(),n=vV(),r=oj(()=>t().getContentProps(),()=>n().presenceProps,e);return te(fe,{get when(){return!n().unmounted},get children(){return te(sV.div,r)}})},Context:e=>e.children(xV()),ContextTrigger:e=>{const t=xV(),n=oj(()=>t().getContextTriggerProps(),e);return te(sV.button,n)},Indicator:e=>{const t=xV(),n=oj(()=>t().getIndicatorProps(),e);return te(sV.div,n)},Item:e=>{const[t,n]=nV()(e,["closeOnSelect","disabled","value","valueText"]),r=xV(),o=oj(()=>r().getItemProps(t),n),i=A(()=>r().getItemState(t));return te(kV,{value:i,get children(){return te(sV.div,o)}})},ItemContext:e=>e.children(CV()),ItemGroup:e=>{const[t,n]=nV()(e,["id"]),r=oj({id:ue()},t),o=xV(),i=oj(()=>o().getItemGroupProps(r),n);return te(DV,{value:r,get children(){return te(sV.div,i)}})},ItemGroupLabel:e=>{const t=xV(),n=AV(),r=oj(t().getItemGroupLabelProps({htmlFor:n.id}),e);return te(sV.div,r)},ItemIndicator:e=>{const t=xV(),n=TV(),r=oj(()=>t().getItemIndicatorProps(n),e);return te(sV.div,r)},ItemText:e=>{const t=xV(),n=TV(),r=oj(()=>t().getItemTextProps(n),e);return te(sV.div,r)},Positioner:e=>{const t=xV(),n=vV(),r=oj(()=>t().getPositionerProps(),e);return te(fe,{get when(){return!n().unmounted},get children(){return te(sV.div,r)}})},RadioItem:e=>{const[t,n]=nV()(e,["closeOnSelect","disabled","value","valueText"]),r=xV(),o=AV(),i=oj(t,()=>({type:"radio",checked:o.value===t.value,onCheckedChange:()=>o.onValueChange?.({value:t.value})})),a=oj(()=>r().getOptionItemProps(i),n),s=A(()=>r().getItemState(i));return te(SV,{value:i,get children(){return te(kV,{value:s,get children(){return te(sV.div,a)}})}})},RadioItemGroup:e=>{const[t,n]=nV()(e,["id","onValueChange","value"]),r=xV(),o=oj({id:ue()},t),i=oj(()=>r().getItemGroupProps(o),n);return te(DV,{value:o,get children(){return te(sV.div,i)}})},Root:e=>{const[t,n]=hV(e),[r,o]=nV()(n,["anchorPoint","aria-label","closeOnSelect","composite","defaultOpen","highlightedValue","id","ids","loopFocus","onEscapeKeyDown","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","open","positioning","typeahead"]),i=xV(),a=IV(),s=OV(r),l=gV(oj(t,()=>({present:s.api().open})));D(()=>{a&&(i?.().setChild(s.machine),s.api().setParent(a))});return te(NV,{value:()=>i?.().getTriggerItemProps(s.api()),get children(){return te(PV,{get value(){return s.machine},get children(){return te(_V,{get value(){return s.api},get children(){return te(mV,{value:l,get children(){return o.children}})}})}})}})},RootProvider:e=>{const t=xV(),n=IV(),[r,o]=hV(e),i=gV(oj(r,()=>({present:o.value.api().open})));D(()=>{n&&(t?.().setChild(o.value.machine),o.value.api().setParent(n))});return te(NV,{value:()=>t?.().getTriggerItemProps(o.value.api()),get children(){return te(PV,{get value(){return o.value.machine},get children(){return te(_V,{get value(){return o.value.api},get children(){return te(mV,{value:i,get children(){return o.children}})}})}})}})},Separator:e=>{const t=xV(),n=oj(()=>t().getSeparatorProps(),e);return te(sV.hr,n)},Trigger:e=>{const t=xV(),n=vV(),r=oj(()=>t().getTriggerProps(),()=>({"aria-controls":n().unmounted&&null}),e);return te(sV.button,r)},TriggerItem:e=>{const t=RV(),n=oj(()=>t?.(),e);return te(sV.div,n)}});tV({hookName:"useNumberInputContext",providerName:"<NumberInputProvider />"}),tV({hookName:"usePaginationContext",providerName:"<PaginationProvider />"}),tV({hookName:"usePinInputContext",providerName:"<PinInputProvider />"}),tV({hookName:"usePopoverContext",providerName:"<PopoverProvider />"});const[FV,LV]=tV({hookName:"useProgressContext",providerName:"<ProgressProvider />"}),MV=e=>{const t=fV(),n=uV(),r=ue(),o=A(()=>({id:r,dir:t().dir,getRootNode:n().getRootNode,...e})),[i,a]=bj(LH(o()),{context:o});return A(()=>function(e,t,n){const r=e.context.percent,o=e.context.max,i=e.context.min,a=e.context.orientation,s=e.context.translations,l=e.context.isIndeterminate,u=e.context.value,c=s.value({value:u,max:o,percent:r,min:i}),d=function(e,t){return null==e?"indeterminate":e===t?"complete":"loading"}(u,o),p={role:"progressbar","aria-label":c,"data-max":o,"aria-valuemin":i,"aria-valuemax":o,"aria-valuenow":u??void 0,"data-orientation":a,"data-state":d},f=function(e){const t={style:{"--radius":"calc(var(--size) / 2 - var(--thickness) / 2)",cx:"calc(var(--size) / 2)",cy:"calc(var(--size) / 2)",r:"var(--radius)",fill:"transparent",strokeWidth:"var(--thickness)"}};return{root:{viewBox:"0 0 var(--size) var(--size)",style:{width:"var(--size)",height:"var(--size)"}},track:t,range:{opacity:0===e.value?0:void 0,style:{...t.style,"--percent":e.percent,"--circumference":"calc(2 * 3.14159 * var(--radius))","--offset":"calc(var(--circumference) * (100 - var(--percent)) / 100}))",strokeDashoffset:"calc(var(--circumference) * ((100 - var(--percent)) / 100))",strokeDasharray:e.isIndeterminate?void 0:"var(--circumference)",transformOrigin:"center",transform:"rotate(-90deg)"}}}}(e.context);return{value:u,valueAsString:c,setValue(e){t({type:"VALUE.SET",value:e})},setToMax(){t({type:"VALUE.SET",value:o})},getRootProps:()=>n.element({dir:e.context.dir,...RH.root.attrs,id:BH.getRootId(e.context),"data-max":o,"data-value":u??void 0,"data-state":d,"data-orientation":a,style:{"--percent":l?void 0:r}}),getLabelProps:()=>n.element({dir:e.context.dir,id:BH.getLabelId(e.context),...RH.label.attrs,"data-orientation":a}),getValueTextProps:()=>n.element({dir:e.context.dir,"aria-live":"polite",...RH.valueText.attrs}),getTrackProps:()=>n.element({dir:e.context.dir,id:BH.getTrackId(e.context),...RH.track.attrs,...p}),getRangeProps:()=>n.element({dir:e.context.dir,...RH.range.attrs,"data-orientation":a,"data-state":d,style:{[e.context.isHorizontal?"width":"height"]:l?void 0:`${r}%`}}),getCircleProps:()=>n.element({dir:e.context.dir,id:BH.getCircleId(e.context),...RH.circle.attrs,...p,...f.root}),getCircleTrackProps:()=>n.element({dir:e.context.dir,"data-orientation":a,...RH.circleTrack.attrs,...f.track}),getCircleRangeProps:()=>n.element({dir:e.context.dir,...RH.circleRange.attrs,...f.range,"data-state":d}),getViewProps:t=>n.element({dir:e.context.dir,...RH.view.attrs,"data-state":t.state,hidden:t.state!==d})}}(i,a,pj))};var UV=Object.freeze({__proto__:null,Circle:e=>{const t=LV(),n=oj(()=>t().getCircleProps(),e);return te(sV.svg,n)},CircleRange:e=>{const t=LV(),n=oj(()=>t().getCircleRangeProps(),e);return te(sV.circle,n)},CircleTrack:e=>{const t=LV(),n=oj(()=>t().getCircleTrackProps(),e);return te(sV.circle,n)},Context:e=>e.children(LV()),Label:e=>{const t=LV(),n=oj(()=>t().getLabelProps(),e);return te(sV.label,n)},Range:e=>{const t=LV(),n=oj(()=>t().getRangeProps(),e);return te(sV.div,n)},Root:e=>{const[t,n]=nV()(e,["id","ids","max","min","orientation","translations","value"]),r=MV(t),o=oj(()=>r().getRootProps(),n);return te(FV,{value:r,get children(){return te(sV.div,o)}})},RootProvider:e=>{const[{value:t},n]=nV()(e,["value"]),r=oj(()=>t().getRootProps(),n);return te(FV,{value:t,get children(){return te(sV.div,r)}})},Track:e=>{const t=LV(),n=oj(()=>t().getTrackProps(),e);return te(sV.div,n)},ValueText:e=>{const t=LV(),n=oj(()=>t().getValueTextProps(),e);return te(sV.span,ae(n,{get children(){return e.children||t().valueAsString}}))},View:e=>{const[t,n]=nV()(e,["state"]),r=LV(),o=oj(()=>r().getViewProps(t),n);return te(sV.span,o)}});tV({hookName:"useQrCodeContext",providerName:"<QrCodeProvider />"}),tV({hookName:"useRadioGroupContext",providerName:"<RadioGroupProvider />"}),tV({hookName:"useRadioGroupItemContext",providerName:"<RadioGroupItemProvider />"}),tV({hookName:"useRadioGroupItemPropsContext",providerName:"<RadioGroupItemPropsProvider />"}),tV({hookName:"useRatingGroupContext",providerName:"<RatingGroupProvider />"}),tV({hookName:"useRatingGroupItemContext",providerName:"<RatingGroupItemProvider />"}),tV({hookName:"useSegmentGroupContext",providerName:"<SegmentGroupProvider />"}),tV({hookName:"useSegmentGroupItemContext",providerName:"<SegmentGroupItemProvider />"}),tV({hookName:"useSegmentGroupItemPropsContext",providerName:"<SegmentGroupItemPropsProvider />"}),tV({hookName:"useSelectContext",providerName:"<SelectProvider />"}),tV({hookName:"useSelectItemContext",providerName:"<SelectItemProvider />"}),tV({hookName:"useSelectItemPropsContext",providerName:"<SelectItemPropsProvider />"}),tV({hookName:"useSelectItemGroupPropsContext",providerName:"<SelectItemGroupPropsProvider />"}),tV({hookName:"useSignaturePadContext",providerName:"<SignaturePadProvider />"});var jV=(e,t=[])=>({parts:(...n)=>{if(zV(t))return jV(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>jV(e,[...t,...n]),rename:e=>jV(e,t),keys:()=>t,build:()=>[...new Set(t)].reduce((t,n)=>Object.assign(t,{[n]:{selector:[`&[data-scope="${$V(e)}"][data-part="${$V(n)}"]`,`& [data-scope="${$V(e)}"][data-part="${$V(n)}"]`].join(", "),attrs:{"data-scope":$V(e),"data-part":$V(n)}}}),{})}),$V=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),zV=e=>0===e.length;function HV(e,t){const n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0;return n?(n[e]||(n[e]=t()),n[e]):t()}HV("__zag__proxyStateMap",()=>new WeakMap),HV("__zag__refSet",()=>new WeakSet),jV("signature-pad").parts("root","control","segment","segmentPath","guide","clearTrigger","label").build();var VV=Yj({getRootId:e=>e.ids?.root??`signature-${e.id}`,getControlId:e=>e.ids?.control??`signature-control-${e.id}`,getHiddenInputId:e=>e.ids?.hiddenInput??`signature-input-${e.id}`,getControlEl:e=>VV.getById(e,VV.getControlId(e)),getSegmentEl:e=>function(e,t){return e?.querySelector(t)??null}(VV.getControlEl(e),"[data-part=segment]"),getHiddenInputEl:e=>VV.getById(e,VV.getHiddenInputId(e)),getDataUrl:(e,t)=>e.isEmpty?Promise.resolve(""):function(e,t){const{type:n,quality:r=.92}=t;if(!e)throw new Error("[get-data-url]: could not find the svg element");const o=Cj(e),i=o.document,a='<?xml version="1.0" standalone="no"?>\r\n'+(new o.XMLSerializer).serializeToString(e),s="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(a);if("image/svg+xml"===n)return Promise.resolve(s);const l=e.getBoundingClientRect(),u=o.devicePixelRatio||1,c=i.createElement("canvas"),d=new o.Image;d.src=s,c.width=l.width*u,c.height=l.height*u;const p=c.getContext("2d");return p.scale(u,u),new Promise(e=>{d.onload=()=>{p.drawImage(d,0,0),e(c.toDataURL(n,r))}})}(VV.getSegmentEl(e),t)});rj()(["dir","disabled","getRootNode","id","ids","onDraw","onDrawEnd","readOnly","drawing","name"]),tV({hookName:"useSliderContext",providerName:"<SliderProvider />"}),tV({hookName:"useSliderThumbPropsContext",providerName:"<SliderThumbPropsProvider />"}),tV({hookName:"useSplitterContext",providerName:"<SplitterProvider />"}),tV({hookName:"useSwitchContext",providerName:"<SwitchProvider />"}),tV({hookName:"useTabsContext",providerName:"<TabsProvider />"}),tV({hookName:"useTagsInputContext",providerName:"<TagsInputProvider />"}),tV({hookName:"useTagsInputItemContext",providerName:"<TagsInputItemProvider />"}),tV({hookName:"useTagsInputItemPropsContext",providerName:"<TagsInputItemPropsProvider />"});const[WV,qV]=tV({hookName:"useToastContext",providerName:"<ToastProvider />"});var GV=ke("<div><div></div><div>");const KV=e=>{const[t,n]=se(e,["toaster","children"]),[r,o]=bj(t.toaster.machine),i=r.context.placement,a=A(()=>eV.connect(r,o,pj)),s=A(()=>a().getToastsByPlacement(i)),l=oj(a().getGroupProps({placement:i}),n);return te(sV.div,ae(l,{get children(){return te(de,{get each(){return s()},children:e=>te(YV,{value:e,children:e=>t.children(e)})})}}))},YV=e=>{const[t,n]=[yj(r=e.value),r.send];var r;const o=A(()=>function(e,t,n){const r=e.hasTag("visible"),o=e.hasTag("paused"),i=e.context.placement,a=e.context.type,[s,l="center"]=i.split("-");return{type:a,title:e.context.title,description:e.context.description,placement:i,visible:r,paused:o,pause(){t("PAUSE")},resume(){t("RESUME")},dismiss(){t("DISMISS")},getRootProps:()=>n.element({...zH.root.attrs,dir:e.context.dir,id:HH.getRootId(e.context),"data-state":r?"open":"closed","data-type":a,"data-placement":i,"data-align":l,"data-side":s,"data-mounted":wj(e.context.mounted),"data-paused":wj(o),"data-first":wj(e.context.frontmost),"data-sibling":wj(!e.context.frontmost),"data-stack":wj(e.context.stacked),"data-overlap":wj(!e.context.stacked),role:"status","aria-atomic":"true",tabIndex:0,style:KH(e.context,r),onKeyDown(e){e.defaultPrevented||"Escape"==e.key&&(t("DISMISS"),e.preventDefault())}}),getGhostBeforeProps:()=>n.element({"data-ghost":"before",style:YH(e.context,r)}),getGhostAfterProps:()=>n.element({"data-ghost":"after",style:(e.context,{position:"absolute",left:"0",height:"calc(var(--gap) + 2px)",bottom:"100%",width:"100%"})}),getTitleProps:()=>n.element({...zH.title.attrs,id:HH.getTitleId(e.context)}),getDescriptionProps:()=>n.element({...zH.description.attrs,id:HH.getDescriptionId(e.context)}),getActionTriggerProps:()=>n.button({...zH.actionTrigger.attrs,type:"button",onClick(e){e.defaultPrevented||t("DISMISS")}}),getCloseTriggerProps:()=>n.button({id:HH.getCloseTriggerId(e.context),...zH.closeTrigger.attrs,type:"button","aria-label":"Dismiss notification",onClick(e){e.defaultPrevented||t("DISMISS")}})}}(t,n,pj)),i=A(()=>t.context);return te(WV,{value:o,get children(){return e.children(i)}})};var ZV=Object.freeze({__proto__:null,ActionTrigger:e=>{const t=qV(),n=oj(()=>t().getActionTriggerProps(),e);return te(sV.button,n)},CloseTrigger:e=>{const t=qV(),n=oj(()=>t().getCloseTriggerProps(),e);return te(sV.button,n)},Context:e=>e.children(qV()),Description:e=>{const t=qV(),n=oj(()=>t().getDescriptionProps(),e);return te(sV.div,n)},Root:e=>{const t=qV(),n=oj(()=>t().getRootProps(),e);return r=GV(),o=r.firstChild,i=o.nextSibling,Ae(r,n,!1,!0),Ae(o,ae(()=>t().getGhostBeforeProps()),!1,!1),Pe(r,()=>e.children,i),Ae(i,ae(()=>t().getGhostAfterProps()),!1,!1),r;var r,o,i},Title:e=>{const t=qV(),n=oj(()=>t().getTitleProps(),e);return te(sV.div,n)}});tV({hookName:"useToggleGroupContext",providerName:"<ToggleGroupProvider />"}),tV({hookName:"useTooltipContext",providerName:"<TooltipProvider />"}),tV({hookName:"useTreeViewBranchContext",providerName:"<TreeViewBranchProvider />"}),tV({hookName:"useTreeViewContext",providerName:"<TreeViewProvider />"}),tV({hookName:"useTreeViewDepthContext",providerName:"<TreeViewDepthProvider />"}),tV({hookName:"useTreeViewItemContext",providerName:"<TreeViewItemProvider />"}),tV({hookName:"useTreeViewItemPropsContext",providerName:"<TreeViewItemProvider />"});const XV=e=>te(EV.Root,{get open(){return e.isOpen},lazyMount:!0,unmountOnExit:!0,onOpenChange:t=>t.open?void 0:e.onClose?.(),get children(){return[te(EV.Backdrop,{class:"fixed inset-0 bg-[rgba(0,0,0,0.5)] h-screen z-50"}),te(EV.Positioner,{class:"fixed inset-0 z-50 flex items-center justify-center px-2",get children(){return[te(EV.Content,{get children(){return e.children}}),te(EV.CloseTrigger,{class:"fixed top-2 right-2 z-50 rounded-md bg-white p-2 text-black",get children(){return te(ft,{class:"w-4"})}})]}})]}}),QV=ke('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2px" stroke-linecap="round" stroke-linejoin="round"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4">'),JV=e=>(()=>{const t=QV();return Ae(t,e,!0,!0),t})(),eW=ke('<div class="flex items-center gap-4 border bg-white border-gray-200 rounded-md p-2 text-gray-900 min-w-[250px]"><div></div><div class="flex flex-col"><span class="text-md font-normal text-sm"></span><span class="text-gray-500 text-xs">'),tW=e=>{const t=rW(e.file);return(()=>{const n=eW(),r=n.firstChild,o=r.nextSibling.firstChild,i=o.nextSibling;return Pe(r,te(JV,{class:"w-6 h-6"})),Pe(o,()=>e.file.name),Pe(i,()=>nW(e.file)),T(()=>Te(r,tt("rounded-md text-white p-2 flex items-center","pink"===t&&"bg-pink-400","blue"===t&&"bg-blue-400","green"===t&&"bg-green-400","gray"===t&&"bg-gray-400","orange"===t&&"bg-orange-400"))),n})()},nW=e=>{switch(e.name.split(".").pop()){case"pdf":return"PDF";case"doc":case"docx":return"Word";case"xls":case"xlsx":case"csv":return"Sheet";case"json":return"JSON";case"md":return"Markdown";default:return"DOCUMENT"}},rW=e=>{const t=e.name.split(".").pop();if(!t)return"gray";switch(t){case"pdf":return"pink";case"doc":case"docx":return"blue";case"xls":case"xlsx":case"csv":return"green";case"json":return"orange";default:return"gray"}},oW=ke('<div class="flex justify-end items-end animate-fade-in gap-2">'),iW=ke("<div>"),aW=ke("<span>"),sW=ke('<img alt="Attachment">'),lW=ke('<div class="flex flex-col gap-1 items-end w-full"><div class="bubble bubble--guest whitespace-pre-wrap flex flex-col" data-testid="guest-bubble">'),uW=ke("<img>"),cW=ke('<div class="flex flex-col gap-1 items-end"><div class="bubble bubble--guest w-full w-whitespace-pre-wrap flex flex-col" data-testid="guest-bubble"><audio controls>'),dW=e=>(()=>{const t=oW();return Pe(t,te(he,{get children(){return[te(ge,{get when(){return"text"===e.answer?.type},get children(){return te(pW,{get answer(){return e.answer}})}}),te(ge,{get when(){return"recording"===e.answer?.type},get children(){return te(fW,{get answer(){return e.answer}})}})]}}),null),Pe(t,te(fe,{get when(){return e.showAvatar},get children(){return te(dU,{get initialAvatarSrc(){return e.avatarSrc}})}}),null),T(()=>null!=(e.hasHostAvatar?Li()?"28px":"50px":void 0)?t.style.setProperty("margin-left",e.hasHostAvatar?Li()?"28px":"50px":void 0):t.style.removeProperty("margin-left")),t})(),pW=e=>{const[t,n]=S();return(()=>{const r=lW(),o=r.firstChild;return Pe(r,te(fe,{get when(){return(e.answer.attachments??[]).length>0},get children(){return[(()=>{const t=iW();return Pe(t,te(de,{get each(){return e.answer.attachments?.filter(e=>e.type.startsWith("image"))},children:(t,r)=>(()=>{const o=uW();return o.$$click=()=>n(t.url),T(n=>{const i=t.url,a=`Attached image ${r()+1}`,s=tt("bubble bubble--guest cursor-pointer",e.answer.attachments.filter(e=>e.type.startsWith("image")).length>1&&"max-w-[90%]");return i!==n._v$&&Se(o,"src",n._v$=i),a!==n._v$2&&Se(o,"alt",n._v$2=a),s!==n._v$3&&Te(o,n._v$3=s),n},{_v$:void 0,_v$2:void 0,_v$3:void 0}),o})()})),T(()=>Te(t,tt("flex gap-1 overflow-auto max-w-[350px]",Li()?"flex-wrap justify-end":"items-center"))),t})(),(()=>{const t=iW();return Pe(t,te(de,{get each(){return e.answer.attachments?.filter(e=>!e.type.startsWith("image"))},children:e=>te(tW,{get file(){return{name:e.url.split("/").at(-1)}}})})),T(()=>Te(t,tt("flex gap-1 overflow-auto max-w-[350px]",Li()?"flex-wrap justify-end":"items-center"))),t})()]}}),o),Pe(o,te(fe,{get when(){return Qe(e.answer.label??e.answer.value)},get children(){const t=aW();return t.style.setProperty("overflow-wrap","break-word"),Pe(t,()=>e.answer.label??e.answer.value),t}})),Pe(r,te(XV,{get isOpen(){return void 0!==t()},onClose:()=>n(void 0),get children(){const e=sW();return e.style.setProperty("border-radius","6px"),T(()=>Se(e,"src",t())),e}}),null),r})()},fW=e=>(()=>{const t=cW(),n=t.firstChild.firstChild;return T(()=>Se(n,"src",e.answer.url)),t})();Ce(["click"]);let hW=function(e){return e.COLOR="Color",e.IMAGE="Image",e.NONE="None",e}({});[{label:"Top",value:"top"},{label:"Bottom",value:"bottom"}].map(e=>e.value),[{label:"Fixed",value:"fixed"},{label:"Absolute",value:"absolute"}].map(e=>e.value);[{label:"None",value:"none"},{label:"M",value:"medium"},{label:"L",value:"large"},{label:"10",value:"custom"}].map(e=>e.value);const gW="Open Sans",mW="absolute",vW="large",yW="transparent",bW="#01a952",wW=!0,EW=!1,_W=e=>{const{chatChunks:t}=Fi(),n=()=>t()[e.chunkIndex]?.input?.answer;return te(fe,{get when(){return n()&&!e.hasError},get children(){return te(dW,{get answer(){return n()},get showAvatar(){return e.guestAvatar?.isEnabled??EW},get avatarSrc(){return e.guestAvatar?.url&&e.guestAvatar.url},get hasHostAvatar(){return e.hasHostAvatar}})}})},xW=ke("<div><div>"),kW=e=>{let t;const[n,r]=S(0),o=new ResizeObserver(e=>r(e[0].target.clientHeight-(Li()?24:40)));return P(()=>{t&&o.observe(t)}),I(()=>{t&&o.unobserve(t)}),(()=>{const r=xW(),o=r.firstChild;return"function"==typeof t?Oe(t,r):t=r,Pe(o,te(dU,{get initialAvatarSrc(){return e.hostAvatarSrc}})),T(t=>{const i="flex flex-shrink-0 items-center relative bot-avatar-container "+(Li()?"w-6":"w-10"),a="absolute flex items-center top-0"+(Li()?" w-6 h-6":" w-10 h-10")+(e.hideAvatar?" opacity-0":" opacity-100"),s=`${n()}px`,l=e.isTransitionDisabled?void 0:"top 350ms ease-out, opacity 250ms ease-out";return i!==t._v$&&Te(r,t._v$=i),a!==t._v$2&&Te(o,t._v$2=a),s!==t._v$3&&(null!=(t._v$3=s)?o.style.setProperty("top",s):o.style.removeProperty("top")),l!==t._v$4&&(null!=(t._v$4=l)?o.style.setProperty("transition",l):o.style.removeProperty("transition")),t},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),r})()},CW=ke('<div class="flex flex-col animate-fade-in"><div class="flex w-full items-center"><div class="flex relative items-start max-w-full"><div class="bubble bubble--host flex items-center absolute" data-testid="host-bubble"></div><div class="bubble flex flex-col overflow-hidden relative text-ellipsis h-full gap-6">'),SW=ke("<span>"),TW=e=>{const[t,n]=xn(S([]),{key:`bot-streaming-message-${e.streamingMessageId}`,storage:e.context.storage});return D(()=>{if(Ii()?.id!==e.streamingMessageId)return[];n(Ii()?.content.split("```").map((e,t)=>t%2==0?e.split("\n\n").map(e=>eM(e.replace(/【.+】/g,""),{format:"html",enableCodeBlocksMode:!1})):[eM("```"+e+"```",{format:"html",enableCodeBlocksMode:!1})]).flat().filter(Qe)??[])}),(()=>{const e=CW(),n=e.firstChild.firstChild.firstChild,r=n.nextSibling;return n.style.setProperty("width","100%"),n.style.setProperty("height","100%"),Pe(r,te(de,{get each(){return t()},children:e=>(()=>{const t=SW();return t.innerHTML=e,t})()})),e})()},DW=ke('<div class="flex flex-col w-full min-w-0 gap-2"><div><div class="flex flex-col flex-1 gap-2 w-10">'),AW=ke("<div>"),OW=e=>{let t;const{getDisplayedMessageIndex:n,setDisplayedMessageIndex:r}=Fi(),[o,i]=S(),[a,s]=S(!1);D(()=>{e.isTransitionDisabled?(r(e.index,e.messages.length),s(!0)):a()||(r(e.index,0),s(!0))});const l=()=>n(e.index);P(()=>{e.streamingMessageId||(0===e.messages.length&&e.onAllBubblesDisplayed(),e.onScrollToBottom(t,50))});const u=async t=>{(e.settings.typingEmulation?.delayBetweenBubbles??on.delayBetweenBubbles)>0&&l()<e.messages.length-1&&await new Promise(t=>setTimeout(t,1e3*(e.settings.typingEmulation?.delayBetweenBubbles??on.delayBetweenBubbles)));const n=e.messages[l()].id;await e.onNewBubbleDisplayed(n),r(e.index,l()===e.messages.length?l():l()+1),e.onScrollToBottom(t),l()===e.messages.length&&(i(t),e.onAllBubblesDisplayed())};return(()=>{const n=DW(),r=n.firstChild,i=r.firstChild;return Pe(r,te(fe,{get when(){return(e.theme.chat?.hostAvatar?.isEnabled??wW)&&(e.messages.length>0||e.streamingMessageId)},get children(){return te(kW,{get hostAvatarSrc(){return e.theme.chat?.hostAvatar?.url},get hideAvatar(){return e.hideAvatar},get isTransitionDisabled(){return e.isTransitionDisabled}})}}),i),Pe(i,te(fe,{get when(){return e.messages.length>0},get children(){return te(de,{get each(){return e.messages.slice(0,l()+1)},children:(t,n)=>te(aU,{message:t,get typingEmulation(){return e.settings.typingEmulation},get isTypingSkipped(){return A(()=>!(!(e.settings.typingEmulation?.isDisabledOnFirstMessage??on.isDisabledOnFirstMessage)||0!==e.index))()&&0===n()},get onTransitionEnd(){return e.isTransitionDisabled?void 0:u},get onCompleted(){return e.onSubmit}})})}}),null),Pe(i,te(fe,{get when(){return e.streamingMessageId},keyed:!0,children:t=>(()=>{const n=AW(),r=e.blockRef;return"function"==typeof r?Oe(r,n):e.blockRef=n,Pe(n,te(TW,{streamingMessageId:t,get context(){return e.context}})),T(()=>null!=(e.theme.chat?.guestAvatar?.isEnabled?Li()?"calc(100% - 60px)":"calc(100% - 48px - 48px)":"100%")?n.style.setProperty("max-width",e.theme.chat?.guestAvatar?.isEnabled?Li()?"calc(100% - 60px)":"calc(100% - 48px - 48px)":"100%"):n.style.removeProperty("max-width")),n})()}),null),Pe(n,te(fe,{get when(){return l()===e.messages.length&&e.input},children:n=>te(_W,{ref(e){"function"==typeof t?t(e):t=e},get block(){return n()},get chunkIndex(){return e.index},get hasHostAvatar(){return e.theme.chat?.hostAvatar?.isEnabled??wW},get guestAvatar(){return e.theme.chat?.guestAvatar},get context(){return e.context},get isInputPrefillEnabled(){return e.settings.general?.isInputPrefillEnabled??rn.isInputPrefillEnabled},get hasError(){return e.hasError},onTransitionEnd:()=>e.onScrollToBottom(o()),get onSubmit(){return e.onSubmit},get onSkip(){return e.onSkip}})}),null),T(()=>Te(r,tt("flex",Li()?"gap-1":"gap-2"))),n})()},PW=ke('<div class="w-full max-w-xs p-4 bg-white shadow-lg rounded-lg flex flex-col gap-3 toast--popup-blocked border border-gray-200" role="alert"><div class="flex items-start gap-2"><div class="flex flex-col gap-1 flex-1"><div class="flex-shrink-0 mt-0.5"><svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-orange-500" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd"></path></svg></div><span class="text-sm font-semibold text-gray-900">Popup blocked</span><div class="text-sm font-normal text-gray-600 leading-relaxed">The bot wants to open a new tab but it was blocked by your browser. It needs a manual approval.</div></div></div><a target="_blank" class="button justify-center text-sm font-medium focus:outline-none focus:ring-2 focus:ring-offset-2 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 rounded-lg hover:opacity-90 active:scale-[0.98]" rel="noreferrer"><span>Continue in new tab</span><svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" viewBox="0 0 20 20" fill="currentColor"><path d="M11 3a1 1 0 100 2h2.586l-6.293 6.293a1 1 0 101.414 1.414L15 6.414V9a1 1 0 102 0V4a1 1 0 00-1-1h-5z"></path><path d="M5 5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-3a1 1 0 10-2 0v3H5V7h3a1 1 0 000-2H5z">'),IW=e=>(()=>{const t=PW(),n=t.firstChild.nextSibling;return n.$$click=()=>e.onLinkClick(),T(()=>Se(n,"href",e.url)),t})();Ce(["click"]);const NW=ke('<div class="conversation-container__body flex flex-col overflow-y-auto w-full px-5 py-10 relative scroll-smooth gap-2 flex-[9]">'),RW=ke('<div class="flex justify-end">'),BW=e=>{const{chatChunks:t,theme:n,hasError:r,blockRef:o,blockedPopupUrl:i,setBlockedPopupUrl:a,isSending:s,sendMessage:l,processClientSideActions:u,onBubblesDisplayed:c}=Fi();let d,p;P(()=>{(async()=>{const e=t()[0];if(!e.clientSideActions)return;const n=e.clientSideActions.filter(e=>Ze(e.lastBubbleBlockId));await u(n)})()}),I(()=>{p&&clearTimeout(p)});const f=async()=>{const n=[...t()].pop();n&&(p&&clearTimeout(p),p=setTimeout(()=>{c(),p=void 0},300),Ze(n.input)&&e.onEnd?.())},h=async n=>{const r=[...t()].pop();if(!r)return;const o=r.messages.find(e=>e.id===n);if(o){if(e.onNewBlock&&e.onNewBlock({id:o.id,type:o.type}),r.clientSideActions){const e=r.clientSideActions.filter(e=>e.lastBubbleBlockId===n);await u(e)}}else console.warn(`Block with id "${n}" not found in messages`,{blockId:n,availableMessageIds:r.messages.map(e=>e.id),chunkIndex:t().length-1})},g=()=>l(void 0);return(()=>{const u=NW();return"function"==typeof d?Oe(d,u):d=u,Pe(u,te(pe,{get each(){return t()},children:(i,a)=>te(OW,{blockRef:o,index:a,get messages(){return i().messages},get input(){return i().input},get theme(){return n()},get settings(){return e.initialChatReply.bot.settings},get streamingMessageId(){return i().streamingMessageId},get context(){return e.context},get hideAvatar(){return A(()=>!i().input)()&&((t()[a+1]?.messages??0).length>0||void 0!==t()[a+1]?.streamingMessageId||i().messages.length>0&&s())},get hasError(){return A(()=>!!r())()&&a===t().length-1},get isTransitionDisabled(){return a!==t().length-1},onNewBubbleDisplayed:h,onAllBubblesDisplayed:f,onSubmit:l,onScrollToBottom:(e,t)=>nn(d,e,t),onSkip:g})}),null),Pe(u,te(fe,{get when(){return i()},keyed:!0,children:e=>(()=>{const t=RW();return Pe(t,te(IW,{url:e,onLinkClick:()=>a(void 0)})),t})()}),null),u})()},FW=ke('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_7660_13477)"><path d="M24 0H0V24H24V0Z" fill="#5DDE8A"></path><path d="M0 0L7.00328 7.00328L8.30164 6.25574L10.9377 5.23279H12.8262L15.8951 5.98033L17.5475 8.18361L18.0984 9.83607L18.3738 12.3541L18.4918 13.6525L17.0754 16.6426H16.6426L24 24V0H0Z" fill="#5BCB82"></path><path d="M14.0853 18.2951H5.27222V9.67872C5.27222 7.12134 7.35746 5.07544 9.87549 5.07544H14.046C16.6034 5.07544 18.6493 7.16069 18.6493 9.67872V13.6918C18.6886 16.2099 16.6427 18.2951 14.0853 18.2951ZM6.49189 17.1148H14.1247C16.0132 17.1148 17.5476 15.5804 17.5476 13.6918V9.67872C17.5476 7.79019 16.0132 6.25577 14.1247 6.25577H9.91484C8.02631 6.25577 6.49189 7.79019 6.49189 9.67872V17.1148Z" fill="white"></path><path d="M11.9609 12.6295C12.4824 12.6295 12.9051 12.2067 12.9051 11.6852C12.9051 11.1637 12.4824 10.741 11.9609 10.741C11.4394 10.741 11.0166 11.1637 11.0166 11.6852C11.0166 12.2067 11.4394 12.6295 11.9609 12.6295Z" fill="white"></path><path d="M8.97063 12.6295C9.49213 12.6295 9.91489 12.2067 9.91489 11.6852C9.91489 11.1637 9.49213 10.741 8.97063 10.741C8.44913 10.741 8.02637 11.1637 8.02637 11.6852C8.02637 12.2067 8.44913 12.6295 8.97063 12.6295Z" fill="white"></path><path d="M15.0297 12.6295C15.5512 12.6295 15.974 12.2067 15.974 11.6852C15.974 11.1637 15.5512 10.741 15.0297 10.741C14.5082 10.741 14.0854 11.1637 14.0854 11.6852C14.0854 12.2067 14.5082 12.6295 15.0297 12.6295Z" fill="white"></path></g><defs><clipPath id="clip0_7660_13477"><path d="M0 1.62712C0 0.728487 0.728486 0 1.62712 0H22.3729C23.2715 0 24 0.728486 24 1.62712V22.3729C24 23.2715 23.2715 24 22.3729 24H1.62712C0.728487 24 0 23.2715 0 22.3729V1.62712Z" fill="white">'),LW=()=>FW(),MW=ke('<a href="https://quick.bot/?utm_source=litebadge" target="_blank" rel="noopener noreferrer" class="!p-3 !bg-black/[0.04] !z-50 !border-t !border-black/[0.08] !text-black/60 !gap-2 !text-xs !leading-3 !h-10 !font-normal !opacity-100 !visible !flex !items-center !justify-center !no-underline hover:!bg-[#f7f8ff] [&_svg]:!w-4 [&_svg]:!h-4" id="lite-badge"><span>Powered by quick.bot'),UW=e=>{let t,n;const r=n=>{n.forEach(n=>{n.removedNodes.forEach(n=>{"id"in n&&t&&"lite-badge"==n.id&&(console.log("Sorry, you can't remove the brand 😅"),e.botContainer?.append(t))})})};return P(()=>{document&&e.botContainer&&(n=new MutationObserver(r),n.observe(e.botContainer,{subtree:!1,childList:!0}))}),I(()=>{n&&n.disconnect()}),(()=>{const e=MW(),n=e.firstChild;return"function"==typeof t?Oe(t,e):t=e,Pe(e,te(LW,{}),n),e})()},jW=ke('<div class="!p-3 !z-50 !text-black/60 !gap-2 !leading-3 !h-10 !font-normal !opacity-100 !visible !flex !items-center !justify-center !no-underline hover:!opacity-80"><span>The conversation has ended.'),$W=()=>jW(),zW=ke('<textarea id="user-input" class="focus:outline-none bg-transparent flex-1 w-full resize-none overflow-hidden h-[25px]" data-testid="textarea" required>'),HW=e=>{const[t,n]=se(e,["ref","onInput","containerRef"]),r=e=>{const n=e.currentTarget;n.style.height="25px";const r=Math.max(25,Math.min(n.scrollHeight,150));n.style.height=`${r}px`,n.style.overflow=n.scrollHeight>150?"auto":"hidden",t.onInput(n.value)};return(()=>{const e=zW();e.$$input=r;const o=t.ref;return"function"==typeof o?Oe(o,e):t.ref=e,Ae(e,ae({get autofocus(){return!Li()}},n),!1,!1),e})()};Ce(["input"]);const VW=ke('<img class="rounded-md object-cover w-[58px] h-[58px]">'),WW=ke('<div class="relative group flex-shrink-0"><button class="absolute -right-2 p-0.5 -top-2 rounded-full bg-gray-200 text-black border border-gray-400 opacity-1 sm:opacity-0 group-hover:opacity-100 transition-opacity" aria-label="Remove attachment">'),qW=ke('<div class="absolute w-full h-full inset-0 bg-black/20 rounded-md">'),GW=e=>(()=>{const t=WW(),n=t.firstChild;return Pe(t,te(he,{get children(){return[te(ge,{get when(){return e.file.type.startsWith("image")},get children(){const t=VW();return T(n=>{const r=URL.createObjectURL(e.file),o=e.file.name;return r!==n._v$&&Se(t,"src",n._v$=r),o!==n._v$2&&Se(t,"alt",n._v$2=o),n},{_v$:void 0,_v$2:void 0}),t}}),te(ge,{when:!0,get children(){return te(tW,{get file(){return e.file}})}})]}}),n),n.addEventListener("click",e.onRemoveClick),Pe(n,te(ft,{class:"w-4"})),Pe(t,te(fe,{get when(){return Ye(e.uploadProgressPercent)&&100!==e.uploadProgressPercent},get children(){return te(KW,{get progressPercent(){return e.uploadProgressPercent}})}}),null),t})(),KW=e=>{const[t,n]=S(e.progressPercent??0);let r;return D(()=>{if(20===e.progressPercent){r=setInterval(()=>{t()<100&&n(e=>e+(Math.floor(10*Math.random())+1))},1e3)}}),I(()=>{clearInterval(r)}),(()=>{const e=qW();return Pe(e,te(UV.Root,{get value(){return t()},class:"flex items-center justify-center",get children(){return te(UV.Circle,{get children(){return[te(UV.CircleTrack,{}),te(UV.CircleRange,{})]}})}})),e})()},YW=ke('<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M8.99992 16V6.41407L5.70696 9.70704C5.31643 10.0976 4.68342 10.0976 4.29289 9.70704C3.90237 9.31652 3.90237 8.6835 4.29289 8.29298L9.29289 3.29298L9.36907 3.22462C9.76184 2.90427 10.3408 2.92686 10.707 3.29298L15.707 8.29298L15.7753 8.36915C16.0957 8.76192 16.0731 9.34092 15.707 9.70704C15.3408 10.0732 14.7618 10.0958 14.3691 9.7754L14.2929 9.70704L10.9999 6.41407V16C10.9999 16.5523 10.5522 17 9.99992 17C9.44764 17 8.99992 16.5523 8.99992 16Z">'),ZW=e=>(()=>{const t=YW();return Ae(t,e,!0,!0),t})(),XW=ke('<svg><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z">'),QW=e=>(()=>{const t=XW();return Ae(t,ae(e,{get class(){return tt("animate-spin h-6 w-6",e.class)},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","data-testid":"loading-spinner"}),!0,!0),t})(),JW=ke("<button>"),eq=e=>{const t=L(()=>e.children),[n,r]=se(e,["disabled","class"]),o=e.isDisabled||e.isLoading;return(()=>{const i=JW();return Ae(i,ae(r,{disabled:o,get class(){return tt("button focus:outline-none filter hover:brightness-90 active:brightness-75 disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 flex justify-center transition-all duration-300 w-auto",n.class)}}),!1,!0),Pe(i,te(fe,{get when(){return!e.isLoading},get fallback(){return te(QW,{})},get children(){return t()}})),i})()},tq=e=>{const t=zM.NEXT_PUBLIC_BETA_ENV&&!!e?.children;return te(eq,ae({type:"submit","aria-label":t?void 0:"Send",get class(){return tt(t?"px-4":void 0,e.class)}},e,{get children(){return te(he,{get children(){return[te(ge,{when:!t,get children(){return te(ZW,{})}}),te(ge,{when:t,get children(){return e.children}})]}})}}))},nq=ke('<form><div class="flex w-full h-full transition-all duration-100"></div><div class="flex-shrink-0">'),rq=e=>{const{children:t,onSubmit:n,buttonLabel:r,isDisabled:o=!1,class:i,customButton:a,isInputDisabled:s,hasError:l}=e;return(()=>{const e=nq(),u=e.firstChild,c=u.nextSibling;return e.addEventListener("submit",e=>{e.preventDefault(),n()}),Pe(u,t),Pe(c,te(fe,{when:a,get fallback(){return te(tq,{isDisabled:o,children:r})},children:a})),T(()=>Te(e,tt("input__field w-full flex gap-2 items-center border rounded-full px-5 py-2 pr-2 overflow-hidden",s?.()&&!l&&"opacity-50 pointer-events-none",i))),e})()},oq=e=>{const t=t=>{const{data:n}=t;n.isFromBot&&e(t)};P(()=>{window.addEventListener("message",t)}),I(()=>{window.removeEventListener("message",t)})},iq="Send";let aq=function(e){return e.TEXT="text input",e.NUMBER="number input",e.EMAIL="email input",e.URL="url input",e.DATE="date input",e.PHONE="phone number input",e.CHOICE="buttons input",e.RATING="rating input",e.FILE="file input",e}({});const sq={placeholder:"Type your answer..."},lq={isEnabled:!1},uq=ke('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2px" stroke-linecap="round" stroke-linejoin="round"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"></path><path d="M14 2v4a2 2 0 0 0 2 2h4"></path><circle cx="10" cy="12" r="2"></circle><path d="m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22">'),cq=e=>(()=>{const t=uq();return Ae(t,e,!0,!0),t})(),dq=ke('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48">'),pq=e=>(()=>{const t=dq();return Ae(t,e,!0,!0),t})(),fq=ke('<input type="file" id="document-upload" multiple class="hidden">'),hq=ke('<input type="file" id="photos-upload" accept="image/*, video/*" multiple class="hidden">'),gq=ke('<label aria-label="Add attachments" for="document-upload">'),mq=ke("<label> Document"),vq=ke("<label> Photos & videos"),yq=e=>[(()=>{const t=fq();return t.addEventListener("change",t=>{t.currentTarget.files&&e.onNewFiles(t.currentTarget.files)}),t})(),(()=>{const t=hq();return t.addEventListener("change",t=>{t.currentTarget.files&&e.onNewFiles(t.currentTarget.files)}),t})(),te(he,{get children(){return[te(ge,{get when(){return Li()},get children(){const t=gq();return Pe(t,te(pq,{class:"w-5"})),T(()=>Te(t,tt("filter data-[state=open]:backdrop-brightness-90 hover:backdrop-brightness-95 transition rounded-md p-2 focus:outline-none",e.class))),t}}),te(ge,{when:!0,get children(){return te(BV.Root,{get children(){return[te(BV.Trigger,{get class(){return tt("filter data-[state=open]:backdrop-brightness-90 hover:backdrop-brightness-95 transition rounded-md p-2 focus:outline-none",e.class)},"aria-label":"Add attachments",get children(){return te(pq,{class:"w-5"})}}),te(BV.Positioner,{get children(){return te(BV.Content,{class:"p-3 gap-2 focus:outline-none",get children(){return[te(BV.Item,{value:"document",asChild:e=>(()=>{const t=mq(),n=t.firstChild;return Ae(t,ae(e,{for:"document-upload",class:"p-2 filter hover:brightness-95 flex gap-3 items-center"}),!1,!0),Pe(t,te(JV,{class:"w-4"}),n),t})()}),te(BV.Item,{value:"photos",asChild:e=>(()=>{const t=vq(),n=t.firstChild;return Ae(t,ae(e,{for:"photos-upload",class:"p-2 filter hover:brightness-95 flex gap-3 items-center"}),!1,!0),Pe(t,te(cq,{class:"w-4"}),n),t})()})]}})}})]}})}})]}})],bq=({newFile:e,existingFiles:t,onError:n})=>{const r=Et("NEXT_PUBLIC_BOT_FILE_UPLOAD_MAX_SIZE");if(r&&e.size>1024*r*1024)return void n({title:"File too large",description:`${e.name} is larger than ${r}MB`});if(0===t.length)return e;let o=e.name,i=1;for(;t.some(e=>e.name===o);){const t=e.name.lastIndexOf("."),n=-1!==t?e.name.slice(t):"";o=`${e.name.slice(0,t)}(${i})${n}`,i++}return new File([e],o,{type:e.type})},wq=(e=>{const t=eV.machine({id:"1",...e});return{...eV.connect(t,t.send,pj),machine:t}})({placement:"bottom-end",gap:24}),Eq=async({apiHost:e,files:t,onUploadProgress:n})=>{const r=[];let o=0;for(const{input:i,file:a}of t){n&&n({progress:o/t.length*100,fileIndex:o}),o+=1;const{data:s}=await Ke({method:"POST",url:`${e}/api/v2/generate-upload-url`,body:{fileName:i.fileName,sessionId:i.sessionId,fileType:a.type}});if(s?.presignedUrl){const e=new FormData;Object.entries(s.formData).forEach(([t,n])=>{e.append(t,n)}),e.append("file",a);if(!(await fetch(s.presignedUrl,{method:"POST",body:e})).ok)continue;r.push({url:s.fileUrl,type:a.type})}}return r},_q=e=>{e=e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(e,t,n,r)=>t+t+n+n+r+r);const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]:[0,0,0]},xq=e=>{if(!e)return[0,0,0];if(e.startsWith("#"))return _q(e);if(e.startsWith("rgba")||e.startsWith("rgb")){const t=e.match(/\d+(\.\d+)?/g);if(t&&t.length>=3)return[parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10)]}return _q(e)},kq=e=>{if(!e)return 1;if(e.startsWith("rgba")){const t=e.match(/\d+(\.\d+)?/g);if(t&&t.length>=4)return parseFloat(t[3])}return 1},Cq=e=>({rgb:xq(e),alpha:kq(e)}),Sq=ke('<div><button class="p-0.5 rounded-full" aria-label="Stop recording"></button><div class="relative flex w-full"><canvas class="w-full h-[56px]"></canvas><div class="absolute w-2 left-0 h-[56px] recorder__left-gradient"></div><div class="absolute w-3 right-0 h-[56px] recorder__right-gradient"></div></div><span class="flex-none w-[35px] font-bold text-sm">'),Tq=e=>{const[t,n]=S(0);let r,o,i,a,s,l,u,c,d,p=[],f=0;const h=_q(e.buttonsTheme?.backgroundColor??bW).join(", "),g=()=>{if(!i||!r||!d)return;const e=performance.now(),t=e-d;d=e,i.clearRect(0,0,r.width,r.height),i.fillStyle=`rgba(${h}, 0.2)`;for(let e=0;e<(r.width+3)/6;e++){const t=6*e-f,n=.1*r.height,o=(r.height-n)/2;i.beginPath(),i.roundRect(t,o,3,n,5),i.fill()}i.fillStyle=`rgba(${h}, 1)`;for(let e=0;e<p.length;e++){const t=r.width+6*(e+1)-f,n=r.height*(p[e]/100),o=(r.height-n)/2;i.beginPath(),i.roundRect(t,o,3,n,5),i.fill()}f+=t/1e3*60,o=requestAnimationFrame(g)},m=()=>{i&&r&&i.clearRect(0,0,r.width,r.height),f=0,s?.disconnect(),s=void 0,l?.disconnect(),l=void 0,a?.close(),a=void 0,u?.getTracks().forEach(e=>e.stop()),u=void 0,p=[],clearTimeout(c),n(0),cancelAnimationFrame(o),e.onAbortRecording()};return D(()=>{"asking"===e.recordingStatus?(async()=>{r&&(u=await navigator.mediaDevices.getUserMedia({audio:!0}),e.onRecordingConfirmed(u),i||(i=r.getContext("2d")??void 0),c=setInterval(()=>{n(e=>e+1)},1e3),a=new AudioContext,s=await Dq(a),l=a.createMediaStreamSource(u),l.connect(s),s.connect(a.destination),s.port.onmessage=e=>{6*((r.width+3)/6+p.length)<r.width+f&&p.push(Math.min(Math.max(e.data,5),90))},d=performance.now(),o=requestAnimationFrame(g))})():"stopped"===e.recordingStatus&&m()}),I(()=>{m()}),(()=>{const n=Sq(),o=n.firstChild,i=o.nextSibling,a=i.firstChild,s=i.nextSibling;o.addEventListener("click",m),Pe(o,te(ft,{class:"w-4"}));return"function"==typeof r?Oe(r,a):r=a,Pe(s,()=>Aq(t())),T(()=>Te(n,tt("w-full gap-2 items-center transition-opacity px-2 recorder","started"===e.recordingStatus?"opacity-1 flex":"opacity-0 hidden"))),n})()},Dq=async e=>{const t=new Blob(['\nconst gainFactor = 3;\n\nclass VolumeProcessor extends AudioWorkletProcessor {\n constructor() {\n super();\n }\n\n process(inputs) {\n const input = inputs[0];\n if (input.length > 0) {\n const channelData = input[0];\n let sum = 0;\n for (let i = 0; i < channelData.length; i++) {\n sum += channelData[i] * channelData[i];\n }\n const rms = Math.sqrt(sum / channelData.length);\n this.port.postMessage(rms * 100 * gainFactor)\n }\n return true;\n }\n}\n\nregisterProcessor("volume-processor", VolumeProcessor);\n\n'],{type:"application/javascript"}),n=URL.createObjectURL(t);return await e.audioWorklet.addModule(n),new AudioWorkletNode(e,"volume-processor")},Aq=e=>`${Math.floor(e/60)}:${(e%60).toString().padStart(2,"0")}`,Oq=ke('<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><path d="M15.7806 10.1963C16.1326 10.3011 16.3336 10.6714 16.2288 11.0234L16.1487 11.2725C15.3429 13.6262 13.2236 15.3697 10.6644 15.6299L10.6653 16.835H12.0833L12.2171 16.8486C12.5202 16.9106 12.7484 17.1786 12.7484 17.5C12.7484 17.8214 12.5202 18.0894 12.2171 18.1514L12.0833 18.165H7.91632C7.5492 18.1649 7.25128 17.8672 7.25128 17.5C7.25128 17.1328 7.5492 16.8351 7.91632 16.835H9.33527L9.33429 15.6299C6.775 15.3697 4.6558 13.6262 3.84992 11.2725L3.76984 11.0234L3.74445 10.8906C3.71751 10.5825 3.91011 10.2879 4.21808 10.1963C4.52615 10.1047 4.84769 10.2466 4.99347 10.5195L5.04523 10.6436L5.10871 10.8418C5.8047 12.8745 7.73211 14.335 9.99933 14.335C12.3396 14.3349 14.3179 12.7789 14.9534 10.6436L15.0052 10.5195C15.151 10.2466 15.4725 10.1046 15.7806 10.1963ZM12.2513 5.41699C12.2513 4.17354 11.2437 3.16521 10.0003 3.16504C8.75675 3.16504 7.74835 4.17343 7.74835 5.41699V9.16699C7.74853 10.4104 8.75685 11.418 10.0003 11.418C11.2436 11.4178 12.2511 10.4103 12.2513 9.16699V5.41699ZM13.5814 9.16699C13.5812 11.1448 11.9781 12.7479 10.0003 12.748C8.02232 12.748 6.41845 11.1449 6.41828 9.16699V5.41699C6.41828 3.43889 8.02221 1.83496 10.0003 1.83496C11.9783 1.83514 13.5814 3.439 13.5814 5.41699V9.16699Z">'),Pq=e=>(()=>{const t=Oq();return Ae(t,e,!0,!0),t})();var Iq={},Nq=function(e,t){return Nq=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Nq(e,t)};function Rq(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Nq(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Bq=function(){return Bq=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Bq.apply(this,arguments)};function Fq(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function Lq(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function Mq(e,t){return function(n,r){t(n,r,e)}}function Uq(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function jq(e,t,n,r){return new(n||(n=Promise))(function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function s(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})}function $q(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}var zq=Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function Hq(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||zq(t,e,n)}function Vq(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Wq(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function qq(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Wq(arguments[t]));return e}function Gq(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r}function Kq(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function Yq(e){return this instanceof Yq?(this.v=e,this):new Yq(e)}function Zq(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},a("next"),a("throw"),a("return"),r[Symbol.asyncIterator]=function(){return this},r;function a(e){o[e]&&(r[e]=function(t){return new Promise(function(n,r){i.push([e,t,n,r])>1||s(e,t)})})}function s(e,t){try{!function(e){e.value instanceof Yq?Promise.resolve(e.value.v).then(l,u):c(i[0][2],e)}(o[e](t))}catch(e){c(i[0][3],e)}}function l(e){s("next",e)}function u(e){s("throw",e)}function c(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}function Xq(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,o){t[r]=e[r]?function(t){return(n=!n)?{value:Yq(e[r](t)),done:!1}:o?o(t):t}:o}}function Qq(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=Vq(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,o){(function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)})(r,o,(t=e[n](t)).done,t.value)})}}}function Jq(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var eG=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function tG(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&zq(t,e,n);return eG(t,e),t}function nG(e){return e&&e.__esModule?e:{default:e}}function rG(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function oG(e,t,n,r,o){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?o.call(e,n):o?o.value=n:t.set(e,n),n}function iG(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function aG(e,t,n){if(null!=t){if("object"!=typeof t)throw new TypeError("Object expected.");var r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose]}if("function"!=typeof r)throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}var sG="function"==typeof SuppressedError?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function lG(e){function t(t){e.error=e.hasError?new sG(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function n(){for(;e.stack.length;){var r=e.stack.pop();try{var o=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(o).then(n,function(e){return t(e),n()})}catch(e){t(e)}}if(e.hasError)throw e.error}()}var uG,cG={__extends:Rq,__assign:Bq,__rest:Fq,__decorate:Lq,__param:Mq,__metadata:Uq,__awaiter:jq,__generator:$q,__createBinding:zq,__exportStar:Hq,__values:Vq,__read:Wq,__spread:qq,__spreadArrays:Gq,__spreadArray:Kq,__await:Yq,__asyncGenerator:Zq,__asyncDelegator:Xq,__asyncValues:Qq,__makeTemplateObject:Jq,__importStar:tG,__importDefault:nG,__classPrivateFieldGet:rG,__classPrivateFieldSet:oG,__classPrivateFieldIn:iG,__addDisposableResource:aG,__disposeResources:lG},dG=Object.freeze({__proto__:null,__addDisposableResource:aG,get __assign(){return Bq},__asyncDelegator:Xq,__asyncGenerator:Zq,__asyncValues:Qq,__await:Yq,__awaiter:jq,__classPrivateFieldGet:rG,__classPrivateFieldIn:iG,__classPrivateFieldSet:oG,__createBinding:zq,__decorate:Lq,__disposeResources:lG,__esDecorate:function(e,t,n,r,o,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,l=r.kind,u="getter"===l?"get":"setter"===l?"set":"value",c=!t&&e?r.static?e:e.prototype:null,d=t||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),p=!1,f=n.length-1;f>=0;f--){var h={};for(var g in r)h[g]="access"===g?{}:r[g];for(var g in r.access)h.access[g]=r.access[g];h.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var m=(0,n[f])("accessor"===l?{get:d.get,set:d.set}:d[u],h);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(s=a(m.get))&&(d.get=s),(s=a(m.set))&&(d.set=s),(s=a(m.init))&&o.unshift(s)}else(s=a(m))&&("field"===l?o.unshift(s):d[u]=s)}c&&Object.defineProperty(c,r.name,d),p=!0},__exportStar:Hq,__extends:Rq,__generator:$q,__importDefault:nG,__importStar:tG,__makeTemplateObject:Jq,__metadata:Uq,__param:Mq,__propKey:function(e){return"symbol"==typeof e?e:"".concat(e)},__read:Wq,__rest:Fq,__runInitializers:function(e,t,n){for(var r=arguments.length>2,o=0;o<t.length;o++)n=r?t[o].call(e,n):t[o].call(e);return r?n:void 0},__setFunctionName:function(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})},__spread:qq,__spreadArray:Kq,__spreadArrays:Gq,__values:Vq,default:cG}),pG={},fG={},hG={};function gG(){if(uG)return hG;uG=1,Object.defineProperty(hG,"__esModule",{value:!0}),hG.WebmBase=void 0;return hG.WebmBase=class{constructor(e="Unknown",t=0){this.name=e,this.start=t}getType(){return"Unknown"}updateBySource(){}setSource(e){this.source=e,this.updateBySource()}updateByData(){}setData(e){this.data=e,this.updateByData()}getValue(){return this.data}setValue(e){this.setData(e)}},hG}var mG,vG,yG={},bG={},wG={};function EG(){return mG||(mG=1,Object.defineProperty(wG,"__esModule",{value:!0}),wG.SectionType=void 0,function(e){e.Container="Container",e.Uint="Uint",e.Int="Int",e.Float="Float",e.String="String",e.Date="Date",e.Binary="Binary"}(e||(wG.SectionType=e={}))),wG;var e}function _G(){if(vG)return bG;vG=1,Object.defineProperty(bG,"__esModule",{value:!0}),bG.sections=void 0;const e=EG();return bG.sections={172351395:{name:"EBML",type:e.SectionType.Container},646:{name:"EBMLVersion",type:e.SectionType.Uint},759:{name:"EBMLReadVersion",type:e.SectionType.Uint},754:{name:"EBMLMaxIDLength",type:e.SectionType.Uint},755:{name:"EBMLMaxSizeLength",type:e.SectionType.Uint},642:{name:"DocType",type:e.SectionType.String},647:{name:"DocTypeVersion",type:e.SectionType.Uint},645:{name:"DocTypeReadVersion",type:e.SectionType.Uint},108:{name:"Void",type:e.SectionType.Binary},63:{name:"CRC-32",type:e.SectionType.Binary},190023271:{name:"SignatureSlot",type:e.SectionType.Container},16010:{name:"SignatureAlgo",type:e.SectionType.Uint},16026:{name:"SignatureHash",type:e.SectionType.Uint},16037:{name:"SignaturePublicKey",type:e.SectionType.Binary},16053:{name:"Signature",type:e.SectionType.Binary},15963:{name:"SignatureElements",type:e.SectionType.Container},15995:{name:"SignatureElementList",type:e.SectionType.Container},9522:{name:"SignedElement",type:e.SectionType.Binary},139690087:{name:"Segment",type:e.SectionType.Container},21863284:{name:"SeekHead",type:e.SectionType.Container},3515:{name:"Seek",type:e.SectionType.Container},5035:{name:"SeekID",type:e.SectionType.Binary},5036:{name:"SeekPosition",type:e.SectionType.Uint},88713574:{name:"Info",type:e.SectionType.Container},13220:{name:"SegmentUID",type:e.SectionType.Binary},13188:{name:"SegmentFilename",type:e.SectionType.String},1882403:{name:"PrevUID",type:e.SectionType.Binary},1868715:{name:"PrevFilename",type:e.SectionType.String},2013475:{name:"NextUID",type:e.SectionType.Binary},1999803:{name:"NextFilename",type:e.SectionType.String},1092:{name:"SegmentFamily",type:e.SectionType.Binary},10532:{name:"ChapterTranslate",type:e.SectionType.Container},10748:{name:"ChapterTranslateEditionUID",type:e.SectionType.Uint},10687:{name:"ChapterTranslateCodec",type:e.SectionType.Uint},10661:{name:"ChapterTranslateID",type:e.SectionType.Binary},710577:{name:"TimecodeScale",type:e.SectionType.Uint},1161:{name:"Duration",type:e.SectionType.Float},1121:{name:"DateUTC",type:e.SectionType.Date},15273:{name:"Title",type:e.SectionType.String},3456:{name:"MuxingApp",type:e.SectionType.String},5953:{name:"WritingApp",type:e.SectionType.String},103:{name:"Timecode",type:e.SectionType.Uint},6228:{name:"SilentTracks",type:e.SectionType.Container},6359:{name:"SilentTrackNumber",type:e.SectionType.Uint},39:{name:"Position",type:e.SectionType.Uint},43:{name:"PrevSize",type:e.SectionType.Uint},35:{name:"SimpleBlock",type:e.SectionType.Binary},32:{name:"BlockGroup",type:e.SectionType.Container},33:{name:"Block",type:e.SectionType.Binary},34:{name:"BlockVirtual",type:e.SectionType.Binary},13729:{name:"BlockAdditions",type:e.SectionType.Container},38:{name:"BlockMore",type:e.SectionType.Container},110:{name:"BlockAddID",type:e.SectionType.Uint},37:{name:"BlockAdditional",type:e.SectionType.Binary},27:{name:"BlockDuration",type:e.SectionType.Uint},122:{name:"ReferencePriority",type:e.SectionType.Uint},123:{name:"ReferenceBlock",type:e.SectionType.Int},125:{name:"ReferenceVirtual",type:e.SectionType.Int},36:{name:"CodecState",type:e.SectionType.Binary},13730:{name:"DiscardPadding",type:e.SectionType.Int},14:{name:"Slices",type:e.SectionType.Container},104:{name:"TimeSlice",type:e.SectionType.Container},76:{name:"LaceNumber",type:e.SectionType.Uint},77:{name:"FrameNumber",type:e.SectionType.Uint},75:{name:"BlockAdditionID",type:e.SectionType.Uint},78:{name:"Delay",type:e.SectionType.Uint},79:{name:"SliceDuration",type:e.SectionType.Uint},72:{name:"ReferenceFrame",type:e.SectionType.Container},73:{name:"ReferenceOffset",type:e.SectionType.Uint},74:{name:"ReferenceTimeCode",type:e.SectionType.Uint},47:{name:"EncryptedBlock",type:e.SectionType.Binary},106212971:{name:"Tracks",type:e.SectionType.Container},46:{name:"TrackEntry",type:e.SectionType.Container},87:{name:"TrackNumber",type:e.SectionType.Uint},13253:{name:"TrackUID",type:e.SectionType.Uint},3:{name:"TrackType",type:e.SectionType.Uint},57:{name:"FlagEnabled",type:e.SectionType.Uint},8:{name:"FlagDefault",type:e.SectionType.Uint},5546:{name:"FlagForced",type:e.SectionType.Uint},28:{name:"FlagLacing",type:e.SectionType.Uint},11751:{name:"MinCache",type:e.SectionType.Uint},11768:{name:"MaxCache",type:e.SectionType.Uint},254851:{name:"DefaultDuration",type:e.SectionType.Uint},216698:{name:"DefaultDecodedFieldDuration",type:e.SectionType.Uint},209231:{name:"TrackTimecodeScale",type:e.SectionType.Float},4991:{name:"TrackOffset",type:e.SectionType.Int},5614:{name:"MaxBlockAdditionID",type:e.SectionType.Uint},4974:{name:"Name",type:e.SectionType.String},177564:{name:"Language",type:e.SectionType.String},6:{name:"CodecID",type:e.SectionType.String},9122:{name:"CodecPrivate",type:e.SectionType.Binary},362120:{name:"CodecName",type:e.SectionType.String},13382:{name:"AttachmentLink",type:e.SectionType.Uint},1742487:{name:"CodecSettings",type:e.SectionType.String},1785920:{name:"CodecInfoURL",type:e.SectionType.String},438848:{name:"CodecDownloadURL",type:e.SectionType.String},42:{name:"CodecDecodeAll",type:e.SectionType.Uint},12203:{name:"TrackOverlay",type:e.SectionType.Uint},5802:{name:"CodecDelay",type:e.SectionType.Uint},5819:{name:"SeekPreRoll",type:e.SectionType.Uint},9764:{name:"TrackTranslate",type:e.SectionType.Container},9980:{name:"TrackTranslateEditionUID",type:e.SectionType.Uint},9919:{name:"TrackTranslateCodec",type:e.SectionType.Uint},9893:{name:"TrackTranslateTrackID",type:e.SectionType.Binary},96:{name:"Video",type:e.SectionType.Container},26:{name:"FlagInterlaced",type:e.SectionType.Uint},5048:{name:"StereoMode",type:e.SectionType.Uint},5056:{name:"AlphaMode",type:e.SectionType.Uint},5049:{name:"OldStereoMode",type:e.SectionType.Uint},48:{name:"PixelWidth",type:e.SectionType.Uint},58:{name:"PixelHeight",type:e.SectionType.Uint},5290:{name:"PixelCropBottom",type:e.SectionType.Uint},5307:{name:"PixelCropTop",type:e.SectionType.Uint},5324:{name:"PixelCropLeft",type:e.SectionType.Uint},5341:{name:"PixelCropRight",type:e.SectionType.Uint},5296:{name:"DisplayWidth",type:e.SectionType.Uint},5306:{name:"DisplayHeight",type:e.SectionType.Uint},5298:{name:"DisplayUnit",type:e.SectionType.Uint},5299:{name:"AspectRatioType",type:e.SectionType.Uint},963876:{name:"ColourSpace",type:e.SectionType.Binary},1029411:{name:"GammaValue",type:e.SectionType.Float},230371:{name:"FrameRate",type:e.SectionType.Float},97:{name:"Audio",type:e.SectionType.Container},53:{name:"SamplingFrequency",type:e.SectionType.Float},14517:{name:"OutputSamplingFrequency",type:e.SectionType.Float},31:{name:"Channels",type:e.SectionType.Uint},15739:{name:"ChannelPositions",type:e.SectionType.Binary},8804:{name:"BitDepth",type:e.SectionType.Uint},98:{name:"TrackOperation",type:e.SectionType.Container},99:{name:"TrackCombinePlanes",type:e.SectionType.Container},100:{name:"TrackPlane",type:e.SectionType.Container},101:{name:"TrackPlaneUID",type:e.SectionType.Uint},102:{name:"TrackPlaneType",type:e.SectionType.Uint},105:{name:"TrackJoinBlocks",type:e.SectionType.Container},109:{name:"TrackJoinUID",type:e.SectionType.Uint},64:{name:"TrickTrackUID",type:e.SectionType.Uint},65:{name:"TrickTrackSegmentUID",type:e.SectionType.Binary},70:{name:"TrickTrackFlag",type:e.SectionType.Uint},71:{name:"TrickMasterTrackUID",type:e.SectionType.Uint},68:{name:"TrickMasterTrackSegmentUID",type:e.SectionType.Binary},11648:{name:"ContentEncodings",type:e.SectionType.Container},8768:{name:"ContentEncoding",type:e.SectionType.Container},4145:{name:"ContentEncodingOrder",type:e.SectionType.Uint},4146:{name:"ContentEncodingScope",type:e.SectionType.Uint},4147:{name:"ContentEncodingType",type:e.SectionType.Uint},4148:{name:"ContentCompression",type:e.SectionType.Container},596:{name:"ContentCompAlgo",type:e.SectionType.Uint},597:{name:"ContentCompSettings",type:e.SectionType.Binary},4149:{name:"ContentEncryption",type:e.SectionType.Container},2017:{name:"ContentEncAlgo",type:e.SectionType.Uint},2018:{name:"ContentEncKeyID",type:e.SectionType.Binary},2019:{name:"ContentSignature",type:e.SectionType.Binary},2020:{name:"ContentSigKeyID",type:e.SectionType.Binary},2021:{name:"ContentSigAlgo",type:e.SectionType.Uint},2022:{name:"ContentSigHashAlgo",type:e.SectionType.Uint},206814059:{name:"Cues",type:e.SectionType.Container},59:{name:"CuePoint",type:e.SectionType.Container},51:{name:"CueTime",type:e.SectionType.Uint},55:{name:"CueTrackPositions",type:e.SectionType.Container},119:{name:"CueTrack",type:e.SectionType.Uint},113:{name:"CueClusterPosition",type:e.SectionType.Uint},112:{name:"CueRelativePosition",type:e.SectionType.Uint},50:{name:"CueDuration",type:e.SectionType.Uint},4984:{name:"CueBlockNumber",type:e.SectionType.Uint},106:{name:"CueCodecState",type:e.SectionType.Uint},91:{name:"CueReference",type:e.SectionType.Container},22:{name:"CueRefTime",type:e.SectionType.Uint},23:{name:"CueRefCluster",type:e.SectionType.Uint},4959:{name:"CueRefNumber",type:e.SectionType.Uint},107:{name:"CueRefCodecState",type:e.SectionType.Uint},155296873:{name:"Attachments",type:e.SectionType.Container},8615:{name:"AttachedFile",type:e.SectionType.Container},1662:{name:"FileDescription",type:e.SectionType.String},1646:{name:"FileName",type:e.SectionType.String},1632:{name:"FileMimeType",type:e.SectionType.String},1628:{name:"FileData",type:e.SectionType.Binary},1710:{name:"FileUID",type:e.SectionType.Uint},1653:{name:"FileReferral",type:e.SectionType.Binary},1633:{name:"FileUsedStartTime",type:e.SectionType.Uint},1634:{name:"FileUsedEndTime",type:e.SectionType.Uint},4433776:{name:"Chapters",type:e.SectionType.Container},1465:{name:"EditionEntry",type:e.SectionType.Container},1468:{name:"EditionUID",type:e.SectionType.Uint},1469:{name:"EditionFlagHidden",type:e.SectionType.Uint},1499:{name:"EditionFlagDefault",type:e.SectionType.Uint},1501:{name:"EditionFlagOrdered",type:e.SectionType.Uint},54:{name:"ChapterAtom",type:e.SectionType.Container},13252:{name:"ChapterUID",type:e.SectionType.Uint},5716:{name:"ChapterStringUID",type:e.SectionType.String},17:{name:"ChapterTimeStart",type:e.SectionType.Uint},18:{name:"ChapterTimeEnd",type:e.SectionType.Uint},24:{name:"ChapterFlagHidden",type:e.SectionType.Uint},1432:{name:"ChapterFlagEnabled",type:e.SectionType.Uint},11879:{name:"ChapterSegmentUID",type:e.SectionType.Binary},11964:{name:"ChapterSegmentEditionUID",type:e.SectionType.Uint},9155:{name:"ChapterPhysicalEquiv",type:e.SectionType.Uint},15:{name:"ChapterTrack",type:e.SectionType.Container},9:{name:"ChapterTrackNumber",type:e.SectionType.Uint},0:{name:"ChapterDisplay",type:e.SectionType.Container},5:{name:"ChapString",type:e.SectionType.String},892:{name:"ChapLanguage",type:e.SectionType.String},894:{name:"ChapCountry",type:e.SectionType.String},10564:{name:"ChapProcess",type:e.SectionType.Container},10581:{name:"ChapProcessCodecID",type:e.SectionType.Uint},1293:{name:"ChapProcessPrivate",type:e.SectionType.Binary},10513:{name:"ChapProcessCommand",type:e.SectionType.Container},10530:{name:"ChapProcessTime",type:e.SectionType.Uint},10547:{name:"ChapProcessData",type:e.SectionType.Binary},39109479:{name:"Tags",type:e.SectionType.Container},13171:{name:"Tag",type:e.SectionType.Container},9152:{name:"Targets",type:e.SectionType.Container},10442:{name:"TargetTypeValue",type:e.SectionType.Uint},9162:{name:"TargetType",type:e.SectionType.String},9157:{name:"TagTrackUID",type:e.SectionType.Uint},9161:{name:"TagEditionUID",type:e.SectionType.Uint},9156:{name:"TagChapterUID",type:e.SectionType.Uint},9158:{name:"TagAttachmentUID",type:e.SectionType.Uint},10184:{name:"SimpleTag",type:e.SectionType.Container},1443:{name:"TagName",type:e.SectionType.String},1146:{name:"TagLanguage",type:e.SectionType.String},1156:{name:"TagDefault",type:e.SectionType.Uint},1159:{name:"TagString",type:e.SectionType.String},1157:{name:"TagBinary",type:e.SectionType.Binary},5552:{name:"Colour",type:e.SectionType.Container},5553:{name:"MatrixCoefficients",type:e.SectionType.Uint},5554:{name:"BitsPerChannel",type:e.SectionType.Uint},5555:{name:"ChromaSubsamplingHorz",type:e.SectionType.Uint},5556:{name:"ChromaSubsamplingVert",type:e.SectionType.Uint},5557:{name:"CbSubsamplingHorz",type:e.SectionType.Uint},5558:{name:"CbSubsamplingVert",type:e.SectionType.Uint},5559:{name:"ChromaSitingHorz",type:e.SectionType.Uint},5560:{name:"ChromaSitingVert",type:e.SectionType.Uint},5561:{name:"Range",type:e.SectionType.Uint},5562:{name:"TransferCharacteristics",type:e.SectionType.Uint},5563:{name:"Primaries",type:e.SectionType.Uint},5564:{name:"MaxCLL",type:e.SectionType.Uint},5565:{name:"MaxFALL",type:e.SectionType.Uint}},bG}var xG,kG={};function CG(){if(xG)return kG;xG=1,Object.defineProperty(kG,"__esModule",{value:!0}),kG.WebmUint=void 0;const e=gG();function t(e){return e.length%2==1?"0"+e:e}let n=class extends e.WebmBase{constructor(e,t=0){super(e,t)}getType(){return"Uint"}updateBySource(){this.data="";for(let e=0;e<this.source.length;e++){const n=this.source[e].toString(16);this.data+=t(n)}}updateByData(){const e=this.data.length/2;this.source=new Uint8Array(e);for(let t=0;t<e;t++){const e=this.data.substring(2*t,2*t+2);this.source[t]=parseInt(e,16)}}getValue(){return parseInt(this.data,16)}setValue(e){this.setData(t(e.toString(16)))}};return kG.WebmUint=n,kG}var SG,TG={};function DG(){if(SG)return TG;SG=1,Object.defineProperty(TG,"__esModule",{value:!0}),TG.WebmFloat=void 0;const e=gG();let t=class extends e.WebmBase{constructor(e,t=0){super(e,t)}getType(){return"Float"}getFloatArrayType(){return this.source&&4===this.source.length?Float32Array:Float64Array}updateBySource(){const e=this.source.reverse(),t=new(this.getFloatArrayType())(e.buffer);this.data=t[0]}updateByData(){const e=new(this.getFloatArrayType())([this.data]),t=new Uint8Array(e.buffer);this.source=t.reverse()}};return TG.WebmFloat=t,TG}var AG,OG,PG={};function IG(){if(AG)return PG;AG=1,Object.defineProperty(PG,"__esModule",{value:!0}),PG.WebmString=void 0;const e=gG();let t=class extends e.WebmBase{constructor(e,t=0){super(e,t)}getType(){return"String"}updateBySource(){this.data=this.source}updateByData(){this.source=this.data}getValue(){let e="";return this.source.forEach(t=>{e+=String.fromCharCode(t)}),e}};return PG.WebmString=t,PG}function NG(){if(OG)return yG;OG=1,Object.defineProperty(yG,"__esModule",{value:!0}),yG.WebmContainer=void 0;const e=gG(),t=_G(),n=EG(),r=CG(),o=DG(),i=IG();let a=class a extends e.WebmBase{constructor(e,t=!1,n=0){super(e,n),this.isInfinite=t,this.offset=0}getType(){return"Container"}readByte(){return this.source[this.offset++]}readUint(){const e=this.readByte(),t=8-e.toString(2).length;let n=e-(1<<7-t);for(let e=0;e<t;e++)n<<=8,n|=this.readByte();return n}updateBySource(){var s;let l;for(this.data=[],this.offset=0;this.offset<this.source.length;this.offset=l){const u=this.offset,c=this.readUint(),{name:d,type:p}=null!==(s=t.sections[c])&&void 0!==s?s:{},f=this.readUint();l=this.source.length,f>=0&&(l=Math.min(this.offset+f,l));const h=this.source.slice(this.offset,l);let g;switch(p){case n.SectionType.Container:g=new a(d,f<0,u);break;case n.SectionType.Uint:g=new r.WebmUint(d,u);break;case n.SectionType.Float:g=new o.WebmFloat(d,u);break;case n.SectionType.String:g=new i.WebmString(d,u);break;default:g=new e.WebmBase(d,u)}g.setSource(h),this.data.push({id:c,idHex:c.toString(16),data:g})}}writeUint(e,t=!1){let n;for(n=1;(e<0||e>=1<<7*n)&&n<8;n++);if(!t){for(let t=0;t<n;t++)this.source[this.offset+t]=e>>8*(n-1-t)&255;this.source[this.offset]&=(1<<8-n)-1,this.source[this.offset]|=1<<8-n}this.offset+=n}writeSections(e=!1){this.offset=0;for(let t=0;t<this.data.length;t++){const n=this.data[t],r=n.data.source,o=r.length;this.writeUint(n.id,e),this.writeUint(n.data instanceof a&&n.data.isInfinite?-1:o,e),e||this.source.set(r,this.offset),this.offset+=o}return this.offset}updateByData(){const e=this.writeSections(!0);this.source=new Uint8Array(e),this.writeSections()}getSectionById(e){for(let t=0;t<this.data.length;t++){const n=this.data[t];if(n.id===e)return n.data}return null}};return yG.WebmContainer=a,yG}var RG,BG={};var FG,LG,MG={};function UG(){return LG||(LG=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=dG;t.__exportStar(gG(),e),t.__exportStar(NG(),e),t.__exportStar(function(){if(RG)return BG;RG=1,Object.defineProperty(BG,"__esModule",{value:!0}),BG.WebmFile=void 0;const e=dG,t=NG();let n=class n extends t.WebmContainer{constructor(e){super("File"),this.setSource(e)}getType(){return"File"}toBlob(e="video/webm"){return new Blob([this.source.buffer],{type:e})}static blobToArray(e){return new Promise((t,n)=>{try{const r=new FileReader;r.onloadend=()=>{try{t(new Uint8Array(r.result))}catch(e){n(e)}},r.readAsArrayBuffer(e)}catch(e){n(e)}})}static fromBlob(t){return e.__awaiter(this,void 0,void 0,function*(){const e=yield n.blobToArray(t);return new n(e)})}};return BG.WebmFile=n,BG}(),e),t.__exportStar(DG(),e),t.__exportStar(IG(),e),t.__exportStar(CG(),e),t.__exportStar(EG(),e),t.__exportStar((FG||(FG=1,Object.defineProperty(MG,"__esModule",{value:!0})),MG),e),t.__exportStar(_G(),e)}(fG)),fG}var jG,$G,zG={};function HG(){if(jG)return zG;jG=1,Object.defineProperty(zG,"__esModule",{value:!0}),zG.fixParsedWebmDuration=void 0;const e=UG();return zG.fixParsedWebmDuration=(t,n,r={})=>{let o=r.logger;void 0===o?o=e=>console.debug(e):o||(o=()=>{});const i=t.getSectionById(139690087);if(!i)return o("[fix-webm-duration] Segment section is missing"),!1;const a=i.getSectionById(88713574);if(!a)return o("[fix-webm-duration] Info section is missing"),!1;const s=a.getSectionById(710577);if(!s)return o("[fix-webm-duration] TimecodeScale section is missing"),!1;let l=a.getSectionById(1161);if(l){if(!(l.getValue()<=0))return o(`[fix-webm-duration] Duration section is present, and the value is ${l.getValue()}`),!1;o(`[fix-webm-duration] Duration section is present, but the value is ${l.getValue()}`),l.setValue(n)}else o("[fix-webm-duration] Duration section is missing"),l=new e.WebmFloat("Duration"),l.setValue(n),a.data.push({id:1161,data:l});return s.setValue(1e6),a.updateByData(),i.updateByData(),t.updateByData(),!0},zG}!function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=dG;t.__exportStar(function(){if($G)return pG;$G=1,Object.defineProperty(pG,"__esModule",{value:!0}),pG.fixWebmDuration=void 0;const e=dG,t=UG(),n=HG();return pG.fixWebmDuration=(r,o,i)=>e.__awaiter(void 0,void 0,void 0,function*(){try{const e=yield t.WebmFile.fromBlob(r);if((0,n.fixParsedWebmDuration)(e,o,i))return e.toBlob(r.type)}catch(e){}return r}),pG}(),e),t.__exportStar(HG(),e)}(Iq);const VG=ke('<div class="p-2 flex gap-2 border-gray-100 overflow-auto">'),WG=ke('<div class="flex justify-between h-full max-h-[150px] items-center">'),qG=ke("<div>"),GG=e=>{const[t,n]=S(e.defaultValue??""),[r,o]=S([]),[i,a]=S(void 0),[s,l]=S(!1),[u,c]=S("stopped");let d,p,f,h=[];const g=e=>n(e),m=async()=>{if("started"===u()&&f)f.stop();else if(""!==d?.value&&d?.reportValidity()){let n;if(r().length>0){a(void 0);const t=await Eq({apiHost:e.context.apiHost??_t({ignoreChatApiUrl:!0}),files:r().map(t=>({file:t,input:{sessionId:e.context.sessionId,fileName:t.name}})),onUploadProgress:a});n=t?.filter(Ye)}e.onSubmit({type:"text",value:d?.value??t(),attachments:n})}else d?.focus()},v=e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),m())};P(()=>{!Li()&&d&&d.focus({preventScroll:!0})}),oq(e=>{const{data:t}=e;"setInputValue"===t.command&&n(t.value)});const y=e=>{e.preventDefault(),l(!0)},b=()=>l(!1),w=e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer?.files&&E(e.dataTransfer.files)},E=e=>{const t=Array.from(e).map(e=>bq({existingFiles:r(),newFile:e,onError:({description:e,title:t})=>{wq.create({description:e,title:t})}})).filter(Ye);0!==t.length&&o(e=>[...t,...e])},_=()=>{c("asking")},x=t=>{let n;const r=MediaRecorder.isTypeSupported("audio/webm")?"audio/webm":"video/mp4";f=new MediaRecorder(t,{mimeType:r}),f.ondataavailable=e=>{0!==e.data.size&&h.push(e.data)},f.onstart=()=>{n=Date.now()},f.onstop=async()=>{if("started"!==u()||0===h.length)return;const t=Date.now()-n,o=await Iq.fixWebmDuration(new Blob(h,{type:r}),t),i=new File([o],`rec-${e.block.id}-${Date.now()}.${"audio/webm"===r?"webm":"mp4"}`,{type:r});a(void 0);const s=(await Eq({apiHost:e.context.apiHost??_t({ignoreChatApiUrl:!0}),files:[{file:i,input:{sessionId:e.context.sessionId,fileName:i.name}}],onUploadProgress:a})).filter(Ye).map(e=>e.url);e.onSubmit({type:"recording",url:s[0]})},f.start(),c("started")},k=()=>{f?.stop(),c("stopped"),f=void 0,h=[]},C=Boolean(i()),D=te(he,{get children(){return[te(ge,{get when(){return!t()&&"started"!==u()&&e.block.options?.audioClip?.isEnabled},get children(){return te(eq,{"on:click":_,"aria-label":"Record voice",get children(){return te(Pq,{})}})}}),te(ge,{when:!0,get children(){return te(tq,{isDisabled:C,get children(){return e.block.options?.labels?.button}})}})]}});return te(rq,{onSubmit:m,customButton:D,class:"items-end",get isInputDisabled(){return e.isInputDisabled},get hasError(){return e.hasError},get children(){const n=qG();return n.addEventListener("dragleave",b),n.addEventListener("dragover",y),n.addEventListener("drop",w),Pe(n,te(Tq,{get recordingStatus(){return u()},get buttonsTheme(){return e.context.bot.theme.chat?.buttons},onRecordingConfirmed:x,onAbortRecording:k}),null),Pe(n,te(fe,{get when(){return"started"!==u()},get children(){return[te(fe,{get when(){return r().length},get children(){const e=VG();return e.style.setProperty("border-bottom-width","1px"),Pe(e,te(de,{get each(){return r()},children:(e,t)=>te(GW,{file:e,get uploadProgressPercent(){return A(()=>!!i())()?A(()=>i()?.fileIndex===t())()?20:t()<(i()?.fileIndex??0)?100:0:void 0},onRemoveClick:()=>(e=>{o(t=>t.filter((t,n)=>n!==e))})(t())})})),e}}),(()=>{const n=WG();return"function"==typeof p?Oe(p,n):p=n,Pe(n,te(HW,{containerRef:p,ref(e){"function"==typeof d?d(e):d=e},onInput:g,onKeyDown:v,get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??sq.placeholder}}),null),Pe(n,te(fe,{get when(){return(e.block.options?.attachments?.isEnabled??lq.isEnabled)&&e.block.options?.attachments?.saveVariableId},get children(){return te(yq,{onNewFiles:E,class:"ml-2"})}}),null),n})()]}}),null),T(()=>Te(n,tt("flex-col w-full relative",s()&&"filter brightness-95"))),n}})},KG={placeholder:"Type a number..."},YG=ke('<input class="focus:outline-none bg-transparent flex-1 w-full" type="number">'),ZG=e=>{const[t,n]=S(e.defaultValue??""),[r,o,i]=[O(a=()=>t()),function(e){D(function(){const t=a();if(null==t)return void(e.value=t);const n=e.value;(0===t&&""===n||t!=n)&&(e.value=t+"")})},function(e){return e.validity.badInput?a():""!=e.value?e.valueAsNumber:void 0}];var a;let s;const l=()=>{""!==s?.value&&s?.reportValidity()?e.onSubmit({type:"text",value:s?.value??t().toString()}):s?.focus()},u=e=>{"Enter"===e.key&&(e.preventDefault(),l())};return oq(e=>{const{data:t}=e;"setInputValue"===t.command&&n(t.value)}),P(()=>{!Li()&&s&&s.focus({preventScroll:!0})}),te(rq,{onSubmit:l,get buttonLabel(){return e.block.options?.labels?.button},get children(){const t=YG();t.$$keydown=u,t.$$input=e=>{n(i(e.currentTarget))},Oe(o,t,()=>!0);return"function"==typeof s?Oe(s,t):s=t,t.style.setProperty("font-size","16px"),t.style.setProperty("appearance","auto"),t.value=r,T(n=>{const r=e.block.options?.labels?.placeholder??KG.placeholder,o=e.block.options?.min,i=e.block.options?.max,a=e.block.options?.step??"any";return r!==n._v$&&Se(t,"placeholder",n._v$=r),o!==n._v$2&&Se(t,"min",n._v$2=o),i!==n._v$3&&Se(t,"max",n._v$3=i),a!==n._v$4&&Se(t,"step",n._v$4=a),n},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),t}})};Ce(["input","keydown"]);const XG=ke('<input class="focus:outline-none bg-transparent flex-1 w-full" type="text">'),QG=e=>{const[t,n]=se(e,["ref","onInput"]);return(()=>{const r=XG();r.$$input=e=>t.onInput(e.currentTarget.value);const o=e.ref;return"function"==typeof o?Oe(o,r):e.ref=r,r.style.setProperty("font-size","16px"),Ae(r,n,!1,!1),r})()};Ce(["input"]);const JG={placeholder:"Type your email..."},eK=e=>{const[t,n]=S(e.defaultValue??"");let r;const o=e=>n(e),i=()=>{""!==r?.value&&r?.reportValidity()?e.onSubmit({type:"text",value:r?.value??t()}):r?.focus()},a=e=>{"Enter"===e.key&&(e.preventDefault(),i())};return oq(e=>{const{data:t}=e;"setInputValue"===t.command&&n(t.value)}),P(()=>{!Li()&&r&&r.focus({preventScroll:!0})}),te(rq,{onSubmit:i,get buttonLabel(){return e.block.options?.labels?.button},get isInputDisabled(){return e.isInputDisabled},get hasError(){return e.hasError},get children(){return te(QG,{ref(e){"function"==typeof r?r(e):r=e},type:"email",autocomplete:"email",get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??JG.placeholder},onInput:o,onKeyDown:a})}})},tK={placeholder:"Type a URL..."},nK=e=>{const[t,n]=S(e.defaultValue??"");let r;const o=e=>{n(e)},i=()=>{r&&!r?.value.startsWith("http")&&(r.value=`https://${r.value}`),""!==r?.value&&r?.reportValidity()?e.onSubmit({type:"text",value:r?.value??t()}):r?.focus()},a=e=>{"Enter"===e.key&&(e.preventDefault(),i())};return oq(e=>{const{data:t}=e;"setInputValue"===t.command&&n(t.value)}),P(()=>{!Li()&&r&&r.focus({preventScroll:!0})}),te(rq,{onSubmit:i,get buttonLabel(){return e.block.options?.labels?.button},get isInputDisabled(){return e.isInputDisabled},get hasError(){return e.hasError},get children(){return te(QG,{ref(e){"function"==typeof r?r(e):r=e},get value(){return t()},get placeholder(){return e.block.options?.labels?.placeholder??tK.placeholder},onInput:o,onKeyDown:a,type:"url",autocomplete:"url"})}})},rK=ke('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2px" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9">'),oK=e=>(()=>{const t=rK();return Ae(t,e,!0,!0),t})(),iK=[{name:"International",flag:"🌐",code:"INT",dial_code:null},{name:"Afghanistan",flag:"🇦🇫",code:"AF",dial_code:"+93"},{name:"Åland Islands",flag:"🇦🇽",code:"AX",dial_code:"+358"},{name:"Albania",flag:"🇦🇱",code:"AL",dial_code:"+355"},{name:"Algeria",flag:"🇩🇿",code:"DZ",dial_code:"+213"},{name:"American Samoa",flag:"🇦🇸",code:"AS",dial_code:"+1684"},{name:"Andorra",flag:"🇦🇩",code:"AD",dial_code:"+376"},{name:"Angola",flag:"🇦🇴",code:"AO",dial_code:"+244"},{name:"Anguilla",flag:"🇦🇮",code:"AI",dial_code:"+1264"},{name:"Antarctica",flag:"🇦🇶",code:"AQ",dial_code:"+672"},{name:"Antigua and Barbuda",flag:"🇦🇬",code:"AG",dial_code:"+1268"},{name:"Argentina",flag:"🇦🇷",code:"AR",dial_code:"+54"},{name:"Armenia",flag:"🇦🇲",code:"AM",dial_code:"+374"},{name:"Aruba",flag:"🇦🇼",code:"AW",dial_code:"+297"},{name:"Australia",flag:"🇦🇺",code:"AU",dial_code:"+61"},{name:"Austria",flag:"🇦🇹",code:"AT",dial_code:"+43"},{name:"Azerbaijan",flag:"🇦🇿",code:"AZ",dial_code:"+994"},{name:"Bahamas",flag:"🇧🇸",code:"BS",dial_code:"+1242"},{name:"Bahrain",flag:"🇧🇭",code:"BH",dial_code:"+973"},{name:"Bangladesh",flag:"🇧🇩",code:"BD",dial_code:"+880"},{name:"Barbados",flag:"🇧🇧",code:"BB",dial_code:"+1246"},{name:"Belarus",flag:"🇧🇾",code:"BY",dial_code:"+375"},{name:"Belgium",flag:"🇧🇪",code:"BE",dial_code:"+32"},{name:"Belize",flag:"🇧🇿",code:"BZ",dial_code:"+501"},{name:"Benin",flag:"🇧🇯",code:"BJ",dial_code:"+229"},{name:"Bermuda",flag:"🇧🇲",code:"BM",dial_code:"+1441"},{name:"Bhutan",flag:"🇧🇹",code:"BT",dial_code:"+975"},{name:"Bolivia, Plurinational State of bolivia",flag:"🇧🇴",code:"BO",dial_code:"+591"},{name:"Bosnia and Herzegovina",flag:"🇧🇦",code:"BA",dial_code:"+387"},{name:"Botswana",flag:"🇧🇼",code:"BW",dial_code:"+267"},{name:"Bouvet Island",flag:"🇧🇻",code:"BV",dial_code:"+47"},{name:"Brazil",flag:"🇧🇷",code:"BR",dial_code:"+55"},{name:"British Indian Ocean Territory",flag:"🇮🇴",code:"IO",dial_code:"+246"},{name:"Brunei Darussalam",flag:"🇧🇳",code:"BN",dial_code:"+673"},{name:"Bulgaria",flag:"🇧🇬",code:"BG",dial_code:"+359"},{name:"Burkina Faso",flag:"🇧🇫",code:"BF",dial_code:"+226"},{name:"Burundi",flag:"🇧🇮",code:"BI",dial_code:"+257"},{name:"Cambodia",flag:"🇰🇭",code:"KH",dial_code:"+855"},{name:"Cameroon",flag:"🇨🇲",code:"CM",dial_code:"+237"},{name:"Canada",flag:"🇨🇦",code:"CA",dial_code:"+1"},{name:"Cape Verde",flag:"🇨🇻",code:"CV",dial_code:"+238"},{name:"Cayman Islands",flag:"🇰🇾",code:"KY",dial_code:"+345"},{name:"Central African Republic",flag:"🇨🇫",code:"CF",dial_code:"+236"},{name:"Chad",flag:"🇹🇩",code:"TD",dial_code:"+235"},{name:"Chile",flag:"🇨🇱",code:"CL",dial_code:"+56"},{name:"China",flag:"🇨🇳",code:"CN",dial_code:"+86"},{name:"Christmas Island",flag:"🇨🇽",code:"CX",dial_code:"+61"},{name:"Cocos (Keeling) Islands",flag:"🇨🇨",code:"CC",dial_code:"+61"},{name:"Colombia",flag:"🇨🇴",code:"CO",dial_code:"+57"},{name:"Comoros",flag:"🇰🇲",code:"KM",dial_code:"+269"},{name:"Congo",flag:"🇨🇬",code:"CG",dial_code:"+242"},{name:"Congo, The Democratic Republic of the Congo",flag:"🇨🇩",code:"CD",dial_code:"+243"},{name:"Cook Islands",flag:"🇨🇰",code:"CK",dial_code:"+682"},{name:"Costa Rica",flag:"🇨🇷",code:"CR",dial_code:"+506"},{name:"Cote d'Ivoire",flag:"🇨🇮",code:"CI",dial_code:"+225"},{name:"Croatia",flag:"🇭🇷",code:"HR",dial_code:"+385"},{name:"Cuba",flag:"🇨🇺",code:"CU",dial_code:"+53"},{name:"Cyprus",flag:"🇨🇾",code:"CY",dial_code:"+357"},{name:"Czech Republic",flag:"🇨🇿",code:"CZ",dial_code:"+420"},{name:"Denmark",flag:"🇩🇰",code:"DK",dial_code:"+45"},{name:"Djibouti",flag:"🇩🇯",code:"DJ",dial_code:"+253"},{name:"Dominica",flag:"🇩🇲",code:"DM",dial_code:"+1767"},{name:"Dominican Republic",flag:"🇩🇴",code:"DO",dial_code:"+1849"},{name:"Dominican Republic",flag:"🇩🇴",code:"DO",dial_code:"+1829"},{name:"Dominican Republic",flag:"🇩🇴",code:"DO",dial_code:"+1809"},{name:"Ecuador",flag:"🇪🇨",code:"EC",dial_code:"+593"},{name:"Egypt",flag:"🇪🇬",code:"EG",dial_code:"+20"},{name:"El Salvador",flag:"🇸🇻",code:"SV",dial_code:"+503"},{name:"Equatorial Guinea",flag:"🇬🇶",code:"GQ",dial_code:"+240"},{name:"Eritrea",flag:"🇪🇷",code:"ER",dial_code:"+291"},{name:"Estonia",flag:"🇪🇪",code:"EE",dial_code:"+372"},{name:"Ethiopia",flag:"🇪🇹",code:"ET",dial_code:"+251"},{name:"Falkland Islands (Malvinas)",flag:"🇫🇰",code:"FK",dial_code:"+500"},{name:"Faroe Islands",flag:"🇫🇴",code:"FO",dial_code:"+298"},{name:"Fiji",flag:"🇫🇯",code:"FJ",dial_code:"+679"},{name:"Finland",flag:"🇫🇮",code:"FI",dial_code:"+358"},{name:"France",flag:"🇫🇷",code:"FR",dial_code:"+33"},{name:"French Guiana",flag:"🇬🇫",code:"GF",dial_code:"+594"},{name:"French Polynesia",flag:"🇵🇫",code:"PF",dial_code:"+689"},{name:"French Southern Territories",flag:"🇹🇫",code:"TF",dial_code:"+262"},{name:"Gabon",flag:"🇬🇦",code:"GA",dial_code:"+241"},{name:"Gambia",flag:"🇬🇲",code:"GM",dial_code:"+220"},{name:"Georgia",flag:"🇬🇪",code:"GE",dial_code:"+995"},{name:"Germany",flag:"🇩🇪",code:"DE",dial_code:"+49"},{name:"Ghana",flag:"🇬🇭",code:"GH",dial_code:"+233"},{name:"Gibraltar",flag:"🇬🇮",code:"GI",dial_code:"+350"},{name:"Greece",flag:"🇬🇷",code:"GR",dial_code:"+30"},{name:"Greenland",flag:"🇬🇱",code:"GL",dial_code:"+299"},{name:"Grenada",flag:"🇬🇩",code:"GD",dial_code:"+1473"},{name:"Guadeloupe",flag:"🇬🇵",code:"GP",dial_code:"+590"},{name:"Guam",flag:"🇬🇺",code:"GU",dial_code:"+1671"},{name:"Guatemala",flag:"🇬🇹",code:"GT",dial_code:"+502"},{name:"Guernsey",flag:"🇬🇬",code:"GG",dial_code:"+44"},{name:"Guinea",flag:"🇬🇳",code:"GN",dial_code:"+224"},{name:"Guinea-Bissau",flag:"🇬🇼",code:"GW",dial_code:"+245"},{name:"Guyana",flag:"🇬🇾",code:"GY",dial_code:"+592"},{name:"Haiti",flag:"🇭🇹",code:"HT",dial_code:"+509"},{name:"Heard Island and Mcdonald Islands",flag:"🇭🇲",code:"HM",dial_code:"+672"},{name:"Holy See (Vatican City State)",flag:"🇻🇦",code:"VA",dial_code:"+379"},{name:"Honduras",flag:"🇭🇳",code:"HN",dial_code:"+504"},{name:"Hong Kong",flag:"🇭🇰",code:"HK",dial_code:"+852"},{name:"Hungary",flag:"🇭🇺",code:"HU",dial_code:"+36"},{name:"Iceland",flag:"🇮🇸",code:"IS",dial_code:"+354"},{name:"India",flag:"🇮🇳",code:"IN",dial_code:"+91"},{name:"Indonesia",flag:"🇮🇩",code:"ID",dial_code:"+62"},{name:"Iran, Islamic Republic of Persian Gulf",flag:"🇮🇷",code:"IR",dial_code:"+98"},{name:"Iraq",flag:"🇮🇶",code:"IQ",dial_code:"+964"},{name:"Ireland",flag:"🇮🇪",code:"IE",dial_code:"+353"},{name:"Isle of Man",flag:"🇮🇲",code:"IM",dial_code:"+44"},{name:"Israel",flag:"🇮🇱",code:"IL",dial_code:"+972"},{name:"Italy",flag:"🇮🇹",code:"IT",dial_code:"+39"},{name:"Jamaica",flag:"🇯🇲",code:"JM",dial_code:"+1876"},{name:"Japan",flag:"🇯🇵",code:"JP",dial_code:"+81"},{name:"Jersey",flag:"🇯🇪",code:"JE",dial_code:"+44"},{name:"Jordan",flag:"🇯🇴",code:"JO",dial_code:"+962"},{name:"Kazakhstan",flag:"🇰🇿",code:"KZ",dial_code:"+7"},{name:"Kenya",flag:"🇰🇪",code:"KE",dial_code:"+254"},{name:"Kiribati",flag:"🇰🇮",code:"KI",dial_code:"+686"},{name:"Korea, Democratic People's Republic of Korea",flag:"🇰🇵",code:"KP",dial_code:"+850"},{name:"Korea, Republic of South Korea",flag:"🇰🇷",code:"KR",dial_code:"+82"},{name:"Kosovo",flag:"🇽🇰",code:"XK",dial_code:"+383"},{name:"Kuwait",flag:"🇰🇼",code:"KW",dial_code:"+965"},{name:"Kyrgyzstan",flag:"🇰🇬",code:"KG",dial_code:"+996"},{name:"Laos",flag:"🇱🇦",code:"LA",dial_code:"+856"},{name:"Latvia",flag:"🇱🇻",code:"LV",dial_code:"+371"},{name:"Lebanon",flag:"🇱🇧",code:"LB",dial_code:"+961"},{name:"Lesotho",flag:"🇱🇸",code:"LS",dial_code:"+266"},{name:"Liberia",flag:"🇱🇷",code:"LR",dial_code:"+231"},{name:"Libyan Arab Jamahiriya",flag:"🇱🇾",code:"LY",dial_code:"+218"},{name:"Liechtenstein",flag:"🇱🇮",code:"LI",dial_code:"+423"},{name:"Lithuania",flag:"🇱🇹",code:"LT",dial_code:"+370"},{name:"Luxembourg",flag:"🇱🇺",code:"LU",dial_code:"+352"},{name:"Macao",flag:"🇲🇴",code:"MO",dial_code:"+853"},{name:"Macedonia",flag:"🇲🇰",code:"MK",dial_code:"+389"},{name:"Madagascar",flag:"🇲🇬",code:"MG",dial_code:"+261"},{name:"Malawi",flag:"🇲🇼",code:"MW",dial_code:"+265"},{name:"Malaysia",flag:"🇲🇾",code:"MY",dial_code:"+60"},{name:"Maldives",flag:"🇲🇻",code:"MV",dial_code:"+960"},{name:"Mali",flag:"🇲🇱",code:"ML",dial_code:"+223"},{name:"Malta",flag:"🇲🇹",code:"MT",dial_code:"+356"},{name:"Marshall Islands",flag:"🇲🇭",code:"MH",dial_code:"+692"},{name:"Martinique",flag:"🇲🇶",code:"MQ",dial_code:"+596"},{name:"Mauritania",flag:"🇲🇷",code:"MR",dial_code:"+222"},{name:"Mauritius",flag:"🇲🇺",code:"MU",dial_code:"+230"},{name:"Mayotte",flag:"🇾🇹",code:"YT",dial_code:"+262"},{name:"Mexico",flag:"🇲🇽",code:"MX",dial_code:"+52"},{name:"Micronesia, Federated States of Micronesia",flag:"🇫🇲",code:"FM",dial_code:"+691"},{name:"Moldova",flag:"🇲🇩",code:"MD",dial_code:"+373"},{name:"Monaco",flag:"🇲🇨",code:"MC",dial_code:"+377"},{name:"Mongolia",flag:"🇲🇳",code:"MN",dial_code:"+976"},{name:"Montenegro",flag:"🇲🇪",code:"ME",dial_code:"+382"},{name:"Montserrat",flag:"🇲🇸",code:"MS",dial_code:"+1664"},{name:"Morocco",flag:"🇲🇦",code:"MA",dial_code:"+212"},{name:"Mozambique",flag:"🇲🇿",code:"MZ",dial_code:"+258"},{name:"Myanmar",flag:"🇲🇲",code:"MM",dial_code:"+95"},{name:"Namibia",flag:"🇳🇦",code:"NA",dial_code:"+264"},{name:"Nauru",flag:"🇳🇷",code:"NR",dial_code:"+674"},{name:"Nepal",flag:"🇳🇵",code:"NP",dial_code:"+977"},{name:"Netherlands",flag:"🇳🇱",code:"NL",dial_code:"+31"},{name:"Netherlands Antilles",flag:"",code:"AN",dial_code:"+599"},{name:"New Caledonia",flag:"🇳🇨",code:"NC",dial_code:"+687"},{name:"New Zealand",flag:"🇳🇿",code:"NZ",dial_code:"+64"},{name:"Nicaragua",flag:"🇳🇮",code:"NI",dial_code:"+505"},{name:"Niger",flag:"🇳🇪",code:"NE",dial_code:"+227"},{name:"Nigeria",flag:"🇳🇬",code:"NG",dial_code:"+234"},{name:"Niue",flag:"🇳🇺",code:"NU",dial_code:"+683"},{name:"Norfolk Island",flag:"🇳🇫",code:"NF",dial_code:"+672"},{name:"Northern Mariana Islands",flag:"🇲🇵",code:"MP",dial_code:"+1670"},{name:"Norway",flag:"🇳🇴",code:"NO",dial_code:"+47"},{name:"Oman",flag:"🇴🇲",code:"OM",dial_code:"+968"},{name:"Pakistan",flag:"🇵🇰",code:"PK",dial_code:"+92"},{name:"Palau",flag:"🇵🇼",code:"PW",dial_code:"+680"},{name:"Palestinian Territory, Occupied",flag:"🇵🇸",code:"PS",dial_code:"+970"},{name:"Panama",flag:"🇵🇦",code:"PA",dial_code:"+507"},{name:"Papua New Guinea",flag:"🇵🇬",code:"PG",dial_code:"+675"},{name:"Paraguay",flag:"🇵🇾",code:"PY",dial_code:"+595"},{name:"Peru",flag:"🇵🇪",code:"PE",dial_code:"+51"},{name:"Philippines",flag:"🇵🇭",code:"PH",dial_code:"+63"},{name:"Pitcairn",flag:"🇵🇳",code:"PN",dial_code:"+64"},{name:"Poland",flag:"🇵🇱",code:"PL",dial_code:"+48"},{name:"Portugal",flag:"🇵🇹",code:"PT",dial_code:"+351"},{name:"Puerto Rico",flag:"🇵🇷",code:"PR",dial_code:"+1939"},{name:"Qatar",flag:"🇶🇦",code:"QA",dial_code:"+974"},{name:"Romania",flag:"🇷🇴",code:"RO",dial_code:"+40"},{name:"Russia",flag:"🇷🇺",code:"RU",dial_code:"+7"},{name:"Rwanda",flag:"🇷🇼",code:"RW",dial_code:"+250"},{name:"Reunion",flag:"🇷🇪",code:"RE",dial_code:"+262"},{name:"Saint Barthelemy",flag:"🇧🇱",code:"BL",dial_code:"+590"},{name:"Saint Helena, Ascension and Tristan Da Cunha",flag:"🇸🇭",code:"SH",dial_code:"+290"},{name:"Saint Kitts and Nevis",flag:"🇰🇳",code:"KN",dial_code:"+1869"},{name:"Saint Lucia",flag:"🇱🇨",code:"LC",dial_code:"+1758"},{name:"Saint Martin",flag:"🇲🇫",code:"MF",dial_code:"+590"},{name:"Saint Pierre and Miquelon",flag:"🇵🇲",code:"PM",dial_code:"+508"},{name:"Saint Vincent and the Grenadines",flag:"🇻🇨",code:"VC",dial_code:"+1784"},{name:"Samoa",flag:"🇼🇸",code:"WS",dial_code:"+685"},{name:"San Marino",flag:"🇸🇲",code:"SM",dial_code:"+378"},{name:"Sao Tome and Principe",flag:"🇸🇹",code:"ST",dial_code:"+239"},{name:"Saudi Arabia",flag:"🇸🇦",code:"SA",dial_code:"+966"},{name:"Senegal",flag:"🇸🇳",code:"SN",dial_code:"+221"},{name:"Serbia",flag:"🇷🇸",code:"RS",dial_code:"+381"},{name:"Seychelles",flag:"🇸🇨",code:"SC",dial_code:"+248"},{name:"Sierra Leone",flag:"🇸🇱",code:"SL",dial_code:"+232"},{name:"Singapore",flag:"🇸🇬",code:"SG",dial_code:"+65"},{name:"Slovakia",flag:"🇸🇰",code:"SK",dial_code:"+421"},{name:"Slovenia",flag:"🇸🇮",code:"SI",dial_code:"+386"},{name:"Solomon Islands",flag:"🇸🇧",code:"SB",dial_code:"+677"},{name:"Somalia",flag:"🇸🇴",code:"SO",dial_code:"+252"},{name:"South Africa",flag:"🇿🇦",code:"ZA",dial_code:"+27"},{name:"South Sudan",flag:"🇸🇸",code:"SS",dial_code:"+211"},{name:"South Georgia and the South Sandwich Islands",flag:"🇬🇸",code:"GS",dial_code:"+500"},{name:"Spain",flag:"🇪🇸",code:"ES",dial_code:"+34"},{name:"Sri Lanka",flag:"🇱🇰",code:"LK",dial_code:"+94"},{name:"Sudan",flag:"🇸🇩",code:"SD",dial_code:"+249"},{name:"Suriname",flag:"🇸🇷",code:"SR",dial_code:"+597"},{name:"Svalbard and Jan Mayen",flag:"🇸🇯",code:"SJ",dial_code:"+47"},{name:"Swaziland",flag:"🇸🇿",code:"SZ",dial_code:"+268"},{name:"Sweden",flag:"🇸🇪",code:"SE",dial_code:"+46"},{name:"Switzerland",flag:"🇨🇭",code:"CH",dial_code:"+41"},{name:"Syrian Arab Republic",flag:"🇸🇾",code:"SY",dial_code:"+963"},{name:"Taiwan",flag:"🇹🇼",code:"TW",dial_code:"+886"},{name:"Tajikistan",flag:"🇹🇯",code:"TJ",dial_code:"+992"},{name:"Tanzania, United Republic of Tanzania",flag:"🇹🇿",code:"TZ",dial_code:"+255"},{name:"Thailand",flag:"🇹🇭",code:"TH",dial_code:"+66"},{name:"Timor-Leste",flag:"🇹🇱",code:"TL",dial_code:"+670"},{name:"Togo",flag:"🇹🇬",code:"TG",dial_code:"+228"},{name:"Tokelau",flag:"🇹🇰",code:"TK",dial_code:"+690"},{name:"Tonga",flag:"🇹🇴",code:"TO",dial_code:"+676"},{name:"Trinidad and Tobago",flag:"🇹🇹",code:"TT",dial_code:"+1868"},{name:"Tunisia",flag:"🇹🇳",code:"TN",dial_code:"+216"},{name:"Turkey",flag:"🇹🇷",code:"TR",dial_code:"+90"},{name:"Turkmenistan",flag:"🇹🇲",code:"TM",dial_code:"+993"},{name:"Turks and Caicos Islands",flag:"🇹🇨",code:"TC",dial_code:"+1649"},{name:"Tuvalu",flag:"🇹🇻",code:"TV",dial_code:"+688"},{name:"Uganda",flag:"🇺🇬",code:"UG",dial_code:"+256"},{name:"Ukraine",flag:"🇺🇦",code:"UA",dial_code:"+380"},{name:"United Arab Emirates",flag:"🇦🇪",code:"AE",dial_code:"+971"},{name:"United Kingdom",flag:"🇬🇧",code:"GB",dial_code:"+44"},{name:"United States",flag:"🇺🇸",code:"US",dial_code:"+1"},{name:"Uruguay",flag:"🇺🇾",code:"UY",dial_code:"+598"},{name:"Uzbekistan",flag:"🇺🇿",code:"UZ",dial_code:"+998"},{name:"Vanuatu",flag:"🇻🇺",code:"VU",dial_code:"+678"},{name:"Venezuela, Bolivarian Republic of Venezuela",flag:"🇻🇪",code:"VE",dial_code:"+58"},{name:"Vietnam",flag:"🇻🇳",code:"VN",dial_code:"+84"},{name:"Virgin Islands, British",flag:"🇻🇬",code:"VG",dial_code:"+1284"},{name:"Virgin Islands, U.S.",flag:"🇻🇮",code:"VI",dial_code:"+1340"},{name:"Wallis and Futuna",flag:"🇼🇫",code:"WF",dial_code:"+681"},{name:"Yemen",flag:"🇾🇪",code:"YE",dial_code:"+967"},{name:"Zambia",flag:"🇿🇲",code:"ZM",dial_code:"+260"},{name:"Zimbabwe",flag:"🇿🇼",code:"ZW",dial_code:"+263"}],aK={placeholder:"Type your phone number..."},sK=ke('<div class="input__field--phone relative flex justify-center items-center"><div class="pl-2 pr-1 flex items-center gap-2"><span></span></div><select class="absolute top-0 left-0 w-full h-full cursor-pointer opacity-0">'),lK=ke("<option> "),uK=e=>{const[t,n]=S(Xe(e.defaultCountryCode)?"INT":e.defaultCountryCode),[r,o]=S(e.defaultValue??"");let i;const a=e=>{o(e),""!==e&&"+"!==e||"INT"===t()||n("INT");const r=e?.startsWith("+")&&e.length>2&&iK.reduce((t,n)=>!n?.dial_code||null!==t&&!t.dial_code?t:e?.startsWith(n.dial_code)&&n.dial_code.length>(t?.dial_code.length??0)?n:t,null);r&&n(r.code)},s=()=>{const n=iK.find(e=>e.code===t())?.dial_code;if(""!==i?.value&&i?.reportValidity()){const t=i?.value??r();e.onSubmit({type:"text",value:t.startsWith("+")?t:`${n??""}${t}`})}else i?.focus()},l=e=>{"Enter"===e.key&&(e.preventDefault(),s())},u=e=>{const t=e.currentTarget.value;n(t);const a=iK.find(e=>e.code===t)?.dial_code;""===r()&&a&&o(a),i?.focus()};return oq(e=>{const{data:t}=e;"setInputValue"===t.command&&o(t.value)}),P(()=>{!Li()&&i&&i.focus({preventScroll:!0})}),te(rq,{onSubmit:s,get buttonLabel(){return e.labels?.button},get isInputDisabled(){return e.isInputDisabled},get hasError(){return e.hasError},get children(){return[(()=>{const e=sK(),n=e.firstChild,r=n.firstChild,o=n.nextSibling;return Pe(r,()=>iK.find(e=>t()===e.code)?.flag),Pe(n,te(oK,{class:"w-3"}),null),o.addEventListener("change",u),Pe(o,te(de,{each:iK,children:e=>(()=>{const n=lK(),r=n.firstChild;return Pe(n,()=>e.name,r),Pe(n,()=>e.dial_code?`(${e.dial_code})`:"",null),T(()=>n.selected=e.code===t()),T(()=>n.value=e.code),n})()})),e})(),te(QG,{ref(e){"function"==typeof i?i(e):i=e},type:"tel",get value(){return r()},onInput:a,onKeyDown:l,get placeholder(){return e.labels?.placeholder??aK.placeholder},get autofocus(){return!Li()}})]}})},cK={button:iq,from:"From:",to:"To:"},dK="dd/MM/yyyy",pK="dd/MM/yyyy HH:mm";function fK(e){return fK="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fK(e)}function hK(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function gK(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function mK(e){gK(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===fK(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}var vK={};function yK(){return vK}function bK(e){if(gK(1,arguments),!function(e){return gK(1,arguments),e instanceof Date||"object"===fK(e)&&"[object Date]"===Object.prototype.toString.call(e)}(e)&&"number"!=typeof e)return!1;var t=mK(e);return!isNaN(Number(t))}function wK(e,t){return gK(2,arguments),function(e,t){gK(2,arguments);var n=mK(e).getTime(),r=hK(t);return new Date(n+r)}(e,-hK(t))}function EK(e){gK(1,arguments);var t=mK(e),n=t.getUTCDay(),r=(n<1?7:0)+n-1;return t.setUTCDate(t.getUTCDate()-r),t.setUTCHours(0,0,0,0),t}function _K(e){gK(1,arguments);var t=mK(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=EK(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var a=EK(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function xK(e){gK(1,arguments);var t=mK(e),n=EK(t).getTime()-function(e){gK(1,arguments);var t=_K(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),EK(n)}(t).getTime();return Math.round(n/6048e5)+1}function kK(e,t){var n,r,o,i,a,s,l,u;gK(1,arguments);var c=yK(),d=hK(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(a=t.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.weekStartsOn)&&void 0!==o?o:c.weekStartsOn)&&void 0!==r?r:null===(l=c.locale)||void 0===l||null===(u=l.options)||void 0===u?void 0:u.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=mK(e),f=p.getUTCDay(),h=(f<d?7:0)+f-d;return p.setUTCDate(p.getUTCDate()-h),p.setUTCHours(0,0,0,0),p}function CK(e,t){var n,r,o,i,a,s,l,u;gK(1,arguments);var c=mK(e),d=c.getUTCFullYear(),p=yK(),f=hK(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(a=t.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==o?o:p.firstWeekContainsDate)&&void 0!==r?r:null===(l=p.locale)||void 0===l||null===(u=l.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var h=new Date(0);h.setUTCFullYear(d+1,0,f),h.setUTCHours(0,0,0,0);var g=kK(h,t),m=new Date(0);m.setUTCFullYear(d,0,f),m.setUTCHours(0,0,0,0);var v=kK(m,t);return c.getTime()>=g.getTime()?d+1:c.getTime()>=v.getTime()?d:d-1}function SK(e,t){gK(1,arguments);var n=mK(e),r=kK(n,t).getTime()-function(e,t){var n,r,o,i,a,s,l,u;gK(1,arguments);var c=yK(),d=hK(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(a=t.locale)||void 0===a||null===(s=a.options)||void 0===s?void 0:s.firstWeekContainsDate)&&void 0!==o?o:c.firstWeekContainsDate)&&void 0!==r?r:null===(l=c.locale)||void 0===l||null===(u=l.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==n?n:1),p=CK(e,t),f=new Date(0);return f.setUTCFullYear(p,0,d),f.setUTCHours(0,0,0,0),kK(f,t)}(n,t).getTime();return Math.round(r/6048e5)+1}function TK(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var DK=function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return TK("yy"===t?r%100:r,t.length)},AK=function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):TK(n+1,2)},OK=function(e,t){return TK(e.getUTCDate(),t.length)},PK=function(e,t){return TK(e.getUTCHours()%12||12,t.length)},IK=function(e,t){return TK(e.getUTCHours(),t.length)},NK=function(e,t){return TK(e.getUTCMinutes(),t.length)},RK=function(e,t){return TK(e.getUTCSeconds(),t.length)},BK=function(e,t){var n=t.length,r=e.getUTCMilliseconds();return TK(Math.floor(r*Math.pow(10,n-3)),t.length)},FK="midnight",LK="noon",MK="morning",UK="afternoon",jK="evening",$K="night",zK={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return DK(e,t)},Y:function(e,t,n,r){var o=CK(e,r),i=o>0?o:1-o;return"YY"===t?TK(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):TK(i,t.length)},R:function(e,t){return TK(_K(e),t.length)},u:function(e,t){return TK(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return TK(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return TK(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return AK(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return TK(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=SK(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):TK(o,t.length)},I:function(e,t,n){var r=xK(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):TK(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):OK(e,t)},D:function(e,t,n){var r=function(e){gK(1,arguments);var t=mK(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=n-t.getTime();return Math.floor(r/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):TK(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return TK(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return TK(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return TK(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?LK:0===o?FK:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?jK:o>=12?UK:o>=4?MK:$K,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return PK(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):IK(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):TK(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):TK(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):NK(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):RK(e,t)},S:function(e,t){return BK(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return VK(o);case"XXXX":case"XX":return WK(o);default:return WK(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return VK(o);case"xxxx":case"xx":return WK(o);default:return WK(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+HK(o,":");default:return"GMT"+WK(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+HK(o,":");default:return"GMT"+WK(o,":")}},t:function(e,t,n,r){var o=r._originalDate||e;return TK(Math.floor(o.getTime()/1e3),t.length)},T:function(e,t,n,r){return TK((r._originalDate||e).getTime(),t.length)}};function HK(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(0===i)return n+String(o);var a=t;return n+String(o)+a+TK(i,2)}function VK(e,t){return e%60==0?(e>0?"-":"+")+TK(Math.abs(e)/60,2):WK(e,t)}function WK(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+TK(Math.floor(o/60),2)+n+TK(o%60,2)}var qK=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},GK=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},KK={p:GK,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return qK(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",qK(o,t)).replace("{{time}}",GK(i,t))}},YK=["D","DD"],ZK=["YY","YYYY"];function XK(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var QK={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function JK(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var eY={date:JK({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:JK({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:JK({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},tY={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function nY(e){return function(t,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,i=null!=n&&n.width?String(n.width):o;r=e.formattingValues[i]||e.formattingValues[o]}else{var a=e.defaultWidth,s=null!=n&&n.width?String(n.width):e.defaultWidth;r=e.values[s]||e.values[a]}return r[e.argumentCallback?e.argumentCallback(t):t]}}var rY={ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:nY({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:nY({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:nY({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:nY({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:nY({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function oY(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,o=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(o);if(!i)return null;var a,s=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(l)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return}(l,function(e){return e.test(s)}):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n;return}(l,function(e){return e.test(s)});return a=e.valueCallback?e.valueCallback(u):u,{value:a=n.valueCallback?n.valueCallback(a):a,rest:t.slice(s.length)}}}var iY,aY={ordinalNumber:(iY={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.match(iY.matchPattern);if(!n)return null;var r=n[0],o=e.match(iY.parsePattern);if(!o)return null;var i=iY.valueCallback?iY.valueCallback(o[0]):o[0];return{value:i=t.valueCallback?t.valueCallback(i):i,rest:e.slice(r.length)}}),era:oY({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:oY({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:oY({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:oY({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:oY({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},sY={code:"en-US",formatDistance:function(e,t,n){var r,o=QK[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:eY,formatRelative:function(e,t,n,r){return tY[e]},localize:rY,match:aY,options:{weekStartsOn:0,firstWeekContainsDate:1}},lY=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,uY=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cY=/^'([^]*?)'?$/,dY=/''/g,pY=/[a-zA-Z]/;function fY(e,t,n){var r,o,i,a,s,l,u,c,d,p,f;gK(2,arguments);var h=String(t),g=yK(),m=null!==(r=g.locale)&&void 0!==r?r:sY,v=hK(null!==(o=null!==(i=null!==(a=void 0)&&void 0!==a?a:g.firstWeekContainsDate)&&void 0!==i?i:null===(s=g.locale)||void 0===s||null===(l=s.options)||void 0===l?void 0:l.firstWeekContainsDate)&&void 0!==o?o:1);if(!(v>=1&&v<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var y=hK(null!==(u=null!==(c=null!==(d=void 0)&&void 0!==d?d:g.weekStartsOn)&&void 0!==c?c:null===(p=g.locale)||void 0===p||null===(f=p.options)||void 0===f?void 0:f.weekStartsOn)&&void 0!==u?u:0);if(!(y>=0&&y<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!m.localize)throw new RangeError("locale must contain localize property");if(!m.formatLong)throw new RangeError("locale must contain formatLong property");var b=mK(e);if(!bK(b))throw new RangeError("Invalid time value");var w=function(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}(b),E=wK(b,w),_={firstWeekContainsDate:v,weekStartsOn:y,locale:m,_originalDate:b};return h.match(uY).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,KK[t])(e,m.formatLong):e}).join("").match(lY).map(function(n){if("''"===n)return"'";var r=n[0];if("'"===r)return function(e){var t=e.match(cY);if(!t)return e;return t[1].replace(dY,"'")}(n);var o,i=zK[r];if(i)return o=n,-1!==ZK.indexOf(o)&&XK(n,t,String(e)),function(e){return-1!==YK.indexOf(e)}(n)&&XK(n,t,String(e)),i(E,n,m.localize,_);if(r.match(pY))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");return n}).join("")}function hY(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gY(e,t){return gY=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gY(e,t)}function mY(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gY(e,t)}function vY(e){return vY=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vY(e)}function yY(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(yY=function(){return!!e})()}function bY(e){var t=yY();return function(){var n,r=vY(e);if(t){var o=vY(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"==fK(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return hY(e)}(this,n)}}function wY(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function EY(e){var t=function(e,t){if("object"!=fK(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=fK(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==fK(t)?t:t+""}function _Y(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,EY(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function xY(e,t,n){return(t=EY(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var kY=function(){function e(){wY(this,e),xY(this,"priority",void 0),xY(this,"subPriority",0)}return _Y(e,[{key:"validate",value:function(e,t){return!0}}]),e}(),CY=function(){mY(t,kY);var e=bY(t);function t(n,r,o,i,a){var s;return wY(this,t),(s=e.call(this)).value=n,s.validateValue=r,s.setValue=o,s.priority=i,a&&(s.subPriority=a),s}return _Y(t,[{key:"validate",value:function(e,t){return this.validateValue(e,this.value,t)}},{key:"set",value:function(e,t,n){return this.setValue(e,t,this.value,n)}}]),t}(),SY=function(){function e(){wY(this,e),xY(this,"incompatibleTokens",void 0),xY(this,"priority",void 0),xY(this,"subPriority",void 0)}return _Y(e,[{key:"run",value:function(e,t,n,r){var o=this.parse(e,t,n,r);return o?{setter:new CY(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}},{key:"validate",value:function(e,t,n){return!0}}]),e}(),TY=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",140),xY(hY(n),"incompatibleTokens",["R","u","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"G":case"GG":case"GGG":return n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"});case"GGGGG":return n.era(e,{width:"narrow"});default:return n.era(e,{width:"wide"})||n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"})}}},{key:"set",value:function(e,t,n){return t.era=n,e.setUTCFullYear(n,0,1),e.setUTCHours(0,0,0,0),e}}]),t}(),DY=/^(1[0-2]|0?\d)/,AY=/^(3[0-1]|[0-2]?\d)/,OY=/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,PY=/^(5[0-3]|[0-4]?\d)/,IY=/^(2[0-3]|[0-1]?\d)/,NY=/^(2[0-4]|[0-1]?\d)/,RY=/^(1[0-1]|0?\d)/,BY=/^(1[0-2]|0?\d)/,FY=/^[0-5]?\d/,LY=/^[0-5]?\d/,MY=/^\d/,UY=/^\d{1,2}/,jY=/^\d{1,3}/,$Y=/^\d{1,4}/,zY=/^-?\d+/,HY=/^-?\d/,VY=/^-?\d{1,2}/,WY=/^-?\d{1,3}/,qY=/^-?\d{1,4}/,GY=/^([+-])(\d{2})(\d{2})?|Z/,KY=/^([+-])(\d{2})(\d{2})|Z/,YY=/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,ZY=/^([+-])(\d{2}):(\d{2})|Z/,XY=/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/;function QY(e,t){return e?{value:t(e.value),rest:e.rest}:e}function JY(e,t){var n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function eZ(e,t){var n=t.match(e);return n?"Z"===n[0]?{value:0,rest:t.slice(1)}:{value:("+"===n[1]?1:-1)*(36e5*(n[2]?parseInt(n[2],10):0)+6e4*(n[3]?parseInt(n[3],10):0)+1e3*(n[5]?parseInt(n[5],10):0)),rest:t.slice(n[0].length)}:null}function tZ(e){return JY(zY,e)}function nZ(e,t){switch(e){case 1:return JY(MY,t);case 2:return JY(UY,t);case 3:return JY(jY,t);case 4:return JY($Y,t);default:return JY(new RegExp("^\\d{1,"+e+"}"),t)}}function rZ(e,t){switch(e){case 1:return JY(HY,t);case 2:return JY(VY,t);case 3:return JY(WY,t);case 4:return JY(qY,t);default:return JY(new RegExp("^-?\\d{1,"+e+"}"),t)}}function oZ(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function iZ(e,t){var n,r=t>0,o=r?t:1-t;if(o<=50)n=e||100;else{var i=o+50;n=e+100*Math.floor(i/100)-(e>=i%100?100:0)}return r?n:1-n}function aZ(e){return e%400==0||e%4==0&&e%100!=0}var sZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",130),xY(hY(n),"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){var r=function(e){return{year:e,isTwoDigitYear:"yy"===t}};switch(t){case"y":return QY(nZ(4,e),r);case"yo":return QY(n.ordinalNumber(e,{unit:"year"}),r);default:return QY(nZ(t.length,e),r)}}},{key:"validate",value:function(e,t){return t.isTwoDigitYear||t.year>0}},{key:"set",value:function(e,t,n){var r=e.getUTCFullYear();if(n.isTwoDigitYear){var o=iZ(n.year,r);return e.setUTCFullYear(o,0,1),e.setUTCHours(0,0,0,0),e}var i="era"in t&&1!==t.era?1-n.year:n.year;return e.setUTCFullYear(i,0,1),e.setUTCHours(0,0,0,0),e}}]),t}(),lZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",130),xY(hY(n),"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){var r=function(e){return{year:e,isTwoDigitYear:"YY"===t}};switch(t){case"Y":return QY(nZ(4,e),r);case"Yo":return QY(n.ordinalNumber(e,{unit:"year"}),r);default:return QY(nZ(t.length,e),r)}}},{key:"validate",value:function(e,t){return t.isTwoDigitYear||t.year>0}},{key:"set",value:function(e,t,n,r){var o=CK(e,r);if(n.isTwoDigitYear){var i=iZ(n.year,o);return e.setUTCFullYear(i,0,r.firstWeekContainsDate),e.setUTCHours(0,0,0,0),kK(e,r)}var a="era"in t&&1!==t.era?1-n.year:n.year;return e.setUTCFullYear(a,0,r.firstWeekContainsDate),e.setUTCHours(0,0,0,0),kK(e,r)}}]),t}(),uZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",130),xY(hY(n),"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t){return rZ("R"===t?4:t.length,e)}},{key:"set",value:function(e,t,n){var r=new Date(0);return r.setUTCFullYear(n,0,4),r.setUTCHours(0,0,0,0),EK(r)}}]),t}(),cZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",130),xY(hY(n),"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t){return rZ("u"===t?4:t.length,e)}},{key:"set",value:function(e,t,n){return e.setUTCFullYear(n,0,1),e.setUTCHours(0,0,0,0),e}}]),t}(),dZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",120),xY(hY(n),"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"Q":case"QQ":return nZ(t.length,e);case"Qo":return n.ordinalNumber(e,{unit:"quarter"});case"QQQ":return n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(e,{width:"narrow",context:"formatting"});default:return n.quarter(e,{width:"wide",context:"formatting"})||n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(e,t){return t>=1&&t<=4}},{key:"set",value:function(e,t,n){return e.setUTCMonth(3*(n-1),1),e.setUTCHours(0,0,0,0),e}}]),t}(),pZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",120),xY(hY(n),"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"q":case"qq":return nZ(t.length,e);case"qo":return n.ordinalNumber(e,{unit:"quarter"});case"qqq":return n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(e,{width:"narrow",context:"standalone"});default:return n.quarter(e,{width:"wide",context:"standalone"})||n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(e,t){return t>=1&&t<=4}},{key:"set",value:function(e,t,n){return e.setUTCMonth(3*(n-1),1),e.setUTCHours(0,0,0,0),e}}]),t}(),fZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]),xY(hY(n),"priority",110),n}return _Y(t,[{key:"parse",value:function(e,t,n){var r=function(e){return e-1};switch(t){case"M":return QY(JY(DY,e),r);case"MM":return QY(nZ(2,e),r);case"Mo":return QY(n.ordinalNumber(e,{unit:"month"}),r);case"MMM":return n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(e,{width:"narrow",context:"formatting"});default:return n.month(e,{width:"wide",context:"formatting"})||n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=11}},{key:"set",value:function(e,t,n){return e.setUTCMonth(n,1),e.setUTCHours(0,0,0,0),e}}]),t}(),hZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",110),xY(hY(n),"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){var r=function(e){return e-1};switch(t){case"L":return QY(JY(DY,e),r);case"LL":return QY(nZ(2,e),r);case"Lo":return QY(n.ordinalNumber(e,{unit:"month"}),r);case"LLL":return n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(e,{width:"narrow",context:"standalone"});default:return n.month(e,{width:"wide",context:"standalone"})||n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=11}},{key:"set",value:function(e,t,n){return e.setUTCMonth(n,1),e.setUTCHours(0,0,0,0),e}}]),t}();var gZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",100),xY(hY(n),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"w":return JY(PY,e);case"wo":return n.ordinalNumber(e,{unit:"week"});default:return nZ(t.length,e)}}},{key:"validate",value:function(e,t){return t>=1&&t<=53}},{key:"set",value:function(e,t,n,r){return kK(function(e,t,n){gK(2,arguments);var r=mK(e),o=hK(t),i=SK(r,n)-o;return r.setUTCDate(r.getUTCDate()-7*i),r}(e,n,r),r)}}]),t}();var mZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",100),xY(hY(n),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"I":return JY(PY,e);case"Io":return n.ordinalNumber(e,{unit:"week"});default:return nZ(t.length,e)}}},{key:"validate",value:function(e,t){return t>=1&&t<=53}},{key:"set",value:function(e,t,n){return EK(function(e,t){gK(2,arguments);var n=mK(e),r=hK(t),o=xK(n)-r;return n.setUTCDate(n.getUTCDate()-7*o),n}(e,n))}}]),t}(),vZ=[31,28,31,30,31,30,31,31,30,31,30,31],yZ=[31,29,31,30,31,30,31,31,30,31,30,31],bZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",90),xY(hY(n),"subPriority",1),xY(hY(n),"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"d":return JY(AY,e);case"do":return n.ordinalNumber(e,{unit:"date"});default:return nZ(t.length,e)}}},{key:"validate",value:function(e,t){var n=aZ(e.getUTCFullYear()),r=e.getUTCMonth();return n?t>=1&&t<=yZ[r]:t>=1&&t<=vZ[r]}},{key:"set",value:function(e,t,n){return e.setUTCDate(n),e.setUTCHours(0,0,0,0),e}}]),t}(),wZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",90),xY(hY(n),"subpriority",1),xY(hY(n),"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"D":case"DD":return JY(OY,e);case"Do":return n.ordinalNumber(e,{unit:"date"});default:return nZ(t.length,e)}}},{key:"validate",value:function(e,t){return aZ(e.getUTCFullYear())?t>=1&&t<=366:t>=1&&t<=365}},{key:"set",value:function(e,t,n){return e.setUTCMonth(0,n),e.setUTCHours(0,0,0,0),e}}]),t}();function EZ(e,t,n){var r,o,i,a,s,l,u,c;gK(2,arguments);var d=yK(),p=hK(null!==(r=null!==(o=null!==(i=null!==(a=null==n?void 0:n.weekStartsOn)&&void 0!==a?a:null==n||null===(s=n.locale)||void 0===s||null===(l=s.options)||void 0===l?void 0:l.weekStartsOn)&&void 0!==i?i:d.weekStartsOn)&&void 0!==o?o:null===(u=d.locale)||void 0===u||null===(c=u.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==r?r:0);if(!(p>=0&&p<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=mK(e),h=hK(t),g=((h%7+7)%7<p?7:0)+h-f.getUTCDay();return f.setUTCDate(f.getUTCDate()+g),f}var _Z=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",90),xY(hY(n),"incompatibleTokens",["D","i","e","c","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"E":case"EE":case"EEE":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=6}},{key:"set",value:function(e,t,n,r){return(e=EZ(e,n,r)).setUTCHours(0,0,0,0),e}}]),t}(),xZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",90),xY(hY(n),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n,r){var o=function(e){var t=7*Math.floor((e-1)/7);return(e+r.weekStartsOn+6)%7+t};switch(t){case"e":case"ee":return QY(nZ(t.length,e),o);case"eo":return QY(n.ordinalNumber(e,{unit:"day"}),o);case"eee":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeeee":return n.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=6}},{key:"set",value:function(e,t,n,r){return(e=EZ(e,n,r)).setUTCHours(0,0,0,0),e}}]),t}(),kZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",90),xY(hY(n),"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n,r){var o=function(e){var t=7*Math.floor((e-1)/7);return(e+r.weekStartsOn+6)%7+t};switch(t){case"c":case"cc":return QY(nZ(t.length,e),o);case"co":return QY(n.ordinalNumber(e,{unit:"day"}),o);case"ccc":return n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"ccccc":return n.day(e,{width:"narrow",context:"standalone"});case"cccccc":return n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});default:return n.day(e,{width:"wide",context:"standalone"})||n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"})}}},{key:"validate",value:function(e,t){return t>=0&&t<=6}},{key:"set",value:function(e,t,n,r){return(e=EZ(e,n,r)).setUTCHours(0,0,0,0),e}}]),t}();var CZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",90),xY(hY(n),"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){var r=function(e){return 0===e?7:e};switch(t){case"i":case"ii":return nZ(t.length,e);case"io":return n.ordinalNumber(e,{unit:"day"});case"iii":return QY(n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r);case"iiiii":return QY(n.day(e,{width:"narrow",context:"formatting"}),r);case"iiiiii":return QY(n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r);default:return QY(n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),r)}}},{key:"validate",value:function(e,t){return t>=1&&t<=7}},{key:"set",value:function(e,t,n){return e=function(e,t){gK(2,arguments);var n=hK(t);n%7==0&&(n-=7);var r=mK(e),o=((n%7+7)%7<1?7:0)+n-r.getUTCDay();return r.setUTCDate(r.getUTCDate()+o),r}(e,n),e.setUTCHours(0,0,0,0),e}}]),t}(),SZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",80),xY(hY(n),"incompatibleTokens",["b","B","H","k","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(e,t,n){return e.setUTCHours(oZ(n),0,0,0),e}}]),t}(),TZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",80),xY(hY(n),"incompatibleTokens",["a","B","H","k","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"b":case"bb":case"bbb":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(e,t,n){return e.setUTCHours(oZ(n),0,0,0),e}}]),t}(),DZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",80),xY(hY(n),"incompatibleTokens",["a","b","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"B":case"BB":case"BBB":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(e,{width:"narrow",context:"formatting"});default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}},{key:"set",value:function(e,t,n){return e.setUTCHours(oZ(n),0,0,0),e}}]),t}(),AZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",70),xY(hY(n),"incompatibleTokens",["H","K","k","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"h":return JY(BY,e);case"ho":return n.ordinalNumber(e,{unit:"hour"});default:return nZ(t.length,e)}}},{key:"validate",value:function(e,t){return t>=1&&t<=12}},{key:"set",value:function(e,t,n){var r=e.getUTCHours()>=12;return r&&n<12?e.setUTCHours(n+12,0,0,0):r||12!==n?e.setUTCHours(n,0,0,0):e.setUTCHours(0,0,0,0),e}}]),t}(),OZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",70),xY(hY(n),"incompatibleTokens",["a","b","h","K","k","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"H":return JY(IY,e);case"Ho":return n.ordinalNumber(e,{unit:"hour"});default:return nZ(t.length,e)}}},{key:"validate",value:function(e,t){return t>=0&&t<=23}},{key:"set",value:function(e,t,n){return e.setUTCHours(n,0,0,0),e}}]),t}(),PZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",70),xY(hY(n),"incompatibleTokens",["h","H","k","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"K":return JY(RY,e);case"Ko":return n.ordinalNumber(e,{unit:"hour"});default:return nZ(t.length,e)}}},{key:"validate",value:function(e,t){return t>=0&&t<=11}},{key:"set",value:function(e,t,n){return e.getUTCHours()>=12&&n<12?e.setUTCHours(n+12,0,0,0):e.setUTCHours(n,0,0,0),e}}]),t}(),IZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",70),xY(hY(n),"incompatibleTokens",["a","b","h","H","K","t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"k":return JY(NY,e);case"ko":return n.ordinalNumber(e,{unit:"hour"});default:return nZ(t.length,e)}}},{key:"validate",value:function(e,t){return t>=1&&t<=24}},{key:"set",value:function(e,t,n){var r=n<=24?n%24:n;return e.setUTCHours(r,0,0,0),e}}]),t}(),NZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",60),xY(hY(n),"incompatibleTokens",["t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"m":return JY(FY,e);case"mo":return n.ordinalNumber(e,{unit:"minute"});default:return nZ(t.length,e)}}},{key:"validate",value:function(e,t){return t>=0&&t<=59}},{key:"set",value:function(e,t,n){return e.setUTCMinutes(n,0,0),e}}]),t}(),RZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",50),xY(hY(n),"incompatibleTokens",["t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t,n){switch(t){case"s":return JY(LY,e);case"so":return n.ordinalNumber(e,{unit:"second"});default:return nZ(t.length,e)}}},{key:"validate",value:function(e,t){return t>=0&&t<=59}},{key:"set",value:function(e,t,n){return e.setUTCSeconds(n,0),e}}]),t}(),BZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",30),xY(hY(n),"incompatibleTokens",["t","T"]),n}return _Y(t,[{key:"parse",value:function(e,t){return QY(nZ(t.length,e),function(e){return Math.floor(e*Math.pow(10,3-t.length))})}},{key:"set",value:function(e,t,n){return e.setUTCMilliseconds(n),e}}]),t}(),FZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",10),xY(hY(n),"incompatibleTokens",["t","T","x"]),n}return _Y(t,[{key:"parse",value:function(e,t){switch(t){case"X":return eZ(GY,e);case"XX":return eZ(KY,e);case"XXXX":return eZ(YY,e);case"XXXXX":return eZ(XY,e);default:return eZ(ZY,e)}}},{key:"set",value:function(e,t,n){return t.timestampIsSet?e:new Date(e.getTime()-n)}}]),t}(),LZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",10),xY(hY(n),"incompatibleTokens",["t","T","X"]),n}return _Y(t,[{key:"parse",value:function(e,t){switch(t){case"x":return eZ(GY,e);case"xx":return eZ(KY,e);case"xxxx":return eZ(YY,e);case"xxxxx":return eZ(XY,e);default:return eZ(ZY,e)}}},{key:"set",value:function(e,t,n){return t.timestampIsSet?e:new Date(e.getTime()-n)}}]),t}(),MZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",40),xY(hY(n),"incompatibleTokens","*"),n}return _Y(t,[{key:"parse",value:function(e){return tZ(e)}},{key:"set",value:function(e,t,n){return[new Date(1e3*n),{timestampIsSet:!0}]}}]),t}(),UZ=function(){mY(t,SY);var e=bY(t);function t(){var n;wY(this,t);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return xY(hY(n=e.call.apply(e,[this].concat(o))),"priority",20),xY(hY(n),"incompatibleTokens","*"),n}return _Y(t,[{key:"parse",value:function(e){return tZ(e)}},{key:"set",value:function(e,t,n){return[new Date(n),{timestampIsSet:!0}]}}]),t}();new TY,new sZ,new lZ,new uZ,new cZ,new dZ,new pZ,new fZ,new hZ,new gZ,new mZ,new bZ,new wZ,new _Z,new xZ,new kZ,new CZ,new SZ,new TZ,new DZ,new AZ,new OZ,new PZ,new IZ,new NZ,new RZ,new BZ,new FZ,new LZ,new MZ,new UZ;const jZ=ke('<div><div><input class="input__field--date focus:outline-none flex-1 w-full" data-testid="from-date">'),$Z=ke('<p class="font-normal">'),zZ=ke('<div class="flex items-center p-4 h-full"><input class="input__field--date focus:outline-none flex-1 w-full ml-2 h-full" data-testid="to-date">'),HZ=ke('<div class="w-full mt-2 px-3 py-2 text-sm rounded-md">'),VZ=e=>{const[t,n]=S(WZ(e.defaultValue??"")),[r,o]=S(null),i=t=>{if(!t)return"";try{let n;if(e.options?.hasTime)n=new Date(t);else{if(/T|(\s+\d{1,2}:\d{2})/.test(t))n=new Date(t);else{const e=`${t.split(/[T\s]/)[0]}T12:00:00`;n=new Date(e),isNaN(n.getTime())&&(n=new Date(t))}}if(isNaN(n.getTime()))return t;return fY(n,e.options?.format??(e.options?.hasTime?pK:dK))}catch(e){return console.error("Error formatting date:",e),t}},a=t=>{if(t)return e.options?.hasTime?t:t.split(/[T\s]/)[0]},s=(t,n)=>{if(!e.options?.isRange)return o(null),!0;if(!t||!n)return t||n?(o("Please provide both start and end dates for the date range."),!1):(o(null),!0);const r=new Date(t),i=new Date(n);return isNaN(r.getTime())||isNaN(i.getTime())?(o(null),!0):r>i?(o(e.options?.retryMessageContent||"The start date cannot be after the end date. Please select a valid date range."),!1):(o(null),!0)};return te(rq,{onSubmit:()=>{const n=t().from,r=t().to;if(e.options?.isRange){if(!n||!r)return void o("Please provide both start and end dates for the date range.")}else if(!n)return void o("Please select a date.");if(!s(n,r))return;const a=i(t().from),l=t().to?i(t().to):"",u=e.options?.isRange?`${a} to ${l}`:a,c=`${t().from}${e.options?.isRange?` to ${t().to}`:""}`;e.onSubmit({type:"text",value:c,label:u})},get buttonLabel(){return e.options?.labels?.button},get children(){const o=jZ(),i=o.firstChild,l=i.firstChild;return Pe(i,(()=>{const t=A(()=>!!e.options?.isRange);return()=>t()&&(()=>{const t=$Z();return Pe(t,()=>e.options.labels?.from??cK.from),t})()})(),l),l.addEventListener("change",e=>{const r={...t(),from:e.currentTarget.value};n(r),s(r.from,r.to)}),l.style.setProperty("min-height","32px"),l.style.setProperty("min-width","100px"),l.style.setProperty("font-size","16px"),Pe(o,(()=>{const r=A(()=>!!e.options?.isRange);return()=>r()&&(()=>{const r=zZ(),o=r.firstChild;return Pe(r,(()=>{const t=A(()=>!!e.options.isRange);return()=>t()&&(()=>{const t=$Z();return Pe(t,()=>e.options.labels?.to??cK.to),t})()})(),o),o.addEventListener("change",e=>{const r={...t(),to:e.currentTarget.value};n(r),s(r.from,r.to)}),o.style.setProperty("min-height","32px"),o.style.setProperty("min-width","100px"),o.style.setProperty("font-size","16px"),T(n=>{const r=e.options.hasTime?"datetime-local":"date",i=(()=>{const n=a(e.options?.min),r=t().from;return r?n?new Date(r)>new Date(n)?r:n:r:n})(),s=a(e.options?.max);return r!==n._v$6&&Se(o,"type",n._v$6=r),i!==n._v$7&&Se(o,"min",n._v$7=i),s!==n._v$8&&Se(o,"max",n._v$8=s),n},{_v$6:void 0,_v$7:void 0,_v$8:void 0}),T(()=>o.value=t().to),r})()})(),null),Pe(o,(()=>{const e=A(()=>!!r());return()=>e()&&(()=>{const e=HZ();return e.style.setProperty("color","#c53030"),e.style.setProperty("background-color","#fff5f5"),e.style.setProperty("border","1px solid #feb2b2"),Pe(e,r),e})()})(),null),T(n=>{const r=tt("flex flex-col w-full",e.options?.isRange?"items-end":"items-center"),s=tt("flex items-center",e.options?.isRange&&"pb-0 gap-2"),u=e.options?.hasTime?"datetime-local":"date",c=a(e.options?.min),d=(()=>{const n=a(e.options?.max),r=t().to;return r?n?new Date(r)<new Date(n)?r:n:r:n})();return r!==n._v$&&Te(o,n._v$=r),s!==n._v$2&&Te(i,n._v$2=s),u!==n._v$3&&Se(l,"type",n._v$3=u),c!==n._v$4&&Se(l,"min",n._v$4=c),d!==n._v$5&&Se(l,"max",n._v$5=d),n},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0}),T(()=>l.value=t().from),o}})},WZ=e=>{if(!e.includes("to"))return{from:e,to:""};const[t,n]=e.split(" to ");return{from:t,to:n}},qZ="Numbers",GZ=10,KZ={button:iq},YZ=1,ZZ=ke('<form class="flex flex-col gap-3"><div class="flex flex-wrap justify-center gap-2 py-2">'),XZ=ke('<span class="text-sm w-full text-gray-600 dark:text-gray-400">'),QZ=ke('<span class="text-sm w-full text-right pr-2 text-gray-600 dark:text-gray-400">'),JZ=ke('<div class="flex justify-end pt-2">'),eX=ke('<div role="checkbox">'),tX=ke("<div>"),nX=e=>{const[t,n]=S(e.defaultValue?Number(e.defaultValue):void 0),r=n=>{n.preventDefault();const r=t();Ze(r)||e.onSubmit({type:"text",value:r.toString()})},o=t=>{e.block.options?.isOneClickSubmitEnabled&&e.onSubmit({type:"text",value:t.toString()}),n(t)};return(()=>{const n=ZZ(),i=n.firstChild;return n.addEventListener("submit",r),Pe(n,(()=>{const t=A(()=>!!e.block.options?.labels?.left);return()=>t()&&(()=>{const t=XZ();return Pe(t,()=>e.block.options.labels.left),t})()})(),i),Pe(i,te(de,{get each(){return Array.from(Array((e.block.options?.length??GZ)+("Numbers"===(e.block.options?.buttonType??qZ)?-((e.block.options?.startsAt??YZ)-1):0)))},children:(n,r)=>te(rX,ae(()=>e.block.options,{get rating(){return t()},get idx(){return r()+("Numbers"===(e.block.options?.buttonType??qZ)?e.block.options?.startsAt??YZ:1)},onClick:o}))})),Pe(n,(()=>{const t=A(()=>!!e.block.options?.labels?.right);return()=>t()&&(()=>{const t=QZ();return Pe(t,()=>e.block.options.labels.right),t})()})(),null),Pe(n,(()=>{const n=A(()=>!!Ye(t()));return()=>n()&&(()=>{const t=JZ();return Pe(t,te(tq,{get children(){return e.block.options?.labels?.button??KZ.button}})),t})()})(),null),n})()},rX=e=>{const t=t=>{t.preventDefault(),e.onClick(e.idx)};return te(he,{get children(){return[te(ge,{get when(){return"Numbers"===(e.buttonType??qZ)},get children(){return[te(fe,{get when(){return e.isOneClickSubmitEnabled},get children(){return te(eq,{"on:click":t,get children(){return e.idx}})}}),te(fe,{get when(){return!e.isOneClickSubmitEnabled},get children(){const n=eX();return n.addEventListener("click",t),Pe(n,()=>e.idx),T(t=>{const r=Ye(e.rating)&&e.idx<=e.rating,o=tt("button button--selectable flex items-center justify-center font-medium focus:outline-none cursor-pointer select-none",Ye(e.rating)&&e.idx<=e.rating&&" button--selected");return r!==t._v$&&Se(n,"aria-checked",t._v$=r),o!==t._v$2&&Te(n,t._v$2=o),t},{_v$:void 0,_v$2:void 0}),n}})]}}),te(ge,{get when(){return"Numbers"!==(e.buttonType??qZ)},get children(){const t=tX();return t.addEventListener("click",()=>e.onClick(e.idx)),T(n=>{const r="input__field--rating flex justify-center items-center cursor-pointer w-[48px] h-[48px]"+(Ye(e.rating)&&e.idx<=e.rating?" input__field--rating--selected":""),o=e.customIcon?.isEnabled&&!Xe(e.customIcon.svg)?e.customIcon.svg:oX;return r!==n._v$3&&Te(t,n._v$3=r),o!==n._v$4&&(t.innerHTML=n._v$4=o),n},{_v$3:void 0,_v$4:void 0}),t}})]}})},oX='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-star"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg>',iX={isMultipleAllowed:!1,labels:{placeholder:"<strong>\n Click to upload\n </strong> or drag and drop<br>\n (size limit: 10MB)",button:"Upload",clear:"Clear",skip:"Skip",success:{single:"File uploaded",multiple:"{total} files uploaded"}}},aX=ke('<div class="w-full bg-gray-200 rounded-full h-2.5"><div class="h-2.5 rounded-full input__field--upload__progress-bar">'),sX=ke('<div class="p-4 flex gap-2 border-gray-200 border overflow-auto bg-white rounded-md w-full">'),lX=ke('<div class="flex flex-col justify-center items-center gap-4 max-w-[90%]"><p class="text-sm text-gray-500 text-center">'),uX=ke('<input id="dropzone-file" type="file" class="hidden">'),cX=ke('<div class="flex justify-end">'),dX=ke('<div class="flex justify-end"><div class="flex gap-2">'),pX=ke('<form class="flex flex-col w-full gap-2"><label for="dropzone-file">'),fX=ke('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-gray-500"><polyline points="16 16 12 12 8 16"></polyline><line x1="12" y1="12" x2="12" y2="21"></line><path d="M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"></path><polyline points="16 16 12 12 8 16">'),hX=e=>{const[t,n]=S([]),[r,o]=S(!1),[i,a]=S(0),[s,l]=S(!1),u=r=>{const o=Array.from(r).map(e=>bq({existingFiles:t(),newFile:e,onError:({description:e,title:t})=>wq.create({title:t,description:e})})).filter(Ye);if(0!==o.length)return e.block.options?.isMultipleAllowed?void n([...t(),...o]):d(o[0])},c=async e=>{e.preventDefault(),0!==t().length&&p(t())},d=async t=>{o(!0);const n=await Eq({apiHost:e.context.apiHost??_t({ignoreChatApiUrl:!0}),files:[{file:t,input:{sessionId:e.context.sessionId,fileName:t.name}}]});if(o(!1),n.length&&n[0])return e.onSubmit({type:"text",label:e.block.options?.labels?.success?.single??iX.labels.success.single,value:n[0]?mX(n[0].url):"",attachments:[{type:t.type,url:n[0].url}]});wq.create({description:"An error occured while uploading the file"})},p=async t=>{o(!0);const n=await Eq({apiHost:e.context.apiHost??_t({ignoreChatApiUrl:!0}),files:t.map(t=>({file:t,input:{sessionId:e.context.sessionId,fileName:t.name}})),onUploadProgress:a});if(o(!1),a(0),n.length!==t.length)return wq.create({description:"An error occured while uploading the files"});e.onSubmit({type:"text",label:n.length>1?(e.block.options?.labels?.success?.multiple??iX.labels.success.multiple).replaceAll("{total}",n.length.toString()):e.block.options?.labels?.success?.single??iX.labels.success.single,value:n.filter(Ye).map(({url:e})=>mX(e)).join(", "),attachments:n.filter(Ye)})},f=e=>{e.preventDefault(),l(!0)},h=()=>l(!1),g=e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer?.files&&u(e.dataTransfer.files)},m=()=>n([]),v=()=>e.onSkip(e.block.options?.labels?.skip??iX.labels.skip);return(()=>{const o=pX(),a=o.firstChild;return o.addEventListener("submit",c),a.addEventListener("drop",g),a.addEventListener("dragleave",h),a.addEventListener("dragover",f),Pe(a,te(he,{get children(){return[te(ge,{get when(){return r()},get children(){return te(fe,{get when(){return t().length>1},get fallback(){return te(QW,{})},get children(){const e=aX(),t=e.firstChild;return t.style.setProperty("transition","width 150ms cubic-bezier(0.4, 0, 0.2, 1)"),T(()=>null!=`${i()>0?i:10}%`?t.style.setProperty("width",`${i()>0?i:10}%`):t.style.removeProperty("width")),e}})}}),te(ge,{get when(){return!r()},get children(){return[(()=>{const r=lX(),o=r.firstChild;return Pe(r,te(fe,{get when(){return t().length},get fallback(){return te(gX,{})},get children(){const e=sX();return e.addEventListener("click",e=>{e.preventDefault(),e.stopPropagation()}),Pe(e,te(de,{get each(){return t()},children:(e,t)=>te(GW,{file:e,onRemoveClick:()=>(e=>{n(t=>t.filter((t,n)=>n!==e))})(t())})})),e}}),o),T(()=>o.innerHTML=e.block.options?.labels?.placeholder??iX.labels.placeholder),r})(),(()=>{const t=uX();return t.addEventListener("change",e=>{e.currentTarget.files&&u(e.currentTarget.files)}),T(()=>t.multiple=e.block.options?.isMultipleAllowed??iX.isMultipleAllowed),t})()]}})]}})),Pe(o,te(fe,{get when(){return 0===t().length&&!1===e.block.options?.isRequired},get children(){const t=cX();return Pe(t,te(eq,{"on:click":v,get children(){return e.block.options?.labels?.skip??iX.labels.skip}})),t}}),null),Pe(o,te(fe,{get when(){return A(()=>!!(e.block.options?.isMultipleAllowed&&t().length>0))()&&!r()},get children(){const n=dX(),r=n.firstChild;return Pe(r,te(fe,{get when(){return t().length},get children(){return te(eq,{"on:click":m,get children(){return e.block.options?.labels?.clear??iX.labels.clear}})}}),null),Pe(r,te(tq,{get children(){return A(()=>(e.block.options?.labels?.button??iX.labels.button)===iX.labels.button)()?`Upload ${t().length} file${t().length>1?"s":""}`:e.block.options?.labels?.button}}),null),n}}),null),T(()=>Te(a,"input__field--upload py-6 flex flex-col justify-center items-center w-full bg-gray-50 border-2 border-gray-300 border-dashed cursor-pointer hover:bg-gray-100 px-8"+(s()?"input__upload--dragging":""))),o})()},gX=()=>fX(),mX=e=>{const t=e.split("/"),n=t.pop();if(!n)return e;let r=n;try{r=decodeURIComponent(n)}catch{}const o=encodeURIComponent(r);return[...t,o].join("/")},vX=iq,yX="Filter the options...",bX=ke('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3px" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12">'),wX=e=>(()=>{const t=bX();return Ae(t,e,!0,!0),t})(),EX=ke('<button class="w-5 h-5">'),_X=ke('<div class="flex justify-between items-center gap-2 w-full pr-4"><input class="input__field focus:outline-none bg-transparent px-4 py-4 flex-1 w-full" type="text">'),xX=e=>{const[t,n]=S(""),[r,o]=se(e,["onInput","ref"]),i=()=>{n(""),e.onClear()};return(()=>{const a=_X(),s=a.firstChild;s.$$input=e=>(e=>{n(e),r.onInput(e)})(e.currentTarget.value);const l=e.ref;return"function"==typeof l?Oe(l,s):e.ref=s,s.style.setProperty("font-size","16px"),Ae(s,ae({get value(){return t()}},o),!1,!1),Pe(a,te(fe,{get when(){return t().length>0},get children(){const e=EX();return e.addEventListener("click",i),Pe(e,te(ft,{class:"w-4"})),e}}),null),a})()};Ce(["input"]);const kX=ke('<form class="flex flex-col gap-2 w-full items-end">'),CX=ke('<div class="flex flex-col gap-2 w-full items-end">'),SX=ke('<div class="flex items-end w-full">'),TX=ke("<div>"),DX=ke('<img fetchpriority="high" class="m-auto min-w-[200px] w-full max-h-[200px] h-full object-cover rounded-t-[var(--quickbot-button-border-radius)]">'),AX=ke('<span class="font-normal">'),OX=ke('<span class="text-sm whitespace-pre-wrap text-left">'),PX=ke('<div class="flex flex-col gap-1 flex-1">'),IX=ke("<span>"),NX=ke('<span class="flex h-3 w-3 absolute top-0 right-0 -mt-1 -mr-1 ping"><span class="animate-ping absolute inline-flex h-full w-full rounded-full brightness-200 opacity-75"></span><span class="relative inline-flex rounded-full h-3 w-3 brightness-150">'),RX=e=>{let t;const[n,r]=S(e.defaultItems),[o,i]=S([]),[a,s]=S(0);P(()=>{Li(),0});const l=t=>{const r=n()[t];if(r){if(!e.multiple){const t=r.content,n=r.value??r.content??r.id;return r.pictureSrc?e.onSubmit({type:"text",label:Qe(t)?t:r.pictureSrc??r.id,value:r.value??r.id}):e.onSubmit({type:"text",label:t,value:n})}u(r.id)}},u=e=>{const t=o().indexOf(e);i(-1!==t?t=>t.filter(t=>t!==e):t=>[...t,e])},c=t=>{t?.preventDefault(),e.onSubmit({type:"text",value:o().map(t=>{const n=e.defaultItems.find(e=>e.id===t);return n?n.pictureSrc?Qe(n.content)?n.content:n.pictureSrc:n.content:""}).join(", ")})},d=t=>{const n=(t??"").toLowerCase();r(e.defaultItems.filter(e=>{const t=e.content?.toLowerCase()??"";return e.pictureSrc?t.includes(n)||e.description?.toLowerCase().includes(n):t.includes(n)}))};D(()=>{a()===e.defaultItems.filter(e=>Ye(e.pictureSrc)).length&&e.onTransitionEnd()});const p=()=>{s(e=>e+1)},f=e=>o().includes(e),h=()=>{if(!e.multiple)return n();const t=o().filter(e=>!n().some(t=>t.id===e)).map(t=>e.defaultItems.find(e=>e.id===t)).filter(Ye);return[...n(),...t]};return te(he,{get children(){return[te(ge,{get when(){return e.multiple},get children(){const n=kX();return n.addEventListener("submit",c),Pe(n,te(BX,{get options(){return e.options},get multiple(){return e.multiple},inputRef:t,filterItems:d,get defaultItems(){return e.defaultItems},setFilteredItems:r,get itemsToRender(){return h()},isItemSelected:f,handleClick:l,onImageLoad:p,get chunkIndex(){return e.chunkIndex},get selectedItemIds(){return o()}})),n}}),te(ge,{get when(){return!e.multiple},get children(){const n=CX();return Pe(n,te(BX,{get options(){return e.options},get multiple(){return e.multiple},inputRef:t,filterItems:d,get defaultItems(){return e.defaultItems},setFilteredItems:r,get itemsToRender(){return h()},isItemSelected:f,handleClick:l,onImageLoad:p,get chunkIndex(){return e.chunkIndex},get selectedItemIds(){return o()}})),n}})]}})},BX=e=>[te(fe,{get when(){return e.options?.isSearchable},get children(){const t=SX();return Pe(t,te(xX,{ref(t){const n=e.inputRef;"function"==typeof n?n(t):e.inputRef=t},get onInput(){return e.filterItems},get placeholder(){return e.options?.searchInputPlaceholder??yX},onClear:()=>e.setFilteredItems(e.defaultItems)})),t}}),(()=>{const t=TX();return Pe(t,te(de,{get each(){return e.itemsToRender},children:(t,n)=>te(MX,{item:t,get index(){return n()},selected:()=>e.isItemSelected(t.id),onClick:()=>e.handleClick(n()),get onImageLoad(){return e.onImageLoad},get multiple(){return e.multiple},get showPingIndicator(){return 0===e.chunkIndex&&1===e.defaultItems.length}})})),T(()=>Te(t,tt("flex flex-wrap justify-end gap-2",e.options?.isSearchable&&"overflow-y-scroll max-h-80 rounded-md"))),t})(),te(fe,{get when(){return e.multiple&&e.selectedItemIds.length>0},get children(){return te(tq,{get children(){return e.options?.buttonLabel??vX}})}})],FX=e=>(()=>{const t=DX();return De(t,"load",e.onImageLoad),T(n=>{const r=e.item.pictureSrc,o=e.item.content??`Picture ${e.index+1}`,i=`Picture choice ${e.index+1}`;return r!==n._v$&&Se(t,"src",n._v$=r),o!==n._v$2&&Se(t,"alt",n._v$2=o),i!==n._v$3&&Se(t,"elementtiming",n._v$3=i),n},{_v$:void 0,_v$2:void 0,_v$3:void 0}),t})(),LX=e=>(()=>{const t=PX();return Pe(t,te(fe,{get when(){return e.item.content},get children(){const t=AX();return Pe(t,()=>e.item.content),t}}),null),Pe(t,te(fe,{get when(){return e.item.description},get children(){const t=OX();return Pe(t,()=>e.item.description),t}}),null),t})(),MX=e=>te(he,{get children(){return[te(ge,{get when(){return e.item.pictureSrc&&e.multiple},get children(){return te(eq,{type:"button",role:"checkbox",get"aria-checked"(){return e.selected()},get"on:click"(){return e.onClick},get class(){return tt("button--selectable","button--has-image",Je(e.item.pictureSrc)&&"button--has-svg")},get"data-itemid"(){return e.item.id},get children(){return[te(FX,{get item(){return e.item},get index(){return e.index},get onImageLoad(){return e.onImageLoad},get multiple(){return e.multiple}}),(()=>{const t=TX();return Pe(t,te(UX,{get isChecked(){return e.selected()},class:"flex-shrink-0"}),null),Pe(t,te(LX,{get item(){return e.item}}),null),T(()=>Te(t,tt("py-2 px-4 flex items-center gap-2",e.item.description&&"items-start"))),t})()]}})}}),te(ge,{get when(){return e.item.pictureSrc&&!e.multiple},get children(){return te(eq,{get"on:click"(){return e.onClick},get"data-itemid"(){return e.item.id},get class(){return tt("button--selectable","button--has-image",Je(e.item.pictureSrc)&&"button--has-svg")},get children(){return[te(FX,{get item(){return e.item},get index(){return e.index},get onImageLoad(){return e.onImageLoad},get multiple(){return e.multiple}}),(()=>{const t=TX();return Pe(t,te(LX,{get item(){return e.item}})),T(()=>Te(t,tt("py-2 px-4 flex items-center gap-2",e.item.description&&"items-start"))),t})()]}})}}),te(ge,{get when(){return!e.item.pictureSrc&&e.multiple},get children(){const t=IX();return Pe(t,te(eq,{type:"button",role:"checkbox",get"aria-checked"(){return e.selected()},get"on:click"(){return e.onClick},get class(){return tt("button--selectable",e.selected()&&"button--selected")},get"data-itemid"(){return e.item.id},get children(){const t=TX();return Pe(t,te(UX,{get isChecked(){return e.selected()},class:"flex-shrink-0"}),null),Pe(t,te(LX,{get item(){return e.item}}),null),T(()=>Te(t,tt("flex items-center gap-2",e.item.description&&"items-start"))),t}})),T(()=>Te(t,tt("relative",Li()&&"w-full"))),t}}),te(ge,{get when(){return!e.item.pictureSrc&&!e.multiple},get children(){const t=IX();return Pe(t,te(eq,{get"on:click"(){return e.onClick},get class(){return tt("button--selectable",e.selected()&&"button--selected")},get"data-itemid"(){return e.item.id},get children(){const t=TX();return Pe(t,te(LX,{get item(){return e.item}})),T(()=>Te(t,tt("flex items-center gap-2",e.item.description&&"items-start"))),t}}),null),Pe(t,te(fe,{get when(){return e.showPingIndicator},get children(){return NX()}}),null),T(()=>Te(t,tt("relative",Li()&&"w-full"))),t}})]}}),UX=e=>(()=>{const t=TX();return Pe(t,te(wX,{get classList(){return{"w-3":!0,"h-3":!0,"transition-opacity":!0,"duration-200":!0,"opacity-100":e.isChecked,"group-hover:opacity-0":e.isChecked,"opacity-0":!e.isChecked}}}),null),Pe(t,te(ft,{get classList(){return{absolute:!0,"top-1/2":!0,"left-1/2":!0,"-translate-x-1/2":!0,"-translate-y-1/2":!0,"w-3":!0,"h-3":!0,"transition-opacity":!0,"duration-200":!0,"opacity-0":!0,"group-hover:opacity-100":e.isChecked}}}),null),T(()=>Te(t,tt("button__checkbox","w-4 h-4 rounded-full relative flex items-center justify-center",e.isChecked&&"button__checkbox--checked",e.class))),t})(),jX={button:"Pay",success:"Success"},$X=ke('<div class="input__field--error mt-4 text-center animate-fade-in">'),zX=ke('<form id="payment-form" class="flex flex-col p-4 w-full items-center"><slot name="stripe-payment-form">');let HX,VX=null,WX=null;const qX=e=>{const[t,n]=S(),[r,o]=S(!1),[i,a]=S(!1);P(async()=>{if(GX(HX),!e.options?.publicKey)return n("Missing Stripe public key");var t;if(VX=await(t=e.options?.publicKey,new Promise(e=>{if(window.Stripe)return e(window.Stripe(t));const n=document.createElement("script");n.src="https://js.stripe.com/v3",document.body.appendChild(n),n.onload=()=>{if(!window.Stripe)throw new Error("Stripe.js failed to load.");e(window.Stripe(t))}})),!VX)return;WX=VX.elements({appearance:{theme:"stripe",variables:{colorPrimary:getComputedStyle(HX).getPropertyValue("--quickbot-button-bg-color")}},clientSecret:e.options.paymentIntentSecret});WX.create("payment",{layout:"tabs"}).mount("#payment-element"),setTimeout(()=>{o(!0),e.onTransitionEnd()},1e3)});const s=async t=>{if(t.preventDefault(),!VX||!WX)return;var r;a(!0),r={sessionId:e.context.sessionId,resultId:e.context.resultId,bot:e.context.bot},sessionStorage.setItem("botPaymentInProgress",JSON.stringify(r));const{postalCode:o,...i}=e.options?.additionalInformation?.address??{},{error:s,paymentIntent:l}=await VX.confirmPayment({elements:WX,confirmParams:{return_url:window.location.href,payment_method_data:{billing_details:{name:e.options?.additionalInformation?.name,email:e.options?.additionalInformation?.email,phone:e.options?.additionalInformation?.phoneNumber,address:{...i,postal_code:o}}}},redirect:"if_required"});return kt(),a(!1),"validation_error"!==s?.type?"card_error"===s?.type?n(s.message):s||"succeeded"!==l.status?void 0:e.onSuccess():void 0};return(()=>{const n=zX(),o=n.firstChild;n.addEventListener("submit",s);return"function"==typeof HX?Oe(HX,o):HX=o,o._$owner=R(),Pe(n,te(fe,{get when(){return r()},get children(){return te(tq,{get isLoading(){return i()},class:"mt-4 w-full max-w-lg animate-fade-in",get children(){return[A(()=>e.options?.labels?.button??jX.button)," ",A(()=>e.options?.amountLabel)]}})}}),null),Pe(n,te(fe,{get when(){return t()},get children(){const e=$X();return Pe(e,t),e}}),null),n})()},GX=e=>{const t=e.getRootNode().host,n=document.createElement("div");n.style.width="100%",n.slot="stripe-payment-form",t.appendChild(n);const r=document.createElement("div");r.id="payment-element",n.appendChild(r)},KX=e=>te(qX,{get onSuccess(){return e.onSuccess},get options(){return e.options},get context(){return e.context},get onTransitionEnd(){return e.onTransitionEnd}});let YX=function(e){return e.ZAPIER="Zapier",e.MAKE_COM="Make.com",e.PABBLY_CONNECT="Pabbly",e.CHATWOOT="Chatwoot",e.PIXEL="Pixel",e.PAYMENT="stripe",e}({});const ZX=ke("<div>"),XX=ke('<div class="transition-opacity duration-200 px-5 py-3">'),QX=e=>{const{setAnswer:t,isSending:n,getDisplayedMessageIndex:r,chatChunks:o}=Fi(),[i,a]=xn(S(),{key:`bot-${e.context.bot.id}-input-footer-${e.chunkIndex}`,storage:e.context.storage}),s=()=>o()[e.chunkIndex]?.input?.answer,l=()=>{const e=o(),t=!!e.at(-1)?.streamingMessageId||n(),i=e.some((e,t)=>0!==e.messages.length&&r(t)<e.messages.length);return!Ze(s())||t||i},u=async n=>{a(n),t(e.chunkIndex,n),e.onSubmit(n)},c=n=>{const r={type:"text",value:n};a(r),t(e.chunkIndex,r),e.onSkip()},d=()=>(e.hasError?(e=>{if(e)return"text"===e.type?e.value:e.url})(i()):void 0)??(e.isInputPrefillEnabled?e.block.prefilledValue:void 0),p=()=>u({type:"text",value:e.block.options?.labels?.success??jX.success});return D(()=>{if(e.block.type===aq.FILE)return;const n=Jt().findLast(t=>e.chunkIndex===t.inputIndex)?.formattedMessage;if(n){const r=s();if("text"===r?.type&&r.label!==n){if(e.block.type===aq.CHOICE&&r.label)return;a(e=>"text"===e?.type?{...e,label:n}:e),t(e.chunkIndex,{...r,label:n})}}}),(()=>{const t=XX();return Pe(t,te(fe,{get when(){return e.hasHostAvatar},get children(){const e=ZX();return T(()=>Te(e,tt("flex flex-shrink-0 items-center",Li()?"w-6 h-6":"w-10 h-10"))),e}}),null),Pe(t,te(he,{get children(){return[te(ge,{get when(){return e.block.type===aq.TEXT},get children(){return te(GG,{get block(){return e.block},get defaultValue(){return d()},get context(){return e.context},onSubmit:u,isInputDisabled:l,hasError:!1})}}),te(ge,{get when(){return e.block.type===aq.NUMBER},get children(){return te(ZG,{get block(){return e.block},get defaultValue(){return d()},onSubmit:u})}}),te(ge,{get when(){return e.block.type===aq.EMAIL},get children(){return te(eK,{get block(){return e.block},get defaultValue(){return d()},onSubmit:u,isInputDisabled:l,hasError:!1})}}),te(ge,{get when(){return e.block.type===aq.URL},get children(){return te(nK,{get block(){return e.block},get defaultValue(){return d()},onSubmit:u,isInputDisabled:l,hasError:!1})}}),te(ge,{get when(){return e.block.type===aq.PHONE},get children(){return te(uK,{get labels(){return e.block.options?.labels},get defaultCountryCode(){return e.block.options?.defaultCountryCode},get defaultValue(){return d()},onSubmit:u,isInputDisabled:l,hasError:!1})}}),te(ge,{get when(){return A(()=>e.block.type===aq.DATE)()&&!l()},get children(){return te(VZ,{get options(){return e.block.options},get defaultValue(){return d()},onSubmit:u})}}),te(ge,{get when(){return A(()=>e.block.type===aq.RATING)()&&!l()},get children(){return te(nX,{get block(){return e.block},get defaultValue(){return d()},onSubmit:u})}}),te(ge,{get when(){return A(()=>e.block.type===aq.FILE)()&&!l()},get children(){return te(hX,{get context(){return e.context},get block(){return e.block},onSubmit:u,onSkip:c})}}),te(ge,{get when(){return A(()=>e.block.type===YX.PAYMENT)()&&!l()},get children(){return te(KX,{get context(){return e.context},get options(){return{...e.block.options,...e.block.runtimeOptions}},onSuccess:p,get onTransitionEnd(){return e.onTransitionEnd}})}}),te(ge,{get when(){return e.block.type===aq.CHOICE&&!l()&&e.block},keyed:!0,children:t=>te(RX,{get chunkIndex(){return e.chunkIndex},get defaultItems(){return t.items},get options(){return t.options},onSubmit:u,get onTransitionEnd(){return e.onTransitionEnd},get multiple(){return!!t.options?.isMultipleChoice}})})]}}),null),T(()=>Se(t,"data-blockid",e.block.id)),t})()},JX=ke('<div class="conversation-container__footer transition-colors duration-200 border-t border-black/8 empty:hidden">'),eQ=e=>{const{chatChunks:t,theme:n,hasError:r,blockRef:o,currentBlock:i,sendMessage:a,isSending:s,getDisplayedMessageIndex:l}=Fi(),u=()=>a(void 0);return[(()=>{const c=JX();return Pe(c,te(fe,{get when(){return i()?.input},children:i=>te(QX,{get block(){return i()},get chunkIndex(){return t().length-1},get hasHostAvatar(){return n().chat?.hostAvatar?.isEnabled??!1},get guestAvatar(){return n().chat?.guestAvatar},get context(){return e.context},get isInputPrefillEnabled(){return e.initialChatReply.bot.settings.general?.isInputPrefillEnabled??rn.isInputPrefillEnabled},get hasError(){return r()},onSubmit:a,onTransitionEnd:()=>nn(o),onSkip:u})}),null),Pe(c,te(fe,{get when(){const e=i(),n=t(),r=!!n.at(-1)?.streamingMessageId||s(),o=n.some((e,t)=>0!==e.messages.length&&l(t)<e.messages.length);return!e?.input&&!r&&!o},get children(){return te($W,{})}}),null),c})(),te(fe,{get when(){return e.initialChatReply.bot.settings.general?.isBrandingEnabled},get children(){return te(UW,{get botContainer(){return e.botContainer}})}})]},tQ=ke('<div class="conversation-container flex flex-col h-full">'),nQ=e=>te(Bi,ae(e,{get children(){const t=tQ();return Pe(t,te(BW,e),null),Pe(t,te(eQ,e),null),t}})),rQ=ke('<div class="h-full flex justify-center items-center flex-col"><p class="text-2xl text-center"></p><pre>'),oQ=e=>(()=>{const t=rQ(),n=t.firstChild,r=n.nextSibling;return Pe(n,()=>e.error.message),Pe(r,()=>JSON.stringify(e.error.cause,null,2)),t})(),iQ="resultId",aQ=e=>{if(e)try{const t=sessionStorage.getItem(`bot-${e}-initialChatReply`)??localStorage.getItem(`bot-${e}-initialChatReply`);if(!t)return;return JSON.parse(t)}catch{}},sQ=(e,{botId:t,storage:n})=>{try{const r=JSON.stringify(e);dQ(n).setItem(`bot-${t}-initialChatReply`,r)}catch{}},lQ=()=>{try{sessionStorage.setItem("bot-botOpened","true")}catch{}},uQ=()=>{try{sessionStorage.removeItem("bot-botOpened")}catch{}},cQ=()=>{try{return"true"===sessionStorage.getItem("bot-botOpened")}catch{return!1}},dQ=e=>"session"===(e??rn.rememberUser.storage)?sessionStorage:localStorage,pQ=e=>{let t;try{const n=aQ(e);n?.bot?.id&&(t=n.bot.id)}catch{}const n=[`bot-${e}`,`resultId-${e}`];t&&t!==e&&(n.push(`bot-${t}`),n.push(`resultId-${t}`));[localStorage,sessionStorage].forEach(e=>{Object.keys(e).forEach(t=>{n.some(e=>t.startsWith(e))&&e.removeItem(t)})})},fQ={position:"--quickbot-progress-bar-position",color:"--quickbot-progress-bar-color",colorRgb:"--quickbot-progress-bar-bg-rgb",height:"--quickbot-progress-bar-height",top:"--quickbot-progress-bar-top",bottom:"--quickbot-progress-bar-bottom"},hQ={container:{fontFamily:"--quickbot-container-font-family",maxWidth:"--quickbot-chat-container-max-width",maxHeight:"--quickbot-chat-container-max-height",bgColor:"--quickbot-chat-container-bg-rgb",bgImage:"--quickbot-chat-container-bg-image",color:"--quickbot-chat-container-color",borderRadius:"--quickbot-chat-container-border-radius",borderWidth:"--quickbot-chat-container-border-width",borderColor:"--quickbot-chat-container-border-rgb",borderOpacity:"--quickbot-chat-container-border-opacity",opacity:"--quickbot-chat-container-opacity",blur:"--quickbot-chat-container-blur",boxShadow:"--quickbot-chat-container-box-shadow"},hostBubbles:{bgColor:"--quickbot-host-bubble-bg-rgb",color:"--quickbot-host-bubble-color",borderRadius:"--quickbot-host-bubble-border-radius",borderWidth:"--quickbot-host-bubble-border-width",borderColor:"--quickbot-host-bubble-border-rgb",borderOpacity:"--quickbot-host-bubble-border-opacity",opacity:"--quickbot-host-bubble-opacity",blur:"--quickbot-host-bubble-blur",boxShadow:"--quickbot-host-bubble-box-shadow"},guestBubbles:{bgColor:"--quickbot-guest-bubble-bg-rgb",color:"--quickbot-guest-bubble-color",borderRadius:"--quickbot-guest-bubble-border-radius",borderWidth:"--quickbot-guest-bubble-border-width",borderColor:"--quickbot-guest-bubble-border-rgb",borderOpacity:"--quickbot-guest-bubble-border-opacity",opacity:"--quickbot-guest-bubble-opacity",blur:"--quickbot-guest-bubble-blur",boxShadow:"--quickbot-guest-bubble-box-shadow"},inputs:{bgColor:"--quickbot-input-bg-rgb",color:"--quickbot-input-color",placeholderColor:"--quickbot-input-placeholder-color",borderRadius:"--quickbot-input-border-radius",borderWidth:"--quickbot-input-border-width",borderColor:"--quickbot-input-border-rgb",borderOpacity:"--quickbot-input-border-opacity",opacity:"--quickbot-input-opacity",blur:"--quickbot-input-blur",boxShadow:"--quickbot-input-box-shadow"},buttons:{bgRgb:"--quickbot-button-bg-rgb",color:"--quickbot-button-color",borderRadius:"--quickbot-button-border-radius",borderWidth:"--quickbot-button-border-width",borderColor:"--quickbot-button-border-rgb",borderOpacity:"--quickbot-button-border-opacity",opacity:"--quickbot-button-opacity",blur:"--quickbot-button-blur",boxShadow:"--quickbot-button-box-shadow"},checkbox:{bgRgb:"--quickbot-checkbox-bg-rgb",alphaRatio:"--selectable-alpha-ratio"}},gQ=(e,t,n)=>{const r=e?.position??mW;t.setProperty(fQ.position,"fixed"===r?n?"absolute":"fixed":r),t.setProperty(fQ.color,e?.color??"#01a952"),t.setProperty(fQ.colorRgb,xq(e?.backgroundColor??"#dffaeb").join(", ")),t.setProperty(fQ.height,`${e?.thickness??4}px`);const o=e?.placement??"top";t.setProperty(fQ.top,"Top"===o?"0":"auto"),t.setProperty(fQ.bottom,"Bottom"===o?"0":"auto")},mQ=(e,t)=>{vQ(e?.container,t,e?.roundness),yQ(e?.hostBubbles,t,e?.roundness),bQ(e?.guestBubbles,t,e?.roundness),wQ(e?.buttons,t,e?.roundness),EQ(e?.inputs,t,e?.roundness),_Q(e?.container,t)},vQ=(e,t,n)=>{const r=e?.font;t.setProperty(hQ.container.fontFamily,("string"==typeof r?r:r?.family)??gW);const o=e?.background,i=o?.type??hW.COLOR,a=o?.content;let s=e?.backgroundColor??yW;o&&i===hW.COLOR&&a?s=a:o&&i===hW.NONE&&(s="transparent");const l="transparent"===s||Xe(s),u=Cq(s);o&&i===hW.IMAGE&&a?t.setProperty(hQ.container.bgImage,`url(${a})`):t.setProperty(hQ.container.bgImage,"none"),t.setProperty(hQ.container.bgColor,l?"0, 0, 0":u.rgb.join(", ")),t.setProperty(hQ.container.color,_q(e?.color??"#303235").join(", ")),t.setProperty(hQ.container.maxWidth,e?.maxWidth??"800px"),t.setProperty(hQ.container.maxHeight,e?.maxHeight??"100%");const c=l?0:1!==u.alpha?u.alpha:e?.opacity??1;t.setProperty(hQ.container.opacity,l?"0":c.toString()),t.setProperty(hQ.container.blur,1===c||l?"0px":`${e?.blur??0}px`),kQ(e?.shadow,t,hQ.container.boxShadow),xQ(e?.border??{roundeness:n??vW},t,hQ.container.borderRadius),t.setProperty(hQ.container.borderWidth,Ye(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(hQ.container.borderOpacity,Ye(e?.border?.opacity)?e.border.opacity.toString():1..toString()),t.setProperty(hQ.container.borderColor,xq(e?.border?.color??"").join(", "))},yQ=(e,t,n)=>{const r=e?.backgroundColor??"#f5f5f5",o=Cq(r);t.setProperty(hQ.hostBubbles.bgColor,o.rgb.join(", ")),t.setProperty(hQ.hostBubbles.color,e?.color??"#202020"),xQ(e?.border??{roundeness:n??vW},t,hQ.hostBubbles.borderRadius),t.setProperty(hQ.hostBubbles.borderWidth,Ye(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(hQ.hostBubbles.borderColor,xq(e?.border?.color??"").join(", "));const i="transparent"===r?0:1!==o.alpha?o.alpha:e?.opacity??1;t.setProperty(hQ.hostBubbles.opacity,i.toString()),t.setProperty(hQ.hostBubbles.borderOpacity,Ye(e?.border?.opacity)?e.border.opacity.toString():1..toString()),t.setProperty(hQ.hostBubbles.blur,Ye(e?.blur)?`${e.blur??0}px`:"none"),kQ(e?.shadow,t,hQ.hostBubbles.boxShadow)},bQ=(e,t,n)=>{const r=e?.backgroundColor??"#dffaeb",o=Cq(r);t.setProperty(hQ.guestBubbles.bgColor,o.rgb.join(", ")),t.setProperty(hQ.guestBubbles.color,e?.color??"#1c201f"),xQ(e?.border??{roundeness:n??vW},t,hQ.guestBubbles.borderRadius),t.setProperty(hQ.guestBubbles.borderWidth,Ye(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(hQ.guestBubbles.borderColor,xq(e?.border?.color??"").join(", ")),t.setProperty(hQ.guestBubbles.borderOpacity,Ye(e?.border?.opacity)?e.border.opacity.toString():1..toString());const i="transparent"===r?0:1!==o.alpha?o.alpha:e?.opacity??1;t.setProperty(hQ.guestBubbles.opacity,i.toString()),t.setProperty(hQ.guestBubbles.blur,Ye(e?.blur)?`${e.blur??0}px`:"none"),kQ(e?.shadow,t,hQ.guestBubbles.boxShadow)},wQ=(e,t,n)=>{const r=e?.backgroundColor??bW,o=Cq(r);t.setProperty(hQ.buttons.bgRgb,o.rgb.join(", ")),t.setProperty(hQ.buttons.color,e?.color??"#ffffff"),xQ(e?.border??{roundeness:n??vW},t,hQ.buttons.borderRadius),t.setProperty(hQ.buttons.borderWidth,Ye(e?.border?.thickness)?`${e?.border?.thickness}px`:"0px"),t.setProperty(hQ.buttons.borderColor,xq(e?.border?.color??e?.backgroundColor??bW).join(", ")),t.setProperty(hQ.buttons.borderOpacity,Ye(e?.border?.opacity)?e.border.opacity.toString():1..toString());const i="transparent"===r?0:1!==o.alpha?o.alpha:e?.opacity??1;t.setProperty(hQ.buttons.opacity,i.toString()),t.setProperty(hQ.buttons.blur,Ye(e?.blur)?`${e.blur??0}px`:"none"),kQ(e?.shadow,t,hQ.buttons.boxShadow)},EQ=(e,t,n)=>{const r=e?.backgroundColor??"#FFFFFF",o=Cq(r);t.setProperty(hQ.inputs.bgColor,o.rgb.join(", ")),t.setProperty(hQ.inputs.color,e?.color??"#202020"),t.setProperty(hQ.inputs.placeholderColor,e?.placeholderColor??"#9095A0"),xQ(e?.border??{roundeness:n??vW},t,hQ.inputs.borderRadius),t.setProperty(hQ.inputs.borderWidth,Ye(e?.border?.thickness)?`${e?.border?.thickness}px`:"0"),t.setProperty(hQ.inputs.borderColor,xq(e?.border?.color??"").join(", ")),t.setProperty(hQ.inputs.borderOpacity,Ye(e?.border?.opacity)?e.border.opacity.toString():1..toString());const i="transparent"===r?0:1!==o.alpha?o.alpha:e?.opacity??1;t.setProperty(hQ.inputs.opacity,i.toString()),t.setProperty(hQ.inputs.blur,Ye(e?.blur)?`${e.blur??0}px`:"none"),kQ(e?.shadow??"md",t,hQ.inputs.boxShadow)},_Q=(e,t)=>{const n=e?.backgroundColor??yW;"transparent"===n||Xe(n)||(e?.opacity??1)<=.2?(t.setProperty(hQ.checkbox.bgRgb,"255, 255, 255"),t.setProperty(hQ.checkbox.alphaRatio,"2")):(t.setProperty(hQ.checkbox.bgRgb,xq(n).concat(e?.opacity??1).join(", ")),t.setProperty(hQ.checkbox.alphaRatio,"2"))},xQ=(e,t,n)=>{switch(e?.roundeness??vW){case"none":t.setProperty(n,"0");break;case"medium":t.setProperty(n,"6px");break;case"large":t.setProperty(n,"20px");break;case"custom":t.setProperty(n,`${e.customRoundeness??6}px`)}},kQ=(e,t,n)=>{if(void 0!==e)switch(e){case"none":t.setProperty(n,"0 0 #0000");break;case"sm":t.setProperty(n,"0 1px 2px 0 rgb(0 0 0 / 0.05)");break;case"md":t.setProperty(n,"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)");break;case"lg":t.setProperty(n,"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)");break;case"xl":t.setProperty(n,"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)");break;case"2xl":t.setProperty(n,"0 25px 50px -12px rgb(0 0 0 / 0.25)")}else t.setProperty(n,"0 0 #0000")},CQ="bot-font",SQ=e=>{const t=document.getElementById(CQ);if("string"==typeof e||"Google"===e.type){const n=("string"==typeof e?e:e.family)??gW;if(t?.getAttribute("href")?.includes(n))return;t?.remove();const r=document.createElement("link");return r.href=`https://fonts.bunny.net/css2?family=${n}:ital,wght@0,300;0,400;0,600;1,300;1,400;1,600&display=swap`,r.rel="stylesheet",r.id=CQ,void document.head.appendChild(r)}if("Custom"===e.type){if(Qe(e.css)){if(t?.innerHTML===e.css)return;t?.remove();const n=document.createElement("style");n.innerHTML=e.css,n.id=CQ,document.head.appendChild(n)}if(Qe(e.url)){if(t?.getAttribute("href")===e.url)return;t?.remove();const n=document.createElement("link");n.href=e.url,n.rel="stylesheet",n.id=CQ,document.head.appendChild(n)}}},TQ=ke('<div class="left-0 w-full z-[42424242] progress-bar "><div class="absolute h-full transition-[width] duration-[250ms] ease-in-out progress-bar__fill">'),DQ=e=>(()=>{const t=TQ(),n=t.firstChild;return T(()=>null!=`${e.value}%`?n.style.setProperty("width",`${e.value}%`):n.style.removeProperty("width")),t})(),[,AQ]=S(),OQ=ke("<style>"),PQ=ke('<div class="flex items-center justify-center h-full w-full">'),IQ=ke("<div>"),NQ=e=>{const[t,n]=S(),[r,o]=S(""),[i,a]=S(!1),[s,l]=S(!1),[u,c]=S(),d=async()=>{e.font&&SQ(e.font),a(!0),l(!0);const t=new URLSearchParams(location.search);e.onInit?.();const r={};t.forEach((e,t)=>{r[t]=e});const i="string"==typeof e.bot?e.bot:void 0,s="string"!=typeof e.bot||(e.isPreview??!1),u=(e=>{if(e)try{return sessionStorage.getItem(`${iQ}-${e}`)??localStorage.getItem(`${iQ}-${e}`)??void 0}catch{}})(i),{data:d,error:p}=await async function({bot:e,isPreview:t,apiHost:n,prefilledVariables:r,resultId:o,stripeRedirectStatus:i,startFrom:a,sessionId:s}){if(Ze(e))throw new Error("Bot ID is required to get initial messages");const l=xt()??void 0,u=l?JSON.parse(l):void 0;if(u){kt();try{return{data:{...await Gt.post(Yt({apiHost:n,apiEndpoint:`/api/v1/sessions/${u.sessionId}/continueChat`}),{json:{message:u?"failed"===i?"fail":"Success":void 0},timeout:!1}).json(),...u}}}catch(e){return{error:e}}}const c="string"==typeof e?e:e.id;if(t)try{return{data:await Gt.post(Yt({apiHost:n,apiEndpoint:`/api/v1/bots/${c}/preview/startChat`}),{json:{isStreamEnabled:!0,startFrom:a,bot:e,prefilledVariables:{...r,system_device:Zt(navigator.userAgent),"Device type":Zt(navigator.userAgent)},sessionId:s},timeout:!1}).json()}}catch(e){return{error:e}}try{const e=parent!==window&&Qe(document.referrer)?new URL(document.referrer).origin:void 0,t=await Gt.post(Yt({apiHost:n,apiEndpoint:`/api/v1/bots/${c}/startChat`}),{headers:{"x-quickbot-iframe-referrer-origin":e},json:{isStreamEnabled:!0,prefilledVariables:{...r,system_device:Zt(navigator.userAgent),"Device type":Zt(navigator.userAgent)},resultId:o,isOnlyRegistering:!1},timeout:!1}),i=t.headers.get("access-control-allow-origin");if(e&&i&&"*"!==i&&!e.includes(i))throw new Kt(i);return{data:await t.json()}}catch(e){return{error:e}}}({stripeRedirectStatus:t.get("redirect_status")??void 0,bot:e.bot,apiHost:e.apiHost,isPreview:s,resultId:Qe(e.resultId)?e.resultId:u,prefilledVariables:{...r,...e.prefilledVariables},startFrom:e.startFrom,sessionId:e.sessionId});if(p instanceof Ct)return l(!1),s?c(new Error("An error occurred while loading the bot.",{cause:{status:p.response.status,body:await p.response.json()}})):400===p.response.status||403===p.response.status?c(new Error("This bot is now closed.")):404===p.response.status?c(new Error("The bot you're looking for doesn't exist.")):c(new Error(`Error! Couldn't initiate the chat. (${p.response.statusText})`));if(p instanceof Kt)return l(!1),c(new Error(p.message));if(!d)return l(!1),p&&(console.error(p),s)?c(new Error("Error! Could not reach server. Check your connection.",{cause:p})):c(new Error("Error! Could not reach server. Check your connection."));if(d.resultId&&i&&(d.bot.settings.general?.rememberUser?.isEnabled??rn.rememberUser.isEnabled)){u&&u!==d.resultId&&pQ(i);const t=d.bot.settings.general?.rememberUser?.storage??rn.rememberUser.storage;((e="session")=>(t,n)=>{try{dQ(e).setItem(`${iQ}-${t}`,n)}catch{}})(t)(i,d.resultId);const r=aQ(i);r&&r.bot.publishedAt&&d.bot.publishedAt?new Date(r.bot.publishedAt).getTime()===new Date(d.bot.publishedAt).getTime()?n(d):(pQ(i),n(d),sQ(d,{botId:i,storage:t})):(n(d),sQ(d,{botId:i,storage:t})),e.onChatStatePersisted?.(!0)}else pQ(i||d.bot.id),n(d),d.logs&&e.onNewLogs?.(d.logs),e.onChatStatePersisted?.(!1);o(d.bot.theme.customCss??""),l(!1)};return D(()=>{Ze(e.bot)||i()||d().then()}),D(()=>{Ze(e.bot)||"string"==typeof e.bot||(o(e.bot.theme.customCss??""),e.bot.theme.progressBar?.isEnabled&&t()&&!t()?.bot.theme.progressBar?.isEnabled&&(a(!1),d().then()))}),I(()=>{a(!1)}),[(()=>{const e=OQ();return Pe(e,r),e})(),te(fe,{get when(){return u()},keyed:!0,children:e=>te(oQ,{error:e})}),te(fe,{get when(){return A(()=>!!s())()&&!u()},get children(){const e=PQ();return Pe(e,te(QW,{class:"h-8 w-8 text-blue-500"})),e}}),te(fe,{get when(){return t()},keyed:!0,children:t=>te(RQ,{get class(){return e.class},get initialChatReply(){return{...t,bot:{...t.bot,settings:"string"==typeof e.bot?t.bot?.settings:e.bot?.settings,theme:"string"==typeof e.bot?t.bot?.theme:e.bot?.theme}}},get context(){return{apiHost:e.apiHost,isPreview:"string"!=typeof e.bot||(e.isPreview??!1),resultId:t.resultId,sessionId:t.sessionId,bot:t.bot,storage:t.bot.settings.general?.rememberUser?.isEnabled&&"string"==typeof e.bot&&!e.isPreview?t.bot.settings.general?.rememberUser?.storage??rn.rememberUser.storage:void 0}},get progressBarRef(){return e.progressBarRef},get onNewBlock(){return e.onNewBlock},get onNewLogs(){return e.onNewLogs},get onAnswer(){return e.onAnswer},get onEnd(){return e.onEnd},get onBubblesDisplayed(){return e.onBubblesDisplayed}})})]},RQ=e=>{const[t,n]=xn(S(e.initialChatReply.progress),{storage:e.context.storage,key:`bot-${e.context.bot.id}-progressValue`}),[r,o]=S(!1);let i;const a=new ResizeObserver(e=>Mi(e[0].target.clientWidth<400));return P(()=>{i&&(AQ(i),a.observe(i),Gi(`${i.clientHeight}px`),((e,t,n)=>{if(!e)return;const r=t?.style;r&&(gQ(e.progressBar,r,n),mQ(e.chat,r))})(e.initialChatReply.bot.theme,i,e.context.isPreview),o(!0))}),D(()=>{SQ(e.initialChatReply.bot.theme.chat?.container?.font??{type:"Google",family:gW})}),I(()=>{i&&a.unobserve(i)}),(()=>{const o=IQ();return"function"==typeof i?Oe(i,o):i=o,Pe(o,te(fe,{get when(){return Ye(t())&&e.initialChatReply.bot.theme.progressBar?.isEnabled},get children(){return te(fe,{get when(){return e.progressBarRef&&"fixed"===(e.initialChatReply.bot.theme.progressBar?.position??mW)},get fallback(){return te(DQ,{get value(){return t()}})},get children(){return te(je,{get mount(){return e.progressBarRef},get children(){return te(DQ,{get value(){return t()}})}})}})}}),null),Pe(o,te(fe,{get when(){return r()},get children(){return te(nQ,{botContainer:i,get context(){return e.context},get initialChatReply(){return e.initialChatReply},get onNewBlock(){return e.onNewBlock},get onAnswer(){return e.onAnswer},get onEnd(){return e.onEnd},get onNewLogs(){return e.onNewLogs},onProgressUpdate:n,get onBubblesDisplayed(){return e.onBubblesDisplayed}})}}),null),Pe(o,te(KV,{toaster:wq,children:e=>te(ZV.Root,{get children(){return[te(ZV.Title,{get children(){return e().title}}),te(ZV.Description,{get children(){return e().description}}),te(ZV.CloseTrigger,{class:"absolute right-2 top-2",get children(){return te(ft,{class:"w-4"})}})]}})}),null),T(()=>Te(o,tt("h-full w-full flex flex-col quickbot",e.class))),o})()},BQ=ke("<style>"),FQ=ke("<div>"),LQ=ke('<div part="bot">'),MQ=e=>{const[t,n]=se(e,["onOpen","onClose","previewMessage","onPreviewMessageClick","theme","autoShowDelay"]),[r,o]=S(!0),[i,a]=S(n.prefilledVariables),[s,l]=S(!1),[u,c]=S({message:t.previewMessage?.message??"",avatarUrl:t.previewMessage?.avatarUrl}),[d,p]=S(!1),[f,h]=S(!1),[g,m]=S(UQ(t.theme?.button?.size??"medium"));let v;D(()=>{m(UQ(t.theme?.button?.size??"medium"))}),oq(e=>{const{data:t}=e;"open"===t.command&&y(),"close"===t.command&&b(),"toggle"===t.command&&w(),"showPreviewMessage"===t.command&&_(t.message),"hidePreviewMessage"===t.command&&x(),"setPrefilledVariables"===t.command&&a(e=>({...e,...t.variables})),"unmount"===t.command&&k()}),P(()=>{const e=t.autoShowDelay,n=t.previewMessage?.autoShowDelay;(cQ()||xt())&&y(),Ye(e)&&setTimeout(()=>{y()},e),Ye(n)&&setTimeout(()=>{_()},n)}),D(()=>{e.prefilledVariables&&a(t=>({...t,...e.prefilledVariables}))});const y=()=>{f()||h(!0),x(),p(!0),d()&&t.onOpen?.()},b=()=>{p(!1),uQ(),d()&&t.onClose?.()},w=()=>{d()?b():y()},E=()=>{t.onPreviewMessageClick?.(),y()},_=e=>{e&&c(e),d()||l(!0)},x=()=>{l(!1)},k=()=>{d()?(b(),setTimeout(()=>{o(!1)},200)):o(!1)},C=e=>{n.onChatStatePersisted?.(e),e&&lQ()};return te(fe,{get when(){return r()},get children(){return te(dV,{get value(){return document.querySelector("bot-bubble")?.shadowRoot},get children(){return[(()=>{const e=BQ();return Pe(e,Ge),e})(),te(fe,{get when(){return s()},get children(){return te(bt,ae(u,{get placement(){return t.theme?.placement},get previewMessageTheme(){return t.theme?.previewMessage},get buttonSize(){return g()},onClick:E,onCloseClick:x}))}}),te(dt,ae(()=>t.theme?.button,{get placement(){return t.theme?.placement},toggleBot:w,get isBotOpened(){return d()},get buttonSize(){return g()}})),(()=>{const e=FQ();return"function"==typeof v?Oe(v,e):v=e,e})(),(()=>{const r=LQ();return r.style.setProperty("transition","transform 200ms cubic-bezier(0, 1.2, 1, 1), opacity 150ms ease-out"),r.style.setProperty("box-shadow","rgb(0 0 0 / 16%) 0px 5px 40px"),r.style.setProperty("z-index","42424242"),Pe(r,te(fe,{get when(){return f()},get children(){return te(NQ,ae(n,{onChatStatePersisted:C,get prefilledVariables(){return i()},class:"rounded-lg",progressBarRef:v}))}})),T(n=>{const o=`calc(100% - ${g()} - 32px)`,i=e.theme?.chatWindow?.maxHeight??"704px",a=e.theme?.chatWindow?.maxWidth??"400px",s="left"===e.theme?.placement?"bottom left":"bottom right",l=d()?"scale3d(1, 1, 1)":"scale3d(0, 0, 1)",u=t.theme?.chatWindow?.backgroundColor,c=`calc(${g()} + 32px)`,p="fixed rounded-lg w-full"+(d()?" opacity-1":" opacity-0 pointer-events-none")+("left"===e.theme?.placement?" left-5":" sm:right-5 right-0");return o!==n._v$&&(null!=(n._v$=o)?r.style.setProperty("height",o):r.style.removeProperty("height")),i!==n._v$2&&(null!=(n._v$2=i)?r.style.setProperty("max-height",i):r.style.removeProperty("max-height")),a!==n._v$3&&(null!=(n._v$3=a)?r.style.setProperty("max-width",a):r.style.removeProperty("max-width")),s!==n._v$4&&(null!=(n._v$4=s)?r.style.setProperty("transform-origin",s):r.style.removeProperty("transform-origin")),l!==n._v$5&&(null!=(n._v$5=l)?r.style.setProperty("transform",l):r.style.removeProperty("transform")),u!==n._v$6&&(null!=(n._v$6=u)?r.style.setProperty("background-color",u):r.style.removeProperty("background-color")),c!==n._v$7&&(null!=(n._v$7=c)?r.style.setProperty("bottom",c):r.style.removeProperty("bottom")),p!==n._v$8&&Te(r,n._v$8=p),n},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0,_v$6:void 0,_v$7:void 0,_v$8:void 0}),r})()]}})}})},UQ=e=>"medium"===e?"48px":"large"===e?"64px":e||"48px",jQ=ke("<style>"),$Q=ke('<div class="relative" aria-labelledby="modal-title" role="dialog" aria-modal="true"><style></style><div class="fixed inset-0 bg-black bg-opacity-50 transition-opacity animate-fade-in" part="overlay"></div><div class="fixed inset-0 z-10 overflow-y-auto"><div class="flex min-h-full items-center justify-center p-4 text-center sm:p-0"><div>'),zQ=e=>{const[t,n]=se(e,["onOpen","onClose","autoShowDelay","theme","isOpen","defaultOpen"]),[r,o]=S(n.prefilledVariables),[i,a]=S(t.isOpen??!1);oq(e=>{const{data:t}=e;"open"===t.command&&l(),"close"===t.command&&u(),"toggle"===t.command&&c(),"setPrefilledVariables"===t.command&&o(e=>({...e,...t.variables}))}),P(()=>{(t.defaultOpen||xt()||cQ())&&l();const e=t.autoShowDelay;Ye(e)&&setTimeout(()=>{l()},e)}),D(()=>{Ze(e.isOpen)||e.isOpen===i()||c()}),D(()=>{e.prefilledVariables&&o(t=>({...t,...e.prefilledVariables}))});const s=e=>{e.stopPropagation()},l=()=>{a(!0),t.onOpen?.(),document.body.style.setProperty("overflow","hidden","important"),document.addEventListener("pointerdown",u)},u=()=>{a(!1),t.onClose?.(),document.body.style.overflow="auto",document.removeEventListener("pointerdown",u),uQ()},c=()=>i()?u():l(),d=e=>{n.onChatStatePersisted?.(e),e&&lQ()};return te(fe,{get when(){return i()},get children(){return te(dV,{get value(){return document.querySelector("quickbot-popup")?.shadowRoot},get children(){return[(()=>{const e=jQ();return Pe(e,Ge),e})(),(()=>{const t=$Q(),o=t.firstChild,i=o.nextSibling.nextSibling.firstChild.firstChild;return Pe(o,Ge),i.addEventListener("pointerdown",s),Pe(i,te(NQ,ae(n,{get prefilledVariables(){return r()},onChatStatePersisted:d}))),T(n=>{const r=e.theme?.zIndex??42424242,o="relative h-[80vh] transform overflow-hidden rounded-lg text-left transition-all sm:my-8 w-full max-w-lg"+(e.theme?.backgroundColor?" shadow-xl":""),a=e.theme?.backgroundColor??"transparent",s=e.theme?.width??"512px";return r!==n._v$&&(null!=(n._v$=r)?t.style.setProperty("z-index",r):t.style.removeProperty("z-index")),o!==n._v$2&&Te(i,n._v$2=o),a!==n._v$3&&(null!=(n._v$3=a)?i.style.setProperty("background-color",a):i.style.removeProperty("background-color")),s!==n._v$4&&(null!=(n._v$4=s)?i.style.setProperty("max-width",s):i.style.removeProperty("max-width")),n},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),t})()]}})}})},HQ=ke("<style>\n:host {\n display: block;\n width: 100%;\n height: 100%;\n overflow-y: hidden;\n}\n"),VQ=(e,{element:t})=>{const[n,r]=S(!1),o=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&r(!0)});return oq(()=>{}),P(()=>{o.observe(t)}),I(()=>{o.disconnect()}),te(dV,{get value(){return document.querySelector("quickbot-standard")?.shadowRoot},get children(){return[(()=>{const e=HQ(),t=e.firstChild;return Pe(e,Ge,t),e})(),te(fe,{get when(){return n()},get children(){return te(NQ,e)}})]}})},WQ=()=>{window.postMessage({isFromBot:!0,command:"close"})},qQ=()=>{window.postMessage({isFromBot:!0,command:"hidePreviewMessage"})},GQ=()=>{window.postMessage({isFromBot:!0,command:"open"})},KQ=e=>{const t={isFromBot:!0,command:"setPrefilledVariables",variables:e};window.postMessage(t)},YQ=e=>{const t={isFromBot:!0,command:"showPreviewMessage",message:e};window.postMessage(t)},ZQ=()=>{window.postMessage({isFromBot:!0,command:"toggle"})},XQ=e=>{const t={isFromBot:!0,command:"setInputValue",value:e};window.postMessage(t)},QQ=()=>{window.postMessage({isFromBot:!0,command:"unmount"})},JQ=e=>{const t=e.id?document.getElementById(e.id):document.querySelector("quickbot-standard");if(!t)throw new Error("<quickbot-standard> element not found.");Object.assign(t,e)},eJ=e=>{const t=document.createElement("quickbot-popup");Object.assign(t,e),document.body.prepend(t)},tJ=e=>{const t=document.createElement("bot-bubble");Object.assign(t,e),document.body.prepend(t)};"undefined"!=typeof window&&(He("quickbot-standard",Ve,VQ),He("bot-bubble",qe,MQ),He("quickbot-popup",We,zQ));const nJ={initStandard:JQ,initPopup:eJ,initBubble:tJ,close:WQ,hidePreviewMessage:qQ,open:GQ,setPrefilledVariables:KQ,showPreviewMessage:YQ,toggle:ZQ,setInputValue:XQ,unmount:QQ};(e=>{"undefined"!=typeof window&&(window.Bot={...e})})(nJ);export{nJ as default};
|