@molin.ai/shop-ai 0.9.27 → 0.9.28
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 +354 -354
- package/package.json +3 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDescriptor;var Qd=Object.getOwnPropertyNames;var ep=Object.getPrototypeOf,tp=Object.prototype.hasOwnProperty;var Zl=r=>{throw TypeError(r)};var rp=(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 np=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Qd(e))!tp.call(r,i)&&i!==t&&Io(r,i,{get:()=>e[i],enumerable:!(n=Xd(e,i))||n.enumerable});return r};var ip=(r,e,t)=>(t=r!=null?Yd(ep(r)):{},np(e||!r||!r.__esModule?Io(t,"default",{value:r,enumerable:!0}):t,r));var w=(r,e,t)=>rp(r,typeof e!="symbol"?e+"":e,t),Mo=(r,e,t)=>e.has(r)||Zl("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)?Zl("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 Jl=(r,e,t,n)=>({set _(i){g(r,e,i,t)},get _(){return o(r,e,n)}});var Fu=sn(Lt=>{"use strict";var I1=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())})},M1=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=A1;function A1(r){return I1(this,void 0,void 0,function(){var e,t,n;return M1(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=L1(r),n&&(t=t.slice(0,t.size,n)),[2,t]}})})}var T1=/^data:(.+);base64,/;function L1(r){var e;return(e=r.match(T1))===null||e===void 0?void 0:e.slice(1,2).pop()}});var Nu=sn(jt=>{"use strict";var j1=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())})},D1=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=O1;function O1(r,e,t){return j1(this,void 0,void 0,function(){var n,i;return D1(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=U1;function U1(r){return Ua(this,void 0,void 0,function(){return Pa(this,function(e){return[2,typeof FileReader=="function"?P1(r):B1(r)]})})}var $r;(function(r){r.error="error",r.loadend="loadend"})($r||($r={}));function P1(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 R1="application/octet-stream";function B1(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||R1,[2,"data:".concat(i,";base64,").concat(e.toString("base64"))]}})})}});var Hu=sn(hs=>{"use strict";Object.defineProperty(hs,"__esModule",{value:!0});hs.fileToBase64=void 0;var q1=Ra();Object.defineProperty(hs,"fileToBase64",{enumerable:!0,get:function(){return q1.blobToBase64}})});var zu=sn(Pe=>{"use strict";var V1=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)&&V1(e,r,t)};Object.defineProperty(Pe,"__esModule",{value:!0});ds(Fu(),Pe);ds(Nu(),Pe);ds(Ra(),Pe);ds(Hu(),Pe)});var _i=globalThis,Ii=_i.ShadowRoot&&(_i.ShadyCSS===void 0||_i.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ao=Symbol(),Kl=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=Kl.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Kl.set(t,e))}return e}toString(){return this.cssText}},Yl=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)},Xl=(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 Yl(t)})(r):r;var{is:sp,defineProperty:op,getOwnPropertyDescriptor:ap,getOwnPropertyNames:lp,getOwnPropertySymbols:cp,getPrototypeOf:up}=Object,Mi=globalThis,Ql=Mi.trustedTypes,hp=Ql?Ql.emptyScript:"",dp=Mi.reactiveElementPolyfillSupport,an=(r,e)=>r,Lo={toAttribute(r,e){switch(e){case Boolean:r=r?hp: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}},tc=(r,e)=>!sp(r,e),ec={attribute:!0,type:String,converter:Lo,reflect:!1,useDefault:!1,hasChanged:tc};Symbol.metadata??=Symbol("metadata"),Mi.litPropertyMetadata??=new WeakMap;var He=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=ec){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&&op(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){let{get:i,set:s}=ap(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)??ec}static _$Ei(){if(this.hasOwnProperty(an("elementProperties")))return;let e=up(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=[...lp(t),...cp(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 Xl(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??tc)(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){}};He.elementStyles=[],He.shadowRootOptions={mode:"open"},He[an("elementProperties")]=new Map,He[an("finalized")]=new Map,dp?.({ReactiveElement:He}),(Mi.reactiveElementVersions??=[]).push("2.1.1");var Do=globalThis,Ai=Do.trustedTypes,rc=Ai?Ai.createPolicy("lit-html",{createHTML:r=>r}):void 0,Oo="$lit$",ze=`lit$${Math.random().toFixed(9).slice(2)}$`,Uo="?"+ze,pp=`<${Uo}>`,xt=document,cn=()=>xt.createComment(""),un=r=>r===null||typeof r!="object"&&typeof r!="function",Po=Array.isArray,lc=r=>Po(r)||typeof r?.[Symbol.iterator]=="function",jo=`[
|
|
2
|
-
\f\r]`,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
1
|
+
var Sa=Object.create;var Ui=Object.defineProperty;var Ea=Object.getOwnPropertyDescriptor;var _a=Object.getOwnPropertyNames;var Ma=Object.getPrototypeOf,Ia=Object.prototype.hasOwnProperty;var ft=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Aa=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _a(e))!Ia.call(t,i)&&i!==r&&Ui(t,i,{get:()=>e[i],enumerable:!(n=Ea(e,i))||n.enumerable});return t};var Ta=(t,e,r)=>(r=t!=null?Sa(Ma(t)):{},Aa(e||!t||!t.__esModule?Ui(r,"default",{value:t,enumerable:!0}):r,t));var wo=ft(je=>{"use strict";var ec=je&&je.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function c(h){try{a(n.next(h))}catch(d){o(d)}}function l(h){try{a(n.throw(h))}catch(d){o(d)}}function a(h){h.done?s(h.value):i(h.value).then(c,l)}a((n=n.apply(t,e||[])).next())})},tc=je&&je.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=c(0),o.throw=c(1),o.return=c(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(a){return function(h){return l([a,h])}}function l(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(r=0)),r;)try{if(n=1,i&&(s=a[0]&2?i.return:a[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,a[1])).done)return s;switch(i=0,s&&(a=[a[0]&2,s.value]),a[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){r.label=a[1];break}if(a[0]===6&&r.label<s[1]){r.label=s[1],s=a;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(a);break}s[2]&&r.ops.pop(),r.trys.pop();continue}a=e.call(t,r)}catch(h){a=[6,h],i=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(je,"__esModule",{value:!0});je.base64ToBlob=rc;function rc(t){return ec(this,void 0,void 0,function(){var e,r,n;return tc(this,function(i){switch(i.label){case 0:return[4,fetch(t)];case 1:return e=i.sent(),[4,e.blob()];case 2:return r=i.sent(),n=ic(t),n&&(r=r.slice(0,r.size,n)),[2,r]}})})}var nc=/^data:(.+);base64,/;function ic(t){var e;return(e=t.match(nc))===null||e===void 0?void 0:e.slice(1,2).pop()}});var yo=ft(De=>{"use strict";var sc=De&&De.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function c(h){try{a(n.next(h))}catch(d){o(d)}}function l(h){try{a(n.throw(h))}catch(d){o(d)}}function a(h){h.done?s(h.value):i(h.value).then(c,l)}a((n=n.apply(t,e||[])).next())})},oc=De&&De.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=c(0),o.throw=c(1),o.return=c(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(a){return function(h){return l([a,h])}}function l(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(r=0)),r;)try{if(n=1,i&&(s=a[0]&2?i.return:a[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,a[1])).done)return s;switch(i=0,s&&(a=[a[0]&2,s.value]),a[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){r.label=a[1];break}if(a[0]===6&&r.label<s[1]){r.label=s[1],s=a;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(a);break}s[2]&&r.ops.pop(),r.trys.pop();continue}a=e.call(t,r)}catch(h){a=[6,h],i=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(De,"__esModule",{value:!0});De.base64ToFile=ac;function ac(t,e,r){return sc(this,void 0,void 0,function(){var n,i;return oc(this,function(s){switch(s.label){case 0:return[4,fetch(t)];case 1:return n=s.sent(),[4,n.blob()];case 2:return i=s.sent(),[2,new File([i],e,r)]}})})}});var Qn=ft(Oe=>{"use strict";var Yn=Oe&&Oe.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function c(h){try{a(n.next(h))}catch(d){o(d)}}function l(h){try{a(n.throw(h))}catch(d){o(d)}}function a(h){h.done?s(h.value):i(h.value).then(c,l)}a((n=n.apply(t,e||[])).next())})},Xn=Oe&&Oe.__generator||function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=c(0),o.throw=c(1),o.return=c(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(a){return function(h){return l([a,h])}}function l(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(r=0)),r;)try{if(n=1,i&&(s=a[0]&2?i.return:a[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,a[1])).done)return s;switch(i=0,s&&(a=[a[0]&2,s.value]),a[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){r.label=a[1];break}if(a[0]===6&&r.label<s[1]){r.label=s[1],s=a;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(a);break}s[2]&&r.ops.pop(),r.trys.pop();continue}a=e.call(t,r)}catch(h){a=[6,h],i=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.blobToBase64=lc;function lc(t){return Yn(this,void 0,void 0,function(){return Xn(this,function(e){return[2,typeof FileReader=="function"?cc(t):hc(t)]})})}var rt;(function(t){t.error="error",t.loadend="loadend"})(rt||(rt={}));function cc(t){return Yn(this,void 0,void 0,function(){return Xn(this,function(e){return[2,new Promise(function(r,n){try{var i=new FileReader,s=function(){r(i.result),i.removeEventListener(rt.loadend,s)};i.addEventListener(rt.loadend,s);var o=function(){n(i.error),i.removeEventListener(rt.error,o)};i.addEventListener(rt.error,o),i.readAsDataURL(t)}catch(c){n(c)}})]})})}var uc="application/octet-stream";function hc(t){return Yn(this,void 0,void 0,function(){var e,r,n,i;return Xn(this,function(s){switch(s.label){case 0:return n=(r=Buffer).from,[4,t.text()];case 1:return e=n.apply(r,[s.sent()]),i=t.type||uc,[2,"data:".concat(i,";base64,").concat(e.toString("base64"))]}})})}});var vo=ft(xr=>{"use strict";Object.defineProperty(xr,"__esModule",{value:!0});xr.fileToBase64=void 0;var dc=Qn();Object.defineProperty(xr,"fileToBase64",{enumerable:!0,get:function(){return dc.blobToBase64}})});var bo=ft(ie=>{"use strict";var pc=ie&&ie.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),kr=ie&&ie.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pc(e,t,r)};Object.defineProperty(ie,"__esModule",{value:!0});kr(wo(),ie);kr(yo(),ie);kr(Qn(),ie);kr(vo(),ie)});var Ft=globalThis,Vt=Ft.ShadowRoot&&(Ft.ShadyCSS===void 0||Ft.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Jr=Symbol(),Pi=new WeakMap,mt=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==Jr)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o,r=this.t;if(Vt&&e===void 0){let n=r!==void 0&&r.length===1;n&&(e=Pi.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Pi.set(r,e))}return e}toString(){return this.cssText}},Ri=t=>new mt(typeof t=="string"?t:t+"",void 0,Jr),D=(t,...e)=>{let r=t.length===1?t[0]:e.reduce(((n,i,s)=>n+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[s+1]),t[0]);return new mt(r,t,Jr)},Bi=(t,e)=>{if(Vt)t.adoptedStyleSheets=e.map((r=>r instanceof CSSStyleSheet?r:r.styleSheet));else for(let r of e){let n=document.createElement("style"),i=Ft.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)}},Kr=Vt?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let n of e.cssRules)r+=n.cssText;return Ri(r)})(t):t;var{is:La,defineProperty:ja,getOwnPropertyDescriptor:Da,getOwnPropertyNames:Oa,getOwnPropertySymbols:Ua,getPrototypeOf:Pa}=Object,Nt=globalThis,qi=Nt.trustedTypes,Ra=qi?qi.emptyScript:"",Ba=Nt.reactiveElementPolyfillSupport,gt=(t,e)=>t,Yr={toAttribute(t,e){switch(e){case Boolean:t=t?Ra:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},Vi=(t,e)=>!La(t,e),Fi={attribute:!0,type:String,converter:Yr,reflect:!1,useDefault:!1,hasChanged:Vi};Symbol.metadata??=Symbol("metadata"),Nt.litPropertyMetadata??=new WeakMap;var le=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,r=Fi){if(r.state&&(r.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((r=Object.create(r)).wrapped=!0),this.elementProperties.set(e,r),!r.noAccessor){let n=Symbol(),i=this.getPropertyDescriptor(e,n,r);i!==void 0&&ja(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){let{get:i,set:s}=Da(this.prototype,e)??{get(){return this[r]},set(o){this[r]=o}};return{get:i,set(o){let c=i?.call(this);s?.call(this,o),this.requestUpdate(e,c,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Fi}static _$Ei(){if(this.hasOwnProperty(gt("elementProperties")))return;let e=Pa(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(gt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(gt("properties"))){let r=this.properties,n=[...Oa(r),...Ua(r)];for(let i of n)this.createProperty(i,r[i])}let e=this[Symbol.metadata];if(e!==null){let r=litPropertyMetadata.get(e);if(r!==void 0)for(let[n,i]of r)this.elementProperties.set(n,i)}this._$Eh=new Map;for(let[r,n]of this.elementProperties){let i=this._$Eu(r,n);i!==void 0&&this._$Eh.set(i,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let r=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let i of n)r.unshift(Kr(i))}else e!==void 0&&r.push(Kr(e));return r}static _$Eu(e,r){let n=r.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,r=this.constructor.elementProperties;for(let n of r.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 Bi(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,r,n){this._$AK(e,n)}_$ET(e,r){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:Yr).toAttribute(r,n.type);this._$Em=e,s==null?this.removeAttribute(i):this.setAttribute(i,s),this._$Em=null}}_$AK(e,r){let n=this.constructor,i=n._$Eh.get(e);if(i!==void 0&&this._$Em!==i){let s=n.getPropertyOptions(i),o=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:Yr;this._$Em=i;let c=o.fromAttribute(r,s.type);this[i]=c??this._$Ej?.get(i)??c,this._$Em=null}}requestUpdate(e,r,n){if(e!==void 0){let i=this.constructor,s=this[e];if(n??=i.getPropertyOptions(e),!((n.hasChanged??Vi)(s,r)||n.useDefault&&n.reflect&&s===this._$Ej?.get(e)&&!this.hasAttribute(i._$Eu(e,n))))return;this.C(e,r,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,r,{useDefault:n,reflect:i,wrapped:s},o){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??r??this[e]),s!==!0||o!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(r=void 0),this._$AL.set(e,r)),i===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}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:o}=s,c=this[i];o!==!0||this._$AL.has(i)||c===void 0||this.C(i,void 0,s,c)}}let e=!1,r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),this._$EO?.forEach((n=>n.hostUpdate?.())),this.update(r)):this._$EM()}catch(n){throw e=!1,this._$EM(),n}e&&this._$AE(r)}willUpdate(e){}_$AE(e){this._$EO?.forEach((r=>r.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((r=>this._$ET(r,this[r]))),this._$EM()}updated(e){}firstUpdated(e){}};le.elementStyles=[],le.shadowRootOptions={mode:"open"},le[gt("elementProperties")]=new Map,le[gt("finalized")]=new Map,Ba?.({ReactiveElement:le}),(Nt.reactiveElementVersions??=[]).push("2.1.1");var Qr=globalThis,Ht=Qr.trustedTypes,Ni=Ht?Ht.createPolicy("lit-html",{createHTML:t=>t}):void 0,en="$lit$",ce=`lit$${Math.random().toFixed(9).slice(2)}$`,tn="?"+ce,qa=`<${tn}>`,Ee=document,yt=()=>Ee.createComment(""),vt=t=>t===null||typeof t!="object"&&typeof t!="function",rn=Array.isArray,Ji=t=>rn(t)||typeof t?.[Symbol.iterator]=="function",Xr=`[
|
|
2
|
+
\f\r]`,wt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Hi=/-->/g,zi=/>/g,$e=RegExp(`>|${Xr}(?:([^\\s"'>=/]+)(${Xr}*=${Xr}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Wi=/'/g,Gi=/"/g,Ki=/^(?:script|style|textarea|title)$/i,nn=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),u=nn(1),xu=nn(2),ku=nn(3),ee=Symbol.for("lit-noChange"),L=Symbol.for("lit-nothing"),Zi=new WeakMap,Se=Ee.createTreeWalker(Ee,129);function Yi(t,e){if(!rn(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Ni!==void 0?Ni.createHTML(e):e}var Xi=(t,e)=>{let r=t.length-1,n=[],i,s=e===2?"<svg>":e===3?"<math>":"",o=wt;for(let c=0;c<r;c++){let l=t[c],a,h,d=-1,f=0;for(;f<l.length&&(o.lastIndex=f,h=o.exec(l),h!==null);)f=o.lastIndex,o===wt?h[1]==="!--"?o=Hi:h[1]!==void 0?o=zi:h[2]!==void 0?(Ki.test(h[2])&&(i=RegExp("</"+h[2],"g")),o=$e):h[3]!==void 0&&(o=$e):o===$e?h[0]===">"?(o=i??wt,d=-1):h[1]===void 0?d=-2:(d=o.lastIndex-h[2].length,a=h[1],o=h[3]===void 0?$e:h[3]==='"'?Gi:Wi):o===Gi||o===Wi?o=$e:o===Hi||o===zi?o=wt:(o=$e,i=void 0);let p=o===$e&&t[c+1].startsWith("/>")?" ":"";s+=o===wt?l+qa:d>=0?(n.push(a),l.slice(0,d)+en+l.slice(d)+ce+p):l+ce+(d===-2?c:p)}return[Yi(t,s+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},bt=class t{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let s=0,o=0,c=e.length-1,l=this.parts,[a,h]=Xi(e,r);if(this.el=t.createElement(a,n),Se.currentNode=this.el.content,r===2||r===3){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(i=Se.nextNode())!==null&&l.length<c;){if(i.nodeType===1){if(i.hasAttributes())for(let d of i.getAttributeNames())if(d.endsWith(en)){let f=h[o++],p=i.getAttribute(d).split(ce),y=/([.?@])?(.*)/.exec(f);l.push({type:1,index:s,name:y[2],strings:p,ctor:y[1]==="."?Wt:y[1]==="?"?Gt:y[1]==="@"?Zt:Me}),i.removeAttribute(d)}else d.startsWith(ce)&&(l.push({type:6,index:s}),i.removeAttribute(d));if(Ki.test(i.tagName)){let d=i.textContent.split(ce),f=d.length-1;if(f>0){i.textContent=Ht?Ht.emptyScript:"";for(let p=0;p<f;p++)i.append(d[p],yt()),Se.nextNode(),l.push({type:2,index:++s});i.append(d[f],yt())}}}else if(i.nodeType===8)if(i.data===tn)l.push({type:2,index:s});else{let d=-1;for(;(d=i.data.indexOf(ce,d+1))!==-1;)l.push({type:7,index:s}),d+=ce.length-1}s++}}static createElement(e,r){let n=Ee.createElement("template");return n.innerHTML=e,n}};function _e(t,e,r=t,n){if(e===ee)return e;let i=n!==void 0?r._$Co?.[n]:r._$Cl,s=vt(e)?void 0:e._$litDirective$;return i?.constructor!==s&&(i?._$AO?.(!1),s===void 0?i=void 0:(i=new s(t),i._$AT(t,r,n)),n!==void 0?(r._$Co??=[])[n]=i:r._$Cl=i),i!==void 0&&(e=_e(t,i._$AS(t,e.values),i,n)),e}var zt=class{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:r},parts:n}=this._$AD,i=(e?.creationScope??Ee).importNode(r,!0);Se.currentNode=i;let s=Se.nextNode(),o=0,c=0,l=n[0];for(;l!==void 0;){if(o===l.index){let a;l.type===2?a=new qe(s,s.nextSibling,this,e):l.type===1?a=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(a=new Jt(s,this,e)),this._$AV.push(a),l=n[++c]}o!==l?.index&&(s=Se.nextNode(),o++)}return Se.currentNode=Ee,i}p(e){let r=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}},qe=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,r,n,i){this.type=2,this._$AH=L,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=_e(this,e,r),vt(e)?e===L||e==null||e===""?(this._$AH!==L&&this._$AR(),this._$AH=L):e!==this._$AH&&e!==ee&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ji(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!==L&&vt(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ee.createTextNode(e)),this._$AH=e}$(e){let{values:r,_$litType$:n}=e,i=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=bt.createElement(Yi(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(r);else{let s=new zt(i,this),o=s.u(this.options);s.p(r),this.T(o),this._$AH=s}}_$AC(e){let r=Zi.get(e.strings);return r===void 0&&Zi.set(e.strings,r=new bt(e)),r}k(e){rn(this._$AH)||(this._$AH=[],this._$AR());let r=this._$AH,n,i=0;for(let s of e)i===r.length?r.push(n=new t(this.O(yt()),this.O(yt()),this,this.options)):n=r[i],n._$AI(s),i++;i<r.length&&(this._$AR(n&&n._$AB.nextSibling,i),r.length=i)}_$AR(e=this._$AA.nextSibling,r){for(this._$AP?.(!1,!0,r);e!==this._$AB;){let n=e.nextSibling;e.remove(),e=n}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Me=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,n,i,s){this.type=1,this._$AH=L,this._$AN=void 0,this.element=e,this.name=r,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=L}_$AI(e,r=this,n,i){let s=this.strings,o=!1;if(s===void 0)e=_e(this,e,r,0),o=!vt(e)||e!==this._$AH&&e!==ee,o&&(this._$AH=e);else{let c=e,l,a;for(e=s[0],l=0;l<s.length-1;l++)a=_e(this,c[n+l],r,l),a===ee&&(a=this._$AH[l]),o||=!vt(a)||a!==this._$AH[l],a===L?e=L:e!==L&&(e+=(a??"")+s[l+1]),this._$AH[l]=a}o&&!i&&this.j(e)}j(e){e===L?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Wt=class extends Me{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===L?void 0:e}},Gt=class extends Me{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==L)}},Zt=class extends Me{constructor(e,r,n,i,s){super(e,r,n,i,s),this.type=5}_$AI(e,r=this){if((e=_e(this,e,r,0)??L)===ee)return;let n=this._$AH,i=e===L&&n!==L||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,s=e!==L&&(n===L||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)}},Jt=class{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){_e(this,e)}},Qi={M:en,P:ce,A:tn,C:1,L:Xi,R:zt,D:Ji,V:_e,I:qe,H:Me,N:Gt,U:Zt,B:Wt,F:Jt},Fa=Qr.litHtmlPolyfillSupport;Fa?.(bt,qe),(Qr.litHtmlVersions??=[]).push("3.3.1");var es=(t,e,r)=>{let n=r?.renderBefore??e,i=n._$litPart$;if(i===void 0){let s=r?.renderBefore??null;n._$litPart$=i=new qe(e.insertBefore(yt(),s),s,void 0,r??{})}return i._$AI(t),i};var sn=globalThis,v=class extends le{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 r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=es(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return ee}};v._$litElement$=!0,v.finalized=!0,sn.litElementHydrateSupport?.({LitElement:v});var Va=sn.litElementPolyfillSupport;Va?.({LitElement:v});(sn.litElementVersions??=[]).push("4.2.1");var Kt=class t extends HTMLElement{static observedAttributes=["name"];constructor(){super(),this.attachShadow({mode:"open"})}attributeChangedCallback(e,r,n){if(r!==n&&t.observedAttributes.includes(e)){switch(e){case"name":this.name=n||"";break}this.render()}}resolveIcon(e){throw new Error("Not implemented")}render(){let e=document.createElement("style");for(e.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(
|
|
8
|
+
`;this.shadowRoot?.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild),this.shadowRoot.appendChild(e);if(!this.name)return;let r=this.resolveIcon(this.name);if(!r){console.warn(`'${this.name}' not found, please add it to ${t.name}`);return}let s=new DOMParser().parseFromString(r,"image/svg+xml").documentElement;s.setAttribute("fill","currentColor"),s.style.width="100%",s.style.height="100%",this.shadowRoot?.appendChild(s)}name=""};var ts={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,19 +127,7 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=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 gp=fc,qo=class extends Ui{resolveIcon(e){let t=gp[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 mc=Array.isArray;var Fo=r=>!!(r&&r.constructor&&r.call&&r.apply);var gc=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,v]=await tr(t)(f.item);d.push({error:y,result:v,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 gc(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 wc(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 wp=!0,Jo="Invariant failed";function Ce(r,e){if(!r){if(wp)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,yc,vc,bc,xc,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 wc({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))),Jl(this,nr)._++}initWS(){return new Pi(o(this,K),{url:()=>o(this,Y).url(this.conversationId,{}),onOpen:e=>m(this,fe,yc).call(this,e),onMessage:e=>m(this,fe,vc).call(this,JSON.parse(e.data)),onError:e=>m(this,fe,bc).call(this,e),onClose:e=>m(this,fe,xc).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)},yc=function(e){g(this,nr,0)},vc=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)}`)}},bc=function(e){console.error("onError",e),o(this,Y).onError?.(e)},xc=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 E2=Symbol(),yp=Symbol();var kc=Object.getPrototypeOf,Ko=new WeakMap,vp=r=>r&&(Ko.has(r)?Ko.get(r):kc(r)===Object.prototype||kc(r)===Array.prototype);var Cc=r=>vp(r)&&r[yp]||null,Yo=(r,e=!0)=>{Ko.set(r,e)};var Qo=r=>typeof r=="object"&&r!==null,bp=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),Ec=(r,e)=>{let t=$c.get(r);if(t?.[0]===e)return t[1];let n=Array.isArray(r)?[]:Object.create(Object.getPrototypeOf(r));return Yo(n,!0),$c.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=Ec(c,u())}Object.defineProperty(n,i,l)}),Object.preventExtensions(n)},xp=(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&&(Sc(u,a)||qi.has(a)&&Sc(u,qi.get(a))))return!0;t(s),Qo(a)&&(a=Cc(a)||a);let d=!$t.has(a)&&Cp(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,$c=new WeakMap,Xo=[1],qi=new WeakMap,Sc=Object.is,kp=(r,e)=>new Proxy(r,e),Cp=bp,$p=Ec,Sp=xp;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(k=>k(S,M)))},s=t,a=(S=Xo[0])=>(s!==S&&(s=S,c.forEach(([M])=>{let k=M[1](S);k>t&&(t=k)})),t),l=S=>(M,k)=>{let E=[...M];E[1]=[S,...E[1]],i(E,k)},c=new Map,u=(S,M)=>{let k=!ea.has(M)&&$t.get(M);if(k){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=k[2](l(S));c.set(S,[k,E])}else c.set(S,[k])}},d=S=>{var M;let k=c.get(S);k&&(c.delete(S),(M=k[1])==null||M.call(k))},f=S=>(n.add(S),n.size===1&&c.forEach(([k,E],L)=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&E)throw new Error("remove already exists");let z=k[2](l(L));c.set(L,[k,z])}),()=>{n.delete(S),n.size===0&&c.forEach(([k,E],L)=>{E&&(E(),c.set(L,[k]))})}),y=!0,v=Sp(()=>y,u,d,i),C=kp(r,v);qi.set(r,C);let j=[r,a,f];return $t.set(C,j),Reflect.ownKeys(r).forEach(S=>{let M=Object.getOwnPropertyDescriptor(r,S);"value"in M&&M.writable&&(C[S]=r[S])}),y=!1,C}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 $p(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,tt=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,Ep(o(this,ur),o(this,yn))),!o(this,_t)))return;let e=o(this,_t)[o(this,hr)]instanceof tt?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 Ep(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 _c=()=>{if(window.Shopify)try{return{customerId:_p()}}catch{return null}return null},_p=()=>{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},Ic=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 Mc(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 Ac(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 Tc=()=>{if(window.ShopRenter)try{let r=Mp();return{customerEmail:r?.customerEmail,customerId:r?.customerId,customerName:r?.customerName}}catch{return null}return null},Mp=()=>{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}}},Lc=async()=>{try{let r=window.ShopRenter.shop?.domain;if(!r)return[];let e=Mc(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 jc=()=>{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},Dc=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 Lp;function jp(r){return Lp?.get(r)}var Dp;function Op(r){return Dp?.get(r)}var Up;function Pp(r,e){return Up?.get(r)?.get(e)}function Uc(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??Uc(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??Pp(r.reference,c.lang)??(u?Op(c.lang):null)??n.message??jp(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 Rp(r,e){return Object.hasOwn(r,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function Pc(r,e){let t=[...new Set(r)];return t.length>1?`(${t.join(` ${e} `)})`:t[0]??"never"}var Bp=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 qp(r,e,t){return typeof r.fallback=="function"?r.fallback(e,t):r.fallback}function Rc(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 We(r,e){return{kind:"schema",type:"object",reference:We,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]:Rc(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]=qp(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=Rc(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:Pc(r.map(Uc),"|"),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(Rp(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 Oc(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:Pc(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:Oc(s)}),t.typed=!0}else{if(a?.length===1)return a[0];ye(this,"type",t,n,{issues:Oc(a)})}return t}}}function Bc(r,e,t){let n=r["~run"]({value:e},ia(t));if(n.issues)throw new Bp(n.issues);return n.value}function qc(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 Vc(...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 Fc=Hi(X(),fr([X(),Ni(),la(),ca()])),Nc=Vc(X(),oa(1),sa(5e3)),Hc=()=>{try{return window.UNAS?jc():window.Shopify?_c():window.ShopRenter?Tc():null}catch{return null}},zc=async()=>{try{return window.UNAS?await Dc():window.Shopify?await Ic():window.ShopRenter?await Lc():[]}catch{return[]}},mr={schema:We({conversationId:pr(X()),messages:pr(dr(We({id:X(),timestamp:Ni(),role:ua(["user","assistant","support"]),content:X(),parts:pr(dr(fr([We({text:X()}),We({html:X()}),We({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=Bc(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,Wc,bn,xn,gr,q,Gc,Wi=class Wi 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 tt(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,Wc),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,Gc).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,Wc=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=Hc();o(this,U,q).sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,language:window.navigator.language,cart:[]}),zc().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)},Gc=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(Fc,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(Nc,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 Zc(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 Vp(r,e=","){return r.map(xa).join(e)}var tu=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 Jc(r){return r}function Yi(){}var te={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function ru(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(ru(r),15)<<18}var Fp=["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)&&~Fp.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:r,p:i,r:s,i:e}}var nu=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?"."+tu(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 Kc=new Intl.Collator("en",{numeric:!0});function iu(r,e){for(var t=0,n=r.length;t<n;){let i=n+t>>1;0>=su(r[i],e)?t=i+1:n=i}return n}function su(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||Kc.compare(Yc(r.n),Yc(e.n))||Kc.compare(Xc(r.n),Xc(e.n))}function Yc(r){return(r||"").split(/:/).pop().split("/").pop()||"\0"}function Xc(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 ou(r,e,t,n,i=[]){return(function s(a,{n:l,p:c,r:u=[],i:d},f){let y=[],v="",C=0,j=0;for(let k in a||{}){var S,M;let E=a[k];if(k[0]=="@"){if(!E)continue;if(k[1]=="a"){y.push(...$a(l,c,Ji(""+E),f,c,u,d,!0));continue}if(k[1]=="l"){for(let L of V(E))y.push(...s(L,{n:l,p:(S=te[k[7]],c&~te.o|S),r:k[7]=="d"?[]:u,i:d},f));continue}if(k[1]=="i"){y.push(...V(E).map(L=>({p:-1,o:0,r:[],d:k+" "+L})));continue}if(k[1]=="k"){y.push({p:te.d,o:0,r:[k],d:s(E,{p:te.d},f).map(wa).join("")});continue}if(k[1]=="f"){y.push(...V(E).map(L=>({p:te.d,o:0,r:[k],d:s(L,{p:te.d},f).map(wa).join("")})));continue}}if(typeof E!="object"||Array.isArray(E))k=="label"&&E?l=E+Gi(JSON.stringify([c,d,a])):(E||E===0)&&(k=k.replace(/[A-Z]/g,L=>"-"+L.toLowerCase()),j+=1,C=Math.max(C,(M=k)[0]=="-"?0:ru(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),v+=(v?";":"")+V(E).map(L=>f.s(k,Ca(""+L,f.theme)+(d?" !important":""))).join(";"));else if(k[0]=="@"||k.includes("&")){let L=c;k[0]=="@"&&(k=k.replace(/\bscreen\(([^)]+)\)/g,(z,ee)=>{let se=f.theme("screens",ee);return se?(L|=67108864,Ki(se,"")):z}),L|=ga(k)),y.push(...s(E,{n:l,p:L,r:[...u,k],i:d},f))}else y.push(...s(E,{p:c,r:[...u,k]},f))}return y.unshift({n:l,p:c,o:Math.max(0,15-j)+1.5*Math.min(C||15,15),r:u,d:v}),y.sort(su)})(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 au(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 v=(function(C,j){let S=nu.get(C.n);return S?S(C,j):j.r(C.n,C.v[0]=="dark")})(c,u);return v?typeof v=="string"?({r:f,p:d}=ka(c,u,d,f),au(Zi(Ji(v),u,d,f,c.i),c.n)):Array.isArray(v)?v.map(C=>{var j,S;return{o:0,...C,r:[...V(f),...V(C.r)],p:(j=d,S=C.p??d,j&~te.o|S)}}):ou(v,c,u,d,f):[{c:xa(c),p:0,o:0,r:[]}]})(a,e,t,n,i))s.splice(iu(s,l),0,l);return s}function $a(r,e,t,n,i,s,a,l){return au((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 Np(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)},nu.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(Hp),i}))}}function Hp(r,e,t){return t.indexOf(r)==e}var Qc=new Map;function Ji(r){let e=Qc.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}=n[0].pop();for(let C of y)C.v.splice(+(C.v[0]=="dark")-+(v[0]=="dark"),v.length);ma([...t,Np(f.length>1?f.slice(0,-1)+Gi(JSON.stringify([f,y])):f+"("+Vp(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),Qc.set(r,e=n[0])}return e}function b(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 x(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=lu(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,zp(e,t)]}function zp(r={},e){return(t,n)=>{let{section:i=lu(t[0]).replace("-","")+"Color"}=r,[s,a]=Wp(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),v=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 C=v(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},C={"&":C,[n.v("dark")]:v(t,n)})}return C}}function Wp(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 lu(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:v}=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(v)]}}return t}function eu(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 Gp(r){var e;return ba(r[0],typeof(e=r[1])=="function"?e:()=>e)}function Zp(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 cu(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 cu(r,e){let t=V(r).map(Jp);return(n,i,s)=>{for(let a of t){let l=e(n,a,i,s);if(l)return l}}}function Jp(r){return typeof r=="string"?RegExp("^"+r+(r.includes("$")||r.slice(-1)=="-"?"":"$")):r}function uu(r,e){let t=Cn(r),n=(function({theme:c,darkMode:u,darkColor:d=Yi,variants:f,rules:y,hash:v,stringify:C,ignorelist:j,finalize:S}){let M=new Map,k=new Map,E=new Map,L=new Map,z=cu(j,(B,oe)=>oe.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 v=="function"?B=>v(B,Gi):v?Gi:Jc;ee!==Jc&&S.push(B=>({...B,n:B.n&&ee(B.n),d:B.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(oe,de)=>"--"+ee(de).replace("#",""))}));let se={theme:(function({extend:B={},...oe}){let de={},_o={get colors(){return gt("colors")},theme:gt,negative(){return{}},breakpoints(Z){let ae={};for(let ge in Z)typeof Z[ge]=="string"&&(ae["screen-"+ge]=Z[ge]);return ae}};return gt;function gt(Z,ae,ge,tn){if(Z){if({1:Z,2:tn}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(Z)||[,Z],/[.[]/.test(Z)){let Ne=[];Z.replace(/\[([^\]]+)\]|([^.[]+)/g,(yt,nn,Kd=nn)=>Ne.push(Kd)),Z=Ne.shift(),ge=ae,ae=Ne.join("-")}let Oe=de[Z]||Object.assign(Object.assign(de[Z]={},Ei(oe,Z)),Ei(B,Z));if(ae==null)return Oe;ae||(ae="DEFAULT");let wt=Oe[ae]??ae.split("-").reduce((Ne,yt)=>Ne?.[yt],Oe)??ge;return tn?Se(wt,{opacityValue:Ca(tn,gt)}):wt}let rn={};for(let Oe of[...Object.keys(oe),...Object.keys(B)])rn[Oe]=gt(Oe);return rn}function Ei(Z,ae){let ge=Z[ae];return typeof ge=="function"&&(ge=ge(_o)),ge&&/color|fill|stroke/i.test(ae)?(function tn(rn,Oe=[]){let wt={};for(let Ne in rn){let yt=rn[Ne],nn=[...Oe,Ne];wt[nn.join("-")]=yt,Ne=="DEFAULT"&&(nn=Oe,wt[Oe.join("-")]=yt),typeof yt=="object"&&Object.assign(wt,tn(yt,nn))}return wt})(ge):ge}})(c),e:tu,h:ee,s(B,oe){return C(B,oe,se)},d(B,oe,de){return d(B,oe,se,de)},v(B){return M.has(B)||M.set(B,eu(B,f,k,Gp,se)||"&:"+B),M.get(B)},r(B,oe){let de=JSON.stringify([B,oe]);return E.has(de)||E.set(de,!z(B,se)&&eu(B,y,L,Zp,se,oe)),E.get(de)},f(B){return S.reduce((oe,de)=>de(oe,se),B)}};return se})(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=iu(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):ou(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 Kp(r,e){return r!=e&&""+r.split(" ").sort()!=""+e.split(" ").sort()}function hu(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&&Kp(a,s=r(a))&&i.setAttribute("class",s)}}function Yp(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:Yp(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 Xp=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 du(r){return Xp.get(r)}function pu(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 fu(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 Qp=[["-webkit-",1],["-moz-",2],["-ms-",4]];function Qi(){return({stringify:r})=>({stringify(e,t,n){let i="",s=du(e);s&&(i+=r(s,t,n)+";");let a=pu(e),l=fu(e,t);for(let c of Qp)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})=>mu(r))],["line-clamp-(\\d+)",({1:r})=>mu(r)]]}}function mu(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 gu={"*,::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 ku=[b("\\[([-\\w]+):(.+)]",({1:r,2:e},t)=>({"@layer overrides":{"&":{[r]:Ue(`[${e}]`,"",t)}}})),b("(group|peer)([~/][^-[]+)?",({input:r},{h:e})=>[{c:e(r)}]),x("aspect-","aspectRatio"),b("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}}}),x("content-","content",({_:r})=>({"--tw-content":r,content:"var(--tw-content)"})),b("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),b("box-(border|content)","boxSizing",({1:r})=>r+"-box"),b("hidden",{display:"none"}),b("table-(auto|fixed)","tableLayout"),b(["(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)",b("isolate","isolation"),b("object-(contain|cover|fill|none|scale-down)","objectFit"),x("object-","objectPosition"),b("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",ts),b("overscroll(-[xy])?-(auto|contain|none)",({1:r="",2:e})=>({["overscroll-behavior"+r]:e})),b("(static|fixed|absolute|relative|sticky)","position"),x("-?inset(-[xy])?(?:$|-)","inset",({1:r,_:e})=>({top:r!="-x"&&e,right:r!="-y"&&e,bottom:r!="-x"&&e,left:r!="-y"&&e})),x("-?(top|bottom|left|right)(?:$|-)","inset"),b("(visible|collapse)","visibility"),b("invisible",{visibility:"hidden"}),x("-?z-","zIndex"),b("flex-((row|col)(-reverse)?)","flexDirection",wu),b("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),x("(flex-(?:grow|shrink))(?:$|-)"),x("(flex)-"),x("grow(?:$|-)","flexGrow"),x("shrink(?:$|-)","flexShrink"),x("basis-","flexBasis"),x("-?(order)-"),"-?(order)-(\\d+)",x("grid-cols-","gridTemplateColumns"),b("grid-cols-(\\d+)","gridTemplateColumns",xu),x("col-","gridColumn"),b("col-(span)-(\\d+)","gridColumn",bu),x("col-start-","gridColumnStart"),b("col-start-(auto|\\d+)","gridColumnStart"),x("col-end-","gridColumnEnd"),b("col-end-(auto|\\d+)","gridColumnEnd"),x("grid-rows-","gridTemplateRows"),b("grid-rows-(\\d+)","gridTemplateRows",xu),x("row-","gridRow"),b("row-(span)-(\\d+)","gridRow",bu),x("row-start-","gridRowStart"),b("row-start-(auto|\\d+)","gridRowStart"),x("row-end-","gridRowEnd"),b("row-end-(auto|\\d+)","gridRowEnd"),b("grid-flow-((row|col)(-dense)?)","gridAutoFlow",r=>ts(wu(r))),b("grid-flow-(dense)","gridAutoFlow"),x("auto-cols-","gridAutoColumns"),x("auto-rows-","gridAutoRows"),x("gap-x(?:$|-)","gap","columnGap"),x("gap-y(?:$|-)","gap","rowGap"),x("gap(?:$|-)","gap"),"(justify-(?:items|self))-",b("justify-","justifyContent",yu),b("(content|items|self)-",r=>({["align-"+r[1]]:yu(r)})),b("(place-(content|items|self))-",({1:r,$$:e})=>({[r]:("wun".includes(e[3])?"space-":"")+e})),x("p([xytrbl])?(?:$|-)","padding",vr("padding")),x("-?m([xytrbl])?(?:$|-)","margin",vr("margin")),x("-?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))`}})),b("space-(x|y)-reverse",({1:r})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${r}-reverse`]:"1"}})),x("w-","width"),x("min-w-","minWidth"),x("max-w-","maxWidth"),x("h-","height"),x("min-h-","minHeight"),x("max-h-","maxHeight"),x("font-","fontWeight"),x("font-","fontFamily",({_:r})=>typeof(r=V(r))[1]=="string"?{fontFamily:Te(r)}:{fontFamily:Te(r[0]),...r[1]}),b("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),b("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),b("italic","fontStyle"),b("not-italic",{fontStyle:"normal"}),b("(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)",...rt({"--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,/*!*/ /*!*/)"})}),x("tracking-","letterSpacing"),x("leading-","lineHeight"),b("list-(inside|outside)","listStylePosition"),x("list-","listStyleType"),b("list-","listStyleType"),x("placeholder-opacity-","placeholderOpacity",({_:r})=>({"&::placeholder":{"--tw-placeholder-opacity":r}})),re("placeholder-",{property:"color",selector:"&::placeholder"}),b("text-(left|center|right|justify|start|end)","textAlign"),b("text-(ellipsis|clip)","textOverflow"),x("text-opacity-","textOpacity","--tw-text-opacity"),re("text-",{property:"color"}),x("text-","fontSize",({_:r})=>typeof r=="string"?{fontSize:r}:{fontSize:r[0],...typeof r[1]=="string"?{lineHeight:r[1]}:r[1]}),x("indent-","textIndent"),b("(overline|underline|line-through)","textDecorationLine"),b("no-underline",{textDecorationLine:"none"}),x("underline-offset-","textUnderlineOffset"),re("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),x("decoration-","textDecorationThickness"),b("decoration-","textDecorationStyle"),b("(uppercase|lowercase|capitalize)","textTransform"),b("normal-case",{textTransform:"none"}),b("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),b("align-","verticalAlign"),b("whitespace-","whiteSpace"),b("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),b("break-words",{overflowWrap:"break-word"}),b("break-all",{wordBreak:"break-all"}),b("break-keep",{wordBreak:"keep-all"}),re("caret-",{opacityVariable:!1,opacitySection:"opacity"}),re("accent-",{opacityVariable:!1,opacitySection:"opacity"}),b("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"}),b("bg-(fixed|local|scroll)","backgroundAttachment"),b("bg-origin-(border|padding|content)","backgroundOrigin",({1:r})=>r+"-box"),b(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),b("bg-blend-","backgroundBlendMode"),b("bg-clip-(border|padding|content|text)","backgroundClip",({1:r})=>r+(r=="text"?"":"-box")),x("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),re("bg-",{section:"backgroundColor"}),x("bg-","backgroundImage"),x("bg-","backgroundPosition"),b("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",ts),x("bg-","backgroundSize"),x("rounded(?:$|-)","borderRadius"),x("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}}),b("border-(collapse|separate)","borderCollapse"),x("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),b("border-(solid|dashed|dotted|double|none)","borderStyle"),x("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:r,_:e})=>({...rt({"--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-"),x("border-([xytrbl])(?:$|-)","borderWidth",vr("border","Width")),x("border(?:$|-)","borderWidth"),x("divide-opacity(?:$|-)","divideOpacity",({_:r})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":r}})),b("divide-(solid|dashed|dotted|double|none)",({1:r})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:r}})),b("divide-([xy]-reverse)",({1:r})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+r]:"1"}})),x("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])"}),x("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),re("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),x("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),b("ring-inset",{"--tw-ring-inset":"inset"}),re("ring-",{property:"--tw-ring-color"}),x("ring(?:$|-)","ringWidth",({_:r},{theme:e})=>({...rt({"--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)"})),x("shadow(?:$|-)","boxShadow",({_:r})=>({...rt({"--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)"})),x("(opacity)-"),b("mix-blend-","mixBlendMode"),...vu(),...vu("backdrop-"),x("transition(?:$|-)","transitionProperty",(r,{theme:e})=>({transitionProperty:Te(r),transitionTimingFunction:r._=="none"?void 0:Te(e("transitionTimingFunction","")),transitionDuration:r._=="none"?void 0:Te(e("transitionDuration",""))})),x("duration(?:$|-)","transitionDuration","transitionDuration",Te),x("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",Te),x("delay(?:$|-)","transitionDelay","transitionDelay",Te),x("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)",b("transform",_a),b("transform-(cpu|gpu)",({1:r})=>({"--tw-transform":Cu(r=="gpu")})),x("scale(-[xy])?-","scale",({1:r,_:e})=>({["--tw-scale"+(r||"-x")]:e,["--tw-scale"+(r||"-y")]:e,..._a()})),x("-?(rotate)-","rotate",Ea),x("-?(translate-[xy])-","translate",Ea),x("-?(skew-[xy])-","skew",Ea),b("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",ts),"(appearance)-",x("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",x("(cursor)-"),"(cursor)-",b("snap-(none)","scroll-snap-type"),b("snap-(x|y|both)",({1:r})=>({...rt({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":r+" var(--tw-scroll-snap-strictness)"})),b("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),b("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),b("snap-(normal|always)","scroll-snap-stop"),b("scroll-(auto|smooth)","scroll-behavior"),x("scroll-p([xytrbl])?(?:$|-)","padding",vr("scroll-padding")),x("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",vr("scroll-margin")),b("touch-(auto|none|manipulation)","touch-action"),b("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:r,2:e,3:t})=>({...rt({"--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)"})),b("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),b("outline",{outlineStyle:"solid"}),b("outline-(dashed|dotted|double)","outlineStyle"),x("-?(outline-offset)-"),re("outline-",{opacityVariable:!1,opacitySection:"opacity"}),x("outline-","outlineWidth"),"(pointer-events)-",x("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:r})=>({x:"horizontal",y:"vertical"})[r]||r||"both"],b("select-(none|text|all|auto)","userSelect"),re("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),re("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),x("stroke-","strokeWidth"),b("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),b("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 wu(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 yu({$$: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 vu(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={...rt(t),[`${r}filter`]:e.map(n=>`var(--tw-${r}${n})`).join(" ")},[`(${r}filter)-(none)`,b(`${r}filter`,t),...e.map(n=>x(`${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{...rt({"--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":Cu()}),transform:"var(--tw-transform)"}}function Cu(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 bu({1:r,2:e}){return`${r} ${e} / ${r} ${e}`}function xu({1:r}){return`repeat(${r},minmax(0,1fr))`}function rt(r){return{"@layer defaults":{"*,::before,::after":r,"::backdrop":r}}}var $u=[["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 Su({colors:r,disablePreflight:e}={}){return{preflight:e?void 0:gu,theme:{...Sn,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...r}},variants:$u,rules:ku,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 e1={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},t1={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},r1={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},n1={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},i1={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},s1={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},o1={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},a1={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},l1={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},c1={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},u1={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},h1={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},d1={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},p1={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},f1={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},m1={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},g1={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},w1={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},y1={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},v1={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},b1={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},x1={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},Eu={__proto__:null,slate:e1,gray:t1,zinc:r1,neutral:n1,stone:i1,red:s1,orange:o1,amber:a1,yellow:l1,lime:c1,green:u1,emerald:h1,teal:d1,cyan:p1,sky:f1,blue:m1,indigo:g1,violet:w1,purple:y1,fuchsia:v1,pink:b1,rose:x1};function rs({disablePreflight:r}={}){return Su({colors:Eu,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)=>Mu(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=Iu(a.theme("fontSize",s));return l&&{"@layer components":l}}],[r+"-",({$$:s},a)=>i(s,a)],[r,(s,a)=>({...i(e,a),"@layer base":[_u(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"}}),_u(r,a,t)],"@layer components":{...Iu(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 v=a.theme(`colors.${s}.${f}`,f);y["--tw-prose-"+d]=Se(v);let C=y!=c&&a.d("colors",`${s}-${f}`,v);C&&(c["--tw-prose-"+d]=Se(C))};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 _u(r,e,t){let n={};for(let i in t)n[Mu(r,i,e,s=>`.${e.e(e.h(r))}${s}`)]=t[i];return n}function Mu(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 Iu(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(k1)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,v)=>v&&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=uu({...r,hash:r.hash??e},t),i=hu(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 k1=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($){constructor(){super(),this.color="#601feb",this.radius="16.8576px",this.size="320px",this.border="#d1d5db"}render(){return h`
|
|
131
|
-
<div class="flex flex-row flex-wrap gap-0">
|
|
132
|
-
<div class="relative z-0 flex min-h-9 items-center justify-center overflow-hidden" style="border-radius: ${this.radius};">
|
|
133
|
-
<!-- Spinning gradient background -->
|
|
134
|
-
<div
|
|
135
|
-
class="absolute z-[-2] m-auto animate-[spin-slow_4s_linear_infinite] bg-[0_0] bg-cover bg-no-repeat"
|
|
136
|
-
style="background-image: conic-gradient(transparent, ${this.color}, transparent 30%); height: ${this.size}; width: ${this.size}; background-color: ${this.border};"></div>
|
|
137
|
-
<!-- White background with 1px border space for gradient -->
|
|
138
|
-
<div class="absolute top-[1px] left-[1px] z-[-1] h-[calc(100%_-_2px)] w-[calc(100%_-_2px)] bg-white" style="border-radius: ${this.radius};"></div>
|
|
139
|
-
<slot></slot>
|
|
140
|
-
</div>
|
|
141
|
-
</div>
|
|
142
|
-
`}};w(En,"properties",{color:{type:String},radius:{type:String},size:{type:String},border:{type:String}}),w(En,"styles",J`
|
|
130
|
+
</svg>`};var Na=ts,on=class extends Kt{resolveIcon(e){let r=Na[e];if(!r)throw console.warn("hi-outline: icon not found",e),new Error(`Icon ${e} not found`);return r}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(r=>{r.setAttribute("stroke","currentColor")})}};customElements.get("hi-outline")||customElements.define("hi-outline",on);var Yt=class{#e;#t;#r;constructor(e,r){if(!e)throw new Error("host is required");if(!r)throw new Error("config is required");this.#e=e,this.#e.addController(this),this.#t=r}connect(e){this.#t=e,this.#r=this.#n()}hostConnected(){this.#r||setTimeout(()=>{this.#r||(this.#r=this.#n())},0)}hostDisconnected(){this.#r?.close(1e3,"lit_host_disconnected"),this.#r=void 0}send(e){this.#r?.send(e)}close(e,r){this.#r?.close(e,r)}get isConnected(){return this.#r?.readyState===WebSocket.OPEN}get isConnecting(){return this.#r?.readyState===WebSocket.CONNECTING}#n(){let e=new WebSocket(this.#t.url());return this.#t.onClose&&(e.onclose=this.#t.onClose),this.#t.onOpen&&(e.onopen=this.#t.onOpen),this.#t.onError&&(e.onerror=this.#t.onError),this.#t.onMessage&&(e.onmessage=this.#t.onMessage),e}};var rs=Array.isArray;var an=t=>!!(t&&t.constructor&&t.call&&t.apply);var ns=t=>!(!t||!t.then||!an(t.then));var ln=(t,e,r=!1)=>{if(!t)return[];let n=(s,o)=>e(s)-e(o),i=(s,o)=>e(o)-e(s);return t.slice().sort(r===!0?i:n)};function*Fe(t,e,r=i=>i,n=1){let i=an(r)?r:()=>r,s=e?t:0,o=e??t;for(let c=s;c<=o&&(yield i(c),!(c+n>o));c+=n);}var cn=(t,e,r,n)=>Array.from(Fe(t,e,r,n));var un=(t,e)=>t?t.reduce((r,n)=>{let[i,s]=r;return e(n)?[[...i,n],s]:[i,[...s,n]]},[[],[]]):[[],[]];var hn=class extends Error{constructor(e=[]){super();let r=e.find(n=>n.name)?.name??"";this.name=`AggregateError(${r}...)`,this.message=`AggregateError with ${e.length} errors`,this.stack=e.find(n=>n.stack)?.stack??this.stack,this.errors=e}},dn=async(t,e,r)=>{let n=e.map((a,h)=>({index:h,item:a})),i=async a=>{let h=[];for(;;){let d=n.pop();if(!d)return a(h);let[f,p]=await Ne(r)(d.item);h.push({error:f,result:p,index:d.index})}},s=cn(1,t).map(()=>new Promise(i)),o=await Promise.all(s),[c,l]=un(ln(o.flat(),a=>a.index),a=>!!a.error);if(c.length>0)throw new hn(c.map(a=>a.error));return l.map(a=>a.result)};var pn=async(t,e)=>{let r=t?.times??3,n=t?.delay,i=t?.backoff??null;for(let s of Fe(1,r)){let[o,c]=await Ne(e)(l=>{throw{_exited:l}});if(!o)return c;if(o._exited)throw o._exited;if(s===r)throw o;n&&await Ve(n),i&&await Ve(i(s))}},Ve=t=>new Promise(e=>setTimeout(e,t)),Ne=t=>(...e)=>{try{let r=t(...e);return ns(r)?r.then(n=>[void 0,n]).catch(n=>[n,void 0]):[void 0,r]}catch(r){return[r,void 0]}};var He=({interval:t},e)=>{let r=!0,n,i=(...s)=>{r&&(e(...s),r=!1,n=setTimeout(()=>{r=!0,n=void 0},t))};return i.isThrottled=()=>n!==void 0,i};async function is(t,e){let r=t?.times??3,n=t?.delay,i=t?.backoff??null;for(let s of Fe(1,r)){let[o,c]=await Ne(e)(l=>{throw{_exited:l}});if(!o)return c;if(o._exited)throw o._exited;if(s===r)throw o;n&&await Ve(n),i&&await Ve(i(s))}throw new Error("unreachable")}var Ha=!0,fn="Invariant failed";function J(t,e){if(!t){if(Ha)throw new Error(fn);var r=typeof e=="function"?e():e,n=r?"".concat(fn,": ").concat(r):fn;throw new Error(n)}}var Xt=class{#e;#t;#r=null;isStreaming=!1;typingIndicator;ranOutOfCredits=!1;messages=[];conversationId="";#n=0;#i;isLiveMode=!1;get hasQueuedMessages(){return this.#s.length>0}constructor(e,r){this.#e=e,this.#t=r,this.#t.autoConnect!==!1&&(this.#r=this.initWS()),e.addController(this)}#s=[];#o(e,{expectStreaming:r=!1}={}){return this.ranOutOfCredits?!1:this.#r?this.#r.isConnecting?(console.warn("WebSocket is connecting, message not sent",e),!1):this.#r.isConnected?(r&&!this.isLiveMode&&(this.isStreaming=!0,this.#e.requestUpdate()),this.#r.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)}async enqueueMessage(e,{expectStreaming:r=!1}={}){if(this.#s.length>0){let n=this.#s[this.#s.length-1];if(e.type==="USER_INPUT"&&n.message.type==="USER_INPUT"&&e.value===n.message.value)return!0}return this.#r||this.connect(),this.#r?.isConnected?this.#o(e,{expectStreaming:r}):(this.#s.push({message:e,options:{expectStreaming:r}}),this.#e.requestUpdate(),this.#r&&!this.#r.isConnecting&&!this.#r.isConnected&&this.retry(),await is({times:5,delay:2e3},async()=>{if(this.#r?.isConnected){let n=[...this.#s];this.#s=[],this.#e.requestUpdate();let i=!1;for(let{message:s,options:o}of n){let c=this.#o(s,o);s===e&&(i=c)}return i}else throw new Error("WebSocket not connected yet")}).catch(()=>(console.warn("Failed to send message after retries",e),this.#s=[],this.#e.requestUpdate(),!1)))}async sendUserInput(e,{xUserData:r,xCustomInstructions:n,role:i="user",expectStreaming:s=!1,requestInputResponse:o}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:i,xUserData:r,xCustomInstructions:n,requestInputResponse:o},{expectStreaming:s})}async enqueueUserInput(e,{xUserData:r,xCustomInstructions:n,role:i="user",expectStreaming:s=!1,requestInputResponse:o}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:i,xUserData:r,xCustomInstructions:n,requestInputResponse:o},{expectStreaming:s})}sendImageDelete(e){J(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(){this.#o({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(){this.#r?.close(1e3,"closed by user")}retry(){clearTimeout(this.#i),this.#i=setTimeout(()=>{this.#t.onReconnect?.(),this.#r=this.initWS()},1e3*this.#n),this.#n++}initWS(){return new Yt(this.#e,{url:()=>this.#t.url(this.conversationId,{}),onOpen:e=>this.#a(e),onMessage:e=>this.#h(JSON.parse(e.data)),onError:e=>this.#c(e),onClose:e=>this.#l(e)})}#a(e){this.#n=0}#h(e){switch(e.type){case"NEW_MESSAGE":{this.messages=[...this.messages,{...e.message,streaming:!0}].filter((r,n,i)=>n===i.findIndex(s=>s.id===r.id)),this.typingIndicator=void 0,this.#e.requestUpdate(),this.#t.onNewMessage?.(e.message),this.#t.persistConversationState?.(this.conversationId,this.messages);break}case"APPEND_MESSAGE":{let r=this.messages.find(n=>n.id===e.message.id);if(r){switch(e.message.content_type){case"text":{let{part:n,delta:i,position:s}=e.message;r.content=r.content.slice(0,s)+i,r.parts||=[],r.parts[n]={text:r.parts[n]&&"text"in r.parts[n]?(r.parts[n].text||"").slice(0,s)+i:i};break}case"html":{let{part:n,delta:i,position:s}=e.message;r.parts||=[],r.parts[n]={html:r.parts[n]&&"html"in r.parts[n]?(r.parts[n].html||"").slice(0,s)+i:i};break}case"data":{let{part:n}=e.message;r.parts||=[],r.parts[n]={tag:e.message.tag,data:r.parts[n]&&"data"in r.parts[n]?Object.assign(r.parts[n].data||{},e.message.data):e.message.data};break}}e.metadata&&(r.metadata=e.metadata),this.#t.onMessageAppend?.(e),this.#e.requestUpdate()}else throw new Error(`Message with id ${e.message.id} not found`);break}case"MESSAGE_DONE":{let r=this.messages.find(n=>n.id===e.message.id);if(r)Object.assign(r,e.message),r.streaming=!1;else throw new Error(`Message with id ${e.message.id} not found`);this.isStreaming=!1,this.#e.requestUpdate(),this.#t.onMessageDone?.(e,r),this.#t.persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,this.#e.requestUpdate();break}case"ERROR":{this.#t.onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,this.#t.onConnect?.(e.conversationId,e.metadata),this.#t.persistConversationState?.(e.conversationId,e.messages),this.isLiveMode=e.metadata.isLiveMode,this.#e.requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},this.#e.requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,this.#e.requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.ranOutOfCredits=!0,this.#e.requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),this.#e.requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}}#c(e){console.error("onError",e),this.#t.onError?.(e)}#l(e){this.#e.isConnected&&this.#r&&!this.#r.isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,this.#e.requestUpdate(),this.#t.onClose?.()}hostConnected(){this.conversationId=this.#t.restoreConversationState?.()?.conversationId||"",this.messages=this.#t.restoreConversationState?.()?.messages||[]}reset(){this.#t.onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,this.#s=[],this.#e.requestUpdate()}hostDisconnected(){clearTimeout(this.#i)}connect(){this.#r||(this.#r=this.initWS())}reconnectSocket(){this.#r?.close(1e3,"destroy"),this.#r=this.initWS()}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}get isConnected(){return this.#r?.isConnected??!1}};var Gh=Symbol(),za=Symbol();var ss=Object.getPrototypeOf,mn=new WeakMap,Wa=t=>t&&(mn.has(t)?mn.get(t):ss(t)===Object.prototype||ss(t)===Array.prototype);var os=t=>Wa(t)&&t[za]||null,gn=(t,e=!0)=>{mn.set(t,e)};var yn=t=>typeof t=="object"&&t!==null,Ga=t=>yn(t)&&!vn.has(t)&&(Array.isArray(t)||!(Symbol.iterator in t))&&!(t instanceof WeakMap)&&!(t instanceof WeakSet)&&!(t instanceof Error)&&!(t instanceof Number)&&!(t instanceof Date)&&!(t instanceof String)&&!(t instanceof RegExp)&&!(t instanceof ArrayBuffer)&&!(t instanceof Promise),cs=(t,e)=>{let r=as.get(t);if(r?.[0]===e)return r[1];let n=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t));return gn(n,!0),as.set(t,[e,n]),Reflect.ownKeys(t).forEach(i=>{if(Object.getOwnPropertyDescriptor(n,i))return;let s=Reflect.get(t,i),{enumerable:o}=Reflect.getOwnPropertyDescriptor(t,i),c={value:s,enumerable:o,configurable:!0};if(vn.has(s))gn(s,!1);else if(Ie.has(s)){let[l,a]=Ie.get(s);c.value=cs(l,a())}Object.defineProperty(n,i,c)}),Object.preventExtensions(n)},Za=(t,e,r,n)=>({deleteProperty(i,s){let o=Reflect.get(i,s);r(s);let c=Reflect.deleteProperty(i,s);return c&&n(["delete",[s],o]),c},set(i,s,o,c){let l=!t()&&Reflect.has(i,s),a=Reflect.get(i,s,c);if(l&&(ls(a,o)||Qt.has(o)&&ls(a,Qt.get(o))))return!0;r(s),yn(o)&&(o=os(o)||o);let h=!Ie.has(o)&&Ka(o)?bn(o):o;return e(s,h),Reflect.set(i,s,h,c),n(["set",[s],o,a]),!0}}),Ie=new WeakMap,vn=new WeakSet,as=new WeakMap,wn=[1],Qt=new WeakMap,ls=Object.is,Ja=(t,e)=>new Proxy(t,e),Ka=Ga,Ya=cs,Xa=Za;function bn(t={}){if(!yn(t))throw new Error("object required");let e=Qt.get(t);if(e)return e;let r=wn[0],n=new Set,i=(b,x=++wn[0])=>{r!==x&&(s=r=x,n.forEach(w=>w(b,x)))},s=r,o=(b=wn[0])=>(s!==b&&(s=b,l.forEach(([x])=>{let w=x[1](b);w>r&&(r=w)})),r),c=b=>(x,w)=>{let $=[...x];$[1]=[b,...$[1]],i($,w)},l=new Map,a=(b,x)=>{let w=!vn.has(x)&&Ie.get(x);if(w){if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&l.has(b))throw new Error("prop listener already exists");if(n.size){let $=w[2](c(b));l.set(b,[w,$])}else l.set(b,[w])}},h=b=>{var x;let w=l.get(b);w&&(l.delete(b),(x=w[1])==null||x.call(w))},d=b=>(n.add(b),n.size===1&&l.forEach(([w,$],S)=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&$)throw new Error("remove already exists");let T=w[2](c(S));l.set(S,[w,T])}),()=>{n.delete(b),n.size===0&&l.forEach(([w,$],S)=>{$&&($(),l.set(S,[w]))})}),f=!0,p=Xa(()=>f,a,h,i),y=Ja(t,p);Qt.set(t,y);let E=[t,o,d];return Ie.set(y,E),Reflect.ownKeys(t).forEach(b=>{let x=Object.getOwnPropertyDescriptor(t,b);"value"in x&&x.writable&&(y[b]=t[b])}),f=!1,y}function er(t,e,r){let n=Ie.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!n&&console.warn("Please use proxy object");let i,s=[],o=n[2],c=!1,a=o(h=>{if(s.push(h),r){e(s.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,c&&e(s.splice(0))}))});return c=!0,()=>{c=!1,a()}}function ze(t){let e=Ie.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!e&&console.warn("Please use proxy object");let[r,n]=e;return Ya(r,n())}var We=class{#e;#t;#r;#n=()=>{};constructor(e,r){this.#e=e,this.#t=r,this.#r=ze(r),e.addController(this)}get state(){return this.#r}get value(){return this.#r}hostConnected(){this.#n(),this.#n=er(this.#t,()=>{this.#r=ze(this.#t),this.#e.requestUpdate()})}hostDisconnected(){this.#n()}};var me=class{#e;#t;proxyObject;#r;#n=()=>{};constructor(e,r,n){this.#e=e,this.#t=n,this.proxyObject=bn(r),this.#r=ze(this.proxyObject),e.addController(this)}get state(){return this.#r}get value(){return this.#r}hostConnected(){this.#n(),this.#t?.subscribe&&(this.#n=er(this.proxyObject,()=>{this.#r=ze(this.proxyObject),this.#e.requestUpdate()}))}hostDisconnected(){this.#n()}};var tr=class{#e;#t;#r;#n=null;#i=null;constructor(e,{provider:r,tag:n,key:i}){this.#e=e,this.#t=n,this.#r=i,e.addController(this)}get value(){return this.#i?this.#i.value:null}hostConnected(){if(this.#i||(this.#n=Qa(this.#e,this.#t),!this.#n))return;let e=this.#n[this.#r]instanceof me?this.#n[this.#r]:null;e&&(this.#i=new We(this.#e,e.proxyObject))}hostDisconnected(){}};function Qa(t,e){let r=t;for(;r;){let n=r.closest(e);if(n)return n;let i=r.getRootNode();if(i instanceof ShadowRoot)r=i.host;else break}return null}var us=()=>{if(window.Shopify)try{return{customerId:el()}}catch{return null}return null},el=()=>{try{let t=[()=>window.ShopifyAnalytics?.meta?.page?.customerId,()=>window.meta?.page?.customerId,()=>window._st?.cid,()=>window.ShopifyAnalytics?.lib?.user()?.traits()?.uniqToken];for(let e of t)try{let r=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(r))continue;if(r)return r}catch{}}catch{return null}return null},hs=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 ds(t,e="http"){return t.startsWith("http://")||t.startsWith("https://")?t:`${e}://${t}`}function xn(t){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(t)}function ps(t,e){let r=t instanceof URL?t:new URL(t);if(e)for(let[n,i]of e)r.searchParams.set(n,i);return r}var fs=()=>{if(window.ShopRenter)try{let t=rl();return{customerEmail:t?.customerEmail,customerId:t?.customerId,customerName:t?.customerName}}catch{return null}return null},rl=()=>{try{if(window.ShopRenter){let t=window.ShopRenter.customer;return{customerEmail:t?.email,customerId:t?.userId,customerName:[t?.name?.firstName,t?.name?.lastName].filter(Boolean).join(" ")}}return{customerEmail:null,customerId:null,customerName:null}}catch{return{customerEmail:null,customerId:null,customerName:null}}},ms=async()=>{try{let t=window.ShopRenter.shop?.domain;if(!t)return[];let e=ds(t,"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 gs=()=>{if(window.UNAS)try{let t=window.UNAS.customer;return{customerEmail:t?.email,customerId:t?.id}}catch(t){return console.error("Error fetching customer information:",t),null}return null},ws=async()=>new Promise((t,e)=>{try{window.UNAS.getCart(r=>{let i=r.items.map(s=>({id:s.id,name:s.name,quantity:s.quantity,price:s.price,sku:s.sku}));t(i)})}catch(r){console.error("Error fetching cart information:",r),e(r)}});var kn;function Cn(t){return{lang:t?.lang??kn?.lang,message:t?.message,abortEarly:t?.abortEarly??kn?.abortEarly,abortPipeEarly:t?.abortPipeEarly??kn?.abortPipeEarly}}var sl;function ol(t){return sl?.get(t)}var al;function ll(t){return al?.get(t)}var cl;function ul(t,e){return cl?.get(t)?.get(e)}function vs(t){let e=typeof t;return e==="string"?`"${t}"`:e==="number"||e==="bigint"||e==="boolean"?`${t}`:e==="object"||e==="function"?(t&&Object.getPrototypeOf(t)?.constructor?.name)??"null":e}function z(t,e,r,n,i){let s=i&&"input"in i?i.input:r.value,o=i?.expected??t.expects??null,c=i?.received??vs(s),l={kind:t.kind,type:t.type,input:s,expected:o,received:c,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${c}`,requirement:t.requirement,path:i?.path,issues:i?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},a=t.kind==="schema",h=i?.message??t.message??ul(t.reference,l.lang)??(a?ll(l.lang):null)??n.message??ol(l.lang);h!==void 0&&(l.message=typeof h=="function"?h(l):h),a&&(r.typed=!1),r.issues?r.issues.push(l):r.issues=[l]}function W(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},Cn())}}}function hl(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function bs(t,e){let r=[...new Set(t)];return r.length>1?`(${r.join(` ${e} `)})`:r[0]??"never"}var dl=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function $n(t,e){return{kind:"validation",type:"max_length",reference:$n,async:!1,expects:`<=${t}`,requirement:t,message:e,"~run"(r,n){return r.typed&&r.value.length>this.requirement&&z(this,"length",r,n,{received:`${r.value.length}`}),r}}}function Sn(t,e){return{kind:"validation",type:"min_length",reference:Sn,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(r,n){return r.typed&&r.value.length<this.requirement&&z(this,"length",r,n,{received:`${r.value.length}`}),r}}}function pl(t,e,r){return typeof t.fallback=="function"?t.fallback(e,r):t.fallback}function xs(t,e,r){return typeof t.default=="function"?t.default(e,r):t.default}function En(){return{kind:"schema",type:"any",reference:En,expects:"any",async:!1,get"~standard"(){return W(this)},"~run"(t){return t.typed=!0,t}}}function Ge(t,e){return{kind:"schema",type:"array",reference:Ge,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return W(this)},"~run"(r,n){let i=r.value;if(Array.isArray(i)){r.typed=!0,r.value=[];for(let s=0;s<i.length;s++){let o=i[s],c=this.item["~run"]({value:o},n);if(c.issues){let l={type:"array",origin:"value",input:i,key:s,value:o};for(let a of c.issues)a.path?a.path.unshift(l):a.path=[l],r.issues?.push(a);if(r.issues||(r.issues=c.issues),n.abortEarly){r.typed=!1;break}}c.typed||(r.typed=!1),r.value.push(c.value)}}else z(this,"type",r,n);return r}}}function _n(t){return{kind:"schema",type:"boolean",reference:_n,expects:"boolean",async:!1,message:t,get"~standard"(){return W(this)},"~run"(e,r){return typeof e.value=="boolean"?e.typed=!0:z(this,"type",e,r),e}}}function Mn(t){return{kind:"schema",type:"null",reference:Mn,expects:"null",async:!1,message:t,get"~standard"(){return W(this)},"~run"(e,r){return e.value===null?e.typed=!0:z(this,"type",e,r),e}}}function rr(t){return{kind:"schema",type:"number",reference:rr,expects:"number",async:!1,message:t,get"~standard"(){return W(this)},"~run"(e,r){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:z(this,"type",e,r),e}}}function ue(t,e){return{kind:"schema",type:"object",reference:ue,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return W(this)},"~run"(r,n){let i=r.value;if(i&&typeof i=="object"){r.typed=!0,r.value={};for(let s in this.entries){let o=this.entries[s];if(s in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){let c=s in i?i[s]:xs(o),l=o["~run"]({value:c},n);if(l.issues){let a={type:"object",origin:"value",input:i,key:s,value:c};for(let h of l.issues)h.path?h.path.unshift(a):h.path=[a],r.issues?.push(h);if(r.issues||(r.issues=l.issues),n.abortEarly){r.typed=!1;break}}l.typed||(r.typed=!1),r.value[s]=l.value}else if(o.fallback!==void 0)r.value[s]=pl(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(z(this,"key",r,n,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]}),n.abortEarly))break}}else z(this,"type",r,n);return r}}}function Ze(t,e){return{kind:"schema",type:"optional",reference:Ze,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return W(this)},"~run"(r,n){return r.value===void 0&&(this.default!==void 0&&(r.value=xs(this,r,n)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,n)}}}function In(t,e){return{kind:"schema",type:"picklist",reference:In,expects:bs(t.map(vs),"|"),async:!1,options:t,message:e,get"~standard"(){return W(this)},"~run"(r,n){return this.options.includes(r.value)?r.typed=!0:z(this,"type",r,n),r}}}function nr(t,e,r){return{kind:"schema",type:"record",reference:nr,expects:"Object",async:!1,key:t,value:e,message:r,get"~standard"(){return W(this)},"~run"(n,i){let s=n.value;if(s&&typeof s=="object"){n.typed=!0,n.value={};for(let o in s)if(hl(s,o)){let c=s[o],l=this.key["~run"]({value:o},i);if(l.issues){let h={type:"object",origin:"key",input:s,key:o,value:c};for(let d of l.issues)d.path=[h],n.issues?.push(d);if(n.issues||(n.issues=l.issues),i.abortEarly){n.typed=!1;break}}let a=this.value["~run"]({value:c},i);if(a.issues){let h={type:"object",origin:"value",input:s,key:o,value:c};for(let d of a.issues)d.path?d.path.unshift(h):d.path=[h],n.issues?.push(d);if(n.issues||(n.issues=a.issues),i.abortEarly){n.typed=!1;break}}(!l.typed||!a.typed)&&(n.typed=!1),l.typed&&(n.value[l.value]=a.value)}}else z(this,"type",n,i);return n}}}function O(t){return{kind:"schema",type:"string",reference:O,expects:"string",async:!1,message:t,get"~standard"(){return W(this)},"~run"(e,r){return typeof e.value=="string"?e.typed=!0:z(this,"type",e,r),e}}}function ys(t){let e;if(t)for(let r of t)e?e.push(...r.issues):e=r.issues;return e}function Je(t,e){return{kind:"schema",type:"union",reference:Je,expects:bs(t.map(r=>r.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return W(this)},"~run"(r,n){let i,s,o;for(let c of this.options){let l=c["~run"]({value:r.value},n);if(l.typed)if(l.issues)s?s.push(l):s=[l];else{i=l;break}else o?o.push(l):o=[l]}if(i)return i;if(s){if(s.length===1)return s[0];z(this,"type",r,n,{issues:ys(s)}),r.typed=!0}else{if(o?.length===1)return o[0];z(this,"type",r,n,{issues:ys(o)})}return r}}}function ks(t,e,r){let n=t["~run"]({value:e},Cn(r));if(n.issues)throw new dl(n.issues);return n.value}function Cs(t,e){let r={};for(let n in t.entries)r[n]=!e||e.includes(n)?Ze(t.entries[n]):t.entries[n];return{...t,entries:r,get"~standard"(){return W(this)}}}function $s(...t){return{...t[0],pipe:t,get"~standard"(){return W(this)},"~run"(e,r){for(let n of t)if(n.kind!=="metadata"){if(e.issues&&(n.kind==="schema"||n.kind==="transformation")){e.typed=!1;break}(!e.issues||!r.abortEarly&&!r.abortPipeEarly)&&(e=n["~run"](e,r))}return e}}}function xt(t,e,r){let n=t["~run"]({value:e},Cn(r));return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}var Ss=nr(O(),Je([O(),rr(),_n(),Mn()])),Es=$s(O(),Sn(1),$n(5e3)),_s=()=>{try{return window.UNAS?gs():window.Shopify?us():window.ShopRenter?fs():null}catch{return null}},Ms=async()=>{try{return window.UNAS?await ws():window.Shopify?await hs():window.ShopRenter?await ms():[]}catch{return[]}},Ke={schema:ue({conversationId:Ze(O()),messages:Ze(Ge(ue({id:O(),timestamp:rr(),role:In(["user","assistant","support"]),content:O(),parts:Ze(Ge(Je([ue({text:O()}),ue({html:O()}),ue({tag:O(),data:nr(O(),En())})])))})))}),getStorageKey(t){if(!t)throw new Error("widgetId is not set");return`_molin_${t}`},persist(t,e,r){let n=this.getStorageKey(t);localStorage.setItem(n,JSON.stringify({conversationId:e,messages:r}))},restore(t){try{let e=this.getStorageKey(t),r=JSON.parse(localStorage.getItem(e)||"{}"),n=ks(this.schema,r);return{conversationId:n.conversationId||"",messages:n.messages||[]}}catch(e){return console.error("Failed to restore conversation state:",e),{conversationId:"",messages:[]}}},reset(t){let e=this.getStorageKey(t);localStorage.removeItem(e)}};var Ye=class t extends v{static properties={widgetId:{type:String},config:{type:Object},callbacks:{type:Object},xUserData:{type:Object},xCustomInstructions:{type:Object},autoConnect:{type:Boolean}};contextCtrl;constructor(){super(),this.widgetId="",this.config={},this.callbacks={},this.xUserData=void 0,this.xCustomInstructions=void 0,this.autoConnect=!1,this.contextCtrl=new me(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:()=>this.#i.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:this.#i.sendImageDelete.bind(this.#i)})}connectedCallback(){super.connectedCallback(),this.updated()}updated(){this.autoConnect&&this.#i.connect(),Object.assign(this.contextCtrl.proxyObject,{widgetId:this.widgetId,config:this.config,callbacks:this.callbacks,xUserData:this.#t,xCustomInstructions:this.#r,conversationId:this.#i.conversationId,messages:this.#e,isStreaming:this.#i.isStreaming,typingIndicator:this.#i.typingIndicator,ranOutOfCredits:this.#i.ranOutOfCredits,isLiveMode:this.#i.isLiveMode,lastMsg:this.#i.lastMsg,hasQueuedMessages:this.#i.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:this.#i.sendImageDelete.bind(this.#i)}),this.#s()}get#e(){return this.#i?.ranOutOfCredits?[{id:crypto.randomUUID(),role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}]:this.#i?.messages||[]}#t;#r;#n=null;get#i(){return this.#n||(this.#n=new Xt(this,{autoConnect:this.autoConnect,url:e=>{let r=new URL(this.config.wsApiUrl);return r.searchParams.set("widgetId",this.widgetId),r.searchParams.set("conversationId",e),r.searchParams.set("pageUrl",window.location.href),r},onReconnect:()=>{},onError:e=>{console.error("ws error",e)},onClose:()=>{},onNewMessage:e=>{e.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:e,conversationId:this.#i.conversationId})},onMessageAppend:e=>{},onMessageDone:(e,r)=>{r.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:r.content??"",message:r,usage_TOKENS_COMPLETION:e.message.usage.TOKENS_COMPLETION,conversationId:this.#i.conversationId})},onMessageError:e=>{console.error("ws message error",e),e.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+e.message})},onReset:()=>{Ke.reset(this.widgetId)},onConnect:(e,r)=>{let n=_s();this.#i.sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:n,language:window.navigator.language,cart:[]}),Ms().then(i=>{i?.length>0&&this.#i.sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:n,cart:i,language:window.navigator.language})}).catch(i=>{console.error(i)}),this.dispatchEvent(new t.ConnectedEvent({conversationId:e,metadata:r,widgetId:this.widgetId,pendingImages:r?.pendingImages||[]}))},persistConversationState:(e,r)=>{Ke.persist(this.widgetId,e,r)},restoreConversationState:()=>Ke.restore(this.widgetId)})),this.#n}#s(){function e(n){if(!n)return;let i;try{i=typeof n=="object"?n:JSON.parse(n)}catch(o){console.error("Molin: user-data is not valid JSON",o);return}if(!i||typeof i!="object"||Object.keys(i).length===0)return;let s=xt(Ss,i);if(!s.success){console.error("Molin: user-data does not pass schema validation",s.issues);return}return s.output}function r(n){if(!n)return;let i=xt(Es,n);if(!i.success){console.error("Molin: custom-instructions does not pass schema validation",i.issues);return}return i.output}this.#t=e(this.xUserData),this.#r=r(this.xCustomInstructions)}async sendUserInput(e,r={}){let n={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,...r},i=await this.#i.sendUserInput(e,n);return i&&this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:e,example:!1,conversationId:this.#i.conversationId}),i}async enqueueUserInput(e,r={}){let n={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,role:"user",expectStreaming:!0,...r};return this.#i.enqueueUserInput(e,n)}sendUserCancel(){this.#i.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}sendUserTypingStart(){this.#i.sendUserTypingStart()}sendUserTypingStop(){this.#i.sendUserTypingStop()}sendNewChat(){this.#i.sendNewChat()}reset(){this.#i.reset()}reloadConfig(){this.#i.reloadConfig()}connect(){this.#i.connect()}render(){return u`<slot></slot>`}};function Is(t){let e=new tr(t,{provider:Ye,tag:"mw-context-widget",key:"contextCtrl"});return new Proxy({value:null},{get(r,n){if(n==="value")return e.value}})}Ye.ConnectedEvent=class extends CustomEvent{static type="mw-context-widget:connected";constructor(e,r={}){super(Ye.ConnectedEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};customElements.get("mw-context-widget")||customElements.define("mw-context-widget",Ye);function Bn(t){return[...t.v,(t.i?"!":"")+t.n].join(":")}function fl(t,e=","){return t.map(Bn).join(e)}var Us=typeof CSS<"u"&&CSS.escape||(t=>t.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function sr(t){for(var e=9,r=t.length;r--;)e=Math.imul(e^t.charCodeAt(r),1597334677);return"#"+((e^e>>>9)>>>0).toString(36)}function lr(t,e="@media "){return e+I(t).map(r=>(typeof r=="string"&&(r={min:r}),r.raw||Object.keys(r).map(n=>`(${n}-width:${r[n]})`).join(" and "))).join(",")}function I(t=[]){return Array.isArray(t)?t:t==null?[]:[t]}function As(t){return t}function cr(){}var P={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function Ps(t){return t.match(/[-=:;]/g)?.length||0}function Dn(t){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(t)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(Ps(t),15)<<18}var ml=["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 qn({n:t,i:e,v:r=[]},n,i,s){t&&(t=Bn({n:t,i:e,v:r})),s=[...I(s)];for(let c of r){let l=n.theme("screens",c);for(let a of I(l&&lr(l)||n.v(c))){var o;s.push(a),i|=l?67108864|Dn(a):c=="dark"?1073741824:a[0]=="@"?Dn(a):(o=a,1<<~(/:([a-z-]+)/.test(o)&&~ml.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:t,p:i,r:s,i:e}}var Rs=new Map;function On(t){if(t.d){let e=[],r=An(t.r.reduce((n,i)=>i[0]=="@"?(e.push(i),n):i?An(n,s=>An(i,o=>{let c=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(o);if(c){let l=s.indexOf(c[1]);return~l?s.slice(0,l)+c[0]+s.slice(l+c[1].length):Tn(s,o)}return Tn(o,s)})):n,"&"),n=>Tn(n,t.n?"."+Us(t.n):""));return r&&e.push(r.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((n,i)=>i+"{"+n+"}",t.d)}}function An(t,e){return t.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(r,n,i)=>e(n)+i)}function Tn(t,e){return t.replace(/&/g,e)}var Ts=new Intl.Collator("en",{numeric:!0});function Bs(t,e){for(var r=0,n=t.length;r<n;){let i=n+r>>1;0>=qs(t[i],e)?r=i+1:n=i}return n}function qs(t,e){let r=t.p&P.o;return r==(e.p&P.o)&&(r==P.b||r==P.o)?0:t.p-e.p||t.o-e.o||Ts.compare(Ls(t.n),Ls(e.n))||Ts.compare(js(t.n),js(e.n))}function Ls(t){return(t||"").split(/:/).pop().split("/").pop()||"\0"}function js(t){return(t||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function Ln(t,e){return Math.round(parseInt(t,16)*e)}function K(t,e={}){if(typeof t=="function")return t(e);let{opacityValue:r="1",opacityVariable:n}=e,i=n?`var(${n})`:r;if(t.includes("<alpha-value>"))return t.replace("<alpha-value>",i);if(t[0]=="#"&&(t.length==4||t.length==7)){let s=(t.length-1)/3,o=[17,1,.062272][s-1];return`rgba(${[Ln(t.substr(1,s),o),Ln(t.substr(1+s,s),o),Ln(t.substr(1+2*s,s),o),i]})`}return i=="1"?t:i=="0"?"#0000":t.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${i})`)}function Fs(t,e,r,n,i=[]){return(function s(o,{n:c,p:l,r:a=[],i:h},d){let f=[],p="",y=0,E=0;for(let w in o||{}){var b,x;let $=o[w];if(w[0]=="@"){if(!$)continue;if(w[1]=="a"){f.push(...Vn(c,l,ar(""+$),d,l,a,h,!0));continue}if(w[1]=="l"){for(let S of I($))f.push(...s(S,{n:c,p:(b=P[w[7]],l&~P.o|b),r:w[7]=="d"?[]:a,i:h},d));continue}if(w[1]=="i"){f.push(...I($).map(S=>({p:-1,o:0,r:[],d:w+" "+S})));continue}if(w[1]=="k"){f.push({p:P.d,o:0,r:[w],d:s($,{p:P.d},d).map(On).join("")});continue}if(w[1]=="f"){f.push(...I($).map(S=>({p:P.d,o:0,r:[w],d:s(S,{p:P.d},d).map(On).join("")})));continue}}if(typeof $!="object"||Array.isArray($))w=="label"&&$?c=$+sr(JSON.stringify([l,h,o])):($||$===0)&&(w=w.replace(/[A-Z]/g,S=>"-"+S.toLowerCase()),E+=1,y=Math.max(y,(x=w)[0]=="-"?0:Ps(x)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(x)?+!!RegExp.$1||-!!RegExp.$2:0)+1),p+=(p?";":"")+I($).map(S=>d.s(w,Fn(""+S,d.theme)+(h?" !important":""))).join(";"));else if(w[0]=="@"||w.includes("&")){let S=l;w[0]=="@"&&(w=w.replace(/\bscreen\(([^)]+)\)/g,(T,U)=>{let B=d.theme("screens",U);return B?(S|=67108864,lr(B,"")):T}),S|=Dn(w)),f.push(...s($,{n:c,p:S,r:[...a,w],i:h},d))}else f.push(...s($,{p:l,r:[...a,w]},d))}return f.unshift({n:c,p:l,o:Math.max(0,15-E)+1.5*Math.min(y||15,15),r:a,d:p}),f.sort(qs)})(t,qn(e,r,n,i),r)}function Fn(t,e){return t.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(r,n,i,s,o="")=>{let c=e(i,o);return typeof c=="function"&&/color|fill|stroke/i.test(i)?K(c):""+I(c).filter(l=>Object(l)!==l)})}function Vs(t,e){let r,n=[];for(let i of t)i.d&&i.n?r?.p==i.p&&""+r.r==""+i.r?(r.c=[r.c,i.c].filter(Boolean).join(" "),r.d=r.d+";"+i.d):n.push(r={...i,n:i.n&&e}):n.push({...i,n:i.n&&e});return n}function or(t,e,r=P.u,n,i){let s=[];for(let o of t)for(let c of(function(l,a,h,d,f){l={...l,i:l.i||f};let p=(function(y,E){let b=Rs.get(y.n);return b?b(y,E):E.r(y.n,y.v[0]=="dark")})(l,a);return p?typeof p=="string"?({r:d,p:h}=qn(l,a,h,d),Vs(or(ar(p),a,h,d,l.i),l.n)):Array.isArray(p)?p.map(y=>{var E,b;return{o:0,...y,r:[...I(d),...I(y.r)],p:(E=h,b=y.p??h,E&~P.o|b)}}):Fs(p,l,a,h,d):[{c:Bn(l),p:0,o:0,r:[]}]})(o,e,r,n,i))s.splice(Bs(s,c),0,c);return s}function Vn(t,e,r,n,i,s,o,c){return Vs((c?r.flatMap(l=>or([l],n,i,s,o)):or(r,n,i,s,o)).map(l=>l.p&P.o&&(l.n||e==P.b)?{...l,p:l.p&~P.o|e,o:0}:l),t)}function gl(t,e,r,n){var i;return i=(s,o)=>{let{n:c,p:l,r:a,i:h}=qn(s,o,e);return r&&Vn(c,e,r,o,l,a,h,n)},Rs.set(t,i),t}function jn(t,e,r){if(t[t.length-1]!="("){let n=[],i=!1,s=!1,o="";for(let c of t)if(!(c=="("||/[~@]$/.test(c))){if(c[0]=="!"&&(c=c.slice(1),i=!i),c.endsWith(":")){n[c=="dark:"?"unshift":"push"](c.slice(0,-1));continue}c[0]=="-"&&(c=c.slice(1),s=!s),c.endsWith("-")&&(c=c.slice(0,-1)),c&&c!="&"&&(o+=(o&&"-")+c)}o&&(s&&(o="-"+o),e[0].push({n:o,v:n.filter(wl),i}))}}function wl(t,e,r){return r.indexOf(t)==e}var Ds=new Map;function ar(t){let e=Ds.get(t);if(!e){let r=[],n=[[]],i=0,s=0,o=null,c=0,l=(a,h=0)=>{i!=c&&(r.push(t.slice(i,c+h)),a&&jn(r,n)),i=c+1};for(;c<t.length;c++){let a=t[c];if(s)t[c-1]!="\\"&&(s+=+(a=="[")||-(a=="]"));else if(a=="[")s+=1;else if(o)t[c-1]!="\\"&&o.test(t.slice(c))&&(o=null,i=c+RegExp.lastMatch.length);else if(a=="/"&&t[c-1]!="\\"&&(t[c+1]=="*"||t[c+1]=="/"))o=t[c+1]=="*"?/^\*\//:/^[\r\n]/;else if(a=="(")l(),r.push(a);else if(a==":")t[c+1]!=":"&&l(!1,1);else if(/[\s,)]/.test(a)){l(!0);let h=r.lastIndexOf("(");if(a==")"){let d=r[h-1];if(/[~@]$/.test(d)){let f=n.shift();r.length=h,jn([...r,"#"],n);let{v:p}=n[0].pop();for(let y of f)y.v.splice(+(y.v[0]=="dark")-+(p[0]=="dark"),p.length);jn([...r,gl(d.length>1?d.slice(0,-1)+sr(JSON.stringify([d,f])):d+"("+fl(f)+")",P.a,f,/@$/.test(d))],n)}h=r.lastIndexOf("(",h-1)}r.length=h+1}else/[~@]/.test(a)&&t[c+1]=="("&&n.unshift([])}l(!0),Ds.set(t,e=n[0])}return e}function m(t,e,r){return[t,Un(e,r)]}function Un(t,e){return typeof t=="function"?t:typeof t=="string"&&/^[\w-]+$/.test(t)?(r,n)=>({[t]:e?e(r,n):Pn(r,1)}):r=>t||{[r[1]]:Pn(r,2)}}function Pn(t,e,r=t.slice(e).find(Boolean)||t.$$||t.input){return t.input[0]=="-"?`calc(${r} * -1)`:r}function g(t,e,r,n){return[t,Nn(e,r,n)]}function Nn(t,e,r){let n=typeof e=="string"?(i,s)=>({[e]:r?r(i,s):i._}):e||(({1:i,_:s},o,c)=>({[i||c]:s}));return(i,s)=>{let o=Ns(t||i[1]),c=s.theme(o,i.$$)??ne(i.$$,o,s);if(c!=null)return i._=Pn(i,0,c),n(i,s,o)}}function R(t,e={},r){return[t,yl(e,r)]}function yl(t={},e){return(r,n)=>{let{section:i=Ns(r[0]).replace("-","")+"Color"}=t,[s,o]=vl(r.$$);if(!s)return;let c=n.theme(i,s)||ne(s,i,n);if(!c||typeof c=="object")return;let{opacityVariable:l=`--tw-${r[0].replace(/-$/,"")}-opacity`,opacitySection:a=i.replace("Color","Opacity"),property:h=i,selector:d}=t,f=n.theme(a,o||"DEFAULT")||o&&ne(o,a,n),p=e||(({_:E})=>{let b=kt(h,E);return d?{[d]:b}:b});r._={value:K(c,{opacityVariable:l||void 0,opacityValue:f||void 0}),color:E=>K(c,E),opacityVariable:l||void 0,opacityValue:f||void 0};let y=p(r,n);if(!r.dark){let E=n.d(i,s,c);E&&E!==c&&(r._={value:K(E,{opacityVariable:l||void 0,opacityValue:f||"1"}),color:b=>K(E,b),opacityVariable:l||void 0,opacityValue:f||void 0},y={"&":y,[n.v("dark")]:p(r,n)})}return y}}function vl(t){return(t.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function kt(t,e){let r={};return typeof e=="string"?r[t]=e:(e.opacityVariable&&e.value.includes(e.opacityVariable)&&(r[e.opacityVariable]=e.opacityValue||"1"),r[t]=e.value),r}function ne(t,e,r){if(t[0]=="["&&t.slice(-1)=="]"){if(t=Xe(Fn(t.slice(1,-1),r.theme)),!e)return t;if(!(/color|fill|stroke/i.test(e)&&!(/^color:/.test(t)||/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(t))||/image/i.test(e)&&!(/^image:/.test(t)||/^[a-z-]+\(/.test(t))||/weight/i.test(e)&&!(/^(number|any):/.test(t)||/^\d+$/.test(t))||/position/i.test(e)&&/^(length|size):/.test(t)))return t.replace(/^[a-z-]+:/,"")}}function Ns(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function Xe(t){return t.includes("url(")?t.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,r="",n,i="")=>Xe(r)+n+Xe(i)):t.replace(/(^|[^\\])_+/g,(e,r)=>r+" ".repeat(e.length-r.length)).replace(/\\_/g,"_").replace(/(calc|min|max|clamp)\(.+\)/g,e=>e.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 "))}function Ct({presets:t=[],...e}){let r={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:I(e.variants),rules:I(e.rules),ignorelist:I(e.ignorelist),hash:void 0,stringify:(n,i)=>n+":"+i,finalize:[]};for(let n of I([...t,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&I(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:i,darkMode:s=r.darkMode,darkColor:o=r.darkColor,theme:c,variants:l,rules:a,ignorelist:h,hash:d=r.hash,stringify:f=r.stringify,finalize:p}=typeof n=="function"?n(r):n;r={preflight:r.preflight!==!1&&i!==!1&&[...r.preflight,...I(i)],darkMode:s,darkColor:o,theme:{...r.theme,...c,extend:{...r.theme.extend,...c?.extend}},variants:[...r.variants,...I(l)],rules:[...r.rules,...I(a)],ignorelist:[...r.ignorelist,...I(h)],hash:d,stringify:f,finalize:[...r.finalize,...I(p)]}}return r}function Os(t,e,r,n,i,s){for(let o of e){let c=r.get(o);c||r.set(o,c=n(o));let l=c(t,i,s);if(l)return l}}function bl(t){var e;return Rn(t[0],typeof(e=t[1])=="function"?e:()=>e)}function xl(t){var e,r;return Array.isArray(t)?Rn(t[0],Un(t[1],t[2])):Rn(t,Un(e,r))}function Rn(t,e){return Hs(t,(r,n,i,s)=>{let o=n.exec(r);if(o)return o.$$=r.slice(o[0].length),o.dark=s,e(o,i)})}function Hs(t,e){let r=I(t).map(kl);return(n,i,s)=>{for(let o of r){let c=e(n,o,i,s);if(c)return c}}}function kl(t){return typeof t=="string"?RegExp("^"+t+(t.includes("$")||t.slice(-1)=="-"?"":"$")):t}function zs(t,e){let r=Ct(t),n=(function({theme:l,darkMode:a,darkColor:h=cr,variants:d,rules:f,hash:p,stringify:y,ignorelist:E,finalize:b}){let x=new Map,w=new Map,$=new Map,S=new Map,T=Hs(E,(M,q)=>q.test(M));d.push(["dark",Array.isArray(a)||a=="class"?`${I(a)[1]||".dark"} &`:typeof a=="string"&&a!="media"?a:"@media (prefers-color-scheme:dark)"]);let U=typeof p=="function"?M=>p(M,sr):p?sr:As;U!==As&&b.push(M=>({...M,n:M.n&&U(M.n),d:M.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(q,N)=>"--"+U(N).replace("#",""))}));let B={theme:(function({extend:M={},...q}){let N={},Zr={get colors(){return xe("colors")},theme:xe,negative(){return{}},breakpoints(j){let F={};for(let H in j)typeof j[H]=="string"&&(F["screen-"+H]=j[H]);return F}};return xe;function xe(j,F,H,ht){if(j){if({1:j,2:ht}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(j)||[,j],/[.[]/.test(j)){let ae=[];j.replace(/\[([^\]]+)\]|([^.[]+)/g,(Ce,pt,$a=pt)=>ae.push($a)),j=ae.shift(),H=F,F=ae.join("-")}let re=N[j]||Object.assign(Object.assign(N[j]={},qt(q,j)),qt(M,j));if(F==null)return re;F||(F="DEFAULT");let ke=re[F]??F.split("-").reduce((ae,Ce)=>ae?.[Ce],re)??H;return ht?K(ke,{opacityValue:Fn(ht,xe)}):ke}let dt={};for(let re of[...Object.keys(q),...Object.keys(M)])dt[re]=xe(re);return dt}function qt(j,F){let H=j[F];return typeof H=="function"&&(H=H(Zr)),H&&/color|fill|stroke/i.test(F)?(function ht(dt,re=[]){let ke={};for(let ae in dt){let Ce=dt[ae],pt=[...re,ae];ke[pt.join("-")]=Ce,ae=="DEFAULT"&&(pt=re,ke[re.join("-")]=Ce),typeof Ce=="object"&&Object.assign(ke,ht(Ce,pt))}return ke})(H):H}})(l),e:Us,h:U,s(M,q){return y(M,q,B)},d(M,q,N){return h(M,q,B,N)},v(M){return x.has(M)||x.set(M,Os(M,d,w,bl,B)||"&:"+M),x.get(M)},r(M,q){let N=JSON.stringify([M,q]);return $.has(N)||$.set(N,!T(M,B)&&Os(M,f,S,xl,B,q)),$.get(N)},f(M){return b.reduce((q,N)=>N(q,B),M)}};return B})(r),i=new Map,s=[],o=new Set;e.resume(l=>i.set(l,l),(l,a)=>{e.insert(l,s.length,a),s.push(a),o.add(l)});function c(l){let a=n.f(l),h=On(a);if(h&&!o.has(h)){o.add(h);let d=Bs(s,l);e.insert(h,d,l),s.splice(d,0,l)}return a.n}return Object.defineProperties(function(a){if(!i.size)for(let d of I(r.preflight))typeof d=="function"&&(d=d(n)),d&&(typeof d=="string"?Vn("",P.b,ar(d),n,P.b,[],!1,!0):Fs(d,{},n,P.b)).forEach(c);a=""+a;let h=i.get(a);if(!h){let d=new Set;for(let f of or(ar(a),n))d.add(f.c).add(c(f));h=[...d].filter(Boolean).join(" "),i.set(a,h).set(h,h)}return h},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:n.theme,config:r,snapshot(){let l=e.snapshot(),a=new Set(o),h=new Map(i),d=[...s];return()=>{l(),o=a,i=h,s=d}},clear(){e.clear(),o=new Set,i=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function Cl(t,e){return t!=e&&""+t.split(" ").sort()!=""+e.split(" ").sort()}function Ws(t){let e=new MutationObserver(r);return{observe(i){e.observe(i,{attributeFilter:["class"],subtree:!0,childList:!0}),n(i),r([{target:i,type:""}])},disconnect(){e.disconnect()}};function r(i){for(let{type:s,target:o}of i)if(s[0]=="a")n(o);else for(let c of o.querySelectorAll("[class]"))n(c);e.takeRecords()}function n(i){let s,o=i.getAttribute?.("class");o&&Cl(o,s=t(o))&&i.setAttribute("class",s)}}function $l(t){let e=document.querySelector(t||'style[data-twind=""]');return(!e||e.tagName!="STYLE")&&(e=document.createElement("style"),document.head.prepend(e)),e.dataset.twind="claimed",e}function ur(t){let e=t?.cssRules?t:(t&&typeof t!="string"?t:$l(t)).sheet;return{target:e,snapshot(){let r=Array.from(e.cssRules,n=>n.cssText);return()=>{this.clear(),r.forEach(this.insert)}},clear(){for(let r=e.cssRules.length;r--;)e.deleteRule(r)},destroy(){e.ownerNode?.remove()},insert(r,n){try{e.insertRule(r,n)}catch{e.insertRule(":root{}",n)}},resume:cr}}var Sl=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 Gs(t){return Sl.get(t)}function Zs(t){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(t);return e?e[1]?1:e[2]?2:e[3]?3:5:0}function Js(t,e){var r=/^(?:(pos)|(cli)|(background-i)|(flex(?:$|-b)|(?:max-|min-)?(?:block-s|inl|he|widt))|dis)/i.exec(t);return r?r[1]?/^sti/i.test(e)?1:0:r[2]?/^pat/i.test(e)?1:0:r[3]?/^image-/i.test(e)?1:0:r[4]?e[3]==="-"?2:0:/^(?:inline-)?grid$/i.test(e)?4:0:0}var El=[["-webkit-",1],["-moz-",2],["-ms-",4]];function hr(){return({stringify:t})=>({stringify(e,r,n){let i="",s=Gs(e);s&&(i+=t(s,r,n)+";");let o=Zs(e),c=Js(e,r);for(let l of El)o&l[1]&&(i+=t(l[0]+e,r,n)+";"),c&l[1]&&(i+=t(e,l[0]+r,n)+";");return i+t(e,r,n)}})}function dr(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",Nn("lineClamp",({_:t})=>Ks(t))],["line-clamp-(\\d+)",({1:t})=>Ks(t)]]}}function Ks(t){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${t}`}}var St={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",...G(4,"rem",4,.5,.5),...G(12,"rem",4,5),14:"3.5rem",...G(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:_("blur"),backdropBrightness:_("brightness"),backdropContrast:_("contrast"),backdropGrayscale:_("grayscale"),backdropHueRotate:_("hueRotate"),backdropInvert:_("invert"),backdropOpacity:_("opacity"),backdropSaturate:_("saturate"),backdropSepia:_("sepia"),backgroundColor:_("colors"),backgroundImage:{none:"none"},backgroundOpacity:_("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:{...G(200,"",100,0,50),...G(110,"",100,90,5),75:"0.75",125:"1.25"},borderColor:({theme:t})=>({DEFAULT:t("colors.gray.200","currentColor"),...t("colors")}),borderOpacity:_("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:_("spacing"),borderWidth:{DEFAULT:"1px",...Y(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:_("colors"),caretColor:_("colors"),accentColor:({theme:t})=>({auto:"auto",...t("colors")}),contrast:{...G(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:_("borderColor"),divideOpacity:_("borderOpacity"),divideWidth:_("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:t})=>({...t("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:t})=>({...t("spacing"),...$t(2,6),...$t(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:_("spacing"),gradientColorStops:_("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:t})=>({...t("spacing"),...$t(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:t})=>({...t("spacing"),...$t(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:{...G(10,"rem",4,3),none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2"},margin:({theme:t})=>({auto:"auto",...t("spacing")}),maxHeight:({theme:t})=>({full:"100%",min:"min-content",max:"max-content",fit:"fit-content",screen:"100vh",...t("spacing")}),maxWidth:({theme:t,breakpoints:e})=>({...e(t("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:{...G(100,"",100,0,10),5:"0.05",25:"0.25",75:"0.75",95:"0.95"},order:{first:"-9999",last:"9999",none:"0"},padding:_("spacing"),placeholderColor:_("colors"),placeholderOpacity:_("opacity"),outlineColor:_("colors"),outlineOffset:Y(8,"px"),outlineWidth:Y(8,"px"),ringColor:({theme:t})=>({...t("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:_("colors"),ringOffsetWidth:Y(8,"px"),ringOpacity:({theme:t})=>({...t("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...Y(8,"px")},rotate:{...Y(2,"deg"),...Y(12,"deg",3),...Y(180,"deg",45)},saturate:G(200,"",100,0,50),scale:{...G(150,"",100,0,50),...G(110,"",100,90,5),75:"0.75",125:"1.25"},scrollMargin:_("spacing"),scrollPadding:_("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...Y(2,"deg"),...Y(12,"deg",3)},space:_("spacing"),stroke:({theme:t})=>({...t("colors"),none:"none"}),strokeWidth:G(2),textColor:_("colors"),textDecorationColor:_("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...Y(8,"px")},textUnderlineOffset:{auto:"auto",...Y(8,"px")},textIndent:_("spacing"),textOpacity:_("opacity"),transitionDuration:({theme:t})=>({...t("durations"),DEFAULT:"150ms"}),transitionDelay:_("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:t})=>({...t("spacing"),...$t(2,4),full:"100%"}),width:({theme:t})=>({min:"min-content",max:"max-content",fit:"fit-content",screen:"100vw",...t("flexBasis")}),willChange:{scroll:"scroll-position"},zIndex:{...G(50,"",1,0,10),auto:"auto"}};function $t(t,e){let r={};do for(var n=1;n<t;n++)r[`${n}/${t}`]=Number((n/t*100).toFixed(6))+"%";while(++t<=e);return r}function Y(t,e,r=0){let n={};for(;r<=t;r=2*r||1)n[r]=r+e;return n}function G(t,e="",r=1,n=0,i=1,s={}){for(;n<=t;n+=i)s[n]=n/r+e;return s}function _(t){return({theme:e})=>e(t)}var Ys={"*,::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, ${St.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, ${St.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 no=[m("\\[([-\\w]+):(.+)]",({1:t,2:e},r)=>({"@layer overrides":{"&":{[t]:ne(`[${e}]`,"",r)}}})),m("(group|peer)([~/][^-[]+)?",({input:t},{h:e})=>[{c:e(t)}]),g("aspect-","aspectRatio"),m("container",(t,{theme:e})=>{let{screens:r=e("screens"),center:n,padding:i}=e("container"),s={width:"100%",marginRight:n&&"auto",marginLeft:n&&"auto",...o("xs")};for(let c in r){let l=r[c];typeof l=="string"&&(s[lr(l)]={"&":{maxWidth:l,...o(c)}})}return s;function o(c){let l=i&&(typeof i=="string"?i:i[c]||i.DEFAULT);if(l)return{paddingRight:l,paddingLeft:l}}}),g("content-","content",({_:t})=>({"--tw-content":t,content:"var(--tw-content)"})),m("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),m("box-(border|content)","boxSizing",({1:t})=>t+"-box"),m("hidden",{display:"none"}),m("table-(auto|fixed)","tableLayout"),m(["(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)",m("isolate","isolation"),m("object-(contain|cover|fill|none|scale-down)","objectFit"),g("object-","objectPosition"),m("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",pr),m("overscroll(-[xy])?-(auto|contain|none)",({1:t="",2:e})=>({["overscroll-behavior"+t]:e})),m("(static|fixed|absolute|relative|sticky)","position"),g("-?inset(-[xy])?(?:$|-)","inset",({1:t,_:e})=>({top:t!="-x"&&e,right:t!="-y"&&e,bottom:t!="-x"&&e,left:t!="-y"&&e})),g("-?(top|bottom|left|right)(?:$|-)","inset"),m("(visible|collapse)","visibility"),m("invisible",{visibility:"hidden"}),g("-?z-","zIndex"),m("flex-((row|col)(-reverse)?)","flexDirection",Xs),m("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),g("(flex-(?:grow|shrink))(?:$|-)"),g("(flex)-"),g("grow(?:$|-)","flexGrow"),g("shrink(?:$|-)","flexShrink"),g("basis-","flexBasis"),g("-?(order)-"),"-?(order)-(\\d+)",g("grid-cols-","gridTemplateColumns"),m("grid-cols-(\\d+)","gridTemplateColumns",ro),g("col-","gridColumn"),m("col-(span)-(\\d+)","gridColumn",to),g("col-start-","gridColumnStart"),m("col-start-(auto|\\d+)","gridColumnStart"),g("col-end-","gridColumnEnd"),m("col-end-(auto|\\d+)","gridColumnEnd"),g("grid-rows-","gridTemplateRows"),m("grid-rows-(\\d+)","gridTemplateRows",ro),g("row-","gridRow"),m("row-(span)-(\\d+)","gridRow",to),g("row-start-","gridRowStart"),m("row-start-(auto|\\d+)","gridRowStart"),g("row-end-","gridRowEnd"),m("row-end-(auto|\\d+)","gridRowEnd"),m("grid-flow-((row|col)(-dense)?)","gridAutoFlow",t=>pr(Xs(t))),m("grid-flow-(dense)","gridAutoFlow"),g("auto-cols-","gridAutoColumns"),g("auto-rows-","gridAutoRows"),g("gap-x(?:$|-)","gap","columnGap"),g("gap-y(?:$|-)","gap","rowGap"),g("gap(?:$|-)","gap"),"(justify-(?:items|self))-",m("justify-","justifyContent",Qs),m("(content|items|self)-",t=>({["align-"+t[1]]:Qs(t)})),m("(place-(content|items|self))-",({1:t,$$:e})=>({[t]:("wun".includes(e[3])?"space-":"")+e})),g("p([xytrbl])?(?:$|-)","padding",Qe("padding")),g("-?m([xytrbl])?(?:$|-)","margin",Qe("margin")),g("-?space-(x|y)(?:$|-)","space",({1:t,_:e})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"0",["margin-"+{y:"top",x:"left"}[t]]:`calc(${e} * calc(1 - var(--tw-space-${t}-reverse)))`,["margin-"+{y:"bottom",x:"right"}[t]]:`calc(${e} * var(--tw-space-${t}-reverse))`}})),m("space-(x|y)-reverse",({1:t})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"1"}})),g("w-","width"),g("min-w-","minWidth"),g("max-w-","maxWidth"),g("h-","height"),g("min-h-","minHeight"),g("max-h-","maxHeight"),g("font-","fontWeight"),g("font-","fontFamily",({_:t})=>typeof(t=I(t))[1]=="string"?{fontFamily:te(t)}:{fontFamily:te(t[0]),...t[1]}),m("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),m("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),m("italic","fontStyle"),m("not-italic",{fontStyle:"normal"}),m("(ordinal|slashed-zero|(normal|lining|oldstyle|proportional|tabular)-nums|(diagonal|stacked)-fractions)",({1:t,2:e="",3:r})=>e=="normal"?{fontVariantNumeric:"normal"}:{["--tw-"+(r?"numeric-fraction":"pt".includes(e[0])?"numeric-spacing":e?"numeric-figure":t)]:t,fontVariantNumeric:"var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)",...ge({"--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,/*!*/ /*!*/)"})}),g("tracking-","letterSpacing"),g("leading-","lineHeight"),m("list-(inside|outside)","listStylePosition"),g("list-","listStyleType"),m("list-","listStyleType"),g("placeholder-opacity-","placeholderOpacity",({_:t})=>({"&::placeholder":{"--tw-placeholder-opacity":t}})),R("placeholder-",{property:"color",selector:"&::placeholder"}),m("text-(left|center|right|justify|start|end)","textAlign"),m("text-(ellipsis|clip)","textOverflow"),g("text-opacity-","textOpacity","--tw-text-opacity"),R("text-",{property:"color"}),g("text-","fontSize",({_:t})=>typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}),g("indent-","textIndent"),m("(overline|underline|line-through)","textDecorationLine"),m("no-underline",{textDecorationLine:"none"}),g("underline-offset-","textUnderlineOffset"),R("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),g("decoration-","textDecorationThickness"),m("decoration-","textDecorationStyle"),m("(uppercase|lowercase|capitalize)","textTransform"),m("normal-case",{textTransform:"none"}),m("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),m("align-","verticalAlign"),m("whitespace-","whiteSpace"),m("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),m("break-words",{overflowWrap:"break-word"}),m("break-all",{wordBreak:"break-all"}),m("break-keep",{wordBreak:"keep-all"}),R("caret-",{opacityVariable:!1,opacitySection:"opacity"}),R("accent-",{opacityVariable:!1,opacitySection:"opacity"}),m("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:t})=>`linear-gradient(to ${Ae(t," ")},var(--tw-gradient-stops))`),R("from-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-gradient-from":t.value,"--tw-gradient-to":t.color({opacityValue:"0"}),"--tw-gradient-stops":"var(--tw-gradient-from),var(--tw-gradient-to)"})),R("via-",{section:"gradientColorStops",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-gradient-to":t.color({opacityValue:"0"}),"--tw-gradient-stops":`var(--tw-gradient-from),${t.value},var(--tw-gradient-to)`})),R("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),m("bg-(fixed|local|scroll)","backgroundAttachment"),m("bg-origin-(border|padding|content)","backgroundOrigin",({1:t})=>t+"-box"),m(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),m("bg-blend-","backgroundBlendMode"),m("bg-clip-(border|padding|content|text)","backgroundClip",({1:t})=>t+(t=="text"?"":"-box")),g("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),R("bg-",{section:"backgroundColor"}),g("bg-","backgroundImage"),g("bg-","backgroundPosition"),m("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",pr),g("bg-","backgroundSize"),g("rounded(?:$|-)","borderRadius"),g("rounded-([trbl]|[tb][rl])(?:$|-)","borderRadius",({1:t,_:e})=>{let r={t:["tl","tr"],r:["tr","br"],b:["bl","br"],l:["bl","tl"]}[t]||[t,t];return{[`border-${Ae(r[0])}-radius`]:e,[`border-${Ae(r[1])}-radius`]:e}}),m("border-(collapse|separate)","borderCollapse"),g("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),m("border-(solid|dashed|dotted|double|none)","borderStyle"),g("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:t,_:e})=>({...ge({"--tw-border-spacing-x":"0","--tw-border-spacing-y":"0"}),["--tw-border-spacing"+(t||"-x")]:e,["--tw-border-spacing"+(t||"-y")]:e,"border-spacing":"var(--tw-border-spacing-x) var(--tw-border-spacing-y)"})),R("border-([xytrbl])-",{section:"borderColor"},Qe("border","Color")),R("border-"),g("border-([xytrbl])(?:$|-)","borderWidth",Qe("border","Width")),g("border(?:$|-)","borderWidth"),g("divide-opacity(?:$|-)","divideOpacity",({_:t})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":t}})),m("divide-(solid|dashed|dotted|double|none)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:t}})),m("divide-([xy]-reverse)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+t]:"1"}})),g("divide-([xy])(?:$|-)","divideWidth",({1:t,_:e})=>{let r={x:"lr",y:"tb"}[t];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${t}-reverse`]:"0",[`border-${Ae(r[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${t}-reverse)))`,[`border-${Ae(r[1])}Width`]:`calc(${e} * var(--tw-divide-${t}-reverse))`}}}),R("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),g("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),R("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),g("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),m("ring-inset",{"--tw-ring-inset":"inset"}),R("ring-",{property:"--tw-ring-color"}),g("ring(?:$|-)","ringWidth",({_:t},{theme:e})=>({...ge({"--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":K(e("ringOffsetColor","","#fff")),"--tw-ring-color":K(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(${t} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),R("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-shadow-color":t.value,"--tw-shadow":"var(--tw-shadow-colored)"})),g("shadow(?:$|-)","boxShadow",({_:t})=>({...ge({"--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(t),"--tw-shadow-colored":te(t).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)"})),g("(opacity)-"),m("mix-blend-","mixBlendMode"),...eo(),...eo("backdrop-"),g("transition(?:$|-)","transitionProperty",(t,{theme:e})=>({transitionProperty:te(t),transitionTimingFunction:t._=="none"?void 0:te(e("transitionTimingFunction","")),transitionDuration:t._=="none"?void 0:te(e("transitionDuration",""))})),g("duration(?:$|-)","transitionDuration","transitionDuration",te),g("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",te),g("delay(?:$|-)","transitionDelay","transitionDelay",te),g("animate(?:$|-)","animation",(t,{theme:e,h:r,e:n})=>{let i=te(t),s=i.split(" "),o=e("keyframes",s[0]);return o?{["@keyframes "+(s[0]=n(r(s[0])))]:o,animation:s.join(" ")}:{animation:i}}),"(transform)-(none)",m("transform",zn),m("transform-(cpu|gpu)",({1:t})=>({"--tw-transform":io(t=="gpu")})),g("scale(-[xy])?-","scale",({1:t,_:e})=>({["--tw-scale"+(t||"-x")]:e,["--tw-scale"+(t||"-y")]:e,...zn()})),g("-?(rotate)-","rotate",Hn),g("-?(translate-[xy])-","translate",Hn),g("-?(skew-[xy])-","skew",Hn),m("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",pr),"(appearance)-",g("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",g("(cursor)-"),"(cursor)-",m("snap-(none)","scroll-snap-type"),m("snap-(x|y|both)",({1:t})=>({...ge({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":t+" var(--tw-scroll-snap-strictness)"})),m("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),m("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),m("snap-(normal|always)","scroll-snap-stop"),m("scroll-(auto|smooth)","scroll-behavior"),g("scroll-p([xytrbl])?(?:$|-)","padding",Qe("scroll-padding")),g("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",Qe("scroll-margin")),m("touch-(auto|none|manipulation)","touch-action"),m("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:t,2:e,3:r})=>({...ge({"--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":r?"pan-y":t}`]:t,"touch-action":"var(--tw-touch-action)"})),m("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),m("outline",{outlineStyle:"solid"}),m("outline-(dashed|dotted|double)","outlineStyle"),g("-?(outline-offset)-"),R("outline-",{opacityVariable:!1,opacitySection:"opacity"}),g("outline-","outlineWidth"),"(pointer-events)-",g("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:t})=>({x:"horizontal",y:"vertical"})[t]||t||"both"],m("select-(none|text|all|auto)","userSelect"),R("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),R("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),g("stroke-","strokeWidth"),m("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),m("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function pr(t){return(typeof t=="string"?t:t[1]).replace(/-/g," ").trim()}function Xs(t){return(typeof t=="string"?t:t[1]).replace("col","column")}function Ae(t,e="-"){let r=[];for(let n of t)r.push({t:"top",r:"right",b:"bottom",l:"left"}[n]);return r.join(e)}function te(t){return t&&""+(t._||t)}function Qs({$$:t}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[t[3]||""]||"")+t}function Qe(t,e=""){return({1:r,_:n})=>{let i={x:"lr",y:"tb"}[r]||r+r;return i?{...kt(t+"-"+Ae(i[0])+e,n),...kt(t+"-"+Ae(i[1])+e,n)}:kt(t+e,n)}}function eo(t=""){let e=["blur","brightness","contrast","grayscale","hue-rotate","invert",t&&"opacity","saturate","sepia",!t&&"drop-shadow"].filter(Boolean),r={};for(let n of e)r[`--tw-${t}${n}`]="var(--tw-empty,/*!*/ /*!*/)";return r={...ge(r),[`${t}filter`]:e.map(n=>`var(--tw-${t}${n})`).join(" ")},[`(${t}filter)-(none)`,m(`${t}filter`,r),...e.map(n=>g(`${n[0]=="h"?"-?":""}(${t}${n})(?:$|-)`,n,({1:i,_:s})=>({[`--tw-${i}`]:I(s).map(o=>`${n}(${o})`).join(" "),...r})))]}function Hn({1:t,_:e}){return{["--tw-"+t]:e,...zn()}}function zn(){return{...ge({"--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":io()}),transform:"var(--tw-transform)"}}function io(t){return[t?"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 to({1:t,2:e}){return`${t} ${e} / ${t} ${e}`}function ro({1:t}){return`repeat(${t},minmax(0,1fr))`}function ge(t){return{"@layer defaults":{"*,::before,::after":t,"::backdrop":t}}}var so=[["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:t})=>`@media (orientation:${t})`],["contrast-(more|less)",({1:t})=>`@media (prefers-contrast:${t})`],["(first-(letter|line)|placeholder|backdrop|before|after)",({1:t})=>`&::${t}`],["(marker|selection)",({1:t})=>`& *::${t},&::${t}`],["file","&::file-selector-button"],["(first|last|only)",({1:t})=>`&:${t}-child`],["even","&:nth-child(2n)"],["odd","&:nth-child(odd)"],["open","&[open]"],["(aria|data)-",({1:t,$$:e},r)=>e&&`&[${t}-${r.theme(t,e)||ne(e,"",r)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:t,3:e="",4:r,5:n="",6:i=e},{e:s,h:o,v:c})=>{let l=Xe(n)||(r[0]=="["?r:c(r.slice(1)));return`${(l.includes("&")?l:"&"+l).replace(/&/g,`:merge(.${s(o(t+i))})`)}${t[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:t})=>`[dir="${t}"] &`],["supports-",({$$:t},e)=>{if(t&&(t=e.theme("supports",t)||ne(t,"",e)),t)return t.includes(":")||(t+=":var(--tw)"),/^\w*\s*\(/.test(t)||(t=`(${t})`),`@supports ${t.replace(/\b(and|or|not)\b/g," $1 ").trim()}`}],["max-",({$$:t},e)=>{if(t&&(t=e.theme("screens",t)||ne(t,"",e)),typeof t=="string")return`@media not all and (min-width:${t})`}],["min-",({$$:t},e)=>(t&&(t=ne(t,"",e)),t&&`@media (min-width:${t})`)],[/^\[(.+)]$/,({1:t})=>/[&@]/.test(t)&&Xe(t).replace(/[}]+$/,"").split("{")]];function oo({colors:t,disablePreflight:e}={}){return{preflight:e?void 0:Ys,theme:{...St,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...t}},variants:so,rules:no,finalize(r){return r.n&&r.d&&r.r.some(n=>/^&::(before|after)$/.test(n))&&!/(^|;)content:/.test(r.d)?{...r,d:"content:var(--tw-content);"+r.d}:r}}}var _l={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},Ml={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},Il={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},Al={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},Tl={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},Ll={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},jl={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},Dl={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},Ol={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},Ul={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},Pl={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},Rl={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},Bl={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},ql={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},Fl={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},Vl={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},Nl={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},Hl={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},zl={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},Wl={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},Gl={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},Zl={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},ao={__proto__:null,slate:_l,gray:Ml,zinc:Il,neutral:Al,stone:Tl,red:Ll,orange:jl,amber:Dl,yellow:Ol,lime:Ul,green:Pl,emerald:Rl,teal:Bl,cyan:ql,sky:Fl,blue:Vl,indigo:Nl,violet:Hl,purple:zl,fuchsia:Wl,pink:Gl,rose:Zl};function fr({disablePreflight:t}={}){return oo({colors:ao,disablePreflight:t})}function mr({className:t="prose",defaultColor:e="gray",extend:r={},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,o=s])=>[`${t}-${s}`,(c,l)=>uo(t,o[0]=="."?"."+l.e(l.h(o.slice(1))):o,l,a=>`& :is(${a.trim()})`)]),rules:[[`(lead|not-${t})`,({1:s},{h:o})=>[{c:o(s)}]],[`${t}-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)"}}],[t+"-",({$$:s},o)=>{let c=co(o.theme("fontSize",s));return c&&{"@layer components":c}}],[t+"-",({$$:s},o)=>i(s,o)],[t,(s,o)=>({...i(e,o),"@layer base":[lo(t,o,{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:k(20,16),marginBottom:k(20,16),paddingLeft:k(26,16)},li:{marginTop:k(8,16),marginBottom:k(8,16)},"ol>li,ul>li":{paddingLeft:k(6,16)},">ul>li p":{marginTop:k(12,16),marginBottom:k(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:k(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:k(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:k(12,16),marginBottom:k(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:k(48,16),marginBottom:k(48,16)},blockquote:{marginTop:k(32,20),marginBottom:k(32,20),paddingLeft:k(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:k(20,16),marginBottom:k(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:k(36,16),marginTop:"0",marginBottom:k(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:k(24,16),marginTop:k(48,24),marginBottom:k(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:k(20,16),marginTop:k(32,20),marginBottom:k(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:k(24,16),marginBottom:k(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:k(32,16),marginBottom:k(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:k(14,16),lineHeight:"1.4",marginTop:k(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:k(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:k(21,24)},"h3 code":{fontSize:k(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:k(14,16),lineHeight:"1.7",marginTop:k(24,14),marginBottom:k(24,14),borderRadius:"0.375rem",paddingTop:k(12,14),paddingRight:k(16,14),paddingBottom:k(12,14),paddingLeft:k(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:k(32,16),marginBottom:k(32,16),fontSize:k(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:k(8,14),paddingBottom:k(8,14),paddingLeft:k(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:k(8,14),paddingRight:k(8,14),paddingBottom:k(8,14),paddingLeft:k(8,14)},"tbody td:first-child,tfoot td:first-child":{paddingLeft:"0"},"tbody td:last-child,tfoot td:last-child":{paddingRight:"0"},[`.${o.e(o.h("lead"))}`]:{color:"var(--tw-prose-lead)",fontSize:k(20,16),lineHeight:"1.6",marginTop:k(24,20),marginBottom:k(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),lo(t,o,r)],"@layer components":{...co(o.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function i(s,o){let c={},l={},a=(h,d,f)=>{let p=o.theme(`colors.${s}.${d}`,d);f["--tw-prose-"+h]=K(p);let y=f!=l&&o.d("colors",`${s}-${d}`,p);y&&(l["--tw-prose-"+h]=K(y))};for(let h in n){let d=n[h];h!="dark"&&d&&a(h,d,c)}for(let h in n.dark||{}){let d=n.dark[h];d&&(n.dark?a("invert-"+h,d,c):a(h,d,l))}return Object.keys(c).length?{"@layer defaults":{"&":c,[o.v("dark")]:l}}:void 0}}function lo(t,e,r){let n={};for(let i in r)n[uo(t,i,e,s=>`.${e.e(e.h(t))}${s}`)]=r[i];return n}function uo(t,e,{e:r,h:n},i){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,o=" ",c=s,l="")=>i(`${o}:where(${c}):not(:where(.${r(n("not-"+t))} *))${l}`))}function co(t){return t?typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}:void 0}function k(t,e){return`${(t/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var Wn=Ct({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:[fr(),hr(),dr(),mr()]});function gr(t,e=!0){let r=(function(){if(Jl)try{let l=ur(new CSSStyleSheet);return l.connect=a=>{let h=Gn(a);h.adoptedStyleSheets=[...h.adoptedStyleSheets,l.target]},l.disconnect=cr,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let o=[ur(s)],c=new WeakMap;return{get target(){return o[0].target},snapshot(){let l=o.map(a=>a.snapshot());return()=>l.forEach(a=>a())},clear(){o.forEach(l=>l.clear())},destroy(){o.forEach(l=>l.destroy())},insert(l,a,h){o[0].insert(l,a,h);let d=this.target.cssRules[a];o.forEach((f,p)=>p&&f.target.insertRule(d.cssText,a))},resume(l,a){return o[0].resume(l,a)},connect(l){let a=document.createElement("style");Gn(l).appendChild(a);let h=ur(a),{cssRules:d}=this.target;for(let f=0;f<d.length;f++)h.target.insertRule(d[f].cssText,f);o.push(h),c.set(l,h)},disconnect(l){let a=o.indexOf(c.get(l));a>=0&&o.splice(a,1)}}})(),n=zs({...t,hash:t.hash??e},r),i=Ws(n);return function(o){return class extends o{connectedCallback(){super.connectedCallback?.(),r.connect(this),i.observe(Gn(this))}disconnectedCallback(){r.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=n}}}}var Jl=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function Gn(t){return t.shadowRoot||t.attachShadow({mode:"open"})}var C=t=>gr(Wn)(t);var Zn=class extends C(v){static properties={color:{type:String},radius:{type:String},size:{type:String},border:{type:String}};static styles=D`
|
|
143
131
|
:host {
|
|
144
132
|
display: block;
|
|
145
133
|
}
|
|
@@ -154,7 +142,27 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
154
142
|
transform: rotate(360deg);
|
|
155
143
|
}
|
|
156
144
|
}
|
|
157
|
-
|
|
145
|
+
`;constructor(){super(),this.color="#601feb",this.radius="16.8576px",this.size="320px",this.border="#d1d5db"}render(){return u`
|
|
146
|
+
<div class="flex flex-row flex-wrap gap-0">
|
|
147
|
+
<div class="relative z-0 flex min-h-9 items-center justify-center overflow-hidden" style="border-radius: ${this.radius};">
|
|
148
|
+
<!-- Spinning gradient background -->
|
|
149
|
+
<div
|
|
150
|
+
class="absolute z-[-2] m-auto animate-[spin-slow_4s_linear_infinite] bg-[0_0] bg-cover bg-no-repeat"
|
|
151
|
+
style="background-image: conic-gradient(transparent, ${this.color}, transparent 30%); height: ${this.size}; width: ${this.size}; background-color: ${this.border};"></div>
|
|
152
|
+
<!-- White background with 1px border space for gradient -->
|
|
153
|
+
<div class="absolute top-[1px] left-[1px] z-[-1] h-[calc(100%_-_2px)] w-[calc(100%_-_2px)] bg-white" style="border-radius: ${this.radius};"></div>
|
|
154
|
+
<slot></slot>
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
`}};customElements.get("mw-spinning-border")||customElements.define("mw-spinning-border",Zn);var Jn=class extends C(v){static properties={state:{type:String},color:{type:String},bubbleStyle:{type:String},src:{type:String},width:{type:String},height:{type:String}};static styles=D`
|
|
158
|
+
.shadow-button {
|
|
159
|
+
box-shadow:
|
|
160
|
+
-58.9194px 74.8436px 38.218px rgba(0, 0, 0, 0.01),
|
|
161
|
+
-33.4408px 42.9953px 31.8483px rgba(0, 0, 0, 0.05),
|
|
162
|
+
-14.3318px 19.109px 23.8863px rgba(0, 0, 0, 0.09),
|
|
163
|
+
-3.18483px 4.77725px 12.7393px rgba(0, 0, 0, 0.1);
|
|
164
|
+
}
|
|
165
|
+
`;constructor(){super(),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 e=parseFloat(this.width),r=parseFloat(this.height),i=Math.min(e,r)*.55,s=i,o=i/1.65;return{width:s,height:o}}get dynamicRadius(){let e=parseFloat(this.width),r=parseFloat(this.height);return`${Math.min(e,r)*.265}px`}render=()=>u`
|
|
158
166
|
<div class="shadow-button inline-block transition-transform hover:scale-105 active:scale-90" style="border-radius: ${this.dynamicRadius};">
|
|
159
167
|
<mw-spinning-border .color="${this.color}" .border="${"#f9fafb"}" .radius="${this.dynamicRadius}">
|
|
160
168
|
<!-- we want the transform transition on the root element so that both the transform transition and state switch transition are continuous and fluid -->
|
|
@@ -165,14 +173,14 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
165
173
|
aria-label="Open Molin AI chat window">
|
|
166
174
|
<!-- the 'open' state invites the user to open (e.g. the chat window) -->
|
|
167
175
|
<div class="${this.state==="open"?"visible opacity-100":"invisible opacity-0"} absolute top-[1px] right-0 bottom-0 left-[1px] transition-[opacity,visibility]">
|
|
168
|
-
${this.src?
|
|
176
|
+
${this.src?u`
|
|
169
177
|
<!-- load given source -->
|
|
170
178
|
<img
|
|
171
179
|
class="flex items-center justify-center bg-white"
|
|
172
180
|
style="width: calc(${this.width} - 2px); height: calc(${this.height} - 2px); border-radius: ${this.dynamicRadius};"
|
|
173
181
|
src="${this.src}"
|
|
174
182
|
alt="Molin AI chat" />
|
|
175
|
-
`:
|
|
183
|
+
`:u`
|
|
176
184
|
<!-- the solid background with AI text -->
|
|
177
185
|
<div
|
|
178
186
|
class="flex items-center justify-center bg-[${this.backgroundColor}]"
|
|
@@ -211,15 +219,7 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
211
219
|
</button>
|
|
212
220
|
</mw-spinning-border>
|
|
213
221
|
</div>
|
|
214
|
-
`
|
|
215
|
-
.shadow-button {
|
|
216
|
-
box-shadow:
|
|
217
|
-
-58.9194px 74.8436px 38.218px rgba(0, 0, 0, 0.01),
|
|
218
|
-
-33.4408px 42.9953px 31.8483px rgba(0, 0, 0, 0.05),
|
|
219
|
-
-14.3318px 19.109px 23.8863px rgba(0, 0, 0, 0.09),
|
|
220
|
-
-3.18483px 4.77725px 12.7393px rgba(0, 0, 0, 0.1);
|
|
221
|
-
}
|
|
222
|
-
`);customElements.get("mw-bubble")||customElements.define("mw-bubble",_n);var Au={airplay:`<svg
|
|
222
|
+
`};customElements.get("mw-bubble")||customElements.define("mw-bubble",Jn);var ho={airplay:`<svg
|
|
223
223
|
xmlns="http://www.w3.org/2000/svg"
|
|
224
224
|
width="24"
|
|
225
225
|
height="24"
|
|
@@ -1146,26 +1146,26 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1146
1146
|
>
|
|
1147
1147
|
<rect width="14" height="14" x="8" y="8" rx="2" ry="2" />
|
|
1148
1148
|
<path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />
|
|
1149
|
-
</svg>`};var
|
|
1149
|
+
</svg>`};var wr=class t extends HTMLElement{static observedAttributes=["name","fill","stroke"];constructor(){super(),this.attachShadow({mode:"open"})}attributeChangedCallback(e,r,n){if(r!==n&&t.observedAttributes.includes(e)){switch(e){case"name":this.name=n||"";break;case"fill":this.fill=n||"none";break;case"stroke":this.stroke=n||"currentColor";break}this.render()}}resolveIcon(e){throw new Error("Not implemented")}render(){let e=document.createElement("style");if(e.textContent=`
|
|
1150
1150
|
:host {
|
|
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(
|
|
1154
|
+
`,this.shadowRoot){for(;this.shadowRoot.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild);this.shadowRoot.appendChild(e)}if(!this.name)return;let r=this.resolveIcon(this.name);if(!r){console.warn(`'${this.name}' not found, please add it to ${t.name}`);return}let s=new DOMParser().parseFromString(r,"image/svg+xml").documentElement;s.setAttribute("fill",this.fill),s.setAttribute("stroke",this.stroke),s.style.width="100%",s.style.height="100%",this.shadowRoot?.appendChild(s)}name="";fill="none";stroke="currentColor"};var Kl=ho,Kn=class extends wr{resolveIcon(e){return Kl[e]}};customElements.get("lucide-icon")||customElements.define("lucide-icon",Kn);var Te=class t extends C(v){static properties={color:{type:String},disabled:{type:Boolean},placeholder:{type:String},dark:{type:Boolean},_inputValue:{type:String,state:!0}};constructor(){super(),this.color="#8B5CF6",this.disabled=!1,this.placeholder="Ask AI...",this.dark=!1,this._inputValue=""}#e=new Date;#t(e){let r=e.target;this._inputValue=r.value,this.dispatchEvent(new t.ChangeEvent({value:this._inputValue}))}render(){return u`
|
|
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="${
|
|
1161
|
+
@submit="${this.#r}"
|
|
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="${
|
|
1168
|
-
@input="${
|
|
1167
|
+
@keydown="${this.#s}"
|
|
1168
|
+
@input="${this.#t}"
|
|
1169
1169
|
.value="${this._inputValue}"
|
|
1170
1170
|
placeholder="${this.placeholder}"
|
|
1171
1171
|
autocomplete="off"
|
|
@@ -1183,9 +1183,9 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1183
1183
|
</button>
|
|
1184
1184
|
</form>
|
|
1185
1185
|
</mw-spinning-border>
|
|
1186
|
-
`}
|
|
1186
|
+
`}#r(e){e.preventDefault();let r=new Date;if(r.getTime()-this.#e.getTime()<500)return;this.#e=r;let i=this._inputValue.trim();i&&this.dispatchEvent(new t.SubmitInputEvent({text:i}))&&(this._inputValue="")}get#n(){return this.renderRoot.querySelector('input[name="input"]')??null}get#i(){return this.renderRoot.querySelector('button[type="submit"]')??null}#s(e){Yl(e)&&(e.preventDefault(),this.disabled||this.#i?.click())}};Te.SubmitInputEvent=class extends CustomEvent{static type="mw-floating-ask-ai:submit";constructor(e,r={}){super(Te.SubmitInputEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};Te.ChangeEvent=class extends CustomEvent{static type="mw-floating-ask-ai:change";constructor(e,r={}){super(Te.ChangeEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};function Yl(t){return(t.code==="Enter"||t.code==="NumpadEnter")&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey}customElements.get("mw-floating-ask-ai")||customElements.define("mw-floating-ask-ai",Te);var yr={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},vr=t=>(...e)=>({_$litDirective$:t,values:e}),et=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,n){this._$Ct=e,this._$AM=r,this._$Ci=n}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}};var{I:Xl}=Qi;var po=()=>document.createComment(""),tt=(t,e,r)=>{let n=t._$AA.parentNode,i=e===void 0?t._$AB:e._$AA;if(r===void 0){let s=n.insertBefore(po(),i),o=n.insertBefore(po(),i);r=new Xl(s,o,t,t.options)}else{let s=r._$AB.nextSibling,o=r._$AM,c=o!==t;if(c){let l;r._$AQ?.(t),r._$AM=t,r._$AP!==void 0&&(l=t._$AU)!==o._$AU&&r._$AP(l)}if(s!==i||c){let l=r._$AA;for(;l!==s;){let a=l.nextSibling;n.insertBefore(l,i),l=a}}}return r},we=(t,e,r=t)=>(t._$AI(e,r),t),Ql={},fo=(t,e=Ql)=>t._$AH=e,mo=t=>t._$AH,br=t=>{t._$AR(),t._$AA.remove()};var go=(t,e,r)=>{let n=new Map;for(let i=e;i<=r;i++)n.set(t[i],i);return n},X=vr(class extends et{constructor(t){if(super(t),t.type!==yr.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,r){let n;r===void 0?r=e:e!==void 0&&(n=e);let i=[],s=[],o=0;for(let c of t)i[o]=n?n(c,o):o,s[o]=r(c,o),o++;return{values:s,keys:i}}render(t,e,r){return this.dt(t,e,r).values}update(t,[e,r,n]){let i=mo(t),{values:s,keys:o}=this.dt(e,r,n);if(!Array.isArray(i))return this.ut=o,s;let c=this.ut??=[],l=[],a,h,d=0,f=i.length-1,p=0,y=s.length-1;for(;d<=f&&p<=y;)if(i[d]===null)d++;else if(i[f]===null)f--;else if(c[d]===o[p])l[p]=we(i[d],s[p]),d++,p++;else if(c[f]===o[y])l[y]=we(i[f],s[y]),f--,y--;else if(c[d]===o[y])l[y]=we(i[d],s[y]),tt(t,l[y+1],i[d]),d++,y--;else if(c[f]===o[p])l[p]=we(i[f],s[p]),tt(t,i[d],i[f]),f--,p++;else if(a===void 0&&(a=go(o,p,y),h=go(c,d,f)),a.has(c[d]))if(a.has(c[f])){let E=h.get(o[p]),b=E!==void 0?i[E]:null;if(b===null){let x=tt(t,i[d]);we(x,s[p]),l[p]=x}else l[p]=we(b,s[p]),tt(t,i[d],b),i[E]=null;p++}else br(i[f]),f--;else br(i[d]),d++;for(;p<=y;){let E=tt(t,l[y+1]);we(E,s[p]),l[p++]=E}for(;d<=f;){let E=i[d++];E!==null&&br(E)}return this.ut=o,fo(t,l),ee}});var Et=class t extends C(v){static properties={examples:{type:Object},color:{type:String}};constructor(){super(),this.examples={title:"",items:[]},this.color=""}render(){return!this.examples?.title&&!this.examples?.items?.length?null:u`
|
|
1187
1187
|
<div class="flex h-full w-full flex-1 flex-col overflow-y-auto px-4 pt-6 pb-2">
|
|
1188
|
-
${this.examples.title?
|
|
1188
|
+
${this.examples.title?u`
|
|
1189
1189
|
<h2 class="mt-14 px-2 pt-9 pb-2 text-left text-3xl leading-tight font-bold tracking-tight">
|
|
1190
1190
|
<span>${this.examples.title}</span>
|
|
1191
1191
|
<svg class="inline-block h-9 w-9 align-middle" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 58 61">
|
|
@@ -1195,19 +1195,31 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1195
1195
|
</svg>
|
|
1196
1196
|
</h2>
|
|
1197
1197
|
`:null}
|
|
1198
|
-
${this.examples?.items?.length?
|
|
1198
|
+
${this.examples?.items?.length?u`
|
|
1199
1199
|
<ul class="mt-auto flex flex-wrap justify-end gap-2.5 text-sm leading-6 text-black select-none">
|
|
1200
|
-
${
|
|
1200
|
+
${X(this.examples.items,e=>e,e=>u`
|
|
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="${()=>
|
|
1204
|
-
<span>${
|
|
1203
|
+
@click="${()=>this.#e(e)}">
|
|
1204
|
+
<span>${e.trim()}</span>
|
|
1205
1205
|
</li>
|
|
1206
1206
|
`)}
|
|
1207
1207
|
</ul>
|
|
1208
1208
|
`:null}
|
|
1209
1209
|
</div>
|
|
1210
|
-
`}
|
|
1210
|
+
`}#e(e){this.dispatchEvent(new t.ExampleClickEvent({example:e}))}};Et.ExampleClickEvent=class extends CustomEvent{static type="mw:example-click";constructor(e,r={}){super(Et.ExampleClickEvent.type,{detail:e,...r})}};customElements.get("mw-chat-background")||customElements.define("mw-chat-background",Et);var Le=class t extends C(v){static properties={content:{type:Object},showNewChat:{type:Boolean,attribute:"show-new-chat"},showClose:{type:Boolean,attribute:"show-close"}};constructor(){super(),this.content={logoUrl:"",title:"",color:""},this.showNewChat=!1,this.showClose=!1}static styles=D`
|
|
1211
|
+
/* blurred background */
|
|
1212
|
+
|
|
1213
|
+
.gradient-blur {
|
|
1214
|
+
/* blur gradient */
|
|
1215
|
+
mask-image: linear-gradient(to bottom, white 70%, transparent);
|
|
1216
|
+
-webkit-mask-image: linear-gradient(to bottom, white 70%, transparent);
|
|
1217
|
+
backdrop-filter: blur(2px);
|
|
1218
|
+
|
|
1219
|
+
/* bg-color gradient */
|
|
1220
|
+
background-image: linear-gradient(to bottom, white 20%, transparent);
|
|
1221
|
+
}
|
|
1222
|
+
`;render(){return u`
|
|
1211
1223
|
<div class="relative z-10 h-12">
|
|
1212
1224
|
<div class="gradient-blur absolute inset-x-0.5 mt-2 h-12"></div>
|
|
1213
1225
|
|
|
@@ -1230,7 +1242,7 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1230
1242
|
<div class="flex-grow"></div>
|
|
1231
1243
|
|
|
1232
1244
|
<!-- new chat btn -->
|
|
1233
|
-
<button @click=${
|
|
1245
|
+
<button @click=${this.#e} type="button" class="${this.showNewChat?"inline-flex":"hidden"} shrink-0">
|
|
1234
1246
|
<!-- svg icon of a bubble with a plus -->
|
|
1235
1247
|
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 37 36">
|
|
1236
1248
|
<path
|
|
@@ -1242,7 +1254,7 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1242
1254
|
</button>
|
|
1243
1255
|
|
|
1244
1256
|
<!-- close chat btn -->
|
|
1245
|
-
<button @click=${
|
|
1257
|
+
<button @click=${this.#t} class="${this.showClose?"inline-flex":"hidden"} shrink-0">
|
|
1246
1258
|
<!-- svg icon of an X -->
|
|
1247
1259
|
<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
1260
|
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
|
|
@@ -1257,34 +1269,22 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1257
1269
|
</div>
|
|
1258
1270
|
</div>
|
|
1259
1271
|
</div>
|
|
1260
|
-
`}};
|
|
1261
|
-
/* blurred background */
|
|
1262
|
-
|
|
1263
|
-
.gradient-blur {
|
|
1264
|
-
/* blur gradient */
|
|
1265
|
-
mask-image: linear-gradient(to bottom, white 70%, transparent);
|
|
1266
|
-
-webkit-mask-image: linear-gradient(to bottom, white 70%, transparent);
|
|
1267
|
-
backdrop-filter: blur(2px);
|
|
1268
|
-
|
|
1269
|
-
/* bg-color gradient */
|
|
1270
|
-
background-image: linear-gradient(to bottom, white 20%, transparent);
|
|
1271
|
-
}
|
|
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 Wu=ip(zu(),1);var Re=Object.freeze({PENDING:"pending",READY:"ready",ERROR:"error"}),N,P,le,Sr,Er,me,O,Ba,qa,Gu,ms,jn,Dn,On,Un,Zu,ps,it,Ln,Va,Ju,Ku,Yu,fs=class{constructor(e,t){p(this,O);p(this,N);p(this,P);p(this,le,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,Zu).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,le)&&o(this,le).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,Gu).call(this)}hostConnected(){m(this,O,Ba).call(this)}hostDisconnected(){m(this,O,qa).call(this),o(this,le)&&o(this,le).parentNode&&o(this,le).parentNode.removeChild(o(this,le))}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,le=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))},Gu=function(){g(this,le,document.createElement("input")),o(this,le).type="file",o(this,le).accept=o(this,P).acceptedTypes.join(","),o(this,le).multiple=o(this,P).maxFiles>1,o(this,le).style.display="none",o(this,le).addEventListener("change",o(this,ms)),document.body.appendChild(o(this,le))},ms=new WeakMap,jn=new WeakMap,Dn=new WeakMap,On=new WeakMap,Un=new WeakMap,Zu=function(e){return e.types&&e.types.includes("Files")},ps=function(e){o(this,Sr)!==e&&(g(this,Sr,e),o(this,N).requestUpdate())},it=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,Ju).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,it).call(this,`You can upload a maximum of ${i} files`);return}try{let l=(await Promise.all(t.map(c=>m(this,O,Ku).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,Yu).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,it).call(this,"Upload failed")}},Ju=function(e){return o(this,P).acceptedTypes.includes(e.type)?e.size>o(this,P).maxFileSize?(m(this,O,it).call(this,`Max file size: ${o(this,P).maxFileSize/(1024*1024)}MB`),!1):!0:(m(this,O,it).call(this,"Invalid file type"),!1)},Ku=async function(e){try{let t=await(0,Wu.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}`)}},Yu=async function(e){if(!e){console.error("No image provided to upload"),m(this,O,it).call(this,"No image provided");return}if(!o(this,P)?.uploadUrl){console.error("Missing uploadUrl in options"),m(this,O,it).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),t.append("role",o(this,P).role||"user"),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,it).call(this,i.message),e.processingState=Re.ERROR,o(this,N).requestUpdate()}};var Fa={maxHeight:120,initialHeight:32,paddingY:12},Pn,Q,_r,Xu,Qu,eh,th,gs,Ot=class Ot extends I($){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`
|
|
1272
|
+
`}#e(){this.dispatchEvent(new t.NewChatClickEvent)}#t(){this.dispatchEvent(new t.CloseClickEvent)}};Le.NewChatClickEvent=class extends CustomEvent{static type="mw:new-chat-click";constructor(e={}){super(Le.NewChatClickEvent.type,{...e})}};Le.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(Le.CloseClickEvent.type,{...e})}};customElements.get("mw-chat-header")||customElements.define("mw-chat-header",Le);var xo=Ta(bo(),1);var se=Object.freeze({PENDING:"pending",READY:"ready",ERROR:"error"}),Cr=class{#e;#t;#r=null;#n=!1;#i=null;#s=[];constructor(e,r){this.#e=e,this.#t={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:()=>{},...r},e.addController(this),this.#l()}hostConnected(){this.#o(),this.#h()}hostDisconnected(){this.#a(),this.#c(),this.#r&&this.#r.parentNode&&this.#r.parentNode.removeChild(this.#r)}#o(){this.#t.enabled&&this.#t.isConnected()&&(this.#e.addEventListener("dragover",this.#w),this.#e.addEventListener("dragenter",this.#y),this.#e.addEventListener("dragleave",this.#v),this.#e.addEventListener("drop",this.#b))}#a(){this.#e.removeEventListener("dragover",this.#w),this.#e.removeEventListener("dragenter",this.#y),this.#e.removeEventListener("dragleave",this.#v),this.#e.removeEventListener("drop",this.#b)}#h(){this.#t.enabled&&this.#e.addEventListener("paste",this.#m)}#c(){this.#e.removeEventListener("paste",this.#m)}#l(){this.#r=document.createElement("input"),this.#r.type="file",this.#r.accept=this.#t.acceptedTypes.join(","),this.#r.multiple=this.#t.maxFiles>1,this.#r.style.display="none",this.#r.addEventListener("change",this.#f),document.body.appendChild(this.#r)}#f=e=>{let r=e.target,n=Array.from(r.files||[]);this.#t.isConnected()||this.#t.onConnect?.(),this.#k(n),r.value=""};#w=e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")};#y=e=>{e.preventDefault(),e.dataTransfer&&this.#x(e.dataTransfer)&&this.#g(!0)};#v=e=>{e.preventDefault();let r=e.relatedTarget;this.#e.contains(r)||this.#g(!1)};#b=e=>{if(e.preventDefault(),this.#g(!1),e.dataTransfer){let r=Array.from(e.dataTransfer.files||[]);this.#k(r)}};#m=e=>{if(!e.clipboardData)return;let n=Array.from(e.clipboardData.items||[]).filter(s=>s.type.startsWith("image/"));if(n.length===0)return;e.preventDefault();let i=n.map(s=>s.getAsFile()).filter(s=>s!==null);this.#k(i)};#x(e){return e.types&&e.types.includes("Files")}#g(e){this.#n!==e&&(this.#n=e,this.#e.requestUpdate())}#u(e){this.#i=e,this.#t.onError(e),this.#e.requestUpdate(),setTimeout(()=>{this.#d()},6e3)}#d(){this.#i=null,this.#e.requestUpdate()}async#k(e){if(e.length===0)return;this.#d();let r=e.filter(o=>this.#C(o));if(r.length===0)return;let n=this.#s.length,i=this.#t.maxFiles??1/0,s=r.length;if(n+s>i){this.#u(`You can upload a maximum of ${i} files`);return}try{let c=(await Promise.all(r.map(l=>this.#p(l)))).filter(l=>!this.#s.some(a=>a.dataUrl===l.dataUrl));this.#s=[...this.#s,...c],this.#e.requestUpdate(),await pn({times:5,delay:2e3},async()=>{if(this.#t.isConnected())await dn(3,c,async l=>{await this.#$(l)});else throw new Error("Not connected yet")}),this.#e.requestUpdate()}catch(o){console.error("Failed to process and upload images:",o),this.#u("Upload failed")}}#C(e){return this.#t.acceptedTypes.includes(e.type)?e.size>this.#t.maxFileSize?(this.#u(`Max file size: ${this.#t.maxFileSize/(1024*1024)}MB`),!1):!0:(this.#u("Invalid file type"),!1)}async#p(e){try{let r=await(0,xo.fileToBase64)(e);return{id:crypto.randomUUID(),name:e.name,type:e.type,size:e.size,dataUrl:r,file:e,processingState:se.PENDING}}catch(r){let n=r instanceof Error?r:new Error(String(r));throw new Error(`Failed to read file: ${e.name} - ${n.message}`)}}async#$(e){if(!e){console.error("No image provided to upload"),this.#u("No image provided");return}if(!this.#t?.uploadUrl){console.error("Missing uploadUrl in options"),this.#u("Upload URL not configured");return}e.processingState=se.PENDING,this.#e.requestUpdate();let r=new FormData;r.append("file",e.file),r.append("imageId",e.id),r.append("role",this.#t.role||"user"),this.#t.conversationId&&r.append("conversationId",this.#t.conversationId),this.#t.widgetId&&r.append("widgetId",this.#t.widgetId);try{let n=await fetch(this.#t.uploadUrl,{method:"POST",body:r});if(!n.ok)throw new Error(`Upload failed with status: ${n.status}`);let i=await n.json();if(!!!i?.success){let o=i?.error||"Upload failed";throw new Error(o)}i.imageUrl&&i.imageId?(e.imageUrl=i.imageUrl,e.id=i.imageId,e.processingState=se.READY):e.processingState=se.PENDING,this.#e.requestUpdate()}catch(n){let i=n instanceof Error?n:new Error(String(n));console.error("Upload error:",i.message),this.#u(i.message),e.processingState=se.ERROR,this.#e.requestUpdate()}}get isDragging(){return this.#n}get error(){return this.#i}get selectedImages(){return this.#s}get hasPendingImages(){return this.#s.some(e=>e.processingState===se.PENDING)}openImagePicker=()=>{if(!this.#t.enabled||!this.#t.widgetId){console.warn("Image uploads are disabled");return}this.#r&&this.#r.click()};clearError(){this.#d()}updateUploadOptions(e){let r=this.#t.isConnected();e.conversationId!==void 0&&(this.#t.conversationId=e.conversationId),e.widgetId!==void 0&&(this.#t.widgetId=e.widgetId),e.enabled!==void 0&&(this.#t.enabled=!!e.enabled),e.isConnected!==void 0&&(this.#t.isConnected=e.isConnected),e.onConnect!==void 0&&(this.#t.onConnect=e.onConnect),!this.#t.enabled||!this.#t.isConnected()?(this.#a(),this.#c()):!r&&this.#t.isConnected()&&(this.#o(),this.#h())}restoreImages(e){if(!Array.isArray(e)||e.length===0){this.#s=[],this.#e.requestUpdate();return}let r=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:se.READY,imageUrl:n.url}});this.#s=r,this.#e.requestUpdate()}clearImages(){this.#s=[],this.clearError(),this.#e.requestUpdate()}onImageDelete=e=>{this.#t.onImageDelete&&this.#t.onImageDelete(e),this.#s=this.#s.filter(r=>r.id!==e),this.#d(),this.#e.requestUpdate()}};var ei={maxHeight:120,initialHeight:32,paddingY:12},he=class t extends C(v){static 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}};#e=new Date;constructor(){super(),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 this.#t?.value?.trim()??""}render(){return u`
|
|
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 -->
|
|
1276
|
-
${this.enableImageUpload&&this.images&&this.images.length>0?
|
|
1276
|
+
${this.enableImageUpload&&this.images&&this.images.length>0?u`
|
|
1277
1277
|
<div class="mb-2 flex flex-wrap gap-2 rounded-t-[18px] bg-white p-2">
|
|
1278
|
-
${this.images.map(
|
|
1278
|
+
${this.images.map(e=>u`
|
|
1279
1279
|
<div class="relative inline-block">
|
|
1280
|
-
<img src="${
|
|
1280
|
+
<img src="${e.dataUrl}" alt="${e.name}" class="h-[60px] w-[60px] rounded-xl object-cover" />
|
|
1281
1281
|
|
|
1282
1282
|
<!-- Progress/Status overlay -->
|
|
1283
|
-
${
|
|
1283
|
+
${e.processingState===se.PENDING?u`
|
|
1284
1284
|
<div class="absolute inset-0 flex items-center justify-center rounded-xl bg-black/40">
|
|
1285
1285
|
<lucide-icon name="loader-circle" class="inline-flex animate-spin text-white transition-all duration-1000"></lucide-icon>
|
|
1286
1286
|
</div>
|
|
1287
|
-
`:
|
|
1287
|
+
`:e.processingState===se.ERROR?u`
|
|
1288
1288
|
<div class="absolute inset-0 flex items-center justify-center rounded-xl bg-red-500/60">
|
|
1289
1289
|
<lucide-icon name="badge-alert" class="h-6 w-6 text-white"></lucide-icon>
|
|
1290
1290
|
</div>
|
|
@@ -1294,7 +1294,7 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1294
1294
|
<button
|
|
1295
1295
|
data-testid="image-delete-btn"
|
|
1296
1296
|
type="button"
|
|
1297
|
-
@click="${()=>this.onImageDelete?.(
|
|
1297
|
+
@click="${()=>this.onImageDelete?.(e.id)}"
|
|
1298
1298
|
class="absolute -top-1 -right-1 flex h-5 w-5 items-center justify-center rounded-full bg-[#eeedf1] text-white hover:bg-[#eeedf195]">
|
|
1299
1299
|
<lucide-icon name="x" class="h-3 w-3 text-[#14161a]"></lucide-icon>
|
|
1300
1300
|
</button>
|
|
@@ -1304,8 +1304,8 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1304
1304
|
`:null}
|
|
1305
1305
|
|
|
1306
1306
|
<!-- Input form -->
|
|
1307
|
-
<form @submit="${
|
|
1308
|
-
${this.enableImageUpload?
|
|
1307
|
+
<form @submit="${this.#i}" class="flex w-full items-center">
|
|
1308
|
+
${this.enableImageUpload?u`
|
|
1309
1309
|
<button
|
|
1310
1310
|
data-testid="image-upload-btn"
|
|
1311
1311
|
type="button"
|
|
@@ -1319,12 +1319,12 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1319
1319
|
<textarea
|
|
1320
1320
|
data-testid="mw-chat-input-textarea"
|
|
1321
1321
|
name="input"
|
|
1322
|
-
@input="${
|
|
1323
|
-
@keydown="${
|
|
1322
|
+
@input="${this.#s}"
|
|
1323
|
+
@keydown="${this.#n}"
|
|
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-[${ei.initialHeight}px] w-full resize-none place-content-center rounded bg-white py-[${ei.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"
|
|
@@ -1333,7 +1333,7 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1333
1333
|
class="mx-1 rounded-full px-2 transition-all duration-150 ease-out disabled:cursor-not-allowed disabled:opacity-50">
|
|
1334
1334
|
<div
|
|
1335
1335
|
class="${this.streaming||this.loading||!this.value&&(!this.enableImageUpload||this.images.length===0)?"bg-gray-400":""} ${this.streaming||this.loading?"scale-100":"scale-95"} flex h-8 w-8 flex-row items-center justify-center rounded-full bg-[${this.color}] p-1.5 transition-all transition-colors duration-200">
|
|
1336
|
-
${this.loading?
|
|
1336
|
+
${this.loading?u`<lucide-icon name="loader-circle" class="inline-flex animate-spin text-white transition-all"></lucide-icon>`:this.streaming?u`<lucide-icon name="x" class="inline-flex h-4 w-4 text-white transition-colors"></lucide-icon>`:u`<lucide-icon name="arrow-up" class="inline-flex h-4 w-4 text-white transition-colors"></lucide-icon>`}
|
|
1337
1337
|
</div>
|
|
1338
1338
|
</button>
|
|
1339
1339
|
</form>
|
|
@@ -1342,16 +1342,16 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1342
1342
|
<slot>
|
|
1343
1343
|
<div class="h-5 w-full"></div>
|
|
1344
1344
|
</slot>
|
|
1345
|
-
`}
|
|
1345
|
+
`}get#t(){return this.renderRoot.querySelector('textarea[name="input"]')??null}get#r(){return this.renderRoot.querySelector('button[type="submit"]')??null}#n(e){fc(e)&&(e.preventDefault(),!this.streaming&&!this.disabled&&!this.loading&&this.#r?.click())}#i(e){e.preventDefault();let r=new Date;if(r.getTime()-this.#e.getTime()<500)return;if(this.#e=r,this.streaming){this.dispatchEvent(new t.CancelEvent);return}let i=this.#t;if(!i)throw new Error("Expected input element to be present");let s=i.value.trim();(s||this.enableImageUpload&&this.images.length>0)&&this.dispatchEvent(new t.SubmitEvent(s))&&(i.value=""),this.#o(),window.requestAnimationFrame(()=>{this.focus()})}#s(e){this.dispatchEvent(new t.ChangeEvent({delta:e.data,full:e.target instanceof HTMLTextAreaElement?e.target.value:""})),this.#o()}#o(){let e=this.#t;if(!e)return;let{maxHeight:r,initialHeight:n,paddingY:i}=ei;e.style.height=`${n}px`;let s=e.scrollHeight,o=i*2,c=Math.min(s-o,r);e.style.height=`${c}px`,this.requestUpdate()}setValue(e){let r=this.#t;if(!r){console.warn("input element not found, cannot set value");return}r.value=e,this.#o(),this.dispatchEvent(new t.ChangeEvent({delta:null,full:e}))}focus(){this.#t?.focus()}};he.ChangeEvent=class extends CustomEvent{static type="mw:change";constructor(e,r={}){super(he.ChangeEvent.type,{detail:e,...r})}};he.SubmitEvent=class extends CustomEvent{static type="mw:submit";constructor(e,r={}){super(he.SubmitEvent.type,{detail:e,...r,cancelable:!0})}};he.CancelEvent=class extends CustomEvent{static type="mw:cancel";constructor(e={}){super(he.CancelEvent.type,{...e})}};function fc(t){return(t.code==="Enter"||t.code==="NumpadEnter")&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey}customElements.get("mw-chat-input")||customElements.define("mw-chat-input",he);var ti=class extends C(v){static properties={side:{type:String},status:{type:String},color:{type:String},logoUrl:{type:String,attribute:"logo"},position:{type:String}};constructor(){super(),this.side="assistant",this.status="",this.color="",this.logoUrl="",this.position="single"}render(){let r=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 u`
|
|
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 -->
|
|
1349
|
-
<div class="${
|
|
1349
|
+
<div class="${r} border border-[${this.color}] bg-[${this.color}] px-4 py-3 text-left text-white">
|
|
1350
1350
|
<slot></slot>
|
|
1351
1351
|
</div>
|
|
1352
1352
|
|
|
1353
1353
|
<!-- render status (if any) -->
|
|
1354
|
-
${this.status==="sent"?
|
|
1354
|
+
${this.status==="sent"?u`
|
|
1355
1355
|
<!-- tick mark -->
|
|
1356
1356
|
<svg class="ml-auto h-3 w-3 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor">
|
|
1357
1357
|
<path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" />
|
|
@@ -1359,7 +1359,7 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1359
1359
|
`:null}
|
|
1360
1360
|
</div>
|
|
1361
1361
|
</div>
|
|
1362
|
-
`;case"assistant":case"support":return
|
|
1362
|
+
`;case"assistant":case"support":return u`
|
|
1363
1363
|
<div class="mr-8 flex justify-start font-sans text-base">
|
|
1364
1364
|
<div class="flex max-w-full space-x-2">
|
|
1365
1365
|
<!--
|
|
@@ -1373,18 +1373,18 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1373
1373
|
min-h-[50px] because when we start streaming we sometimes start with an empty paragraph
|
|
1374
1374
|
-->
|
|
1375
1375
|
<!-- TODO: maybe add back border? border border-gray-100 -->
|
|
1376
|
-
<div class="${
|
|
1376
|
+
<div class="${r} min-h-[50px] max-w-full overflow-hidden bg-gray-50 px-4 py-3 text-left text-gray-800">
|
|
1377
1377
|
<slot></slot>
|
|
1378
1378
|
</div>
|
|
1379
1379
|
</div>
|
|
1380
1380
|
</div>
|
|
1381
|
-
`;default:throw new Error(`Unknown side: ${this.side}`)}}};
|
|
1382
|
-
<div class="${
|
|
1383
|
-
<div class="${
|
|
1381
|
+
`;default:throw new Error(`Unknown side: ${this.side}`)}}};customElements.get("mw-chat-message")||customElements.define("mw-chat-message",ti);var de=class extends C(v){static properties={src:{type:String},alt:{type:String},side:{type:String},position:{type:String},width:{type:String},height:{type:String},clickable:{type:Boolean}};constructor(){super(),this.src="",this.alt="",this.side="right",this.position="single",this.width="300px",this.height="auto",this.clickable=!1}#e=!1;#t=!1;#r=!1;#n=!1;updated(e){e.has("src")&&(this.#e=!1,this.#t=!1)}get#i(){return this.side==="left"||this.side==="assistant"?"flex justify-start ml-[25px]":"flex justify-end"}get#s(){let e="inline-block overflow-hidden shadow-sm";if(this.side==="right"||this.side==="user")switch(this.position){case"first":e+=" rounded-2xl rounded-br-[4px]";break;case"middle":e+=" rounded-2xl rounded-r-[4px]";break;case"last":case"last-current":e+=" rounded-2xl rounded-tr-[4px]";break;default:e+=" rounded-2xl";break}else switch(this.position){case"first":e+=" rounded-2xl rounded-bl-[4px]";break;case"middle":e+=" rounded-2xl rounded-l-[4px]";break;case"last":case"last-current":e+=" rounded-2xl rounded-tl-[4px]";break;default:e+=" rounded-2xl";break}return e}#o(){if(!this.src)return"";try{let e=new URL(this.src);return e.searchParams.set("for","full"),e.href}catch{return this.src}}render(){return this.src?u`
|
|
1382
|
+
<div class="${this.#i} mb-2 min-h-[100px]">
|
|
1383
|
+
<div class="${this.#s} relative">
|
|
1384
1384
|
<!-- Placeholder background that's only shown when loading or error -->
|
|
1385
|
-
${
|
|
1385
|
+
${this.#e?null:u`
|
|
1386
1386
|
<div class="flex items-center justify-center bg-gray-100" style="width: ${this.width}; height: 200px;">
|
|
1387
|
-
${
|
|
1387
|
+
${this.#t?u`
|
|
1388
1388
|
<!-- Error icon -->
|
|
1389
1389
|
<svg class="h-8 w-8 text-gray-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
|
1390
1390
|
<path
|
|
@@ -1392,7 +1392,7 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1392
1392
|
stroke-linejoin="round"
|
|
1393
1393
|
d="m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z" />
|
|
1394
1394
|
</svg>
|
|
1395
|
-
`:
|
|
1395
|
+
`:u`
|
|
1396
1396
|
<!-- Loading pulse animation -->
|
|
1397
1397
|
<div class="h-8 w-8 animate-pulse rounded-full bg-gray-300"></div>
|
|
1398
1398
|
`}
|
|
@@ -1404,24 +1404,24 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1404
1404
|
src="${this.src}"
|
|
1405
1405
|
alt="${this.alt}"
|
|
1406
1406
|
style="width: ${this.width}; height: ${this.height}; display: block;"
|
|
1407
|
-
class="${
|
|
1408
|
-
@error="${
|
|
1409
|
-
@load="${
|
|
1410
|
-
@click="${this.clickable?
|
|
1407
|
+
class="${this.#e?"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="${this.#a}"
|
|
1409
|
+
@load="${this.#h}"
|
|
1410
|
+
@click="${this.clickable?this.#c:void 0}"
|
|
1411
1411
|
loading="lazy" />
|
|
1412
1412
|
</div>
|
|
1413
1413
|
</div>
|
|
1414
1414
|
|
|
1415
1415
|
<!-- Full image modal -->
|
|
1416
|
-
${
|
|
1416
|
+
${this.#r?u`
|
|
1417
1417
|
<div
|
|
1418
|
-
class="${
|
|
1419
|
-
@click="${
|
|
1418
|
+
class="${this.#n?"bg-opacity-0":"bg-opacity-75"} fixed inset-0 z-50 flex items-center justify-center bg-black p-4 transition-opacity duration-300"
|
|
1419
|
+
@click="${this.#l}">
|
|
1420
1420
|
<!-- Close button -->
|
|
1421
1421
|
<button
|
|
1422
1422
|
type="button"
|
|
1423
|
-
class="bg-opacity-50 ${
|
|
1424
|
-
@click="${
|
|
1423
|
+
class="bg-opacity-50 ${this.#n?"opacity-0":"opacity-75"} hover:bg-opacity-75 absolute top-8 right-8 z-10 rounded-full bg-black p-2 text-white transition-[colors,opacity] delay-300 focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-transparent focus:outline-none"
|
|
1424
|
+
@click="${this.#l}"
|
|
1425
1425
|
aria-label="Close full image">
|
|
1426
1426
|
<!-- X mark icon -->
|
|
1427
1427
|
<svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
|
|
@@ -1430,33 +1430,33 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1430
1430
|
</button>
|
|
1431
1431
|
<div class="relative flex max-h-full max-w-full">
|
|
1432
1432
|
<img
|
|
1433
|
-
src="${
|
|
1433
|
+
src="${this.#o()}"
|
|
1434
1434
|
alt="${this.alt}"
|
|
1435
|
-
class="${
|
|
1436
|
-
@click="${
|
|
1435
|
+
class="${this.#n?"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="${this.#f}" />
|
|
1437
1437
|
</div>
|
|
1438
1438
|
</div>
|
|
1439
1439
|
`:null}
|
|
1440
|
-
`:(console.warn("MwChatImage: No src provided"),null)}
|
|
1440
|
+
`:(console.warn("MwChatImage: No src provided"),null)}#a=e=>{console.error("Failed to load chat image:",this.src),this.#t=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:error",{detail:{src:this.src,event:e},bubbles:!0}))};#h=e=>{this.#e=!0,this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:load",{detail:{src:this.src,event:e},bubbles:!0}))};#c=e=>{this.clickable&&(e.preventDefault(),e.stopPropagation(),this.#r=!0,this.requestUpdate(),this.#n=!0,this.requestUpdate(),setTimeout(()=>{this.#n=!1,this.requestUpdate()},500),this.dispatchEvent(new CustomEvent("mw-chat-image:click",{detail:{src:this.src,event:e},bubbles:!0})))};#l=e=>{e.preventDefault(),e.stopPropagation(),this.#r=!1,this.requestUpdate()};#f=e=>{e.preventDefault(),e.stopPropagation()}};de.ErrorEvent=class extends CustomEvent{static type="mw-chat-image:error";constructor(e,r={}){super(de.ErrorEvent.type,{detail:e,...r})}};de.LoadEvent=class extends CustomEvent{static type="mw-chat-image:load";constructor(e,r={}){super(de.LoadEvent.type,{detail:e,...r})}};de.ClickEvent=class extends CustomEvent{static type="mw-chat-image:click";constructor(e,r={}){super(de.ClickEvent.type,{detail:e,...r})}};customElements.get("mw-chat-image")||customElements.define("mw-chat-image",de);var V=t=>t??L;var mc=["javascript:","data:text/html","vbscript:","data:text/javascript","data:text/vbscript","data:text/css","data:text/plain","data:text/xml"],_t=class t extends C(v){static properties={text:{type:String},color:{type:String},dismissible:{type:Boolean},storageKey:{type:String,attribute:"storage-key"},_dismissed:{type:Boolean,state:!0}};constructor(){super(),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(e){super.updated(e),e.has("storageKey")&&this.storageKey&&this.dismissible&&(this._dismissed=this.#e())}connectedCallback(){super.connectedCallback(),this.storageKey&&this.dismissible&&(this._dismissed=this.#e())}#e(){try{return localStorage.getItem(this.storageKey)==="true"}catch{return!1}}#t(){try{localStorage.setItem(this.storageKey,"true")}catch(e){console.warn("Could not save disclaimer dismissed state to localStorage:",e)}}#r=e=>{e.preventDefault(),this._dismissed=!0,this.storageKey&&this.#t(),this.dispatchEvent(new t.DismissEvent)};#n(e){let n=/\[([^\]]+)\]\(([^)]+)\)/g.exec(e);if(n){let i=n[0],s=n[1],o=n[2],c=n.index;return mc.some(l=>o.toLowerCase().startsWith(l))||!o||!s?e:u`${e.slice(0,c)}<a href="${V(o)}" target="_blank" rel="noopener noreferrer" @click="${this.#i}" class="underline" style="color: ${this.color}"
|
|
1441
|
+
>${s}</a
|
|
1442
|
+
>${e.slice(c+i.length)}`}return e}#i=e=>{e.stopPropagation()};render(){if(this._dismissed)return null;let e=this.#n(this.text);return u`
|
|
1441
1443
|
<div class="flex items-center justify-between">
|
|
1442
1444
|
<div class="flex flex-1 items-center justify-center">
|
|
1443
|
-
<span class="px-3 text-center text-xs font-light text-gray-500">${
|
|
1445
|
+
<span class="px-3 text-center text-xs font-light text-gray-500">${e}</span>
|
|
1444
1446
|
</div>
|
|
1445
1447
|
|
|
1446
|
-
${this.dismissible?
|
|
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="${
|
|
1448
|
+
${this.dismissible?u`
|
|
1449
|
+
<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="${this.#r}">
|
|
1448
1450
|
<lucide-icon name="x" class="h-3 w-3 text-gray-500"></lucide-icon>
|
|
1449
1451
|
</button>
|
|
1450
1452
|
`:null}
|
|
1451
1453
|
</div>
|
|
1452
|
-
`}};
|
|
1453
|
-
>${a}</a
|
|
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,ah,lh,Ss=class extends I($){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,ah).call(this)}render(){let t=m(this,Ar,lh).call(this);return h`
|
|
1454
|
+
`}};_t.DismissEvent=class extends CustomEvent{static type="mw-disclaimer:dismiss";constructor(e={}){super(_t.DismissEvent.type,{...e})}};customElements.get("mw-disclaimer")||customElements.define("mw-disclaimer",_t);var ri=class extends C(v){static properties={text:{type:String},variant:{type:String},autoDismissable:{type:Boolean,attribute:"auto-dismissable"},dismissDelay:{type:Number,attribute:"dismiss-delay"},_isVisible:{type:Boolean,state:!0}};constructor(){super(),this.text="I'm still learning!",this.variant="info",this.autoDismissable=!1,this.dismissDelay=5e3,this._isVisible=!0}connectedCallback(){super.connectedCallback(),this.autoDismissable&&this.#e()}#e(){setTimeout(()=>{this._isVisible=!1,this.requestUpdate()},this.dismissDelay)}#t(){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"}}}render(){let e=this.#t();return u`
|
|
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
|
-
<div class="${
|
|
1457
|
+
<div class="${e.bg} mb-2 flex max-w-[70%] items-center justify-center rounded-full px-3 py-2 select-none">
|
|
1458
1458
|
<!-- Icon based on variant -->
|
|
1459
|
-
${this.variant==="info"?
|
|
1459
|
+
${this.variant==="info"?u`
|
|
1460
1460
|
<!-- (i) symbol for info -->
|
|
1461
1461
|
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4">
|
|
1462
1462
|
<path
|
|
@@ -1465,21 +1465,21 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1465
1465
|
d="M2.25 12C2.25 6.61522 6.61522 2.25 12 2.25C17.3848 2.25 21.75 6.61522 21.75 12C21.75 17.3848 17.3848 21.75 12 21.75C6.61522 21.75 2.25 17.3848 2.25 12ZM10.9562 10.5584C12.1025 9.98533 13.3931 11.0206 13.0823 12.2639L12.3733 15.0999L12.4148 15.0792C12.7852 14.894 13.2357 15.0441 13.421 15.4146C13.6062 15.7851 13.4561 16.2356 13.0856 16.4208L13.0441 16.4416C11.8979 17.0147 10.6072 15.9794 10.9181 14.7361L11.6271 11.9001L11.5856 11.9208C11.2151 12.1061 10.7646 11.9559 10.5793 11.5854C10.3941 11.2149 10.5443 10.7644 10.9148 10.5792L10.9562 10.5584ZM12 9C12.4142 9 12.75 8.66421 12.75 8.25C12.75 7.83579 12.4142 7.5 12 7.5C11.5858 7.5 11.25 7.83579 11.25 8.25C11.25 8.66421 11.5858 9 12 9Z"
|
|
1466
1466
|
fill="white" />
|
|
1467
1467
|
</svg>
|
|
1468
|
-
`:this.variant==="error"?
|
|
1468
|
+
`:this.variant==="error"?u`
|
|
1469
1469
|
<!-- Alert circle for error -->
|
|
1470
1470
|
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4">
|
|
1471
1471
|
<circle cx="12" cy="12" r="10" stroke="white" stroke-width="2" />
|
|
1472
1472
|
<line x1="15" y1="9" x2="9" y2="15" stroke="white" stroke-width="2" />
|
|
1473
1473
|
<line x1="9" y1="9" x2="15" y2="15" stroke="white" stroke-width="2" />
|
|
1474
1474
|
</svg>
|
|
1475
|
-
`:this.variant==="warning"?
|
|
1475
|
+
`:this.variant==="warning"?u`
|
|
1476
1476
|
<!-- Alert triangle for warning -->
|
|
1477
1477
|
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4">
|
|
1478
1478
|
<path d="M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
1479
1479
|
<line x1="12" y1="9" x2="12" y2="13" stroke="white" stroke-width="2" stroke-linecap="round" />
|
|
1480
1480
|
<path d="M12 17h.01" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
1481
1481
|
</svg>
|
|
1482
|
-
`:
|
|
1482
|
+
`:u`
|
|
1483
1483
|
<!-- Check circle for success -->
|
|
1484
1484
|
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="h-4 w-4">
|
|
1485
1485
|
<path d="M22 11.08V12a10 10 0 11-5.93-9.14" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
|
|
@@ -1487,10 +1487,10 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1487
1487
|
</svg>
|
|
1488
1488
|
`}
|
|
1489
1489
|
|
|
1490
|
-
<span class="${
|
|
1490
|
+
<span class="${e.text} ml-1 text-xs">${this.text}</span>
|
|
1491
1491
|
</div>
|
|
1492
1492
|
</div>
|
|
1493
|
-
`}};
|
|
1493
|
+
`}};customElements.get("mw-info-banner")||customElements.define("mw-info-banner",ri);var ni=class extends C(v){render=()=>u`
|
|
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 Yd=Object.create;var Io=Object.defineProperty;var Xd=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
|
-
`
|
|
1505
|
+
`};customElements.get("mw-loading")||customElements.define("mw-loading",ni);var gc="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",ii=class extends C(v){render=()=>u`
|
|
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="${gc}" 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,10 +1525,20 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1525
1525
|
<span>Molin AI</span>
|
|
1526
1526
|
</a>
|
|
1527
1527
|
</p>
|
|
1528
|
-
`
|
|
1528
|
+
`};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",ii);var wc=Math.pow(10,8)*24*60*60*1e3,K1=-wc;var yc=3600;var ko=yc*24,Y1=ko*7,vc=ko*365.2425,bc=vc/12,X1=bc*3,si=Symbol.for("constructDateFrom");function Co(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&si in t?t[si](e):t instanceof Date?new t.constructor(e):new Date(e)}function oi(t,e){return Co(e||t,t)}function $o(t){return e=>{let n=(t?Math[t]:Math.trunc)(e);return n===0?0:n}}function So(t,e){return+oi(t)-+oi(e)}function ai(t,e,r){let n=So(t,e)/1e3;return $o(r?.roundingMethod)(n)}var li=class extends C(v){static 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},cdnBaseUrl:{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}};static styles=D`
|
|
1529
|
+
:host {
|
|
1530
|
+
display: block;
|
|
1531
|
+
}
|
|
1532
|
+
`;#e=7;constructor(){super(),this.question="",this.options=["No","Yes"],this.heading="",this.gameTitle="",this.resultPrefix="",this.correctButtonText="Correct",this.wrongButtonText="Wrong",this.color="#601feb",this.apiBaseUrl="",this.cdnBaseUrl="",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}firstUpdated(){this._currentQuestion=this.question}async#t(){if(!this.apiBaseUrl)return console.warn("API base URL not configured, cannot fetch next question"),null;this._isLoadingNextQuestion=!0;try{let e=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>=this.#e})});return e.ok?await e.json():(console.error("failed to fetch next question",e.status),null)}catch(e){return console.error("error fetching next question",e),null}finally{this._isLoadingNextQuestion=!1}}#r=async e=>{this._loadingAnswer=e,this._questionHistory.push({question:this._currentQuestion,answer:e}),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:e,totalQuestions:this.#e,allAnswers:this._questionHistory.map(n=>n.answer)}}));let r=await this.#t();r&&(r.isComplete&&r.guessedJob?(this._guessedJob=r.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(n=>n.answer)}}))):r.nextQuestion&&(this._currentQuestion=r.nextQuestion)),this._loadingAnswer=""};#n=async e=>{if(this._validatingButton=e?"correct":"wrong",this.dispatchEvent(new CustomEvent("mw-chat-wait-game:guess-validated",{bubbles:!0,composed:!0,detail:{guessedProfession:this._guessedJob,isCorrect:e,questionCount:this._questionHistory.length,allAnswers:this._questionHistory.map(r=>r.answer)}})),e)this._guessValidated=!0,this._validatingButton="";else{let r=await this.#t();r?.nextQuestion&&(this._currentQuestion=r.nextQuestion),this._guessedJob="",this._currentAttemptQuestionCount=0,this._validatingButton=""}};#i(){return Math.round(this._currentAttemptQuestionCount/this.#e*100)}#s(){let e=this.cdnBaseUrl?`${this.cdnBaseUrl}/assets/career-ladder`:"https://widget.molin.ai/assets/career-ladder";return u`
|
|
1533
|
+
<div class="mt-3 flex items-center justify-center gap-1">
|
|
1534
|
+
<span class="text-[11px] text-black/40">Inspired by</span>
|
|
1535
|
+
|
|
1536
|
+
<img src="${e}" alt="Career Ladder" class="h-6" />
|
|
1537
|
+
</div>
|
|
1538
|
+
`}render(){let e=this.#i(),r=this.heading||"Agent joining in",n=this.gameTitle||"\u{1F9E0} I'll guess your job",i=this.resultPrefix||"I'm pretty confident:";return this._guessedJob?u`
|
|
1529
1539
|
<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
1540
|
<div class="flex items-center justify-between">
|
|
1531
|
-
<div class="text-[13px] text-black/60">${
|
|
1541
|
+
<div class="text-[13px] text-black/60">${r}</div>
|
|
1532
1542
|
<span class="h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"></span>
|
|
1533
1543
|
</div>
|
|
1534
1544
|
|
|
@@ -1538,22 +1548,22 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1538
1548
|
</div>
|
|
1539
1549
|
|
|
1540
1550
|
<div class="mt-3 space-y-1.5 text-[13px] text-black/80">
|
|
1541
|
-
<div class="rounded-xl bg-black/[0.04] px-3 py-2">${
|
|
1551
|
+
<div class="rounded-xl bg-black/[0.04] px-3 py-2">${i} ${this._guessedJob}.</div>
|
|
1542
1552
|
</div>
|
|
1543
1553
|
|
|
1544
|
-
${this._guessValidated?"":
|
|
1554
|
+
${this._guessValidated?"":u`
|
|
1545
1555
|
<div class="mt-3 grid grid-cols-2 gap-2">
|
|
1546
1556
|
<button
|
|
1547
|
-
@click="${()=>
|
|
1557
|
+
@click="${()=>this.#n(!1)}"
|
|
1548
1558
|
?disabled="${!!this._validatingButton}"
|
|
1549
1559
|
class="flex items-center justify-center gap-1 rounded-xl border border-[${this.color}] bg-white px-4 py-2 text-sm font-medium text-black transition-colors hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50">
|
|
1550
|
-
${this._validatingButton==="wrong"?
|
|
1560
|
+
${this._validatingButton==="wrong"?u`<lucide-icon class="h-4 w-4 animate-spin" name="loader-circle"></lucide-icon>`:this.wrongButtonText}
|
|
1551
1561
|
</button>
|
|
1552
1562
|
<button
|
|
1553
|
-
@click="${()=>
|
|
1563
|
+
@click="${()=>this.#n(!0)}"
|
|
1554
1564
|
?disabled="${!!this._validatingButton}"
|
|
1555
1565
|
class="flex items-center justify-center gap-1 rounded-xl bg-[${this.color}] px-4 py-2 text-sm font-medium text-white transition-colors hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50">
|
|
1556
|
-
${this._validatingButton==="correct"?
|
|
1566
|
+
${this._validatingButton==="correct"?u`<lucide-icon class="h-4 w-4 animate-spin" name="loader-circle"></lucide-icon>`:this.correctButtonText}
|
|
1557
1567
|
</button>
|
|
1558
1568
|
</div>
|
|
1559
1569
|
`}
|
|
@@ -1562,12 +1572,12 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1562
1572
|
<div class="h-full rounded-full bg-[${this.color}] transition-[width] duration-300" style="width: 100%"></div>
|
|
1563
1573
|
</div>
|
|
1564
1574
|
|
|
1565
|
-
${
|
|
1575
|
+
${this.#s()}
|
|
1566
1576
|
</div>
|
|
1567
|
-
`:this._currentQuestion?
|
|
1577
|
+
`:this._currentQuestion?u`
|
|
1568
1578
|
<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">
|
|
1569
1579
|
<div class="flex items-center justify-between">
|
|
1570
|
-
<div class="text-[13px] text-black/60">${
|
|
1580
|
+
<div class="text-[13px] text-black/60">${r}</div>
|
|
1571
1581
|
<span class="h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"></span>
|
|
1572
1582
|
</div>
|
|
1573
1583
|
|
|
@@ -1577,40 +1587,34 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1577
1587
|
</div>
|
|
1578
1588
|
|
|
1579
1589
|
<div class="mt-2 flex items-center justify-between">
|
|
1580
|
-
<h3 class="text-sm font-semibold text-black">${
|
|
1581
|
-
<div class="text-xs text-black/40"><span>${this._currentAttemptQuestionCount}</span>/${
|
|
1590
|
+
<h3 class="text-sm font-semibold text-black">${n}</h3>
|
|
1591
|
+
<div class="text-xs text-black/40"><span>${this._currentAttemptQuestionCount}</span>/${this.#e}</div>
|
|
1582
1592
|
</div>
|
|
1583
1593
|
|
|
1584
1594
|
<div class="mt-3 rounded-xl bg-black/[0.04] px-3 py-2 text-[14px] font-medium text-black">${this._currentQuestion}</div>
|
|
1585
1595
|
|
|
1586
1596
|
<div class="mt-3 grid grid-cols-2 gap-1">
|
|
1587
|
-
${this.options.map((
|
|
1597
|
+
${this.options.map((s,o)=>{let c=this._loadingAnswer===s;return u`
|
|
1588
1598
|
<button
|
|
1589
|
-
@click="${()=>
|
|
1599
|
+
@click="${()=>this.#r(s)}"
|
|
1590
1600
|
?disabled="${this._isLoadingNextQuestion}"
|
|
1591
|
-
class="${
|
|
1592
|
-
${c?
|
|
1601
|
+
class="${o===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`}">
|
|
1602
|
+
${c?u`<lucide-icon class="h-3.5 w-3.5 animate-spin" name="loader-circle"></lucide-icon>`:s}
|
|
1593
1603
|
</button>
|
|
1594
1604
|
`})}
|
|
1595
1605
|
</div>
|
|
1596
1606
|
|
|
1597
1607
|
<div class="mt-3 h-1.5 overflow-hidden rounded-full bg-black/5">
|
|
1598
|
-
<div class="h-full rounded-full bg-[${this.color}] transition-[width] duration-300" style="width: ${
|
|
1608
|
+
<div class="h-full rounded-full bg-[${this.color}] transition-[width] duration-300" style="width: ${e}%"></div>
|
|
1599
1609
|
</div>
|
|
1600
1610
|
|
|
1601
|
-
${
|
|
1602
|
-
</div>
|
|
1603
|
-
`: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,qe=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,ph=function(){return Math.round(this._currentAttemptQuestionCount/o(this,Pt)*100)},nl=function(){let t=this.cdnBaseUrl?`${this.cdnBaseUrl}/assets/career-ladder`:"https://widget.molin.ai/assets/career-ladder";return h`
|
|
1604
|
-
<div class="mt-3 flex items-center justify-center gap-1">
|
|
1605
|
-
<span class="text-[11px] text-black/40">Inspired by</span>
|
|
1606
|
-
|
|
1607
|
-
<img src="${t}" alt="Career Ladder" class="h-6" />
|
|
1611
|
+
${this.#s()}
|
|
1608
1612
|
</div>
|
|
1609
|
-
|
|
1613
|
+
`:u`<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>`}};customElements.get("mw-chat-wait-game")||customElements.define("mw-chat-wait-game",li);var ci=class extends C(v){static 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},cdnBaseUrl:{type:String},soundUrl:{type:String,attribute:"sound"},_remainingSeconds:{type:Number,state:!0},_isComplete:{type:Boolean,state:!0},_showGame:{type:Boolean,state:!0}};static styles=D`
|
|
1610
1614
|
:host {
|
|
1611
1615
|
display: block;
|
|
1612
1616
|
}
|
|
1613
|
-
|
|
1617
|
+
`;#e=null;#t=null;#r=0;constructor(){super(),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.cdnBaseUrl="",this.soundUrl="",this._remainingSeconds=480,this._isComplete=!1,this._showGame=!1}connectedCallback(){super.connectedCallback(),this.#n(),this.#s()}disconnectedCallback(){super.disconnectedCallback(),this.#o()}#n(){this.targetEndTime?this.#t=new Date(this.targetEndTime):this.#t=new Date(Date.now()+this._remainingSeconds*1e3),this.#r=Math.max(ai(this.#t,new Date),0),this.#i()}#i(){if(this.#t===null)return;let e=new Date,r=ai(this.#t,e);r>=0?(this._remainingSeconds=r,this._isComplete=!1):(this._remainingSeconds=Math.abs(r),this._isComplete=!0)}#s(){this.#o(),this.#e=setInterval(()=>{this.#i()},1e3)}#o(){this.#e!==null&&(clearInterval(this.#e),this.#e=null)}#a=()=>{this.#h(),this._showGame=!0,this.dispatchEvent(new CustomEvent("mw-chat-wait-timer:game-click",{bubbles:!0,composed:!0}))};#h(){if(!this.soundUrl)return;let e=new Audio(this.soundUrl);e.volume=.5,e.play().then(()=>{}).catch(r=>{console.error("Error playing audio:",r,{})})}#c(){let e=Math.floor(this._remainingSeconds/60),r=this._remainingSeconds%60,n=i=>String(i).padStart(2,"0");return{minutes:n(e),seconds:n(r)}}#l(){return this._isComplete?0:this.#t===null||this.#r===0?100:Math.round(this._remainingSeconds/this.#r*100)}render(){let{minutes:e,seconds:r}=this.#c();if(this._showGame)return u`
|
|
1614
1618
|
<mw-chat-wait-game
|
|
1615
1619
|
.question="${this.question}"
|
|
1616
1620
|
.options="${this.options||["No","Yes"]}"
|
|
@@ -1622,16 +1626,16 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1622
1626
|
.color="${this.color}"
|
|
1623
1627
|
.apiBaseUrl="${this.apiBaseUrl}"
|
|
1624
1628
|
.cdnBaseUrl="${this.cdnBaseUrl}"
|
|
1625
|
-
.minutes="${
|
|
1626
|
-
.seconds="${
|
|
1627
|
-
`;let
|
|
1629
|
+
.minutes="${e}"
|
|
1630
|
+
.seconds="${r}"></mw-chat-wait-game>
|
|
1631
|
+
`;let n=this.#l();return u`
|
|
1628
1632
|
<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">
|
|
1629
1633
|
<!-- Time -->
|
|
1630
|
-
<div class="font-[ui-monospace,Menlo,Monaco,Consolas] text-4xl tracking-tight text-black tabular-nums" aria-live="polite">${
|
|
1634
|
+
<div class="font-[ui-monospace,Menlo,Monaco,Consolas] text-4xl tracking-tight text-black tabular-nums" aria-live="polite">${e}<span class="text-black/30">:</span>${r}</div>
|
|
1631
1635
|
|
|
1632
1636
|
<!-- Progress bar -->
|
|
1633
1637
|
<div class="mt-3 h-1.5 overflow-hidden rounded-full bg-black/5">
|
|
1634
|
-
<div class="h-full rounded-full bg-[${this.color}] transition-[width] duration-300" style="width: ${
|
|
1638
|
+
<div class="h-full rounded-full bg-[${this.color}] transition-[width] duration-300" style="width: ${n}%"></div>
|
|
1635
1639
|
</div>
|
|
1636
1640
|
|
|
1637
1641
|
<!-- Message -->
|
|
@@ -1639,40 +1643,36 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1639
1643
|
|
|
1640
1644
|
<!-- Play a Game Button -->
|
|
1641
1645
|
<div class="mt-4">
|
|
1642
|
-
<button @click="${
|
|
1646
|
+
<button @click="${this.#a}" 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>
|
|
1643
1647
|
</div>
|
|
1644
1648
|
</div>
|
|
1645
|
-
`}};
|
|
1646
|
-
:host {
|
|
1647
|
-
display: block;
|
|
1648
|
-
}
|
|
1649
|
-
`);customElements.get("mw-chat-wait-timer")||customElements.define("mw-chat-wait-timer",Fn);var Is=class extends I($){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 Ac(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`
|
|
1649
|
+
`}};customElements.get("mw-chat-wait-timer")||customElements.define("mw-chat-wait-timer",ci);var ui=class extends C(v){static properties={product:{type:Object},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},searchParams:{type:Object},imagesByProductUrl:{type:Object}};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,r=this.searchParams;try{if(e&&r)return ps(e,r).href}catch{}return e}render(){let{name:e,description:r,price:n,url:i}=this.product||{},s=i?this.imagesByProductUrl?.[i]:void 0;return u`
|
|
1650
1650
|
<a
|
|
1651
|
-
href="${
|
|
1652
|
-
title="${
|
|
1651
|
+
href="${V(this.trackedProductUrl)}"
|
|
1652
|
+
title="${V(e)}"
|
|
1653
1653
|
class="group flex w-full max-w-md cursor-pointer gap-[10px] overflow-hidden rounded-lg"
|
|
1654
1654
|
target="${this.linksNewTab?"_blank":"_self"}"
|
|
1655
1655
|
?disabled="${this.streaming}">
|
|
1656
|
-
${this.streaming?
|
|
1656
|
+
${this.streaming?u`
|
|
1657
1657
|
<!-- shimmer -->
|
|
1658
1658
|
<div class="h-[70px] w-[70px] animate-pulse overflow-hidden rounded-lg bg-gray-200"></div>
|
|
1659
|
-
`:
|
|
1659
|
+
`:u`<img src="${V(s)}" class="block h-[70px] w-[70px] rounded-lg bg-gray-100 object-contain" loading="lazy" />`}
|
|
1660
1660
|
|
|
1661
1661
|
<div class="flex flex-1 flex-col justify-between">
|
|
1662
1662
|
<div>
|
|
1663
|
-
${e||!this.streaming?
|
|
1663
|
+
${e||!this.streaming?u`<h3 class="line-clamp-1 text-sm font-medium group-hover:underline">${e}</h3>`:u`<div class="h-5 w-32 animate-pulse rounded bg-gray-200"></div>`}
|
|
1664
1664
|
|
|
1665
1665
|
<!-- no margin here -->
|
|
1666
1666
|
|
|
1667
|
-
${
|
|
1667
|
+
${r||!this.streaming?u`<p class="line-clamp-2 text-xs text-gray-500">${r}</p>`:u`<div class="my-1 h-6 w-3/4 animate-pulse rounded bg-gray-200"></div>`}
|
|
1668
1668
|
</div>
|
|
1669
1669
|
|
|
1670
1670
|
<!-- flexbox filled space -->
|
|
1671
1671
|
|
|
1672
|
-
${n||!this.streaming?
|
|
1672
|
+
${n||!this.streaming?u`<span class="text-xs text-gray-900">${n}</span>`:u`<div class="h-4 w-14 animate-pulse rounded bg-gray-200"></div>`}
|
|
1673
1673
|
</div>
|
|
1674
1674
|
</a>
|
|
1675
|
-
`}};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 ol=.001,J1=.01,vh=10,K1=.05,Y1=1;function bh({duration:r=800,bounce:e=.25,velocity:t=0,mass:n=1}){let i,s;As(r<=vh*1e3,"Spring duration must be 10 seconds or less");let a=1-e;a=Nn(K1,Y1,a),r=Nn(J1,vh,r/1e3),a<1?(i=u=>{let d=u*a,f=d*r,y=d-t,v=Ts(u,a),C=Math.exp(-f);return ol-y/v*C},s=u=>{let f=u*a*r,y=f*t+t,v=Math.pow(a,2)*Math.pow(u,2)*r,C=Math.exp(-f),j=Ts(Math.pow(u,2),a);return(-i(u)+ol>0?-1:1)*((y-v)*C)/j}):(i=u=>{let d=Math.exp(-u*r),f=(u-t)*r+1;return-ol+d*f},s=u=>{let d=Math.exp(-u*r),f=(t-u)*(r*r);return d*f});let l=5/r,c=Q1(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 X1=12;function Q1(r,e,t){let n=t;for(let i=1;i<X1;i++)n=n-r(n)/e(n);return n}function Ts(r,e){return r*Math.sqrt(1-e*e)}var e0=["duration","bounce"],t0=["stiffness","damping","mass"];function xh(r,e){return e.some(t=>r[t]!==void 0)}function r0(r){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},r);if(!xh(r,t0)&&xh(r,e0)){let t=bh(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}=r0(s),v=kh,C=kh;function j(){let S=d?-(d/1e3):0,M=t-e,k=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)),k<1){let L=Ts(E,k);v=z=>{let ee=Math.exp(-k*E*z);return t-ee*((S+k*E*M)/L*Math.sin(L*z)+M*Math.cos(L*z))},C=z=>{let ee=Math.exp(-k*E*z);return k*E*ee*(Math.sin(L*z)*(S+k*E*M)/L+M*Math.cos(L*z))-ee*(Math.cos(L*z)*(S+k*E*M)-L*M*Math.sin(L*z))}}else if(k===1)v=L=>t-Math.exp(-E*L)*(M+(S+E*M)*L);else{let L=E*Math.sqrt(k*k-1);v=z=>{let ee=Math.exp(-k*E*z),se=Math.min(L*z,300);return t-ee*((S+k*E*M)*Math.sinh(se)+L*M*Math.cosh(se))/L}}}return j(),{next:S=>{let M=v(S);if(y)a.done=S>=f;else{let k=C(S)*1e3,E=Math.abs(k)<=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 kh=r=>0;var al=(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),at=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,Ch=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Ke(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)}),Pw=Object.assign(Object.assign({},Or),{default:1});var Hn=r=>({test:e=>Ke(e)&&e.endsWith(r)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${r}`}),qw=Hn("deg"),Ur=Hn("%"),Vw=Hn("px"),Fw=Hn("vh"),Nw=Hn("vw"),Hw=Object.assign(Object.assign({},Ur),{parse:r=>Ur.parse(r)/100,transform:r=>Ur.transform(r*100)});var Pr=(r,e)=>t=>!!(Ke(t)&&Ch.test(t)&&t.startsWith(r)||e&&Object.prototype.hasOwnProperty.call(t,e)),Us=(r,e,t)=>n=>{if(!Ke(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 Ve={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(at(e))+", "+Ur.transform(at(t))+", "+at(Os.transform(n))+")"};var n0=js(0,255),Ps=Object.assign(Object.assign({},Or),{transform:r=>Math.round(n0(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)+", "+at(Os.transform(n))+")"};function i0(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:i0,transform:Ie.transform};var lt={test:r=>Ie.test(r)||Rr.test(r)||Ve.test(r),parse:r=>Ie.test(r)?Ie.parse(r):Ve.test(r)?Ve.parse(r):Rr.parse(r),transform:r=>Ke(r)?r:r.hasOwnProperty("red")?Ie.transform(r):Ve.transform(r)};var $h="${c}",Sh="${n}";function s0(r){var e,t,n,i;return isNaN(r)&&Ke(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 Eh(r){typeof r=="number"&&(r=`${r}`);let e=[],t=0,n=r.match(Ds);n&&(t=n.length,r=r.replace(Ds,$h),e.push(...n.map(lt.parse)));let i=r.match(Dr);return i&&(r=r.replace(Dr,Sh),e.push(...i.map(Or.parse))),{values:e,numColors:t,tokenised:r}}function _h(r){return Eh(r).values}function Ih(r){let{values:e,numColors:t,tokenised:n}=Eh(r),i=e.length;return s=>{let a=n;for(let l=0;l<i;l++)a=a.replace(l<t?$h:Sh,l<t?lt.transform(s[l]):at(s[l]));return a}}var o0=r=>typeof r=="number"?0:r;function a0(r){let e=_h(r);return Ih(r)(e.map(o0))}var Rs={test:s0,parse:_h,createTransformer:Ih,getAnimatableNone:a0};function ll(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 cl({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=ll(c,l,r+1/3),s=ll(c,l,r),a=ll(c,l,r-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:n}}var l0=(r,e,t)=>{let n=r*r,i=e*e;return Math.sqrt(Math.max(0,t*(i-n)+n))},c0=[Rr,Ie,Ve],Mh=r=>c0.find(e=>e.test(r)),Ah=r=>`'${r}' is not an animatable color. Use the equivalent color code instead.`,Bs=(r,e)=>{let t=Mh(r),n=Mh(e);Lr(!!t,Ah(r)),Lr(!!n,Ah(e));let i=t.parse(r),s=n.parse(e);t===Ve&&(i=cl(i),t=Ie),n===Ve&&(s=cl(s),n=Ie);let a=Object.assign({},i);return l=>{for(let c in a)c!=="alpha"&&(a[c]=l0(i[c],s[c],l));return a.alpha=jr(i.alpha,s.alpha,l),t.transform(a)}};var Th=r=>typeof r=="number";var u0=(r,e)=>t=>e(r(t)),qs=(...r)=>r.reduce(u0);function jh(r,e){return Th(r)?t=>jr(r,e,t):lt.test(r)?Bs(r,e):hl(r,e)}var ul=(r,e)=>{let t=[...r],n=t.length,i=r.map((s,a)=>jh(s,e[a]));return s=>{for(let a=0;a<n;a++)t[a]=i[a](s);return t}},Dh=(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]=jh(r[i],e[i]));return i=>{for(let s in n)t[s]=n[s](i);return t}};function Lh(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 hl=(r,e)=>{let t=Rs.createTransformer(e),n=Lh(r),i=Lh(e);return n.numHSL===i.numHSL&&n.numRGB===i.numRGB&&n.numNumbers>=i.numNumbers?qs(ul(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 h0=(r,e)=>t=>jr(r,e,t);function d0(r){if(typeof r=="number")return h0;if(typeof r=="string")return lt.test(r)?Bs:hl;if(Array.isArray(r))return ul;if(typeof r=="object")return Dh}function p0(r,e,t){let n=[],i=t||d0(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 f0([r,e],[t]){return n=>t(al(r,e,n))}function m0(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=al(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=p0(e,n,i),l=s===2?f0(r,a):m0(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,Oh=r=>e=>Math.pow(e,r),dl=r=>e=>e*e*((r+1)*e-r),Uh=r=>{let e=dl(r);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))};var Ph=1.525,g0=4/11,w0=8/11,y0=9/10;var Rh=Oh(2),G4=zn(Rh),Bh=Fs(Rh),v0=r=>1-Math.sin(Math.acos(r)),b0=zn(v0),Z4=Fs(b0),qh=dl(Ph),J4=zn(qh),K4=Fs(qh),Y4=Uh(Ph),x0=4356/361,k0=35442/1805,C0=16061/1805,$0=r=>{if(r===1||r===0)return r;let e=r*r;return r<g0?7.5625*e:r<w0?9.075*e-9.9*r+3.4:r<y0?x0*e-k0*r+C0:10.8*r*r-20.52*r+10.72},X4=zn($0);function S0(r,e){return r.map(()=>e||Bh).splice(0,r.length-1)}function E0(r){let e=r.length;return r.map((t,n)=>n!==0?n/(e-1):0)}function _0(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=_0(n&&n.length===a.length?n:E0(a),i);function c(){return Vs(l,a,{ease:Array.isArray(t)?t:S0(a,t)})}let u=c();return{next:d=>(s.value=u(d),s.done=d>=i,s),flipTarget:()=>{a.reverse(),u=c()}}}function Vh({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 Fh={keyframes:Wn,spring:Ls,decay:Vh};function Nh(r){if(Array.isArray(r.to))return Wn;if(Fh[r.type])return Fh[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 pl=16.666666666666668,I0=typeof performance<"u"?()=>performance.now():()=>Date.now(),fl=typeof window<"u"?r=>window.requestAnimationFrame(r):r=>setTimeout(()=>r(I0()),pl);function Hh(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 M0=40,ml=!0,Zn=!1,gl=!1,Gn={delta:0,timestamp:0},Jn=["read","update","preRender","render","postRender"],Ns=Jn.reduce((r,e)=>(r[e]=Hh(()=>Zn=!0),r),{}),A0=Jn.reduce((r,e)=>{let t=Ns[e];return r[e]=(n,i=!1,s=!1)=>(Zn||L0(),t.schedule(n,i,s)),r},{}),zh=Jn.reduce((r,e)=>(r[e]=Ns[e].cancel,r),{}),dy=Jn.reduce((r,e)=>(r[e]=()=>Ns[e].process(Gn),r),{}),T0=r=>Ns[r].process(Gn),Wh=r=>{Zn=!1,Gn.delta=ml?pl:Math.max(Math.min(r-Gn.timestamp,M0),1),Gn.timestamp=r,gl=!0,Jn.forEach(T0),gl=!1,Zn&&(ml=!1,fl(Wh))},L0=()=>{Zn=!0,ml=!0,gl||fl(Wh)};var Gh=A0;function wl(r,e,t=0){return r-e-t}function Zh(r,e,t=0,n=!0){return n?wl(e+-r,e,t):e-(r-e)+t}function Jh(r,e,t,n){return n?r>=e+t:r<=-t}var j0=r=>{let e=({delta:t})=>r(t);return{start:()=>Gh.update(e,!0),stop:()=>zh.update(e)}};function yl(r){var e,t,{from:n,autoplay:i=!0,driver:s=j0,elapsed:a=0,repeat:l=0,repeatType:c="loop",repeatDelay:u=0,onPlay:d,onStop:f,onComplete:y,onRepeat:v,onUpdate:C}=r,j=Ms(r,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:S}=j,M,k=0,E=j.duration,L,z=!1,ee=!0,se,B=Nh(j);!((t=(e=B).needsInterpolation)===null||t===void 0)&&t.call(e,n,S)&&(se=Vs([0,100],[n,S],{clamp:!1}),n=0,S=100);let oe=B(Object.assign(Object.assign({},j),{from:n,to:S}));function de(){k++,c==="reverse"?(ee=k%2===0,a=Zh(a,E,u,ee)):(a=wl(a,E,u),c==="mirror"&&oe.flipTarget()),z=!1,v&&v()}function _o(){M.stop(),y&&y()}function gt(Z){if(ee||(Z=-Z),a+=Z,!z){let ae=oe.next(Math.max(0,a));L=ae.value,se&&(L=se(L)),z=ee?ae.done:a<=0}C?.(L),z&&(k===0&&(E??(E=a)),k<l?Jh(a,E,u,ee)&&de():_o())}function Ei(){d?.(),M=s(gt),M.start()}return i&&Ei(),{stop:()=>{f?.(),M.stop()}}}var H,Kh,Hs,Yh,zs,Xh,Qh,ed,Ws,Gs=class Gs extends I($){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,Kh).call(this)}get images(){return this.product?.images||[]}render(){if(!this.product)return h`
|
|
1675
|
+
`}};customElements.get("mw-product-card-horizontal")||customElements.define("mw-product-card-horizontal",ui);function $r(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}var Sr=function(){},nt=function(){};var Mt=(t,e,r)=>Math.min(Math.max(r,t),e);var hi=.001,xc=.01,Eo=10,kc=.05,Cc=1;function _o({duration:t=800,bounce:e=.25,velocity:r=0,mass:n=1}){let i,s;Sr(t<=Eo*1e3,"Spring duration must be 10 seconds or less");let o=1-e;o=Mt(kc,Cc,o),t=Mt(xc,Eo,t/1e3),o<1?(i=a=>{let h=a*o,d=h*t,f=h-r,p=Er(a,o),y=Math.exp(-d);return hi-f/p*y},s=a=>{let d=a*o*t,f=d*r+r,p=Math.pow(o,2)*Math.pow(a,2)*t,y=Math.exp(-d),E=Er(Math.pow(a,2),o);return(-i(a)+hi>0?-1:1)*((f-p)*y)/E}):(i=a=>{let h=Math.exp(-a*t),d=(a-r)*t+1;return-hi+h*d},s=a=>{let h=Math.exp(-a*t),d=(r-a)*(t*t);return h*d});let c=5/t,l=Sc(i,s,c);if(t=t*1e3,isNaN(l))return{stiffness:100,damping:10,duration:t};{let a=Math.pow(l,2)*n;return{stiffness:a,damping:o*2*Math.sqrt(n*a),duration:t}}}var $c=12;function Sc(t,e,r){let n=r;for(let i=1;i<$c;i++)n=n-t(n)/e(n);return n}function Er(t,e){return t*Math.sqrt(1-e*e)}var Ec=["duration","bounce"],_c=["stiffness","damping","mass"];function Mo(t,e){return e.some(r=>t[r]!==void 0)}function Mc(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!Mo(t,_c)&&Mo(t,Ec)){let r=_o(t);e=Object.assign(Object.assign(Object.assign({},e),r),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function _r(t){var{from:e=0,to:r=1,restSpeed:n=2,restDelta:i}=t,s=$r(t,["from","to","restSpeed","restDelta"]);let o={done:!1,value:e},{stiffness:c,damping:l,mass:a,velocity:h,duration:d,isResolvedFromDuration:f}=Mc(s),p=Io,y=Io;function E(){let b=h?-(h/1e3):0,x=r-e,w=l/(2*Math.sqrt(c*a)),$=Math.sqrt(c/a)/1e3;if(i===void 0&&(i=Math.min(Math.abs(r-e)/100,.4)),w<1){let S=Er($,w);p=T=>{let U=Math.exp(-w*$*T);return r-U*((b+w*$*x)/S*Math.sin(S*T)+x*Math.cos(S*T))},y=T=>{let U=Math.exp(-w*$*T);return w*$*U*(Math.sin(S*T)*(b+w*$*x)/S+x*Math.cos(S*T))-U*(Math.cos(S*T)*(b+w*$*x)-S*x*Math.sin(S*T))}}else if(w===1)p=S=>r-Math.exp(-$*S)*(x+(b+$*x)*S);else{let S=$*Math.sqrt(w*w-1);p=T=>{let U=Math.exp(-w*$*T),B=Math.min(S*T,300);return r-U*((b+w*$*x)*Math.sinh(B)+S*x*Math.cosh(B))/S}}}return E(),{next:b=>{let x=p(b);if(f)o.done=b>=d;else{let w=y(b)*1e3,$=Math.abs(w)<=n,S=Math.abs(r-x)<=i;o.done=$&&S}return o.value=o.done?r:x,o},flipTarget:()=>{h=-h,[e,r]=[r,e],E()}}}_r.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";var Io=t=>0;var di=(t,e,r)=>{let n=e-t;return n===0?1:(r-t)/n};var it=(t,e,r)=>-r*t+r*e+t;var Mr=(t,e)=>r=>Math.max(Math.min(r,e),t),ye=t=>t%1?Number(t.toFixed(5)):t,st=/(-)?([\d]*\.?[\d])+/g,Ir=/(#[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,Ao=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function pe(t){return typeof t=="string"}var ot={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Ar=Object.assign(Object.assign({},ot),{transform:Mr(0,1)}),P0=Object.assign(Object.assign({},ot),{default:1});var It=t=>({test:e=>pe(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),q0=It("deg"),at=It("%"),F0=It("px"),V0=It("vh"),N0=It("vw"),H0=Object.assign(Object.assign({},at),{parse:t=>at.parse(t)/100,transform:t=>at.transform(t*100)});var lt=(t,e)=>r=>!!(pe(r)&&Ao.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),Tr=(t,e,r)=>n=>{if(!pe(n))return n;let[i,s,o,c]=n.match(st);return{[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(o),alpha:c!==void 0?parseFloat(c):1}};var oe={test:lt("hsl","hue"),parse:Tr("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+at.transform(ye(e))+", "+at.transform(ye(r))+", "+ye(Ar.transform(n))+")"};var Ic=Mr(0,255),Lr=Object.assign(Object.assign({},ot),{transform:t=>Math.round(Ic(t))}),Q={test:lt("rgb","red"),parse:Tr("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+Lr.transform(t)+", "+Lr.transform(e)+", "+Lr.transform(r)+", "+ye(Ar.transform(n))+")"};function Ac(t){let e="",r="",n="",i="";return t.length>5?(e=t.substr(1,2),r=t.substr(3,2),n=t.substr(5,2),i=t.substr(7,2)):(e=t.substr(1,1),r=t.substr(2,1),n=t.substr(3,1),i=t.substr(4,1),e+=e,r+=r,n+=n,i+=i),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}var ct={test:lt("#"),parse:Ac,transform:Q.transform};var ve={test:t=>Q.test(t)||ct.test(t)||oe.test(t),parse:t=>Q.test(t)?Q.parse(t):oe.test(t)?oe.parse(t):ct.parse(t),transform:t=>pe(t)?t:t.hasOwnProperty("red")?Q.transform(t):oe.transform(t)};var To="${c}",Lo="${n}";function Tc(t){var e,r,n,i;return isNaN(t)&&pe(t)&&((r=(e=t.match(st))===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0)+((i=(n=t.match(Ir))===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0)>0}function jo(t){typeof t=="number"&&(t=`${t}`);let e=[],r=0,n=t.match(Ir);n&&(r=n.length,t=t.replace(Ir,To),e.push(...n.map(ve.parse)));let i=t.match(st);return i&&(t=t.replace(st,Lo),e.push(...i.map(ot.parse))),{values:e,numColors:r,tokenised:t}}function Do(t){return jo(t).values}function Oo(t){let{values:e,numColors:r,tokenised:n}=jo(t),i=e.length;return s=>{let o=n;for(let c=0;c<i;c++)o=o.replace(c<r?To:Lo,c<r?ve.transform(s[c]):ye(s[c]));return o}}var Lc=t=>typeof t=="number"?0:t;function jc(t){let e=Do(t);return Oo(t)(e.map(Lc))}var jr={test:Tc,parse:Do,createTransformer:Oo,getAnimatableNone:jc};function pi(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function fi({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,s=0,o=0;if(!e)i=s=o=r;else{let c=r<.5?r*(1+e):r+e-r*e,l=2*r-c;i=pi(l,c,t+1/3),s=pi(l,c,t),o=pi(l,c,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}var Dc=(t,e,r)=>{let n=t*t,i=e*e;return Math.sqrt(Math.max(0,r*(i-n)+n))},Oc=[ct,Q,oe],Uo=t=>Oc.find(e=>e.test(t)),Po=t=>`'${t}' is not an animatable color. Use the equivalent color code instead.`,Dr=(t,e)=>{let r=Uo(t),n=Uo(e);nt(!!r,Po(t)),nt(!!n,Po(e));let i=r.parse(t),s=n.parse(e);r===oe&&(i=fi(i),r=Q),n===oe&&(s=fi(s),n=Q);let o=Object.assign({},i);return c=>{for(let l in o)l!=="alpha"&&(o[l]=Dc(i[l],s[l],c));return o.alpha=it(i.alpha,s.alpha,c),r.transform(o)}};var Ro=t=>typeof t=="number";var Uc=(t,e)=>r=>e(t(r)),Or=(...t)=>t.reduce(Uc);function qo(t,e){return Ro(t)?r=>it(t,e,r):ve.test(t)?Dr(t,e):gi(t,e)}var mi=(t,e)=>{let r=[...t],n=r.length,i=t.map((s,o)=>qo(s,e[o]));return s=>{for(let o=0;o<n;o++)r[o]=i[o](s);return r}},Fo=(t,e)=>{let r=Object.assign(Object.assign({},t),e),n={};for(let i in r)t[i]!==void 0&&e[i]!==void 0&&(n[i]=qo(t[i],e[i]));return i=>{for(let s in n)r[s]=n[s](i);return r}};function Bo(t){let e=jr.parse(t),r=e.length,n=0,i=0,s=0;for(let o=0;o<r;o++)n||typeof e[o]=="number"?n++:e[o].hue!==void 0?s++:i++;return{parsed:e,numNumbers:n,numRGB:i,numHSL:s}}var gi=(t,e)=>{let r=jr.createTransformer(e),n=Bo(t),i=Bo(e);return n.numHSL===i.numHSL&&n.numRGB===i.numRGB&&n.numNumbers>=i.numNumbers?Or(mi(n.parsed,i.parsed),r):(Sr(!0,`Complex values '${t}' 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.`),o=>`${o>0?e:t}`)};var Pc=(t,e)=>r=>it(t,e,r);function Rc(t){if(typeof t=="number")return Pc;if(typeof t=="string")return ve.test(t)?Dr:gi;if(Array.isArray(t))return mi;if(typeof t=="object")return Fo}function Bc(t,e,r){let n=[],i=r||Rc(t[0]),s=t.length-1;for(let o=0;o<s;o++){let c=i(t[o],t[o+1]);if(e){let l=Array.isArray(e)?e[o]:e;c=Or(l,c)}n.push(c)}return n}function qc([t,e],[r]){return n=>r(di(t,e,n))}function Fc(t,e){let r=t.length,n=r-1;return i=>{let s=0,o=!1;if(i<=t[0]?o=!0:i>=t[n]&&(s=n-1,o=!0),!o){let l=1;for(;l<r&&!(t[l]>i||l===n);l++);s=l-1}let c=di(t[s],t[s+1],i);return e[s](c)}}function Ur(t,e,{clamp:r=!0,ease:n,mixer:i}={}){let s=t.length;nt(s===e.length,"Both input and output ranges must be the same length"),nt(!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."),t[0]>t[s-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());let o=Bc(e,n,i),c=s===2?qc(t,o):Fc(t,o);return r?l=>c(Mt(t[0],t[s-1],l)):c}var At=t=>e=>1-t(1-e),Pr=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Vo=t=>e=>Math.pow(e,t),wi=t=>e=>e*e*((t+1)*e-t),No=t=>{let e=wi(t);return r=>(r*=2)<1?.5*e(r):.5*(2-Math.pow(2,-10*(r-1)))};var Ho=1.525,Vc=4/11,Nc=8/11,Hc=9/10;var zo=Vo(2),Zf=At(zo),Wo=Pr(zo),zc=t=>1-Math.sin(Math.acos(t)),Wc=At(zc),Jf=Pr(Wc),Go=wi(Ho),Kf=At(Go),Yf=Pr(Go),Xf=No(Ho),Gc=4356/361,Zc=35442/1805,Jc=16061/1805,Kc=t=>{if(t===1||t===0)return t;let e=t*t;return t<Vc?7.5625*e:t<Nc?9.075*e-9.9*t+3.4:t<Hc?Gc*e-Zc*t+Jc:10.8*t*t-20.52*t+10.72},Qf=At(Kc);function Yc(t,e){return t.map(()=>e||Wo).splice(0,t.length-1)}function Xc(t){let e=t.length;return t.map((r,n)=>n!==0?n/(e-1):0)}function Qc(t,e){return t.map(r=>r*e)}function Tt({from:t=0,to:e=1,ease:r,offset:n,duration:i=300}){let s={done:!1,value:t},o=Array.isArray(e)?e:[t,e],c=Qc(n&&n.length===o.length?n:Xc(o),i);function l(){return Ur(c,o,{ease:Array.isArray(r)?r:Yc(o,r)})}let a=l();return{next:h=>(s.value=a(h),s.done=h>=i,s),flipTarget:()=>{o.reverse(),a=l()}}}function Zo({velocity:t=0,from:e=0,power:r=.8,timeConstant:n=350,restDelta:i=.5,modifyTarget:s}){let o={done:!1,value:e},c=r*t,l=e+c,a=s===void 0?l:s(l);return a!==l&&(c=a-e),{next:h=>{let d=-c*Math.exp(-h/n);return o.done=!(d>i||d<-i),o.value=o.done?a:a+d,o},flipTarget:()=>{}}}var Jo={keyframes:Tt,spring:_r,decay:Zo};function Ko(t){if(Array.isArray(t.to))return Tt;if(Jo[t.type])return Jo[t.type];let e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Tt:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?_r:Tt}var yi=16.666666666666668,eu=typeof performance<"u"?()=>performance.now():()=>Date.now(),vi=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(eu()),yi);function Yo(t){let e=[],r=[],n=0,i=!1,s=!1,o=new WeakSet,c={schedule:(l,a=!1,h=!1)=>{let d=h&&i,f=d?e:r;return a&&o.add(l),f.indexOf(l)===-1&&(f.push(l),d&&i&&(n=e.length)),l},cancel:l=>{let a=r.indexOf(l);a!==-1&&r.splice(a,1),o.delete(l)},process:l=>{if(i){s=!0;return}if(i=!0,[e,r]=[r,e],r.length=0,n=e.length,n)for(let a=0;a<n;a++){let h=e[a];h(l),o.has(h)&&(c.schedule(h),t())}i=!1,s&&(s=!1,c.process(l))}};return c}var tu=40,bi=!0,jt=!1,xi=!1,Lt={delta:0,timestamp:0},Dt=["read","update","preRender","render","postRender"],Rr=Dt.reduce((t,e)=>(t[e]=Yo(()=>jt=!0),t),{}),ru=Dt.reduce((t,e)=>{let r=Rr[e];return t[e]=(n,i=!1,s=!1)=>(jt||iu(),r.schedule(n,i,s)),t},{}),Xo=Dt.reduce((t,e)=>(t[e]=Rr[e].cancel,t),{}),p2=Dt.reduce((t,e)=>(t[e]=()=>Rr[e].process(Lt),t),{}),nu=t=>Rr[t].process(Lt),Qo=t=>{jt=!1,Lt.delta=bi?yi:Math.max(Math.min(t-Lt.timestamp,tu),1),Lt.timestamp=t,xi=!0,Dt.forEach(nu),xi=!1,jt&&(bi=!1,vi(Qo))},iu=()=>{jt=!0,bi=!0,xi||vi(Qo)};var ea=ru;function ki(t,e,r=0){return t-e-r}function ta(t,e,r=0,n=!0){return n?ki(e+-t,e,r):e-(t-e)+r}function ra(t,e,r,n){return n?t>=e+r:t<=-r}var su=t=>{let e=({delta:r})=>t(r);return{start:()=>ea.update(e,!0),stop:()=>Xo.update(e)}};function Ci(t){var e,r,{from:n,autoplay:i=!0,driver:s=su,elapsed:o=0,repeat:c=0,repeatType:l="loop",repeatDelay:a=0,onPlay:h,onStop:d,onComplete:f,onRepeat:p,onUpdate:y}=t,E=$r(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:b}=E,x,w=0,$=E.duration,S,T=!1,U=!0,B,M=Ko(E);!((r=(e=M).needsInterpolation)===null||r===void 0)&&r.call(e,n,b)&&(B=Ur([0,100],[n,b],{clamp:!1}),n=0,b=100);let q=M(Object.assign(Object.assign({},E),{from:n,to:b}));function N(){w++,l==="reverse"?(U=w%2===0,o=ta(o,$,a,U)):(o=ki(o,$,a),l==="mirror"&&q.flipTarget()),T=!1,p&&p()}function Zr(){x.stop(),f&&f()}function xe(j){if(U||(j=-j),o+=j,!T){let F=q.next(Math.max(0,o));S=F.value,B&&(S=B(S)),T=U?F.done:o<=0}y?.(S),T&&(w===0&&($??($=o)),w<c?ra(o,$,a,U)&&N():Zr())}function qt(){h?.(),x=s(xe),x.start()}return i&&qt(),{stop:()=>{d?.(),x.stop()}}}var Ot=class t extends C(v){static properties={product:{type:Object},labels:{type:Object},_currentImageIndex:{type:Number,state:!0},_isValidUrl:{type:Boolean,state:!0}};constructor(){super(),this.product=void 0,this.labels={addToCart:"Add to cart",color:"Color",size:"Size"},this._currentImageIndex=0,this._isValidUrl=!1}willUpdate(e){e.has("product")&&this.#e()}#e(){if(!this.product?.url){this._isValidUrl=!1;return}try{let e=new URL(this.product.url);this._isValidUrl=e.protocol==="http:"||e.protocol==="https:"}catch{this._isValidUrl=!1}}get images(){return this.product?.images||[]}render(){if(!this.product)return u`
|
|
1676
1676
|
<div class="my-2 w-full rounded-3xl border bg-white p-4">
|
|
1677
1677
|
<div class="relative mx-auto mb-4 max-w-[240px]">
|
|
1678
1678
|
<div class="h-[180px] w-full animate-pulse rounded-2xl bg-gray-200"></div>
|
|
@@ -1691,15 +1691,15 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1691
1691
|
<div class="h-8 flex-auto animate-pulse rounded-xl bg-gray-200"></div>
|
|
1692
1692
|
</div>
|
|
1693
1693
|
</div>
|
|
1694
|
-
`;if(this.product.layout==="horizontal")return
|
|
1694
|
+
`;if(this.product.layout==="horizontal")return u` <mw-product-card-horizontal product="${JSON.stringify(this.product)}"></mw-product-card-horizontal> `;let{name:e,description:r,price:n,category:i}=this.product;return u`
|
|
1695
1695
|
<div class="my-2 w-full rounded-3xl border-[0.5px] border-[#5e5d59]/25 bg-white p-4 hover:shadow-sm">
|
|
1696
1696
|
<div class="pointer-events-auto mx-auto mb-4">
|
|
1697
1697
|
<div class="group relative overflow-hidden rounded-2xl">
|
|
1698
1698
|
<div class="image-slider z-0 flex transition-transform duration-300 ease-in-out" style="transform: translateX(-${this._currentImageIndex*100}%)">
|
|
1699
|
-
${this.images.length>0?
|
|
1699
|
+
${this.images.length>0?X(this.images,s=>s,(s,o)=>u`
|
|
1700
1700
|
<!-- TODO: add srcset with 1x/2x variants for high DPI displays -->
|
|
1701
|
-
<img src="${
|
|
1702
|
-
`):
|
|
1701
|
+
<img src="${s}" alt="image ${o+1}: ${e}" class="h-auto w-full flex-shrink-0 object-scale-down" loading="lazy" />
|
|
1702
|
+
`):u`
|
|
1703
1703
|
<div class="h-full w-full flex-shrink-0 object-scale-down"></div>
|
|
1704
1704
|
<svg class="rounded-lg" height="144" viewBox="0 0 100 133" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1705
1705
|
<rect width="100" height="133" rx="2" fill="#EEEEEE" style="" transform="matrix(0.9999999999999999, 0, 0, 0.9999999999999999, 0, -7.105427357601002e-15)" />
|
|
@@ -1711,67 +1711,67 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1711
1711
|
</svg>
|
|
1712
1712
|
`}
|
|
1713
1713
|
</div>
|
|
1714
|
-
${this.images.length>1?
|
|
1714
|
+
${this.images.length>1?u`
|
|
1715
1715
|
<div class="absolute inset-0 flex items-center justify-between px-4">
|
|
1716
1716
|
<button
|
|
1717
|
-
@click="${
|
|
1717
|
+
@click="${this.#s}"
|
|
1718
1718
|
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">
|
|
1719
1719
|
<hi-outline class="block h-6 w-3" name="chevron-left"></hi-outline>
|
|
1720
1720
|
</button>
|
|
1721
1721
|
<button
|
|
1722
|
-
@click="${
|
|
1722
|
+
@click="${this.#i}"
|
|
1723
1723
|
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">
|
|
1724
1724
|
<hi-outline class="block h-6 w-3" name="chevron-right"></hi-outline>
|
|
1725
1725
|
</button>
|
|
1726
1726
|
</div>
|
|
1727
1727
|
`:null}
|
|
1728
|
-
${this.images?.length>1?
|
|
1728
|
+
${this.images?.length>1?u`
|
|
1729
1729
|
<div class="slider-dots absolute bottom-3 left-1/2 flex -translate-x-1/2 gap-2">
|
|
1730
|
-
${this.images.map((
|
|
1730
|
+
${this.images.map((s,o)=>u`
|
|
1731
1731
|
<button
|
|
1732
|
-
@click="${()=>
|
|
1733
|
-
class="${
|
|
1732
|
+
@click="${()=>this.#o(o)}"
|
|
1733
|
+
class="${o===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>
|
|
1734
1734
|
`)}
|
|
1735
1735
|
</div>
|
|
1736
1736
|
`:null}
|
|
1737
1737
|
</div>
|
|
1738
1738
|
</div>
|
|
1739
|
-
<div @click="${
|
|
1740
|
-
${
|
|
1739
|
+
<div @click="${this.#t}" class="cursor-pointer">
|
|
1740
|
+
${i?u`<a @click="${this.#t}" class="${this._isValidUrl?"":"pointer-events-none"} line-clamp-1 text-xs text-gray-600 hover:underline"> ${i} </a>`:null}
|
|
1741
1741
|
|
|
1742
1742
|
<h3
|
|
1743
|
-
@click="${
|
|
1743
|
+
@click="${this.#t}"
|
|
1744
1744
|
class="${this._isValidUrl?"":"pointer-events-none cursor-default"} mb-1 line-clamp-2 cursor-pointer text-lg font-semibold transition-all hover:underline">
|
|
1745
|
-
${
|
|
1745
|
+
${e||u`<span class="inline-block h-6 w-32 animate-pulse rounded bg-gray-200"></span>`}
|
|
1746
1746
|
</h3>
|
|
1747
|
-
${
|
|
1748
|
-
<span class="text-lg font-bold"> ${
|
|
1747
|
+
${r?u`<p class="mb-2 line-clamp-2 text-sm text-gray-600">${r}</p>`:u`<div class="mb-2 h-4 w-3/4 animate-pulse rounded bg-gray-200"></div>`}
|
|
1748
|
+
<span class="text-lg font-bold"> ${n||u`<span class="inline-block h-6 w-16 animate-pulse rounded bg-gray-200"></span>`} </span>
|
|
1749
1749
|
|
|
1750
1750
|
<!-- <div class="my-4 border-t border-gray-200"></div> -->
|
|
1751
1751
|
|
|
1752
1752
|
<!-- <button
|
|
1753
|
-
@click="${
|
|
1753
|
+
@click="${this.#r}"
|
|
1754
1754
|
?disabled="${!this._isValidUrl}"
|
|
1755
1755
|
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">
|
|
1756
1756
|
${this.labels.addToCart}
|
|
1757
1757
|
</button> -->
|
|
1758
1758
|
</div>
|
|
1759
1759
|
</div>
|
|
1760
|
-
`}
|
|
1760
|
+
`}#t(e){e.preventDefault(),!(!this.product?.url||!this._isValidUrl)&&window.open(this.product.url,"_blank")}#r(e){!this.product?.url||!this._isValidUrl||(window.open(this.product.url,"_blank"),this.dispatchEvent(new t.AddToCartEvent(this.product)))}#n(e,r){this.#a&&Ci({from:e,to:r,duration:300,onUpdate:n=>{this.#a&&(this.#a.style.transform=`translateX(${n}%)`)}})}#i(){if(!this.product?.images?.length)return;let e=this._currentImageIndex,r=(e+1)%this.product.images.length,n=-(e*100),i=-(r*100);this.#n(n,i),this._currentImageIndex=r}#s(){if(!this.product?.images?.length)return;let e=this._currentImageIndex,r=(e-1+this.product.images.length)%this.product.images.length,n=-(e*100),i=-(r*100);this.#n(n,i),this._currentImageIndex=r}#o(e){if(!this.product?.images?.length)return;let r=this._currentImageIndex,n=Math.max(0,Math.min(e,this.product.images.length-1)),i=-(r*100),s=-(n*100);this.#n(i,s),this._currentImageIndex=n}get#a(){return this.renderRoot.querySelector(".image-slider")}};Ot.AddToCartEvent=class extends CustomEvent{static type="mw-product-card:add-to-cart";constructor(e,r={}){super(Ot.AddToCartEvent.type,{detail:{product:e},...r})}};customElements.get("mw-product-card")||customElements.define("mw-product-card",Ot);function ut(t){return Array.isArray(t)?t:t?[t]:[]}function na(t,e){let r=new Map;for(let n of t){let i=e(n);r.has(i)||r.set(i,[]),(r.get(i)||[]).push(n)}return r}var Br=(t,e,r)=>{for(let n of e)if(n[0]===t)return(0,n[1])();return r?.()};var $i=class extends C(v){static properties={orderDetails:{type:Object,attribute:"order-details"},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},color:{type:String}};constructor(){super(),this.orderDetails=null,this.streaming=!1,this.linksNewTab=!1,this.color="#601feb"}render(){let e=ut(this.orderDetails?.order_status?.step||[]),r=ut(this.orderDetails?.items?.item||[]),n=ut(this.orderDetails?.actions||[]);return u`
|
|
1761
1761
|
<div class="flex w-full max-w-md flex-col rounded-3xl border bg-white p-4">
|
|
1762
1762
|
<!-- Header with order ID -->
|
|
1763
1763
|
<div class="mb-2">
|
|
1764
|
-
${this.orderDetails?.order_id?.label||!this.streaming?
|
|
1764
|
+
${this.orderDetails?.order_id?.label||!this.streaming?u`<h2 class="text-lg font-semibold">${this.orderDetails?.order_id?.label} ${this.orderDetails?.order_id?.value}</h2>`:u`<div class="h-7 w-full animate-pulse rounded bg-gray-200"></div>`}
|
|
1765
1765
|
</div>
|
|
1766
1766
|
|
|
1767
1767
|
<!-- Progress Timeline -->
|
|
1768
1768
|
<div>
|
|
1769
1769
|
<ol role="list" class="w-full overflow-hidden">
|
|
1770
|
-
${this.streaming&&!this.orderDetails?
|
|
1770
|
+
${this.streaming&&!this.orderDetails?u`
|
|
1771
1771
|
<!-- Loading for status timeline -->
|
|
1772
|
-
${[1,2,3].map((i,s)=>
|
|
1772
|
+
${[1,2,3].map((i,s)=>u`
|
|
1773
1773
|
<li class="w-full pb-8">
|
|
1774
|
-
${s<2?
|
|
1774
|
+
${s<2?u`<div class="absolute top-2 left-2 mt-0.5 -ml-px h-full w-0.5 animate-pulse bg-gray-200" aria-hidden="true"></div>`:""}
|
|
1775
1775
|
<div class="group relative flex items-start">
|
|
1776
1776
|
<span class="flex h-6 items-center">
|
|
1777
1777
|
<span class="h-4 w-4 animate-pulse rounded-full bg-gray-200"></span>
|
|
@@ -1782,32 +1782,32 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1782
1782
|
</div>
|
|
1783
1783
|
</li>
|
|
1784
1784
|
`)}
|
|
1785
|
-
`:
|
|
1786
|
-
${
|
|
1785
|
+
`:X(e,i=>i.label,(i,s)=>{let o=i.status==="completed",c=i.status==="in_progress",l=s===e.length-1;return u`<li class="relative pb-4">
|
|
1786
|
+
${l?"":u`<div class="${`absolute left-2 top-2 -ml-px mt-0.5 h-full w-0.5 ${o?`bg-[${this.color}]`:"bg-gray-300"}`}" aria-hidden="true"></div>`}
|
|
1787
1787
|
|
|
1788
1788
|
<div class="group relative flex items-start">
|
|
1789
|
-
${
|
|
1789
|
+
${Br(i.status,[["pending",()=>u` <span class="flex h-6 items-center">
|
|
1790
1790
|
<span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-gray-300 bg-white">
|
|
1791
1791
|
<span class="h-1.5 w-1.5 rounded-full bg-transparent"></span>
|
|
1792
1792
|
</span>
|
|
1793
|
-
</span>`],["in_progress",()=>
|
|
1793
|
+
</span>`],["in_progress",()=>u`<span class="flex h-6 items-center">
|
|
1794
1794
|
<span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-[${this.color}] bg-white">
|
|
1795
1795
|
<span class="h-1.5 w-1.5 rounded-full bg-[${this.color}]"></span>
|
|
1796
1796
|
</span>
|
|
1797
|
-
</span>`],["completed",()=>
|
|
1797
|
+
</span>`],["completed",()=>u`
|
|
1798
1798
|
<span class="flex h-6 items-center">
|
|
1799
1799
|
<span class="flex h-4 w-4 items-center justify-center rounded-full bg-[${this.color}]">
|
|
1800
1800
|
<hi-outline class="mb-3 block h-3 w-3 text-white" name="check"></hi-outline>
|
|
1801
1801
|
</span>
|
|
1802
1802
|
</span>
|
|
1803
|
-
`]],()=>
|
|
1803
|
+
`]],()=>u`<span class="flex h-6 items-center">
|
|
1804
1804
|
<span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-[${this.color}] bg-white">
|
|
1805
1805
|
<span class="h-1.5 w-1.5 rounded-full bg-[${this.color}]"></span>
|
|
1806
1806
|
</span>
|
|
1807
1807
|
</span>`)}
|
|
1808
1808
|
|
|
1809
1809
|
<span class="ml-3 flex min-w-0 flex-col">
|
|
1810
|
-
<span class="${`text-sm font-medium ${
|
|
1810
|
+
<span class="${`text-sm font-medium ${c?`text-[${this.color}]`:o?"text-gray-900":"text-gray-500"}`}"> ${i.label} </span>
|
|
1811
1811
|
</span>
|
|
1812
1812
|
</div>
|
|
1813
1813
|
</li>`})}
|
|
@@ -1816,7 +1816,7 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1816
1816
|
|
|
1817
1817
|
<!-- Products list with order items -->
|
|
1818
1818
|
<div class="mb-2 w-full">
|
|
1819
|
-
${
|
|
1819
|
+
${r.length===0&&!this.orderDetails?.total?.amount&&this.streaming?u`
|
|
1820
1820
|
<!-- Loading shimmer for products -->
|
|
1821
1821
|
<div class="w-full space-y-4">
|
|
1822
1822
|
<div class="flex items-center gap-2">
|
|
@@ -1831,11 +1831,11 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1831
1831
|
<div class="h-4 w-10 animate-pulse rounded bg-gray-200"></div>
|
|
1832
1832
|
</div>
|
|
1833
1833
|
</div>
|
|
1834
|
-
`:
|
|
1834
|
+
`:u`
|
|
1835
1835
|
<div class="divide-y divide-gray-100">
|
|
1836
|
-
${this.streaming&&!
|
|
1836
|
+
${this.streaming&&!r.length?u`
|
|
1837
1837
|
<!-- Loading shimmer for individual products -->
|
|
1838
|
-
${[1,2].map(()=>
|
|
1838
|
+
${[1,2].map(()=>u`
|
|
1839
1839
|
<div class="flex items-center gap-2 py-1.5">
|
|
1840
1840
|
<div class="h-12 w-12 animate-pulse rounded-lg bg-gray-200"></div>
|
|
1841
1841
|
<div class="min-w-0 flex-1">
|
|
@@ -1844,14 +1844,14 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1844
1844
|
<div class="h-4 w-24 animate-pulse rounded bg-gray-200"></div>
|
|
1845
1845
|
</div>
|
|
1846
1846
|
`)}
|
|
1847
|
-
`:
|
|
1847
|
+
`:r?.map(i=>{let s=i?.image_url;return u`
|
|
1848
1848
|
<div class="flex items-center gap-2 py-1.5">
|
|
1849
|
-
<img src="${
|
|
1849
|
+
<img src="${V(s)}" class="block h-12 w-12 rounded-lg bg-gray-100 object-contain" loading="lazy" />
|
|
1850
1850
|
|
|
1851
1851
|
<div class="min-w-0 flex-1">
|
|
1852
|
-
${!i?.name&&this.streaming?
|
|
1852
|
+
${!i?.name&&this.streaming?u`<div class="h-4 w-32 animate-pulse rounded bg-gray-200"></div>`:u`<h3 class="truncate text-sm font-medium">${i?.name}</h3>`}
|
|
1853
1853
|
</div>
|
|
1854
|
-
${!i?.price&&this.streaming?
|
|
1854
|
+
${!i?.price&&this.streaming?u`<div class="h-4 w-24 animate-pulse rounded bg-gray-200"></div>`:u`<span class="text-sm text-gray-500">${i?.quantity&&Number(i.quantity)>1?"x":""} ${i?.price}</span>`}
|
|
1855
1855
|
</div>
|
|
1856
1856
|
`})}
|
|
1857
1857
|
</div>
|
|
@@ -1867,9 +1867,9 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1867
1867
|
|
|
1868
1868
|
<!-- Shipping and payment information -->
|
|
1869
1869
|
<div class="mb-2 flex w-full flex-col gap-2 overflow-hidden">
|
|
1870
|
-
${this.streaming&&!this.orderDetails?
|
|
1870
|
+
${this.streaming&&!this.orderDetails?u`
|
|
1871
1871
|
<!-- Loading shimmer template -->
|
|
1872
|
-
${[1,2].map(()=>
|
|
1872
|
+
${[1,2].map(()=>u`
|
|
1873
1873
|
<div>
|
|
1874
1874
|
<div class="mb-2 h-5 w-32 animate-pulse rounded bg-gray-200"></div>
|
|
1875
1875
|
<div class="space-y-2 overflow-hidden">
|
|
@@ -1878,10 +1878,10 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1878
1878
|
</div>
|
|
1879
1879
|
</div>
|
|
1880
1880
|
`)}
|
|
1881
|
-
`:
|
|
1881
|
+
`:u`
|
|
1882
1882
|
<!-- Shipping Section -->
|
|
1883
1883
|
<div>
|
|
1884
|
-
${this.streaming&&!this.orderDetails?.shipping?
|
|
1884
|
+
${this.streaming&&!this.orderDetails?.shipping?u`
|
|
1885
1885
|
<div>
|
|
1886
1886
|
<div class="mb-2 h-5 w-32 animate-pulse rounded bg-gray-200"></div>
|
|
1887
1887
|
<div class="space-y-2 overflow-hidden">
|
|
@@ -1889,18 +1889,18 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1889
1889
|
<div class="h-4 w-36 animate-pulse rounded bg-gray-200"></div>
|
|
1890
1890
|
</div>
|
|
1891
1891
|
</div>
|
|
1892
|
-
`:this.orderDetails?.shipping?.method||this.orderDetails?.customer?.name?
|
|
1892
|
+
`:this.orderDetails?.shipping?.method||this.orderDetails?.customer?.name?u`
|
|
1893
1893
|
<h3 class="mb-1 text-sm font-medium">${this.orderDetails?.shipping?.label}</h3>
|
|
1894
1894
|
<div class="space-y-1">
|
|
1895
|
-
${this.orderDetails.customer?.name?
|
|
1896
|
-
${this.orderDetails.shipping?.method?
|
|
1895
|
+
${this.orderDetails.customer?.name?u`<p class="text-xs text-gray-600">${this.orderDetails.customer.name}</p>`:""}
|
|
1896
|
+
${this.orderDetails.shipping?.method?u`<p class="text-xs text-gray-600">${this.orderDetails.shipping.method}</p>`:""}
|
|
1897
1897
|
</div>
|
|
1898
1898
|
`:""}
|
|
1899
1899
|
</div>
|
|
1900
1900
|
|
|
1901
1901
|
<!-- Payment Section -->
|
|
1902
1902
|
<div>
|
|
1903
|
-
${this.streaming&&!this.orderDetails?.payment?
|
|
1903
|
+
${this.streaming&&!this.orderDetails?.payment?u`
|
|
1904
1904
|
<div>
|
|
1905
1905
|
<div class="mb-2 h-5 w-32 animate-pulse rounded bg-gray-200"></div>
|
|
1906
1906
|
<div class="space-y-2 overflow-hidden">
|
|
@@ -1908,15 +1908,15 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1908
1908
|
<div class="h-4 w-36 animate-pulse rounded bg-gray-200"></div>
|
|
1909
1909
|
</div>
|
|
1910
1910
|
</div>
|
|
1911
|
-
`:this.orderDetails?.payment?
|
|
1911
|
+
`:this.orderDetails?.payment?u`
|
|
1912
1912
|
<h3 class="mb-1 text-sm font-medium">${this.orderDetails.payment.label}</h3>
|
|
1913
|
-
${this.orderDetails.payment?.method?.value?
|
|
1913
|
+
${this.orderDetails.payment?.method?.value?u`
|
|
1914
1914
|
<p class="text-xs text-gray-600">
|
|
1915
1915
|
<span class="font-medium">${this.orderDetails.payment.method.label}:</span>
|
|
1916
1916
|
${this.orderDetails.payment.method.value}
|
|
1917
1917
|
</p>
|
|
1918
1918
|
`:""}
|
|
1919
|
-
${this.orderDetails.payment.status?.value?
|
|
1919
|
+
${this.orderDetails.payment.status?.value?u`
|
|
1920
1920
|
<p class="text-xs text-gray-600">
|
|
1921
1921
|
<span class="font-medium">${this.orderDetails.payment.status.label}:</span>
|
|
1922
1922
|
<span>${this.orderDetails.payment.status.value}</span>
|
|
@@ -1929,11 +1929,11 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1929
1929
|
|
|
1930
1930
|
<!-- Action buttons section -->
|
|
1931
1931
|
<div class="flex w-full flex-col gap-2 overflow-hidden">
|
|
1932
|
-
${this.streaming&&!n[0]?.track_order?.label&&!
|
|
1932
|
+
${this.streaming&&!n[0]?.track_order?.label&&!xn(n[0]?.track_order?.tracking_url||"")?u`
|
|
1933
1933
|
<!-- Loading shimmer for buttons -->
|
|
1934
1934
|
<div class="h-10 w-full min-w-[250px] animate-pulse overflow-hidden rounded-xl bg-gray-200"></div>
|
|
1935
|
-
`:
|
|
1936
|
-
${
|
|
1935
|
+
`:X(n,(i,s)=>`action-${s}`,i=>{if(i?.track_order?.label)return u`
|
|
1936
|
+
${xn(i.track_order?.tracking_url||"")?u` <a
|
|
1937
1937
|
target="${this.linksNewTab?"_blank":"_self"}"
|
|
1938
1938
|
href="${i.track_order?.tracking_url}"
|
|
1939
1939
|
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"
|
|
@@ -1942,14 +1942,7 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1942
1942
|
`})}
|
|
1943
1943
|
</div>
|
|
1944
1944
|
</div>
|
|
1945
|
-
`}};
|
|
1946
|
-
<svg width="10" height="10" viewBox="0 0 10 10" aria-hidden="true">
|
|
1947
|
-
<g fill-rule="evenodd">
|
|
1948
|
-
<path part="line" stroke="currentColor" fill="currentColor" d="M0 5h7"></path>
|
|
1949
|
-
<path part="tip" stroke="currentColor" fill="transparent" d="M1 1l4 4-4 4"></path>
|
|
1950
|
-
</g>
|
|
1951
|
-
</svg>
|
|
1952
|
-
`}};w(Ks,"styles",J`
|
|
1945
|
+
`}};customElements.get("mw-product-order-status-card")||customElements.define("mw-product-order-status-card",$i);var ou={".section-spacing":{"@apply":"relative flex justify-center px-[25px] py-16 sm:px-9 sm:py-[45px] lg:px-24 lg:py-[104px]"}},Si=Ct({preflight:{...ou},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:[fr(),hr(),dr(),mr()],ignorelist:/^(sb-|css-|sbdocs|docblock|innerZoomElementWrapper|docs-|rejt-)/});var Ei=t=>gr(Si)(t);var _i=class extends Ei(v){static styles=D`
|
|
1953
1946
|
:host {
|
|
1954
1947
|
--w-hover-arrow--hovered: 0;
|
|
1955
1948
|
}
|
|
@@ -1963,43 +1956,50 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
1963
1956
|
transform: translateX(calc(var(--w-hover-arrow--hovered) * 3px));
|
|
1964
1957
|
transition: transform 0.3s ease-in-out;
|
|
1965
1958
|
}
|
|
1966
|
-
|
|
1959
|
+
`;render(){return u`
|
|
1960
|
+
<svg width="10" height="10" viewBox="0 0 10 10" aria-hidden="true">
|
|
1961
|
+
<g fill-rule="evenodd">
|
|
1962
|
+
<path part="line" stroke="currentColor" fill="currentColor" d="M0 5h7"></path>
|
|
1963
|
+
<path part="tip" stroke="currentColor" fill="transparent" d="M1 1l4 4-4 4"></path>
|
|
1964
|
+
</g>
|
|
1965
|
+
</svg>
|
|
1966
|
+
`}};customElements.get("w-hover-arrow")||customElements.define("w-hover-arrow",_i);var Ut=class t extends C(v){static properties={title:{type:String},type:{type:String},color:{type:String},_hoverRating:{type:Number,state:!0}};constructor(){super(),this.title="",this.type="star-rating",this.color="#8B5CF6",this._hoverRating=0}render(){return u`
|
|
1967
1967
|
<div
|
|
1968
1968
|
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}]">
|
|
1969
1969
|
<div class="flex flex-col gap-2 p-4">
|
|
1970
|
-
${
|
|
1970
|
+
${Br(this.type,[["star-rating",()=>this.#t()],["binary-vote",()=>this.#r()],["new-conversation-button",()=>this.#e()]],()=>u`<span class="text-sm text-gray-500">Unsupported input type</span>`)}
|
|
1971
1971
|
</div>
|
|
1972
1972
|
</div>
|
|
1973
|
-
`}
|
|
1973
|
+
`}#e(){return u`
|
|
1974
1974
|
<button
|
|
1975
1975
|
type="button"
|
|
1976
|
-
@click="${()=>this.dispatchEvent(new
|
|
1976
|
+
@click="${()=>this.dispatchEvent(new t.SubmitEvent({type:"new-conversation-button"}))}">
|
|
1977
1977
|
<span class="group relative flex items-center justify-center gap-3 font-sans text-sm font-semibold whitespace-nowrap text-[${this.color}]">
|
|
1978
1978
|
${this.title||"Start a new conversation"}
|
|
1979
1979
|
<w-hover-arrow class="text-[#8D00FF] group-hover:text-[${this.color}] group-hover:[--w-hover-arrow--hovered:1]"></w-hover-arrow>
|
|
1980
1980
|
</span>
|
|
1981
1981
|
</button>
|
|
1982
|
-
`}
|
|
1983
|
-
${this.title?
|
|
1982
|
+
`}#t(){return u`
|
|
1983
|
+
${this.title?u`<p class="text-sm font-medium text-gray-700">${this.title}</p>`:null}
|
|
1984
1984
|
<div class="flex justify-center gap-1">
|
|
1985
|
-
${[1,2,3,4,5].map(
|
|
1985
|
+
${[1,2,3,4,5].map(e=>u`
|
|
1986
1986
|
<button
|
|
1987
1987
|
type="button"
|
|
1988
|
-
@click="${()=>
|
|
1989
|
-
@mouseenter="${()=>
|
|
1990
|
-
@mouseleave="${
|
|
1988
|
+
@click="${()=>this.#i(e)}"
|
|
1989
|
+
@mouseenter="${()=>this.#s(e)}"
|
|
1990
|
+
@mouseleave="${this.#o}"
|
|
1991
1991
|
class="p-1 transition-transform hover:scale-110"
|
|
1992
|
-
aria-label="${
|
|
1993
|
-
${
|
|
1992
|
+
aria-label="${e} star${e>1?"s":""}">
|
|
1993
|
+
${this.#n(e)}
|
|
1994
1994
|
</button>
|
|
1995
1995
|
`)}
|
|
1996
1996
|
</div>
|
|
1997
|
-
`}
|
|
1998
|
-
${this.title?
|
|
1997
|
+
`}#r(){return u`
|
|
1998
|
+
${this.title?u`<p class="text-sm font-medium text-gray-700">${this.title}</p>`:null}
|
|
1999
1999
|
<div class="flex justify-center gap-4">
|
|
2000
2000
|
<button
|
|
2001
2001
|
type="button"
|
|
2002
|
-
@click="${()=>
|
|
2002
|
+
@click="${()=>this.#a("negative")}"
|
|
2003
2003
|
class="flex flex-col items-center gap-1 rounded-lg border-2 border-gray-300 p-1 transition-all hover:border-red-400">
|
|
2004
2004
|
<svg class="h-6 w-6 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
2005
2005
|
<path
|
|
@@ -2011,7 +2011,7 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
2011
2011
|
</button>
|
|
2012
2012
|
<button
|
|
2013
2013
|
type="button"
|
|
2014
|
-
@click="${()=>
|
|
2014
|
+
@click="${()=>this.#a("positive")}"
|
|
2015
2015
|
class="flex flex-col items-center gap-1 rounded-lg border-2 border-gray-300 p-1 transition-all hover:border-green-400">
|
|
2016
2016
|
<svg class="h-6 w-6 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
2017
2017
|
<path
|
|
@@ -2022,69 +2022,69 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
2022
2022
|
</svg>
|
|
2023
2023
|
</button>
|
|
2024
2024
|
</div>
|
|
2025
|
-
`}
|
|
2026
|
-
<svg class="${
|
|
2025
|
+
`}#n(e){let r=e<=this._hoverRating;return u`
|
|
2026
|
+
<svg class="${r?"text-yellow-400":"text-gray-300"} h-6 w-6" fill="${r?"currentColor":"none"}" stroke="currentColor" viewBox="0 0 24 24">
|
|
2027
2027
|
<path
|
|
2028
2028
|
stroke-linecap="round"
|
|
2029
2029
|
stroke-linejoin="round"
|
|
2030
2030
|
stroke-width="2"
|
|
2031
2031
|
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" />
|
|
2032
2032
|
</svg>
|
|
2033
|
-
`}
|
|
2034
|
-
${
|
|
2033
|
+
`}#i(e){this._hoverRating=0,this.dispatchEvent(new t.SubmitEvent({type:"star-rating",rating:e}))}#s(e){this._hoverRating=e}#o(){this._hoverRating=0}#a(e){this.dispatchEvent(new t.SubmitEvent({type:"binary-vote",vote:e}))}};Ut.SubmitEvent=class extends CustomEvent{static type="mw-request-input:submit";constructor(e,r={}){super(Ut.SubmitEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}};customElements.get("mw-request-input")||customElements.define("mw-request-input",Ut);var Pt=class extends et{constructor(e){if(super(e),this.it=L,e.type!==yr.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===L||e==null)return this._t=void 0,this.it=e;if(e===ee)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 r=[e];return r.raw=r,this._t={_$litType$:this.constructor.resultType,strings:r,values:[]}}};Pt.directiveName="unsafeHTML",Pt.resultType=1;var ia=vr(Pt);var sa=Cs(ue({name:O(),description:O(),price:O(),image_url:Je([O(),Ge(O())]),category:O(),url:O()}));function oa(t,e,r,{imagesByProductUrl:n,linksNewTab:i=!0,searchParams:s,messageIsStreaming:o=!1,isSupportAgent:c,color:l="#601feb",apiBaseUrl:a="",cdnBaseUrl:h=""}){if(!t)return u``;let d=e>0&&r[e-1]&&"data"in r[e-1],f=e<r.length-1||!o;if("text"in t)return u`<p>${t.text}</p>`;if("html"in t)return u`${ia(t.html)}`;if("data"in t)switch(t.tag){case"product-card":case"product-card-v1":case"product-card-horizontal":{let p=xt(sa,t.data);if(p.success){let y={...p.output,images:[]};return y.images=ut(y.image_url),u`
|
|
2034
|
+
${d?u`<div class="my-3 w-full border-t border-gray-200/50"></div>`:null}
|
|
2035
2035
|
<mw-product-card-horizontal
|
|
2036
|
-
product="${JSON.stringify(
|
|
2037
|
-
?streaming="${!
|
|
2036
|
+
product="${JSON.stringify(y)}"
|
|
2037
|
+
?streaming="${!f}"
|
|
2038
2038
|
?links-new-tab="${i}"
|
|
2039
2039
|
.searchParams="${s}"
|
|
2040
2040
|
.imagesByProductUrl="${n}"></mw-product-card-horizontal>
|
|
2041
|
-
`}console.warn(
|
|
2042
|
-
order-details="${JSON.stringify(
|
|
2043
|
-
?streaming="${!
|
|
2041
|
+
`}console.warn(p.issues);break}case"order-status-card-v1":return u`<mw-product-order-status-card
|
|
2042
|
+
order-details="${JSON.stringify(t.data)}"
|
|
2043
|
+
?streaming="${!f}"
|
|
2044
2044
|
?links-new-tab="${i}"
|
|
2045
|
-
color="${
|
|
2046
|
-
heading="${
|
|
2047
|
-
message="${
|
|
2048
|
-
completeMessage="${
|
|
2049
|
-
gameButton="${
|
|
2050
|
-
target-end-time="${
|
|
2051
|
-
question="${
|
|
2052
|
-
.options="${
|
|
2053
|
-
game-title="${
|
|
2054
|
-
result-prefix="${
|
|
2055
|
-
correct-button-text="${
|
|
2056
|
-
wrong-button-text="${
|
|
2057
|
-
color="${
|
|
2058
|
-
apiBaseUrl="${
|
|
2059
|
-
cdnBaseUrl="${
|
|
2060
|
-
sound="${
|
|
2045
|
+
color="${l}"></mw-product-order-status-card> `;case"live-chat-wait-card-v1":{let p=t.data||{};if(c)return u`<p><i>${p.message}</i></p>`;let y=h?`${h}/assets/game-intro.aac`:"";return u`<mw-chat-wait-timer
|
|
2046
|
+
heading="${p.title||""}"
|
|
2047
|
+
message="${p.message||""}"
|
|
2048
|
+
completeMessage="${p.completeMessage||""}"
|
|
2049
|
+
gameButton="${p.gameButton||""}"
|
|
2050
|
+
target-end-time="${p.targetEndTime||""}"
|
|
2051
|
+
question="${p.firstQuestion||""}"
|
|
2052
|
+
.options="${p.options?.option||["No","Yes"]}"
|
|
2053
|
+
game-title="${p.gameTitle||""}"
|
|
2054
|
+
result-prefix="${p.resultPrefix||""}"
|
|
2055
|
+
correct-button-text="${p.correctButtonText||"Correct"}"
|
|
2056
|
+
wrong-button-text="${p.wrongButtonText||"Wrong"}"
|
|
2057
|
+
color="${l}"
|
|
2058
|
+
apiBaseUrl="${a}"
|
|
2059
|
+
cdnBaseUrl="${h}"
|
|
2060
|
+
sound="${y}"></mw-chat-wait-timer>`}case"request-input-v1":return u``}return console.warn("could not render part:",t),u`<p><i>data type not supported</i></p>`}var qr=class{#e;#t;#r;#n=!1;timeoutMs;get isTyping(){return this.#n}constructor(e,r,{timeoutMs:n=2e3}={}){this.#e=e,this.#t=r,this.timeoutMs=n,e.addController(this)}hostDisconnected(){clearTimeout(this.#r),this.#r=void 0}onInput(e){if(this.#e.isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(this.#r),this.#r=setTimeout(()=>this.typingStopped(),this.timeoutMs),this.#n||this.#i()}}#i(){this.#n=!0,this.#t.typingStarted()}typingStopped(){clearTimeout(this.#r),this.#n=!1,this.#t.typingStopped()}};function aa(t,e="en-US"){let r=new Intl.DateTimeFormat(e,{hour:"numeric",minute:"numeric"}).format(t);return`${t.toLocaleDateString(e,{year:"numeric",month:"short",day:"numeric"})}, ${r}`}function la(t){t?.body?.cancel().catch(console.warn)}var Mi=class{#e;constructor(e=window.localStorage){this.#e=e}#t(e){if(!(typeof e!="string"||e===""))try{return JSON.parse(e)}catch{return}}#r(e){if(e!==void 0)try{return JSON.stringify(e)}catch{return}}setex(e,r,n){return this.#e.setItem(e,this.#r({value:this.#r(r),expiresAt:Date.now()+n*1e3})||"")}set(e,r){return this.#e.setItem(e,this.#r({value:this.#r(r)})||"")}get(e){let r=this.#e.getItem(e);if(!r)return;let n=this.#t(r);if(n){if(n.expiresAt&&n.expiresAt<Date.now()){this.#e.removeItem(e);return}return this.#t(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 Z.get("molin-shop-ai-widget-open")??null}set molin_widget_open_state(e){Z.set("molin-shop-ai-widget-open",e)}resetWidgetData(){Z.molin_shop_assistant_distinct_id=null,Z.molin_widget_open_state=null}},Z=new Mi;var Ii=class{#e=[];#t;#r=10;#n=5e3;#i=!1;async add(e,r){if(this.#e.push(ha(e,r)),this.#e.length>=this.#r)return this.flush();this.#t||(this.#t=setTimeout(()=>{this.flush().catch(console.error)},this.#n))}async flush(){if(this.#i||this.#e.length===0)return;let e=[...this.#e];try{this.#i=!0,clearTimeout(this.#t),this.#t=void 0,this.#e=[];let r=new AbortController,n=setTimeout(()=>r.abort(),5e3);await ua(e,{signal:r.signal}),clearTimeout(n)}catch(r){if(r.name==="AbortError")console.error("Request timed out, retrying events"),this.#e=[...e,...this.#e];else{console.error("Failed to send events to backend:",r);let n=e.filter(i=>i.event.includes("error"));this.#e=[...n,...this.#e]}}finally{this.#i=!1,this.#e.length>0&&!this.#t&&(this.#t=setTimeout(()=>{this.flush().catch(console.error)},this.#n))}}async flushBeforeUnload(){if(this.#e.length>0)try{let e=new FormData;e.set("events",JSON.stringify(this.#e)),navigator.sendBeacon(new URL("/widgets/data/collect",Fr()).href,e)}catch(e){console.error("Failed to send final events:",e)}}},ca=new Ii;window.addEventListener("beforeunload",()=>{ca.flushBeforeUnload().catch(console.error)});async function A(t,e,r){if(typeof t!="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(t==="ShopAssistant: user clicked link"&&cu("molin_link_click",e),r?.immediate){await ua([ha(t,e)]);return}else return ca.add(t,e)}catch(n){console.error("Failed to send event:",n)}}async function ua(t,{signal:e}={}){let r=new FormData;r.set("events",JSON.stringify(t));let n=await fetch(new URL("/widgets/data/collect",Fr()),{method:"POST",body:r,signal:e});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);la(n)}function ha(t,e){return{event:t,widget_id:e.widgetId,properties:Object.assign({},e,lu()),distinct_id:au(),timestamp:new Date().toISOString()}}function au(){try{let t=Z.molin_shop_assistant_distinct_id;return t||(t=crypto.randomUUID(),Z.molin_shop_assistant_distinct_id=t),t}catch(t){console.error("Failed to deserialize distinct_id:",t);let e=crypto.randomUUID();try{Z.molin_shop_assistant_distinct_id=e}catch(r){console.error("Failed to store new distinct_id:",r)}return e}}function lu(){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 Fr(){let t=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"}[t]||"https://molin.ai"}function cu(t,e){try{window.dataLayer=window.dataLayer||[];let r={event:t,link_url:e.url};window.dataLayer.push(r)}catch(r){console.error("Failed to send event to dataLayer:",r)}}var Vr=class{#e;#t;#r;#n;isLoading=!1;data=void 0;constructor(e,r,n){this.#e=e,this.#t=r,this.#r=n,e.addController(this)}fetch(){if(this.isLoading)return;this.#n?.abort();let e=new AbortController;this.#n=e,this.isLoading=!0,this.data=void 0,this.#e.requestUpdate(),(async()=>{let r=this.#i();return r.signal?.addEventListener("abort",()=>e.abort(),{signal:e.signal}),fetch(r,{signal:e.signal})})().then(async r=>{if(!r.ok)throw new Error(`${r.statusText}: ${await r.text()}`);this.isLoading=!1,this.data=typeof this.#r?.transform=="function"?await this.#r.transform(r):r,this.#e.requestUpdate()}).catch(r=>{this.#r?.onError?.(r),this.isLoading=!1,this.data=void 0,this.#e.requestUpdate()}).finally(()=>{e.abort()})}#i(){let e=this.#t;if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)}hostConnected(){this.isLoading||this.#r?.fetchWhenConnected&&this.fetch()}hostDisconnected(){this.#n?.abort(),this.#n=void 0}};function be(){return window.molinSettings&&typeof window.molinSettings=="object"?window.molinSettings:null}var Ue=class t extends C(v){static styles=D`
|
|
2061
|
+
:host {
|
|
2062
|
+
all: initial; /* reset all properties that can pierce the shadow DOM */
|
|
2063
|
+
}
|
|
2064
|
+
`;static 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}};constructor(){super(),this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1,this.xUserData=be()?.userData,this.xCustomInstructions=be()?.customInstructions}#e=pa(this);get config(){return this.#t||this.#e.data}#t;#r={onError:e=>{alert(e.error),console.error(e.widgetId,e.error),A("ShopAssistant: error",{...e},{immediate:!0})},onNewMessageStartedStreaming:e=>{A("ShopAssistant: user received bot message (streaming started)",e)},onMessageEndedStreaming:e=>{A("ShopAssistant: user received bot message (streaming ended)",e)},onUserCanceledStreaming:e=>{A("ShopAssistant: user canceled streaming",e)},onUserClickedLink:e=>{A("ShopAssistant: user clicked link",e)},onUserSentInput:e=>{A("ShopAssistant: user sent input",e)}};render(){return this.config?u`
|
|
2061
2065
|
<mw-context-widget
|
|
2062
2066
|
.widgetId="${this.widgetId}"
|
|
2063
2067
|
.config="${this.config}"
|
|
2064
|
-
.callbacks="${
|
|
2068
|
+
.callbacks="${this.#r}"
|
|
2065
2069
|
.xUserData="${this.xUserData}"
|
|
2066
2070
|
.xCustomInstructions="${this.xCustomInstructions}"
|
|
2067
2071
|
autoConnect>
|
|
2068
2072
|
<!-- embed our chat component forwarding props -->
|
|
2069
|
-
<mw-chat ?show-close="${this.showClose}" @mw:close-click="${
|
|
2073
|
+
<mw-chat ?show-close="${this.showClose}" @mw:close-click="${this.#n}">
|
|
2070
2074
|
<slot name="banner" slot="banner"></slot>
|
|
2071
2075
|
</mw-chat>
|
|
2072
2076
|
</mw-context-widget>
|
|
2073
|
-
`:null}
|
|
2074
|
-
:host {
|
|
2075
|
-
all: initial; /* reset all properties that can pierce the shadow DOM */
|
|
2076
|
-
}
|
|
2077
|
-
`),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 Ft=ii;customElements.get("molin-shop-ai-chat")||customElements.define("molin-shop-ai-chat",Ft);var _l;Ft.CloseClickEvent=(_l=class extends CustomEvent{constructor(e={}){super(Ft.CloseClickEvent.type,{...e})}},w(_l,"type","mw:close-click"),_l);var Il=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 Ft&&e.reset()}};function kd({hidden:r}){let e=new Il({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){R0(e);let t=dt(),n=typeof t?.hidden=="boolean"?t.hidden:window.self!==window.top;if(kd({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 R0(r){window.__INIT_MOLIN_SHOP_AI_OPTIONS=r}function Cd(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var Me,oi,Nr,Hr,Nt=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=Cd();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;var xd=(r,e)=>new Nt(r,{onError:e?.onError||console.error,...e});function $d(){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"}function Sd(){let r=new URL(import.meta.url).hostname;return{localhost:"http://localhost:8702","molin.localhost":"http://localhost:8702","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 B0="\xB7 \xB7 \xB7",q0=["star-rating","binary-vote","new-conversation-button"],A,De,li,ce,zr,ci,oo,ui,hi,di,D,Ed,_d,ao,Id,Md,Ad,Al,Td,Ld,jd,Ht,Dd,V0,pt,lo=class lo extends I($){constructor(){super();p(this,D);p(this,A,Zc(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",$d()).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=td(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`
|
|
2077
|
+
`:null}#n(){this.dispatchEvent(new t.CloseClickEvent)}injectConfig(e){this.#t=e,this.requestUpdate()}reloadConfig(){this.#i?.reloadConfig()}reset(){this.xUserData={},this.xCustomInstructions="",this.#i?.reset(),this.requestUpdate()}get#i(){return this.renderRoot.querySelector("mw-chat")}get conversationId(){return this.#i?.conversationId??""}get messages(){return this.#i?.messages??[]}};customElements.get("molin-shop-ai-chat")||customElements.define("molin-shop-ai-chat",Ue);Ue.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(Ue.CloseClickEvent.type,{...e})}};var Ai=class{hidden;constructor({hidden:e=!1}){this.hidden=e}setUserData(e){for(let r of document.querySelectorAll("molin-shop-ai"))e?r.setAttribute("user-data",JSON.stringify(e)):r.removeAttribute("user-data");for(let r of document.querySelectorAll("molin-shop-ai-chat"))e?r.setAttribute("user-data",JSON.stringify(e)):r.removeAttribute("user-data")}setCustomInstructions(e){for(let r of document.querySelectorAll("molin-shop-ai"))e?r.setAttribute("custom-instructions",e):r.removeAttribute("custom-instructions");for(let r of document.querySelectorAll("molin-shop-ai-chat"))e?r.setAttribute("custom-instructions",e):r.removeAttribute("custom-instructions")}showLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof fe&&e.showLauncher()}hideLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof fe&&e.hideLauncher()}openChat(e){let{message:r,autoSend:n}=e||{};for(let i of document.querySelectorAll("molin-shop-ai"))i instanceof fe&&i.openChat({message:r,autoSend:n})}closeChat(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof fe&&e.closeChat()}reset(){Z.resetWidgetData();for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof fe&&e.reset();for(let e of document.querySelectorAll("molin-shop-ai-chat"))e instanceof Ue&&e.reset()}};function fa({hidden:t}){let e=new Ai({hidden:t});return window.Molin=e,e}function Nr(){let t=window.Molin;if(!t)throw new Error("window.Molin global not initialized");return t}window.__INIT_MOLIN_SHOP_AI=function(e){uu(e);let r=be(),n=typeof r?.hidden=="boolean"?r.hidden:window.self!==window.top;if(fa({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 uu(t){window.__INIT_MOLIN_SHOP_AI_OPTIONS=t}function ma(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var Pe=class{#e;#t;#r;#n;get data(){return this.#n||this.#r?.data}constructor(e,r){this.#e=e,this.#t=r,e.addController(this)}hostConnected(){if(this.#r||this.#n)return;let e=ma();e&&e.widgetId===this.#e.widgetId?this.#n=e.config:this.#r=new Vr(this.#e,()=>{if(this.#e.cdn&&this.#e.widgetId)return`${this.#e.cdn}/config?w=${this.#e.widgetId}`;throw new Error("missing cdn or widgetId")},{fetchWhenConnected:!0,transform:async r=>{let n=await r.json();return n&&!e&&window.__INIT_MOLIN_SHOP_AI({cdn:this.#e.cdn,widgetId:this.#e.widgetId,config:n}),n},onError:this.#t?.onError})}},pa=(t,e)=>new Pe(t,{onError:e?.onError||console.error,...e});function ga(){let t=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"}[t]||"https://widget.molin.ai"}function wa(){let t=new URL(import.meta.url).hostname;return{localhost:"http://localhost:8702","molin.localhost":"http://localhost:8702","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"}[t]||"https://widget.molin.ai"}var hu="\xB7 \xB7 \xB7",du=["star-rating","binary-vote","new-conversation-button"],Rt=class t extends C(v){#e=Is(this);static properties={showClose:{type:Boolean,attribute:"show-close"},_currentRequestInputIndex:{type:Number,state:!0}};#t=[];constructor(){super(),this.showClose=!1,this._currentRequestInputIndex=0}#r=new qr(this,{typingStarted:()=>this.#e.value?.sendUserTypingStart(),typingStopped:()=>this.#e.value?.sendUserTypingStop()});#n=new Cr(this,{onImageDelete:e=>{if(!this.#e.value){console.warn("widget context not available, cannot delete image");return}this.#e.value.sendImageDelete(e),this.#p?.focus()},uploadUrl:new URL("/v1/uploads",ga()).href,onConnect:()=>{this.#e.value?.connect()}});get conversationId(){return this.#e.value?.conversationId||""}get messages(){return this.#e.value?.messages||[]}get config(){return this.#e.value?.config}get callbacks(){return this.#e.value?.callbacks||{}}get widgetId(){return this.#e.value?.widgetId||""}get typingIndicator(){return this.#e.value?.typingIndicator}get isStreaming(){return this.#e.value?.isStreaming}get ranOutOfCredits(){return this.#e.value?.ranOutOfCredits}get isLiveMode(){return this.#e.value?.isLiveMode}get lastMsg(){return this.#e.value?.lastMsg}get hasQueuedMessages(){return this.#e.value?.hasQueuedMessages}#i="single";#s=null;firstUpdated(){document.addEventListener("mw-context-widget:connected",this.#o,{once:!0}),this.addEventListener("mw-chat-wait-game:question-answered",this.#a),this.addEventListener("mw-chat-wait-game:game-completed",this.#h),this.addEventListener("mw-chat-wait-game:guess-validated",this.#c)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("mw-chat-wait-game:question-answered",this.#a),this.removeEventListener("mw-chat-wait-game:game-completed",this.#h),this.removeEventListener("mw-chat-wait-game:guess-validated",this.#c)}#o=e=>{let r=e,{pendingImages:n}=r.detail;Array.isArray(n)&&this.#n.restoreImages(n)};#a=e=>{let r=e,{questionIndex:n,question:i,answer:s,totalQuestions:o}=r.detail;this.callbacks.onWaitGameQuestionAnswered?.({widgetId:this.widgetId,conversationId:this.conversationId,questionIndex:n,question:i,answer:s,totalQuestions:o})};#h=e=>{let r=e,{guessedProfession:n,questionCount:i}=r.detail;this.callbacks.onWaitGameCompleted?.({widgetId:this.widgetId,conversationId:this.conversationId,guessedProfession:n,questionCount:i})};#c=e=>{let r=e,{guessedProfession:n,isCorrect:i,questionCount:s}=r.detail;this.callbacks.onWaitGameGuessValidated?.({widgetId:this.widgetId,conversationId:this.conversationId,guessedProfession:n,isCorrect:i,questionCount:s})};updated(){let e=this.lastMsg?.id;e&&e!==this.#s&&(this.#s=e,this._currentRequestInputIndex=0),this.#e.value?.widgetId&&this.config?.enableImageUpload&&this.#n.updateUploadOptions({conversationId:this.conversationId,widgetId:this.#e.value?.widgetId,enabled:this.config?.enableImageUpload,isConnected:()=>this.#e.value?.isConnected()??!1,onConnect:()=>{this.#e.value?.connect()}})}render(){J(this.config,"config is required");let e=na(this.messages,i=>{try{let s=new Date(i.timestamp),o=Math.floor(s.getUTCMinutes()/5)*5;return s.setUTCMinutes(o,0,0),s.valueOf().toString()}catch(s){console.error(s)}}),r=Math.max(0,Math.min(this._currentRequestInputIndex,this.#d.length-1)),n=this.#d[r];return u`
|
|
2078
2078
|
<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]">
|
|
2079
2079
|
<div
|
|
2080
2080
|
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]">
|
|
2081
2081
|
<mw-chat-header
|
|
2082
2082
|
class="absolute top-1.5 right-1.5 left-1.5"
|
|
2083
2083
|
.content="${{logoUrl:this.config.logoUrl,title:this.config.title,color:this.config.color}}"
|
|
2084
|
-
?show-new-chat="${!this.isLiveMode&&this.messages.length>0&&!
|
|
2084
|
+
?show-new-chat="${!this.isLiveMode&&this.messages.length>0&&!this.#k}"
|
|
2085
2085
|
?show-close="${this.showClose}"
|
|
2086
|
-
@mw:new-chat-click="${m
|
|
2087
|
-
@mw:close-click="${
|
|
2086
|
+
@mw:new-chat-click="${this.#m}"
|
|
2087
|
+
@mw:close-click="${this.#x}">
|
|
2088
2088
|
</mw-chat-header>
|
|
2089
2089
|
|
|
2090
2090
|
<!-- used by the dashboard to inject content -->
|
|
@@ -2093,7 +2093,7 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
2093
2093
|
</div>
|
|
2094
2094
|
|
|
2095
2095
|
<!-- drag overlay -->
|
|
2096
|
-
${this.config.enableImageUpload&&
|
|
2096
|
+
${this.config.enableImageUpload&&this.#n.isDragging&&this.#e.value?.isConnected()?u`
|
|
2097
2097
|
<div class="bg-opacity-90 absolute inset-0 z-50 flex items-center justify-center bg-white sm:rounded-[30px]">
|
|
2098
2098
|
<div class="p-8 text-center">
|
|
2099
2099
|
<lucide-icon name="image-plus" class="mx-auto mb-4 h-12 w-12 text-blue-500"></lucide-icon>
|
|
@@ -2105,8 +2105,8 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
2105
2105
|
|
|
2106
2106
|
<!-- this structure of 2 divs is required for the browser native stick/scroll to bottom -->
|
|
2107
2107
|
<div id="scrollable-content" class="mt-6 flex h-full flex-shrink flex-grow flex-col-reverse overflow-auto">
|
|
2108
|
-
${this.config.enableImageUpload&&
|
|
2109
|
-
${this.config?.showStillLearningBanner?
|
|
2108
|
+
${this.config.enableImageUpload&&this.#n.error?u`<mw-info-banner variant="error" text="${this.#n.error}" auto-dismissable></mw-info-banner> `:null}
|
|
2109
|
+
${this.config?.showStillLearningBanner?u`<mw-info-banner variant="info" text="I'm still learning!"></mw-info-banner>`:u`
|
|
2110
2110
|
<!-- this makes the chat stick to bottom when the banner is hidden -->
|
|
2111
2111
|
<div class="flex p-1"></div>
|
|
2112
2112
|
`}
|
|
@@ -2114,30 +2114,30 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
2114
2114
|
<!-- the padding at the top makes empty room at the top when scrolling and content is hidden behind header -->
|
|
2115
2115
|
<!-- this is the 2nd (inner) div that will natively stick/scroll to bottom -->
|
|
2116
2116
|
<div class="${this.messages.length>0?"pt-20":""}">
|
|
2117
|
-
${
|
|
2118
|
-
<div class="my-2 text-center text-xs text-gray-500">${
|
|
2119
|
-
${
|
|
2120
|
-
${
|
|
2121
|
-
<div data-id="${
|
|
2117
|
+
${X(Array.from(e),([i])=>i,([i,s])=>u`
|
|
2118
|
+
<div class="my-2 text-center text-xs text-gray-500">${aa(new Date(Number(i)),window.navigator.language)}</div>
|
|
2119
|
+
${X(s??[],o=>o.id,(o,c)=>{let a=s[c+1]?.role===o.role,d=(c>0?s[c-1]:void 0)?.role===o.role,p=(s.length>0?s[s.length-1]:void 0)?.id===o.id,y=()=>p&&!d&&!a?"single-current":!d&&!a?"single":!d&&a?"first":p&&d&&!a?"last-current":d&&!a?"last":d&&a?"middle":"single";this.#i=y();let E=this.isLiveMode&&o.role==="user"&&o.id===this.lastMsg?.id?"sent":"",b=(o.content.includes("<request-input-v1>")||!o.content)&&o.parts?.every(x=>"data"in x&&x.tag==="request-input-v1");return u`
|
|
2120
|
+
${o.images?X(o.images,x=>x,x=>u`
|
|
2121
|
+
<div data-id="${o.id}" class="${a?"mb-[1px]":"mb-3"} mr-2 ml-[15px] flex-row">
|
|
2122
2122
|
<mw-chat-image
|
|
2123
|
-
src="${
|
|
2123
|
+
src="${x}"
|
|
2124
2124
|
alt="User uploaded image"
|
|
2125
|
-
.side="${
|
|
2126
|
-
position=${
|
|
2125
|
+
.side="${o.role==="user"?"right":"left"}"
|
|
2126
|
+
position=${this.#i}
|
|
2127
2127
|
width="300px"></mw-chat-image>
|
|
2128
2128
|
</div>
|
|
2129
2129
|
`):null}
|
|
2130
|
-
${(
|
|
2130
|
+
${(o.content||o.parts)&&!b?u` <div data-id="${o.id}" class="${a?"mb-[1px]":"mb-3"} mx-2 flex-row">
|
|
2131
2131
|
<mw-chat-message
|
|
2132
2132
|
.color="${this.config?.color}"
|
|
2133
|
-
status="${
|
|
2134
|
-
logo="${
|
|
2135
|
-
side="${
|
|
2136
|
-
position=${
|
|
2137
|
-
@click="${
|
|
2133
|
+
status="${E}"
|
|
2134
|
+
logo="${o.metadata?.avatar||this.config?.logoUrl}"
|
|
2135
|
+
side="${o.role}"
|
|
2136
|
+
position=${this.#i}
|
|
2137
|
+
@click="${this.#l}">
|
|
2138
2138
|
<div
|
|
2139
2139
|
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">
|
|
2140
|
-
${
|
|
2140
|
+
${o.content===hu?u`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config?.color}]"></mw-loading>`:o.parts?X(o.parts,(x,w)=>w,(x,w)=>oa(x,w,o.parts??[],{imagesByProductUrl:o.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:o.streaming,color:this.config?.color,apiBaseUrl:Fr(),cdnBaseUrl:wa()})):u`<p>${o.content}</p>`}
|
|
2141
2141
|
</div>
|
|
2142
2142
|
</mw-chat-message>
|
|
2143
2143
|
</div>`:null}
|
|
@@ -2145,7 +2145,7 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
2145
2145
|
`)}
|
|
2146
2146
|
|
|
2147
2147
|
<!-- show typing indicator if the non-user side is typing -->
|
|
2148
|
-
${["assistant","support"].includes(this.typingIndicator?.role??"")&&this.typingIndicator?.role?
|
|
2148
|
+
${["assistant","support"].includes(this.typingIndicator?.role??"")&&this.typingIndicator?.role?u`
|
|
2149
2149
|
<mw-chat-message class="mx-2 mb-3 block" color="${this.config?.color}" logo="${this.typingIndicator?.metadata?.avatar||this.config?.logoUrl}" side="${this.typingIndicator.role}">
|
|
2150
2150
|
<div
|
|
2151
2151
|
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">
|
|
@@ -2159,51 +2159,51 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
2159
2159
|
class="flex-grow"
|
|
2160
2160
|
.examples="${this.messages.length>0?[]:this.config.examples}"
|
|
2161
2161
|
color="${this.config.color}"
|
|
2162
|
-
@mw:example-click="${
|
|
2162
|
+
@mw:example-click="${this.#f}"></mw-chat-background>
|
|
2163
2163
|
</div>
|
|
2164
2164
|
|
|
2165
|
-
${this.messages.length===0&&this.config.disclaimerFloating?
|
|
2165
|
+
${this.messages.length===0&&this.config.disclaimerFloating?u`
|
|
2166
2166
|
<div class="mx-4 mb-2 rounded-xl bg-[#eeedf1] px-3 py-2">
|
|
2167
2167
|
<mw-disclaimer .text="${this.config.disclaimerFloating}" .color="${this.config.color}"></mw-disclaimer>
|
|
2168
2168
|
</div>
|
|
2169
2169
|
`:null}
|
|
2170
2170
|
|
|
2171
2171
|
<div class="m-1.5 flex-shrink-0 flex-grow-0 space-y-2 rounded-3xl bg-[#eeedf1] p-1.5">
|
|
2172
|
-
${this.config.disclaimer&&!this.config.removePoweredBy?
|
|
2172
|
+
${this.config.disclaimer&&!this.config.removePoweredBy?u`
|
|
2173
2173
|
<!-- spacing between input box and disclaimer or bottom -->
|
|
2174
2174
|
<div class="mb-1.5">
|
|
2175
2175
|
<mw-disclaimer .text="${this.config.disclaimer}" .color="${this.config.color}"></mw-disclaimer>
|
|
2176
2176
|
</div>
|
|
2177
2177
|
`:null}
|
|
2178
|
-
${
|
|
2178
|
+
${this.#d.length===0?u`
|
|
2179
2179
|
<mw-chat-input
|
|
2180
|
-
@mw:change="${
|
|
2181
|
-
@mw:submit="${
|
|
2182
|
-
@mw:cancel="${
|
|
2180
|
+
@mw:change="${this.#v}"
|
|
2181
|
+
@mw:submit="${this.#y}"
|
|
2182
|
+
@mw:cancel="${this.#b}"
|
|
2183
2183
|
placeholder="${this.config?.input?.placeholder??""}"
|
|
2184
|
-
?disabled="${this.ranOutOfCredits||this.hasQueuedMessages||
|
|
2184
|
+
?disabled="${this.ranOutOfCredits||this.hasQueuedMessages||this.#n.hasPendingImages}"
|
|
2185
2185
|
?streaming="${this.isStreaming??!0}"
|
|
2186
|
-
?loading="${this.hasQueuedMessages||
|
|
2186
|
+
?loading="${this.hasQueuedMessages||this.#n.hasPendingImages}"
|
|
2187
2187
|
?enableImageUpload="${this.config?.enableImageUpload&&!this.ranOutOfCredits}"
|
|
2188
2188
|
color="${this.config?.color??""}"
|
|
2189
|
-
.onImageUploadClick="${this.config?.enableImageUpload?
|
|
2190
|
-
.images="${this.config?.enableImageUpload?
|
|
2191
|
-
.onImageDelete="${this.config?.enableImageUpload?
|
|
2189
|
+
.onImageUploadClick="${this.config?.enableImageUpload?this.#n.openImagePicker:void 0}"
|
|
2190
|
+
.images="${this.config?.enableImageUpload?this.#n.selectedImages:[]}"
|
|
2191
|
+
.onImageDelete="${this.config?.enableImageUpload?this.#n.onImageDelete:void 0}">
|
|
2192
2192
|
</mw-chat-input>
|
|
2193
|
-
`:
|
|
2193
|
+
`:u`
|
|
2194
2194
|
<mw-request-input
|
|
2195
|
-
.title="${
|
|
2196
|
-
.type="${
|
|
2195
|
+
.title="${n?.title}"
|
|
2196
|
+
.type="${n?.type}"
|
|
2197
2197
|
.color="${this.config?.color??"#8B5CF6"}"
|
|
2198
|
-
@mw-request-input:submit="${
|
|
2198
|
+
@mw-request-input:submit="${this.#g}">
|
|
2199
2199
|
</mw-request-input>
|
|
2200
2200
|
`}
|
|
2201
|
-
${this.config.removePoweredBy?this.config.disclaimer?
|
|
2201
|
+
${this.config.removePoweredBy?this.config.disclaimer?u`
|
|
2202
2202
|
<!-- spacing between input box and disclaimer or bottom -->
|
|
2203
2203
|
<div class="mt-1.5">
|
|
2204
2204
|
<mw-disclaimer .text="${this.config.disclaimer}" .color="${this.config.color}"></mw-disclaimer>
|
|
2205
2205
|
</div>
|
|
2206
|
-
`:null:
|
|
2206
|
+
`:null:u`
|
|
2207
2207
|
<!-- spacing between input box and powered-by or bottom -->
|
|
2208
2208
|
<div class="h-4">
|
|
2209
2209
|
<mw-powered-by></mw-powered-by>
|
|
@@ -2212,13 +2212,21 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
2212
2212
|
</div>
|
|
2213
2213
|
</div>
|
|
2214
2214
|
</div>
|
|
2215
|
-
`}
|
|
2215
|
+
`}#l(e){let n=e.composedPath().find(i=>i instanceof HTMLAnchorElement);if(n){if(e.preventDefault(),this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:n.href,conversationId:this.conversationId}),window.self!==window.top){window.open(n.href,"_blank");return}let s=this.config?.linksNewTab?"_blank":"_self";window.open(n.href,n.target||s)}}#f(e){if(this.isStreaming)return;e.preventDefault();let r=e.detail.example;this.#w(r)}#w=He({interval:200},async e=>{J(this.#e.value,"widget context is required"),await this.#e.value.enqueueUserInput(e,{xUserData:this.#e.value?.xUserData,xCustomInstructions:this.#e.value?.xCustomInstructions})&&(this.#p?.setValue(""),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:e,example:!0,conversationId:this.conversationId}))});#y(e){if(J(this.#e.value,"widget context is required"),e.preventDefault(),this.config?.enableImageUpload&&this.#n.hasPendingImages)return;let r=e.detail;this.#e.value.enqueueUserInput(r,{xUserData:this.#e.value?.xUserData,xCustomInstructions:this.#e.value?.xCustomInstructions}).then(n=>{n&&(this.#p?.setValue(""),this.#n.clearImages(),this.#r.typingStopped(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:r,example:!1,conversationId:this.conversationId}),window.requestAnimationFrame(()=>{this.#p?.focus()}))}).catch(console.warn)}#v(e){this.#r.onInput(e.detail.full)}#b(){J(this.#e.value,"widget context is required"),this.#e.value.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}#m(){J(this.#e.value,"widget context is required"),this.#e.value.sendNewChat(),this.reset()}#x(){this.dispatchEvent(new t.CloseClickEvent)}#g(e){J(this.#e.value,"widget context is required");let r=this.#d,n=r[this._currentRequestInputIndex];if(!n){console.warn("no current state found for request input");return}switch(e.detail.type){case"star-rating":{let{rating:s,type:o}=e.detail;this.#t.push({type:o,rating:s,key:n.key,title:n.title});break}case"binary-vote":{let{vote:s,type:o}=e.detail;this.#t.push({type:o,vote:s,key:n.key,title:n.title});break}case"new-conversation-button":{this.#m(),this.requestUpdate();return}default:console.warn("unknown request input type",e.detail);return}this._currentRequestInputIndex+=1;let i=r.filter(s=>s.type==="star-rating"||s.type==="binary-vote").length;this.#t.length>=i&&this.#u(),this.requestUpdate()}async#u(){if(J(this.#e.value,"widget context is required"),this.#t.length===0)return;if(!this.#e.value.lastMsg?.id){console.warn("cannot submit request inputs without message ID");return}await this.#e.value.enqueueUserInput("",{role:"user",expectStreaming:!1,requestInputResponse:this.#t})&&(this.#t=[]),this.requestUpdate()}get#d(){J(this.#e.value,"widget context is required");let e=this.messages.findLast(i=>i.role==="assistant"&&i.parts?.some(s=>"tag"in s&&s.tag==="request-input-v1"&&"data"in s&&s.data.type==="new-conversation-button")),r=this.#e.value.lastMsg;if(e&&r?.id!==e.id){let i=e?.parts?.find(s=>"tag"in s&&s.tag==="request-input-v1"&&"data"in s&&s.data.type==="new-conversation-button");if(i&&"data"in i)return[{title:i.data.title,type:i.data.type,key:i.data.key}]}if(r?.role!=="assistant")return[];let n=r.parts?.filter(i=>"tag"in i&&i.tag==="request-input-v1");return!n||n.length===0?[]:n.map(i=>!("data"in i)||!du.includes(i.data.type)?null:{title:i.data.title,type:i.data.type,key:i.data.key}).filter(i=>i!==null)}get#k(){if(this.#d.length===0)return!1;let r=this.#d.filter(n=>n.type==="star-rating"||n.type==="binary-vote").length;return this.#t.length<r}get#C(){return this.renderRoot.querySelector("#scrollable-content")}get#p(){return this.renderRoot.querySelector("mw-chat-input")}reloadConfig(){this.#e.value?.reloadConfig(),this.requestUpdate()}sendMessage=He({interval:200},async e=>{if(!e?.trim())return console.warn("sendMessage: Message must be a non-empty string"),!1;J(this.#e.value,"Widget context is required");let{value:r}=this.#e,n=await r.enqueueUserInput(e,{xUserData:r.xUserData,xCustomInstructions:r.xCustomInstructions,role:"user",expectStreaming:!0});return n&&this.#p?.setValue(""),n??!1});setInputValue(e){if(!e||typeof e!="string"){console.warn("setInputValue requires a valid string value");return}let r=this.#p;if(!r){console.warn("input element not found, cannot set value");return}r.setValue?r.setValue(e):console.warn("input element does not have setValue method")}focusInput(){window.requestAnimationFrame(()=>{this.#p?.focus()})}reset(){this.#n.clearImages(),this._currentRequestInputIndex=0,this.#t=[],this.#e.value?.reset()}};Rt.CloseClickEvent=class extends CustomEvent{static type="mw:close-click";constructor(e={}){super(Rt.CloseClickEvent.type,{...e})}};customElements.get("mw-chat")||customElements.define("mw-chat",Rt);var Re=class t extends C(v){static properties={text:{type:String},color:{type:String}};static styles=D`
|
|
2216
|
+
.popup-desktop:hover button {
|
|
2217
|
+
transition-delay: 0s !important;
|
|
2218
|
+
}
|
|
2219
|
+
|
|
2220
|
+
.popup-desktop button {
|
|
2221
|
+
transition-delay: 1s;
|
|
2222
|
+
}
|
|
2223
|
+
`;constructor(){super(),this.text="Hello there. How can we help?",this.color="#601feb"}render=()=>u`
|
|
2216
2224
|
<div class="popup-desktop group relative w-[300px] cursor-pointer rounded-[17px] shadow-2xl select-none">
|
|
2217
2225
|
<mw-spinning-border .color="${this.color}" .border="${"transparent"}" .radius="${"17px"}">
|
|
2218
2226
|
<!-- wrapper -->
|
|
2219
2227
|
<div class="relative z-[2147483647] m-[1px] w-[300px] rounded-2xl bg-white font-sans text-base leading-normal">
|
|
2220
2228
|
<!-- content -->
|
|
2221
|
-
<div class="p-4 text-left text-gray-800" @click="${
|
|
2229
|
+
<div class="p-4 text-left text-gray-800" @click="${this.#t}">
|
|
2222
2230
|
<p>${this.text}</p>
|
|
2223
2231
|
</div>
|
|
2224
2232
|
</div>
|
|
@@ -2227,36 +2235,28 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
2227
2235
|
<!-- close button -->
|
|
2228
2236
|
<button
|
|
2229
2237
|
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"
|
|
2230
|
-
@click="${
|
|
2238
|
+
@click="${this.#e}"
|
|
2231
2239
|
aria-label="Close">
|
|
2232
2240
|
×
|
|
2233
2241
|
</button>
|
|
2234
2242
|
</div>
|
|
2235
|
-
|
|
2236
|
-
.popup-desktop:hover button {
|
|
2237
|
-
transition-delay: 0s !important;
|
|
2238
|
-
}
|
|
2239
|
-
|
|
2240
|
-
.popup-desktop button {
|
|
2241
|
-
transition-delay: 1s;
|
|
2242
|
-
}
|
|
2243
|
-
`);var zt=Wr,Tl;zt.CloseEvent=(Tl=class extends CustomEvent{constructor(e={}){super(zt.CloseEvent.type,{...e})}},w(Tl,"type","mw:close"),Tl);var Ll;zt.ClickEvent=(Ll=class extends CustomEvent{constructor(e={}){super(zt.ClickEvent.type,{...e})}},w(Ll,"type","mw:click"),Ll);customElements.get("mw-popup-desktop")||customElements.define("mw-popup-desktop",zt);var Zr,Pd,Rd,pi=class pi extends I($){constructor(){super();p(this,Zr);w(this,"render",()=>h`
|
|
2243
|
+
`;#e(){this.dispatchEvent(new t.CloseEvent)}#t(){this.dispatchEvent(new t.ClickEvent)}};Re.CloseEvent=class extends CustomEvent{static type="mw:close";constructor(e={}){super(Re.CloseEvent.type,{...e})}};Re.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(Re.ClickEvent.type,{...e})}};customElements.get("mw-popup-desktop")||customElements.define("mw-popup-desktop",Re);var Be=class t extends C(v){static properties={title:{type:String},text:{type:String},button:{type:String},color:{type:String}};constructor(){super(),this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}render=()=>u`
|
|
2244
2244
|
<!-- wrapper -->
|
|
2245
2245
|
<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">
|
|
2246
2246
|
<!-- close button -->
|
|
2247
2247
|
<button
|
|
2248
2248
|
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"
|
|
2249
|
-
@click="${
|
|
2249
|
+
@click="${this.#e}"
|
|
2250
2250
|
aria-label="Close">
|
|
2251
2251
|
×
|
|
2252
2252
|
</button>
|
|
2253
2253
|
|
|
2254
2254
|
<!-- content -->
|
|
2255
|
-
<div class="p-4 text-gray-800" @click="${
|
|
2255
|
+
<div class="p-4 text-gray-800" @click="${this.#t}">
|
|
2256
2256
|
<h1 class="font-display mr-8 py-2.5 text-left text-lg font-bold">${this.title}</h1>
|
|
2257
2257
|
<p class="py-2.5 text-left">${this.text}</p>
|
|
2258
2258
|
<div class="h-4"></div>
|
|
2259
|
-
${this.button&&this.color?
|
|
2259
|
+
${this.button&&this.color?u`
|
|
2260
2260
|
<!-- only visible if button text and color are given -->
|
|
2261
2261
|
<button class="w-full rounded-full bg-[${this.color}] px-5 py-2.5 text-center text-sm font-medium text-white" type="button">${this.button}</button>
|
|
2262
2262
|
`:null}
|
|
@@ -2265,30 +2265,30 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
2265
2265
|
<!-- can append any other content -->
|
|
2266
2266
|
<slot name="footer"></slot>
|
|
2267
2267
|
</div>
|
|
2268
|
-
|
|
2268
|
+
`;#e(){this.dispatchEvent(new t.CloseEvent)}#t(){this.dispatchEvent(new t.ClickEvent)}};Be.CloseEvent=class extends CustomEvent{static type="mw:close";constructor(e={}){super(Be.CloseEvent.type,{...e})}};Be.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(Be.ClickEvent.type,{...e})}};customElements.get("mw-popup-mobile")||customElements.define("mw-popup-mobile",Be);var Hr=class{#e;#t=!1;constructor(e,r){this.#e=r,e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",this.#r),window.addEventListener("keydown",this.#r)}stopListening(){window.removeEventListener("click",this.#r),window.removeEventListener("keydown",this.#r)}#r=()=>{this.#t||(this.#e.userFirstInteracted?.(),this.#t=!0),this.#e.userInteracted?.()}};var pu=1440*60*1e3,zr=class{#e;#t;#r;#n;#i=!1;#s=!1;get showing(){return this.#i}constructor(e,r,n=Date){this.#e=e,this.#t=r,this.#r=n,e.addController(this)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!this.#i&&(this.#i=!0,this.#e.requestUpdate(),e)){this.#t.playPopupSound();let r=this.#t.getPersistedState();this.#t.setPersistedState({...r,playedSoundOnce:!0})}}#o(){let e=this.#t.getPersistedState(),r=!!e?.playedSoundOnce;e?.userDismissedAt&&this.#r.now()-e.userDismissedAt<pu||this.show({sound:!r})}hide(){this.#s=!0,this.abortAutoShowTimer(),this.#i=!1,this.#e.requestUpdate()}abortAutoShowTimer(){clearTimeout(this.#n)}onCloseClick(){let e=this.#t.getPersistedState();this.#t.setPersistedState({...e,userDismissedAt:this.#r.now()}),this.hide()}onContentClick(){let e=this.#t.getPersistedState();this.#t.setPersistedState({...e,userDismissedAt:this.#r.now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),this.#s||(this.#n=setTimeout(()=>this.#o(),this.#t.getDelayMs()))}};var Bt=class t extends C(v){static properties={positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object}};#e=new zr(this,{getDelayMs:()=>this.delayMs,playPopupSound:()=>{this.soundUrl&&new Audio(this.soundUrl).play().then(()=>{}).catch(e=>{console.error("Error playing audio:",e,{})})},setPersistedState:e=>{e?localStorage.setItem("_molin_popup",JSON.stringify(e)):localStorage.removeItem("_molin_popup")},getPersistedState:()=>{let e=localStorage.getItem("_molin_popup");try{return e?JSON.parse(e):null}catch{return null}}});#t=new Hr(this,this.#e);constructor(){super(),this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:"",color:""},mobile:{title:"",text:"",button:"",color:"",poweredBy:!0}}}render(){let e=this.#e.showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",r=this.content;return u`
|
|
2269
2269
|
<!-- mobile shadow backdrop -->
|
|
2270
|
-
<div @click="${
|
|
2270
|
+
<div @click="${this.#r}" class="${e} fixed inset-0 z-[2147483647] bg-black/50 transition-[opacity,visibility] sm:hidden"></div>
|
|
2271
2271
|
|
|
2272
2272
|
<!-- mobile overlay -->
|
|
2273
|
-
<div class="${
|
|
2274
|
-
<mw-popup-mobile title="${
|
|
2275
|
-
${
|
|
2273
|
+
<div class="${e} fixed right-0 bottom-0 left-0 z-[2147483647] sm:hidden">
|
|
2274
|
+
<mw-popup-mobile title="${r.mobile.title}" text="${r.mobile.text}" button="${r.mobile.button}" color="${r.mobile.color}" @mw:click="${this.#n}" @mw:close="${this.#r}">
|
|
2275
|
+
${r.mobile.poweredBy?u`<mw-powered-by class="block p-4" slot="footer"></mw-powered-by>`:null}
|
|
2276
2276
|
</mw-popup-mobile>
|
|
2277
2277
|
</div>
|
|
2278
2278
|
|
|
2279
2279
|
<!-- desktop -->
|
|
2280
|
-
<div class="${
|
|
2281
|
-
<mw-popup-desktop color="${
|
|
2280
|
+
<div class="${e} ${this.positionClasses} fixed z-[2147483647] transition-[opacity,translate,visibility] max-sm:hidden">
|
|
2281
|
+
<mw-popup-desktop color="${r.desktop.color}" text="${r.desktop.text}" @mw:click="${this.#n}" @mw:close="${this.#r}"></mw-popup-desktop>
|
|
2282
2282
|
</div>
|
|
2283
|
-
`}
|
|
2283
|
+
`}#r(){this.#e.onCloseClick()}#n(){this.dispatchEvent(new t.ClickEvent),this.#e.onContentClick()}hide(){this.#e.hide()}};Bt.ClickEvent=class extends CustomEvent{static type="mw:click";constructor(e={}){super(Bt.ClickEvent.type,{...e})}};customElements.get("mw-popup")||customElements.define("mw-popup",Bt);var Ti=class extends C(v){static properties={color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}};constructor(){super(),this.color="sky-500",this.position="top-right"}render=()=>u`
|
|
2284
2284
|
<span class="relative inline-flex">
|
|
2285
2285
|
<slot></slot>
|
|
2286
|
-
<span class="${
|
|
2286
|
+
<span class="${this.#e} pointer-events-none absolute z-10 flex h-3 w-3">
|
|
2287
2287
|
<span class="bg-${this.color} absolute inline-flex h-3 w-3 animate-ping rounded-full opacity-75"></span>
|
|
2288
2288
|
<span class="bg-${this.color} relative inline-flex h-3 w-3 rounded-full"></span>
|
|
2289
2289
|
</span>
|
|
2290
2290
|
</span>
|
|
2291
|
-
|
|
2291
|
+
`;get#e(){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}`)}}};customElements.get("mw-pulse-dot")||customElements.define("mw-pulse-dot",Ti);var Li=class extends C(v){static properties={positionClasses:{type:String,attribute:"position"},text:{type:String}};constructor(){super(),this.positionClasses="",this.text="Try it out"}render=()=>u`
|
|
2292
2292
|
<div class="${this.positionClasses} fixed right-6 bottom-24 z-10 flex animate-bounce flex-col items-center justify-center font-sans text-base">
|
|
2293
2293
|
<p class="mb-2 -translate-x-4 -rotate-12 transform text-lg leading-normal font-bold text-gray-800">${this.text}</p>
|
|
2294
2294
|
|
|
@@ -2301,7 +2301,11 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
2301
2301
|
stroke-linecap="round"></path>
|
|
2302
2302
|
</svg>
|
|
2303
2303
|
</div>
|
|
2304
|
-
`
|
|
2304
|
+
`};customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",Li);var ji=class extends C(v){static styles=D`
|
|
2305
|
+
:host {
|
|
2306
|
+
all: initial; /* reset all properties that can pierce the shadow DOM */
|
|
2307
|
+
}
|
|
2308
|
+
`;static properties={cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}};constructor(){super(),this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}#e=new Pe(this,{onError:console.error});get config(){return this.#e.data}render(){return this.config?u`
|
|
2305
2309
|
<!-- embed our bubble component forwarding props -->
|
|
2306
2310
|
<!-- these props are never internally updated by mw-bubble so we pass them down only one way -->
|
|
2307
2311
|
<mw-bubble
|
|
@@ -2309,70 +2313,66 @@ var Yd=Object.create;var Io=Object.defineProperty;var Xd=Object.getOwnPropertyDe
|
|
|
2309
2313
|
.color="${this.config?.bubble?.color||this.config?.color}"
|
|
2310
2314
|
.bubbleStyle="${this.config?.bubble?.style}"
|
|
2311
2315
|
.src="${this.config?.bubble?.bubbleUrl}"
|
|
2312
|
-
width="${
|
|
2313
|
-
height="${
|
|
2314
|
-
`:null}};
|
|
2316
|
+
width="${V(this.config?.bubble?.size?.width)}"
|
|
2317
|
+
height="${V(this.config?.bubble?.size?.height)}"></mw-bubble>
|
|
2318
|
+
`:null}};customElements.get("molin-shop-ai-launcher")||customElements.define("molin-shop-ai-launcher",ji);var J5="navigator"in globalThis&&/Mobi|Android|iPhone/i.test(navigator.userAgent),K5="navigator"in globalThis&&"share"in navigator,fu=Object.freeze({sm:640,md:768,lg:1024,xl:1280,"2xl":1536});function mu(t){if(typeof window>"u")return!1;let e=fu[t];return typeof e!="number"?(console.warn(`Invalid breakpoint: ${t}`),!1):window.matchMedia(`(min-width: ${e}px)`).matches}function Di(){return mu("sm")}var Wr=class{#e;#t;#r;#n;#i=!1;constructor(e,r,n,i=window.history){this.#e=e,this.#t=r,this.#r=n,this.#n=i,e.addController(this)}hostConnected(){this.#s();let e=this.#n.pushState;this.#n.pushState=(...r)=>{if(e.call(this.#n,...r),!this.#i)try{let n=new URL(r[2],window.location.origin);this.#t.test(n.pathname)&&this.#r.navigated()}catch{}}}hostDisconnected(){this.#i=!0}#s=()=>{this.#t.test(window.location.pathname)&&this.#r.navigated()}};function ya({minMs:t,maxMs:e}){return Math.random()*(e-t)+t}function Gr(t,e=""){return Object.entries(t).filter(([r,n])=>n).map(([r,n])=>`${e}${r}-[${n}]`).join(" ")}function va(t,e={}){return[Gr(t),Gr(e,"max-sm:")].join(" ")}function ba(t){return Gr(t)}function xa(t){return Object.entries(t).filter(([e,r])=>r).filter(([e])=>e==="left"||e==="right").map(([e,r])=>{let n=`sm:${e}-[${r}]`;return e==="left"&&(n+=" sm:right-auto"),e==="right"&&(n+=" sm:left-auto"),n}).join(" ")}function ka(t){let e=Gr(t),n=`sm:bottom-[${t.bottom?`calc(${t.bottom}+72px)`:"72px"}]`;return[e,n].filter(Boolean).join(" ")}var Oi=class{#e=0;#t=!1;#r;#n;constructor(e,r,{threshold:n=5}={}){this.#r=r,this.#n=n,e.addController(this)}hostConnected(){this.#e=window.scrollY,window.addEventListener("scroll",this.#i,{passive:!0})}hostDisconnected(){window.removeEventListener("scroll",this.#i)}#i=()=>{this.#t||(requestAnimationFrame(this.#s),this.#t=!0)};#s=()=>{let e=window.scrollY,r=e-this.#e;if(Math.abs(r)>=this.#n){let n=r>0?"down":"up";this.#r({scrollY:e,direction:n,deltaY:Math.abs(r)}),this.#e=e}this.#t=!1}};function Ca(t,e,r){return new Oi(t,e,r)}var fe=class extends C(v){static styles=D`
|
|
2315
2319
|
:host {
|
|
2316
2320
|
all: initial; /* reset all properties that can pierce the shadow DOM */
|
|
2317
2321
|
}
|
|
2318
|
-
|
|
2322
|
+
`;static properties={cdn:{type:String},widgetId:{type:String,attribute:"widget"},xUserData:{type:Object,attribute:!1},xCustomInstructions:{type:String,attribute:!1},_floatingInputVisible:{type:Boolean,state:!0},_dialogShown:{type:Boolean,state:!0}};constructor(){super(),this.cdn="https://widget.molin.ai",this.widgetId="",this._floatingInputVisible=!0,this._dialogShown=!1,this.xUserData=be()?.userData,this.xCustomInstructions=be()?.customInstructions}#e=new Pe(this,{onError:console.error});#t=Ca(this,e=>{this.#a&&!this._dialogShown&&(e.direction==="down"?this._floatingInputVisible=!1:e.direction==="up"&&(this._floatingInputVisible=!0),this.requestUpdate())},{threshold:20});get config(){return this.#r||this.#e.data}#r;#n=new Wr(this,/.*/i,{navigated:()=>{if(this.requestUpdate(),!this.widgetId){console.warn("No widgetId set, cannot track page view");return}let e=this.#l?.conversationId,r=Ke.restore(this.widgetId)?.conversationId,n=e||r;n&&A("ShopAssistant: pageview",{widgetId:this.widgetId,conversationId:n,url:document.location.href,title:document.title,hidden:this.config?this.config.hidden||!1:void 0,shouldHideForCurrentUrl:this.#h})}});#i=!1;#s={onError:e=>{alert(e.error),console.error(e.widgetId,e.error),A("ShopAssistant: error",{...e},{immediate:!0})},onNewMessageStartedStreaming:e=>{A("ShopAssistant: user received bot message (streaming started)",e)},onMessageEndedStreaming:e=>{A("ShopAssistant: user received bot message (streaming ended)",e)},onUserCanceledStreaming:e=>{A("ShopAssistant: user canceled streaming",e)},onUserClickedLink:e=>{A("ShopAssistant: user clicked link",e)},onUserSentInput:e=>{A("ShopAssistant: user sent input",e)},onWaitGameQuestionAnswered:e=>{A("ShopAssistant: wait game question answered",e)},onWaitGameCompleted:e=>{A("ShopAssistant: wait game completed",e)},onWaitGameGuessValidated:e=>{A("ShopAssistant: wait game guess validated",e)}};get#o(){return typeof this.config?.bubble?.zIndex=="number"?this.config.bubble.zIndex:2147483647}get#a(){return this.config?.floatingAskAI?.enabled||!0}get#h(){if(!this.config?.hideUrls||!Array.isArray(this.config.hideUrls))return!1;let e=window.location.href,r=window.location.pathname;return this.config.hideUrls.some(n=>{if(!n||typeof n!="string")return!1;let i=n.endsWith("*"),s=i?n.slice(0,-1):n;return n.startsWith("http")?i?e.startsWith(s):e===s:i?r.startsWith(s):r===s})}render(){if(!this.config)return null;let e=va(this.config.bubble.position,this.config.bubble.mobilePosition),r=ba(this.config.bubble.position),n=xa(this.config.bubble.position),i=ka(this.config.bubble.position);return this.config.hidden||Nr().hidden||this.#h?null:u`
|
|
2319
2323
|
<mw-context-widget
|
|
2320
2324
|
.widgetId="${this.widgetId}"
|
|
2321
2325
|
.config="${this.config}"
|
|
2322
|
-
.callbacks="${
|
|
2326
|
+
.callbacks="${this.#s}"
|
|
2323
2327
|
.xUserData="${this.xUserData}"
|
|
2324
2328
|
.xCustomInstructions="${this.xCustomInstructions}"
|
|
2325
|
-
.autoConnect="${
|
|
2329
|
+
.autoConnect="${this.#i}">
|
|
2326
2330
|
<mw-bubble
|
|
2327
|
-
class="${
|
|
2328
|
-
@click="${
|
|
2331
|
+
class="${e} ${this._dialogShown?"opacity-0":"opacity-100"} fixed z-[${this.#o}] transition-opacity"
|
|
2332
|
+
@click="${this.#y}"
|
|
2329
2333
|
state="${this._dialogShown?"close":"open"}"
|
|
2330
2334
|
.color="${this.config?.bubble?.color||this.config?.color}"
|
|
2331
2335
|
.bubbleStyle="${this.config?.bubble?.style}"
|
|
2332
2336
|
.src="${this.config?.bubble?.bubbleUrl}"
|
|
2333
|
-
width="${
|
|
2334
|
-
height="${
|
|
2337
|
+
width="${V(this.config?.bubble?.size?.width)}"
|
|
2338
|
+
height="${V(this.config?.bubble?.size?.height)}"></mw-bubble>
|
|
2335
2339
|
|
|
2336
2340
|
<!-- only load the component if enabled on any platform -->
|
|
2337
|
-
${this.isPopupEnabled?
|
|
2341
|
+
${this.isPopupEnabled?u`
|
|
2338
2342
|
<mw-popup
|
|
2339
|
-
position="${
|
|
2340
|
-
delay="${this.config.popup?.delayMs||
|
|
2343
|
+
position="${i}"
|
|
2344
|
+
delay="${this.config.popup?.delayMs||ya({minMs:2e3,maxMs:5e3})}"
|
|
2341
2345
|
sound="${this.config.popup?.muteSounds?"":this.config.popup?.soundUrl||""}"
|
|
2342
2346
|
.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}}}"
|
|
2343
|
-
@mw:click="${
|
|
2347
|
+
@mw:click="${this.#w}"></mw-popup>
|
|
2344
2348
|
`:null}
|
|
2345
2349
|
|
|
2346
2350
|
<!-- show "Try it out" if enabled (even if the chat window is showing) -->
|
|
2347
|
-
${this.config?.tryItOut?.mobileEnabled||this.config?.tryItOut?.desktopEnabled?
|
|
2351
|
+
${this.config?.tryItOut?.mobileEnabled||this.config?.tryItOut?.desktopEnabled?u`<mw-try-it-out
|
|
2348
2352
|
class="${this.config?.tryItOut?.mobileEnabled?"visible":"invisible"} ${this.config?.tryItOut?.desktopEnabled?"sm:visible":"sm:invisible"}"
|
|
2349
|
-
position="${
|
|
2353
|
+
position="${r}"
|
|
2350
2354
|
text="${this.config.tryItOut?.text||""}"></mw-try-it-out>`:null}
|
|
2351
2355
|
|
|
2352
2356
|
<!-- 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. -->
|
|
2353
2357
|
<div
|
|
2354
|
-
class="${this._dialogShown?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${
|
|
2355
|
-
<mw-chat ?show-close="${!0}" @mw:close-click="${
|
|
2358
|
+
class="${this._dialogShown?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${n} 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]">
|
|
2359
|
+
<mw-chat ?show-close="${!0}" @mw:close-click="${this.#v}">
|
|
2356
2360
|
<slot name="banner" slot="banner"></slot>
|
|
2357
2361
|
</mw-chat>
|
|
2358
2362
|
</div>
|
|
2359
2363
|
|
|
2360
2364
|
<!-- Floating input only visible when enabled, in center, on desktop only -->
|
|
2361
|
-
${this.config?.floatingAskAI?.enabled&&
|
|
2365
|
+
${this.config?.floatingAskAI?.enabled&&this.#a?u`
|
|
2362
2366
|
<mw-floating-ask-ai
|
|
2363
2367
|
?dark="${this.config?.floatingAskAI?.darkMode}"
|
|
2364
2368
|
.color="${this.config.color||this.config?.bubble?.color}"
|
|
2365
|
-
placeholder="${
|
|
2366
|
-
class="${!this._dialogShown&&this._floatingInputVisible?"opacity-100 translate-y-0":"opacity-0 translate-y-full"} fixed left-1/2 z-[${o
|
|
2369
|
+
placeholder="${V(this.config?.floatingAskAI?.placeholder)}"
|
|
2370
|
+
class="${!this._dialogShown&&this._floatingInputVisible?"opacity-100 translate-y-0":"opacity-0 translate-y-full"} fixed left-1/2 z-[${this.#o}] hidden -translate-x-1/2 transition-all duration-300 ease-in-out max-md:hidden sm:block"
|
|
2367
2371
|
style="bottom: ${this.config.bubble.position.bottom||"1.5rem"}"
|
|
2368
|
-
@mw-floating-ask-ai:submit="${
|
|
2372
|
+
@mw-floating-ask-ai:submit="${this.#b}"></mw-floating-ask-ai>
|
|
2369
2373
|
`:null}
|
|
2370
2374
|
</mw-context-widget>
|
|
2371
|
-
`}get isPopupEnabled(){return
|
|
2372
|
-
:host {
|
|
2373
|
-
all: initial; /* reset all properties that can pierce the shadow DOM */
|
|
2374
|
-
}
|
|
2375
|
-
`),w(je,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},xUserData:{type:Object,attribute:!1},xCustomInstructions:{type:String,attribute:!1},_floatingInputVisible:{type:Boolean,state:!0},_dialogShown:{type:Boolean,state:!0}});customElements.get("molin-shop-ai")||customElements.define("molin-shop-ai",je);export{je as MolinShopAI};
|
|
2375
|
+
`}get isPopupEnabled(){return Di()?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){this._dialogShown&&this.#c?.hide(),this._dialogShown&&setTimeout(()=>{this.#l?.focusInput()},0)}firstUpdated(){Di()&&Z.molin_widget_open_state?.isOpen&&!this._dialogShown&&(this._dialogShown=!0,this.#i=!0,this.requestUpdate())}get#c(){return this.renderRoot.querySelector("mw-popup")}get#l(){return this.renderRoot.querySelector("mw-chat")}get#f(){return this.renderRoot.querySelector("mw-context-widget")}#w(){this._dialogShown=!0,this.#i=!0,this.requestUpdate(),this.#u(!0),A("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"popup-click",state:this._dialogShown?"open":"close"})}#y(){this._dialogShown=!this._dialogShown,this.#i=!0,this.requestUpdate(),this.#u(this._dialogShown),this.#c?.hide(),A("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"bubble-toggle",state:this._dialogShown?"open":"close"})}#v(){this._dialogShown=!1,this._floatingInputVisible=!0,this.requestUpdate(),this.#u(!1),A("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"top-right-close-button",state:this._dialogShown?"open":"close"})}#b=e=>{let r=e.detail.text,n=this.#f;n&&typeof n.connect=="function"&&n.connect(),this._dialogShown=!0,this.#i=!0,this.requestUpdate(),this.#u(!0),setTimeout(()=>{this.#g(r),this.#x(r).catch(console.warn)},100),A("ShopAssistant: user sent input",{widgetId:this.widgetId,text:r,example:!1,conversationId:this.#l?.conversationId||"",source:"ask-ai"})};#m=He({interval:200},({message:e,autoSend:r=!1}={})=>{if(!e)return;this.#g(e);let n=this.#l?.isLiveMode;n||this.reset(),r&&!n&&this.#x(e).catch(console.warn)});openChat(e){let{message:r,autoSend:n}=e||{};if(this._dialogShown){this.#m({message:r,autoSend:n});return}let i=this.#f;i&&typeof i.connect=="function"&&i.connect(),this._dialogShown=!0,this.#i=!0,this.requestUpdate(),this.#u(!0),this.#c?.hide(),setTimeout(()=>{this.#m({message:r,autoSend:n})},100),A("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(),this.#u(!1),this.#c?.hide(),A("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:this._dialogShown?"open":"close"}))}showLauncher(){let e=Nr();e.hidden=!1,this.requestUpdate(),A("ShopAssistant: called show launcher",{widgetId:this.widgetId,source:"programmatic-method"})}hideLauncher(){let e=Nr();e.hidden=!0,this.requestUpdate(),A("ShopAssistant: called hide launcher",{widgetId:this.widgetId,source:"programmatic-method"})}injectConfig(e){this.#r=e,this.requestUpdate()}reset(){this.xUserData={},this.xCustomInstructions="",this.#l?.reset(),this.requestUpdate()}async#x(e){let r=this.#l;if(!r){console.warn("Chat element not found, cannot send message");return}r.sendMessage?await r.sendMessage(e):console.warn("Chat element does not have sendMessage method")}#g(e){let r=this.#l;if(!r){console.warn("Chat element not found, cannot set input value");return}r.setInputValue?r.setInputValue(e):console.warn("Chat element does not have setInputValue method")}#u(e){Z.molin_widget_open_state={isOpen:e}}};customElements.get("molin-shop-ai")||customElements.define("molin-shop-ai",fe);export{fe as MolinShopAI};
|
|
2376
2376
|
/*! Bundled license information:
|
|
2377
2377
|
|
|
2378
2378
|
@lit/reactive-element/css-tag.js:
|