@molin.ai/shop-ai 0.9.24 → 0.9.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/molin-shop-ai.min.js +142 -142
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDescriptor;var Zd=Object.getOwnPropertyNames;var Jd=Object.getPrototypeOf,Kd=Object.prototype.hasOwnProperty;var Wl=r=>{throw TypeError(r)};var Yd=(r,e,t)=>e in r?_o(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var sn=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Xd=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Zd(e))!Kd.call(r,i)&&i!==t&&_o(r,i,{get:()=>e[i],enumerable:!(n=Gd(e,i))||n.enumerable});return r};var Qd=(r,e,t)=>(t=r!=null?Wd(Jd(r)):{},Xd(e||!r||!r.__esModule?_o(t,"default",{value:r,enumerable:!0}):t,r));var w=(r,e,t)=>Yd(r,typeof e!="symbol"?e+"":e,t),Io=(r,e,t)=>e.has(r)||Wl("Cannot "+t);var o=(r,e,t)=>(Io(r,e,"read from private field"),t?t.call(r):e.get(r)),p=(r,e,t)=>e.has(r)?Wl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),g=(r,e,t,n)=>(Io(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),m=(r,e,t)=>(Io(r,e,"access private method"),t);var Gl=(r,e,t,n)=>({set _(i){g(r,e,i,t)},get _(){return o(r,e,n)}});var qu=sn(Lt=>{"use strict";var C1=Lt&&Lt.__awaiter||function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function u(d){try{c(n.next(d))}catch(f){a(f)}}function l(d){try{c(n.throw(d))}catch(f){a(f)}}function c(d){d.done?s(d.value):i(d.value).then(u,l)}c((n=n.apply(r,e||[])).next())})},$1=Lt&&Lt.__generator||function(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(d){return l([c,d])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(t=0)),t;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,i=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){t.label=c[1];break}if(c[0]===6&&t.label<s[1]){t.label=s[1],s=c;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(c);break}s[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(d){c=[6,d],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.base64ToBlob=S1;function S1(r){return C1(this,void 0,void 0,function(){var e,t,n;return $1(this,function(i){switch(i.label){case 0:return[4,fetch(r)];case 1:return e=i.sent(),[4,e.blob()];case 2:return t=i.sent(),n=_1(r),n&&(t=t.slice(0,t.size,n)),[2,t]}})})}var E1=/^data:(.+);base64,/;function _1(r){var e;return(e=r.match(E1))===null||e===void 0?void 0:e.slice(1,2).pop()}});var Vu=sn(jt=>{"use strict";var I1=jt&&jt.__awaiter||function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function u(d){try{c(n.next(d))}catch(f){a(f)}}function l(d){try{c(n.throw(d))}catch(f){a(f)}}function c(d){d.done?s(d.value):i(d.value).then(u,l)}c((n=n.apply(r,e||[])).next())})},M1=jt&&jt.__generator||function(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(d){return l([c,d])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(t=0)),t;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,i=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){t.label=c[1];break}if(c[0]===6&&t.label<s[1]){t.label=s[1],s=c;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(c);break}s[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(d){c=[6,d],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(jt,"__esModule",{value:!0});jt.base64ToFile=A1;function A1(r,e,t){return I1(this,void 0,void 0,function(){var n,i;return M1(this,function(s){switch(s.label){case 0:return[4,fetch(r)];case 1:return n=s.sent(),[4,n.blob()];case 2:return i=s.sent(),[2,new File([i],e,t)]}})})}});var Pa=sn(Dt=>{"use strict";var Oa=Dt&&Dt.__awaiter||function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function u(d){try{c(n.next(d))}catch(f){a(f)}}function l(d){try{c(n.throw(d))}catch(f){a(f)}}function c(d){d.done?s(d.value):i(d.value).then(u,l)}c((n=n.apply(r,e||[])).next())})},Ua=Dt&&Dt.__generator||function(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(d){return l([c,d])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(t=0)),t;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,i=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){t.label=c[1];break}if(c[0]===6&&t.label<s[1]){t.label=s[1],s=c;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(c);break}s[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(r,t)}catch(d){c=[6,d],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.blobToBase64=T1;function T1(r){return Oa(this,void 0,void 0,function(){return Ua(this,function(e){return[2,typeof FileReader=="function"?L1(r):D1(r)]})})}var $r;(function(r){r.error="error",r.loadend="loadend"})($r||($r={}));function L1(r){return Oa(this,void 0,void 0,function(){return Ua(this,function(e){return[2,new Promise(function(t,n){try{var i=new FileReader,s=function(){t(i.result),i.removeEventListener($r.loadend,s)};i.addEventListener($r.loadend,s);var a=function(){n(i.error),i.removeEventListener($r.error,a)};i.addEventListener($r.error,a),i.readAsDataURL(r)}catch(u){n(u)}})]})})}var j1="application/octet-stream";function D1(r){return Oa(this,void 0,void 0,function(){var e,t,n,i;return Ua(this,function(s){switch(s.label){case 0:return n=(t=Buffer).from,[4,r.text()];case 1:return e=n.apply(t,[s.sent()]),i=r.type||j1,[2,"data:".concat(i,";base64,").concat(e.toString("base64"))]}})})}});var Fu=sn(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.fileToBase64=void 0;var O1=Pa();Object.defineProperty(us,"fileToBase64",{enumerable:!0,get:function(){return O1.blobToBase64}})});var Nu=sn(Pe=>{"use strict";var U1=Pe&&Pe.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),hs=Pe&&Pe.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&U1(e,r,t)};Object.defineProperty(Pe,"__esModule",{value:!0});hs(qu(),Pe);hs(Vu(),Pe);hs(Pa(),Pe);hs(Fu(),Pe)});var Ei=globalThis,_i=Ei.ShadowRoot&&(Ei.ShadyCSS===void 0||Ei.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Mo=Symbol(),Zl=new WeakMap,on=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Mo)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(_i&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=Zl.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Zl.set(t,e))}return e}toString(){return this.cssText}},Jl=r=>new on(typeof r=="string"?r:r+"",void 0,Mo),J=(r,...e)=>{let t=r.length===1?r[0]:e.reduce(((n,i,s)=>n+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[s+1]),r[0]);return new on(t,r,Mo)},Kl=(r,e)=>{if(_i)r.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(let t of e){let n=document.createElement("style"),i=Ei.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=t.cssText,r.appendChild(n)}},Ao=_i?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return Jl(t)})(r):r;var{is:ep,defineProperty:tp,getOwnPropertyDescriptor:rp,getOwnPropertyNames:np,getOwnPropertySymbols:ip,getPrototypeOf:sp}=Object,Ii=globalThis,Yl=Ii.trustedTypes,op=Yl?Yl.emptyScript:"",ap=Ii.reactiveElementPolyfillSupport,an=(r,e)=>r,To={toAttribute(r,e){switch(e){case Boolean:r=r?op:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},Ql=(r,e)=>!ep(r,e),Xl={attribute:!0,type:String,converter:To,reflect:!1,useDefault:!1,hasChanged:Ql};Symbol.metadata??=Symbol("metadata"),Ii.litPropertyMetadata??=new WeakMap;var Ne=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Xl){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),i=this.getPropertyDescriptor(e,n,t);i!==void 0&&tp(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){let{get:i,set:s}=rp(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:i,set(a){let u=i?.call(this);s?.call(this,a),this.requestUpdate(e,u,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Xl}static _$Ei(){if(this.hasOwnProperty(an("elementProperties")))return;let e=sp(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(an("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(an("properties"))){let t=this.properties,n=[...np(t),...ip(t)];for(let i of n)this.createProperty(i,t[i])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[n,i]of t)this.elementProperties.set(n,i)}this._$Eh=new Map;for(let[t,n]of this.elementProperties){let i=this._$Eu(t,n);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let i of n)t.unshift(Ao(i))}else e!==void 0&&t.push(Ao(e));return t}static _$Eu(e,t){let n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Kl(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(i!==void 0&&n.reflect===!0){let s=(n.converter?.toAttribute!==void 0?n.converter:To).toAttribute(t,n.type);this._$Em=e,s==null?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(e,t){let n=this.constructor,i=n._$Eh.get(e);if(i!==void 0&&this._$Em!==i){let s=n.getPropertyOptions(i),a=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:To;this._$Em=i;let u=a.fromAttribute(t,s.type);this[i]=u??this._$Ej?.get(i)??u,this._$Em=null}}requestUpdate(e,t,n){if(e!==void 0){let i=this.constructor,s=this[e];if(n??=i.getPropertyOptions(e),!((n.hasChanged??Ql)(s,t)||n.useDefault&&n.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(i._$Eu(e,n))))return;this.C(e,t,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:i,wrapped:s},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),s!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,s]of this._$Ep)this[i]=s;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[i,s]of n){let{wrapped:a}=s,u=this[i];a!==!0||this._$AL.has(i)||u===void 0||this.C(i,void 0,s,u)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((n=>n.hostUpdate?.())),this.update(t)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};Ne.elementStyles=[],Ne.shadowRootOptions={mode:"open"},Ne[an("elementProperties")]=new Map,Ne[an("finalized")]=new Map,ap?.({ReactiveElement:Ne}),(Ii.reactiveElementVersions??=[]).push("2.1.1");var jo=globalThis,Mi=jo.trustedTypes,ec=Mi?Mi.createPolicy("lit-html",{createHTML:r=>r}):void 0,Do="$lit$",He=`lit$${Math.random().toFixed(9).slice(2)}$`,Oo="?"+He,lp=`<${Oo}>`,xt=document,cn=()=>xt.createComment(""),un=r=>r===null||typeof r!="object"&&typeof r!="function",Uo=Array.isArray,oc=r=>Uo(r)||typeof r?.[Symbol.iterator]=="function",Lo=`[
|
|
2
|
-
\f\r]`,ln=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
1
|
+
var Gd=Object.create;var Io=Object.defineProperty;var Zd=Object.getOwnPropertyDescriptor;var Jd=Object.getOwnPropertyNames;var Kd=Object.getPrototypeOf,Yd=Object.prototype.hasOwnProperty;var Gl=r=>{throw TypeError(r)};var Xd=(r,e,t)=>e in r?Io(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var sn=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Qd=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Jd(e))!Yd.call(r,i)&&i!==t&&Io(r,i,{get:()=>e[i],enumerable:!(n=Zd(e,i))||n.enumerable});return r};var ep=(r,e,t)=>(t=r!=null?Gd(Kd(r)):{},Qd(e||!r||!r.__esModule?Io(t,"default",{value:r,enumerable:!0}):t,r));var w=(r,e,t)=>Xd(r,typeof e!="symbol"?e+"":e,t),Mo=(r,e,t)=>e.has(r)||Gl("Cannot "+t);var o=(r,e,t)=>(Mo(r,e,"read from private field"),t?t.call(r):e.get(r)),p=(r,e,t)=>e.has(r)?Gl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),g=(r,e,t,n)=>(Mo(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),m=(r,e,t)=>(Mo(r,e,"access private method"),t);var Zl=(r,e,t,n)=>({set _(i){g(r,e,i,t)},get _(){return o(r,e,n)}});var Vu=sn(Lt=>{"use strict";var $1=Lt&&Lt.__awaiter||function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function l(d){try{u(n.next(d))}catch(f){a(f)}}function c(d){try{u(n.throw(d))}catch(f){a(f)}}function u(d){d.done?s(d.value):i(d.value).then(l,c)}u((n=n.apply(r,e||[])).next())})},S1=Lt&&Lt.__generator||function(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(t=0)),t;)try{if(n=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){t.label=u[1];break}if(u[0]===6&&t.label<s[1]){t.label=s[1],s=u;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(u);break}s[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(d){u=[6,d],i=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.base64ToBlob=E1;function E1(r){return $1(this,void 0,void 0,function(){var e,t,n;return S1(this,function(i){switch(i.label){case 0:return[4,fetch(r)];case 1:return e=i.sent(),[4,e.blob()];case 2:return t=i.sent(),n=I1(r),n&&(t=t.slice(0,t.size,n)),[2,t]}})})}var _1=/^data:(.+);base64,/;function I1(r){var e;return(e=r.match(_1))===null||e===void 0?void 0:e.slice(1,2).pop()}});var Fu=sn(jt=>{"use strict";var M1=jt&&jt.__awaiter||function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function l(d){try{u(n.next(d))}catch(f){a(f)}}function c(d){try{u(n.throw(d))}catch(f){a(f)}}function u(d){d.done?s(d.value):i(d.value).then(l,c)}u((n=n.apply(r,e||[])).next())})},A1=jt&&jt.__generator||function(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(t=0)),t;)try{if(n=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){t.label=u[1];break}if(u[0]===6&&t.label<s[1]){t.label=s[1],s=u;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(u);break}s[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(d){u=[6,d],i=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(jt,"__esModule",{value:!0});jt.base64ToFile=T1;function T1(r,e,t){return M1(this,void 0,void 0,function(){var n,i;return A1(this,function(s){switch(s.label){case 0:return[4,fetch(r)];case 1:return n=s.sent(),[4,n.blob()];case 2:return i=s.sent(),[2,new File([i],e,t)]}})})}});var Ra=sn(Dt=>{"use strict";var Ua=Dt&&Dt.__awaiter||function(r,e,t,n){function i(s){return s instanceof t?s:new t(function(a){a(s)})}return new(t||(t=Promise))(function(s,a){function l(d){try{u(n.next(d))}catch(f){a(f)}}function c(d){try{u(n.throw(d))}catch(f){a(f)}}function u(d){d.done?s(d.value):i(d.value).then(l,c)}u((n=n.apply(r,e||[])).next())})},Pa=Dt&&Dt.__generator||function(r,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function l(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(t=0)),t;)try{if(n=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){t.label=u[1];break}if(u[0]===6&&t.label<s[1]){t.label=s[1],s=u;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(u);break}s[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(d){u=[6,d],i=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.blobToBase64=L1;function L1(r){return Ua(this,void 0,void 0,function(){return Pa(this,function(e){return[2,typeof FileReader=="function"?j1(r):O1(r)]})})}var $r;(function(r){r.error="error",r.loadend="loadend"})($r||($r={}));function j1(r){return Ua(this,void 0,void 0,function(){return Pa(this,function(e){return[2,new Promise(function(t,n){try{var i=new FileReader,s=function(){t(i.result),i.removeEventListener($r.loadend,s)};i.addEventListener($r.loadend,s);var a=function(){n(i.error),i.removeEventListener($r.error,a)};i.addEventListener($r.error,a),i.readAsDataURL(r)}catch(l){n(l)}})]})})}var D1="application/octet-stream";function O1(r){return Ua(this,void 0,void 0,function(){var e,t,n,i;return Pa(this,function(s){switch(s.label){case 0:return n=(t=Buffer).from,[4,r.text()];case 1:return e=n.apply(t,[s.sent()]),i=r.type||D1,[2,"data:".concat(i,";base64,").concat(e.toString("base64"))]}})})}});var Nu=sn(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.fileToBase64=void 0;var U1=Ra();Object.defineProperty(hs,"fileToBase64",{enumerable:!0,get:function(){return U1.blobToBase64}})});var Hu=sn(Pe=>{"use strict";var P1=Pe&&Pe.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),ds=Pe&&Pe.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&P1(e,r,t)};Object.defineProperty(Pe,"__esModule",{value:!0});ds(Vu(),Pe);ds(Fu(),Pe);ds(Ra(),Pe);ds(Nu(),Pe)});var _i=globalThis,Ii=_i.ShadowRoot&&(_i.ShadyCSS===void 0||_i.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ao=Symbol(),Jl=new WeakMap,on=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Ao)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(Ii&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=Jl.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Jl.set(t,e))}return e}toString(){return this.cssText}},Kl=r=>new on(typeof r=="string"?r:r+"",void 0,Ao),J=(r,...e)=>{let t=r.length===1?r[0]:e.reduce(((n,i,s)=>n+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[s+1]),r[0]);return new on(t,r,Ao)},Yl=(r,e)=>{if(Ii)r.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(let t of e){let n=document.createElement("style"),i=_i.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=t.cssText,r.appendChild(n)}},To=Ii?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(let n of e.cssRules)t+=n.cssText;return Kl(t)})(r):r;var{is:tp,defineProperty:rp,getOwnPropertyDescriptor:np,getOwnPropertyNames:ip,getOwnPropertySymbols:sp,getPrototypeOf:op}=Object,Mi=globalThis,Xl=Mi.trustedTypes,ap=Xl?Xl.emptyScript:"",lp=Mi.reactiveElementPolyfillSupport,an=(r,e)=>r,Lo={toAttribute(r,e){switch(e){case Boolean:r=r?ap:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},ec=(r,e)=>!tp(r,e),Ql={attribute:!0,type:String,converter:Lo,reflect:!1,useDefault:!1,hasChanged:ec};Symbol.metadata??=Symbol("metadata"),Mi.litPropertyMetadata??=new WeakMap;var Ne=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=Ql){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),i=this.getPropertyDescriptor(e,n,t);i!==void 0&&rp(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){let{get:i,set:s}=np(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:i,set(a){let l=i?.call(this);s?.call(this,a),this.requestUpdate(e,l,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Ql}static _$Ei(){if(this.hasOwnProperty(an("elementProperties")))return;let e=op(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(an("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(an("properties"))){let t=this.properties,n=[...ip(t),...sp(t)];for(let i of n)this.createProperty(i,t[i])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[n,i]of t)this.elementProperties.set(n,i)}this._$Eh=new Map;for(let[t,n]of this.elementProperties){let i=this._$Eu(t,n);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let i of n)t.unshift(To(i))}else e!==void 0&&t.push(To(e));return t}static _$Eu(e,t){let n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Yl(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(i!==void 0&&n.reflect===!0){let s=(n.converter?.toAttribute!==void 0?n.converter:Lo).toAttribute(t,n.type);this._$Em=e,s==null?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(e,t){let n=this.constructor,i=n._$Eh.get(e);if(i!==void 0&&this._$Em!==i){let s=n.getPropertyOptions(i),a=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:Lo;this._$Em=i;let l=a.fromAttribute(t,s.type);this[i]=l??this._$Ej?.get(i)??l,this._$Em=null}}requestUpdate(e,t,n){if(e!==void 0){let i=this.constructor,s=this[e];if(n??=i.getPropertyOptions(e),!((n.hasChanged??ec)(s,t)||n.useDefault&&n.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(i._$Eu(e,n))))return;this.C(e,t,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:i,wrapped:s},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),s!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,s]of this._$Ep)this[i]=s;this._$Ep=void 0}let n=this.constructor.elementProperties;if(n.size>0)for(let[i,s]of n){let{wrapped:a}=s,l=this[i];a!==!0||this._$AL.has(i)||l===void 0||this.C(i,void 0,s,l)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((n=>n.hostUpdate?.())),this.update(t)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};Ne.elementStyles=[],Ne.shadowRootOptions={mode:"open"},Ne[an("elementProperties")]=new Map,Ne[an("finalized")]=new Map,lp?.({ReactiveElement:Ne}),(Mi.reactiveElementVersions??=[]).push("2.1.1");var Do=globalThis,Ai=Do.trustedTypes,tc=Ai?Ai.createPolicy("lit-html",{createHTML:r=>r}):void 0,Oo="$lit$",He=`lit$${Math.random().toFixed(9).slice(2)}$`,Uo="?"+He,cp=`<${Uo}>`,xt=document,cn=()=>xt.createComment(""),un=r=>r===null||typeof r!="object"&&typeof r!="function",Po=Array.isArray,ac=r=>Po(r)||typeof r?.[Symbol.iterator]=="function",jo=`[
|
|
2
|
+
\f\r]`,ln=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,rc=/-->/g,nc=/>/g,vt=RegExp(`>|${jo}(?:([^\\s"'>=/]+)(${jo}*=${jo}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ic=/'/g,sc=/"/g,lc=/^(?:script|style|textarea|title)$/i,Ro=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),h=Ro(1),W0=Ro(2),G0=Ro(3),Ae=Symbol.for("lit-noChange"),W=Symbol.for("lit-nothing"),oc=new WeakMap,bt=xt.createTreeWalker(xt,129);function cc(r,e){if(!Po(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return tc!==void 0?tc.createHTML(e):e}var uc=(r,e)=>{let t=r.length-1,n=[],i,s=e===2?"<svg>":e===3?"<math>":"",a=ln;for(let l=0;l<t;l++){let c=r[l],u,d,f=-1,y=0;for(;y<c.length&&(a.lastIndex=y,d=a.exec(c),d!==null);)y=a.lastIndex,a===ln?d[1]==="!--"?a=rc:d[1]!==void 0?a=nc:d[2]!==void 0?(lc.test(d[2])&&(i=RegExp("</"+d[2],"g")),a=vt):d[3]!==void 0&&(a=vt):a===vt?d[0]===">"?(a=i??ln,f=-1):d[1]===void 0?f=-2:(f=a.lastIndex-d[2].length,u=d[1],a=d[3]===void 0?vt:d[3]==='"'?sc:ic):a===sc||a===ic?a=vt:a===rc||a===nc?a=ln:(a=vt,i=void 0);let k=a===vt&&r[l+1].startsWith("/>")?" ":"";s+=a===ln?c+cp:f>=0?(n.push(u),c.slice(0,f)+Oo+c.slice(f)+He+k):c+He+(f===-2?l:k)}return[cc(r,s+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},hn=class r{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let s=0,a=0,l=e.length-1,c=this.parts,[u,d]=uc(e,t);if(this.el=r.createElement(u,n),bt.currentNode=this.el.content,t===2||t===3){let f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(i=bt.nextNode())!==null&&c.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(let f of i.getAttributeNames())if(f.endsWith(Oo)){let y=d[a++],k=i.getAttribute(f).split(He),$=/([.?@])?(.*)/.exec(y);c.push({type:1,index:s,name:$[2],strings:k,ctor:$[1]==="."?Li:$[1]==="?"?ji:$[1]==="@"?Di:Ct}),i.removeAttribute(f)}else f.startsWith(He)&&(c.push({type:6,index:s}),i.removeAttribute(f));if(lc.test(i.tagName)){let f=i.textContent.split(He),y=f.length-1;if(y>0){i.textContent=Ai?Ai.emptyScript:"";for(let k=0;k<y;k++)i.append(f[k],cn()),bt.nextNode(),c.push({type:2,index:++s});i.append(f[y],cn())}}}else if(i.nodeType===8)if(i.data===Uo)c.push({type:2,index:s});else{let f=-1;for(;(f=i.data.indexOf(He,f+1))!==-1;)c.push({type:7,index:s}),f+=He.length-1}s++}}static createElement(e,t){let n=xt.createElement("template");return n.innerHTML=e,n}};function kt(r,e,t=r,n){if(e===Ae)return e;let i=n!==void 0?t._$Co?.[n]:t._$Cl,s=un(e)?void 0:e._$litDirective$;return i?.constructor!==s&&(i?._$AO?.(!1),s===void 0?i=void 0:(i=new s(r),i._$AT(r,t,n)),n!==void 0?(t._$Co??=[])[n]=i:t._$Cl=i),i!==void 0&&(e=kt(r,i._$AS(r,e.values),i,n)),e}var Ti=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,i=(e?.creationScope??xt).importNode(t,!0);bt.currentNode=i;let s=bt.nextNode(),a=0,l=0,c=n[0];for(;c!==void 0;){if(a===c.index){let u;c.type===2?u=new Xt(s,s.nextSibling,this,e):c.type===1?u=new c.ctor(s,c.name,c.strings,this,e):c.type===6&&(u=new Oi(s,this,e)),this._$AV.push(u),c=n[++l]}a!==c?.index&&(s=bt.nextNode(),a++)}return bt.currentNode=xt,i}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},Xt=class r{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,i){this.type=2,this._$AH=W,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=kt(this,e,t),un(e)?e===W||e==null||e===""?(this._$AH!==W&&this._$AR(),this._$AH=W):e!==this._$AH&&e!==Ae&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):ac(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==W&&un(this._$AH)?this._$AA.nextSibling.data=e:this.T(xt.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,i=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=hn.createElement(cc(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(t);else{let s=new Ti(i,this),a=s.u(this.options);s.p(t),this.T(a),this._$AH=s}}_$AC(e){let t=oc.get(e.strings);return t===void 0&&oc.set(e.strings,t=new hn(e)),t}k(e){Po(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,n,i=0;for(let s of e)i===t.length?t.push(n=new r(this.O(cn()),this.O(cn()),this,this.options)):n=t[i],n._$AI(s),i++;i<t.length&&(this._$AR(n&&n._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let n=e.nextSibling;e.remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Ct=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,i,s){this.type=1,this._$AH=W,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=s,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=W}_$AI(e,t=this,n,i){let s=this.strings,a=!1;if(s===void 0)e=kt(this,e,t,0),a=!un(e)||e!==this._$AH&&e!==Ae,a&&(this._$AH=e);else{let l=e,c,u;for(e=s[0],c=0;c<s.length-1;c++)u=kt(this,l[n+c],t,c),u===Ae&&(u=this._$AH[c]),a||=!un(u)||u!==this._$AH[c],u===W?e=W:e!==W&&(e+=(u??"")+s[c+1]),this._$AH[c]=u}a&&!i&&this.j(e)}j(e){e===W?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Li=class extends Ct{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===W?void 0:e}},ji=class extends Ct{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==W)}},Di=class extends Ct{constructor(e,t,n,i,s){super(e,t,n,i,s),this.type=5}_$AI(e,t=this){if((e=kt(this,e,t,0)??W)===Ae)return;let n=this._$AH,i=e===W&&n!==W||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,s=e!==W&&(n===W||i);i&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Oi=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){kt(this,e)}},hc={M:Oo,P:He,A:Uo,C:1,L:uc,R:Ti,D:ac,V:kt,I:Xt,H:Ct,N:ji,U:Di,B:Li,F:Oi},up=Do.litHtmlPolyfillSupport;up?.(hn,Xt),(Do.litHtmlVersions??=[]).push("3.3.1");var dc=(r,e,t)=>{let n=t?.renderBefore??e,i=n._$litPart$;if(i===void 0){let s=t?.renderBefore??null;n._$litPart$=i=new Xt(e.insertBefore(cn(),s),s,void 0,t??{})}return i._$AI(r),i};var Bo=globalThis,C=class extends Ne{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=dc(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Ae}};C._$litElement$=!0,C.finalized=!0,Bo.litElementHydrateSupport?.({LitElement:C});var hp=Bo.litElementPolyfillSupport;hp?.({LitElement:C});(Bo.litElementVersions??=[]).push("4.2.1");var dn=class dn extends HTMLElement{constructor(){super();w(this,"name","");this.attachShadow({mode:"open"})}attributeChangedCallback(t,n,i){if(n!==i&&dn.observedAttributes.includes(t)){switch(t){case"name":this.name=i||"";break}this.render()}}resolveIcon(t){throw new Error("Not implemented")}render(){let t=document.createElement("style");for(t.textContent=`
|
|
4
4
|
:host {
|
|
5
5
|
display: inline-block;
|
|
6
6
|
line-height: 0;
|
|
7
7
|
}
|
|
8
|
-
`;this.shadowRoot?.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild),this.shadowRoot.appendChild(t);if(!this.name)return;let n=this.resolveIcon(this.name);if(!n){console.warn(`'${this.name}' not found, please add it to ${dn.name}`);return}let a=new DOMParser().parseFromString(n,"image/svg+xml").documentElement;a.setAttribute("fill","currentColor"),a.style.width="100%",a.style.height="100%",this.shadowRoot?.appendChild(a)}};w(dn,"observedAttributes",["name"]);var
|
|
8
|
+
`;this.shadowRoot?.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild),this.shadowRoot.appendChild(t);if(!this.name)return;let n=this.resolveIcon(this.name);if(!n){console.warn(`'${this.name}' not found, please add it to ${dn.name}`);return}let a=new DOMParser().parseFromString(n,"image/svg+xml").documentElement;a.setAttribute("fill","currentColor"),a.style.width="100%",a.style.height="100%",this.shadowRoot?.appendChild(a)}};w(dn,"observedAttributes",["name"]);var Ui=dn;var pc={clock:`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
9
9
|
<path d="M12 6V12H16.5M21 12C21 16.9706 16.9706 21 12 21C7.02944 21 3 16.9706 3 12C3 7.02944 7.02944 3 12 3C16.9706 3 21 7.02944 21 12Z" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
10
10
|
</svg>`,"arrow-path":`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
11
11
|
<path d="M16.0228 9.34841H21.0154V9.34663M2.98413 19.6444V14.6517M2.98413 14.6517L7.97677 14.6517M2.98413 14.6517L6.16502 17.8347C7.15555 18.8271 8.41261 19.58 9.86436 19.969C14.2654 21.1483 18.7892 18.5364 19.9685 14.1353M4.03073 9.86484C5.21 5.46374 9.73377 2.85194 14.1349 4.03121C15.5866 4.4202 16.8437 5.17312 17.8342 6.1655L21.0154 9.34663M21.0154 4.3558V9.34663" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
@@ -127,7 +127,7 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
127
127
|
<path d="M3.97993 8.22257C3.05683 9.31382 2.35242 10.596 1.93436 12.0015C3.22565 16.338 7.24311 19.5 11.9991 19.5C12.9917 19.5 13.9521 19.3623 14.8623 19.1049M6.22763 6.22763C7.88389 5.13558 9.86771 4.5 12 4.5C16.756 4.5 20.7734 7.66205 22.0647 11.9985C21.3528 14.3919 19.8106 16.4277 17.772 17.772M6.22763 6.22763L3 3M6.22763 6.22763L9.87868 9.87868M17.772 17.772L21 21M17.772 17.772L14.1213 14.1213M14.1213 14.1213C14.6642 13.5784 15 12.8284 15 12C15 10.3431 13.6569 9 12 9C11.1716 9 10.4216 9.33579 9.87868 9.87868M14.1213 14.1213L9.87868 9.87868" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
128
128
|
</svg>`,star:`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
129
129
|
<path d="M11.4806 3.4987C11.6728 3.03673 12.3272 3.03673 12.5193 3.4987L14.6453 8.61016C14.7263 8.80492 14.9095 8.93799 15.1197 8.95485L20.638 9.39724C21.1367 9.43722 21.339 10.0596 20.959 10.3851L16.7546 13.9866C16.5945 14.1238 16.5245 14.3391 16.5734 14.5443L17.8579 19.9292C17.974 20.4159 17.4446 20.8005 17.0176 20.5397L12.2932 17.6541C12.1132 17.5441 11.8868 17.5441 11.7068 17.6541L6.98238 20.5397C6.55539 20.8005 6.02594 20.4159 6.14203 19.9292L7.42652 14.5443C7.47546 14.3391 7.4055 14.1238 7.24531 13.9866L3.04099 10.3851C2.661 10.0596 2.86323 9.43722 3.36197 9.39724L8.88022 8.95485C9.09048 8.93799 9.27363 8.80492 9.35464 8.61016L11.4806 3.4987Z" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
130
|
-
</svg>`};var hp=dc,Bo=class extends Oi{resolveIcon(e){let t=hp[e];if(!t)throw console.warn("hi-outline: icon not found",e),new Error(`Icon ${e} not found`);return t}render(){super.render();let e=this.shadowRoot?.querySelector("svg");if(!e)throw new Error("svgEl not found "+this.name);e.setAttribute("fill","none"),e.querySelectorAll("[stroke]").forEach(t=>{t.setAttribute("stroke","currentColor")})}};customElements.get("hi-outline")||customElements.define("hi-outline",Bo);var pn,pe,we,fn,qo,Ui=class{constructor(e,t){p(this,fn);p(this,pn);p(this,pe);p(this,we);if(!e)throw new Error("host is required");if(!t)throw new Error("config is required");g(this,pn,e),o(this,pn).addController(this),g(this,pe,t)}connect(e){g(this,pe,e),g(this,we,m(this,fn,qo).call(this))}hostConnected(){o(this,we)||setTimeout(()=>{o(this,we)||g(this,we,m(this,fn,qo).call(this))},0)}hostDisconnected(){o(this,we)?.close(1e3,"lit_host_disconnected"),g(this,we,void 0)}send(e){o(this,we)?.send(e)}close(e,t){o(this,we)?.close(e,t)}get isConnected(){return o(this,we)?.readyState===WebSocket.OPEN}get isConnecting(){return o(this,we)?.readyState===WebSocket.CONNECTING}};pn=new WeakMap,pe=new WeakMap,we=new WeakMap,fn=new WeakSet,qo=function(){let e=new WebSocket(o(this,pe).url());return o(this,pe).onClose&&(e.onclose=o(this,pe).onClose),o(this,pe).onOpen&&(e.onopen=o(this,pe).onOpen),o(this,pe).onError&&(e.onerror=o(this,pe).onError),o(this,pe).onMessage&&(e.onmessage=o(this,pe).onMessage),e};var pc=Array.isArray;var Vo=r=>!!(r&&r.constructor&&r.call&&r.apply);var fc=r=>!(!r||!r.then||!Vo(r.then));var Fo=(r,e,t=!1)=>{if(!r)return[];let n=(s,a)=>e(s)-e(a),i=(s,a)=>e(a)-e(s);return r.slice().sort(t===!0?i:n)};function*Qt(r,e,t=i=>i,n=1){let i=Vo(t)?t:()=>t,s=e?r:0,a=e??r;for(let u=s;u<=a&&(yield i(u),!(u+n>a));u+=n);}var No=(r,e,t,n)=>Array.from(Qt(r,e,t,n));var Ho=(r,e)=>r?r.reduce((t,n)=>{let[i,s]=t;return e(n)?[[...i,n],s]:[i,[...s,n]]},[[],[]]):[[],[]];var zo=class extends Error{constructor(e=[]){super();let t=e.find(n=>n.name)?.name??"";this.name=`AggregateError(${t}...)`,this.message=`AggregateError with ${e.length} errors`,this.stack=e.find(n=>n.stack)?.stack??this.stack,this.errors=e}},Wo=async(r,e,t)=>{let n=e.map((c,d)=>({index:d,item:c})),i=async c=>{let d=[];for(;;){let f=n.pop();if(!f)return c(d);let[y,x]=await tr(t)(f.item);d.push({error:y,result:x,index:f.index})}},s=No(1,r).map(()=>new Promise(i)),a=await Promise.all(s),[u,l]=Ho(Fo(a.flat(),c=>c.index),c=>!!c.error);if(u.length>0)throw new zo(u.map(c=>c.error));return l.map(c=>c.result)};var Go=async(r,e)=>{let t=r?.times??3,n=r?.delay,i=r?.backoff??null;for(let s of Qt(1,t)){let[a,u]=await tr(e)(l=>{throw{_exited:l}});if(!a)return u;if(a._exited)throw a._exited;if(s===t)throw a;n&&await er(n),i&&await er(i(s))}},er=r=>new Promise(e=>setTimeout(e,r)),tr=r=>(...e)=>{try{let t=r(...e);return fc(t)?t.then(n=>[void 0,n]).catch(n=>[n,void 0]):[void 0,t]}catch(t){return[t,void 0]}};var rr=({interval:r},e)=>{let t=!0,n,i=(...s)=>{t&&(e(...s),t=!1,n=setTimeout(()=>{t=!0,n=void 0},r))};return i.isThrottled=()=>n!==void 0,i};async function mc(r,e){let t=r?.times??3,n=r?.delay,i=r?.backoff??null;for(let s of Qt(1,t)){let[a,u]=await tr(e)(l=>{throw{_exited:l}});if(!a)return u;if(a._exited)throw a._exited;if(s===t)throw a;n&&await er(n),i&&await er(i(s))}throw new Error("unreachable")}var dp=!0,Zo="Invariant failed";function Ce(r,e){if(!r){if(dp)throw new Error(Zo);var t=typeof e=="function"?e():e,n=t?"".concat(Zo,": ").concat(t):Zo;throw new Error(n)}}var K,Y,G,nr,ir,$e,fe,Pi,gc,wc,yc,vc,Ri=class{constructor(e,t){p(this,fe);p(this,K);p(this,Y);p(this,G,null);w(this,"isStreaming",!1);w(this,"typingIndicator");w(this,"ranOutOfCredits",!1);w(this,"messages",[]);w(this,"conversationId","");p(this,nr,0);p(this,ir);w(this,"isLiveMode",!1);p(this,$e,[]);g(this,K,e),g(this,Y,t),o(this,Y).autoConnect!==!1&&g(this,G,this.initWS()),e.addController(this)}get hasQueuedMessages(){return o(this,$e).length>0}async enqueueMessage(e,{expectStreaming:t=!1}={}){if(o(this,$e).length>0){let n=o(this,$e)[o(this,$e).length-1];if(e.type==="USER_INPUT"&&n.message.type==="USER_INPUT"&&e.value===n.message.value)return!0}return o(this,G)||this.connect(),o(this,G)?.isConnected?m(this,fe,Pi).call(this,e,{expectStreaming:t}):(o(this,$e).push({message:e,options:{expectStreaming:t}}),o(this,K).requestUpdate(),o(this,G)&&!o(this,G).isConnecting&&!o(this,G).isConnected&&this.retry(),await mc({times:5,delay:2e3},async()=>{if(o(this,G)?.isConnected){let n=[...o(this,$e)];g(this,$e,[]),o(this,K).requestUpdate();let i=!1;for(let{message:s,options:a}of n){let u=m(this,fe,Pi).call(this,s,a);s===e&&(i=u)}return i}else throw new Error("WebSocket not connected yet")}).catch(()=>(console.warn("Failed to send message after retries",e),g(this,$e,[]),o(this,K).requestUpdate(),!1)))}async sendUserInput(e,{xUserData:t,xCustomInstructions:n,role:i="user",expectStreaming:s=!1,requestInputResponse:a}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:i,xUserData:t,xCustomInstructions:n,requestInputResponse:a},{expectStreaming:s})}async enqueueUserInput(e,{xUserData:t,xCustomInstructions:n,role:i="user",expectStreaming:s=!1,requestInputResponse:a}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:i,xUserData:t,xCustomInstructions:n,requestInputResponse:a},{expectStreaming:s})}sendImageDelete(e){Ce(e,"imageId is required"),this.enqueueMessage({type:"USER_FILE_DELETE",imageId:e}).catch(console.warn)}sendUserCancel(){this.enqueueMessage({type:"USER_CANCEL"}).catch(console.warn)}sendUserTypingStart(){m(this,fe,Pi).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){this.enqueueMessage({type:"USER_TYPING_STOP"}).catch(console.warn)}sendNewChat(){this.enqueueMessage({type:"NEW_CHAT"})}sendUserMeta(e){this.enqueueMessage({type:"USER_META",metadata:e}).catch(console.warn)}reloadConfig(){this.enqueueMessage({type:"RELOAD_CONFIG"}).catch(console.warn)}close(){o(this,G)?.close(1e3,"closed by user")}retry(){clearTimeout(o(this,ir)),g(this,ir,setTimeout(()=>{o(this,Y).onReconnect?.(),g(this,G,this.initWS())},1e3*o(this,nr))),Gl(this,nr)._++}initWS(){return new Ui(o(this,K),{url:()=>o(this,Y).url(this.conversationId,{}),onOpen:e=>m(this,fe,gc).call(this,e),onMessage:e=>m(this,fe,wc).call(this,JSON.parse(e.data)),onError:e=>m(this,fe,yc).call(this,e),onClose:e=>m(this,fe,vc).call(this,e)})}hostConnected(){this.conversationId=o(this,Y).restoreConversationState?.()?.conversationId||"",this.messages=o(this,Y).restoreConversationState?.()?.messages||[]}reset(){o(this,Y).onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,g(this,$e,[]),o(this,K).requestUpdate()}hostDisconnected(){clearTimeout(o(this,ir))}connect(){o(this,G)||g(this,G,this.initWS())}reconnectSocket(){o(this,G)?.close(1e3,"destroy"),g(this,G,this.initWS())}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}get isConnected(){return o(this,G)?.isConnected??!1}};K=new WeakMap,Y=new WeakMap,G=new WeakMap,nr=new WeakMap,ir=new WeakMap,$e=new WeakMap,fe=new WeakSet,Pi=function(e,{expectStreaming:t=!1}={}){return this.ranOutOfCredits?!1:o(this,G)?o(this,G).isConnecting?(console.warn("WebSocket is connecting, message not sent",e),!1):o(this,G).isConnected?(t&&!this.isLiveMode&&(this.isStreaming=!0,o(this,K).requestUpdate()),o(this,G).send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent",e),this.retry(),!1):(console.warn("WebSocket not initialized, message not sent",e),this.connect(),!1)},gc=function(e){g(this,nr,0)},wc=function(e){switch(e.type){case"NEW_MESSAGE":{this.messages=[...this.messages,{...e.message,streaming:!0}].filter((t,n,i)=>n===i.findIndex(s=>s.id===t.id)),this.typingIndicator=void 0,o(this,K).requestUpdate(),o(this,Y).onNewMessage?.(e.message),o(this,Y).persistConversationState?.(this.conversationId,this.messages);break}case"APPEND_MESSAGE":{let t=this.messages.find(n=>n.id===e.message.id);if(t){switch(e.message.content_type){case"text":{let{part:n,delta:i,position:s}=e.message;t.content=t.content.slice(0,s)+i,t.parts||=[],t.parts[n]={text:t.parts[n]&&"text"in t.parts[n]?(t.parts[n].text||"").slice(0,s)+i:i};break}case"html":{let{part:n,delta:i,position:s}=e.message;t.parts||=[],t.parts[n]={html:t.parts[n]&&"html"in t.parts[n]?(t.parts[n].html||"").slice(0,s)+i:i};break}case"data":{let{part:n}=e.message;t.parts||=[],t.parts[n]={tag:e.message.tag,data:t.parts[n]&&"data"in t.parts[n]?Object.assign(t.parts[n].data||{},e.message.data):e.message.data};break}}e.metadata&&(t.metadata=e.metadata),o(this,Y).onMessageAppend?.(e),o(this,K).requestUpdate()}else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let t=this.messages.find(n=>n.id===e.message.id);if(t)Object.assign(t,e.message),t.streaming=!1;else throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,o(this,K).requestUpdate(),o(this,Y).onMessageDone?.(e,t),o(this,Y).persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,o(this,K).requestUpdate();break}case"ERROR":{o(this,Y).onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,o(this,Y).onConnect?.(e.conversationId,e.metadata),o(this,Y).persistConversationState?.(e.conversationId,e.messages),this.isLiveMode=e.metadata.isLiveMode,o(this,K).requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},o(this,K).requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,o(this,K).requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.ranOutOfCredits=!0,o(this,K).requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),o(this,K).requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},yc=function(e){console.error("onError",e),o(this,Y).onError?.(e)},vc=function(e){o(this,K).isConnected&&o(this,G)&&!o(this,G).isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,o(this,K).requestUpdate(),o(this,Y).onClose?.()};var x2=Symbol(),pp=Symbol();var bc=Object.getPrototypeOf,Jo=new WeakMap,fp=r=>r&&(Jo.has(r)?Jo.get(r):bc(r)===Object.prototype||bc(r)===Array.prototype);var xc=r=>fp(r)&&r[pp]||null,Ko=(r,e=!0)=>{Jo.set(r,e)};var Xo=r=>typeof r=="object"&&r!==null,mp=r=>Xo(r)&&!Qo.has(r)&&(Array.isArray(r)||!(Symbol.iterator in r))&&!(r instanceof WeakMap)&&!(r instanceof WeakSet)&&!(r instanceof Error)&&!(r instanceof Number)&&!(r instanceof Date)&&!(r instanceof String)&&!(r instanceof RegExp)&&!(r instanceof ArrayBuffer)&&!(r instanceof Promise),$c=(r,e)=>{let t=kc.get(r);if(t?.[0]===e)return t[1];let n=Array.isArray(r)?[]:Object.create(Object.getPrototypeOf(r));return Ko(n,!0),kc.set(r,[e,n]),Reflect.ownKeys(r).forEach(i=>{if(Object.getOwnPropertyDescriptor(n,i))return;let s=Reflect.get(r,i),{enumerable:a}=Reflect.getOwnPropertyDescriptor(r,i),u={value:s,enumerable:a,configurable:!0};if(Qo.has(s))Ko(s,!1);else if($t.has(s)){let[l,c]=$t.get(s);u.value=$c(l,c())}Object.defineProperty(n,i,u)}),Object.preventExtensions(n)},gp=(r,e,t,n)=>({deleteProperty(i,s){let a=Reflect.get(i,s);t(s);let u=Reflect.deleteProperty(i,s);return u&&n(["delete",[s],a]),u},set(i,s,a,u){let l=!r()&&Reflect.has(i,s),c=Reflect.get(i,s,u);if(l&&(Cc(c,a)||Bi.has(a)&&Cc(c,Bi.get(a))))return!0;t(s),Xo(a)&&(a=xc(a)||a);let d=!$t.has(a)&&yp(a)?ea(a):a;return e(s,d),Reflect.set(i,s,d,u),n(["set",[s],a,c]),!0}}),$t=new WeakMap,Qo=new WeakSet,kc=new WeakMap,Yo=[1],Bi=new WeakMap,Cc=Object.is,wp=(r,e)=>new Proxy(r,e),yp=mp,vp=$c,bp=gp;function ea(r={}){if(!Xo(r))throw new Error("object required");let e=Bi.get(r);if(e)return e;let t=Yo[0],n=new Set,i=(k,M=++Yo[0])=>{t!==M&&(s=t=M,n.forEach(C=>C(k,M)))},s=t,a=(k=Yo[0])=>(s!==k&&(s=k,l.forEach(([M])=>{let C=M[1](k);C>t&&(t=C)})),t),u=k=>(M,C)=>{let I=[...M];I[1]=[k,...I[1]],i(I,C)},l=new Map,c=(k,M)=>{let C=!Qo.has(M)&&$t.get(M);if(C){if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&l.has(k))throw new Error("prop listener already exists");if(n.size){let I=C[2](u(k));l.set(k,[C,I])}else l.set(k,[C])}},d=k=>{var M;let C=l.get(k);C&&(l.delete(k),(M=C[1])==null||M.call(C))},f=k=>(n.add(k),n.size===1&&l.forEach(([C,I],L)=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&I)throw new Error("remove already exists");let z=C[2](u(L));l.set(L,[C,z])}),()=>{n.delete(k),n.size===0&&l.forEach(([C,I],L)=>{I&&(I(),l.set(L,[C]))})}),y=!0,x=bp(()=>y,c,d,i),S=wp(r,x);Bi.set(r,S);let j=[r,a,f];return $t.set(S,j),Reflect.ownKeys(r).forEach(k=>{let M=Object.getOwnPropertyDescriptor(r,k);"value"in M&&M.writable&&(S[k]=r[k])}),y=!1,S}function qi(r,e,t){let n=$t.get(r);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!n&&console.warn("Please use proxy object");let i,s=[],a=n[2],u=!1,c=a(d=>{if(s.push(d),t){e(s.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,u&&e(s.splice(0))}))});return u=!0,()=>{u=!1,c()}}function sr(r){let e=$t.get(r);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!e&&console.warn("Please use proxy object");let[t,n]=e;return vp(t,n())}var mn,or,St,ar,lr=class{constructor(e,t){p(this,mn);p(this,or);p(this,St);p(this,ar,()=>{});g(this,mn,e),g(this,or,t),g(this,St,sr(t)),e.addController(this)}get state(){return o(this,St)}get value(){return o(this,St)}hostConnected(){o(this,ar).call(this),g(this,ar,qi(o(this,or),()=>{g(this,St,sr(o(this,or))),o(this,mn).requestUpdate()}))}hostDisconnected(){o(this,ar).call(this)}};mn=new WeakMap,or=new WeakMap,St=new WeakMap,ar=new WeakMap;var gn,wn,Et,cr,et=class{constructor(e,t,n){p(this,gn);p(this,wn);w(this,"proxyObject");p(this,Et);p(this,cr,()=>{});g(this,gn,e),g(this,wn,n),this.proxyObject=ea(t),g(this,Et,sr(this.proxyObject)),e.addController(this)}get state(){return o(this,Et)}get value(){return o(this,Et)}hostConnected(){o(this,cr).call(this),o(this,wn)?.subscribe&&g(this,cr,qi(this.proxyObject,()=>{g(this,Et,sr(this.proxyObject)),o(this,gn).requestUpdate()}))}hostDisconnected(){o(this,cr).call(this)}};gn=new WeakMap,wn=new WeakMap,Et=new WeakMap,cr=new WeakMap;var ur,yn,hr,_t,It,Vi=class{constructor(e,{provider:t,tag:n,key:i}){p(this,ur);p(this,yn);p(this,hr);p(this,_t,null);p(this,It,null);g(this,ur,e),g(this,yn,n),g(this,hr,i),e.addController(this)}get value(){return o(this,It)?o(this,It).value:null}hostConnected(){if(o(this,It)||(g(this,_t,xp(o(this,ur),o(this,yn))),!o(this,_t)))return;let e=o(this,_t)[o(this,hr)]instanceof et?o(this,_t)[o(this,hr)]:null;e&&g(this,It,new lr(o(this,ur),e.proxyObject))}hostDisconnected(){}};ur=new WeakMap,yn=new WeakMap,hr=new WeakMap,_t=new WeakMap,It=new WeakMap;function xp(r,e){let t=r;for(;t;){let n=t.closest(e);if(n)return n;let i=t.getRootNode();if(i instanceof ShadowRoot)t=i.host;else break}return null}var Sc=()=>{if(window.Shopify)try{return{customerId:kp()}}catch{return null}return null},kp=()=>{try{let r=[()=>window.ShopifyAnalytics?.meta?.page?.customerId,()=>window.meta?.page?.customerId,()=>window._st?.cid,()=>window.ShopifyAnalytics?.lib?.user()?.traits()?.uniqToken];for(let e of r)try{let t=e();if(/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i.test(t))continue;if(t)return t}catch{}}catch{return null}return null},Ec=async()=>{try{return(await(await fetch(window.Shopify.routes.root+"cart.js")).json()).items.map(n=>({id:n.id,name:n.title,quantity:n.quantity,price:n.price,variantId:n.variant_id,sku:n.sku,url:n.url,description:n.product_description,image:n.featured_image?.url}))}catch{return[]}};function _c(r,e="http"){return r.startsWith("http://")||r.startsWith("https://")?r:`${e}://${r}`}function ta(r){return new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+!*'();@&=,$]*)*(\\?[-a-z\\d%_.~+!*'();@&=,$]*)?(\\#[-a-z\\d%_.~+!*'();@&=,$]*)?$","i").test(r)}function Ic(r,e){let t=r instanceof URL?r:new URL(r);if(e)for(let[n,i]of e)t.searchParams.set(n,i);return t}var Mc=()=>{if(window.ShopRenter)try{let r=$p();return{customerEmail:r?.customerEmail,customerId:r?.customerId,customerName:r?.customerName}}catch{return null}return null},$p=()=>{try{if(window.ShopRenter){let r=window.ShopRenter.customer;return{customerEmail:r?.email,customerId:r?.userId,customerName:[r?.name?.firstName,r?.name?.lastName].filter(Boolean).join(" ")}}return{customerEmail:null,customerId:null,customerName:null}}catch{return{customerEmail:null,customerId:null,customerName:null}}},Ac=async()=>{try{let r=window.ShopRenter.shop?.domain;if(!r)return[];let e=_c(r,"https")+"/cart.json";return(await(await fetch(e)).json()).items.map(s=>({id:s.id,name:s.name,quantity:s.quantity,price:s.price,sku:s.sku,image:s.image,url:s.href}))}catch{return[]}};var Tc=()=>{if(window.UNAS)try{let r=window.UNAS.customer;return{customerEmail:r?.email,customerId:r?.id}}catch(r){return console.error("Error fetching customer information:",r),null}return null},Lc=async()=>new Promise((r,e)=>{try{window.UNAS.getCart(t=>{let i=t.items.map(s=>({id:s.id,name:s.name,quantity:s.quantity,price:s.price,sku:s.sku}));r(i)})}catch(t){console.error("Error fetching cart information:",t),e(t)}});var ra;function na(r){return{lang:r?.lang??ra?.lang,message:r?.message,abortEarly:r?.abortEarly??ra?.abortEarly,abortPipeEarly:r?.abortPipeEarly??ra?.abortPipeEarly}}var _p;function Ip(r){return _p?.get(r)}var Mp;function Ap(r){return Mp?.get(r)}var Tp;function Lp(r,e){return Tp?.get(r)?.get(e)}function Dc(r){let e=typeof r;return e==="string"?`"${r}"`:e==="number"||e==="bigint"||e==="boolean"?`${r}`:e==="object"||e==="function"?(r&&Object.getPrototypeOf(r)?.constructor?.name)??"null":e}function ye(r,e,t,n,i){let s=i&&"input"in i?i.input:t.value,a=i?.expected??r.expects??null,u=i?.received??Dc(s),l={kind:r.kind,type:r.type,input:s,expected:a,received:u,message:`Invalid ${e}: ${a?`Expected ${a} but r`:"R"}eceived ${u}`,requirement:r.requirement,path:i?.path,issues:i?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},c=r.kind==="schema",d=i?.message??r.message??Lp(r.reference,l.lang)??(c?Ap(l.lang):null)??n.message??Ip(l.lang);d!==void 0&&(l.message=typeof d=="function"?d(l):d),c&&(t.typed=!1),t.issues?t.issues.push(l):t.issues=[l]}function ve(r){return{version:1,vendor:"valibot",validate(e){return r["~run"]({value:e},na())}}}function jp(r,e){return Object.hasOwn(r,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Oc(r,e){let t=[...new Set(r)];return t.length>1?`(${t.join(` ${e} `)})`:t[0]??"never"}var Dp=class extends Error{constructor(r){super(r[0].message),this.name="ValiError",this.issues=r}};function ia(r,e){return{kind:"validation",type:"max_length",reference:ia,async:!1,expects:`<=${r}`,requirement:r,message:e,"~run"(t,n){return t.typed&&t.value.length>this.requirement&&ye(this,"length",t,n,{received:`${t.value.length}`}),t}}}function sa(r,e){return{kind:"validation",type:"min_length",reference:sa,async:!1,expects:`>=${r}`,requirement:r,message:e,"~run"(t,n){return t.typed&&t.value.length<this.requirement&&ye(this,"length",t,n,{received:`${t.value.length}`}),t}}}function Op(r,e,t){return typeof r.fallback=="function"?r.fallback(e,t):r.fallback}function Uc(r,e,t){return typeof r.default=="function"?r.default(e,t):r.default}function oa(){return{kind:"schema",type:"any",reference:oa,expects:"any",async:!1,get"~standard"(){return ve(this)},"~run"(r){return r.typed=!0,r}}}function dr(r,e){return{kind:"schema",type:"array",reference:dr,expects:"Array",async:!1,item:r,message:e,get"~standard"(){return ve(this)},"~run"(t,n){let i=t.value;if(Array.isArray(i)){t.typed=!0,t.value=[];for(let s=0;s<i.length;s++){let a=i[s],u=this.item["~run"]({value:a},n);if(u.issues){let l={type:"array",origin:"value",input:i,key:s,value:a};for(let c of u.issues)c.path?c.path.unshift(l):c.path=[l],t.issues?.push(c);if(t.issues||(t.issues=u.issues),n.abortEarly){t.typed=!1;break}}u.typed||(t.typed=!1),t.value.push(u.value)}}else ye(this,"type",t,n);return t}}}function aa(r){return{kind:"schema",type:"boolean",reference:aa,expects:"boolean",async:!1,message:r,get"~standard"(){return ve(this)},"~run"(e,t){return typeof e.value=="boolean"?e.typed=!0:ye(this,"type",e,t),e}}}function la(r){return{kind:"schema",type:"null",reference:la,expects:"null",async:!1,message:r,get"~standard"(){return ve(this)},"~run"(e,t){return e.value===null?e.typed=!0:ye(this,"type",e,t),e}}}function Fi(r){return{kind:"schema",type:"number",reference:Fi,expects:"number",async:!1,message:r,get"~standard"(){return ve(this)},"~run"(e,t){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:ye(this,"type",e,t),e}}}function ze(r,e){return{kind:"schema",type:"object",reference:ze,expects:"Object",async:!1,entries:r,message:e,get"~standard"(){return ve(this)},"~run"(t,n){let i=t.value;if(i&&typeof i=="object"){t.typed=!0,t.value={};for(let s in this.entries){let a=this.entries[s];if(s in i||(a.type==="exact_optional"||a.type==="optional"||a.type==="nullish")&&a.default!==void 0){let u=s in i?i[s]:Uc(a),l=a["~run"]({value:u},n);if(l.issues){let c={type:"object",origin:"value",input:i,key:s,value:u};for(let d of l.issues)d.path?d.path.unshift(c):d.path=[c],t.issues?.push(d);if(t.issues||(t.issues=l.issues),n.abortEarly){t.typed=!1;break}}l.typed||(t.typed=!1),t.value[s]=l.value}else if(a.fallback!==void 0)t.value[s]=Op(a);else if(a.type!=="exact_optional"&&a.type!=="optional"&&a.type!=="nullish"&&(ye(this,"key",t,n,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]}),n.abortEarly))break}}else ye(this,"type",t,n);return t}}}function pr(r,e){return{kind:"schema",type:"optional",reference:pr,expects:`(${r.expects} | undefined)`,async:!1,wrapped:r,default:e,get"~standard"(){return ve(this)},"~run"(t,n){return t.value===void 0&&(this.default!==void 0&&(t.value=Uc(this,t,n)),t.value===void 0)?(t.typed=!0,t):this.wrapped["~run"](t,n)}}}function ca(r,e){return{kind:"schema",type:"picklist",reference:ca,expects:Oc(r.map(Dc),"|"),async:!1,options:r,message:e,get"~standard"(){return ve(this)},"~run"(t,n){return this.options.includes(t.value)?t.typed=!0:ye(this,"type",t,n),t}}}function Ni(r,e,t){return{kind:"schema",type:"record",reference:Ni,expects:"Object",async:!1,key:r,value:e,message:t,get"~standard"(){return ve(this)},"~run"(n,i){let s=n.value;if(s&&typeof s=="object"){n.typed=!0,n.value={};for(let a in s)if(jp(s,a)){let u=s[a],l=this.key["~run"]({value:a},i);if(l.issues){let d={type:"object",origin:"key",input:s,key:a,value:u};for(let f of l.issues)f.path=[d],n.issues?.push(f);if(n.issues||(n.issues=l.issues),i.abortEarly){n.typed=!1;break}}let c=this.value["~run"]({value:u},i);if(c.issues){let d={type:"object",origin:"value",input:s,key:a,value:u};for(let f of c.issues)f.path?f.path.unshift(d):f.path=[d],n.issues?.push(f);if(n.issues||(n.issues=c.issues),i.abortEarly){n.typed=!1;break}}(!l.typed||!c.typed)&&(n.typed=!1),l.typed&&(n.value[l.value]=c.value)}}else ye(this,"type",n,i);return n}}}function X(r){return{kind:"schema",type:"string",reference:X,expects:"string",async:!1,message:r,get"~standard"(){return ve(this)},"~run"(e,t){return typeof e.value=="string"?e.typed=!0:ye(this,"type",e,t),e}}}function jc(r){let e;if(r)for(let t of r)e?e.push(...t.issues):e=t.issues;return e}function fr(r,e){return{kind:"schema",type:"union",reference:fr,expects:Oc(r.map(t=>t.expects),"|"),async:!1,options:r,message:e,get"~standard"(){return ve(this)},"~run"(t,n){let i,s,a;for(let u of this.options){let l=u["~run"]({value:t.value},n);if(l.typed)if(l.issues)s?s.push(l):s=[l];else{i=l;break}else a?a.push(l):a=[l]}if(i)return i;if(s){if(s.length===1)return s[0];ye(this,"type",t,n,{issues:jc(s)}),t.typed=!0}else{if(a?.length===1)return a[0];ye(this,"type",t,n,{issues:jc(a)})}return t}}}function Pc(r,e,t){let n=r["~run"]({value:e},na(t));if(n.issues)throw new Dp(n.issues);return n.value}function Rc(r,e){let t={};for(let n in r.entries)t[n]=!e||e.includes(n)?pr(r.entries[n]):r.entries[n];return{...r,entries:t,get"~standard"(){return ve(this)}}}function Bc(...r){return{...r[0],pipe:r,get"~standard"(){return ve(this)},"~run"(e,t){for(let n of r)if(n.kind!=="metadata"){if(e.issues&&(n.kind==="schema"||n.kind==="transformation")){e.typed=!1;break}(!e.issues||!t.abortEarly&&!t.abortPipeEarly)&&(e=n["~run"](e,t))}return e}}}function vn(r,e,t){let n=r["~run"]({value:e},na(t));return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}var qc=Ni(X(),fr([X(),Fi(),aa(),la()])),Vc=Bc(X(),sa(1),ia(5e3)),Fc=()=>{try{return window.UNAS?Tc():window.Shopify?Sc():window.ShopRenter?Mc():null}catch{return null}},Nc=async()=>{try{return window.UNAS?await Lc():window.Shopify?await Ec():window.ShopRenter?await Ac():[]}catch{return[]}},mr={schema:ze({conversationId:pr(X()),messages:pr(dr(ze({id:X(),timestamp:Fi(),role:ca(["user","assistant","support"]),content:X(),parts:pr(dr(fr([ze({text:X()}),ze({html:X()}),ze({tag:X(),data:Ni(X(),oa())})])))})))}),getStorageKey(r){if(!r)throw new Error("widgetId is not set");return`_molin_${r}`},persist(r,e,t){let n=this.getStorageKey(r);localStorage.setItem(n,JSON.stringify({conversationId:e,messages:t}))},restore(r){try{let e=this.getStorageKey(r),t=JSON.parse(localStorage.getItem(e)||"{}"),n=Pc(this.schema,t);return{conversationId:n.conversationId||"",messages:n.messages||[]}}catch(e){return console.error("Failed to restore conversation state:",e),{conversationId:"",messages:[]}}},reset(r){let e=this.getStorageKey(r);localStorage.removeItem(e)}};var U,Hc,bn,xn,gr,q,zc,zi=class zi extends ${constructor(){super();p(this,U);w(this,"contextCtrl");p(this,bn);p(this,xn);p(this,gr,null);this.widgetId="",this.config={},this.callbacks={},this.xUserData=void 0,this.xCustomInstructions=void 0,this.autoConnect=!1,this.contextCtrl=new et(this,{config:this.config,callbacks:this.callbacks,xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,widgetId:this.widgetId,conversationId:"",messages:[],isStreaming:!1,typingIndicator:void 0,ranOutOfCredits:!1,isLiveMode:!1,lastMsg:void 0,hasQueuedMessages:!1,isConnected:()=>o(this,U,q).isConnected,sendUserInput:this.sendUserInput.bind(this),sendUserCancel:this.sendUserCancel.bind(this),sendUserTypingStart:this.sendUserTypingStart.bind(this),sendUserTypingStop:this.sendUserTypingStop.bind(this),sendNewChat:this.sendNewChat.bind(this),reset:this.reset.bind(this),reloadConfig:this.reloadConfig.bind(this),enqueueUserInput:this.enqueueUserInput.bind(this),connect:this.connect.bind(this),sendImageDelete:o(this,U,q).sendImageDelete.bind(o(this,U,q))})}connectedCallback(){super.connectedCallback(),this.updated()}updated(){this.autoConnect&&o(this,U,q).connect(),Object.assign(this.contextCtrl.proxyObject,{widgetId:this.widgetId,config:this.config,callbacks:this.callbacks,xUserData:o(this,bn),xCustomInstructions:o(this,xn),conversationId:o(this,U,q).conversationId,messages:o(this,U,Hc),isStreaming:o(this,U,q).isStreaming,typingIndicator:o(this,U,q).typingIndicator,ranOutOfCredits:o(this,U,q).ranOutOfCredits,isLiveMode:o(this,U,q).isLiveMode,lastMsg:o(this,U,q).lastMsg,hasQueuedMessages:o(this,U,q).hasQueuedMessages,sendUserInput:this.sendUserInput.bind(this),sendUserCancel:this.sendUserCancel.bind(this),sendUserTypingStart:this.sendUserTypingStart.bind(this),sendUserTypingStop:this.sendUserTypingStop.bind(this),reset:this.reset.bind(this),reloadConfig:this.reloadConfig.bind(this),enqueueUserInput:this.enqueueUserInput.bind(this),connect:this.connect.bind(this),sendImageDelete:o(this,U,q).sendImageDelete.bind(o(this,U,q))}),m(this,U,zc).call(this)}async sendUserInput(t,n={}){let i={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,...n},s=await o(this,U,q).sendUserInput(t,i);return s&&this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:t,example:!1,conversationId:o(this,U,q).conversationId}),s}async enqueueUserInput(t,n={}){let i={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,role:"user",expectStreaming:!0,...n};return o(this,U,q).enqueueUserInput(t,i)}sendUserCancel(){o(this,U,q).sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}sendUserTypingStart(){o(this,U,q).sendUserTypingStart()}sendUserTypingStop(){o(this,U,q).sendUserTypingStop()}sendNewChat(){o(this,U,q).sendNewChat()}reset(){o(this,U,q).reset()}reloadConfig(){o(this,U,q).reloadConfig()}connect(){o(this,U,q).connect()}render(){return h`<slot></slot>`}};U=new WeakSet,Hc=function(){return o(this,U,q)?.ranOutOfCredits?[{id:crypto.randomUUID(),role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}]:o(this,U,q)?.messages||[]},bn=new WeakMap,xn=new WeakMap,gr=new WeakMap,q=function(){return o(this,gr)||g(this,gr,new Ri(this,{autoConnect:this.autoConnect,url:t=>{let n=new URL(this.config.wsApiUrl);return n.searchParams.set("widgetId",this.widgetId),n.searchParams.set("conversationId",t),n.searchParams.set("pageUrl",window.location.href),n},onReconnect:()=>{},onError:t=>{console.error("ws error",t)},onClose:()=>{},onNewMessage:t=>{t.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:t,conversationId:o(this,U,q).conversationId})},onMessageAppend:t=>{},onMessageDone:(t,n)=>{n.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:n.content??"",message:n,usage_TOKENS_COMPLETION:t.message.usage.TOKENS_COMPLETION,conversationId:o(this,U,q).conversationId})},onMessageError:t=>{console.error("ws message error",t),t.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+t.message})},onReset:()=>{mr.reset(this.widgetId)},onConnect:(t,n)=>{let i=Fc();o(this,U,q).sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,language:window.navigator.language,cart:[]}),Nc().then(s=>{s?.length>0&&o(this,U,q).sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,cart:s,language:window.navigator.language})}).catch(s=>{console.error(s)}),this.dispatchEvent(new zi.ConnectedEvent({conversationId:t,metadata:n,widgetId:this.widgetId,pendingImages:n?.pendingImages||[]}))},persistConversationState:(t,n)=>{mr.persist(this.widgetId,t,n)},restoreConversationState:()=>mr.restore(this.widgetId)})),o(this,gr)},zc=function(){function t(i){if(!i)return;let s;try{s=typeof i=="object"?i:JSON.parse(i)}catch(u){console.error("Molin: user-data is not valid JSON",u);return}if(!s||typeof s!="object"||Object.keys(s).length===0)return;let a=vn(qc,s);if(!a.success){console.error("Molin: user-data does not pass schema validation",a.issues);return}return a.output}function n(i){if(!i)return;let s=vn(Vc,i);if(!s.success){console.error("Molin: custom-instructions does not pass schema validation",s.issues);return}return s.output}g(this,bn,t(this.xUserData)),g(this,xn,n(this.xCustomInstructions))},w(zi,"properties",{widgetId:{type:String},config:{type:Object},callbacks:{type:Object},xUserData:{type:Object},xCustomInstructions:{type:Object},autoConnect:{type:Boolean}});var wr=zi;function Wc(r){let e=new Vi(r,{provider:wr,tag:"mw-context-widget",key:"contextCtrl"});return new Proxy({value:null},{get(t,n){if(n==="value")return e.value}})}var ua;wr.ConnectedEvent=(ua=class extends CustomEvent{constructor(e,t={}){super(wr.ConnectedEvent.type,{detail:e,bubbles:!0,composed:!0,...t})}},w(ua,"type","mw-context-widget:connected"),ua);customElements.get("mw-context-widget")||customElements.define("mw-context-widget",wr);function ba(r){return[...r.v,(r.i?"!":"")+r.n].join(":")}function Up(r,e=","){return r.map(ba).join(e)}var Qc=typeof CSS<"u"&&CSS.escape||(r=>r.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function Wi(r){for(var e=9,t=r.length;t--;)e=Math.imul(e^r.charCodeAt(t),1597334677);return"#"+((e^e>>>9)>>>0).toString(36)}function Ji(r,e="@media "){return e+V(r).map(t=>(typeof t=="string"&&(t={min:t}),t.raw||Object.keys(t).map(n=>`(${n}-width:${t[n]})`).join(" and "))).join(",")}function V(r=[]){return Array.isArray(r)?r:r==null?[]:[r]}function Gc(r){return r}function Ki(){}var te={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function eu(r){return r.match(/[-=:;]/g)?.length||0}function ma(r){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(r)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(eu(r),15)<<18}var Pp=["rst-c","st-ch","h-chi","y-lin","nk","sited","ecked","pty","ad-on","cus-w","ver","cus","cus-v","tive","sable","tiona","quire"];function xa({n:r,i:e,v:t=[]},n,i,s){r&&(r=ba({n:r,i:e,v:t})),s=[...V(s)];for(let u of t){let l=n.theme("screens",u);for(let c of V(l&&Ji(l)||n.v(u))){var a;s.push(c),i|=l?67108864|ma(c):u=="dark"?1073741824:c[0]=="@"?ma(c):(a=c,1<<~(/:([a-z-]+)/.test(a)&&~Pp.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:r,p:i,r:s,i:e}}var tu=new Map;function ga(r){if(r.d){let e=[],t=ha(r.r.reduce((n,i)=>i[0]=="@"?(e.push(i),n):i?ha(n,s=>ha(i,a=>{let u=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(a);if(u){let l=s.indexOf(u[1]);return~l?s.slice(0,l)+u[0]+s.slice(l+u[1].length):da(s,a)}return da(a,s)})):n,"&"),n=>da(n,r.n?"."+Qc(r.n):""));return t&&e.push(t.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((n,i)=>i+"{"+n+"}",r.d)}}function ha(r,e){return r.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(t,n,i)=>e(n)+i)}function da(r,e){return r.replace(/&/g,e)}var Zc=new Intl.Collator("en",{numeric:!0});function ru(r,e){for(var t=0,n=r.length;t<n;){let i=n+t>>1;0>=nu(r[i],e)?t=i+1:n=i}return n}function nu(r,e){let t=r.p&te.o;return t==(e.p&te.o)&&(t==te.b||t==te.o)?0:r.p-e.p||r.o-e.o||Zc.compare(Jc(r.n),Jc(e.n))||Zc.compare(Kc(r.n),Kc(e.n))}function Jc(r){return(r||"").split(/:/).pop().split("/").pop()||"\0"}function Kc(r){return(r||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function pa(r,e){return Math.round(parseInt(r,16)*e)}function Se(r,e={}){if(typeof r=="function")return r(e);let{opacityValue:t="1",opacityVariable:n}=e,i=n?`var(${n})`:t;if(r.includes("<alpha-value>"))return r.replace("<alpha-value>",i);if(r[0]=="#"&&(r.length==4||r.length==7)){let s=(r.length-1)/3,a=[17,1,.062272][s-1];return`rgba(${[pa(r.substr(1,s),a),pa(r.substr(1+s,s),a),pa(r.substr(1+2*s,s),a),i]})`}return i=="1"?r:i=="0"?"#0000":r.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${i})`)}function iu(r,e,t,n,i=[]){return(function s(a,{n:u,p:l,r:c=[],i:d},f){let y=[],x="",S=0,j=0;for(let C in a||{}){var k,M;let I=a[C];if(C[0]=="@"){if(!I)continue;if(C[1]=="a"){y.push(...Ca(u,l,Zi(""+I),f,l,c,d,!0));continue}if(C[1]=="l"){for(let L of V(I))y.push(...s(L,{n:u,p:(k=te[C[7]],l&~te.o|k),r:C[7]=="d"?[]:c,i:d},f));continue}if(C[1]=="i"){y.push(...V(I).map(L=>({p:-1,o:0,r:[],d:C+" "+L})));continue}if(C[1]=="k"){y.push({p:te.d,o:0,r:[C],d:s(I,{p:te.d},f).map(ga).join("")});continue}if(C[1]=="f"){y.push(...V(I).map(L=>({p:te.d,o:0,r:[C],d:s(L,{p:te.d},f).map(ga).join("")})));continue}}if(typeof I!="object"||Array.isArray(I))C=="label"&&I?u=I+Wi(JSON.stringify([l,d,a])):(I||I===0)&&(C=C.replace(/[A-Z]/g,L=>"-"+L.toLowerCase()),j+=1,S=Math.max(S,(M=C)[0]=="-"?0:eu(M)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(M)?+!!RegExp.$1||-!!RegExp.$2:0)+1),x+=(x?";":"")+V(I).map(L=>f.s(C,ka(""+L,f.theme)+(d?" !important":""))).join(";"));else if(C[0]=="@"||C.includes("&")){let L=l;C[0]=="@"&&(C=C.replace(/\bscreen\(([^)]+)\)/g,(z,ee)=>{let ie=f.theme("screens",ee);return ie?(L|=67108864,Ji(ie,"")):z}),L|=ma(C)),y.push(...s(I,{n:u,p:L,r:[...c,C],i:d},f))}else y.push(...s(I,{p:l,r:[...c,C]},f))}return y.unshift({n:u,p:l,o:Math.max(0,15-j)+1.5*Math.min(S||15,15),r:c,d:x}),y.sort(nu)})(r,xa(e,t,n,i),t)}function ka(r,e){return r.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(t,n,i,s,a="")=>{let u=e(i,a);return typeof u=="function"&&/color|fill|stroke/i.test(i)?Se(u):""+V(u).filter(l=>Object(l)!==l)})}function su(r,e){let t,n=[];for(let i of r)i.d&&i.n?t?.p==i.p&&""+t.r==""+i.r?(t.c=[t.c,i.c].filter(Boolean).join(" "),t.d=t.d+";"+i.d):n.push(t={...i,n:i.n&&e}):n.push({...i,n:i.n&&e});return n}function Gi(r,e,t=te.u,n,i){let s=[];for(let a of r)for(let u of(function(l,c,d,f,y){l={...l,i:l.i||y};let x=(function(S,j){let k=tu.get(S.n);return k?k(S,j):j.r(S.n,S.v[0]=="dark")})(l,c);return x?typeof x=="string"?({r:f,p:d}=xa(l,c,d,f),su(Gi(Zi(x),c,d,f,l.i),l.n)):Array.isArray(x)?x.map(S=>{var j,k;return{o:0,...S,r:[...V(f),...V(S.r)],p:(j=d,k=S.p??d,j&~te.o|k)}}):iu(x,l,c,d,f):[{c:ba(l),p:0,o:0,r:[]}]})(a,e,t,n,i))s.splice(ru(s,u),0,u);return s}function Ca(r,e,t,n,i,s,a,u){return su((u?t.flatMap(l=>Gi([l],n,i,s,a)):Gi(t,n,i,s,a)).map(l=>l.p&te.o&&(l.n||e==te.b)?{...l,p:l.p&~te.o|e,o:0}:l),r)}function Rp(r,e,t,n){var i;return i=(s,a)=>{let{n:u,p:l,r:c,i:d}=xa(s,a,e);return t&&Ca(u,e,t,a,l,c,d,n)},tu.set(r,i),r}function fa(r,e,t){if(r[r.length-1]!="("){let n=[],i=!1,s=!1,a="";for(let u of r)if(!(u=="("||/[~@]$/.test(u))){if(u[0]=="!"&&(u=u.slice(1),i=!i),u.endsWith(":")){n[u=="dark:"?"unshift":"push"](u.slice(0,-1));continue}u[0]=="-"&&(u=u.slice(1),s=!s),u.endsWith("-")&&(u=u.slice(0,-1)),u&&u!="&"&&(a+=(a&&"-")+u)}a&&(s&&(a="-"+a),e[0].push({n:a,v:n.filter(Bp),i}))}}function Bp(r,e,t){return t.indexOf(r)==e}var Yc=new Map;function Zi(r){let e=Yc.get(r);if(!e){let t=[],n=[[]],i=0,s=0,a=null,u=0,l=(c,d=0)=>{i!=u&&(t.push(r.slice(i,u+d)),c&&fa(t,n)),i=u+1};for(;u<r.length;u++){let c=r[u];if(s)r[u-1]!="\\"&&(s+=+(c=="[")||-(c=="]"));else if(c=="[")s+=1;else if(a)r[u-1]!="\\"&&a.test(r.slice(u))&&(a=null,i=u+RegExp.lastMatch.length);else if(c=="/"&&r[u-1]!="\\"&&(r[u+1]=="*"||r[u+1]=="/"))a=r[u+1]=="*"?/^\*\//:/^[\r\n]/;else if(c=="(")l(),t.push(c);else if(c==":")r[u+1]!=":"&&l(!1,1);else if(/[\s,)]/.test(c)){l(!0);let d=t.lastIndexOf("(");if(c==")"){let f=t[d-1];if(/[~@]$/.test(f)){let y=n.shift();t.length=d,fa([...t,"#"],n);let{v:x}=n[0].pop();for(let S of y)S.v.splice(+(S.v[0]=="dark")-+(x[0]=="dark"),x.length);fa([...t,Rp(f.length>1?f.slice(0,-1)+Wi(JSON.stringify([f,y])):f+"("+Up(y)+")",te.a,y,/@$/.test(f))],n)}d=t.lastIndexOf("(",d-1)}t.length=d+1}else/[~@]/.test(c)&&r[u+1]=="("&&n.unshift([])}l(!0),Yc.set(r,e=n[0])}return e}function v(r,e,t){return[r,wa(e,t)]}function wa(r,e){return typeof r=="function"?r:typeof r=="string"&&/^[\w-]+$/.test(r)?(t,n)=>({[r]:e?e(t,n):ya(t,1)}):t=>r||{[t[1]]:ya(t,2)}}function ya(r,e,t=r.slice(e).find(Boolean)||r.$$||r.input){return r.input[0]=="-"?`calc(${t} * -1)`:t}function b(r,e,t,n){return[r,$a(e,t,n)]}function $a(r,e,t){let n=typeof e=="string"?(i,s)=>({[e]:t?t(i,s):i._}):e||(({1:i,_:s},a,u)=>({[i||u]:s}));return(i,s)=>{let a=ou(r||i[1]),u=s.theme(a,i.$$)??Ue(i.$$,a,s);if(u!=null)return i._=ya(i,0,u),n(i,s,a)}}function re(r,e={},t){return[r,qp(e,t)]}function qp(r={},e){return(t,n)=>{let{section:i=ou(t[0]).replace("-","")+"Color"}=r,[s,a]=Vp(t.$$);if(!s)return;let u=n.theme(i,s)||Ue(s,i,n);if(!u||typeof u=="object")return;let{opacityVariable:l=`--tw-${t[0].replace(/-$/,"")}-opacity`,opacitySection:c=i.replace("Color","Opacity"),property:d=i,selector:f}=r,y=n.theme(c,a||"DEFAULT")||a&&Ue(a,c,n),x=e||(({_:j})=>{let k=kn(d,j);return f?{[f]:k}:k});t._={value:Se(u,{opacityVariable:l||void 0,opacityValue:y||void 0}),color:j=>Se(u,j),opacityVariable:l||void 0,opacityValue:y||void 0};let S=x(t,n);if(!t.dark){let j=n.d(i,s,u);j&&j!==u&&(t._={value:Se(j,{opacityVariable:l||void 0,opacityValue:y||"1"}),color:k=>Se(j,k),opacityVariable:l||void 0,opacityValue:y||void 0},S={"&":S,[n.v("dark")]:x(t,n)})}return S}}function Vp(r){return(r.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function kn(r,e){let t={};return typeof e=="string"?t[r]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(t[e.opacityVariable]=e.opacityValue||"1"),t[r]=e.value),t}function Ue(r,e,t){if(r[0]=="["&&r.slice(-1)=="]"){if(r=yr(ka(r.slice(1,-1),t.theme)),!e)return r;if(!(/color|fill|stroke/i.test(e)&&!(/^color:/.test(r)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(r))||/image/i.test(e)&&!(/^image:/.test(r)||/^[a-z-]+\(/.test(r))||/weight/i.test(e)&&!(/^(number|any):/.test(r)||/^\d+$/.test(r))||/position/i.test(e)&&/^(length|size):/.test(r)))return r.replace(/^[a-z-]+:/,"")}}function ou(r){return r.replace(/-./g,e=>e[1].toUpperCase())}function yr(r){return r.includes("url(")?r.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,t="",n,i="")=>yr(t)+n+yr(i)):r.replace(/(^|[^\\])_+/g,(e,t)=>t+" ".repeat(e.length-t.length)).replace(/\\_/g,"_").replace(/(calc|min|max|clamp)\(.+\)/g,e=>e.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "))}function Cn({presets:r=[],...e}){let t={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:V(e.variants),rules:V(e.rules),ignorelist:V(e.ignorelist),hash:void 0,stringify:(n,i)=>n+":"+i,finalize:[]};for(let n of V([...r,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&V(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:i,darkMode:s=t.darkMode,darkColor:a=t.darkColor,theme:u,variants:l,rules:c,ignorelist:d,hash:f=t.hash,stringify:y=t.stringify,finalize:x}=typeof n=="function"?n(t):n;t={preflight:t.preflight!==!1&&i!==!1&&[...t.preflight,...V(i)],darkMode:s,darkColor:a,theme:{...t.theme,...u,extend:{...t.theme.extend,...u?.extend}},variants:[...t.variants,...V(l)],rules:[...t.rules,...V(c)],ignorelist:[...t.ignorelist,...V(d)],hash:f,stringify:y,finalize:[...t.finalize,...V(x)]}}return t}function Xc(r,e,t,n,i,s){for(let a of e){let u=t.get(a);u||t.set(a,u=n(a));let l=u(r,i,s);if(l)return l}}function Fp(r){var e;return va(r[0],typeof(e=r[1])=="function"?e:()=>e)}function Np(r){var e,t;return Array.isArray(r)?va(r[0],wa(r[1],r[2])):va(r,wa(e,t))}function va(r,e){return au(r,(t,n,i,s)=>{let a=n.exec(t);if(a)return a.$$=t.slice(a[0].length),a.dark=s,e(a,i)})}function au(r,e){let t=V(r).map(Hp);return(n,i,s)=>{for(let a of t){let u=e(n,a,i,s);if(u)return u}}}function Hp(r){return typeof r=="string"?RegExp("^"+r+(r.includes("$")||r.slice(-1)=="-"?"":"$")):r}function lu(r,e){let t=Cn(r),n=(function({theme:l,darkMode:c,darkColor:d=Ki,variants:f,rules:y,hash:x,stringify:S,ignorelist:j,finalize:k}){let M=new Map,C=new Map,I=new Map,L=new Map,z=au(j,(B,se)=>se.test(B));f.push(["dark",Array.isArray(c)||c=="class"?`${V(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let ee=typeof x=="function"?B=>x(B,Wi):x?Wi:Gc;ee!==Gc&&k.push(B=>({...B,n:B.n&&ee(B.n),d:B.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(se,de)=>"--"+ee(de).replace("#",""))}));let ie={theme:(function({extend:B={},...se}){let de={},Eo={get colors(){return gt("colors")},theme:gt,negative(){return{}},breakpoints(Z){let oe={};for(let ge in Z)typeof Z[ge]=="string"&&(oe["screen-"+ge]=Z[ge]);return oe}};return gt;function gt(Z,oe,ge,tn){if(Z){if({1:Z,2:tn}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(Z)||[,Z],/[.[]/.test(Z)){let Fe=[];Z.replace(/\[([^\]]+)\]|([^.[]+)/g,(yt,nn,zd=nn)=>Fe.push(zd)),Z=Fe.shift(),ge=oe,oe=Fe.join("-")}let Oe=de[Z]||Object.assign(Object.assign(de[Z]={},Si(se,Z)),Si(B,Z));if(oe==null)return Oe;oe||(oe="DEFAULT");let wt=Oe[oe]??oe.split("-").reduce((Fe,yt)=>Fe?.[yt],Oe)??ge;return tn?Se(wt,{opacityValue:ka(tn,gt)}):wt}let rn={};for(let Oe of[...Object.keys(se),...Object.keys(B)])rn[Oe]=gt(Oe);return rn}function Si(Z,oe){let ge=Z[oe];return typeof ge=="function"&&(ge=ge(Eo)),ge&&/color|fill|stroke/i.test(oe)?(function tn(rn,Oe=[]){let wt={};for(let Fe in rn){let yt=rn[Fe],nn=[...Oe,Fe];wt[nn.join("-")]=yt,Fe=="DEFAULT"&&(nn=Oe,wt[Oe.join("-")]=yt),typeof yt=="object"&&Object.assign(wt,tn(yt,nn))}return wt})(ge):ge}})(l),e:Qc,h:ee,s(B,se){return S(B,se,ie)},d(B,se,de){return d(B,se,ie,de)},v(B){return M.has(B)||M.set(B,Xc(B,f,C,Fp,ie)||"&:"+B),M.get(B)},r(B,se){let de=JSON.stringify([B,se]);return I.has(de)||I.set(de,!z(B,ie)&&Xc(B,y,L,Np,ie,se)),I.get(de)},f(B){return k.reduce((se,de)=>de(se,ie),B)}};return ie})(t),i=new Map,s=[],a=new Set;e.resume(l=>i.set(l,l),(l,c)=>{e.insert(l,s.length,c),s.push(c),a.add(l)});function u(l){let c=n.f(l),d=ga(c);if(d&&!a.has(d)){a.add(d);let f=ru(s,l);e.insert(d,f,l),s.splice(f,0,l)}return c.n}return Object.defineProperties(function(c){if(!i.size)for(let f of V(t.preflight))typeof f=="function"&&(f=f(n)),f&&(typeof f=="string"?Ca("",te.b,Zi(f),n,te.b,[],!1,!0):iu(f,{},n,te.b)).forEach(u);c=""+c;let d=i.get(c);if(!d){let f=new Set;for(let y of Gi(Zi(c),n))f.add(y.c).add(u(y));d=[...f].filter(Boolean).join(" "),i.set(c,d).set(d,d)}return d},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:n.theme,config:t,snapshot(){let l=e.snapshot(),c=new Set(a),d=new Map(i),f=[...s];return()=>{l(),a=c,i=d,s=f}},clear(){e.clear(),a=new Set,i=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function zp(r,e){return r!=e&&""+r.split(" ").sort()!=""+e.split(" ").sort()}function cu(r){let e=new MutationObserver(t);return{observe(i){e.observe(i,{attributeFilter:["class"],subtree:!0,childList:!0}),n(i),t([{target:i,type:""}])},disconnect(){e.disconnect()}};function t(i){for(let{type:s,target:a}of i)if(s[0]=="a")n(a);else for(let u of a.querySelectorAll("[class]"))n(u);e.takeRecords()}function n(i){let s,a=i.getAttribute?.("class");a&&zp(a,s=r(a))&&i.setAttribute("class",s)}}function Wp(r){let e=document.querySelector(r||'style[data-twind=""]');return(!e||e.tagName!="STYLE")&&(e=document.createElement("style"),document.head.prepend(e)),e.dataset.twind="claimed",e}function Yi(r){let e=r?.cssRules?r:(r&&typeof r!="string"?r:Wp(r)).sheet;return{target:e,snapshot(){let t=Array.from(e.cssRules,n=>n.cssText);return()=>{this.clear(),t.forEach(this.insert)}},clear(){for(let t=e.cssRules.length;t--;)e.deleteRule(t)},destroy(){e.ownerNode?.remove()},insert(t,n){try{e.insertRule(t,n)}catch{e.insertRule(":root{}",n)}},resume:Ki}}var Gp=new Map([["align-self","-ms-grid-row-align"],["color-adjust","-webkit-print-color-adjust"],["column-gap","grid-column-gap"],["forced-color-adjust","-ms-high-contrast-adjust"],["gap","grid-gap"],["grid-template-columns","-ms-grid-columns"],["grid-template-rows","-ms-grid-rows"],["justify-self","-ms-grid-column-align"],["margin-inline-end","-webkit-margin-end"],["margin-inline-start","-webkit-margin-start"],["mask-border","-webkit-mask-box-image"],["mask-border-outset","-webkit-mask-box-image-outset"],["mask-border-slice","-webkit-mask-box-image-slice"],["mask-border-source","-webkit-mask-box-image-source"],["mask-border-repeat","-webkit-mask-box-image-repeat"],["mask-border-width","-webkit-mask-box-image-width"],["overflow-wrap","word-wrap"],["padding-inline-end","-webkit-padding-end"],["padding-inline-start","-webkit-padding-start"],["print-color-adjust","color-adjust"],["row-gap","grid-row-gap"],["scroll-margin-bottom","scroll-snap-margin-bottom"],["scroll-margin-left","scroll-snap-margin-left"],["scroll-margin-right","scroll-snap-margin-right"],["scroll-margin-top","scroll-snap-margin-top"],["scroll-margin","scroll-snap-margin"],["text-combine-upright","-ms-text-combine-horizontal"]]);function uu(r){return Gp.get(r)}function hu(r){var e=/^(?:(text-(?:decoration$|e|or|si)|back(?:ground-cl|d|f)|box-d|mask(?:$|-[ispro]|-cl)|pr|hyphena|flex-d)|(tab-|column(?!-s)|text-align-l)|(ap)|u|hy)/i.exec(r);return e?e[1]?1:e[2]?2:e[3]?3:5:0}function du(r,e){var t=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(r);return t?t[1]?/^sti/i.test(e)?1:0:t[2]?/^pat/i.test(e)?1:0:t[3]?/^image-/i.test(e)?1:0:t[4]?e[3]==="-"?2:0:/^(?:inline-)?grid$/i.test(e)?4:0:0}var Zp=[["-webkit-",1],["-moz-",2],["-ms-",4]];function Xi(){return({stringify:r})=>({stringify(e,t,n){let i="",s=uu(e);s&&(i+=r(s,t,n)+";");let a=hu(e),u=du(e,t);for(let l of Zp)a&l[1]&&(i+=r(l[0]+e,t,n)+";"),u&l[1]&&(i+=r(e,l[0]+t,n)+";");return i+r(e,t,n)}})}function Qi(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",$a("lineClamp",({_:r})=>pu(r))],["line-clamp-(\\d+)",({1:r})=>pu(r)]]}}function pu(r){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${r}`}}var Sn={screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},columns:{auto:"auto","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},spacing:{px:"1px",0:"0px",...be(4,"rem",4,.5,.5),...be(12,"rem",4,5),14:"3.5rem",...be(64,"rem",4,16,4),72:"18rem",80:"20rem",96:"24rem"},durations:{75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0,0,0.2,1) infinite",pulse:"pulse 2s cubic-bezier(0.4,0,0.6,1) infinite",bounce:"bounce 1s infinite"},aspectRatio:{auto:"auto",square:"1/1",video:"16/9"},backdropBlur:R("blur"),backdropBrightness:R("brightness"),backdropContrast:R("contrast"),backdropGrayscale:R("grayscale"),backdropHueRotate:R("hueRotate"),backdropInvert:R("invert"),backdropOpacity:R("opacity"),backdropSaturate:R("saturate"),backdropSepia:R("sepia"),backgroundColor:R("colors"),backgroundImage:{none:"none"},backgroundOpacity:R("opacity"),backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{none:"none",0:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},brightness:{...be(200,"",100,0,50),...be(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:r})=>({DEFAULT:r("colors.gray.200","currentColor"),...r("colors")}),borderOpacity:R("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem","1/2":"50%",full:"9999px"},borderSpacing:R("spacing"),borderWidth:{DEFAULT:"1px",...Ee(8,"px")},boxShadow:{sm:"0 1px 2px 0 rgba(0,0,0,0.05)",DEFAULT:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.05)",none:"0 0 #0000"},boxShadowColor:R("colors"),caretColor:R("colors"),accentColor:({theme:r})=>({auto:"auto",...r("colors")}),contrast:{...be(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:R("borderColor"),divideOpacity:R("borderOpacity"),divideWidth:R("borderWidth"),dropShadow:{sm:"0 1px 1px rgba(0,0,0,0.05)",DEFAULT:["0 1px 2px rgba(0,0,0,0.1)","0 1px 1px rgba(0,0,0,0.06)"],md:["0 4px 3px rgba(0,0,0,0.07)","0 2px 2px rgba(0,0,0,0.06)"],lg:["0 10px 8px rgba(0,0,0,0.04)","0 4px 3px rgba(0,0,0,0.1)"],xl:["0 20px 13px rgba(0,0,0,0.03)","0 8px 5px rgba(0,0,0,0.08)"],"2xl":"0 25px 25px rgba(0,0,0,0.15)",none:"0 0 #0000"},fill:({theme:r})=>({...r("colors"),none:"none"}),grayscale:{DEFAULT:"100%",0:"0"},hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},invert:{DEFAULT:"100%",0:"0"},flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:r})=>({...r("spacing"),...$n(2,6),...$n(12,12),auto:"auto",full:"100%"}),flexGrow:{DEFAULT:1,0:0},flexShrink:{DEFAULT:1,0:0},fontFamily:{sans:'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"'.split(","),serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif'.split(","),mono:'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'.split(",")},fontSize:{xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:R("spacing"),gradientColorStops:R("colors"),gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridColumn:{auto:"auto","span-full":"1 / -1"},gridRow:{auto:"auto","span-full":"1 / -1"},gridTemplateColumns:{none:"none"},gridTemplateRows:{none:"none"},height:({theme:r})=>({...r("spacing"),...$n(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:r})=>({...r("spacing"),...$n(2,4),auto:"auto",full:"100%"}),keyframes:{spin:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},ping:{"0%":{transform:"scale(1)",opacity:"1"},"75%,100%":{transform:"scale(2)",opacity:"0"}},pulse:{"0%,100%":{opacity:"1"},"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{...be(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:r})=>({auto:"auto",...r("spacing")}),maxHeight:({theme:r})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...r("spacing")}),maxWidth:({theme:r,breakpoints:e})=>({...e(r("screens")),none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch"}),minHeight:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"},opacity:{...be(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:R("spacing"),placeholderColor:R("colors"),placeholderOpacity:R("opacity"),outlineColor:R("colors"),outlineOffset:Ee(8,"px"),outlineWidth:Ee(8,"px"),ringColor:({theme:r})=>({...r("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:R("colors"),ringOffsetWidth:Ee(8,"px"),ringOpacity:({theme:r})=>({...r("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...Ee(8,"px")},rotate:{...Ee(2,"deg"),...Ee(12,"deg",3),...Ee(180,"deg",45)},saturate:be(200,"",100,0,50),scale:{...be(150,"",100,0,50),...be(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:R("spacing"),scrollPadding:R("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...Ee(2,"deg"),...Ee(12,"deg",3)},space:R("spacing"),stroke:({theme:r})=>({...r("colors"),none:"none"}),strokeWidth:be(2),textColor:R("colors"),textDecorationColor:R("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...Ee(8,"px")},textUnderlineOffset:{auto:"auto",...Ee(8,"px")},textIndent:R("spacing"),textOpacity:R("opacity"),transitionDuration:({theme:r})=>({...r("durations"),DEFAULT:"150ms"}),transitionDelay:R("durations"),transitionProperty:{none:"none",all:"all",DEFAULT:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",colors:"color,background-color,border-color,text-decoration-color,fill,stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4,0,0.2,1)",linear:"linear",in:"cubic-bezier(0.4,0,1,1)",out:"cubic-bezier(0,0,0.2,1)","in-out":"cubic-bezier(0.4,0,0.2,1)"},translate:({theme:r})=>({...r("spacing"),...$n(2,4),full:"100%"}),width:({theme:r})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...r("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...be(50,"",1,0,10),auto:"auto"}};function $n(r,e){let t={};do for(var n=1;n<r;n++)t[`${n}/${r}`]=Number((n/r*100).toFixed(6))+"%";while(++r<=e);return t}function Ee(r,e,t=0){let n={};for(;t<=r;t=2*t||1)n[t]=t+e;return n}function be(r,e="",t=1,n=0,i=1,s={}){for(;n<=r;n+=i)s[n]=n/t+e;return s}function R(r){return({theme:e})=>e(r)}var fu={"*,::before,::after":{boxSizing:"border-box",borderWidth:"0",borderStyle:"solid",borderColor:"theme(borderColor.DEFAULT, currentColor)"},"::before,::after":{"--tw-content":"''"},html:{lineHeight:1.5,WebkitTextSizeAdjust:"100%",MozTabSize:"4",tabSize:4,fontFamily:`theme(fontFamily.sans, ${Sn.fontFamily.sans})`,fontFeatureSettings:"theme(fontFamily.sans[1].fontFeatureSettings, normal)"},body:{margin:"0",lineHeight:"inherit"},hr:{height:"0",color:"inherit",borderTopWidth:"1px"},"abbr:where([title])":{textDecoration:"underline dotted"},"h1,h2,h3,h4,h5,h6":{fontSize:"inherit",fontWeight:"inherit"},a:{color:"inherit",textDecoration:"inherit"},"b,strong":{fontWeight:"bolder"},"code,kbd,samp,pre":{fontFamily:`theme(fontFamily.mono, ${Sn.fontFamily.mono})`,fontFeatureSettings:"theme(fontFamily.mono[1].fontFeatureSettings, normal)",fontSize:"1em"},small:{fontSize:"80%"},"sub,sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sub:{bottom:"-0.25em"},sup:{top:"-0.5em"},table:{textIndent:"0",borderColor:"inherit",borderCollapse:"collapse"},"button,input,optgroup,select,textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"inherit",color:"inherit",margin:"0",padding:"0"},"button,select":{textTransform:"none"},"button,[type='button'],[type='reset'],[type='submit']":{WebkitAppearance:"button",backgroundColor:"transparent",backgroundImage:"none"},":-moz-focusring":{outline:"auto"},":-moz-ui-invalid":{boxShadow:"none"},progress:{verticalAlign:"baseline"},"::-webkit-inner-spin-button,::-webkit-outer-spin-button":{height:"auto"},"[type='search']":{WebkitAppearance:"textfield",outlineOffset:"-2px"},"::-webkit-search-decoration":{WebkitAppearance:"none"},"::-webkit-file-upload-button":{WebkitAppearance:"button",font:"inherit"},summary:{display:"list-item"},"blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre":{margin:"0"},fieldset:{margin:"0",padding:"0"},legend:{padding:"0"},"ol,ul,menu":{listStyle:"none",margin:"0",padding:"0"},textarea:{resize:"vertical"},"input::placeholder,textarea::placeholder":{opacity:1,color:"theme(colors.gray.400, #9ca3af)"},'button,[role="button"]':{cursor:"pointer"},":disabled":{cursor:"default"},"img,svg,video,canvas,audio,iframe,embed,object":{display:"block",verticalAlign:"middle"},"img,video":{maxWidth:"100%",height:"auto"},"[hidden]":{display:"none"}};var bu=[v("\\[([-\\w]+):(.+)]",({1:r,2:e},t)=>({"@layer overrides":{"&":{[r]:Ue(`[${e}]`,"",t)}}})),v("(group|peer)([~/][^-[]+)?",({input:r},{h:e})=>[{c:e(r)}]),b("aspect-","aspectRatio"),v("container",(r,{theme:e})=>{let{screens:t=e("screens"),center:n,padding:i}=e("container"),s={width:"100%",marginRight:n&&"auto",marginLeft:n&&"auto",...a("xs")};for(let u in t){let l=t[u];typeof l=="string"&&(s[Ji(l)]={"&":{maxWidth:l,...a(u)}})}return s;function a(u){let l=i&&(typeof i=="string"?i:i[u]||i.DEFAULT);if(l)return{paddingRight:l,paddingLeft:l}}}),b("content-","content",({_:r})=>({"--tw-content":r,content:"var(--tw-content)"})),v("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),v("box-(border|content)","boxSizing",({1:r})=>r+"-box"),v("hidden",{display:"none"}),v("table-(auto|fixed)","tableLayout"),v(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",v("isolate","isolation"),v("object-(contain|cover|fill|none|scale-down)","objectFit"),b("object-","objectPosition"),v("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",es),v("overscroll(-[xy])?-(auto|contain|none)",({1:r="",2:e})=>({["overscroll-behavior"+r]:e})),v("(static|fixed|absolute|relative|sticky)","position"),b("-?inset(-[xy])?(?:$|-)","inset",({1:r,_:e})=>({top:r!="-x"&&e,right:r!="-y"&&e,bottom:r!="-x"&&e,left:r!="-y"&&e})),b("-?(top|bottom|left|right)(?:$|-)","inset"),v("(visible|collapse)","visibility"),v("invisible",{visibility:"hidden"}),b("-?z-","zIndex"),v("flex-((row|col)(-reverse)?)","flexDirection",mu),v("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),b("(flex-(?:grow|shrink))(?:$|-)"),b("(flex)-"),b("grow(?:$|-)","flexGrow"),b("shrink(?:$|-)","flexShrink"),b("basis-","flexBasis"),b("-?(order)-"),"-?(order)-(\\d+)",b("grid-cols-","gridTemplateColumns"),v("grid-cols-(\\d+)","gridTemplateColumns",vu),b("col-","gridColumn"),v("col-(span)-(\\d+)","gridColumn",yu),b("col-start-","gridColumnStart"),v("col-start-(auto|\\d+)","gridColumnStart"),b("col-end-","gridColumnEnd"),v("col-end-(auto|\\d+)","gridColumnEnd"),b("grid-rows-","gridTemplateRows"),v("grid-rows-(\\d+)","gridTemplateRows",vu),b("row-","gridRow"),v("row-(span)-(\\d+)","gridRow",yu),b("row-start-","gridRowStart"),v("row-start-(auto|\\d+)","gridRowStart"),b("row-end-","gridRowEnd"),v("row-end-(auto|\\d+)","gridRowEnd"),v("grid-flow-((row|col)(-dense)?)","gridAutoFlow",r=>es(mu(r))),v("grid-flow-(dense)","gridAutoFlow"),b("auto-cols-","gridAutoColumns"),b("auto-rows-","gridAutoRows"),b("gap-x(?:$|-)","gap","columnGap"),b("gap-y(?:$|-)","gap","rowGap"),b("gap(?:$|-)","gap"),"(justify-(?:items|self))-",v("justify-","justifyContent",gu),v("(content|items|self)-",r=>({["align-"+r[1]]:gu(r)})),v("(place-(content|items|self))-",({1:r,$$:e})=>({[r]:("wun".includes(e[3])?"space-":"")+e})),b("p([xytrbl])?(?:$|-)","padding",vr("padding")),b("-?m([xytrbl])?(?:$|-)","margin",vr("margin")),b("-?space-(x|y)(?:$|-)","space",({1:r,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${r}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[r]]:`calc(${e} * calc(1 - var(--tw-space-${r}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[r]]:`calc(${e} * var(--tw-space-${r}-reverse))`}})),v("space-(x|y)-reverse",({1:r})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${r}-reverse`]:"1"}})),b("w-","width"),b("min-w-","minWidth"),b("max-w-","maxWidth"),b("h-","height"),b("min-h-","minHeight"),b("max-h-","maxHeight"),b("font-","fontWeight"),b("font-","fontFamily",({_:r})=>typeof(r=V(r))[1]=="string"?{fontFamily:Te(r)}:{fontFamily:Te(r[0]),...r[1]}),v("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),v("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),v("italic","fontStyle"),v("not-italic",{fontStyle:"normal"}),v("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:r,2:e="",3:t})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(t?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":r)]:r,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...tt({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),b("tracking-","letterSpacing"),b("leading-","lineHeight"),v("list-(inside|outside)","listStylePosition"),b("list-","listStyleType"),v("list-","listStyleType"),b("placeholder-opacity-","placeholderOpacity",({_:r})=>({"&::placeholder":{"--tw-placeholder-opacity":r}})),re("placeholder-",{property:"color",selector:"&::placeholder"}),v("text-(left|center|right|justify|start|end)","textAlign"),v("text-(ellipsis|clip)","textOverflow"),b("text-opacity-","textOpacity","--tw-text-opacity"),re("text-",{property:"color"}),b("text-","fontSize",({_:r})=>typeof r=="string"?{fontSize:r}:{fontSize:r[0],...typeof r[1]=="string"?{lineHeight:r[1]}:r[1]}),b("indent-","textIndent"),v("(overline|underline|line-through)","textDecorationLine"),v("no-underline",{textDecorationLine:"none"}),b("underline-offset-","textUnderlineOffset"),re("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),b("decoration-","textDecorationThickness"),v("decoration-","textDecorationStyle"),v("(uppercase|lowercase|capitalize)","textTransform"),v("normal-case",{textTransform:"none"}),v("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),v("align-","verticalAlign"),v("whitespace-","whiteSpace"),v("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),v("break-words",{overflowWrap:"break-word"}),v("break-all",{wordBreak:"break-all"}),v("break-keep",{wordBreak:"keep-all"}),re("caret-",{opacityVariable:!1,opacitySection:"opacity"}),re("accent-",{opacityVariable:!1,opacitySection:"opacity"}),v("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:r})=>`linear-gradient(to ${Mt(r," ")},var(--tw-gradient-stops))`),re("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:r})=>({"--tw-gradient-from":r.value,"--tw-gradient-to":r.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),re("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:r})=>({"--tw-gradient-to":r.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${r.value},var(--tw-gradient-to)`})),re("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),v("bg-(fixed|local|scroll)","backgroundAttachment"),v("bg-origin-(border|padding|content)","backgroundOrigin",({1:r})=>r+"-box"),v(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),v("bg-blend-","backgroundBlendMode"),v("bg-clip-(border|padding|content|text)","backgroundClip",({1:r})=>r+(r=="text"?"":"-box")),b("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),re("bg-",{section:"backgroundColor"}),b("bg-","backgroundImage"),b("bg-","backgroundPosition"),v("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",es),b("bg-","backgroundSize"),b("rounded(?:$|-)","borderRadius"),b("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:r,_:e})=>{let t={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[r]||[r,r];return{[`border-${Mt(t[0])}-radius`]:e,[`border-${Mt(t[1])}-radius`]:e}}),v("border-(collapse|separate)","borderCollapse"),b("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),v("border-(solid|dashed|dotted|double|none)","borderStyle"),b("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:r,_:e})=>({...tt({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(r||"-x")]:e,["--tw-border-spacing"+(r||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),re("border-([xytrbl])-",{section:"borderColor"},vr("border","Color")),re("border-"),b("border-([xytrbl])(?:$|-)","borderWidth",vr("border","Width")),b("border(?:$|-)","borderWidth"),b("divide-opacity(?:$|-)","divideOpacity",({_:r})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":r}})),v("divide-(solid|dashed|dotted|double|none)",({1:r})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:r}})),v("divide-([xy]-reverse)",({1:r})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+r]:"1"}})),b("divide-([xy])(?:$|-)","divideWidth",({1:r,_:e})=>{let t={x:"lr",y:"tb"}[r];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${r}-reverse`]:"0",[`border-${Mt(t[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${r}-reverse)))`,[`border-${Mt(t[1])}Width`]:`calc(${e} * var(--tw-divide-${r}-reverse))`}}}),re("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),b("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),re("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),b("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),v("ring-inset",{"--tw-ring-inset":"inset"}),re("ring-",{property:"--tw-ring-color"}),b("ring(?:$|-)","ringWidth",({_:r},{theme:e})=>({...tt({"--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-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":e("ringOffsetWidth","","0px"),"--tw-ring-offset-color":Se(e("ringOffsetColor","","#fff")),"--tw-ring-color":Se(e("ringColor","","#93c5fd"),{opacityVariable:"--tw-ring-opacity"}),"--tw-ring-opacity":e("ringOpacity","","0.5")}}),"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${r} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),re("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:r})=>({"--tw-shadow-color":r.value,"--tw-shadow":"var(--tw-shadow-colored)"})),b("shadow(?:$|-)","boxShadow",({_:r})=>({...tt({"--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-shadow":Te(r),"--tw-shadow-colored":Te(r).replace(/([^,]\s+)(?:#[a-f\d]+|(?:(?:hsl|rgb)a?|hwb|lab|lch|color|var)\(.+?\)|[a-z]+)(,|$)/g,"$1var(--tw-shadow-color)$2"),boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),b("(opacity)-"),v("mix-blend-","mixBlendMode"),...wu(),...wu("backdrop-"),b("transition(?:$|-)","transitionProperty",(r,{theme:e})=>({transitionProperty:Te(r),transitionTimingFunction:r._=="none"?void 0:Te(e("transitionTimingFunction","")),transitionDuration:r._=="none"?void 0:Te(e("transitionDuration",""))})),b("duration(?:$|-)","transitionDuration","transitionDuration",Te),b("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",Te),b("delay(?:$|-)","transitionDelay","transitionDelay",Te),b("animate(?:$|-)","animation",(r,{theme:e,h:t,e:n})=>{let i=Te(r),s=i.split(" "),a=e("keyframes",s[0]);return a?{["@keyframes "+(s[0]=n(t(s[0])))]:a,animation:s.join(" ")}:{animation:i}}),"(transform)-(none)",v("transform",Ea),v("transform-(cpu|gpu)",({1:r})=>({"--tw-transform":xu(r=="gpu")})),b("scale(-[xy])?-","scale",({1:r,_:e})=>({["--tw-scale"+(r||"-x")]:e,["--tw-scale"+(r||"-y")]:e,...Ea()})),b("-?(rotate)-","rotate",Sa),b("-?(translate-[xy])-","translate",Sa),b("-?(skew-[xy])-","skew",Sa),v("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",es),"(appearance)-",b("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",b("(cursor)-"),"(cursor)-",v("snap-(none)","scroll-snap-type"),v("snap-(x|y|both)",({1:r})=>({...tt({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":r+" var(--tw-scroll-snap-strictness)"})),v("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),v("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),v("snap-(normal|always)","scroll-snap-stop"),v("scroll-(auto|smooth)","scroll-behavior"),b("scroll-p([xytrbl])?(?:$|-)","padding",vr("scroll-padding")),b("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",vr("scroll-margin")),v("touch-(auto|none|manipulation)","touch-action"),v("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:r,2:e,3:t})=>({...tt({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),[`--tw-${e?"pan-x":t?"pan-y":r}`]:r,"touch-action":"var(--tw-touch-action)"})),v("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),v("outline",{outlineStyle:"solid"}),v("outline-(dashed|dotted|double)","outlineStyle"),b("-?(outline-offset)-"),re("outline-",{opacityVariable:!1,opacitySection:"opacity"}),b("outline-","outlineWidth"),"(pointer-events)-",b("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:r})=>({x:"horizontal",y:"vertical"})[r]||r||"both"],v("select-(none|text|all|auto)","userSelect"),re("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),re("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),b("stroke-","strokeWidth"),v("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),v("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function es(r){return(typeof r=="string"?r:r[1]).replace(/-/g," ").trim()}function mu(r){return(typeof r=="string"?r:r[1]).replace("col","column")}function Mt(r,e="-"){let t=[];for(let n of r)t.push({t:"top",r:"right",b:"bottom",l:"left"}[n]);return t.join(e)}function Te(r){return r&&""+(r._||r)}function gu({$$:r}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[r[3]||""]||"")+r}function vr(r,e=""){return({1:t,_:n})=>{let i={x:"lr",y:"tb"}[t]||t+t;return i?{...kn(r+"-"+Mt(i[0])+e,n),...kn(r+"-"+Mt(i[1])+e,n)}:kn(r+e,n)}}function wu(r=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",r&&"opacity","saturate","sepia",!r&&"drop-shadow"].filter(Boolean),t={};for(let n of e)t[`--tw-${r}${n}`]="var(--tw-empty,/*!*/ /*!*/)";return t={...tt(t),[`${r}filter`]:e.map(n=>`var(--tw-${r}${n})`).join(" ")},[`(${r}filter)-(none)`,v(`${r}filter`,t),...e.map(n=>b(`${n[0]=="h"?"-?":""}(${r}${n})(?:$|-)`,n,({1:i,_:s})=>({[`--tw-${i}`]:V(s).map(a=>`${n}(${a})`).join(" "),...t})))]}function Sa({1:r,_:e}){return{["--tw-"+r]:e,...Ea()}}function Ea(){return{...tt({"--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-transform":xu()}),transform:"var(--tw-transform)"}}function xu(r){return[r?"translate3d(var(--tw-translate-x),var(--tw-translate-y),0)":"translateX(var(--tw-translate-x)) translateY(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))"].join(" ")}function yu({1:r,2:e}){return`${r} ${e} / ${r} ${e}`}function vu({1:r}){return`repeat(${r},minmax(0,1fr))`}function tt(r){return{"@layer defaults":{"*,::before,::after":r,"::backdrop":r}}}var ku=[["sticky","@supports ((position: -webkit-sticky) or (position:sticky))"],["motion-reduce","@media (prefers-reduced-motion:reduce)"],["motion-safe","@media (prefers-reduced-motion:no-preference)"],["print","@media print"],["(portrait|landscape)",({1:r})=>`@media (orientation:${r})`],["contrast-(more|less)",({1:r})=>`@media (prefers-contrast:${r})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:r})=>`&::${r}`],["(marker|selection)",({1:r})=>`& *::${r},&::${r}`],["file","&::file-selector-button"],["(first|last|only)",({1:r})=>`&:${r}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:r,$$:e},t)=>e&&`&[${r}-${t.theme(r,e)||Ue(e,"",t)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:r,3:e="",4:t,5:n="",6:i=e},{e:s,h:a,v:u})=>{let l=yr(n)||(t[0]=="["?t:u(t.slice(1)));return`${(l.includes("&")?l:"&"+l).replace(/&/g,`:merge(.${s(a(r+i))})`)}${r[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:r})=>`[dir="${r}"] &`],["supports-",({$$:r},e)=>{if(r&&(r=e.theme("supports",r)||Ue(r,"",e)),r)return r.includes(":")||(r+=":var(--tw)"),/^\w*\s*\(/.test(r)||(r=`(${r})`),`@supports ${r.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:r},e)=>{if(r&&(r=e.theme("screens",r)||Ue(r,"",e)),typeof r=="string")return`@media not all and (min-width:${r})`}],["min-",({$$:r},e)=>(r&&(r=Ue(r,"",e)),r&&`@media (min-width:${r})`)],[/^\[(.+)]$/,({1:r})=>/[&@]/.test(r)&&yr(r).replace(/[}]+$/,"").split("{")]];function Cu({colors:r,disablePreflight:e}={}){return{preflight:e?void 0:fu,theme:{...Sn,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...r}},variants:ku,rules:bu,finalize(t){return t.n&&t.d&&t.r.some(n=>/^&::(before|after)$/.test(n))&&!/(^|;)content:/.test(t.d)?{...t,d:"content:var(--tw-content);"+t.d}:t}}}var Jp={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},Kp={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},Yp={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},Xp={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},Qp={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},e1={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},t1={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},r1={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},n1={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},i1={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},s1={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},o1={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},a1={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},l1={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},c1={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},u1={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},h1={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},d1={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},p1={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},f1={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},m1={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},g1={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},$u={__proto__:null,slate:Jp,gray:Kp,zinc:Yp,neutral:Xp,stone:Qp,red:e1,orange:t1,amber:r1,yellow:n1,lime:i1,green:s1,emerald:o1,teal:a1,cyan:l1,sky:c1,blue:u1,indigo:h1,violet:d1,purple:p1,fuchsia:f1,pink:m1,rose:g1};function ts({disablePreflight:r}={}){return Cu({colors:$u,disablePreflight:r})}function rs({className:r="prose",defaultColor:e="gray",extend:t={},colors:n={}}={}){return n={body:"700",headings:"900",lead:"600",links:"900",bold:"900",counters:"500",bullets:"300",hr:"200",quotes:"900","quote-borders":"200",captions:"500",code:"900","pre-code":"200","pre-bg":"800","th-borders":"300","td-borders":"200",...n,dark:n.dark===null?null:{body:"300",headings:"#fff",lead:"400",links:"#fff",bold:"#fff",counters:"400",bullets:"600",hr:"700",quotes:"100","quote-borders":"700",captions:"400",code:"#fff","pre-code":"300","pre-bg":"rgb(0 0 0 / 50%)","th-borders":"600","td-borders":"700",...n.dark}},{variants:[["headings","h1,h2,h3,h4,h5,h6,th"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["p"],["a"],["blockquote"],["figure"],["figcaption"],["strong"],["em"],["code"],["pre"],["ol"],["ul"],["li"],["table"],["thead"],["tr"],["th"],["td"],["img"],["video"],["hr"],["lead",".lead"]].map(([s,a=s])=>[`${r}-${s}`,(u,l)=>_u(r,a[0]=="."?"."+l.e(l.h(a.slice(1))):a,l,c=>`& :is(${c.trim()})`)]),rules:[[`(lead|not-${r})`,({1:s},{h:a})=>[{c:a(s)}]],[`${r}-invert`,{"@layer base":{"--tw-prose-body":"var(--tw-prose-invert-body)","--tw-prose-headings":"var(--tw-prose-invert-headings)","--tw-prose-lead":"var(--tw-prose-invert-lead)","--tw-prose-links":"var(--tw-prose-invert-links)","--tw-prose-bold":"var(--tw-prose-invert-bold)","--tw-prose-counters":"var(--tw-prose-invert-counters)","--tw-prose-bullets":"var(--tw-prose-invert-bullets)","--tw-prose-hr":"var(--tw-prose-invert-hr)","--tw-prose-quotes":"var(--tw-prose-invert-quotes)","--tw-prose-quote-borders":"var(--tw-prose-invert-quote-borders)","--tw-prose-captions":"var(--tw-prose-invert-captions)","--tw-prose-code":"var(--tw-prose-invert-code)","--tw-prose-pre-code":"var(--tw-prose-invert-pre-code)","--tw-prose-pre-bg":"var(--tw-prose-invert-pre-bg)","--tw-prose-th-borders":"var(--tw-prose-invert-th-borders)","--tw-prose-td-borders":"var(--tw-prose-invert-td-borders)"}}],[r+"-",({$$:s},a)=>{let u=Eu(a.theme("fontSize",s));return u&&{"@layer components":u}}],[r+"-",({$$:s},a)=>i(s,a)],[r,(s,a)=>({...i(e,a),"@layer base":[Su(r,a,{a:{color:"var(--tw-prose-links)",textDecorationLine:"underline",fontWeight:"500"},strong:{color:"var(--tw-prose-bold)",fontWeight:"600"},"a strong,blockquote strong,thead th strong":{color:"inherit"},ul:{listStyleType:"disc"},ol:{listStyleType:"decimal"},'ol[type="A"]':{listStyleType:"upper-alpha"},'ol[type="a"]':{listStyleType:"lower-alpha"},'ol[type="A" s]':{listStyleType:"upper-alpha"},'ol[type="a" s]':{listStyleType:"lower-alpha"},'ol[type="I"]':{listStyleType:"upper-roman"},'ol[type="i"]':{listStyleType:"lower-roman"},'ol[type="I" s]':{listStyleType:"upper-roman"},'ol[type="i" s]':{listStyleType:"lower-roman"},'ol[type="1"]':{listStyleType:"decimal"},"ol,ul":{marginTop:E(20,16),marginBottom:E(20,16),paddingLeft:E(26,16)},li:{marginTop:E(8,16),marginBottom:E(8,16)},"ol>li,ul>li":{paddingLeft:E(6,16)},">ul>li p":{marginTop:E(12,16),marginBottom:E(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:E(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:E(20,16)},"ol>li::marker":{fontWeight:"400",color:"var(--tw-prose-counters)"},"ul>li::marker":{color:"var(--tw-prose-bullets)"},"ul ul,ul ol,ol ul,ol ol":{marginTop:E(12,16),marginBottom:E(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:E(48,16),marginBottom:E(48,16)},blockquote:{marginTop:E(32,20),marginBottom:E(32,20),paddingLeft:E(20,20),fontWeight:"500",fontStyle:"italic",color:"var(--tw-prose-quotes)",borderLeftWidth:"0.25rem",borderLeftColor:"var(--tw-prose-quote-borders)",quotes:'"\\201C""\\201D""\\2018""\\2019"'},"blockquote p:first-of-type::before":{content:"open-quote"},"blockquote p:last-of-type::after":{content:"close-quote"},p:{marginTop:E(20,16),marginBottom:E(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:E(36,16),marginTop:"0",marginBottom:E(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:E(24,16),marginTop:E(48,24),marginBottom:E(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:E(20,16),marginTop:E(32,20),marginBottom:E(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:E(24,16),marginBottom:E(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:E(32,16),marginBottom:E(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:E(14,16),lineHeight:"1.4",marginTop:E(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:E(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:E(21,24)},"h3 code":{fontSize:E(18,20)},"a code,h1 code,h2 code,h3 code,h4 code,blockquote code,thead th code":{color:"inherit"},pre:{color:"var(--tw-prose-pre-code)",backgroundColor:"var(--tw-prose-pre-bg)",overflowX:"auto",fontWeight:"400",fontSize:E(14,16),lineHeight:"1.7",marginTop:E(24,14),marginBottom:E(24,14),borderRadius:"0.375rem",paddingTop:E(12,14),paddingRight:E(16,14),paddingBottom:E(12,14),paddingLeft:E(16,14)},"pre code":{backgroundColor:"transparent",borderWidth:"0",borderRadius:"0",padding:"0",fontWeight:"inherit",color:"inherit",fontSize:"inherit",fontFamily:"inherit",lineHeight:"inherit"},"pre code::before":{content:"none"},"pre code::after":{content:"none"},table:{width:"100%",tableLayout:"auto",textAlign:"left",marginTop:E(32,16),marginBottom:E(32,16),fontSize:E(14,16),lineHeight:"1.7"},thead:{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-th-borders)"},"thead th":{color:"var(--tw-prose-headings)",fontWeight:"600",verticalAlign:"bottom",paddingRight:E(8,14),paddingBottom:E(8,14),paddingLeft:E(8,14)},"thead th:first-child":{paddingLeft:"0"},"thead th:last-child":{paddingRight:"0"},"tbody tr":{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-td-borders)"},"tbody tr:last-child":{borderBottomWidth:"0"},"tbody td,tfoot td":{verticalAlign:"baseline",paddingTop:E(8,14),paddingRight:E(8,14),paddingBottom:E(8,14),paddingLeft:E(8,14)},"tbody td:first-child,tfoot td:first-child":{paddingLeft:"0"},"tbody td:last-child,tfoot td:last-child":{paddingRight:"0"},[`.${a.e(a.h("lead"))}`]:{color:"var(--tw-prose-lead)",fontSize:E(20,16),lineHeight:"1.6",marginTop:E(24,20),marginBottom:E(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),Su(r,a,t)],"@layer components":{...Eu(a.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function i(s,a){let u={},l={},c=(d,f,y)=>{let x=a.theme(`colors.${s}.${f}`,f);y["--tw-prose-"+d]=Se(x);let S=y!=l&&a.d("colors",`${s}-${f}`,x);S&&(l["--tw-prose-"+d]=Se(S))};for(let d in n){let f=n[d];d!="dark"&&f&&c(d,f,u)}for(let d in n.dark||{}){let f=n.dark[d];f&&(n.dark?c("invert-"+d,f,u):c(d,f,l))}return Object.keys(u).length?{"@layer defaults":{"&":u,[a.v("dark")]:l}}:void 0}}function Su(r,e,t){let n={};for(let i in t)n[_u(r,i,e,s=>`.${e.e(e.h(r))}${s}`)]=t[i];return n}function _u(r,e,{e:t,h:n},i){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,a=" ",u=s,l="")=>i(`${a}:where(${u}):not(:where(.${t(n("not-"+r))} *))${l}`))}function Eu(r){return r?typeof r=="string"?{fontSize:r}:{fontSize:r[0],...typeof r[1]=="string"?{lineHeight:r[1]}:r[1]}:void 0}function E(r,e){return`${(r/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var _a=Cn({hash:!1,darkMode:"class",theme:{extend:{colors:{violet:{DEFAULT:"#601feb",50:"#f3f2ff",100:"#eae7ff",200:"#d7d2ff",300:"#baaeff",400:"#9980ff",500:"#784dff",600:"#6829fe",700:"#601feb",800:"#4b12c5",900:"#3f11a1",950:"#25086d"},pink:{DEFAULT:"#ff0bbb",50:"#fff0fc",100:"#ffe3fc",200:"#ffc6f9",300:"#ff98f2",400:"#ff58e5",500:"#ff27d5",600:"#ff0bbb",700:"#df0095",800:"#b8007b",900:"#980368",950:"#5f003b"},lime:{DEFAULT:"#b9e901",50:"#fdffe4",100:"#f9ffc5",200:"#f1ff92",300:"#e2ff54",400:"#d1fa21",500:"#b9e901",600:"#8ab400",700:"#688902",800:"#526b09",900:"#465a0d",950:"#243300"}},spacing:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},padding:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},lineHeight:{3:"12px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px"},maxWidth:{xs:"320px",sm:"384px",md:"448px",lg:"512px",xl:"576px","2xl":"672px","3xl":"768px","4xl":"896px","5xl":"1024px","6xl":"1152px","7xl":"1280px"},maxHeight:{.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},borderRadius:{sm:"2px",DEFAULT:"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px"},fontSize:{xs:["12px","16px"],sm:["14px","20px"],base:["16px","24px"],lg:["18px","28px"],xl:["20px","28px"],"2xl":["24px","32px"],"3xl":["30px","36px"],"4xl":["36px","40px"],"5xl":["48px","1"],"6xl":["60px","1"],"7xl":["72px","1"],"8xl":["96px","1"],"9xl":["128px","1"]}}},presets:[ts(),Xi(),Qi(),rs()]});function ns(r,e=!0){let t=(function(){if(w1)try{let l=Yi(new CSSStyleSheet);return l.connect=c=>{let d=Ia(c);d.adoptedStyleSheets=[...d.adoptedStyleSheets,l.target]},l.disconnect=Ki,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let a=[Yi(s)],u=new WeakMap;return{get target(){return a[0].target},snapshot(){let l=a.map(c=>c.snapshot());return()=>l.forEach(c=>c())},clear(){a.forEach(l=>l.clear())},destroy(){a.forEach(l=>l.destroy())},insert(l,c,d){a[0].insert(l,c,d);let f=this.target.cssRules[c];a.forEach((y,x)=>x&&y.target.insertRule(f.cssText,c))},resume(l,c){return a[0].resume(l,c)},connect(l){let c=document.createElement("style");Ia(l).appendChild(c);let d=Yi(c),{cssRules:f}=this.target;for(let y=0;y<f.length;y++)d.target.insertRule(f[y].cssText,y);a.push(d),u.set(l,d)},disconnect(l){let c=a.indexOf(u.get(l));c>=0&&a.splice(c,1)}}})(),n=lu({...r,hash:r.hash??e},t),i=cu(n);return function(a){return class extends a{connectedCallback(){super.connectedCallback?.(),t.connect(this),i.observe(Ia(this))}disconnectedCallback(){t.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=n}}}}var w1=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function Ia(r){return r.shadowRoot||r.attachShadow({mode:"open"})}var _=r=>ns(_a)(r);var En=class extends _($){constructor(){super(),this.color="#601feb",this.radius="16.8576px",this.size="320px",this.border="#d1d5db"}render(){return h`
|
|
130
|
+
</svg>`};var dp=pc,qo=class extends Ui{resolveIcon(e){let t=dp[e];if(!t)throw console.warn("hi-outline: icon not found",e),new Error(`Icon ${e} not found`);return t}render(){super.render();let e=this.shadowRoot?.querySelector("svg");if(!e)throw new Error("svgEl not found "+this.name);e.setAttribute("fill","none"),e.querySelectorAll("[stroke]").forEach(t=>{t.setAttribute("stroke","currentColor")})}};customElements.get("hi-outline")||customElements.define("hi-outline",qo);var pn,pe,we,fn,Vo,Pi=class{constructor(e,t){p(this,fn);p(this,pn);p(this,pe);p(this,we);if(!e)throw new Error("host is required");if(!t)throw new Error("config is required");g(this,pn,e),o(this,pn).addController(this),g(this,pe,t)}connect(e){g(this,pe,e),g(this,we,m(this,fn,Vo).call(this))}hostConnected(){o(this,we)||setTimeout(()=>{o(this,we)||g(this,we,m(this,fn,Vo).call(this))},0)}hostDisconnected(){o(this,we)?.close(1e3,"lit_host_disconnected"),g(this,we,void 0)}send(e){o(this,we)?.send(e)}close(e,t){o(this,we)?.close(e,t)}get isConnected(){return o(this,we)?.readyState===WebSocket.OPEN}get isConnecting(){return o(this,we)?.readyState===WebSocket.CONNECTING}};pn=new WeakMap,pe=new WeakMap,we=new WeakMap,fn=new WeakSet,Vo=function(){let e=new WebSocket(o(this,pe).url());return o(this,pe).onClose&&(e.onclose=o(this,pe).onClose),o(this,pe).onOpen&&(e.onopen=o(this,pe).onOpen),o(this,pe).onError&&(e.onerror=o(this,pe).onError),o(this,pe).onMessage&&(e.onmessage=o(this,pe).onMessage),e};var fc=Array.isArray;var Fo=r=>!!(r&&r.constructor&&r.call&&r.apply);var mc=r=>!(!r||!r.then||!Fo(r.then));var No=(r,e,t=!1)=>{if(!r)return[];let n=(s,a)=>e(s)-e(a),i=(s,a)=>e(a)-e(s);return r.slice().sort(t===!0?i:n)};function*Qt(r,e,t=i=>i,n=1){let i=Fo(t)?t:()=>t,s=e?r:0,a=e??r;for(let l=s;l<=a&&(yield i(l),!(l+n>a));l+=n);}var Ho=(r,e,t,n)=>Array.from(Qt(r,e,t,n));var zo=(r,e)=>r?r.reduce((t,n)=>{let[i,s]=t;return e(n)?[[...i,n],s]:[i,[...s,n]]},[[],[]]):[[],[]];var Wo=class extends Error{constructor(e=[]){super();let t=e.find(n=>n.name)?.name??"";this.name=`AggregateError(${t}...)`,this.message=`AggregateError with ${e.length} errors`,this.stack=e.find(n=>n.stack)?.stack??this.stack,this.errors=e}},Go=async(r,e,t)=>{let n=e.map((u,d)=>({index:d,item:u})),i=async u=>{let d=[];for(;;){let f=n.pop();if(!f)return u(d);let[y,k]=await tr(t)(f.item);d.push({error:y,result:k,index:f.index})}},s=Ho(1,r).map(()=>new Promise(i)),a=await Promise.all(s),[l,c]=zo(No(a.flat(),u=>u.index),u=>!!u.error);if(l.length>0)throw new Wo(l.map(u=>u.error));return c.map(u=>u.result)};var Zo=async(r,e)=>{let t=r?.times??3,n=r?.delay,i=r?.backoff??null;for(let s of Qt(1,t)){let[a,l]=await tr(e)(c=>{throw{_exited:c}});if(!a)return l;if(a._exited)throw a._exited;if(s===t)throw a;n&&await er(n),i&&await er(i(s))}},er=r=>new Promise(e=>setTimeout(e,r)),tr=r=>(...e)=>{try{let t=r(...e);return mc(t)?t.then(n=>[void 0,n]).catch(n=>[n,void 0]):[void 0,t]}catch(t){return[t,void 0]}};var rr=({interval:r},e)=>{let t=!0,n,i=(...s)=>{t&&(e(...s),t=!1,n=setTimeout(()=>{t=!0,n=void 0},r))};return i.isThrottled=()=>n!==void 0,i};async function gc(r,e){let t=r?.times??3,n=r?.delay,i=r?.backoff??null;for(let s of Qt(1,t)){let[a,l]=await tr(e)(c=>{throw{_exited:c}});if(!a)return l;if(a._exited)throw a._exited;if(s===t)throw a;n&&await er(n),i&&await er(i(s))}throw new Error("unreachable")}var pp=!0,Jo="Invariant failed";function Ce(r,e){if(!r){if(pp)throw new Error(Jo);var t=typeof e=="function"?e():e,n=t?"".concat(Jo,": ").concat(t):Jo;throw new Error(n)}}var K,Y,G,nr,ir,$e,fe,Ri,wc,yc,vc,bc,Bi=class{constructor(e,t){p(this,fe);p(this,K);p(this,Y);p(this,G,null);w(this,"isStreaming",!1);w(this,"typingIndicator");w(this,"ranOutOfCredits",!1);w(this,"messages",[]);w(this,"conversationId","");p(this,nr,0);p(this,ir);w(this,"isLiveMode",!1);p(this,$e,[]);g(this,K,e),g(this,Y,t),o(this,Y).autoConnect!==!1&&g(this,G,this.initWS()),e.addController(this)}get hasQueuedMessages(){return o(this,$e).length>0}async enqueueMessage(e,{expectStreaming:t=!1}={}){if(o(this,$e).length>0){let n=o(this,$e)[o(this,$e).length-1];if(e.type==="USER_INPUT"&&n.message.type==="USER_INPUT"&&e.value===n.message.value)return!0}return o(this,G)||this.connect(),o(this,G)?.isConnected?m(this,fe,Ri).call(this,e,{expectStreaming:t}):(o(this,$e).push({message:e,options:{expectStreaming:t}}),o(this,K).requestUpdate(),o(this,G)&&!o(this,G).isConnecting&&!o(this,G).isConnected&&this.retry(),await gc({times:5,delay:2e3},async()=>{if(o(this,G)?.isConnected){let n=[...o(this,$e)];g(this,$e,[]),o(this,K).requestUpdate();let i=!1;for(let{message:s,options:a}of n){let l=m(this,fe,Ri).call(this,s,a);s===e&&(i=l)}return i}else throw new Error("WebSocket not connected yet")}).catch(()=>(console.warn("Failed to send message after retries",e),g(this,$e,[]),o(this,K).requestUpdate(),!1)))}async sendUserInput(e,{xUserData:t,xCustomInstructions:n,role:i="user",expectStreaming:s=!1,requestInputResponse:a}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:i,xUserData:t,xCustomInstructions:n,requestInputResponse:a},{expectStreaming:s})}async enqueueUserInput(e,{xUserData:t,xCustomInstructions:n,role:i="user",expectStreaming:s=!1,requestInputResponse:a}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:i,xUserData:t,xCustomInstructions:n,requestInputResponse:a},{expectStreaming:s})}sendImageDelete(e){Ce(e,"imageId is required"),this.enqueueMessage({type:"USER_FILE_DELETE",imageId:e}).catch(console.warn)}sendUserCancel(){this.enqueueMessage({type:"USER_CANCEL"}).catch(console.warn)}sendUserTypingStart(){m(this,fe,Ri).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){this.enqueueMessage({type:"USER_TYPING_STOP"}).catch(console.warn)}sendNewChat(){this.enqueueMessage({type:"NEW_CHAT"})}sendUserMeta(e){this.enqueueMessage({type:"USER_META",metadata:e}).catch(console.warn)}reloadConfig(){this.enqueueMessage({type:"RELOAD_CONFIG"}).catch(console.warn)}close(){o(this,G)?.close(1e3,"closed by user")}retry(){clearTimeout(o(this,ir)),g(this,ir,setTimeout(()=>{o(this,Y).onReconnect?.(),g(this,G,this.initWS())},1e3*o(this,nr))),Zl(this,nr)._++}initWS(){return new Pi(o(this,K),{url:()=>o(this,Y).url(this.conversationId,{}),onOpen:e=>m(this,fe,wc).call(this,e),onMessage:e=>m(this,fe,yc).call(this,JSON.parse(e.data)),onError:e=>m(this,fe,vc).call(this,e),onClose:e=>m(this,fe,bc).call(this,e)})}hostConnected(){this.conversationId=o(this,Y).restoreConversationState?.()?.conversationId||"",this.messages=o(this,Y).restoreConversationState?.()?.messages||[]}reset(){o(this,Y).onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,g(this,$e,[]),o(this,K).requestUpdate()}hostDisconnected(){clearTimeout(o(this,ir))}connect(){o(this,G)||g(this,G,this.initWS())}reconnectSocket(){o(this,G)?.close(1e3,"destroy"),g(this,G,this.initWS())}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}get isConnected(){return o(this,G)?.isConnected??!1}};K=new WeakMap,Y=new WeakMap,G=new WeakMap,nr=new WeakMap,ir=new WeakMap,$e=new WeakMap,fe=new WeakSet,Ri=function(e,{expectStreaming:t=!1}={}){return this.ranOutOfCredits?!1:o(this,G)?o(this,G).isConnecting?(console.warn("WebSocket is connecting, message not sent",e),!1):o(this,G).isConnected?(t&&!this.isLiveMode&&(this.isStreaming=!0,o(this,K).requestUpdate()),o(this,G).send(JSON.stringify(e)),!0):(console.warn("WebSocket is not connected, message not sent",e),this.retry(),!1):(console.warn("WebSocket not initialized, message not sent",e),this.connect(),!1)},wc=function(e){g(this,nr,0)},yc=function(e){switch(e.type){case"NEW_MESSAGE":{this.messages=[...this.messages,{...e.message,streaming:!0}].filter((t,n,i)=>n===i.findIndex(s=>s.id===t.id)),this.typingIndicator=void 0,o(this,K).requestUpdate(),o(this,Y).onNewMessage?.(e.message),o(this,Y).persistConversationState?.(this.conversationId,this.messages);break}case"APPEND_MESSAGE":{let t=this.messages.find(n=>n.id===e.message.id);if(t){switch(e.message.content_type){case"text":{let{part:n,delta:i,position:s}=e.message;t.content=t.content.slice(0,s)+i,t.parts||=[],t.parts[n]={text:t.parts[n]&&"text"in t.parts[n]?(t.parts[n].text||"").slice(0,s)+i:i};break}case"html":{let{part:n,delta:i,position:s}=e.message;t.parts||=[],t.parts[n]={html:t.parts[n]&&"html"in t.parts[n]?(t.parts[n].html||"").slice(0,s)+i:i};break}case"data":{let{part:n}=e.message;t.parts||=[],t.parts[n]={tag:e.message.tag,data:t.parts[n]&&"data"in t.parts[n]?Object.assign(t.parts[n].data||{},e.message.data):e.message.data};break}}e.metadata&&(t.metadata=e.metadata),o(this,Y).onMessageAppend?.(e),o(this,K).requestUpdate()}else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let t=this.messages.find(n=>n.id===e.message.id);if(t)Object.assign(t,e.message),t.streaming=!1;else throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,o(this,K).requestUpdate(),o(this,Y).onMessageDone?.(e,t),o(this,Y).persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,o(this,K).requestUpdate();break}case"ERROR":{o(this,Y).onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,o(this,Y).onConnect?.(e.conversationId,e.metadata),o(this,Y).persistConversationState?.(e.conversationId,e.messages),this.isLiveMode=e.metadata.isLiveMode,o(this,K).requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},o(this,K).requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,o(this,K).requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.ranOutOfCredits=!0,o(this,K).requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),o(this,K).requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},vc=function(e){console.error("onError",e),o(this,Y).onError?.(e)},bc=function(e){o(this,K).isConnected&&o(this,G)&&!o(this,G).isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,o(this,K).requestUpdate(),o(this,Y).onClose?.()};var k2=Symbol(),fp=Symbol();var xc=Object.getPrototypeOf,Ko=new WeakMap,mp=r=>r&&(Ko.has(r)?Ko.get(r):xc(r)===Object.prototype||xc(r)===Array.prototype);var kc=r=>mp(r)&&r[fp]||null,Yo=(r,e=!0)=>{Ko.set(r,e)};var Qo=r=>typeof r=="object"&&r!==null,gp=r=>Qo(r)&&!ea.has(r)&&(Array.isArray(r)||!(Symbol.iterator in r))&&!(r instanceof WeakMap)&&!(r instanceof WeakSet)&&!(r instanceof Error)&&!(r instanceof Number)&&!(r instanceof Date)&&!(r instanceof String)&&!(r instanceof RegExp)&&!(r instanceof ArrayBuffer)&&!(r instanceof Promise),Sc=(r,e)=>{let t=Cc.get(r);if(t?.[0]===e)return t[1];let n=Array.isArray(r)?[]:Object.create(Object.getPrototypeOf(r));return Yo(n,!0),Cc.set(r,[e,n]),Reflect.ownKeys(r).forEach(i=>{if(Object.getOwnPropertyDescriptor(n,i))return;let s=Reflect.get(r,i),{enumerable:a}=Reflect.getOwnPropertyDescriptor(r,i),l={value:s,enumerable:a,configurable:!0};if(ea.has(s))Yo(s,!1);else if($t.has(s)){let[c,u]=$t.get(s);l.value=Sc(c,u())}Object.defineProperty(n,i,l)}),Object.preventExtensions(n)},wp=(r,e,t,n)=>({deleteProperty(i,s){let a=Reflect.get(i,s);t(s);let l=Reflect.deleteProperty(i,s);return l&&n(["delete",[s],a]),l},set(i,s,a,l){let c=!r()&&Reflect.has(i,s),u=Reflect.get(i,s,l);if(c&&($c(u,a)||qi.has(a)&&$c(u,qi.get(a))))return!0;t(s),Qo(a)&&(a=kc(a)||a);let d=!$t.has(a)&&vp(a)?ta(a):a;return e(s,d),Reflect.set(i,s,d,l),n(["set",[s],a,u]),!0}}),$t=new WeakMap,ea=new WeakSet,Cc=new WeakMap,Xo=[1],qi=new WeakMap,$c=Object.is,yp=(r,e)=>new Proxy(r,e),vp=gp,bp=Sc,xp=wp;function ta(r={}){if(!Qo(r))throw new Error("object required");let e=qi.get(r);if(e)return e;let t=Xo[0],n=new Set,i=(S,M=++Xo[0])=>{t!==M&&(s=t=M,n.forEach(x=>x(S,M)))},s=t,a=(S=Xo[0])=>(s!==S&&(s=S,c.forEach(([M])=>{let x=M[1](S);x>t&&(t=x)})),t),l=S=>(M,x)=>{let E=[...M];E[1]=[S,...E[1]],i(E,x)},c=new Map,u=(S,M)=>{let x=!ea.has(M)&&$t.get(M);if(x){if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&c.has(S))throw new Error("prop listener already exists");if(n.size){let E=x[2](l(S));c.set(S,[x,E])}else c.set(S,[x])}},d=S=>{var M;let x=c.get(S);x&&(c.delete(S),(M=x[1])==null||M.call(x))},f=S=>(n.add(S),n.size===1&&c.forEach(([x,E],L)=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&E)throw new Error("remove already exists");let z=x[2](l(L));c.set(L,[x,z])}),()=>{n.delete(S),n.size===0&&c.forEach(([x,E],L)=>{E&&(E(),c.set(L,[x]))})}),y=!0,k=xp(()=>y,u,d,i),$=yp(r,k);qi.set(r,$);let j=[r,a,f];return $t.set($,j),Reflect.ownKeys(r).forEach(S=>{let M=Object.getOwnPropertyDescriptor(r,S);"value"in M&&M.writable&&($[S]=r[S])}),y=!1,$}function Vi(r,e,t){let n=$t.get(r);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!n&&console.warn("Please use proxy object");let i,s=[],a=n[2],l=!1,u=a(d=>{if(s.push(d),t){e(s.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,l&&e(s.splice(0))}))});return l=!0,()=>{l=!1,u()}}function sr(r){let e=$t.get(r);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!e&&console.warn("Please use proxy object");let[t,n]=e;return bp(t,n())}var mn,or,St,ar,lr=class{constructor(e,t){p(this,mn);p(this,or);p(this,St);p(this,ar,()=>{});g(this,mn,e),g(this,or,t),g(this,St,sr(t)),e.addController(this)}get state(){return o(this,St)}get value(){return o(this,St)}hostConnected(){o(this,ar).call(this),g(this,ar,Vi(o(this,or),()=>{g(this,St,sr(o(this,or))),o(this,mn).requestUpdate()}))}hostDisconnected(){o(this,ar).call(this)}};mn=new WeakMap,or=new WeakMap,St=new WeakMap,ar=new WeakMap;var gn,wn,Et,cr,et=class{constructor(e,t,n){p(this,gn);p(this,wn);w(this,"proxyObject");p(this,Et);p(this,cr,()=>{});g(this,gn,e),g(this,wn,n),this.proxyObject=ta(t),g(this,Et,sr(this.proxyObject)),e.addController(this)}get state(){return o(this,Et)}get value(){return o(this,Et)}hostConnected(){o(this,cr).call(this),o(this,wn)?.subscribe&&g(this,cr,Vi(this.proxyObject,()=>{g(this,Et,sr(this.proxyObject)),o(this,gn).requestUpdate()}))}hostDisconnected(){o(this,cr).call(this)}};gn=new WeakMap,wn=new WeakMap,Et=new WeakMap,cr=new WeakMap;var ur,yn,hr,_t,It,Fi=class{constructor(e,{provider:t,tag:n,key:i}){p(this,ur);p(this,yn);p(this,hr);p(this,_t,null);p(this,It,null);g(this,ur,e),g(this,yn,n),g(this,hr,i),e.addController(this)}get value(){return o(this,It)?o(this,It).value:null}hostConnected(){if(o(this,It)||(g(this,_t,kp(o(this,ur),o(this,yn))),!o(this,_t)))return;let e=o(this,_t)[o(this,hr)]instanceof et?o(this,_t)[o(this,hr)]:null;e&&g(this,It,new lr(o(this,ur),e.proxyObject))}hostDisconnected(){}};ur=new WeakMap,yn=new WeakMap,hr=new WeakMap,_t=new WeakMap,It=new WeakMap;function kp(r,e){let t=r;for(;t;){let n=t.closest(e);if(n)return n;let i=t.getRootNode();if(i instanceof ShadowRoot)t=i.host;else break}return null}var Ec=()=>{if(window.Shopify)try{return{customerId:Cp()}}catch{return null}return null},Cp=()=>{try{let r=[()=>window.ShopifyAnalytics?.meta?.page?.customerId,()=>window.meta?.page?.customerId,()=>window._st?.cid,()=>window.ShopifyAnalytics?.lib?.user()?.traits()?.uniqToken];for(let e of r)try{let t=e();if(/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i.test(t))continue;if(t)return t}catch{}}catch{return null}return null},_c=async()=>{try{return(await(await fetch(window.Shopify.routes.root+"cart.js")).json()).items.map(n=>({id:n.id,name:n.title,quantity:n.quantity,price:n.price,variantId:n.variant_id,sku:n.sku,url:n.url,description:n.product_description,image:n.featured_image?.url}))}catch{return[]}};function Ic(r,e="http"){return r.startsWith("http://")||r.startsWith("https://")?r:`${e}://${r}`}function ra(r){return new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+!*'();@&=,$]*)*(\\?[-a-z\\d%_.~+!*'();@&=,$]*)?(\\#[-a-z\\d%_.~+!*'();@&=,$]*)?$","i").test(r)}function Mc(r,e){let t=r instanceof URL?r:new URL(r);if(e)for(let[n,i]of e)t.searchParams.set(n,i);return t}var Ac=()=>{if(window.ShopRenter)try{let r=Sp();return{customerEmail:r?.customerEmail,customerId:r?.customerId,customerName:r?.customerName}}catch{return null}return null},Sp=()=>{try{if(window.ShopRenter){let r=window.ShopRenter.customer;return{customerEmail:r?.email,customerId:r?.userId,customerName:[r?.name?.firstName,r?.name?.lastName].filter(Boolean).join(" ")}}return{customerEmail:null,customerId:null,customerName:null}}catch{return{customerEmail:null,customerId:null,customerName:null}}},Tc=async()=>{try{let r=window.ShopRenter.shop?.domain;if(!r)return[];let e=Ic(r,"https")+"/cart.json";return(await(await fetch(e)).json()).items.map(s=>({id:s.id,name:s.name,quantity:s.quantity,price:s.price,sku:s.sku,image:s.image,url:s.href}))}catch{return[]}};var Lc=()=>{if(window.UNAS)try{let r=window.UNAS.customer;return{customerEmail:r?.email,customerId:r?.id}}catch(r){return console.error("Error fetching customer information:",r),null}return null},jc=async()=>new Promise((r,e)=>{try{window.UNAS.getCart(t=>{let i=t.items.map(s=>({id:s.id,name:s.name,quantity:s.quantity,price:s.price,sku:s.sku}));r(i)})}catch(t){console.error("Error fetching cart information:",t),e(t)}});var na;function ia(r){return{lang:r?.lang??na?.lang,message:r?.message,abortEarly:r?.abortEarly??na?.abortEarly,abortPipeEarly:r?.abortPipeEarly??na?.abortPipeEarly}}var Ip;function Mp(r){return Ip?.get(r)}var Ap;function Tp(r){return Ap?.get(r)}var Lp;function jp(r,e){return Lp?.get(r)?.get(e)}function Oc(r){let e=typeof r;return e==="string"?`"${r}"`:e==="number"||e==="bigint"||e==="boolean"?`${r}`:e==="object"||e==="function"?(r&&Object.getPrototypeOf(r)?.constructor?.name)??"null":e}function ye(r,e,t,n,i){let s=i&&"input"in i?i.input:t.value,a=i?.expected??r.expects??null,l=i?.received??Oc(s),c={kind:r.kind,type:r.type,input:s,expected:a,received:l,message:`Invalid ${e}: ${a?`Expected ${a} but r`:"R"}eceived ${l}`,requirement:r.requirement,path:i?.path,issues:i?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},u=r.kind==="schema",d=i?.message??r.message??jp(r.reference,c.lang)??(u?Tp(c.lang):null)??n.message??Mp(c.lang);d!==void 0&&(c.message=typeof d=="function"?d(c):d),u&&(t.typed=!1),t.issues?t.issues.push(c):t.issues=[c]}function ve(r){return{version:1,vendor:"valibot",validate(e){return r["~run"]({value:e},ia())}}}function Dp(r,e){return Object.hasOwn(r,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Uc(r,e){let t=[...new Set(r)];return t.length>1?`(${t.join(` ${e} `)})`:t[0]??"never"}var Op=class extends Error{constructor(r){super(r[0].message),this.name="ValiError",this.issues=r}};function sa(r,e){return{kind:"validation",type:"max_length",reference:sa,async:!1,expects:`<=${r}`,requirement:r,message:e,"~run"(t,n){return t.typed&&t.value.length>this.requirement&&ye(this,"length",t,n,{received:`${t.value.length}`}),t}}}function oa(r,e){return{kind:"validation",type:"min_length",reference:oa,async:!1,expects:`>=${r}`,requirement:r,message:e,"~run"(t,n){return t.typed&&t.value.length<this.requirement&&ye(this,"length",t,n,{received:`${t.value.length}`}),t}}}function Up(r,e,t){return typeof r.fallback=="function"?r.fallback(e,t):r.fallback}function Pc(r,e,t){return typeof r.default=="function"?r.default(e,t):r.default}function aa(){return{kind:"schema",type:"any",reference:aa,expects:"any",async:!1,get"~standard"(){return ve(this)},"~run"(r){return r.typed=!0,r}}}function dr(r,e){return{kind:"schema",type:"array",reference:dr,expects:"Array",async:!1,item:r,message:e,get"~standard"(){return ve(this)},"~run"(t,n){let i=t.value;if(Array.isArray(i)){t.typed=!0,t.value=[];for(let s=0;s<i.length;s++){let a=i[s],l=this.item["~run"]({value:a},n);if(l.issues){let c={type:"array",origin:"value",input:i,key:s,value:a};for(let u of l.issues)u.path?u.path.unshift(c):u.path=[c],t.issues?.push(u);if(t.issues||(t.issues=l.issues),n.abortEarly){t.typed=!1;break}}l.typed||(t.typed=!1),t.value.push(l.value)}}else ye(this,"type",t,n);return t}}}function la(r){return{kind:"schema",type:"boolean",reference:la,expects:"boolean",async:!1,message:r,get"~standard"(){return ve(this)},"~run"(e,t){return typeof e.value=="boolean"?e.typed=!0:ye(this,"type",e,t),e}}}function ca(r){return{kind:"schema",type:"null",reference:ca,expects:"null",async:!1,message:r,get"~standard"(){return ve(this)},"~run"(e,t){return e.value===null?e.typed=!0:ye(this,"type",e,t),e}}}function Ni(r){return{kind:"schema",type:"number",reference:Ni,expects:"number",async:!1,message:r,get"~standard"(){return ve(this)},"~run"(e,t){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:ye(this,"type",e,t),e}}}function ze(r,e){return{kind:"schema",type:"object",reference:ze,expects:"Object",async:!1,entries:r,message:e,get"~standard"(){return ve(this)},"~run"(t,n){let i=t.value;if(i&&typeof i=="object"){t.typed=!0,t.value={};for(let s in this.entries){let a=this.entries[s];if(s in i||(a.type==="exact_optional"||a.type==="optional"||a.type==="nullish")&&a.default!==void 0){let l=s in i?i[s]:Pc(a),c=a["~run"]({value:l},n);if(c.issues){let u={type:"object",origin:"value",input:i,key:s,value:l};for(let d of c.issues)d.path?d.path.unshift(u):d.path=[u],t.issues?.push(d);if(t.issues||(t.issues=c.issues),n.abortEarly){t.typed=!1;break}}c.typed||(t.typed=!1),t.value[s]=c.value}else if(a.fallback!==void 0)t.value[s]=Up(a);else if(a.type!=="exact_optional"&&a.type!=="optional"&&a.type!=="nullish"&&(ye(this,"key",t,n,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]}),n.abortEarly))break}}else ye(this,"type",t,n);return t}}}function pr(r,e){return{kind:"schema",type:"optional",reference:pr,expects:`(${r.expects} | undefined)`,async:!1,wrapped:r,default:e,get"~standard"(){return ve(this)},"~run"(t,n){return t.value===void 0&&(this.default!==void 0&&(t.value=Pc(this,t,n)),t.value===void 0)?(t.typed=!0,t):this.wrapped["~run"](t,n)}}}function ua(r,e){return{kind:"schema",type:"picklist",reference:ua,expects:Uc(r.map(Oc),"|"),async:!1,options:r,message:e,get"~standard"(){return ve(this)},"~run"(t,n){return this.options.includes(t.value)?t.typed=!0:ye(this,"type",t,n),t}}}function Hi(r,e,t){return{kind:"schema",type:"record",reference:Hi,expects:"Object",async:!1,key:r,value:e,message:t,get"~standard"(){return ve(this)},"~run"(n,i){let s=n.value;if(s&&typeof s=="object"){n.typed=!0,n.value={};for(let a in s)if(Dp(s,a)){let l=s[a],c=this.key["~run"]({value:a},i);if(c.issues){let d={type:"object",origin:"key",input:s,key:a,value:l};for(let f of c.issues)f.path=[d],n.issues?.push(f);if(n.issues||(n.issues=c.issues),i.abortEarly){n.typed=!1;break}}let u=this.value["~run"]({value:l},i);if(u.issues){let d={type:"object",origin:"value",input:s,key:a,value:l};for(let f of u.issues)f.path?f.path.unshift(d):f.path=[d],n.issues?.push(f);if(n.issues||(n.issues=u.issues),i.abortEarly){n.typed=!1;break}}(!c.typed||!u.typed)&&(n.typed=!1),c.typed&&(n.value[c.value]=u.value)}}else ye(this,"type",n,i);return n}}}function X(r){return{kind:"schema",type:"string",reference:X,expects:"string",async:!1,message:r,get"~standard"(){return ve(this)},"~run"(e,t){return typeof e.value=="string"?e.typed=!0:ye(this,"type",e,t),e}}}function Dc(r){let e;if(r)for(let t of r)e?e.push(...t.issues):e=t.issues;return e}function fr(r,e){return{kind:"schema",type:"union",reference:fr,expects:Uc(r.map(t=>t.expects),"|"),async:!1,options:r,message:e,get"~standard"(){return ve(this)},"~run"(t,n){let i,s,a;for(let l of this.options){let c=l["~run"]({value:t.value},n);if(c.typed)if(c.issues)s?s.push(c):s=[c];else{i=c;break}else a?a.push(c):a=[c]}if(i)return i;if(s){if(s.length===1)return s[0];ye(this,"type",t,n,{issues:Dc(s)}),t.typed=!0}else{if(a?.length===1)return a[0];ye(this,"type",t,n,{issues:Dc(a)})}return t}}}function Rc(r,e,t){let n=r["~run"]({value:e},ia(t));if(n.issues)throw new Op(n.issues);return n.value}function Bc(r,e){let t={};for(let n in r.entries)t[n]=!e||e.includes(n)?pr(r.entries[n]):r.entries[n];return{...r,entries:t,get"~standard"(){return ve(this)}}}function qc(...r){return{...r[0],pipe:r,get"~standard"(){return ve(this)},"~run"(e,t){for(let n of r)if(n.kind!=="metadata"){if(e.issues&&(n.kind==="schema"||n.kind==="transformation")){e.typed=!1;break}(!e.issues||!t.abortEarly&&!t.abortPipeEarly)&&(e=n["~run"](e,t))}return e}}}function vn(r,e,t){let n=r["~run"]({value:e},ia(t));return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}var Vc=Hi(X(),fr([X(),Ni(),la(),ca()])),Fc=qc(X(),oa(1),sa(5e3)),Nc=()=>{try{return window.UNAS?Lc():window.Shopify?Ec():window.ShopRenter?Ac():null}catch{return null}},Hc=async()=>{try{return window.UNAS?await jc():window.Shopify?await _c():window.ShopRenter?await Tc():[]}catch{return[]}},mr={schema:ze({conversationId:pr(X()),messages:pr(dr(ze({id:X(),timestamp:Ni(),role:ua(["user","assistant","support"]),content:X(),parts:pr(dr(fr([ze({text:X()}),ze({html:X()}),ze({tag:X(),data:Hi(X(),aa())})])))})))}),getStorageKey(r){if(!r)throw new Error("widgetId is not set");return`_molin_${r}`},persist(r,e,t){let n=this.getStorageKey(r);localStorage.setItem(n,JSON.stringify({conversationId:e,messages:t}))},restore(r){try{let e=this.getStorageKey(r),t=JSON.parse(localStorage.getItem(e)||"{}"),n=Rc(this.schema,t);return{conversationId:n.conversationId||"",messages:n.messages||[]}}catch(e){return console.error("Failed to restore conversation state:",e),{conversationId:"",messages:[]}}},reset(r){let e=this.getStorageKey(r);localStorage.removeItem(e)}};var U,zc,bn,xn,gr,q,Wc,Wi=class Wi extends C{constructor(){super();p(this,U);w(this,"contextCtrl");p(this,bn);p(this,xn);p(this,gr,null);this.widgetId="",this.config={},this.callbacks={},this.xUserData=void 0,this.xCustomInstructions=void 0,this.autoConnect=!1,this.contextCtrl=new et(this,{config:this.config,callbacks:this.callbacks,xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,widgetId:this.widgetId,conversationId:"",messages:[],isStreaming:!1,typingIndicator:void 0,ranOutOfCredits:!1,isLiveMode:!1,lastMsg:void 0,hasQueuedMessages:!1,isConnected:()=>o(this,U,q).isConnected,sendUserInput:this.sendUserInput.bind(this),sendUserCancel:this.sendUserCancel.bind(this),sendUserTypingStart:this.sendUserTypingStart.bind(this),sendUserTypingStop:this.sendUserTypingStop.bind(this),sendNewChat:this.sendNewChat.bind(this),reset:this.reset.bind(this),reloadConfig:this.reloadConfig.bind(this),enqueueUserInput:this.enqueueUserInput.bind(this),connect:this.connect.bind(this),sendImageDelete:o(this,U,q).sendImageDelete.bind(o(this,U,q))})}connectedCallback(){super.connectedCallback(),this.updated()}updated(){this.autoConnect&&o(this,U,q).connect(),Object.assign(this.contextCtrl.proxyObject,{widgetId:this.widgetId,config:this.config,callbacks:this.callbacks,xUserData:o(this,bn),xCustomInstructions:o(this,xn),conversationId:o(this,U,q).conversationId,messages:o(this,U,zc),isStreaming:o(this,U,q).isStreaming,typingIndicator:o(this,U,q).typingIndicator,ranOutOfCredits:o(this,U,q).ranOutOfCredits,isLiveMode:o(this,U,q).isLiveMode,lastMsg:o(this,U,q).lastMsg,hasQueuedMessages:o(this,U,q).hasQueuedMessages,sendUserInput:this.sendUserInput.bind(this),sendUserCancel:this.sendUserCancel.bind(this),sendUserTypingStart:this.sendUserTypingStart.bind(this),sendUserTypingStop:this.sendUserTypingStop.bind(this),reset:this.reset.bind(this),reloadConfig:this.reloadConfig.bind(this),enqueueUserInput:this.enqueueUserInput.bind(this),connect:this.connect.bind(this),sendImageDelete:o(this,U,q).sendImageDelete.bind(o(this,U,q))}),m(this,U,Wc).call(this)}async sendUserInput(t,n={}){let i={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,...n},s=await o(this,U,q).sendUserInput(t,i);return s&&this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:t,example:!1,conversationId:o(this,U,q).conversationId}),s}async enqueueUserInput(t,n={}){let i={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,role:"user",expectStreaming:!0,...n};return o(this,U,q).enqueueUserInput(t,i)}sendUserCancel(){o(this,U,q).sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}sendUserTypingStart(){o(this,U,q).sendUserTypingStart()}sendUserTypingStop(){o(this,U,q).sendUserTypingStop()}sendNewChat(){o(this,U,q).sendNewChat()}reset(){o(this,U,q).reset()}reloadConfig(){o(this,U,q).reloadConfig()}connect(){o(this,U,q).connect()}render(){return h`<slot></slot>`}};U=new WeakSet,zc=function(){return o(this,U,q)?.ranOutOfCredits?[{id:crypto.randomUUID(),role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}]:o(this,U,q)?.messages||[]},bn=new WeakMap,xn=new WeakMap,gr=new WeakMap,q=function(){return o(this,gr)||g(this,gr,new Bi(this,{autoConnect:this.autoConnect,url:t=>{let n=new URL(this.config.wsApiUrl);return n.searchParams.set("widgetId",this.widgetId),n.searchParams.set("conversationId",t),n.searchParams.set("pageUrl",window.location.href),n},onReconnect:()=>{},onError:t=>{console.error("ws error",t)},onClose:()=>{},onNewMessage:t=>{t.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:t,conversationId:o(this,U,q).conversationId})},onMessageAppend:t=>{},onMessageDone:(t,n)=>{n.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:n.content??"",message:n,usage_TOKENS_COMPLETION:t.message.usage.TOKENS_COMPLETION,conversationId:o(this,U,q).conversationId})},onMessageError:t=>{console.error("ws message error",t),t.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+t.message})},onReset:()=>{mr.reset(this.widgetId)},onConnect:(t,n)=>{let i=Nc();o(this,U,q).sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,language:window.navigator.language,cart:[]}),Hc().then(s=>{s?.length>0&&o(this,U,q).sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,cart:s,language:window.navigator.language})}).catch(s=>{console.error(s)}),this.dispatchEvent(new Wi.ConnectedEvent({conversationId:t,metadata:n,widgetId:this.widgetId,pendingImages:n?.pendingImages||[]}))},persistConversationState:(t,n)=>{mr.persist(this.widgetId,t,n)},restoreConversationState:()=>mr.restore(this.widgetId)})),o(this,gr)},Wc=function(){function t(i){if(!i)return;let s;try{s=typeof i=="object"?i:JSON.parse(i)}catch(l){console.error("Molin: user-data is not valid JSON",l);return}if(!s||typeof s!="object"||Object.keys(s).length===0)return;let a=vn(Vc,s);if(!a.success){console.error("Molin: user-data does not pass schema validation",a.issues);return}return a.output}function n(i){if(!i)return;let s=vn(Fc,i);if(!s.success){console.error("Molin: custom-instructions does not pass schema validation",s.issues);return}return s.output}g(this,bn,t(this.xUserData)),g(this,xn,n(this.xCustomInstructions))},w(Wi,"properties",{widgetId:{type:String},config:{type:Object},callbacks:{type:Object},xUserData:{type:Object},xCustomInstructions:{type:Object},autoConnect:{type:Boolean}});var wr=Wi;function Gc(r){let e=new Fi(r,{provider:wr,tag:"mw-context-widget",key:"contextCtrl"});return new Proxy({value:null},{get(t,n){if(n==="value")return e.value}})}var ha;wr.ConnectedEvent=(ha=class extends CustomEvent{constructor(e,t={}){super(wr.ConnectedEvent.type,{detail:e,bubbles:!0,composed:!0,...t})}},w(ha,"type","mw-context-widget:connected"),ha);customElements.get("mw-context-widget")||customElements.define("mw-context-widget",wr);function xa(r){return[...r.v,(r.i?"!":"")+r.n].join(":")}function Pp(r,e=","){return r.map(xa).join(e)}var eu=typeof CSS<"u"&&CSS.escape||(r=>r.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function Gi(r){for(var e=9,t=r.length;t--;)e=Math.imul(e^r.charCodeAt(t),1597334677);return"#"+((e^e>>>9)>>>0).toString(36)}function Ki(r,e="@media "){return e+V(r).map(t=>(typeof t=="string"&&(t={min:t}),t.raw||Object.keys(t).map(n=>`(${n}-width:${t[n]})`).join(" and "))).join(",")}function V(r=[]){return Array.isArray(r)?r:r==null?[]:[r]}function Zc(r){return r}function Yi(){}var te={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function tu(r){return r.match(/[-=:;]/g)?.length||0}function ga(r){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(r)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(tu(r),15)<<18}var Rp=["rst-c","st-ch","h-chi","y-lin","nk","sited","ecked","pty","ad-on","cus-w","ver","cus","cus-v","tive","sable","tiona","quire"];function ka({n:r,i:e,v:t=[]},n,i,s){r&&(r=xa({n:r,i:e,v:t})),s=[...V(s)];for(let l of t){let c=n.theme("screens",l);for(let u of V(c&&Ki(c)||n.v(l))){var a;s.push(u),i|=c?67108864|ga(u):l=="dark"?1073741824:u[0]=="@"?ga(u):(a=u,1<<~(/:([a-z-]+)/.test(a)&&~Rp.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:r,p:i,r:s,i:e}}var ru=new Map;function wa(r){if(r.d){let e=[],t=da(r.r.reduce((n,i)=>i[0]=="@"?(e.push(i),n):i?da(n,s=>da(i,a=>{let l=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(a);if(l){let c=s.indexOf(l[1]);return~c?s.slice(0,c)+l[0]+s.slice(c+l[1].length):pa(s,a)}return pa(a,s)})):n,"&"),n=>pa(n,r.n?"."+eu(r.n):""));return t&&e.push(t.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((n,i)=>i+"{"+n+"}",r.d)}}function da(r,e){return r.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(t,n,i)=>e(n)+i)}function pa(r,e){return r.replace(/&/g,e)}var Jc=new Intl.Collator("en",{numeric:!0});function nu(r,e){for(var t=0,n=r.length;t<n;){let i=n+t>>1;0>=iu(r[i],e)?t=i+1:n=i}return n}function iu(r,e){let t=r.p&te.o;return t==(e.p&te.o)&&(t==te.b||t==te.o)?0:r.p-e.p||r.o-e.o||Jc.compare(Kc(r.n),Kc(e.n))||Jc.compare(Yc(r.n),Yc(e.n))}function Kc(r){return(r||"").split(/:/).pop().split("/").pop()||"\0"}function Yc(r){return(r||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function fa(r,e){return Math.round(parseInt(r,16)*e)}function Se(r,e={}){if(typeof r=="function")return r(e);let{opacityValue:t="1",opacityVariable:n}=e,i=n?`var(${n})`:t;if(r.includes("<alpha-value>"))return r.replace("<alpha-value>",i);if(r[0]=="#"&&(r.length==4||r.length==7)){let s=(r.length-1)/3,a=[17,1,.062272][s-1];return`rgba(${[fa(r.substr(1,s),a),fa(r.substr(1+s,s),a),fa(r.substr(1+2*s,s),a),i]})`}return i=="1"?r:i=="0"?"#0000":r.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${i})`)}function su(r,e,t,n,i=[]){return(function s(a,{n:l,p:c,r:u=[],i:d},f){let y=[],k="",$=0,j=0;for(let x in a||{}){var S,M;let E=a[x];if(x[0]=="@"){if(!E)continue;if(x[1]=="a"){y.push(...$a(l,c,Ji(""+E),f,c,u,d,!0));continue}if(x[1]=="l"){for(let L of V(E))y.push(...s(L,{n:l,p:(S=te[x[7]],c&~te.o|S),r:x[7]=="d"?[]:u,i:d},f));continue}if(x[1]=="i"){y.push(...V(E).map(L=>({p:-1,o:0,r:[],d:x+" "+L})));continue}if(x[1]=="k"){y.push({p:te.d,o:0,r:[x],d:s(E,{p:te.d},f).map(wa).join("")});continue}if(x[1]=="f"){y.push(...V(E).map(L=>({p:te.d,o:0,r:[x],d:s(L,{p:te.d},f).map(wa).join("")})));continue}}if(typeof E!="object"||Array.isArray(E))x=="label"&&E?l=E+Gi(JSON.stringify([c,d,a])):(E||E===0)&&(x=x.replace(/[A-Z]/g,L=>"-"+L.toLowerCase()),j+=1,$=Math.max($,(M=x)[0]=="-"?0:tu(M)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(M)?+!!RegExp.$1||-!!RegExp.$2:0)+1),k+=(k?";":"")+V(E).map(L=>f.s(x,Ca(""+L,f.theme)+(d?" !important":""))).join(";"));else if(x[0]=="@"||x.includes("&")){let L=c;x[0]=="@"&&(x=x.replace(/\bscreen\(([^)]+)\)/g,(z,ee)=>{let ie=f.theme("screens",ee);return ie?(L|=67108864,Ki(ie,"")):z}),L|=ga(x)),y.push(...s(E,{n:l,p:L,r:[...u,x],i:d},f))}else y.push(...s(E,{p:c,r:[...u,x]},f))}return y.unshift({n:l,p:c,o:Math.max(0,15-j)+1.5*Math.min($||15,15),r:u,d:k}),y.sort(iu)})(r,ka(e,t,n,i),t)}function Ca(r,e){return r.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(t,n,i,s,a="")=>{let l=e(i,a);return typeof l=="function"&&/color|fill|stroke/i.test(i)?Se(l):""+V(l).filter(c=>Object(c)!==c)})}function ou(r,e){let t,n=[];for(let i of r)i.d&&i.n?t?.p==i.p&&""+t.r==""+i.r?(t.c=[t.c,i.c].filter(Boolean).join(" "),t.d=t.d+";"+i.d):n.push(t={...i,n:i.n&&e}):n.push({...i,n:i.n&&e});return n}function Zi(r,e,t=te.u,n,i){let s=[];for(let a of r)for(let l of(function(c,u,d,f,y){c={...c,i:c.i||y};let k=(function($,j){let S=ru.get($.n);return S?S($,j):j.r($.n,$.v[0]=="dark")})(c,u);return k?typeof k=="string"?({r:f,p:d}=ka(c,u,d,f),ou(Zi(Ji(k),u,d,f,c.i),c.n)):Array.isArray(k)?k.map($=>{var j,S;return{o:0,...$,r:[...V(f),...V($.r)],p:(j=d,S=$.p??d,j&~te.o|S)}}):su(k,c,u,d,f):[{c:xa(c),p:0,o:0,r:[]}]})(a,e,t,n,i))s.splice(nu(s,l),0,l);return s}function $a(r,e,t,n,i,s,a,l){return ou((l?t.flatMap(c=>Zi([c],n,i,s,a)):Zi(t,n,i,s,a)).map(c=>c.p&te.o&&(c.n||e==te.b)?{...c,p:c.p&~te.o|e,o:0}:c),r)}function Bp(r,e,t,n){var i;return i=(s,a)=>{let{n:l,p:c,r:u,i:d}=ka(s,a,e);return t&&$a(l,e,t,a,c,u,d,n)},ru.set(r,i),r}function ma(r,e,t){if(r[r.length-1]!="("){let n=[],i=!1,s=!1,a="";for(let l of r)if(!(l=="("||/[~@]$/.test(l))){if(l[0]=="!"&&(l=l.slice(1),i=!i),l.endsWith(":")){n[l=="dark:"?"unshift":"push"](l.slice(0,-1));continue}l[0]=="-"&&(l=l.slice(1),s=!s),l.endsWith("-")&&(l=l.slice(0,-1)),l&&l!="&"&&(a+=(a&&"-")+l)}a&&(s&&(a="-"+a),e[0].push({n:a,v:n.filter(qp),i}))}}function qp(r,e,t){return t.indexOf(r)==e}var Xc=new Map;function Ji(r){let e=Xc.get(r);if(!e){let t=[],n=[[]],i=0,s=0,a=null,l=0,c=(u,d=0)=>{i!=l&&(t.push(r.slice(i,l+d)),u&&ma(t,n)),i=l+1};for(;l<r.length;l++){let u=r[l];if(s)r[l-1]!="\\"&&(s+=+(u=="[")||-(u=="]"));else if(u=="[")s+=1;else if(a)r[l-1]!="\\"&&a.test(r.slice(l))&&(a=null,i=l+RegExp.lastMatch.length);else if(u=="/"&&r[l-1]!="\\"&&(r[l+1]=="*"||r[l+1]=="/"))a=r[l+1]=="*"?/^\*\//:/^[\r\n]/;else if(u=="(")c(),t.push(u);else if(u==":")r[l+1]!=":"&&c(!1,1);else if(/[\s,)]/.test(u)){c(!0);let d=t.lastIndexOf("(");if(u==")"){let f=t[d-1];if(/[~@]$/.test(f)){let y=n.shift();t.length=d,ma([...t,"#"],n);let{v:k}=n[0].pop();for(let $ of y)$.v.splice(+($.v[0]=="dark")-+(k[0]=="dark"),k.length);ma([...t,Bp(f.length>1?f.slice(0,-1)+Gi(JSON.stringify([f,y])):f+"("+Pp(y)+")",te.a,y,/@$/.test(f))],n)}d=t.lastIndexOf("(",d-1)}t.length=d+1}else/[~@]/.test(u)&&r[l+1]=="("&&n.unshift([])}c(!0),Xc.set(r,e=n[0])}return e}function v(r,e,t){return[r,ya(e,t)]}function ya(r,e){return typeof r=="function"?r:typeof r=="string"&&/^[\w-]+$/.test(r)?(t,n)=>({[r]:e?e(t,n):va(t,1)}):t=>r||{[t[1]]:va(t,2)}}function va(r,e,t=r.slice(e).find(Boolean)||r.$$||r.input){return r.input[0]=="-"?`calc(${t} * -1)`:t}function b(r,e,t,n){return[r,Sa(e,t,n)]}function Sa(r,e,t){let n=typeof e=="string"?(i,s)=>({[e]:t?t(i,s):i._}):e||(({1:i,_:s},a,l)=>({[i||l]:s}));return(i,s)=>{let a=au(r||i[1]),l=s.theme(a,i.$$)??Ue(i.$$,a,s);if(l!=null)return i._=va(i,0,l),n(i,s,a)}}function re(r,e={},t){return[r,Vp(e,t)]}function Vp(r={},e){return(t,n)=>{let{section:i=au(t[0]).replace("-","")+"Color"}=r,[s,a]=Fp(t.$$);if(!s)return;let l=n.theme(i,s)||Ue(s,i,n);if(!l||typeof l=="object")return;let{opacityVariable:c=`--tw-${t[0].replace(/-$/,"")}-opacity`,opacitySection:u=i.replace("Color","Opacity"),property:d=i,selector:f}=r,y=n.theme(u,a||"DEFAULT")||a&&Ue(a,u,n),k=e||(({_:j})=>{let S=kn(d,j);return f?{[f]:S}:S});t._={value:Se(l,{opacityVariable:c||void 0,opacityValue:y||void 0}),color:j=>Se(l,j),opacityVariable:c||void 0,opacityValue:y||void 0};let $=k(t,n);if(!t.dark){let j=n.d(i,s,l);j&&j!==l&&(t._={value:Se(j,{opacityVariable:c||void 0,opacityValue:y||"1"}),color:S=>Se(j,S),opacityVariable:c||void 0,opacityValue:y||void 0},$={"&":$,[n.v("dark")]:k(t,n)})}return $}}function Fp(r){return(r.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function kn(r,e){let t={};return typeof e=="string"?t[r]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(t[e.opacityVariable]=e.opacityValue||"1"),t[r]=e.value),t}function Ue(r,e,t){if(r[0]=="["&&r.slice(-1)=="]"){if(r=yr(Ca(r.slice(1,-1),t.theme)),!e)return r;if(!(/color|fill|stroke/i.test(e)&&!(/^color:/.test(r)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(r))||/image/i.test(e)&&!(/^image:/.test(r)||/^[a-z-]+\(/.test(r))||/weight/i.test(e)&&!(/^(number|any):/.test(r)||/^\d+$/.test(r))||/position/i.test(e)&&/^(length|size):/.test(r)))return r.replace(/^[a-z-]+:/,"")}}function au(r){return r.replace(/-./g,e=>e[1].toUpperCase())}function yr(r){return r.includes("url(")?r.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,t="",n,i="")=>yr(t)+n+yr(i)):r.replace(/(^|[^\\])_+/g,(e,t)=>t+" ".repeat(e.length-t.length)).replace(/\\_/g,"_").replace(/(calc|min|max|clamp)\(.+\)/g,e=>e.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "))}function Cn({presets:r=[],...e}){let t={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:V(e.variants),rules:V(e.rules),ignorelist:V(e.ignorelist),hash:void 0,stringify:(n,i)=>n+":"+i,finalize:[]};for(let n of V([...r,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&V(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:i,darkMode:s=t.darkMode,darkColor:a=t.darkColor,theme:l,variants:c,rules:u,ignorelist:d,hash:f=t.hash,stringify:y=t.stringify,finalize:k}=typeof n=="function"?n(t):n;t={preflight:t.preflight!==!1&&i!==!1&&[...t.preflight,...V(i)],darkMode:s,darkColor:a,theme:{...t.theme,...l,extend:{...t.theme.extend,...l?.extend}},variants:[...t.variants,...V(c)],rules:[...t.rules,...V(u)],ignorelist:[...t.ignorelist,...V(d)],hash:f,stringify:y,finalize:[...t.finalize,...V(k)]}}return t}function Qc(r,e,t,n,i,s){for(let a of e){let l=t.get(a);l||t.set(a,l=n(a));let c=l(r,i,s);if(c)return c}}function Np(r){var e;return ba(r[0],typeof(e=r[1])=="function"?e:()=>e)}function Hp(r){var e,t;return Array.isArray(r)?ba(r[0],ya(r[1],r[2])):ba(r,ya(e,t))}function ba(r,e){return lu(r,(t,n,i,s)=>{let a=n.exec(t);if(a)return a.$$=t.slice(a[0].length),a.dark=s,e(a,i)})}function lu(r,e){let t=V(r).map(zp);return(n,i,s)=>{for(let a of t){let l=e(n,a,i,s);if(l)return l}}}function zp(r){return typeof r=="string"?RegExp("^"+r+(r.includes("$")||r.slice(-1)=="-"?"":"$")):r}function cu(r,e){let t=Cn(r),n=(function({theme:c,darkMode:u,darkColor:d=Yi,variants:f,rules:y,hash:k,stringify:$,ignorelist:j,finalize:S}){let M=new Map,x=new Map,E=new Map,L=new Map,z=lu(j,(B,se)=>se.test(B));f.push(["dark",Array.isArray(u)||u=="class"?`${V(u)[1]||".dark"} &`:typeof u=="string"&&u!="media"?u:"@media (prefers-color-scheme:dark)"]);let ee=typeof k=="function"?B=>k(B,Gi):k?Gi:Zc;ee!==Zc&&S.push(B=>({...B,n:B.n&&ee(B.n),d:B.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(se,de)=>"--"+ee(de).replace("#",""))}));let ie={theme:(function({extend:B={},...se}){let de={},_o={get colors(){return gt("colors")},theme:gt,negative(){return{}},breakpoints(Z){let oe={};for(let ge in Z)typeof Z[ge]=="string"&&(oe["screen-"+ge]=Z[ge]);return oe}};return gt;function gt(Z,oe,ge,tn){if(Z){if({1:Z,2:tn}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(Z)||[,Z],/[.[]/.test(Z)){let Fe=[];Z.replace(/\[([^\]]+)\]|([^.[]+)/g,(yt,nn,Wd=nn)=>Fe.push(Wd)),Z=Fe.shift(),ge=oe,oe=Fe.join("-")}let Oe=de[Z]||Object.assign(Object.assign(de[Z]={},Ei(se,Z)),Ei(B,Z));if(oe==null)return Oe;oe||(oe="DEFAULT");let wt=Oe[oe]??oe.split("-").reduce((Fe,yt)=>Fe?.[yt],Oe)??ge;return tn?Se(wt,{opacityValue:Ca(tn,gt)}):wt}let rn={};for(let Oe of[...Object.keys(se),...Object.keys(B)])rn[Oe]=gt(Oe);return rn}function Ei(Z,oe){let ge=Z[oe];return typeof ge=="function"&&(ge=ge(_o)),ge&&/color|fill|stroke/i.test(oe)?(function tn(rn,Oe=[]){let wt={};for(let Fe in rn){let yt=rn[Fe],nn=[...Oe,Fe];wt[nn.join("-")]=yt,Fe=="DEFAULT"&&(nn=Oe,wt[Oe.join("-")]=yt),typeof yt=="object"&&Object.assign(wt,tn(yt,nn))}return wt})(ge):ge}})(c),e:eu,h:ee,s(B,se){return $(B,se,ie)},d(B,se,de){return d(B,se,ie,de)},v(B){return M.has(B)||M.set(B,Qc(B,f,x,Np,ie)||"&:"+B),M.get(B)},r(B,se){let de=JSON.stringify([B,se]);return E.has(de)||E.set(de,!z(B,ie)&&Qc(B,y,L,Hp,ie,se)),E.get(de)},f(B){return S.reduce((se,de)=>de(se,ie),B)}};return ie})(t),i=new Map,s=[],a=new Set;e.resume(c=>i.set(c,c),(c,u)=>{e.insert(c,s.length,u),s.push(u),a.add(c)});function l(c){let u=n.f(c),d=wa(u);if(d&&!a.has(d)){a.add(d);let f=nu(s,c);e.insert(d,f,c),s.splice(f,0,c)}return u.n}return Object.defineProperties(function(u){if(!i.size)for(let f of V(t.preflight))typeof f=="function"&&(f=f(n)),f&&(typeof f=="string"?$a("",te.b,Ji(f),n,te.b,[],!1,!0):su(f,{},n,te.b)).forEach(l);u=""+u;let d=i.get(u);if(!d){let f=new Set;for(let y of Zi(Ji(u),n))f.add(y.c).add(l(y));d=[...f].filter(Boolean).join(" "),i.set(u,d).set(d,d)}return d},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:n.theme,config:t,snapshot(){let c=e.snapshot(),u=new Set(a),d=new Map(i),f=[...s];return()=>{c(),a=u,i=d,s=f}},clear(){e.clear(),a=new Set,i=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function Wp(r,e){return r!=e&&""+r.split(" ").sort()!=""+e.split(" ").sort()}function uu(r){let e=new MutationObserver(t);return{observe(i){e.observe(i,{attributeFilter:["class"],subtree:!0,childList:!0}),n(i),t([{target:i,type:""}])},disconnect(){e.disconnect()}};function t(i){for(let{type:s,target:a}of i)if(s[0]=="a")n(a);else for(let l of a.querySelectorAll("[class]"))n(l);e.takeRecords()}function n(i){let s,a=i.getAttribute?.("class");a&&Wp(a,s=r(a))&&i.setAttribute("class",s)}}function Gp(r){let e=document.querySelector(r||'style[data-twind=""]');return(!e||e.tagName!="STYLE")&&(e=document.createElement("style"),document.head.prepend(e)),e.dataset.twind="claimed",e}function Xi(r){let e=r?.cssRules?r:(r&&typeof r!="string"?r:Gp(r)).sheet;return{target:e,snapshot(){let t=Array.from(e.cssRules,n=>n.cssText);return()=>{this.clear(),t.forEach(this.insert)}},clear(){for(let t=e.cssRules.length;t--;)e.deleteRule(t)},destroy(){e.ownerNode?.remove()},insert(t,n){try{e.insertRule(t,n)}catch{e.insertRule(":root{}",n)}},resume:Yi}}var Zp=new Map([["align-self","-ms-grid-row-align"],["color-adjust","-webkit-print-color-adjust"],["column-gap","grid-column-gap"],["forced-color-adjust","-ms-high-contrast-adjust"],["gap","grid-gap"],["grid-template-columns","-ms-grid-columns"],["grid-template-rows","-ms-grid-rows"],["justify-self","-ms-grid-column-align"],["margin-inline-end","-webkit-margin-end"],["margin-inline-start","-webkit-margin-start"],["mask-border","-webkit-mask-box-image"],["mask-border-outset","-webkit-mask-box-image-outset"],["mask-border-slice","-webkit-mask-box-image-slice"],["mask-border-source","-webkit-mask-box-image-source"],["mask-border-repeat","-webkit-mask-box-image-repeat"],["mask-border-width","-webkit-mask-box-image-width"],["overflow-wrap","word-wrap"],["padding-inline-end","-webkit-padding-end"],["padding-inline-start","-webkit-padding-start"],["print-color-adjust","color-adjust"],["row-gap","grid-row-gap"],["scroll-margin-bottom","scroll-snap-margin-bottom"],["scroll-margin-left","scroll-snap-margin-left"],["scroll-margin-right","scroll-snap-margin-right"],["scroll-margin-top","scroll-snap-margin-top"],["scroll-margin","scroll-snap-margin"],["text-combine-upright","-ms-text-combine-horizontal"]]);function hu(r){return Zp.get(r)}function du(r){var e=/^(?:(text-(?:decoration$|e|or|si)|back(?:ground-cl|d|f)|box-d|mask(?:$|-[ispro]|-cl)|pr|hyphena|flex-d)|(tab-|column(?!-s)|text-align-l)|(ap)|u|hy)/i.exec(r);return e?e[1]?1:e[2]?2:e[3]?3:5:0}function pu(r,e){var t=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(r);return t?t[1]?/^sti/i.test(e)?1:0:t[2]?/^pat/i.test(e)?1:0:t[3]?/^image-/i.test(e)?1:0:t[4]?e[3]==="-"?2:0:/^(?:inline-)?grid$/i.test(e)?4:0:0}var Jp=[["-webkit-",1],["-moz-",2],["-ms-",4]];function Qi(){return({stringify:r})=>({stringify(e,t,n){let i="",s=hu(e);s&&(i+=r(s,t,n)+";");let a=du(e),l=pu(e,t);for(let c of Jp)a&c[1]&&(i+=r(c[0]+e,t,n)+";"),l&c[1]&&(i+=r(e,c[0]+t,n)+";");return i+r(e,t,n)}})}function es(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",Sa("lineClamp",({_:r})=>fu(r))],["line-clamp-(\\d+)",({1:r})=>fu(r)]]}}function fu(r){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${r}`}}var Sn={screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},columns:{auto:"auto","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},spacing:{px:"1px",0:"0px",...be(4,"rem",4,.5,.5),...be(12,"rem",4,5),14:"3.5rem",...be(64,"rem",4,16,4),72:"18rem",80:"20rem",96:"24rem"},durations:{75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0,0,0.2,1) infinite",pulse:"pulse 2s cubic-bezier(0.4,0,0.6,1) infinite",bounce:"bounce 1s infinite"},aspectRatio:{auto:"auto",square:"1/1",video:"16/9"},backdropBlur:R("blur"),backdropBrightness:R("brightness"),backdropContrast:R("contrast"),backdropGrayscale:R("grayscale"),backdropHueRotate:R("hueRotate"),backdropInvert:R("invert"),backdropOpacity:R("opacity"),backdropSaturate:R("saturate"),backdropSepia:R("sepia"),backgroundColor:R("colors"),backgroundImage:{none:"none"},backgroundOpacity:R("opacity"),backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{none:"none",0:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},brightness:{...be(200,"",100,0,50),...be(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:r})=>({DEFAULT:r("colors.gray.200","currentColor"),...r("colors")}),borderOpacity:R("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem","1/2":"50%",full:"9999px"},borderSpacing:R("spacing"),borderWidth:{DEFAULT:"1px",...Ee(8,"px")},boxShadow:{sm:"0 1px 2px 0 rgba(0,0,0,0.05)",DEFAULT:"0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1)",md:"0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1)",lg:"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",xl:"0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1)","2xl":"0 25px 50px -12px rgba(0,0,0,0.25)",inner:"inset 0 2px 4px 0 rgba(0,0,0,0.05)",none:"0 0 #0000"},boxShadowColor:R("colors"),caretColor:R("colors"),accentColor:({theme:r})=>({auto:"auto",...r("colors")}),contrast:{...be(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:R("borderColor"),divideOpacity:R("borderOpacity"),divideWidth:R("borderWidth"),dropShadow:{sm:"0 1px 1px rgba(0,0,0,0.05)",DEFAULT:["0 1px 2px rgba(0,0,0,0.1)","0 1px 1px rgba(0,0,0,0.06)"],md:["0 4px 3px rgba(0,0,0,0.07)","0 2px 2px rgba(0,0,0,0.06)"],lg:["0 10px 8px rgba(0,0,0,0.04)","0 4px 3px rgba(0,0,0,0.1)"],xl:["0 20px 13px rgba(0,0,0,0.03)","0 8px 5px rgba(0,0,0,0.08)"],"2xl":"0 25px 25px rgba(0,0,0,0.15)",none:"0 0 #0000"},fill:({theme:r})=>({...r("colors"),none:"none"}),grayscale:{DEFAULT:"100%",0:"0"},hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},invert:{DEFAULT:"100%",0:"0"},flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:r})=>({...r("spacing"),...$n(2,6),...$n(12,12),auto:"auto",full:"100%"}),flexGrow:{DEFAULT:1,0:0},flexShrink:{DEFAULT:1,0:0},fontFamily:{sans:'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"'.split(","),serif:'ui-serif,Georgia,Cambria,"Times New Roman",Times,serif'.split(","),mono:'ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'.split(",")},fontSize:{xs:["0.75rem","1rem"],sm:["0.875rem","1.25rem"],base:["1rem","1.5rem"],lg:["1.125rem","1.75rem"],xl:["1.25rem","1.75rem"],"2xl":["1.5rem","2rem"],"3xl":["1.875rem","2.25rem"],"4xl":["2.25rem","2.5rem"],"5xl":["3rem","1"],"6xl":["3.75rem","1"],"7xl":["4.5rem","1"],"8xl":["6rem","1"],"9xl":["8rem","1"]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:R("spacing"),gradientColorStops:R("colors"),gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0,1fr)"},gridColumn:{auto:"auto","span-full":"1 / -1"},gridRow:{auto:"auto","span-full":"1 / -1"},gridTemplateColumns:{none:"none"},gridTemplateRows:{none:"none"},height:({theme:r})=>({...r("spacing"),...$n(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:r})=>({...r("spacing"),...$n(2,4),auto:"auto",full:"100%"}),keyframes:{spin:{from:{transform:"rotate(0deg)"},to:{transform:"rotate(360deg)"}},ping:{"0%":{transform:"scale(1)",opacity:"1"},"75%,100%":{transform:"scale(2)",opacity:"0"}},pulse:{"0%,100%":{opacity:"1"},"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{...be(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:r})=>({auto:"auto",...r("spacing")}),maxHeight:({theme:r})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...r("spacing")}),maxWidth:({theme:r,breakpoints:e})=>({...e(r("screens")),none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch"}),minHeight:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"},opacity:{...be(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:R("spacing"),placeholderColor:R("colors"),placeholderOpacity:R("opacity"),outlineColor:R("colors"),outlineOffset:Ee(8,"px"),outlineWidth:Ee(8,"px"),ringColor:({theme:r})=>({...r("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:R("colors"),ringOffsetWidth:Ee(8,"px"),ringOpacity:({theme:r})=>({...r("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...Ee(8,"px")},rotate:{...Ee(2,"deg"),...Ee(12,"deg",3),...Ee(180,"deg",45)},saturate:be(200,"",100,0,50),scale:{...be(150,"",100,0,50),...be(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:R("spacing"),scrollPadding:R("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...Ee(2,"deg"),...Ee(12,"deg",3)},space:R("spacing"),stroke:({theme:r})=>({...r("colors"),none:"none"}),strokeWidth:be(2),textColor:R("colors"),textDecorationColor:R("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...Ee(8,"px")},textUnderlineOffset:{auto:"auto",...Ee(8,"px")},textIndent:R("spacing"),textOpacity:R("opacity"),transitionDuration:({theme:r})=>({...r("durations"),DEFAULT:"150ms"}),transitionDelay:R("durations"),transitionProperty:{none:"none",all:"all",DEFAULT:"color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",colors:"color,background-color,border-color,text-decoration-color,fill,stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4,0,0.2,1)",linear:"linear",in:"cubic-bezier(0.4,0,1,1)",out:"cubic-bezier(0,0,0.2,1)","in-out":"cubic-bezier(0.4,0,0.2,1)"},translate:({theme:r})=>({...r("spacing"),...$n(2,4),full:"100%"}),width:({theme:r})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...r("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...be(50,"",1,0,10),auto:"auto"}};function $n(r,e){let t={};do for(var n=1;n<r;n++)t[`${n}/${r}`]=Number((n/r*100).toFixed(6))+"%";while(++r<=e);return t}function Ee(r,e,t=0){let n={};for(;t<=r;t=2*t||1)n[t]=t+e;return n}function be(r,e="",t=1,n=0,i=1,s={}){for(;n<=r;n+=i)s[n]=n/t+e;return s}function R(r){return({theme:e})=>e(r)}var mu={"*,::before,::after":{boxSizing:"border-box",borderWidth:"0",borderStyle:"solid",borderColor:"theme(borderColor.DEFAULT, currentColor)"},"::before,::after":{"--tw-content":"''"},html:{lineHeight:1.5,WebkitTextSizeAdjust:"100%",MozTabSize:"4",tabSize:4,fontFamily:`theme(fontFamily.sans, ${Sn.fontFamily.sans})`,fontFeatureSettings:"theme(fontFamily.sans[1].fontFeatureSettings, normal)"},body:{margin:"0",lineHeight:"inherit"},hr:{height:"0",color:"inherit",borderTopWidth:"1px"},"abbr:where([title])":{textDecoration:"underline dotted"},"h1,h2,h3,h4,h5,h6":{fontSize:"inherit",fontWeight:"inherit"},a:{color:"inherit",textDecoration:"inherit"},"b,strong":{fontWeight:"bolder"},"code,kbd,samp,pre":{fontFamily:`theme(fontFamily.mono, ${Sn.fontFamily.mono})`,fontFeatureSettings:"theme(fontFamily.mono[1].fontFeatureSettings, normal)",fontSize:"1em"},small:{fontSize:"80%"},"sub,sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sub:{bottom:"-0.25em"},sup:{top:"-0.5em"},table:{textIndent:"0",borderColor:"inherit",borderCollapse:"collapse"},"button,input,optgroup,select,textarea":{fontFamily:"inherit",fontSize:"100%",lineHeight:"inherit",color:"inherit",margin:"0",padding:"0"},"button,select":{textTransform:"none"},"button,[type='button'],[type='reset'],[type='submit']":{WebkitAppearance:"button",backgroundColor:"transparent",backgroundImage:"none"},":-moz-focusring":{outline:"auto"},":-moz-ui-invalid":{boxShadow:"none"},progress:{verticalAlign:"baseline"},"::-webkit-inner-spin-button,::-webkit-outer-spin-button":{height:"auto"},"[type='search']":{WebkitAppearance:"textfield",outlineOffset:"-2px"},"::-webkit-search-decoration":{WebkitAppearance:"none"},"::-webkit-file-upload-button":{WebkitAppearance:"button",font:"inherit"},summary:{display:"list-item"},"blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre":{margin:"0"},fieldset:{margin:"0",padding:"0"},legend:{padding:"0"},"ol,ul,menu":{listStyle:"none",margin:"0",padding:"0"},textarea:{resize:"vertical"},"input::placeholder,textarea::placeholder":{opacity:1,color:"theme(colors.gray.400, #9ca3af)"},'button,[role="button"]':{cursor:"pointer"},":disabled":{cursor:"default"},"img,svg,video,canvas,audio,iframe,embed,object":{display:"block",verticalAlign:"middle"},"img,video":{maxWidth:"100%",height:"auto"},"[hidden]":{display:"none"}};var xu=[v("\\[([-\\w]+):(.+)]",({1:r,2:e},t)=>({"@layer overrides":{"&":{[r]:Ue(`[${e}]`,"",t)}}})),v("(group|peer)([~/][^-[]+)?",({input:r},{h:e})=>[{c:e(r)}]),b("aspect-","aspectRatio"),v("container",(r,{theme:e})=>{let{screens:t=e("screens"),center:n,padding:i}=e("container"),s={width:"100%",marginRight:n&&"auto",marginLeft:n&&"auto",...a("xs")};for(let l in t){let c=t[l];typeof c=="string"&&(s[Ki(c)]={"&":{maxWidth:c,...a(l)}})}return s;function a(l){let c=i&&(typeof i=="string"?i:i[l]||i.DEFAULT);if(c)return{paddingRight:c,paddingLeft:c}}}),b("content-","content",({_:r})=>({"--tw-content":r,content:"var(--tw-content)"})),v("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),v("box-(border|content)","boxSizing",({1:r})=>r+"-box"),v("hidden",{display:"none"}),v("table-(auto|fixed)","tableLayout"),v(["(block|flex|table|grid|inline|contents|flow-root|list-item)","(inline-(block|flex|table|grid))","(table-(caption|cell|column|row|(column|row|footer|header)-group))"],"display"),"(float)-(left|right|none)","(clear)-(left|right|none|both)","(overflow(?:-[xy])?)-(auto|hidden|clip|visible|scroll)","(isolation)-(auto)",v("isolate","isolation"),v("object-(contain|cover|fill|none|scale-down)","objectFit"),b("object-","objectPosition"),v("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",ts),v("overscroll(-[xy])?-(auto|contain|none)",({1:r="",2:e})=>({["overscroll-behavior"+r]:e})),v("(static|fixed|absolute|relative|sticky)","position"),b("-?inset(-[xy])?(?:$|-)","inset",({1:r,_:e})=>({top:r!="-x"&&e,right:r!="-y"&&e,bottom:r!="-x"&&e,left:r!="-y"&&e})),b("-?(top|bottom|left|right)(?:$|-)","inset"),v("(visible|collapse)","visibility"),v("invisible",{visibility:"hidden"}),b("-?z-","zIndex"),v("flex-((row|col)(-reverse)?)","flexDirection",gu),v("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),b("(flex-(?:grow|shrink))(?:$|-)"),b("(flex)-"),b("grow(?:$|-)","flexGrow"),b("shrink(?:$|-)","flexShrink"),b("basis-","flexBasis"),b("-?(order)-"),"-?(order)-(\\d+)",b("grid-cols-","gridTemplateColumns"),v("grid-cols-(\\d+)","gridTemplateColumns",bu),b("col-","gridColumn"),v("col-(span)-(\\d+)","gridColumn",vu),b("col-start-","gridColumnStart"),v("col-start-(auto|\\d+)","gridColumnStart"),b("col-end-","gridColumnEnd"),v("col-end-(auto|\\d+)","gridColumnEnd"),b("grid-rows-","gridTemplateRows"),v("grid-rows-(\\d+)","gridTemplateRows",bu),b("row-","gridRow"),v("row-(span)-(\\d+)","gridRow",vu),b("row-start-","gridRowStart"),v("row-start-(auto|\\d+)","gridRowStart"),b("row-end-","gridRowEnd"),v("row-end-(auto|\\d+)","gridRowEnd"),v("grid-flow-((row|col)(-dense)?)","gridAutoFlow",r=>ts(gu(r))),v("grid-flow-(dense)","gridAutoFlow"),b("auto-cols-","gridAutoColumns"),b("auto-rows-","gridAutoRows"),b("gap-x(?:$|-)","gap","columnGap"),b("gap-y(?:$|-)","gap","rowGap"),b("gap(?:$|-)","gap"),"(justify-(?:items|self))-",v("justify-","justifyContent",wu),v("(content|items|self)-",r=>({["align-"+r[1]]:wu(r)})),v("(place-(content|items|self))-",({1:r,$$:e})=>({[r]:("wun".includes(e[3])?"space-":"")+e})),b("p([xytrbl])?(?:$|-)","padding",vr("padding")),b("-?m([xytrbl])?(?:$|-)","margin",vr("margin")),b("-?space-(x|y)(?:$|-)","space",({1:r,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${r}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[r]]:`calc(${e} * calc(1 - var(--tw-space-${r}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[r]]:`calc(${e} * var(--tw-space-${r}-reverse))`}})),v("space-(x|y)-reverse",({1:r})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${r}-reverse`]:"1"}})),b("w-","width"),b("min-w-","minWidth"),b("max-w-","maxWidth"),b("h-","height"),b("min-h-","minHeight"),b("max-h-","maxHeight"),b("font-","fontWeight"),b("font-","fontFamily",({_:r})=>typeof(r=V(r))[1]=="string"?{fontFamily:Te(r)}:{fontFamily:Te(r[0]),...r[1]}),v("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),v("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),v("italic","fontStyle"),v("not-italic",{fontStyle:"normal"}),v("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:r,2:e="",3:t})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(t?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":r)]:r,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...tt({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),b("tracking-","letterSpacing"),b("leading-","lineHeight"),v("list-(inside|outside)","listStylePosition"),b("list-","listStyleType"),v("list-","listStyleType"),b("placeholder-opacity-","placeholderOpacity",({_:r})=>({"&::placeholder":{"--tw-placeholder-opacity":r}})),re("placeholder-",{property:"color",selector:"&::placeholder"}),v("text-(left|center|right|justify|start|end)","textAlign"),v("text-(ellipsis|clip)","textOverflow"),b("text-opacity-","textOpacity","--tw-text-opacity"),re("text-",{property:"color"}),b("text-","fontSize",({_:r})=>typeof r=="string"?{fontSize:r}:{fontSize:r[0],...typeof r[1]=="string"?{lineHeight:r[1]}:r[1]}),b("indent-","textIndent"),v("(overline|underline|line-through)","textDecorationLine"),v("no-underline",{textDecorationLine:"none"}),b("underline-offset-","textUnderlineOffset"),re("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),b("decoration-","textDecorationThickness"),v("decoration-","textDecorationStyle"),v("(uppercase|lowercase|capitalize)","textTransform"),v("normal-case",{textTransform:"none"}),v("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),v("align-","verticalAlign"),v("whitespace-","whiteSpace"),v("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),v("break-words",{overflowWrap:"break-word"}),v("break-all",{wordBreak:"break-all"}),v("break-keep",{wordBreak:"keep-all"}),re("caret-",{opacityVariable:!1,opacitySection:"opacity"}),re("accent-",{opacityVariable:!1,opacitySection:"opacity"}),v("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:r})=>`linear-gradient(to ${Mt(r," ")},var(--tw-gradient-stops))`),re("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:r})=>({"--tw-gradient-from":r.value,"--tw-gradient-to":r.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),re("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:r})=>({"--tw-gradient-to":r.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${r.value},var(--tw-gradient-to)`})),re("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),v("bg-(fixed|local|scroll)","backgroundAttachment"),v("bg-origin-(border|padding|content)","backgroundOrigin",({1:r})=>r+"-box"),v(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),v("bg-blend-","backgroundBlendMode"),v("bg-clip-(border|padding|content|text)","backgroundClip",({1:r})=>r+(r=="text"?"":"-box")),b("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),re("bg-",{section:"backgroundColor"}),b("bg-","backgroundImage"),b("bg-","backgroundPosition"),v("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",ts),b("bg-","backgroundSize"),b("rounded(?:$|-)","borderRadius"),b("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:r,_:e})=>{let t={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[r]||[r,r];return{[`border-${Mt(t[0])}-radius`]:e,[`border-${Mt(t[1])}-radius`]:e}}),v("border-(collapse|separate)","borderCollapse"),b("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),v("border-(solid|dashed|dotted|double|none)","borderStyle"),b("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:r,_:e})=>({...tt({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(r||"-x")]:e,["--tw-border-spacing"+(r||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),re("border-([xytrbl])-",{section:"borderColor"},vr("border","Color")),re("border-"),b("border-([xytrbl])(?:$|-)","borderWidth",vr("border","Width")),b("border(?:$|-)","borderWidth"),b("divide-opacity(?:$|-)","divideOpacity",({_:r})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":r}})),v("divide-(solid|dashed|dotted|double|none)",({1:r})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:r}})),v("divide-([xy]-reverse)",({1:r})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+r]:"1"}})),b("divide-([xy])(?:$|-)","divideWidth",({1:r,_:e})=>{let t={x:"lr",y:"tb"}[r];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${r}-reverse`]:"0",[`border-${Mt(t[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${r}-reverse)))`,[`border-${Mt(t[1])}Width`]:`calc(${e} * var(--tw-divide-${r}-reverse))`}}}),re("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),b("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),re("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),b("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),v("ring-inset",{"--tw-ring-inset":"inset"}),re("ring-",{property:"--tw-ring-color"}),b("ring(?:$|-)","ringWidth",({_:r},{theme:e})=>({...tt({"--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-ring-inset":"var(--tw-empty,/*!*/ /*!*/)","--tw-ring-offset-width":e("ringOffsetWidth","","0px"),"--tw-ring-offset-color":Se(e("ringOffsetColor","","#fff")),"--tw-ring-color":Se(e("ringColor","","#93c5fd"),{opacityVariable:"--tw-ring-opacity"}),"--tw-ring-opacity":e("ringOpacity","","0.5")}}),"--tw-ring-offset-shadow":"var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color)","--tw-ring-shadow":`var(--tw-ring-inset) 0 0 0 calc(${r} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),re("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:r})=>({"--tw-shadow-color":r.value,"--tw-shadow":"var(--tw-shadow-colored)"})),b("shadow(?:$|-)","boxShadow",({_:r})=>({...tt({"--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-shadow":Te(r),"--tw-shadow-colored":Te(r).replace(/([^,]\s+)(?:#[a-f\d]+|(?:(?:hsl|rgb)a?|hwb|lab|lch|color|var)\(.+?\)|[a-z]+)(,|$)/g,"$1var(--tw-shadow-color)$2"),boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),b("(opacity)-"),v("mix-blend-","mixBlendMode"),...yu(),...yu("backdrop-"),b("transition(?:$|-)","transitionProperty",(r,{theme:e})=>({transitionProperty:Te(r),transitionTimingFunction:r._=="none"?void 0:Te(e("transitionTimingFunction","")),transitionDuration:r._=="none"?void 0:Te(e("transitionDuration",""))})),b("duration(?:$|-)","transitionDuration","transitionDuration",Te),b("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",Te),b("delay(?:$|-)","transitionDelay","transitionDelay",Te),b("animate(?:$|-)","animation",(r,{theme:e,h:t,e:n})=>{let i=Te(r),s=i.split(" "),a=e("keyframes",s[0]);return a?{["@keyframes "+(s[0]=n(t(s[0])))]:a,animation:s.join(" ")}:{animation:i}}),"(transform)-(none)",v("transform",_a),v("transform-(cpu|gpu)",({1:r})=>({"--tw-transform":ku(r=="gpu")})),b("scale(-[xy])?-","scale",({1:r,_:e})=>({["--tw-scale"+(r||"-x")]:e,["--tw-scale"+(r||"-y")]:e,..._a()})),b("-?(rotate)-","rotate",Ea),b("-?(translate-[xy])-","translate",Ea),b("-?(skew-[xy])-","skew",Ea),v("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",ts),"(appearance)-",b("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",b("(cursor)-"),"(cursor)-",v("snap-(none)","scroll-snap-type"),v("snap-(x|y|both)",({1:r})=>({...tt({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":r+" var(--tw-scroll-snap-strictness)"})),v("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),v("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),v("snap-(normal|always)","scroll-snap-stop"),v("scroll-(auto|smooth)","scroll-behavior"),b("scroll-p([xytrbl])?(?:$|-)","padding",vr("scroll-padding")),b("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",vr("scroll-margin")),v("touch-(auto|none|manipulation)","touch-action"),v("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:r,2:e,3:t})=>({...tt({"--tw-pan-x":"var(--tw-empty,/*!*/ /*!*/)","--tw-pan-y":"var(--tw-empty,/*!*/ /*!*/)","--tw-pinch-zoom":"var(--tw-empty,/*!*/ /*!*/)","--tw-touch-action":"var(--tw-pan-x) var(--tw-pan-y) var(--tw-pinch-zoom)"}),[`--tw-${e?"pan-x":t?"pan-y":r}`]:r,"touch-action":"var(--tw-touch-action)"})),v("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),v("outline",{outlineStyle:"solid"}),v("outline-(dashed|dotted|double)","outlineStyle"),b("-?(outline-offset)-"),re("outline-",{opacityVariable:!1,opacitySection:"opacity"}),b("outline-","outlineWidth"),"(pointer-events)-",b("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:r})=>({x:"horizontal",y:"vertical"})[r]||r||"both"],v("select-(none|text|all|auto)","userSelect"),re("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),re("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),b("stroke-","strokeWidth"),v("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),v("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function ts(r){return(typeof r=="string"?r:r[1]).replace(/-/g," ").trim()}function gu(r){return(typeof r=="string"?r:r[1]).replace("col","column")}function Mt(r,e="-"){let t=[];for(let n of r)t.push({t:"top",r:"right",b:"bottom",l:"left"}[n]);return t.join(e)}function Te(r){return r&&""+(r._||r)}function wu({$$:r}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[r[3]||""]||"")+r}function vr(r,e=""){return({1:t,_:n})=>{let i={x:"lr",y:"tb"}[t]||t+t;return i?{...kn(r+"-"+Mt(i[0])+e,n),...kn(r+"-"+Mt(i[1])+e,n)}:kn(r+e,n)}}function yu(r=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",r&&"opacity","saturate","sepia",!r&&"drop-shadow"].filter(Boolean),t={};for(let n of e)t[`--tw-${r}${n}`]="var(--tw-empty,/*!*/ /*!*/)";return t={...tt(t),[`${r}filter`]:e.map(n=>`var(--tw-${r}${n})`).join(" ")},[`(${r}filter)-(none)`,v(`${r}filter`,t),...e.map(n=>b(`${n[0]=="h"?"-?":""}(${r}${n})(?:$|-)`,n,({1:i,_:s})=>({[`--tw-${i}`]:V(s).map(a=>`${n}(${a})`).join(" "),...t})))]}function Ea({1:r,_:e}){return{["--tw-"+r]:e,..._a()}}function _a(){return{...tt({"--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-transform":ku()}),transform:"var(--tw-transform)"}}function ku(r){return[r?"translate3d(var(--tw-translate-x),var(--tw-translate-y),0)":"translateX(var(--tw-translate-x)) translateY(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))"].join(" ")}function vu({1:r,2:e}){return`${r} ${e} / ${r} ${e}`}function bu({1:r}){return`repeat(${r},minmax(0,1fr))`}function tt(r){return{"@layer defaults":{"*,::before,::after":r,"::backdrop":r}}}var Cu=[["sticky","@supports ((position: -webkit-sticky) or (position:sticky))"],["motion-reduce","@media (prefers-reduced-motion:reduce)"],["motion-safe","@media (prefers-reduced-motion:no-preference)"],["print","@media print"],["(portrait|landscape)",({1:r})=>`@media (orientation:${r})`],["contrast-(more|less)",({1:r})=>`@media (prefers-contrast:${r})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:r})=>`&::${r}`],["(marker|selection)",({1:r})=>`& *::${r},&::${r}`],["file","&::file-selector-button"],["(first|last|only)",({1:r})=>`&:${r}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:r,$$:e},t)=>e&&`&[${r}-${t.theme(r,e)||Ue(e,"",t)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:r,3:e="",4:t,5:n="",6:i=e},{e:s,h:a,v:l})=>{let c=yr(n)||(t[0]=="["?t:l(t.slice(1)));return`${(c.includes("&")?c:"&"+c).replace(/&/g,`:merge(.${s(a(r+i))})`)}${r[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:r})=>`[dir="${r}"] &`],["supports-",({$$:r},e)=>{if(r&&(r=e.theme("supports",r)||Ue(r,"",e)),r)return r.includes(":")||(r+=":var(--tw)"),/^\w*\s*\(/.test(r)||(r=`(${r})`),`@supports ${r.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:r},e)=>{if(r&&(r=e.theme("screens",r)||Ue(r,"",e)),typeof r=="string")return`@media not all and (min-width:${r})`}],["min-",({$$:r},e)=>(r&&(r=Ue(r,"",e)),r&&`@media (min-width:${r})`)],[/^\[(.+)]$/,({1:r})=>/[&@]/.test(r)&&yr(r).replace(/[}]+$/,"").split("{")]];function $u({colors:r,disablePreflight:e}={}){return{preflight:e?void 0:mu,theme:{...Sn,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...r}},variants:Cu,rules:xu,finalize(t){return t.n&&t.d&&t.r.some(n=>/^&::(before|after)$/.test(n))&&!/(^|;)content:/.test(t.d)?{...t,d:"content:var(--tw-content);"+t.d}:t}}}var Kp={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},Yp={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},Xp={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},Qp={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},e1={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},t1={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},r1={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},n1={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},i1={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},s1={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},o1={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},a1={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},l1={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},c1={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},u1={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},h1={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},d1={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},p1={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},f1={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},m1={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},g1={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},w1={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Su={__proto__:null,slate:Kp,gray:Yp,zinc:Xp,neutral:Qp,stone:e1,red:t1,orange:r1,amber:n1,yellow:i1,lime:s1,green:o1,emerald:a1,teal:l1,cyan:c1,sky:u1,blue:h1,indigo:d1,violet:p1,purple:f1,fuchsia:m1,pink:g1,rose:w1};function rs({disablePreflight:r}={}){return $u({colors:Su,disablePreflight:r})}function ns({className:r="prose",defaultColor:e="gray",extend:t={},colors:n={}}={}){return n={body:"700",headings:"900",lead:"600",links:"900",bold:"900",counters:"500",bullets:"300",hr:"200",quotes:"900","quote-borders":"200",captions:"500",code:"900","pre-code":"200","pre-bg":"800","th-borders":"300","td-borders":"200",...n,dark:n.dark===null?null:{body:"300",headings:"#fff",lead:"400",links:"#fff",bold:"#fff",counters:"400",bullets:"600",hr:"700",quotes:"100","quote-borders":"700",captions:"400",code:"#fff","pre-code":"300","pre-bg":"rgb(0 0 0 / 50%)","th-borders":"600","td-borders":"700",...n.dark}},{variants:[["headings","h1,h2,h3,h4,h5,h6,th"],["h1"],["h2"],["h3"],["h4"],["h5"],["h6"],["p"],["a"],["blockquote"],["figure"],["figcaption"],["strong"],["em"],["code"],["pre"],["ol"],["ul"],["li"],["table"],["thead"],["tr"],["th"],["td"],["img"],["video"],["hr"],["lead",".lead"]].map(([s,a=s])=>[`${r}-${s}`,(l,c)=>Iu(r,a[0]=="."?"."+c.e(c.h(a.slice(1))):a,c,u=>`& :is(${u.trim()})`)]),rules:[[`(lead|not-${r})`,({1:s},{h:a})=>[{c:a(s)}]],[`${r}-invert`,{"@layer base":{"--tw-prose-body":"var(--tw-prose-invert-body)","--tw-prose-headings":"var(--tw-prose-invert-headings)","--tw-prose-lead":"var(--tw-prose-invert-lead)","--tw-prose-links":"var(--tw-prose-invert-links)","--tw-prose-bold":"var(--tw-prose-invert-bold)","--tw-prose-counters":"var(--tw-prose-invert-counters)","--tw-prose-bullets":"var(--tw-prose-invert-bullets)","--tw-prose-hr":"var(--tw-prose-invert-hr)","--tw-prose-quotes":"var(--tw-prose-invert-quotes)","--tw-prose-quote-borders":"var(--tw-prose-invert-quote-borders)","--tw-prose-captions":"var(--tw-prose-invert-captions)","--tw-prose-code":"var(--tw-prose-invert-code)","--tw-prose-pre-code":"var(--tw-prose-invert-pre-code)","--tw-prose-pre-bg":"var(--tw-prose-invert-pre-bg)","--tw-prose-th-borders":"var(--tw-prose-invert-th-borders)","--tw-prose-td-borders":"var(--tw-prose-invert-td-borders)"}}],[r+"-",({$$:s},a)=>{let l=_u(a.theme("fontSize",s));return l&&{"@layer components":l}}],[r+"-",({$$:s},a)=>i(s,a)],[r,(s,a)=>({...i(e,a),"@layer base":[Eu(r,a,{a:{color:"var(--tw-prose-links)",textDecorationLine:"underline",fontWeight:"500"},strong:{color:"var(--tw-prose-bold)",fontWeight:"600"},"a strong,blockquote strong,thead th strong":{color:"inherit"},ul:{listStyleType:"disc"},ol:{listStyleType:"decimal"},'ol[type="A"]':{listStyleType:"upper-alpha"},'ol[type="a"]':{listStyleType:"lower-alpha"},'ol[type="A" s]':{listStyleType:"upper-alpha"},'ol[type="a" s]':{listStyleType:"lower-alpha"},'ol[type="I"]':{listStyleType:"upper-roman"},'ol[type="i"]':{listStyleType:"lower-roman"},'ol[type="I" s]':{listStyleType:"upper-roman"},'ol[type="i" s]':{listStyleType:"lower-roman"},'ol[type="1"]':{listStyleType:"decimal"},"ol,ul":{marginTop:_(20,16),marginBottom:_(20,16),paddingLeft:_(26,16)},li:{marginTop:_(8,16),marginBottom:_(8,16)},"ol>li,ul>li":{paddingLeft:_(6,16)},">ul>li p":{marginTop:_(12,16),marginBottom:_(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:_(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:_(20,16)},"ol>li::marker":{fontWeight:"400",color:"var(--tw-prose-counters)"},"ul>li::marker":{color:"var(--tw-prose-bullets)"},"ul ul,ul ol,ol ul,ol ol":{marginTop:_(12,16),marginBottom:_(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:_(48,16),marginBottom:_(48,16)},blockquote:{marginTop:_(32,20),marginBottom:_(32,20),paddingLeft:_(20,20),fontWeight:"500",fontStyle:"italic",color:"var(--tw-prose-quotes)",borderLeftWidth:"0.25rem",borderLeftColor:"var(--tw-prose-quote-borders)",quotes:'"\\201C""\\201D""\\2018""\\2019"'},"blockquote p:first-of-type::before":{content:"open-quote"},"blockquote p:last-of-type::after":{content:"close-quote"},p:{marginTop:_(20,16),marginBottom:_(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:_(36,16),marginTop:"0",marginBottom:_(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:_(24,16),marginTop:_(48,24),marginBottom:_(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:_(20,16),marginTop:_(32,20),marginBottom:_(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:_(24,16),marginBottom:_(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:_(32,16),marginBottom:_(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:_(14,16),lineHeight:"1.4",marginTop:_(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:_(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:_(21,24)},"h3 code":{fontSize:_(18,20)},"a code,h1 code,h2 code,h3 code,h4 code,blockquote code,thead th code":{color:"inherit"},pre:{color:"var(--tw-prose-pre-code)",backgroundColor:"var(--tw-prose-pre-bg)",overflowX:"auto",fontWeight:"400",fontSize:_(14,16),lineHeight:"1.7",marginTop:_(24,14),marginBottom:_(24,14),borderRadius:"0.375rem",paddingTop:_(12,14),paddingRight:_(16,14),paddingBottom:_(12,14),paddingLeft:_(16,14)},"pre code":{backgroundColor:"transparent",borderWidth:"0",borderRadius:"0",padding:"0",fontWeight:"inherit",color:"inherit",fontSize:"inherit",fontFamily:"inherit",lineHeight:"inherit"},"pre code::before":{content:"none"},"pre code::after":{content:"none"},table:{width:"100%",tableLayout:"auto",textAlign:"left",marginTop:_(32,16),marginBottom:_(32,16),fontSize:_(14,16),lineHeight:"1.7"},thead:{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-th-borders)"},"thead th":{color:"var(--tw-prose-headings)",fontWeight:"600",verticalAlign:"bottom",paddingRight:_(8,14),paddingBottom:_(8,14),paddingLeft:_(8,14)},"thead th:first-child":{paddingLeft:"0"},"thead th:last-child":{paddingRight:"0"},"tbody tr":{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-td-borders)"},"tbody tr:last-child":{borderBottomWidth:"0"},"tbody td,tfoot td":{verticalAlign:"baseline",paddingTop:_(8,14),paddingRight:_(8,14),paddingBottom:_(8,14),paddingLeft:_(8,14)},"tbody td:first-child,tfoot td:first-child":{paddingLeft:"0"},"tbody td:last-child,tfoot td:last-child":{paddingRight:"0"},[`.${a.e(a.h("lead"))}`]:{color:"var(--tw-prose-lead)",fontSize:_(20,16),lineHeight:"1.6",marginTop:_(24,20),marginBottom:_(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),Eu(r,a,t)],"@layer components":{..._u(a.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function i(s,a){let l={},c={},u=(d,f,y)=>{let k=a.theme(`colors.${s}.${f}`,f);y["--tw-prose-"+d]=Se(k);let $=y!=c&&a.d("colors",`${s}-${f}`,k);$&&(c["--tw-prose-"+d]=Se($))};for(let d in n){let f=n[d];d!="dark"&&f&&u(d,f,l)}for(let d in n.dark||{}){let f=n.dark[d];f&&(n.dark?u("invert-"+d,f,l):u(d,f,c))}return Object.keys(l).length?{"@layer defaults":{"&":l,[a.v("dark")]:c}}:void 0}}function Eu(r,e,t){let n={};for(let i in t)n[Iu(r,i,e,s=>`.${e.e(e.h(r))}${s}`)]=t[i];return n}function Iu(r,e,{e:t,h:n},i){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,a=" ",l=s,c="")=>i(`${a}:where(${l}):not(:where(.${t(n("not-"+r))} *))${c}`))}function _u(r){return r?typeof r=="string"?{fontSize:r}:{fontSize:r[0],...typeof r[1]=="string"?{lineHeight:r[1]}:r[1]}:void 0}function _(r,e){return`${(r/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var Ia=Cn({hash:!1,darkMode:"class",theme:{extend:{colors:{violet:{DEFAULT:"#601feb",50:"#f3f2ff",100:"#eae7ff",200:"#d7d2ff",300:"#baaeff",400:"#9980ff",500:"#784dff",600:"#6829fe",700:"#601feb",800:"#4b12c5",900:"#3f11a1",950:"#25086d"},pink:{DEFAULT:"#ff0bbb",50:"#fff0fc",100:"#ffe3fc",200:"#ffc6f9",300:"#ff98f2",400:"#ff58e5",500:"#ff27d5",600:"#ff0bbb",700:"#df0095",800:"#b8007b",900:"#980368",950:"#5f003b"},lime:{DEFAULT:"#b9e901",50:"#fdffe4",100:"#f9ffc5",200:"#f1ff92",300:"#e2ff54",400:"#d1fa21",500:"#b9e901",600:"#8ab400",700:"#688902",800:"#526b09",900:"#465a0d",950:"#243300"}},spacing:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},padding:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},lineHeight:{3:"12px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px"},maxWidth:{xs:"320px",sm:"384px",md:"448px",lg:"512px",xl:"576px","2xl":"672px","3xl":"768px","4xl":"896px","5xl":"1024px","6xl":"1152px","7xl":"1280px"},maxHeight:{.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},borderRadius:{sm:"2px",DEFAULT:"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px"},fontSize:{xs:["12px","16px"],sm:["14px","20px"],base:["16px","24px"],lg:["18px","28px"],xl:["20px","28px"],"2xl":["24px","32px"],"3xl":["30px","36px"],"4xl":["36px","40px"],"5xl":["48px","1"],"6xl":["60px","1"],"7xl":["72px","1"],"8xl":["96px","1"],"9xl":["128px","1"]}}},presets:[rs(),Qi(),es(),ns()]});function is(r,e=!0){let t=(function(){if(y1)try{let c=Xi(new CSSStyleSheet);return c.connect=u=>{let d=Ma(u);d.adoptedStyleSheets=[...d.adoptedStyleSheets,c.target]},c.disconnect=Yi,c}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let a=[Xi(s)],l=new WeakMap;return{get target(){return a[0].target},snapshot(){let c=a.map(u=>u.snapshot());return()=>c.forEach(u=>u())},clear(){a.forEach(c=>c.clear())},destroy(){a.forEach(c=>c.destroy())},insert(c,u,d){a[0].insert(c,u,d);let f=this.target.cssRules[u];a.forEach((y,k)=>k&&y.target.insertRule(f.cssText,u))},resume(c,u){return a[0].resume(c,u)},connect(c){let u=document.createElement("style");Ma(c).appendChild(u);let d=Xi(u),{cssRules:f}=this.target;for(let y=0;y<f.length;y++)d.target.insertRule(f[y].cssText,y);a.push(d),l.set(c,d)},disconnect(c){let u=a.indexOf(l.get(c));u>=0&&a.splice(u,1)}}})(),n=cu({...r,hash:r.hash??e},t),i=uu(n);return function(a){return class extends a{connectedCallback(){super.connectedCallback?.(),t.connect(this),i.observe(Ma(this))}disconnectedCallback(){t.disconnect(this),super.disconnectedCallback?.()}constructor(...c){super(...c),this.tw=n}}}}var y1=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function Ma(r){return r.shadowRoot||r.attachShadow({mode:"open"})}var I=r=>is(Ia)(r);var En=class extends I(C){constructor(){super(),this.color="#601feb",this.radius="16.8576px",this.size="320px",this.border="#d1d5db"}render(){return h`
|
|
131
131
|
<div class="flex flex-row flex-wrap gap-0">
|
|
132
132
|
<div class="relative z-0 flex min-h-9 items-center justify-center overflow-hidden" style="border-radius: ${this.radius};">
|
|
133
133
|
<!-- Spinning gradient background -->
|
|
@@ -154,7 +154,7 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
154
154
|
transform: rotate(360deg);
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
`);customElements.get("mw-spinning-border")||customElements.define("mw-spinning-border",En);var _n=class extends
|
|
157
|
+
`);customElements.get("mw-spinning-border")||customElements.define("mw-spinning-border",En);var _n=class extends I(C){constructor(){super();w(this,"render",()=>h`
|
|
158
158
|
<div class="shadow-button inline-block transition-transform hover:scale-105 active:scale-90" style="border-radius: ${this.dynamicRadius};">
|
|
159
159
|
<mw-spinning-border .color="${this.color}" .border="${"#f9fafb"}" .radius="${this.dynamicRadius}">
|
|
160
160
|
<!-- we want the transform transition on the root element so that both the transform transition and state switch transition are continuous and fluid -->
|
|
@@ -211,7 +211,7 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
211
211
|
</button>
|
|
212
212
|
</mw-spinning-border>
|
|
213
213
|
</div>
|
|
214
|
-
`);this.state="open",this.color="#601feb",this.bubbleStyle="solid",this.src="",this.width="64px",this.height="64px"}get iconColor(){return this.bubbleStyle==="solid"?"#ffffff":this.color}get backgroundColor(){return this.bubbleStyle==="solid"?this.color:"#ffffff"}get svgSize(){let t=parseFloat(this.width),n=parseFloat(this.height),s=Math.min(t,n)*.55,a=s,
|
|
214
|
+
`);this.state="open",this.color="#601feb",this.bubbleStyle="solid",this.src="",this.width="64px",this.height="64px"}get iconColor(){return this.bubbleStyle==="solid"?"#ffffff":this.color}get backgroundColor(){return this.bubbleStyle==="solid"?this.color:"#ffffff"}get svgSize(){let t=parseFloat(this.width),n=parseFloat(this.height),s=Math.min(t,n)*.55,a=s,l=s/1.65;return{width:a,height:l}}get dynamicRadius(){let t=parseFloat(this.width),n=parseFloat(this.height);return`${Math.min(t,n)*.265}px`}};w(_n,"properties",{state:{type:String},color:{type:String},bubbleStyle:{type:String},src:{type:String},width:{type:String},height:{type:String}}),w(_n,"styles",J`
|
|
215
215
|
.shadow-button {
|
|
216
216
|
box-shadow:
|
|
217
217
|
-58.9194px 74.8436px 38.218px rgba(0, 0, 0, 0.01),
|
|
@@ -219,7 +219,7 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
219
219
|
-14.3318px 19.109px 23.8863px rgba(0, 0, 0, 0.09),
|
|
220
220
|
-3.18483px 4.77725px 12.7393px rgba(0, 0, 0, 0.1);
|
|
221
221
|
}
|
|
222
|
-
`);customElements.get("mw-bubble")||customElements.define("mw-bubble",_n);var
|
|
222
|
+
`);customElements.get("mw-bubble")||customElements.define("mw-bubble",_n);var Mu={airplay:`<svg
|
|
223
223
|
xmlns="http://www.w3.org/2000/svg"
|
|
224
224
|
width="24"
|
|
225
225
|
height="24"
|
|
@@ -1151,21 +1151,21 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1151
1151
|
display: inline-block;
|
|
1152
1152
|
line-height: 0;
|
|
1153
1153
|
}
|
|
1154
|
-
`,this.shadowRoot){for(;this.shadowRoot.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild);this.shadowRoot.appendChild(t)}if(!this.name)return;let n=this.resolveIcon(this.name);if(!n){console.warn(`'${this.name}' not found, please add it to ${In.name}`);return}let a=new DOMParser().parseFromString(n,"image/svg+xml").documentElement;a.setAttribute("fill",this.fill),a.setAttribute("stroke",this.stroke),a.style.width="100%",a.style.height="100%",this.shadowRoot?.appendChild(a)}};w(In,"observedAttributes",["name","fill","stroke"]);var
|
|
1154
|
+
`,this.shadowRoot){for(;this.shadowRoot.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild);this.shadowRoot.appendChild(t)}if(!this.name)return;let n=this.resolveIcon(this.name);if(!n){console.warn(`'${this.name}' not found, please add it to ${In.name}`);return}let a=new DOMParser().parseFromString(n,"image/svg+xml").documentElement;a.setAttribute("fill",this.fill),a.setAttribute("stroke",this.stroke),a.style.width="100%",a.style.height="100%",this.shadowRoot?.appendChild(a)}};w(In,"observedAttributes",["name","fill","stroke"]);var ss=In;var v1=Mu,Aa=class extends ss{resolveIcon(e){return v1[e]}};customElements.get("lucide-icon")||customElements.define("lucide-icon",Aa);var An,Le,Au,Tu,b1,Lu,ju,Mn=class Mn extends I(C){constructor(){super();p(this,Le);p(this,An,new Date);this.color="#8B5CF6",this.disabled=!1,this.placeholder="Ask AI...",this.dark=!1,this._inputValue=""}render(){return h`
|
|
1155
1155
|
<mw-spinning-border
|
|
1156
1156
|
.size=${"420px"}
|
|
1157
1157
|
.color=${this.color||"#8B5CF6"}
|
|
1158
1158
|
.radius=${"24px"}
|
|
1159
1159
|
class="${this.dark?"dark":""} rounded-[24px] font-sans text-sm shadow-lg transition-transform duration-500 hover:scale-105">
|
|
1160
1160
|
<form
|
|
1161
|
-
@submit="${m(this,Le,
|
|
1161
|
+
@submit="${m(this,Le,Tu)}"
|
|
1162
1162
|
class="m-[1px] flex w-[250px] items-center rounded-[24px] bg-white px-2 py-2 text-gray-800 transition-all duration-500 focus-within:w-[calc(100vw-2rem)] focus-within:scale-100 active:w-[calc(100vw-2rem)] md:focus-within:w-[350px] md:active:w-[350px] dark:bg-gray-900 dark:text-white">
|
|
1163
1163
|
<lucide-icon class="h-5 w-5 flex-none text-[${this.color||"#8B5CF6"}]" name="${"sparkles"}"></lucide-icon>
|
|
1164
1164
|
|
|
1165
1165
|
<input
|
|
1166
1166
|
?disabled="${this.disabled}"
|
|
1167
|
-
@keydown="${m(this,Le,
|
|
1168
|
-
@input="${m(this,Le,
|
|
1167
|
+
@keydown="${m(this,Le,ju)}"
|
|
1168
|
+
@input="${m(this,Le,Au)}"
|
|
1169
1169
|
.value="${this._inputValue}"
|
|
1170
1170
|
placeholder="${this.placeholder}"
|
|
1171
1171
|
autocomplete="off"
|
|
@@ -1183,7 +1183,7 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1183
1183
|
</button>
|
|
1184
1184
|
</form>
|
|
1185
1185
|
</mw-spinning-border>
|
|
1186
|
-
`}};An=new WeakMap,Le=new WeakSet,
|
|
1186
|
+
`}};An=new WeakMap,Le=new WeakSet,Au=function(t){let n=t.target;this._inputValue=n.value,this.dispatchEvent(new Mn.ChangeEvent({value:this._inputValue}))},Tu=function(t){t.preventDefault();let n=new Date;if(n.getTime()-o(this,An).getTime()<500)return;g(this,An,n);let s=this._inputValue.trim();s&&this.dispatchEvent(new Mn.SubmitInputEvent({text:s}))&&(this._inputValue="")},b1=function(){return this.renderRoot.querySelector('input[name="input"]')??null},Lu=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},ju=function(t){x1(t)&&(t.preventDefault(),this.disabled||o(this,Le,Lu)?.click())},w(Mn,"properties",{color:{type:String},disabled:{type:Boolean},placeholder:{type:String},dark:{type:Boolean},_inputValue:{type:String,state:!0}});var At=Mn,Ta;At.SubmitInputEvent=(Ta=class extends CustomEvent{constructor(e,t={}){super(At.SubmitInputEvent.type,{detail:e,bubbles:!0,composed:!0,...t})}},w(Ta,"type","mw-floating-ask-ai:submit"),Ta);var La;At.ChangeEvent=(La=class extends CustomEvent{constructor(e,t={}){super(At.ChangeEvent.type,{detail:e,bubbles:!0,composed:!0,...t})}},w(La,"type","mw-floating-ask-ai:change"),La);function x1(r){return(r.code==="Enter"||r.code==="NumpadEnter")&&!r.ctrlKey&&!r.metaKey&&!r.shiftKey}customElements.get("mw-floating-ask-ai")||customElements.define("mw-floating-ask-ai",At);var os={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},as=r=>(...e)=>({_$litDirective$:r,values:e}),br=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var{I:k1}=hc;var Du=()=>document.createComment(""),xr=(r,e,t)=>{let n=r._$AA.parentNode,i=e===void 0?r._$AB:e._$AA;if(t===void 0){let s=n.insertBefore(Du(),i),a=n.insertBefore(Du(),i);t=new k1(s,a,r,r.options)}else{let s=t._$AB.nextSibling,a=t._$AM,l=a!==r;if(l){let c;t._$AQ?.(r),t._$AM=r,t._$AP!==void 0&&(c=r._$AU)!==a._$AU&&t._$AP(c)}if(s!==i||l){let c=t._$AA;for(;c!==s;){let u=c.nextSibling;n.insertBefore(c,i),c=u}}}return t},rt=(r,e,t=r)=>(r._$AI(e,t),r),C1={},Ou=(r,e=C1)=>r._$AH=e,Uu=r=>r._$AH,ls=r=>{r._$AR(),r._$AA.remove()};var Pu=(r,e,t)=>{let n=new Map;for(let i=e;i<=t;i++)n.set(r[i],i);return n},_e=as(class extends br{constructor(r){if(super(r),r.type!==os.CHILD)throw Error("repeat() can only be used in text expressions")}dt(r,e,t){let n;t===void 0?t=e:e!==void 0&&(n=e);let i=[],s=[],a=0;for(let l of r)i[a]=n?n(l,a):a,s[a]=t(l,a),a++;return{values:s,keys:i}}render(r,e,t){return this.dt(r,e,t).values}update(r,[e,t,n]){let i=Uu(r),{values:s,keys:a}=this.dt(e,t,n);if(!Array.isArray(i))return this.ut=a,s;let l=this.ut??=[],c=[],u,d,f=0,y=i.length-1,k=0,$=s.length-1;for(;f<=y&&k<=$;)if(i[f]===null)f++;else if(i[y]===null)y--;else if(l[f]===a[k])c[k]=rt(i[f],s[k]),f++,k++;else if(l[y]===a[$])c[$]=rt(i[y],s[$]),y--,$--;else if(l[f]===a[$])c[$]=rt(i[f],s[$]),xr(r,c[$+1],i[f]),f++,$--;else if(l[y]===a[k])c[k]=rt(i[y],s[k]),xr(r,i[f],i[y]),y--,k++;else if(u===void 0&&(u=Pu(a,k,$),d=Pu(l,f,y)),u.has(l[f]))if(u.has(l[y])){let j=d.get(a[k]),S=j!==void 0?i[j]:null;if(S===null){let M=xr(r,i[f]);rt(M,s[k]),c[k]=M}else c[k]=rt(S,s[k]),xr(r,i[f],S),i[j]=null;k++}else ls(i[y]),y--;else ls(i[f]),f++;for(;k<=$;){let j=xr(r,c[$+1]);rt(j,s[k]),c[k++]=j}for(;f<=y;){let j=i[f++];j!==null&&ls(j)}return this.ut=a,Ou(r,c),Ae}});var cs,Ru,us=class us extends I(C){constructor(){super();p(this,cs);this.examples={title:"",items:[]},this.color=""}render(){return!this.examples?.title&&!this.examples?.items?.length?null:h`
|
|
1187
1187
|
<div class="flex h-full w-full flex-1 flex-col overflow-y-auto px-4 pt-6 pb-2">
|
|
1188
1188
|
${this.examples.title?h`
|
|
1189
1189
|
<h2 class="mt-14 px-2 pt-9 pb-2 text-left text-3xl leading-tight font-bold tracking-tight">
|
|
@@ -1200,14 +1200,14 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1200
1200
|
${_e(this.examples.items,t=>t,t=>h`
|
|
1201
1201
|
<li
|
|
1202
1202
|
class="my-auto inline-block cursor-pointer rounded-2xl border-1 border-gray-300 px-4 py-2 text-left transition-all duration-200 hover:-translate-y-0.5 hover:bg-[${this.color}]/[0.08] hover:opacity-80 hover:shadow"
|
|
1203
|
-
@click="${()=>m(this,
|
|
1203
|
+
@click="${()=>m(this,cs,Ru).call(this,t)}">
|
|
1204
1204
|
<span>${t.trim()}</span>
|
|
1205
1205
|
</li>
|
|
1206
1206
|
`)}
|
|
1207
1207
|
</ul>
|
|
1208
1208
|
`:null}
|
|
1209
1209
|
</div>
|
|
1210
|
-
`}};
|
|
1210
|
+
`}};cs=new WeakSet,Ru=function(t){this.dispatchEvent(new us.ExampleClickEvent({example:t}))},w(us,"properties",{examples:{type:Object},color:{type:String}});var Tn=us,ja;Tn.ExampleClickEvent=(ja=class extends CustomEvent{constructor(e,t={}){super(Tn.ExampleClickEvent.type,{detail:e,...t})}},w(ja,"type","mw:example-click"),ja);customElements.get("mw-chat-background")||customElements.define("mw-chat-background",Tn);var Cr,Bu,qu,kr=class kr extends I(C){constructor(){super();p(this,Cr);this.content={logoUrl:"",title:"",color:""},this.showNewChat=!1,this.showClose=!1}render(){return h`
|
|
1211
1211
|
<div class="relative z-10 h-12">
|
|
1212
1212
|
<div class="gradient-blur absolute inset-x-0.5 mt-2 h-12"></div>
|
|
1213
1213
|
|
|
@@ -1230,7 +1230,7 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1230
1230
|
<div class="flex-grow"></div>
|
|
1231
1231
|
|
|
1232
1232
|
<!-- new chat btn -->
|
|
1233
|
-
<button @click=${m(this,Cr,
|
|
1233
|
+
<button @click=${m(this,Cr,Bu)} type="button" class="${this.showNewChat?"inline-flex":"hidden"} shrink-0">
|
|
1234
1234
|
<!-- svg icon of a bubble with a plus -->
|
|
1235
1235
|
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 37 36">
|
|
1236
1236
|
<path
|
|
@@ -1242,7 +1242,7 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1242
1242
|
</button>
|
|
1243
1243
|
|
|
1244
1244
|
<!-- close chat btn -->
|
|
1245
|
-
<button @click=${m(this,Cr,
|
|
1245
|
+
<button @click=${m(this,Cr,qu)} class="${this.showClose?"inline-flex":"hidden"} shrink-0">
|
|
1246
1246
|
<!-- svg icon of an X -->
|
|
1247
1247
|
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="white">
|
|
1248
1248
|
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
|
|
@@ -1257,7 +1257,7 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1257
1257
|
</div>
|
|
1258
1258
|
</div>
|
|
1259
1259
|
</div>
|
|
1260
|
-
`}};Cr=new WeakSet,
|
|
1260
|
+
`}};Cr=new WeakSet,Bu=function(){this.dispatchEvent(new kr.NewChatClickEvent)},qu=function(){this.dispatchEvent(new kr.CloseClickEvent)},w(kr,"properties",{content:{type:Object},showNewChat:{type:Boolean,attribute:"show-new-chat"},showClose:{type:Boolean,attribute:"show-close"}}),w(kr,"styles",J`
|
|
1261
1261
|
/* blurred background */
|
|
1262
1262
|
|
|
1263
1263
|
.gradient-blur {
|
|
@@ -1269,7 +1269,7 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1269
1269
|
/* bg-color gradient */
|
|
1270
1270
|
background-image: linear-gradient(to bottom, white 20%, transparent);
|
|
1271
1271
|
}
|
|
1272
|
-
`);var Tt=kr,
|
|
1272
|
+
`);var Tt=kr,Da;Tt.NewChatClickEvent=(Da=class extends CustomEvent{constructor(e={}){super(Tt.NewChatClickEvent.type,{...e})}},w(Da,"type","mw:new-chat-click"),Da);var Oa;Tt.CloseClickEvent=(Oa=class extends CustomEvent{constructor(e={}){super(Tt.CloseClickEvent.type,{...e})}},w(Oa,"type","mw:close-click"),Oa);customElements.get("mw-chat-header")||customElements.define("mw-chat-header",Tt);var zu=ep(Hu(),1);var Re=Object.freeze({PENDING:"pending",READY:"ready",ERROR:"error"}),N,P,ae,Sr,Er,me,O,Ba,qa,Wu,ms,jn,Dn,On,Un,Gu,ps,nt,Ln,Va,Zu,Ju,Ku,fs=class{constructor(e,t){p(this,O);p(this,N);p(this,P);p(this,ae,null);p(this,Sr,!1);p(this,Er,null);p(this,me,[]);p(this,ms,e=>{let t=e.target,n=Array.from(t.files||[]);o(this,P).isConnected()||o(this,P).onConnect?.(),m(this,O,Va).call(this,n),t.value=""});p(this,jn,e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")});p(this,Dn,e=>{e.preventDefault(),e.dataTransfer&&m(this,O,Gu).call(this,e.dataTransfer)&&m(this,O,ps).call(this,!0)});p(this,On,e=>{e.preventDefault();let t=e.relatedTarget;o(this,N).contains(t)||m(this,O,ps).call(this,!1)});p(this,Un,e=>{if(e.preventDefault(),m(this,O,ps).call(this,!1),e.dataTransfer){let t=Array.from(e.dataTransfer.files||[]);m(this,O,Va).call(this,t)}});w(this,"openImagePicker",()=>{if(!o(this,P).enabled||!o(this,P).widgetId){console.warn("Image uploads are disabled");return}o(this,ae)&&o(this,ae).click()});w(this,"onImageDelete",e=>{o(this,P).onImageDelete&&o(this,P).onImageDelete(e),g(this,me,o(this,me).filter(t=>t.id!==e)),m(this,O,Ln).call(this),o(this,N).requestUpdate()});g(this,N,e),g(this,P,{acceptedTypes:["image/jpeg","image/png","image/gif","image/webp","image/svg+xml","image/heic"],maxFileSize:10*1024*1024,maxFiles:3,onError:()=>{},enabled:!0,isConnected:()=>!1,onConnect:()=>{},...t}),e.addController(this),m(this,O,Wu).call(this)}hostConnected(){m(this,O,Ba).call(this)}hostDisconnected(){m(this,O,qa).call(this),o(this,ae)&&o(this,ae).parentNode&&o(this,ae).parentNode.removeChild(o(this,ae))}get isDragging(){return o(this,Sr)}get error(){return o(this,Er)}get selectedImages(){return o(this,me)}get hasPendingImages(){return o(this,me).some(e=>e.processingState===Re.PENDING)}clearError(){m(this,O,Ln).call(this)}updateUploadOptions(e){let t=o(this,P).isConnected();e.conversationId!==void 0&&(o(this,P).conversationId=e.conversationId),e.widgetId!==void 0&&(o(this,P).widgetId=e.widgetId),e.enabled!==void 0&&(o(this,P).enabled=!!e.enabled),e.isConnected!==void 0&&(o(this,P).isConnected=e.isConnected),e.onConnect!==void 0&&(o(this,P).onConnect=e.onConnect),!o(this,P).enabled||!o(this,P).isConnected()?m(this,O,qa).call(this):!t&&o(this,P).isConnected()&&m(this,O,Ba).call(this)}restoreImages(e){if(!Array.isArray(e)||e.length===0){g(this,me,[]),o(this,N).requestUpdate();return}let t=e.map(n=>{let i=new File([],n.name,{type:n.type});return{id:n.id,name:n.name,type:n.type,size:n.size,dataUrl:n.url,file:i,processingState:Re.READY,imageUrl:n.url}});g(this,me,t),o(this,N).requestUpdate()}clearImages(){g(this,me,[]),this.clearError(),o(this,N).requestUpdate()}};N=new WeakMap,P=new WeakMap,ae=new WeakMap,Sr=new WeakMap,Er=new WeakMap,me=new WeakMap,O=new WeakSet,Ba=function(){o(this,P).enabled&&o(this,P).isConnected()&&(o(this,N).addEventListener("dragover",o(this,jn)),o(this,N).addEventListener("dragenter",o(this,Dn)),o(this,N).addEventListener("dragleave",o(this,On)),o(this,N).addEventListener("drop",o(this,Un)))},qa=function(){o(this,N).removeEventListener("dragover",o(this,jn)),o(this,N).removeEventListener("dragenter",o(this,Dn)),o(this,N).removeEventListener("dragleave",o(this,On)),o(this,N).removeEventListener("drop",o(this,Un))},Wu=function(){g(this,ae,document.createElement("input")),o(this,ae).type="file",o(this,ae).accept=o(this,P).acceptedTypes.join(","),o(this,ae).multiple=o(this,P).maxFiles>1,o(this,ae).style.display="none",o(this,ae).addEventListener("change",o(this,ms)),document.body.appendChild(o(this,ae))},ms=new WeakMap,jn=new WeakMap,Dn=new WeakMap,On=new WeakMap,Un=new WeakMap,Gu=function(e){return e.types&&e.types.includes("Files")},ps=function(e){o(this,Sr)!==e&&(g(this,Sr,e),o(this,N).requestUpdate())},nt=function(e){g(this,Er,e),o(this,P).onError(e),o(this,N).requestUpdate(),setTimeout(()=>{m(this,O,Ln).call(this)},6e3)},Ln=function(){g(this,Er,null),o(this,N).requestUpdate()},Va=async function(e){if(e.length===0)return;m(this,O,Ln).call(this);let t=e.filter(a=>m(this,O,Zu).call(this,a));if(t.length===0)return;let n=o(this,me).length,i=o(this,P).maxFiles??1/0,s=t.length;if(n+s>i){m(this,O,nt).call(this,`You can upload a maximum of ${i} files`);return}try{let l=(await Promise.all(t.map(c=>m(this,O,Ju).call(this,c)))).filter(c=>!o(this,me).some(u=>u.dataUrl===c.dataUrl));g(this,me,[...o(this,me),...l]),o(this,N).requestUpdate(),await Zo({times:5,delay:2e3},async()=>{if(o(this,P).isConnected())await Go(3,l,async c=>{await m(this,O,Ku).call(this,c)});else throw new Error("Not connected yet")}),o(this,N).requestUpdate()}catch(a){console.error("Failed to process and upload images:",a),m(this,O,nt).call(this,"Upload failed")}},Zu=function(e){return o(this,P).acceptedTypes.includes(e.type)?e.size>o(this,P).maxFileSize?(m(this,O,nt).call(this,`Max file size: ${o(this,P).maxFileSize/(1024*1024)}MB`),!1):!0:(m(this,O,nt).call(this,"Invalid file type"),!1)},Ju=async function(e){try{let t=await(0,zu.fileToBase64)(e);return{id:crypto.randomUUID(),name:e.name,type:e.type,size:e.size,dataUrl:t,file:e,processingState:Re.PENDING}}catch(t){let n=t instanceof Error?t:new Error(String(t));throw new Error(`Failed to read file: ${e.name} - ${n.message}`)}},Ku=async function(e){if(!e){console.error("No image provided to upload"),m(this,O,nt).call(this,"No image provided");return}if(!o(this,P)?.uploadUrl){console.error("Missing uploadUrl in options"),m(this,O,nt).call(this,"Upload URL not configured");return}e.processingState=Re.PENDING,o(this,N).requestUpdate();let t=new FormData;t.append("file",e.file),t.append("imageId",e.id),o(this,P).conversationId&&t.append("conversationId",o(this,P).conversationId),o(this,P).widgetId&&t.append("widgetId",o(this,P).widgetId);try{let n=await fetch(o(this,P).uploadUrl,{method:"POST",body:t});if(!n.ok)throw new Error(`Upload failed with status: ${n.status}`);let i=await n.json();if(!!!i?.success){let a=i?.error||"Upload failed";throw new Error(a)}i.imageUrl&&i.imageId?(e.imageUrl=i.imageUrl,e.id=i.imageId,e.processingState=Re.READY):e.processingState=Re.PENDING,o(this,N).requestUpdate()}catch(n){let i=n instanceof Error?n:new Error(String(n));console.error("Upload error:",i.message),m(this,O,nt).call(this,i.message),e.processingState=Re.ERROR,o(this,N).requestUpdate()}};var Fa={maxHeight:120,initialHeight:32,paddingY:12},Pn,Q,_r,Yu,Xu,Qu,eh,gs,Ot=class Ot extends I(C){constructor(){super();p(this,Q);p(this,Pn,new Date);this.disabled=!1,this.streaming=!1,this.loading=!1,this.placeholder="Type a message...",this.enableImageUpload=!1,this.onImageUploadClick=void 0,this.images=[],this.onImageDelete=void 0,this.color="#8B5CF6"}get value(){return o(this,Q,_r)?.value?.trim()??""}render(){return h`
|
|
1273
1273
|
<div
|
|
1274
1274
|
class="focus-within:ring-opacity-50 ${this.enableImageUpload&&this.images.length>0?`ring-2 ring-[${this.color}] ring-opacity-50`:""} w-full overflow-hidden rounded-[18px] bg-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.2)] transition-all duration-200 focus-within:ring-2 focus-within:ring-[${this.color}]">
|
|
1275
1275
|
<!-- Image preview area -->
|
|
@@ -1304,7 +1304,7 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1304
1304
|
`:null}
|
|
1305
1305
|
|
|
1306
1306
|
<!-- Input form -->
|
|
1307
|
-
<form @submit="${m(this,Q,
|
|
1307
|
+
<form @submit="${m(this,Q,Qu)}" class="flex w-full items-center">
|
|
1308
1308
|
${this.enableImageUpload?h`
|
|
1309
1309
|
<button
|
|
1310
1310
|
data-testid="image-upload-btn"
|
|
@@ -1319,12 +1319,12 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1319
1319
|
<textarea
|
|
1320
1320
|
data-testid="mw-chat-input-textarea"
|
|
1321
1321
|
name="input"
|
|
1322
|
-
@input="${m(this,Q,
|
|
1323
|
-
@keydown="${m(this,Q,
|
|
1322
|
+
@input="${m(this,Q,eh)}"
|
|
1323
|
+
@keydown="${m(this,Q,Xu)}"
|
|
1324
1324
|
autofocus
|
|
1325
1325
|
?disabled="${this.disabled}"
|
|
1326
1326
|
placeholder="${this.placeholder}"
|
|
1327
|
-
class="${this.enableImageUpload?"px-1":"pl-3 pr-1"} box-content h-[${
|
|
1327
|
+
class="${this.enableImageUpload?"px-1":"pl-3 pr-1"} box-content h-[${Fa.initialHeight}px] w-full resize-none place-content-center rounded bg-white py-[${Fa.paddingY}px] text-base text-gray-800 outline-none placeholder:text-[14px] placeholder:font-light disabled:place-content-baseline"></textarea>
|
|
1328
1328
|
|
|
1329
1329
|
<button
|
|
1330
1330
|
type="submit"
|
|
@@ -1342,7 +1342,7 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1342
1342
|
<slot>
|
|
1343
1343
|
<div class="h-5 w-full"></div>
|
|
1344
1344
|
</slot>
|
|
1345
|
-
`}setValue(t){let n=o(this,Q,_r);if(!n){console.warn("input element not found, cannot set value");return}n.value=t,m(this,Q,
|
|
1345
|
+
`}setValue(t){let n=o(this,Q,_r);if(!n){console.warn("input element not found, cannot set value");return}n.value=t,m(this,Q,gs).call(this),this.dispatchEvent(new Ot.ChangeEvent({delta:null,full:t}))}focus(){o(this,Q,_r)?.focus()}};Pn=new WeakMap,Q=new WeakSet,_r=function(){return this.renderRoot.querySelector('textarea[name="input"]')??null},Yu=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},Xu=function(t){R1(t)&&(t.preventDefault(),!this.streaming&&!this.disabled&&!this.loading&&o(this,Q,Yu)?.click())},Qu=function(t){t.preventDefault();let n=new Date;if(n.getTime()-o(this,Pn).getTime()<500)return;if(g(this,Pn,n),this.streaming){this.dispatchEvent(new Ot.CancelEvent);return}let s=o(this,Q,_r);if(!s)throw new Error("Expected input element to be present");let a=s.value.trim();(a||this.enableImageUpload&&this.images.length>0)&&this.dispatchEvent(new Ot.SubmitEvent(a))&&(s.value=""),m(this,Q,gs).call(this),window.requestAnimationFrame(()=>{this.focus()})},eh=function(t){this.dispatchEvent(new Ot.ChangeEvent({delta:t.data,full:t.target instanceof HTMLTextAreaElement?t.target.value:""})),m(this,Q,gs).call(this)},gs=function(){let t=o(this,Q,_r);if(!t)return;let{maxHeight:n,initialHeight:i,paddingY:s}=Fa;t.style.height=`${i}px`;let a=t.scrollHeight,l=s*2,c=Math.min(a-l,n);t.style.height=`${c}px`,this.requestUpdate()},w(Ot,"properties",{disabled:{type:Boolean},streaming:{type:Boolean},loading:{type:Boolean},placeholder:{type:String},color:{type:String},enableImageUpload:{type:Boolean},onImageUploadClick:{type:Function},images:{type:Array},onImageDelete:{type:Function}});var We=Ot,Na;We.ChangeEvent=(Na=class extends CustomEvent{constructor(e,t={}){super(We.ChangeEvent.type,{detail:e,...t})}},w(Na,"type","mw:change"),Na);var Ha;We.SubmitEvent=(Ha=class extends CustomEvent{constructor(e,t={}){super(We.SubmitEvent.type,{detail:e,...t,cancelable:!0})}},w(Ha,"type","mw:submit"),Ha);var za;We.CancelEvent=(za=class extends CustomEvent{constructor(e={}){super(We.CancelEvent.type,{...e})}},w(za,"type","mw:cancel"),za);function R1(r){return(r.code==="Enter"||r.code==="NumpadEnter")&&!r.ctrlKey&&!r.metaKey&&!r.shiftKey}customElements.get("mw-chat-input")||customElements.define("mw-chat-input",We);var ws=class extends I(C){constructor(){super(),this.side="assistant",this.status="",this.color="",this.logoUrl="",this.position="single"}render(){let t=this.side==="user"&&this.position==="single"?"rounded-2xl":this.side==="user"&&["single-current","first"].includes(this.position)?"rounded-2xl rounded-br-[4px]":this.side==="user"&&["middle","last-current"].includes(this.position)?"rounded-2xl rounded-r-[4px]":this.side==="user"&&this.position==="last"?"rounded-2xl rounded-tr-[4px]":["support","assistant"].includes(this.side)&&["single","single-current"].includes(this.position)?"rounded-2xl":["support","assistant"].includes(this.side)&&this.position==="first"?"rounded-2xl rounded-bl-[4px]":["support","assistant"].includes(this.side)&&this.position==="middle"?"rounded-2xl rounded-l-[4px]":["support","assistant"].includes(this.side)&&["last","last-current"].includes(this.position)?"rounded-2xl rounded-tl-[4px]":"rounded-2xl";switch(this.side){case"user":return h`
|
|
1346
1346
|
<div class="ml-20 flex justify-end font-sans text-base">
|
|
1347
1347
|
<div class="max-w-full">
|
|
1348
1348
|
<!-- include an invisible border (same color as background) so that this message is the same height as the bot message -->
|
|
@@ -1378,9 +1378,9 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1378
1378
|
</div>
|
|
1379
1379
|
</div>
|
|
1380
1380
|
</div>
|
|
1381
|
-
`;default:throw new Error(`Unknown side: ${this.side}`)}}};w(
|
|
1382
|
-
<div class="${o(this,st,
|
|
1383
|
-
<div class="${o(this,st,
|
|
1381
|
+
`;default:throw new Error(`Unknown side: ${this.side}`)}}};w(ws,"properties",{side:{type:String},status:{type:String},color:{type:String},logoUrl:{type:String,attribute:"logo"},position:{type:String}});customElements.get("mw-chat-message")||customElements.define("mw-chat-message",ws);var Ut,Ir,Mr,it,st,th,rh,nh,ys,vs,bs,Rn,xs,Be=class extends I(C){constructor(){super();p(this,st);p(this,Ut,!1);p(this,Ir,!1);p(this,Mr,!1);p(this,it,!1);p(this,ys,t=>{console.error("Failed to load chat image:",this.src),g(this,Ir,!0),this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:error",{detail:{src:this.src,event:t},bubbles:!0}))});p(this,vs,t=>{g(this,Ut,!0),this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:load",{detail:{src:this.src,event:t},bubbles:!0}))});p(this,bs,t=>{this.clickable&&(t.preventDefault(),t.stopPropagation(),g(this,Mr,!0),this.requestUpdate(),g(this,it,!0),this.requestUpdate(),setTimeout(()=>{g(this,it,!1),this.requestUpdate()},500),this.dispatchEvent(new CustomEvent("mw-chat-image:click",{detail:{src:this.src,event:t},bubbles:!0})))});p(this,Rn,t=>{t.preventDefault(),t.stopPropagation(),g(this,Mr,!1),this.requestUpdate()});p(this,xs,t=>{t.preventDefault(),t.stopPropagation()});this.src="",this.alt="",this.side="right",this.position="single",this.width="300px",this.height="auto",this.clickable=!1}updated(t){t.has("src")&&(g(this,Ut,!1),g(this,Ir,!1))}render(){return this.src?h`
|
|
1382
|
+
<div class="${o(this,st,th)} mb-2 min-h-[100px]">
|
|
1383
|
+
<div class="${o(this,st,rh)} relative">
|
|
1384
1384
|
<!-- Placeholder background that's only shown when loading or error -->
|
|
1385
1385
|
${o(this,Ut)?null:h`
|
|
1386
1386
|
<div class="flex items-center justify-center bg-gray-100" style="width: ${this.width}; height: 200px;">
|
|
@@ -1405,9 +1405,9 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1405
1405
|
alt="${this.alt}"
|
|
1406
1406
|
style="width: ${this.width}; height: ${this.height}; display: block;"
|
|
1407
1407
|
class="${o(this,Ut)?"opacity-100":"opacity-0 hidden"} ${this.clickable?"cursor-pointer hover:scale-[105%]":""} h-full w-full max-w-full transition-all duration-200"
|
|
1408
|
-
@error="${o(this,
|
|
1409
|
-
@load="${o(this,
|
|
1410
|
-
@click="${this.clickable?o(this,
|
|
1408
|
+
@error="${o(this,ys)}"
|
|
1409
|
+
@load="${o(this,vs)}"
|
|
1410
|
+
@click="${this.clickable?o(this,bs):void 0}"
|
|
1411
1411
|
loading="lazy" />
|
|
1412
1412
|
</div>
|
|
1413
1413
|
</div>
|
|
@@ -1430,28 +1430,28 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1430
1430
|
</button>
|
|
1431
1431
|
<div class="relative max-h-full max-w-full">
|
|
1432
1432
|
<img
|
|
1433
|
-
src="${m(this,st,
|
|
1433
|
+
src="${m(this,st,nh).call(this)}"
|
|
1434
1434
|
alt="${this.alt}"
|
|
1435
1435
|
class="${o(this,it)?"scale-75 opacity-0":"scale-100 opacity-100"} max-h-full max-w-full transform rounded-lg shadow-2xl transition-all duration-100 ease-out"
|
|
1436
|
-
@click="${o(this,
|
|
1436
|
+
@click="${o(this,xs)}" />
|
|
1437
1437
|
</div>
|
|
1438
1438
|
</div>
|
|
1439
1439
|
`:null}
|
|
1440
|
-
`:(console.warn("MwChatImage: No src provided"),null)}};Ut=new WeakMap,Ir=new WeakMap,Mr=new WeakMap,it=new WeakMap,st=new WeakSet,
|
|
1440
|
+
`:(console.warn("MwChatImage: No src provided"),null)}};Ut=new WeakMap,Ir=new WeakMap,Mr=new WeakMap,it=new WeakMap,st=new WeakSet,th=function(){return this.side==="left"||this.side==="assistant"?"flex justify-start ml-[25px]":"flex justify-end"},rh=function(){let t="inline-block overflow-hidden shadow-sm";if(this.side==="right"||this.side==="user")switch(this.position){case"first":t+=" rounded-2xl rounded-br-[4px]";break;case"middle":t+=" rounded-2xl rounded-r-[4px]";break;case"last":case"last-current":t+=" rounded-2xl rounded-tr-[4px]";break;default:t+=" rounded-2xl";break}else switch(this.position){case"first":t+=" rounded-2xl rounded-bl-[4px]";break;case"middle":t+=" rounded-2xl rounded-l-[4px]";break;case"last":case"last-current":t+=" rounded-2xl rounded-tl-[4px]";break;default:t+=" rounded-2xl";break}return t},nh=function(){if(!this.src)return"";try{let t=new URL(this.src);return t.searchParams.set("for","full"),t.href}catch{return this.src}},ys=new WeakMap,vs=new WeakMap,bs=new WeakMap,Rn=new WeakMap,xs=new WeakMap,w(Be,"properties",{src:{type:String},alt:{type:String},side:{type:String},position:{type:String},width:{type:String},height:{type:String},clickable:{type:Boolean}});var Wa;Be.ErrorEvent=(Wa=class extends CustomEvent{constructor(e,t={}){super(Be.ErrorEvent.type,{detail:e,...t})}},w(Wa,"type","mw-chat-image:error"),Wa);var Ga;Be.LoadEvent=(Ga=class extends CustomEvent{constructor(e,t={}){super(Be.LoadEvent.type,{detail:e,...t})}},w(Ga,"type","mw-chat-image:load"),Ga);var Za;Be.ClickEvent=(Za=class extends CustomEvent{constructor(e,t={}){super(Be.ClickEvent.type,{detail:e,...t})}},w(Za,"type","mw-chat-image:click"),Za);customElements.get("mw-chat-image")||customElements.define("mw-chat-image",Be);var ue=r=>r??W;var B1=["javascript:","data:text/html","vbscript:","data:text/javascript","data:text/vbscript","data:text/css","data:text/plain","data:text/xml"],Ge,Ka,ih,ks,sh,Cs,$s=class $s extends I(C){constructor(){super();p(this,Ge);p(this,ks,t=>{t.preventDefault(),this._dismissed=!0,this.storageKey&&m(this,Ge,ih).call(this),this.dispatchEvent(new $s.DismissEvent)});p(this,Cs,t=>{t.stopPropagation()});this.text="By chatting with us, you agree to the monitoring and recording of this chat to deliver our services and processing of your personal data in accordance with our [Privacy Policy](https://docs.molin.ai/legal/privacy-policy).",this.color="#3b82f6",this.dismissible=!1,this.storageKey="mw-disclaimer-dismissed",this._dismissed=!1}updated(t){super.updated(t),t.has("storageKey")&&this.storageKey&&this.dismissible&&(this._dismissed=m(this,Ge,Ka).call(this))}connectedCallback(){super.connectedCallback(),this.storageKey&&this.dismissible&&(this._dismissed=m(this,Ge,Ka).call(this))}render(){if(this._dismissed)return null;let t=m(this,Ge,sh).call(this,this.text);return h`
|
|
1441
1441
|
<div class="flex items-center justify-between">
|
|
1442
1442
|
<div class="flex flex-1 items-center justify-center">
|
|
1443
1443
|
<span class="px-3 text-center text-xs font-light text-gray-500">${t}</span>
|
|
1444
1444
|
</div>
|
|
1445
1445
|
|
|
1446
1446
|
${this.dismissible?h`
|
|
1447
|
-
<button type="button" aria-label="Dismiss" class="ml-2 flex h-4 w-4 flex-shrink-0 cursor-pointer items-center justify-center rounded hover:bg-gray-200" @click="${o(this,
|
|
1447
|
+
<button type="button" aria-label="Dismiss" class="ml-2 flex h-4 w-4 flex-shrink-0 cursor-pointer items-center justify-center rounded hover:bg-gray-200" @click="${o(this,ks)}">
|
|
1448
1448
|
<lucide-icon name="x" class="h-3 w-3 text-gray-500"></lucide-icon>
|
|
1449
1449
|
</button>
|
|
1450
1450
|
`:null}
|
|
1451
1451
|
</div>
|
|
1452
|
-
`}};Ge=new WeakSet,
|
|
1452
|
+
`}};Ge=new WeakSet,Ka=function(){try{return localStorage.getItem(this.storageKey)==="true"}catch{return!1}},ih=function(){try{localStorage.setItem(this.storageKey,"true")}catch(t){console.warn("Could not save disclaimer dismissed state to localStorage:",t)}},ks=new WeakMap,sh=function(t){let i=/\[([^\]]+)\]\(([^)]+)\)/g.exec(t);if(i){let s=i[0],a=i[1],l=i[2],c=i.index;return B1.some(u=>l.toLowerCase().startsWith(u))||!l||!a?t:h`${t.slice(0,c)}<a href="${ue(l)}" target="_blank" rel="noopener noreferrer" @click="${o(this,Cs)}" class="underline" style="color: ${this.color}"
|
|
1453
1453
|
>${a}</a
|
|
1454
|
-
>${t.slice(
|
|
1454
|
+
>${t.slice(c+s.length)}`}return t},Cs=new WeakMap,w($s,"properties",{text:{type:String},color:{type:String},dismissible:{type:Boolean},storageKey:{type:String,attribute:"storage-key"},_dismissed:{type:Boolean,state:!0}});var Bn=$s,Ja;Bn.DismissEvent=(Ja=class extends CustomEvent{constructor(e={}){super(Bn.DismissEvent.type,{...e})}},w(Ja,"type","mw-disclaimer:dismiss"),Ja);customElements.get("mw-disclaimer")||customElements.define("mw-disclaimer",Bn);var Ar,oh,ah,Ss=class extends I(C){constructor(){super();p(this,Ar);this.text="I'm still learning!",this.variant="info",this.autoDismissable=!1,this.dismissDelay=5e3,this._isVisible=!0}connectedCallback(){super.connectedCallback(),this.autoDismissable&&m(this,Ar,oh).call(this)}render(){let t=m(this,Ar,ah).call(this);return h`
|
|
1455
1455
|
<div
|
|
1456
1456
|
class="${this._isVisible?"opacity-100 translate-y-0":"opacity-0 translate-y-[50px] pointer-events-none mt-[-40px]"} flex justify-center transition-all transition-discrete duration-[1s] ease-in-out">
|
|
1457
1457
|
<div class="${t.bg} mb-2 flex max-w-[70%] items-center justify-center rounded-full px-3 py-2 select-none">
|
|
@@ -1490,7 +1490,7 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1490
1490
|
<span class="${t.text} ml-1 text-xs">${this.text}</span>
|
|
1491
1491
|
</div>
|
|
1492
1492
|
</div>
|
|
1493
|
-
`}};Ar=new WeakSet,
|
|
1493
|
+
`}};Ar=new WeakSet,oh=function(){setTimeout(()=>{this._isVisible=!1,this.requestUpdate()},this.dismissDelay)},ah=function(){switch(this.variant){case"error":return{bg:"bg-red-600",text:"text-white",icon:"badge-alert"};case"warning":return{bg:"bg-yellow-600",text:"text-white",icon:"alert-triangle"};case"success":return{bg:"bg-green-600",text:"text-white",icon:"check-circle"};case"info":default:return{bg:"bg-black",text:"text-white",icon:"info"}}},w(Ss,"properties",{text:{type:String},variant:{type:String},autoDismissable:{type:Boolean,attribute:"auto-dismissable"},dismissDelay:{type:Number,attribute:"dismiss-delay"},_isVisible:{type:Boolean,state:!0}});customElements.get("mw-info-banner")||customElements.define("mw-info-banner",Ss);var Ya=class extends I(C){constructor(){super(...arguments);w(this,"render",()=>h`
|
|
1494
1494
|
<svg class="inline-block h-full w-full leading-0" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" xml:space="preserve">
|
|
1495
1495
|
<circle fill="currentFill" stroke="none" cx="27" cy="50" r="6">
|
|
1496
1496
|
<animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.1" />
|
|
@@ -1502,11 +1502,11 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1502
1502
|
<animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.3" />
|
|
1503
1503
|
</circle>
|
|
1504
1504
|
</svg>
|
|
1505
|
-
`)}};customElements.get("mw-loading")||customElements.define("mw-loading",
|
|
1505
|
+
`)}};customElements.get("mw-loading")||customElements.define("mw-loading",Ya);var q1="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",Xa=class extends I(C){constructor(){super(...arguments);w(this,"render",()=>h`
|
|
1506
1506
|
<p class="flex items-center justify-center text-xs whitespace-nowrap">
|
|
1507
1507
|
<span>Powered by</span>
|
|
1508
1508
|
|
|
1509
|
-
<a href="${
|
|
1509
|
+
<a href="${q1}" target="_blank" class="inline-flex items-center underline">
|
|
1510
1510
|
<svg class="mx-1 inline-block h-4 w-4" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1511
1511
|
<circle cx="10.0361" cy="10.0361" r="10.0361" fill="#242038" />
|
|
1512
1512
|
<path
|
|
@@ -1525,7 +1525,7 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1525
1525
|
<span>Molin AI</span>
|
|
1526
1526
|
</a>
|
|
1527
1527
|
</p>
|
|
1528
|
-
`)}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",
|
|
1528
|
+
`)}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",Xa);var V1=Math.pow(10,8)*24*60*60*1e3,N5=-V1;var F1=3600;var lh=F1*24,H5=lh*7,N1=lh*365.2425,H1=N1/12,z5=H1*3,Qa=Symbol.for("constructDateFrom");function ch(r,e){return typeof r=="function"?r(e):r&&typeof r=="object"&&Qa in r?r[Qa](e):r instanceof Date?new r.constructor(e):new Date(e)}function el(r,e){return ch(e||r,r)}function uh(r){return e=>{let n=(r?Math[r]:Math.trunc)(e);return n===0?0:n}}function hh(r,e){return+el(r)-+el(e)}function tl(r,e,t){let n=hh(r,e)/1e3;return uh(t?.roundingMethod)(n)}var Pt,Rt,rl,Es,Vn,dh,qn=class extends I(C){constructor(){super();p(this,Rt);p(this,Pt,7);p(this,Es,async t=>{this._loadingAnswer=t,this._questionHistory.push({question:this._currentQuestion,answer:t}),this._currentAttemptQuestionCount++,this.dispatchEvent(new CustomEvent("mw-chat-wait-game:question-answered",{bubbles:!0,composed:!0,detail:{questionIndex:this._questionHistory.length-1,question:this._currentQuestion,answer:t,totalQuestions:o(this,Pt),allAnswers:this._questionHistory.map(i=>i.answer)}}));let n=await m(this,Rt,rl).call(this);n&&(n.isComplete&&n.guessedJob?(this._guessedJob=n.guessedJob,this.dispatchEvent(new CustomEvent("mw-chat-wait-game:game-completed",{bubbles:!0,composed:!0,detail:{guessedProfession:this._guessedJob,questionCount:this._questionHistory.length,allAnswers:this._questionHistory.map(i=>i.answer)}}))):n.nextQuestion&&(this._currentQuestion=n.nextQuestion)),this._loadingAnswer=""});p(this,Vn,async t=>{if(this._validatingButton=t?"correct":"wrong",this.dispatchEvent(new CustomEvent("mw-chat-wait-game:guess-validated",{bubbles:!0,composed:!0,detail:{guessedProfession:this._guessedJob,isCorrect:t,questionCount:this._questionHistory.length,allAnswers:this._questionHistory.map(n=>n.answer)}})),t)this._guessValidated=!0,this._validatingButton="";else{let n=await m(this,Rt,rl).call(this);n?.nextQuestion&&(this._currentQuestion=n.nextQuestion),this._guessedJob="",this._currentAttemptQuestionCount=0,this._validatingButton=""}});this.question="",this.options=["No","Yes"],this.heading="",this.gameTitle="",this.resultPrefix="",this.correctButtonText="Correct",this.wrongButtonText="Wrong",this.color="#601feb",this.apiBaseUrl="",this.minutes="00",this.seconds="00",this._questionHistory=[],this._currentQuestion="",this._guessedJob="",this._isLoadingNextQuestion=!1,this._loadingAnswer="",this._guessValidated=!1,this._validatingButton="",this._currentAttemptQuestionCount=0}connectedCallback(){super.connectedCallback(),this._currentQuestion=this.question}render(){let t=m(this,Rt,dh).call(this),n=this.heading||"Agent joining in",i=this.gameTitle||"\u{1F9E0} I'll guess your job",s=this.resultPrefix||"I'm pretty confident:";return this._guessedJob?h`
|
|
1529
1529
|
<div class="mx-auto w-full max-w-xs rounded-2xl bg-white/70 p-4 shadow-sm ring-1 ring-black/10 backdrop-blur">
|
|
1530
1530
|
<div class="flex items-center justify-between">
|
|
1531
1531
|
<div class="text-[13px] text-black/60">${n}</div>
|
|
@@ -1582,12 +1582,12 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1582
1582
|
<div class="mt-3 rounded-xl bg-black/[0.04] px-3 py-2 text-[14px] font-medium text-black">${this._currentQuestion}</div>
|
|
1583
1583
|
|
|
1584
1584
|
<div class="mt-3 grid grid-cols-2 gap-1">
|
|
1585
|
-
${this.options.map((a,
|
|
1585
|
+
${this.options.map((a,l)=>{let c=this._loadingAnswer===a;return h`
|
|
1586
1586
|
<button
|
|
1587
|
-
@click="${()=>o(this,
|
|
1587
|
+
@click="${()=>o(this,Es).call(this,a)}"
|
|
1588
1588
|
?disabled="${this._isLoadingNextQuestion}"
|
|
1589
|
-
class="${
|
|
1590
|
-
${
|
|
1589
|
+
class="${l===0?`flex items-center justify-center gap-1 rounded-xl border border-[${this.color}] bg-white text-black px-1 py-1.5 max-h-[35px] text-sm transition-colors hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50`:`flex items-center justify-center gap-1 rounded-xl bg-[${this.color}] py-1.5 max-h-[35px] px-1 text-sm text-white transition-colors hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50`}">
|
|
1590
|
+
${c?h`<lucide-icon class="h-3.5 w-3.5 animate-spin" name="loader-circle"></lucide-icon>`:a}
|
|
1591
1591
|
</button>
|
|
1592
1592
|
`})}
|
|
1593
1593
|
</div>
|
|
@@ -1596,11 +1596,11 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1596
1596
|
<div class="h-full rounded-full bg-[${this.color}] transition-[width] duration-300" style="width: ${t}%"></div>
|
|
1597
1597
|
</div>
|
|
1598
1598
|
</div>
|
|
1599
|
-
`:h`<div class="mx-auto w-full max-w-xs rounded-2xl bg-white/70 p-4 text-center text-sm text-black/60">Loading game...</div>`}};Pt=new WeakMap,Rt=new WeakSet,
|
|
1599
|
+
`:h`<div class="mx-auto w-full max-w-xs rounded-2xl bg-white/70 p-4 text-center text-sm text-black/60">Loading game...</div>`}};Pt=new WeakMap,Rt=new WeakSet,rl=async function(){if(!this.apiBaseUrl)return console.warn("API base URL not configured, cannot fetch next question"),null;this._isLoadingNextQuestion=!0;try{let t=await fetch(`${this.apiBaseUrl}/preview/wait-game/next-question`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({questionAnswers:this._questionHistory,takeGuess:this._currentAttemptQuestionCount>=o(this,Pt)})});return t.ok?await t.json():(console.error("failed to fetch next question",t.status),null)}catch(t){return console.error("error fetching next question",t),null}finally{this._isLoadingNextQuestion=!1}},Es=new WeakMap,Vn=new WeakMap,dh=function(){return Math.round(this._currentAttemptQuestionCount/o(this,Pt)*100)},w(qn,"properties",{question:{type:String},options:{type:Array},heading:{type:String},gameTitle:{type:String},resultPrefix:{type:String},correctButtonText:{type:String},wrongButtonText:{type:String},color:{type:String},apiBaseUrl:{type:String},minutes:{type:String},seconds:{type:String},_currentQuestion:{type:String,state:!0},_questionHistory:{type:Array,state:!0},_guessedJob:{type:String,state:!0},_isLoadingNextQuestion:{type:Boolean,state:!0},_loadingAnswer:{type:String,state:!0},_guessValidated:{type:Boolean,state:!0},_validatingButton:{type:String,state:!0},_currentAttemptQuestionCount:{type:Number,state:!0}}),w(qn,"styles",J`
|
|
1600
1600
|
:host {
|
|
1601
1601
|
display: block;
|
|
1602
1602
|
}
|
|
1603
|
-
`);customElements.get("mw-chat-wait-game")||customElements.define("mw-chat-wait-game",qn);var Bt,Ze,Tr,le,
|
|
1603
|
+
`);customElements.get("mw-chat-wait-game")||customElements.define("mw-chat-wait-game",qn);var Bt,Ze,Tr,le,ph,nl,fh,il,_s,mh,gh,Fn=class extends I(C){constructor(){super();p(this,le);p(this,Bt,null);p(this,Ze,null);p(this,Tr,0);p(this,_s,()=>{this._showGame=!0,this.dispatchEvent(new CustomEvent("mw-chat-wait-timer:game-click",{bubbles:!0,composed:!0}))});this.heading="",this.message="",this.completeMessage="",this.gameButton="",this.question="",this.options="",this.gameTitle="",this.resultPrefix="",this.correctButtonText="Correct",this.wrongButtonText="Wrong",this.targetEndTime="",this.color="#601feb",this.apiBaseUrl="",this._remainingSeconds=480,this._isComplete=!1,this._showGame=!1}connectedCallback(){super.connectedCallback(),m(this,le,ph).call(this),m(this,le,fh).call(this)}disconnectedCallback(){super.disconnectedCallback(),m(this,le,il).call(this)}render(){let{minutes:t,seconds:n}=m(this,le,mh).call(this);if(this._showGame)return h`
|
|
1604
1604
|
<mw-chat-wait-game
|
|
1605
1605
|
.question="${this.question}"
|
|
1606
1606
|
.options="${this.options||["No","Yes"]}"
|
|
@@ -1613,7 +1613,7 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1613
1613
|
.apiBaseUrl="${this.apiBaseUrl}"
|
|
1614
1614
|
.minutes="${t}"
|
|
1615
1615
|
.seconds="${n}"></mw-chat-wait-game>
|
|
1616
|
-
`;let i=m(this,le,
|
|
1616
|
+
`;let i=m(this,le,gh).call(this);return h`
|
|
1617
1617
|
<div class="mx-auto w-full max-w-xs rounded-2xl bg-white/70 p-4 shadow-sm ring-1 ring-black/10 backdrop-blur">
|
|
1618
1618
|
<!-- Time -->
|
|
1619
1619
|
<div class="font-[ui-monospace,Menlo,Monaco,Consolas] text-4xl tracking-tight text-black tabular-nums" aria-live="polite">${t}<span class="text-black/30">:</span>${n}</div>
|
|
@@ -1628,14 +1628,14 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1628
1628
|
|
|
1629
1629
|
<!-- Play a Game Button -->
|
|
1630
1630
|
<div class="mt-4">
|
|
1631
|
-
<button @click="${o(this,
|
|
1631
|
+
<button @click="${o(this,_s)}" class="w-full rounded-xl bg-[${this.color}] px-4 py-2 text-sm font-medium text-white transition hover:opacity-90">${this.gameButton}</button>
|
|
1632
1632
|
</div>
|
|
1633
1633
|
</div>
|
|
1634
|
-
`}};Bt=new WeakMap,Ze=new WeakMap,Tr=new WeakMap,le=new WeakSet,
|
|
1634
|
+
`}};Bt=new WeakMap,Ze=new WeakMap,Tr=new WeakMap,le=new WeakSet,ph=function(){this.targetEndTime?g(this,Ze,new Date(this.targetEndTime)):g(this,Ze,new Date(Date.now()+this._remainingSeconds*1e3)),g(this,Tr,Math.max(tl(o(this,Ze),new Date),0)),m(this,le,nl).call(this)},nl=function(){if(o(this,Ze)===null)return;let t=new Date,n=tl(o(this,Ze),t);n>=0?(this._remainingSeconds=n,this._isComplete=!1):(this._remainingSeconds=Math.abs(n),this._isComplete=!0)},fh=function(){m(this,le,il).call(this),g(this,Bt,setInterval(()=>{m(this,le,nl).call(this)},1e3))},il=function(){o(this,Bt)!==null&&(clearInterval(o(this,Bt)),g(this,Bt,null))},_s=new WeakMap,mh=function(){let t=Math.floor(this._remainingSeconds/60),n=this._remainingSeconds%60,i=s=>String(s).padStart(2,"0");return{minutes:i(t),seconds:i(n)}},gh=function(){return this._isComplete?0:o(this,Ze)===null||o(this,Tr)===0?100:Math.round(this._remainingSeconds/o(this,Tr)*100)},w(Fn,"properties",{totalSeconds:{type:Number},heading:{type:String},message:{type:String},completeMessage:{type:String},gameButton:{type:String},question:{type:String},options:{type:String},gameTitle:{type:String,attribute:"game-title"},resultPrefix:{type:String,attribute:"result-prefix"},correctButtonText:{type:String,attribute:"correct-button-text"},wrongButtonText:{type:String,attribute:"wrong-button-text"},targetEndTime:{type:String,attribute:"target-end-time"},color:{type:String},apiBaseUrl:{type:String},_remainingSeconds:{type:Number,state:!0},_isComplete:{type:Boolean,state:!0},_showGame:{type:Boolean,state:!0}}),w(Fn,"styles",J`
|
|
1635
1635
|
:host {
|
|
1636
1636
|
display: block;
|
|
1637
1637
|
}
|
|
1638
|
-
`);customElements.get("mw-chat-wait-timer")||customElements.define("mw-chat-wait-timer",Fn);var
|
|
1638
|
+
`);customElements.get("mw-chat-wait-timer")||customElements.define("mw-chat-wait-timer",Fn);var Is=class extends I(C){constructor(){super(),this.product=void 0,this.streaming=!1,this.linksNewTab=!1,this.searchParams=void 0,this.imagesByProductUrl={}}get trackedProductUrl(){let e=this.product?.url,t=this.searchParams;try{if(e&&t)return Mc(e,t).href}catch{}return e}render(){let{name:e,description:t,price:n,url:i}=this.product||{},s=i?this.imagesByProductUrl?.[i]:void 0;return h`
|
|
1639
1639
|
<a
|
|
1640
1640
|
href="${ue(this.trackedProductUrl)}"
|
|
1641
1641
|
title="${ue(e)}"
|
|
@@ -1661,7 +1661,7 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1661
1661
|
${n||!this.streaming?h`<span class="text-xs text-gray-900">${n}</span>`:h`<div class="h-4 w-14 animate-pulse rounded bg-gray-200"></div>`}
|
|
1662
1662
|
</div>
|
|
1663
1663
|
</a>
|
|
1664
|
-
`}};w(_s,"properties",{product:{type:Object},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},searchParams:{type:Object},imagesByProductUrl:{type:Object}});customElements.get("mw-product-card-horizontal")||customElements.define("mw-product-card-horizontal",_s);function Is(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}var Ms=function(){},Lr=function(){};var Nn=(r,e,t)=>Math.min(Math.max(t,r),e);var il=.001,H1=.01,gh=10,z1=.05,W1=1;function wh({duration:r=800,bounce:e=.25,velocity:t=0,mass:n=1}){let i,s;Ms(r<=gh*1e3,"Spring duration must be 10 seconds or less");let a=1-e;a=Nn(z1,W1,a),r=Nn(H1,gh,r/1e3),a<1?(i=c=>{let d=c*a,f=d*r,y=d-t,x=As(c,a),S=Math.exp(-f);return il-y/x*S},s=c=>{let f=c*a*r,y=f*t+t,x=Math.pow(a,2)*Math.pow(c,2)*r,S=Math.exp(-f),j=As(Math.pow(c,2),a);return(-i(c)+il>0?-1:1)*((y-x)*S)/j}):(i=c=>{let d=Math.exp(-c*r),f=(c-t)*r+1;return-il+d*f},s=c=>{let d=Math.exp(-c*r),f=(t-c)*(r*r);return d*f});let u=5/r,l=Z1(i,s,u);if(r=r*1e3,isNaN(l))return{stiffness:100,damping:10,duration:r};{let c=Math.pow(l,2)*n;return{stiffness:c,damping:a*2*Math.sqrt(n*c),duration:r}}}var G1=12;function Z1(r,e,t){let n=t;for(let i=1;i<G1;i++)n=n-r(n)/e(n);return n}function As(r,e){return r*Math.sqrt(1-e*e)}var J1=["duration","bounce"],K1=["stiffness","damping","mass"];function yh(r,e){return e.some(t=>r[t]!==void 0)}function Y1(r){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},r);if(!yh(r,K1)&&yh(r,J1)){let t=wh(r);e=Object.assign(Object.assign(Object.assign({},e),t),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function Ts(r){var{from:e=0,to:t=1,restSpeed:n=2,restDelta:i}=r,s=Is(r,["from","to","restSpeed","restDelta"]);let a={done:!1,value:e},{stiffness:u,damping:l,mass:c,velocity:d,duration:f,isResolvedFromDuration:y}=Y1(s),x=vh,S=vh;function j(){let k=d?-(d/1e3):0,M=t-e,C=l/(2*Math.sqrt(u*c)),I=Math.sqrt(u/c)/1e3;if(i===void 0&&(i=Math.min(Math.abs(t-e)/100,.4)),C<1){let L=As(I,C);x=z=>{let ee=Math.exp(-C*I*z);return t-ee*((k+C*I*M)/L*Math.sin(L*z)+M*Math.cos(L*z))},S=z=>{let ee=Math.exp(-C*I*z);return C*I*ee*(Math.sin(L*z)*(k+C*I*M)/L+M*Math.cos(L*z))-ee*(Math.cos(L*z)*(k+C*I*M)-L*M*Math.sin(L*z))}}else if(C===1)x=L=>t-Math.exp(-I*L)*(M+(k+I*M)*L);else{let L=I*Math.sqrt(C*C-1);x=z=>{let ee=Math.exp(-C*I*z),ie=Math.min(L*z,300);return t-ee*((k+C*I*M)*Math.sinh(ie)+L*M*Math.cosh(ie))/L}}}return j(),{next:k=>{let M=x(k);if(y)a.done=k>=f;else{let C=S(k)*1e3,I=Math.abs(C)<=n,L=Math.abs(t-M)<=i;a.done=I&&L}return a.value=a.done?t:M,a},flipTarget:()=>{d=-d,[e,t]=[t,e],j()}}}Ts.needsInterpolation=(r,e)=>typeof r=="string"||typeof e=="string";var vh=r=>0;var sl=(r,e,t)=>{let n=e-r;return n===0?1:(t-r)/n};var jr=(r,e,t)=>-t*r+t*e+r;var Ls=(r,e)=>t=>Math.max(Math.min(t,e),r),ot=r=>r%1?Number(r.toFixed(5)):r,Dr=/(-)?([\d]*\.?[\d])+/g,js=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,bh=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Je(r){return typeof r=="string"}var Or={test:r=>typeof r=="number",parse:parseFloat,transform:r=>r},Ds=Object.assign(Object.assign({},Or),{transform:Ls(0,1)}),Lw=Object.assign(Object.assign({},Or),{default:1});var Hn=r=>({test:e=>Je(e)&&e.endsWith(r)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${r}`}),Ow=Hn("deg"),Ur=Hn("%"),Uw=Hn("px"),Pw=Hn("vh"),Rw=Hn("vw"),Bw=Object.assign(Object.assign({},Ur),{parse:r=>Ur.parse(r)/100,transform:r=>Ur.transform(r*100)});var Pr=(r,e)=>t=>!!(Je(t)&&bh.test(t)&&t.startsWith(r)||e&&Object.prototype.hasOwnProperty.call(t,e)),Os=(r,e,t)=>n=>{if(!Je(n))return n;let[i,s,a,u]=n.match(Dr);return{[r]:parseFloat(i),[e]:parseFloat(s),[t]:parseFloat(a),alpha:u!==void 0?parseFloat(u):1}};var qe={test:Pr("hsl","hue"),parse:Os("hue","saturation","lightness"),transform:({hue:r,saturation:e,lightness:t,alpha:n=1})=>"hsla("+Math.round(r)+", "+Ur.transform(ot(e))+", "+Ur.transform(ot(t))+", "+ot(Ds.transform(n))+")"};var X1=Ls(0,255),Us=Object.assign(Object.assign({},Or),{transform:r=>Math.round(X1(r))}),Ie={test:Pr("rgb","red"),parse:Os("red","green","blue"),transform:({red:r,green:e,blue:t,alpha:n=1})=>"rgba("+Us.transform(r)+", "+Us.transform(e)+", "+Us.transform(t)+", "+ot(Ds.transform(n))+")"};function Q1(r){let e="",t="",n="",i="";return r.length>5?(e=r.substr(1,2),t=r.substr(3,2),n=r.substr(5,2),i=r.substr(7,2)):(e=r.substr(1,1),t=r.substr(2,1),n=r.substr(3,1),i=r.substr(4,1),e+=e,t+=t,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}var Rr={test:Pr("#"),parse:Q1,transform:Ie.transform};var at={test:r=>Ie.test(r)||Rr.test(r)||qe.test(r),parse:r=>Ie.test(r)?Ie.parse(r):qe.test(r)?qe.parse(r):Rr.parse(r),transform:r=>Je(r)?r:r.hasOwnProperty("red")?Ie.transform(r):qe.transform(r)};var xh="${c}",kh="${n}";function e0(r){var e,t,n,i;return isNaN(r)&&Je(r)&&((t=(e=r.match(Dr))===null||e===void 0?void 0:e.length)!==null&&t!==void 0?t:0)+((i=(n=r.match(js))===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0)>0}function Ch(r){typeof r=="number"&&(r=`${r}`);let e=[],t=0,n=r.match(js);n&&(t=n.length,r=r.replace(js,xh),e.push(...n.map(at.parse)));let i=r.match(Dr);return i&&(r=r.replace(Dr,kh),e.push(...i.map(Or.parse))),{values:e,numColors:t,tokenised:r}}function $h(r){return Ch(r).values}function Sh(r){let{values:e,numColors:t,tokenised:n}=Ch(r),i=e.length;return s=>{let a=n;for(let u=0;u<i;u++)a=a.replace(u<t?xh:kh,u<t?at.transform(s[u]):ot(s[u]));return a}}var t0=r=>typeof r=="number"?0:r;function r0(r){let e=$h(r);return Sh(r)(e.map(t0))}var Ps={test:e0,parse:$h,createTransformer:Sh,getAnimatableNone:r0};function ol(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*(2/3-t)*6:r}function al({hue:r,saturation:e,lightness:t,alpha:n}){r/=360,e/=100,t/=100;let i=0,s=0,a=0;if(!e)i=s=a=t;else{let u=t<.5?t*(1+e):t+e-t*e,l=2*t-u;i=ol(l,u,r+1/3),s=ol(l,u,r),a=ol(l,u,r-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:n}}var n0=(r,e,t)=>{let n=r*r,i=e*e;return Math.sqrt(Math.max(0,t*(i-n)+n))},i0=[Rr,Ie,qe],Eh=r=>i0.find(e=>e.test(r)),_h=r=>`'${r}' is not an animatable color. Use the equivalent color code instead.`,Rs=(r,e)=>{let t=Eh(r),n=Eh(e);Lr(!!t,_h(r)),Lr(!!n,_h(e));let i=t.parse(r),s=n.parse(e);t===qe&&(i=al(i),t=Ie),n===qe&&(s=al(s),n=Ie);let a=Object.assign({},i);return u=>{for(let l in a)l!=="alpha"&&(a[l]=n0(i[l],s[l],u));return a.alpha=jr(i.alpha,s.alpha,u),t.transform(a)}};var Ih=r=>typeof r=="number";var s0=(r,e)=>t=>e(r(t)),Bs=(...r)=>r.reduce(s0);function Ah(r,e){return Ih(r)?t=>jr(r,e,t):at.test(r)?Rs(r,e):cl(r,e)}var ll=(r,e)=>{let t=[...r],n=t.length,i=r.map((s,a)=>Ah(s,e[a]));return s=>{for(let a=0;a<n;a++)t[a]=i[a](s);return t}},Th=(r,e)=>{let t=Object.assign(Object.assign({},r),e),n={};for(let i in t)r[i]!==void 0&&e[i]!==void 0&&(n[i]=Ah(r[i],e[i]));return i=>{for(let s in n)t[s]=n[s](i);return t}};function Mh(r){let e=Ps.parse(r),t=e.length,n=0,i=0,s=0;for(let a=0;a<t;a++)n||typeof e[a]=="number"?n++:e[a].hue!==void 0?s++:i++;return{parsed:e,numNumbers:n,numRGB:i,numHSL:s}}var cl=(r,e)=>{let t=Ps.createTransformer(e),n=Mh(r),i=Mh(e);return n.numHSL===i.numHSL&&n.numRGB===i.numRGB&&n.numNumbers>=i.numNumbers?Bs(ll(n.parsed,i.parsed),t):(Ms(!0,`Complex values '${r}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),a=>`${a>0?e:r}`)};var o0=(r,e)=>t=>jr(r,e,t);function a0(r){if(typeof r=="number")return o0;if(typeof r=="string")return at.test(r)?Rs:cl;if(Array.isArray(r))return ll;if(typeof r=="object")return Th}function l0(r,e,t){let n=[],i=t||a0(r[0]),s=r.length-1;for(let a=0;a<s;a++){let u=i(r[a],r[a+1]);if(e){let l=Array.isArray(e)?e[a]:e;u=Bs(l,u)}n.push(u)}return n}function c0([r,e],[t]){return n=>t(sl(r,e,n))}function u0(r,e){let t=r.length,n=t-1;return i=>{let s=0,a=!1;if(i<=r[0]?a=!0:i>=r[n]&&(s=n-1,a=!0),!a){let l=1;for(;l<t&&!(r[l]>i||l===n);l++);s=l-1}let u=sl(r[s],r[s+1],i);return e[s](u)}}function qs(r,e,{clamp:t=!0,ease:n,mixer:i}={}){let s=r.length;Lr(s===e.length,"Both input and output ranges must be the same length"),Lr(!n||!Array.isArray(n)||n.length===s-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),r[0]>r[s-1]&&(r=[].concat(r),e=[].concat(e),r.reverse(),e.reverse());let a=l0(e,n,i),u=s===2?c0(r,a):u0(r,a);return t?l=>u(Nn(r[0],r[s-1],l)):u}var zn=r=>e=>1-r(1-e),Vs=r=>e=>e<=.5?r(2*e)/2:(2-r(2*(1-e)))/2,Lh=r=>e=>Math.pow(e,r),ul=r=>e=>e*e*((r+1)*e-r),jh=r=>{let e=ul(r);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))};var Dh=1.525,h0=4/11,d0=8/11,p0=9/10;var Oh=Lh(2),F4=zn(Oh),Uh=Vs(Oh),f0=r=>1-Math.sin(Math.acos(r)),m0=zn(f0),N4=Vs(m0),Ph=ul(Dh),H4=zn(Ph),z4=Vs(Ph),W4=jh(Dh),g0=4356/361,w0=35442/1805,y0=16061/1805,v0=r=>{if(r===1||r===0)return r;let e=r*r;return r<h0?7.5625*e:r<d0?9.075*e-9.9*r+3.4:r<p0?g0*e-w0*r+y0:10.8*r*r-20.52*r+10.72},G4=zn(v0);function b0(r,e){return r.map(()=>e||Uh).splice(0,r.length-1)}function x0(r){let e=r.length;return r.map((t,n)=>n!==0?n/(e-1):0)}function k0(r,e){return r.map(t=>t*e)}function Wn({from:r=0,to:e=1,ease:t,offset:n,duration:i=300}){let s={done:!1,value:r},a=Array.isArray(e)?e:[r,e],u=k0(n&&n.length===a.length?n:x0(a),i);function l(){return qs(u,a,{ease:Array.isArray(t)?t:b0(a,t)})}let c=l();return{next:d=>(s.value=c(d),s.done=d>=i,s),flipTarget:()=>{a.reverse(),c=l()}}}function Rh({velocity:r=0,from:e=0,power:t=.8,timeConstant:n=350,restDelta:i=.5,modifyTarget:s}){let a={done:!1,value:e},u=t*r,l=e+u,c=s===void 0?l:s(l);return c!==l&&(u=c-e),{next:d=>{let f=-u*Math.exp(-d/n);return a.done=!(f>i||f<-i),a.value=a.done?c:c+f,a},flipTarget:()=>{}}}var Bh={keyframes:Wn,spring:Ts,decay:Rh};function qh(r){if(Array.isArray(r.to))return Wn;if(Bh[r.type])return Bh[r.type];let e=new Set(Object.keys(r));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Wn:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Ts:Wn}var hl=16.666666666666668,C0=typeof performance<"u"?()=>performance.now():()=>Date.now(),dl=typeof window<"u"?r=>window.requestAnimationFrame(r):r=>setTimeout(()=>r(C0()),hl);function Vh(r){let e=[],t=[],n=0,i=!1,s=!1,a=new WeakSet,u={schedule:(l,c=!1,d=!1)=>{let f=d&&i,y=f?e:t;return c&&a.add(l),y.indexOf(l)===-1&&(y.push(l),f&&i&&(n=e.length)),l},cancel:l=>{let c=t.indexOf(l);c!==-1&&t.splice(c,1),a.delete(l)},process:l=>{if(i){s=!0;return}if(i=!0,[e,t]=[t,e],t.length=0,n=e.length,n)for(let c=0;c<n;c++){let d=e[c];d(l),a.has(d)&&(u.schedule(d),r())}i=!1,s&&(s=!1,u.process(l))}};return u}var $0=40,pl=!0,Zn=!1,fl=!1,Gn={delta:0,timestamp:0},Jn=["read","update","preRender","render","postRender"],Fs=Jn.reduce((r,e)=>(r[e]=Vh(()=>Zn=!0),r),{}),S0=Jn.reduce((r,e)=>{let t=Fs[e];return r[e]=(n,i=!1,s=!1)=>(Zn||_0(),t.schedule(n,i,s)),r},{}),Fh=Jn.reduce((r,e)=>(r[e]=Fs[e].cancel,r),{}),ay=Jn.reduce((r,e)=>(r[e]=()=>Fs[e].process(Gn),r),{}),E0=r=>Fs[r].process(Gn),Nh=r=>{Zn=!1,Gn.delta=pl?hl:Math.max(Math.min(r-Gn.timestamp,$0),1),Gn.timestamp=r,fl=!0,Jn.forEach(E0),fl=!1,Zn&&(pl=!1,dl(Nh))},_0=()=>{Zn=!0,pl=!0,fl||dl(Nh)};var Hh=S0;function ml(r,e,t=0){return r-e-t}function zh(r,e,t=0,n=!0){return n?ml(e+-r,e,t):e-(r-e)+t}function Wh(r,e,t,n){return n?r>=e+t:r<=-t}var I0=r=>{let e=({delta:t})=>r(t);return{start:()=>Hh.update(e,!0),stop:()=>Fh.update(e)}};function gl(r){var e,t,{from:n,autoplay:i=!0,driver:s=I0,elapsed:a=0,repeat:u=0,repeatType:l="loop",repeatDelay:c=0,onPlay:d,onStop:f,onComplete:y,onRepeat:x,onUpdate:S}=r,j=Is(r,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:k}=j,M,C=0,I=j.duration,L,z=!1,ee=!0,ie,B=qh(j);!((t=(e=B).needsInterpolation)===null||t===void 0)&&t.call(e,n,k)&&(ie=qs([0,100],[n,k],{clamp:!1}),n=0,k=100);let se=B(Object.assign(Object.assign({},j),{from:n,to:k}));function de(){C++,l==="reverse"?(ee=C%2===0,a=zh(a,I,c,ee)):(a=ml(a,I,c),l==="mirror"&&se.flipTarget()),z=!1,x&&x()}function Eo(){M.stop(),y&&y()}function gt(Z){if(ee||(Z=-Z),a+=Z,!z){let oe=se.next(Math.max(0,a));L=oe.value,ie&&(L=ie(L)),z=ee?oe.done:a<=0}S?.(L),z&&(C===0&&(I??(I=a)),C<u?Wh(a,I,c,ee)&&de():Eo())}function Si(){d?.(),M=s(gt),M.start()}return i&&Si(),{stop:()=>{f?.(),M.stop()}}}var H,Gh,Ns,Zh,Hs,Jh,Kh,Yh,zs,Ws=class Ws extends _($){constructor(){super();p(this,H);this.product=void 0,this.labels={addToCart:"Add to cart",color:"Color",size:"Size"},this._currentImageIndex=0,this._isValidUrl=!1}willUpdate(t){t.has("product")&&m(this,H,Gh).call(this)}get images(){return this.product?.images||[]}render(){if(!this.product)return h`
|
|
1664
|
+
`}};w(Is,"properties",{product:{type:Object},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},searchParams:{type:Object},imagesByProductUrl:{type:Object}});customElements.get("mw-product-card-horizontal")||customElements.define("mw-product-card-horizontal",Is);function Ms(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}var As=function(){},Lr=function(){};var Nn=(r,e,t)=>Math.min(Math.max(t,r),e);var sl=.001,z1=.01,wh=10,W1=.05,G1=1;function yh({duration:r=800,bounce:e=.25,velocity:t=0,mass:n=1}){let i,s;As(r<=wh*1e3,"Spring duration must be 10 seconds or less");let a=1-e;a=Nn(W1,G1,a),r=Nn(z1,wh,r/1e3),a<1?(i=u=>{let d=u*a,f=d*r,y=d-t,k=Ts(u,a),$=Math.exp(-f);return sl-y/k*$},s=u=>{let f=u*a*r,y=f*t+t,k=Math.pow(a,2)*Math.pow(u,2)*r,$=Math.exp(-f),j=Ts(Math.pow(u,2),a);return(-i(u)+sl>0?-1:1)*((y-k)*$)/j}):(i=u=>{let d=Math.exp(-u*r),f=(u-t)*r+1;return-sl+d*f},s=u=>{let d=Math.exp(-u*r),f=(t-u)*(r*r);return d*f});let l=5/r,c=J1(i,s,l);if(r=r*1e3,isNaN(c))return{stiffness:100,damping:10,duration:r};{let u=Math.pow(c,2)*n;return{stiffness:u,damping:a*2*Math.sqrt(n*u),duration:r}}}var Z1=12;function J1(r,e,t){let n=t;for(let i=1;i<Z1;i++)n=n-r(n)/e(n);return n}function Ts(r,e){return r*Math.sqrt(1-e*e)}var K1=["duration","bounce"],Y1=["stiffness","damping","mass"];function vh(r,e){return e.some(t=>r[t]!==void 0)}function X1(r){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},r);if(!vh(r,Y1)&&vh(r,K1)){let t=yh(r);e=Object.assign(Object.assign(Object.assign({},e),t),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function Ls(r){var{from:e=0,to:t=1,restSpeed:n=2,restDelta:i}=r,s=Ms(r,["from","to","restSpeed","restDelta"]);let a={done:!1,value:e},{stiffness:l,damping:c,mass:u,velocity:d,duration:f,isResolvedFromDuration:y}=X1(s),k=bh,$=bh;function j(){let S=d?-(d/1e3):0,M=t-e,x=c/(2*Math.sqrt(l*u)),E=Math.sqrt(l/u)/1e3;if(i===void 0&&(i=Math.min(Math.abs(t-e)/100,.4)),x<1){let L=Ts(E,x);k=z=>{let ee=Math.exp(-x*E*z);return t-ee*((S+x*E*M)/L*Math.sin(L*z)+M*Math.cos(L*z))},$=z=>{let ee=Math.exp(-x*E*z);return x*E*ee*(Math.sin(L*z)*(S+x*E*M)/L+M*Math.cos(L*z))-ee*(Math.cos(L*z)*(S+x*E*M)-L*M*Math.sin(L*z))}}else if(x===1)k=L=>t-Math.exp(-E*L)*(M+(S+E*M)*L);else{let L=E*Math.sqrt(x*x-1);k=z=>{let ee=Math.exp(-x*E*z),ie=Math.min(L*z,300);return t-ee*((S+x*E*M)*Math.sinh(ie)+L*M*Math.cosh(ie))/L}}}return j(),{next:S=>{let M=k(S);if(y)a.done=S>=f;else{let x=$(S)*1e3,E=Math.abs(x)<=n,L=Math.abs(t-M)<=i;a.done=E&&L}return a.value=a.done?t:M,a},flipTarget:()=>{d=-d,[e,t]=[t,e],j()}}}Ls.needsInterpolation=(r,e)=>typeof r=="string"||typeof e=="string";var bh=r=>0;var ol=(r,e,t)=>{let n=e-r;return n===0?1:(t-r)/n};var jr=(r,e,t)=>-t*r+t*e+r;var js=(r,e)=>t=>Math.max(Math.min(t,e),r),ot=r=>r%1?Number(r.toFixed(5)):r,Dr=/(-)?([\d]*\.?[\d])+/g,Ds=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,xh=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Je(r){return typeof r=="string"}var Or={test:r=>typeof r=="number",parse:parseFloat,transform:r=>r},Os=Object.assign(Object.assign({},Or),{transform:js(0,1)}),jw=Object.assign(Object.assign({},Or),{default:1});var Hn=r=>({test:e=>Je(e)&&e.endsWith(r)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${r}`}),Uw=Hn("deg"),Ur=Hn("%"),Pw=Hn("px"),Rw=Hn("vh"),Bw=Hn("vw"),qw=Object.assign(Object.assign({},Ur),{parse:r=>Ur.parse(r)/100,transform:r=>Ur.transform(r*100)});var Pr=(r,e)=>t=>!!(Je(t)&&xh.test(t)&&t.startsWith(r)||e&&Object.prototype.hasOwnProperty.call(t,e)),Us=(r,e,t)=>n=>{if(!Je(n))return n;let[i,s,a,l]=n.match(Dr);return{[r]:parseFloat(i),[e]:parseFloat(s),[t]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}};var qe={test:Pr("hsl","hue"),parse:Us("hue","saturation","lightness"),transform:({hue:r,saturation:e,lightness:t,alpha:n=1})=>"hsla("+Math.round(r)+", "+Ur.transform(ot(e))+", "+Ur.transform(ot(t))+", "+ot(Os.transform(n))+")"};var Q1=js(0,255),Ps=Object.assign(Object.assign({},Or),{transform:r=>Math.round(Q1(r))}),Ie={test:Pr("rgb","red"),parse:Us("red","green","blue"),transform:({red:r,green:e,blue:t,alpha:n=1})=>"rgba("+Ps.transform(r)+", "+Ps.transform(e)+", "+Ps.transform(t)+", "+ot(Os.transform(n))+")"};function e0(r){let e="",t="",n="",i="";return r.length>5?(e=r.substr(1,2),t=r.substr(3,2),n=r.substr(5,2),i=r.substr(7,2)):(e=r.substr(1,1),t=r.substr(2,1),n=r.substr(3,1),i=r.substr(4,1),e+=e,t+=t,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}var Rr={test:Pr("#"),parse:e0,transform:Ie.transform};var at={test:r=>Ie.test(r)||Rr.test(r)||qe.test(r),parse:r=>Ie.test(r)?Ie.parse(r):qe.test(r)?qe.parse(r):Rr.parse(r),transform:r=>Je(r)?r:r.hasOwnProperty("red")?Ie.transform(r):qe.transform(r)};var kh="${c}",Ch="${n}";function t0(r){var e,t,n,i;return isNaN(r)&&Je(r)&&((t=(e=r.match(Dr))===null||e===void 0?void 0:e.length)!==null&&t!==void 0?t:0)+((i=(n=r.match(Ds))===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0)>0}function $h(r){typeof r=="number"&&(r=`${r}`);let e=[],t=0,n=r.match(Ds);n&&(t=n.length,r=r.replace(Ds,kh),e.push(...n.map(at.parse)));let i=r.match(Dr);return i&&(r=r.replace(Dr,Ch),e.push(...i.map(Or.parse))),{values:e,numColors:t,tokenised:r}}function Sh(r){return $h(r).values}function Eh(r){let{values:e,numColors:t,tokenised:n}=$h(r),i=e.length;return s=>{let a=n;for(let l=0;l<i;l++)a=a.replace(l<t?kh:Ch,l<t?at.transform(s[l]):ot(s[l]));return a}}var r0=r=>typeof r=="number"?0:r;function n0(r){let e=Sh(r);return Eh(r)(e.map(r0))}var Rs={test:t0,parse:Sh,createTransformer:Eh,getAnimatableNone:n0};function al(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*(2/3-t)*6:r}function ll({hue:r,saturation:e,lightness:t,alpha:n}){r/=360,e/=100,t/=100;let i=0,s=0,a=0;if(!e)i=s=a=t;else{let l=t<.5?t*(1+e):t+e-t*e,c=2*t-l;i=al(c,l,r+1/3),s=al(c,l,r),a=al(c,l,r-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:n}}var i0=(r,e,t)=>{let n=r*r,i=e*e;return Math.sqrt(Math.max(0,t*(i-n)+n))},s0=[Rr,Ie,qe],_h=r=>s0.find(e=>e.test(r)),Ih=r=>`'${r}' is not an animatable color. Use the equivalent color code instead.`,Bs=(r,e)=>{let t=_h(r),n=_h(e);Lr(!!t,Ih(r)),Lr(!!n,Ih(e));let i=t.parse(r),s=n.parse(e);t===qe&&(i=ll(i),t=Ie),n===qe&&(s=ll(s),n=Ie);let a=Object.assign({},i);return l=>{for(let c in a)c!=="alpha"&&(a[c]=i0(i[c],s[c],l));return a.alpha=jr(i.alpha,s.alpha,l),t.transform(a)}};var Mh=r=>typeof r=="number";var o0=(r,e)=>t=>e(r(t)),qs=(...r)=>r.reduce(o0);function Th(r,e){return Mh(r)?t=>jr(r,e,t):at.test(r)?Bs(r,e):ul(r,e)}var cl=(r,e)=>{let t=[...r],n=t.length,i=r.map((s,a)=>Th(s,e[a]));return s=>{for(let a=0;a<n;a++)t[a]=i[a](s);return t}},Lh=(r,e)=>{let t=Object.assign(Object.assign({},r),e),n={};for(let i in t)r[i]!==void 0&&e[i]!==void 0&&(n[i]=Th(r[i],e[i]));return i=>{for(let s in n)t[s]=n[s](i);return t}};function Ah(r){let e=Rs.parse(r),t=e.length,n=0,i=0,s=0;for(let a=0;a<t;a++)n||typeof e[a]=="number"?n++:e[a].hue!==void 0?s++:i++;return{parsed:e,numNumbers:n,numRGB:i,numHSL:s}}var ul=(r,e)=>{let t=Rs.createTransformer(e),n=Ah(r),i=Ah(e);return n.numHSL===i.numHSL&&n.numRGB===i.numRGB&&n.numNumbers>=i.numNumbers?qs(cl(n.parsed,i.parsed),t):(As(!0,`Complex values '${r}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),a=>`${a>0?e:r}`)};var a0=(r,e)=>t=>jr(r,e,t);function l0(r){if(typeof r=="number")return a0;if(typeof r=="string")return at.test(r)?Bs:ul;if(Array.isArray(r))return cl;if(typeof r=="object")return Lh}function c0(r,e,t){let n=[],i=t||l0(r[0]),s=r.length-1;for(let a=0;a<s;a++){let l=i(r[a],r[a+1]);if(e){let c=Array.isArray(e)?e[a]:e;l=qs(c,l)}n.push(l)}return n}function u0([r,e],[t]){return n=>t(ol(r,e,n))}function h0(r,e){let t=r.length,n=t-1;return i=>{let s=0,a=!1;if(i<=r[0]?a=!0:i>=r[n]&&(s=n-1,a=!0),!a){let c=1;for(;c<t&&!(r[c]>i||c===n);c++);s=c-1}let l=ol(r[s],r[s+1],i);return e[s](l)}}function Vs(r,e,{clamp:t=!0,ease:n,mixer:i}={}){let s=r.length;Lr(s===e.length,"Both input and output ranges must be the same length"),Lr(!n||!Array.isArray(n)||n.length===s-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),r[0]>r[s-1]&&(r=[].concat(r),e=[].concat(e),r.reverse(),e.reverse());let a=c0(e,n,i),l=s===2?u0(r,a):h0(r,a);return t?c=>l(Nn(r[0],r[s-1],c)):l}var zn=r=>e=>1-r(1-e),Fs=r=>e=>e<=.5?r(2*e)/2:(2-r(2*(1-e)))/2,jh=r=>e=>Math.pow(e,r),hl=r=>e=>e*e*((r+1)*e-r),Dh=r=>{let e=hl(r);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))};var Oh=1.525,d0=4/11,p0=8/11,f0=9/10;var Uh=jh(2),N4=zn(Uh),Ph=Fs(Uh),m0=r=>1-Math.sin(Math.acos(r)),g0=zn(m0),H4=Fs(g0),Rh=hl(Oh),z4=zn(Rh),W4=Fs(Rh),G4=Dh(Oh),w0=4356/361,y0=35442/1805,v0=16061/1805,b0=r=>{if(r===1||r===0)return r;let e=r*r;return r<d0?7.5625*e:r<p0?9.075*e-9.9*r+3.4:r<f0?w0*e-y0*r+v0:10.8*r*r-20.52*r+10.72},Z4=zn(b0);function x0(r,e){return r.map(()=>e||Ph).splice(0,r.length-1)}function k0(r){let e=r.length;return r.map((t,n)=>n!==0?n/(e-1):0)}function C0(r,e){return r.map(t=>t*e)}function Wn({from:r=0,to:e=1,ease:t,offset:n,duration:i=300}){let s={done:!1,value:r},a=Array.isArray(e)?e:[r,e],l=C0(n&&n.length===a.length?n:k0(a),i);function c(){return Vs(l,a,{ease:Array.isArray(t)?t:x0(a,t)})}let u=c();return{next:d=>(s.value=u(d),s.done=d>=i,s),flipTarget:()=>{a.reverse(),u=c()}}}function Bh({velocity:r=0,from:e=0,power:t=.8,timeConstant:n=350,restDelta:i=.5,modifyTarget:s}){let a={done:!1,value:e},l=t*r,c=e+l,u=s===void 0?c:s(c);return u!==c&&(l=u-e),{next:d=>{let f=-l*Math.exp(-d/n);return a.done=!(f>i||f<-i),a.value=a.done?u:u+f,a},flipTarget:()=>{}}}var qh={keyframes:Wn,spring:Ls,decay:Bh};function Vh(r){if(Array.isArray(r.to))return Wn;if(qh[r.type])return qh[r.type];let e=new Set(Object.keys(r));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Wn:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Ls:Wn}var dl=16.666666666666668,$0=typeof performance<"u"?()=>performance.now():()=>Date.now(),pl=typeof window<"u"?r=>window.requestAnimationFrame(r):r=>setTimeout(()=>r($0()),dl);function Fh(r){let e=[],t=[],n=0,i=!1,s=!1,a=new WeakSet,l={schedule:(c,u=!1,d=!1)=>{let f=d&&i,y=f?e:t;return u&&a.add(c),y.indexOf(c)===-1&&(y.push(c),f&&i&&(n=e.length)),c},cancel:c=>{let u=t.indexOf(c);u!==-1&&t.splice(u,1),a.delete(c)},process:c=>{if(i){s=!0;return}if(i=!0,[e,t]=[t,e],t.length=0,n=e.length,n)for(let u=0;u<n;u++){let d=e[u];d(c),a.has(d)&&(l.schedule(d),r())}i=!1,s&&(s=!1,l.process(c))}};return l}var S0=40,fl=!0,Zn=!1,ml=!1,Gn={delta:0,timestamp:0},Jn=["read","update","preRender","render","postRender"],Ns=Jn.reduce((r,e)=>(r[e]=Fh(()=>Zn=!0),r),{}),E0=Jn.reduce((r,e)=>{let t=Ns[e];return r[e]=(n,i=!1,s=!1)=>(Zn||I0(),t.schedule(n,i,s)),r},{}),Nh=Jn.reduce((r,e)=>(r[e]=Ns[e].cancel,r),{}),ly=Jn.reduce((r,e)=>(r[e]=()=>Ns[e].process(Gn),r),{}),_0=r=>Ns[r].process(Gn),Hh=r=>{Zn=!1,Gn.delta=fl?dl:Math.max(Math.min(r-Gn.timestamp,S0),1),Gn.timestamp=r,ml=!0,Jn.forEach(_0),ml=!1,Zn&&(fl=!1,pl(Hh))},I0=()=>{Zn=!0,fl=!0,ml||pl(Hh)};var zh=E0;function gl(r,e,t=0){return r-e-t}function Wh(r,e,t=0,n=!0){return n?gl(e+-r,e,t):e-(r-e)+t}function Gh(r,e,t,n){return n?r>=e+t:r<=-t}var M0=r=>{let e=({delta:t})=>r(t);return{start:()=>zh.update(e,!0),stop:()=>Nh.update(e)}};function wl(r){var e,t,{from:n,autoplay:i=!0,driver:s=M0,elapsed:a=0,repeat:l=0,repeatType:c="loop",repeatDelay:u=0,onPlay:d,onStop:f,onComplete:y,onRepeat:k,onUpdate:$}=r,j=Ms(r,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:S}=j,M,x=0,E=j.duration,L,z=!1,ee=!0,ie,B=Vh(j);!((t=(e=B).needsInterpolation)===null||t===void 0)&&t.call(e,n,S)&&(ie=Vs([0,100],[n,S],{clamp:!1}),n=0,S=100);let se=B(Object.assign(Object.assign({},j),{from:n,to:S}));function de(){x++,c==="reverse"?(ee=x%2===0,a=Wh(a,E,u,ee)):(a=gl(a,E,u),c==="mirror"&&se.flipTarget()),z=!1,k&&k()}function _o(){M.stop(),y&&y()}function gt(Z){if(ee||(Z=-Z),a+=Z,!z){let oe=se.next(Math.max(0,a));L=oe.value,ie&&(L=ie(L)),z=ee?oe.done:a<=0}$?.(L),z&&(x===0&&(E??(E=a)),x<l?Gh(a,E,u,ee)&&de():_o())}function Ei(){d?.(),M=s(gt),M.start()}return i&&Ei(),{stop:()=>{f?.(),M.stop()}}}var H,Zh,Hs,Jh,zs,Kh,Yh,Xh,Ws,Gs=class Gs extends I(C){constructor(){super();p(this,H);this.product=void 0,this.labels={addToCart:"Add to cart",color:"Color",size:"Size"},this._currentImageIndex=0,this._isValidUrl=!1}willUpdate(t){t.has("product")&&m(this,H,Zh).call(this)}get images(){return this.product?.images||[]}render(){if(!this.product)return h`
|
|
1665
1665
|
<div class="my-2 w-full rounded-3xl border bg-white p-4">
|
|
1666
1666
|
<div class="relative mx-auto mb-4 max-w-[240px]">
|
|
1667
1667
|
<div class="h-[180px] w-full animate-pulse rounded-2xl bg-gray-200"></div>
|
|
@@ -1685,9 +1685,9 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1685
1685
|
<div class="pointer-events-auto mx-auto mb-4">
|
|
1686
1686
|
<div class="group relative overflow-hidden rounded-2xl">
|
|
1687
1687
|
<div class="image-slider z-0 flex transition-transform duration-300 ease-in-out" style="transform: translateX(-${this._currentImageIndex*100}%)">
|
|
1688
|
-
${this.images.length>0?_e(this.images,a=>a,(a,
|
|
1688
|
+
${this.images.length>0?_e(this.images,a=>a,(a,l)=>h`
|
|
1689
1689
|
<!-- TODO: add srcset with 1x/2x variants for high DPI displays -->
|
|
1690
|
-
<img src="${a}" alt="image ${
|
|
1690
|
+
<img src="${a}" alt="image ${l+1}: ${t}" class="h-auto w-full flex-shrink-0 object-scale-down" loading="lazy" />
|
|
1691
1691
|
`):h`
|
|
1692
1692
|
<div class="h-full w-full flex-shrink-0 object-scale-down"></div>
|
|
1693
1693
|
<svg class="rounded-lg" height="144" viewBox="0 0 100 133" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -1703,12 +1703,12 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1703
1703
|
${this.images.length>1?h`
|
|
1704
1704
|
<div class="absolute inset-0 flex items-center justify-between px-4">
|
|
1705
1705
|
<button
|
|
1706
|
-
@click="${m(this,H,
|
|
1706
|
+
@click="${m(this,H,Yh)}"
|
|
1707
1707
|
class="bg-opacity-80 hover:bg-opacity-100 absolute top-1/2 left-2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-full bg-white shadow transition-all">
|
|
1708
1708
|
<hi-outline class="block h-6 w-3" name="chevron-left"></hi-outline>
|
|
1709
1709
|
</button>
|
|
1710
1710
|
<button
|
|
1711
|
-
@click="${m(this,H,
|
|
1711
|
+
@click="${m(this,H,Kh)}"
|
|
1712
1712
|
class="bg-opacity-80 hover:bg-opacity-100 absolute top-1/2 right-2 flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-full bg-white shadow transition-all">
|
|
1713
1713
|
<hi-outline class="block h-6 w-3" name="chevron-right"></hi-outline>
|
|
1714
1714
|
</button>
|
|
@@ -1716,20 +1716,20 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1716
1716
|
`:null}
|
|
1717
1717
|
${this.images?.length>1?h`
|
|
1718
1718
|
<div class="slider-dots absolute bottom-3 left-1/2 flex -translate-x-1/2 gap-2">
|
|
1719
|
-
${this.images.map((a,
|
|
1719
|
+
${this.images.map((a,l)=>h`
|
|
1720
1720
|
<button
|
|
1721
|
-
@click="${()=>m(this,H,
|
|
1722
|
-
class="${
|
|
1721
|
+
@click="${()=>m(this,H,Xh).call(this,l)}"
|
|
1722
|
+
class="${l===this._currentImageIndex?"bg-opacity-100":"bg-opacity-60"} hover:bg-opacity-80 h-1.5 w-1.5 rounded-full bg-white transition-all"></button>
|
|
1723
1723
|
`)}
|
|
1724
1724
|
</div>
|
|
1725
1725
|
`:null}
|
|
1726
1726
|
</div>
|
|
1727
1727
|
</div>
|
|
1728
|
-
<div @click="${m(this,H,
|
|
1729
|
-
${s?h`<a @click="${m(this,H,
|
|
1728
|
+
<div @click="${m(this,H,Hs)}" class="cursor-pointer">
|
|
1729
|
+
${s?h`<a @click="${m(this,H,Hs)}" class="${this._isValidUrl?"":"pointer-events-none"} line-clamp-1 text-xs text-gray-600 hover:underline"> ${s} </a>`:null}
|
|
1730
1730
|
|
|
1731
1731
|
<h3
|
|
1732
|
-
@click="${m(this,H,
|
|
1732
|
+
@click="${m(this,H,Hs)}"
|
|
1733
1733
|
class="${this._isValidUrl?"":"pointer-events-none cursor-default"} mb-1 line-clamp-2 cursor-pointer text-lg font-semibold transition-all hover:underline">
|
|
1734
1734
|
${t||h`<span class="inline-block h-6 w-32 animate-pulse rounded bg-gray-200"></span>`}
|
|
1735
1735
|
</h3>
|
|
@@ -1739,14 +1739,14 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1739
1739
|
<!-- <div class="my-4 border-t border-gray-200"></div> -->
|
|
1740
1740
|
|
|
1741
1741
|
<!-- <button
|
|
1742
|
-
@click="${m(this,H,
|
|
1742
|
+
@click="${m(this,H,Jh)}"
|
|
1743
1743
|
?disabled="${!this._isValidUrl}"
|
|
1744
1744
|
class="${this._isValidUrl?"bg-gray-900 hover:bg-gray-800":"bg-gray-900/80 cursor-default"} w-full rounded-xl px-4 py-1.5 text-sm text-white">
|
|
1745
1745
|
${this.labels.addToCart}
|
|
1746
1746
|
</button> -->
|
|
1747
1747
|
</div>
|
|
1748
1748
|
</div>
|
|
1749
|
-
`}};H=new WeakSet,
|
|
1749
|
+
`}};H=new WeakSet,Zh=function(){if(!this.product?.url){this._isValidUrl=!1;return}try{let t=new URL(this.product.url);this._isValidUrl=t.protocol==="http:"||t.protocol==="https:"}catch{this._isValidUrl=!1}},Hs=function(t){t.preventDefault(),!(!this.product?.url||!this._isValidUrl)&&window.open(this.product.url,"_blank")},Jh=function(t){!this.product?.url||!this._isValidUrl||(window.open(this.product.url,"_blank"),this.dispatchEvent(new Gs.AddToCartEvent(this.product)))},zs=function(t,n){o(this,H,Ws)&&wl({from:t,to:n,duration:300,onUpdate:i=>{o(this,H,Ws)&&(o(this,H,Ws).style.transform=`translateX(${i}%)`)}})},Kh=function(){if(!this.product?.images?.length)return;let t=this._currentImageIndex,n=(t+1)%this.product.images.length,i=-(t*100),s=-(n*100);m(this,H,zs).call(this,i,s),this._currentImageIndex=n},Yh=function(){if(!this.product?.images?.length)return;let t=this._currentImageIndex,n=(t-1+this.product.images.length)%this.product.images.length,i=-(t*100),s=-(n*100);m(this,H,zs).call(this,i,s),this._currentImageIndex=n},Xh=function(t){if(!this.product?.images?.length)return;let n=this._currentImageIndex,i=Math.max(0,Math.min(t,this.product.images.length-1)),s=-(n*100),a=-(i*100);m(this,H,zs).call(this,s,a),this._currentImageIndex=i},Ws=function(){return this.renderRoot.querySelector(".image-slider")},w(Gs,"properties",{product:{type:Object},labels:{type:Object},_currentImageIndex:{type:Number,state:!0},_isValidUrl:{type:Boolean,state:!0}});var Kn=Gs,yl;Kn.AddToCartEvent=(yl=class extends CustomEvent{constructor(e,t={}){super(Kn.AddToCartEvent.type,{detail:{product:e},...t})}},w(yl,"type","mw-product-card:add-to-cart"),yl);customElements.get("mw-product-card")||customElements.define("mw-product-card",Kn);function Br(r){return Array.isArray(r)?r:r?[r]:[]}function Qh(r,e){let t=new Map;for(let n of r){let i=e(n);t.has(i)||t.set(i,[]),(t.get(i)||[]).push(n)}return t}var Zs=(r,e,t)=>{for(let n of e)if(n[0]===r)return(0,n[1])();return t?.()};var Js=class extends I(C){constructor(){super(),this.orderDetails=null,this.streaming=!1,this.linksNewTab=!1,this.color="#601feb"}render(){let e=Br(this.orderDetails?.order_status?.step||[]),t=Br(this.orderDetails?.items?.item||[]),n=Br(this.orderDetails?.actions||[]);return h`
|
|
1750
1750
|
<div class="flex w-full max-w-md flex-col rounded-3xl border bg-white p-4">
|
|
1751
1751
|
<!-- Header with order ID -->
|
|
1752
1752
|
<div class="mb-2">
|
|
@@ -1771,11 +1771,11 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1771
1771
|
</div>
|
|
1772
1772
|
</li>
|
|
1773
1773
|
`)}
|
|
1774
|
-
`:_e(e,i=>i.label,(i,s)=>{let a=i.status==="completed",
|
|
1775
|
-
${
|
|
1774
|
+
`:_e(e,i=>i.label,(i,s)=>{let a=i.status==="completed",l=i.status==="in_progress",c=s===e.length-1;return h`<li class="relative pb-4">
|
|
1775
|
+
${c?"":h`<div class="${`absolute left-2 top-2 -ml-px mt-0.5 h-full w-0.5 ${a?`bg-[${this.color}]`:"bg-gray-300"}`}" aria-hidden="true"></div>`}
|
|
1776
1776
|
|
|
1777
1777
|
<div class="group relative flex items-start">
|
|
1778
|
-
${
|
|
1778
|
+
${Zs(i.status,[["pending",()=>h` <span class="flex h-6 items-center">
|
|
1779
1779
|
<span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-gray-300 bg-white">
|
|
1780
1780
|
<span class="h-1.5 w-1.5 rounded-full bg-transparent"></span>
|
|
1781
1781
|
</span>
|
|
@@ -1796,7 +1796,7 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1796
1796
|
</span>`)}
|
|
1797
1797
|
|
|
1798
1798
|
<span class="ml-3 flex min-w-0 flex-col">
|
|
1799
|
-
<span class="${`text-sm font-medium ${
|
|
1799
|
+
<span class="${`text-sm font-medium ${l?`text-[${this.color}]`:a?"text-gray-900":"text-gray-500"}`}"> ${i.label} </span>
|
|
1800
1800
|
</span>
|
|
1801
1801
|
</div>
|
|
1802
1802
|
</li>`})}
|
|
@@ -1918,11 +1918,11 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1918
1918
|
|
|
1919
1919
|
<!-- Action buttons section -->
|
|
1920
1920
|
<div class="flex w-full flex-col gap-2 overflow-hidden">
|
|
1921
|
-
${this.streaming&&!n[0]?.track_order?.label&&!
|
|
1921
|
+
${this.streaming&&!n[0]?.track_order?.label&&!ra(n[0]?.track_order?.tracking_url||"")?h`
|
|
1922
1922
|
<!-- Loading shimmer for buttons -->
|
|
1923
1923
|
<div class="h-10 w-full min-w-[250px] animate-pulse overflow-hidden rounded-xl bg-gray-200"></div>
|
|
1924
1924
|
`:_e(n,(i,s)=>`action-${s}`,i=>{if(i?.track_order?.label)return h`
|
|
1925
|
-
${
|
|
1925
|
+
${ra(i.track_order?.tracking_url||"")?h` <a
|
|
1926
1926
|
target="${this.linksNewTab?"_blank":"_self"}"
|
|
1927
1927
|
href="${i.track_order?.tracking_url}"
|
|
1928
1928
|
class="mt-1 w-full rounded-xl bg-[${this.color}] px-4 py-2 text-center text-sm font-medium text-white hover:opacity-90"
|
|
@@ -1931,14 +1931,14 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1931
1931
|
`})}
|
|
1932
1932
|
</div>
|
|
1933
1933
|
</div>
|
|
1934
|
-
`}};w(
|
|
1934
|
+
`}};w(Js,"properties",{orderDetails:{type:Object,attribute:"order-details"},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},color:{type:String}});customElements.get("mw-product-order-status-card")||customElements.define("mw-product-order-status-card",Js);var A0={".section-spacing":{"@apply":"relative flex justify-center px-[25px] py-16 sm:px-9 sm:py-[45px] lg:px-24 lg:py-[104px]"}},vl=Cn({preflight:{...A0},hash:!1,darkMode:"class",theme:{extend:{fontFamily:{display:["Work Sans","sans-serif"],sans:["Inter","sans-serif"]},colors:{violet:{DEFAULT:"#601feb",50:"#f3f2ff",100:"#eae7ff",200:"#d7d2ff",300:"#baaeff",400:"#9980ff",500:"#784dff",600:"#6829fe",700:"#601feb",800:"#4b12c5",900:"#3f11a1",950:"#25086d"},pink:{DEFAULT:"#ff0bbb",50:"#fff0fc",100:"#ffe3fc",200:"#ffc6f9",300:"#ff98f2",400:"#ff58e5",500:"#ff27d5",600:"#ff0bbb",700:"#df0095",800:"#b8007b",900:"#980368",950:"#5f003b"},lime:{DEFAULT:"#b9e901",50:"#fdffe4",100:"#f9ffc5",200:"#f1ff92",300:"#e2ff54",400:"#d1fa21",500:"#b9e901",600:"#8ab400",700:"#688902",800:"#526b09",900:"#465a0d",950:"#243300"}}}},presets:[rs(),Qi(),es(),ns()],ignorelist:/^(sb-|css-|sbdocs|docblock|innerZoomElementWrapper|docs-|rejt-)/});var bl=r=>is(vl)(r);var Ks=class extends bl(C){render(){return h`
|
|
1935
1935
|
<svg width="10" height="10" viewBox="0 0 10 10" aria-hidden="true">
|
|
1936
1936
|
<g fill-rule="evenodd">
|
|
1937
1937
|
<path part="line" stroke="currentColor" fill="currentColor" d="M0 5h7"></path>
|
|
1938
1938
|
<path part="tip" stroke="currentColor" fill="transparent" d="M1 1l4 4-4 4"></path>
|
|
1939
1939
|
</g>
|
|
1940
1940
|
</svg>
|
|
1941
|
-
`}};w(
|
|
1941
|
+
`}};w(Ks,"styles",J`
|
|
1942
1942
|
:host {
|
|
1943
1943
|
--w-hover-arrow--hovered: 0;
|
|
1944
1944
|
}
|
|
@@ -1952,14 +1952,14 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1952
1952
|
transform: translateX(calc(var(--w-hover-arrow--hovered) * 3px));
|
|
1953
1953
|
transition: transform 0.3s ease-in-out;
|
|
1954
1954
|
}
|
|
1955
|
-
`);customElements.get("w-hover-arrow")||customElements.define("w-hover-arrow",
|
|
1955
|
+
`);customElements.get("w-hover-arrow")||customElements.define("w-hover-arrow",Ks);var ne,ed,td,rd,nd,id,sd,od,kl,qr=class qr extends I(C){constructor(){super();p(this,ne);this.title="",this.type="star-rating",this.color="#8B5CF6",this._hoverRating=0}render(){return h`
|
|
1956
1956
|
<div
|
|
1957
1957
|
class="focus-within:ring-opacity-50 w-full overflow-hidden rounded-[18px] bg-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.2)] transition-all duration-200 focus-within:ring-2 focus-within:ring-[${this.color}]">
|
|
1958
1958
|
<div class="flex flex-col gap-2 p-4">
|
|
1959
|
-
${
|
|
1959
|
+
${Zs(this.type,[["star-rating",()=>m(this,ne,td).call(this)],["binary-vote",()=>m(this,ne,rd).call(this)],["new-conversation-button",()=>m(this,ne,ed).call(this)]],()=>h`<span class="text-sm text-gray-500">Unsupported input type</span>`)}
|
|
1960
1960
|
</div>
|
|
1961
1961
|
</div>
|
|
1962
|
-
`}};ne=new WeakSet,
|
|
1962
|
+
`}};ne=new WeakSet,ed=function(){return h`
|
|
1963
1963
|
<button
|
|
1964
1964
|
type="button"
|
|
1965
1965
|
@click="${()=>this.dispatchEvent(new qr.SubmitEvent({type:"new-conversation-button"}))}">
|
|
@@ -1968,27 +1968,27 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
1968
1968
|
<w-hover-arrow class="text-[#8D00FF] group-hover:text-[${this.color}] group-hover:[--w-hover-arrow--hovered:1]"></w-hover-arrow>
|
|
1969
1969
|
</span>
|
|
1970
1970
|
</button>
|
|
1971
|
-
`},
|
|
1971
|
+
`},td=function(){return h`
|
|
1972
1972
|
${this.title?h`<p class="text-sm font-medium text-gray-700">${this.title}</p>`:null}
|
|
1973
1973
|
<div class="flex justify-center gap-1">
|
|
1974
1974
|
${[1,2,3,4,5].map(t=>h`
|
|
1975
1975
|
<button
|
|
1976
1976
|
type="button"
|
|
1977
|
-
@click="${()=>m(this,ne,
|
|
1978
|
-
@mouseenter="${()=>m(this,ne,
|
|
1979
|
-
@mouseleave="${m(this,ne,
|
|
1977
|
+
@click="${()=>m(this,ne,id).call(this,t)}"
|
|
1978
|
+
@mouseenter="${()=>m(this,ne,sd).call(this,t)}"
|
|
1979
|
+
@mouseleave="${m(this,ne,od)}"
|
|
1980
1980
|
class="p-1 transition-transform hover:scale-110"
|
|
1981
1981
|
aria-label="${t} star${t>1?"s":""}">
|
|
1982
|
-
${m(this,ne,
|
|
1982
|
+
${m(this,ne,nd).call(this,t)}
|
|
1983
1983
|
</button>
|
|
1984
1984
|
`)}
|
|
1985
1985
|
</div>
|
|
1986
|
-
`},
|
|
1986
|
+
`},rd=function(){return h`
|
|
1987
1987
|
${this.title?h`<p class="text-sm font-medium text-gray-700">${this.title}</p>`:null}
|
|
1988
1988
|
<div class="flex justify-center gap-4">
|
|
1989
1989
|
<button
|
|
1990
1990
|
type="button"
|
|
1991
|
-
@click="${()=>m(this,ne,
|
|
1991
|
+
@click="${()=>m(this,ne,kl).call(this,"negative")}"
|
|
1992
1992
|
class="flex flex-col items-center gap-1 rounded-lg border-2 border-gray-300 p-1 transition-all hover:border-red-400">
|
|
1993
1993
|
<svg class="h-6 w-6 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
1994
1994
|
<path
|
|
@@ -2000,7 +2000,7 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
2000
2000
|
</button>
|
|
2001
2001
|
<button
|
|
2002
2002
|
type="button"
|
|
2003
|
-
@click="${()=>m(this,ne,
|
|
2003
|
+
@click="${()=>m(this,ne,kl).call(this,"positive")}"
|
|
2004
2004
|
class="flex flex-col items-center gap-1 rounded-lg border-2 border-gray-300 p-1 transition-all hover:border-green-400">
|
|
2005
2005
|
<svg class="h-6 w-6 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
2006
2006
|
<path
|
|
@@ -2011,7 +2011,7 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
2011
2011
|
</svg>
|
|
2012
2012
|
</button>
|
|
2013
2013
|
</div>
|
|
2014
|
-
`},
|
|
2014
|
+
`},nd=function(t){let n=t<=this._hoverRating;return h`
|
|
2015
2015
|
<svg class="${n?"text-yellow-400":"text-gray-300"} h-6 w-6" fill="${n?"currentColor":"none"}" stroke="currentColor" viewBox="0 0 24 24">
|
|
2016
2016
|
<path
|
|
2017
2017
|
stroke-linecap="round"
|
|
@@ -2019,10 +2019,10 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
2019
2019
|
stroke-width="2"
|
|
2020
2020
|
d="M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z" />
|
|
2021
2021
|
</svg>
|
|
2022
|
-
`},
|
|
2022
|
+
`},id=function(t){this._hoverRating=0,this.dispatchEvent(new qr.SubmitEvent({type:"star-rating",rating:t}))},sd=function(t){this._hoverRating=t},od=function(){this._hoverRating=0},kl=function(t){this.dispatchEvent(new qr.SubmitEvent({type:"binary-vote",vote:t}))},w(qr,"properties",{title:{type:String},type:{type:String},color:{type:String},_hoverRating:{type:Number,state:!0}});var Yn=qr,xl;Yn.SubmitEvent=(xl=class extends CustomEvent{constructor(e,t={}){super(Yn.SubmitEvent.type,{detail:e,bubbles:!0,composed:!0,...t})}},w(xl,"type","mw-request-input:submit"),xl);customElements.get("mw-request-input")||customElements.define("mw-request-input",Yn);var Xn=class extends br{constructor(e){if(super(e),this.it=W,e.type!==os.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===W||e==null)return this._t=void 0,this.it=e;if(e===Ae)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};Xn.directiveName="unsafeHTML",Xn.resultType=1;var ad=as(Xn);var ld=Bc(ze({name:X(),description:X(),price:X(),image_url:fr([X(),dr(X())]),category:X(),url:X()}));function cd(r,e,t,{imagesByProductUrl:n,linksNewTab:i=!0,searchParams:s,messageIsStreaming:a=!1,isSupportAgent:l,color:c="#601feb",apiBaseUrl:u=""}){if(!r)return h``;let d=e>0&&t[e-1]&&"data"in t[e-1],f=e<t.length-1||!a;if("text"in r)return h`<p>${r.text}</p>`;if("html"in r)return h`${ad(r.html)}`;if("data"in r)switch(r.tag){case"product-card":case"product-card-v1":case"product-card-horizontal":{let y=vn(ld,r.data);if(y.success){let k={...y.output,images:[]};return k.images=Br(k.image_url),h`
|
|
2023
2023
|
${d?h`<div class="my-3 w-full border-t border-gray-200/50"></div>`:null}
|
|
2024
2024
|
<mw-product-card-horizontal
|
|
2025
|
-
product="${JSON.stringify(
|
|
2025
|
+
product="${JSON.stringify(k)}"
|
|
2026
2026
|
?streaming="${!f}"
|
|
2027
2027
|
?links-new-tab="${i}"
|
|
2028
2028
|
.searchParams="${s}"
|
|
@@ -2031,7 +2031,7 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
2031
2031
|
order-details="${JSON.stringify(r.data)}"
|
|
2032
2032
|
?streaming="${!f}"
|
|
2033
2033
|
?links-new-tab="${i}"
|
|
2034
|
-
color="${
|
|
2034
|
+
color="${c}"></mw-product-order-status-card> `;case"live-chat-wait-card-v1":{let y=r.data||{};return l?h`<p><i>${y.message}</i></p>`:h`<mw-chat-wait-timer
|
|
2035
2035
|
heading="${y.title||""}"
|
|
2036
2036
|
message="${y.message||""}"
|
|
2037
2037
|
completeMessage="${y.completeMessage||""}"
|
|
@@ -2043,35 +2043,35 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
2043
2043
|
result-prefix="${y.resultPrefix||""}"
|
|
2044
2044
|
correct-button-text="${y.correctButtonText||"Correct"}"
|
|
2045
2045
|
wrong-button-text="${y.wrongButtonText||"Wrong"}"
|
|
2046
|
-
color="${
|
|
2047
|
-
apiBaseUrl="${
|
|
2046
|
+
color="${c}"
|
|
2047
|
+
apiBaseUrl="${u}"></mw-chat-wait-timer>`}case"request-input-v1":return h``}return console.warn("could not render part:",r),h`<p><i>data type not supported</i></p>`}var Qn,Vr,lt,qt,Xs,ud,Ys=class{constructor(e,t,{timeoutMs:n=2e3}={}){p(this,Xs);p(this,Qn);p(this,Vr);p(this,lt);p(this,qt,!1);w(this,"timeoutMs");g(this,Qn,e),g(this,Vr,t),this.timeoutMs=n,e.addController(this)}get isTyping(){return o(this,qt)}hostDisconnected(){clearTimeout(o(this,lt)),g(this,lt,void 0)}onInput(e){if(o(this,Qn).isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(o(this,lt)),g(this,lt,setTimeout(()=>this.typingStopped(),this.timeoutMs)),o(this,qt)||m(this,Xs,ud).call(this)}}typingStopped(){clearTimeout(o(this,lt)),g(this,qt,!1),o(this,Vr).typingStopped()}};Qn=new WeakMap,Vr=new WeakMap,lt=new WeakMap,qt=new WeakMap,Xs=new WeakSet,ud=function(){g(this,qt,!0),o(this,Vr).typingStarted()};function hd(r,e="en-US"){let t=new Intl.DateTimeFormat(e,{hour:"numeric",minute:"numeric"}).format(r);return`${r.toLocaleDateString(e,{year:"numeric",month:"short",day:"numeric"})}, ${t}`}function dd(r){r?.body?.cancel().catch(console.warn)}var ct,Ve,$l,ei,Cl=class{constructor(e=window.localStorage){p(this,Ve);p(this,ct);g(this,ct,e)}setex(e,t,n){return o(this,ct).setItem(e,m(this,Ve,ei).call(this,{value:m(this,Ve,ei).call(this,t),expiresAt:Date.now()+n*1e3})||"")}set(e,t){return o(this,ct).setItem(e,m(this,Ve,ei).call(this,{value:m(this,Ve,ei).call(this,t)})||"")}get(e){let t=o(this,ct).getItem(e);if(!t)return;let n=m(this,Ve,$l).call(this,t);if(n){if(n.expiresAt&&n.expiresAt<Date.now()){o(this,ct).removeItem(e);return}return m(this,Ve,$l).call(this,n.value)}}get molin_shop_assistant_distinct_id(){return localStorage.getItem("molin_shop_assistant_distinct_id")}set molin_shop_assistant_distinct_id(e){e===null?localStorage.removeItem("molin_shop_assistant_distinct_id"):localStorage.setItem("molin_shop_assistant_distinct_id",e)}get molin_widget_open_state(){return xe.get("molin-shop-ai-widget-open")??null}set molin_widget_open_state(e){xe.set("molin-shop-ai-widget-open",e)}resetWidgetData(){xe.molin_shop_assistant_distinct_id=null,xe.molin_widget_open_state=null}};ct=new WeakMap,Ve=new WeakSet,$l=function(e){if(!(typeof e!="string"||e===""))try{return JSON.parse(e)}catch{return}},ei=function(e){if(e!==void 0)try{return JSON.stringify(e)}catch{return}};var xe=new Cl;var he,Ke,Qs,ti,Fr,Sl=class{constructor(){p(this,he,[]);p(this,Ke);p(this,Qs,10);p(this,ti,5e3);p(this,Fr,!1)}async add(e,t){if(o(this,he).push(md(e,t)),o(this,he).length>=o(this,Qs))return this.flush();o(this,Ke)||g(this,Ke,setTimeout(()=>{this.flush().catch(console.error)},o(this,ti)))}async flush(){if(o(this,Fr)||o(this,he).length===0)return;let e=[...o(this,he)];try{g(this,Fr,!0),clearTimeout(o(this,Ke)),g(this,Ke,void 0),g(this,he,[]);let t=new AbortController,n=setTimeout(()=>t.abort(),5e3);await fd(e,{signal:t.signal}),clearTimeout(n)}catch(t){if(t.name==="AbortError")console.error("Request timed out, retrying events"),g(this,he,[...e,...o(this,he)]);else{console.error("Failed to send events to backend:",t);let n=e.filter(i=>i.event.includes("error"));g(this,he,[...n,...o(this,he)])}}finally{g(this,Fr,!1),o(this,he).length>0&&!o(this,Ke)&&g(this,Ke,setTimeout(()=>{this.flush().catch(console.error)},o(this,ti)))}}async flushBeforeUnload(){if(o(this,he).length>0)try{let e=new FormData;e.set("events",JSON.stringify(o(this,he))),navigator.sendBeacon(new URL("/widgets/data/collect",eo()).href,e)}catch(e){console.error("Failed to send final events:",e)}}};he=new WeakMap,Ke=new WeakMap,Qs=new WeakMap,ti=new WeakMap,Fr=new WeakMap;var pd=new Sl;window.addEventListener("beforeunload",()=>{pd.flushBeforeUnload().catch(console.error)});async function F(r,e,t){if(typeof r!="string")throw new TypeError("Event name must be a string");if(typeof e!="object"||e===null)throw new TypeError("Properties must be an object");try{if(r==="ShopAssistant: user clicked link"&&j0("molin_link_click",e),t?.immediate){await fd([md(r,e)]);return}else return pd.add(r,e)}catch(n){console.error("Failed to send event:",n)}}async function fd(r,{signal:e}={}){let t=new FormData;t.set("events",JSON.stringify(r));let n=await fetch(new URL("/widgets/data/collect",eo()),{method:"POST",body:t,signal:e});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);dd(n)}function md(r,e){return{event:r,widget_id:e.widgetId,properties:Object.assign({},e,L0()),distinct_id:T0(),timestamp:new Date().toISOString()}}function T0(){try{let r=xe.molin_shop_assistant_distinct_id;return r||(r=crypto.randomUUID(),xe.molin_shop_assistant_distinct_id=r),r}catch(r){console.error("Failed to deserialize distinct_id:",r);let e=crypto.randomUUID();try{xe.molin_shop_assistant_distinct_id=e}catch(t){console.error("Failed to store new distinct_id:",t)}return e}}function L0(){return{referrer:document.referrer,userAgent:navigator.userAgent,language:navigator.language,screenWidth:window.innerWidth,screenHeight:window.innerHeight,timestamp:new Date().toISOString(),timezoneOffset:new Date().getTimezoneOffset(),doNotTrack:navigator.doNotTrack??void 0}}function eo(){let r=new URL(import.meta.url).hostname;return{localhost:"http://localhost:8787","molin.localhost":"http://molin.localhost:8787","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai","molin.ai":"https://molin.ai","molin.foo":"https://molin.foo"}[r]||"https://molin.ai"}function j0(r,e){try{window.dataLayer=window.dataLayer||[];let t={event:r,link_url:e.url};window.dataLayer.push(t)}catch(t){console.error("Failed to send event to dataLayer:",t)}}var Vt,ri,ut,Ft,ro,wd,to=class{constructor(e,t,n){p(this,ro);p(this,Vt);p(this,ri);p(this,ut);p(this,Ft);w(this,"isLoading",!1);w(this,"data");g(this,Vt,e),g(this,ri,t),g(this,ut,n),e.addController(this)}fetch(){if(this.isLoading)return;o(this,Ft)?.abort();let e=new AbortController;g(this,Ft,e),this.isLoading=!0,this.data=void 0,o(this,Vt).requestUpdate(),(async()=>{let t=m(this,ro,wd).call(this);return t.signal?.addEventListener("abort",()=>e.abort(),{signal:e.signal}),fetch(t,{signal:e.signal})})().then(async t=>{if(!t.ok)throw new Error(`${t.statusText}: ${await t.text()}`);this.isLoading=!1,this.data=typeof o(this,ut)?.transform=="function"?await o(this,ut).transform(t):t,o(this,Vt).requestUpdate()}).catch(t=>{o(this,ut)?.onError?.(t),this.isLoading=!1,this.data=void 0,o(this,Vt).requestUpdate()}).finally(()=>{e.abort()})}hostConnected(){this.isLoading||o(this,ut)?.fetchWhenConnected&&this.fetch()}hostDisconnected(){o(this,Ft)?.abort(),g(this,Ft,void 0)}};Vt=new WeakMap,ri=new WeakMap,ut=new WeakMap,Ft=new WeakMap,ro=new WeakSet,wd=function(){let e=o(this,ri);if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)};function ht(){return window.molinSettings&&typeof window.molinSettings=="object"?window.molinSettings:null}var no,si,io,Ye,yd,ni,ii=class ii extends I(C){constructor(){super();p(this,Ye);p(this,no,new dt(this,{onError:console.error}));p(this,si);p(this,io,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),F("ShopAssistant: error",{...t},{immediate:!0})},onNewMessageStartedStreaming:t=>{F("ShopAssistant: user received bot message (streaming started)",t)},onMessageEndedStreaming:t=>{F("ShopAssistant: user received bot message (streaming ended)",t)},onUserCanceledStreaming:t=>{F("ShopAssistant: user canceled streaming",t)},onUserClickedLink:t=>{F("ShopAssistant: user clicked link",t)},onUserSentInput:t=>{F("ShopAssistant: user sent input",t)}});this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1,this.xUserData=ht()?.userData,this.xCustomInstructions=ht()?.customInstructions}get config(){return o(this,si)||o(this,no).data}render(){return this.config?h`
|
|
2048
2048
|
<mw-context-widget
|
|
2049
2049
|
.widgetId="${this.widgetId}"
|
|
2050
2050
|
.config="${this.config}"
|
|
2051
|
-
.callbacks="${o(this,
|
|
2051
|
+
.callbacks="${o(this,io)}"
|
|
2052
2052
|
.xUserData="${this.xUserData}"
|
|
2053
2053
|
.xCustomInstructions="${this.xCustomInstructions}"
|
|
2054
2054
|
autoConnect>
|
|
2055
2055
|
<!-- embed our chat component forwarding props -->
|
|
2056
|
-
<mw-chat ?show-close="${this.showClose}" @mw:close-click="${m(this,Ye,
|
|
2056
|
+
<mw-chat ?show-close="${this.showClose}" @mw:close-click="${m(this,Ye,yd)}">
|
|
2057
2057
|
<slot name="banner" slot="banner"></slot>
|
|
2058
2058
|
</mw-chat>
|
|
2059
2059
|
</mw-context-widget>
|
|
2060
|
-
`:null}injectConfig(t){g(this,si,t),this.requestUpdate()}reloadConfig(){o(this,Ye,ni)?.reloadConfig()}reset(){this.xUserData={},this.xCustomInstructions="",o(this,Ye,ni)?.reset(),this.requestUpdate()}get conversationId(){return o(this,Ye,ni)?.conversationId??""}get messages(){return o(this,Ye,ni)?.messages??[]}};
|
|
2060
|
+
`:null}injectConfig(t){g(this,si,t),this.requestUpdate()}reloadConfig(){o(this,Ye,ni)?.reloadConfig()}reset(){this.xUserData={},this.xCustomInstructions="",o(this,Ye,ni)?.reset(),this.requestUpdate()}get conversationId(){return o(this,Ye,ni)?.conversationId??""}get messages(){return o(this,Ye,ni)?.messages??[]}};no=new WeakMap,si=new WeakMap,io=new WeakMap,Ye=new WeakSet,yd=function(){this.dispatchEvent(new ii.CloseClickEvent)},ni=function(){return this.renderRoot.querySelector("mw-chat")},w(ii,"styles",J`
|
|
2061
2061
|
:host {
|
|
2062
2062
|
all: initial; /* reset all properties that can pierce the shadow DOM */
|
|
2063
2063
|
}
|
|
2064
|
-
`),w(ii,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"},xUserData:{type:Object,attribute:!1},xCustomInstructions:{type:String,attribute:!1}});var Nt=ii;customElements.get("molin-shop-ai-chat")||customElements.define("molin-shop-ai-chat",Nt);var
|
|
2064
|
+
`),w(ii,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},showClose:{type:Boolean,attribute:"show-close"},xUserData:{type:Object,attribute:!1},xCustomInstructions:{type:String,attribute:!1}});var Nt=ii;customElements.get("molin-shop-ai-chat")||customElements.define("molin-shop-ai-chat",Nt);var El;Nt.CloseClickEvent=(El=class extends CustomEvent{constructor(e={}){super(Nt.CloseClickEvent.type,{...e})}},w(El,"type","mw:close-click"),El);var _l=class{constructor({hidden:e=!1}){w(this,"hidden");this.hidden=e}setUserData(e){for(let t of document.querySelectorAll("molin-shop-ai"))e?t.setAttribute("user-data",JSON.stringify(e)):t.removeAttribute("user-data");for(let t of document.querySelectorAll("molin-shop-ai-chat"))e?t.setAttribute("user-data",JSON.stringify(e)):t.removeAttribute("user-data")}setCustomInstructions(e){for(let t of document.querySelectorAll("molin-shop-ai"))e?t.setAttribute("custom-instructions",e):t.removeAttribute("custom-instructions");for(let t of document.querySelectorAll("molin-shop-ai-chat"))e?t.setAttribute("custom-instructions",e):t.removeAttribute("custom-instructions")}showLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof je&&e.showLauncher()}hideLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof je&&e.hideLauncher()}openChat(e){let{message:t,autoSend:n}=e||{};for(let i of document.querySelectorAll("molin-shop-ai"))i instanceof je&&i.openChat({message:t,autoSend:n})}closeChat(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof je&&e.closeChat()}reset(){xe.resetWidgetData();for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof je&&e.reset();for(let e of document.querySelectorAll("molin-shop-ai-chat"))e instanceof Nt&&e.reset()}};function vd({hidden:r}){let e=new _l({hidden:r});return window.Molin=e,e}function so(){let r=window.Molin;if(!r)throw new Error("window.Molin global not initialized");return r}window.__INIT_MOLIN_SHOP_AI=function(e){D0(e);let t=ht(),n=typeof t?.hidden=="boolean"?t.hidden:window.self!==window.top;if(vd({hidden:n}),e.auto){let i=document.createElement("molin-shop-ai");i.setAttribute("cdn",e.cdn),i.setAttribute("widget",e.widgetId),document.body.appendChild(i)}};function D0(r){window.__INIT_MOLIN_SHOP_AI_OPTIONS=r}function bd(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var Me,oi,Nr,Hr,dt=class{constructor(e,t){p(this,Me);p(this,oi);p(this,Nr);p(this,Hr);g(this,Me,e),g(this,oi,t),e.addController(this)}get data(){return o(this,Hr)||o(this,Nr)?.data}hostConnected(){if(o(this,Nr)||o(this,Hr))return;let e=bd();e&&e.widgetId===o(this,Me).widgetId?g(this,Hr,e.config):g(this,Nr,new to(o(this,Me),()=>{if(o(this,Me).cdn&&o(this,Me).widgetId)return`${o(this,Me).cdn}/config?w=${o(this,Me).widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:async t=>{let n=await t.json();return n&&!e&&window.__INIT_MOLIN_SHOP_AI({cdn:o(this,Me).cdn,widgetId:o(this,Me).widgetId,config:n}),n},onError:o(this,oi)?.onError}))}};Me=new WeakMap,oi=new WeakMap,Nr=new WeakMap,Hr=new WeakMap;function xd(){let r=new URL(import.meta.url).hostname;return{localhost:"http://uploads.molin.localhost:8787","molin.localhost":"http://uploads.molin.localhost:8787","widget.molin.foo":"https://widget.molin.foo","widget.molin.ai":"https://widget.molin.ai","molin.ai":"https://widget.molin.ai","molin.foo":"https://widget.molin.foo"}[r]||"https://widget.molin.ai"}var O0="\xB7 \xB7 \xB7",U0=["star-rating","binary-vote","new-conversation-button"],A,De,li,ce,zr,ci,oo,ui,hi,di,D,kd,Cd,ao,$d,Sd,Ed,Ml,_d,Id,Md,Ht,Ad,P0,pt,lo=class lo extends I(C){constructor(){super();p(this,D);p(this,A,Gc(this));p(this,De,[]);p(this,li,new Ys(this,{typingStarted:()=>o(this,A).value?.sendUserTypingStart(),typingStopped:()=>o(this,A).value?.sendUserTypingStop()}));p(this,ce,new fs(this,{onImageDelete:t=>{if(!o(this,A).value){console.warn("widget context not available, cannot delete image");return}o(this,A).value.sendImageDelete(t),o(this,D,pt)?.focus()},uploadUrl:new URL("/v1/uploads",xd()).href,onConnect:()=>{o(this,A).value?.connect()}}));p(this,zr,"single");p(this,ci,null);p(this,oo,t=>{let n=t,{pendingImages:i}=n.detail;Array.isArray(i)&&o(this,ce).restoreImages(i)});p(this,ui,t=>{let n=t,{questionIndex:i,question:s,answer:a,totalQuestions:l}=n.detail;this.callbacks.onWaitGameQuestionAnswered?.({widgetId:this.widgetId,conversationId:this.conversationId,questionIndex:i,question:s,answer:a,totalQuestions:l})});p(this,hi,t=>{let n=t,{guessedProfession:i,questionCount:s}=n.detail;this.callbacks.onWaitGameCompleted?.({widgetId:this.widgetId,conversationId:this.conversationId,guessedProfession:i,questionCount:s})});p(this,di,t=>{let n=t,{guessedProfession:i,isCorrect:s,questionCount:a}=n.detail;this.callbacks.onWaitGameGuessValidated?.({widgetId:this.widgetId,conversationId:this.conversationId,guessedProfession:i,isCorrect:s,questionCount:a})});p(this,ao,rr({interval:200},async t=>{Ce(o(this,A).value,"widget context is required"),await o(this,A).value.enqueueUserInput(t,{xUserData:o(this,A).value?.xUserData,xCustomInstructions:o(this,A).value?.xCustomInstructions})&&(o(this,D,pt)?.setValue(""),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:t,example:!0,conversationId:this.conversationId}))}));w(this,"sendMessage",rr({interval:200},async t=>{if(!t?.trim())return console.warn("sendMessage: Message must be a non-empty string"),!1;Ce(o(this,A).value,"Widget context is required");let{value:n}=o(this,A),i=await n.enqueueUserInput(t,{xUserData:n.xUserData,xCustomInstructions:n.xCustomInstructions,role:"user",expectStreaming:!0});return i&&o(this,D,pt)?.setValue(""),i??!1}));this.showClose=!1,this._currentRequestInputIndex=0}get conversationId(){return o(this,A).value?.conversationId||""}get messages(){return o(this,A).value?.messages||[]}get config(){return o(this,A).value?.config}get callbacks(){return o(this,A).value?.callbacks||{}}get widgetId(){return o(this,A).value?.widgetId||""}get typingIndicator(){return o(this,A).value?.typingIndicator}get isStreaming(){return o(this,A).value?.isStreaming}get ranOutOfCredits(){return o(this,A).value?.ranOutOfCredits}get isLiveMode(){return o(this,A).value?.isLiveMode}get lastMsg(){return o(this,A).value?.lastMsg}get hasQueuedMessages(){return o(this,A).value?.hasQueuedMessages}firstUpdated(){document.addEventListener("mw-context-widget:connected",o(this,oo),{once:!0}),this.addEventListener("mw-chat-wait-game:question-answered",o(this,ui)),this.addEventListener("mw-chat-wait-game:game-completed",o(this,hi)),this.addEventListener("mw-chat-wait-game:guess-validated",o(this,di))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("mw-chat-wait-game:question-answered",o(this,ui)),this.removeEventListener("mw-chat-wait-game:game-completed",o(this,hi)),this.removeEventListener("mw-chat-wait-game:guess-validated",o(this,di))}updated(){let t=this.lastMsg?.id;t&&t!==o(this,ci)&&(g(this,ci,t),this._currentRequestInputIndex=0),o(this,A).value?.widgetId&&this.config?.enableImageUpload&&o(this,ce).updateUploadOptions({conversationId:this.conversationId,widgetId:o(this,A).value?.widgetId,enabled:this.config?.enableImageUpload,isConnected:()=>o(this,A).value?.isConnected()??!1,onConnect:()=>{o(this,A).value?.connect()}})}render(){Ce(this.config,"config is required");let t=Qh(this.messages,s=>{try{let a=new Date(s.timestamp),l=Math.floor(a.getUTCMinutes()/5)*5;return a.setUTCMinutes(l,0,0),a.valueOf().toString()}catch(a){console.error(a)}}),n=Math.max(0,Math.min(this._currentRequestInputIndex,o(this,D,Ht).length-1)),i=o(this,D,Ht)[n];return h`
|
|
2065
2065
|
<div class="relative mx-auto h-full bg-[#FDFDFD] font-sans text-base before:absolute before:inset-0 before:bg-[#8d8d8d] before:opacity-10 sm:rounded-[36px] sm:p-1.5 sm:before:rounded-[36px]">
|
|
2066
2066
|
<div
|
|
2067
2067
|
class="relative flex h-full flex-col bg-white shadow-[0px_4px_4px_0px_rgba(0,0,0,0.25),-116px_177px_59px_0px_rgba(0,0,0,0.00),-74px_113px_54px_0px_rgba(0,0,0,0.01),-42px_64px_46px_0px_rgba(0,0,0,0.03),-19px_28px_34px_0px_rgba(0,0,0,0.06)] sm:rounded-[30px]">
|
|
2068
2068
|
<mw-chat-header
|
|
2069
2069
|
class="absolute top-1.5 right-1.5 left-1.5"
|
|
2070
2070
|
.content="${{logoUrl:this.config.logoUrl,title:this.config.title,color:this.config.color}}"
|
|
2071
|
-
?show-new-chat="${!this.isLiveMode&&this.messages.length>0&&!o(this,D,
|
|
2071
|
+
?show-new-chat="${!this.isLiveMode&&this.messages.length>0&&!o(this,D,Ad)}"
|
|
2072
2072
|
?show-close="${this.showClose}"
|
|
2073
|
-
@mw:new-chat-click="${m(this,D,
|
|
2074
|
-
@mw:close-click="${m(this,D,
|
|
2073
|
+
@mw:new-chat-click="${m(this,D,Ml)}"
|
|
2074
|
+
@mw:close-click="${m(this,D,_d)}">
|
|
2075
2075
|
</mw-chat-header>
|
|
2076
2076
|
|
|
2077
2077
|
<!-- used by the dashboard to inject content -->
|
|
@@ -2101,30 +2101,30 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
2101
2101
|
<!-- the padding at the top makes empty room at the top when scrolling and content is hidden behind header -->
|
|
2102
2102
|
<!-- this is the 2nd (inner) div that will natively stick/scroll to bottom -->
|
|
2103
2103
|
<div class="${this.messages.length>0?"pt-20":""}">
|
|
2104
|
-
${_e(Array.from(t),([
|
|
2105
|
-
<div class="my-2 text-center text-xs text-gray-500">${
|
|
2106
|
-
${_e(
|
|
2107
|
-
${
|
|
2108
|
-
<div data-id="${
|
|
2104
|
+
${_e(Array.from(t),([s])=>s,([s,a])=>h`
|
|
2105
|
+
<div class="my-2 text-center text-xs text-gray-500">${hd(new Date(Number(s)),window.navigator.language)}</div>
|
|
2106
|
+
${_e(a??[],l=>l.id,(l,c)=>{let d=a[c+1]?.role===l.role,y=(c>0?a[c-1]:void 0)?.role===l.role,$=(a.length>0?a[a.length-1]:void 0)?.id===l.id;g(this,zr,$&&!y&&!d?"single-current":!y&&!d?"single":!y&&d?"first":$&&y&&!d?"last-current":y&&!d?"last":y&&d?"middle":"single");let S=this.isLiveMode&&l.role==="user"&&l.id===this.lastMsg?.id?"sent":"",M=(l.content.includes("<request-input-v1>")||!l.content)&&l.parts?.every(x=>"data"in x&&x.tag==="request-input-v1");return h`
|
|
2107
|
+
${l.images?_e(l.images,x=>x,x=>h`
|
|
2108
|
+
<div data-id="${l.id}" class="${d?"mb-[1px]":"mb-3"} mr-2 ml-[15px] flex-row">
|
|
2109
2109
|
<mw-chat-image
|
|
2110
|
-
src="${
|
|
2110
|
+
src="${x}"
|
|
2111
2111
|
alt="User uploaded image"
|
|
2112
|
-
.side="${
|
|
2112
|
+
.side="${l.role==="user"?"right":"left"}"
|
|
2113
2113
|
position=${o(this,zr)}
|
|
2114
2114
|
width="300px"></mw-chat-image>
|
|
2115
2115
|
</div>
|
|
2116
2116
|
`):null}
|
|
2117
|
-
${(
|
|
2117
|
+
${(l.content||l.parts)&&!M?h` <div data-id="${l.id}" class="${d?"mb-[1px]":"mb-3"} mx-2 flex-row">
|
|
2118
2118
|
<mw-chat-message
|
|
2119
2119
|
.color="${this.config?.color}"
|
|
2120
2120
|
status="${S}"
|
|
2121
|
-
logo="${
|
|
2122
|
-
side="${
|
|
2121
|
+
logo="${l.metadata?.avatar||this.config?.logoUrl}"
|
|
2122
|
+
side="${l.role}"
|
|
2123
2123
|
position=${o(this,zr)}
|
|
2124
|
-
@click="${m(this,D,
|
|
2124
|
+
@click="${m(this,D,kd)}">
|
|
2125
2125
|
<div
|
|
2126
2126
|
class="prose prose-h1:first:mt-0 prose-h2:first:mt-0 prose-h3:first:mt-0 prose-h4:first:mt-0 prose-h1:last:mb-0 prose-h2:last:mb-0 prose-h3:last:mb-0 prose-h4:last:mb-0 prose-h1:mt-5 prose-h2:mt-5 prose-h3:mt-5 prose-h4:mt-5 prose-h1:mb-2 prose-h2:mb-2 prose-h3:mb-2 prose-h4:mb-2 prose-h1:text-xl prose-h1:text-bold prose-h2:text-lg prose-h2:text-bold prose-h3:text-base prose-h3:text-bold prose-h4:text-sm prose-h4:text-bold break-words text-inherit">
|
|
2127
|
-
${
|
|
2127
|
+
${l.content===O0?h`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config?.color}]"></mw-loading>`:l.parts?_e(l.parts,(x,E)=>E,(x,E)=>cd(x,E,l.parts??[],{imagesByProductUrl:l.metadata?.imagesByProductUrl,linksNewTab:this.config?.linksNewTab??!0,searchParams:this.config?.disableUtmInjection?void 0:new URLSearchParams({utm_source:"molin.ai",utm_medium:"chat",utm_campaign:"general"}),messageIsStreaming:l.streaming,color:this.config?.color,apiBaseUrl:eo()})):h`<p>${l.content}</p>`}
|
|
2128
2128
|
</div>
|
|
2129
2129
|
</mw-chat-message>
|
|
2130
2130
|
</div>`:null}
|
|
@@ -2146,7 +2146,7 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
2146
2146
|
class="flex-grow"
|
|
2147
2147
|
.examples="${this.messages.length>0?[]:this.config.examples}"
|
|
2148
2148
|
color="${this.config.color}"
|
|
2149
|
-
@mw:example-click="${m(this,D,
|
|
2149
|
+
@mw:example-click="${m(this,D,Cd)}"></mw-chat-background>
|
|
2150
2150
|
</div>
|
|
2151
2151
|
|
|
2152
2152
|
${this.messages.length===0&&this.config.disclaimerFloating?h`
|
|
@@ -2162,11 +2162,11 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
2162
2162
|
<mw-disclaimer .text="${this.config.disclaimer}" .color="${this.config.color}"></mw-disclaimer>
|
|
2163
2163
|
</div>
|
|
2164
2164
|
`:null}
|
|
2165
|
-
${o(this,D,Ht).length===0
|
|
2165
|
+
${o(this,D,Ht).length===0?h`
|
|
2166
2166
|
<mw-chat-input
|
|
2167
|
-
@mw:change="${m(this,D
|
|
2168
|
-
@mw:submit="${m(this,D
|
|
2169
|
-
@mw:cancel="${m(this,D,
|
|
2167
|
+
@mw:change="${m(this,D,Sd)}"
|
|
2168
|
+
@mw:submit="${m(this,D,$d)}"
|
|
2169
|
+
@mw:cancel="${m(this,D,Ed)}"
|
|
2170
2170
|
placeholder="${this.config?.input?.placeholder??""}"
|
|
2171
2171
|
?disabled="${this.ranOutOfCredits||this.hasQueuedMessages||o(this,ce).hasPendingImages}"
|
|
2172
2172
|
?streaming="${this.isStreaming??!0}"
|
|
@@ -2179,10 +2179,10 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
2179
2179
|
</mw-chat-input>
|
|
2180
2180
|
`:h`
|
|
2181
2181
|
<mw-request-input
|
|
2182
|
-
.title="${
|
|
2183
|
-
.type="${
|
|
2182
|
+
.title="${i?.title}"
|
|
2183
|
+
.type="${i?.type}"
|
|
2184
2184
|
.color="${this.config?.color??"#8B5CF6"}"
|
|
2185
|
-
@mw-request-input:submit="${m(this,D,
|
|
2185
|
+
@mw-request-input:submit="${m(this,D,Id)}">
|
|
2186
2186
|
</mw-request-input>
|
|
2187
2187
|
`}
|
|
2188
2188
|
${this.config.removePoweredBy?this.config.disclaimer?h`
|
|
@@ -2199,13 +2199,13 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
2199
2199
|
</div>
|
|
2200
2200
|
</div>
|
|
2201
2201
|
</div>
|
|
2202
|
-
`}reloadConfig(){o(this,A).value?.reloadConfig(),this.requestUpdate()}setInputValue(t){if(!t||typeof t!="string"){console.warn("setInputValue requires a valid string value");return}let n=o(this,D,pt);if(!n){console.warn("input element not found, cannot set value");return}n.setValue?n.setValue(t):console.warn("input element does not have setValue method")}focusInput(){window.requestAnimationFrame(()=>{o(this,D,pt)?.focus()})}reset(){o(this,ce).clearImages(),this._currentRequestInputIndex=0,g(this,De,[]),o(this,A).value?.reset()}};A=new WeakMap,De=new WeakMap,li=new WeakMap,ce=new WeakMap,zr=new WeakMap,
|
|
2202
|
+
`}reloadConfig(){o(this,A).value?.reloadConfig(),this.requestUpdate()}setInputValue(t){if(!t||typeof t!="string"){console.warn("setInputValue requires a valid string value");return}let n=o(this,D,pt);if(!n){console.warn("input element not found, cannot set value");return}n.setValue?n.setValue(t):console.warn("input element does not have setValue method")}focusInput(){window.requestAnimationFrame(()=>{o(this,D,pt)?.focus()})}reset(){o(this,ce).clearImages(),this._currentRequestInputIndex=0,g(this,De,[]),o(this,A).value?.reset()}};A=new WeakMap,De=new WeakMap,li=new WeakMap,ce=new WeakMap,zr=new WeakMap,ci=new WeakMap,oo=new WeakMap,ui=new WeakMap,hi=new WeakMap,di=new WeakMap,D=new WeakSet,kd=function(t){let i=t.composedPath().find(s=>s instanceof HTMLAnchorElement);if(i){if(t.preventDefault(),this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:i.href,conversationId:this.conversationId}),window.self!==window.top){window.open(i.href,"_blank");return}let a=this.config?.linksNewTab?"_blank":"_self";window.open(i.href,i.target||a)}},Cd=function(t){if(this.isStreaming)return;t.preventDefault();let n=t.detail.example;o(this,ao).call(this,n)},ao=new WeakMap,$d=function(t){if(Ce(o(this,A).value,"widget context is required"),t.preventDefault(),this.config?.enableImageUpload&&o(this,ce).hasPendingImages)return;let n=t.detail;o(this,A).value.enqueueUserInput(n,{xUserData:o(this,A).value?.xUserData,xCustomInstructions:o(this,A).value?.xCustomInstructions}).then(i=>{i&&(o(this,D,pt)?.setValue(""),o(this,ce).clearImages(),o(this,li).typingStopped(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:n,example:!1,conversationId:this.conversationId}),window.requestAnimationFrame(()=>{o(this,D,pt)?.focus()}))}).catch(console.warn)},Sd=function(t){o(this,li).onInput(t.detail.full)},Ed=function(){Ce(o(this,A).value,"widget context is required"),o(this,A).value.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})},Ml=function(){Ce(o(this,A).value,"widget context is required"),o(this,A).value.sendNewChat(),this.reset()},_d=function(){this.dispatchEvent(new lo.CloseClickEvent)},Id=function(t){Ce(o(this,A).value,"widget context is required");let n=o(this,D,Ht),i=n[this._currentRequestInputIndex];if(!i){console.warn("no current state found for request input");return}switch(t.detail.type){case"star-rating":{let{rating:a,type:l}=t.detail;o(this,De).push({type:l,rating:a,key:i.key,title:i.title});break}case"binary-vote":{let{vote:a,type:l}=t.detail;o(this,De).push({type:l,vote:a,key:i.key,title:i.title});break}case"new-conversation-button":{m(this,D,Ml).call(this),this.requestUpdate();return}default:console.warn("unknown request input type",t.detail);return}this._currentRequestInputIndex+=1;let s=n.filter(a=>a.type==="star-rating"||a.type==="binary-vote").length;o(this,De).length>=s&&m(this,D,Md).call(this),this.requestUpdate()},Md=async function(){if(Ce(o(this,A).value,"widget context is required"),o(this,De).length===0)return;if(!o(this,A).value.lastMsg?.id){console.warn("cannot submit request inputs without message ID");return}await o(this,A).value.enqueueUserInput("",{role:"user",expectStreaming:!1,requestInputResponse:o(this,De)})&&g(this,De,[]),this.requestUpdate()},Ht=function(){Ce(o(this,A).value,"widget context is required");let t=o(this,A).value.lastMsg;if(t?.role!=="assistant")return[];let n=t.parts?.filter(i=>"tag"in i&&i.tag==="request-input-v1");return!n||n.length===0?[]:n.map(i=>!("data"in i)||!U0.includes(i.data.type)?null:{title:i.data.title,type:i.data.type,key:i.data.key}).filter(i=>i!==null)},Ad=function(){if(o(this,D,Ht).length===0)return!1;let n=o(this,D,Ht).filter(i=>i.type==="star-rating"||i.type==="binary-vote").length;return o(this,De).length<n},P0=function(){return this.renderRoot.querySelector("#scrollable-content")},pt=function(){return this.renderRoot.querySelector("mw-chat-input")},w(lo,"properties",{showClose:{type:Boolean,attribute:"show-close"},_currentRequestInputIndex:{type:Number,state:!0}});var ai=lo,Il;ai.CloseClickEvent=(Il=class extends CustomEvent{constructor(e={}){super(ai.CloseClickEvent.type,{...e})}},w(Il,"type","mw:close-click"),Il);customElements.get("mw-chat")||customElements.define("mw-chat",ai);var Gr,Td,Ld,Wr=class Wr extends I(C){constructor(){super();p(this,Gr);w(this,"render",()=>h`
|
|
2203
2203
|
<div class="popup-desktop group relative w-[300px] cursor-pointer rounded-[17px] shadow-2xl select-none">
|
|
2204
2204
|
<mw-spinning-border .color="${this.color}" .border="${"transparent"}" .radius="${"17px"}">
|
|
2205
2205
|
<!-- wrapper -->
|
|
2206
2206
|
<div class="relative z-[2147483647] m-[1px] w-[300px] rounded-2xl bg-white font-sans text-base leading-normal">
|
|
2207
2207
|
<!-- content -->
|
|
2208
|
-
<div class="p-4 text-left text-gray-800" @click="${m(this,Gr,
|
|
2208
|
+
<div class="p-4 text-left text-gray-800" @click="${m(this,Gr,Ld)}">
|
|
2209
2209
|
<p>${this.text}</p>
|
|
2210
2210
|
</div>
|
|
2211
2211
|
</div>
|
|
@@ -2214,12 +2214,12 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
2214
2214
|
<!-- close button -->
|
|
2215
2215
|
<button
|
|
2216
2216
|
class="bg-opacity-50 absolute -top-8 right-0 inline-flex h-6 w-6 items-center justify-center rounded-full bg-gray-300 pb-[2px] text-center text-gray-700 opacity-0 shadow transition-opacity duration-300 ease-in-out group-hover:opacity-100"
|
|
2217
|
-
@click="${m(this,Gr,
|
|
2217
|
+
@click="${m(this,Gr,Td)}"
|
|
2218
2218
|
aria-label="Close">
|
|
2219
2219
|
×
|
|
2220
2220
|
</button>
|
|
2221
2221
|
</div>
|
|
2222
|
-
`);this.text="Hello there. How can we help?",this.color="#601feb"}};Gr=new WeakSet,
|
|
2222
|
+
`);this.text="Hello there. How can we help?",this.color="#601feb"}};Gr=new WeakSet,Td=function(){this.dispatchEvent(new Wr.CloseEvent)},Ld=function(){this.dispatchEvent(new Wr.ClickEvent)},w(Wr,"properties",{text:{type:String},color:{type:String}}),w(Wr,"styles",J`
|
|
2223
2223
|
.popup-desktop:hover button {
|
|
2224
2224
|
transition-delay: 0s !important;
|
|
2225
2225
|
}
|
|
@@ -2227,19 +2227,19 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
2227
2227
|
.popup-desktop button {
|
|
2228
2228
|
transition-delay: 1s;
|
|
2229
2229
|
}
|
|
2230
|
-
`);var zt=Wr,
|
|
2230
|
+
`);var zt=Wr,Al;zt.CloseEvent=(Al=class extends CustomEvent{constructor(e={}){super(zt.CloseEvent.type,{...e})}},w(Al,"type","mw:close"),Al);var Tl;zt.ClickEvent=(Tl=class extends CustomEvent{constructor(e={}){super(zt.ClickEvent.type,{...e})}},w(Tl,"type","mw:click"),Tl);customElements.get("mw-popup-desktop")||customElements.define("mw-popup-desktop",zt);var Zr,jd,Dd,pi=class pi extends I(C){constructor(){super();p(this,Zr);w(this,"render",()=>h`
|
|
2231
2231
|
<!-- wrapper -->
|
|
2232
2232
|
<div class="group relative z-[2147483647] rounded-t-2xl bg-white text-left font-sans text-base text-[16px] leading-normal text-gray-800 shadow-2xl transition-all select-none">
|
|
2233
2233
|
<!-- close button -->
|
|
2234
2234
|
<button
|
|
2235
2235
|
class="bg-opacity-50 absolute top-[28px] right-4 inline-flex h-7 w-7 items-center justify-center rounded-full bg-gray-300 pb-[2px] text-center text-xl shadow-none duration-300 ease-in-out focus:outline-none"
|
|
2236
|
-
@click="${m(this,Zr,
|
|
2236
|
+
@click="${m(this,Zr,jd)}"
|
|
2237
2237
|
aria-label="Close">
|
|
2238
2238
|
×
|
|
2239
2239
|
</button>
|
|
2240
2240
|
|
|
2241
2241
|
<!-- content -->
|
|
2242
|
-
<div class="p-4 text-gray-800" @click="${m(this,Zr,
|
|
2242
|
+
<div class="p-4 text-gray-800" @click="${m(this,Zr,Dd)}">
|
|
2243
2243
|
<h1 class="font-display mr-8 py-2.5 text-left text-lg font-bold">${this.title}</h1>
|
|
2244
2244
|
<p class="py-2.5 text-left">${this.text}</p>
|
|
2245
2245
|
<div class="h-4"></div>
|
|
@@ -2252,30 +2252,30 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
2252
2252
|
<!-- can append any other content -->
|
|
2253
2253
|
<slot name="footer"></slot>
|
|
2254
2254
|
</div>
|
|
2255
|
-
`);this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}};Zr=new WeakSet,
|
|
2255
|
+
`);this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}};Zr=new WeakSet,jd=function(){this.dispatchEvent(new pi.CloseEvent)},Dd=function(){this.dispatchEvent(new pi.ClickEvent)},w(pi,"properties",{title:{type:String},text:{type:String},button:{type:String},color:{type:String}});var Wt=pi,Ll;Wt.CloseEvent=(Ll=class extends CustomEvent{constructor(e={}){super(Wt.CloseEvent.type,{...e})}},w(Ll,"type","mw:close"),Ll);var jl;Wt.ClickEvent=(jl=class extends CustomEvent{constructor(e={}){super(Wt.ClickEvent.type,{...e})}},w(jl,"type","mw:click"),jl);customElements.get("mw-popup-mobile")||customElements.define("mw-popup-mobile",Wt);var Jr,fi,Gt,co=class{constructor(e,t){p(this,Jr);p(this,fi,!1);p(this,Gt,()=>{o(this,fi)||(o(this,Jr).userFirstInteracted?.(),g(this,fi,!0)),o(this,Jr).userInteracted?.()});g(this,Jr,t),e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",o(this,Gt)),window.addEventListener("keydown",o(this,Gt))}stopListening(){window.removeEventListener("click",o(this,Gt)),window.removeEventListener("keydown",o(this,Gt))}};Jr=new WeakMap,fi=new WeakMap,Gt=new WeakMap;var R0=1440*60*1e3,Kr,ke,Zt,mi,Jt,gi,ho,Od,uo=class{constructor(e,t,n=Date){p(this,ho);p(this,Kr);p(this,ke);p(this,Zt);p(this,mi);p(this,Jt,!1);p(this,gi,!1);g(this,Kr,e),g(this,ke,t),g(this,Zt,n),e.addController(this)}get showing(){return o(this,Jt)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!o(this,Jt)&&(g(this,Jt,!0),o(this,Kr).requestUpdate(),e)){o(this,ke).playPopupSound();let t=o(this,ke).getPersistedState();o(this,ke).setPersistedState({...t,playedSoundOnce:!0})}}hide(){g(this,gi,!0),this.abortAutoShowTimer(),g(this,Jt,!1),o(this,Kr).requestUpdate()}abortAutoShowTimer(){clearTimeout(o(this,mi))}onCloseClick(){let e=o(this,ke).getPersistedState();o(this,ke).setPersistedState({...e,userDismissedAt:o(this,Zt).now()}),this.hide()}onContentClick(){let e=o(this,ke).getPersistedState();o(this,ke).setPersistedState({...e,userDismissedAt:o(this,Zt).now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),o(this,gi)||g(this,mi,setTimeout(()=>m(this,ho,Od).call(this),o(this,ke).getDelayMs()))}};Kr=new WeakMap,ke=new WeakMap,Zt=new WeakMap,mi=new WeakMap,Jt=new WeakMap,gi=new WeakMap,ho=new WeakSet,Od=function(){let e=o(this,ke).getPersistedState(),t=!!e?.playedSoundOnce;e?.userDismissedAt&&o(this,Zt).now()-e.userDismissedAt<R0||this.show({sound:!t})};var ft,Ul,Xe,po,Ol,fo=class fo extends I(C){constructor(){super();p(this,Xe);p(this,ft,new uo(this,{getDelayMs:()=>this.delayMs,playPopupSound:()=>{this.soundUrl&&new Audio(this.soundUrl).play().then(()=>{}).catch(t=>{console.error("Error playing audio:",t,{})})},setPersistedState:t=>{t?localStorage.setItem("_molin_popup",JSON.stringify(t)):localStorage.removeItem("_molin_popup")},getPersistedState:()=>{let t=localStorage.getItem("_molin_popup");try{return t?JSON.parse(t):null}catch{return null}}}));p(this,Ul,new co(this,o(this,ft)));this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:"",color:""},mobile:{title:"",text:"",button:"",color:"",poweredBy:!0}}}render(){let t=o(this,ft).showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",n=this.content;return h`
|
|
2256
2256
|
<!-- mobile shadow backdrop -->
|
|
2257
|
-
<div @click="${m(this,Xe,
|
|
2257
|
+
<div @click="${m(this,Xe,po)}" class="${t} fixed inset-0 z-[2147483647] bg-black/50 transition-[opacity,visibility] sm:hidden"></div>
|
|
2258
2258
|
|
|
2259
2259
|
<!-- mobile overlay -->
|
|
2260
2260
|
<div class="${t} fixed right-0 bottom-0 left-0 z-[2147483647] sm:hidden">
|
|
2261
|
-
<mw-popup-mobile title="${n.mobile.title}" text="${n.mobile.text}" button="${n.mobile.button}" color="${n.mobile.color}" @mw:click="${m(this,Xe,
|
|
2261
|
+
<mw-popup-mobile title="${n.mobile.title}" text="${n.mobile.text}" button="${n.mobile.button}" color="${n.mobile.color}" @mw:click="${m(this,Xe,Ol)}" @mw:close="${m(this,Xe,po)}">
|
|
2262
2262
|
${n.mobile.poweredBy?h`<mw-powered-by class="block p-4" slot="footer"></mw-powered-by>`:null}
|
|
2263
2263
|
</mw-popup-mobile>
|
|
2264
2264
|
</div>
|
|
2265
2265
|
|
|
2266
2266
|
<!-- desktop -->
|
|
2267
2267
|
<div class="${t} ${this.positionClasses} fixed z-[2147483647] transition-[opacity,translate,visibility] max-sm:hidden">
|
|
2268
|
-
<mw-popup-desktop color="${n.desktop.color}" text="${n.desktop.text}" @mw:click="${m(this,Xe,
|
|
2268
|
+
<mw-popup-desktop color="${n.desktop.color}" text="${n.desktop.text}" @mw:click="${m(this,Xe,Ol)}" @mw:close="${m(this,Xe,po)}"></mw-popup-desktop>
|
|
2269
2269
|
</div>
|
|
2270
|
-
`}hide(){o(this,ft).hide()}};ft=new WeakMap,
|
|
2270
|
+
`}hide(){o(this,ft).hide()}};ft=new WeakMap,Ul=new WeakMap,Xe=new WeakSet,po=function(){o(this,ft).onCloseClick()},Ol=function(){this.dispatchEvent(new fo.ClickEvent),o(this,ft).onContentClick()},w(fo,"properties",{positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object}});var wi=fo,Dl;wi.ClickEvent=(Dl=class extends CustomEvent{constructor(e={}){super(wi.ClickEvent.type,{...e})}},w(Dl,"type","mw:click"),Dl);customElements.get("mw-popup")||customElements.define("mw-popup",wi);var go,Ud,mo=class extends I(C){constructor(){super();p(this,go);w(this,"render",()=>h`
|
|
2271
2271
|
<span class="relative inline-flex">
|
|
2272
2272
|
<slot></slot>
|
|
2273
|
-
<span class="${o(this,
|
|
2273
|
+
<span class="${o(this,go,Ud)} pointer-events-none absolute z-10 flex h-3 w-3">
|
|
2274
2274
|
<span class="bg-${this.color} absolute inline-flex h-3 w-3 animate-ping rounded-full opacity-75"></span>
|
|
2275
2275
|
<span class="bg-${this.color} relative inline-flex h-3 w-3 rounded-full"></span>
|
|
2276
2276
|
</span>
|
|
2277
2277
|
</span>
|
|
2278
|
-
`);this.color="sky-500",this.position="top-right"}};
|
|
2278
|
+
`);this.color="sky-500",this.position="top-right"}};go=new WeakSet,Ud=function(){switch(this.position){case"top-left":return"top-0 left-0 -mt-1 -ml-1";case"top-right":return"top-0 right-0 -mt-1 -mr-1";case"bottom-left":return"bottom-0 left-0 -mb-1 -ml-1";case"bottom-right":return"bottom-0 right-0 -mb-1 -mr-1";default:throw new Error(`Invalid position: ${this.position}`)}},w(mo,"properties",{color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}});customElements.get("mw-pulse-dot")||customElements.define("mw-pulse-dot",mo);var wo=class extends I(C){constructor(){super();w(this,"render",()=>h`
|
|
2279
2279
|
<div class="${this.positionClasses} fixed right-6 bottom-24 z-10 flex animate-bounce flex-col items-center justify-center font-sans text-base">
|
|
2280
2280
|
<p class="mb-2 -translate-x-4 -rotate-12 transform text-lg leading-normal font-bold text-gray-800">${this.text}</p>
|
|
2281
2281
|
|
|
@@ -2288,7 +2288,7 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
2288
2288
|
stroke-linecap="round"></path>
|
|
2289
2289
|
</svg>
|
|
2290
2290
|
</div>
|
|
2291
|
-
`);this.positionClasses="",this.text="Try it out"}};w(
|
|
2291
|
+
`);this.positionClasses="",this.text="Try it out"}};w(wo,"properties",{positionClasses:{type:String,attribute:"position"},text:{type:String}});customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",wo);var yo,yi=class extends I(C){constructor(){super();p(this,yo,new dt(this,{onError:console.error}));this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}get config(){return o(this,yo).data}render(){return this.config?h`
|
|
2292
2292
|
<!-- embed our bubble component forwarding props -->
|
|
2293
2293
|
<!-- these props are never internally updated by mw-bubble so we pass them down only one way -->
|
|
2294
2294
|
<mw-bubble
|
|
@@ -2298,21 +2298,21 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
2298
2298
|
.src="${this.config?.bubble?.bubbleUrl}"
|
|
2299
2299
|
width="${ue(this.config?.bubble?.size?.width)}"
|
|
2300
2300
|
height="${ue(this.config?.bubble?.size?.height)}"></mw-bubble>
|
|
2301
|
-
`:null}};
|
|
2301
|
+
`:null}};yo=new WeakMap,w(yi,"styles",J`
|
|
2302
2302
|
:host {
|
|
2303
2303
|
all: initial; /* reset all properties that can pierce the shadow DOM */
|
|
2304
2304
|
}
|
|
2305
|
-
`),w(
|
|
2305
|
+
`),w(yi,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}});customElements.get("molin-shop-ai-launcher")||customElements.define("molin-shop-ai-launcher",yi);var c6="navigator"in globalThis&&/Mobi|Android|iPhone/i.test(navigator.userAgent),u6="navigator"in globalThis&&"share"in navigator,B0=Object.freeze({sm:640,md:768,lg:1024,xl:1280,"2xl":1536});function q0(r){if(typeof window>"u")return!1;let e=B0[r];return typeof e!="number"?(console.warn(`Invalid breakpoint: ${r}`),!1):window.matchMedia(`(min-width: ${e}px)`).matches}function Pl(){return q0("sm")}var bo,Yr,Xr,Kt,vi,xo,vo=class{constructor(e,t,n,i=window.history){p(this,bo);p(this,Yr);p(this,Xr);p(this,Kt);p(this,vi,!1);p(this,xo,()=>{o(this,Yr).test(window.location.pathname)&&o(this,Xr).navigated()});g(this,bo,e),g(this,Yr,t),g(this,Xr,n),g(this,Kt,i),e.addController(this)}hostConnected(){o(this,xo).call(this);let e=o(this,Kt).pushState;o(this,Kt).pushState=(...t)=>{if(e.call(o(this,Kt),...t),!o(this,vi))try{let n=new URL(t[2],window.location.origin);o(this,Yr).test(n.pathname)&&o(this,Xr).navigated()}catch{}}}hostDisconnected(){g(this,vi,!0)}};bo=new WeakMap,Yr=new WeakMap,Xr=new WeakMap,Kt=new WeakMap,vi=new WeakMap,xo=new WeakMap;function Pd({minMs:r,maxMs:e}){return Math.random()*(e-r)+r}function ko(r,e=""){return Object.entries(r).filter(([t,n])=>n).map(([t,n])=>`${e}${t}-[${n}]`).join(" ")}function Rd(r,e={}){return[ko(r),ko(e,"max-sm:")].join(" ")}function Bd(r){return ko(r)}function qd(r){return Object.entries(r).filter(([e,t])=>t).filter(([e])=>e==="left"||e==="right").map(([e,t])=>{let n=`sm:${e}-[${t}]`;return e==="left"&&(n+=" sm:right-auto"),e==="right"&&(n+=" sm:left-auto"),n}).join(" ")}function Vd(r){let e=ko(r),n=`sm:bottom-[${r.bottom?`calc(${r.bottom}+72px)`:"72px"}]`;return[e,n].filter(Boolean).join(" ")}var Qr,en,bi,xi,ki,Co,Rl=class{constructor(e,t,{threshold:n=5}={}){p(this,Qr,0);p(this,en,!1);p(this,bi);p(this,xi);p(this,ki,()=>{o(this,en)||(requestAnimationFrame(o(this,Co)),g(this,en,!0))});p(this,Co,()=>{let e=window.scrollY,t=e-o(this,Qr);if(Math.abs(t)>=o(this,xi)){let n=t>0?"down":"up";o(this,bi).call(this,{scrollY:e,direction:n,deltaY:Math.abs(t)}),g(this,Qr,e)}g(this,en,!1)});g(this,bi,t),g(this,xi,n),e.addController(this)}hostConnected(){g(this,Qr,window.scrollY),window.addEventListener("scroll",o(this,ki),{passive:!0})}hostDisconnected(){window.removeEventListener("scroll",o(this,ki))}};Qr=new WeakMap,en=new WeakMap,bi=new WeakMap,xi=new WeakMap,ki=new WeakMap,Co=new WeakMap;function Fd(r,e,t){return new Rl(r,e,t)}var $o,zl,$i,Wl,Qe,So,T,Bl,ql,Vl,Ci,mt,Fl,Nd,Hd,zd,Eo,Si,Nl,Hl,Yt,je=class extends I(C){constructor(){super();p(this,T);p(this,$o,new dt(this,{onError:console.error}));p(this,zl,Fd(this,t=>{o(this,T,ql)&&!this._dialogShown&&(t.direction==="down"?this._floatingInputVisible=!1:t.direction==="up"&&(this._floatingInputVisible=!0),this.requestUpdate())},{threshold:20}));p(this,$i);p(this,Wl,new vo(this,/.*/i,{navigated:()=>{if(this.requestUpdate(),!this.widgetId){console.warn("No widgetId set, cannot track page view");return}let t=o(this,T,mt)?.conversationId,n=mr.restore(this.widgetId)?.conversationId,i=t||n;i&&F("ShopAssistant: pageview",{widgetId:this.widgetId,conversationId:i,url:document.location.href,title:document.title,hidden:this.config?this.config.hidden||!1:void 0,shouldHideForCurrentUrl:o(this,T,Vl)})}}));p(this,Qe,!1);p(this,So,{onError:t=>{alert(t.error),console.error(t.widgetId,t.error),F("ShopAssistant: error",{...t},{immediate:!0})},onNewMessageStartedStreaming:t=>{F("ShopAssistant: user received bot message (streaming started)",t)},onMessageEndedStreaming:t=>{F("ShopAssistant: user received bot message (streaming ended)",t)},onUserCanceledStreaming:t=>{F("ShopAssistant: user canceled streaming",t)},onUserClickedLink:t=>{F("ShopAssistant: user clicked link",t)},onUserSentInput:t=>{F("ShopAssistant: user sent input",t)},onWaitGameQuestionAnswered:t=>{F("ShopAssistant: wait game question answered",t)},onWaitGameCompleted:t=>{F("ShopAssistant: wait game completed",t)},onWaitGameGuessValidated:t=>{F("ShopAssistant: wait game guess validated",t)}});p(this,Eo,t=>{let n=t.detail.text,i=o(this,T,Fl);i&&typeof i.connect=="function"&&i.connect(),this._dialogShown=!0,g(this,Qe,!0),this.requestUpdate(),m(this,T,Yt).call(this,!0),setTimeout(()=>{m(this,T,Hl).call(this,n),m(this,T,Nl).call(this,n).catch(console.warn)},100),F("ShopAssistant: user sent input",{widgetId:this.widgetId,text:n,example:!1,conversationId:o(this,T,mt)?.conversationId||"",source:"ask-ai"})});p(this,Si,rr({interval:200},({message:t,autoSend:n=!1}={})=>{if(!t)return;m(this,T,Hl).call(this,t);let i=o(this,T,mt)?.isLiveMode;i||this.reset(),n&&!i&&m(this,T,Nl).call(this,t).catch(console.warn)}));this.cdn="https://widget.molin.ai",this.widgetId="",this._floatingInputVisible=!0,this._dialogShown=!1,this.xUserData=ht()?.userData,this.xCustomInstructions=ht()?.customInstructions}get config(){return o(this,$i)||o(this,$o).data}render(){if(!this.config)return null;let t=Rd(this.config.bubble.position,this.config.bubble.mobilePosition),n=Bd(this.config.bubble.position),i=qd(this.config.bubble.position),s=Vd(this.config.bubble.position);return this.config.hidden||so().hidden||o(this,T,Vl)?null:h`
|
|
2306
2306
|
<mw-context-widget
|
|
2307
2307
|
.widgetId="${this.widgetId}"
|
|
2308
2308
|
.config="${this.config}"
|
|
2309
|
-
.callbacks="${o(this
|
|
2309
|
+
.callbacks="${o(this,So)}"
|
|
2310
2310
|
.xUserData="${this.xUserData}"
|
|
2311
2311
|
.xCustomInstructions="${this.xCustomInstructions}"
|
|
2312
2312
|
.autoConnect="${o(this,Qe)}">
|
|
2313
2313
|
<mw-bubble
|
|
2314
|
-
class="${t} ${this._dialogShown?"opacity-0":"opacity-100"} fixed z-[${o(this,T,
|
|
2315
|
-
@click="${m(this,T,
|
|
2314
|
+
class="${t} ${this._dialogShown?"opacity-0":"opacity-100"} fixed z-[${o(this,T,Bl)}] transition-opacity"
|
|
2315
|
+
@click="${m(this,T,Hd)}"
|
|
2316
2316
|
state="${this._dialogShown?"close":"open"}"
|
|
2317
2317
|
.color="${this.config?.bubble?.color||this.config?.color}"
|
|
2318
2318
|
.bubbleStyle="${this.config?.bubble?.style}"
|
|
@@ -2324,10 +2324,10 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
2324
2324
|
${this.isPopupEnabled?h`
|
|
2325
2325
|
<mw-popup
|
|
2326
2326
|
position="${s}"
|
|
2327
|
-
delay="${this.config.popup?.delayMs||
|
|
2327
|
+
delay="${this.config.popup?.delayMs||Pd({minMs:2e3,maxMs:5e3})}"
|
|
2328
2328
|
sound="${this.config.popup?.muteSounds?"":this.config.popup?.soundUrl||""}"
|
|
2329
2329
|
.content="${{desktop:{text:this.config.popup?.text||"Hello there. How can we help?",color:this.config?.bubble?.color||this.config.color},mobile:{title:this.config.popup?.mobileTitleText||`Chat with ${this.config.title}`,text:this.config.popup?.text||"Hello there. How can we help?",button:this.config.popup?.mobileButtonText||`Chat with ${this.config.title}`,color:this.config.color,poweredBy:!this.config.removePoweredBy}}}"
|
|
2330
|
-
@mw:click="${m(this,T,
|
|
2330
|
+
@mw:click="${m(this,T,Nd)}"></mw-popup>
|
|
2331
2331
|
`:null}
|
|
2332
2332
|
|
|
2333
2333
|
<!-- show "Try it out" if enabled (even if the chat window is showing) -->
|
|
@@ -2339,23 +2339,23 @@ var Wd=Object.create;var _o=Object.defineProperty;var Gd=Object.getOwnPropertyDe
|
|
|
2339
2339
|
<!-- On first render, do not render the dialog, so it does not connect to backend. Once it's rendered once, it's never removed from the DOM. -->
|
|
2340
2340
|
<div
|
|
2341
2341
|
class="${this._dialogShown?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${i} fixed inset-0 z-[2147483647] bg-white font-sans text-[16px] leading-normal text-gray-800 shadow-2xl transition-all sm:top-auto sm:bottom-[1.5rem] sm:h-[92%] sm:max-h-[800px] sm:w-[calc(100dvh*0.50)] sm:max-w-[400px] sm:min-w-[300px] sm:rounded-[36px] 2xl:max-w-[420px]">
|
|
2342
|
-
<mw-chat ?show-close="${!0}" @mw:close-click="${m(this,T,
|
|
2342
|
+
<mw-chat ?show-close="${!0}" @mw:close-click="${m(this,T,zd)}">
|
|
2343
2343
|
<slot name="banner" slot="banner"></slot>
|
|
2344
2344
|
</mw-chat>
|
|
2345
2345
|
</div>
|
|
2346
2346
|
|
|
2347
2347
|
<!-- Floating input only visible when enabled, in center, on desktop only -->
|
|
2348
|
-
${this.config?.floatingAskAI?.enabled&&o(this,T,
|
|
2348
|
+
${this.config?.floatingAskAI?.enabled&&o(this,T,ql)?h`
|
|
2349
2349
|
<mw-floating-ask-ai
|
|
2350
2350
|
?dark="${this.config?.floatingAskAI?.darkMode}"
|
|
2351
2351
|
.color="${this.config.color||this.config?.bubble?.color}"
|
|
2352
2352
|
placeholder="${ue(this.config?.floatingAskAI?.placeholder)}"
|
|
2353
|
-
class="${!this._dialogShown&&this._floatingInputVisible?"opacity-100 translate-y-0":"opacity-0 translate-y-full"} fixed left-1/2 z-[${o(this,T,
|
|
2353
|
+
class="${!this._dialogShown&&this._floatingInputVisible?"opacity-100 translate-y-0":"opacity-0 translate-y-full"} fixed left-1/2 z-[${o(this,T,Bl)}] hidden -translate-x-1/2 transition-all duration-300 ease-in-out max-md:hidden sm:block"
|
|
2354
2354
|
style="bottom: ${this.config.bubble.position.bottom||"1.5rem"}"
|
|
2355
|
-
@mw-floating-ask-ai:submit="${o(this,
|
|
2355
|
+
@mw-floating-ask-ai:submit="${o(this,Eo)}"></mw-floating-ask-ai>
|
|
2356
2356
|
`:null}
|
|
2357
2357
|
</mw-context-widget>
|
|
2358
|
-
`}get isPopupEnabled(){return
|
|
2358
|
+
`}get isPopupEnabled(){return Pl()?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){this._dialogShown&&o(this,T,Ci)?.hide(),this._dialogShown&&setTimeout(()=>{o(this,T,mt)?.focusInput()},0)}firstUpdated(){Pl()&&xe.molin_widget_open_state?.isOpen&&!this._dialogShown&&(this._dialogShown=!0,g(this,Qe,!0),this.requestUpdate())}openChat(t){let{message:n,autoSend:i}=t||{};if(this._dialogShown){o(this,Si).call(this,{message:n,autoSend:i});return}let s=o(this,T,Fl);s&&typeof s.connect=="function"&&s.connect(),this._dialogShown=!0,g(this,Qe,!0),this.requestUpdate(),m(this,T,Yt).call(this,!0),o(this,T,Ci)?.hide(),setTimeout(()=>{o(this,Si).call(this,{message:n,autoSend:i})},100),F("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:this._dialogShown?"open":"close"})}closeChat(){this._dialogShown&&(this._dialogShown=!1,this._floatingInputVisible=!0,this.requestUpdate(),m(this,T,Yt).call(this,!1),o(this,T,Ci)?.hide(),F("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:this._dialogShown?"open":"close"}))}showLauncher(){let t=so();t.hidden=!1,this.requestUpdate(),F("ShopAssistant: called show launcher",{widgetId:this.widgetId,source:"programmatic-method"})}hideLauncher(){let t=so();t.hidden=!0,this.requestUpdate(),F("ShopAssistant: called hide launcher",{widgetId:this.widgetId,source:"programmatic-method"})}injectConfig(t){g(this,$i,t),this.requestUpdate()}reset(){this.xUserData={},this.xCustomInstructions="",o(this,T,mt)?.reset(),this.requestUpdate()}};$o=new WeakMap,zl=new WeakMap,$i=new WeakMap,Wl=new WeakMap,Qe=new WeakMap,So=new WeakMap,T=new WeakSet,Bl=function(){return typeof this.config?.bubble?.zIndex=="number"?this.config.bubble.zIndex:2147483647},ql=function(){return this.config?.floatingAskAI?.enabled||!0},Vl=function(){if(!this.config?.hideUrls||!Array.isArray(this.config.hideUrls))return!1;let t=window.location.href,n=window.location.pathname;return this.config.hideUrls.some(i=>{if(!i||typeof i!="string")return!1;let s=i.endsWith("*"),a=s?i.slice(0,-1):i;return i.startsWith("http")?s?t.startsWith(a):t===a:s?n.startsWith(a):n===a})},Ci=function(){return this.renderRoot.querySelector("mw-popup")},mt=function(){return this.renderRoot.querySelector("mw-chat")},Fl=function(){return this.renderRoot.querySelector("mw-context-widget")},Nd=function(){this._dialogShown=!0,g(this,Qe,!0),this.requestUpdate(),m(this,T,Yt).call(this,!0),F("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"popup-click",state:this._dialogShown?"open":"close"})},Hd=function(){this._dialogShown=!this._dialogShown,g(this,Qe,!0),this.requestUpdate(),m(this,T,Yt).call(this,this._dialogShown),o(this,T,Ci)?.hide(),F("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"bubble-toggle",state:this._dialogShown?"open":"close"})},zd=function(){this._dialogShown=!1,this._floatingInputVisible=!0,this.requestUpdate(),m(this,T,Yt).call(this,!1),F("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"top-right-close-button",state:this._dialogShown?"open":"close"})},Eo=new WeakMap,Si=new WeakMap,Nl=async function(t){let n=o(this,T,mt);if(!n){console.warn("Chat element not found, cannot send message");return}n.sendMessage?await n.sendMessage(t):console.warn("Chat element does not have sendMessage method")},Hl=function(t){let n=o(this,T,mt);if(!n){console.warn("Chat element not found, cannot set input value");return}n.setInputValue?n.setInputValue(t):console.warn("Chat element does not have setInputValue method")},Yt=function(t){xe.molin_widget_open_state={isOpen:t}},w(je,"styles",J`
|
|
2359
2359
|
:host {
|
|
2360
2360
|
all: initial; /* reset all properties that can pierce the shadow DOM */
|
|
2361
2361
|
}
|