-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathweb.js
More file actions
1 lines (1 loc) · 163 KB
/
web.js
File metadata and controls
1 lines (1 loc) · 163 KB
1
function e(e){return Object.keys(e).reduce(((t,r)=>{var s=e[r];return t[r]=Object.assign({},s),!o(s.value)||function(e){return"[object Function]"===Object.prototype.toString.call(e)}(s.value)||Array.isArray(s.value)||(t[r].value=Object.assign({},s.value)),Array.isArray(s.value)&&(t[r].value=s.value.slice(0)),t}),{})}function t(e){if(e)try{return JSON.parse(e)}catch(t){return e}}function r(e,t,r){if(null==r||!1===r)return e.removeAttribute(t);let o=JSON.stringify(r);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)}var s,n;let i;function a(o,s){const n=Object.keys(s);return class extends o{static get observedAttributes(){return n.map((e=>s[e].attribute))}constructor(){super(),this.__initialized=!1,this.__released=!1,this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props={}}connectedCallback(){if(!this.__initialized){this.__releaseCallbacks=[],this.__propertyChangedCallbacks=[],this.__updating={},this.props=function(o,s){const n=e(s);return Object.keys(s).forEach((e=>{const s=n[e],i=o.getAttribute(s.attribute),a=o[e];i&&(s.value=s.parse?t(i):i),null!=a&&(s.value=Array.isArray(a)?a.slice(0):a),s.reflect&&r(o,s.attribute,s.value),Object.defineProperty(o,e,{get:()=>s.value,set(t){var o=s.value;s.value=t,s.reflect&&r(this,s.attribute,s.value);for(let r=0,s=this.__propertyChangedCallbacks.length;r<s;r++)this.__propertyChangedCallbacks[r](e,t,o)},enumerable:!0,configurable:!0})})),n}(this,s);var o=function(e){return Object.keys(e).reduce(((t,r)=>(t[r]=e[r].value,t)),{})}(this.props),n=this.Component,a=i;try{(i=this).__initialized=!0,function(e){return"function"==typeof e&&0===e.toString().indexOf("class")}(n)?new n(o,{element:this}):n(o,{element:this})}finally{i=a}}}async disconnectedCallback(){if(await Promise.resolve(),!this.isConnected){this.__propertyChangedCallbacks.length=0;for(var e=null;e=this.__releaseCallbacks.pop();)e(this);delete this.__initialized,this.__released=!0}}attributeChangedCallback(e,r,o){!this.__initialized||this.__updating[e]||(e=this.lookupProp(e))in s&&(null==o&&!this[e]||(this[e]=s[e].parse?t(o):o))}lookupProp(e){if(s)return n.find((t=>e===t||e===s[t].attribute))}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(e){this.__releaseCallbacks.push(e)}addPropertyChangedCallback(e){this.__propertyChangedCallbacks.push(e)}}}function l(e,t={},r={}){const{BaseElement:s=HTMLElement,extension:n}=r;return r=>{if(!e)throw new Error("tag is required to register a Component");let i=customElements.get(e);return i?i.prototype.Component=r:((i=a(s,function(e){return e?Object.keys(e).reduce(((t,r)=>{var s=e[r];return t[r]=o(s)&&"value"in s?s:{value:s},t[r].attribute||(t[r].attribute=function(e){return e.replace(/\.?([A-Z]+)/g,((e,t)=>"-"+t.toLowerCase())).replace("_","-").replace(/^-/,"")}(r)),t[r].parse="parse"in t[r]?t[r].parse:"string"!=typeof t[r].value,t}),{}):{}}(t))).prototype.Component=r,i.prototype.registeredTag=e,customElements.define(e,i,n)),i}}(s=self.document)&&!s.getElementById("livereloadscript")&&((n=s.createElement("script")).async=1,n.src="//"+(self.location.host||"localhost").split(":")[0]+":35729/livereload.js?snipver=1",n.id="livereloadscript",s.getElementsByTagName("head")[0].appendChild(n));const c=Symbol("solid-proxy"),h=Symbol("solid-track"),p={equals:(e,t)=>e===t};let d=z;const u=1,f=2,g={owned:null,cleanups:null,context:null,owner:null};var b=null;let w=null,m=null,y=null,v=null,x=0;function k(e,t){const r=m,o=b,s=0===e.length,n=s?g:{owned:null,cleanups:null,context:null,owner:void 0===t?o:t},i=s?e:()=>e((()=>P((()=>U(n)))));b=n,m=null;try{return j(i,!0)}finally{m=r,b=o}}function _(e,t){const r={value:e,observers:null,observerSlots:null,comparator:(t=t?Object.assign({},p,t):p).equals||void 0};return[E.bind(r),e=>("function"==typeof e&&(e=e(r.value)),B(r,e))]}function C(e,t,r){R(O(e,t,!1,u))}function S(e,t,r){d=I,(e=O(e,t,!1,u)).user=!0,v?v.push(e):R(e)}function A(e,t,r){return r=r?Object.assign({},p,r):p,(e=O(e,t,!0,0)).observers=null,e.observerSlots=null,e.comparator=r.equals||void 0,R(e),E.bind(e)}function P(e){if(null===m)return e();var t=m;m=null;try{return e()}finally{m=t}}function $(e){S((()=>P(e)))}function T(e){return null!==b&&(null===b.cleanups?b.cleanups=[e]:b.cleanups.push(e)),e}function E(){var e;return this.sources&&this.state&&(this.state===u?R(this):(e=y,y=null,j((()=>N(this)),!1),y=e)),m&&(e=this.observers?this.observers.length:0,m.sources?(m.sources.push(this),m.sourceSlots.push(e)):(m.sources=[this],m.sourceSlots=[e]),this.observers?(this.observers.push(m),this.observerSlots.push(m.sources.length-1)):(this.observers=[m],this.observerSlots=[m.sources.length-1])),this.value}function B(e,t,r){var o=e.value;return e.comparator&&e.comparator(o,t)||(e.value=t,e.observers&&e.observers.length&&j((()=>{for(let o=0;o<e.observers.length;o+=1){var t=e.observers[o],r=w&&w.running;r&&w.disposed.has(t),(r?t.tState:t.state)||((t.pure?y:v).push(t),t.observers&&M(t)),r||(t.state=u)}if(1e6<y.length)throw y=[],new Error}),!1)),t}function R(e){var t,r,o;e.fn&&(U(e),t=b,r=m,o=x,function(e,t,r){let o;try{o=e.fn(t)}catch(t){return e.pure&&(e.state=u,e.owned&&e.owned.forEach(U),e.owned=null),e.updatedAt=r+1,q(t)}(!e.updatedAt||e.updatedAt<=r)&&(null!=e.updatedAt&&"observers"in e?B(e,o):e.value=o,e.updatedAt=r)}(m=b=e,e.value,o),m=r,b=t)}function O(e,t,r,o=u,s){return e={fn:e,state:o,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:b,context:null,pure:r},null!==b&&b!==g&&(b.owned?b.owned.push(e):b.owned=[e]),e}function L(e){if(0!==e.state){if(e.state===f)return N(e);if(e.suspense&&P(e.suspense.inFallback))return e.suspense.effects.push(e);const r=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<x);)e.state&&r.push(e);for(let o=r.length-1;0<=o;o--){var t;(e=r[o]).state===u?R(e):e.state===f&&(t=y,y=null,j((()=>N(e,r[0])),!1),y=t)}}}function j(e,t){if(y)return e();let r=!1;t||(y=[]),v?r=!0:v=[],x++;try{var o=e();return function(e){if(y&&(z(y),y=null),!e){const e=v;v=null,e.length&&j((()=>d(e)),!1)}}(r),o}catch(e){r||(v=null),y=null,q(e)}}function z(e){for(let t=0;t<e.length;t++)L(e[t])}function I(e){let t,r=0;for(t=0;t<e.length;t++){var o=e[t];o.user?e[r++]=o:L(o)}for(t=0;t<r;t++)L(e[t])}function N(e,t){for(let s=e.state=0;s<e.sources.length;s+=1){var r,o=e.sources[s];o.sources&&((r=o.state)===u?o!==t&&(!o.updatedAt||o.updatedAt<x)&&L(o):r===f&&N(o,t))}}function M(e){for(let r=0;r<e.observers.length;r+=1){var t=e.observers[r];t.state||(t.state=f,(t.pure?y:v).push(t),t.observers&&M(t))}}function U(e){let t;if(e.sources)for(;e.sources.length;){var r,o,s=e.sources.pop(),n=e.sourceSlots.pop(),i=s.observers;i&&i.length&&(r=i.pop(),o=s.observerSlots.pop(),n<i.length)&&(i[r.sourceSlots[o]=n]=r,s.observerSlots[n]=o)}if(e.owned){for(t=e.owned.length-1;0<=t;t--)U(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;0<=t;t--)e.cleanups[t]();e.cleanups=null}e.state=0,e.context=null}function q(e){throw e}const D=Symbol("fallback");function F(e){for(let t=0;t<e.length;t++)e[t]()}function H(e,t){return P((()=>e(t||{})))}function W(){return!0}const G={get:(e,t,r)=>t===c?r:e.get(t),has:(e,t)=>t===c||e.has(t),set:W,deleteProperty:W,getOwnPropertyDescriptor:(e,t)=>({configurable:!0,enumerable:!0,get:()=>e.get(t),set:W,deleteProperty:W}),ownKeys:e=>e.keys()};function V(e){return(e="function"==typeof e?e():e)||{}}function Y(...e){let t=!1;for(let o=0;o<e.length;o++){var r=e[o];t=t||!!r&&c in r,e[o]="function"==typeof r?(t=!0,A(r)):r}if(t)return new Proxy({get(t){for(let o=e.length-1;0<=o;o--){var r=V(e[o])[t];if(void 0!==r)return r}},has(t){for(let r=e.length-1;0<=r;r--)if(t in V(e[r]))return!0;return!1},keys(){var t=[];for(let r=0;r<e.length;r++)t.push(...Object.keys(V(e[r])));return[...new Set(t)]}},G);var o={};for(let t=e.length-1;0<=t;t--)if(e[t])for(const r in Object.getOwnPropertyDescriptors(e[t]))r in o||Object.defineProperty(o,r,{enumerable:!0,get(){for(let o=e.length-1;0<=o;o--){var t=(e[o]||{})[r];if(void 0!==t)return t}}});return o}function X(e,...t){const r=new Set(t.flat());var o;if(c in e)return(o=t.map((t=>new Proxy({get:r=>t.includes(r)?e[r]:void 0,has:r=>t.includes(r)&&r in e,keys:()=>t.filter((t=>t in e))},G)))).push(new Proxy({get:t=>r.has(t)?void 0:e[t],has:t=>!r.has(t)&&t in e,keys:()=>Object.keys(e).filter((e=>!r.has(e)))},G)),o;const s=Object.getOwnPropertyDescriptors(e);return t.push(Object.keys(s).filter((e=>!r.has(e)))),t.map((t=>{var r={};for(let o=0;o<t.length;o++){const n=t[o];n in e&&Object.defineProperty(r,n,s[n]||{get:()=>e[n],set:()=>!0,enumerable:!0})}return r}))}function J(e){var t="fallback"in e&&{fallback:()=>e.fallback};return A(function(e,t,r={}){let o=[],s=[],n=[],i=0,a=1<t.length?[]:null;return T((()=>F(n))),()=>{let l,c,p=e()||[];return p[h],P((()=>{let e,t,h,u,f,g,b,w,m,y=p.length;if(0===y)0!==i&&(F(n),n=[],o=[],s=[],i=0,a=a&&[]),r.fallback&&(o=[D],s[0]=k((e=>(n[0]=e,r.fallback()))),i=1);else if(0===i){for(s=new Array(y),c=0;c<y;c++)o[c]=p[c],s[c]=k(d);i=y}else{for(h=new Array(y),u=new Array(y),a&&(f=new Array(y)),g=0,b=Math.min(i,y);g<b&&o[g]===p[g];g++);for(b=i-1,w=y-1;b>=g&&w>=g&&o[b]===p[w];b--,w--)h[w]=s[b],u[w]=n[b],a&&(f[w]=a[b]);for(e=new Map,t=new Array(w+1),c=w;c>=g;c--)m=p[c],l=e.get(m),t[c]=void 0===l?-1:l,e.set(m,c);for(l=g;l<=b;l++)m=o[l],void 0!==(c=e.get(m))&&-1!==c?(h[c]=s[l],u[c]=n[l],a&&(f[c]=a[l]),c=t[c],e.set(m,c)):n[l]();for(c=g;c<y;c++)c in h?(s[c]=h[c],n[c]=u[c],a&&(a[c]=f[c],a[c](c))):s[c]=k(d);s=s.slice(0,i=y),o=p.slice(0)}return s}));function d(e){var r;return n[c]=e,a?([e,r]=_(c),a[c]=r,t(p[c],e)):t(p[c])}}}((()=>e.each),e.children,t||void 0))}function K(e){const t=e.keyed,r=A((()=>e.when),void 0,{equals:(e,r)=>t?e===r:!e==!r});return A((()=>{const o=r();if(o){const s=e.children;return"function"==typeof s&&0<s.length?P((()=>s(t?o:()=>{if(P(r))return e.when;throw(e=>`Stale read from <${e}>.`)("Show")}))):s}return e.fallback}),void 0,void 0)}const Q=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"]),Z=new Set(["innerHTML","textContent","innerText","children"]),ee=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),te=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 re=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),oe={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};const se="_$DX_DELEGATE";function ne(e,t,r){let o;const s=()=>{var t=document.createElement("template");return t.innerHTML=e,(r?t.content.firstChild:t.content).firstChild};return(t=t?()=>(o=o||s()).cloneNode(!0):()=>P((()=>document.importNode(o=o||s(),!0)))).cloneNode=t}function ie(e,t=window.document){var r=t[se]||(t[se]=new Set);for(let s=0,n=e.length;s<n;s++){var o=e[s];r.has(o)||(r.add(o),t.addEventListener(o,fe))}}function ae(e,t,r){null==r?e.removeAttribute(t):e.setAttribute(t,r)}function le(e,t){null==t?e.removeAttribute("class"):e.className=t}function ce(e,t={},r,o){const s={};return o||C((()=>s.children=ge(e,t.children,s.children))),C((()=>t.ref&&t.ref(e))),C((()=>function(e,t,r,o,s={},n=!1){t=t||{};for(const o in s)o in t||"children"!==o&&(s[o]=ue(e,o,null,s[o],r,n));for(const a in t){var i;"children"===a?o||ge(e,t.children):(i=t[a],s[a]=ue(e,a,i,s[a],r,n))}}(e,t,r,!0,s,!0))),s}function he(e,t,r){return P((()=>e(t,r)))}function pe(e,t,r,o){if(void 0!==r&&(o=o||[]),"function"!=typeof t)return ge(e,t,o,r);C((o=>ge(e,t(),o,r)),o)}function de(e,t,r){var o=t.trim().split(/\s+/);for(let t=0,s=o.length;t<s;t++)e.classList.toggle(o[t],r)}function ue(e,t,r,o,s,n){let i,a,l,c,h;var p;return"style"===t?function(e,t,r){if(!t)return r?ae(e,"style"):t;var o=e.style;if("string"==typeof t)return o.cssText=t;let s,n;for(n in"string"==typeof r&&(o.cssText=r=void 0),t=t||{},r=r||{})null==t[n]&&o.removeProperty(n),delete r[n];for(n in t)(s=t[n])!==r[n]&&(o.setProperty(n,s),r[n]=s);return r}(e,r,o):"classList"===t?function(e,t,r={}){var o=Object.keys(t||{}),s=Object.keys(r);let n,i;for(n=0,i=s.length;n<i;n++){var a=s[n];a&&"undefined"!==a&&!t[a]&&(de(e,a,!1),delete r[a])}for(n=0,i=o.length;n<i;n++){var l=o[n],c=!!t[l];l&&"undefined"!==l&&r[l]!==c&&c&&(de(e,l,!0),r[l]=c)}return r}(e,r,o):r===o?o:("ref"===t?n||r(e):"on:"===t.slice(0,3)?(n=t.slice(3),o&&e.removeEventListener(n,o),r&&e.addEventListener(n,r)):"oncapture:"===t.slice(0,10)?(n=t.slice(10),o&&e.removeEventListener(n,o,!0),r&&e.addEventListener(n,r,!0)):"on"===t.slice(0,2)?(n=t.slice(2).toLowerCase(),!(p=re.has(n))&&o&&(o=Array.isArray(o)?o[0]:o,e.removeEventListener(n,o)),(p||r)&&(function(e,t,r,o){if(o)Array.isArray(r)?(e["$$"+t]=r[0],e[`$$${t}Data`]=r[1]):e["$$"+t]=r;else if(Array.isArray(r)){const o=r[0];e.addEventListener(t,r[0]=t=>o.call(e,r[1],t))}else e.addEventListener(t,r)}(e,n,r,p),p)&&ie([n])):"attr:"===t.slice(0,5)?ae(e,t.slice(5),r):(h="prop:"===t.slice(0,5))||(l=Z.has(t))||!s&&((c=function(e,t){return"object"==typeof(e=te[e])?e[t]?e.$:void 0:e}(t,e.tagName))||(a=Q.has(t)))||(i=e.nodeName.includes("-"))?(h&&(t=t.slice(5),a=!0),"class"===t||"className"===t?le(e,r):!i||a||l?e[c||t]=r:e[function(e){return e.toLowerCase().replace(/-([a-z])/g,((e,t)=>t.toUpperCase()))}(t)]=r):(o=s&&-1<t.indexOf(":")&&oe[t.split(":")[0]])?function(e,t,r,o){null==o?e.removeAttributeNS(t,r):e.setAttributeNS(t,r,o)}(e,o,t,r):ae(e,ee[t]||t,r),r)}function fe(e){var t="$$"+e.type;let r=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==r&&Object.defineProperty(e,"target",{configurable:!0,value:r}),Object.defineProperty(e,"currentTarget",{configurable:!0,get:()=>r||document});r;){var o=r[t];if(o&&!r.disabled){var s=r[t+"Data"];if(void 0!==s?o.call(r,s,e):o.call(r,e),e.cancelBubble)return}r=r._$host||r.parentNode||r.host}}function ge(e,t,r,o,s){for(;"function"==typeof r;)r=r();if(t!==r){var n=typeof t,i=void 0!==o;if(e=i&&r[0]&&r[0].parentNode||e,"string"==n||"number"==n)if("number"==n&&(t=t.toString()),i){let s=r[0];s&&3===s.nodeType?s.data=t:s=document.createTextNode(t),r=me(e,r,o,s)}else r=""!==r&&"string"==typeof r?e.firstChild.data=t:e.textContent=t;else if(null==t||"boolean"==n)r=me(e,r,o);else{if("function"==n)return C((()=>{let s=t();for(;"function"==typeof s;)s=s();r=ge(e,s,r,o)})),()=>r;if(Array.isArray(t)){const a=[];if(n=r&&Array.isArray(r),be(a,t,r,s))return C((()=>r=ge(e,a,r,o,!0))),()=>r;if(0===a.length){if(r=me(e,r,o),i)return r}else n?0===r.length?we(e,a,o):function(e,t,r){let o=r.length,s=t.length,n=o,i=0,a=0,l=t[s-1].nextSibling,c=null;for(;i<s||a<n;)if(t[i]===r[a])i++,a++;else{for(;t[s-1]===r[n-1];)s--,n--;if(s===i)for(var h=n<o?a?r[a-1].nextSibling:r[n-a]:l;a<n;)e.insertBefore(r[a++],h);else if(n===a)for(;i<s;)c&&c.has(t[i])||t[i].remove(),i++;else if(t[i]===r[n-1]&&r[a]===t[s-1]){var p=t[--s].nextSibling;e.insertBefore(r[a++],t[i++].nextSibling),e.insertBefore(r[--n],p),t[s]=r[n]}else{if(!c){c=new Map;let e=a;for(;e<n;)c.set(r[e],e++)}var d=c.get(t[i]);if(null!=d)if(a<d&&d<n){let o,l=i,h=1;for(;++l<s&&l<n&&null!=(o=c.get(t[l]))&&o===d+h;)h++;if(h>d-a)for(var u=t[i];a<d;)e.insertBefore(r[a++],u);else e.replaceChild(r[a++],t[i++])}else i++;else t[i++].remove()}}}(e,r,a):(r&&me(e),we(e,a));r=a}else if(t instanceof Node){if(Array.isArray(r)){if(i)return r=me(e,r,o,t);me(e,r,null,t)}else null!=r&&""!==r&&e.firstChild?e.replaceChild(t,e.firstChild):e.appendChild(t);r=t}else console.warn("Unrecognized value. Skipped inserting",t)}}return r}function be(e,t,r,o){let s=!1;for(let i=0,a=t.length;i<a;i++){let a=t[i],l=r&&r[i];if(a instanceof Node)e.push(a);else if(null!=a&&!0!==a&&!1!==a)if(Array.isArray(a))s=be(e,a,l)||s;else if("function"==typeof a)if(o){for(;"function"==typeof a;)a=a();s=be(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||s}else e.push(a),s=!0;else{var n=String(a);l&&3===l.nodeType?(l.data=n,e.push(l)):e.push(document.createTextNode(n))}}return s}function we(e,t,r=null){for(let o=0,s=t.length;o<s;o++)e.insertBefore(t[o],r)}function me(e,t,r,o){if(void 0===r)return e.textContent="";var s=o||document.createTextNode("");if(t.length){let o=!1;for(let a=t.length-1;0<=a;a--){var n,i=t[a];s!==i?(n=i.parentNode===e,o||a?n&&i.remove():n?e.replaceChild(s,i):e.insertBefore(s,r)):o=!0}}else e.insertBefore(s,r);return[s]}function ye(e){return(t,r)=>{const o=r.element;return k((s=>{const n=function(e){var t=Object.keys(e),r={};for(let o=0;o<t.length;o++){const[s,n]=_(e[t[o]]);Object.defineProperty(r,t[o],{get:s,set(e){n((()=>e))}})}return r}(t);o.addPropertyChangedCallback(((e,t)=>n[e]=t)),o.addReleaseCallback((()=>{o.renderRoot.textContent="",s()}));var i=e(n,r);return pe(o.renderRoot,i)}),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:e)._$owner}(o))}}function ve(e,t,r){return 2===arguments.length&&(r=t,t={}),l(e,t)(ye(r))}const xe={chatflowid:"",apiHost:void 0,chatflowConfig:void 0,theme:void 0,observersConfig:void 0};var ke='/*! tailwindcss v3.3.1 | 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{color:inherit;font-family:inherit;font-size:100%;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}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-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-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: }.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em;margin-top:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-bottom:1.2em;margin-top:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);font-weight:500;text-decoration:underline}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-bottom:1.25em;margin-top:1.25em;padding-left:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-bottom:1.25em;margin-top:1.25em;padding-left:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-counters);font-weight:400}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-bottom:3em;margin-top:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){border-left-color:var(--tw-prose-quote-borders);border-left-width:.25rem;color:var(--tw-prose-quotes);font-style:italic;font-weight:500;margin-bottom:1.6em;margin-top:1.6em;padding-left:1em;quotes:"\\201C""\\201D""\\2018""\\2019"}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-size:2.25em;font-weight:800;line-height:1.1111111;margin-bottom:.8888889em;margin-top:0}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:900}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-size:1.5em;font-weight:700;line-height:1.3333333;margin-bottom:1em;margin-top:2em}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:800}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-size:1.25em;font-weight:600;line-height:1.6;margin-bottom:.6em;margin-top:1.6em}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:700}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;line-height:1.5;margin-bottom:.5em;margin-top:1.5em}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-weight:700}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:2em;margin-top:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-bottom:2em;margin-top:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){border-radius:.3125rem;box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows)/10%),0 3px 0 rgb(var(--tw-prose-kbd-shadows)/10%);color:var(--tw-prose-kbd);font-family:inherit;font-size:.875em;font-weight:500;padding:.1875em .375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-size:.875em;font-weight:600}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:var(--tw-prose-pre-bg);border-radius:.375rem;color:var(--tw-prose-pre-code);font-size:.875em;font-weight:400;line-height:1.7142857;margin-bottom:1.7142857em;margin-top:1.7142857em;overflow-x:auto;padding:.8571429em 1.1428571em}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-radius:0;border-width:0;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;padding:0}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.875em;line-height:1.7142857;margin-bottom:2em;margin-top:2em;table-layout:auto;text-align:left;width:100%}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-color:var(--tw-prose-th-borders);border-bottom-width:1px}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;padding-bottom:.5714286em;padding-left:.5714286em;padding-right:.5714286em;vertical-align:bottom}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-color:var(--tw-prose-td-borders);border-bottom-width:1px}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-color:var(--tw-prose-th-borders);border-top-width:1px}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0;margin-top:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body:#374151;--tw-prose-headings:#111827;--tw-prose-lead:#4b5563;--tw-prose-links:#111827;--tw-prose-bold:#111827;--tw-prose-counters:#6b7280;--tw-prose-bullets:#d1d5db;--tw-prose-hr:#e5e7eb;--tw-prose-quotes:#111827;--tw-prose-quote-borders:#e5e7eb;--tw-prose-captions:#6b7280;--tw-prose-kbd:#111827;--tw-prose-kbd-shadows:17 24 39;--tw-prose-code:#111827;--tw-prose-pre-code:#e5e7eb;--tw-prose-pre-bg:#1f2937;--tw-prose-th-borders:#d1d5db;--tw-prose-td-borders:#e5e7eb;--tw-prose-invert-body:#d1d5db;--tw-prose-invert-headings:#fff;--tw-prose-invert-lead:#9ca3af;--tw-prose-invert-links:#fff;--tw-prose-invert-bold:#fff;--tw-prose-invert-counters:#9ca3af;--tw-prose-invert-bullets:#4b5563;--tw-prose-invert-hr:#374151;--tw-prose-invert-quotes:#f3f4f6;--tw-prose-invert-quote-borders:#374151;--tw-prose-invert-captions:#9ca3af;--tw-prose-invert-kbd:#fff;--tw-prose-invert-kbd-shadows:255 255 255;--tw-prose-invert-code:#fff;--tw-prose-invert-pre-code:#d1d5db;--tw-prose-invert-pre-bg:rgba(0,0,0,.5);--tw-prose-invert-th-borders:#4b5563;--tw-prose-invert-td-borders:#374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0;margin-top:0}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:2em;margin-top:2em}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:.5em;margin-top:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:.75em;margin-top:.75em}.prose :where(.prose>ul>li>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:.75em;margin-top:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em;margin-top:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-left:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-left:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-right:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:2em;margin-top:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.pointer-events-none{pointer-events:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.bottom-0{bottom:0}.bottom-20{bottom:80px}.bottom-24{bottom:96px}.left-0{left:0}.right-0{right:0}.top-0{top:0}.z-0{z-index:0}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\\[1001\\]{z-index:1001}.z-\\[1002\\]{z-index:1002}.float-right{float:right}.m-0{margin:0}.m-auto{margin:auto}.mx-auto{margin-left:auto;margin-right:auto}.my-2{margin-bottom:8px;margin-top:8px}.my-6{margin-bottom:24px;margin-top:24px}.-ml-1{margin-left:-4px}.mb-1{margin-bottom:4px}.mb-2{margin-bottom:8px}.ml-1{margin-left:4px}.ml-1\\.5{margin-left:6px}.ml-2{margin-left:8px}.ml-auto{margin-left:auto}.mr-1{margin-right:4px}.mr-2{margin-right:8px}.mr-3{margin-right:12px}.mr-\\[10px\\]{margin-right:10px}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.h-10{height:40px}.h-12{height:48px}.h-16{height:64px}.h-2{height:8px}.h-32{height:128px}.h-4{height:16px}.h-5{height:20px}.h-6{height:24px}.h-7{height:28px}.h-9{height:36px}.h-\\[50px\\]{height:50px}.h-\\[58px\\]{height:58px}.h-full{height:100%}.max-h-\\[704px\\]{max-height:704px}.min-h-full{min-height:100%}.w-10{width:40px}.w-12{width:48px}.w-16{width:64px}.w-2{width:8px}.w-4{width:16px}.w-5{width:20px}.w-6{width:24px}.w-7{width:28px}.w-9{width:36px}.w-\\[200px\\]{width:200px}.w-full{width:100%}.min-w-full{min-width:100%}.max-w-3xl{max-width:768px}.max-w-\\[128px\\]{max-width:128px}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-auto{flex:1 1 auto}.flex-shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.flex-grow-0{flex-grow:0}.basis-auto{flex-basis:auto}.-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 spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.flex-row{flex-direction:row}.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}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:8px}.gap-3{gap:12px}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-scroll{overflow-y:scroll}.scroll-smooth{scroll-behavior:smooth}.whitespace-pre-wrap{white-space:pre-wrap}.rounded{border-radius:4px}.rounded-\\[10px\\]{border-radius:10px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:8px}.rounded-md{border-radius:6px}.rounded-none{border-radius:0}.rounded-xl{border-radius:12px}.rounded-b{border-bottom-left-radius:4px;border-bottom-right-radius:4px}.rounded-t{border-top-left-radius:4px;border-top-right-radius:4px}.border{border-width:1px}.border-0{border-width:0}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-solid{border-style:solid}.border-dashed{border-style:dashed}.border-\\[\\#eeeeee\\]{--tw-border-opacity:1;border-color:rgb(238 238 238/var(--tw-border-opacity))}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}.bg-black\\/10{background-color:rgba(0,0,0,.1)}.bg-black\\/60{background-color:rgba(0,0,0,.6)}.bg-emerald-500{--tw-bg-opacity:1;background-color:rgb(16 185 129/var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/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}.bg-cover{background-size:cover}.bg-center{background-position:50%}.fill-transparent{fill:transparent}.stroke-2{stroke-width:2}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:4px}.p-2{padding:8px}.p-2\\.5{padding:10px}.p-4{padding:16px}.p-5{padding:20px}.p-6{padding:24px}.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-\\[10px\\]{padding-left:10px;padding-right:10px}.py-1{padding-bottom:4px;padding-top:4px}.py-2{padding-bottom:8px;padding-top:8px}.py-4{padding-bottom:16px;padding-top:16px}.py-\\[10px\\]{padding-bottom:10px;padding-top:10px}.pb-1{padding-bottom:4px}.pb-\\[10px\\]{padding-bottom:10px}.pt-2{padding-top:8px}.pt-\\[6px\\]{padding-top:6px}.pt-\\[70px\\]{padding-top:70px}.text-left{text-align:left}.text-center{text-align:center}.text-2xl{font-size:24px;line-height:32px}.text-\\[13px\\]{font-size:13px}.text-base{font-size:16px;line-height:24px}.text-sm{font-size:14px;line-height:20px}.text-xl{font-size:20px;line-height:28px}.font-bold{font-weight:700}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-none{line-height:1}.text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}.text-transparent{color:transparent}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-25{opacity:.25}.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)}.outline-none{outline:2px solid transparent;outline-offset:2px}.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)}.backdrop-blur-sm{--tw-backdrop-blur:blur(4px);-webkit-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);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)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;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-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-150,.transition-transform{transition-duration:.15s}.duration-200{transition-duration:.2s}.ease-linear{transition-timing-function:linear}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}:host{--chatbot-container-bg-image:none;--chatbot-container-bg-color:transparent;--chatbot-container-font-family:"Open Sans";--chatbot-button-bg-color:#0042da;--chatbot-button-color:#fff;--chatbot-host-bubble-bg-color:#f7f8ff;--chatbot-host-bubble-color:#303235;--chatbot-guest-bubble-bg-color:#3b81f6;--chatbot-guest-bubble-color:#fff;--chatbot-input-bg-color:#fff;--chatbot-input-color:#303235;--chatbot-input-placeholder-color:#9095a0;--chatbot-header-bg-color:#fff;--chatbot-header-color:#303235;--chatbot-border-radius:6px;--PhoneInputCountryFlag-borderColor:transparent;--PhoneInput-color--focus:transparent}a{color:#16bed7;font-weight:500}a:hover{text-decoration:underline}pre{word-wrap:break-word;font-size:13px;margin:5px;overflow:auto;padding:5px;white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;width:auto}.string{color:green}.number{color:#ff8c00}.boolean{color:blue}.null{color:#f0f}.key{color:#002b36}.scrollable-container::-webkit-scrollbar{display:none}.scrollable-container{-ms-overflow-style:none;scrollbar-width:none}.text-fade-in{transition:opacity .4s ease-in .2s}.bubble-typing{transition:width .4s ease-out,height .4s ease-out}.bubble1,.bubble2,.bubble3{background-color:var(--chatbot-host-bubble-color);opacity:.5}.bubble1,.bubble2{animation:chatBubbles 1s ease-in-out infinite}.bubble2{animation-delay:.3s}.bubble3{animation:chatBubbles 1s ease-in-out infinite;animation-delay:.5s}@keyframes chatBubbles{0%{transform:translateY(0)}50%{transform:translateY(-5px)}to{transform:translateY(0)}}button,input,textarea{font-weight:300}.slate-a{text-decoration:underline}.slate-html-container>div{min-height:24px}.slate-bold{font-weight:700}.slate-italic{font-style:oblique}.slate-underline{text-decoration:underline}.text-input::-moz-placeholder{color:#9095a0!important;opacity:1!important}.text-input::placeholder{color:#9095a0!important;opacity:1!important}.chatbot-container{background-color:var(--chatbot-container-bg-color);background-image:var(--chatbot-container-bg-image);font-family:Open Sans,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol}.file-annotation-button{background-color:#02a0a0c2;border:1px solid #02a0a0c2;border-radius:var(--chatbot-border-radius);color:var(--chatbot-button-color)}.chatbot-button{background-color:#0042da;border:1px solid #0042da;border-radius:var(--chatbot-border-radius);color:var(--chatbot-button-color)}.chatbot-button.selectable{border:1px solid #0042da}.chatbot-button.selectable,.chatbot-host-bubble{background-color:#f7f8ff;color:var(--chatbot-host-bubble-color)}.chatbot-host-bubble>.bubble-typing{background-color:#f7f8ff;border:var(--chatbot-host-bubble-border);border-radius:6px}.chatbot-host-bubble iframe,.chatbot-host-bubble img,.chatbot-host-bubble video{border-radius:var(--chatbot-border-radius)}.chatbot-guest-bubble{background-color:#3b81f6;border-radius:6px;color:var(--chatbot-guest-bubble-color)}.chatbot-input,.feedback-input{background-color:#fff;border-radius:var(--chatbot-border-radius);box-shadow:0 2px 6px -1px rgba(0,0,0,.1);color:#303235}.chatbot-input-error-message{color:#303235}.chatbot-button>.send-icon{fill:var(--chatbot-button-color);stroke:var(--chatbot-button-color)}.chatbot-chat-view{max-width:800px}.ping span{background-color:#0042da}.rating-icon-container svg{stroke:#0042da;fill:#f7f8ff;height:42px;transition:fill .1s ease-out;width:42px}.rating-icon-container.selected svg{fill:#0042da}.rating-icon-container:hover svg{filter:brightness(.9)}.rating-icon-container:active svg{filter:brightness(.75)}.upload-progress-bar{background-color:#0042da;border-radius:var(--chatbot-border-radius)}.total-files-indicator{background-color:#0042da;color:var(--chatbot-button-color);font-size:10px}.chatbot-upload-input{transition:border-color .1s ease-out}.chatbot-upload-input.dragging-over{border-color:#0042da}.secondary-button{background-color:#f7f8ff;border-radius:var(--chatbot-border-radius);color:var(--chatbot-host-bubble-color)}.chatbot-country-select{color:#303235}.chatbot-country-select,.chatbot-date-input{background-color:#fff;border-radius:var(--chatbot-border-radius)}.chatbot-date-input{color:#303235;color-scheme:light}.chatbot-popup-blocked-toast{border-radius:var(--chatbot-border-radius)}.messagelist{border-radius:.5rem;height:100%;overflow-y:scroll;width:100%}.messagelistloading{display:flex;justify-content:center;margin-top:1rem;width:100%}.usermessage{padding:1rem 1.5rem}.usermessagewaiting-light{background:linear-gradient(270deg,#ede7f6,#e3f2fd,#ede7f6);background-position:-100% 0;background-size:200% 200%}.usermessagewaiting-dark,.usermessagewaiting-light{animation:loading-gradient 2s ease-in-out infinite;animation-direction:alternate;animation-name:loading-gradient;padding:1rem 1.5rem}.usermessagewaiting-dark{background:linear-gradient(270deg,#2e2352,#1d3d60,#2e2352);background-position:-100% 0;background-size:200% 200%;color:#ececf1}@keyframes loading-gradient{0%{background-position:-100% 0}to{background-position:100% 0}}.apimessage{animation:fadein .5s;padding:1rem 1.5rem}@keyframes fadein{0%{opacity:0}to{opacity:1}}.apimessage,.usermessage,.usermessagewaiting{display:flex}.markdownanswer{line-height:1.75}.markdownanswer a:hover{opacity:.8}.markdownanswer a{color:#16bed7;font-weight:500}.markdownanswer code{color:#15cb19;font-weight:500;white-space:pre-wrap!important}.markdownanswer ol,.markdownanswer ul{margin:1rem}.boticon,.usericon{border-radius:1rem;margin-right:1rem}.markdownanswer h1,.markdownanswer h2,.markdownanswer h3{font-size:inherit}.center{flex-direction:column;padding:10px;position:relative}.center,.cloud{align-items:center;display:flex;justify-content:center}.cloud{border-radius:.5rem;height:calc(100% - 50px);width:400px}input{background-color:transparent;border:none;font-family:Poppins,sans-serif;padding:10px}.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\\: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);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)}.focus\\:border-blue-500:focus{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-blue-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity))}.active\\:scale-95:active{--tw-scale-x:.95;--tw-scale-y:.95;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\\:bg-emerald-600:active{--tw-bg-opacity:1;background-color:rgb(5 150 105/var(--tw-bg-opacity))}.active\\:brightness-75:active{--tw-brightness:brightness(.75);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)}.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\\:flex{display:flex}@media (min-width:640px){.sm\\:right-5{right:20px}.sm\\:my-8{margin-bottom:32px;margin-top:32px}.sm\\:w-\\[400px\\]{width:400px}.sm\\:w-full{width:100%}.sm\\:max-w-lg{max-width:512px}.sm\\:p-0{padding:0}}';const _e=e=>null==e,Ce=e=>null!=e,Se=async e=>{try{var t="string"==typeof e?e:e.url,r=await fetch(t,{method:"string"==typeof e?"GET":e.method,mode:"cors",headers:"string"!=typeof e&&Ce(e.body)?{"Content-Type":"application/json"}:void 0,body:"string"!=typeof e&&Ce(e.body)?JSON.stringify(e.body):void 0});let s;var o=r.headers.get("Content-Type");if(s=o&&o.includes("application/json")?await r.json():"string"!=typeof e&&"blob"===e.type?await r.blob():await r.text(),r.ok)return{data:s};{let e;throw e="object"==typeof s&&"error"in s?s.error:s||r.statusText}}catch(e){return console.error(e),{error:e}}},Ae=ne('<svg 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">'),Pe=ne('<img alt="Bubble button icon">'),$e=ne('<button part="button"><svg 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">'),Te=e=>{{const t=$e(),r=t.firstChild;return t.$$click=()=>e.toggleBot(),t.style.setProperty("z-index","42424242"),pe(t,H(K,{get when(){return _e(e.customIconSrc)},keyed:!0,get children(){const t=Ae();return C((r=>{var o=e.iconColor??"white",s="stroke-2 fill-transparent absolute duration-200 transition "+(e.isBotOpened?"scale-0 opacity-0":"scale-100 opacity-100")+("large"===e.size?" w-9":" w-7");return o!==r._v$&&(null!=(r._v$=o)?t.style.setProperty("stroke",o):t.style.removeProperty("stroke")),s!==r._v$2&&ae(t,"class",r._v$2=s),r}),{_v$:void 0,_v$2:void 0}),t}}),r),pe(t,H(K,{get when(){return e.customIconSrc},get children(){const t=Pe();return C((r=>{var o=e.customIconSrc,s="rounded-full object-cover"+(e.isBotOpened?"scale-0 opacity-0":"scale-100 opacity-100")+("large"===e.size?" w-9 h-9":" w-7 h-7");return o!==r._v$3&&ae(t,"src",r._v$3=o),s!==r._v$4&&le(t,r._v$4=s),r}),{_v$3:void 0,_v$4:void 0}),t}}),r),C((o=>{var s="fixed shadow-md rounded-full hover:scale-110 active:scale-95 transition-transform duration-200 flex justify-center items-center animate-fade-in"+("large"===e.size?" w-16 h-16":" w-12 h-12"),n=e.backgroundColor??"#3B81F6",i=e.right?e.right.toString()+"px":"20px",a=e.bottom?e.bottom.toString()+"px":"20px",l=e.iconColor??"white",c="absolute duration-200 transition "+(e.isBotOpened?"scale-100 rotate-0 opacity-100":"scale-0 -rotate-180 opacity-0")+("large"===e.size?" w-9":" w-7");return s!==o._v$5&&le(t,o._v$5=s),n!==o._v$6&&(null!=(o._v$6=n)?t.style.setProperty("background-color",n):t.style.removeProperty("background-color")),i!==o._v$7&&(null!=(o._v$7=i)?t.style.setProperty("right",i):t.style.removeProperty("right")),a!==o._v$8&&(null!=(o._v$8=a)?t.style.setProperty("bottom",a):t.style.removeProperty("bottom")),l!==o._v$9&&(null!=(o._v$9=l)?r.style.setProperty("fill",l):r.style.removeProperty("fill")),c!==o._v$10&&ae(r,"class",o._v$10=c),o}),{_v$5:void 0,_v$6:void 0,_v$7:void 0,_v$8:void 0,_v$9:void 0,_v$10:void 0}),t}};let Ee;ie(["click"]);const Be=new Uint8Array(16);function Re(){if(Ee=Ee||"undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto))return Ee(Be);throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}const Oe=[];for(let e=0;e<256;++e)Oe.push((e+256).toString(16).slice(1));var Le,je,ze={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Ie(e,t,r){if(ze.randomUUID&&!t&&!e)return ze.randomUUID();var o=(e=e||{}).random||(e.rng||Re)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=o[e];return t}return function(e,t=0){return Oe[e[t+0]]+Oe[e[t+1]]+Oe[e[t+2]]+Oe[e[t+3]]+"-"+Oe[e[t+4]]+Oe[e[t+5]]+"-"+Oe[e[t+6]]+Oe[e[t+7]]+"-"+Oe[e[t+8]]+Oe[e[t+9]]+"-"+Oe[e[t+10]]+Oe[e[t+11]]+Oe[e[t+12]]+Oe[e[t+13]]+Oe[e[t+14]]+Oe[e[t+15]]}(o)}const Ne=({chatflowid:e,apiHost:t="http://localhost:3000",body:r})=>Se({method:"POST",url:t+"/api/v1/feedback/"+e,body:r}),Me=({apiHost:e="http://localhost:3000",body:t})=>Se({method:"POST",url:e+"/api/v1/openai-assistants-file",body:t,type:"blob"}),Ue=ne('<input class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100" type="text">'),qe=e=>{const[t,r]=X(e,["ref","onInput"]);return(o=Ue()).$$input=e=>t.onInput(e.currentTarget.value),"function"==typeof(s=e.ref)?he(s,o):e.ref=o,ce(o,Y({get disabled(){return e.disabled},get style(){return{"font-size":e.fontSize?e.fontSize+"px":"16px"}}},r),!1,!1),o;var o,s},[De,Fe]=(ie(["input"]),_()),He=ne('<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-refresh w-4 h-4" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="8" height="4" x="8" y="2" rx="1" ry="1"></rect><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2">'),We=e=>{{const t=He();return C((()=>ae(t,"stroke",e.color??"#3B81F6"))),t}},Ge=ne('<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-refresh w-4 h-4" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M17 14V2"></path><path d="M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22h0a3.13 3.13 0 0 1-3-3.88Z">'),Ve=e=>{{const t=Ge();return C((r=>{var o=e.color??"none",s=e.color??"#3B81F6";return o!==r._v$&&ae(t,"fill",r._v$=o),s!==r._v$2&&ae(t,"stroke",r._v$2=s),r}),{_v$:void 0,_v$2:void 0}),t}},Ye=ne('<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-refresh w-4 h-4" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7 10v12"></path><path d="M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2h0a3.13 3.13 0 0 1 3 3.88Z">'),Xe=e=>{{const t=Ye();return C((r=>{var o=e.color??"none",s=e.color??"#3B81F6";return o!==r._v$&&ae(t,"fill",r._v$=o),s!==r._v$2&&ae(t,"stroke",r._v$2=s),r}),{_v$:void 0,_v$2:void 0}),t}},Je=ne('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7"></path><line x1="16" x2="22" y1="5" y2="5"></line><line x1="19" x2="19" y1="2" y2="8"></line><circle cx="9" cy="9" r="2"></circle><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21">'),Ke=e=>{{const t=Je();return C((()=>ae(t,"stroke",e.color??"#3B81F6"))),t}},Qe=ne('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"></circle><circle cx="12" cy="12" r="1">'),Ze=e=>{{const t=Qe();return C((()=>ae(t,"stroke",e.color??"#3B81F6"))),t}},et=ne('<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-refresh" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"></path><path d="M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4">'),tt=e=>{{const t=et();return C((()=>ae(t,"stroke",e.color??"#3B81F6"))),t}},rt=ne('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"></path><path d="M19 10v2a7 7 0 0 1-14 0v-2"></path><line x1="12" x2="12" y1="19" y2="22">'),ot=e=>{{const t=rt();return C((()=>ae(t,"stroke",e.color??"#3B81F6"))),t}},st=ne('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="19px"><path d="M476.59 227.05l-.16-.07L49.35 49.84A23.56 23.56 0 0027.14 52 24.65 24.65 0 0016 72.59v113.29a24 24 0 0019.52 23.57l232.93 43.07a4 4 0 010 7.86L35.53 303.45A24 24 0 0016 327v113.31A23.57 23.57 0 0026.59 460a23.94 23.94 0 0013.22 4 24.55 24.55 0 009.52-1.93L476.4 285.94l.19-.09a32 32 0 000-58.8z">'),nt=e=>{return ce(t=st(),Y({get style(){return{fill:e.color??"#3B81F6"}}},e),!0,!0),t;var t},it=ne('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17">'),at=e=>{{const t=it();return C((()=>ae(t,"stroke",e.color??"#3B81F6"))),t}},lt=ne('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"></path><path d="m6 6 12 12">'),ct=e=>{{const t=lt();return C((()=>ae(t,"stroke",e.color??"#3B81F6"))),t}},ht=ne('<button type="submit">'),pt=ne('<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">'),dt=e=>{return ce(t=ht(),Y({get disabled(){return e.isDisabled||e.isLoading}},e,{get class(){return"py-2 px-4 justify-center font-semibold text-white focus:outline-none flex items-center disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 transition-all filter hover:brightness-90 active:brightness-75 chatbot-button "+e.class},style:{background:"transparent",border:"none"}}),!1,!0),pe(t,H(K,{get when(){return!e.isLoading},get fallback(){return H(ft,{class:"text-white"})},get children(){return H(nt,{get color(){return e.sendButtonColor},get class(){return"send-icon flex "+(e.disableIcon?"hidden":"")}})}})),t;var t},ut=e=>{return ce(t=ht(),Y({get disabled(){return e.isDisabled||e.isLoading}},e,{get class(){return"py-2 px-4 justify-center font-semibold text-white focus:outline-none flex items-center disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 transition-all filter hover:brightness-90 active:brightness-75 chatbot-button "+e.class},style:{background:"transparent",border:"none"},title:"New Chat"}),!1,!0),pe(t,H(K,{get when(){return!e.isLoading},get fallback(){return H(ft,{class:"text-white"})},get children(){return H(tt,{get color(){return e.sendButtonColor},get class(){return"send-icon flex "+(e.disableIcon?"hidden":"")}})}})),t;var t},ft=e=>{return ce(t=pt(),Y(e,{get class(){return"animate-spin -ml-1 mr-3 h-5 w-5 "+e.class},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","data-testid":"loading-spinner"}),!0,!0),t;var t},gt=ne('<button type="submit">'),bt=ne('<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">'),wt=e=>{return ce(t=gt(),Y({get disabled(){return e.isDisabled||e.isLoading}},e,{get class(){return"py-2 px-4 justify-center font-semibold focus:outline-none flex items-center disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 transition-all filter hover:brightness-90 active:brightness-75 chatbot-button "+e.class},style:{background:"transparent",border:"none"}}),!1,!0),pe(t,H(K,{get when(){return!e.isLoading},get fallback(){return H(mt,{class:"text-white"})},get children(){return H(Ke,{get color(){return e.buttonColor}})}})),t;var t},mt=e=>{return ce(t=bt(),Y(e,{get class(){return"animate-spin -ml-1 mr-3 h-5 w-5 "+e.class},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","data-testid":"loading-spinner"}),!0,!0),t;var t},yt=ne('<button type="submit">'),vt=ne('<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">'),xt=e=>{return ce(t=yt(),Y({get disabled(){return e.isDisabled||e.isLoading}},e,{get class(){return"py-2 px-4 justify-center font-semibold focus:outline-none flex items-center disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 transition-all filter hover:brightness-90 active:brightness-75 chatbot-button "+e.class},style:{background:"transparent",border:"none"}}),!1,!0),pe(t,H(K,{get when(){return!e.isLoading},get fallback(){return H(kt,{class:"text-white"})},get children(){return H(ot,{get color(){return e.buttonColor}})}})),t;var t},kt=e=>{return ce(t=vt(),Y(e,{get class(){return"animate-spin -ml-1 mr-3 h-5 w-5 "+e.class},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","data-testid":"loading-spinner"}),!0,!0),t;var t},_t=ne("<span>Send"),Ct=ne('<div class="flex items-center justify-between chatbot-input border border-[#eeeeee]" data-testid="input">'),St=ne("<span>Image Upload"),At=ne('<input multiple type="file">'),Pt=ne("<span>Record Audio"),$t=e=>{const[t,r]=_(e.defaultValue??"");let o,s;const n=e=>r(e),i=()=>{""!==t()&&o?.reportValidity()&&e.onSubmit(t()),r("")},a=e=>{var t=e.isComposing||229===e.keyCode;"Enter"!==e.key||t||i()},l=()=>{s&&s.click()},c=(S((()=>{e.disabled||De()||!o||o.focus()})),$((()=>{!De()&&o&&o.focus()})),t=>{e.handleFileChange(t),t.target&&(t.target.value="")});{const r=Ct();return r.$$keydown=a,r.style.setProperty("margin","auto"),pe(r,(()=>{const t=A((()=>!!e.uploadsConfig?.isImageUploadAllowed));return()=>{return t()?[H(wt,{get buttonColor(){return e.sendButtonColor},type:"button",class:"m-0","on:click":l,get children(){var e=St();return e.style.setProperty("font-family","Poppins, sans-serif"),e}}),((r=At()).addEventListener("change",c),"function"==typeof(o=s)?he(o,r):s=r,r.style.setProperty("display","none"),r)]:null;var r,o}})(),null),pe(r,H(qe,{ref(e){"function"==typeof o?o(e):o=e},onInput:n,get value(){return t()},get fontSize(){return e.fontSize},get disabled(){return e.disabled},get placeholder(){return e.placeholder??"Type your question"}}),null),pe(r,(()=>{const t=A((()=>!!e.uploadsConfig?.isSpeechToTextEnabled));return()=>t()?H(xt,{get buttonColor(){return e.sendButtonColor},type:"button",class:"m-0 start-recording-button",get"on:click"(){return e.onMicrophoneClicked},get children(){var e=Pt();return e.style.setProperty("font-family","Poppins, sans-serif"),e}}):null})(),null),pe(r,H(dt,{get sendButtonColor(){return e.sendButtonColor},type:"button",get isDisabled(){return e.disabled||""===t()},class:"m-0","on:click":i,get children(){var e=_t();return e.style.setProperty("font-family","Poppins, sans-serif"),e}}),null),C((t=>{var o=e.backgroundColor??"#ffffff",s=e.textColor??"#303235";return o!==t._v$&&(null!=(t._v$=o)?r.style.setProperty("background-color",o):r.style.removeProperty("background-color")),s!==t._v$2&&(null!=(t._v$2=s)?r.style.setProperty("color",s):r.style.removeProperty("color")),t}),{_v$:void 0,_v$2:void 0}),r}},Tt=(ie(["keydown"]),ne('<figure data-testid="default-avatar"><svg width="75" height="75" viewBox="0 0 75 75" fill="none" xmlns="http://www.w3.org/2000/svg"><mask id="mask0" x="0" y="0" mask-type="alpha"><circle cx="37.5" cy="37.5" r="37.5" fill="#0042DA"></circle></mask><g mask="url(#mask0)"><rect x="-30" y="-43" width="131" height="154" fill="#0042DA"></rect><rect x="2.50413" y="120.333" width="81.5597" height="86.4577" rx="2.5" transform="rotate(-52.6423 2.50413 120.333)" stroke="#FED23D" stroke-width="5"></rect><circle cx="76.5" cy="-1.5" r="29" stroke="#FF8E20" stroke-width="5"></circle><path d="M-49.8224 22L-15.5 -40.7879L18.8224 22H-49.8224Z" stroke="#F7F8FF" stroke-width="5">')),Et=()=>{{const e=Tt(),t=e.firstChild;return C((r=>{var o="flex justify-center items-center rounded-full text-white relative "+(De()?"w-6 h-6 text-sm":"w-10 h-10 text-xl"),s="absolute top-0 left-0 "+(De()?" w-6 h-6 text-sm":"w-full h-full text-xl");return o!==r._v$&&le(e,r._v$=o),s!==r._v$2&&ae(t,"class",r._v$2=s),r}),{_v$:void 0,_v$2:void 0}),e}},Bt=ne('<figure><img alt="Bot avatar" class="rounded-full object-cover w-full h-full">'),Rt=e=>{const[t,r]=_(e.initialAvatarSrc);return S((()=>{t()?.startsWith("{{")&&e.initialAvatarSrc?.startsWith("http")&&r(e.initialAvatarSrc)})),H(K,{get when(){return(e=>null!=e&&""!==e)(t())},keyed:!0,get fallback(){return H(Et,{})},get children(){const e=Bt(),r=e.firstChild;return C((o=>{var s="flex justify-center items-center rounded-full text-white relative flex-shrink-0 "+(De()?"w-6 h-6 text-sm":"w-10 h-10 text-xl"),n=t();return s!==o._v$&&le(e,o._v$=s),n!==o._v$2&&ae(r,"src",o._v$2=n),o}),{_v$:void 0,_v$2:void 0}),e}})};class Ot{source;flags;constructor(e,t=""){this.source=e.source,this.flags=t}setGroup(e,t){let r="string"==typeof t?t:t.source;return r=r.replace(/(^|[^\[])\^/g,"$1"),this.source=this.source.replace(e,r),this}getRegexp(){return new RegExp(this.source,this.flags)}}const Lt=/[&<>"']/,jt=/[&<>"']/g,zt={"&":"&","<":"<",">":">",'"':""","'":"'"},It=/[<>"']|&(?!#?\w+;)/,Nt=/[<>"']|&(?!#?\w+;)/g;function Mt(e,t){if(t){if(Lt.test(e))return e.replace(jt,(e=>zt[e]))}else if(It.test(e))return e.replace(Nt,(e=>zt[e]));return e}function Ut(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,(function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))}!function(e){e[e.space=1]="space",e[e.text=2]="text",e[e.paragraph=3]="paragraph",e[e.heading=4]="heading",e[e.listStart=5]="listStart",e[e.listEnd=6]="listEnd",e[e.looseItemStart=7]="looseItemStart",e[e.looseItemEnd=8]="looseItemEnd",e[e.listItemStart=9]="listItemStart",e[e.listItemEnd=10]="listItemEnd",e[e.blockquoteStart=11]="blockquoteStart",e[e.blockquoteEnd=12]="blockquoteEnd",e[e.code=13]="code",e[e.table=14]="table",e[e.html=15]="html",e[e.hr=16]="hr"}(Le=Le||{});class qt{gfm=!0;tables=!0;breaks=!1;pedantic=!1;sanitize=!1;sanitizer;mangle=!0;smartLists=!1;silent=!1;highlight;langPrefix="lang-";smartypants=!1;headerPrefix="";renderer;xhtml=!1;escape=Mt;unescape=Ut;isNoP}class Dt{options;constructor(e){this.options=e||Wt.options}code(e,t,r,o){this.options.highlight&&null!=(s=this.options.highlight(e,t))&&s!==e&&(r=!0,e=s);var s=r?e:this.options.escape(e,!0);return t?`\n<pre><code class="${this.options.langPrefix+this.options.escape(t,!0)}">${s}\n</code></pre>\n`:`\n<pre><code>${s}\n</code></pre>\n`}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e){return e}heading(e,t,r){return`<h${t} id="${this.options.headerPrefix+r.toLowerCase().replace(/[^\w]+/g,"-")}">${e}</h${t}>\n`}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t){return`\n<${t=t?"ol":"ul"}>\n${e}</${t}>\n`}listitem(e){return"<li>"+e+"</li>\n"}paragraph(e){return"<p>"+e+"</p>\n"}table(e,t){return`\n<table>\n<thead>\n${e}</thead>\n<tbody>\n${t}</tbody>\n</table>\n`}tablerow(e){return"<tr>\n"+e+"</tr>\n"}tablecell(e,t){var r=t.header?"th":"td";return(t.align?"<"+r+' style="text-align:'+t.align+'">':"<"+r+">")+e+"</"+r+">\n"}strong(e){return"<strong>"+e+"</strong>"}em(e){return"<em>"+e+"</em>"}codespan(e){return"<code>"+e+"</code>"}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return"<del>"+e+"</del>"}link(e,t,r){if(this.options.sanitize){let o;try{o=decodeURIComponent(this.options.unescape(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(t){return r}if(0===o.indexOf("javascript:")||0===o.indexOf("vbscript:")||0===o.indexOf("data:"))return r}let o='<a href="'+e+'"';return t&&(o+=' title="'+t+'"'),o+">"+r+"</a>"}image(e,t,r){let o='<img src="'+e+'" alt="'+r+'"';return t&&(o+=' title="'+t+'"'),o+(this.options.xhtml?"/>":">")}text(e){return e}}class Ft{staticThis;links;options;static rulesBase=null;static rulesPedantic=null;static rulesGfm=null;static rulesBreaks=null;rules;renderer;inLink;hasRulesGfm;ruleCallbacks;constructor(e,t,r=Wt.options,o){if(this.staticThis=e,this.links=t,this.options=r,this.renderer=o||this.options.renderer||new Dt(this.options),!this.links)throw new Error("InlineLexer requires 'links' parameter.");this.setRules()}static output(e,t,r){return new this(this,t,r).output(e)}static getRulesBase(){var e;return this.rulesBase||((e={escape:/^\\([\\`*{}\[\]()#+\-.!_>])/,autolink:/^<([^ <>]+(@|:\/)[^ <>]+)>/,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^<'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)([\s\S]*?[^`])\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,text:/^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/,_inside:/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/,_href:/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/}).link=new Ot(e.link).setGroup("inside",e._inside).setGroup("href",e._href).getRegexp(),e.reflink=new Ot(e.reflink).setGroup("inside",e._inside).getRegexp(),this.rulesBase=e)}static getRulesPedantic(){return this.rulesPedantic||(this.rulesPedantic={...this.getRulesBase(),strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/})}static getRulesGfm(){var e,t,r;return this.rulesGfm||(e=this.getRulesBase(),t=new Ot(e.escape).setGroup("])","~|])").getRegexp(),r=new Ot(e.text).setGroup("]|","~]|").setGroup("|","|https?://|").getRegexp(),this.rulesGfm={...e,escape:t,url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:r})}static getRulesBreaks(){var e,t;return this.rulesBreaks||(e=this.getRulesGfm(),t=this.getRulesGfm(),this.rulesBreaks={...t,br:new Ot(e.br).setGroup("{2,}","*").getRegexp(),text:new Ot(t.text).setGroup("{2,}","*").getRegexp()})}setRules(){this.options.gfm?this.options.breaks?this.rules=this.staticThis.getRulesBreaks():this.rules=this.staticThis.getRulesGfm():this.options.pedantic?this.rules=this.staticThis.getRulesPedantic():this.rules=this.staticThis.getRulesBase(),this.hasRulesGfm=void 0!==this.rules.url}output(e){let t,r="";for(;e;)if(t=this.rules.escape.exec(e))e=e.substring(t[0].length),r+=t[1];else if(t=this.rules.autolink.exec(e)){let o,s;e=e.substring(t[0].length),s="@"===t[2]?(o=this.options.escape(":"===t[1].charAt(6)?this.mangle(t[1].substring(7)):this.mangle(t[1])),this.mangle("mailto:")+o):o=this.options.escape(t[1]),r+=this.renderer.link(s,null,o)}else if(!this.inLink&&this.hasRulesGfm&&(t=this.rules.url.exec(e))){e=e.substring(t[0].length);var o=this.options.escape(t[1]);r+=this.renderer.link(o,null,o)}else if(t=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(t[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(t[0])&&(this.inLink=!1),e=e.substring(t[0].length),r+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):this.options.escape(t[0]):t[0];else if(t=this.rules.link.exec(e))e=e.substring(t[0].length),this.inLink=!0,r+=this.outputLink(t,{href:t[2],title:t[3]}),this.inLink=!1;else if(t=(t=this.rules.reflink.exec(e))||this.rules.nolink.exec(e)){e=e.substring(t[0].length);o=(t[2]||t[1]).replace(/\s+/g," ");var s=this.links[o.toLowerCase()];s&&s.href?(this.inLink=!0,r+=this.outputLink(t,s),this.inLink=!1):(r+=t[0].charAt(0),e=t[0].substring(1)+e)}else if(t=this.rules.strong.exec(e))e=e.substring(t[0].length),r+=this.renderer.strong(this.output(t[2]||t[1]));else if(t=this.rules.em.exec(e))e=e.substring(t[0].length),r+=this.renderer.em(this.output(t[2]||t[1]));else if(t=this.rules.code.exec(e))e=e.substring(t[0].length),r+=this.renderer.codespan(this.options.escape(t[2].trim(),!0));else if(t=this.rules.br.exec(e))e=e.substring(t[0].length),r+=this.renderer.br();else if(this.hasRulesGfm&&(t=this.rules.del.exec(e)))e=e.substring(t[0].length),r+=this.renderer.del(this.output(t[1]));else if(t=this.rules.text.exec(e))e=e.substring(t[0].length),r+=this.renderer.text(this.options.escape(this.smartypants(t[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return r}outputLink(e,t){var r=this.options.escape(t.href);t=t.title?this.options.escape(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(r,t,this.output(e[1])):this.renderer.image(r,t,this.options.escape(e[1]))}smartypants(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/([{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/([{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e}mangle(e){if(!this.options.mangle)return e;let t="";var r=e.length;for(let o=0;o<r;o++){let r;.5<Math.random()&&(r="x"+e.charCodeAt(o).toString(16)),t+="&#"+r+";"}return t}}class Ht{simpleRenderers=[];tokens;token;inlineLexer;options;renderer;line=0;constructor(e){this.tokens=[],this.token=null,this.options=e||Wt.options,this.renderer=this.options.renderer||new Dt(this.options)}static parse(e,t,r){return new this(r).parse(t,e)}parse(e,t){this.inlineLexer=new Ft(Ft,e,this.options,this.renderer),this.tokens=t.reverse();let r="";for(;this.next();)r+=this.tok();return r}debug(e,t){this.inlineLexer=new Ft(Ft,e,this.options,this.renderer),this.tokens=t.reverse();let r="";for(;this.next();){var o=this.tok();this.token.line=this.line+=o.split("\n").length-1,r+=o}return r}next(){return this.token=this.tokens.pop()}getNextElement(){return this.tokens[this.tokens.length-1]}parseText(){let e=this.token.text;for(var t;(t=this.getNextElement())&&t.type==Le.text;)e+="\n"+this.next().text;return this.inlineLexer.output(e)}tok(){switch(this.token.type){case Le.space:return"";case Le.paragraph:return this.renderer.paragraph(this.inlineLexer.output(this.token.text));case Le.text:return this.options.isNoP?this.parseText():this.renderer.paragraph(this.parseText());case Le.heading:return this.renderer.heading(this.inlineLexer.output(this.token.text),this.token.depth,this.token.text);case Le.listStart:{let t="";for(var e=this.token.ordered;this.next().type!=Le.listEnd;)t+=this.tok();return this.renderer.list(t,e)}case Le.listItemStart:{let e="";for(;this.next().type!=Le.listItemEnd;)e+=this.token.type==Le.text?this.parseText():this.tok();return this.renderer.listitem(e)}case Le.looseItemStart:{let e="";for(;this.next().type!=Le.listItemEnd;)e+=this.tok();return this.renderer.listitem(e)}case Le.code:return this.renderer.code(this.token.text,this.token.lang,this.token.escaped,this.token.meta);case Le.table:{e="";let o,s="";o="";for(let e=0;e<this.token.header.length;e++){var t={header:!0,align:this.token.align[e]},r=this.inlineLexer.output(this.token.header[e]);o+=this.renderer.tablecell(r,t)}e+=this.renderer.tablerow(o);for(const e of this.token.cells){o="";for(let t=0;t<e.length;t++)o+=this.renderer.tablecell(this.inlineLexer.output(e[t]),{header:!1,align:this.token.align[t]});s+=this.renderer.tablerow(o)}return this.renderer.table(e,s)}case Le.blockquoteStart:{let e="";for(;this.next().type!=Le.blockquoteEnd;)e+=this.tok();return this.renderer.blockquote(e)}case Le.hr:return this.renderer.hr();case Le.html:return e=this.token.pre||this.options.pedantic?this.token.text:this.inlineLexer.output(this.token.text),this.renderer.html(e);default:if(this.simpleRenderers.length)for(let e=0;e<this.simpleRenderers.length;e++)if(this.token.type=="simpleRule"+(e+1))return this.simpleRenderers[e].call(this.renderer,this.token.execArr);if(e=`Token with "${this.token.type}" type was not found.`,!this.options.silent)throw new Error(e);console.log(e)}}}class Wt{static options=new qt;static simpleRenderers=[];static setOptions(e){return Object.assign(this.options,e),this}static setBlockRule(e,t=(()=>"")){return Gt.simpleRules.push(e),this.simpleRenderers.push(t),this}static parse(e,t){try{t={...this.options,...t};var{tokens:r,links:o}=this.callBlockLexer(e,t);return this.callParser(r,o,t)}catch(e){return this.callMe(e)}}static debug(e,t=this.options){var{tokens:e,links:r}=this.callBlockLexer(e,t);let o=e.slice();return(t=new Ht(t)).simpleRenderers=this.simpleRenderers,t=t.debug(r,e),{tokens:o=o.map((e=>{e.type=Le[e.type]||e.type;var t=e.line;return delete e.line,t?{line:t,...e}:e})),links:r,result:t}}static callBlockLexer(e="",t){if("string"!=typeof e)throw new Error(`Expected that the 'src' parameter would have a 'string' type, got '${typeof e}'`);return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n").replace(/^ +$/gm,""),Gt.lex(e,t,!0)}static callParser(e,t,r){var o;return this.simpleRenderers.length?((o=new Ht(r)).simpleRenderers=this.simpleRenderers,o.parse(t,e)):Ht.parse(e,t,r)}static callMe(e){if(e.message+="\nPlease report this to https://github.com/ts-stack/markdown",this.options.silent)return"<p>An error occured:</p><pre>"+this.options.escape(e.message+"",!0)+"</pre>";throw e}}class Gt{staticThis;static simpleRules=[];static rulesBase=null;static rulesGfm=null;static rulesTables=null;rules;options;links={};tokens=[];hasRulesGfm;hasRulesTables;constructor(e,t){this.staticThis=e,this.options=t||Wt.options,this.setRules()}static lex(e,t,r,o){return new this(this,t).getTokens(e,r,o)}static getRulesBase(){var e,t;return this.rulesBase||((e={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/,bullet:/(?:[*+-]|\d+\.)/,item:/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/}).item=new Ot(e.item,"gm").setGroup(/bull/g,e.bullet).getRegexp(),e.list=new Ot(e.list).setGroup(/bull/g,e.bullet).setGroup("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))").setGroup("def","\\n+(?="+e.def.source+")").getRegexp(),t="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",e.html=new Ot(e.html).setGroup("comment",/<!--[\s\S]*?-->/).setGroup("closed",/<(tag)[\s\S]+?<\/\1>/).setGroup("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/).setGroup(/tag/g,t).getRegexp(),e.paragraph=new Ot(e.paragraph).setGroup("hr",e.hr).setGroup("heading",e.heading).setGroup("lheading",e.lheading).setGroup("blockquote",e.blockquote).setGroup("tag","<"+t).setGroup("def",e.def).getRegexp(),this.rulesBase=e)}static getRulesGfm(){var e,t,r,o;return this.rulesGfm||(r=(t={...e=this.getRulesBase(),fences:/^ *(`{3,}|~{3,})[ \.]*((\S+)? *[^\n]*)\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}).fences.source.replace("\\1","\\2"),o=e.list.source.replace("\\1","\\3"),t.paragraph=new Ot(e.paragraph).setGroup("(?!",`(?!${r}|${o}|`).getRegexp(),this.rulesGfm=t)}static getRulesTable(){return this.rulesTables||(this.rulesTables={...this.getRulesGfm(),nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/})}setRules(){this.options.gfm?this.options.tables?this.rules=this.staticThis.getRulesTable():this.rules=this.staticThis.getRulesGfm():this.rules=this.staticThis.getRulesBase(),this.hasRulesGfm=void 0!==this.rules.fences,this.hasRulesTables=void 0!==this.rules.table}getTokens(e,t,r){let o,s=e;e:for(;s;)if((o=this.rules.newline.exec(s))&&(s=s.substring(o[0].length),1<o[0].length)&&this.tokens.push({type:Le.space}),o=this.rules.code.exec(s)){s=s.substring(o[0].length);var n=o[0].replace(/^ {4}/gm,"");this.tokens.push({type:Le.code,text:this.options.pedantic?n:n.replace(/\n+$/,"")})}else if(this.hasRulesGfm&&(o=this.rules.fences.exec(s)))s=s.substring(o[0].length),this.tokens.push({type:Le.code,meta:o[2],lang:o[3],text:o[4]||""});else if(o=this.rules.heading.exec(s))s=s.substring(o[0].length),this.tokens.push({type:Le.heading,depth:o[1].length,text:o[2]});else if(t&&this.hasRulesTables&&(o=this.rules.nptable.exec(s))){s=s.substring(o[0].length);var i={type:Le.table,header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:[]};for(let e=0;e<i.align.length;e++)/^ *-+: *$/.test(i.align[e])?i.align[e]="right":/^ *:-+: *$/.test(i.align[e])?i.align[e]="center":/^ *:-+ *$/.test(i.align[e])?i.align[e]="left":i.align[e]=null;var a=o[3].replace(/\n$/,"").split("\n");for(let e=0;e<a.length;e++)i.cells[e]=a[e].split(/ *\| */);this.tokens.push(i)}else if(o=this.rules.lheading.exec(s))s=s.substring(o[0].length),this.tokens.push({type:Le.heading,depth:"="===o[2]?1:2,text:o[1]});else if(o=this.rules.hr.exec(s))s=s.substring(o[0].length),this.tokens.push({type:Le.hr});else if(o=this.rules.blockquote.exec(s))s=s.substring(o[0].length),this.tokens.push({type:Le.blockquoteStart}),n=o[0].replace(/^ *> ?/gm,""),this.getTokens(n),this.tokens.push({type:Le.blockquoteEnd});else if(o=this.rules.list.exec(s)){s=s.substring(o[0].length);var l,c=o[2],h=(this.tokens.push({type:Le.listStart,ordered:1<c.length}),o[0].match(this.rules.item)),p=h.length;let e,t=!1;for(let o=0;o<p;o++){let n=h[o];l=n.length,-1!==(n=n.replace(/^ *([*+-]|\d+\.) +/,"")).indexOf("\n ")&&(l-=n.length,n=this.options.pedantic?n.replace(/^ {1,4}/gm,""):n.replace(new RegExp("^ {1,"+l+"}","gm"),"")),!this.options.smartLists||o===p-1||c===(l=this.staticThis.getRulesBase().bullet.exec(h[o+1])[0])||1<c.length&&1<l.length||(s=h.slice(o+1).join("\n")+s,o=p-1),e=t||/\n\n(?!\s*$)/.test(n),o!==p-1&&(t="\n"===n.charAt(n.length-1),e=e||t),this.tokens.push({type:e?Le.looseItemStart:Le.listItemStart}),this.getTokens(n,!1,r),this.tokens.push({type:Le.listItemEnd})}this.tokens.push({type:Le.listEnd})}else if(o=this.rules.html.exec(s)){s=s.substring(o[0].length);var d=o[1];this.tokens.push({type:this.options.sanitize?Le.paragraph:Le.html,pre:!this.options.sanitizer&&("pre"===d||"script"===d||"style"===d),text:o[0]})}else if(t&&(o=this.rules.def.exec(s)))s=s.substring(o[0].length),this.links[o[1].toLowerCase()]={href:o[2],title:o[3]};else if(t&&this.hasRulesTables&&(o=this.rules.table.exec(s))){s=s.substring(o[0].length);var u={type:Le.table,header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:[]};for(let e=0;e<u.align.length;e++)/^ *-+: *$/.test(u.align[e])?u.align[e]="right":/^ *:-+: *$/.test(u.align[e])?u.align[e]="center":/^ *:-+ *$/.test(u.align[e])?u.align[e]="left":u.align[e]=null;var f=o[3].replace(/(?: *\| *)?\n$/,"").split("\n");for(let e=0;e<f.length;e++)u.cells[e]=f[e].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(u)}else{if(this.staticThis.simpleRules.length){var g=this.staticThis.simpleRules;for(let e=0;e<g.length;e++)if(o=g[e].exec(s)){s=s.substring(o[0].length);var b="simpleRule"+(e+1);this.tokens.push({type:b,execArr:o});continue e}}if(t&&(o=this.rules.paragraph.exec(s)))s=s.substring(o[0].length),"\n"===o[1].slice(-1)?this.tokens.push({type:Le.paragraph,text:o[1].slice(0,-1)}):this.tokens.push({type:0<this.tokens.length?Le.paragraph:Le.text,text:o[1]});else if(o=this.rules.text.exec(s))s=s.substring(o[0].length),this.tokens.push({type:Le.text,text:o[0]});else if(s)throw new Error("Infinite loop on byte: "+s.charCodeAt(0)+`, near text '${s.slice(0,30)}...'`)}return{tokens:this.tokens,links:this.links}}}const Vt=ne('<div class="flex justify-end mb-2 items-end guest-container"><div class="max-w-full flex flex-col justify-center items-start chatbot-guest-bubble px-4 py-2 gap-2" data-testid="guest-bubble">'),Yt=ne('<div class="flex flex-col items-start flex-wrap w-full gap-2">'),Xt=ne('<div class="flex items-center justify-center max-w-[128px] mr-[10px] p-0 m-0"><img class="w-full h-full bg-cover">'),Jt=ne('<audio class="w-[200px] h-10 block bg-cover bg-center rounded-none text-transparent" controls>Your browser does not support the <audio> tag.<source>'),Kt=ne('<span class="mr-2 whitespace-pre-wrap">'),Qt=(Wt.setOptions({isNoP:!0}),e=>{let t;$((()=>{t&&(t.innerHTML=Wt.parse(e.message.message))}));{const r=Vt(),o=r.firstChild;return r.style.setProperty("margin-left","50px"),o.style.setProperty("border-radius","6px"),pe(o,(()=>{const t=A((()=>!!(e.message.fileUploads&&0<e.message.fileUploads.length)));return()=>{return t()&&(pe(r=Yt(),H(J,{get each(){return e.message.fileUploads},children:t=>{var r=`${e.apiHost}/api/v1/get-upload-file?chatflowId=${e.chatflowid}&chatId=${e.chatId}&fileName=`+t.name;const o=t.data??r;return A((()=>{const e=A((()=>!(!t.mime||!t.mime.startsWith("image/"))));return()=>{if(e())return ae((r=Xt()).firstChild,"src",o),r;{const e=Jt(),r=e.firstChild.nextSibling;return ae(r,"src",o),C((()=>ae(r,"type",t.mime))),e}var r}})())}})),r);var r}})(),null),pe(o,(()=>{const r=A((()=>!!e.message.message));return()=>r()&&(()=>{const r=Kt();return"function"==typeof t?he(t,r):t=r,C((()=>null!=(e.fontSize?e.fontSize+"px":"16")?r.style.setProperty("font-size",e.fontSize?e.fontSize+"px":"16"):r.style.removeProperty("font-size"))),r})()})(),null),pe(r,H(K,{get when(){return e.showAvatar},get children(){return H(Rt,{get initialAvatarSrc(){return e.avatarSrc}})}}),null),C((t=>{var r=e.backgroundColor??"#3B81F6",s=e.textColor??"#ffffff";return r!==t._v$&&(null!=(t._v$=r)?o.style.setProperty("background-color",r):o.style.removeProperty("background-color")),s!==t._v$2&&(null!=(t._v$2=s)?o.style.setProperty("color",s):o.style.removeProperty("color")),t}),{_v$:void 0,_v$2:void 0}),r}}),Zt=ne("<button>"),er=ne('<button type="submit">'),tr=e=>{return ce(t=Zt(),Y({get disabled(){return e.isDisabled||e.isLoading}},e,{get class(){return"p-2 justify-center font-semibold text-white focus:outline-none flex items-center disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 transition-all filter hover:brightness-90 active:brightness-75 chatbot-button "+e.class},style:{background:"transparent",border:"none"},title:"Copy to clipboard"}),!1,!0),pe(t,H(K,{get when(){return!e.isLoading},get fallback(){return H(ft,{class:"text-white"})},get children(){return H(We,{get color(){return e.sendButtonColor},get class(){return"send-icon flex "+(e.disableIcon?"hidden":"")}})}})),t;var t},rr=e=>{return ce(t=er(),Y({get disabled(){return e.isDisabled||e.isLoading}},e,{get class(){return"p-2 justify-center font-semibold text-white focus:outline-none flex items-center disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 transition-all filter hover:brightness-90 active:brightness-75 chatbot-button "+e.class},style:{background:"transparent",border:"none"},title:"Thumbs Up"}),!1,!0),pe(t,H(K,{get when(){return!e.isLoading},get fallback(){return H(ft,{class:"text-white"})},get children(){return H(Xe,{get color(){return e.sendButtonColor},get class(){return"send-icon flex "+(e.disableIcon?"hidden":"")}})}})),t;var t},or=e=>{return ce(t=er(),Y({get disabled(){return e.isDisabled||e.isLoading}},e,{get class(){return"p-2 justify-center font-semibold text-white focus:outline-none flex items-center disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 transition-all filter hover:brightness-90 active:brightness-75 chatbot-button "+e.class},style:{background:"transparent",border:"none"},title:"Thumbs Down"}),!1,!0),pe(t,H(K,{get when(){return!e.isLoading},get fallback(){return H(ft,{class:"text-white"})},get children(){return H(Ve,{get color(){return e.sendButtonColor},get class(){return"send-icon flex "+(e.disableIcon?"hidden":"")}})}})),t;var t},sr=ne('<div class="flex overflow-x-hidden overflow-y-auto fixed inset-0 z-[1002] outline-none focus:outline-none justify-center items-center"><div class="relative w-full my-6 mx-auto max-w-3xl"><div class="border-0 rounded-lg shadow-lg relative flex flex-col w-full bg-white outline-none focus:outline-none"><div class="flex items-start justify-between p-5 border-b border-solid border-blueGray-200 rounded-t"><h3 class="text-2xl font-semibold">Provide additional feedback</h3><button class="p-1 ml-auto bg-transparent border-0 text-black float-right text-xl leading-none font-semibold outline-none focus:outline-none" type="button"><span class="bg-transparent block outline-none focus:outline-none"><svg xmlns="http://www.w3.org/2000/svg" class="text-black h-6 w-6" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"></path><path d="m6 6 12 12"></path></svg></span></button></div><div class="relative p-6 flex-auto"><textarea rows="4" class="block p-2.5 rounded-lg border focus:ring-blue-500 focus:border-blue-500 bg-transparent flex-1 w-full feedback-input disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 font-normal" placeholder="What do you think of the response?"></textarea></div><div class="flex items-center justify-end p-4 border-t border-solid border-blueGray-200 rounded-b"><button class="bg-emerald-500 text-white active:bg-emerald-600 font-bold uppercase text-sm px-4 py-2 rounded shadow hover:shadow-lg outline-none focus:outline-none mr-1 mb-1 ease-linear transition-all duration-150" type="button">Submit Feedback'),nr=ne('<div class="flex opacity-25 fixed inset-0 z-[1001] bg-black">'),ir="#303235",ar=e=>{const[t,r]=_("");let o;const s=()=>{""!==t()&&o?.reportValidity()&&e.onSubmit(t()),r("")},n=()=>{e.onClose()};return[(()=>{const i=sr(),a=i.firstChild.firstChild,l=a.firstChild,c=l.firstChild.nextSibling,h=l.nextSibling,p=h.firstChild,d=h.nextSibling.firstChild;l.style.setProperty("border","1px solid #eeeeee"),c.$$click=n;return"function"==typeof o?he(o,p):o=p,p.$$input=e=>(e=e.currentTarget.value,r(e)),p.style.setProperty("border","1px solid #eeeeee"),d.$$click=s,C((t=>{var r=e.backgroundColor??"#ffffff",o=e.textColor??ir,s=e.textColor??ir;return r!==t._v$&&(null!=(t._v$=r)?a.style.setProperty("background-color",r):a.style.removeProperty("background-color")),o!==t._v$2&&(null!=(t._v$2=o)?a.style.setProperty("color",o):a.style.removeProperty("color")),s!==t._v$3&&(null!=(t._v$3=s)?p.style.setProperty("color",s):p.style.removeProperty("color")),t}),{_v$:void 0,_v$2:void 0,_v$3:void 0}),C((()=>p.value=t())),i})(),nr()]},lr=(ie(["click","input"]),ne('<div class="flex flex-col justify-start mb-2 items-start host-container">')),cr=ne('<span class="px-4 py-2 ml-2 max-w-full chatbot-host-bubble prose" data-testid="host-bubble">'),hr=ne('<div class="flex items-center px-2">'),pr=(Wt.setOptions({isNoP:!0}),e=>{let t;const[r,o]=_(""),[s,n]=_(""),[i,a]=_(!1),l=async()=>{if(""===r()){var t={chatflowid:e.chatflowid,chatId:e.chatId,messageId:e.message?.messageId,rating:"THUMBS_UP",content:""};if((t=await Ne({chatflowid:e.chatflowid,apiHost:e.apiHost,body:t})).data){let e="";(t=t.data)&&t.id&&(e=t.id),o("THUMBS_UP"),n(e),a(!0)}}},c=async()=>{if(""===r()){var t={chatflowid:e.chatflowid,chatId:e.chatId,messageId:e.message?.messageId,rating:"THUMBS_DOWN",content:""};if((t=await Ne({chatflowid:e.chatflowid,apiHost:e.apiHost,body:t})).data){let e="";(t=t.data)&&t.id&&(e=t.id),o("THUMBS_DOWN"),n(e),a(!0)}}},h=async t=>{t={content:t},(await(({id:e,apiHost:t="http://localhost:3000",body:r})=>Se({method:"PUT",url:t+"/api/v1/feedback/"+e,body:r}))({id:s(),apiHost:e.apiHost,body:t})).data&&(n(""),a(!1))};return $((()=>{if(t&&(t.innerHTML=Wt.parse(e.message.message),t.querySelectorAll("a").forEach((e=>{e.target="_blank"})),e.fileAnnotations)&&e.fileAnnotations.length)for(const s of e.fileAnnotations){var r=document.createElement("button"),o=(r.textContent=s.fileName,r.className="py-2 px-4 mb-2 justify-center font-semibold text-white focus:outline-none flex items-center disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 transition-all filter hover:brightness-90 active:brightness-75 file-annotation-button",r.addEventListener("click",(function(){(async t=>{try{var r=await Me({apiHost:e.apiHost,body:{question:"",history:[],fileName:t.fileName}}),o=new Blob([r.data]),s=window.URL.createObjectURL(o),n=document.createElement("a");n.href=s,n.download=t.fileName,document.body.appendChild(n),n.click(),n.remove()}catch(t){console.error("Download failed:",t)}})(s)})),document.createElement("div"));o.className="ml-2",o.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-download" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="#ffffff" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2" /><path d="M7 11l5 5l5 -5" /><path d="M12 4l0 12" /></svg>',r.appendChild(o),t.appendChild(r)}})),(p=lr()).style.setProperty("margin-right","50px"),pe(p,H(K,{get when(){return e.showAvatar},get children(){return H(Rt,{get initialAvatarSrc(){return e.avatarSrc}})}}),null),pe(p,(()=>{const r=A((()=>!!e.message.message));return()=>r()&&(()=>{const r=cr();return"function"==typeof t?he(t,r):t=r,r.style.setProperty("border-radius","6px"),C((t=>{var o=e.backgroundColor??"#f7f8ff",s=e.textColor??"#303235",n=e.fontSize?e.fontSize+"px":"16";return o!==t._v$&&(null!=(t._v$=o)?r.style.setProperty("background-color",o):r.style.removeProperty("background-color")),s!==t._v$2&&(null!=(t._v$2=s)?r.style.setProperty("color",s):r.style.removeProperty("color")),n!==t._v$3&&(null!=(t._v$3=n)?r.style.setProperty("font-size",n):r.style.removeProperty("font-size")),t}),{_v$:void 0,_v$2:void 0,_v$3:void 0}),r})()})(),null),pe(p,(()=>{const o=A((()=>!(!e.chatFeedbackStatus||!e.message.messageId)));return()=>{return o()&&[(pe(s=hr(),H(tr,{onClick:()=>(async()=>{try{var e=t?t?.textContent:"";await navigator.clipboard.writeText(e||"")}catch(e){console.error("Error copying to clipboard:",e)}})()}),null),pe(s,(()=>{const e=A((()=>!(""!==r()&&"THUMBS_UP"!==r())));return()=>e()?H(rr,{get isDisabled(){return"THUMBS_UP"===r()},get rating(){return r()},onClick:l}):null})(),null),pe(s,(()=>{const e=A((()=>!(""!==r()&&"THUMBS_DOWN"!==r())));return()=>e()?H(or,{get isDisabled(){return"THUMBS_DOWN"===r()},get rating(){return r()},onClick:c}):null})(),null),s),H(K,{get when(){return i()},get children(){return H(ar,{get isOpen(){return i()},onClose:()=>a(!1),onSubmit:h,get backgroundColor(){return e.backgroundColor},get textColor(){return e.textColor}})}})];var s}})(),null),p;var p}),dr=ne('<div class="flex items-center"><div class="w-2 h-2 mr-1 rounded-full bubble1"></div><div class="w-2 h-2 mr-1 rounded-full bubble2"></div><div class="w-2 h-2 rounded-full bubble3">'),ur=()=>dr(),fr=ne('<div class="flex justify-start mb-2 items-start animate-fade-in host-container"><span class="px-4 py-4 ml-2 whitespace-pre-wrap max-w-full chatbot-host-bubble" data-testid="host-bubble">'),gr=()=>{return pe((e=fr()).firstChild,H(ur,{})),e;var e},br=ne('<div data-modal-target="defaultModal" data-modal-toggle="defaultModal" class="flex justify-start mb-2 items-start animate-fade-in host-container hover:brightness-90 active:brightness-75"><span class="px-2 py-1 ml-1 whitespace-pre-wrap max-w-full chatbot-host-bubble" data-testid="host-bubble">'),wr=e=>{return r=(t=br()).firstChild,t.$$click=()=>e.onSourceClick?.(),r.style.setProperty("width","max-content"),r.style.setProperty("max-width","80px"),r.style.setProperty("font-size","13px"),r.style.setProperty("border-radius","15px"),r.style.setProperty("cursor","pointer"),r.style.setProperty("text-overflow","ellipsis"),r.style.setProperty("overflow","hidden"),r.style.setProperty("white-space","nowrap"),pe(r,(()=>e.pageContent)),t;var t,r},mr=(ie(["click"]),ne('<div data-modal-target="defaultModal" data-modal-toggle="defaultModal" class="flex justify-start items-start animate-fade-in host-container hover:brightness-90 active:brightness-75"><span class="px-2 py-1 ml-1 whitespace-pre-wrap max-w-full chatbot-host-bubble" data-testid="host-bubble">')),yr=e=>{return r=(t=mr()).firstChild,t.$$click=()=>e.onPromptClick?.(),r.style.setProperty("width","max-content"),r.style.setProperty("font-size","15px"),r.style.setProperty("border-radius","15px"),r.style.setProperty("cursor","pointer"),pe(r,(()=>e.prompt)),t;var t,r},vr=(ie(["click"]),ne('<span class="w-full text-center px-[10px] pt-[6px] pb-[10px] m-auto text-[13px]">Powered by<a href="https://flowiseai.com" target="_blank" rel="noopener noreferrer" class="lite-badge" id="lite-badge"><span> Flowise')),xr="#303235",kr=e=>{let t,r;const o=r=>{r.forEach((r=>{r.removedNodes.forEach((r=>{"id"in r&&t&&"lite-badge"==r.id&&(console.log("Sorry, you can't remove the brand 😅"),e.botContainer?.append(t))}))}))};$((()=>{document&&e.botContainer&&(r=new MutationObserver(o)).observe(e.botContainer,{subtree:!1,childList:!0})})),T((()=>{r&&r.disconnect()}));{const r=vr(),o=r.firstChild.nextSibling;return"function"==typeof t?he(t,o):t=o,o.style.setProperty("font-weight","bold"),C((t=>{var s=e.poweredByTextColor??xr,n=e.badgeBackgroundColor??"#ffffff",i=e.poweredByTextColor??xr;return s!==t._v$&&(null!=(t._v$=s)?r.style.setProperty("color",s):r.style.removeProperty("color")),n!==t._v$2&&(null!=(t._v$2=n)?r.style.setProperty("background-color",n):r.style.removeProperty("background-color")),i!==t._v$3&&(null!=(t._v$3=i)?o.style.setProperty("color",i):o.style.removeProperty("color")),t}),{_v$:void 0,_v$2:void 0,_v$3:void 0}),r}},_r=Object.create(null),Cr=(_r.open="0",_r.close="1",_r.ping="2",_r.pong="3",_r.message="4",_r.upgrade="5",_r.noop="6",Object.create(null)),Sr=(Object.keys(_r).forEach((e=>{Cr[_r[e]]=e})),{type:"error",data:"parser error"}),Ar="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),Pr="function"==typeof ArrayBuffer,$r=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Tr=({type:e,data:t},r,o)=>Ar&&t instanceof Blob?r?o(t):Er(t,o):Pr&&(t instanceof ArrayBuffer||$r(t))?r?o(t):Er(new Blob([t]),o):o(_r[e]+(t||"")),Er=(e,t)=>{const r=new FileReader;return r.onload=function(){var e=r.result.split(",")[1];t("b"+(e||""))},r.readAsDataURL(e)};function Br(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Rr;const Or="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Lr="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let e=0;e<64;e++)Lr[Or.charCodeAt(e)]=e;const jr="function"==typeof ArrayBuffer,zr=(e,t)=>{var r;return"string"!=typeof e?{type:"message",data:Nr(e,t)}:"b"===(r=e.charAt(0))?{type:"message",data:Ir(e.substring(1),t)}:Cr[r]?1<e.length?{type:Cr[r],data:e.substring(1)}:{type:Cr[r]}:Sr},Ir=(e,t)=>{var r;return jr?(r=(e=>{let t,r,o,s,n,i=.75*e.length,a=e.length,l=0;"="===e[e.length-1]&&(i--,"="===e[e.length-2])&&i--;var c=new ArrayBuffer(i),h=new Uint8Array(c);for(t=0;t<a;t+=4)r=Lr[e.charCodeAt(t)],o=Lr[e.charCodeAt(t+1)],s=Lr[e.charCodeAt(t+2)],n=Lr[e.charCodeAt(t+3)],h[l++]=r<<2|o>>4,h[l++]=(15&o)<<4|s>>2,h[l++]=(3&s)<<6|63&n;return c})(e),Nr(r,t)):{base64:!0,data:e}},Nr=(e,t)=>"blob"!==t?e instanceof ArrayBuffer?e:e.buffer:e instanceof Blob?e:new Blob([e]),Mr=String.fromCharCode(30);function Ur(){return new TransformStream({transform(e,t){!function(e,t){Ar&&e.data instanceof Blob?e.data.arrayBuffer().then(Br).then(t):Pr&&(e.data instanceof ArrayBuffer||$r(e.data))?t(Br(e.data)):Tr(e,!1,(e=>{Rr=Rr||new TextEncoder,t(Rr.encode(e))}))}(e,(r=>{var o,s=r.length;let n;s<126?(n=new Uint8Array(1),new DataView(n.buffer).setUint8(0,s)):s<65536?(n=new Uint8Array(3),(o=new DataView(n.buffer)).setUint8(0,126),o.setUint16(1,s)):(n=new Uint8Array(9),(o=new DataView(n.buffer)).setUint8(0,127),o.setBigUint64(1,BigInt(s))),e.data&&"string"!=typeof e.data&&(n[0]|=128),t.enqueue(n),t.enqueue(r)}))}})}let qr;function Dr(e){return e.reduce(((e,t)=>e+t.length),0)}function Fr(e,t){if(e[0].length===t)return e.shift();var r=new Uint8Array(t);let o=0;for(let s=0;s<t;s++)r[s]=e[0][o++],o===e[0].length&&(e.shift(),o=0);return e.length&&o<e[0].length&&(e[0]=e[0].slice(o)),r}function Hr(e){if(e)return function(e){for(var t in Hr.prototype)e[t]=Hr.prototype[t];return e}(e)}Hr.prototype.on=Hr.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},Hr.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},Hr.prototype.off=Hr.prototype.removeListener=Hr.prototype.removeAllListeners=Hr.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)this._callbacks={};else{var r=this._callbacks["$"+e];if(r)if(1==arguments.length)delete this._callbacks["$"+e];else{for(var o,s=0;s<r.length;s++)if((o=r[s])===t||o.fn===t){r.splice(s,1);break}0===r.length&&delete this._callbacks["$"+e]}}return this},Hr.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),r=this._callbacks["$"+e],o=1;o<arguments.length;o++)t[o-1]=arguments[o];if(r){o=0;for(var s=(r=r.slice(0)).length;o<s;++o)r[o].apply(this,t)}return this},Hr.prototype.emitReserved=Hr.prototype.emit,Hr.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},Hr.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Wr="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function Gr(e,...t){return t.reduce(((t,r)=>(e.hasOwnProperty(r)&&(t[r]=e[r]),t)),{})}const Vr=Wr.setTimeout,Yr=Wr.clearTimeout;function Xr(e,t){t.useNativeTimers?(e.setTimeoutFn=Vr.bind(Wr),e.clearTimeoutFn=Yr.bind(Wr)):(e.setTimeoutFn=Wr.setTimeout.bind(Wr),e.clearTimeoutFn=Wr.clearTimeout.bind(Wr))}function Jr(e){return"string"==typeof e?function(e){let t,r=0;for(let o=0,s=e.length;o<s;o++)(t=e.charCodeAt(o))<128?r+=1:t<2048?r+=2:t<55296||57344<=t?r+=3:(o++,r+=4);return r}(e):Math.ceil(1.33*(e.byteLength||e.size))}class Kr extends Error{constructor(e,t,r){super(e),this.description=t,this.context=r,this.type="TransportError"}}class Qr extends Hr{constructor(e){super(),this.writable=!1,Xr(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,r){return super.emitReserved("error",new Kr(e,t,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){e=zr(e,this.socket.binaryType),this.onPacket(e)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){var e=this.opts.hostname;return-1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){return e=function(e){let t="";for(var r in e)e.hasOwnProperty(r)&&(t.length&&(t+="&"),t+=encodeURIComponent(r)+"="+encodeURIComponent(e[r]));return t}(e),e.length?"?"+e:""}}const Zr="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),eo=64,to={};let ro,oo=0,so=0;function no(e){let t="";for(;t=Zr[e%eo]+t,0<(e=Math.floor(e/eo)););return t}function io(){var e=no(+new Date);return e!==ro?(oo=0,ro=e):e+"."+no(oo++)}for(;so<eo;so++)to[Zr[so]]=so;let ao=!1;try{ao="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(s){}const lo=ao;function co(e){e=e.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!e||lo))return new XMLHttpRequest}catch(e){}if(!e)try{return new(Wr[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}function ho(){}const po=null!=new co({xdomain:!1}).responseType;class uo extends Hr{constructor(e,t){super(),Xr(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.data=void 0!==t.data?t.data:null,this.create()}create(){var e,t=Gr(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd;const r=this.xhr=new co(t);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders)for(var o in r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0),this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(o)&&r.setRequestHeader(o,this.opts.extraHeaders[o])}catch(e){}if("POST"===this.method)try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{r.setRequestHeader("Accept","*/*")}catch(e){}null!=(e=this.opts.cookieJar)&&e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var e;3===r.readyState&&null!=(e=this.opts.cookieJar)&&e.parseCookies(r),4===r.readyState&&(200===r.status||1223===r.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof r.status?r.status:0)}),0))},r.send(this.data)}catch(e){return void this.setTimeoutFn((()=>{this.onError(e)}),0)}"undefined"!=typeof document&&(this.index=uo.requestsCount++,uo.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=ho,e)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete uo.requests[this.index],this.xhr=null}}onLoad(){var e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(uo.requestsCount=0,uo.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",fo);else if("function"==typeof addEventListener){addEventListener("onpagehide"in Wr?"pagehide":"unload",fo,!1)}function fo(){for(var e in uo.requests)uo.requests.hasOwnProperty(e)&&uo.requests[e].abort()}const go="function"==typeof Promise&&"function"==typeof Promise.resolve?e=>Promise.resolve().then(e):(e,t)=>t(e,0),bo=Wr.WebSocket||Wr.MozWebSocket,wo="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();const mo={websocket:class extends Qr{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(this.check()){var e=this.uri(),t=this.opts.protocols,r=wo?{}:Gr(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=wo?new bo(e,t,r):t?new bo(e,t):new bo(e)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let r=0;r<e.length;r++){var t=e[r];const o=r===e.length-1;Tr(t,this.supportsBinary,(e=>{try{this.ws.send(e)}catch(e){}o&&go((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){var e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=io()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}check(){return!!bo}},webtransport:class extends Qr{get name(){return"webtransport"}doOpen(){"function"==typeof WebTransport&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then((()=>{this.onClose()})).catch((e=>{this.onError("webtransport error",e)})),this.transport.ready.then((()=>{this.transport.createBidirectionalStream().then((e=>{var t=function(e,t){qr=qr||new TextDecoder;const r=[];let o=0,s=-1,n=!1;return new TransformStream({transform(i,a){for(r.push(i);;){if(0===o){if(Dr(r)<1)break;var l=Fr(r,1);n=128==(128&l[0]),s=127&l[0],o=s<126?3:126===s?1:2}else if(1===o){if(Dr(r)<2)break;l=Fr(r,2),s=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),o=3}else if(2===o){if(Dr(r)<8)break;var c=Fr(r,8),h=(c=new DataView(c.buffer,c.byteOffset,c.length)).getUint32(0);if(h>Math.pow(2,21)-1){a.enqueue(Sr);break}s=h*Math.pow(2,32)+c.getUint32(4),o=3}else{if(Dr(r)<s)break;h=Fr(r,s),a.enqueue(zr(n?h:qr.decode(h),t)),o=0}if(0===s||s>e){a.enqueue(Sr);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType);const r=e.readable.pipeThrough(t).getReader();(t=Ur()).readable.pipeTo(e.writable),this.writer=t.writable.getWriter();const o=()=>{r.read().then((({done:e,value:t})=>{e||(this.onPacket(t),o())})).catch((e=>{}))};o(),e={type:"open"},this.query.sid&&(e.data=`{"sid":"${this.query.sid}"}`),this.writer.write(e).then((()=>this.onOpen()))}))})))}write(e){this.writable=!1;for(let r=0;r<e.length;r++){var t=e[r];const o=r===e.length-1;this.writer.write(t).then((()=>{o&&go((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){var e;null!=(e=this.transport)&&e.close()}},polling:class extends Qr{constructor(e){if(super(e),this.polling=!1,"undefined"!=typeof location){var t="https:"===location.protocol;let r=location.port;r=r||(t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||r!==e.port}t=e&&e.forceBase64,this.supportsBinary=po&&!t,this.opts.withCredentials&&(this.cookieJar=void 0)}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let e=0;this.polling&&(e++,this.once("pollComplete",(function(){--e||t()}))),this.writable||(e++,this.once("drain",(function(){--e||t()})))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){((e,t)=>{var r=e.split(Mr),o=[];for(let e=0;e<r.length;e++){var s=zr(r[e],t);if(o.push(s),"error"===s.type)break}return o})(e,this.socket.binaryType).forEach((e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState)&&this.poll()}doClose(){var e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,((e,t)=>{const r=e.length,o=new Array(r);let s=0;e.forEach(((e,n)=>{Tr(e,!1,(e=>{o[n]=e,++s===r&&t(o.join(Mr))}))}))})(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){var e=this.opts.secure?"https":"http",t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=io()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(e,t)}request(e={}){return Object.assign(e,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new uo(this.uri(),e)}doWrite(e,t){(e=this.request({method:"POST",data:e})).on("success",t),e.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){var e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}},yo=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,vo=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function xo(e){var t=e,r=e.indexOf("["),o=e.indexOf("]");-1!=r&&-1!=o&&(e=e.substring(0,r)+e.substring(r,o).replace(/:/g,";")+e.substring(o,e.length));let s=yo.exec(e||""),n={},i=14;for(;i--;)n[vo[i]]=s[i]||"";return-1!=r&&-1!=o&&(n.source=t,n.host=n.host.substring(1,n.host.length-1).replace(/;/g,":"),n.authority=n.authority.replace("[","").replace("]","").replace(/;/g,":"),n.ipv6uri=!0),n.pathNames=function(e,t){var r=t.replace(/\/{2,9}/g,"/").split("/");return"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1),"/"==t.slice(-1)&&r.splice(r.length-1,1),r}(0,n.path),n.queryKey=function(e,t){const r={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,o){t&&(r[t]=o)})),r}(0,n.query),n}let ko=class e extends Hr{constructor(e,t={}){super(),this.binaryType="arraybuffer",this.writeBuffer=[],e&&"object"==typeof e&&(t=e,e=null),e?(e=xo(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=xo(t.host).host),Xr(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){var t={},r=e.split("&");for(let e=0,s=r.length;e<s;e++){var o=r[e].split("=");t[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return t}(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname)&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1)),this.open()}createTransport(e){var t=((t=Object.assign({},this.opts.query)).EIO=4,t.transport=e,this.id&&(t.sid=this.id),Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]));return new mo[e](t)}open(){let t;if(this.opts.rememberUpgrade&&e.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(t){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),(this.transport=e).on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(e=>this.onClose("transport close",e)))}probe(t){let r=this.createTransport(t),o=!1;e.priorWebsocketSuccess=!1;const s=()=>{o||(r.send([{type:"ping",data:"probe"}]),r.once("packet",(t=>{o||("pong"===t.type&&"probe"===t.data?(this.upgrading=!0,this.emitReserved("upgrading",r),r&&(e.priorWebsocketSuccess="websocket"===r.name,this.transport.pause((()=>{o||"closed"!==this.readyState&&(h(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})))):((t=new Error("probe error")).transport=r.name,this.emitReserved("upgradeError",t)))})))};function n(){o||(o=!0,h(),r.close(),r=null)}const i=e=>{(e=new Error("probe error: "+e)).transport=r.name,n(),this.emitReserved("upgradeError",e)};function a(){i("transport closed")}function l(){i("socket closed")}function c(e){r&&e.name!==r.name&&n()}const h=()=>{r.removeListener("open",s),r.removeListener("error",i),r.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};r.once("open",s),r.once("error",i),r.once("close",a),this.once("close",l),this.once("upgrading",c),-1!==this.upgrades.indexOf("webtransport")&&"webtransport"!==t?this.setTimeoutFn((()=>{o||r.open()}),200):r.open()}onOpen(){if(this.readyState="open",e.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade){let e=0;for(var t=this.upgrades.length;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),this.resetPingTimeout(),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":var t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((()=>{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),(this.prevBufferLen=0)===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){var e;"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(e=this.getWritablePackets(),this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush"))}getWritablePackets(){if(this.maxPayload&&"polling"===this.transport.name&&1<this.writeBuffer.length){let t=1;for(let r=0;r<this.writeBuffer.length;r++){var e=this.writeBuffer[r].data;if(e&&(t+=Jr(e)),0<r&&t>this.maxPayload)return this.writeBuffer.slice(0,r);t+=2}}return this.writeBuffer}write(e,t,r){return this.sendPacket("message",e,t,r),this}send(e,t,r){return this.sendPacket("message",e,t,r),this}sendPacket(e,t,r,o){"function"==typeof t&&(o=t,t=void 0),"function"==typeof r&&(o=r,r=null),"closing"!==this.readyState&&"closed"!==this.readyState&&((r=r||{}).compress=!1!==r.compress,this.emitReserved("packetCreate",e={type:e,data:t,options:r}),this.writeBuffer.push(e),o&&this.once("flush",o),this.flush())}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},r=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{(this.upgrading?r:e)()})):(this.upgrading?r:e)()),this}onError(t){e.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){var t=[];let r=0;for(var o=e.length;r<o;r++)~this.transports.indexOf(e[r])&&t.push(e[r]);return t}};ko.protocol=4;const _o="function"==typeof ArrayBuffer,Co=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,So=Object.prototype.toString,Ao="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===So.call(Blob),Po="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===So.call(File);function $o(e){return _o&&(e instanceof ArrayBuffer||Co(e))||Ao&&e instanceof Blob||Po&&e instanceof File}function To(e,t){if(e&&"object"==typeof e)if(Array.isArray(e)){for(let t=0,r=e.length;t<r;t++)if(To(e[t]))return!0}else{if($o(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return To(e.toJSON(),!0);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&To(e[t]))return!0}return!1}function Eo(e){var t=[],r=e.data;return e.data=Bo(r,t),e.attachments=t.length,{packet:e,buffers:t}}function Bo(e,t){if(!e)return e;var r;if($o(e))return r={_placeholder:!0,num:t.length},t.push(e),r;if(Array.isArray(e)){var o=new Array(e.length);for(let r=0;r<e.length;r++)o[r]=Bo(e[r],t);return o}if("object"!=typeof e||e instanceof Date)return e;var s={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(s[r]=Bo(e[r],t));return s}function Ro(e,t){return e.data=Oo(e.data,t),delete e.attachments,e}function Oo(e,t){if(e){if(e&&!0===e._placeholder){if("number"==typeof e.num&&0<=e.num&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let r=0;r<e.length;r++)e[r]=Oo(e[r],t);else if("object"==typeof e)for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(e[r]=Oo(e[r],t))}return e}const Lo=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];!function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(je=je||{});function jo(e){return"[object Object]"===Object.prototype.toString.call(e)}class zo extends Hr{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");var r=(t=this.decodeString(e)).type===je.BINARY_EVENT;(!r&&t.type!==je.BINARY_ACK||(t.type=r?je.EVENT:je.ACK,this.reconstructor=new Io(t),0===t.attachments))&&super.emitReserved("decoded",t)}else{if(!$o(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(t=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;var r={type:Number(e.charAt(0))};if(void 0===je[r.type])throw new Error("unknown packet type "+r.type);if(r.type===je.BINARY_EVENT||r.type===je.BINARY_ACK){for(var o=t+1;"-"!==e.charAt(++t)&&t!=e.length;);if((o=e.substring(o,t))!=Number(o)||"-"!==e.charAt(t))throw new Error("Illegal attachments");r.attachments=Number(o)}if("/"===e.charAt(t+1)){for(o=t+1;++t&&","!==e.charAt(t)&&t!==e.length;);r.nsp=e.substring(o,t)}else r.nsp="/";if(""!==(o=e.charAt(t+1))&&Number(o)==o){for(o=t+1;++t;){var s=e.charAt(t);if(null==s||Number(s)!=s){--t;break}if(t===e.length)break}r.id=Number(e.substring(o,t+1))}if(e.charAt(++t)){if(o=this.tryParse(e.substr(t)),!zo.isPayloadValid(r.type,o))throw new Error("invalid payload");r.data=o}return r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case je.CONNECT:return jo(t);case je.DISCONNECT:return void 0===t;case je.CONNECT_ERROR:return"string"==typeof t||jo(t);case je.EVENT:case je.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===Lo.indexOf(t[0]));case je.ACK:case je.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Io{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){return this.buffers.push(e),this.buffers.length===this.reconPack.attachments?(e=Ro(this.reconPack,this.buffers),this.finishedReconstruction(),e):null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}var No=Object.freeze({__proto__:null,Decoder:zo,Encoder:class{constructor(e){this.replacer=e}encode(e){return e.type!==je.EVENT&&e.type!==je.ACK||!To(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===je.EVENT?je.BINARY_EVENT:je.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==je.BINARY_EVENT&&e.type!==je.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){e=Eo(e);var t=this.encodeAsString(e.packet);return(e=e.buffers).unshift(t),e}},get PacketType(){return je},protocol:5});function Mo(e,t,r){return e.on(t,r),function(){e.off(t,r)}}const Uo=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class qo extends Hr{constructor(e,t,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){var e;this.subs||(e=this.io,this.subs=[Mo(e,"open",this.onopen.bind(this)),Mo(e,"packet",this.onpacket.bind(this)),Mo(e,"error",this.onerror.bind(this)),Mo(e,"close",this.onclose.bind(this))])}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(Uo.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');var r,o;return t.unshift(e),!this._opts.retries||this.flags.fromQueue||this.flags.volatile?((e={type:je.EVENT,data:t,options:{}}).options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]&&(r=this.ids++,o=t.pop(),this._registerAckCallback(r,o),e.id=r),o=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable,(!this.flags.volatile||o&&this.connected)&&(this.connected?(this.notifyOutgoingListeners(e),this.packet(e)):this.sendBuffer.push(e)),this.flags={}):this._addToQueue(t),this}_registerAckCallback(e,t){var r=null!=(r=this.flags.timeout)?r:this._opts.ackTimeout;if(void 0===r)this.acks[e]=t;else{const o=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,new Error("operation has timed out"))}),r);this.acks[e]=(...e)=>{this.io.clearTimeoutFn(o),t.apply(this,[null,...e])}}}emitWithAck(e,...t){const r=void 0!==this.flags.timeout||void 0!==this._opts.ackTimeout;return new Promise(((o,s)=>{t.push(((e,t)=>r?e?s(e):o(t):o(e))),this.emit(e,...t)}))}_addToQueue(e){let t;"function"==typeof e[e.length-1]&&(t=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push(((e,...o)=>{if(r===this._queue[0])return null!==e?r.tryCount>this._opts.retries&&(this._queue.shift(),t)&&t(e):(this._queue.shift(),t&&t(null,...o)),r.pending=!1,this._drainQueue()})),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){var t;!this.connected||0===this._queue.length||(t=this._queue[0]).pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth((e=>{this._sendConnectPacket(e)})):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:je.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case je.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case je.EVENT:case je.BINARY_EVENT:this.onevent(e);break;case je.ACK:case je.BINARY_ACK:this.onack(e);break;case je.DISCONNECT:this.ondisconnect();break;case je.CONNECT_ERROR:this.destroy();var t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){var t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length)for(const t of this._anyListeners.slice())t.apply(this,e);super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let r=!1;return function(...o){r||(r=!0,t.packet({type:je.ACK,id:e,data:o}))}}onack(e){var t=this.acks[e.id];"function"==typeof t&&(t.apply(this,e.data),delete this.acks[e.id])}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:je.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(this._anyListeners)if(e){var t=this._anyListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(this._anyOutgoingListeners)if(e){var t=this._anyOutgoingListeners;for(let r=0;r<t.length;r++)if(e===t[r])return t.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length)for(const t of this._anyOutgoingListeners.slice())t.apply(this,e.data)}}function Do(e){this.ms=(e=e||{}).min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=0<e.jitter&&e.jitter<=1?e.jitter:0,this.attempts=0}Do.prototype.duration=function(){var e,t,r=this.ms*Math.pow(this.factor,this.attempts++);return this.jitter&&(e=Math.random(),t=Math.floor(e*this.jitter*r),r=0==(1&Math.floor(10*e))?r-t:r+t),0|Math.min(r,this.max)},Do.prototype.reset=function(){this.attempts=0},Do.prototype.setMin=function(e){this.ms=e},Do.prototype.setMax=function(e){this.max=e},Do.prototype.setJitter=function(e){this.jitter=e};class Fo extends Hr{constructor(e,t){super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,Xr(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!=(r=t.randomizationFactor)?r:.5),this.backoff=new Do({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;var r=t.parser||No;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null!=(t=this.backoff)&&t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null!=(t=this.backoff)&&t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null!=(t=this.backoff)&&t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(!~this._readyState.indexOf("open")){this.engine=new ko(this.uri,this.opts);const o=this.engine,s=this,n=(this._readyState="opening",this.skipReconnect=!1,Mo(o,"open",(function(){s.onopen(),e&&e()}))),i=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()};var t=Mo(o,"error",i);if(!1!==this._timeout){var r=this._timeout;const e=this.setTimeoutFn((()=>{n(),i(new Error("timeout")),o.close()}),r);this.opts.autoUnref&&e.unref(),this.subs.push((()=>{this.clearTimeoutFn(e)}))}this.subs.push(n),this.subs.push(t)}return this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");var e=this.engine;this.subs.push(Mo(e,"ping",this.onping.bind(this)),Mo(e,"data",this.ondata.bind(this)),Mo(e,"error",this.onerror.bind(this)),Mo(e,"close",this.onclose.bind(this)),Mo(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){go((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new qo(this,e,t),this.nsps[e]=r),r}_destroy(e){for(const e of Object.keys(this.nsps)){if(this.nsps[e].active)return}this._close()}_packet(e){var t=this.encoder.encode(e);for(let r=0;r<t.length;r++)this.engine.write(t[r],e.options)}cleanup(){this.subs.forEach((e=>e())),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{var t=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn((()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect)||e.open((t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()}))}),t);this.opts.autoUnref&&r.unref(),this.subs.push((()=>{this.clearTimeoutFn(r)}))}}onreconnect(){var e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Ho={};function Wo(e,t){"object"==typeof e&&(t=e,e=void 0);e=function(e,t="",r){let o=e;return r=r||"undefined"!=typeof location&&location,"string"==typeof(e=null==e?r.protocol+"//"+r.host:e)&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?r.protocol+e:r.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==r?r.protocol+"//"+e:"https://"+e),o=xo(e)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/",e=-1!==o.host.indexOf(":")?"["+o.host+"]":o.host,o.id=o.protocol+"://"+e+":"+o.port+t,o.href=o.protocol+"://"+e+(r&&r.port===o.port?"":":"+o.port),o}(e,(t=t||{}).path||"/socket.io");var r=e.source,o=e.id,s=e.path;s=Ho[o]&&s in Ho[o].nsps;let n;return n=(s=t.forceNew||t["force new connection"]||!1===t.multiplex||s)?new Fo(r,t):(Ho[o]||(Ho[o]=new Fo(r,t)),Ho[o]),e.query&&!t.query&&(t.query=e.queryKey),n.socket(e.path,t)}Object.assign(Wo,{Manager:Fo,Socket:qo,io:Wo,connect:Wo});const Go=ne("<style>"),Vo=ne('<div class="relative z-10" 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"></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 class="relative transform overflow-hidden rounded-lg text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg">'),Yo=ne("<div><pre>");const Xo=e=>{let t;const[r]=X(e,["onOpen","onClose","isOpen","value"]),[o,s]=($((()=>{t&&(t.innerHTML=function(e){return(e=(e="string"!=typeof e?JSON.stringify(e,void 0,2):e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")).replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)/g,(function(e){let t="number";return/^"/.test(e)?t=/:$/.test(e)?"key":"string":/true|false/.test(e)?t="boolean":/null/.test(e)&&(t="null"),'<span class="'+t+'">'+e+"</span>"}))}(JSON.stringify(e?.value,void 0,2)))})),_(r.isOpen??!1)),n=(S((()=>{_e(e.isOpen)||e.isOpen===o()||a()})),e=>{e.stopPropagation()}),i=()=>{s(!1),r.onClose?.(),document.body.style.overflow="auto"},a=()=>{o()?i():(s(!0),r.onOpen?.(),document.body.style.overflow="hidden")};return H(K,{get when(){return o()},get children(){return[(pe(s=Go(),ke),s),(s=Vo(),r=s.firstChild,o=r.nextSibling.nextSibling.firstChild.firstChild,s.style.setProperty("z-index","1100"),s.addEventListener("click",i),pe(r,ke),o.style.setProperty("background-color","transparent"),o.style.setProperty("margin-left","20px"),o.style.setProperty("margin-right","20px"),o.addEventListener("click",n),o.addEventListener("pointerdown",n),pe(o,(()=>{const r=A((()=>!!e.value));return()=>{return r()&&(o=(e=Yo()).firstChild,e.style.setProperty("background","white"),e.style.setProperty("margin","auto"),e.style.setProperty("padding","7px"),"function"==typeof(s=t)?he(s,o):t=o,e);var e,o,s}})()),s)];var r,o,s}})},Jo=ne('<button type="submit">'),Ko=e=>{return ce(t=Jo(),Y({get disabled(){return e.isDisabled||e.isLoading}},e,{get class(){return"py-2 px-4 justify-center font-semibold focus:outline-none flex items-center disabled:opacity-50 disabled:cursor-not-allowed disabled:brightness-100 transition-all filter hover:brightness-90 active:brightness-75 chatbot-button "+e.class},style:{background:"transparent",border:"none"}}),!1,!0),pe(t,H(ct,{get color(){return e.buttonColor}})),t;var t};let Qo,Zo="00:00";const es=1;let ts;function rs(e,t,r){ns.start().then((()=>{e&&e(!0),Qo=new Date,function(e){Zo="00:00",e(Zo),ts=setInterval((()=>{Zo=function(e){e=(new Date).getTime()-e.getTime();var t=(e/=1e3,Math.floor(e%60)),r=(e=Math.floor(e/60))%60,o=(e=Math.floor(e/60))%24;e=e=Math.floor(e/24),o+=24*e;return 0==o?ss(r,2)+":"+ss(t,2):ss(o,2)+":"+ss(r,2)+":"+ss(t,2)}(Qo),e(Zo),function(){var e=Zo.split(":"),t="0"+es;return 3===e.length&&e[0]===t}()&&os(null)}),1e3)}(r)})).catch((e=>{switch(e.message.includes("mediaDevices API or getUserMedia method is not supported in this browser.")&&t&&t(!0),console.log(e),e.name){case"AbortError":console.log("An AbortError has occurred.");break;case"NotAllowedError":console.log("A NotAllowedError has occurred. User might have denied permission.");break;case"NotFoundError":console.log("A NotFoundError has occurred.");break;case"NotReadableError":console.log("A NotReadableError has occurred.");break;case"SecurityError":console.log("A SecurityError has occurred.");break;case"TypeError":console.log("A TypeError has occurred.");break;case"InvalidStateError":console.log("An InvalidStateError has occurred.");break;case"UnknownError":console.log("An UnknownError has occurred.");break;default:console.log("An error occurred with the error name "+e.name)}}))}function os(e){ns.stop().then((t=>{clearInterval(ts),e&&e(t)})).catch((e=>{"InvalidStateError"===e.name?console.log("An InvalidStateError has occurred."):console.log("An error occurred with the error name "+e.name)}))}function ss(e,t){return(""+e).padStart(t,"0")}const ns={audioBlobs:[],mediaRecorder:null,streamBeingCaptured:null,start:function(){return navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?navigator.mediaDevices.getUserMedia({audio:!0}).then((e=>{ns.streamBeingCaptured=e,ns.mediaRecorder=new MediaRecorder(e),ns.audioBlobs=[],ns.mediaRecorder.addEventListener("dataavailable",(e=>{ns.audioBlobs.push(e.data)})),ns.mediaRecorder.start()})):Promise.reject(new Error("mediaDevices API or getUserMedia method is not supported in this browser."))},stop:function(){return new Promise((e=>{const t=ns.mediaRecorder?.mimeType;ns.mediaRecorder?.addEventListener("stop",(()=>{var r=new Blob(ns.audioBlobs,{type:t});e(r)})),ns.cancel()}))},cancel:function(){ns.mediaRecorder?.stop(),ns.stopStream(),ns.resetRecordingProperties()},stopStream:function(){ns.streamBeingCaptured?.getTracks().forEach((e=>e.stop()))},resetRecordingProperties:function(){ns.mediaRecorder=null,ns.streamBeingCaptured=null}},is=ne('<div class="w-full flex flex-row flex-wrap px-5 py-[10px] gap-2">'),as=ne('<div class="w-full flex items-center justify-start gap-2 px-5 pt-2 border-t border-[#eeeeee]">'),ls=ne('<div><div class="flex flex-col w-full h-full justify-start z-0"><div class="overflow-y-scroll flex flex-col flex-grow min-w-full w-full px-3 pt-[70px] relative scrollable-container chatbot-chat-view scroll-smooth"></div><div class="w-full px-5 pt-2 pb-1">'),cs=ne('<div class="absolute top-0 left-0 bottom-0 right-0 w-full h-full z-50">'),hs=ne('<div class="absolute top-0 left-0 bottom-0 right-0 flex flex-col items-center justify-center bg-black/60 backdrop-blur-sm text-white z-40 gap-2 border-2 border-dashed"><h2 class="text-xl font-semibold">Drop here to upload'),ps=ne("<span>"),ds=ne("<span>Max Allowed Size: <!> MB"),us=ne("<div>"),fs=ne('<span class="px-3 whitespace-pre-wrap font-semibold max-w-full">'),gs=ne("<span>Clear"),bs=ne('<div class="flex flex-row items-center w-full h-[50px] absolute top-0 left-0 z-10"><div>'),ws=ne('<button class="group w-12 h-12 flex items-center justify-center relative rounded-[10px] overflow-hidden transition-colors duration-200"><img class="w-full h-full bg-cover"><span class="absolute hidden group-hover:flex items-center justify-center z-10 w-full h-full top-0 left-0 bg-black/10 rounded-[10px] transition-colors duration-200">'),ms=ne('<div class="inline-flex basis-auto flex-grow-0 flex-shrink-0 justify-between items-center rounded-xl h-12 p-1 mr-1 bg-gray-500"><audio class="block bg-cover bg-center w-full h-full rounded-none text-transparent" controls></audio><button class="w-7 h-7 flex items-center justify-center bg-transparent p-1">'),ys=ne('<div class="w-full flex items-center justify-between p-4 border border-[#eeeeee]"><div class="w-full flex items-center justify-between gap-3"><span class="text-base">To record audio, use modern browsers like Chrome or Firefox that support audio recording.</span><button class="py-2 px-4 justify-center flex items-center bg-red-500 text-white rounded-md" type="button">Okay'),vs=ne("<span>Send"),xs=ne('<div class="h-[58px] flex items-center justify-between chatbot-input border border-[#eeeeee]" data-testid="input"><div class="flex items-center gap-3 px-4 py-2"><span></span><span></span></div><div class="flex items-center">'),ks=ne('<span class="ml-1.5">Sending...'),_s="Hi there! How can I help?",Cs=e=>{const t=Y({showTitle:!0},e);let r,o;const[s,n]=_(""),[i,a]=_(!1),[l,c]=_(!1),[h,p]=_({}),[d,u]=_([{message:t.welcomeMessage??_s,type:"apiMessage"}],{equals:!1}),[f,g]=_(""),[b,w]=_(!1),[m,y]=_(Ie()),[v,x]=_([],{equals:!1}),[k,T]=_(!1),[E,B]=_(),[R,O]=_([]),[L,j]=_("00:00"),[z,I]=_(!1),[N,M]=_(!1),[U,q]=_(!1),[D,F]=_(!1),W=($((()=>{if(e?.observersConfig){const{observeUserInput:t,observeLoading:r,observeMessages:o}=e.observersConfig;"function"==typeof t&&A((()=>{t(s())})),"function"==typeof r&&A((()=>{r(i())})),"function"==typeof o&&A((()=>{o(d())}))}})),()=>{setTimeout((()=>{r?.scrollTo(0,r.scrollHeight)}),50)}),G=e=>{localStorage.setItem(t.chatflowid+"_EXTERNAL",JSON.stringify({chatId:m(),chatHistory:e}))},V=(e,t,r=null,o=null)=>{u((s=>{var n=s.map(((n,i)=>i===s.length-1?{...n,message:n.message+e,messageId:t,sourceDocuments:r,fileAnnotations:o}:n));return G(n),[...n]}))},X=e=>{u((t=>{var r=t.map(((r,o)=>o===t.length-1?{...r,sourceDocuments:e}:r));return G(r),[...r]}))},Q=e=>{Z(e)},Z=async e=>{if(n(e),""===e.trim()){var r=0<R().filter((e=>"audio"===e.type)).length;if(!(1<=R().length&&r))return}a(!0),W();const o=t.welcomeMessage??_s;r=d().filter((e=>e.message!==o));const s=R().map((e=>({data:e.data,type:e.type,name:e.name,mime:e.mime})));R().forEach((e=>URL.revokeObjectURL(e.preview))),O([]),u((t=>(t=[...t,{message:e,type:"userMessage",fileUploads:s}],G(t),t)));r={question:e,history:r,chatId:m()},s&&0<s.length&&(r.uploads=s),t.chatflowConfig&&(r.overrideConfig=t.chatflowConfig),b()?r.socketIOClientId=f():u((e=>[...e,{message:"",type:"apiMessage"}])),r=await(({chatflowid:e,apiHost:t="http://localhost:3000",body:r})=>Se({method:"POST",url:t+"/api/v1/prediction/"+e,body:r}))({chatflowid:t.chatflowid,apiHost:t.apiHost,body:r});if(r.data){var i=r.data;const t=i.question;if(""===e&&t&&u((e=>{var r=e.map(((r,o)=>o===e.length-2?{...r,message:t}:r));return G(r),[...r]})),s&&0<s.length&&u((e=>{var t=e.map(((t,r)=>r===e.length-2&&t.fileUploads?(r=t?.fileUploads.map((e=>({type:e.type,name:e.name,mime:e.mime}))),{...t,fileUploads:r}):t));return G(t),[...t]})),b())V("",i?.chatMessageId,i?.sourceDocuments,i?.fileAnnotations);else{let e="";e=i.text||(i.json?JSON.stringify(i.json,null,2):JSON.stringify(i,null,2)),V(e,i?.chatMessageId,i?.sourceDocuments,i?.fileAnnotations)}a(!1),n(""),W()}r.error&&(i=r.error,console.error(i),((e="Oops! There seems to be an error. Please try again.")=>{u((t=>(t=[...t,{message:e,type:"apiMessage"}],G(t),t))),a(!1),n(""),W()})(r="string"==typeof i?i:i.response.data||i.response.status+": "+i.response.statusText))},ee=()=>{try{localStorage.removeItem(t.chatflowid+"_EXTERNAL"),y(Ie()),u([{message:t.welcomeMessage??_s,type:"apiMessage"}])}catch(t){var e=t.response.data||t.response.status+": "+t.response.statusText;console.error("error: "+e)}},te=(S((()=>{d()&&W()})),S((()=>{t.fontSize&&o&&(o.style.fontSize=t.fontSize+"px")})),S((async()=>{var e=((e=localStorage.getItem(t.chatflowid+"_EXTERNAL"))&&(e=JSON.parse(e),y(e.chatId),e=e.chatHistory.map((e=>{var t={messageId:e?.messageId,message:e.message,type:e.type};return e.sourceDocuments&&(t.sourceDocuments=e.sourceDocuments),e.fileAnnotations&&(t.fileAnnotations=e.fileAnnotations),e.fileUploads&&(t.fileUploads=e.fileUploads),t})),u([...e])),await(({chatflowid:e,apiHost:t="http://localhost:3000"})=>Se({method:"GET",url:t+"/api/v1/chatflows-streaming/"+e}))({chatflowid:t.chatflowid,apiHost:t.apiHost})).data;e&&w(e?.isStreaming??!1),e=await(({chatflowid:e,apiHost:t="http://localhost:3000"})=>Se({method:"GET",url:t+"/api/v1/public-chatbotConfig/"+e}))({chatflowid:t.chatflowid,apiHost:t.apiHost});if(e.data){const t=e.data;if(t.starterPrompts){const e=[];Object.getOwnPropertyNames(t.starterPrompts).forEach((r=>{e.push(t.starterPrompts[r].prompt)})),x(e)}t.chatFeedback&&(e=t.chatFeedback.status,T(e)),t.uploads&&B(t.uploads)}const r=Wo(t.apiHost);return r.on("connect",(()=>{g(r.id)})),r.on("start",(()=>{u((e=>[...e,{message:"",type:"apiMessage"}]))})),r.on("sourceDocuments",X),r.on("token",V),()=>{n(""),a(!1),u([{message:t.welcomeMessage??_s,type:"apiMessage"}]),r&&(r.disconnect(),g(""))}})),e=>{try{return new URL(e)}catch(e){}}),re=e=>{const t=e.type.substring(0,e.type.indexOf(";")),r=new FileReader;r.readAsDataURL(e),r.onloadend=()=>{const e={data:r.result,preview:"../assets/wave-sound.jpg",type:"audio",name:"audio.wav",mime:t};O((t=>[...t,e]))}},oe=e=>{let t=!1;if(E()&&E()?.isImageUploadAllowed&&E()?.imgUploadSizeAndTypes){const r=e.type,o=e.size/1024/1024;E()?.imgUploadSizeAndTypes.map((e=>{e.fileTypes.includes(r)&&o<=e.maxUploadSize&&(t=!0)}))}return t||alert("Cannot upload file. Kindly check the allowed file types and maximum allowed size."),t},se=async e=>{if((e=e.target.files)&&0!==e.length){var t=[];for(const r of e){if(!1===oe(r))return;const e=new FileReader,o=r.name;t.push(new Promise((t=>{e.onload=e=>{e?.target?.result&&(e=e.target.result,t({data:e,preview:URL.createObjectURL(r),type:"file",name:o,mime:r.type}))},e.readAsDataURL(r)})))}const r=await Promise.all(t);O((e=>[...e,...r]))}},ne=e=>{E()?.isImageUploadAllowed&&(e.preventDefault(),e.stopPropagation(),"dragenter"===e.type||"dragover"===e.type?F(!0):"dragleave"===e.type&&F(!1))},ie=async e=>{if(E()?.isImageUploadAllowed){e.preventDefault(),F(!1);var t=[];if(e.dataTransfer&&0<e.dataTransfer.files.length){for(const r of e.dataTransfer.files){if(!1===oe(r))return;const e=new FileReader,o=r.name;t.push(new Promise((t=>{e.onload=e=>{if(e?.target?.result){let s;e=e.target.result,r.type.startsWith("audio/")?s="../assets/wave-sound.jpg":r.type.startsWith("image/")&&(s=URL.createObjectURL(r)),t({data:e,preview:s,type:"file",name:o,mime:r.type})}},e.readAsDataURL(r)})))}const r=await Promise.all(t);O((e=>[...e,...r]))}if(e.dataTransfer&&e.dataTransfer.items)for(const t of e.dataTransfer.items)"string"===t.kind&&t.type.match("^text/uri-list")?t.getAsString((e=>{const t={data:e,preview:e,type:"url",name:e.substring(e.lastIndexOf("/")+1),mime:""};O((e=>[...e,t]))})):"string"===t.kind&&t.type.match("^text/html")&&t.getAsString((e=>{if(-1!==e.indexOf("href")){const t={data:e=(e=e.substring(e.indexOf("href")+6)).substring(0,e.indexOf('"')),preview:e,type:"url",name:e.substring(e.lastIndexOf("/")+1),mime:""};O((e=>[...e,t]))}}))}},ce=e=>{"file"===e.type&&URL.revokeObjectURL(e.preview),O(R().filter((t=>t!==e)))},de=()=>{I(!0),rs(I,M,j)},ue=()=>{N||(ns.cancel(),clearInterval(ts)),I(!1),M(!1)},fe=async()=>{q(!0),os(re)};return S(function(e,t,r){const o=Array.isArray(e);let s,n=r&&r.defer;return r=>{let i;if(o){i=Array(e.length);for(let t=0;t<e.length;t++)i[t]=e[t]()}else i=e();var a;if(!n)return a=P((()=>t(i,s,r))),s=i,a;n=!1}}(R,(e=>{var t=0<e.filter((e=>"audio"===e.type)).length;return 1<=e.length&&t&&(I(!1),M(!1),Q("")),()=>{O([])}}))),[(()=>{const n=ls(),a=n.firstChild,l=a.firstChild,h=l.nextSibling;n.addEventListener("dragenter",ne);var u=("function"==typeof(u=o)?he(u,n):o=n,pe(n,(()=>{const e=A((()=>!!D()));return()=>{return e()&&((t=cs()).addEventListener("drop",ie),t.addEventListener("dragover",ne),t.addEventListener("dragend",ne),t.addEventListener("dragleave",ne),t.addEventListener("dragenter",ne),t);var t}})(),a),pe(n,(()=>{const e=A((()=>!(!D()||!E()?.isImageUploadAllowed)));return()=>e()&&(()=>{const e=hs();return e.firstChild,pe(e,H(J,{get each(){return E()?.imgUploadSizeAndTypes},children:e=>{return[(pe(r=ps(),(()=>e.fileTypes?.join(", "))),r),(r=ds(),(t=r.firstChild.nextSibling).nextSibling,pe(r,(()=>e.maxUploadSize),t),r)];var t,r}}),null),C((()=>null!=t.bubbleBackgroundColor?e.style.setProperty("border-color",t.bubbleBackgroundColor):e.style.removeProperty("border-color"))),e})()})(),a),pe(n,(()=>{const e=A((()=>!!t.showTitle));return()=>{if(e()){const e=bs(),r=e.firstChild;return pe(e,H(K,{get when(){return t.titleAvatarSrc},get children(){return[((e=us()).style.setProperty("width","15px"),e),H(Rt,{get initialAvatarSrc(){return t.titleAvatarSrc}})];var e}}),r),pe(e,H(K,{get when(){return t.title},get children(){var e=fs();return pe(e,(()=>t.title)),e}}),r),r.style.setProperty("flex","1"),pe(e,H(ut,{get sendButtonColor(){return t.bubbleTextColor},type:"button",get isDisabled(){return 1===d().length},class:"my-2 ml-2","on:click":ee,get children(){var e=gs();return e.style.setProperty("font-family","Poppins, sans-serif"),e}}),null),C((r=>{var o=t.bubbleBackgroundColor,s=t.bubbleTextColor,n=t.isFullPage?"0px":"6px",i=t.isFullPage?"0px":"6px";return o!==r._v$&&(null!=(r._v$=o)?e.style.setProperty("background",o):e.style.removeProperty("background")),s!==r._v$2&&(null!=(r._v$2=s)?e.style.setProperty("color",s):e.style.removeProperty("color")),n!==r._v$3&&(null!=(r._v$3=n)?e.style.setProperty("border-top-left-radius",n):e.style.removeProperty("border-top-left-radius")),i!==r._v$4&&(null!=(r._v$4=i)?e.style.setProperty("border-top-right-radius",i):e.style.removeProperty("border-top-right-radius")),r}),{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),e}return null}})(),a),r);return"function"==typeof u?he(u,l):r=l,pe(l,H(J,{get each(){return[...d()]},children:(e,r)=>[A((()=>{const r=A((()=>"userMessage"===e.type));return()=>r()&&H(Qt,{message:e,get apiHost(){return t.apiHost},get chatflowid(){return t.chatflowid},get chatId(){return m()},get backgroundColor(){return t.userMessage?.backgroundColor},get textColor(){return t.userMessage?.textColor},get showAvatar(){return t.userMessage?.showAvatar},get avatarSrc(){return t.userMessage?.avatarSrc},get fontSize(){return t.fontSize}})})()),A((()=>{const r=A((()=>"apiMessage"===e.type));return()=>r()&&H(pr,{message:e,get fileAnnotations(){return e.fileAnnotations},get chatflowid(){return t.chatflowid},get chatId(){return m()},get apiHost(){return t.apiHost},get backgroundColor(){return t.botMessage?.backgroundColor},get textColor(){return t.botMessage?.textColor},get showAvatar(){return t.botMessage?.showAvatar},get avatarSrc(){return t.botMessage?.avatarSrc},get chatFeedbackStatus(){return k()},get fontSize(){return t.fontSize}})})()),A((()=>{const t=A((()=>!("userMessage"!==e.type||!i()||r()!==d().length-1)));return()=>t()&&H(gr,{})})()),A((()=>{const t=A((()=>!("apiMessage"!==e.type||""!==e.message||!i()||r()!==d().length-1)));return()=>t()&&H(gr,{})})()),A((()=>{const t=A((()=>!(!e.sourceDocuments||!e.sourceDocuments.length)));return()=>{return t()&&((r=us()).style.setProperty("display","flex"),r.style.setProperty("flex-direction","row"),r.style.setProperty("width","100%"),r.style.setProperty("flex-wrap","wrap"),pe(r,H(J,{get each(){return[...(e=>{const t=[],r=[];return e.sourceDocuments.forEach((e=>{te(e.metadata.source)&&!t.includes(e.metadata.source)?(t.push(e.metadata.source),r.push(e)):te(e.metadata.source)||r.push(e)})),r})(e)]},children:e=>{const t=te(e.metadata.source);return H(wr,{get pageContent(){return t?t.pathname:e.pageContent},get metadata(){return e.metadata},onSourceClick:()=>{t?window.open(e.metadata.source,"_blank"):(p(e),c(!0))}})}})),r);var r}})())]})),pe(a,H(K,{get when(){return 1===d().length},get children(){return H(K,{get when(){return 0<v().length},get children(){var e=is();return pe(e,H(J,{get each(){return[...v()]},children:e=>H(yr,{prompt:e,onPromptClick:()=>Q(e)})})),e}})}}),h),pe(a,H(K,{get when(){return 0<R().length},get children(){var t=as();return pe(t,H(J,{get each(){return[...R()]},children:t=>A((()=>{const o=A((()=>!!t.mime.startsWith("image/")));return()=>(o()?()=>{const e=ws(),r=e.firstChild,o=r.nextSibling;return e.$$click=()=>ce(t),pe(o,H(at,{})),C((()=>ae(r,"src",t.data))),e}:()=>{const o=ms(),s=o.firstChild,n=s.nextSibling;return n.$$click=()=>ce(t),pe(n,H(at,{color:"white"})),C((n=>{var i=`${r?e.isFullPage?r?.offsetWidth/4:r?.offsetWidth/2:"200"}px`,a=t.data;return i!==n._v$5&&(null!=(n._v$5=i)?o.style.setProperty("width",i):o.style.removeProperty("width")),a!==n._v$6&&ae(s,"src",n._v$6=a),n}),{_v$5:void 0,_v$6:void 0}),o})()})())})),t}}),h),pe(h,(()=>{const e=A((()=>!!z()));return()=>e()?A((()=>{const e=A((()=>!!N()));return()=>{if(e())return(r=ys()).firstChild.firstChild.nextSibling.$$click=()=>ue(),r;{const e=xs(),r=e.firstChild,o=r.firstChild,s=o.nextSibling,n=r.nextSibling;return e.style.setProperty("margin","auto"),pe(o,H(Ze,{color:"red"})),pe(s,(()=>L()||"00:00")),pe(r,(()=>{const e=A((()=>!!U()));return()=>e()&&ks()})(),null),pe(n,H(Ko,{get buttonColor(){return t.textInput?.sendButtonColor},type:"button",class:"m-0","on:click":ue,get children(){var e=vs();return e.style.setProperty("font-family","Poppins, sans-serif"),e}}),null),pe(n,H(dt,{get sendButtonColor(){return t.textInput?.sendButtonColor},type:"button",get isDisabled(){return i()},class:"m-0","on:click":fe,get children(){var e=vs();return e.style.setProperty("font-family","Poppins, sans-serif"),e}}),null),C((r=>{var o=t.textInput?.backgroundColor??"#ffffff",s=t.textInput?.textColor??"#303235";return o!==r._v$7&&(null!=(r._v$7=o)?e.style.setProperty("background-color",o):e.style.removeProperty("background-color")),s!==r._v$8&&(null!=(r._v$8=s)?e.style.setProperty("color",s):e.style.removeProperty("color")),r}),{_v$7:void 0,_v$8:void 0}),e}var r}})()):H($t,{get backgroundColor(){return t.textInput?.backgroundColor},get textColor(){return t.textInput?.textColor},get placeholder(){return t.textInput?.placeholder},get sendButtonColor(){return t.textInput?.sendButtonColor},get fontSize(){return t.fontSize},get disabled(){return i()},get defaultValue(){return s()},onSubmit:Z,get uploadsConfig(){return E()},setPreviews:O,onMicrophoneClicked:de,handleFileChange:se})})()),pe(a,H(kr,{get badgeBackgroundColor(){return t.badgeBackgroundColor},get poweredByTextColor(){return t.poweredByTextColor},botContainer:o}),null),C((()=>le(n,"relative flex w-full h-full text-base overflow-hidden bg-cover bg-center flex-col items-center chatbot-container "+t.class))),n})(),A((()=>{const e=A((()=>!!l()));return()=>e()&&H(Xo,{get isOpen(){return l()},get value(){return h()},onClose:()=>c(!1)})})())]},Ss=(ie(["click"]),ne("<style>")),As=ne('<div part="bot">'),Ps=e=>{const[t]=X(e,["theme"]),[r,o]=_(!1),[s,n]=_(!1);var i;return T((()=>{n(!1)})),[(pe(i=Ss(),ke),i),H(Te,Y((()=>t.theme?.button),{toggleBot:()=>{r()?o(!1):(s()||n(!0),o(!0))},get isBotOpened(){return r()}})),(()=>{const o=As();return o.style.setProperty("transition","transform 200ms cubic-bezier(0, 1.2, 1, 1), opacity 150ms ease-out"),o.style.setProperty("transform-origin","bottom right"),o.style.setProperty("box-shadow","rgb(0 0 0 / 16%) 0px 5px 40px"),o.style.setProperty("z-index","42424242"),pe(o,H(K,{get when(){return s()},get children(){return H(Cs,{get badgeBackgroundColor(){return t.theme?.chatWindow?.backgroundColor},get bubbleBackgroundColor(){return t.theme?.button?.backgroundColor??"#3B81F6"},get bubbleTextColor(){return t.theme?.button?.iconColor??"white"},get showTitle(){return t.theme?.chatWindow?.showTitle},get title(){return t.theme?.chatWindow?.title},get titleAvatarSrc(){return t.theme?.chatWindow?.titleAvatarSrc},get welcomeMessage(){return t.theme?.chatWindow?.welcomeMessage},get poweredByTextColor(){return t.theme?.chatWindow?.poweredByTextColor},get textInput(){return t.theme?.chatWindow?.textInput},get botMessage(){return t.theme?.chatWindow?.botMessage},get userMessage(){return t.theme?.chatWindow?.userMessage},get fontSize(){return t.theme?.chatWindow?.fontSize},get chatflowid(){return e.chatflowid},get chatflowConfig(){return e.chatflowConfig},get apiHost(){return e.apiHost},get observersConfig(){return e.observersConfig}})}})),C((s=>{var n=t.theme?.chatWindow?.height?t.theme?.chatWindow?.height.toString()+"px":"calc(100% - 100px)",i=t.theme?.chatWindow?.width?t.theme?.chatWindow?.width.toString()+"px":void 0,a=r()?"scale3d(1, 1, 1)":"scale3d(0, 0, 1)",l=t.theme?.chatWindow?.backgroundColor||"#ffffff",c="fixed sm:right-5 rounded-lg w-full sm:w-[400px] max-h-[704px]"+(r()?" opacity-1":" opacity-0 pointer-events-none")+("large"===e.theme?.button?.size?" bottom-24":" bottom-20");return n!==s._v$&&(null!=(s._v$=n)?o.style.setProperty("height",n):o.style.removeProperty("height")),i!==s._v$2&&(null!=(s._v$2=i)?o.style.setProperty("width",i):o.style.removeProperty("width")),a!==s._v$3&&(null!=(s._v$3=a)?o.style.setProperty("transform",a):o.style.removeProperty("transform")),l!==s._v$4&&(null!=(s._v$4=l)?o.style.setProperty("background-color",l):o.style.removeProperty("background-color")),c!==s._v$5&&le(o,s._v$5=c),s}),{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0,_v$5:void 0}),o})()]},$s=ne("<style>"),Ts=ne("<div>"),Es=(e,{element:t})=>{const[r,o]=_(!1),s=new IntersectionObserver((e=>{e.some((e=>e.isIntersecting))&&o(!0)}));return $((()=>{s.observe(t)})),T((()=>{s.disconnect()})),[(pe(n=$s(),ke),n),H(K,{get when(){return r()},get children(){const t=Ts();return t.style.setProperty("margin","0px"),pe(t,H(Cs,{get badgeBackgroundColor(){return e.theme?.chatWindow?.backgroundColor},get bubbleBackgroundColor(){return e.theme?.button?.backgroundColor??"#3B81F6"},get bubbleTextColor(){return e.theme?.button?.iconColor??"white"},get showTitle(){return e.theme?.chatWindow?.showTitle},get title(){return e.theme?.chatWindow?.title},get titleAvatarSrc(){return e.theme?.chatWindow?.titleAvatarSrc},get welcomeMessage(){return e.theme?.chatWindow?.welcomeMessage},get poweredByTextColor(){return e.theme?.chatWindow?.poweredByTextColor},get textInput(){return e.theme?.chatWindow?.textInput},get botMessage(){return e.theme?.chatWindow?.botMessage},get userMessage(){return e.theme?.chatWindow?.userMessage},get fontSize(){return e.theme?.chatWindow?.fontSize},get chatflowid(){return e.chatflowid},get chatflowConfig(){return e.chatflowConfig},get apiHost(){return e.apiHost},isFullPage:!0,get observersConfig(){return e.observersConfig}})),C((r=>{var o=e.theme?.chatWindow?.backgroundColor||"#ffffff",s=e.theme?.chatWindow?.height?e.theme?.chatWindow?.height.toString()+"px":"100vh",n=e.theme?.chatWindow?.width?e.theme?.chatWindow?.width.toString()+"px":"100%";return o!==r._v$&&(null!=(r._v$=o)?t.style.setProperty("background-color",o):t.style.removeProperty("background-color")),s!==r._v$2&&(null!=(r._v$2=s)?t.style.setProperty("height",s):t.style.removeProperty("height")),n!==r._v$3&&(null!=(r._v$3=n)?t.style.setProperty("width",n):t.style.removeProperty("width")),r}),{_v$:void 0,_v$2:void 0,_v$3:void 0}),t}})];var n};let Bs;const Rs=e=>{Ls();var t=e.id?document.getElementById(e.id):document.querySelector("flowise-fullchatbot");if(!t)throw new Error("<flowise-fullchatbot> element not found.");Object.assign(t,e),Bs=t},Os=e=>{Ls();var t=document.createElement("flowise-chatbot");Object.assign(t,e),document.body.appendChild(t),Bs=t},Ls=()=>{Bs?.remove()},js=("undefined"!=typeof window&&(ve("flowise-fullchatbot",xe,Es),ve("flowise-chatbot",xe,Ps)),{initFull:Rs,init:Os,destroy:Ls});(e=>{"undefined"!=typeof window&&(window.Chatbot={...e})})(js);export{js as default};