-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathweb2.js
More file actions
1 lines (1 loc) · 120 KB
/
Copy pathweb2.js
File metadata and controls
1 lines (1 loc) · 120 KB
1
function t(t){return Object.keys(t).reduce(((e,r)=>{var o=t[r];return e[r]=Object.assign({},o),!s(o.value)||function(t){return"[object Function]"===Object.prototype.toString.call(t)}(o.value)||Array.isArray(o.value)||(e[r].value=Object.assign({},o.value)),Array.isArray(o.value)&&(e[r].value=o.value.slice(0)),e}),{})}function e(t){if(t)try{return JSON.parse(t)}catch(e){return t}}function r(t,e,r){if(null==r||!1===r)return t.removeAttribute(e);let s=JSON.stringify(r);t.__updating[e]=!0,"true"===s&&(s=""),t.setAttribute(e,s),Promise.resolve().then((()=>delete t.__updating[e]))}function s(t){return null!=t&&("object"==typeof t||"function"==typeof t)}let o;function n(s,n){const i=Object.keys(n);return class extends s{static get observedAttributes(){return i.map((t=>n[t].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(s,o){const n=t(o);return Object.keys(o).forEach((t=>{const o=n[t],i=s.getAttribute(o.attribute),a=s[t];i&&(o.value=o.parse?e(i):i),null!=a&&(o.value=Array.isArray(a)?a.slice(0):a),o.reflect&&r(s,o.attribute,o.value),Object.defineProperty(s,t,{get:()=>o.value,set(e){var s=o.value;o.value=e,o.reflect&&r(this,o.attribute,o.value);for(let r=0,o=this.__propertyChangedCallbacks.length;r<o;r++)this.__propertyChangedCallbacks[r](t,e,s)},enumerable:!0,configurable:!0})})),n}(this,n);var s=function(t){return Object.keys(t).reduce(((e,r)=>(e[r]=t[r].value,e)),{})}(this.props),i=this.Component,a=o;try{(o=this).__initialized=!0,function(t){return"function"==typeof t&&0===t.toString().indexOf("class")}(i)?new i(s,{element:this}):i(s,{element:this})}finally{o=a}}}async disconnectedCallback(){if(await Promise.resolve(),!this.isConnected){this.__propertyChangedCallbacks.length=0;for(var t=null;t=this.__releaseCallbacks.pop();)t(this);delete this.__initialized,this.__released=!0}}attributeChangedCallback(t,r,s){!this.__initialized||this.__updating[t]||(t=this.lookupProp(t))in n&&(null==s&&!this[t]||(this[t]=n[t].parse?e(s):s))}lookupProp(t){if(n)return i.find((e=>t===e||t===n[e].attribute))}get renderRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}addReleaseCallback(t){this.__releaseCallbacks.push(t)}addPropertyChangedCallback(t){this.__propertyChangedCallbacks.push(t)}}}function i(t,e={},r={}){const{BaseElement:o=HTMLElement,extension:i}=r;return r=>{if(!t)throw new Error("tag is required to register a Component");let a=customElements.get(t);return a?a.prototype.Component=r:((a=n(o,function(t){return t?Object.keys(t).reduce(((e,r)=>{var o=t[r];return e[r]=s(o)&&"value"in o?o:{value:o},e[r].attribute||(e[r].attribute=function(t){return t.replace(/\.?([A-Z]+)/g,((t,e)=>"-"+e.toLowerCase())).replace("_","-").replace(/^-/,"")}(r)),e[r].parse="parse"in e[r]?e[r].parse:"string"!=typeof e[r].value,e}),{}):{}}(e))).prototype.Component=r,a.prototype.registeredTag=t,customElements.define(t,a,i)),a}}const a=Symbol("solid-proxy"),l=Symbol("solid-track"),c={equals:(t,e)=>t===e};let h=L;const u=1,p=2,d={owned:null,cleanups:null,context:null,owner:null};var f=null;let g=null,y=null,b=null,m=null,w=0;function v(t,e){const r=y,s=f,o=0===t.length,n=o?d:{owned:null,cleanups:null,context:null,owner:void 0===e?s:e},i=o?t:()=>t((()=>P((()=>z(n)))));f=n,y=null;try{return B(i,!0)}finally{y=r,f=s}}function x(t,e){const r={value:t,observers:null,observerSlots:null,comparator:(e=e?Object.assign({},c,e):c).equals||void 0};return[A.bind(r),t=>("function"==typeof t&&(t=t(r.value)),O(r,t))]}function k(t,e,r){E(R(t,e,!1,u))}function _(t,e,r){h=j,(t=R(t,e,!1,u)).user=!0,m?m.push(t):E(t)}function C(t,e,r){return r=r?Object.assign({},c,r):c,(t=R(t,e,!0,0)).observers=null,t.observerSlots=null,t.comparator=r.equals||void 0,E(t),A.bind(t)}function P(t){if(null===y)return t();var e=y;y=null;try{return t()}finally{y=e}}function S(t){_((()=>P(t)))}function $(t){return null!==f&&(null===f.cleanups?f.cleanups=[t]:f.cleanups.push(t)),t}function A(){var t;return this.sources&&this.state&&(this.state===u?E(this):(t=b,b=null,B((()=>N(this)),!1),b=t)),y&&(t=this.observers?this.observers.length:0,y.sources?(y.sources.push(this),y.sourceSlots.push(t)):(y.sources=[this],y.sourceSlots=[t]),this.observers?(this.observers.push(y),this.observerSlots.push(y.sources.length-1)):(this.observers=[y],this.observerSlots=[y.sources.length-1])),this.value}function O(t,e,r){var s=t.value;return t.comparator&&t.comparator(s,e)||(t.value=e,t.observers&&t.observers.length&&B((()=>{for(let s=0;s<t.observers.length;s+=1){var e=t.observers[s],r=g&&g.running;r&&g.disposed.has(e),(r?e.tState:e.state)||((e.pure?b:m).push(e),e.observers&&M(e)),r||(e.state=u)}if(1e6<b.length)throw b=[],new Error}),!1)),e}function E(t){var e,r,s;t.fn&&(z(t),e=f,r=y,s=w,function(t,e,r){let s;try{s=t.fn(e)}catch(e){return t.pure&&(t.state=u,t.owned&&t.owned.forEach(z),t.owned=null),t.updatedAt=r+1,I(e)}(!t.updatedAt||t.updatedAt<=r)&&(null!=t.updatedAt&&"observers"in t?O(t,s):t.value=s,t.updatedAt=r)}(y=f=t,t.value,s),y=r,f=e)}function R(t,e,r,s=u,o){return t={fn:t,state:s,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:e,owner:f,context:null,pure:r},null!==f&&f!==d&&(f.owned?f.owned.push(t):f.owned=[t]),t}function T(t){if(0!==t.state){if(t.state===p)return N(t);if(t.suspense&&P(t.suspense.inFallback))return t.suspense.effects.push(t);const r=[t];for(;(t=t.owner)&&(!t.updatedAt||t.updatedAt<w);)t.state&&r.push(t);for(let s=r.length-1;0<=s;s--){var e;(t=r[s]).state===u?E(t):t.state===p&&(e=b,b=null,B((()=>N(t,r[0])),!1),b=e)}}}function B(t,e){if(b)return t();let r=!1;e||(b=[]),m?r=!0:m=[],w++;try{var s=t();return function(t){if(b&&(L(b),b=null),!t){const t=m;m=null,t.length&&B((()=>h(t)),!1)}}(r),s}catch(t){r||(m=null),b=null,I(t)}}function L(t){for(let e=0;e<t.length;e++)T(t[e])}function j(t){let e,r=0;for(e=0;e<t.length;e++){var s=t[e];s.user?t[r++]=s:T(s)}for(e=0;e<r;e++)T(t[e])}function N(t,e){for(let o=t.state=0;o<t.sources.length;o+=1){var r,s=t.sources[o];s.sources&&((r=s.state)===u?s!==e&&(!s.updatedAt||s.updatedAt<w)&&T(s):r===p&&N(s,e))}}function M(t){for(let r=0;r<t.observers.length;r+=1){var e=t.observers[r];e.state||(e.state=p,(e.pure?b:m).push(e),e.observers&&M(e))}}function z(t){let e;if(t.sources)for(;t.sources.length;){var r,s,o=t.sources.pop(),n=t.sourceSlots.pop(),i=o.observers;i&&i.length&&(r=i.pop(),s=o.observerSlots.pop(),n<i.length)&&(i[r.sourceSlots[s]=n]=r,o.observerSlots[n]=s)}if(t.owned){for(e=t.owned.length-1;0<=e;e--)z(t.owned[e]);t.owned=null}if(t.cleanups){for(e=t.cleanups.length-1;0<=e;e--)t.cleanups[e]();t.cleanups=null}t.state=0,t.context=null}function I(t){throw t}const q=Symbol("fallback");function D(t){for(let e=0;e<t.length;e++)t[e]()}function F(t,e){return P((()=>t(e||{})))}function H(){return!0}const G={get:(t,e,r)=>e===a?r:t.get(e),has:(t,e)=>e===a||t.has(e),set:H,deleteProperty:H,getOwnPropertyDescriptor:(t,e)=>({configurable:!0,enumerable:!0,get:()=>t.get(e),set:H,deleteProperty:H}),ownKeys:t=>t.keys()};function W(t){return(t="function"==typeof t?t():t)||{}}function U(...t){let e=!1;for(let s=0;s<t.length;s++){var r=t[s];e=e||!!r&&a in r,t[s]="function"==typeof r?(e=!0,C(r)):r}if(e)return new Proxy({get(e){for(let s=t.length-1;0<=s;s--){var r=W(t[s])[e];if(void 0!==r)return r}},has(e){for(let r=t.length-1;0<=r;r--)if(e in W(t[r]))return!0;return!1},keys(){var e=[];for(let r=0;r<t.length;r++)e.push(...Object.keys(W(t[r])));return[...new Set(e)]}},G);var s={};for(let e=t.length-1;0<=e;e--)if(t[e])for(const r in Object.getOwnPropertyDescriptors(t[e]))r in s||Object.defineProperty(s,r,{enumerable:!0,get(){for(let s=t.length-1;0<=s;s--){var e=(t[s]||{})[r];if(void 0!==e)return e}}});return s}function V(t,...e){const r=new Set(e.flat());var s;if(a in t)return(s=e.map((e=>new Proxy({get:r=>e.includes(r)?t[r]:void 0,has:r=>e.includes(r)&&r in t,keys:()=>e.filter((e=>e in t))},G)))).push(new Proxy({get:e=>r.has(e)?void 0:t[e],has:e=>!r.has(e)&&e in t,keys:()=>Object.keys(t).filter((t=>!r.has(t)))},G)),s;const o=Object.getOwnPropertyDescriptors(t);return e.push(Object.keys(o).filter((t=>!r.has(t)))),e.map((e=>{var r={};for(let s=0;s<e.length;s++){const n=e[s];n in t&&Object.defineProperty(r,n,o[n]||{get:()=>t[n],set:()=>!0,enumerable:!0})}return r}))}const Y=t=>`Stale read from <${t}>.`;function K(t){var e="fallback"in t&&{fallback:()=>t.fallback};return C(function(t,e,r={}){let s=[],o=[],n=[],i=0,a=1<e.length?[]:null;return $((()=>D(n))),()=>{let c,h,u=t()||[];return u[l],P((()=>{let t,e,l,d,f,g,y,b,m,w=u.length;if(0===w)0!==i&&(D(n),n=[],s=[],o=[],i=0,a=a&&[]),r.fallback&&(s=[q],o[0]=v((t=>(n[0]=t,r.fallback()))),i=1);else if(0===i){for(o=new Array(w),h=0;h<w;h++)s[h]=u[h],o[h]=v(p);i=w}else{for(l=new Array(w),d=new Array(w),a&&(f=new Array(w)),g=0,y=Math.min(i,w);g<y&&s[g]===u[g];g++);for(y=i-1,b=w-1;y>=g&&b>=g&&s[y]===u[b];y--,b--)l[b]=o[y],d[b]=n[y],a&&(f[b]=a[y]);for(t=new Map,e=new Array(b+1),h=b;h>=g;h--)m=u[h],c=t.get(m),e[h]=void 0===c?-1:c,t.set(m,h);for(c=g;c<=y;c++)m=s[c],void 0!==(h=t.get(m))&&-1!==h?(l[h]=o[c],d[h]=n[c],a&&(f[h]=a[c]),h=e[h],t.set(m,h)):n[c]();for(h=g;h<w;h++)h in l?(o[h]=l[h],n[h]=d[h],a&&(a[h]=f[h],a[h](h))):o[h]=v(p);o=o.slice(0,i=w),s=u.slice(0)}return o}));function p(t){var r;return n[h]=t,a?([t,r]=x(h),a[h]=r,e(u[h],t)):e(u[h])}}}((()=>t.each),t.children,e||void 0))}function X(t){const e=t.keyed,r=C((()=>t.when),void 0,{equals:(t,r)=>e?t===r:!t==!r});return C((()=>{const s=r();if(s){const o=t.children;return"function"==typeof o&&0<o.length?P((()=>o(e?s:()=>{if(P(r))return t.when;throw Y("Show")}))):o}return t.fallback}),void 0,void 0)}const J=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"]),Q=new Set(["innerHTML","textContent","innerText","children"]),Z=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),tt=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 et=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),rt={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};const st="_$DX_DELEGATE";function ot(t,e,r){let s;const o=()=>{var e=document.createElement("template");return e.innerHTML=t,(r?e.content.firstChild:e.content).firstChild};return(e=e?()=>(s=s||o()).cloneNode(!0):()=>P((()=>document.importNode(s=s||o(),!0)))).cloneNode=e}function nt(t,e=window.document){var r=e[st]||(e[st]=new Set);for(let o=0,n=t.length;o<n;o++){var s=t[o];r.has(s)||(r.add(s),e.addEventListener(s,ft))}}function it(t,e,r){null==r?t.removeAttribute(e):t.setAttribute(e,r)}function at(t,e){null==e?t.removeAttribute("class"):t.className=e}function lt(t,e,r,s){if(s)Array.isArray(r)?(t["$$"+e]=r[0],t[`$$${e}Data`]=r[1]):t["$$"+e]=r;else if(Array.isArray(r)){const s=r[0];t.addEventListener(e,r[0]=e=>s.call(t,r[1],e))}else t.addEventListener(e,r)}function ct(t,e={},r,s){const o={};return s||k((()=>o.children=gt(t,e.children,o.children))),k((()=>e.ref&&e.ref(t))),k((()=>function(t,e,r,s,o={},n=!1){e=e||{};for(const s in o)s in e||"children"!==s&&(o[s]=dt(t,s,null,o[s],r,n));for(const a in e){var i;"children"===a?s||gt(t,e.children):(i=e[a],o[a]=dt(t,a,i,o[a],r,n))}}(t,e,r,!0,o,!0))),o}function ht(t,e,r){return P((()=>t(e,r)))}function ut(t,e,r,s){if(void 0!==r&&(s=s||[]),"function"!=typeof e)return gt(t,e,s,r);k((s=>gt(t,e(),s,r)),s)}function pt(t,e,r){var s=e.trim().split(/\s+/);for(let e=0,o=s.length;e<o;e++)t.classList.toggle(s[e],r)}function dt(t,e,r,s,o,n){let i,a,l,c,h;var u;return"style"===e?function(t,e,r){if(!e)return r?it(t,"style"):e;var s=t.style;if("string"==typeof e)return s.cssText=e;let o,n;for(n in"string"==typeof r&&(s.cssText=r=void 0),e=e||{},r=r||{})null==e[n]&&s.removeProperty(n),delete r[n];for(n in e)(o=e[n])!==r[n]&&(s.setProperty(n,o),r[n]=o);return r}(t,r,s):"classList"===e?function(t,e,r={}){var s=Object.keys(e||{}),o=Object.keys(r);let n,i;for(n=0,i=o.length;n<i;n++){var a=o[n];a&&"undefined"!==a&&!e[a]&&(pt(t,a,!1),delete r[a])}for(n=0,i=s.length;n<i;n++){var l=s[n],c=!!e[l];l&&"undefined"!==l&&r[l]!==c&&c&&(pt(t,l,!0),r[l]=c)}return r}(t,r,s):r===s?s:("ref"===e?n||r(t):"on:"===e.slice(0,3)?(n=e.slice(3),s&&t.removeEventListener(n,s),r&&t.addEventListener(n,r)):"oncapture:"===e.slice(0,10)?(n=e.slice(10),s&&t.removeEventListener(n,s,!0),r&&t.addEventListener(n,r,!0)):"on"===e.slice(0,2)?(n=e.slice(2).toLowerCase(),!(u=et.has(n))&&s&&(s=Array.isArray(s)?s[0]:s,t.removeEventListener(n,s)),(u||r)&&(lt(t,n,r,u),u)&&nt([n])):"attr:"===e.slice(0,5)?it(t,e.slice(5),r):(h="prop:"===e.slice(0,5))||(l=Q.has(e))||!o&&((c=function(t,e){return"object"==typeof(t=tt[t])?t[e]?t.$:void 0:t}(e,t.tagName))||(a=J.has(e)))||(i=t.nodeName.includes("-"))?(h&&(e=e.slice(5),a=!0),"class"===e||"className"===e?at(t,r):!i||a||l?t[c||e]=r:t[function(t){return t.toLowerCase().replace(/-([a-z])/g,((t,e)=>e.toUpperCase()))}(e)]=r):(s=o&&-1<e.indexOf(":")&&rt[e.split(":")[0]])?function(t,e,r,s){null==s?t.removeAttributeNS(e,r):t.setAttributeNS(e,r,s)}(t,s,e,r):it(t,Z[e]||e,r),r)}function ft(t){var e="$$"+t.type;let r=t.composedPath&&t.composedPath()[0]||t.target;for(t.target!==r&&Object.defineProperty(t,"target",{configurable:!0,value:r}),Object.defineProperty(t,"currentTarget",{configurable:!0,get:()=>r||document});r;){var s=r[e];if(s&&!r.disabled){var o=r[e+"Data"];if(void 0!==o?s.call(r,o,t):s.call(r,t),t.cancelBubble)return}r=r._$host||r.parentNode||r.host}}function gt(t,e,r,s,o){for(;"function"==typeof r;)r=r();if(e!==r){var n=typeof e,i=void 0!==s;if(t=i&&r[0]&&r[0].parentNode||t,"string"==n||"number"==n)if("number"==n&&(e=e.toString()),i){let o=r[0];o&&3===o.nodeType?o.data=e:o=document.createTextNode(e),r=mt(t,r,s,o)}else r=""!==r&&"string"==typeof r?t.firstChild.data=e:t.textContent=e;else if(null==e||"boolean"==n)r=mt(t,r,s);else{if("function"==n)return k((()=>{let o=e();for(;"function"==typeof o;)o=o();r=gt(t,o,r,s)})),()=>r;if(Array.isArray(e)){const a=[];if(n=r&&Array.isArray(r),yt(a,e,r,o))return k((()=>r=gt(t,a,r,s,!0))),()=>r;if(0===a.length){if(r=mt(t,r,s),i)return r}else n?0===r.length?bt(t,a,s):function(t,e,r){let s=r.length,o=e.length,n=s,i=0,a=0,l=e[o-1].nextSibling,c=null;for(;i<o||a<n;)if(e[i]===r[a])i++,a++;else{for(;e[o-1]===r[n-1];)o--,n--;if(o===i)for(var h=n<s?a?r[a-1].nextSibling:r[n-a]:l;a<n;)t.insertBefore(r[a++],h);else if(n===a)for(;i<o;)c&&c.has(e[i])||e[i].remove(),i++;else if(e[i]===r[n-1]&&r[a]===e[o-1]){var u=e[--o].nextSibling;t.insertBefore(r[a++],e[i++].nextSibling),t.insertBefore(r[--n],u),e[o]=r[n]}else{if(!c){c=new Map;let t=a;for(;t<n;)c.set(r[t],t++)}var p=c.get(e[i]);if(null!=p)if(a<p&&p<n){let s,l=i,h=1;for(;++l<o&&l<n&&null!=(s=c.get(e[l]))&&s===p+h;)h++;if(h>p-a)for(var d=e[i];a<p;)t.insertBefore(r[a++],d);else t.replaceChild(r[a++],e[i++])}else i++;else e[i++].remove()}}}(t,r,a):(r&&mt(t),bt(t,a));r=a}else if(e instanceof Node){if(Array.isArray(r)){if(i)return r=mt(t,r,s,e);mt(t,r,null,e)}else null!=r&&""!==r&&t.firstChild?t.replaceChild(e,t.firstChild):t.appendChild(e);r=e}else console.warn("Unrecognized value. Skipped inserting",e)}}return r}function yt(t,e,r,s){let o=!1;for(let i=0,a=e.length;i<a;i++){let a=e[i],l=r&&r[i];if(a instanceof Node)t.push(a);else if(null!=a&&!0!==a&&!1!==a)if(Array.isArray(a))o=yt(t,a,l)||o;else if("function"==typeof a)if(s){for(;"function"==typeof a;)a=a();o=yt(t,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o}else t.push(a),o=!0;else{var n=String(a);l&&3===l.nodeType?(l.data=n,t.push(l)):t.push(document.createTextNode(n))}}return o}function bt(t,e,r=null){for(let s=0,o=e.length;s<o;s++)t.insertBefore(e[s],r)}function mt(t,e,r,s){if(void 0===r)return t.textContent="";var o=s||document.createTextNode("");if(e.length){let s=!1;for(let a=e.length-1;0<=a;a--){var n,i=e[a];o!==i?(n=i.parentNode===t,s||a?n&&i.remove():n?t.replaceChild(o,i):t.insertBefore(o,r)):s=!0}}else t.insertBefore(o,r);return[o]}function wt(t){return(e,r)=>{const s=r.element;return v((o=>{const n=function(t){var e=Object.keys(t),r={};for(let s=0;s<e.length;s++){const[o,n]=x(t[e[s]]);Object.defineProperty(r,e[s],{get:o,set(t){n((()=>t))}})}return r}(e);s.addPropertyChangedCallback(((t,e)=>n[t]=e)),s.addReleaseCallback((()=>{s.renderRoot.textContent="",o()}));var i=t(n,r);return ut(s.renderRoot,i)}),function(t){if(t.assignedSlot&&t.assignedSlot._$owner)return t.assignedSlot._$owner;let e=t.parentNode;for(;e&&!e._$owner&&(!e.assignedSlot||!e.assignedSlot._$owner);)e=e.parentNode;return(e&&e.assignedSlot?e.assignedSlot:t)._$owner}(s))}}function vt(t,e,r){return 2===arguments.length&&(r=e,e={}),i(t,e)(wt(r))}const xt={chatflowid:"",apiHost:void 0,chatflowConfig:void 0,theme:void 0};var kt,_t,Ct='/*! 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: }.pointer-events-none{pointer-events:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.bottom-20{bottom:80px}.bottom-24{bottom:96px}.left-0{left:0}.top-0{top:0}.z-10{z-index:10}.my-2{margin-bottom:8px;margin-top:8px}.-ml-1{margin-left:-4px}.mb-2{margin-bottom:8px}.ml-1{margin-left:4px}.ml-2{margin-left:8px}.mr-1{margin-right:4px}.mr-2{margin-right:8px}.mr-3{margin-right:12px}.block{display:block}.inline-block{display:inline-block}.flex{display: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-5{height:20px}.h-6{height:24px}.h-7{height:28px}.h-9{height:36px}.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-5{width:20px}.w-6{width:24px}.w-7{width:28px}.w-9{width:36px}.w-full{width:100%}.min-w-full{min-width:100%}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.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-col{flex-direction:column}.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}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-y-scroll{overflow-y:scroll}.scroll-smooth{scroll-behavior:smooth}.whitespace-pre-wrap{white-space:pre-wrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:8px}.border{border-width:1px}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.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-4{padding:16px}.px-2{padding-left:8px;padding-right:8px}.px-3{padding-left:12px;padding-right:12px}.px-4{padding-left:16px;padding-right:16px}.py-1{padding-bottom:4px;padding-top:4px}.py-2{padding-bottom:8px;padding-top:8px}.py-4{padding-bottom:16px;padding-top:16px}.pt-10{padding-top:40px}.text-left{text-align:left}.text-center{text-align:center}.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-semibold{font-weight:600}.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-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)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-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-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.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}.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{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)}.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\\: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\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.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\\: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)}@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 Pt=t=>null==t,St=t=>null!=t,$t=async t=>{try{var e="string"==typeof t?t:t.url,r=await fetch(e,{method:"string"==typeof t?"GET":t.method,mode:"cors",headers:"string"!=typeof t&&St(t.body)?{"Content-Type":"application/json"}:void 0,body:"string"!=typeof t&&St(t.body)?JSON.stringify(t.body):void 0});let o;var s=r.headers.get("Content-Type");if(o=s&&s.includes("application/json")?await r.json():await r.text(),r.ok)return{data:o};{let t;throw t="object"==typeof o&&"error"in o?o.error:o||r.statusText}}catch(t){return console.error(t),{error:t}}},At=ot('<button part="button"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-eraser" width="28" height="28" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" color="white"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M19 20h-10.5l-4.21 -4.3a1 1 0 0 1 0 -1.41l10 -10a1 1 0 0 1 1.41 0l5 5a1 1 0 0 1 0 1.41l-9.2 9.3"></path><path d="M18 13.3l-6.3 -6.3">'),Ot=ot('<button part="button"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-arrows-maximize" width="28" height="28" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" color="white" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><polyline points="16 4 20 4 20 8"></polyline><line x1="14" y1="10" x2="20" y2="4"></line><polyline points="8 20 4 20 4 16"></polyline><line x1="4" y1="20" x2="10" y2="14"></line><polyline points="16 20 20 20 20 16"></polyline><line x1="14" y1="14" x2="20" y2="20"></line><polyline points="8 4 4 4 4 8"></polyline><line x1="4" y1="4" x2="10" y2="10">'),Et=ot('<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">'),Rt=ot('<img alt="Bubble button icon">'),Tt=ot('<button part="button"><svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" width="24" height="24" stroke-width="2" stroke="currentColor" color="white" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18">'),Bt=t=>[C((()=>{const e=C((()=>!t.ismodalopenClose()));return()=>{if(e()){const e=Tt(),r=e.firstChild;return e.$$click=()=>t.toggleBot(),e.style.setProperty("z-index","424242"),ut(e,F(X,{get when(){return Pt(t.customIconSrc)},keyed:!0,get children(){const e=Et();return k((r=>{var s=t.iconColor??"white",o="stroke-2 fill-transparent absolute duration-200 transition "+(t.isBotOpened?"scale-0 opacity-0":"scale-100 opacity-100")+("large"===t.size?" w-9":" w-7");return s!==r._v$7&&(null!=(r._v$7=s)?e.style.setProperty("stroke",s):e.style.removeProperty("stroke")),o!==r._v$8&&it(e,"class",r._v$8=o),r}),{_v$7:void 0,_v$8:void 0}),e}}),r),ut(e,F(X,{get when(){return t.customIconSrc},get children(){const e=Rt();return k((r=>{var s=t.customIconSrc,o="rounded-full object-cover"+(t.isBotOpened?"scale-0 opacity-0":"scale-100 opacity-100")+("large"===t.size?" w-9 h-9":" w-7 h-7");return s!==r._v$9&&it(e,"src",r._v$9=s),o!==r._v$10&&at(e,r._v$10=o),r}),{_v$9:void 0,_v$10:void 0}),e}}),r),k((s=>{var o="fixed shadow-md rounded-full hover:scale-110 active:scale-95 transition-transform duration-200 flex justify-center items-center animate-fade-in "+("large"===t.size?" w-16 h-16":" w-12 h-12"),n=t.backgroundColor??"#3B81F6",i=t.right?t.right.toString()+"px":"20px",a=t.bottom?t.bottom.toString()+"px":"20px",l=t.iconColor??"white",c=t.isBotOpened?"icon icon-tabler icon-tabler-x":"scale-0";return o!==s._v$11&&at(e,s._v$11=o),n!==s._v$12&&(null!=(s._v$12=n)?e.style.setProperty("background-color",n):e.style.removeProperty("background-color")),i!==s._v$13&&(null!=(s._v$13=i)?e.style.setProperty("right",i):e.style.removeProperty("right")),a!==s._v$14&&(null!=(s._v$14=a)?e.style.setProperty("bottom",a):e.style.removeProperty("bottom")),l!==s._v$15&&(null!=(s._v$15=l)?r.style.setProperty("fill",l):r.style.removeProperty("fill")),c!==s._v$16&&it(r,"class",s._v$16=c),s}),{_v$11:void 0,_v$12:void 0,_v$13:void 0,_v$14:void 0,_v$15:void 0,_v$16:void 0}),e}return""}})()),F(X,{get when(){return t.isBotOpened},get children(){return[(()=>{const e=At();return e.$$click=()=>t.isClearmessage(),e.style.setProperty("background-color","#F44336"),e.style.setProperty("z-index","4242"),k((r=>{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"===t.size?" w-16 h-16":" w-12 h-12"),o=(t.right,"80px"),n=t.bottom?t.bottom.toString()+"px":"20px";return s!==r._v$&&at(e,r._v$=s),o!==r._v$2&&(r._v$2=o,e.style.setProperty("right",o)),n!==r._v$3&&(null!=(r._v$3=n)?e.style.setProperty("bottom",n):e.style.removeProperty("bottom")),r}),{_v$:void 0,_v$2:void 0,_v$3:void 0}),e})(),(()=>{const e=Ot();return e.$$click=()=>t.ismodalopen(),e.style.setProperty("background-color","#673AB7"),e.style.setProperty("z-index","424242"),k((r=>{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"===t.size?" w-16 h-16":" w-12 h-12"),o=(t.right,"140px"),n=t.bottom?t.bottom.toString()+"px":"20px";return s!==r._v$4&&at(e,r._v$4=s),o!==r._v$5&&(r._v$5=o,e.style.setProperty("right",o)),n!==r._v$6&&(null!=(r._v$6=n)?e.style.setProperty("bottom",n):e.style.removeProperty("bottom")),r}),{_v$4:void 0,_v$5:void 0,_v$6:void 0}),e})()]}})],Lt=(nt(["click"]),({chatflowid:t,apiHost:e="http://localhost:3000",body:r})=>$t({method:"POST",url:e+"/api/v1/prediction/"+t,body:r})),jt=ot('<input class="focus:outline-none bg-transparent px-4 py-4 flex-1 w-full text-input" type="text">'),Nt=t=>{const[e,r]=V(t,["ref","onInput"]);return(s=jt()).$$input=t=>e.onInput(t.currentTarget.value),"function"==typeof(o=t.ref)?ht(o,s):t.ref=s,ct(s,U({get style(){return{"font-size":t.fontSize?t.fontSize+"px":"16px"}}},r),!1,!1),s;var s,o},Mt=(nt(["input"]),ot('<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">')),zt=t=>{return ct(e=Mt(),U({get style(){return{fill:t.color??"#3B81F6"}}},t),!0,!0),e;var e},It=ot('<button type="submit">'),qt=ot('<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=t=>{return ct(e=It(),U({get disabled(){return t.isDisabled||t.isLoading}},t,{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 "+t.class},style:{background:"transparent",border:"none"}}),!1,!0),ut(e,F(X,{get when(){return!t.isLoading},get fallback(){return F(Ft,{class:"text-white"})},get children(){return F(zt,{get color(){return t.sendButtonColor},get class(){return"send-icon flex "+(t.disableIcon?"hidden":"")}})}})),e;var e},Ft=t=>{return ct(e=qt(),U(t,{get class(){return"animate-spin -ml-1 mr-3 h-5 w-5 "+t.class},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","data-testid":"loading-spinner"}),!0,!0),e;var e},[Ht,Gt]=x(),Wt=ot("<span>Send"),Ut=ot('<div class="flex items-end justify-between chatbot-input" data-testid="input">'),Vt=t=>{const[e,r]=x(t.defaultValue??"");let s;const o=t=>r(t),n=()=>{""!==e()&&s?.reportValidity()&&t.onSubmit(e()),r("")},i=t=>{var e=t.isComposing||229===t.keyCode;"Enter"!==t.key||e||n()};S((()=>{!Ht()&&s&&s.focus()}));{const r=Ut();return r.$$keydown=i,r.style.setProperty("border-top","1px solid #eeeeee"),r.style.setProperty("position","absolute"),r.style.setProperty("left","20px"),r.style.setProperty("right","20px"),r.style.setProperty("bottom","40px"),r.style.setProperty("margin","auto"),r.style.setProperty("z-index","1000"),ut(r,F(Nt,{ref(t){"function"==typeof s?s(t):s=t},onInput:o,get value(){return e()},get fontSize(){return t.fontSize},get placeholder(){return t.placeholder??"请问高新申报有什么要求?"}}),null),ut(r,F(Dt,{get sendButtonColor(){return t.sendButtonColor},type:"button",get isDisabled(){return""===e()},class:"my-2 ml-2","on:click":n,get children(){var t=Wt();return t.style.setProperty("font-family","Poppins, sans-serif"),t}}),null),k((e=>{var s=t.backgroundColor??"#ffffff",o=t.textColor??"#303235";return s!==e._v$&&(null!=(e._v$=s)?r.style.setProperty("background-color",s):r.style.removeProperty("background-color")),o!==e._v$2&&(null!=(e._v$2=o)?r.style.setProperty("color",o):r.style.removeProperty("color")),e}),{_v$:void 0,_v$2:void 0}),r}},Yt=(nt(["keydown"]),ot('<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">')),Kt=()=>{{const t=Yt(),e=t.firstChild;return k((r=>{var s="flex justify-center items-center rounded-full text-white relative "+(Ht()?"w-6 h-6 text-sm":"w-10 h-10 text-xl"),o="absolute top-0 left-0 "+(Ht()?" w-6 h-6 text-sm":"w-full h-full text-xl");return s!==r._v$&&at(t,r._v$=s),o!==r._v$2&&it(e,"class",r._v$2=o),r}),{_v$:void 0,_v$2:void 0}),t}},Xt=ot('<figure><img alt="Bot avatar" class="rounded-full object-cover w-full h-full">'),Jt=t=>{const[e,r]=x(t.initialAvatarSrc);return _((()=>{e()?.startsWith("{{")&&t.initialAvatarSrc?.startsWith("http")&&r(t.initialAvatarSrc)})),F(X,{get when(){return(t=>null!=t&&""!==t)(e())},keyed:!0,get fallback(){return F(Kt,{})},get children(){const t=Xt(),r=t.firstChild;return k((s=>{var o="flex justify-center items-center rounded-full text-white relative flex-shrink-0 "+(Ht()?"w-6 h-6 text-sm":"w-10 h-10 text-xl"),n=e();return o!==s._v$&&at(t,s._v$=o),n!==s._v$2&&it(r,"src",s._v$2=n),s}),{_v$:void 0,_v$2:void 0}),t}})};class Qt{constructor(t,e=""){this.source=t.source,this.flags=e}setGroup(t,e){let r="string"==typeof e?e:e.source;return r=r.replace(/(^|[^\[])\^/g,"$1"),this.source=this.source.replace(t,r),this}getRegexp(){return new RegExp(this.source,this.flags)}}const Zt=/[&<>"']/,te=/[&<>"']/g,ee={"&":"&","<":"<",">":">",'"':""","'":"'"},re=/[<>"']|&(?!#?\w+;)/,se=/[<>"']|&(?!#?\w+;)/g;function oe(t,e){if(e){if(Zt.test(t))return t.replace(te,(t=>ee[t]))}else if(re.test(t))return t.replace(se,(t=>ee[t]));return t}function ne(t){return t.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,(function(t,e){return"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""}))}var ie;(ie=kt=kt||{})[ie.space=1]="space",ie[ie.text=2]="text",ie[ie.paragraph=3]="paragraph",ie[ie.heading=4]="heading",ie[ie.listStart=5]="listStart",ie[ie.listEnd=6]="listEnd",ie[ie.looseItemStart=7]="looseItemStart",ie[ie.looseItemEnd=8]="looseItemEnd",ie[ie.listItemStart=9]="listItemStart",ie[ie.listItemEnd=10]="listItemEnd",ie[ie.blockquoteStart=11]="blockquoteStart",ie[ie.blockquoteEnd=12]="blockquoteEnd",ie[ie.code=13]="code",ie[ie.table=14]="table",ie[ie.html=15]="html",ie[ie.hr=16]="hr";class ae{constructor(t){this.options=t||he.options}code(t,e,r,s){this.options.highlight&&null!=(o=this.options.highlight(t,e))&&o!==t&&(r=!0,t=o);var o=r?t:this.options.escape(t,!0);return e?`\n<pre><code class="${this.options.langPrefix+this.options.escape(e,!0)}">${o}\n</code></pre>\n`:`\n<pre><code>${o}\n</code></pre>\n`}blockquote(t){return`<blockquote>\n${t}</blockquote>\n`}html(t){return t}heading(t,e,r){return`<h${e} id="${this.options.headerPrefix+r.toLowerCase().replace(/[^\w]+/g,"-")}">${t}</h${e}>\n`}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(t,e){return`\n<${e=e?"ol":"ul"}>\n${t}</${e}>\n`}listitem(t){return"<li>"+t+"</li>\n"}paragraph(t){return"<p>"+t+"</p>\n"}table(t,e){return`\n<table>\n<thead>\n${t}</thead>\n<tbody>\n${e}</tbody>\n</table>\n`}tablerow(t){return"<tr>\n"+t+"</tr>\n"}tablecell(t,e){var r=e.header?"th":"td";return(e.align?"<"+r+' style="text-align:'+e.align+'">':"<"+r+">")+t+"</"+r+">\n"}strong(t){return"<strong>"+t+"</strong>"}em(t){return"<em>"+t+"</em>"}codespan(t){return"<code>"+t+"</code>"}br(){return this.options.xhtml?"<br/>":"<br>"}del(t){return"<del>"+t+"</del>"}link(t,e,r){if(this.options.sanitize){let s;try{s=decodeURIComponent(this.options.unescape(t)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return r}if(0===s.indexOf("javascript:")||0===s.indexOf("vbscript:")||0===s.indexOf("data:"))return r}let s='<a href="'+t+'"';return e&&(s+=' title="'+e+'"'),s+">"+r+"</a>"}image(t,e,r){let s='<img src="'+t+'" alt="'+r+'"';return e&&(s+=' title="'+e+'"'),s+(this.options.xhtml?"/>":">")}text(t){return t}}class le{constructor(t,e,r=he.options,s){if(this.staticThis=t,this.links=e,this.options=r,this.renderer=s||this.options.renderer||new ae(this.options),!this.links)throw new Error("InlineLexer requires 'links' parameter.");this.setRules()}static output(t,e,r){return new this(this,e,r).output(t)}static getRulesBase(){var t;return this.rulesBase||((t={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 Qt(t.link).setGroup("inside",t._inside).setGroup("href",t._href).getRegexp(),t.reflink=new Qt(t.reflink).setGroup("inside",t._inside).getRegexp(),this.rulesBase=t)}static getRulesPedantic(){return this.rulesPedantic||(this.rulesPedantic=Object.assign(Object.assign({},this.getRulesBase()),{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}))}static getRulesGfm(){var t,e,r;return this.rulesGfm||(t=this.getRulesBase(),e=new Qt(t.escape).setGroup("])","~|])").getRegexp(),r=new Qt(t.text).setGroup("]|","~]|").setGroup("|","|https?://|").getRegexp(),this.rulesGfm=Object.assign(Object.assign({},t),{escape:e,url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:r}))}static getRulesBreaks(){var t,e;return this.rulesBreaks||(t=this.getRulesGfm(),e=this.getRulesGfm(),this.rulesBreaks=Object.assign(Object.assign({},e),{br:new Qt(t.br).setGroup("{2,}","*").getRegexp(),text:new Qt(e.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(t){let e,r="";for(;t;)if(e=this.rules.escape.exec(t))t=t.substring(e[0].length),r+=e[1];else if(e=this.rules.autolink.exec(t)){let s,o;t=t.substring(e[0].length),o="@"===e[2]?(s=this.options.escape(":"===e[1].charAt(6)?this.mangle(e[1].substring(7)):this.mangle(e[1])),this.mangle("mailto:")+s):s=this.options.escape(e[1]),r+=this.renderer.link(o,null,s)}else if(!this.inLink&&this.hasRulesGfm&&(e=this.rules.url.exec(t)))t=t.substring(e[0].length),s=this.options.escape(e[1]),r+=this.renderer.link(s,null,s);else if(e=this.rules.tag.exec(t))!this.inLink&&/^<a /i.test(e[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(e[0])&&(this.inLink=!1),t=t.substring(e[0].length),r+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(e[0]):this.options.escape(e[0]):e[0];else if(e=this.rules.link.exec(t))t=t.substring(e[0].length),this.inLink=!0,r+=this.outputLink(e,{href:e[2],title:e[3]}),this.inLink=!1;else if(e=(e=this.rules.reflink.exec(t))||this.rules.nolink.exec(t)){t=t.substring(e[0].length);var s=(e[2]||e[1]).replace(/\s+/g," "),o=this.links[s.toLowerCase()];o&&o.href?(this.inLink=!0,r+=this.outputLink(e,o),this.inLink=!1):(r+=e[0].charAt(0),t=e[0].substring(1)+t)}else if(e=this.rules.strong.exec(t))t=t.substring(e[0].length),r+=this.renderer.strong(this.output(e[2]||e[1]));else if(e=this.rules.em.exec(t))t=t.substring(e[0].length),r+=this.renderer.em(this.output(e[2]||e[1]));else if(e=this.rules.code.exec(t))t=t.substring(e[0].length),r+=this.renderer.codespan(this.options.escape(e[2].trim(),!0));else if(e=this.rules.br.exec(t))t=t.substring(e[0].length),r+=this.renderer.br();else if(this.hasRulesGfm&&(e=this.rules.del.exec(t)))t=t.substring(e[0].length),r+=this.renderer.del(this.output(e[1]));else if(e=this.rules.text.exec(t))t=t.substring(e[0].length),r+=this.renderer.text(this.options.escape(this.smartypants(e[0])));else if(t)throw new Error("Infinite loop on byte: "+t.charCodeAt(0));return r}outputLink(t,e){var r=this.options.escape(e.href);e=e.title?this.options.escape(e.title):null;return"!"!==t[0].charAt(0)?this.renderer.link(r,e,this.output(t[1])):this.renderer.image(r,e,this.options.escape(t[1]))}smartypants(t){return this.options.smartypants?t.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):t}mangle(t){if(!this.options.mangle)return t;let e="";var r=t.length;for(let s=0;s<r;s++){let r;.5<Math.random()&&(r="x"+t.charCodeAt(s).toString(16)),e+="&#"+r+";"}return e}}le.rulesBase=null,le.rulesPedantic=null,le.rulesGfm=null,le.rulesBreaks=null;class ce{constructor(t){this.simpleRenderers=[],this.line=0,this.tokens=[],this.token=null,this.options=t||he.options,this.renderer=this.options.renderer||new ae(this.options)}static parse(t,e,r){return new this(r).parse(e,t)}parse(t,e){this.inlineLexer=new le(le,t,this.options,this.renderer),this.tokens=e.reverse();let r="";for(;this.next();)r+=this.tok();return r}debug(t,e){this.inlineLexer=new le(le,t,this.options,this.renderer),this.tokens=e.reverse();let r="";for(;this.next();){var s=this.tok();this.token.line=this.line+=s.split("\n").length-1,r+=s}return r}next(){return this.token=this.tokens.pop()}getNextElement(){return this.tokens[this.tokens.length-1]}parseText(){let t=this.token.text;for(var e;(e=this.getNextElement())&&e.type==kt.text;)t+="\n"+this.next().text;return this.inlineLexer.output(t)}tok(){switch(this.token.type){case kt.space:return"";case kt.paragraph:return this.renderer.paragraph(this.inlineLexer.output(this.token.text));case kt.text:return this.options.isNoP?this.parseText():this.renderer.paragraph(this.parseText());case kt.heading:return this.renderer.heading(this.inlineLexer.output(this.token.text),this.token.depth,this.token.text);case kt.listStart:{let e="";for(var t=this.token.ordered;this.next().type!=kt.listEnd;)e+=this.tok();return this.renderer.list(e,t)}case kt.listItemStart:{let t="";for(;this.next().type!=kt.listItemEnd;)t+=this.token.type==kt.text?this.parseText():this.tok();return this.renderer.listitem(t)}case kt.looseItemStart:{let t="";for(;this.next().type!=kt.listItemEnd;)t+=this.tok();return this.renderer.listitem(t)}case kt.code:return this.renderer.code(this.token.text,this.token.lang,this.token.escaped,this.token.meta);case kt.table:{t="";let s,o="";s="";for(let t=0;t<this.token.header.length;t++){var e={header:!0,align:this.token.align[t]},r=this.inlineLexer.output(this.token.header[t]);s+=this.renderer.tablecell(r,e)}t+=this.renderer.tablerow(s);for(const t of this.token.cells){s="";for(let e=0;e<t.length;e++)s+=this.renderer.tablecell(this.inlineLexer.output(t[e]),{header:!1,align:this.token.align[e]});o+=this.renderer.tablerow(s)}return this.renderer.table(t,o)}case kt.blockquoteStart:{let t="";for(;this.next().type!=kt.blockquoteEnd;)t+=this.tok();return this.renderer.blockquote(t)}case kt.hr:return this.renderer.hr();case kt.html:return t=this.token.pre||this.options.pedantic?this.token.text:this.inlineLexer.output(this.token.text),this.renderer.html(t);default:if(this.simpleRenderers.length)for(let t=0;t<this.simpleRenderers.length;t++)if(this.token.type=="simpleRule"+(t+1))return this.simpleRenderers[t].call(this.renderer,this.token.execArr);if(t=`Token with "${this.token.type}" type was not found.`,!this.options.silent)throw new Error(t);console.log(t)}}}class he{static setOptions(t){return Object.assign(this.options,t),this}static setBlockRule(t,e=(()=>"")){return ue.simpleRules.push(t),this.simpleRenderers.push(e),this}static parse(t,e=this.options){try{var{tokens:r,links:s}=this.callBlockLexer(t,e);return this.callParser(r,s,e)}catch(t){return this.callMe(t)}}static debug(t,e=this.options){var{tokens:t,links:r}=this.callBlockLexer(t,e);let s=t.slice();return(e=new ce(e)).simpleRenderers=this.simpleRenderers,e=e.debug(r,t),{tokens:s=s.map((t=>{t.type=kt[t.type]||t.type;var e=t.line;return delete t.line,e?Object.assign({line:e},t):t})),links:r,result:e}}static callBlockLexer(t="",e){if("string"!=typeof t)throw new Error(`Expected that the 'src' parameter would have a 'string' type, got '${typeof t}'`);return t=t.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n").replace(/^ +$/gm,""),ue.lex(t,e,!0)}static callParser(t,e,r){var s;return this.simpleRenderers.length?((s=new ce(r)).simpleRenderers=this.simpleRenderers,s.parse(e,t)):ce.parse(t,e,r)}static callMe(t){if(t.message+="\nPlease report this to https://github.com/ts-stack/markdown",this.options.silent)return"<p>An error occured:</p><pre>"+this.options.escape(t.message+"",!0)+"</pre>";throw t}}he.options=new class{constructor(){this.gfm=!0,this.tables=!0,this.breaks=!1,this.pedantic=!1,this.sanitize=!1,this.mangle=!0,this.smartLists=!1,this.silent=!1,this.langPrefix="lang-",this.smartypants=!1,this.headerPrefix="",this.xhtml=!1,this.escape=oe,this.unescape=ne}},he.simpleRenderers=[];class ue{constructor(t,e){this.staticThis=t,this.links={},this.tokens=[],this.options=e||he.options,this.setRules()}static lex(t,e,r,s){return new this(this,e).getTokens(t,r,s)}static getRulesBase(){var t,e;return this.rulesBase||((t={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 Qt(t.item,"gm").setGroup(/bull/g,t.bullet).getRegexp(),t.list=new Qt(t.list).setGroup(/bull/g,t.bullet).setGroup("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))").setGroup("def","\\n+(?="+t.def.source+")").getRegexp(),e="(?!(?: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",t.html=new Qt(t.html).setGroup("comment",/<!--[\s\S]*?-->/).setGroup("closed",/<(tag)[\s\S]+?<\/\1>/).setGroup("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/).setGroup(/tag/g,e).getRegexp(),t.paragraph=new Qt(t.paragraph).setGroup("hr",t.hr).setGroup("heading",t.heading).setGroup("lheading",t.lheading).setGroup("blockquote",t.blockquote).setGroup("tag","<"+e).setGroup("def",t.def).getRegexp(),this.rulesBase=t)}static getRulesGfm(){var t,e,r,s;return this.rulesGfm||(t=this.getRulesBase(),r=(e=Object.assign(Object.assign({},t),{fences:/^ *(`{3,}|~{3,})[ \.]*((\S+)? *[^\n]*)\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/})).fences.source.replace("\\1","\\2"),s=t.list.source.replace("\\1","\\3"),e.paragraph=new Qt(t.paragraph).setGroup("(?!",`(?!${r}|${s}|`).getRegexp(),this.rulesGfm=e)}static getRulesTable(){return this.rulesTables||(this.rulesTables=Object.assign(Object.assign({},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(t,e,r){let s,o=t;t:for(;o;)if((s=this.rules.newline.exec(o))&&(o=o.substring(s[0].length),1<s[0].length)&&this.tokens.push({type:kt.space}),s=this.rules.code.exec(o)){o=o.substring(s[0].length);var n=s[0].replace(/^ {4}/gm,"");this.tokens.push({type:kt.code,text:this.options.pedantic?n:n.replace(/\n+$/,"")})}else if(this.hasRulesGfm&&(s=this.rules.fences.exec(o)))o=o.substring(s[0].length),this.tokens.push({type:kt.code,meta:s[2],lang:s[3],text:s[4]||""});else if(s=this.rules.heading.exec(o))o=o.substring(s[0].length),this.tokens.push({type:kt.heading,depth:s[1].length,text:s[2]});else if(e&&this.hasRulesTables&&(s=this.rules.nptable.exec(o))){o=o.substring(s[0].length);var i={type:kt.table,header:s[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:[]};for(let t=0;t<i.align.length;t++)/^ *-+: *$/.test(i.align[t])?i.align[t]="right":/^ *:-+: *$/.test(i.align[t])?i.align[t]="center":/^ *:-+ *$/.test(i.align[t])?i.align[t]="left":i.align[t]=null;var a=s[3].replace(/\n$/,"").split("\n");for(let t=0;t<a.length;t++)i.cells[t]=a[t].split(/ *\| */);this.tokens.push(i)}else if(s=this.rules.lheading.exec(o))o=o.substring(s[0].length),this.tokens.push({type:kt.heading,depth:"="===s[2]?1:2,text:s[1]});else if(s=this.rules.hr.exec(o))o=o.substring(s[0].length),this.tokens.push({type:kt.hr});else if(s=this.rules.blockquote.exec(o))o=o.substring(s[0].length),this.tokens.push({type:kt.blockquoteStart}),n=s[0].replace(/^ *> ?/gm,""),this.getTokens(n),this.tokens.push({type:kt.blockquoteEnd});else if(s=this.rules.list.exec(o)){o=o.substring(s[0].length);var l,c=s[2],h=(this.tokens.push({type:kt.listStart,ordered:1<c.length}),s[0].match(this.rules.item)),u=h.length;let t,e=!1;for(let s=0;s<u;s++){let n=h[s];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||s===u-1||c===(l=this.staticThis.getRulesBase().bullet.exec(h[s+1])[0])||1<c.length&&1<l.length||(o=h.slice(s+1).join("\n")+o,s=u-1),t=e||/\n\n(?!\s*$)/.test(n),s!==u-1&&(e="\n"===n.charAt(n.length-1),t=t||e),this.tokens.push({type:t?kt.looseItemStart:kt.listItemStart}),this.getTokens(n,!1,r),this.tokens.push({type:kt.listItemEnd})}this.tokens.push({type:kt.listEnd})}else if(s=this.rules.html.exec(o)){o=o.substring(s[0].length);var p=s[1];this.tokens.push({type:this.options.sanitize?kt.paragraph:kt.html,pre:!this.options.sanitizer&&("pre"===p||"script"===p||"style"===p),text:s[0]})}else if(e&&(s=this.rules.def.exec(o)))o=o.substring(s[0].length),this.links[s[1].toLowerCase()]={href:s[2],title:s[3]};else if(e&&this.hasRulesTables&&(s=this.rules.table.exec(o))){o=o.substring(s[0].length);var d={type:kt.table,header:s[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:[]};for(let t=0;t<d.align.length;t++)/^ *-+: *$/.test(d.align[t])?d.align[t]="right":/^ *:-+: *$/.test(d.align[t])?d.align[t]="center":/^ *:-+ *$/.test(d.align[t])?d.align[t]="left":d.align[t]=null;var f=s[3].replace(/(?: *\| *)?\n$/,"").split("\n");for(let t=0;t<f.length;t++)d.cells[t]=f[t].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */);this.tokens.push(d)}else{if(this.staticThis.simpleRules.length){var g=this.staticThis.simpleRules;for(let t=0;t<g.length;t++)if(s=g[t].exec(o)){o=o.substring(s[0].length);var y="simpleRule"+(t+1);this.tokens.push({type:y,execArr:s});continue t}}if(e&&(s=this.rules.paragraph.exec(o)))o=o.substring(s[0].length),"\n"===s[1].slice(-1)?this.tokens.push({type:kt.paragraph,text:s[1].slice(0,-1)}):this.tokens.push({type:0<this.tokens.length?kt.paragraph:kt.text,text:s[1]});else if(s=this.rules.text.exec(o))o=o.substring(s[0].length),this.tokens.push({type:kt.text,text:s[0]});else if(o)throw new Error("Infinite loop on byte: "+o.charCodeAt(0)+`, near text '${o.slice(0,30)}...'`)}return{tokens:this.tokens,links:this.links}}}ue.simpleRules=[],ue.rulesBase=null,ue.rulesGfm=null,ue.rulesTables=null;const pe=ot('<div class="flex justify-end mb-2 items-end guest-container"><span class="px-4 py-2 mr-2 whitespace-pre-wrap max-w-full chatbot-guest-bubble" data-testid="guest-bubble">'),de=(he.setOptions({isNoP:!0}),t=>{let e;S((()=>{e&&(e.innerHTML=he.parse(t.message))}));{const r=pe(),s=r.firstChild;r.style.setProperty("margin-left","50px"),r.style.setProperty("margin-top","30px");return"function"==typeof e?ht(e,s):e=s,s.style.setProperty("border-radius","6px"),ut(r,F(X,{get when(){return t.showAvatar},get children(){return F(Jt,{get initialAvatarSrc(){return t.avatarSrc}})}}),null),k((e=>{var r=t.backgroundColor??"#3B81F6",o=t.textColor??"#ffffff";return r!==e._v$&&(null!=(e._v$=r)?s.style.setProperty("background-color",r):s.style.removeProperty("background-color")),o!==e._v$2&&(null!=(e._v$2=o)?s.style.setProperty("color",o):s.style.removeProperty("color")),e}),{_v$:void 0,_v$2:void 0}),r}}),fe=ot('<div class="flex justify-start mb-2 items-start host-container"><span class="px-4 py-2 ml-2 whitespace-pre-wrap max-w-full chatbot-host-bubble" data-testid="host-bubble"></span>'),ge=(he.setOptions({isNoP:!0}),t=>{let e;S((()=>{e&&(e.innerHTML=he.parse(t.message))}));{const r=fe(),s=r.firstChild;r.style.setProperty("margin-right","50px"),r.style.setProperty("position","relative"),ut(r,F(X,{get when(){return t.showAvatar},get children(){return F(Jt,{get initialAvatarSrc(){return t.avatarSrc}})}}),s);return"function"==typeof e?ht(e,s):e=s,s.style.setProperty("border-radius","6px"),k((e=>{var r=t.backgroundColor??"#f7f8ff",o=t.textColor??"#303235";return r!==e._v$&&(null!=(e._v$=r)?s.style.setProperty("background-color",r):s.style.removeProperty("background-color")),o!==e._v$2&&(null!=(e._v$2=o)?s.style.setProperty("color",o):s.style.removeProperty("color")),e}),{_v$:void 0,_v$2:void 0}),r}}),ye=ot('<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">'),be=()=>ye(),me=ot('<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">'),we=()=>{return ut((t=me()).firstChild,F(be,{})),t;var t},ve=ot('<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">'),xe=t=>{return r=(e=ve()).firstChild,e.$$click=()=>t.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"),ut(r,(()=>t.pageContent)),e;var e,r},ke=(nt(["click"]),ot('<span><a href="https://flowiseai.com" target="_blank" rel="noopener noreferrer" class="lite-badge" id="lite-badge"><span>')),_e="#303235",Ce=t=>{let e,r;const s=r=>{r.forEach((r=>{r.removedNodes.forEach((r=>{"id"in r&&e&&"lite-badge"==r.id&&(console.log("Sorry, you can't remove the brand 😅"),t.botContainer?.append(e))}))}))};S((()=>{document&&t.botContainer&&(r=new MutationObserver(s)).observe(t.botContainer,{subtree:!1,childList:!0})})),$((()=>{r&&r.disconnect()}));{const r=ke(),s=r.firstChild;r.style.setProperty("font-size","13px"),r.style.setProperty("position","absolute"),r.style.setProperty("bottom","0"),r.style.setProperty("padding","10px"),r.style.setProperty("margin","auto"),r.style.setProperty("width","100%"),r.style.setProperty("text-align","center");return"function"==typeof e?ht(e,s):e=s,s.style.setProperty("font-weight","bold"),k((e=>{var o=t.poweredByTextColor??_e,n=t.badgeBackgroundColor??"#ffffff",i=t.poweredByTextColor??_e;return o!==e._v$&&(null!=(e._v$=o)?r.style.setProperty("color",o):r.style.removeProperty("color")),n!==e._v$2&&(null!=(e._v$2=n)?r.style.setProperty("background-color",n):r.style.removeProperty("background-color")),i!==e._v$3&&(null!=(e._v$3=i)?s.style.setProperty("color",i):s.style.removeProperty("color")),e}),{_v$:void 0,_v$2:void 0,_v$3:void 0}),r}},Pe=Object.create(null),Se=(Pe.open="0",Pe.close="1",Pe.ping="2",Pe.pong="3",Pe.message="4",Pe.upgrade="5",Pe.noop="6",Object.create(null)),$e=(Object.keys(Pe).forEach((t=>{Se[Pe[t]]=t})),{type:"error",data:"parser error"}),Ae="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),Oe="function"==typeof ArrayBuffer,Ee=({type:t,data:e},r,s)=>Ae&&e instanceof Blob?r?s(e):Re(e,s):Oe&&(e instanceof ArrayBuffer||(t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer)(e))?r?s(e):Re(new Blob([e]),s):s(Pe[t]+(e||"")),Re=(t,e)=>{const r=new FileReader;return r.onload=function(){var t=r.result.split(",")[1];e("b"+(t||""))},r.readAsDataURL(t)},Te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Be="undefined"==typeof Uint8Array?[]:new Uint8Array(256);for(let t=0;t<64;t++)Be[Te.charCodeAt(t)]=t;const Le="function"==typeof ArrayBuffer,je=(t,e)=>{var r;return"string"!=typeof t?{type:"message",data:Me(t,e)}:"b"===(r=t.charAt(0))?{type:"message",data:Ne(t.substring(1),e)}:Se[r]?1<t.length?{type:Se[r],data:t.substring(1)}:{type:Se[r]}:$e},Ne=(t,e)=>{var r;return Le?(r=(t=>{let e,r,s,o,n,i=.75*t.length,a=t.length,l=0;"="===t[t.length-1]&&(i--,"="===t[t.length-2])&&i--;var c=new ArrayBuffer(i),h=new Uint8Array(c);for(e=0;e<a;e+=4)r=Be[t.charCodeAt(e)],s=Be[t.charCodeAt(e+1)],o=Be[t.charCodeAt(e+2)],n=Be[t.charCodeAt(e+3)],h[l++]=r<<2|s>>4,h[l++]=(15&s)<<4|o>>2,h[l++]=(3&o)<<6|63&n;return c})(t),Me(r,e)):{base64:!0,data:t}},Me=(t,e)=>"blob"===e&&t instanceof ArrayBuffer?new Blob([t]):t,ze=String.fromCharCode(30);function Ie(t){if(t)return function(t){for(var e in Ie.prototype)t[e]=Ie.prototype[e];return t}(t)}Ie.prototype.on=Ie.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},Ie.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},Ie.prototype.off=Ie.prototype.removeListener=Ie.prototype.removeAllListeners=Ie.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)this._callbacks={};else{var r=this._callbacks["$"+t];if(r)if(1==arguments.length)delete this._callbacks["$"+t];else{for(var s,o=0;o<r.length;o++)if((s=r[o])===e||s.fn===e){r.splice(o,1);break}0===r.length&&delete this._callbacks["$"+t]}}return this},Ie.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],s=1;s<arguments.length;s++)e[s-1]=arguments[s];if(r){s=0;for(var o=(r=r.slice(0)).length;s<o;++s)r[s].apply(this,e)}return this},Ie.prototype.emitReserved=Ie.prototype.emit,Ie.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},Ie.prototype.hasListeners=function(t){return!!this.listeners(t).length};const qe="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")();function De(t,...e){return e.reduce(((e,r)=>(t.hasOwnProperty(r)&&(e[r]=t[r]),e)),{})}const Fe=qe.setTimeout,He=qe.clearTimeout;function Ge(t,e){e.useNativeTimers?(t.setTimeoutFn=Fe.bind(qe),t.clearTimeoutFn=He.bind(qe)):(t.setTimeoutFn=qe.setTimeout.bind(qe),t.clearTimeoutFn=qe.clearTimeout.bind(qe))}function We(t){return"string"==typeof t?function(t){let e,r=0;for(let s=0,o=t.length;s<o;s++)(e=t.charCodeAt(s))<128?r+=1:e<2048?r+=2:e<55296||57344<=e?r+=3:(s++,r+=4);return r}(t):Math.ceil(1.33*(t.byteLength||t.size))}class Ue extends Error{constructor(t,e,r){super(t),this.description=e,this.context=r,this.type="TransportError"}}class Ve extends Ie{constructor(t){super(),this.writable=!1,Ge(this,t),this.opts=t,this.query=t.query,this.socket=t.socket}onError(t,e,r){return super.emitReserved("error",new Ue(t,e,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(t){"open"===this.readyState&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){t=je(t,this.socket.binaryType),this.onPacket(t)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}}const Ye="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Ke=64,Xe={};let Je,Qe=0,Ze=0;function tr(t){let e="";for(;e=Ye[t%Ke]+e,0<(t=Math.floor(t/Ke)););return e}function er(){var t=tr(+new Date);return t!==Je?(Qe=0,Je=t):t+"."+tr(Qe++)}for(;Ze<Ke;Ze++)Xe[Ye[Ze]]=Ze;function rr(t){let e="";for(var r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e}let sr=!1;try{sr="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(ie){}const or=sr;function nr(t){t=t.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!t||or))return new XMLHttpRequest}catch(t){}if(!t)try{return new(qe[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}function ir(){}const ar=null!=new nr({xdomain:!1}).responseType;class lr extends Ie{constructor(t,e){super(),Ge(this,e),this.opts=e,this.method=e.method||"GET",this.uri=t,this.async=!1!==e.async,this.data=void 0!==e.data?e.data:null,this.create()}create(){var t=De(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this.opts.xd,t.xscheme=!!this.opts.xs;const e=this.xhr=new nr(t);try{e.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders)for(var r in e.setDisableHeaderCheck&&e.setDisableHeaderCheck(!0),this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&e.setRequestHeader(r,this.opts.extraHeaders[r])}catch(t){}if("POST"===this.method)try{e.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{e.setRequestHeader("Accept","*/*")}catch(t){}"withCredentials"in e&&(e.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(e.timeout=this.opts.requestTimeout),e.onreadystatechange=()=>{4===e.readyState&&(200===e.status||1223===e.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof e.status?e.status:0)}),0))},e.send(this.data)}catch(t){return void this.setTimeoutFn((()=>{this.onError(t)}),0)}"undefined"!=typeof document&&(this.index=lr.requestsCount++,lr.requests[this.index]=this)}onError(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}cleanup(t){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=ir,t)try{this.xhr.abort()}catch(t){}"undefined"!=typeof document&&delete lr.requests[this.index],this.xhr=null}}onLoad(){var t=this.xhr.responseText;null!==t&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}if(lr.requestsCount=0,lr.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",cr);else if("function"==typeof addEventListener){addEventListener("onpagehide"in qe?"pagehide":"unload",cr,!1)}function cr(){for(var t in lr.requests)lr.requests.hasOwnProperty(t)&&lr.requests[t].abort()}const hr="function"==typeof Promise&&"function"==typeof Promise.resolve?t=>Promise.resolve().then(t):(t,e)=>e(t,0),ur=qe.WebSocket||qe.MozWebSocket,pr="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();const dr={websocket:class extends Ve{constructor(t){super(t),this.supportsBinary=!t.forceBase64}get name(){return"websocket"}doOpen(){if(this.check()){var t=this.uri(),e=this.opts.protocols,r=pr?{}:De(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=pr?new ur(t,e,r):e?new ur(t,e):new ur(t)}catch(t){return this.emitReserved("error",t)}this.ws.binaryType=this.socket.binaryType||"arraybuffer",this.addEventListeners()}}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let r=0;r<t.length;r++){var e=t[r];const s=r===t.length-1;Ee(e,this.supportsBinary,(t=>{try{this.ws.send(t)}catch(t){}s&&hr((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){var t=this.query||{},e=this.opts.secure?"wss":"ws";let r="";return this.opts.port&&("wss"==e&&443!==Number(this.opts.port)||"ws"==e&&80!==Number(this.opts.port))&&(r=":"+this.opts.port),this.opts.timestampRequests&&(t[this.opts.timestampParam]=er()),this.supportsBinary||(t.b64=1),t=rr(t),e+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(t.length?"?"+t:"")}check(){return!!ur}},polling:class extends Ve{constructor(t){if(super(t),this.polling=!1,"undefined"!=typeof location){var e="https:"===location.protocol;let r=location.port;r=r||(e?"443":"80"),this.xd="undefined"!=typeof location&&t.hostname!==location.hostname||r!==t.port,this.xs=t.secure!==e}e=t&&t.forceBase64,this.supportsBinary=ar&&!e}get name(){return"polling"}doOpen(){this.poll()}pause(t){this.readyState="pausing";const e=()=>{this.readyState="paused",t()};if(this.polling||!this.writable){let t=0;this.polling&&(t++,this.once("pollComplete",(function(){--t||e()}))),this.writable||(t++,this.once("drain",(function(){--t||e()})))}else e()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){((t,e)=>{var r=t.split(ze),s=[];for(let t=0;t<r.length;t++){var o=je(r[t],e);if(s.push(o),"error"===o.type)break}return s})(t,this.socket.binaryType).forEach((t=>{if("opening"===this.readyState&&"open"===t.type&&this.onOpen(),"close"===t.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(t)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState)&&this.poll()}doClose(){var t=()=>{this.write([{type:"close"}])};"open"===this.readyState?t():this.once("open",t)}write(t){this.writable=!1,((t,e)=>{const r=t.length,s=new Array(r);let o=0;t.forEach(((t,n)=>{Ee(t,!1,(t=>{s[n]=t,++o===r&&e(s.join(ze))}))}))})(t,(t=>{this.doWrite(t,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){var t=this.query||{},e=this.opts.secure?"https":"http";let r="";return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=er()),this.supportsBinary||t.sid||(t.b64=1),this.opts.port&&("https"==e&&443!==Number(this.opts.port)||"http"==e&&80!==Number(this.opts.port))&&(r=":"+this.opts.port),t=rr(t),e+"://"+(-1!==this.opts.hostname.indexOf(":")?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(t.length?"?"+t:"")}request(t={}){return Object.assign(t,{xd:this.xd,xs:this.xs},this.opts),new lr(this.uri(),t)}doWrite(t,e){(t=this.request({method:"POST",data:t})).on("success",e),t.on("error",((t,e)=>{this.onError("xhr post error",t,e)}))}doPoll(){var t=this.request();t.on("data",this.onData.bind(this)),t.on("error",((t,e)=>{this.onError("xhr poll error",t,e)})),this.pollXhr=t}}},fr=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,gr=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function yr(t){var e=t,r=t.indexOf("["),s=t.indexOf("]");-1!=r&&-1!=s&&(t=t.substring(0,r)+t.substring(r,s).replace(/:/g,";")+t.substring(s,t.length));let o=fr.exec(t||""),n={},i=14;for(;i--;)n[gr[i]]=o[i]||"";return-1!=r&&-1!=s&&(n.source=e,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(t,e){var r=e.replace(/\/{2,9}/g,"/").split("/");return"/"!=e.slice(0,1)&&0!==e.length||r.splice(0,1),"/"==e.slice(-1)&&r.splice(r.length-1,1),r}(0,n.path),n.queryKey=function(t,e){const r={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(t,e,s){e&&(r[e]=s)})),r}(0,n.query),n}let br=class t extends Ie{constructor(t,e={}){super(),this.writeBuffer=[],t&&"object"==typeof t&&(e=t,t=null),t?(t=yr(t),e.hostname=t.host,e.secure="https"===t.protocol||"wss"===t.protocol,e.port=t.port,t.query&&(e.query=t.query)):e.host&&(e.hostname=yr(e.host).host),Ge(this,e),this.secure=null!=e.secure?e.secure:"undefined"!=typeof location&&"https:"===location.protocol,e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=e.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=e.transports||["polling","websocket"],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:!0},e),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(t){var e={},r=t.split("&");for(let t=0,o=r.length;t<o;t++){var s=r[t].split("=");e[decodeURIComponent(s[0])]=decodeURIComponent(s[1])}return e}(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(t){var e=((e=Object.assign({},this.opts.query)).EIO=4,e.transport=t,this.id&&(e.sid=this.id),Object.assign({},this.opts.transportOptions[t],this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port}));return new dr[t](e)}open(){let e;if(this.opts.rememberUpgrade&&t.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)}setTransport(t){this.transport&&this.transport.removeAllListeners(),(this.transport=t).on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(t=>this.onClose("transport close",t)))}probe(e){let r=this.createTransport(e),s=!1;t.priorWebsocketSuccess=!1;const o=()=>{s||(r.send([{type:"ping",data:"probe"}]),r.once("packet",(e=>{s||("pong"===e.type&&"probe"===e.data?(this.upgrading=!0,this.emitReserved("upgrading",r),r&&(t.priorWebsocketSuccess="websocket"===r.name,this.transport.pause((()=>{s||"closed"!==this.readyState&&(h(),this.setTransport(r),r.send([{type:"upgrade"}]),this.emitReserved("upgrade",r),r=null,this.upgrading=!1,this.flush())})))):((e=new Error("probe error")).transport=r.name,this.emitReserved("upgradeError",e)))})))};function n(){s||(s=!0,h(),r.close(),r=null)}const i=t=>{(t=new Error("probe error: "+t)).transport=r.name,n(),this.emitReserved("upgradeError",t)};function a(){i("transport closed")}function l(){i("socket closed")}function c(t){r&&t.name!==r.name&&n()}const h=()=>{r.removeListener("open",o),r.removeListener("error",i),r.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};r.once("open",o),r.once("error",i),r.once("close",a),this.once("close",l),this.once("upgrading",c),r.open()}onOpen(){if(this.readyState="open",t.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade){let t=0;for(var e=this.upgrades.length;t<e;t++)this.probe(this.upgrades[t])}}onPacket(t){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":var e=new Error("server error");e.code=t.data,this.onError(e);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data)}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.maxPayload=t.maxPayload,this.onOpen(),"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 t;"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(t=this.getWritablePackets(),this.transport.send(t),this.prevBufferLen=t.length,this.emitReserved("flush"))}getWritablePackets(){if(this.maxPayload&&"polling"===this.transport.name&&1<this.writeBuffer.length){let e=1;for(let r=0;r<this.writeBuffer.length;r++){var t=this.writeBuffer[r].data;if(t&&(e+=We(t)),0<r&&e>this.maxPayload)return this.writeBuffer.slice(0,r);e+=2}}return this.writeBuffer}write(t,e,r){return this.sendPacket("message",t,e,r),this}send(t,e,r){return this.sendPacket("message",t,e,r),this}sendPacket(t,e,r,s){"function"==typeof e&&(s=e,e=void 0),"function"==typeof r&&(s=r,r=null),"closing"!==this.readyState&&"closed"!==this.readyState&&((r=r||{}).compress=!1!==r.compress,this.emitReserved("packetCreate",t={type:t,data:e,options:r}),this.writeBuffer.push(t),s&&this.once("flush",s),this.flush())}close(){const t=()=>{this.onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),t()},r=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{(this.upgrading?r:t)()})):(this.upgrading?r:t)()),this}onError(e){t.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(t,e){"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",t,e),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(t){var e=[];let r=0;for(var s=t.length;r<s;r++)~this.transports.indexOf(t[r])&&e.push(t[r]);return e}};br.protocol=4;const mr="function"==typeof ArrayBuffer,wr=t=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,vr=Object.prototype.toString,xr="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===vr.call(Blob),kr="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===vr.call(File);function _r(t){return mr&&(t instanceof ArrayBuffer||wr(t))||xr&&t instanceof Blob||kr&&t instanceof File}function Cr(t,e){if(t&&"object"==typeof t)if(Array.isArray(t)){for(let e=0,r=t.length;e<r;e++)if(Cr(t[e]))return!0}else{if(_r(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return Cr(t.toJSON(),!0);for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&Cr(t[e]))return!0}return!1}function Pr(t){var e=[],r=t.data;return t.data=Sr(r,e),t.attachments=e.length,{packet:t,buffers:e}}function Sr(t,e){if(!t)return t;var r;if(_r(t))return r={_placeholder:!0,num:e.length},e.push(t),r;if(Array.isArray(t)){var s=new Array(t.length);for(let r=0;r<t.length;r++)s[r]=Sr(t[r],e);return s}if("object"!=typeof t||t instanceof Date)return t;var o={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(o[r]=Sr(t[r],e));return o}function $r(t,e){return t.data=Ar(t.data,e),delete t.attachments,t}function Ar(t,e){if(t){if(t&&!0===t._placeholder){if("number"==typeof t.num&&0<=t.num&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r]=Ar(t[r],e);else if("object"==typeof t)for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(t[r]=Ar(t[r],e))}return t}const Or=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];!function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"}(_t=_t||{});function Er(t){return"[object Object]"===Object.prototype.toString.call(t)}class Rr extends Ie{constructor(t){super(),this.reviver=t}add(t){let e;if("string"==typeof t){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");var r=(e=this.decodeString(t)).type===_t.BINARY_EVENT;(!r&&e.type!==_t.BINARY_ACK||(e.type=r?_t.EVENT:_t.ACK,this.reconstructor=new Tr(e),0===e.attachments))&&super.emitReserved("decoded",e)}else{if(!_r(t)&&!t.base64)throw new Error("Unknown type: "+t);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(e=this.reconstructor.takeBinaryData(t))&&(this.reconstructor=null,super.emitReserved("decoded",e))}}decodeString(t){let e=0;var r={type:Number(t.charAt(0))};if(void 0===_t[r.type])throw new Error("unknown packet type "+r.type);if(r.type===_t.BINARY_EVENT||r.type===_t.BINARY_ACK){for(var s=e+1;"-"!==t.charAt(++e)&&e!=t.length;);if((s=t.substring(s,e))!=Number(s)||"-"!==t.charAt(e))throw new Error("Illegal attachments");r.attachments=Number(s)}if("/"===t.charAt(e+1)){for(s=e+1;++e&&","!==t.charAt(e)&&e!==t.length;);r.nsp=t.substring(s,e)}else r.nsp="/";if(""!==(s=t.charAt(e+1))&&Number(s)==s){for(s=e+1;++e;){var o=t.charAt(e);if(null==o||Number(o)!=o){--e;break}if(e===t.length)break}r.id=Number(t.substring(s,e+1))}if(t.charAt(++e)){if(s=this.tryParse(t.substr(e)),!Rr.isPayloadValid(r.type,s))throw new Error("invalid payload");r.data=s}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch(t){return!1}}static isPayloadValid(t,e){switch(t){case _t.CONNECT:return Er(e);case _t.DISCONNECT:return void 0===e;case _t.CONNECT_ERROR:return"string"==typeof e||Er(e);case _t.EVENT:case _t.BINARY_EVENT:return Array.isArray(e)&&("number"==typeof e[0]||"string"==typeof e[0]&&-1===Or.indexOf(e[0]));case _t.ACK:case _t.BINARY_ACK:return Array.isArray(e)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class Tr{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){return this.buffers.push(t),this.buffers.length===this.reconPack.attachments?(t=$r(this.reconPack,this.buffers),this.finishedReconstruction(),t):null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}var Br=Object.freeze({__proto__:null,Decoder:Rr,Encoder:class{constructor(t){this.replacer=t}encode(t){return t.type!==_t.EVENT&&t.type!==_t.ACK||!Cr(t)?[this.encodeAsString(t)]:this.encodeAsBinary({type:t.type===_t.EVENT?_t.BINARY_EVENT:_t.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id})}encodeAsString(t){let e=""+t.type;return t.type!==_t.BINARY_EVENT&&t.type!==_t.BINARY_ACK||(e+=t.attachments+"-"),t.nsp&&"/"!==t.nsp&&(e+=t.nsp+","),null!=t.id&&(e+=t.id),null!=t.data&&(e+=JSON.stringify(t.data,this.replacer)),e}encodeAsBinary(t){t=Pr(t);var e=this.encodeAsString(t.packet);return(t=t.buffers).unshift(e),t}},get PacketType(){return _t},protocol:5});function Lr(t,e,r){return t.on(e,r),function(){t.off(e,r)}}const jr=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Nr extends Ie{constructor(t,e,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=e,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){var t;this.subs||(t=this.io,this.subs=[Lr(t,"open",this.onopen.bind(this)),Lr(t,"packet",this.onpacket.bind(this)),Lr(t,"error",this.onerror.bind(this)),Lr(t,"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(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...e){if(jr.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');var r,s;return e.unshift(t),!this._opts.retries||this.flags.fromQueue||this.flags.volatile?((t={type:_t.EVENT,data:e,options:{}}).options.compress=!1!==this.flags.compress,"function"==typeof e[e.length-1]&&(r=this.ids++,s=e.pop(),this._registerAckCallback(r,s),t.id=r),s=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable,(!this.flags.volatile||s&&this.connected)&&(this.connected?(this.notifyOutgoingListeners(t),this.packet(t)):this.sendBuffer.push(t)),this.flags={}):this._addToQueue(e),this}_registerAckCallback(t,e){var r=null!=(r=this.flags.timeout)?r:this._opts.ackTimeout;if(void 0===r)this.acks[t]=e;else{const s=this.io.setTimeoutFn((()=>{delete this.acks[t];for(let e=0;e<this.sendBuffer.length;e++)this.sendBuffer[e].id===t&&this.sendBuffer.splice(e,1);e.call(this,new Error("operation has timed out"))}),r);this.acks[t]=(...t)=>{this.io.clearTimeoutFn(s),e.apply(this,[null,...t])}}}emitWithAck(t,...e){const r=void 0!==this.flags.timeout||void 0!==this._opts.ackTimeout;return new Promise(((s,o)=>{e.push(((t,e)=>r?t?o(t):s(e):s(t))),this.emit(t,...e)}))}_addToQueue(t){let e;"function"==typeof t[t.length-1]&&(e=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push(((t,...s)=>{if(r===this._queue[0])return null!==t?r.tryCount>this._opts.retries&&(this._queue.shift(),e)&&e(t):(this._queue.shift(),e&&e(null,...s)),r.pending=!1,this._drainQueue()})),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){var e;!this.connected||0===this._queue.length||(e=this._queue[0]).pending&&!t||(e.pending=!0,e.tryCount++,this.flags=e.flags,this.emit.apply(this,e.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){"function"==typeof this.auth?this.auth((t=>{this._sendConnectPacket(t)})):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:_t.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,e){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,e)}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case _t.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case _t.EVENT:case _t.BINARY_EVENT:this.onevent(t);break;case _t.ACK:case _t.BINARY_ACK:this.onack(t);break;case _t.DISCONNECT:this.ondisconnect();break;case _t.CONNECT_ERROR:this.destroy();var e=new Error(t.data.message);e.data=t.data.data,this.emitReserved("connect_error",e)}}onevent(t){var e=t.data||[];null!=t.id&&e.push(this.ack(t.id)),this.connected?this.emitEvent(e):this.receiveBuffer.push(Object.freeze(e))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length)for(const e of this._anyListeners.slice())e.apply(this,t);super.emit.apply(this,t),this._pid&&t.length&&"string"==typeof t[t.length-1]&&(this._lastOffset=t[t.length-1])}ack(t){const e=this;let r=!1;return function(...s){r||(r=!0,e.packet({type:_t.ACK,id:t,data:s}))}}onack(t){var e=this.acks[t.id];"function"==typeof e&&(e.apply(this,t.data),delete this.acks[t.id])}onconnect(t,e){this.id=t,this.recovered=e&&this._pid===e,this._pid=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach((t=>this.emitEvent(t))),this.receiveBuffer=[],this.sendBuffer.forEach((t=>{this.notifyOutgoingListeners(t),this.packet(t)})),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((t=>t())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:_t.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(this._anyListeners)if(t){var e=this._anyListeners;for(let r=0;r<e.length;r++)if(t===e[r])return e.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(this._anyOutgoingListeners)if(t){var e=this._anyOutgoingListeners;for(let r=0;r<e.length;r++)if(t===e[r])return e.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length)for(const e of this._anyOutgoingListeners.slice())e.apply(this,t.data)}}function Mr(t){this.ms=(t=t||{}).min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=0<t.jitter&&t.jitter<=1?t.jitter:0,this.attempts=0}Mr.prototype.duration=function(){var t,e,r=this.ms*Math.pow(this.factor,this.attempts++);return this.jitter&&(t=Math.random(),e=Math.floor(t*this.jitter*r),r=0==(1&Math.floor(10*t))?r-e:r+e),0|Math.min(r,this.max)},Mr.prototype.reset=function(){this.attempts=0},Mr.prototype.setMin=function(t){this.ms=t},Mr.prototype.setMax=function(t){this.max=t},Mr.prototype.setJitter=function(t){this.jitter=t};class zr extends Ie{constructor(t,e){super(),this.nsps={},this.subs=[],t&&"object"==typeof t&&(e=t,t=void 0),(e=e||{}).path=e.path||"/socket.io",this.opts=e,Ge(this,e),this.reconnection(!1!==e.reconnection),this.reconnectionAttempts(e.reconnectionAttempts||1/0),this.reconnectionDelay(e.reconnectionDelay||1e3),this.reconnectionDelayMax(e.reconnectionDelayMax||5e3),this.randomizationFactor(null!=(r=e.randomizationFactor)?r:.5),this.backoff=new Mr({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==e.timeout?2e4:e.timeout),this._readyState="closed",this.uri=t;var r=e.parser||Br;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==e.autoConnect,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,this):this._reconnection}reconnectionAttempts(t){return void 0===t?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var e;return void 0===t?this._reconnectionDelay:(this._reconnectionDelay=t,null!=(e=this.backoff)&&e.setMin(t),this)}randomizationFactor(t){var e;return void 0===t?this._randomizationFactor:(this._randomizationFactor=t,null!=(e=this.backoff)&&e.setJitter(t),this)}reconnectionDelayMax(t){var e;return void 0===t?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,null!=(e=this.backoff)&&e.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(t){if(!~this._readyState.indexOf("open")){this.engine=new br(this.uri,this.opts);const s=this.engine,o=this,n=(this._readyState="opening",this.skipReconnect=!1,Lr(s,"open",(function(){o.onopen(),t&&t()})));var e=Lr(s,"error",(e=>{o.cleanup(),o._readyState="closed",this.emitReserved("error",e),t?t(e):o.maybeReconnectOnOpen()}));if(!1!==this._timeout){var r=this._timeout;0===r&&n();const t=this.setTimeoutFn((()=>{n(),s.close(),s.emit("error",new Error("timeout"))}),r);this.opts.autoUnref&&t.unref(),this.subs.push((function(){clearTimeout(t)}))}this.subs.push(n),this.subs.push(e)}return this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");var t=this.engine;this.subs.push(Lr(t,"ping",this.onping.bind(this)),Lr(t,"data",this.ondata.bind(this)),Lr(t,"error",this.onerror.bind(this)),Lr(t,"close",this.onclose.bind(this)),Lr(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(t){this.onclose("parse error",t)}}ondecoded(t){hr((()=>{this.emitReserved("packet",t)}),this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,e){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new Nr(this,t,e),this.nsps[t]=r),r}_destroy(t){for(const t of Object.keys(this.nsps)){if(this.nsps[t].active)return}this._close()}_packet(t){var e=this.encoder.encode(t);for(let r=0;r<e.length;r++)this.engine.write(e[r],t.options)}cleanup(){this.subs.forEach((t=>t())),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(t,e){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,e),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{var e=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn((()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),t.skipReconnect)||t.open((e=>{e?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",e)):t.onreconnect()}))}),e);this.opts.autoUnref&&r.unref(),this.subs.push((function(){clearTimeout(r)}))}}onreconnect(){var t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Ir={};function qr(t,e){"object"==typeof t&&(e=t,t=void 0);t=function(t,e="",r){let s=t;return r=r||"undefined"!=typeof location&&location,"string"==typeof(t=null==t?r.protocol+"//"+r.host:t)&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?r.protocol+t:r.host+t),/^(https?|wss?):\/\//.test(t)||(t=void 0!==r?r.protocol+"//"+t:"https://"+t),s=yr(t)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/",t=-1!==s.host.indexOf(":")?"["+s.host+"]":s.host,s.id=s.protocol+"://"+t+":"+s.port+e,s.href=s.protocol+"://"+t+(r&&r.port===s.port?"":":"+s.port),s}(t,(e=e||{}).path||"/socket.io");var r=t.source,s=t.id,o=t.path;o=Ir[s]&&o in Ir[s].nsps;let n;return n=(o=e.forceNew||e["force new connection"]||!1===e.multiplex||o)?new zr(r,e):(Ir[s]||(Ir[s]=new zr(r,e)),Ir[s]),t.query&&!e.query&&(e.query=t.queryKey),n.socket(t.path,e)}Object.assign(qr,{Manager:zr,Socket:Nr,io:qr,connect:qr});const Dr=ot("<style>"),Fr=ot('<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">'),Hr=ot("<div><pre>");const Gr=t=>{let e;const[r]=V(t,["onOpen","onClose","isOpen","value"]),[s,o]=(S((()=>{e&&(e.innerHTML=function(t){return(t=(t="string"!=typeof t?JSON.stringify(t,void 0,2):t).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(t){let e="number";return/^"/.test(t)?e=/:$/.test(t)?"key":"string":/true|false/.test(t)?e="boolean":/null/.test(t)&&(e="null"),'<span class="'+e+'">'+t+"</span>"}))}(JSON.stringify(t?.value,void 0,2)))})),x(r.isOpen??!1)),n=(_((()=>{Pt(t.isOpen)||t.isOpen===s()||a()})),t=>{t.stopPropagation()}),i=()=>{o(!1),r.onClose?.(),document.body.style.overflow="auto"},a=()=>{s()?i():(o(!0),r.onOpen?.(),document.body.style.overflow="hidden")};return F(X,{get when(){return s()},get children(){return[(ut(o=Dr(),Ct),o),(o=Fr(),r=o.firstChild,s=r.nextSibling.nextSibling.firstChild.firstChild,o.style.setProperty("z-index","1100"),o.addEventListener("click",i),ut(r,Ct),s.style.setProperty("background-color","transparent"),s.style.setProperty("margin-left","20px"),s.style.setProperty("margin-right","20px"),s.addEventListener("click",n),s.addEventListener("pointerdown",n),ut(s,(()=>{const r=C((()=>!!t.value));return()=>{return r()&&(s=(t=Hr()).firstChild,t.style.setProperty("background","white"),t.style.setProperty("margin","auto"),t.style.setProperty("padding","7px"),"function"==typeof(o=e)?ht(o,s):e=s,t);var t,s,o}})()),o)];var r,s,o}})},Wr=ot('<div><div class="flex w-full h-full justify-center"><div class="overflow-y-scroll min-w-full w-full min-h-full px-3 pt-10 relative scrollable-container chatbot-chat-view scroll-smooth">'),Ur=ot("<div>"),Vr=ot('<div class="w-full h-32">'),Yr="您好,有关高新申报的问题,您可以直接问我。",Kr=t=>{let e,r,s;const[o,n]=x(""),[i,a]=x(!1),[l,c]=x(!1),[h,u]=x({}),[p,d]=x(""),[f,g]=x(!1),{messages:y,setMessages:b}=t,m=(S((()=>{r&&setTimeout((()=>{e?.scrollTo(0,e.scrollHeight)}),50)})),()=>{setTimeout((()=>{e?.scrollTo(0,e.scrollHeight)}),50)}),w=t=>{b((e=>[...e.map(((r,s)=>s===e.length-1?{...r,message:r.message+t}:r))]))},v=t=>{b((e=>[...e.map(((r,s)=>s===e.length-1?{...r,sourceDocuments:t}:r))]))},P=async e=>{if(n(e),""!==e.trim()){a(!0),m();const o=t.welcomeMessage??Yr;var r,s=y().filter((t=>t.message!==o));s=(b((t=>[...t,{message:e,type:"userMessage"}])),console.log("messages***",s,e),{question:e,history:s});if((s=(t.chatflowConfig&&(s.overrideConfig=t.chatflowConfig),f()&&(s.socketIOClientId=p()),await Lt({chatflowid:t.chatflowid,apiHost:t.apiHost,body:s}))).data){const t=A(s.data);"object"==typeof t&&t.text&&t.sourceDocuments?f()||b((e=>[...e,{message:t.text,sourceDocuments:t.sourceDocuments,type:"apiMessage"}])):f()||b((e=>[...e,{message:t,type:"apiMessage"}])),a(!1),n(""),m()}s.error&&(s=s.error,console.error(s),s="string"==typeof s?s:s.response.data||s.response.status+": "+s.response.statusText,[r="Oops! There seems to be an error. Please try again."]=[s],b((t=>[...t,{message:r,type:"apiMessage"}])),a(!1),n(""),m())}},$=(_((()=>{y()&&m()})),_((()=>{t.fontSize&&s&&(s.style.fontSize=t.fontSize+"px")})),_((()=>{t.clearMsg&&(console.log("clearMsg***111"),b((t=>[])))})),_((async()=>{var e=(await(({chatflowid:t,apiHost:e="http://localhost:3000"})=>$t({method:"GET",url:e+"/api/v1/chatflows-streaming/"+t}))({chatflowid:t.chatflowid,apiHost:t.apiHost})).data;e&&g(e?.isStreaming??!1);const r=qr(t.apiHost);return r.on("connect",(()=>{d(r.id)})),r.on("start",(()=>{b((t=>[...t,{message:"",type:"apiMessage"}]))})),r.on("sourceDocuments",v),r.on("token",w),()=>{n(""),a(!1),b([{message:t.welcomeMessage??Yr,type:"apiMessage"}]),r&&(r.disconnect(),d(""))}})),t=>{try{return new URL(t)}catch(t){}}),A=t=>(t.sourceDocuments&&t.sourceDocuments[0].metadata.length&&(t.sourceDocuments=t.sourceDocuments.map((t=>{var e=t.metadata.reduce(((t,e)=>(t[e.name]=e.value,t)),{});return{pageContent:t.pageContent,metadata:e}}))),t);return[(()=>{const n=Wr(),a=n.firstChild,l=a.firstChild;var h;return"function"==typeof(h=("function"==typeof(h=s)?ht(h,n):s=n,e))?ht(h,l):e=l,l.style.setProperty("padding-bottom","100px"),ut(l,F(K,{get each(){return[...y()]},children:(e,r)=>[C((()=>{const r=C((()=>"userMessage"===e.type));return()=>r()&&F(de,{get message(){return e.message},get backgroundColor(){return t.userMessage?.backgroundColor},get textColor(){return t.userMessage?.textColor},get showAvatar(){return t.userMessage?.showAvatar},get avatarSrc(){return t.userMessage?.avatarSrc}})})()),C((()=>{const r=C((()=>"apiMessage"===e.type));return()=>r()&&F(ge,{get message(){return e.message},get backgroundColor(){return t.botMessage?.backgroundColor},get textColor(){return t.botMessage?.textColor},get showAvatar(){return t.botMessage?.showAvatar},get avatarSrc(){return t.botMessage?.avatarSrc}})})()),C((()=>{const t=C((()=>!("userMessage"!==e.type||!i()||r()!==y().length-1)));return()=>t()&&F(we,{})})()),C((()=>{const t=C((()=>!(!e.sourceDocuments||!e.sourceDocuments.length)));return()=>{return t()&&((r=Ur()).style.setProperty("display","flex"),r.style.setProperty("flex-direction","row"),r.style.setProperty("width","100%"),ut(r,F(K,{get each(){return[...(t=>{const e=[],r=[];return(t=A(t)).sourceDocuments.forEach((t=>{$(t.metadata.source)&&!e.includes(t.metadata.source)?(e.push(t.metadata.source),r.push(t)):$(t.metadata.source)||r.push(t)})),r})(e)]},children:t=>{const e=$(t.metadata.source);return F(xe,{get pageContent(){return e?e.pathname:t.pageContent},get metadata(){return t.metadata},onSourceClick:()=>{e?window.open(t.metadata.source,"_blank"):(u(t),c(!0))}})}})),r);var r}})())]})),ut(a,F(Vt,{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 defaultValue(){return o()},onSubmit:P}),null),ut(n,F(Ce,{get badgeBackgroundColor(){return t.badgeBackgroundColor},get poweredByTextColor(){return t.poweredByTextColor},botContainer:s}),null),ut(n,F(Xr,{ref(t){"function"==typeof r?r(t):r=t}}),null),k((()=>at(n,"relative flex w-full h-full text-base overflow-hidden bg-cover bg-center flex-col items-center chatbot-container "+t.class))),n})(),C((()=>{const t=C((()=>!!l()));return()=>t()&&F(Gr,{get isOpen(){return l()},get value(){return h()},onClose:()=>c(!1)})})())]},Xr=t=>{return e=Vr(),"function"==typeof(r=t.ref)?ht(r,e):t.ref=e,e;var e,r},Jr=ot('<div class="ClearModal"><div class="ClearModal-content"><div class="ClearModal-buttons"><button>取消</button><button>确认'),Qr=ot("<h1>"),Zr=ot("<p>");function ts(t){return t.isOpen?(n=(o=(s=(r=(e=Jr()).firstChild).firstChild).firstChild).nextSibling,e.style.setProperty("position","fixed"),e.style.setProperty("background-color","rgba(0, 0, 0, 0.5)"),e.style.setProperty("display","flex"),e.style.setProperty("justify-content","center"),e.style.setProperty("align-items","center"),e.style.setProperty("width","100%"),e.style.setProperty("height","100%"),r.style.setProperty("display","flex"),r.style.setProperty("background-color","#ffffff"),r.style.setProperty("box-shadow","0px 11px 15px -7px rgba(0,0,0,0.2), 0px 24px 38px 3px rgba(0,0,0,0.14), 0px 9px 46px 8px rgba(0,0,0,0.12)"),r.style.setProperty("background-image","none"),r.style.setProperty("border-radius","12px"),r.style.setProperty("margin","32px"),r.style.setProperty("position","relative"),r.style.setProperty("overflow-y","auto"),r.style.setProperty("flex-direction","column"),r.style.setProperty("max-height","calc(100% - 64px)"),r.style.setProperty("max-width","420px"),r.style.setProperty("width","calc(100% - 64px)"),ut(r,(()=>{const e=C((()=>!!t.title));return()=>{return e()&&((r=Qr()).style.setProperty("line-height","1.6"),r.style.setProperty("padding","16px 24px"),r.style.setProperty("font-size","18px"),r.style.setProperty("margin","0"),r.style.setProperty("font-weight","600"),r.style.setProperty("color"," #212121"),r.style.setProperty("letter-spacing","1px"),ut(r,(()=>t.title)),r);var r}})(),s),ut(r,(()=>{const e=C((()=>!!t.content));return()=>{return e()&&((r=Zr()).style.setProperty("padding","20px 24px"),r.style.setProperty("color","#616161"),r.style.setProperty("padding-top","0"),r.style.setProperty("font-size","0.875rem"),r.style.setProperty("font-weight","400"),r.style.setProperty("letter-spacing","1px"),ut(r,(()=>t.content)),r);var r}})(),s),s.style.setProperty("padding","8px"),s.style.setProperty("display","flex"),s.style.setProperty("justify-content","flex-end"),lt(o,"click",t.onClose,!0),o.style.setProperty("color","#2196f3"),o.style.setProperty("margin-right","24px"),o.style.setProperty("font-weight","500"),o.style.setProperty("border-radius","4px"),lt(n,"click",t.onConfirm,!0),n.style.setProperty("box-shadow","0px 3px 1px -2px rgba(0,0,0,0.2), 0px 2px 2px 0px rgba(0,0,0,0.14), 0px 1px 5px 0px rgba(0,0,0,0.12)"),n.style.setProperty("font-weight","500"),n.style.setProperty("border-radius","4px"),n.style.setProperty("color","white"),n.style.setProperty("background-color","#2196f3"),n.style.setProperty("font-size","0.875rem"),n.style.setProperty("line-height","1.75"),n.style.setProperty("min-width","64px"),n.style.setProperty("padding","6px 16px"),e):null;var e,r,s,o,n}nt(["click"]);const es=ot('<div class="modal"><div class="modal-content"><div class="close"><button class="clearBtn"><span class="clear"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-eraser" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M19 20h-10.5l-4.21 -4.3a1 1 0 0 1 0 -1.41l10 -10a1 1 0 0 1 1.41 0l5 5a1 1 0 0 1 0 1.41l-9.2 9.3"></path><path d="M18 13.3l-6.3 -6.3"></path></svg></span>Clear Chat');function rs(t){const[e]=V(t,["theme"]),[r,s]=x(!1),[o,n]=x(!1),i=()=>s(!1),a=()=>{console.log("确认操作"),i(),n(!0),n(!1)};return[(l=es(),c=l.firstChild,h=c.firstChild,u=h.firstChild,p=u.firstChild,lt(l,"click",t.onClose,!0),l.style.setProperty("position","fixed"),l.style.setProperty("background-color","rgba(0, 0, 0, 0.5)"),l.style.setProperty("display","flex"),l.style.setProperty("justify-content","center"),l.style.setProperty("align-items","center"),l.style.setProperty("width","100%"),l.style.setProperty("height","100%"),c.$$click=t=>t.stopPropagation(),c.style.setProperty("height","100%"),c.style.setProperty("display","flex"),c.style.setProperty("background-color","#ffffff"),c.style.setProperty("box-shadow","0px 11px 15px -7px rgba(0,0,0,0.2), 0px 24px 38px 3px rgba(0,0,0,0.14), 0px 9px 46px 8px rgba(0,0,0,0.12)"),c.style.setProperty("background-image","none"),c.style.setProperty("border-radius","12px"),c.style.setProperty("margin","32px"),c.style.setProperty("position","relative"),c.style.setProperty("overflow-y","auto"),c.style.setProperty("flex-direction","column"),c.style.setProperty("max-height","calc(100% - 64px)"),c.style.setProperty("max-width","900px"),c.style.setProperty("width","calc(100% - 64px)"),h.style.setProperty("width","100%"),h.style.setProperty("display","flex"),h.style.setProperty("flex-direction","row-reverse"),h.style.setProperty("height","50px"),h.style.setProperty("align-items","center"),u.$$click=()=>{s(!0)},u.style.setProperty("margin-right","20px"),u.style.setProperty("border","1px solid rgba(244, 67, 54, 0.5)"),u.style.setProperty("border-radius"," 5px"),u.style.setProperty("padding","5px 15px"),u.style.setProperty("font-size"," 0.875rem"),u.style.setProperty("color","#f44336"),u.style.setProperty("font-family","Roboto,sans-serif"),u.style.setProperty("font-weight","600"),u.style.setProperty("display","flex"),u.style.setProperty("align-items","center"),u.style.setProperty("margin-top","20px"),p.style.setProperty("display","inherit"),p.style.setProperty("margin-right","8px"),p.style.setProperty("margin-left","-4px"),ut(c,F(Kr,{get badgeBackgroundColor(){return e.theme?.chatWindow?.backgroundColor},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 t.chatflowid},get chatflowConfig(){return t.chatflowConfig},get apiHost(){return t.apiHost},get clearMsg(){return o()},get messages(){return t.messages},get setMessages(){return t.setMessages}}),null),l),F(X,{get when(){return r()},get children(){return F(ts,{get isOpen(){return r()},onClose:i,onConfirm:a,title:"清除聊天记录",content:"您确定要清除所有聊天记录吗?"})}})];var l,c,h,u,p}nt(["click"]);const ss=ot("<style>"),os=ot('<div part="bot">'),ns=t=>{const[e]=V(t,["theme"]),[r,s]=x(!1),[o,n]=x(!1),[i,a]=x(!1),[l,c]=x(!1),[h,u]=x(!1),[p,d]=x(!1),[f,g]=x([{message:t.welcomeMessage??"您好,有关高新申报的问题,您可以直接问我。",type:"apiMessage"}]),y=()=>{a(!1),u(!1)};var b;const m=()=>{c(!1)},w=()=>{console.log("确认操作"),m(),d(!0),d(!1)};return console.log(i(),r(),"open=",e.theme?.chatWindow?.botMessage,e.theme?.chatWindow?.userMessage),[" ",F(X,{get when(){return i()},get children(){return F(rs,{get isOpen(){return i()},onClose:y,get chatflowid(){return t.chatflowid},messages:f,setMessages:g})}}),F(X,{get when(){return l()},get children(){return F(ts,{get isOpen(){return l()},onClose:m,onConfirm:w,title:"清除聊天记录",content:"您确定要清除所有聊天记录吗?"})}}),F(Bt,U((()=>e.theme?.button),{toggleBot:()=>{r()?s(!1):(o()||n(!0),s(!0))},get isBotOpened(){return r()},isClearmessage:()=>{c(!0)},ismodalopen:()=>{console.log(" apiMessage tomodalBot = ",f()),a(!0),s(!1),u(!0)},ismodalopenClose:h})),(ut(b=ss(),Ct),b),(()=>{const s=os();return s.style.setProperty("transition","transform 200ms cubic-bezier(0, 1.2, 1, 1), opacity 150ms ease-out"),s.style.setProperty("transform-origin","bottom right"),s.style.setProperty("box-shadow","rgb(0 0 0 / 16%) 0px 5px 40px"),s.style.setProperty("z-index","42424242"),ut(s,F(X,{get when(){return o()},get children(){return F(Kr,{get badgeBackgroundColor(){return e.theme?.chatWindow?.backgroundColor},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 t.chatflowid},get chatflowConfig(){return t.chatflowConfig},get apiHost(){return t.apiHost},get clearMsg(){return p()},messages:f,setMessages:g})}})),k((o=>{var n=e.theme?.chatWindow?.height?e.theme?.chatWindow?.height.toString()+"px":"calc(100% - 100px)",i=r()?"scale3d(1, 1, 1)":"scale3d(0, 0, 1)",a=e.theme?.chatWindow?.backgroundColor||"#ffffff",l="fixed sm:right-5 rounded-lg w-full sm:w-[400px] max-h-[704px]"+(r()?" opacity-1":" opacity-0 pointer-events-none")+("large"===t.theme?.button?.size?" bottom-24":" bottom-20");return n!==o._v$&&(null!=(o._v$=n)?s.style.setProperty("height",n):s.style.removeProperty("height")),i!==o._v$2&&(null!=(o._v$2=i)?s.style.setProperty("transform",i):s.style.removeProperty("transform")),a!==o._v$3&&(null!=(o._v$3=a)?s.style.setProperty("background-color",a):s.style.removeProperty("background-color")),l!==o._v$4&&at(s,o._v$4=l),o}),{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),s})()]},is=ot("<style>"),as=ot("<div>"),ls=(t,{element:e})=>{const[r,s]=x(!1),o=new IntersectionObserver((t=>{t.some((t=>t.isIntersecting))&&s(!0)}));return S((()=>{o.observe(e)})),$((()=>{o.disconnect()})),[(ut(n=is(),Ct),n),F(X,{get when(){return r()},get children(){const e=as();return e.style.setProperty("margin","0px"),ut(e,F(Kr,{get badgeBackgroundColor(){return t.theme?.chatWindow?.backgroundColor},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 t.chatflowid},get chatflowConfig(){return t.chatflowConfig},get apiHost(){return t.apiHost}})),k((r=>{var s=t.theme?.chatWindow?.backgroundColor||"#ffffff",o=t.theme?.chatWindow?.height?t.theme?.chatWindow?.height.toString()+"px":"100vh",n=t.theme?.chatWindow?.width?t.theme?.chatWindow?.width.toString()+"px":"100%";return s!==r._v$&&(null!=(r._v$=s)?e.style.setProperty("background-color",s):e.style.removeProperty("background-color")),o!==r._v$2&&(null!=(r._v$2=o)?e.style.setProperty("height",o):e.style.removeProperty("height")),n!==r._v$3&&(null!=(r._v$3=n)?e.style.setProperty("width",n):e.style.removeProperty("width")),r}),{_v$:void 0,_v$2:void 0,_v$3:void 0}),e}})];var n},cs=t=>{var e=t.id?document.getElementById(t.id):document.querySelector("flowise-fullchatbot");if(!e)throw new Error("<flowise-fullchatbot> element not found.");Object.assign(e,t)},hs=t=>{var e=document.createElement("flowise-chatbot");Object.assign(e,t),document.body.appendChild(e)},us=("undefined"!=typeof window&&(vt("flowise-fullchatbot",xt,ls),vt("flowise-chatbot",xt,ns)),{initFull:cs,init:hs});(t=>{"undefined"!=typeof window&&(window.Chatbot={...t})})(us);export{us as default};