@molin.ai/shop-ai 0.9.20 → 0.9.22
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 +793 -687
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDescriptor;var $u=Object.getOwnPropertyNames;var Su=Object.getPrototypeOf,Eu=Object.prototype.hasOwnProperty;var Ml=t=>{throw TypeError(t)};var _u=(t,e,r)=>e in t?mo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Yr=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Mu=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of $u(e))!Eu.call(t,i)&&i!==r&&mo(t,i,{get:()=>e[i],enumerable:!(n=Cu(e,i))||n.enumerable});return t};var Au=(t,e,r)=>(r=t!=null?ku(Su(t)):{},Mu(e||!t||!t.__esModule?mo(r,"default",{value:t,enumerable:!0}):r,t));var w=(t,e,r)=>_u(t,typeof e!="symbol"?e+"":e,r),go=(t,e,r)=>e.has(t)||Ml("Cannot "+r);var o=(t,e,r)=>(go(t,e,"read from private field"),r?r.call(t):e.get(t)),d=(t,e,r)=>e.has(t)?Ml("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),g=(t,e,r,n)=>(go(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),m=(t,e,r)=>(go(t,e,"access private method"),r);var Al=(t,e,r,n)=>({set _(i){g(t,e,i,r)},get _(){return o(t,e,n)}});var k0=Yr(It=>{"use strict";var Q2=It&&It.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function u(p){try{c(n.next(p))}catch(f){a(f)}}function l(p){try{c(n.throw(p))}catch(f){a(f)}}function c(p){p.done?s(p.value):i(p.value).then(u,l)}c((n=n.apply(t,e||[])).next())})},eh=It&&It.__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,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(p){return l([c,p])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(p){c=[6,p],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(It,"__esModule",{value:!0});It.base64ToBlob=th;function th(t){return Q2(this,void 0,void 0,function(){var e,r,n;return eh(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=nh(t),n&&(r=r.slice(0,r.size,n)),[2,r]}})})}var rh=/^data:(.+);base64,/;function nh(t){var e;return(e=t.match(rh))===null||e===void 0?void 0:e.slice(1,2).pop()}});var C0=Yr(Lt=>{"use strict";var ih=Lt&&Lt.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function u(p){try{c(n.next(p))}catch(f){a(f)}}function l(p){try{c(n.throw(p))}catch(f){a(f)}}function c(p){p.done?s(p.value):i(p.value).then(u,l)}c((n=n.apply(t,e||[])).next())})},sh=Lt&&Lt.__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,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(p){return l([c,p])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(p){c=[6,p],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Lt,"__esModule",{value:!0});Lt.base64ToFile=oh;function oh(t,e,r){return ih(this,void 0,void 0,function(){var n,i;return sh(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 $a=Yr(jt=>{"use strict";var ka=jt&&jt.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function u(p){try{c(n.next(p))}catch(f){a(f)}}function l(p){try{c(n.throw(p))}catch(f){a(f)}}function c(p){p.done?s(p.value):i(p.value).then(u,l)}c((n=n.apply(t,e||[])).next())})},Ca=jt&&jt.__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,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(p){return l([c,p])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(p){c=[6,p],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(jt,"__esModule",{value:!0});jt.blobToBase64=ah;function ah(t){return ka(this,void 0,void 0,function(){return Ca(this,function(e){return[2,typeof FileReader=="function"?lh(t):uh(t)]})})}var vr;(function(t){t.error="error",t.loadend="loadend"})(vr||(vr={}));function lh(t){return ka(this,void 0,void 0,function(){return Ca(this,function(e){return[2,new Promise(function(r,n){try{var i=new FileReader,s=function(){r(i.result),i.removeEventListener(vr.loadend,s)};i.addEventListener(vr.loadend,s);var a=function(){n(i.error),i.removeEventListener(vr.error,a)};i.addEventListener(vr.error,a),i.readAsDataURL(t)}catch(u){n(u)}})]})})}var ch="application/octet-stream";function uh(t){return ka(this,void 0,void 0,function(){var e,r,n,i;return Ca(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||ch,[2,"data:".concat(i,";base64,").concat(e.toString("base64"))]}})})}});var $0=Yr(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.fileToBase64=void 0;var hh=$a();Object.defineProperty(ts,"fileToBase64",{enumerable:!0,get:function(){return hh.blobToBase64}})});var S0=Yr(Ue=>{"use strict";var ph=Ue&&Ue.__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]})),rs=Ue&&Ue.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ph(e,t,r)};Object.defineProperty(Ue,"__esModule",{value:!0});rs(k0(),Ue);rs(C0(),Ue);rs($a(),Ue);rs($0(),Ue)});var vi=globalThis,yi=vi.ShadowRoot&&(vi.ShadyCSS===void 0||vi.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,wo=Symbol(),Il=new WeakMap,Qr=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==wo)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(yi&&e===void 0){let n=r!==void 0&&r.length===1;n&&(e=Il.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Il.set(r,e))}return e}toString(){return this.cssText}},Ll=t=>new Qr(typeof t=="string"?t:t+"",void 0,wo),K=(t,...e)=>{let r=t.length===1?t[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)+t[s+1]),t[0]);return new Qr(r,t,wo)},jl=(t,e)=>{if(yi)t.adoptedStyleSheets=e.map((r=>r instanceof CSSStyleSheet?r:r.styleSheet));else for(let r of e){let n=document.createElement("style"),i=vi.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)}},vo=yi?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let n of e.cssRules)r+=n.cssText;return Ll(r)})(t):t;var{is:Iu,defineProperty:Lu,getOwnPropertyDescriptor:ju,getOwnPropertyNames:Tu,getOwnPropertySymbols:Du,getPrototypeOf:Ou}=Object,bi=globalThis,Tl=bi.trustedTypes,Pu=Tl?Tl.emptyScript:"",Uu=bi.reactiveElementPolyfillSupport,en=(t,e)=>t,yo={toAttribute(t,e){switch(e){case Boolean:t=t?Pu: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}},Ol=(t,e)=>!Iu(t,e),Dl={attribute:!0,type:String,converter:yo,reflect:!1,useDefault:!1,hasChanged:Ol};Symbol.metadata??=Symbol("metadata"),bi.litPropertyMetadata??=new WeakMap;var Fe=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=Dl){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&&Lu(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){let{get:i,set:s}=ju(this.prototype,e)??{get(){return this[r]},set(a){this[r]=a}};return{get:i,set(a){let u=i?.call(this);s?.call(this,a),this.requestUpdate(e,u,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Dl}static _$Ei(){if(this.hasOwnProperty(en("elementProperties")))return;let e=Ou(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(en("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(en("properties"))){let r=this.properties,n=[...Tu(r),...Du(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(vo(i))}else e!==void 0&&r.push(vo(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 jl(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:yo).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),a=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:yo;this._$Em=i;let u=a.fromAttribute(r,s.type);this[i]=u??this._$Ej?.get(i)??u,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??Ol)(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},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??r??this[e]),s!==!0||a!==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:a}=s,u=this[i];a!==!0||this._$AL.has(i)||u===void 0||this.C(i,void 0,s,u)}}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){}};Fe.elementStyles=[],Fe.shadowRootOptions={mode:"open"},Fe[en("elementProperties")]=new Map,Fe[en("finalized")]=new Map,Uu?.({ReactiveElement:Fe}),(bi.reactiveElementVersions??=[]).push("2.1.1");var xo=globalThis,xi=xo.trustedTypes,Pl=xi?xi.createPolicy("lit-html",{createHTML:t=>t}):void 0,ko="$lit$",Ne=`lit$${Math.random().toFixed(9).slice(2)}$`,Co="?"+Ne,Ru=`<${Co}>`,yt=document,rn=()=>yt.createComment(""),nn=t=>t===null||typeof t!="object"&&typeof t!="function",$o=Array.isArray,zl=t=>$o(t)||typeof t?.[Symbol.iterator]=="function",bo=`[
|
|
2
|
-
\f\r]`,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
1
|
+
var Ju=Object.create;var Ao=Object.defineProperty;var Ku=Object.getOwnPropertyDescriptor;var Yu=Object.getOwnPropertyNames;var Xu=Object.getPrototypeOf,Qu=Object.prototype.hasOwnProperty;var Fl=t=>{throw TypeError(t)};var e2=(t,e,r)=>e in t?Ao(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var sn=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var t2=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Yu(e))!Qu.call(t,i)&&i!==r&&Ao(t,i,{get:()=>e[i],enumerable:!(n=Ku(e,i))||n.enumerable});return t};var r2=(t,e,r)=>(r=t!=null?Ju(Xu(t)):{},t2(e||!t||!t.__esModule?Ao(r,"default",{value:t,enumerable:!0}):r,t));var w=(t,e,r)=>e2(t,typeof e!="symbol"?e+"":e,r),Io=(t,e,r)=>e.has(t)||Fl("Cannot "+r);var o=(t,e,r)=>(Io(t,e,"read from private field"),r?r.call(t):e.get(t)),d=(t,e,r)=>e.has(t)?Fl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),g=(t,e,r,n)=>(Io(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),f=(t,e,r)=>(Io(t,e,"access private method"),r);var Nl=(t,e,r,n)=>({set _(i){g(t,e,i,r)},get _(){return o(t,e,n)}});var R0=sn(jt=>{"use strict";var Eh=jt&&jt.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function u(p){try{c(n.next(p))}catch(m){a(m)}}function l(p){try{c(n.throw(p))}catch(m){a(m)}}function c(p){p.done?s(p.value):i(p.value).then(u,l)}c((n=n.apply(t,e||[])).next())})},_h=jt&&jt.__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,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(p){return l([c,p])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(p){c=[6,p],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(jt,"__esModule",{value:!0});jt.base64ToBlob=Mh;function Mh(t){return Eh(this,void 0,void 0,function(){var e,r,n;return _h(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=Ih(t),n&&(r=r.slice(0,r.size,n)),[2,r]}})})}var Ah=/^data:(.+);base64,/;function Ih(t){var e;return(e=t.match(Ah))===null||e===void 0?void 0:e.slice(1,2).pop()}});var V0=sn(Tt=>{"use strict";var Lh=Tt&&Tt.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function u(p){try{c(n.next(p))}catch(m){a(m)}}function l(p){try{c(n.throw(p))}catch(m){a(m)}}function c(p){p.done?s(p.value):i(p.value).then(u,l)}c((n=n.apply(t,e||[])).next())})},jh=Tt&&Tt.__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,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(p){return l([c,p])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(p){c=[6,p],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Tt,"__esModule",{value:!0});Tt.base64ToFile=Th;function Th(t,e,r){return Lh(this,void 0,void 0,function(){var n,i;return jh(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 Ra=sn(Dt=>{"use strict";var Pa=Dt&&Dt.__awaiter||function(t,e,r,n){function i(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function u(p){try{c(n.next(p))}catch(m){a(m)}}function l(p){try{c(n.throw(p))}catch(m){a(m)}}function c(p){p.done?s(p.value):i(p.value).then(u,l)}c((n=n.apply(t,e||[])).next())})},Ua=Dt&&Dt.__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,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(c){return function(p){return l([c,p])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(p){c=[6,p],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.blobToBase64=Dh;function Dh(t){return Pa(this,void 0,void 0,function(){return Ua(this,function(e){return[2,typeof FileReader=="function"?Oh(t):Uh(t)]})})}var kr;(function(t){t.error="error",t.loadend="loadend"})(kr||(kr={}));function Oh(t){return Pa(this,void 0,void 0,function(){return Ua(this,function(e){return[2,new Promise(function(r,n){try{var i=new FileReader,s=function(){r(i.result),i.removeEventListener(kr.loadend,s)};i.addEventListener(kr.loadend,s);var a=function(){n(i.error),i.removeEventListener(kr.error,a)};i.addEventListener(kr.error,a),i.readAsDataURL(t)}catch(u){n(u)}})]})})}var Ph="application/octet-stream";function Uh(t){return Pa(this,void 0,void 0,function(){var e,r,n,i;return Ua(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||Ph,[2,"data:".concat(i,";base64,").concat(e.toString("base64"))]}})})}});var B0=sn(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.fileToBase64=void 0;var Rh=Ra();Object.defineProperty(cs,"fileToBase64",{enumerable:!0,get:function(){return Rh.blobToBase64}})});var H0=sn(Re=>{"use strict";var Vh=Re&&Re.__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]})),us=Re&&Re.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Vh(e,t,r)};Object.defineProperty(Re,"__esModule",{value:!0});us(R0(),Re);us(V0(),Re);us(Ra(),Re);us(B0(),Re)});var Ei=globalThis,_i=Ei.ShadowRoot&&(Ei.ShadyCSS===void 0||Ei.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Lo=Symbol(),Zl=new WeakMap,on=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==Lo)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(_i&&e===void 0){let n=r!==void 0&&r.length===1;n&&(e=Zl.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Zl.set(r,e))}return e}toString(){return this.cssText}},Wl=t=>new on(typeof t=="string"?t:t+"",void 0,Lo),H=(t,...e)=>{let r=t.length===1?t[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)+t[s+1]),t[0]);return new on(r,t,Lo)},Gl=(t,e)=>{if(_i)t.adoptedStyleSheets=e.map((r=>r instanceof CSSStyleSheet?r:r.styleSheet));else for(let r of e){let n=document.createElement("style"),i=Ei.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)}},jo=_i?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(let n of e.cssRules)r+=n.cssText;return Wl(r)})(t):t;var{is:n2,defineProperty:i2,getOwnPropertyDescriptor:s2,getOwnPropertyNames:o2,getOwnPropertySymbols:a2,getPrototypeOf:l2}=Object,Mi=globalThis,Jl=Mi.trustedTypes,c2=Jl?Jl.emptyScript:"",u2=Mi.reactiveElementPolyfillSupport,an=(t,e)=>t,To={toAttribute(t,e){switch(e){case Boolean:t=t?c2: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}},Yl=(t,e)=>!n2(t,e),Kl={attribute:!0,type:String,converter:To,reflect:!1,useDefault:!1,hasChanged:Yl};Symbol.metadata??=Symbol("metadata"),Mi.litPropertyMetadata??=new WeakMap;var Fe=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=Kl){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&&i2(this.prototype,e,i)}}static getPropertyDescriptor(e,r,n){let{get:i,set:s}=s2(this.prototype,e)??{get(){return this[r]},set(a){this[r]=a}};return{get:i,set(a){let u=i?.call(this);s?.call(this,a),this.requestUpdate(e,u,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Kl}static _$Ei(){if(this.hasOwnProperty(an("elementProperties")))return;let e=l2(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 r=this.properties,n=[...o2(r),...a2(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(jo(i))}else e!==void 0&&r.push(jo(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 Gl(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:To).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),a=typeof s.converter=="function"?{fromAttribute:s.converter}:s.converter?.fromAttribute!==void 0?s.converter:To;this._$Em=i;let u=a.fromAttribute(r,s.type);this[i]=u??this._$Ej?.get(i)??u,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??Yl)(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},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??r??this[e]),s!==!0||a!==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:a}=s,u=this[i];a!==!0||this._$AL.has(i)||u===void 0||this.C(i,void 0,s,u)}}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){}};Fe.elementStyles=[],Fe.shadowRootOptions={mode:"open"},Fe[an("elementProperties")]=new Map,Fe[an("finalized")]=new Map,u2?.({ReactiveElement:Fe}),(Mi.reactiveElementVersions??=[]).push("2.1.1");var Oo=globalThis,Ai=Oo.trustedTypes,Xl=Ai?Ai.createPolicy("lit-html",{createHTML:t=>t}):void 0,Po="$lit$",Ne=`lit$${Math.random().toFixed(9).slice(2)}$`,Uo="?"+Ne,h2=`<${Uo}>`,bt=document,cn=()=>bt.createComment(""),un=t=>t===null||typeof t!="object"&&typeof t!="function",Ro=Array.isArray,i1=t=>Ro(t)||typeof t?.[Symbol.iterator]=="function",Do=`[
|
|
2
|
+
\f\r]`,ln=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ql=/-->/g,e1=/>/g,yt=RegExp(`>|${Do}(?:([^\\s"'>=/]+)(${Do}*=${Do}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),t1=/'/g,r1=/"/g,s1=/^(?:script|style|textarea|title)$/i,Vo=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),h=Vo(1),Kp=Vo(2),Yp=Vo(3),Ie=Symbol.for("lit-noChange"),Z=Symbol.for("lit-nothing"),n1=new WeakMap,xt=bt.createTreeWalker(bt,129);function o1(t,e){if(!Ro(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return Xl!==void 0?Xl.createHTML(e):e}var a1=(t,e)=>{let r=t.length-1,n=[],i,s=e===2?"<svg>":e===3?"<math>":"",a=ln;for(let u=0;u<r;u++){let l=t[u],c,p,m=-1,v=0;for(;v<l.length&&(a.lastIndex=v,p=a.exec(l),p!==null);)v=a.lastIndex,a===ln?p[1]==="!--"?a=Ql:p[1]!==void 0?a=e1:p[2]!==void 0?(s1.test(p[2])&&(i=RegExp("</"+p[2],"g")),a=yt):p[3]!==void 0&&(a=yt):a===yt?p[0]===">"?(a=i??ln,m=-1):p[1]===void 0?m=-2:(m=a.lastIndex-p[2].length,c=p[1],a=p[3]===void 0?yt:p[3]==='"'?r1:t1):a===r1||a===t1?a=yt:a===Ql||a===e1?a=ln:(a=yt,i=void 0);let b=a===yt&&t[u+1].startsWith("/>")?" ":"";s+=a===ln?l+h2:m>=0?(n.push(c),l.slice(0,m)+Po+l.slice(m)+Ne+b):l+Ne+(m===-2?u:b)}return[o1(t,s+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]},hn=class t{constructor({strings:e,_$litType$:r},n){let i;this.parts=[];let s=0,a=0,u=e.length-1,l=this.parts,[c,p]=a1(e,r);if(this.el=t.createElement(c,n),xt.currentNode=this.el.content,r===2||r===3){let m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(i=xt.nextNode())!==null&&l.length<u;){if(i.nodeType===1){if(i.hasAttributes())for(let m of i.getAttributeNames())if(m.endsWith(Po)){let v=p[a++],b=i.getAttribute(m).split(Ne),S=/([.?@])?(.*)/.exec(v);l.push({type:1,index:s,name:S[2],strings:b,ctor:S[1]==="."?Li:S[1]==="?"?ji:S[1]==="@"?Ti:Ct}),i.removeAttribute(m)}else m.startsWith(Ne)&&(l.push({type:6,index:s}),i.removeAttribute(m));if(s1.test(i.tagName)){let m=i.textContent.split(Ne),v=m.length-1;if(v>0){i.textContent=Ai?Ai.emptyScript:"";for(let b=0;b<v;b++)i.append(m[b],cn()),xt.nextNode(),l.push({type:2,index:++s});i.append(m[v],cn())}}}else if(i.nodeType===8)if(i.data===Uo)l.push({type:2,index:s});else{let m=-1;for(;(m=i.data.indexOf(Ne,m+1))!==-1;)l.push({type:7,index:s}),m+=Ne.length-1}s++}}static createElement(e,r){let n=bt.createElement("template");return n.innerHTML=e,n}};function kt(t,e,r=t,n){if(e===Ie)return e;let i=n!==void 0?r._$Co?.[n]:r._$Cl,s=un(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=kt(t,i._$AS(t,e.values),i,n)),e}var Ii=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??bt).importNode(r,!0);xt.currentNode=i;let s=xt.nextNode(),a=0,u=0,l=n[0];for(;l!==void 0;){if(a===l.index){let c;l.type===2?c=new Qt(s,s.nextSibling,this,e):l.type===1?c=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(c=new Di(s,this,e)),this._$AV.push(c),l=n[++u]}a!==l?.index&&(s=xt.nextNode(),a++)}return xt.currentNode=bt,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++}},Qt=class t{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,r,n,i){this.type=2,this._$AH=Z,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=kt(this,e,r),un(e)?e===Z||e==null||e===""?(this._$AH!==Z&&this._$AR(),this._$AH=Z):e!==this._$AH&&e!==Ie&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):i1(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!==Z&&un(this._$AH)?this._$AA.nextSibling.data=e:this.T(bt.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=hn.createElement(o1(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===i)this._$AH.p(r);else{let s=new Ii(i,this),a=s.u(this.options);s.p(r),this.T(a),this._$AH=s}}_$AC(e){let r=n1.get(e.strings);return r===void 0&&n1.set(e.strings,r=new hn(e)),r}k(e){Ro(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(cn()),this.O(cn()),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))}},Ct=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,n,i,s){this.type=1,this._$AH=Z,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=Z}_$AI(e,r=this,n,i){let s=this.strings,a=!1;if(s===void 0)e=kt(this,e,r,0),a=!un(e)||e!==this._$AH&&e!==Ie,a&&(this._$AH=e);else{let u=e,l,c;for(e=s[0],l=0;l<s.length-1;l++)c=kt(this,u[n+l],r,l),c===Ie&&(c=this._$AH[l]),a||=!un(c)||c!==this._$AH[l],c===Z?e=Z:e!==Z&&(e+=(c??"")+s[l+1]),this._$AH[l]=c}a&&!i&&this.j(e)}j(e){e===Z?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Li=class extends Ct{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Z?void 0:e}},ji=class extends Ct{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==Z)}},Ti=class extends Ct{constructor(e,r,n,i,s){super(e,r,n,i,s),this.type=5}_$AI(e,r=this){if((e=kt(this,e,r,0)??Z)===Ie)return;let n=this._$AH,i=e===Z&&n!==Z||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,s=e!==Z&&(n===Z||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)}},Di=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){kt(this,e)}},l1={M:Po,P:Ne,A:Uo,C:1,L:a1,R:Ii,D:i1,V:kt,I:Qt,H:Ct,N:ji,U:Ti,B:Li,F:Di},p2=Oo.litHtmlPolyfillSupport;p2?.(hn,Qt),(Oo.litHtmlVersions??=[]).push("3.3.1");var c1=(t,e,r)=>{let n=r?.renderBefore??e,i=n._$litPart$;if(i===void 0){let s=r?.renderBefore??null;n._$litPart$=i=new Qt(e.insertBefore(cn(),s),s,void 0,r??{})}return i._$AI(t),i};var Bo=globalThis,$=class extends Fe{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=c1(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Ie}};$._$litElement$=!0,$.finalized=!0,Bo.litElementHydrateSupport?.({LitElement:$});var d2=Bo.litElementPolyfillSupport;d2?.({LitElement:$});(Bo.litElementVersions??=[]).push("4.2.1");var pn=class pn extends HTMLElement{constructor(){super();w(this,"name","");this.attachShadow({mode:"open"})}attributeChangedCallback(r,n,i){if(n!==i&&pn.observedAttributes.includes(r)){switch(r){case"name":this.name=i||"";break}this.render()}}resolveIcon(r){throw new Error("Not implemented")}render(){let r=document.createElement("style");for(r.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(r);if(!this.name)return;let n=this.resolveIcon(this.name);if(!n){console.warn(`'${this.name}' not found, please add it to ${
|
|
8
|
+
`;this.shadowRoot?.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild),this.shadowRoot.appendChild(r);if(!this.name)return;let n=this.resolveIcon(this.name);if(!n){console.warn(`'${this.name}' not found, please add it to ${pn.name}`);return}let a=new DOMParser().parseFromString(n,"image/svg+xml").documentElement;a.setAttribute("fill","currentColor"),a.style.width="100%",a.style.height="100%",this.shadowRoot?.appendChild(a)}};w(pn,"observedAttributes",["name"]);var Oi=pn;var u1={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"/>
|
|
@@ -123,7 +123,7 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
123
123
|
<path d="M2.25 6.75C2.25 15.0343 8.96573 21.75 17.25 21.75H19.5C20.7426 21.75 21.75 20.7426 21.75 19.5V18.1284C21.75 17.6121 21.3987 17.1622 20.8979 17.037L16.4747 15.9312C16.0355 15.8214 15.5734 15.9855 15.3018 16.3476L14.3316 17.6412C14.05 18.0166 13.563 18.1827 13.1223 18.0212C9.81539 16.8098 7.19015 14.1846 5.97876 10.8777C5.81734 10.437 5.98336 9.94998 6.3588 9.6684L7.65242 8.69818C8.01453 8.4266 8.17861 7.96445 8.06883 7.52533L6.96304 3.10215C6.83783 2.60133 6.38785 2.25 5.87163 2.25H4.5C3.25736 2.25 2.25 3.25736 2.25 4.5V6.75Z" stroke="#0F172A" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
|
|
124
124
|
</svg>`,"eye-slash":`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
125
125
|
<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"/>
|
|
126
|
-
</svg>`};var Hu=Gl,_o=class extends _i{resolveIcon(e){let r=Hu[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",_o);var an,de,we,ln,Mo,Mi=class{constructor(e,r){d(this,ln);d(this,an);d(this,de);d(this,we);if(!e)throw new Error("host is required");if(!r)throw new Error("config is required");g(this,an,e),o(this,an).addController(this),g(this,de,r)}connect(e){g(this,de,e),g(this,we,m(this,ln,Mo).call(this))}hostConnected(){o(this,we)||setTimeout(()=>{o(this,we)||g(this,we,m(this,ln,Mo).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,r){o(this,we)?.close(e,r)}get isConnected(){return o(this,we)?.readyState===WebSocket.OPEN}get isConnecting(){return o(this,we)?.readyState===WebSocket.CONNECTING}};an=new WeakMap,de=new WeakMap,we=new WeakMap,ln=new WeakSet,Mo=function(){let e=new WebSocket(o(this,de).url());return o(this,de).onClose&&(e.onclose=o(this,de).onClose),o(this,de).onOpen&&(e.onopen=o(this,de).onOpen),o(this,de).onError&&(e.onerror=o(this,de).onError),o(this,de).onMessage&&(e.onmessage=o(this,de).onMessage),e};var Kl=Array.isArray;var Ao=t=>!!(t&&t.constructor&&t.call&&t.apply);var Jl=t=>!(!t||!t.then||!Ao(t.then));var Io=(t,e,r=!1)=>{if(!t)return[];let n=(s,a)=>e(s)-e(a),i=(s,a)=>e(a)-e(s);return t.slice().sort(r===!0?i:n)};function*cn(t,e,r=i=>i,n=1){let i=Ao(r)?r:()=>r,s=e?t:0,a=e??t;for(let u=s;u<=a&&(yield i(u),!(u+n>a));u+=n);}var Lo=(t,e,r,n)=>Array.from(cn(t,e,r,n));var jo=(t,e)=>t?t.reduce((r,n)=>{let[i,s]=r;return e(n)?[[...i,n],s]:[i,[...s,n]]},[[],[]]):[[],[]];var To=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}},Do=async(t,e,r)=>{let n=e.map((c,p)=>({index:p,item:c})),i=async c=>{let p=[];for(;;){let f=n.pop();if(!f)return c(p);let[v,x]=await un(r)(f.item);p.push({error:v,result:x,index:f.index})}},s=Lo(1,t).map(()=>new Promise(i)),a=await Promise.all(s),[u,l]=jo(Io(a.flat(),c=>c.index),c=>!!c.error);if(u.length>0)throw new To(u.map(c=>c.error));return l.map(c=>c.result)};var Ai=t=>new Promise(e=>setTimeout(e,t)),un=t=>(...e)=>{try{let r=t(...e);return Jl(r)?r.then(n=>[void 0,n]).catch(n=>[n,void 0]):[void 0,r]}catch(r){return[r,void 0]}};async function Xl(t,e){let r=t?.times??3,n=t?.delay,i=t?.backoff??null;for(let s of cn(1,r)){let[a,u]=await un(e)(l=>{throw{_exited:l}});if(!a)return u;if(a._exited)throw a._exited;if(s===r)throw a;n&&await Ai(n),i&&await Ai(i(s))}throw new Error("unreachable")}var zu=!0,Oo="Invariant failed";function fe(t,e){if(!t){if(zu)throw new Error(Oo);var r=typeof e=="function"?e():e,n=r?"".concat(Oo,": ").concat(r):Oo;throw new Error(n)}}var J,re,W,Jt,Xt,Ce,X,Ie,Yl,Ql,e1,t1,Ii=class{constructor(e,r){d(this,X);d(this,J);d(this,re);d(this,W,null);w(this,"isStreaming",!1);w(this,"typingIndicator");w(this,"ranOutOfCredits",!1);w(this,"messages",[]);w(this,"conversationId","");d(this,Jt,0);d(this,Xt);w(this,"isLiveMode",!1);d(this,Ce,[]);g(this,J,e),g(this,re,r),o(this,re).autoConnect!==!1&&g(this,W,this.initWS()),e.addController(this)}get hasQueuedMessages(){return o(this,Ce).length>0}async enqueueMessage(e,{expectStreaming:r=!1}={}){if(o(this,Ce).length>0){let n=o(this,Ce)[o(this,Ce).length-1];if(e.type==="USER_INPUT"&&n.message.type==="USER_INPUT"&&e.value===n.message.value)return!0}return o(this,W)||this.connect(),o(this,W)?.isConnected?m(this,X,Ie).call(this,e,{expectStreaming:r}):(o(this,Ce).push({message:e,options:{expectStreaming:r}}),o(this,J).requestUpdate(),o(this,W)&&!o(this,W).isConnecting&&!o(this,W).isConnected&&this.retry(),await Xl({times:5,delay:2e3},async()=>{if(o(this,W)?.isConnected){let n=[...o(this,Ce)];g(this,Ce,[]),o(this,J).requestUpdate();let i=!1;for(let{message:s,options:a}of n){let u=m(this,X,Ie).call(this,s,a);s===e&&(i=u)}return i}else throw new Error("WebSocket not connected yet")}).catch(()=>(console.warn("Failed to send message after retries",e),g(this,Ce,[]),o(this,J).requestUpdate(),!1)))}sendUserInput(e,{xUserData:r,xCustomInstructions:n,role:i="user",expectStreaming:s=!1,requestInputResponse:a}={}){return m(this,X,Ie).call(this,{type:"USER_INPUT",value:e,role:i,xUserData:r,xCustomInstructions:n,requestInputResponse:a},{expectStreaming:s})}async enqueueUserInput(e,{xUserData:r,xCustomInstructions:n,role:i="user",expectStreaming:s=!1,requestInputResponse:a}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:i,xUserData:r,xCustomInstructions:n,requestInputResponse:a},{expectStreaming:s})}sendImageDelete(e){return fe(e,"imageId is required"),m(this,X,Ie).call(this,{type:"USER_FILE_DELETE",imageId:e})}sendUserCancel(){return m(this,X,Ie).call(this,{type:"USER_CANCEL"})}sendUserTypingStart(){return m(this,X,Ie).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){return m(this,X,Ie).call(this,{type:"USER_TYPING_STOP"})}sendUserMeta(e){return m(this,X,Ie).call(this,{type:"USER_META",metadata:e})}reloadConfig(){m(this,X,Ie).call(this,{type:"RELOAD_CONFIG"})}close(){o(this,W)?.close(1e3,"closed by user")}retry(){clearTimeout(o(this,Xt)),g(this,Xt,setTimeout(()=>{o(this,re).onReconnect?.(),g(this,W,this.initWS())},1e3*o(this,Jt))),Al(this,Jt)._++}initWS(){return new Mi(o(this,J),{url:()=>o(this,re).url(this.conversationId,{}),onOpen:e=>m(this,X,Yl).call(this,e),onMessage:e=>m(this,X,Ql).call(this,JSON.parse(e.data)),onError:e=>m(this,X,e1).call(this,e),onClose:e=>m(this,X,t1).call(this,e)})}hostConnected(){this.conversationId=o(this,re).restoreConversationState?.()?.conversationId||"",this.messages=o(this,re).restoreConversationState?.()?.messages||[]}reset(){m(this,X,Ie).call(this,{type:"NEW_CHAT"}),o(this,re).onReset?.(),this.isStreaming=!1,this.typingIndicator=void 0,this.ranOutOfCredits=!1,this.messages=[],this.conversationId="",this.isLiveMode=!1,g(this,Ce,[]),o(this,J).requestUpdate()}hostDisconnected(){clearTimeout(o(this,Xt))}connect(){o(this,W)||g(this,W,this.initWS())}reconnectSocket(){o(this,W)?.close(1e3,"destroy"),g(this,W,this.initWS())}get lastMsg(){if(this.messages.length>0)return this.messages[this.messages.length-1]}};J=new WeakMap,re=new WeakMap,W=new WeakMap,Jt=new WeakMap,Xt=new WeakMap,Ce=new WeakMap,X=new WeakSet,Ie=function(e,{expectStreaming:r=!1}={}){return this.ranOutOfCredits?!1:o(this,W)?o(this,W).isConnecting?(console.warn("WebSocket is connecting, message not sent",e),!1):o(this,W).isConnected?(r&&!this.isLiveMode&&(this.isStreaming=!0,o(this,J).requestUpdate()),o(this,W).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)},Yl=function(e){g(this,Jt,0)},Ql=function(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,o(this,J).requestUpdate(),o(this,re).onNewMessage?.(e.message);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),o(this,re).onMessageAppend?.(e),o(this,J).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,o(this,J).requestUpdate(),o(this,re).onMessageDone?.(e,r),o(this,re).persistConversationState?.(this.conversationId,this.messages);break}case"MESSAGE_CANCEL":{this.isStreaming=!1,this.typingIndicator=void 0,o(this,J).requestUpdate();break}case"ERROR":{o(this,re).onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,o(this,re).onConnect?.(e.conversationId,e.metadata),o(this,re).persistConversationState?.(e.conversationId,e.messages),this.isLiveMode=e.metadata?.isLiveMode,o(this,J).requestUpdate();break}case"TYPING_START":{e.role==="assistant"&&(this.isStreaming=!0),this.typingIndicator={role:e.role,metadata:e.metadata},o(this,J).requestUpdate();break}case"TYPING_STOP":{this.typingIndicator=void 0,o(this,J).requestUpdate();break}case"RAN_OUT_OF_CREDITS":{this.ranOutOfCredits=!0,o(this,J).requestUpdate();break}case"RECONNECT":{this.reconnectSocket(),o(this,J).requestUpdate();break}default:console.warn(`Unknown message type: ${JSON.stringify(e)}`)}},e1=function(e){console.error("onError",e),o(this,re).onError?.(e)},t1=function(e){o(this,J).isConnected&&o(this,W)&&!o(this,W).isConnected&&e.reason==="reconnect"&&this.retry(),this.isStreaming=!1,this.typingIndicator=void 0,o(this,J).requestUpdate(),o(this,re).onClose?.()};var Vd=Symbol(),Fu=Symbol();var r1=Object.getPrototypeOf,Po=new WeakMap,Nu=t=>t&&(Po.has(t)?Po.get(t):r1(t)===Object.prototype||r1(t)===Array.prototype);var n1=t=>Nu(t)&&t[Fu]||null,Uo=(t,e=!0)=>{Po.set(t,e)};var Vo=t=>typeof t=="object"&&t!==null,qu=t=>Vo(t)&&!Bo.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),o1=(t,e)=>{let r=i1.get(t);if(r?.[0]===e)return r[1];let n=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t));return Uo(n,!0),i1.set(t,[e,n]),Reflect.ownKeys(t).forEach(i=>{if(Object.getOwnPropertyDescriptor(n,i))return;let s=Reflect.get(t,i),{enumerable:a}=Reflect.getOwnPropertyDescriptor(t,i),u={value:s,enumerable:a,configurable:!0};if(Bo.has(s))Uo(s,!1);else if(kt.has(s)){let[l,c]=kt.get(s);u.value=o1(l,c())}Object.defineProperty(n,i,u)}),Object.preventExtensions(n)},Zu=(t,e,r,n)=>({deleteProperty(i,s){let a=Reflect.get(i,s);r(s);let u=Reflect.deleteProperty(i,s);return u&&n(["delete",[s],a]),u},set(i,s,a,u){let l=!t()&&Reflect.has(i,s),c=Reflect.get(i,s,u);if(l&&(s1(c,a)||Li.has(a)&&s1(c,Li.get(a))))return!0;r(s),Vo(a)&&(a=n1(a)||a);let p=!kt.has(a)&&Gu(a)?Ho(a):a;return e(s,p),Reflect.set(i,s,p,u),n(["set",[s],a,c]),!0}}),kt=new WeakMap,Bo=new WeakSet,i1=new WeakMap,Ro=[1],Li=new WeakMap,s1=Object.is,Wu=(t,e)=>new Proxy(t,e),Gu=qu,Ku=o1,Ju=Zu;function Ho(t={}){if(!Vo(t))throw new Error("object required");let e=Li.get(t);if(e)return e;let r=Ro[0],n=new Set,i=(k,M=++Ro[0])=>{r!==M&&(s=r=M,n.forEach(C=>C(k,M)))},s=r,a=(k=Ro[0])=>(s!==k&&(s=k,l.forEach(([M])=>{let C=M[1](k);C>r&&(r=C)})),r),u=k=>(M,C)=>{let _=[...M];_[1]=[k,..._[1]],i(_,C)},l=new Map,c=(k,M)=>{let C=!Bo.has(M)&&kt.get(M);if(C){if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&l.has(k))throw new Error("prop listener already exists");if(n.size){let _=C[2](u(k));l.set(k,[C,_])}else l.set(k,[C])}},p=k=>{var M;let C=l.get(k);C&&(l.delete(k),(M=C[1])==null||M.call(C))},f=k=>(n.add(k),n.size===1&&l.forEach(([C,_],L)=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&_)throw new Error("remove already exists");let F=C[2](u(L));l.set(L,[C,F])}),()=>{n.delete(k),n.size===0&&l.forEach(([C,_],L)=>{_&&(_(),l.set(L,[C]))})}),v=!0,x=Ju(()=>v,c,p,i),S=Wu(t,x);Li.set(t,S);let T=[t,a,f];return kt.set(S,T),Reflect.ownKeys(t).forEach(k=>{let M=Object.getOwnPropertyDescriptor(t,k);"value"in M&&M.writable&&(S[k]=t[k])}),v=!1,S}function ji(t,e,r){let n=kt.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!n&&console.warn("Please use proxy object");let i,s=[],a=n[2],u=!1,c=a(p=>{if(s.push(p),r){e(s.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,u&&e(s.splice(0))}))});return u=!0,()=>{u=!1,c()}}function Yt(t){let e=kt.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!e&&console.warn("Please use proxy object");let[r,n]=e;return Ku(r,n())}var hn,Qt,Ct,er,tr=class{constructor(e,r){d(this,hn);d(this,Qt);d(this,Ct);d(this,er,()=>{});g(this,hn,e),g(this,Qt,r),g(this,Ct,Yt(r)),e.addController(this)}get state(){return o(this,Ct)}get value(){return o(this,Ct)}hostConnected(){o(this,er).call(this),g(this,er,ji(o(this,Qt),()=>{g(this,Ct,Yt(o(this,Qt))),o(this,hn).requestUpdate()}))}hostDisconnected(){o(this,er).call(this)}};hn=new WeakMap,Qt=new WeakMap,Ct=new WeakMap,er=new WeakMap;var pn,dn,$t,rr,Qe=class{constructor(e,r,n){d(this,pn);d(this,dn);w(this,"proxyObject");d(this,$t);d(this,rr,()=>{});g(this,pn,e),g(this,dn,n),this.proxyObject=Ho(r),g(this,$t,Yt(this.proxyObject)),e.addController(this)}get state(){return o(this,$t)}get value(){return o(this,$t)}hostConnected(){o(this,rr).call(this),o(this,dn)?.subscribe&&g(this,rr,ji(this.proxyObject,()=>{g(this,$t,Yt(this.proxyObject)),o(this,pn).requestUpdate()}))}hostDisconnected(){o(this,rr).call(this)}};pn=new WeakMap,dn=new WeakMap,$t=new WeakMap,rr=new WeakMap;var nr,fn,ir,St,Et,Ti=class{constructor(e,{provider:r,tag:n,key:i}){d(this,nr);d(this,fn);d(this,ir);d(this,St,null);d(this,Et,null);g(this,nr,e),g(this,fn,n),g(this,ir,i),e.addController(this)}get value(){return o(this,Et)?o(this,Et).value:null}hostConnected(){if(o(this,Et)||(g(this,St,Xu(o(this,nr),o(this,fn))),!o(this,St)))return;let e=o(this,St)[o(this,ir)]instanceof Qe?o(this,St)[o(this,ir)]:null;e&&g(this,Et,new tr(o(this,nr),e.proxyObject))}hostDisconnected(){}};nr=new WeakMap,fn=new WeakMap,ir=new WeakMap,St=new WeakMap,Et=new WeakMap;function Xu(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 a1=()=>{if(window.Shopify)try{return{customerId:Yu()}}catch{return null}return null},Yu=()=>{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},l1=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 c1(t,e="http"){return t.startsWith("http://")||t.startsWith("https://")?t:`${e}://${t}`}function zo(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 u1(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 h1=()=>{if(window.ShopRenter)try{let t=e2();return{customerEmail:t?.customerEmail,customerId:t?.customerId,customerName:t?.customerName}}catch{return null}return null},e2=()=>{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}}},p1=async()=>{try{let t=window.ShopRenter.shop?.domain;if(!t)return[];let e=c1(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 d1=()=>{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},f1=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 Fo;function No(t){return{lang:t?.lang??Fo?.lang,message:t?.message,abortEarly:t?.abortEarly??Fo?.abortEarly,abortPipeEarly:t?.abortPipeEarly??Fo?.abortPipeEarly}}var n2;function i2(t){return n2?.get(t)}var s2;function o2(t){return s2?.get(t)}var a2;function l2(t,e){return a2?.get(t)?.get(e)}function g1(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 ve(t,e,r,n,i){let s=i&&"input"in i?i.input:r.value,a=i?.expected??t.expects??null,u=i?.received??g1(s),l={kind:t.kind,type:t.type,input:s,expected:a,received:u,message:`Invalid ${e}: ${a?`Expected ${a} but r`:"R"}eceived ${u}`,requirement:t.requirement,path:i?.path,issues:i?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},c=t.kind==="schema",p=i?.message??t.message??l2(t.reference,l.lang)??(c?o2(l.lang):null)??n.message??i2(l.lang);p!==void 0&&(l.message=typeof p=="function"?p(l):p),c&&(r.typed=!1),r.issues?r.issues.push(l):r.issues=[l]}function ye(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},No())}}}function c2(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function w1(t,e){let r=[...new Set(t)];return r.length>1?`(${r.join(` ${e} `)})`:r[0]??"never"}var u2=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function qo(t,e){return{kind:"validation",type:"max_length",reference:qo,async:!1,expects:`<=${t}`,requirement:t,message:e,"~run"(r,n){return r.typed&&r.value.length>this.requirement&&ve(this,"length",r,n,{received:`${r.value.length}`}),r}}}function Zo(t,e){return{kind:"validation",type:"min_length",reference:Zo,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(r,n){return r.typed&&r.value.length<this.requirement&&ve(this,"length",r,n,{received:`${r.value.length}`}),r}}}function h2(t,e,r){return typeof t.fallback=="function"?t.fallback(e,r):t.fallback}function v1(t,e,r){return typeof t.default=="function"?t.default(e,r):t.default}function Wo(){return{kind:"schema",type:"any",reference:Wo,expects:"any",async:!1,get"~standard"(){return ye(this)},"~run"(t){return t.typed=!0,t}}}function sr(t,e){return{kind:"schema",type:"array",reference:sr,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return ye(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 a=i[s],u=this.item["~run"]({value:a},n);if(u.issues){let l={type:"array",origin:"value",input:i,key:s,value:a};for(let c of u.issues)c.path?c.path.unshift(l):c.path=[l],r.issues?.push(c);if(r.issues||(r.issues=u.issues),n.abortEarly){r.typed=!1;break}}u.typed||(r.typed=!1),r.value.push(u.value)}}else ve(this,"type",r,n);return r}}}function Go(t){return{kind:"schema",type:"boolean",reference:Go,expects:"boolean",async:!1,message:t,get"~standard"(){return ye(this)},"~run"(e,r){return typeof e.value=="boolean"?e.typed=!0:ve(this,"type",e,r),e}}}function Ko(t){return{kind:"schema",type:"null",reference:Ko,expects:"null",async:!1,message:t,get"~standard"(){return ye(this)},"~run"(e,r){return e.value===null?e.typed=!0:ve(this,"type",e,r),e}}}function Di(t){return{kind:"schema",type:"number",reference:Di,expects:"number",async:!1,message:t,get"~standard"(){return ye(this)},"~run"(e,r){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:ve(this,"type",e,r),e}}}function qe(t,e){return{kind:"schema",type:"object",reference:qe,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return ye(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 a=this.entries[s];if(s in i||(a.type==="exact_optional"||a.type==="optional"||a.type==="nullish")&&a.default!==void 0){let u=s in i?i[s]:v1(a),l=a["~run"]({value:u},n);if(l.issues){let c={type:"object",origin:"value",input:i,key:s,value:u};for(let p of l.issues)p.path?p.path.unshift(c):p.path=[c],r.issues?.push(p);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(a.fallback!==void 0)r.value[s]=h2(a);else if(a.type!=="exact_optional"&&a.type!=="optional"&&a.type!=="nullish"&&(ve(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 ve(this,"type",r,n);return r}}}function or(t,e){return{kind:"schema",type:"optional",reference:or,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return ye(this)},"~run"(r,n){return r.value===void 0&&(this.default!==void 0&&(r.value=v1(this,r,n)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,n)}}}function Jo(t,e){return{kind:"schema",type:"picklist",reference:Jo,expects:w1(t.map(g1),"|"),async:!1,options:t,message:e,get"~standard"(){return ye(this)},"~run"(r,n){return this.options.includes(r.value)?r.typed=!0:ve(this,"type",r,n),r}}}function Oi(t,e,r){return{kind:"schema",type:"record",reference:Oi,expects:"Object",async:!1,key:t,value:e,message:r,get"~standard"(){return ye(this)},"~run"(n,i){let s=n.value;if(s&&typeof s=="object"){n.typed=!0,n.value={};for(let a in s)if(c2(s,a)){let u=s[a],l=this.key["~run"]({value:a},i);if(l.issues){let p={type:"object",origin:"key",input:s,key:a,value:u};for(let f of l.issues)f.path=[p],n.issues?.push(f);if(n.issues||(n.issues=l.issues),i.abortEarly){n.typed=!1;break}}let c=this.value["~run"]({value:u},i);if(c.issues){let p={type:"object",origin:"value",input:s,key:a,value:u};for(let f of c.issues)f.path?f.path.unshift(p):f.path=[p],n.issues?.push(f);if(n.issues||(n.issues=c.issues),i.abortEarly){n.typed=!1;break}}(!l.typed||!c.typed)&&(n.typed=!1),l.typed&&(n.value[l.value]=c.value)}}else ve(this,"type",n,i);return n}}}function Q(t){return{kind:"schema",type:"string",reference:Q,expects:"string",async:!1,message:t,get"~standard"(){return ye(this)},"~run"(e,r){return typeof e.value=="string"?e.typed=!0:ve(this,"type",e,r),e}}}function m1(t){let e;if(t)for(let r of t)e?e.push(...r.issues):e=r.issues;return e}function ar(t,e){return{kind:"schema",type:"union",reference:ar,expects:w1(t.map(r=>r.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return ye(this)},"~run"(r,n){let i,s,a;for(let u of this.options){let l=u["~run"]({value:r.value},n);if(l.typed)if(l.issues)s?s.push(l):s=[l];else{i=l;break}else a?a.push(l):a=[l]}if(i)return i;if(s){if(s.length===1)return s[0];ve(this,"type",r,n,{issues:m1(s)}),r.typed=!0}else{if(a?.length===1)return a[0];ve(this,"type",r,n,{issues:m1(a)})}return r}}}function y1(t,e,r){let n=t["~run"]({value:e},No(r));if(n.issues)throw new u2(n.issues);return n.value}function b1(t,e){let r={};for(let n in t.entries)r[n]=!e||e.includes(n)?or(t.entries[n]):t.entries[n];return{...t,entries:r,get"~standard"(){return ye(this)}}}function x1(...t){return{...t[0],pipe:t,get"~standard"(){return ye(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 mn(t,e,r){let n=t["~run"]({value:e},No(r));return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}var k1=Oi(Q(),ar([Q(),Di(),Go(),Ko()])),C1=x1(Q(),Zo(1),qo(5e3)),$1=()=>{try{return window.UNAS?d1():window.Shopify?a1():window.ShopRenter?h1():null}catch{return null}},S1=async()=>{try{return window.UNAS?await f1():window.Shopify?await l1():window.ShopRenter?await p1():[]}catch{return[]}},lr={schema:qe({conversationId:or(Q()),messages:or(sr(qe({id:Q(),timestamp:Di(),role:Jo(["user","assistant","support"]),content:Q(),parts:or(sr(ar([qe({text:Q()}),qe({html:Q()}),qe({tag:Q(),data:Oi(Q(),Wo())})])))})))}),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=y1(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 P,E1,gn,wn,cr,V,_1,Ui=class Ui extends ${constructor(){super();d(this,P);w(this,"contextCtrl");d(this,gn);d(this,wn);d(this,cr,null);this.widgetId="",this.config={},this.callbacks={},this.xUserData=void 0,this.xCustomInstructions=void 0,this.autoConnect=!1,this.contextCtrl=new Qe(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,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,P,V).sendImageDelete.bind(o(this,P,V))})}connectedCallback(){super.connectedCallback(),this.updated()}updated(){this.autoConnect&&o(this,P,V).connect(),Object.assign(this.contextCtrl.proxyObject,{widgetId:this.widgetId,config:this.config,callbacks:this.callbacks,xUserData:o(this,gn),xCustomInstructions:o(this,wn),conversationId:o(this,P,V).conversationId,messages:o(this,P,E1),isStreaming:o(this,P,V).isStreaming,typingIndicator:o(this,P,V).typingIndicator,ranOutOfCredits:o(this,P,V).ranOutOfCredits,isLiveMode:o(this,P,V).isLiveMode,lastMsg:o(this,P,V).lastMsg,hasQueuedMessages:o(this,P,V).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,P,V).sendImageDelete.bind(o(this,P,V))}),m(this,P,_1).call(this)}sendUserInput(r,n={}){let i={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,...n},s=o(this,P,V).sendUserInput(r,i);return s&&this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:r,example:!1,conversationId:o(this,P,V).conversationId}),s}async enqueueUserInput(r,n={}){let i={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,role:"user",expectStreaming:!0,...n};return o(this,P,V).enqueueUserInput(r,i)}sendUserCancel(){o(this,P,V).sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}sendUserTypingStart(){o(this,P,V).sendUserTypingStart()}sendUserTypingStop(){o(this,P,V).sendUserTypingStop()}reset(){o(this,P,V).reset()}reloadConfig(){o(this,P,V).reloadConfig()}connect(){o(this,P,V).connect()}render(){return h`<slot></slot>`}};P=new WeakSet,E1=function(){return o(this,P,V)?.ranOutOfCredits?[{id:crypto.randomUUID(),role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}]:o(this,P,V)?.messages||[]},gn=new WeakMap,wn=new WeakMap,cr=new WeakMap,V=function(){return o(this,cr)||g(this,cr,new Ii(this,{autoConnect:this.autoConnect,url:r=>{let n=new URL(this.config.wsApiUrl);return n.searchParams.set("widgetId",this.widgetId),n.searchParams.set("conversationId",r),n.searchParams.set("pageUrl",window.location.href),n},onReconnect:()=>{},onError:r=>{console.error("ws error",r)},onClose:()=>{},onNewMessage:r=>{r.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:r,conversationId:o(this,P,V).conversationId})},onMessageAppend:r=>{},onMessageDone:(r,n)=>{n.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:n.content??"",message:n,usage_TOKENS_COMPLETION:r.message.usage.TOKENS_COMPLETION,conversationId:o(this,P,V).conversationId})},onMessageError:r=>{console.error("ws message error",r),r.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+r.message})},onReset:()=>{lr.reset(this.widgetId)},onConnect:(r,n)=>{let i=$1();o(this,P,V).sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,language:window.navigator.language,cart:[]}),S1().then(s=>{s?.length>0&&o(this,P,V).sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,cart:s,language:window.navigator.language})}).catch(s=>{console.error(s)}),this.dispatchEvent(new Ui.ConnectedEvent({conversationId:r,metadata:n,widgetId:this.widgetId,pendingImages:n?.pendingImages||[]}))},persistConversationState:(r,n)=>{lr.persist(this.widgetId,r,n)},restoreConversationState:()=>lr.restore(this.widgetId)})),o(this,cr)},_1=function(){function r(i){if(!i)return;let s;try{s=typeof i=="object"?i:JSON.parse(i)}catch(u){console.error("Molin: user-data is not valid JSON",u);return}if(!s||typeof s!="object"||Object.keys(s).length===0)return;let a=mn(k1,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=mn(C1,i);if(!s.success){console.error("Molin: custom-instructions does not pass schema validation",s.issues);return}return s.output}g(this,gn,r(this.xUserData)),g(this,wn,n(this.xCustomInstructions))},w(Ui,"properties",{widgetId:{type:String},config:{type:Object},callbacks:{type:Object},xUserData:{type:Object},xCustomInstructions:{type:Object},autoConnect:{type:Boolean}});var ur=Ui;function M1(t){let e=new Ti(t,{provider:ur,tag:"mw-context-widget",key:"contextCtrl"});return new Proxy({value:null},{get(r,n){if(n==="value")return e.value}})}var Xo;ur.ConnectedEvent=(Xo=class extends CustomEvent{constructor(e,r={}){super(ur.ConnectedEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}},w(Xo,"type","mw-context-widget:connected"),Xo);customElements.get("mw-context-widget")||customElements.define("mw-context-widget",ur);function aa(t){return[...t.v,(t.i?"!":"")+t.n].join(":")}function p2(t,e=","){return t.map(aa).join(e)}var O1=typeof CSS<"u"&&CSS.escape||(t=>t.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function Ri(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 Hi(t,e="@media "){return e+B(t).map(r=>(typeof r=="string"&&(r={min:r}),r.raw||Object.keys(r).map(n=>`(${n}-width:${r[n]})`).join(" and "))).join(",")}function B(t=[]){return Array.isArray(t)?t:t==null?[]:[t]}function A1(t){return t}function zi(){}var ne={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function P1(t){return t.match(/[-=:;]/g)?.length||0}function ra(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(P1(t),15)<<18}var d2=["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 la({n:t,i:e,v:r=[]},n,i,s){t&&(t=aa({n:t,i:e,v:r})),s=[...B(s)];for(let u of r){let l=n.theme("screens",u);for(let c of B(l&&Hi(l)||n.v(u))){var a;s.push(c),i|=l?67108864|ra(c):u=="dark"?1073741824:c[0]=="@"?ra(c):(a=c,1<<~(/:([a-z-]+)/.test(a)&&~d2.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:t,p:i,r:s,i:e}}var U1=new Map;function na(t){if(t.d){let e=[],r=Yo(t.r.reduce((n,i)=>i[0]=="@"?(e.push(i),n):i?Yo(n,s=>Yo(i,a=>{let u=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(a);if(u){let l=s.indexOf(u[1]);return~l?s.slice(0,l)+u[0]+s.slice(l+u[1].length):Qo(s,a)}return Qo(a,s)})):n,"&"),n=>Qo(n,t.n?"."+O1(t.n):""));return r&&e.push(r.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((n,i)=>i+"{"+n+"}",t.d)}}function Yo(t,e){return t.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(r,n,i)=>e(n)+i)}function Qo(t,e){return t.replace(/&/g,e)}var I1=new Intl.Collator("en",{numeric:!0});function R1(t,e){for(var r=0,n=t.length;r<n;){let i=n+r>>1;0>=V1(t[i],e)?r=i+1:n=i}return n}function V1(t,e){let r=t.p&ne.o;return r==(e.p&ne.o)&&(r==ne.b||r==ne.o)?0:t.p-e.p||t.o-e.o||I1.compare(L1(t.n),L1(e.n))||I1.compare(j1(t.n),j1(e.n))}function L1(t){return(t||"").split(/:/).pop().split("/").pop()||"\0"}function j1(t){return(t||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function ea(t,e){return Math.round(parseInt(t,16)*e)}function $e(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,a=[17,1,.062272][s-1];return`rgba(${[ea(t.substr(1,s),a),ea(t.substr(1+s,s),a),ea(t.substr(1+2*s,s),a),i]})`}return i=="1"?t:i=="0"?"#0000":t.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${i})`)}function B1(t,e,r,n,i=[]){return(function s(a,{n:u,p:l,r:c=[],i:p},f){let v=[],x="",S=0,T=0;for(let C in a||{}){var k,M;let _=a[C];if(C[0]=="@"){if(!_)continue;if(C[1]=="a"){v.push(...ua(u,l,Bi(""+_),f,l,c,p,!0));continue}if(C[1]=="l"){for(let L of B(_))v.push(...s(L,{n:u,p:(k=ne[C[7]],l&~ne.o|k),r:C[7]=="d"?[]:c,i:p},f));continue}if(C[1]=="i"){v.push(...B(_).map(L=>({p:-1,o:0,r:[],d:C+" "+L})));continue}if(C[1]=="k"){v.push({p:ne.d,o:0,r:[C],d:s(_,{p:ne.d},f).map(na).join("")});continue}if(C[1]=="f"){v.push(...B(_).map(L=>({p:ne.d,o:0,r:[C],d:s(L,{p:ne.d},f).map(na).join("")})));continue}}if(typeof _!="object"||Array.isArray(_))C=="label"&&_?u=_+Ri(JSON.stringify([l,p,a])):(_||_===0)&&(C=C.replace(/[A-Z]/g,L=>"-"+L.toLowerCase()),T+=1,S=Math.max(S,(M=C)[0]=="-"?0:P1(M)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(M)?+!!RegExp.$1||-!!RegExp.$2:0)+1),x+=(x?";":"")+B(_).map(L=>f.s(C,ca(""+L,f.theme)+(p?" !important":""))).join(";"));else if(C[0]=="@"||C.includes("&")){let L=l;C[0]=="@"&&(C=C.replace(/\bscreen\(([^)]+)\)/g,(F,te)=>{let se=f.theme("screens",te);return se?(L|=67108864,Hi(se,"")):F}),L|=ra(C)),v.push(...s(_,{n:u,p:L,r:[...c,C],i:p},f))}else v.push(...s(_,{p:l,r:[...c,C]},f))}return v.unshift({n:u,p:l,o:Math.max(0,15-T)+1.5*Math.min(S||15,15),r:c,d:x}),v.sort(V1)})(t,la(e,r,n,i),r)}function ca(t,e){return t.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(r,n,i,s,a="")=>{let u=e(i,a);return typeof u=="function"&&/color|fill|stroke/i.test(i)?$e(u):""+B(u).filter(l=>Object(l)!==l)})}function H1(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 Vi(t,e,r=ne.u,n,i){let s=[];for(let a of t)for(let u of(function(l,c,p,f,v){l={...l,i:l.i||v};let x=(function(S,T){let k=U1.get(S.n);return k?k(S,T):T.r(S.n,S.v[0]=="dark")})(l,c);return x?typeof x=="string"?({r:f,p}=la(l,c,p,f),H1(Vi(Bi(x),c,p,f,l.i),l.n)):Array.isArray(x)?x.map(S=>{var T,k;return{o:0,...S,r:[...B(f),...B(S.r)],p:(T=p,k=S.p??p,T&~ne.o|k)}}):B1(x,l,c,p,f):[{c:aa(l),p:0,o:0,r:[]}]})(a,e,r,n,i))s.splice(R1(s,u),0,u);return s}function ua(t,e,r,n,i,s,a,u){return H1((u?r.flatMap(l=>Vi([l],n,i,s,a)):Vi(r,n,i,s,a)).map(l=>l.p&ne.o&&(l.n||e==ne.b)?{...l,p:l.p&~ne.o|e,o:0}:l),t)}function f2(t,e,r,n){var i;return i=(s,a)=>{let{n:u,p:l,r:c,i:p}=la(s,a,e);return r&&ua(u,e,r,a,l,c,p,n)},U1.set(t,i),t}function ta(t,e,r){if(t[t.length-1]!="("){let n=[],i=!1,s=!1,a="";for(let u of t)if(!(u=="("||/[~@]$/.test(u))){if(u[0]=="!"&&(u=u.slice(1),i=!i),u.endsWith(":")){n[u=="dark:"?"unshift":"push"](u.slice(0,-1));continue}u[0]=="-"&&(u=u.slice(1),s=!s),u.endsWith("-")&&(u=u.slice(0,-1)),u&&u!="&"&&(a+=(a&&"-")+u)}a&&(s&&(a="-"+a),e[0].push({n:a,v:n.filter(m2),i}))}}function m2(t,e,r){return r.indexOf(t)==e}var T1=new Map;function Bi(t){let e=T1.get(t);if(!e){let r=[],n=[[]],i=0,s=0,a=null,u=0,l=(c,p=0)=>{i!=u&&(r.push(t.slice(i,u+p)),c&&ta(r,n)),i=u+1};for(;u<t.length;u++){let c=t[u];if(s)t[u-1]!="\\"&&(s+=+(c=="[")||-(c=="]"));else if(c=="[")s+=1;else if(a)t[u-1]!="\\"&&a.test(t.slice(u))&&(a=null,i=u+RegExp.lastMatch.length);else if(c=="/"&&t[u-1]!="\\"&&(t[u+1]=="*"||t[u+1]=="/"))a=t[u+1]=="*"?/^\*\//:/^[\r\n]/;else if(c=="(")l(),r.push(c);else if(c==":")t[u+1]!=":"&&l(!1,1);else if(/[\s,)]/.test(c)){l(!0);let p=r.lastIndexOf("(");if(c==")"){let f=r[p-1];if(/[~@]$/.test(f)){let v=n.shift();r.length=p,ta([...r,"#"],n);let{v:x}=n[0].pop();for(let S of v)S.v.splice(+(S.v[0]=="dark")-+(x[0]=="dark"),x.length);ta([...r,f2(f.length>1?f.slice(0,-1)+Ri(JSON.stringify([f,v])):f+"("+p2(v)+")",ne.a,v,/@$/.test(f))],n)}p=r.lastIndexOf("(",p-1)}r.length=p+1}else/[~@]/.test(c)&&t[u+1]=="("&&n.unshift([])}l(!0),T1.set(t,e=n[0])}return e}function y(t,e,r){return[t,ia(e,r)]}function ia(t,e){return typeof t=="function"?t:typeof t=="string"&&/^[\w-]+$/.test(t)?(r,n)=>({[t]:e?e(r,n):sa(r,1)}):r=>t||{[r[1]]:sa(r,2)}}function sa(t,e,r=t.slice(e).find(Boolean)||t.$$||t.input){return t.input[0]=="-"?`calc(${r} * -1)`:r}function b(t,e,r,n){return[t,ha(e,r,n)]}function ha(t,e,r){let n=typeof e=="string"?(i,s)=>({[e]:r?r(i,s):i._}):e||(({1:i,_:s},a,u)=>({[i||u]:s}));return(i,s)=>{let a=z1(t||i[1]),u=s.theme(a,i.$$)??Pe(i.$$,a,s);if(u!=null)return i._=sa(i,0,u),n(i,s,a)}}function ie(t,e={},r){return[t,g2(e,r)]}function g2(t={},e){return(r,n)=>{let{section:i=z1(r[0]).replace("-","")+"Color"}=t,[s,a]=w2(r.$$);if(!s)return;let u=n.theme(i,s)||Pe(s,i,n);if(!u||typeof u=="object")return;let{opacityVariable:l=`--tw-${r[0].replace(/-$/,"")}-opacity`,opacitySection:c=i.replace("Color","Opacity"),property:p=i,selector:f}=t,v=n.theme(c,a||"DEFAULT")||a&&Pe(a,c,n),x=e||(({_:T})=>{let k=vn(p,T);return f?{[f]:k}:k});r._={value:$e(u,{opacityVariable:l||void 0,opacityValue:v||void 0}),color:T=>$e(u,T),opacityVariable:l||void 0,opacityValue:v||void 0};let S=x(r,n);if(!r.dark){let T=n.d(i,s,u);T&&T!==u&&(r._={value:$e(T,{opacityVariable:l||void 0,opacityValue:v||"1"}),color:k=>$e(T,k),opacityVariable:l||void 0,opacityValue:v||void 0},S={"&":S,[n.v("dark")]:x(r,n)})}return S}}function w2(t){return(t.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function vn(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 Pe(t,e,r){if(t[0]=="["&&t.slice(-1)=="]"){if(t=hr(ca(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 z1(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function hr(t){return t.includes("url(")?t.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,r="",n,i="")=>hr(r)+n+hr(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 yn({presets:t=[],...e}){let r={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:B(e.variants),rules:B(e.rules),ignorelist:B(e.ignorelist),hash:void 0,stringify:(n,i)=>n+":"+i,finalize:[]};for(let n of B([...t,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&B(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:i,darkMode:s=r.darkMode,darkColor:a=r.darkColor,theme:u,variants:l,rules:c,ignorelist:p,hash:f=r.hash,stringify:v=r.stringify,finalize:x}=typeof n=="function"?n(r):n;r={preflight:r.preflight!==!1&&i!==!1&&[...r.preflight,...B(i)],darkMode:s,darkColor:a,theme:{...r.theme,...u,extend:{...r.theme.extend,...u?.extend}},variants:[...r.variants,...B(l)],rules:[...r.rules,...B(c)],ignorelist:[...r.ignorelist,...B(p)],hash:f,stringify:v,finalize:[...r.finalize,...B(x)]}}return r}function D1(t,e,r,n,i,s){for(let a of e){let u=r.get(a);u||r.set(a,u=n(a));let l=u(t,i,s);if(l)return l}}function v2(t){var e;return oa(t[0],typeof(e=t[1])=="function"?e:()=>e)}function y2(t){var e,r;return Array.isArray(t)?oa(t[0],ia(t[1],t[2])):oa(t,ia(e,r))}function oa(t,e){return F1(t,(r,n,i,s)=>{let a=n.exec(r);if(a)return a.$$=r.slice(a[0].length),a.dark=s,e(a,i)})}function F1(t,e){let r=B(t).map(b2);return(n,i,s)=>{for(let a of r){let u=e(n,a,i,s);if(u)return u}}}function b2(t){return typeof t=="string"?RegExp("^"+t+(t.includes("$")||t.slice(-1)=="-"?"":"$")):t}function N1(t,e){let r=yn(t),n=(function({theme:l,darkMode:c,darkColor:p=zi,variants:f,rules:v,hash:x,stringify:S,ignorelist:T,finalize:k}){let M=new Map,C=new Map,_=new Map,L=new Map,F=F1(T,(R,oe)=>oe.test(R));f.push(["dark",Array.isArray(c)||c=="class"?`${B(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let te=typeof x=="function"?R=>x(R,Ri):x?Ri:A1;te!==A1&&k.push(R=>({...R,n:R.n&&te(R.n),d:R.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(oe,pe)=>"--"+te(pe).replace("#",""))}));let se={theme:(function({extend:R={},...oe}){let pe={},fo={get colors(){return ft("colors")},theme:ft,negative(){return{}},breakpoints(G){let ae={};for(let ge in G)typeof G[ge]=="string"&&(ae["screen-"+ge]=G[ge]);return ae}};return ft;function ft(G,ae,ge,Kr){if(G){if({1:G,2:Kr}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(G)||[,G],/[.[]/.test(G)){let ze=[];G.replace(/\[([^\]]+)\]|([^.[]+)/g,(gt,Xr,xu=Xr)=>ze.push(xu)),G=ze.shift(),ge=ae,ae=ze.join("-")}let Oe=pe[G]||Object.assign(Object.assign(pe[G]={},wi(oe,G)),wi(R,G));if(ae==null)return Oe;ae||(ae="DEFAULT");let mt=Oe[ae]??ae.split("-").reduce((ze,gt)=>ze?.[gt],Oe)??ge;return Kr?$e(mt,{opacityValue:ca(Kr,ft)}):mt}let Jr={};for(let Oe of[...Object.keys(oe),...Object.keys(R)])Jr[Oe]=ft(Oe);return Jr}function wi(G,ae){let ge=G[ae];return typeof ge=="function"&&(ge=ge(fo)),ge&&/color|fill|stroke/i.test(ae)?(function Kr(Jr,Oe=[]){let mt={};for(let ze in Jr){let gt=Jr[ze],Xr=[...Oe,ze];mt[Xr.join("-")]=gt,ze=="DEFAULT"&&(Xr=Oe,mt[Oe.join("-")]=gt),typeof gt=="object"&&Object.assign(mt,Kr(gt,Xr))}return mt})(ge):ge}})(l),e:O1,h:te,s(R,oe){return S(R,oe,se)},d(R,oe,pe){return p(R,oe,se,pe)},v(R){return M.has(R)||M.set(R,D1(R,f,C,v2,se)||"&:"+R),M.get(R)},r(R,oe){let pe=JSON.stringify([R,oe]);return _.has(pe)||_.set(pe,!F(R,se)&&D1(R,v,L,y2,se,oe)),_.get(pe)},f(R){return k.reduce((oe,pe)=>pe(oe,se),R)}};return se})(r),i=new Map,s=[],a=new Set;e.resume(l=>i.set(l,l),(l,c)=>{e.insert(l,s.length,c),s.push(c),a.add(l)});function u(l){let c=n.f(l),p=na(c);if(p&&!a.has(p)){a.add(p);let f=R1(s,l);e.insert(p,f,l),s.splice(f,0,l)}return c.n}return Object.defineProperties(function(c){if(!i.size)for(let f of B(r.preflight))typeof f=="function"&&(f=f(n)),f&&(typeof f=="string"?ua("",ne.b,Bi(f),n,ne.b,[],!1,!0):B1(f,{},n,ne.b)).forEach(u);c=""+c;let p=i.get(c);if(!p){let f=new Set;for(let v of Vi(Bi(c),n))f.add(v.c).add(u(v));p=[...f].filter(Boolean).join(" "),i.set(c,p).set(p,p)}return p},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:n.theme,config:r,snapshot(){let l=e.snapshot(),c=new Set(a),p=new Map(i),f=[...s];return()=>{l(),a=c,i=p,s=f}},clear(){e.clear(),a=new Set,i=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function x2(t,e){return t!=e&&""+t.split(" ").sort()!=""+e.split(" ").sort()}function q1(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:a}of i)if(s[0]=="a")n(a);else for(let u of a.querySelectorAll("[class]"))n(u);e.takeRecords()}function n(i){let s,a=i.getAttribute?.("class");a&&x2(a,s=t(a))&&i.setAttribute("class",s)}}function k2(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 Fi(t){let e=t?.cssRules?t:(t&&typeof t!="string"?t:k2(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:zi}}var C2=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 Z1(t){return C2.get(t)}function W1(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 G1(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 $2=[["-webkit-",1],["-moz-",2],["-ms-",4]];function Ni(){return({stringify:t})=>({stringify(e,r,n){let i="",s=Z1(e);s&&(i+=t(s,r,n)+";");let a=W1(e),u=G1(e,r);for(let l of $2)a&l[1]&&(i+=t(l[0]+e,r,n)+";"),u&l[1]&&(i+=t(e,l[0]+r,n)+";");return i+t(e,r,n)}})}function qi(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",ha("lineClamp",({_:t})=>K1(t))],["line-clamp-(\\d+)",({1:t})=>K1(t)]]}}function K1(t){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${t}`}}var xn={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:U("blur"),backdropBrightness:U("brightness"),backdropContrast:U("contrast"),backdropGrayscale:U("grayscale"),backdropHueRotate:U("hueRotate"),backdropInvert:U("invert"),backdropOpacity:U("opacity"),backdropSaturate:U("saturate"),backdropSepia:U("sepia"),backgroundColor:U("colors"),backgroundImage:{none:"none"},backgroundOpacity:U("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:t})=>({DEFAULT:t("colors.gray.200","currentColor"),...t("colors")}),borderOpacity:U("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:U("spacing"),borderWidth:{DEFAULT:"1px",...Se(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:U("colors"),caretColor:U("colors"),accentColor:({theme:t})=>({auto:"auto",...t("colors")}),contrast:{...be(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:U("borderColor"),divideOpacity:U("borderOpacity"),divideWidth:U("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"),...bn(2,6),...bn(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:U("spacing"),gradientColorStops:U("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"),...bn(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:t})=>({...t("spacing"),...bn(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: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:{...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:U("spacing"),placeholderColor:U("colors"),placeholderOpacity:U("opacity"),outlineColor:U("colors"),outlineOffset:Se(8,"px"),outlineWidth:Se(8,"px"),ringColor:({theme:t})=>({...t("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:U("colors"),ringOffsetWidth:Se(8,"px"),ringOpacity:({theme:t})=>({...t("opacity"),DEFAULT:"0.5"}),ringWidth:{DEFAULT:"3px",...Se(8,"px")},rotate:{...Se(2,"deg"),...Se(12,"deg",3),...Se(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:U("spacing"),scrollPadding:U("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...Se(2,"deg"),...Se(12,"deg",3)},space:U("spacing"),stroke:({theme:t})=>({...t("colors"),none:"none"}),strokeWidth:be(2),textColor:U("colors"),textDecorationColor:U("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...Se(8,"px")},textUnderlineOffset:{auto:"auto",...Se(8,"px")},textIndent:U("spacing"),textOpacity:U("opacity"),transitionDuration:({theme:t})=>({...t("durations"),DEFAULT:"150ms"}),transitionDelay:U("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"),...bn(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:{...be(50,"",1,0,10),auto:"auto"}};function bn(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 Se(t,e,r=0){let n={};for(;r<=t;r=2*r||1)n[r]=r+e;return n}function be(t,e="",r=1,n=0,i=1,s={}){for(;n<=t;n+=i)s[n]=n/r+e;return s}function U(t){return({theme:e})=>e(t)}var J1={"*,::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, ${xn.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, ${xn.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 r0=[y("\\[([-\\w]+):(.+)]",({1:t,2:e},r)=>({"@layer overrides":{"&":{[t]:Pe(`[${e}]`,"",r)}}})),y("(group|peer)([~/][^-[]+)?",({input:t},{h:e})=>[{c:e(t)}]),b("aspect-","aspectRatio"),y("container",(t,{theme:e})=>{let{screens:r=e("screens"),center:n,padding:i}=e("container"),s={width:"100%",marginRight:n&&"auto",marginLeft:n&&"auto",...a("xs")};for(let u in r){let l=r[u];typeof l=="string"&&(s[Hi(l)]={"&":{maxWidth:l,...a(u)}})}return s;function a(u){let l=i&&(typeof i=="string"?i:i[u]||i.DEFAULT);if(l)return{paddingRight:l,paddingLeft:l}}}),b("content-","content",({_:t})=>({"--tw-content":t,content:"var(--tw-content)"})),y("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),y("box-(border|content)","boxSizing",({1:t})=>t+"-box"),y("hidden",{display:"none"}),y("table-(auto|fixed)","tableLayout"),y(["(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)",y("isolate","isolation"),y("object-(contain|cover|fill|none|scale-down)","objectFit"),b("object-","objectPosition"),y("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",Zi),y("overscroll(-[xy])?-(auto|contain|none)",({1:t="",2:e})=>({["overscroll-behavior"+t]:e})),y("(static|fixed|absolute|relative|sticky)","position"),b("-?inset(-[xy])?(?:$|-)","inset",({1:t,_:e})=>({top:t!="-x"&&e,right:t!="-y"&&e,bottom:t!="-x"&&e,left:t!="-y"&&e})),b("-?(top|bottom|left|right)(?:$|-)","inset"),y("(visible|collapse)","visibility"),y("invisible",{visibility:"hidden"}),b("-?z-","zIndex"),y("flex-((row|col)(-reverse)?)","flexDirection",X1),y("flex-(wrap|wrap-reverse|nowrap)","flexWrap"),b("(flex-(?:grow|shrink))(?:$|-)"),b("(flex)-"),b("grow(?:$|-)","flexGrow"),b("shrink(?:$|-)","flexShrink"),b("basis-","flexBasis"),b("-?(order)-"),"-?(order)-(\\d+)",b("grid-cols-","gridTemplateColumns"),y("grid-cols-(\\d+)","gridTemplateColumns",t0),b("col-","gridColumn"),y("col-(span)-(\\d+)","gridColumn",e0),b("col-start-","gridColumnStart"),y("col-start-(auto|\\d+)","gridColumnStart"),b("col-end-","gridColumnEnd"),y("col-end-(auto|\\d+)","gridColumnEnd"),b("grid-rows-","gridTemplateRows"),y("grid-rows-(\\d+)","gridTemplateRows",t0),b("row-","gridRow"),y("row-(span)-(\\d+)","gridRow",e0),b("row-start-","gridRowStart"),y("row-start-(auto|\\d+)","gridRowStart"),b("row-end-","gridRowEnd"),y("row-end-(auto|\\d+)","gridRowEnd"),y("grid-flow-((row|col)(-dense)?)","gridAutoFlow",t=>Zi(X1(t))),y("grid-flow-(dense)","gridAutoFlow"),b("auto-cols-","gridAutoColumns"),b("auto-rows-","gridAutoRows"),b("gap-x(?:$|-)","gap","columnGap"),b("gap-y(?:$|-)","gap","rowGap"),b("gap(?:$|-)","gap"),"(justify-(?:items|self))-",y("justify-","justifyContent",Y1),y("(content|items|self)-",t=>({["align-"+t[1]]:Y1(t)})),y("(place-(content|items|self))-",({1:t,$$:e})=>({[t]:("wun".includes(e[3])?"space-":"")+e})),b("p([xytrbl])?(?:$|-)","padding",pr("padding")),b("-?m([xytrbl])?(?:$|-)","margin",pr("margin")),b("-?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))`}})),y("space-(x|y)-reverse",({1:t})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-reverse`]:"1"}})),b("w-","width"),b("min-w-","minWidth"),b("max-w-","maxWidth"),b("h-","height"),b("min-h-","minHeight"),b("max-h-","maxHeight"),b("font-","fontWeight"),b("font-","fontFamily",({_:t})=>typeof(t=B(t))[1]=="string"?{fontFamily:Le(t)}:{fontFamily:Le(t[0]),...t[1]}),y("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),y("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),y("italic","fontStyle"),y("not-italic",{fontStyle:"normal"}),y("(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)",...et({"--tw-ordinal":"var(--tw-empty,/*!*/ /*!*/)","--tw-slashed-zero":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-figure":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-spacing":"var(--tw-empty,/*!*/ /*!*/)","--tw-numeric-fraction":"var(--tw-empty,/*!*/ /*!*/)"})}),b("tracking-","letterSpacing"),b("leading-","lineHeight"),y("list-(inside|outside)","listStylePosition"),b("list-","listStyleType"),y("list-","listStyleType"),b("placeholder-opacity-","placeholderOpacity",({_:t})=>({"&::placeholder":{"--tw-placeholder-opacity":t}})),ie("placeholder-",{property:"color",selector:"&::placeholder"}),y("text-(left|center|right|justify|start|end)","textAlign"),y("text-(ellipsis|clip)","textOverflow"),b("text-opacity-","textOpacity","--tw-text-opacity"),ie("text-",{property:"color"}),b("text-","fontSize",({_:t})=>typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}),b("indent-","textIndent"),y("(overline|underline|line-through)","textDecorationLine"),y("no-underline",{textDecorationLine:"none"}),b("underline-offset-","textUnderlineOffset"),ie("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),b("decoration-","textDecorationThickness"),y("decoration-","textDecorationStyle"),y("(uppercase|lowercase|capitalize)","textTransform"),y("normal-case",{textTransform:"none"}),y("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),y("align-","verticalAlign"),y("whitespace-","whiteSpace"),y("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),y("break-words",{overflowWrap:"break-word"}),y("break-all",{wordBreak:"break-all"}),y("break-keep",{wordBreak:"keep-all"}),ie("caret-",{opacityVariable:!1,opacitySection:"opacity"}),ie("accent-",{opacityVariable:!1,opacitySection:"opacity"}),y("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:t})=>`linear-gradient(to ${_t(t," ")},var(--tw-gradient-stops))`),ie("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)"})),ie("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)`})),ie("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),y("bg-(fixed|local|scroll)","backgroundAttachment"),y("bg-origin-(border|padding|content)","backgroundOrigin",({1:t})=>t+"-box"),y(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),y("bg-blend-","backgroundBlendMode"),y("bg-clip-(border|padding|content|text)","backgroundClip",({1:t})=>t+(t=="text"?"":"-box")),b("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),ie("bg-",{section:"backgroundColor"}),b("bg-","backgroundImage"),b("bg-","backgroundPosition"),y("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",Zi),b("bg-","backgroundSize"),b("rounded(?:$|-)","borderRadius"),b("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-${_t(r[0])}-radius`]:e,[`border-${_t(r[1])}-radius`]:e}}),y("border-(collapse|separate)","borderCollapse"),b("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),y("border-(solid|dashed|dotted|double|none)","borderStyle"),b("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:t,_:e})=>({...et({"--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)"})),ie("border-([xytrbl])-",{section:"borderColor"},pr("border","Color")),ie("border-"),b("border-([xytrbl])(?:$|-)","borderWidth",pr("border","Width")),b("border(?:$|-)","borderWidth"),b("divide-opacity(?:$|-)","divideOpacity",({_:t})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":t}})),y("divide-(solid|dashed|dotted|double|none)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:t}})),y("divide-([xy]-reverse)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+t]:"1"}})),b("divide-([xy])(?:$|-)","divideWidth",({1:t,_:e})=>{let r={x:"lr",y:"tb"}[t];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${t}-reverse`]:"0",[`border-${_t(r[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${t}-reverse)))`,[`border-${_t(r[1])}Width`]:`calc(${e} * var(--tw-divide-${t}-reverse))`}}}),ie("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),b("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),ie("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),b("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),y("ring-inset",{"--tw-ring-inset":"inset"}),ie("ring-",{property:"--tw-ring-color"}),b("ring(?:$|-)","ringWidth",({_:t},{theme:e})=>({...et({"--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":$e(e("ringOffsetColor","","#fff")),"--tw-ring-color":$e(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)"})),ie("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-shadow-color":t.value,"--tw-shadow":"var(--tw-shadow-colored)"})),b("shadow(?:$|-)","boxShadow",({_:t})=>({...et({"--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":Le(t),"--tw-shadow-colored":Le(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)"})),b("(opacity)-"),y("mix-blend-","mixBlendMode"),...Q1(),...Q1("backdrop-"),b("transition(?:$|-)","transitionProperty",(t,{theme:e})=>({transitionProperty:Le(t),transitionTimingFunction:t._=="none"?void 0:Le(e("transitionTimingFunction","")),transitionDuration:t._=="none"?void 0:Le(e("transitionDuration",""))})),b("duration(?:$|-)","transitionDuration","transitionDuration",Le),b("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",Le),b("delay(?:$|-)","transitionDelay","transitionDelay",Le),b("animate(?:$|-)","animation",(t,{theme:e,h:r,e:n})=>{let i=Le(t),s=i.split(" "),a=e("keyframes",s[0]);return a?{["@keyframes "+(s[0]=n(r(s[0])))]:a,animation:s.join(" ")}:{animation:i}}),"(transform)-(none)",y("transform",da),y("transform-(cpu|gpu)",({1:t})=>({"--tw-transform":n0(t=="gpu")})),b("scale(-[xy])?-","scale",({1:t,_:e})=>({["--tw-scale"+(t||"-x")]:e,["--tw-scale"+(t||"-y")]:e,...da()})),b("-?(rotate)-","rotate",pa),b("-?(translate-[xy])-","translate",pa),b("-?(skew-[xy])-","skew",pa),y("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",Zi),"(appearance)-",b("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",b("(cursor)-"),"(cursor)-",y("snap-(none)","scroll-snap-type"),y("snap-(x|y|both)",({1:t})=>({...et({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":t+" var(--tw-scroll-snap-strictness)"})),y("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),y("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),y("snap-(normal|always)","scroll-snap-stop"),y("scroll-(auto|smooth)","scroll-behavior"),b("scroll-p([xytrbl])?(?:$|-)","padding",pr("scroll-padding")),b("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",pr("scroll-margin")),y("touch-(auto|none|manipulation)","touch-action"),y("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:t,2:e,3:r})=>({...et({"--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)"})),y("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),y("outline",{outlineStyle:"solid"}),y("outline-(dashed|dotted|double)","outlineStyle"),b("-?(outline-offset)-"),ie("outline-",{opacityVariable:!1,opacitySection:"opacity"}),b("outline-","outlineWidth"),"(pointer-events)-",b("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:t})=>({x:"horizontal",y:"vertical"})[t]||t||"both"],y("select-(none|text|all|auto)","userSelect"),ie("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),ie("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),b("stroke-","strokeWidth"),y("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),y("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function Zi(t){return(typeof t=="string"?t:t[1]).replace(/-/g," ").trim()}function X1(t){return(typeof t=="string"?t:t[1]).replace("col","column")}function _t(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 Le(t){return t&&""+(t._||t)}function Y1({$$:t}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[t[3]||""]||"")+t}function pr(t,e=""){return({1:r,_:n})=>{let i={x:"lr",y:"tb"}[r]||r+r;return i?{...vn(t+"-"+_t(i[0])+e,n),...vn(t+"-"+_t(i[1])+e,n)}:vn(t+e,n)}}function Q1(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={...et(r),[`${t}filter`]:e.map(n=>`var(--tw-${t}${n})`).join(" ")},[`(${t}filter)-(none)`,y(`${t}filter`,r),...e.map(n=>b(`${n[0]=="h"?"-?":""}(${t}${n})(?:$|-)`,n,({1:i,_:s})=>({[`--tw-${i}`]:B(s).map(a=>`${n}(${a})`).join(" "),...r})))]}function pa({1:t,_:e}){return{["--tw-"+t]:e,...da()}}function da(){return{...et({"--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":n0()}),transform:"var(--tw-transform)"}}function n0(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 e0({1:t,2:e}){return`${t} ${e} / ${t} ${e}`}function t0({1:t}){return`repeat(${t},minmax(0,1fr))`}function et(t){return{"@layer defaults":{"*,::before,::after":t,"::backdrop":t}}}var i0=[["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)||Pe(e,"",r)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:t,3:e="",4:r,5:n="",6:i=e},{e:s,h:a,v:u})=>{let l=hr(n)||(r[0]=="["?r:u(r.slice(1)));return`${(l.includes("&")?l:"&"+l).replace(/&/g,`:merge(.${s(a(t+i))})`)}${t[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:t})=>`[dir="${t}"] &`],["supports-",({$$:t},e)=>{if(t&&(t=e.theme("supports",t)||Pe(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)||Pe(t,"",e)),typeof t=="string")return`@media not all and (min-width:${t})`}],["min-",({$$:t},e)=>(t&&(t=Pe(t,"",e)),t&&`@media (min-width:${t})`)],[/^\[(.+)]$/,({1:t})=>/[&@]/.test(t)&&hr(t).replace(/[}]+$/,"").split("{")]];function s0({colors:t,disablePreflight:e}={}){return{preflight:e?void 0:J1,theme:{...xn,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...t}},variants:i0,rules:r0,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 S2={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},E2={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},_2={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},M2={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},A2={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},I2={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},L2={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},j2={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},T2={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},D2={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},O2={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},P2={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},U2={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},R2={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},V2={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},B2={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},H2={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},z2={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},F2={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},N2={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},q2={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},Z2={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},o0={__proto__:null,slate:S2,gray:E2,zinc:_2,neutral:M2,stone:A2,red:I2,orange:L2,amber:j2,yellow:T2,lime:D2,green:O2,emerald:P2,teal:U2,cyan:R2,sky:V2,blue:B2,indigo:H2,violet:z2,purple:F2,fuchsia:N2,pink:q2,rose:Z2};function Wi({disablePreflight:t}={}){return s0({colors:o0,disablePreflight:t})}function Gi({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,a=s])=>[`${t}-${s}`,(u,l)=>c0(t,a[0]=="."?"."+l.e(l.h(a.slice(1))):a,l,c=>`& :is(${c.trim()})`)]),rules:[[`(lead|not-${t})`,({1:s},{h:a})=>[{c:a(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},a)=>{let u=l0(a.theme("fontSize",s));return u&&{"@layer components":u}}],[t+"-",({$$:s},a)=>i(s,a)],[t,(s,a)=>({...i(e,a),"@layer base":[a0(t,a,{a:{color:"var(--tw-prose-links)",textDecorationLine:"underline",fontWeight:"500"},strong:{color:"var(--tw-prose-bold)",fontWeight:"600"},"a strong,blockquote strong,thead th strong":{color:"inherit"},ul:{listStyleType:"disc"},ol:{listStyleType:"decimal"},'ol[type="A"]':{listStyleType:"upper-alpha"},'ol[type="a"]':{listStyleType:"lower-alpha"},'ol[type="A" s]':{listStyleType:"upper-alpha"},'ol[type="a" s]':{listStyleType:"lower-alpha"},'ol[type="I"]':{listStyleType:"upper-roman"},'ol[type="i"]':{listStyleType:"lower-roman"},'ol[type="I" s]':{listStyleType:"upper-roman"},'ol[type="i" s]':{listStyleType:"lower-roman"},'ol[type="1"]':{listStyleType:"decimal"},"ol,ul":{marginTop:E(20,16),marginBottom:E(20,16),paddingLeft:E(26,16)},li:{marginTop:E(8,16),marginBottom:E(8,16)},"ol>li,ul>li":{paddingLeft:E(6,16)},">ul>li p":{marginTop:E(12,16),marginBottom:E(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:E(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:E(20,16)},"ol>li::marker":{fontWeight:"400",color:"var(--tw-prose-counters)"},"ul>li::marker":{color:"var(--tw-prose-bullets)"},"ul ul,ul ol,ol ul,ol ol":{marginTop:E(12,16),marginBottom:E(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:E(48,16),marginBottom:E(48,16)},blockquote:{marginTop:E(32,20),marginBottom:E(32,20),paddingLeft:E(20,20),fontWeight:"500",fontStyle:"italic",color:"var(--tw-prose-quotes)",borderLeftWidth:"0.25rem",borderLeftColor:"var(--tw-prose-quote-borders)",quotes:'"\\201C""\\201D""\\2018""\\2019"'},"blockquote p:first-of-type::before":{content:"open-quote"},"blockquote p:last-of-type::after":{content:"close-quote"},p:{marginTop:E(20,16),marginBottom:E(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:E(36,16),marginTop:"0",marginBottom:E(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:E(24,16),marginTop:E(48,24),marginBottom:E(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:E(20,16),marginTop:E(32,20),marginBottom:E(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:E(24,16),marginBottom:E(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:E(32,16),marginBottom:E(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:E(14,16),lineHeight:"1.4",marginTop:E(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:E(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:E(21,24)},"h3 code":{fontSize:E(18,20)},"a code,h1 code,h2 code,h3 code,h4 code,blockquote code,thead th code":{color:"inherit"},pre:{color:"var(--tw-prose-pre-code)",backgroundColor:"var(--tw-prose-pre-bg)",overflowX:"auto",fontWeight:"400",fontSize:E(14,16),lineHeight:"1.7",marginTop:E(24,14),marginBottom:E(24,14),borderRadius:"0.375rem",paddingTop:E(12,14),paddingRight:E(16,14),paddingBottom:E(12,14),paddingLeft:E(16,14)},"pre code":{backgroundColor:"transparent",borderWidth:"0",borderRadius:"0",padding:"0",fontWeight:"inherit",color:"inherit",fontSize:"inherit",fontFamily:"inherit",lineHeight:"inherit"},"pre code::before":{content:"none"},"pre code::after":{content:"none"},table:{width:"100%",tableLayout:"auto",textAlign:"left",marginTop:E(32,16),marginBottom:E(32,16),fontSize:E(14,16),lineHeight:"1.7"},thead:{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-th-borders)"},"thead th":{color:"var(--tw-prose-headings)",fontWeight:"600",verticalAlign:"bottom",paddingRight:E(8,14),paddingBottom:E(8,14),paddingLeft:E(8,14)},"thead th:first-child":{paddingLeft:"0"},"thead th:last-child":{paddingRight:"0"},"tbody tr":{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-td-borders)"},"tbody tr:last-child":{borderBottomWidth:"0"},"tbody td,tfoot td":{verticalAlign:"baseline",paddingTop:E(8,14),paddingRight:E(8,14),paddingBottom:E(8,14),paddingLeft:E(8,14)},"tbody td:first-child,tfoot td:first-child":{paddingLeft:"0"},"tbody td:last-child,tfoot td:last-child":{paddingRight:"0"},[`.${a.e(a.h("lead"))}`]:{color:"var(--tw-prose-lead)",fontSize:E(20,16),lineHeight:"1.6",marginTop:E(24,20),marginBottom:E(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),a0(t,a,r)],"@layer components":{...l0(a.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function i(s,a){let u={},l={},c=(p,f,v)=>{let x=a.theme(`colors.${s}.${f}`,f);v["--tw-prose-"+p]=$e(x);let S=v!=l&&a.d("colors",`${s}-${f}`,x);S&&(l["--tw-prose-"+p]=$e(S))};for(let p in n){let f=n[p];p!="dark"&&f&&c(p,f,u)}for(let p in n.dark||{}){let f=n.dark[p];f&&(n.dark?c("invert-"+p,f,u):c(p,f,l))}return Object.keys(u).length?{"@layer defaults":{"&":u,[a.v("dark")]:l}}:void 0}}function a0(t,e,r){let n={};for(let i in r)n[c0(t,i,e,s=>`.${e.e(e.h(t))}${s}`)]=r[i];return n}function c0(t,e,{e:r,h:n},i){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,a=" ",u=s,l="")=>i(`${a}:where(${u}):not(:where(.${r(n("not-"+t))} *))${l}`))}function l0(t){return t?typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}:void 0}function E(t,e){return`${(t/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var fa=yn({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:[Wi(),Ni(),qi(),Gi()]});function Ki(t,e=!0){let r=(function(){if(W2)try{let l=Fi(new CSSStyleSheet);return l.connect=c=>{let p=ma(c);p.adoptedStyleSheets=[...p.adoptedStyleSheets,l.target]},l.disconnect=zi,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let a=[Fi(s)],u=new WeakMap;return{get target(){return a[0].target},snapshot(){let l=a.map(c=>c.snapshot());return()=>l.forEach(c=>c())},clear(){a.forEach(l=>l.clear())},destroy(){a.forEach(l=>l.destroy())},insert(l,c,p){a[0].insert(l,c,p);let f=this.target.cssRules[c];a.forEach((v,x)=>x&&v.target.insertRule(f.cssText,c))},resume(l,c){return a[0].resume(l,c)},connect(l){let c=document.createElement("style");ma(l).appendChild(c);let p=Fi(c),{cssRules:f}=this.target;for(let v=0;v<f.length;v++)p.target.insertRule(f[v].cssText,v);a.push(p),u.set(l,p)},disconnect(l){let c=a.indexOf(u.get(l));c>=0&&a.splice(c,1)}}})(),n=N1({...t,hash:t.hash??e},r),i=q1(n);return function(a){return class extends a{connectedCallback(){super.connectedCallback?.(),r.connect(this),i.observe(ma(this))}disconnectedCallback(){r.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=n}}}}var W2=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function ma(t){return t.shadowRoot||t.attachShadow({mode:"open"})}var A=t=>Ki(fa)(t);var kn=class extends A($){constructor(){super(),this.color="#601feb",this.radius="16.8576px",this.size="320px",this.border="#d1d5db"}render(){return h`
|
|
126
|
+
</svg>`};var f2=u1,Ho=class extends Oi{resolveIcon(e){let r=f2[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",Ho);var dn,fe,ve,fn,qo,Pi=class{constructor(e,r){d(this,fn);d(this,dn);d(this,fe);d(this,ve);if(!e)throw new Error("host is required");if(!r)throw new Error("config is required");g(this,dn,e),o(this,dn).addController(this),g(this,fe,r)}connect(e){g(this,fe,e),g(this,ve,f(this,fn,qo).call(this))}hostConnected(){o(this,ve)||setTimeout(()=>{o(this,ve)||g(this,ve,f(this,fn,qo).call(this))},0)}hostDisconnected(){o(this,ve)?.close(1e3,"lit_host_disconnected"),g(this,ve,void 0)}send(e){o(this,ve)?.send(e)}close(e,r){o(this,ve)?.close(e,r)}get isConnected(){return o(this,ve)?.readyState===WebSocket.OPEN}get isConnecting(){return o(this,ve)?.readyState===WebSocket.CONNECTING}};dn=new WeakMap,fe=new WeakMap,ve=new WeakMap,fn=new WeakSet,qo=function(){let e=new WebSocket(o(this,fe).url());return o(this,fe).onClose&&(e.onclose=o(this,fe).onClose),o(this,fe).onOpen&&(e.onopen=o(this,fe).onOpen),o(this,fe).onError&&(e.onerror=o(this,fe).onError),o(this,fe).onMessage&&(e.onmessage=o(this,fe).onMessage),e};var h1=Array.isArray;var zo=t=>!!(t&&t.constructor&&t.call&&t.apply);var p1=t=>!(!t||!t.then||!zo(t.then));var Fo=(t,e,r=!1)=>{if(!t)return[];let n=(s,a)=>e(s)-e(a),i=(s,a)=>e(a)-e(s);return t.slice().sort(r===!0?i:n)};function*mn(t,e,r=i=>i,n=1){let i=zo(r)?r:()=>r,s=e?t:0,a=e??t;for(let u=s;u<=a&&(yield i(u),!(u+n>a));u+=n);}var No=(t,e,r,n)=>Array.from(mn(t,e,r,n));var Zo=(t,e)=>t?t.reduce((r,n)=>{let[i,s]=r;return e(n)?[[...i,n],s]:[i,[...s,n]]},[[],[]]):[[],[]];var Wo=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}},Go=async(t,e,r)=>{let n=e.map((c,p)=>({index:p,item:c})),i=async c=>{let p=[];for(;;){let m=n.pop();if(!m)return c(p);let[v,b]=await gn(r)(m.item);p.push({error:v,result:b,index:m.index})}},s=No(1,t).map(()=>new Promise(i)),a=await Promise.all(s),[u,l]=Zo(Fo(a.flat(),c=>c.index),c=>!!c.error);if(u.length>0)throw new Wo(u.map(c=>c.error));return l.map(c=>c.result)};var Ui=t=>new Promise(e=>setTimeout(e,t)),gn=t=>(...e)=>{try{let r=t(...e);return p1(r)?r.then(n=>[void 0,n]).catch(n=>[n,void 0]):[void 0,r]}catch(r){return[r,void 0]}};async function d1(t,e){let r=t?.times??3,n=t?.delay,i=t?.backoff??null;for(let s of mn(1,r)){let[a,u]=await gn(e)(l=>{throw{_exited:l}});if(!a)return u;if(a._exited)throw a._exited;if(s===r)throw a;n&&await Ui(n),i&&await Ui(i(s))}throw new Error("unreachable")}var m2=!0,Jo="Invariant failed";function me(t,e){if(!t){if(m2)throw new Error(Jo);var r=typeof e=="function"?e():e,n=r?"".concat(Jo,": ").concat(r):Jo;throw new Error(n)}}var K,te,G,er,tr,$e,Y,Le,f1,m1,g1,w1,Ri=class{constructor(e,r){d(this,Y);d(this,K);d(this,te);d(this,G,null);w(this,"isStreaming",!1);w(this,"typingIndicator");w(this,"ranOutOfCredits",!1);w(this,"messages",[]);w(this,"conversationId","");d(this,er,0);d(this,tr);w(this,"isLiveMode",!1);d(this,$e,[]);g(this,K,e),g(this,te,r),o(this,te).autoConnect!==!1&&g(this,G,this.initWS()),e.addController(this)}get hasQueuedMessages(){return o(this,$e).length>0}async enqueueMessage(e,{expectStreaming:r=!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?f(this,Y,Le).call(this,e,{expectStreaming:r}):(o(this,$e).push({message:e,options:{expectStreaming:r}}),o(this,K).requestUpdate(),o(this,G)&&!o(this,G).isConnecting&&!o(this,G).isConnected&&this.retry(),await d1({times:5,delay:2e3},async()=>{if(o(this,G)?.isConnected){let n=[...o(this,$e)];g(this,$e,[]),o(this,K).requestUpdate();let i=!1;for(let{message:s,options:a}of n){let u=f(this,Y,Le).call(this,s,a);s===e&&(i=u)}return i}else throw new Error("WebSocket not connected yet")}).catch(()=>(console.warn("Failed to send message after retries",e),g(this,$e,[]),o(this,K).requestUpdate(),!1)))}sendUserInput(e,{xUserData:r,xCustomInstructions:n,role:i="user",expectStreaming:s=!1,requestInputResponse:a}={}){return f(this,Y,Le).call(this,{type:"USER_INPUT",value:e,role:i,xUserData:r,xCustomInstructions:n,requestInputResponse:a},{expectStreaming:s})}async enqueueUserInput(e,{xUserData:r,xCustomInstructions:n,role:i="user",expectStreaming:s=!1,requestInputResponse:a}={}){return this.enqueueMessage({type:"USER_INPUT",value:e,role:i,xUserData:r,xCustomInstructions:n,requestInputResponse:a},{expectStreaming:s})}sendImageDelete(e){return me(e,"imageId is required"),f(this,Y,Le).call(this,{type:"USER_FILE_DELETE",imageId:e})}sendUserCancel(){return f(this,Y,Le).call(this,{type:"USER_CANCEL"})}sendUserTypingStart(){return f(this,Y,Le).call(this,{type:"USER_TYPING_START"})}sendUserTypingStop(){return f(this,Y,Le).call(this,{type:"USER_TYPING_STOP"})}sendUserMeta(e){return f(this,Y,Le).call(this,{type:"USER_META",metadata:e})}reloadConfig(){f(this,Y,Le).call(this,{type:"RELOAD_CONFIG"})}close(){o(this,G)?.close(1e3,"closed by user")}retry(){clearTimeout(o(this,tr)),g(this,tr,setTimeout(()=>{o(this,te).onReconnect?.(),g(this,G,this.initWS())},1e3*o(this,er))),Nl(this,er)._++}initWS(){return new Pi(o(this,K),{url:()=>o(this,te).url(this.conversationId,{}),onOpen:e=>f(this,Y,f1).call(this,e),onMessage:e=>f(this,Y,m1).call(this,JSON.parse(e.data)),onError:e=>f(this,Y,g1).call(this,e),onClose:e=>f(this,Y,w1).call(this,e)})}hostConnected(){this.conversationId=o(this,te).restoreConversationState?.()?.conversationId||"",this.messages=o(this,te).restoreConversationState?.()?.messages||[]}reset(){f(this,Y,Le).call(this,{type:"NEW_CHAT"}),o(this,te).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,tr))}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]}};K=new WeakMap,te=new WeakMap,G=new WeakMap,er=new WeakMap,tr=new WeakMap,$e=new WeakMap,Y=new WeakSet,Le=function(e,{expectStreaming:r=!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?(r&&!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)},f1=function(e){g(this,er,0)},m1=function(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,o(this,K).requestUpdate(),o(this,te).onNewMessage?.(e.message);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),o(this,te).onMessageAppend?.(e),o(this,K).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,o(this,K).requestUpdate(),o(this,te).onMessageDone?.(e,r),o(this,te).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,te).onMessageError?.(e);break}case"CONNECTED":{this.conversationId=e.conversationId,this.messages=e.messages,o(this,te).onConnect?.(e.conversationId,e.metadata),o(this,te).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)}`)}},g1=function(e){console.error("onError",e),o(this,te).onError?.(e)},w1=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,te).onClose?.()};var g5=Symbol(),g2=Symbol();var v1=Object.getPrototypeOf,Ko=new WeakMap,w2=t=>t&&(Ko.has(t)?Ko.get(t):v1(t)===Object.prototype||v1(t)===Array.prototype);var y1=t=>w2(t)&&t[g2]||null,Yo=(t,e=!0)=>{Ko.set(t,e)};var Qo=t=>typeof t=="object"&&t!==null,v2=t=>Qo(t)&&!ea.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),k1=(t,e)=>{let r=x1.get(t);if(r?.[0]===e)return r[1];let n=Array.isArray(t)?[]:Object.create(Object.getPrototypeOf(t));return Yo(n,!0),x1.set(t,[e,n]),Reflect.ownKeys(t).forEach(i=>{if(Object.getOwnPropertyDescriptor(n,i))return;let s=Reflect.get(t,i),{enumerable:a}=Reflect.getOwnPropertyDescriptor(t,i),u={value:s,enumerable:a,configurable:!0};if(ea.has(s))Yo(s,!1);else if($t.has(s)){let[l,c]=$t.get(s);u.value=k1(l,c())}Object.defineProperty(n,i,u)}),Object.preventExtensions(n)},y2=(t,e,r,n)=>({deleteProperty(i,s){let a=Reflect.get(i,s);r(s);let u=Reflect.deleteProperty(i,s);return u&&n(["delete",[s],a]),u},set(i,s,a,u){let l=!t()&&Reflect.has(i,s),c=Reflect.get(i,s,u);if(l&&(b1(c,a)||Vi.has(a)&&b1(c,Vi.get(a))))return!0;r(s),Qo(a)&&(a=y1(a)||a);let p=!$t.has(a)&&b2(a)?ta(a):a;return e(s,p),Reflect.set(i,s,p,u),n(["set",[s],a,c]),!0}}),$t=new WeakMap,ea=new WeakSet,x1=new WeakMap,Xo=[1],Vi=new WeakMap,b1=Object.is,x2=(t,e)=>new Proxy(t,e),b2=v2,k2=k1,C2=y2;function ta(t={}){if(!Qo(t))throw new Error("object required");let e=Vi.get(t);if(e)return e;let r=Xo[0],n=new Set,i=(k,A=++Xo[0])=>{r!==A&&(s=r=A,n.forEach(C=>C(k,A)))},s=r,a=(k=Xo[0])=>(s!==k&&(s=k,l.forEach(([A])=>{let C=A[1](k);C>r&&(r=C)})),r),u=k=>(A,C)=>{let M=[...A];M[1]=[k,...M[1]],i(M,C)},l=new Map,c=(k,A)=>{let C=!ea.has(A)&&$t.get(A);if(C){if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&l.has(k))throw new Error("prop listener already exists");if(n.size){let M=C[2](u(k));l.set(k,[C,M])}else l.set(k,[C])}},p=k=>{var A;let C=l.get(k);C&&(l.delete(k),(A=C[1])==null||A.call(C))},m=k=>(n.add(k),n.size===1&&l.forEach(([C,M],L)=>{if((import.meta.env?import.meta.env.MODE:void 0)!=="production"&&M)throw new Error("remove already exists");let N=C[2](u(L));l.set(L,[C,N])}),()=>{n.delete(k),n.size===0&&l.forEach(([C,M],L)=>{M&&(M(),l.set(L,[C]))})}),v=!0,b=C2(()=>v,c,p,i),S=x2(t,b);Vi.set(t,S);let T=[t,a,m];return $t.set(S,T),Reflect.ownKeys(t).forEach(k=>{let A=Object.getOwnPropertyDescriptor(t,k);"value"in A&&A.writable&&(S[k]=t[k])}),v=!1,S}function Bi(t,e,r){let n=$t.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!n&&console.warn("Please use proxy object");let i,s=[],a=n[2],u=!1,c=a(p=>{if(s.push(p),r){e(s.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,u&&e(s.splice(0))}))});return u=!0,()=>{u=!1,c()}}function rr(t){let e=$t.get(t);(import.meta.env?import.meta.env.MODE:void 0)!=="production"&&!e&&console.warn("Please use proxy object");let[r,n]=e;return k2(r,n())}var wn,nr,St,ir,sr=class{constructor(e,r){d(this,wn);d(this,nr);d(this,St);d(this,ir,()=>{});g(this,wn,e),g(this,nr,r),g(this,St,rr(r)),e.addController(this)}get state(){return o(this,St)}get value(){return o(this,St)}hostConnected(){o(this,ir).call(this),g(this,ir,Bi(o(this,nr),()=>{g(this,St,rr(o(this,nr))),o(this,wn).requestUpdate()}))}hostDisconnected(){o(this,ir).call(this)}};wn=new WeakMap,nr=new WeakMap,St=new WeakMap,ir=new WeakMap;var vn,yn,Et,or,tt=class{constructor(e,r,n){d(this,vn);d(this,yn);w(this,"proxyObject");d(this,Et);d(this,or,()=>{});g(this,vn,e),g(this,yn,n),this.proxyObject=ta(r),g(this,Et,rr(this.proxyObject)),e.addController(this)}get state(){return o(this,Et)}get value(){return o(this,Et)}hostConnected(){o(this,or).call(this),o(this,yn)?.subscribe&&g(this,or,Bi(this.proxyObject,()=>{g(this,Et,rr(this.proxyObject)),o(this,vn).requestUpdate()}))}hostDisconnected(){o(this,or).call(this)}};vn=new WeakMap,yn=new WeakMap,Et=new WeakMap,or=new WeakMap;var ar,xn,lr,_t,Mt,Hi=class{constructor(e,{provider:r,tag:n,key:i}){d(this,ar);d(this,xn);d(this,lr);d(this,_t,null);d(this,Mt,null);g(this,ar,e),g(this,xn,n),g(this,lr,i),e.addController(this)}get value(){return o(this,Mt)?o(this,Mt).value:null}hostConnected(){if(o(this,Mt)||(g(this,_t,$2(o(this,ar),o(this,xn))),!o(this,_t)))return;let e=o(this,_t)[o(this,lr)]instanceof tt?o(this,_t)[o(this,lr)]:null;e&&g(this,Mt,new sr(o(this,ar),e.proxyObject))}hostDisconnected(){}};ar=new WeakMap,xn=new WeakMap,lr=new WeakMap,_t=new WeakMap,Mt=new WeakMap;function $2(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 C1=()=>{if(window.Shopify)try{return{customerId:S2()}}catch{return null}return null},S2=()=>{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},$1=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 S1(t,e="http"){return t.startsWith("http://")||t.startsWith("https://")?t:`${e}://${t}`}function ra(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 E1(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 _1=()=>{if(window.ShopRenter)try{let t=_2();return{customerEmail:t?.customerEmail,customerId:t?.customerId,customerName:t?.customerName}}catch{return null}return null},_2=()=>{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}}},M1=async()=>{try{let t=window.ShopRenter.shop?.domain;if(!t)return[];let e=S1(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 A1=()=>{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},I1=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 na;function ia(t){return{lang:t?.lang??na?.lang,message:t?.message,abortEarly:t?.abortEarly??na?.abortEarly,abortPipeEarly:t?.abortPipeEarly??na?.abortPipeEarly}}var I2;function L2(t){return I2?.get(t)}var j2;function T2(t){return j2?.get(t)}var D2;function O2(t,e){return D2?.get(t)?.get(e)}function j1(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 ye(t,e,r,n,i){let s=i&&"input"in i?i.input:r.value,a=i?.expected??t.expects??null,u=i?.received??j1(s),l={kind:t.kind,type:t.type,input:s,expected:a,received:u,message:`Invalid ${e}: ${a?`Expected ${a} but r`:"R"}eceived ${u}`,requirement:t.requirement,path:i?.path,issues:i?.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},c=t.kind==="schema",p=i?.message??t.message??O2(t.reference,l.lang)??(c?T2(l.lang):null)??n.message??L2(l.lang);p!==void 0&&(l.message=typeof p=="function"?p(l):p),c&&(r.typed=!1),r.issues?r.issues.push(l):r.issues=[l]}function xe(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},ia())}}}function P2(t,e){return Object.hasOwn(t,e)&&e!=="__proto__"&&e!=="prototype"&&e!=="constructor"}function T1(t,e){let r=[...new Set(t)];return r.length>1?`(${r.join(` ${e} `)})`:r[0]??"never"}var U2=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function sa(t,e){return{kind:"validation",type:"max_length",reference:sa,async:!1,expects:`<=${t}`,requirement:t,message:e,"~run"(r,n){return r.typed&&r.value.length>this.requirement&&ye(this,"length",r,n,{received:`${r.value.length}`}),r}}}function oa(t,e){return{kind:"validation",type:"min_length",reference:oa,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(r,n){return r.typed&&r.value.length<this.requirement&&ye(this,"length",r,n,{received:`${r.value.length}`}),r}}}function R2(t,e,r){return typeof t.fallback=="function"?t.fallback(e,r):t.fallback}function D1(t,e,r){return typeof t.default=="function"?t.default(e,r):t.default}function aa(){return{kind:"schema",type:"any",reference:aa,expects:"any",async:!1,get"~standard"(){return xe(this)},"~run"(t){return t.typed=!0,t}}}function cr(t,e){return{kind:"schema",type:"array",reference:cr,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return xe(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 a=i[s],u=this.item["~run"]({value:a},n);if(u.issues){let l={type:"array",origin:"value",input:i,key:s,value:a};for(let c of u.issues)c.path?c.path.unshift(l):c.path=[l],r.issues?.push(c);if(r.issues||(r.issues=u.issues),n.abortEarly){r.typed=!1;break}}u.typed||(r.typed=!1),r.value.push(u.value)}}else ye(this,"type",r,n);return r}}}function la(t){return{kind:"schema",type:"boolean",reference:la,expects:"boolean",async:!1,message:t,get"~standard"(){return xe(this)},"~run"(e,r){return typeof e.value=="boolean"?e.typed=!0:ye(this,"type",e,r),e}}}function ca(t){return{kind:"schema",type:"null",reference:ca,expects:"null",async:!1,message:t,get"~standard"(){return xe(this)},"~run"(e,r){return e.value===null?e.typed=!0:ye(this,"type",e,r),e}}}function qi(t){return{kind:"schema",type:"number",reference:qi,expects:"number",async:!1,message:t,get"~standard"(){return xe(this)},"~run"(e,r){return typeof e.value=="number"&&!isNaN(e.value)?e.typed=!0:ye(this,"type",e,r),e}}}function Ze(t,e){return{kind:"schema",type:"object",reference:Ze,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return xe(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 a=this.entries[s];if(s in i||(a.type==="exact_optional"||a.type==="optional"||a.type==="nullish")&&a.default!==void 0){let u=s in i?i[s]:D1(a),l=a["~run"]({value:u},n);if(l.issues){let c={type:"object",origin:"value",input:i,key:s,value:u};for(let p of l.issues)p.path?p.path.unshift(c):p.path=[c],r.issues?.push(p);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(a.fallback!==void 0)r.value[s]=R2(a);else if(a.type!=="exact_optional"&&a.type!=="optional"&&a.type!=="nullish"&&(ye(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 ye(this,"type",r,n);return r}}}function ur(t,e){return{kind:"schema",type:"optional",reference:ur,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return xe(this)},"~run"(r,n){return r.value===void 0&&(this.default!==void 0&&(r.value=D1(this,r,n)),r.value===void 0)?(r.typed=!0,r):this.wrapped["~run"](r,n)}}}function ua(t,e){return{kind:"schema",type:"picklist",reference:ua,expects:T1(t.map(j1),"|"),async:!1,options:t,message:e,get"~standard"(){return xe(this)},"~run"(r,n){return this.options.includes(r.value)?r.typed=!0:ye(this,"type",r,n),r}}}function zi(t,e,r){return{kind:"schema",type:"record",reference:zi,expects:"Object",async:!1,key:t,value:e,message:r,get"~standard"(){return xe(this)},"~run"(n,i){let s=n.value;if(s&&typeof s=="object"){n.typed=!0,n.value={};for(let a in s)if(P2(s,a)){let u=s[a],l=this.key["~run"]({value:a},i);if(l.issues){let p={type:"object",origin:"key",input:s,key:a,value:u};for(let m of l.issues)m.path=[p],n.issues?.push(m);if(n.issues||(n.issues=l.issues),i.abortEarly){n.typed=!1;break}}let c=this.value["~run"]({value:u},i);if(c.issues){let p={type:"object",origin:"value",input:s,key:a,value:u};for(let m of c.issues)m.path?m.path.unshift(p):m.path=[p],n.issues?.push(m);if(n.issues||(n.issues=c.issues),i.abortEarly){n.typed=!1;break}}(!l.typed||!c.typed)&&(n.typed=!1),l.typed&&(n.value[l.value]=c.value)}}else ye(this,"type",n,i);return n}}}function X(t){return{kind:"schema",type:"string",reference:X,expects:"string",async:!1,message:t,get"~standard"(){return xe(this)},"~run"(e,r){return typeof e.value=="string"?e.typed=!0:ye(this,"type",e,r),e}}}function L1(t){let e;if(t)for(let r of t)e?e.push(...r.issues):e=r.issues;return e}function hr(t,e){return{kind:"schema",type:"union",reference:hr,expects:T1(t.map(r=>r.expects),"|"),async:!1,options:t,message:e,get"~standard"(){return xe(this)},"~run"(r,n){let i,s,a;for(let u of this.options){let l=u["~run"]({value:r.value},n);if(l.typed)if(l.issues)s?s.push(l):s=[l];else{i=l;break}else a?a.push(l):a=[l]}if(i)return i;if(s){if(s.length===1)return s[0];ye(this,"type",r,n,{issues:L1(s)}),r.typed=!0}else{if(a?.length===1)return a[0];ye(this,"type",r,n,{issues:L1(a)})}return r}}}function O1(t,e,r){let n=t["~run"]({value:e},ia(r));if(n.issues)throw new U2(n.issues);return n.value}function P1(t,e){let r={};for(let n in t.entries)r[n]=!e||e.includes(n)?ur(t.entries[n]):t.entries[n];return{...t,entries:r,get"~standard"(){return xe(this)}}}function U1(...t){return{...t[0],pipe:t,get"~standard"(){return xe(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 bn(t,e,r){let n=t["~run"]({value:e},ia(r));return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}var R1=zi(X(),hr([X(),qi(),la(),ca()])),V1=U1(X(),oa(1),sa(5e3)),B1=()=>{try{return window.UNAS?A1():window.Shopify?C1():window.ShopRenter?_1():null}catch{return null}},H1=async()=>{try{return window.UNAS?await I1():window.Shopify?await $1():window.ShopRenter?await M1():[]}catch{return[]}},pr={schema:Ze({conversationId:ur(X()),messages:ur(cr(Ze({id:X(),timestamp:qi(),role:ua(["user","assistant","support"]),content:X(),parts:ur(cr(hr([Ze({text:X()}),Ze({html:X()}),Ze({tag:X(),data:zi(X(),aa())})])))})))}),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=O1(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 P,q1,kn,Cn,dr,V,z1,Ni=class Ni extends ${constructor(){super();d(this,P);w(this,"contextCtrl");d(this,kn);d(this,Cn);d(this,dr,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,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,P,V).sendImageDelete.bind(o(this,P,V))})}connectedCallback(){super.connectedCallback(),this.updated()}updated(){this.autoConnect&&o(this,P,V).connect(),Object.assign(this.contextCtrl.proxyObject,{widgetId:this.widgetId,config:this.config,callbacks:this.callbacks,xUserData:o(this,kn),xCustomInstructions:o(this,Cn),conversationId:o(this,P,V).conversationId,messages:o(this,P,q1),isStreaming:o(this,P,V).isStreaming,typingIndicator:o(this,P,V).typingIndicator,ranOutOfCredits:o(this,P,V).ranOutOfCredits,isLiveMode:o(this,P,V).isLiveMode,lastMsg:o(this,P,V).lastMsg,hasQueuedMessages:o(this,P,V).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,P,V).sendImageDelete.bind(o(this,P,V))}),f(this,P,z1).call(this)}sendUserInput(r,n={}){let i={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,...n},s=o(this,P,V).sendUserInput(r,i);return s&&this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:r,example:!1,conversationId:o(this,P,V).conversationId}),s}async enqueueUserInput(r,n={}){let i={xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,role:"user",expectStreaming:!0,...n};return o(this,P,V).enqueueUserInput(r,i)}sendUserCancel(){o(this,P,V).sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})}sendUserTypingStart(){o(this,P,V).sendUserTypingStart()}sendUserTypingStop(){o(this,P,V).sendUserTypingStop()}reset(){o(this,P,V).reset()}reloadConfig(){o(this,P,V).reloadConfig()}connect(){o(this,P,V).connect()}render(){return h`<slot></slot>`}};P=new WeakSet,q1=function(){return o(this,P,V)?.ranOutOfCredits?[{id:crypto.randomUUID(),role:"assistant",content:"Sorry, I've run out of credits. Please contact the shop directly.",timestamp:Date.now()}]:o(this,P,V)?.messages||[]},kn=new WeakMap,Cn=new WeakMap,dr=new WeakMap,V=function(){return o(this,dr)||g(this,dr,new Ri(this,{autoConnect:this.autoConnect,url:r=>{let n=new URL(this.config.wsApiUrl);return n.searchParams.set("widgetId",this.widgetId),n.searchParams.set("conversationId",r),n.searchParams.set("pageUrl",window.location.href),n},onReconnect:()=>{},onError:r=>{console.error("ws error",r)},onClose:()=>{},onNewMessage:r=>{r.role==="assistant"&&this.callbacks.onNewMessageStartedStreaming?.({widgetId:this.widgetId,message:r,conversationId:o(this,P,V).conversationId})},onMessageAppend:r=>{},onMessageDone:(r,n)=>{n.role==="assistant"&&this.callbacks.onMessageEndedStreaming?.({widgetId:this.widgetId,text:n.content??"",message:n,usage_TOKENS_COMPLETION:r.message.usage.TOKENS_COMPLETION,conversationId:o(this,P,V).conversationId})},onMessageError:r=>{console.error("ws message error",r),r.message&&this.callbacks.onError?.({widgetId:this.widgetId,error:"WS: "+r.message})},onReset:()=>{pr.reset(this.widgetId)},onConnect:(r,n)=>{let i=B1();o(this,P,V).sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,language:window.navigator.language,cart:[]}),H1().then(s=>{s?.length>0&&o(this,P,V).sendUserMeta({xUserData:this.xUserData,xCustomInstructions:this.xCustomInstructions,customerInformation:i,cart:s,language:window.navigator.language})}).catch(s=>{console.error(s)}),this.dispatchEvent(new Ni.ConnectedEvent({conversationId:r,metadata:n,widgetId:this.widgetId,pendingImages:n?.pendingImages||[]}))},persistConversationState:(r,n)=>{pr.persist(this.widgetId,r,n)},restoreConversationState:()=>pr.restore(this.widgetId)})),o(this,dr)},z1=function(){function r(i){if(!i)return;let s;try{s=typeof i=="object"?i:JSON.parse(i)}catch(u){console.error("Molin: user-data is not valid JSON",u);return}if(!s||typeof s!="object"||Object.keys(s).length===0)return;let a=bn(R1,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=bn(V1,i);if(!s.success){console.error("Molin: custom-instructions does not pass schema validation",s.issues);return}return s.output}g(this,kn,r(this.xUserData)),g(this,Cn,n(this.xCustomInstructions))},w(Ni,"properties",{widgetId:{type:String},config:{type:Object},callbacks:{type:Object},xUserData:{type:Object},xCustomInstructions:{type:Object},autoConnect:{type:Boolean}});var fr=Ni;function F1(t){let e=new Hi(t,{provider:fr,tag:"mw-context-widget",key:"contextCtrl"});return new Proxy({value:null},{get(r,n){if(n==="value")return e.value}})}var ha;fr.ConnectedEvent=(ha=class extends CustomEvent{constructor(e,r={}){super(fr.ConnectedEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}},w(ha,"type","mw-context-widget:connected"),ha);customElements.get("mw-context-widget")||customElements.define("mw-context-widget",fr);function ba(t){return[...t.v,(t.i?"!":"")+t.n].join(":")}function V2(t,e=","){return t.map(ba).join(e)}var Y1=typeof CSS<"u"&&CSS.escape||(t=>t.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function Zi(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 Ji(t,e="@media "){return e+B(t).map(r=>(typeof r=="string"&&(r={min:r}),r.raw||Object.keys(r).map(n=>`(${n}-width:${r[n]})`).join(" and "))).join(",")}function B(t=[]){return Array.isArray(t)?t:t==null?[]:[t]}function N1(t){return t}function Ki(){}var re={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function X1(t){return t.match(/[-=:;]/g)?.length||0}function ga(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(X1(t),15)<<18}var B2=["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:t,i:e,v:r=[]},n,i,s){t&&(t=ba({n:t,i:e,v:r})),s=[...B(s)];for(let u of r){let l=n.theme("screens",u);for(let c of B(l&&Ji(l)||n.v(u))){var a;s.push(c),i|=l?67108864|ga(c):u=="dark"?1073741824:c[0]=="@"?ga(c):(a=c,1<<~(/:([a-z-]+)/.test(a)&&~B2.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:t,p:i,r:s,i:e}}var Q1=new Map;function wa(t){if(t.d){let e=[],r=pa(t.r.reduce((n,i)=>i[0]=="@"?(e.push(i),n):i?pa(n,s=>pa(i,a=>{let u=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(a);if(u){let l=s.indexOf(u[1]);return~l?s.slice(0,l)+u[0]+s.slice(l+u[1].length):da(s,a)}return da(a,s)})):n,"&"),n=>da(n,t.n?"."+Y1(t.n):""));return r&&e.push(r.replace(/:merge\((.+?)\)/g,"$1")),e.reduceRight((n,i)=>i+"{"+n+"}",t.d)}}function pa(t,e){return t.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(r,n,i)=>e(n)+i)}function da(t,e){return t.replace(/&/g,e)}var Z1=new Intl.Collator("en",{numeric:!0});function e0(t,e){for(var r=0,n=t.length;r<n;){let i=n+r>>1;0>=t0(t[i],e)?r=i+1:n=i}return n}function t0(t,e){let r=t.p&re.o;return r==(e.p&re.o)&&(r==re.b||r==re.o)?0:t.p-e.p||t.o-e.o||Z1.compare(W1(t.n),W1(e.n))||Z1.compare(G1(t.n),G1(e.n))}function W1(t){return(t||"").split(/:/).pop().split("/").pop()||"\0"}function G1(t){return(t||"").replace(/\W/g,e=>String.fromCharCode(127+e.charCodeAt(0)))+"\0"}function fa(t,e){return Math.round(parseInt(t,16)*e)}function Se(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,a=[17,1,.062272][s-1];return`rgba(${[fa(t.substr(1,s),a),fa(t.substr(1+s,s),a),fa(t.substr(1+2*s,s),a),i]})`}return i=="1"?t:i=="0"?"#0000":t.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${i})`)}function r0(t,e,r,n,i=[]){return(function s(a,{n:u,p:l,r:c=[],i:p},m){let v=[],b="",S=0,T=0;for(let C in a||{}){var k,A;let M=a[C];if(C[0]=="@"){if(!M)continue;if(C[1]=="a"){v.push(...$a(u,l,Gi(""+M),m,l,c,p,!0));continue}if(C[1]=="l"){for(let L of B(M))v.push(...s(L,{n:u,p:(k=re[C[7]],l&~re.o|k),r:C[7]=="d"?[]:c,i:p},m));continue}if(C[1]=="i"){v.push(...B(M).map(L=>({p:-1,o:0,r:[],d:C+" "+L})));continue}if(C[1]=="k"){v.push({p:re.d,o:0,r:[C],d:s(M,{p:re.d},m).map(wa).join("")});continue}if(C[1]=="f"){v.push(...B(M).map(L=>({p:re.d,o:0,r:[C],d:s(L,{p:re.d},m).map(wa).join("")})));continue}}if(typeof M!="object"||Array.isArray(M))C=="label"&&M?u=M+Zi(JSON.stringify([l,p,a])):(M||M===0)&&(C=C.replace(/[A-Z]/g,L=>"-"+L.toLowerCase()),T+=1,S=Math.max(S,(A=C)[0]=="-"?0:X1(A)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(A)?+!!RegExp.$1||-!!RegExp.$2:0)+1),b+=(b?";":"")+B(M).map(L=>m.s(C,Ca(""+L,m.theme)+(p?" !important":""))).join(";"));else if(C[0]=="@"||C.includes("&")){let L=l;C[0]=="@"&&(C=C.replace(/\bscreen\(([^)]+)\)/g,(N,ee)=>{let se=m.theme("screens",ee);return se?(L|=67108864,Ji(se,"")):N}),L|=ga(C)),v.push(...s(M,{n:u,p:L,r:[...c,C],i:p},m))}else v.push(...s(M,{p:l,r:[...c,C]},m))}return v.unshift({n:u,p:l,o:Math.max(0,15-T)+1.5*Math.min(S||15,15),r:c,d:b}),v.sort(t0)})(t,ka(e,r,n,i),r)}function Ca(t,e){return t.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(r,n,i,s,a="")=>{let u=e(i,a);return typeof u=="function"&&/color|fill|stroke/i.test(i)?Se(u):""+B(u).filter(l=>Object(l)!==l)})}function n0(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 Wi(t,e,r=re.u,n,i){let s=[];for(let a of t)for(let u of(function(l,c,p,m,v){l={...l,i:l.i||v};let b=(function(S,T){let k=Q1.get(S.n);return k?k(S,T):T.r(S.n,S.v[0]=="dark")})(l,c);return b?typeof b=="string"?({r:m,p}=ka(l,c,p,m),n0(Wi(Gi(b),c,p,m,l.i),l.n)):Array.isArray(b)?b.map(S=>{var T,k;return{o:0,...S,r:[...B(m),...B(S.r)],p:(T=p,k=S.p??p,T&~re.o|k)}}):r0(b,l,c,p,m):[{c:ba(l),p:0,o:0,r:[]}]})(a,e,r,n,i))s.splice(e0(s,u),0,u);return s}function $a(t,e,r,n,i,s,a,u){return n0((u?r.flatMap(l=>Wi([l],n,i,s,a)):Wi(r,n,i,s,a)).map(l=>l.p&re.o&&(l.n||e==re.b)?{...l,p:l.p&~re.o|e,o:0}:l),t)}function H2(t,e,r,n){var i;return i=(s,a)=>{let{n:u,p:l,r:c,i:p}=ka(s,a,e);return r&&$a(u,e,r,a,l,c,p,n)},Q1.set(t,i),t}function ma(t,e,r){if(t[t.length-1]!="("){let n=[],i=!1,s=!1,a="";for(let u of t)if(!(u=="("||/[~@]$/.test(u))){if(u[0]=="!"&&(u=u.slice(1),i=!i),u.endsWith(":")){n[u=="dark:"?"unshift":"push"](u.slice(0,-1));continue}u[0]=="-"&&(u=u.slice(1),s=!s),u.endsWith("-")&&(u=u.slice(0,-1)),u&&u!="&"&&(a+=(a&&"-")+u)}a&&(s&&(a="-"+a),e[0].push({n:a,v:n.filter(q2),i}))}}function q2(t,e,r){return r.indexOf(t)==e}var J1=new Map;function Gi(t){let e=J1.get(t);if(!e){let r=[],n=[[]],i=0,s=0,a=null,u=0,l=(c,p=0)=>{i!=u&&(r.push(t.slice(i,u+p)),c&&ma(r,n)),i=u+1};for(;u<t.length;u++){let c=t[u];if(s)t[u-1]!="\\"&&(s+=+(c=="[")||-(c=="]"));else if(c=="[")s+=1;else if(a)t[u-1]!="\\"&&a.test(t.slice(u))&&(a=null,i=u+RegExp.lastMatch.length);else if(c=="/"&&t[u-1]!="\\"&&(t[u+1]=="*"||t[u+1]=="/"))a=t[u+1]=="*"?/^\*\//:/^[\r\n]/;else if(c=="(")l(),r.push(c);else if(c==":")t[u+1]!=":"&&l(!1,1);else if(/[\s,)]/.test(c)){l(!0);let p=r.lastIndexOf("(");if(c==")"){let m=r[p-1];if(/[~@]$/.test(m)){let v=n.shift();r.length=p,ma([...r,"#"],n);let{v:b}=n[0].pop();for(let S of v)S.v.splice(+(S.v[0]=="dark")-+(b[0]=="dark"),b.length);ma([...r,H2(m.length>1?m.slice(0,-1)+Zi(JSON.stringify([m,v])):m+"("+V2(v)+")",re.a,v,/@$/.test(m))],n)}p=r.lastIndexOf("(",p-1)}r.length=p+1}else/[~@]/.test(c)&&t[u+1]=="("&&n.unshift([])}l(!0),J1.set(t,e=n[0])}return e}function y(t,e,r){return[t,va(e,r)]}function va(t,e){return typeof t=="function"?t:typeof t=="string"&&/^[\w-]+$/.test(t)?(r,n)=>({[t]:e?e(r,n):ya(r,1)}):r=>t||{[r[1]]:ya(r,2)}}function ya(t,e,r=t.slice(e).find(Boolean)||t.$$||t.input){return t.input[0]=="-"?`calc(${r} * -1)`:r}function x(t,e,r,n){return[t,Sa(e,r,n)]}function Sa(t,e,r){let n=typeof e=="string"?(i,s)=>({[e]:r?r(i,s):i._}):e||(({1:i,_:s},a,u)=>({[i||u]:s}));return(i,s)=>{let a=i0(t||i[1]),u=s.theme(a,i.$$)??Ue(i.$$,a,s);if(u!=null)return i._=ya(i,0,u),n(i,s,a)}}function ne(t,e={},r){return[t,z2(e,r)]}function z2(t={},e){return(r,n)=>{let{section:i=i0(r[0]).replace("-","")+"Color"}=t,[s,a]=F2(r.$$);if(!s)return;let u=n.theme(i,s)||Ue(s,i,n);if(!u||typeof u=="object")return;let{opacityVariable:l=`--tw-${r[0].replace(/-$/,"")}-opacity`,opacitySection:c=i.replace("Color","Opacity"),property:p=i,selector:m}=t,v=n.theme(c,a||"DEFAULT")||a&&Ue(a,c,n),b=e||(({_:T})=>{let k=$n(p,T);return m?{[m]:k}:k});r._={value:Se(u,{opacityVariable:l||void 0,opacityValue:v||void 0}),color:T=>Se(u,T),opacityVariable:l||void 0,opacityValue:v||void 0};let S=b(r,n);if(!r.dark){let T=n.d(i,s,u);T&&T!==u&&(r._={value:Se(T,{opacityVariable:l||void 0,opacityValue:v||"1"}),color:k=>Se(T,k),opacityVariable:l||void 0,opacityValue:v||void 0},S={"&":S,[n.v("dark")]:b(r,n)})}return S}}function F2(t){return(t.match(/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/)||[]).slice(1)}function $n(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 Ue(t,e,r){if(t[0]=="["&&t.slice(-1)=="]"){if(t=mr(Ca(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 i0(t){return t.replace(/-./g,e=>e[1].toUpperCase())}function mr(t){return t.includes("url(")?t.replace(/(.*?)(url\(.*?\))(.*?)/g,(e,r="",n,i="")=>mr(r)+n+mr(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 Sn({presets:t=[],...e}){let r={darkMode:void 0,darkColor:void 0,preflight:e.preflight!==!1&&[],theme:{},variants:B(e.variants),rules:B(e.rules),ignorelist:B(e.ignorelist),hash:void 0,stringify:(n,i)=>n+":"+i,finalize:[]};for(let n of B([...t,{darkMode:e.darkMode,darkColor:e.darkColor,preflight:e.preflight!==!1&&B(e.preflight),theme:e.theme,hash:e.hash,stringify:e.stringify,finalize:e.finalize}])){let{preflight:i,darkMode:s=r.darkMode,darkColor:a=r.darkColor,theme:u,variants:l,rules:c,ignorelist:p,hash:m=r.hash,stringify:v=r.stringify,finalize:b}=typeof n=="function"?n(r):n;r={preflight:r.preflight!==!1&&i!==!1&&[...r.preflight,...B(i)],darkMode:s,darkColor:a,theme:{...r.theme,...u,extend:{...r.theme.extend,...u?.extend}},variants:[...r.variants,...B(l)],rules:[...r.rules,...B(c)],ignorelist:[...r.ignorelist,...B(p)],hash:m,stringify:v,finalize:[...r.finalize,...B(b)]}}return r}function K1(t,e,r,n,i,s){for(let a of e){let u=r.get(a);u||r.set(a,u=n(a));let l=u(t,i,s);if(l)return l}}function N2(t){var e;return xa(t[0],typeof(e=t[1])=="function"?e:()=>e)}function Z2(t){var e,r;return Array.isArray(t)?xa(t[0],va(t[1],t[2])):xa(t,va(e,r))}function xa(t,e){return s0(t,(r,n,i,s)=>{let a=n.exec(r);if(a)return a.$$=r.slice(a[0].length),a.dark=s,e(a,i)})}function s0(t,e){let r=B(t).map(W2);return(n,i,s)=>{for(let a of r){let u=e(n,a,i,s);if(u)return u}}}function W2(t){return typeof t=="string"?RegExp("^"+t+(t.includes("$")||t.slice(-1)=="-"?"":"$")):t}function o0(t,e){let r=Sn(t),n=(function({theme:l,darkMode:c,darkColor:p=Ki,variants:m,rules:v,hash:b,stringify:S,ignorelist:T,finalize:k}){let A=new Map,C=new Map,M=new Map,L=new Map,N=s0(T,(R,oe)=>oe.test(R));m.push(["dark",Array.isArray(c)||c=="class"?`${B(c)[1]||".dark"} &`:typeof c=="string"&&c!="media"?c:"@media (prefers-color-scheme:dark)"]);let ee=typeof b=="function"?R=>b(R,Zi):b?Zi:N1;ee!==N1&&k.push(R=>({...R,n:R.n&&ee(R.n),d:R.d?.replace(/--(tw(?:-[\w-]+)?)\b/g,(oe,de)=>"--"+ee(de).replace("#",""))}));let se={theme:(function({extend:R={},...oe}){let de={},Mo={get colors(){return gt("colors")},theme:gt,negative(){return{}},breakpoints(J){let le={};for(let we in J)typeof J[we]=="string"&&(le["screen-"+we]=J[we]);return le}};return gt;function gt(J,le,we,tn){if(J){if({1:J,2:tn}=/^(\S+?)(?:\s*\/\s*([^/]+))?$/.exec(J)||[,J],/[.[]/.test(J)){let ze=[];J.replace(/\[([^\]]+)\]|([^.[]+)/g,(vt,nn,Gu=nn)=>ze.push(Gu)),J=ze.shift(),we=le,le=ze.join("-")}let Pe=de[J]||Object.assign(Object.assign(de[J]={},Si(oe,J)),Si(R,J));if(le==null)return Pe;le||(le="DEFAULT");let wt=Pe[le]??le.split("-").reduce((ze,vt)=>ze?.[vt],Pe)??we;return tn?Se(wt,{opacityValue:Ca(tn,gt)}):wt}let rn={};for(let Pe of[...Object.keys(oe),...Object.keys(R)])rn[Pe]=gt(Pe);return rn}function Si(J,le){let we=J[le];return typeof we=="function"&&(we=we(Mo)),we&&/color|fill|stroke/i.test(le)?(function tn(rn,Pe=[]){let wt={};for(let ze in rn){let vt=rn[ze],nn=[...Pe,ze];wt[nn.join("-")]=vt,ze=="DEFAULT"&&(nn=Pe,wt[Pe.join("-")]=vt),typeof vt=="object"&&Object.assign(wt,tn(vt,nn))}return wt})(we):we}})(l),e:Y1,h:ee,s(R,oe){return S(R,oe,se)},d(R,oe,de){return p(R,oe,se,de)},v(R){return A.has(R)||A.set(R,K1(R,m,C,N2,se)||"&:"+R),A.get(R)},r(R,oe){let de=JSON.stringify([R,oe]);return M.has(de)||M.set(de,!N(R,se)&&K1(R,v,L,Z2,se,oe)),M.get(de)},f(R){return k.reduce((oe,de)=>de(oe,se),R)}};return se})(r),i=new Map,s=[],a=new Set;e.resume(l=>i.set(l,l),(l,c)=>{e.insert(l,s.length,c),s.push(c),a.add(l)});function u(l){let c=n.f(l),p=wa(c);if(p&&!a.has(p)){a.add(p);let m=e0(s,l);e.insert(p,m,l),s.splice(m,0,l)}return c.n}return Object.defineProperties(function(c){if(!i.size)for(let m of B(r.preflight))typeof m=="function"&&(m=m(n)),m&&(typeof m=="string"?$a("",re.b,Gi(m),n,re.b,[],!1,!0):r0(m,{},n,re.b)).forEach(u);c=""+c;let p=i.get(c);if(!p){let m=new Set;for(let v of Wi(Gi(c),n))m.add(v.c).add(u(v));p=[...m].filter(Boolean).join(" "),i.set(c,p).set(p,p)}return p},Object.getOwnPropertyDescriptors({get target(){return e.target},theme:n.theme,config:r,snapshot(){let l=e.snapshot(),c=new Set(a),p=new Map(i),m=[...s];return()=>{l(),a=c,i=p,s=m}},clear(){e.clear(),a=new Set,i=new Map,s=[]},destroy(){this.clear(),e.destroy()}}))}function G2(t,e){return t!=e&&""+t.split(" ").sort()!=""+e.split(" ").sort()}function a0(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:a}of i)if(s[0]=="a")n(a);else for(let u of a.querySelectorAll("[class]"))n(u);e.takeRecords()}function n(i){let s,a=i.getAttribute?.("class");a&&G2(a,s=t(a))&&i.setAttribute("class",s)}}function J2(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 Yi(t){let e=t?.cssRules?t:(t&&typeof t!="string"?t:J2(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:Ki}}var K2=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 l0(t){return K2.get(t)}function c0(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 u0(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 Y2=[["-webkit-",1],["-moz-",2],["-ms-",4]];function Xi(){return({stringify:t})=>({stringify(e,r,n){let i="",s=l0(e);s&&(i+=t(s,r,n)+";");let a=c0(e),u=u0(e,r);for(let l of Y2)a&l[1]&&(i+=t(l[0]+e,r,n)+";"),u&l[1]&&(i+=t(e,l[0]+r,n)+";");return i+t(e,r,n)}})}function Qi(){return{rules:[["line-clamp-none",{"-webkit-line-clamp":"unset"}],["line-clamp-",Sa("lineClamp",({_:t})=>h0(t))],["line-clamp-(\\d+)",({1:t})=>h0(t)]]}}function h0(t){return{overflow:"hidden",display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":`${t}`}}var _n={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:U("blur"),backdropBrightness:U("brightness"),backdropContrast:U("contrast"),backdropGrayscale:U("grayscale"),backdropHueRotate:U("hueRotate"),backdropInvert:U("invert"),backdropOpacity:U("opacity"),backdropSaturate:U("saturate"),backdropSepia:U("sepia"),backgroundColor:U("colors"),backgroundImage:{none:"none"},backgroundOpacity:U("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:t})=>({DEFAULT:t("colors.gray.200","currentColor"),...t("colors")}),borderOpacity:U("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:U("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:U("colors"),caretColor:U("colors"),accentColor:({theme:t})=>({auto:"auto",...t("colors")}),contrast:{...be(200,"",100,0,50),75:"0.75",125:"1.25"},content:{none:"none"},divideColor:U("borderColor"),divideOpacity:U("borderOpacity"),divideWidth:U("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"),...En(2,6),...En(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:U("spacing"),gradientColorStops:U("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"),...En(2,6),min:"min-content",max:"max-content",fit:"fit-content",auto:"auto",full:"100%",screen:"100vh"}),inset:({theme:t})=>({...t("spacing"),...En(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: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:{...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:U("spacing"),placeholderColor:U("colors"),placeholderOpacity:U("opacity"),outlineColor:U("colors"),outlineOffset:Ee(8,"px"),outlineWidth:Ee(8,"px"),ringColor:({theme:t})=>({...t("colors"),DEFAULT:"#3b82f6"}),ringOffsetColor:U("colors"),ringOffsetWidth:Ee(8,"px"),ringOpacity:({theme:t})=>({...t("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:U("spacing"),scrollPadding:U("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{...Ee(2,"deg"),...Ee(12,"deg",3)},space:U("spacing"),stroke:({theme:t})=>({...t("colors"),none:"none"}),strokeWidth:be(2),textColor:U("colors"),textDecorationColor:U("colors"),textDecorationThickness:{"from-font":"from-font",auto:"auto",...Ee(8,"px")},textUnderlineOffset:{auto:"auto",...Ee(8,"px")},textIndent:U("spacing"),textOpacity:U("opacity"),transitionDuration:({theme:t})=>({...t("durations"),DEFAULT:"150ms"}),transitionDelay:U("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"),...En(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:{...be(50,"",1,0,10),auto:"auto"}};function En(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 Ee(t,e,r=0){let n={};for(;r<=t;r=2*r||1)n[r]=r+e;return n}function be(t,e="",r=1,n=0,i=1,s={}){for(;n<=t;n+=i)s[n]=n/r+e;return s}function U(t){return({theme:e})=>e(t)}var p0={"*,::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, ${_n.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, ${_n.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 v0=[y("\\[([-\\w]+):(.+)]",({1:t,2:e},r)=>({"@layer overrides":{"&":{[t]:Ue(`[${e}]`,"",r)}}})),y("(group|peer)([~/][^-[]+)?",({input:t},{h:e})=>[{c:e(t)}]),x("aspect-","aspectRatio"),y("container",(t,{theme:e})=>{let{screens:r=e("screens"),center:n,padding:i}=e("container"),s={width:"100%",marginRight:n&&"auto",marginLeft:n&&"auto",...a("xs")};for(let u in r){let l=r[u];typeof l=="string"&&(s[Ji(l)]={"&":{maxWidth:l,...a(u)}})}return s;function a(u){let l=i&&(typeof i=="string"?i:i[u]||i.DEFAULT);if(l)return{paddingRight:l,paddingLeft:l}}}),x("content-","content",({_:t})=>({"--tw-content":t,content:"var(--tw-content)"})),y("(?:box-)?decoration-(slice|clone)","boxDecorationBreak"),y("box-(border|content)","boxSizing",({1:t})=>t+"-box"),y("hidden",{display:"none"}),y("table-(auto|fixed)","tableLayout"),y(["(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)",y("isolate","isolation"),y("object-(contain|cover|fill|none|scale-down)","objectFit"),x("object-","objectPosition"),y("object-(top|bottom|center|(left|right)(-(top|bottom))?)","objectPosition",es),y("overscroll(-[xy])?-(auto|contain|none)",({1:t="",2:e})=>({["overscroll-behavior"+t]:e})),y("(static|fixed|absolute|relative|sticky)","position"),x("-?inset(-[xy])?(?:$|-)","inset",({1:t,_:e})=>({top:t!="-x"&&e,right:t!="-y"&&e,bottom:t!="-x"&&e,left:t!="-y"&&e})),x("-?(top|bottom|left|right)(?:$|-)","inset"),y("(visible|collapse)","visibility"),y("invisible",{visibility:"hidden"}),x("-?z-","zIndex"),y("flex-((row|col)(-reverse)?)","flexDirection",d0),y("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"),y("grid-cols-(\\d+)","gridTemplateColumns",w0),x("col-","gridColumn"),y("col-(span)-(\\d+)","gridColumn",g0),x("col-start-","gridColumnStart"),y("col-start-(auto|\\d+)","gridColumnStart"),x("col-end-","gridColumnEnd"),y("col-end-(auto|\\d+)","gridColumnEnd"),x("grid-rows-","gridTemplateRows"),y("grid-rows-(\\d+)","gridTemplateRows",w0),x("row-","gridRow"),y("row-(span)-(\\d+)","gridRow",g0),x("row-start-","gridRowStart"),y("row-start-(auto|\\d+)","gridRowStart"),x("row-end-","gridRowEnd"),y("row-end-(auto|\\d+)","gridRowEnd"),y("grid-flow-((row|col)(-dense)?)","gridAutoFlow",t=>es(d0(t))),y("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))-",y("justify-","justifyContent",f0),y("(content|items|self)-",t=>({["align-"+t[1]]:f0(t)})),y("(place-(content|items|self))-",({1:t,$$:e})=>({[t]:("wun".includes(e[3])?"space-":"")+e})),x("p([xytrbl])?(?:$|-)","padding",gr("padding")),x("-?m([xytrbl])?(?:$|-)","margin",gr("margin")),x("-?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))`}})),y("space-(x|y)-reverse",({1:t})=>({"&>:not([hidden])~:not([hidden])":{[`--tw-space-${t}-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",({_:t})=>typeof(t=B(t))[1]=="string"?{fontFamily:je(t)}:{fontFamily:je(t[0]),...t[1]}),y("antialiased",{WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"}),y("subpixel-antialiased",{WebkitFontSmoothing:"auto",MozOsxFontSmoothing:"auto"}),y("italic","fontStyle"),y("not-italic",{fontStyle:"normal"}),y("(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)",...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"),y("list-(inside|outside)","listStylePosition"),x("list-","listStyleType"),y("list-","listStyleType"),x("placeholder-opacity-","placeholderOpacity",({_:t})=>({"&::placeholder":{"--tw-placeholder-opacity":t}})),ne("placeholder-",{property:"color",selector:"&::placeholder"}),y("text-(left|center|right|justify|start|end)","textAlign"),y("text-(ellipsis|clip)","textOverflow"),x("text-opacity-","textOpacity","--tw-text-opacity"),ne("text-",{property:"color"}),x("text-","fontSize",({_:t})=>typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}),x("indent-","textIndent"),y("(overline|underline|line-through)","textDecorationLine"),y("no-underline",{textDecorationLine:"none"}),x("underline-offset-","textUnderlineOffset"),ne("decoration-",{section:"textDecorationColor",opacityVariable:!1,opacitySection:"opacity"}),x("decoration-","textDecorationThickness"),y("decoration-","textDecorationStyle"),y("(uppercase|lowercase|capitalize)","textTransform"),y("normal-case",{textTransform:"none"}),y("truncate",{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}),y("align-","verticalAlign"),y("whitespace-","whiteSpace"),y("break-normal",{wordBreak:"normal",overflowWrap:"normal"}),y("break-words",{overflowWrap:"break-word"}),y("break-all",{wordBreak:"break-all"}),y("break-keep",{wordBreak:"keep-all"}),ne("caret-",{opacityVariable:!1,opacitySection:"opacity"}),ne("accent-",{opacityVariable:!1,opacitySection:"opacity"}),y("bg-gradient-to-([trbl]|[tb][rl])","backgroundImage",({1:t})=>`linear-gradient(to ${At(t," ")},var(--tw-gradient-stops))`),ne("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)"})),ne("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)`})),ne("to-",{section:"gradientColorStops",property:"--tw-gradient-to",opacityVariable:!1,opacitySection:"opacity"}),y("bg-(fixed|local|scroll)","backgroundAttachment"),y("bg-origin-(border|padding|content)","backgroundOrigin",({1:t})=>t+"-box"),y(["bg-(no-repeat|repeat(-[xy])?)","bg-repeat-(round|space)"],"backgroundRepeat"),y("bg-blend-","backgroundBlendMode"),y("bg-clip-(border|padding|content|text)","backgroundClip",({1:t})=>t+(t=="text"?"":"-box")),x("bg-opacity-","backgroundOpacity","--tw-bg-opacity"),ne("bg-",{section:"backgroundColor"}),x("bg-","backgroundImage"),x("bg-","backgroundPosition"),y("bg-(top|bottom|center|(left|right)(-(top|bottom))?)","backgroundPosition",es),x("bg-","backgroundSize"),x("rounded(?:$|-)","borderRadius"),x("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-${At(r[0])}-radius`]:e,[`border-${At(r[1])}-radius`]:e}}),y("border-(collapse|separate)","borderCollapse"),x("border-opacity(?:$|-)","borderOpacity","--tw-border-opacity"),y("border-(solid|dashed|dotted|double|none)","borderStyle"),x("border-spacing(-[xy])?(?:$|-)","borderSpacing",({1:t,_:e})=>({...rt({"--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)"})),ne("border-([xytrbl])-",{section:"borderColor"},gr("border","Color")),ne("border-"),x("border-([xytrbl])(?:$|-)","borderWidth",gr("border","Width")),x("border(?:$|-)","borderWidth"),x("divide-opacity(?:$|-)","divideOpacity",({_:t})=>({"&>:not([hidden])~:not([hidden])":{"--tw-divide-opacity":t}})),y("divide-(solid|dashed|dotted|double|none)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{borderStyle:t}})),y("divide-([xy]-reverse)",({1:t})=>({"&>:not([hidden])~:not([hidden])":{["--tw-divide-"+t]:"1"}})),x("divide-([xy])(?:$|-)","divideWidth",({1:t,_:e})=>{let r={x:"lr",y:"tb"}[t];return{"&>:not([hidden])~:not([hidden])":{[`--tw-divide-${t}-reverse`]:"0",[`border-${At(r[0])}Width`]:`calc(${e} * calc(1 - var(--tw-divide-${t}-reverse)))`,[`border-${At(r[1])}Width`]:`calc(${e} * var(--tw-divide-${t}-reverse))`}}}),ne("divide-",{property:"borderColor",selector:"&>:not([hidden])~:not([hidden])"}),x("ring-opacity(?:$|-)","ringOpacity","--tw-ring-opacity"),ne("ring-offset-",{property:"--tw-ring-offset-color",opacityVariable:!1}),x("ring-offset(?:$|-)","ringOffsetWidth","--tw-ring-offset-width"),y("ring-inset",{"--tw-ring-inset":"inset"}),ne("ring-",{property:"--tw-ring-color"}),x("ring(?:$|-)","ringWidth",({_:t},{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(${t} + var(--tw-ring-offset-width)) var(--tw-ring-color)`,boxShadow:"var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)"})),ne("shadow-",{section:"boxShadowColor",opacityVariable:!1,opacitySection:"opacity"},({_:t})=>({"--tw-shadow-color":t.value,"--tw-shadow":"var(--tw-shadow-colored)"})),x("shadow(?:$|-)","boxShadow",({_:t})=>({...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":je(t),"--tw-shadow-colored":je(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)"})),x("(opacity)-"),y("mix-blend-","mixBlendMode"),...m0(),...m0("backdrop-"),x("transition(?:$|-)","transitionProperty",(t,{theme:e})=>({transitionProperty:je(t),transitionTimingFunction:t._=="none"?void 0:je(e("transitionTimingFunction","")),transitionDuration:t._=="none"?void 0:je(e("transitionDuration",""))})),x("duration(?:$|-)","transitionDuration","transitionDuration",je),x("ease(?:$|-)","transitionTimingFunction","transitionTimingFunction",je),x("delay(?:$|-)","transitionDelay","transitionDelay",je),x("animate(?:$|-)","animation",(t,{theme:e,h:r,e:n})=>{let i=je(t),s=i.split(" "),a=e("keyframes",s[0]);return a?{["@keyframes "+(s[0]=n(r(s[0])))]:a,animation:s.join(" ")}:{animation:i}}),"(transform)-(none)",y("transform",_a),y("transform-(cpu|gpu)",({1:t})=>({"--tw-transform":y0(t=="gpu")})),x("scale(-[xy])?-","scale",({1:t,_:e})=>({["--tw-scale"+(t||"-x")]:e,["--tw-scale"+(t||"-y")]:e,..._a()})),x("-?(rotate)-","rotate",Ea),x("-?(translate-[xy])-","translate",Ea),x("-?(skew-[xy])-","skew",Ea),y("origin-(center|((top|bottom)(-(left|right))?)|left|right)","transformOrigin",es),"(appearance)-",x("(columns)-"),"(columns)-(\\d+)","(break-(?:before|after|inside))-",x("(cursor)-"),"(cursor)-",y("snap-(none)","scroll-snap-type"),y("snap-(x|y|both)",({1:t})=>({...rt({"--tw-scroll-snap-strictness":"proximity"}),"scroll-snap-type":t+" var(--tw-scroll-snap-strictness)"})),y("snap-(mandatory|proximity)","--tw-scroll-snap-strictness"),y("snap-(?:(start|end|center)|align-(none))","scroll-snap-align"),y("snap-(normal|always)","scroll-snap-stop"),y("scroll-(auto|smooth)","scroll-behavior"),x("scroll-p([xytrbl])?(?:$|-)","padding",gr("scroll-padding")),x("-?scroll-m([xytrbl])?(?:$|-)","scroll-margin",gr("scroll-margin")),y("touch-(auto|none|manipulation)","touch-action"),y("touch-(pinch-zoom|pan-(?:(x|left|right)|(y|up|down)))",({1:t,2:e,3:r})=>({...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":r?"pan-y":t}`]:t,"touch-action":"var(--tw-touch-action)"})),y("outline-none",{outline:"2px solid transparent","outline-offset":"2px"}),y("outline",{outlineStyle:"solid"}),y("outline-(dashed|dotted|double)","outlineStyle"),x("-?(outline-offset)-"),ne("outline-",{opacityVariable:!1,opacitySection:"opacity"}),x("outline-","outlineWidth"),"(pointer-events)-",x("(will-change)-"),"(will-change)-",["resize(?:-(none|x|y))?","resize",({1:t})=>({x:"horizontal",y:"vertical"})[t]||t||"both"],y("select-(none|text|all|auto)","userSelect"),ne("fill-",{section:"fill",opacityVariable:!1,opacitySection:"opacity"}),ne("stroke-",{section:"stroke",opacityVariable:!1,opacitySection:"opacity"}),x("stroke-","strokeWidth"),y("sr-only",{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0,0,0,0)",borderWidth:"0"}),y("not-sr-only",{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",whiteSpace:"normal",clip:"auto"})];function es(t){return(typeof t=="string"?t:t[1]).replace(/-/g," ").trim()}function d0(t){return(typeof t=="string"?t:t[1]).replace("col","column")}function At(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 je(t){return t&&""+(t._||t)}function f0({$$:t}){return({r:"flex-","":"flex-",w:"space-",u:"space-",n:"space-"}[t[3]||""]||"")+t}function gr(t,e=""){return({1:r,_:n})=>{let i={x:"lr",y:"tb"}[r]||r+r;return i?{...$n(t+"-"+At(i[0])+e,n),...$n(t+"-"+At(i[1])+e,n)}:$n(t+e,n)}}function m0(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={...rt(r),[`${t}filter`]:e.map(n=>`var(--tw-${t}${n})`).join(" ")},[`(${t}filter)-(none)`,y(`${t}filter`,r),...e.map(n=>x(`${n[0]=="h"?"-?":""}(${t}${n})(?:$|-)`,n,({1:i,_:s})=>({[`--tw-${i}`]:B(s).map(a=>`${n}(${a})`).join(" "),...r})))]}function Ea({1:t,_:e}){return{["--tw-"+t]: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":y0()}),transform:"var(--tw-transform)"}}function y0(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 g0({1:t,2:e}){return`${t} ${e} / ${t} ${e}`}function w0({1:t}){return`repeat(${t},minmax(0,1fr))`}function rt(t){return{"@layer defaults":{"*,::before,::after":t,"::backdrop":t}}}var x0=[["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)||Ue(e,"",r)||`${e}="true"`}]`],["((group|peer)(~[^-[]+)?)(-\\[(.+)]|[-[].+?)(\\/.+)?",({2:t,3:e="",4:r,5:n="",6:i=e},{e:s,h:a,v:u})=>{let l=mr(n)||(r[0]=="["?r:u(r.slice(1)));return`${(l.includes("&")?l:"&"+l).replace(/&/g,`:merge(.${s(a(t+i))})`)}${t[0]=="p"?"~":" "}&`}],["(ltr|rtl)",({1:t})=>`[dir="${t}"] &`],["supports-",({$$:t},e)=>{if(t&&(t=e.theme("supports",t)||Ue(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)||Ue(t,"",e)),typeof t=="string")return`@media not all and (min-width:${t})`}],["min-",({$$:t},e)=>(t&&(t=Ue(t,"",e)),t&&`@media (min-width:${t})`)],[/^\[(.+)]$/,({1:t})=>/[&@]/.test(t)&&mr(t).replace(/[}]+$/,"").split("{")]];function b0({colors:t,disablePreflight:e}={}){return{preflight:e?void 0:p0,theme:{..._n,colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",...t}},variants:x0,rules:v0,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 X2={50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a"},Q2={50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827"},eh={50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b"},th={50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717"},rh={50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917"},nh={50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},ih={50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12"},sh={50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f"},oh={50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},ah={50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314"},lh={50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},ch={50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b"},uh={50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a"},hh={50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63"},ph={50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e"},dh={50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a"},fh={50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81"},mh={50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95"},gh={50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87"},wh={50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75"},vh={50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843"},yh={50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337"},k0={__proto__:null,slate:X2,gray:Q2,zinc:eh,neutral:th,stone:rh,red:nh,orange:ih,amber:sh,yellow:oh,lime:ah,green:lh,emerald:ch,teal:uh,cyan:hh,sky:ph,blue:dh,indigo:fh,violet:mh,purple:gh,fuchsia:wh,pink:vh,rose:yh};function ts({disablePreflight:t}={}){return b0({colors:k0,disablePreflight:t})}function rs({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,a=s])=>[`${t}-${s}`,(u,l)=>S0(t,a[0]=="."?"."+l.e(l.h(a.slice(1))):a,l,c=>`& :is(${c.trim()})`)]),rules:[[`(lead|not-${t})`,({1:s},{h:a})=>[{c:a(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},a)=>{let u=$0(a.theme("fontSize",s));return u&&{"@layer components":u}}],[t+"-",({$$:s},a)=>i(s,a)],[t,(s,a)=>({...i(e,a),"@layer base":[C0(t,a,{a:{color:"var(--tw-prose-links)",textDecorationLine:"underline",fontWeight:"500"},strong:{color:"var(--tw-prose-bold)",fontWeight:"600"},"a strong,blockquote strong,thead th strong":{color:"inherit"},ul:{listStyleType:"disc"},ol:{listStyleType:"decimal"},'ol[type="A"]':{listStyleType:"upper-alpha"},'ol[type="a"]':{listStyleType:"lower-alpha"},'ol[type="A" s]':{listStyleType:"upper-alpha"},'ol[type="a" s]':{listStyleType:"lower-alpha"},'ol[type="I"]':{listStyleType:"upper-roman"},'ol[type="i"]':{listStyleType:"lower-roman"},'ol[type="I" s]':{listStyleType:"upper-roman"},'ol[type="i" s]':{listStyleType:"lower-roman"},'ol[type="1"]':{listStyleType:"decimal"},"ol,ul":{marginTop:E(20,16),marginBottom:E(20,16),paddingLeft:E(26,16)},li:{marginTop:E(8,16),marginBottom:E(8,16)},"ol>li,ul>li":{paddingLeft:E(6,16)},">ul>li p":{marginTop:E(12,16),marginBottom:E(12,16)},">ul>li>*:first-child,>ol>li>*:last-child":{marginTop:E(20,16)},">ul>li>*:last-child,>ol>li>*:last-child":{marginBottom:E(20,16)},"ol>li::marker":{fontWeight:"400",color:"var(--tw-prose-counters)"},"ul>li::marker":{color:"var(--tw-prose-bullets)"},"ul ul,ul ol,ol ul,ol ol":{marginTop:E(12,16),marginBottom:E(12,16)},hr:{borderColor:"var(--tw-prose-hr)",borderTopWidth:"1",marginTop:E(48,16),marginBottom:E(48,16)},blockquote:{marginTop:E(32,20),marginBottom:E(32,20),paddingLeft:E(20,20),fontWeight:"500",fontStyle:"italic",color:"var(--tw-prose-quotes)",borderLeftWidth:"0.25rem",borderLeftColor:"var(--tw-prose-quote-borders)",quotes:'"\\201C""\\201D""\\2018""\\2019"'},"blockquote p:first-of-type::before":{content:"open-quote"},"blockquote p:last-of-type::after":{content:"close-quote"},p:{marginTop:E(20,16),marginBottom:E(20,16)},h1:{color:"var(--tw-prose-headings)",fontWeight:"800",fontSize:E(36,16),marginTop:"0",marginBottom:E(32,36),lineHeight:1.15},"h1 strong":{fontWeight:"900",color:"inherit"},h2:{color:"var(--tw-prose-headings)",fontWeight:"700",fontSize:E(24,16),marginTop:E(48,24),marginBottom:E(24,24),lineHeight:"1.35"},"h2 strong":{fontWeight:"800",color:"inherit"},h3:{color:"var(--tw-prose-headings)",fontWeight:"600",fontSize:E(20,16),marginTop:E(32,20),marginBottom:E(12,20),lineHeight:"1.6"},"h3 strong":{fontWeight:"700",color:"inherit"},h4:{color:"var(--tw-prose-headings)",fontWeight:"600",marginTop:E(24,16),marginBottom:E(8,16),lineHeight:"1.5"},"h4 strong":{fontWeight:"700",color:"inherit"},"hr+*,h2+*,h3+*,h4+*":{marginTop:"0"},"img,video,figure":{marginTop:E(32,16),marginBottom:E(32,16)},"figure>*":{marginTop:"0",marginBottom:"0"},figcaption:{color:"var(--tw-prose-captions)",fontSize:E(14,16),lineHeight:"1.4",marginTop:E(12,14)},code:{color:"var(--tw-prose-code)",fontWeight:"600",fontSize:E(14,16)},"code::before,code::after":{content:'"`"'},"h2 code":{fontSize:E(21,24)},"h3 code":{fontSize:E(18,20)},"a code,h1 code,h2 code,h3 code,h4 code,blockquote code,thead th code":{color:"inherit"},pre:{color:"var(--tw-prose-pre-code)",backgroundColor:"var(--tw-prose-pre-bg)",overflowX:"auto",fontWeight:"400",fontSize:E(14,16),lineHeight:"1.7",marginTop:E(24,14),marginBottom:E(24,14),borderRadius:"0.375rem",paddingTop:E(12,14),paddingRight:E(16,14),paddingBottom:E(12,14),paddingLeft:E(16,14)},"pre code":{backgroundColor:"transparent",borderWidth:"0",borderRadius:"0",padding:"0",fontWeight:"inherit",color:"inherit",fontSize:"inherit",fontFamily:"inherit",lineHeight:"inherit"},"pre code::before":{content:"none"},"pre code::after":{content:"none"},table:{width:"100%",tableLayout:"auto",textAlign:"left",marginTop:E(32,16),marginBottom:E(32,16),fontSize:E(14,16),lineHeight:"1.7"},thead:{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-th-borders)"},"thead th":{color:"var(--tw-prose-headings)",fontWeight:"600",verticalAlign:"bottom",paddingRight:E(8,14),paddingBottom:E(8,14),paddingLeft:E(8,14)},"thead th:first-child":{paddingLeft:"0"},"thead th:last-child":{paddingRight:"0"},"tbody tr":{borderBottomWidth:"1px",borderBottomColor:"var(--tw-prose-td-borders)"},"tbody tr:last-child":{borderBottomWidth:"0"},"tbody td,tfoot td":{verticalAlign:"baseline",paddingTop:E(8,14),paddingRight:E(8,14),paddingBottom:E(8,14),paddingLeft:E(8,14)},"tbody td:first-child,tfoot td:first-child":{paddingLeft:"0"},"tbody td:last-child,tfoot td:last-child":{paddingRight:"0"},[`.${a.e(a.h("lead"))}`]:{color:"var(--tw-prose-lead)",fontSize:E(20,16),lineHeight:"1.6",marginTop:E(24,20),marginBottom:E(24,20)},">:first-child":{marginTop:"0"},">:last-child":{marginBottom:"0"}}),C0(t,a,r)],"@layer components":{...$0(a.theme("fontSize","base")),color:"var(--tw-prose-body)",maxWidth:"theme(max-w.prose, 65ch)"}})]]};function i(s,a){let u={},l={},c=(p,m,v)=>{let b=a.theme(`colors.${s}.${m}`,m);v["--tw-prose-"+p]=Se(b);let S=v!=l&&a.d("colors",`${s}-${m}`,b);S&&(l["--tw-prose-"+p]=Se(S))};for(let p in n){let m=n[p];p!="dark"&&m&&c(p,m,u)}for(let p in n.dark||{}){let m=n.dark[p];m&&(n.dark?c("invert-"+p,m,u):c(p,m,l))}return Object.keys(u).length?{"@layer defaults":{"&":u,[a.v("dark")]:l}}:void 0}}function C0(t,e,r){let n={};for(let i in r)n[S0(t,i,e,s=>`.${e.e(e.h(t))}${s}`)]=r[i];return n}function S0(t,e,{e:r,h:n},i){return e.replace(/^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,(s,a=" ",u=s,l="")=>i(`${a}:where(${u}):not(:where(.${r(n("not-"+t))} *))${l}`))}function $0(t){return t?typeof t=="string"?{fontSize:t}:{fontSize:t[0],...typeof t[1]=="string"?{lineHeight:t[1]}:t[1]}:void 0}function E(t,e){return`${(t/e).toFixed(3).replace(/^0|\.?0+$/g,"")}em`}var Ma=Sn({hash:!1,darkMode:"class",theme:{extend:{colors:{violet:{DEFAULT:"#601feb",50:"#f3f2ff",100:"#eae7ff",200:"#d7d2ff",300:"#baaeff",400:"#9980ff",500:"#784dff",600:"#6829fe",700:"#601feb",800:"#4b12c5",900:"#3f11a1",950:"#25086d"},pink:{DEFAULT:"#ff0bbb",50:"#fff0fc",100:"#ffe3fc",200:"#ffc6f9",300:"#ff98f2",400:"#ff58e5",500:"#ff27d5",600:"#ff0bbb",700:"#df0095",800:"#b8007b",900:"#980368",950:"#5f003b"},lime:{DEFAULT:"#b9e901",50:"#fdffe4",100:"#f9ffc5",200:"#f1ff92",300:"#e2ff54",400:"#d1fa21",500:"#b9e901",600:"#8ab400",700:"#688902",800:"#526b09",900:"#465a0d",950:"#243300"}},spacing:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},padding:{px:"1px",0:"0",.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},lineHeight:{3:"12px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px"},maxWidth:{xs:"320px",sm:"384px",md:"448px",lg:"512px",xl:"576px","2xl":"672px","3xl":"768px","4xl":"896px","5xl":"1024px","6xl":"1152px","7xl":"1280px"},maxHeight:{.5:"2px",1:"4px",1.5:"6px",2:"8px",2.5:"10px",3:"12px",3.5:"14px",4:"16px",5:"20px",6:"24px",7:"28px",8:"32px",9:"36px",10:"40px",11:"44px",12:"48px",14:"56px",16:"64px",20:"80px",24:"96px",28:"112px",32:"128px",36:"144px",40:"160px",44:"176px",48:"192px",52:"208px",56:"224px",60:"240px",64:"256px",72:"288px",80:"320px",96:"384px"},borderRadius:{sm:"2px",DEFAULT:"4px",md:"6px",lg:"8px",xl:"12px","2xl":"16px","3xl":"24px"},fontSize:{xs:["12px","16px"],sm:["14px","20px"],base:["16px","24px"],lg:["18px","28px"],xl:["20px","28px"],"2xl":["24px","32px"],"3xl":["30px","36px"],"4xl":["36px","40px"],"5xl":["48px","1"],"6xl":["60px","1"],"7xl":["72px","1"],"8xl":["96px","1"],"9xl":["128px","1"]}}},presets:[ts(),Xi(),Qi(),rs()]});function ns(t,e=!0){let r=(function(){if(xh)try{let l=Yi(new CSSStyleSheet);return l.connect=c=>{let p=Aa(c);p.adoptedStyleSheets=[...p.adoptedStyleSheets,l.target]},l.disconnect=Ki,l}catch{}let s=document.createElement("style");s.media="not all",document.head.prepend(s);let a=[Yi(s)],u=new WeakMap;return{get target(){return a[0].target},snapshot(){let l=a.map(c=>c.snapshot());return()=>l.forEach(c=>c())},clear(){a.forEach(l=>l.clear())},destroy(){a.forEach(l=>l.destroy())},insert(l,c,p){a[0].insert(l,c,p);let m=this.target.cssRules[c];a.forEach((v,b)=>b&&v.target.insertRule(m.cssText,c))},resume(l,c){return a[0].resume(l,c)},connect(l){let c=document.createElement("style");Aa(l).appendChild(c);let p=Yi(c),{cssRules:m}=this.target;for(let v=0;v<m.length;v++)p.target.insertRule(m[v].cssText,v);a.push(p),u.set(l,p)},disconnect(l){let c=a.indexOf(u.get(l));c>=0&&a.splice(c,1)}}})(),n=o0({...t,hash:t.hash??e},r),i=a0(n);return function(a){return class extends a{connectedCallback(){super.connectedCallback?.(),r.connect(this),i.observe(Aa(this))}disconnectedCallback(){r.disconnect(this),super.disconnectedCallback?.()}constructor(...l){super(...l),this.tw=n}}}}var xh=typeof ShadowRoot<"u"&&(typeof ShadyCSS>"u"||ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;function Aa(t){return t.shadowRoot||t.attachShadow({mode:"open"})}var _=t=>ns(Ma)(t);var Mn=class extends _($){constructor(){super(),this.color="#601feb",this.radius="16.8576px",this.size="320px",this.border="#d1d5db"}render(){return h`
|
|
127
127
|
<div class="flex flex-row flex-wrap gap-0">
|
|
128
128
|
<div class="relative z-0 flex min-h-9 items-center justify-center overflow-hidden" style="border-radius: ${this.radius};">
|
|
129
129
|
<!-- Spinning gradient background -->
|
|
@@ -135,7 +135,7 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
135
135
|
<slot></slot>
|
|
136
136
|
</div>
|
|
137
137
|
</div>
|
|
138
|
-
`}};w(
|
|
138
|
+
`}};w(Mn,"properties",{color:{type:String},radius:{type:String},size:{type:String},border:{type:String}}),w(Mn,"styles",H`
|
|
139
139
|
:host {
|
|
140
140
|
display: block;
|
|
141
141
|
}
|
|
@@ -150,7 +150,7 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
150
150
|
transform: rotate(360deg);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
`);customElements.get("mw-spinning-border")||customElements.define("mw-spinning-border",
|
|
153
|
+
`);customElements.get("mw-spinning-border")||customElements.define("mw-spinning-border",Mn);var An=class extends _($){constructor(){super();w(this,"render",()=>h`
|
|
154
154
|
<div class="shadow-button inline-block transition-transform hover:scale-105 active:scale-90" style="border-radius: ${this.dynamicRadius};">
|
|
155
155
|
<mw-spinning-border .color="${this.color}" .border="${"#f9fafb"}" .radius="${this.dynamicRadius}">
|
|
156
156
|
<!-- we want the transform transition on the root element so that both the transform transition and state switch transition are continuous and fluid -->
|
|
@@ -207,7 +207,7 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
207
207
|
</button>
|
|
208
208
|
</mw-spinning-border>
|
|
209
209
|
</div>
|
|
210
|
-
`);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 r=parseFloat(this.width),n=parseFloat(this.height),s=Math.min(r,n)*.55,a=s,u=s/1.65;return{width:a,height:u}}get dynamicRadius(){let r=parseFloat(this.width),n=parseFloat(this.height);return`${Math.min(r,n)*.265}px`}};w(
|
|
210
|
+
`);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 r=parseFloat(this.width),n=parseFloat(this.height),s=Math.min(r,n)*.55,a=s,u=s/1.65;return{width:a,height:u}}get dynamicRadius(){let r=parseFloat(this.width),n=parseFloat(this.height);return`${Math.min(r,n)*.265}px`}};w(An,"properties",{state:{type:String},color:{type:String},bubbleStyle:{type:String},src:{type:String},width:{type:String},height:{type:String}}),w(An,"styles",H`
|
|
211
211
|
.shadow-button {
|
|
212
212
|
box-shadow:
|
|
213
213
|
-58.9194px 74.8436px 38.218px rgba(0, 0, 0, 0.01),
|
|
@@ -215,7 +215,7 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
215
215
|
-14.3318px 19.109px 23.8863px rgba(0, 0, 0, 0.09),
|
|
216
216
|
-3.18483px 4.77725px 12.7393px rgba(0, 0, 0, 0.1);
|
|
217
217
|
}
|
|
218
|
-
`);customElements.get("mw-bubble")||customElements.define("mw-bubble",
|
|
218
|
+
`);customElements.get("mw-bubble")||customElements.define("mw-bubble",An);var E0={airplay:`<svg
|
|
219
219
|
xmlns="http://www.w3.org/2000/svg"
|
|
220
220
|
width="24"
|
|
221
221
|
height="24"
|
|
@@ -1142,26 +1142,26 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
1142
1142
|
>
|
|
1143
1143
|
<rect width="14" height="14" x="8" y="8" rx="2" ry="2" />
|
|
1144
1144
|
<path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />
|
|
1145
|
-
</svg>`};var
|
|
1145
|
+
</svg>`};var In=class In extends HTMLElement{constructor(){super();w(this,"name","");w(this,"fill","none");w(this,"stroke","currentColor");this.attachShadow({mode:"open"})}attributeChangedCallback(r,n,i){if(n!==i&&In.observedAttributes.includes(r)){switch(r){case"name":this.name=i||"";break;case"fill":this.fill=i||"none";break;case"stroke":this.stroke=i||"currentColor";break}this.render()}}resolveIcon(r){throw new Error("Not implemented")}render(){let r=document.createElement("style");if(r.textContent=`
|
|
1146
1146
|
:host {
|
|
1147
1147
|
display: inline-block;
|
|
1148
1148
|
line-height: 0;
|
|
1149
1149
|
}
|
|
1150
|
-
`,this.shadowRoot){for(;this.shadowRoot.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild);this.shadowRoot.appendChild(r)}if(!this.name)return;let n=this.resolveIcon(this.name);if(!n){console.warn(`'${this.name}' not found, please add it to ${
|
|
1150
|
+
`,this.shadowRoot){for(;this.shadowRoot.firstChild;)this.shadowRoot.removeChild(this.shadowRoot.firstChild);this.shadowRoot.appendChild(r)}if(!this.name)return;let n=this.resolveIcon(this.name);if(!n){console.warn(`'${this.name}' not found, please add it to ${In.name}`);return}let a=new DOMParser().parseFromString(n,"image/svg+xml").documentElement;a.setAttribute("fill",this.fill),a.setAttribute("stroke",this.stroke),a.style.width="100%",a.style.height="100%",this.shadowRoot?.appendChild(a)}};w(In,"observedAttributes",["name","fill","stroke"]);var is=In;var bh=E0,Ia=class extends is{resolveIcon(e){return bh[e]}};customElements.get("lucide-icon")||customElements.define("lucide-icon",Ia);var jn,Te,_0,M0,kh,A0,I0,Ln=class Ln extends _($){constructor(){super();d(this,Te);d(this,jn,new Date);this.color="#8B5CF6",this.disabled=!1,this.placeholder="Ask AI...",this.dark=!1,this._inputValue=""}render(){return h`
|
|
1151
1151
|
<mw-spinning-border
|
|
1152
1152
|
.size=${"420px"}
|
|
1153
1153
|
.color=${this.color||"#8B5CF6"}
|
|
1154
1154
|
.radius=${"24px"}
|
|
1155
1155
|
class="${this.dark?"dark":""} rounded-[24px] font-sans text-sm shadow-lg transition-transform duration-500 hover:scale-105">
|
|
1156
1156
|
<form
|
|
1157
|
-
@submit="${
|
|
1157
|
+
@submit="${f(this,Te,M0)}"
|
|
1158
1158
|
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">
|
|
1159
1159
|
<lucide-icon class="h-5 w-5 flex-none text-[${this.color||"#8B5CF6"}]" name="${"sparkles"}"></lucide-icon>
|
|
1160
1160
|
|
|
1161
1161
|
<input
|
|
1162
1162
|
?disabled="${this.disabled}"
|
|
1163
|
-
@keydown="${
|
|
1164
|
-
@input="${
|
|
1163
|
+
@keydown="${f(this,Te,I0)}"
|
|
1164
|
+
@input="${f(this,Te,_0)}"
|
|
1165
1165
|
.value="${this._inputValue}"
|
|
1166
1166
|
placeholder="${this.placeholder}"
|
|
1167
1167
|
autocomplete="off"
|
|
@@ -1179,7 +1179,7 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
1179
1179
|
</button>
|
|
1180
1180
|
</form>
|
|
1181
1181
|
</mw-spinning-border>
|
|
1182
|
-
`}};
|
|
1182
|
+
`}};jn=new WeakMap,Te=new WeakSet,_0=function(r){let n=r.target;this._inputValue=n.value,this.dispatchEvent(new Ln.ChangeEvent({value:this._inputValue}))},M0=function(r){r.preventDefault();let n=new Date;if(n.getTime()-o(this,jn).getTime()<500)return;g(this,jn,n);let s=this._inputValue.trim();s&&this.dispatchEvent(new Ln.SubmitInputEvent({text:s}))&&(this._inputValue="")},kh=function(){return this.renderRoot.querySelector('input[name="input"]')??null},A0=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},I0=function(r){Ch(r)&&(r.preventDefault(),this.disabled||o(this,Te,A0)?.click())},w(Ln,"properties",{color:{type:String},disabled:{type:Boolean},placeholder:{type:String},dark:{type:Boolean},_inputValue:{type:String,state:!0}});var It=Ln,La;It.SubmitInputEvent=(La=class extends CustomEvent{constructor(e,r={}){super(It.SubmitInputEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}},w(La,"type","mw-floating-ask-ai:submit"),La);var ja;It.ChangeEvent=(ja=class extends CustomEvent{constructor(e,r={}){super(It.ChangeEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}},w(ja,"type","mw-floating-ask-ai:change"),ja);function Ch(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",It);var ss={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},vr=t=>(...e)=>({_$litDirective$:t,values:e}),wr=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:$h}=l1;var L0=()=>document.createComment(""),yr=(t,e,r)=>{let n=t._$AA.parentNode,i=e===void 0?t._$AB:e._$AA;if(r===void 0){let s=n.insertBefore(L0(),i),a=n.insertBefore(L0(),i);r=new $h(s,a,t,t.options)}else{let s=r._$AB.nextSibling,a=r._$AM,u=a!==t;if(u){let l;r._$AQ?.(t),r._$AM=t,r._$AP!==void 0&&(l=t._$AU)!==a._$AU&&r._$AP(l)}if(s!==i||u){let l=r._$AA;for(;l!==s;){let c=l.nextSibling;n.insertBefore(l,i),l=c}}}return r},nt=(t,e,r=t)=>(t._$AI(e,r),t),Sh={},j0=(t,e=Sh)=>t._$AH=e,T0=t=>t._$AH,os=t=>{t._$AR(),t._$AA.remove()};var D0=(t,e,r)=>{let n=new Map;for(let i=e;i<=r;i++)n.set(t[i],i);return n},_e=vr(class extends wr{constructor(t){if(super(t),t.type!==ss.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=[],a=0;for(let u of t)i[a]=n?n(u,a):a,s[a]=r(u,a),a++;return{values:s,keys:i}}render(t,e,r){return this.dt(t,e,r).values}update(t,[e,r,n]){let i=T0(t),{values:s,keys:a}=this.dt(e,r,n);if(!Array.isArray(i))return this.ut=a,s;let u=this.ut??=[],l=[],c,p,m=0,v=i.length-1,b=0,S=s.length-1;for(;m<=v&&b<=S;)if(i[m]===null)m++;else if(i[v]===null)v--;else if(u[m]===a[b])l[b]=nt(i[m],s[b]),m++,b++;else if(u[v]===a[S])l[S]=nt(i[v],s[S]),v--,S--;else if(u[m]===a[S])l[S]=nt(i[m],s[S]),yr(t,l[S+1],i[m]),m++,S--;else if(u[v]===a[b])l[b]=nt(i[v],s[b]),yr(t,i[m],i[v]),v--,b++;else if(c===void 0&&(c=D0(a,b,S),p=D0(u,m,v)),c.has(u[m]))if(c.has(u[v])){let T=p.get(a[b]),k=T!==void 0?i[T]:null;if(k===null){let A=yr(t,i[m]);nt(A,s[b]),l[b]=A}else l[b]=nt(k,s[b]),yr(t,i[m],k),i[T]=null;b++}else os(i[v]),v--;else os(i[m]),m++;for(;b<=S;){let T=yr(t,l[S+1]);nt(T,s[b]),l[b++]=T}for(;m<=v;){let T=i[m++];T!==null&&os(T)}return this.ut=a,j0(t,l),Ie}});var as,O0,ls=class ls extends _($){constructor(){super();d(this,as);this.examples={title:"",items:[]},this.color=""}render(){return!this.examples?.title&&!this.examples?.items?.length?null:h`
|
|
1183
1183
|
<div class="flex h-full w-full flex-1 flex-col overflow-y-auto px-4 pt-6 pb-2">
|
|
1184
1184
|
${this.examples.title?h`
|
|
1185
1185
|
<h2 class="mt-14 px-2 pt-9 pb-2 text-left text-3xl leading-tight font-bold tracking-tight">
|
|
@@ -1193,17 +1193,17 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
1193
1193
|
`:null}
|
|
1194
1194
|
${this.examples?.items?.length?h`
|
|
1195
1195
|
<ul class="mt-auto flex flex-wrap justify-end gap-2.5 text-sm leading-6 text-black select-none">
|
|
1196
|
-
${
|
|
1196
|
+
${_e(this.examples.items,r=>r,r=>h`
|
|
1197
1197
|
<li
|
|
1198
1198
|
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"
|
|
1199
|
-
@click="${()=>
|
|
1199
|
+
@click="${()=>f(this,as,O0).call(this,r)}">
|
|
1200
1200
|
<span>${r.trim()}</span>
|
|
1201
1201
|
</li>
|
|
1202
1202
|
`)}
|
|
1203
1203
|
</ul>
|
|
1204
1204
|
`:null}
|
|
1205
1205
|
</div>
|
|
1206
|
-
`}};
|
|
1206
|
+
`}};as=new WeakSet,O0=function(r){this.dispatchEvent(new ls.ExampleClickEvent({example:r}))},w(ls,"properties",{examples:{type:Object},color:{type:String}});var Tn=ls,Ta;Tn.ExampleClickEvent=(Ta=class extends CustomEvent{constructor(e,r={}){super(Tn.ExampleClickEvent.type,{detail:e,...r})}},w(Ta,"type","mw:example-click"),Ta);customElements.get("mw-chat-background")||customElements.define("mw-chat-background",Tn);var br,P0,U0,xr=class xr extends _($){constructor(){super();d(this,br);this.content={logoUrl:"",title:"",color:""},this.showNewChat=!1,this.showClose=!1}render(){return h`
|
|
1207
1207
|
<div class="relative z-10 h-12">
|
|
1208
1208
|
<div class="gradient-blur absolute inset-x-0.5 mt-2 h-12"></div>
|
|
1209
1209
|
|
|
@@ -1226,7 +1226,7 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
1226
1226
|
<div class="flex-grow"></div>
|
|
1227
1227
|
|
|
1228
1228
|
<!-- new chat btn -->
|
|
1229
|
-
<button @click=${
|
|
1229
|
+
<button @click=${f(this,br,P0)} type="button" class="${this.showNewChat?"inline-flex":"hidden"} shrink-0">
|
|
1230
1230
|
<!-- svg icon of a bubble with a plus -->
|
|
1231
1231
|
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 37 36">
|
|
1232
1232
|
<path
|
|
@@ -1238,7 +1238,7 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
1238
1238
|
</button>
|
|
1239
1239
|
|
|
1240
1240
|
<!-- close chat btn -->
|
|
1241
|
-
<button @click=${
|
|
1241
|
+
<button @click=${f(this,br,U0)} class="${this.showClose?"inline-flex":"hidden"} shrink-0">
|
|
1242
1242
|
<!-- svg icon of an X -->
|
|
1243
1243
|
<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">
|
|
1244
1244
|
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" />
|
|
@@ -1253,7 +1253,7 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
1253
1253
|
</div>
|
|
1254
1254
|
</div>
|
|
1255
1255
|
</div>
|
|
1256
|
-
`}};
|
|
1256
|
+
`}};br=new WeakSet,P0=function(){this.dispatchEvent(new xr.NewChatClickEvent)},U0=function(){this.dispatchEvent(new xr.CloseClickEvent)},w(xr,"properties",{content:{type:Object},showNewChat:{type:Boolean,attribute:"show-new-chat"},showClose:{type:Boolean,attribute:"show-close"}}),w(xr,"styles",H`
|
|
1257
1257
|
/* blurred background */
|
|
1258
1258
|
|
|
1259
1259
|
.gradient-blur {
|
|
@@ -1265,7 +1265,7 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
1265
1265
|
/* bg-color gradient */
|
|
1266
1266
|
background-image: linear-gradient(to bottom, white 20%, transparent);
|
|
1267
1267
|
}
|
|
1268
|
-
`);var
|
|
1268
|
+
`);var Lt=xr,Da;Lt.NewChatClickEvent=(Da=class extends CustomEvent{constructor(e={}){super(Lt.NewChatClickEvent.type,{...e})}},w(Da,"type","mw:new-chat-click"),Da);var Oa;Lt.CloseClickEvent=(Oa=class extends CustomEvent{constructor(e={}){super(Lt.CloseClickEvent.type,{...e})}},w(Oa,"type","mw:close-click"),Oa);customElements.get("mw-chat-header")||customElements.define("mw-chat-header",Lt);var q0=r2(H0(),1);var Ve=Object.freeze({PENDING:"pending",READY:"ready",ERROR:"error"}),z,W,ce,Cr,$r,ge,O,z0,Va,F0,ds,On,Pn,Un,Rn,N0,hs,it,Dn,Ba,Z0,W0,G0,ps=class{constructor(e,r){d(this,O);d(this,z);d(this,W);d(this,ce,null);d(this,Cr,!1);d(this,$r,null);d(this,ge,[]);d(this,ds,e=>{let r=e.target,n=Array.from(r.files||[]);f(this,O,Ba).call(this,n),r.value=""});d(this,On,e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="copy")});d(this,Pn,e=>{e.preventDefault(),e.dataTransfer&&f(this,O,N0).call(this,e.dataTransfer)&&f(this,O,hs).call(this,!0)});d(this,Un,e=>{e.preventDefault();let r=e.relatedTarget;o(this,z).contains(r)||f(this,O,hs).call(this,!1)});d(this,Rn,e=>{if(e.preventDefault(),f(this,O,hs).call(this,!1),e.dataTransfer){let r=Array.from(e.dataTransfer.files||[]);f(this,O,Ba).call(this,r)}});w(this,"openImagePicker",()=>{o(this,ce)&&o(this,ce).click()});w(this,"onImageDelete",e=>{o(this,W).onImageDelete&&o(this,W).onImageDelete(e),g(this,ge,o(this,ge).filter(r=>r.id!==e)),f(this,O,Dn).call(this),o(this,z).requestUpdate()});g(this,z,e),g(this,W,{acceptedTypes:["image/jpeg","image/png","image/gif","image/webp","image/svg+xml","image/heic"],maxFileSize:10*1024*1024,maxFiles:3,onError:()=>{},enabled:!0,...r}),e.addController(this),f(this,O,F0).call(this)}hostConnected(){f(this,O,z0).call(this)}hostDisconnected(){f(this,O,Va).call(this),o(this,ce)&&o(this,ce).parentNode&&o(this,ce).parentNode.removeChild(o(this,ce))}get isDragging(){return o(this,Cr)}get error(){return o(this,$r)}get selectedImages(){return o(this,ge)}get hasPendingImages(){return o(this,ge).some(e=>e.processingState===Ve.PENDING)}clearError(){f(this,O,Dn).call(this)}updateUploadOptions(e){e.conversationId!==void 0&&(o(this,W).conversationId=e.conversationId),e.widgetId!==void 0&&(o(this,W).widgetId=e.widgetId),o(this,W).enabled=!!e.enabled,e.enabled||f(this,O,Va).call(this)}restoreImages(e){if(!Array.isArray(e)||e.length===0){g(this,ge,[]),o(this,z).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:Ve.READY,imageUrl:n.url}});g(this,ge,r),o(this,z).requestUpdate()}clearImages(){g(this,ge,[]),this.clearError(),o(this,z).requestUpdate()}};z=new WeakMap,W=new WeakMap,ce=new WeakMap,Cr=new WeakMap,$r=new WeakMap,ge=new WeakMap,O=new WeakSet,z0=function(){o(this,W).enabled&&(o(this,z).addEventListener("dragover",o(this,On)),o(this,z).addEventListener("dragenter",o(this,Pn)),o(this,z).addEventListener("dragleave",o(this,Un)),o(this,z).addEventListener("drop",o(this,Rn)))},Va=function(){o(this,z).removeEventListener("dragover",o(this,On)),o(this,z).removeEventListener("dragenter",o(this,Pn)),o(this,z).removeEventListener("dragleave",o(this,Un)),o(this,z).removeEventListener("drop",o(this,Rn))},F0=function(){g(this,ce,document.createElement("input")),o(this,ce).type="file",o(this,ce).accept=o(this,W).acceptedTypes.join(","),o(this,ce).multiple=o(this,W).maxFiles>1,o(this,ce).style.display="none",o(this,ce).addEventListener("change",o(this,ds)),document.body.appendChild(o(this,ce))},ds=new WeakMap,On=new WeakMap,Pn=new WeakMap,Un=new WeakMap,Rn=new WeakMap,N0=function(e){return e.types&&e.types.includes("Files")},hs=function(e){o(this,Cr)!==e&&(g(this,Cr,e),o(this,z).requestUpdate())},it=function(e){g(this,$r,e),o(this,W).onError(e),o(this,z).requestUpdate(),setTimeout(()=>{f(this,O,Dn).call(this)},6e3)},Dn=function(){g(this,$r,null),o(this,z).requestUpdate()},Ba=async function(e){if(e.length===0)return;f(this,O,Dn).call(this);let r=e.filter(a=>f(this,O,Z0).call(this,a));if(r.length===0)return;let n=o(this,ge).length,i=o(this,W).maxFiles??1/0,s=r.length;if(n+s>i){f(this,O,it).call(this,`You can upload a maximum of ${i} files`);return}try{let u=(await Promise.all(r.map(l=>f(this,O,W0).call(this,l)))).filter(l=>!o(this,ge).some(c=>c.dataUrl===l.dataUrl));g(this,ge,[...o(this,ge),...u]),await Go(3,u,async l=>{await f(this,O,G0).call(this,l)}),o(this,z).requestUpdate()}catch(a){let u=a instanceof Error?a:new Error(String(a));f(this,O,it).call(this,"Upload failed")}},Z0=function(e){return o(this,W).acceptedTypes.includes(e.type)?e.size>o(this,W).maxFileSize?(f(this,O,it).call(this,`Max file size: ${o(this,W).maxFileSize/(1024*1024)}MB`),!1):!0:(f(this,O,it).call(this,"Invalid file type"),!1)},W0=async function(e){try{let r=await(0,q0.fileToBase64)(e);return{id:crypto.randomUUID(),name:e.name,type:e.type,size:e.size,dataUrl:r,file:e,processingState:Ve.PENDING}}catch(r){let n=r instanceof Error?r:new Error(String(r));throw new Error(`Failed to read file: ${e.name} - ${n.message}`)}},G0=async function(e){if(!e){console.error("No image provided to upload"),f(this,O,it).call(this,"No image provided");return}if(!o(this,W)?.uploadUrl){console.error("Missing uploadUrl in options"),f(this,O,it).call(this,"Upload URL not configured");return}e.processingState=Ve.PENDING,o(this,z).requestUpdate();let r=new FormData;r.append("file",e.file),r.append("imageId",e.id),o(this,W).conversationId&&r.append("conversationId",o(this,W).conversationId),o(this,W).widgetId&&r.append("widgetId",o(this,W).widgetId);try{let n=await fetch(o(this,W).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 a=i?.error||"Upload failed";throw new Error(a)}i.imageUrl&&i.imageId?(e.imageUrl=i.imageUrl,e.id=i.imageId,e.processingState=Ve.READY):e.processingState=Ve.PENDING,o(this,z).requestUpdate()}catch(n){let i=n instanceof Error?n:new Error(String(n));console.error("Upload error:",i.message),f(this,O,it).call(this,i.message),e.processingState=Ve.ERROR,o(this,z).requestUpdate()}};var Ha={maxHeight:120,initialHeight:32,paddingY:12},Vn,Q,Sr,J0,K0,Y0,X0,fs,Ot=class Ot extends _($){constructor(){super();d(this,Q);d(this,Vn,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,Sr)?.value?.trim()??""}render(){return h`
|
|
1269
1269
|
<div
|
|
1270
1270
|
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}]">
|
|
1271
1271
|
<!-- Image preview area -->
|
|
@@ -1276,11 +1276,11 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
1276
1276
|
<img src="${r.dataUrl}" alt="${r.name}" class="h-[60px] w-[60px] rounded-xl object-cover" />
|
|
1277
1277
|
|
|
1278
1278
|
<!-- Progress/Status overlay -->
|
|
1279
|
-
${r.processingState===
|
|
1279
|
+
${r.processingState===Ve.PENDING?h`
|
|
1280
1280
|
<div class="absolute inset-0 flex items-center justify-center rounded-xl bg-black/40">
|
|
1281
1281
|
<lucide-icon name="loader-circle" class="inline-flex animate-spin text-white transition-all duration-1000"></lucide-icon>
|
|
1282
1282
|
</div>
|
|
1283
|
-
`:r.processingState===
|
|
1283
|
+
`:r.processingState===Ve.ERROR?h`
|
|
1284
1284
|
<div class="absolute inset-0 flex items-center justify-center rounded-xl bg-red-500/60">
|
|
1285
1285
|
<lucide-icon name="badge-alert" class="h-6 w-6 text-white"></lucide-icon>
|
|
1286
1286
|
</div>
|
|
@@ -1300,7 +1300,7 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
1300
1300
|
`:null}
|
|
1301
1301
|
|
|
1302
1302
|
<!-- Input form -->
|
|
1303
|
-
<form @submit="${
|
|
1303
|
+
<form @submit="${f(this,Q,Y0)}" class="flex w-full items-center">
|
|
1304
1304
|
${this.enableImageUpload?h`
|
|
1305
1305
|
<button
|
|
1306
1306
|
data-testid="image-upload-btn"
|
|
@@ -1315,12 +1315,12 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
1315
1315
|
<textarea
|
|
1316
1316
|
data-testid="mw-chat-input-textarea"
|
|
1317
1317
|
name="input"
|
|
1318
|
-
@input="${
|
|
1319
|
-
@keydown="${
|
|
1318
|
+
@input="${f(this,Q,X0)}"
|
|
1319
|
+
@keydown="${f(this,Q,K0)}"
|
|
1320
1320
|
autofocus
|
|
1321
1321
|
?disabled="${this.disabled}"
|
|
1322
1322
|
placeholder="${this.placeholder}"
|
|
1323
|
-
class="${this.enableImageUpload?"px-1":"pl-3 pr-1"} box-content h-[${
|
|
1323
|
+
class="${this.enableImageUpload?"px-1":"pl-3 pr-1"} box-content h-[${Ha.initialHeight}px] w-full resize-none place-content-center rounded bg-white py-[${Ha.paddingY}px] text-base text-gray-800 outline-none placeholder:text-[14px] placeholder:font-light disabled:place-content-baseline"></textarea>
|
|
1324
1324
|
|
|
1325
1325
|
<button
|
|
1326
1326
|
type="submit"
|
|
@@ -1338,7 +1338,7 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
1338
1338
|
<slot>
|
|
1339
1339
|
<div class="h-5 w-full"></div>
|
|
1340
1340
|
</slot>
|
|
1341
|
-
`}setValue(r){let n=o(this,
|
|
1341
|
+
`}setValue(r){let n=o(this,Q,Sr);if(!n){console.warn("input element not found, cannot set value");return}n.value=r,f(this,Q,fs).call(this),this.dispatchEvent(new Ot.ChangeEvent({delta:null,full:r}))}focus(){o(this,Q,Sr)?.focus()}};Vn=new WeakMap,Q=new WeakSet,Sr=function(){return this.renderRoot.querySelector('textarea[name="input"]')??null},J0=function(){return this.renderRoot.querySelector('button[type="submit"]')??null},K0=function(r){Bh(r)&&(r.preventDefault(),!this.streaming&&!this.disabled&&!this.loading&&o(this,Q,J0)?.click())},Y0=function(r){r.preventDefault();let n=new Date;if(n.getTime()-o(this,Vn).getTime()<500)return;if(g(this,Vn,n),this.streaming){this.dispatchEvent(new Ot.CancelEvent);return}let s=o(this,Q,Sr);if(!s)throw new Error("Expected input element to be present");let a=s.value.trim();(a||this.enableImageUpload&&this.images.length>0)&&this.dispatchEvent(new Ot.SubmitEvent(a))&&(s.value=""),f(this,Q,fs).call(this),window.requestAnimationFrame(()=>{this.focus()})},X0=function(r){this.dispatchEvent(new Ot.ChangeEvent({delta:r.data,full:r.target instanceof HTMLTextAreaElement?r.target.value:""})),f(this,Q,fs).call(this)},fs=function(){let r=o(this,Q,Sr);if(!r)return;let{maxHeight:n,initialHeight:i,paddingY:s}=Ha;r.style.height=`${i}px`;let a=r.scrollHeight,u=s*2,l=Math.min(a-u,n);r.style.height=`${l}px`,this.requestUpdate()},w(Ot,"properties",{disabled:{type:Boolean},streaming:{type:Boolean},loading:{type:Boolean},placeholder:{type:String},color:{type:String},enableImageUpload:{type:Boolean},onImageUploadClick:{type:Function},images:{type:Array},onImageDelete:{type:Function}});var We=Ot,qa;We.ChangeEvent=(qa=class extends CustomEvent{constructor(e,r={}){super(We.ChangeEvent.type,{detail:e,...r})}},w(qa,"type","mw:change"),qa);var za;We.SubmitEvent=(za=class extends CustomEvent{constructor(e,r={}){super(We.SubmitEvent.type,{detail:e,...r,cancelable:!0})}},w(za,"type","mw:submit"),za);var Fa;We.CancelEvent=(Fa=class extends CustomEvent{constructor(e={}){super(We.CancelEvent.type,{...e})}},w(Fa,"type","mw:cancel"),Fa);function Bh(t){return(t.code==="Enter"||t.code==="NumpadEnter")&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey}customElements.get("mw-chat-input")||customElements.define("mw-chat-input",We);var ms=class extends _($){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 h`
|
|
1342
1342
|
<div class="ml-20 flex justify-end font-sans text-base">
|
|
1343
1343
|
<div class="max-w-full">
|
|
1344
1344
|
<!-- include an invisible border (same color as background) so that this message is the same height as the bot message -->
|
|
@@ -1374,13 +1374,13 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
1374
1374
|
</div>
|
|
1375
1375
|
</div>
|
|
1376
1376
|
</div>
|
|
1377
|
-
`;default:throw new Error(`Unknown side: ${this.side}`)}}};w(
|
|
1378
|
-
<div class="${o(this,
|
|
1379
|
-
<div class="${o(this,
|
|
1377
|
+
`;default:throw new Error(`Unknown side: ${this.side}`)}}};w(ms,"properties",{side:{type:String},status:{type:String},color:{type:String},logoUrl:{type:String,attribute:"logo"},position:{type:String}});customElements.get("mw-chat-message")||customElements.define("mw-chat-message",ms);var Pt,Er,_r,st,ot,Q0,ec,tc,gs,ws,vs,Bn,ys,Be=class extends _($){constructor(){super();d(this,ot);d(this,Pt,!1);d(this,Er,!1);d(this,_r,!1);d(this,st,!1);d(this,gs,r=>{console.error("Failed to load chat image:",this.src),g(this,Er,!0),this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:error",{detail:{src:this.src,event:r},bubbles:!0}))});d(this,ws,r=>{g(this,Pt,!0),this.requestUpdate(),this.dispatchEvent(new CustomEvent("mw-chat-image:load",{detail:{src:this.src,event:r},bubbles:!0}))});d(this,vs,r=>{this.clickable&&(r.preventDefault(),r.stopPropagation(),g(this,_r,!0),this.requestUpdate(),g(this,st,!0),this.requestUpdate(),setTimeout(()=>{g(this,st,!1),this.requestUpdate()},500),this.dispatchEvent(new CustomEvent("mw-chat-image:click",{detail:{src:this.src,event:r},bubbles:!0})))});d(this,Bn,r=>{r.preventDefault(),r.stopPropagation(),g(this,_r,!1),this.requestUpdate()});d(this,ys,r=>{r.preventDefault(),r.stopPropagation()});this.src="",this.alt="",this.side="right",this.position="single",this.width="300px",this.height="auto",this.clickable=!1}updated(r){r.has("src")&&(g(this,Pt,!1),g(this,Er,!1))}render(){return this.src?h`
|
|
1378
|
+
<div class="${o(this,ot,Q0)} mb-2 min-h-[100px]">
|
|
1379
|
+
<div class="${o(this,ot,ec)} relative">
|
|
1380
1380
|
<!-- Placeholder background that's only shown when loading or error -->
|
|
1381
|
-
${o(this,
|
|
1381
|
+
${o(this,Pt)?null:h`
|
|
1382
1382
|
<div class="flex items-center justify-center bg-gray-100" style="width: ${this.width}; height: 200px;">
|
|
1383
|
-
${o(this,
|
|
1383
|
+
${o(this,Er)?h`
|
|
1384
1384
|
<!-- Error icon -->
|
|
1385
1385
|
<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">
|
|
1386
1386
|
<path
|
|
@@ -1400,24 +1400,24 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
1400
1400
|
src="${this.src}"
|
|
1401
1401
|
alt="${this.alt}"
|
|
1402
1402
|
style="width: ${this.width}; height: ${this.height}; display: block;"
|
|
1403
|
-
class="${o(this,
|
|
1404
|
-
@error="${o(this,
|
|
1405
|
-
@load="${o(this,
|
|
1406
|
-
@click="${this.clickable?o(this,
|
|
1403
|
+
class="${o(this,Pt)?"opacity-100":"opacity-0 hidden"} ${this.clickable?"cursor-pointer hover:scale-[105%]":""} h-full w-full max-w-full transition-all duration-200"
|
|
1404
|
+
@error="${o(this,gs)}"
|
|
1405
|
+
@load="${o(this,ws)}"
|
|
1406
|
+
@click="${this.clickable?o(this,vs):void 0}"
|
|
1407
1407
|
loading="lazy" />
|
|
1408
1408
|
</div>
|
|
1409
1409
|
</div>
|
|
1410
1410
|
|
|
1411
1411
|
<!-- Full image modal -->
|
|
1412
|
-
${o(this,
|
|
1412
|
+
${o(this,_r)?h`
|
|
1413
1413
|
<div
|
|
1414
|
-
class="${o(this,
|
|
1415
|
-
@click="${o(this,
|
|
1414
|
+
class="${o(this,st)?"bg-opacity-0":"bg-opacity-75"} fixed inset-0 z-50 flex items-center justify-center bg-black p-4 transition-opacity duration-300"
|
|
1415
|
+
@click="${o(this,Bn)}">
|
|
1416
1416
|
<!-- Close button -->
|
|
1417
1417
|
<button
|
|
1418
1418
|
type="button"
|
|
1419
|
-
class="bg-opacity-50 ${o(this,
|
|
1420
|
-
@click="${o(this,
|
|
1419
|
+
class="bg-opacity-50 ${o(this,st)?"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"
|
|
1420
|
+
@click="${o(this,Bn)}"
|
|
1421
1421
|
aria-label="Close full image">
|
|
1422
1422
|
<!-- X mark icon -->
|
|
1423
1423
|
<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">
|
|
@@ -1426,26 +1426,28 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
1426
1426
|
</button>
|
|
1427
1427
|
<div class="relative max-h-full max-w-full">
|
|
1428
1428
|
<img
|
|
1429
|
-
src="${
|
|
1429
|
+
src="${f(this,ot,tc).call(this)}"
|
|
1430
1430
|
alt="${this.alt}"
|
|
1431
|
-
class="${o(this,
|
|
1432
|
-
@click="${o(this,
|
|
1431
|
+
class="${o(this,st)?"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"
|
|
1432
|
+
@click="${o(this,ys)}" />
|
|
1433
1433
|
</div>
|
|
1434
1434
|
</div>
|
|
1435
1435
|
`:null}
|
|
1436
|
-
`:(console.warn("MwChatImage: No src provided"),null)}};
|
|
1436
|
+
`:(console.warn("MwChatImage: No src provided"),null)}};Pt=new WeakMap,Er=new WeakMap,_r=new WeakMap,st=new WeakMap,ot=new WeakSet,Q0=function(){return this.side==="left"||this.side==="assistant"?"flex justify-start ml-[25px]":"flex justify-end"},ec=function(){let r="inline-block overflow-hidden shadow-sm";if(this.side==="right"||this.side==="user")switch(this.position){case"first":r+=" rounded-2xl rounded-br-[4px]";break;case"middle":r+=" rounded-2xl rounded-r-[4px]";break;case"last":case"last-current":r+=" rounded-2xl rounded-tr-[4px]";break;default:r+=" rounded-2xl";break}else switch(this.position){case"first":r+=" rounded-2xl rounded-bl-[4px]";break;case"middle":r+=" rounded-2xl rounded-l-[4px]";break;case"last":case"last-current":r+=" rounded-2xl rounded-tl-[4px]";break;default:r+=" rounded-2xl";break}return r},tc=function(){if(!this.src)return"";try{let r=new URL(this.src);return r.searchParams.set("for","full"),r.href}catch{return this.src}},gs=new WeakMap,ws=new WeakMap,vs=new WeakMap,Bn=new WeakMap,ys=new WeakMap,w(Be,"properties",{src:{type:String},alt:{type:String},side:{type:String},position:{type:String},width:{type:String},height:{type:String},clickable:{type:Boolean}});var Na;Be.ErrorEvent=(Na=class extends CustomEvent{constructor(e,r={}){super(Be.ErrorEvent.type,{detail:e,...r})}},w(Na,"type","mw-chat-image:error"),Na);var Za;Be.LoadEvent=(Za=class extends CustomEvent{constructor(e,r={}){super(Be.LoadEvent.type,{detail:e,...r})}},w(Za,"type","mw-chat-image:load"),Za);var Wa;Be.ClickEvent=(Wa=class extends CustomEvent{constructor(e,r={}){super(Be.ClickEvent.type,{detail:e,...r})}},w(Wa,"type","mw-chat-image:click"),Wa);customElements.get("mw-chat-image")||customElements.define("mw-chat-image",Be);var ue=t=>t??Z;var Hh=["javascript:","data:text/html","vbscript:","data:text/javascript","data:text/vbscript","data:text/css","data:text/plain","data:text/xml"],Ge,Ja,rc,xs,nc,bs,ks=class ks extends _($){constructor(){super();d(this,Ge);d(this,xs,r=>{r.preventDefault(),this._dismissed=!0,this.storageKey&&f(this,Ge,rc).call(this),this.dispatchEvent(new ks.DismissEvent)});d(this,bs,r=>{r.stopPropagation()});this.text="By chatting with us, you agree to the monitoring and recording of this chat to deliver our services and processing of your personal data in accordance with our [Privacy Policy](https://docs.molin.ai/legal/privacy-policy).",this.color="#3b82f6",this.dismissible=!1,this.storageKey="mw-disclaimer-dismissed",this._dismissed=!1}updated(r){super.updated(r),r.has("storageKey")&&this.storageKey&&this.dismissible&&(this._dismissed=f(this,Ge,Ja).call(this))}connectedCallback(){super.connectedCallback(),this.storageKey&&this.dismissible&&(this._dismissed=f(this,Ge,Ja).call(this))}render(){if(this._dismissed)return null;let r=f(this,Ge,nc).call(this,this.text);return h`
|
|
1437
1437
|
<div class="flex items-center justify-between">
|
|
1438
1438
|
<div class="flex flex-1 items-center justify-center">
|
|
1439
1439
|
<span class="text-xs text-gray-600"> ${r} </span>
|
|
1440
1440
|
</div>
|
|
1441
1441
|
|
|
1442
1442
|
${this.dismissible?h`
|
|
1443
|
-
<button type="button" aria-label="Dismiss" class="ml-2 flex h-4 w-4 flex-shrink-0 cursor-pointer items-center justify-center rounded hover:bg-gray-200" @click="${o(this,
|
|
1443
|
+
<button type="button" aria-label="Dismiss" class="ml-2 flex h-4 w-4 flex-shrink-0 cursor-pointer items-center justify-center rounded hover:bg-gray-200" @click="${o(this,xs)}">
|
|
1444
1444
|
<lucide-icon name="x" class="h-3 w-3 text-gray-500"></lucide-icon>
|
|
1445
1445
|
</button>
|
|
1446
1446
|
`:null}
|
|
1447
1447
|
</div>
|
|
1448
|
-
`}};
|
|
1448
|
+
`}};Ge=new WeakSet,Ja=function(){try{return localStorage.getItem(this.storageKey)==="true"}catch{return!1}},rc=function(){try{localStorage.setItem(this.storageKey,"true")}catch(r){console.warn("Could not save disclaimer dismissed state to localStorage:",r)}},xs=new WeakMap,nc=function(r){let i=/\[([^\]]+)\]\(([^)]+)\)/g.exec(r);if(i){let s=i[0],a=i[1],u=i[2],l=i.index;return Hh.some(c=>u.toLowerCase().startsWith(c))||!u||!a?r:h`${r.slice(0,l)}<a href="${ue(u)}" target="_blank" rel="noopener noreferrer" @click="${o(this,bs)}" class="underline" style="color: ${this.color}"
|
|
1449
|
+
>${a}</a
|
|
1450
|
+
>${r.slice(l+s.length)}`}return r},bs=new WeakMap,w(ks,"properties",{text:{type:String},color:{type:String},dismissible:{type:Boolean},storageKey:{type:String,attribute:"storage-key"},_dismissed:{type:Boolean,state:!0}});var Hn=ks,Ga;Hn.DismissEvent=(Ga=class extends CustomEvent{constructor(e={}){super(Hn.DismissEvent.type,{...e})}},w(Ga,"type","mw-disclaimer:dismiss"),Ga);customElements.get("mw-disclaimer")||customElements.define("mw-disclaimer",Hn);var Mr,ic,sc,Cs=class extends _($){constructor(){super();d(this,Mr);this.text="I'm still learning!",this.variant="info",this.autoDismissable=!1,this.dismissDelay=5e3,this._isVisible=!0}connectedCallback(){super.connectedCallback(),this.autoDismissable&&f(this,Mr,ic).call(this)}render(){let r=f(this,Mr,sc).call(this);return h`
|
|
1449
1451
|
<div
|
|
1450
1452
|
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">
|
|
1451
1453
|
<div class="${r.bg} mb-2 flex max-w-[70%] items-center justify-center rounded-full px-3 py-2 select-none">
|
|
@@ -1484,7 +1486,7 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
1484
1486
|
<span class="${r.text} ml-1 text-xs">${this.text}</span>
|
|
1485
1487
|
</div>
|
|
1486
1488
|
</div>
|
|
1487
|
-
`}}
|
|
1489
|
+
`}};Mr=new WeakSet,ic=function(){setTimeout(()=>{this._isVisible=!1,this.requestUpdate()},this.dismissDelay)},sc=function(){switch(this.variant){case"error":return{bg:"bg-red-600",text:"text-white",icon:"badge-alert"};case"warning":return{bg:"bg-yellow-600",text:"text-white",icon:"alert-triangle"};case"success":return{bg:"bg-green-600",text:"text-white",icon:"check-circle"};case"info":default:return{bg:"bg-black",text:"text-white",icon:"info"}}},w(Cs,"properties",{text:{type:String},variant:{type:String},autoDismissable:{type:Boolean,attribute:"auto-dismissable"},dismissDelay:{type:Number,attribute:"dismiss-delay"},_isVisible:{type:Boolean,state:!0}});customElements.get("mw-info-banner")||customElements.define("mw-info-banner",Cs);var Ka=class extends _($){constructor(){super(...arguments);w(this,"render",()=>h`
|
|
1488
1490
|
<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">
|
|
1489
1491
|
<circle fill="currentFill" stroke="none" cx="27" cy="50" r="6">
|
|
1490
1492
|
<animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.1" />
|
|
@@ -1496,11 +1498,11 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
1496
1498
|
<animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.3" />
|
|
1497
1499
|
</circle>
|
|
1498
1500
|
</svg>
|
|
1499
|
-
`)}};customElements.get("mw-loading")||customElements.define("mw-loading",
|
|
1501
|
+
`)}};customElements.get("mw-loading")||customElements.define("mw-loading",Ka);var qh="https://molin.ai/?utm_source=molin-shop-ai&utm_medium=widget&utm_campaign=poweredby",Ya=class extends _($){constructor(){super(...arguments);w(this,"render",()=>h`
|
|
1500
1502
|
<p class="flex items-center justify-center text-xs whitespace-nowrap">
|
|
1501
1503
|
<span>Powered by</span>
|
|
1502
1504
|
|
|
1503
|
-
<a href="${
|
|
1505
|
+
<a href="${qh}" target="_blank" class="inline-flex items-center underline">
|
|
1504
1506
|
<svg class="mx-1 inline-block h-4 w-4" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1505
1507
|
<circle cx="10.0361" cy="10.0361" r="10.0361" fill="#242038" />
|
|
1506
1508
|
<path
|
|
@@ -1519,7 +1521,382 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
1519
1521
|
<span>Molin AI</span>
|
|
1520
1522
|
</a>
|
|
1521
1523
|
</p>
|
|
1522
|
-
`)}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",
|
|
1524
|
+
`)}};customElements.get("mw-powered-by")||customElements.define("mw-powered-by",Ya);var zh=Math.pow(10,8)*24*60*60*1e3,R3=-zh;var Fh=3600;var oc=Fh*24,V3=oc*7,Nh=oc*365.2425,Zh=Nh/12,B3=Zh*3,Xa=Symbol.for("constructDateFrom");function ac(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Xa in t?t[Xa](e):t instanceof Date?new t.constructor(e):new Date(e)}function Qa(t,e){return ac(e||t,t)}function lc(t){return e=>{let n=(t?Math[t]:Math.trunc)(e);return n===0?0:n}}function cc(t,e){return+Qa(t)-+Qa(e)}function el(t,e,r){let n=cc(t,e)/1e3;return lc(r?.roundingMethod)(n)}var Ar,Ir,uc,$s,hc,qn=class extends _($){constructor(){super();d(this,Ir);d(this,Ar,7);d(this,$s,async r=>{this._loadingAnswer=r,this._questionHistory.push({question:this._currentQuestion,answer:r}),this.dispatchEvent(new CustomEvent("mw-chat-wait-game:question-answered",{bubbles:!0,composed:!0,detail:{questionIndex:this._questionHistory.length-1,question:this._currentQuestion,answer:r,totalQuestions:o(this,Ar),allAnswers:this._questionHistory.map(i=>i.answer)}}));let n=await f(this,Ir,uc).call(this);n&&(n.isComplete&&n.guessedJob?(this._guessedJob=n.guessedJob,this.dispatchEvent(new CustomEvent("mw-chat-wait-game:game-completed",{bubbles:!0,composed:!0,detail:{guessedProfession:this._guessedJob,questionCount:this._questionHistory.length,allAnswers:this._questionHistory.map(i=>i.answer)}}))):n.nextQuestion&&(this._currentQuestion=n.nextQuestion)),this._loadingAnswer=""});this.question="",this.options=["Yes","No","Not sure"],this.title="",this.gameTitle="",this.resultPrefix="",this.color="#601feb",this.apiBaseUrl="",this._questionHistory=[],this._currentQuestion="",this._guessedJob="",this._isLoadingNextQuestion=!1,this._loadingAnswer=""}connectedCallback(){super.connectedCallback(),this._currentQuestion=this.question}render(){let r=f(this,Ir,hc).call(this),n=this.title||"Agent joining in",i=this.gameTitle||"\u{1F9E0} I'll guess your job",s=this.resultPrefix||"I'm pretty confident:";return this._guessedJob?h`
|
|
1525
|
+
<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">
|
|
1526
|
+
<div class="flex items-center justify-between">
|
|
1527
|
+
<div class="text-[13px] text-black/60">${n}</div>
|
|
1528
|
+
<span class="h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"></span>
|
|
1529
|
+
</div>
|
|
1530
|
+
|
|
1531
|
+
<div class="mt-3 space-y-1.5 text-[13px] text-black/80">
|
|
1532
|
+
<div class="rounded-xl bg-black/[0.04] px-3 py-2">${s} ${this._guessedJob}.</div>
|
|
1533
|
+
</div>
|
|
1534
|
+
|
|
1535
|
+
<div class="mt-3 h-1.5 overflow-hidden rounded-full bg-black/5">
|
|
1536
|
+
<div class="h-full rounded-full bg-[${this.color}] transition-[width] duration-300" style="width: 100%"></div>
|
|
1537
|
+
</div>
|
|
1538
|
+
</div>
|
|
1539
|
+
`:this._currentQuestion?h`
|
|
1540
|
+
<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">
|
|
1541
|
+
<div class="flex items-center justify-between">
|
|
1542
|
+
<div class="text-[13px] text-black/60">${n}</div>
|
|
1543
|
+
<span class="h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"></span>
|
|
1544
|
+
</div>
|
|
1545
|
+
|
|
1546
|
+
<div class="mt-2 flex items-center justify-between">
|
|
1547
|
+
<h3 class="text-sm font-semibold text-black">${i}</h3>
|
|
1548
|
+
<div class="text-xs text-black/40"><span>${this._questionHistory.length}</span>/${o(this,Ar)}</div>
|
|
1549
|
+
</div>
|
|
1550
|
+
|
|
1551
|
+
<div class="mt-3 rounded-xl bg-black/[0.04] px-3 py-2 text-[14px] font-medium text-black">${this._currentQuestion}</div>
|
|
1552
|
+
|
|
1553
|
+
<div class="mt-3 grid grid-cols-3 gap-2">
|
|
1554
|
+
${this.options.map((a,u)=>{let l=this._loadingAnswer===a;return h`
|
|
1555
|
+
<button
|
|
1556
|
+
@click="${()=>o(this,$s).call(this,a)}"
|
|
1557
|
+
?disabled="${this._isLoadingNextQuestion}"
|
|
1558
|
+
class="${u===0?`flex items-center justify-center gap-1 rounded-xl bg-[${this.color}] px-1 py-1.5 text-sm text-white transition-colors hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50`:u===1?`flex items-center justify-center gap-1 rounded-xl bg-[${this.color}]/80 px-1 py-1.5 text-sm text-white transition-colors hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50`:"flex items-center justify-center gap-1 rounded-xl border border-black/10 bg-white px-1 py-1.5 text-sm transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-50"}">
|
|
1559
|
+
${l?h`<lucide-icon class="h-3.5 w-3.5 animate-spin" name="loader-circle"></lucide-icon>`:a}
|
|
1560
|
+
</button>
|
|
1561
|
+
`})}
|
|
1562
|
+
</div>
|
|
1563
|
+
|
|
1564
|
+
<div class="mt-3 h-1.5 overflow-hidden rounded-full bg-black/5">
|
|
1565
|
+
<div class="h-full rounded-full bg-[${this.color}] transition-[width] duration-300" style="width: ${r}%"></div>
|
|
1566
|
+
</div>
|
|
1567
|
+
</div>
|
|
1568
|
+
`: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>`}};Ar=new WeakMap,Ir=new WeakSet,uc=async function(){if(!this.apiBaseUrl)return console.warn("API base URL not configured, cannot fetch next question"),null;this._isLoadingNextQuestion=!0;try{let r=await fetch(`${this.apiBaseUrl}/preview/wait-game/next-question`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({questionAnswers:this._questionHistory})});return r.ok?await r.json():(console.error("failed to fetch next question",r.status),null)}catch(r){return console.error("error fetching next question",r),null}finally{this._isLoadingNextQuestion=!1}},$s=new WeakMap,hc=function(){return Math.round(this._questionHistory.length/o(this,Ar)*100)},w(qn,"properties",{question:{type:String},options:{type:Array},title:{type:String},gameTitle:{type:String},resultPrefix:{type:String},color:{type:String},apiBaseUrl:{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}}),w(qn,"styles",H`
|
|
1569
|
+
:host {
|
|
1570
|
+
display: block;
|
|
1571
|
+
}
|
|
1572
|
+
`);customElements.define("mw-chat-wait-game",qn);var Ut,Je,Rt,ae,pc,tl,dc,Ss,Es,fc,mc,zn=class extends _($){constructor(){super();d(this,ae);d(this,Ut,null);d(this,Je,null);d(this,Rt,0);d(this,Es,()=>{this._showGame=!0,this.dispatchEvent(new CustomEvent("mw-chat-wait-timer:game-click",{bubbles:!0,composed:!0}))});this.title="",this.message="",this.completeMessage="",this.gameButton="",this.question="",this.options="",this.gameTitle="",this.resultPrefix="",this.targetEndTime="",this.color="#601feb",this.apiBaseUrl="",this._remainingSeconds=480,this._isComplete=!1,this._showGame=!1}connectedCallback(){super.connectedCallback(),f(this,ae,pc).call(this),f(this,ae,dc).call(this)}disconnectedCallback(){super.disconnectedCallback(),f(this,ae,Ss).call(this)}render(){if(this._showGame)return h`
|
|
1573
|
+
<mw-chat-wait-game
|
|
1574
|
+
.question="${this.question}"
|
|
1575
|
+
.options="${this.options}"
|
|
1576
|
+
.gameTitle="${this.gameTitle}"
|
|
1577
|
+
.resultPrefix="${this.resultPrefix}"
|
|
1578
|
+
.title="${this.title}"
|
|
1579
|
+
.color="${this.color}"
|
|
1580
|
+
.apiBaseUrl="${this.apiBaseUrl}"></mw-chat-wait-game>
|
|
1581
|
+
`;let{minutes:r,seconds:n}=f(this,ae,fc).call(this),i=f(this,ae,mc).call(this);return h`
|
|
1582
|
+
<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">
|
|
1583
|
+
<!-- Time -->
|
|
1584
|
+
<div class="font-[ui-monospace,Menlo,Monaco,Consolas] text-4xl tracking-tight text-black tabular-nums" aria-live="polite">${r}<span class="text-black/30">:</span>${n}</div>
|
|
1585
|
+
|
|
1586
|
+
<!-- Progress bar -->
|
|
1587
|
+
<div class="mt-3 h-1.5 overflow-hidden rounded-full bg-black/5">
|
|
1588
|
+
<div class="h-full rounded-full bg-[${this.color}] transition-[width] duration-300" style="width: ${i}%"></div>
|
|
1589
|
+
</div>
|
|
1590
|
+
|
|
1591
|
+
<!-- Message -->
|
|
1592
|
+
<div class="mt-2 text-[12px] text-black/50">${this._isComplete?this.completeMessage:this.message}</div>
|
|
1593
|
+
|
|
1594
|
+
<!-- Play a Game Button -->
|
|
1595
|
+
<div class="mt-4">
|
|
1596
|
+
<button @click="${o(this,Es)}" 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>
|
|
1597
|
+
</div>
|
|
1598
|
+
</div>
|
|
1599
|
+
`}};Ut=new WeakMap,Je=new WeakMap,Rt=new WeakMap,ae=new WeakSet,pc=function(){this.targetEndTime?g(this,Je,new Date(this.targetEndTime)):g(this,Je,new Date(Date.now()+this._remainingSeconds*1e3)),g(this,Rt,Math.max(el(o(this,Je),new Date),0)),f(this,ae,tl).call(this)},tl=function(){if(o(this,Je)===null)return;let r=new Date;this._remainingSeconds=Math.max(el(o(this,Je),r),0),this._remainingSeconds===0&&(f(this,ae,Ss).call(this),this._isComplete=!0)},dc=function(){f(this,ae,Ss).call(this),g(this,Ut,setInterval(()=>{f(this,ae,tl).call(this)},1e3))},Ss=function(){o(this,Ut)!==null&&(clearInterval(o(this,Ut)),g(this,Ut,null))},Es=new WeakMap,fc=function(){let r=Math.floor(this._remainingSeconds/60),n=this._remainingSeconds%60,i=s=>String(s).padStart(2,"0");return{minutes:i(r),seconds:i(n)}},mc=function(){if(o(this,Je)===null||o(this,Rt)===0)return 0;let r=o(this,Rt)-this._remainingSeconds;return Math.round(r/o(this,Rt)*100)},w(zn,"properties",{totalSeconds:{type:Number},title:{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"},targetEndTime:{type:String,attribute:"target-end-time"},color:{type:String},apiBaseUrl:{type:String},_remainingSeconds:{type:Number,state:!0},_isComplete:{type:Boolean,state:!0},_showGame:{type:Boolean,state:!0}}),w(zn,"styles",H`
|
|
1600
|
+
:host {
|
|
1601
|
+
display: block;
|
|
1602
|
+
}
|
|
1603
|
+
`);customElements.define("mw-chat-wait-timer",zn);var _s=class extends _($){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 E1(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 h`
|
|
1604
|
+
<a
|
|
1605
|
+
href="${ue(this.trackedProductUrl)}"
|
|
1606
|
+
title="${ue(e)}"
|
|
1607
|
+
class="group flex w-full max-w-md cursor-pointer gap-[10px] overflow-hidden rounded-lg"
|
|
1608
|
+
target="${this.linksNewTab?"_blank":"_self"}"
|
|
1609
|
+
?disabled="${this.streaming}">
|
|
1610
|
+
${this.streaming?h`
|
|
1611
|
+
<!-- shimmer -->
|
|
1612
|
+
<div class="h-[70px] w-[70px] animate-pulse overflow-hidden rounded-lg bg-gray-200"></div>
|
|
1613
|
+
`:h`<img src="${ue(s)}" class="block h-[70px] w-[70px] rounded-lg bg-gray-100 object-contain" loading="lazy" />`}
|
|
1614
|
+
|
|
1615
|
+
<div class="flex flex-1 flex-col justify-between">
|
|
1616
|
+
<div>
|
|
1617
|
+
${e||!this.streaming?h`<h3 class="line-clamp-1 text-sm font-medium group-hover:underline">${e}</h3>`:h`<div class="h-5 w-32 animate-pulse rounded bg-gray-200"></div>`}
|
|
1618
|
+
|
|
1619
|
+
<!-- no margin here -->
|
|
1620
|
+
|
|
1621
|
+
${r||!this.streaming?h`<p class="line-clamp-2 text-xs text-gray-500">${r}</p>`:h`<div class="my-1 h-6 w-3/4 animate-pulse rounded bg-gray-200"></div>`}
|
|
1622
|
+
</div>
|
|
1623
|
+
|
|
1624
|
+
<!-- flexbox filled space -->
|
|
1625
|
+
|
|
1626
|
+
${n||!this.streaming?h`<span class="text-xs text-gray-900">${n}</span>`:h`<div class="h-4 w-14 animate-pulse rounded bg-gray-200"></div>`}
|
|
1627
|
+
</div>
|
|
1628
|
+
</a>
|
|
1629
|
+
`}};w(_s,"properties",{product:{type:Object},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},searchParams:{type:Object},imagesByProductUrl:{type:Object}});customElements.get("mw-product-card-horizontal")||customElements.define("mw-product-card-horizontal",_s);function Ms(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 As=function(){},Lr=function(){};var Fn=(t,e,r)=>Math.min(Math.max(r,t),e);var rl=.001,Wh=.01,gc=10,Gh=.05,Jh=1;function wc({duration:t=800,bounce:e=.25,velocity:r=0,mass:n=1}){let i,s;As(t<=gc*1e3,"Spring duration must be 10 seconds or less");let a=1-e;a=Fn(Gh,Jh,a),t=Fn(Wh,gc,t/1e3),a<1?(i=c=>{let p=c*a,m=p*t,v=p-r,b=Is(c,a),S=Math.exp(-m);return rl-v/b*S},s=c=>{let m=c*a*t,v=m*r+r,b=Math.pow(a,2)*Math.pow(c,2)*t,S=Math.exp(-m),T=Is(Math.pow(c,2),a);return(-i(c)+rl>0?-1:1)*((v-b)*S)/T}):(i=c=>{let p=Math.exp(-c*t),m=(c-r)*t+1;return-rl+p*m},s=c=>{let p=Math.exp(-c*t),m=(r-c)*(t*t);return p*m});let u=5/t,l=Yh(i,s,u);if(t=t*1e3,isNaN(l))return{stiffness:100,damping:10,duration:t};{let c=Math.pow(l,2)*n;return{stiffness:c,damping:a*2*Math.sqrt(n*c),duration:t}}}var Kh=12;function Yh(t,e,r){let n=r;for(let i=1;i<Kh;i++)n=n-t(n)/e(n);return n}function Is(t,e){return t*Math.sqrt(1-e*e)}var Xh=["duration","bounce"],Qh=["stiffness","damping","mass"];function vc(t,e){return e.some(r=>t[r]!==void 0)}function ep(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!vc(t,Qh)&&vc(t,Xh)){let r=wc(t);e=Object.assign(Object.assign(Object.assign({},e),r),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function Ls(t){var{from:e=0,to:r=1,restSpeed:n=2,restDelta:i}=t,s=Ms(t,["from","to","restSpeed","restDelta"]);let a={done:!1,value:e},{stiffness:u,damping:l,mass:c,velocity:p,duration:m,isResolvedFromDuration:v}=ep(s),b=yc,S=yc;function T(){let k=p?-(p/1e3):0,A=r-e,C=l/(2*Math.sqrt(u*c)),M=Math.sqrt(u/c)/1e3;if(i===void 0&&(i=Math.min(Math.abs(r-e)/100,.4)),C<1){let L=Is(M,C);b=N=>{let ee=Math.exp(-C*M*N);return r-ee*((k+C*M*A)/L*Math.sin(L*N)+A*Math.cos(L*N))},S=N=>{let ee=Math.exp(-C*M*N);return C*M*ee*(Math.sin(L*N)*(k+C*M*A)/L+A*Math.cos(L*N))-ee*(Math.cos(L*N)*(k+C*M*A)-L*A*Math.sin(L*N))}}else if(C===1)b=L=>r-Math.exp(-M*L)*(A+(k+M*A)*L);else{let L=M*Math.sqrt(C*C-1);b=N=>{let ee=Math.exp(-C*M*N),se=Math.min(L*N,300);return r-ee*((k+C*M*A)*Math.sinh(se)+L*A*Math.cosh(se))/L}}}return T(),{next:k=>{let A=b(k);if(v)a.done=k>=m;else{let C=S(k)*1e3,M=Math.abs(C)<=n,L=Math.abs(r-A)<=i;a.done=M&&L}return a.value=a.done?r:A,a},flipTarget:()=>{p=-p,[e,r]=[r,e],T()}}}Ls.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";var yc=t=>0;var nl=(t,e,r)=>{let n=e-t;return n===0?1:(r-t)/n};var jr=(t,e,r)=>-r*t+r*e+t;var js=(t,e)=>r=>Math.max(Math.min(r,e),t),at=t=>t%1?Number(t.toFixed(5)):t,Tr=/(-)?([\d]*\.?[\d])+/g,Ts=/(#[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,xc=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Ke(t){return typeof t=="string"}var Dr={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Ds=Object.assign(Object.assign({},Dr),{transform:js(0,1)}),Mm=Object.assign(Object.assign({},Dr),{default:1});var Nn=t=>({test:e=>Ke(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Lm=Nn("deg"),Or=Nn("%"),jm=Nn("px"),Tm=Nn("vh"),Dm=Nn("vw"),Om=Object.assign(Object.assign({},Or),{parse:t=>Or.parse(t)/100,transform:t=>Or.transform(t*100)});var Pr=(t,e)=>r=>!!(Ke(r)&&xc.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),Os=(t,e,r)=>n=>{if(!Ke(n))return n;let[i,s,a,u]=n.match(Tr);return{[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(a),alpha:u!==void 0?parseFloat(u):1}};var He={test:Pr("hsl","hue"),parse:Os("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+Or.transform(at(e))+", "+Or.transform(at(r))+", "+at(Ds.transform(n))+")"};var tp=js(0,255),Ps=Object.assign(Object.assign({},Dr),{transform:t=>Math.round(tp(t))}),Me={test:Pr("rgb","red"),parse:Os("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+Ps.transform(t)+", "+Ps.transform(e)+", "+Ps.transform(r)+", "+at(Ds.transform(n))+")"};function rp(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 Ur={test:Pr("#"),parse:rp,transform:Me.transform};var lt={test:t=>Me.test(t)||Ur.test(t)||He.test(t),parse:t=>Me.test(t)?Me.parse(t):He.test(t)?He.parse(t):Ur.parse(t),transform:t=>Ke(t)?t:t.hasOwnProperty("red")?Me.transform(t):He.transform(t)};var bc="${c}",kc="${n}";function np(t){var e,r,n,i;return isNaN(t)&&Ke(t)&&((r=(e=t.match(Tr))===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0)+((i=(n=t.match(Ts))===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0)>0}function Cc(t){typeof t=="number"&&(t=`${t}`);let e=[],r=0,n=t.match(Ts);n&&(r=n.length,t=t.replace(Ts,bc),e.push(...n.map(lt.parse)));let i=t.match(Tr);return i&&(t=t.replace(Tr,kc),e.push(...i.map(Dr.parse))),{values:e,numColors:r,tokenised:t}}function $c(t){return Cc(t).values}function Sc(t){let{values:e,numColors:r,tokenised:n}=Cc(t),i=e.length;return s=>{let a=n;for(let u=0;u<i;u++)a=a.replace(u<r?bc:kc,u<r?lt.transform(s[u]):at(s[u]));return a}}var ip=t=>typeof t=="number"?0:t;function sp(t){let e=$c(t);return Sc(t)(e.map(ip))}var Us={test:np,parse:$c,createTransformer:Sc,getAnimatableNone:sp};function il(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 sl({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,s=0,a=0;if(!e)i=s=a=r;else{let u=r<.5?r*(1+e):r+e-r*e,l=2*r-u;i=il(l,u,t+1/3),s=il(l,u,t),a=il(l,u,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:n}}var op=(t,e,r)=>{let n=t*t,i=e*e;return Math.sqrt(Math.max(0,r*(i-n)+n))},ap=[Ur,Me,He],Ec=t=>ap.find(e=>e.test(t)),_c=t=>`'${t}' is not an animatable color. Use the equivalent color code instead.`,Rs=(t,e)=>{let r=Ec(t),n=Ec(e);Lr(!!r,_c(t)),Lr(!!n,_c(e));let i=r.parse(t),s=n.parse(e);r===He&&(i=sl(i),r=Me),n===He&&(s=sl(s),n=Me);let a=Object.assign({},i);return u=>{for(let l in a)l!=="alpha"&&(a[l]=op(i[l],s[l],u));return a.alpha=jr(i.alpha,s.alpha,u),r.transform(a)}};var Mc=t=>typeof t=="number";var lp=(t,e)=>r=>e(t(r)),Vs=(...t)=>t.reduce(lp);function Ic(t,e){return Mc(t)?r=>jr(t,e,r):lt.test(t)?Rs(t,e):al(t,e)}var ol=(t,e)=>{let r=[...t],n=r.length,i=t.map((s,a)=>Ic(s,e[a]));return s=>{for(let a=0;a<n;a++)r[a]=i[a](s);return r}},Lc=(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]=Ic(t[i],e[i]));return i=>{for(let s in n)r[s]=n[s](i);return r}};function Ac(t){let e=Us.parse(t),r=e.length,n=0,i=0,s=0;for(let a=0;a<r;a++)n||typeof e[a]=="number"?n++:e[a].hue!==void 0?s++:i++;return{parsed:e,numNumbers:n,numRGB:i,numHSL:s}}var al=(t,e)=>{let r=Us.createTransformer(e),n=Ac(t),i=Ac(e);return n.numHSL===i.numHSL&&n.numRGB===i.numRGB&&n.numNumbers>=i.numNumbers?Vs(ol(n.parsed,i.parsed),r):(As(!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.`),a=>`${a>0?e:t}`)};var cp=(t,e)=>r=>jr(t,e,r);function up(t){if(typeof t=="number")return cp;if(typeof t=="string")return lt.test(t)?Rs:al;if(Array.isArray(t))return ol;if(typeof t=="object")return Lc}function hp(t,e,r){let n=[],i=r||up(t[0]),s=t.length-1;for(let a=0;a<s;a++){let u=i(t[a],t[a+1]);if(e){let l=Array.isArray(e)?e[a]:e;u=Vs(l,u)}n.push(u)}return n}function pp([t,e],[r]){return n=>r(nl(t,e,n))}function dp(t,e){let r=t.length,n=r-1;return i=>{let s=0,a=!1;if(i<=t[0]?a=!0:i>=t[n]&&(s=n-1,a=!0),!a){let l=1;for(;l<r&&!(t[l]>i||l===n);l++);s=l-1}let u=nl(t[s],t[s+1],i);return e[s](u)}}function Bs(t,e,{clamp:r=!0,ease:n,mixer:i}={}){let s=t.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."),t[0]>t[s-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());let a=hp(e,n,i),u=s===2?pp(t,a):dp(t,a);return r?l=>u(Fn(t[0],t[s-1],l)):u}var Zn=t=>e=>1-t(1-e),Hs=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,jc=t=>e=>Math.pow(e,t),ll=t=>e=>e*e*((t+1)*e-t),Tc=t=>{let e=ll(t);return r=>(r*=2)<1?.5*e(r):.5*(2-Math.pow(2,-10*(r-1)))};var Dc=1.525,fp=4/11,mp=8/11,gp=9/10;var Oc=jc(2),R7=Zn(Oc),Pc=Hs(Oc),wp=t=>1-Math.sin(Math.acos(t)),vp=Zn(wp),V7=Hs(vp),Uc=ll(Dc),B7=Zn(Uc),H7=Hs(Uc),q7=Tc(Dc),yp=4356/361,xp=35442/1805,bp=16061/1805,kp=t=>{if(t===1||t===0)return t;let e=t*t;return t<fp?7.5625*e:t<mp?9.075*e-9.9*t+3.4:t<gp?yp*e-xp*t+bp:10.8*t*t-20.52*t+10.72},z7=Zn(kp);function Cp(t,e){return t.map(()=>e||Pc).splice(0,t.length-1)}function $p(t){let e=t.length;return t.map((r,n)=>n!==0?n/(e-1):0)}function Sp(t,e){return t.map(r=>r*e)}function Wn({from:t=0,to:e=1,ease:r,offset:n,duration:i=300}){let s={done:!1,value:t},a=Array.isArray(e)?e:[t,e],u=Sp(n&&n.length===a.length?n:$p(a),i);function l(){return Bs(u,a,{ease:Array.isArray(r)?r:Cp(a,r)})}let c=l();return{next:p=>(s.value=c(p),s.done=p>=i,s),flipTarget:()=>{a.reverse(),c=l()}}}function Rc({velocity:t=0,from:e=0,power:r=.8,timeConstant:n=350,restDelta:i=.5,modifyTarget:s}){let a={done:!1,value:e},u=r*t,l=e+u,c=s===void 0?l:s(l);return c!==l&&(u=c-e),{next:p=>{let m=-u*Math.exp(-p/n);return a.done=!(m>i||m<-i),a.value=a.done?c:c+m,a},flipTarget:()=>{}}}var Vc={keyframes:Wn,spring:Ls,decay:Rc};function Bc(t){if(Array.isArray(t.to))return Wn;if(Vc[t.type])return Vc[t.type];let e=new Set(Object.keys(t));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 cl=16.666666666666668,Ep=typeof performance<"u"?()=>performance.now():()=>Date.now(),ul=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Ep()),cl);function Hc(t){let e=[],r=[],n=0,i=!1,s=!1,a=new WeakSet,u={schedule:(l,c=!1,p=!1)=>{let m=p&&i,v=m?e:r;return c&&a.add(l),v.indexOf(l)===-1&&(v.push(l),m&&i&&(n=e.length)),l},cancel:l=>{let c=r.indexOf(l);c!==-1&&r.splice(c,1),a.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 c=0;c<n;c++){let p=e[c];p(l),a.has(p)&&(u.schedule(p),t())}i=!1,s&&(s=!1,u.process(l))}};return u}var _p=40,hl=!0,Jn=!1,pl=!1,Gn={delta:0,timestamp:0},Kn=["read","update","preRender","render","postRender"],qs=Kn.reduce((t,e)=>(t[e]=Hc(()=>Jn=!0),t),{}),Mp=Kn.reduce((t,e)=>{let r=qs[e];return t[e]=(n,i=!1,s=!1)=>(Jn||Ip(),r.schedule(n,i,s)),t},{}),qc=Kn.reduce((t,e)=>(t[e]=qs[e].cancel,t),{}),ng=Kn.reduce((t,e)=>(t[e]=()=>qs[e].process(Gn),t),{}),Ap=t=>qs[t].process(Gn),zc=t=>{Jn=!1,Gn.delta=hl?cl:Math.max(Math.min(t-Gn.timestamp,_p),1),Gn.timestamp=t,pl=!0,Kn.forEach(Ap),pl=!1,Jn&&(hl=!1,ul(zc))},Ip=()=>{Jn=!0,hl=!0,pl||ul(zc)};var Fc=Mp;function dl(t,e,r=0){return t-e-r}function Nc(t,e,r=0,n=!0){return n?dl(e+-t,e,r):e-(t-e)+r}function Zc(t,e,r,n){return n?t>=e+r:t<=-r}var Lp=t=>{let e=({delta:r})=>t(r);return{start:()=>Fc.update(e,!0),stop:()=>qc.update(e)}};function fl(t){var e,r,{from:n,autoplay:i=!0,driver:s=Lp,elapsed:a=0,repeat:u=0,repeatType:l="loop",repeatDelay:c=0,onPlay:p,onStop:m,onComplete:v,onRepeat:b,onUpdate:S}=t,T=Ms(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:k}=T,A,C=0,M=T.duration,L,N=!1,ee=!0,se,R=Bc(T);!((r=(e=R).needsInterpolation)===null||r===void 0)&&r.call(e,n,k)&&(se=Bs([0,100],[n,k],{clamp:!1}),n=0,k=100);let oe=R(Object.assign(Object.assign({},T),{from:n,to:k}));function de(){C++,l==="reverse"?(ee=C%2===0,a=Nc(a,M,c,ee)):(a=dl(a,M,c),l==="mirror"&&oe.flipTarget()),N=!1,b&&b()}function Mo(){A.stop(),v&&v()}function gt(J){if(ee||(J=-J),a+=J,!N){let le=oe.next(Math.max(0,a));L=le.value,se&&(L=se(L)),N=ee?le.done:a<=0}S?.(L),N&&(C===0&&(M??(M=a)),C<u?Zc(a,M,c,ee)&&de():Mo())}function Si(){p?.(),A=s(gt),A.start()}return i&&Si(),{stop:()=>{m?.(),A.stop()}}}var F,Wc,zs,Gc,Fs,Jc,Kc,Yc,Ns,Zs=class Zs extends _($){constructor(){super();d(this,F);this.product=void 0,this.labels={addToCart:"Add to cart",color:"Color",size:"Size"},this._currentImageIndex=0,this._isValidUrl=!1}willUpdate(r){r.has("product")&&f(this,F,Wc).call(this)}get images(){return this.product?.images||[]}render(){if(!this.product)return h`
|
|
1630
|
+
<div class="my-2 w-full rounded-3xl border bg-white p-4">
|
|
1631
|
+
<div class="relative mx-auto mb-4 max-w-[240px]">
|
|
1632
|
+
<div class="h-[180px] w-full animate-pulse rounded-2xl bg-gray-200"></div>
|
|
1633
|
+
</div>
|
|
1634
|
+
<div class="mb-2 flex items-end justify-between">
|
|
1635
|
+
<div>
|
|
1636
|
+
<div class="mb-1 h-4 w-20 animate-pulse rounded bg-gray-200"></div>
|
|
1637
|
+
<div class="h-6 w-32 animate-pulse rounded bg-gray-200"></div>
|
|
1638
|
+
</div>
|
|
1639
|
+
<div class="h-6 w-16 animate-pulse rounded bg-gray-200"></div>
|
|
1640
|
+
</div>
|
|
1641
|
+
<div class="mb-4 h-4 w-3/4 animate-pulse rounded bg-gray-200"></div>
|
|
1642
|
+
<div class="my-4 border-t border-gray-200"></div>
|
|
1643
|
+
<div class="flex items-end justify-between gap-3">
|
|
1644
|
+
<div class="h-6 w-16 animate-pulse rounded bg-gray-200"></div>
|
|
1645
|
+
<div class="h-8 flex-auto animate-pulse rounded-xl bg-gray-200"></div>
|
|
1646
|
+
</div>
|
|
1647
|
+
</div>
|
|
1648
|
+
`;if(this.product.layout==="horizontal")return h` <mw-product-card-horizontal product="${JSON.stringify(this.product)}"></mw-product-card-horizontal> `;let{name:r,description:n,price:i,category:s}=this.product;return h`
|
|
1649
|
+
<div class="my-2 w-full rounded-3xl border-[0.5px] border-[#5e5d59]/25 bg-white p-4 hover:shadow-sm">
|
|
1650
|
+
<div class="pointer-events-auto mx-auto mb-4">
|
|
1651
|
+
<div class="group relative overflow-hidden rounded-2xl">
|
|
1652
|
+
<div class="image-slider z-0 flex transition-transform duration-300 ease-in-out" style="transform: translateX(-${this._currentImageIndex*100}%)">
|
|
1653
|
+
${this.images.length>0?_e(this.images,a=>a,(a,u)=>h`
|
|
1654
|
+
<!-- TODO: add srcset with 1x/2x variants for high DPI displays -->
|
|
1655
|
+
<img src="${a}" alt="image ${u+1}: ${r}" class="h-auto w-full flex-shrink-0 object-scale-down" loading="lazy" />
|
|
1656
|
+
`):h`
|
|
1657
|
+
<div class="h-full w-full flex-shrink-0 object-scale-down"></div>
|
|
1658
|
+
<svg class="rounded-lg" height="144" viewBox="0 0 100 133" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1659
|
+
<rect width="100" height="133" rx="2" fill="#EEEEEE" style="" transform="matrix(0.9999999999999999, 0, 0, 0.9999999999999999, 0, -7.105427357601002e-15)" />
|
|
1660
|
+
<g transform="matrix(0.6458070278167725, 0, 0, 0.5434090495109558, -19.74715805053711, -14.242161750793464)">
|
|
1661
|
+
<rect x="92" y="135.169" width="32" height="26.831" rx="2" stroke-width="4" style="isolation: isolate; stroke: rgb(187, 187, 187); fill: none;" />
|
|
1662
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M 109.142 156.857 L 104 149 L 94 160 L 108 160 L 114 160 L 122 160 L 115 153 L 109.142 156.857 Z" fill="#BBBBBB" style="" />
|
|
1663
|
+
<circle cx="110" cy="146" r="3" fill="#BBBBBB" style="" />
|
|
1664
|
+
</g>
|
|
1665
|
+
</svg>
|
|
1666
|
+
`}
|
|
1667
|
+
</div>
|
|
1668
|
+
${this.images.length>1?h`
|
|
1669
|
+
<div class="absolute inset-0 flex items-center justify-between px-4">
|
|
1670
|
+
<button
|
|
1671
|
+
@click="${f(this,F,Kc)}"
|
|
1672
|
+
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">
|
|
1673
|
+
<hi-outline class="block h-6 w-3" name="chevron-left"></hi-outline>
|
|
1674
|
+
</button>
|
|
1675
|
+
<button
|
|
1676
|
+
@click="${f(this,F,Jc)}"
|
|
1677
|
+
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">
|
|
1678
|
+
<hi-outline class="block h-6 w-3" name="chevron-right"></hi-outline>
|
|
1679
|
+
</button>
|
|
1680
|
+
</div>
|
|
1681
|
+
`:null}
|
|
1682
|
+
${this.images?.length>1?h`
|
|
1683
|
+
<div class="slider-dots absolute bottom-3 left-1/2 flex -translate-x-1/2 gap-2">
|
|
1684
|
+
${this.images.map((a,u)=>h`
|
|
1685
|
+
<button
|
|
1686
|
+
@click="${()=>f(this,F,Yc).call(this,u)}"
|
|
1687
|
+
class="${u===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>
|
|
1688
|
+
`)}
|
|
1689
|
+
</div>
|
|
1690
|
+
`:null}
|
|
1691
|
+
</div>
|
|
1692
|
+
</div>
|
|
1693
|
+
<div @click="${f(this,F,zs)}" class="cursor-pointer">
|
|
1694
|
+
${s?h`<a @click="${f(this,F,zs)}" class="${this._isValidUrl?"":"pointer-events-none"} line-clamp-1 text-xs text-gray-600 hover:underline"> ${s} </a>`:null}
|
|
1695
|
+
|
|
1696
|
+
<h3
|
|
1697
|
+
@click="${f(this,F,zs)}"
|
|
1698
|
+
class="${this._isValidUrl?"":"pointer-events-none cursor-default"} mb-1 line-clamp-2 cursor-pointer text-lg font-semibold transition-all hover:underline">
|
|
1699
|
+
${r||h`<span class="inline-block h-6 w-32 animate-pulse rounded bg-gray-200"></span>`}
|
|
1700
|
+
</h3>
|
|
1701
|
+
${n?h`<p class="mb-2 line-clamp-2 text-sm text-gray-600">${n}</p>`:h`<div class="mb-2 h-4 w-3/4 animate-pulse rounded bg-gray-200"></div>`}
|
|
1702
|
+
<span class="text-lg font-bold"> ${i||h`<span class="inline-block h-6 w-16 animate-pulse rounded bg-gray-200"></span>`} </span>
|
|
1703
|
+
|
|
1704
|
+
<!-- <div class="my-4 border-t border-gray-200"></div> -->
|
|
1705
|
+
|
|
1706
|
+
<!-- <button
|
|
1707
|
+
@click="${f(this,F,Gc)}"
|
|
1708
|
+
?disabled="${!this._isValidUrl}"
|
|
1709
|
+
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">
|
|
1710
|
+
${this.labels.addToCart}
|
|
1711
|
+
</button> -->
|
|
1712
|
+
</div>
|
|
1713
|
+
</div>
|
|
1714
|
+
`}};F=new WeakSet,Wc=function(){if(!this.product?.url){this._isValidUrl=!1;return}try{let r=new URL(this.product.url);this._isValidUrl=r.protocol==="http:"||r.protocol==="https:"}catch{this._isValidUrl=!1}},zs=function(r){r.preventDefault(),!(!this.product?.url||!this._isValidUrl)&&window.open(this.product.url,"_blank")},Gc=function(r){!this.product?.url||!this._isValidUrl||(window.open(this.product.url,"_blank"),this.dispatchEvent(new Zs.AddToCartEvent(this.product)))},Fs=function(r,n){o(this,F,Ns)&&fl({from:r,to:n,duration:300,onUpdate:i=>{o(this,F,Ns)&&(o(this,F,Ns).style.transform=`translateX(${i}%)`)}})},Jc=function(){if(!this.product?.images?.length)return;let r=this._currentImageIndex,n=(r+1)%this.product.images.length,i=-(r*100),s=-(n*100);f(this,F,Fs).call(this,i,s),this._currentImageIndex=n},Kc=function(){if(!this.product?.images?.length)return;let r=this._currentImageIndex,n=(r-1+this.product.images.length)%this.product.images.length,i=-(r*100),s=-(n*100);f(this,F,Fs).call(this,i,s),this._currentImageIndex=n},Yc=function(r){if(!this.product?.images?.length)return;let n=this._currentImageIndex,i=Math.max(0,Math.min(r,this.product.images.length-1)),s=-(n*100),a=-(i*100);f(this,F,Fs).call(this,s,a),this._currentImageIndex=i},Ns=function(){return this.renderRoot.querySelector(".image-slider")},w(Zs,"properties",{product:{type:Object},labels:{type:Object},_currentImageIndex:{type:Number,state:!0},_isValidUrl:{type:Boolean,state:!0}});var Yn=Zs,ml;Yn.AddToCartEvent=(ml=class extends CustomEvent{constructor(e,r={}){super(Yn.AddToCartEvent.type,{detail:{product:e},...r})}},w(ml,"type","mw-product-card:add-to-cart"),ml);customElements.get("mw-product-card")||customElements.define("mw-product-card",Yn);function Rr(t){return Array.isArray(t)?t:t?[t]:[]}function Xc(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 Ws=(t,e,r)=>{for(let n of e)if(n[0]===t)return(0,n[1])();return r?.()};var Gs=class extends _($){constructor(){super(),this.orderDetails=null,this.streaming=!1,this.linksNewTab=!1,this.color="#601feb"}render(){let e=Rr(this.orderDetails?.order_status?.step||[]),r=Rr(this.orderDetails?.items?.item||[]),n=Rr(this.orderDetails?.actions||[]);return h`
|
|
1715
|
+
<div class="flex w-full max-w-md flex-col rounded-3xl border bg-white p-4">
|
|
1716
|
+
<!-- Header with order ID -->
|
|
1717
|
+
<div class="mb-2">
|
|
1718
|
+
${this.orderDetails?.order_id?.label||!this.streaming?h`<h2 class="text-lg font-semibold">${this.orderDetails?.order_id?.label} ${this.orderDetails?.order_id?.value}</h2>`:h`<div class="h-7 w-full animate-pulse rounded bg-gray-200"></div>`}
|
|
1719
|
+
</div>
|
|
1720
|
+
|
|
1721
|
+
<!-- Progress Timeline -->
|
|
1722
|
+
<div>
|
|
1723
|
+
<ol role="list" class="w-full overflow-hidden">
|
|
1724
|
+
${this.streaming&&!this.orderDetails?h`
|
|
1725
|
+
<!-- Loading for status timeline -->
|
|
1726
|
+
${[1,2,3].map((i,s)=>h`
|
|
1727
|
+
<li class="w-full pb-8">
|
|
1728
|
+
${s<2?h`<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>`:""}
|
|
1729
|
+
<div class="group relative flex items-start">
|
|
1730
|
+
<span class="flex h-6 items-center">
|
|
1731
|
+
<span class="h-4 w-4 animate-pulse rounded-full bg-gray-200"></span>
|
|
1732
|
+
</span>
|
|
1733
|
+
<span class="ml-3 flex min-w-0 flex-col">
|
|
1734
|
+
<span class="h-5 w-24 animate-pulse rounded bg-gray-200"></span>
|
|
1735
|
+
</span>
|
|
1736
|
+
</div>
|
|
1737
|
+
</li>
|
|
1738
|
+
`)}
|
|
1739
|
+
`:_e(e,i=>i.label,(i,s)=>{let a=i.status==="completed",u=i.status==="in_progress",l=s===e.length-1;return h`<li class="relative pb-4">
|
|
1740
|
+
${l?"":h`<div class="${`absolute left-2 top-2 -ml-px mt-0.5 h-full w-0.5 ${a?`bg-[${this.color}]`:"bg-gray-300"}`}" aria-hidden="true"></div>`}
|
|
1741
|
+
|
|
1742
|
+
<div class="group relative flex items-start">
|
|
1743
|
+
${Ws(i.status,[["pending",()=>h` <span class="flex h-6 items-center">
|
|
1744
|
+
<span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-gray-300 bg-white">
|
|
1745
|
+
<span class="h-1.5 w-1.5 rounded-full bg-transparent"></span>
|
|
1746
|
+
</span>
|
|
1747
|
+
</span>`],["in_progress",()=>h`<span class="flex h-6 items-center">
|
|
1748
|
+
<span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-[${this.color}] bg-white">
|
|
1749
|
+
<span class="h-1.5 w-1.5 rounded-full bg-[${this.color}]"></span>
|
|
1750
|
+
</span>
|
|
1751
|
+
</span>`],["completed",()=>h`
|
|
1752
|
+
<span class="flex h-6 items-center">
|
|
1753
|
+
<span class="flex h-4 w-4 items-center justify-center rounded-full bg-[${this.color}]">
|
|
1754
|
+
<hi-outline class="mb-3 block h-3 w-3 text-white" name="check"></hi-outline>
|
|
1755
|
+
</span>
|
|
1756
|
+
</span>
|
|
1757
|
+
`]],()=>h`<span class="flex h-6 items-center">
|
|
1758
|
+
<span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-[${this.color}] bg-white">
|
|
1759
|
+
<span class="h-1.5 w-1.5 rounded-full bg-[${this.color}]"></span>
|
|
1760
|
+
</span>
|
|
1761
|
+
</span>`)}
|
|
1762
|
+
|
|
1763
|
+
<span class="ml-3 flex min-w-0 flex-col">
|
|
1764
|
+
<span class="${`text-sm font-medium ${u?`text-[${this.color}]`:a?"text-gray-900":"text-gray-500"}`}"> ${i.label} </span>
|
|
1765
|
+
</span>
|
|
1766
|
+
</div>
|
|
1767
|
+
</li>`})}
|
|
1768
|
+
</ol>
|
|
1769
|
+
</div>
|
|
1770
|
+
|
|
1771
|
+
<!-- Products list with order items -->
|
|
1772
|
+
<div class="mb-2 w-full">
|
|
1773
|
+
${r.length===0&&!this.orderDetails?.total?.amount&&this.streaming?h`
|
|
1774
|
+
<!-- Loading shimmer for products -->
|
|
1775
|
+
<div class="w-full space-y-4">
|
|
1776
|
+
<div class="flex items-center gap-2">
|
|
1777
|
+
<div class="h-12 w-12 animate-pulse rounded-lg bg-gray-200"></div>
|
|
1778
|
+
<div class="flex-1 space-y-2">
|
|
1779
|
+
<div class="h-4 w-32 animate-pulse rounded bg-gray-200"></div>
|
|
1780
|
+
<div class="h-4 w-24 animate-pulse rounded bg-gray-200"></div>
|
|
1781
|
+
</div>
|
|
1782
|
+
</div>
|
|
1783
|
+
<div class="flex items-center justify-between">
|
|
1784
|
+
<div class="h-4 w-12 animate-pulse rounded bg-gray-200"></div>
|
|
1785
|
+
<div class="h-4 w-10 animate-pulse rounded bg-gray-200"></div>
|
|
1786
|
+
</div>
|
|
1787
|
+
</div>
|
|
1788
|
+
`:h`
|
|
1789
|
+
<div class="divide-y divide-gray-100">
|
|
1790
|
+
${this.streaming&&!r.length?h`
|
|
1791
|
+
<!-- Loading shimmer for individual products -->
|
|
1792
|
+
${[1,2].map(()=>h`
|
|
1793
|
+
<div class="flex items-center gap-2 py-1.5">
|
|
1794
|
+
<div class="h-12 w-12 animate-pulse rounded-lg bg-gray-200"></div>
|
|
1795
|
+
<div class="min-w-0 flex-1">
|
|
1796
|
+
<div class="h-4 w-32 animate-pulse rounded bg-gray-200"></div>
|
|
1797
|
+
</div>
|
|
1798
|
+
<div class="h-4 w-24 animate-pulse rounded bg-gray-200"></div>
|
|
1799
|
+
</div>
|
|
1800
|
+
`)}
|
|
1801
|
+
`:r?.map(i=>{let s=i?.image_url;return h`
|
|
1802
|
+
<div class="flex items-center gap-2 py-1.5">
|
|
1803
|
+
<img src="${ue(s)}" class="block h-12 w-12 rounded-lg bg-gray-100 object-contain" loading="lazy" />
|
|
1804
|
+
|
|
1805
|
+
<div class="min-w-0 flex-1">
|
|
1806
|
+
${!i?.name&&this.streaming?h`<div class="h-4 w-32 animate-pulse rounded bg-gray-200"></div>`:h`<h3 class="truncate text-sm font-medium">${i?.name}</h3>`}
|
|
1807
|
+
</div>
|
|
1808
|
+
${!i?.price&&this.streaming?h`<div class="h-4 w-24 animate-pulse rounded bg-gray-200"></div>`:h`<span class="text-sm text-gray-500">${i?.quantity&&Number(i.quantity)>1?"x":""} ${i?.price}</span>`}
|
|
1809
|
+
</div>
|
|
1810
|
+
`})}
|
|
1811
|
+
</div>
|
|
1812
|
+
<!-- Order total -->
|
|
1813
|
+
<div class="mt-1 border-t border-gray-200 pt-1">
|
|
1814
|
+
<div class="flex justify-between font-medium">
|
|
1815
|
+
<span>${this.orderDetails?.total?.label}</span>
|
|
1816
|
+
<span>${this.orderDetails?.total?.amount}</span>
|
|
1817
|
+
</div>
|
|
1818
|
+
</div>
|
|
1819
|
+
`}
|
|
1820
|
+
</div>
|
|
1821
|
+
|
|
1822
|
+
<!-- Shipping and payment information -->
|
|
1823
|
+
<div class="mb-2 flex w-full flex-col gap-2 overflow-hidden">
|
|
1824
|
+
${this.streaming&&!this.orderDetails?h`
|
|
1825
|
+
<!-- Loading shimmer template -->
|
|
1826
|
+
${[1,2].map(()=>h`
|
|
1827
|
+
<div>
|
|
1828
|
+
<div class="mb-2 h-5 w-32 animate-pulse rounded bg-gray-200"></div>
|
|
1829
|
+
<div class="space-y-2 overflow-hidden">
|
|
1830
|
+
<div class="h-4 w-40 animate-pulse rounded bg-gray-200"></div>
|
|
1831
|
+
<div class="h-4 w-36 animate-pulse rounded bg-gray-200"></div>
|
|
1832
|
+
</div>
|
|
1833
|
+
</div>
|
|
1834
|
+
`)}
|
|
1835
|
+
`:h`
|
|
1836
|
+
<!-- Shipping Section -->
|
|
1837
|
+
<div>
|
|
1838
|
+
${this.streaming&&!this.orderDetails?.shipping?h`
|
|
1839
|
+
<div>
|
|
1840
|
+
<div class="mb-2 h-5 w-32 animate-pulse rounded bg-gray-200"></div>
|
|
1841
|
+
<div class="space-y-2 overflow-hidden">
|
|
1842
|
+
<div class="h-4 w-40 animate-pulse rounded bg-gray-200"></div>
|
|
1843
|
+
<div class="h-4 w-36 animate-pulse rounded bg-gray-200"></div>
|
|
1844
|
+
</div>
|
|
1845
|
+
</div>
|
|
1846
|
+
`:this.orderDetails?.shipping?.method||this.orderDetails?.customer?.name?h`
|
|
1847
|
+
<h3 class="mb-1 text-sm font-medium">${this.orderDetails?.shipping?.label}</h3>
|
|
1848
|
+
<div class="space-y-1">
|
|
1849
|
+
${this.orderDetails.customer?.name?h`<p class="text-xs text-gray-600">${this.orderDetails.customer.name}</p>`:""}
|
|
1850
|
+
${this.orderDetails.shipping?.method?h`<p class="text-xs text-gray-600">${this.orderDetails.shipping.method}</p>`:""}
|
|
1851
|
+
</div>
|
|
1852
|
+
`:""}
|
|
1853
|
+
</div>
|
|
1854
|
+
|
|
1855
|
+
<!-- Payment Section -->
|
|
1856
|
+
<div>
|
|
1857
|
+
${this.streaming&&!this.orderDetails?.payment?h`
|
|
1858
|
+
<div>
|
|
1859
|
+
<div class="mb-2 h-5 w-32 animate-pulse rounded bg-gray-200"></div>
|
|
1860
|
+
<div class="space-y-2 overflow-hidden">
|
|
1861
|
+
<div class="h-4 w-40 animate-pulse rounded bg-gray-200"></div>
|
|
1862
|
+
<div class="h-4 w-36 animate-pulse rounded bg-gray-200"></div>
|
|
1863
|
+
</div>
|
|
1864
|
+
</div>
|
|
1865
|
+
`:this.orderDetails?.payment?h`
|
|
1866
|
+
<h3 class="mb-1 text-sm font-medium">${this.orderDetails.payment.label}</h3>
|
|
1867
|
+
${this.orderDetails.payment?.method?.value?h`
|
|
1868
|
+
<p class="text-xs text-gray-600">
|
|
1869
|
+
<span class="font-medium">${this.orderDetails.payment.method.label}:</span>
|
|
1870
|
+
${this.orderDetails.payment.method.value}
|
|
1871
|
+
</p>
|
|
1872
|
+
`:""}
|
|
1873
|
+
${this.orderDetails.payment.status?.value?h`
|
|
1874
|
+
<p class="text-xs text-gray-600">
|
|
1875
|
+
<span class="font-medium">${this.orderDetails.payment.status.label}:</span>
|
|
1876
|
+
<span>${this.orderDetails.payment.status.value}</span>
|
|
1877
|
+
</p>
|
|
1878
|
+
`:""}
|
|
1879
|
+
`:""}
|
|
1880
|
+
</div>
|
|
1881
|
+
`}
|
|
1882
|
+
</div>
|
|
1883
|
+
|
|
1884
|
+
<!-- Action buttons section -->
|
|
1885
|
+
<div class="flex w-full flex-col gap-2 overflow-hidden">
|
|
1886
|
+
${this.streaming&&!n[0]?.track_order?.label&&!ra(n[0]?.track_order?.tracking_url||"")?h`
|
|
1887
|
+
<!-- Loading shimmer for buttons -->
|
|
1888
|
+
<div class="h-10 w-full min-w-[250px] animate-pulse overflow-hidden rounded-xl bg-gray-200"></div>
|
|
1889
|
+
`:_e(n,(i,s)=>`action-${s}`,i=>{if(i?.track_order?.label)return h`
|
|
1890
|
+
${ra(i.track_order?.tracking_url||"")?h` <a
|
|
1891
|
+
target="${this.linksNewTab?"_blank":"_self"}"
|
|
1892
|
+
href="${i.track_order?.tracking_url}"
|
|
1893
|
+
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"
|
|
1894
|
+
>${i.track_order.label}</a
|
|
1895
|
+
>`:null}
|
|
1896
|
+
`})}
|
|
1897
|
+
</div>
|
|
1898
|
+
</div>
|
|
1899
|
+
`}};w(Gs,"properties",{orderDetails:{type:Object,attribute:"order-details"},streaming:{type:Boolean},linksNewTab:{type:Boolean,attribute:"links-new-tab"},color:{type:String}});customElements.get("mw-product-order-status-card")||customElements.define("mw-product-order-status-card",Gs);var jp={".section-spacing":{"@apply":"relative flex justify-center px-[25px] py-16 sm:px-9 sm:py-[45px] lg:px-24 lg:py-[104px]"}},gl=Sn({preflight:{...jp},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:[ts(),Xi(),Qi(),rs()],ignorelist:/^(sb-|css-|sbdocs|docblock|innerZoomElementWrapper|docs-|rejt-)/});var Vt=t=>ns(gl)(t);var Qc={afterpay:`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1523
1900
|
<g clip-path="url(#clip0_72_99)">
|
|
1524
1901
|
<path d="M4.05111 17.7979C3.3811 17.609 2.88528 16.8228 3.02311 16.1679C3.08754 15.8613 3.62488 14.8916 5.66696 11.3969C7.31253 8.58086 7.16807 8.79614 7.5579 8.57693C8.1651 8.23577 8.85729 8.35944 9.3574 8.89876C9.57406 9.13227 12.7138 14.5138 13.2446 15.5611C13.7013 16.4624 13.4779 17.2918 12.6683 17.7008C12.3026 17.8856 12.1445 17.9027 10.807 17.9027H9.34544V16.7853V15.668L9.90628 15.6413C10.3909 15.6177 10.4707 15.5894 10.4932 15.4321C10.5327 15.1567 8.50761 11.6728 8.28829 11.6389C8.1454 11.6169 7.90872 11.9632 7.01429 13.5023C5.77516 15.6347 5.77068 15.6592 6.61953 15.6592H7.10209V16.7809V17.9026L5.73364 17.8869C4.98099 17.8869 4.22386 17.8397 4.05111 17.7894V17.7979ZM16.1369 16.4297C15.9485 16.3605 15.7151 16.2328 15.6182 16.1451C15.4392 15.9829 13.9709 13.5122 14.0263 13.4663C14.1601 13.3547 15.8055 12.4296 15.8647 12.4316C15.9066 12.4331 16.0522 12.6179 16.1881 12.8416C16.5946 13.5112 16.6682 13.4466 17.8815 11.3525C18.4675 10.3409 18.947 9.46699 18.947 9.41041C18.947 9.22184 18.6781 9.19843 16.514 9.19843C14.0428 9.19843 14.0805 9.18271 14.4881 9.94894C14.6196 10.1953 14.7176 10.4028 14.7059 10.4095C13.2307 11.2587 12.9019 11.4418 12.8521 11.4418C12.819 11.4418 12.4606 10.8657 12.0557 10.1617C11.3983 9.0185 11.3196 8.83291 11.3196 8.42529C11.3196 7.92054 11.5349 7.51511 11.9768 7.18779C12.2256 7.0033 12.3073 7 16.5532 7C20.5886 7 20.8942 7.01571 21.1455 7.16469C21.7124 7.51134 21.9754 8.15783 21.8067 8.79033C21.7221 9.1076 18.1774 15.3666 17.7607 15.9344C17.3974 16.4295 16.7103 16.639 16.1369 16.4297Z" fill="currentColor"/>
|
|
1525
1902
|
</g>
|
|
@@ -1764,605 +2141,323 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
1764
2141
|
</svg>`,"wechat-pay":`<svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1765
2142
|
<path d="M10.0425 15.8914C9.87678 15.9759 9.68475 15.9928 9.50688 15.9384C9.32901 15.8841 9.17922 15.7627 9.08913 15.6L9.04254 15.4971L7.07304 11.1659C7.06497 11.1139 7.06497 11.0609 7.07304 11.0088C7.07288 10.9615 7.08222 10.9146 7.1005 10.8709C7.11877 10.8272 7.14562 10.7876 7.17946 10.7545C7.21329 10.7214 7.25342 10.6954 7.29748 10.678C7.34154 10.6607 7.38862 10.6523 7.43596 10.6535C7.5129 10.6519 7.588 10.6772 7.64829 10.725L10.01 12.3793C10.1851 12.4964 10.3908 12.5593 10.6015 12.5602C10.7285 12.5609 10.8543 12.5366 10.972 12.4887L21.8562 7.61367C20.7399 6.38076 19.372 5.40176 17.8449 4.74278C16.3179 4.08381 14.6671 3.76021 13.0043 3.79383C7.01779 3.79383 2.16663 7.83467 2.16663 12.8592C2.2017 14.2127 2.56028 15.5382 3.21238 16.7248C3.86449 17.9114 4.79117 18.9246 5.91496 19.6798C6.03454 19.768 6.12378 19.8911 6.17036 20.0322C6.21693 20.1733 6.21854 20.3254 6.17496 20.4674L5.68746 22.3102C5.65782 22.3941 5.63925 22.4815 5.63221 22.5702C5.63117 22.618 5.63983 22.6655 5.65764 22.7099C5.67546 22.7542 5.70208 22.7945 5.73588 22.8283C5.76969 22.8621 5.80999 22.8887 5.85436 22.9066C5.89873 22.9244 5.94624 22.933 5.99404 22.932C6.06674 22.9281 6.13738 22.9065 6.19988 22.8692L8.56154 21.4988C8.73488 21.3926 8.93313 21.3352 9.13679 21.3341C9.24404 21.3341 9.35021 21.3493 9.45096 21.3807C10.6025 21.7057 11.792 21.8703 12.988 21.8682C18.9735 21.8682 23.8322 17.8284 23.8322 12.844C23.8435 11.3574 23.4313 9.89832 22.6438 8.63742L10.1291 15.8438L10.0425 15.8914Z" fill="currentColor"/>
|
|
1766
2143
|
</svg>`,"wrench-screwdriver-solid":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
|
|
1767
|
-
<path fill-rule="evenodd" d="M12 6.75a5.25 5.25 0 0 1 6.775-5.025.75.75 0 0 1 .313 1.248l-3.32 3.319c.063.475.276.934.641 1.299.365.365.824.578 1.3.64l3.318-3.319a.75.75 0 0 1 1.248.313 5.25 5.25 0 0 1-5.472 6.756c-1.018-.086-1.87.1-2.309.634L7.344 21.3A3.298 3.298 0 1 1 2.7 16.657l8.684-7.151c.533-.44.72-1.291.634-2.309A5.342 5.342 0 0 1 12 6.75ZM4.117 19.125a.75.75 0 0 1 .75-.75h.008a.75.75 0 0 1 .75.75v.008a.75.75 0 0 1-.75.75h-.008a.75.75 0 0 1-.75-.75v-.008Z" clip-rule="evenodd" />
|
|
1768
|
-
<path d="m10.076 8.64-2.201-2.2V4.874a.75.75 0 0 0-.364-.643l-3.75-2.25a.75.75 0 0 0-.916.113l-.75.75a.75.75 0 0 0-.113.916l2.25 3.75a.75.75 0 0 0 .643.364h1.564l2.062 2.062 1.575-1.297Z" />
|
|
1769
|
-
<path fill-rule="evenodd" d="m12.556 17.329 4.183 4.182a3.375 3.375 0 0 0 4.773-4.773l-3.306-3.305a6.803 6.803 0 0 1-1.53.043c-.394-.034-.682-.006-.867.042a.589.589 0 0 0-.167.063l-3.086 3.748Zm3.414-1.36a.75.75 0 0 1 1.06 0l1.875 1.876a.75.75 0 1 1-1.06 1.06L15.97 17.03a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" />
|
|
1770
|
-
</svg>`};var
|
|
1771
|
-
:host(:not([class])) svg {
|
|
1772
|
-
width: 20px;
|
|
1773
|
-
height: 20px;
|
|
1774
|
-
}
|
|
1775
|
-
:host([class]) svg {
|
|
1776
|
-
width: 100%;
|
|
1777
|
-
height: 100%;
|
|
1778
|
-
}
|
|
1779
|
-
`);customElements.define("m-svg-icon",
|
|
1780
|
-
<svg width="10" height="10" viewBox="0 0 10 10" aria-hidden="true">
|
|
1781
|
-
<g fill-rule="evenodd">
|
|
1782
|
-
<path part="line" stroke="currentColor" fill="currentColor" d="M0 5h7"></path>
|
|
1783
|
-
<path part="tip" stroke="currentColor" fill="transparent" d="M1 1l4 4-4 4"></path>
|
|
1784
|
-
</g>
|
|
1785
|
-
</svg>
|
|
1786
|
-
`}};w(gs,"styles",K`
|
|
1787
|
-
:host {
|
|
1788
|
-
--w-hover-arrow--hovered: 0;
|
|
1789
|
-
}
|
|
1790
|
-
|
|
1791
|
-
[part='line'] {
|
|
1792
|
-
opacity: calc(var(--w-hover-arrow--hovered) * 1);
|
|
1793
|
-
transition: opacity 0.3s ease-in-out;
|
|
1794
|
-
}
|
|
1795
|
-
|
|
1796
|
-
[part='tip'] {
|
|
1797
|
-
transform: translateX(calc(var(--w-hover-arrow--hovered) * 3px));
|
|
1798
|
-
transition: transform 0.3s ease-in-out;
|
|
1799
|
-
}
|
|
1800
|
-
`);customElements.define("w-hover-arrow",gs);var wh=["primary","secondary","black","transparent","gradient","transparent-hover","link","transparent-rounded","dialog-primary","dialog-primary-danger","dialog-secondary","ninja-solid","ninja-outline"],Rn=class extends Ot($){constructor(){super(),this.variant="primary",this.disabled=!1,this.isLoading=!1,this.bgColor="#FCBF0B",this.textColor="black"}renderPrimary(){return h`
|
|
1801
|
-
<span
|
|
1802
|
-
class="group relative inline-block h-auto w-full rounded-full border border-black/20 bg-transparent p-[1px] shadow-[0px_0px_3.13px_0px_#0000001a] duration-200 ease-[cubic-bezier(0.33,1,0.68,1)] disabled:cursor-default disabled:opacity-80 lg:hover:border-transparent lg:hover:shadow-none"
|
|
1803
|
-
?disabled="${this.disabled}">
|
|
1804
|
-
<span
|
|
1805
|
-
part="btn-rainbow-gradient"
|
|
1806
|
-
class="absolute top-1/2 left-1/2 block h-[calc(100%_+_4px)] w-[calc(100%_+_6px)] -translate-x-1/2 -translate-y-1/2 rounded-[80px] bg-transparent bg-cover bg-no-repeat transition-all duration-200 ease-in-out">
|
|
1807
|
-
</span>
|
|
1808
|
-
<span
|
|
1809
|
-
class="to-violet relative flex h-full w-full flex-row items-center justify-center gap-1 rounded-full bg-gradient-to-r from-[#8d00ff] from-40% px-8 py-2 text-center font-sans text-base leading-6 font-medium text-white transition-all ease-[cubic-bezier(0.33,1,0.68,1)] hover:from-[#0a2540] hover:to-[#0a2540] hover:shadow-xl">
|
|
1810
|
-
${this.isLoading?h`<m-svg-icon class="absolute h-5 w-5 stroke-2" icon="loading"></m-svg-icon>`:null}
|
|
1811
|
-
<span class="${this.isLoading?"opacity-0":""} transition-opacity">
|
|
1812
|
-
<slot></slot>
|
|
1813
|
-
</span>
|
|
1814
|
-
</span>
|
|
1815
|
-
</span>
|
|
1816
|
-
`}renderSecondary(){return h`
|
|
1817
|
-
<span
|
|
1818
|
-
class="group inline-block rounded-full border-[0.5px] border-current bg-current px-6 py-1.5 text-center font-sans text-sm leading-6 font-medium transition-[color,opacity,box-shadow] duration-200 ease-[cubic-bezier(0.215,0.61,0.355,1)] hover:opacity-90 hover:shadow-xl disabled:cursor-default disabled:opacity-80"
|
|
1819
|
-
?disabled="${this.disabled}">
|
|
1820
|
-
<span class="flex items-center justify-center gap-3 whitespace-nowrap text-white">
|
|
1821
|
-
${this.isLoading?h`<m-svg-icon class="absolute h-5 w-5 stroke-2" icon="loading"></m-svg-icon>`:null}
|
|
1822
|
-
<span class="${this.isLoading?"opacity-0":""} transition-opacity">
|
|
1823
|
-
<slot></slot>
|
|
1824
|
-
</span>
|
|
1825
|
-
<w-hover-arrow class="group-hover:[--w-hover-arrow--hovered:1]"></w-hover-arrow>
|
|
1826
|
-
</span>
|
|
1827
|
-
</span>
|
|
1828
|
-
`}renderBlack(){return h`
|
|
1829
|
-
<span
|
|
1830
|
-
class="${this.disabled?"pointer-events-none opacity-50":""} inline-flex h-9 items-center justify-center gap-3 rounded-md bg-[#18181A] px-4 py-2 text-sm font-medium whitespace-nowrap text-[#FAFAFA] shadow transition-colors hover:bg-[#18181A]/80">
|
|
1831
|
-
${this.isLoading?h`<m-svg-icon class="h-5 w-5 stroke-2" icon="loading"></m-svg-icon>`:null}
|
|
1832
|
-
<slot></slot>
|
|
1833
|
-
</span>
|
|
1834
|
-
`}renderLink(){return h`
|
|
1835
|
-
<span
|
|
1836
|
-
class="group relative flex items-center justify-center gap-3 font-sans text-sm font-semibold whitespace-nowrap text-black disabled:cursor-default disabled:opacity-80 lg:hover:text-[#8D00FF]"
|
|
1837
|
-
?disabled="${this.disabled}">
|
|
1838
|
-
${this.isLoading?h`<m-svg-icon class="absolute h-5 w-5 stroke-2" icon="loading"></m-svg-icon>`:null}
|
|
1839
|
-
<span class="${this.isLoading?"opacity-0":""} transition-opacity">
|
|
1840
|
-
<slot></slot>
|
|
1841
|
-
</span>
|
|
1842
|
-
<w-hover-arrow class="group-hover:[--w-hover-arrow--hovered:1]"></w-hover-arrow>
|
|
1843
|
-
</span>
|
|
1844
|
-
`}renderTransparent(){return h`
|
|
1845
|
-
<span
|
|
1846
|
-
class="relative inline-block h-auto w-full rounded-full border border-black/20 bg-transparent p-[1px] shadow-[0px_0px_3.13px_0px_#0000001a] duration-200 ease-[cubic-bezier(0.33,1,0.68,1)] lg:hover:shadow-none">
|
|
1847
|
-
<span class="hover:border-violet relative inline-block w-full rounded-full border border-gray-500">
|
|
1848
|
-
<span
|
|
1849
|
-
class="hover:text-violet relative flex h-full w-full flex-row items-center justify-center gap-1 rounded-full bg-transparent px-8 py-[7px] text-center font-sans text-base leading-6 font-medium text-[#0A2540] transition-all ease-[cubic-bezier(0.33,1,0.68,1)] hover:cursor-pointer hover:shadow-xl disabled:cursor-default disabled:opacity-80">
|
|
1850
|
-
${this.isLoading?h`<m-svg-icon class="absolute h-5 w-5 stroke-2" icon="loading"></m-svg-icon>`:null}
|
|
1851
|
-
<span class="${this.isLoading?"opacity-0":""} transition-opacity">
|
|
1852
|
-
<slot></slot>
|
|
1853
|
-
</span>
|
|
1854
|
-
</span>
|
|
1855
|
-
</span>
|
|
1856
|
-
</span>
|
|
1857
|
-
`}renderTransparentRounded(){return h`
|
|
1858
|
-
<span
|
|
1859
|
-
class="inline-block h-12 w-full overflow-hidden rounded-3xl border-[0.5px] border-[#0A254033] bg-[#EEEDF133] p-[2px] shadow-[0px_0px_3.13px_0px_#0000001a] duration-200 ease-[cubic-bezier(0.33,1,0.68,1)]">
|
|
1860
|
-
<span
|
|
1861
|
-
class="lg:hover:border-violet lg:hover:text-violet flex h-full w-full items-center justify-center gap-5 rounded-3xl border border-[#0A2540] bg-transparent py-2 font-sans text-[15px] leading-[18px] font-semibold text-[#0A2540] disabled:cursor-default disabled:opacity-80 lg:text-lg lg:hover:border-2 lg:hover:bg-transparent">
|
|
1862
|
-
${this.isLoading?h`<m-svg-icon class="absolute h-5 w-5 stroke-2" icon="loading"></m-svg-icon>`:null}
|
|
1863
|
-
<span class="${this.isLoading?"opacity-0":""} transition-opacity">
|
|
1864
|
-
<slot></slot>
|
|
1865
|
-
</span>
|
|
1866
|
-
</span>
|
|
1867
|
-
</span>
|
|
1868
|
-
`}renderTransparentHover(){return h`
|
|
1869
|
-
<span
|
|
1870
|
-
class="hover:shadow[#e0e0e033] group relative inline-block w-full overflow-hidden rounded-full border-[0.5px] border-[#EEEDF133] p-[2px] shadow-[0px_0px_3.13px_0px_#0000001a] duration-200 ease-[cubic-bezier(0.33,1,0.68,1)] group-hover:bg-transparent hover:shadow-sm">
|
|
1871
|
-
<span
|
|
1872
|
-
class="absolute -top-[5px] -left-[5px] block h-[calc(100%+10px)] w-[calc(100%+10px)] rounded-[80px] bg-transparent bg-cover bg-no-repeat duration-200 ease-[cubic-bezier(0.33,1,0.68,1)] lg:group-hover:blur-[6px]">
|
|
1873
|
-
</span>
|
|
1874
|
-
<span
|
|
1875
|
-
class="relative flex h-auto w-auto items-center justify-center gap-5 rounded-full border px-6 py-2 font-sans text-base font-semibold text-white duration-200 ease-[cubic-bezier(0.33,1,0.68,1)] disabled:cursor-default disabled:opacity-80 sm:text-[15px] lg:group-hover:border-transparent lg:group-hover:bg-white lg:group-hover:text-black">
|
|
1876
|
-
${this.isLoading?h`<m-svg-icon class="absolute h-5 w-5 stroke-2" icon="loading"></m-svg-icon>`:null}
|
|
1877
|
-
<span class="${this.isLoading?"opacity-0":""} transition-opacity">
|
|
1878
|
-
<slot></slot>
|
|
1879
|
-
</span>
|
|
1880
|
-
|
|
1881
|
-
<!-- right arrow -->
|
|
1882
|
-
<svg width="20" height="19" viewBox="0 0 20 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1883
|
-
<path
|
|
1884
|
-
d="M19 9.49473C19 9.38257 18.9681 9.27259 18.9077 9.17697C18.8474 9.08136 18.761 9.00384 18.6581 8.95299L2.80405 1.12543C2.56474 1.01069 2.29394 0.973353 2.03124 1.01886C1.76854 1.06437 1.5277 1.19035 1.34392 1.37839C1.16014 1.56642 1.04305 1.80665 1.00977 2.06397C0.976486 2.3213 1.02875 2.58222 1.15893 2.80861L5.37636 9.49433L1.15893 16.1914C1.02875 16.4178 0.976486 16.6787 1.00977 16.936C1.04305 17.1933 1.16014 17.4336 1.34392 17.6216C1.5277 17.8096 1.76854 17.9356 2.03124 17.9811C2.29394 18.0266 2.56474 17.9893 2.80405 17.8746L18.6581 10.0365C18.761 9.98563 18.8474 9.9081 18.9077 9.81249C18.9681 9.71687 19 9.6069 19 9.49473ZM19 9.49473L5.37219 9.49433"
|
|
1885
|
-
class="lg:group-hover:stroke-black"
|
|
1886
|
-
stroke="white"
|
|
1887
|
-
stroke-width="1.2"
|
|
1888
|
-
stroke-linecap="round"
|
|
1889
|
-
stroke-linejoin="round" />
|
|
1890
|
-
</svg>
|
|
1891
|
-
</span>
|
|
1892
|
-
</span>
|
|
1893
|
-
`}renderGradient(){return h`
|
|
1894
|
-
<span class="group inline-block rounded-full border border-black/20 p-[1px]">
|
|
1895
|
-
<span
|
|
1896
|
-
class="to-violet hover:from-violet hover:to-violet flex flex-row items-center justify-center gap-1 rounded-full bg-gradient-to-r from-[#8d00ff] from-40% px-8 py-[5px] text-center font-sans text-sm leading-6 font-medium text-white transition-[background-image,box-shadow] hover:cursor-pointer hover:shadow-xl disabled:cursor-default disabled:opacity-80">
|
|
1897
|
-
${this.isLoading?h`<m-svg-icon class="absolute h-5 w-5 stroke-2" icon="loading"></m-svg-icon>`:null}
|
|
1898
|
-
<span class="${this.isLoading?"opacity-0":""} transition-opacity">
|
|
1899
|
-
<slot></slot>
|
|
1900
|
-
</span>
|
|
1901
|
-
</span>
|
|
1902
|
-
</span>
|
|
1903
|
-
`}renderDialogPrimary(){return h`
|
|
1904
|
-
<span class="inline-block rounded-full border border-violet-400/20 p-[1px]">
|
|
1905
|
-
<span
|
|
1906
|
-
class="flex flex-row items-center justify-center gap-1 rounded-full bg-gradient-to-r from-violet-600 to-violet-500 px-8 py-[5px] text-center font-sans text-sm leading-6 font-medium text-white transition-all hover:cursor-pointer hover:from-violet-500 hover:to-violet-500">
|
|
1907
|
-
${this.isLoading?h`<m-svg-icon class="absolute h-5 w-5 stroke-2" icon="loading"></m-svg-icon>`:null}
|
|
1908
|
-
<span class="${this.isLoading?"opacity-0":""} transition-opacity">
|
|
1909
|
-
<slot></slot>
|
|
1910
|
-
</span>
|
|
1911
|
-
</span>
|
|
1912
|
-
</span>
|
|
1913
|
-
`}renderDialogPrimaryDanger(){return h`
|
|
1914
|
-
<span class="inline-block rounded-full border border-red-400/20 p-[1px]">
|
|
1915
|
-
<span
|
|
1916
|
-
class="flex flex-row items-center justify-center gap-1 rounded-full bg-gradient-to-r from-red-600 to-red-500 px-8 py-[5px] text-center font-sans text-sm leading-6 font-medium text-white transition-all hover:cursor-pointer hover:from-red-500 hover:to-red-500">
|
|
1917
|
-
${this.isLoading?h`<m-svg-icon class="absolute h-5 w-5 stroke-2" icon="loading"></m-svg-icon>`:null}
|
|
1918
|
-
<span class="${this.isLoading?"opacity-0":""} transition-opacity">
|
|
1919
|
-
<slot></slot>
|
|
1920
|
-
</span>
|
|
1921
|
-
</span>
|
|
1922
|
-
</span>
|
|
1923
|
-
`}renderDialogSecondary(){return h`
|
|
1924
|
-
<span class="inline-block rounded-full p-[1px]">
|
|
1925
|
-
<span
|
|
1926
|
-
class="hover:text-violet flex flex-row items-center justify-center gap-1 rounded-full bg-neutral-400/10 bg-gradient-to-r px-8 py-[5px] text-center font-sans text-sm leading-6 font-medium transition-all hover:cursor-pointer">
|
|
1927
|
-
${this.isLoading?h`<m-svg-icon class="absolute h-5 w-5 stroke-2" icon="loading"></m-svg-icon>`:null}
|
|
1928
|
-
<span class="${this.isLoading?"opacity-0":""} transition-opacity">
|
|
1929
|
-
<slot></slot>
|
|
1930
|
-
</span>
|
|
1931
|
-
</span>
|
|
1932
|
-
</span>
|
|
1933
|
-
`}renderNinjaSolid(){return h`
|
|
1934
|
-
<span
|
|
1935
|
-
class="text-${this.textColor} inline-flex h-10 items-center justify-center gap-2 rounded-2xl px-4 py-1.5 text-sm font-medium whitespace-nowrap transition-all duration-200 ease-[cubic-bezier(0.33,1,0.68,1)] hover:opacity-80 hover:shadow-md disabled:cursor-default disabled:opacity-50"
|
|
1936
|
-
style="background-color: ${this.bgColor}"
|
|
1937
|
-
?disabled="${this.disabled}">
|
|
1938
|
-
${this.isLoading?h`<m-svg-icon class="text-${this.textColor==="black"?"white":"black"} absolute h-4 w-4 stroke-2" icon="loading"></m-svg-icon>`:null}
|
|
1939
|
-
<span class="${this.isLoading?"opacity-0":""} transition-opacity">
|
|
1940
|
-
<slot></slot>
|
|
1941
|
-
</span>
|
|
1942
|
-
</span>
|
|
1943
|
-
`}renderNinjaOutline(){return h`
|
|
1944
|
-
<span
|
|
1945
|
-
class="inline-flex h-10 items-center justify-center gap-2 rounded-2xl border border-[#ffffff20] bg-transparent px-4 py-1.5 text-sm font-medium whitespace-nowrap text-white transition-all duration-200 ease-[cubic-bezier(0.33,1,0.68,1)] hover:bg-[#ffffff10] disabled:cursor-default disabled:opacity-50"
|
|
1946
|
-
?disabled="${this.disabled}">
|
|
1947
|
-
${this.isLoading?h`<m-svg-icon class="absolute h-4 w-4 stroke-2" style="color: #FCBF0B;" icon="loading"></m-svg-icon>`:null}
|
|
1948
|
-
<span class="${this.isLoading?"opacity-0":""} transition-opacity">
|
|
1949
|
-
<slot></slot>
|
|
1950
|
-
</span>
|
|
1951
|
-
</span>
|
|
1952
|
-
`}render(){switch(fe(wh.includes(this.variant),`invalid variant: ${this.variant}`),this.variant){case"primary":return this.renderPrimary();case"secondary":return this.renderSecondary();case"black":return this.renderBlack();case"transparent":return this.renderTransparent();case"gradient":return this.renderGradient();case"transparent-hover":return this.renderTransparentHover();case"link":return this.renderLink();case"transparent-rounded":return this.renderTransparentRounded();case"dialog-primary":return this.renderDialogPrimary();case"dialog-primary-danger":return this.renderDialogPrimaryDanger();case"dialog-secondary":return this.renderDialogSecondary();case"ninja-solid":return this.renderNinjaSolid();case"ninja-outline":return this.renderNinjaOutline()}}};w(Rn,"styles",K`
|
|
1953
|
-
:host {
|
|
1954
|
-
display: inline-block;
|
|
1955
|
-
line-height: 0;
|
|
1956
|
-
}
|
|
1957
|
-
|
|
1958
|
-
@media (min-width: 1024px) {
|
|
1959
|
-
.group:hover [part='btn-rainbow-gradient'] {
|
|
1960
|
-
background: conic-gradient(
|
|
1961
|
-
from 180deg at 50% 50%,
|
|
1962
|
-
#ffba71 0deg,
|
|
1963
|
-
#bc82f3 45deg,
|
|
1964
|
-
#f5b9eac9 90deg,
|
|
1965
|
-
#8d99ff 135deg,
|
|
1966
|
-
#aa6eeecf 180deg,
|
|
1967
|
-
#ff6778c2 225deg,
|
|
1968
|
-
#ffba71 270deg,
|
|
1969
|
-
#bc82f3 315deg,
|
|
1970
|
-
#ffba71 360deg
|
|
1971
|
-
);
|
|
1972
|
-
filter: blur(6.5px);
|
|
1973
|
-
}
|
|
1974
|
-
}
|
|
1975
|
-
`),w(Rn,"properties",{variant:{type:String},disabled:{type:Boolean},isLoading:{type:Boolean,attribute:"loading"},bgColor:{type:String,attribute:"bg-color"},textColor:{type:String,attribute:"text-color"}});customElements.define("w-button",Rn);var ws=(t,e,r)=>{for(let n of e)if(n[0]===t)return(0,n[1])();return r?.()};var Y,W0,Ba,Ha,G0,K0,J0,X0,za,Er=class Er extends A($){constructor(){super();d(this,Y);this.title="",this.type="star-rating",this.color="#8B5CF6",this._hoverRating=0}render(){return h`
|
|
1976
|
-
<div
|
|
1977
|
-
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}]">
|
|
1978
|
-
<div class="flex flex-col gap-2 p-4">
|
|
1979
|
-
${ws(this.type,[["star-rating",()=>m(this,Y,Ba).call(this)],["binary-vote",()=>m(this,Y,Ha).call(this)],["new-conversation-button",()=>m(this,Y,W0).call(this)]],()=>h`<span class="text-sm text-gray-500">Unsupported input type</span>`)}
|
|
1980
|
-
${this.type==="star-rating"?m(this,Y,Ba).call(this):this.type==="binary-vote"?m(this,Y,Ha).call(this):null}
|
|
1981
|
-
</div>
|
|
1982
|
-
</div>
|
|
1983
|
-
`}};Y=new WeakSet,W0=function(){return h`
|
|
1984
|
-
<button
|
|
1985
|
-
type="button"
|
|
1986
|
-
@click="${()=>this.dispatchEvent(new Er.SubmitEvent({type:"new-conversation-button"}))}">
|
|
1987
|
-
<w-button variant="link">${this.title||"Start a new conversation"}</w-button>
|
|
1988
|
-
</button>
|
|
1989
|
-
`},Ba=function(){return h`
|
|
1990
|
-
${this.title?h`<p class="text-sm font-medium text-gray-700">${this.title}</p>`:null}
|
|
1991
|
-
<div class="flex justify-center gap-1">
|
|
1992
|
-
${[1,2,3,4,5].map(r=>h`
|
|
1993
|
-
<button
|
|
1994
|
-
type="button"
|
|
1995
|
-
@click="${()=>m(this,Y,K0).call(this,r)}"
|
|
1996
|
-
@mouseenter="${()=>m(this,Y,J0).call(this,r)}"
|
|
1997
|
-
@mouseleave="${m(this,Y,X0)}"
|
|
1998
|
-
class="p-1 transition-transform hover:scale-110"
|
|
1999
|
-
aria-label="${r} star${r>1?"s":""}">
|
|
2000
|
-
${m(this,Y,G0).call(this,r)}
|
|
2001
|
-
</button>
|
|
2002
|
-
`)}
|
|
2003
|
-
</div>
|
|
2004
|
-
`},Ha=function(){return h`
|
|
2005
|
-
${this.title?h`<p class="text-sm font-medium text-gray-700">${this.title}</p>`:null}
|
|
2006
|
-
<div class="flex justify-center gap-4">
|
|
2007
|
-
<button
|
|
2008
|
-
type="button"
|
|
2009
|
-
@click="${()=>m(this,Y,za).call(this,"positive")}"
|
|
2010
|
-
class="flex flex-col items-center gap-1 rounded-lg border-2 border-gray-300 p-1 transition-all hover:border-green-400">
|
|
2011
|
-
<svg class="h-6 w-6 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
2012
|
-
<path
|
|
2013
|
-
stroke-linecap="round"
|
|
2014
|
-
stroke-linejoin="round"
|
|
2015
|
-
stroke-width="2"
|
|
2016
|
-
d="M14 10h4.764a2 2 0 011.789 2.894l-3.5 7A2 2 0 0115.263 21h-4.017c-.163 0-.326-.02-.485-.06L7 20m7-10V5a2 2 0 00-2-2h-.095c-.5 0-.905.405-.905.905 0 .714-.211 1.412-.608 2.006L7 11v9m7-10h-2M7 20H5a2 2 0 01-2-2v-6a2 2 0 012-2h2.5" />
|
|
2017
|
-
</svg>
|
|
2018
|
-
</button>
|
|
2019
|
-
<button
|
|
2020
|
-
type="button"
|
|
2021
|
-
@click="${()=>m(this,Y,za).call(this,"negative")}"
|
|
2022
|
-
class="flex flex-col items-center gap-1 rounded-lg border-2 border-gray-300 p-1 transition-all hover:border-red-400">
|
|
2023
|
-
<svg class="h-6 w-6 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
2024
|
-
<path
|
|
2025
|
-
stroke-linecap="round"
|
|
2026
|
-
stroke-linejoin="round"
|
|
2027
|
-
stroke-width="2"
|
|
2028
|
-
d="M10 14H5.236a2 2 0 01-1.789-2.894l3.5-7A2 2 0 018.736 3h4.018a2 2 0 01.485.06l3.76.94m-7 10v5a2 2 0 002 2h.096c.5 0 .905-.405.905-.904 0-.715.211-1.413.608-2.008L17 13V4m-7 10h2m5-10h2a2 2 0 012 2v6a2 2 0 01-2 2h-2.5" />
|
|
2029
|
-
</svg>
|
|
2030
|
-
</button>
|
|
2031
|
-
</div>
|
|
2032
|
-
`},G0=function(r){let n=r<=this._hoverRating;return h`
|
|
2033
|
-
<svg class="${n?"text-yellow-400":"text-gray-300"} h-6 w-6" fill="${n?"currentColor":"none"}" stroke="currentColor" viewBox="0 0 24 24">
|
|
2034
|
-
<path
|
|
2035
|
-
stroke-linecap="round"
|
|
2036
|
-
stroke-linejoin="round"
|
|
2037
|
-
stroke-width="2"
|
|
2038
|
-
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" />
|
|
2144
|
+
<path fill-rule="evenodd" d="M12 6.75a5.25 5.25 0 0 1 6.775-5.025.75.75 0 0 1 .313 1.248l-3.32 3.319c.063.475.276.934.641 1.299.365.365.824.578 1.3.64l3.318-3.319a.75.75 0 0 1 1.248.313 5.25 5.25 0 0 1-5.472 6.756c-1.018-.086-1.87.1-2.309.634L7.344 21.3A3.298 3.298 0 1 1 2.7 16.657l8.684-7.151c.533-.44.72-1.291.634-2.309A5.342 5.342 0 0 1 12 6.75ZM4.117 19.125a.75.75 0 0 1 .75-.75h.008a.75.75 0 0 1 .75.75v.008a.75.75 0 0 1-.75.75h-.008a.75.75 0 0 1-.75-.75v-.008Z" clip-rule="evenodd" />
|
|
2145
|
+
<path d="m10.076 8.64-2.201-2.2V4.874a.75.75 0 0 0-.364-.643l-3.75-2.25a.75.75 0 0 0-.916.113l-.75.75a.75.75 0 0 0-.113.916l2.25 3.75a.75.75 0 0 0 .643.364h1.564l2.062 2.062 1.575-1.297Z" />
|
|
2146
|
+
<path fill-rule="evenodd" d="m12.556 17.329 4.183 4.182a3.375 3.375 0 0 0 4.773-4.773l-3.306-3.305a6.803 6.803 0 0 1-1.53.043c-.394-.034-.682-.006-.867.042a.589.589 0 0 0-.167.063l-3.086 3.748Zm3.414-1.36a.75.75 0 0 1 1.06 0l1.875 1.876a.75.75 0 1 1-1.06 1.06L15.97 17.03a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" />
|
|
2147
|
+
</svg>`};var Bt=class extends wr{constructor(e){if(super(e),this.it=Z,e.type!==ss.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===Z||e==null)return this._t=void 0,this.it=e;if(e===Ie)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:[]}}};Bt.directiveName="unsafeHTML",Bt.resultType=1;var eu=vr(Bt);var Xn=class extends Bt{};Xn.directiveName="unsafeSVG",Xn.resultType=2;var tu=vr(Xn);var Vr,Qn=class extends Vt($){constructor(){super();d(this,Vr,"");this.icon=""}updated(r){if(super.updated(r),r.has("icon")){let n=Qc[this.icon];n&&(g(this,Vr,n),this.requestUpdate())}}render(){return this.icon&&o(this,Vr)?tu(o(this,Vr)):null}};Vr=new WeakMap,w(Qn,"properties",{icon:{type:String}}),w(Qn,"styles",H`
|
|
2148
|
+
:host(:not([class])) svg {
|
|
2149
|
+
width: 20px;
|
|
2150
|
+
height: 20px;
|
|
2151
|
+
}
|
|
2152
|
+
:host([class]) svg {
|
|
2153
|
+
width: 100%;
|
|
2154
|
+
height: 100%;
|
|
2155
|
+
}
|
|
2156
|
+
`);customElements.define("m-svg-icon",Qn);var Js=class extends Vt($){render(){return h`
|
|
2157
|
+
<svg width="10" height="10" viewBox="0 0 10 10" aria-hidden="true">
|
|
2158
|
+
<g fill-rule="evenodd">
|
|
2159
|
+
<path part="line" stroke="currentColor" fill="currentColor" d="M0 5h7"></path>
|
|
2160
|
+
<path part="tip" stroke="currentColor" fill="transparent" d="M1 1l4 4-4 4"></path>
|
|
2161
|
+
</g>
|
|
2039
2162
|
</svg>
|
|
2040
|
-
`}
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
class="group flex w-full max-w-md cursor-pointer gap-[10px] overflow-hidden rounded-lg"
|
|
2045
|
-
target="${this.linksNewTab?"_blank":"_self"}"
|
|
2046
|
-
?disabled="${this.streaming}">
|
|
2047
|
-
${this.streaming?h`
|
|
2048
|
-
<!-- shimmer -->
|
|
2049
|
-
<div class="h-[70px] w-[70px] animate-pulse overflow-hidden rounded-lg bg-gray-200"></div>
|
|
2050
|
-
`:h`<img src="${ce(s)}" class="block h-[70px] w-[70px] rounded-lg bg-gray-100 object-contain" loading="lazy" />`}
|
|
2051
|
-
|
|
2052
|
-
<div class="flex flex-1 flex-col justify-between">
|
|
2053
|
-
<div>
|
|
2054
|
-
${e||!this.streaming?h`<h3 class="line-clamp-1 text-sm font-medium group-hover:underline">${e}</h3>`:h`<div class="h-5 w-32 animate-pulse rounded bg-gray-200"></div>`}
|
|
2055
|
-
|
|
2056
|
-
<!-- no margin here -->
|
|
2057
|
-
|
|
2058
|
-
${r||!this.streaming?h`<p class="line-clamp-2 text-xs text-gray-500">${r}</p>`:h`<div class="my-1 h-6 w-3/4 animate-pulse rounded bg-gray-200"></div>`}
|
|
2059
|
-
</div>
|
|
2060
|
-
|
|
2061
|
-
<!-- flexbox filled space -->
|
|
2062
|
-
|
|
2063
|
-
${n||!this.streaming?h`<span class="text-xs text-gray-900">${n}</span>`:h`<div class="h-4 w-14 animate-pulse rounded bg-gray-200"></div>`}
|
|
2064
|
-
</div>
|
|
2065
|
-
</a>
|
|
2066
|
-
`}};w(vs,"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",vs);function ys(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 bs=function(){},_r=function(){};var Bn=(t,e,r)=>Math.min(Math.max(r,t),e);var Fa=.001,vh=.01,Y0=10,yh=.05,bh=1;function Q0({duration:t=800,bounce:e=.25,velocity:r=0,mass:n=1}){let i,s;bs(t<=Y0*1e3,"Spring duration must be 10 seconds or less");let a=1-e;a=Bn(yh,bh,a),t=Bn(vh,Y0,t/1e3),a<1?(i=c=>{let p=c*a,f=p*t,v=p-r,x=xs(c,a),S=Math.exp(-f);return Fa-v/x*S},s=c=>{let f=c*a*t,v=f*r+r,x=Math.pow(a,2)*Math.pow(c,2)*t,S=Math.exp(-f),T=xs(Math.pow(c,2),a);return(-i(c)+Fa>0?-1:1)*((v-x)*S)/T}):(i=c=>{let p=Math.exp(-c*t),f=(c-r)*t+1;return-Fa+p*f},s=c=>{let p=Math.exp(-c*t),f=(r-c)*(t*t);return p*f});let u=5/t,l=kh(i,s,u);if(t=t*1e3,isNaN(l))return{stiffness:100,damping:10,duration:t};{let c=Math.pow(l,2)*n;return{stiffness:c,damping:a*2*Math.sqrt(n*c),duration:t}}}var xh=12;function kh(t,e,r){let n=r;for(let i=1;i<xh;i++)n=n-t(n)/e(n);return n}function xs(t,e){return t*Math.sqrt(1-e*e)}var Ch=["duration","bounce"],$h=["stiffness","damping","mass"];function ec(t,e){return e.some(r=>t[r]!==void 0)}function Sh(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!ec(t,$h)&&ec(t,Ch)){let r=Q0(t);e=Object.assign(Object.assign(Object.assign({},e),r),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function ks(t){var{from:e=0,to:r=1,restSpeed:n=2,restDelta:i}=t,s=ys(t,["from","to","restSpeed","restDelta"]);let a={done:!1,value:e},{stiffness:u,damping:l,mass:c,velocity:p,duration:f,isResolvedFromDuration:v}=Sh(s),x=tc,S=tc;function T(){let k=p?-(p/1e3):0,M=r-e,C=l/(2*Math.sqrt(u*c)),_=Math.sqrt(u/c)/1e3;if(i===void 0&&(i=Math.min(Math.abs(r-e)/100,.4)),C<1){let L=xs(_,C);x=F=>{let te=Math.exp(-C*_*F);return r-te*((k+C*_*M)/L*Math.sin(L*F)+M*Math.cos(L*F))},S=F=>{let te=Math.exp(-C*_*F);return C*_*te*(Math.sin(L*F)*(k+C*_*M)/L+M*Math.cos(L*F))-te*(Math.cos(L*F)*(k+C*_*M)-L*M*Math.sin(L*F))}}else if(C===1)x=L=>r-Math.exp(-_*L)*(M+(k+_*M)*L);else{let L=_*Math.sqrt(C*C-1);x=F=>{let te=Math.exp(-C*_*F),se=Math.min(L*F,300);return r-te*((k+C*_*M)*Math.sinh(se)+L*M*Math.cosh(se))/L}}}return T(),{next:k=>{let M=x(k);if(v)a.done=k>=f;else{let C=S(k)*1e3,_=Math.abs(C)<=n,L=Math.abs(r-M)<=i;a.done=_&&L}return a.value=a.done?r:M,a},flipTarget:()=>{p=-p,[e,r]=[r,e],T()}}}ks.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";var tc=t=>0;var Na=(t,e,r)=>{let n=e-t;return n===0?1:(r-t)/n};var Mr=(t,e,r)=>-r*t+r*e+t;var Cs=(t,e)=>r=>Math.max(Math.min(r,e),t),st=t=>t%1?Number(t.toFixed(5)):t,Ar=/(-)?([\d]*\.?[\d])+/g,$s=/(#[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,rc=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Ge(t){return typeof t=="string"}var Ir={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Ss=Object.assign(Object.assign({},Ir),{transform:Cs(0,1)}),b7=Object.assign(Object.assign({},Ir),{default:1});var Hn=t=>({test:e=>Ge(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),C7=Hn("deg"),Lr=Hn("%"),$7=Hn("px"),S7=Hn("vh"),E7=Hn("vw"),_7=Object.assign(Object.assign({},Lr),{parse:t=>Lr.parse(t)/100,transform:t=>Lr.transform(t*100)});var jr=(t,e)=>r=>!!(Ge(r)&&rc.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),Es=(t,e,r)=>n=>{if(!Ge(n))return n;let[i,s,a,u]=n.match(Ar);return{[t]:parseFloat(i),[e]:parseFloat(s),[r]:parseFloat(a),alpha:u!==void 0?parseFloat(u):1}};var Be={test:jr("hsl","hue"),parse:Es("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+Lr.transform(st(e))+", "+Lr.transform(st(r))+", "+st(Ss.transform(n))+")"};var Eh=Cs(0,255),_s=Object.assign(Object.assign({},Ir),{transform:t=>Math.round(Eh(t))}),_e={test:jr("rgb","red"),parse:Es("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+_s.transform(t)+", "+_s.transform(e)+", "+_s.transform(r)+", "+st(Ss.transform(n))+")"};function _h(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 Tr={test:jr("#"),parse:_h,transform:_e.transform};var ot={test:t=>_e.test(t)||Tr.test(t)||Be.test(t),parse:t=>_e.test(t)?_e.parse(t):Be.test(t)?Be.parse(t):Tr.parse(t),transform:t=>Ge(t)?t:t.hasOwnProperty("red")?_e.transform(t):Be.transform(t)};var nc="${c}",ic="${n}";function Mh(t){var e,r,n,i;return isNaN(t)&&Ge(t)&&((r=(e=t.match(Ar))===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0)+((i=(n=t.match($s))===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0)>0}function sc(t){typeof t=="number"&&(t=`${t}`);let e=[],r=0,n=t.match($s);n&&(r=n.length,t=t.replace($s,nc),e.push(...n.map(ot.parse)));let i=t.match(Ar);return i&&(t=t.replace(Ar,ic),e.push(...i.map(Ir.parse))),{values:e,numColors:r,tokenised:t}}function oc(t){return sc(t).values}function ac(t){let{values:e,numColors:r,tokenised:n}=sc(t),i=e.length;return s=>{let a=n;for(let u=0;u<i;u++)a=a.replace(u<r?nc:ic,u<r?ot.transform(s[u]):st(s[u]));return a}}var Ah=t=>typeof t=="number"?0:t;function Ih(t){let e=oc(t);return ac(t)(e.map(Ah))}var Ms={test:Mh,parse:oc,createTransformer:ac,getAnimatableNone:Ih};function qa(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 Za({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let i=0,s=0,a=0;if(!e)i=s=a=r;else{let u=r<.5?r*(1+e):r+e-r*e,l=2*r-u;i=qa(l,u,t+1/3),s=qa(l,u,t),a=qa(l,u,t-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(a*255),alpha:n}}var Lh=(t,e,r)=>{let n=t*t,i=e*e;return Math.sqrt(Math.max(0,r*(i-n)+n))},jh=[Tr,_e,Be],lc=t=>jh.find(e=>e.test(t)),cc=t=>`'${t}' is not an animatable color. Use the equivalent color code instead.`,As=(t,e)=>{let r=lc(t),n=lc(e);_r(!!r,cc(t)),_r(!!n,cc(e));let i=r.parse(t),s=n.parse(e);r===Be&&(i=Za(i),r=_e),n===Be&&(s=Za(s),n=_e);let a=Object.assign({},i);return u=>{for(let l in a)l!=="alpha"&&(a[l]=Lh(i[l],s[l],u));return a.alpha=Mr(i.alpha,s.alpha,u),r.transform(a)}};var uc=t=>typeof t=="number";var Th=(t,e)=>r=>e(t(r)),Is=(...t)=>t.reduce(Th);function pc(t,e){return uc(t)?r=>Mr(t,e,r):ot.test(t)?As(t,e):Ga(t,e)}var Wa=(t,e)=>{let r=[...t],n=r.length,i=t.map((s,a)=>pc(s,e[a]));return s=>{for(let a=0;a<n;a++)r[a]=i[a](s);return r}},dc=(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]=pc(t[i],e[i]));return i=>{for(let s in n)r[s]=n[s](i);return r}};function hc(t){let e=Ms.parse(t),r=e.length,n=0,i=0,s=0;for(let a=0;a<r;a++)n||typeof e[a]=="number"?n++:e[a].hue!==void 0?s++:i++;return{parsed:e,numNumbers:n,numRGB:i,numHSL:s}}var Ga=(t,e)=>{let r=Ms.createTransformer(e),n=hc(t),i=hc(e);return n.numHSL===i.numHSL&&n.numRGB===i.numRGB&&n.numNumbers>=i.numNumbers?Is(Wa(n.parsed,i.parsed),r):(bs(!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.`),a=>`${a>0?e:t}`)};var Dh=(t,e)=>r=>Mr(t,e,r);function Oh(t){if(typeof t=="number")return Dh;if(typeof t=="string")return ot.test(t)?As:Ga;if(Array.isArray(t))return Wa;if(typeof t=="object")return dc}function Ph(t,e,r){let n=[],i=r||Oh(t[0]),s=t.length-1;for(let a=0;a<s;a++){let u=i(t[a],t[a+1]);if(e){let l=Array.isArray(e)?e[a]:e;u=Is(l,u)}n.push(u)}return n}function Uh([t,e],[r]){return n=>r(Na(t,e,n))}function Rh(t,e){let r=t.length,n=r-1;return i=>{let s=0,a=!1;if(i<=t[0]?a=!0:i>=t[n]&&(s=n-1,a=!0),!a){let l=1;for(;l<r&&!(t[l]>i||l===n);l++);s=l-1}let u=Na(t[s],t[s+1],i);return e[s](u)}}function Ls(t,e,{clamp:r=!0,ease:n,mixer:i}={}){let s=t.length;_r(s===e.length,"Both input and output ranges must be the same length"),_r(!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 a=Ph(e,n,i),u=s===2?Uh(t,a):Rh(t,a);return r?l=>u(Bn(t[0],t[s-1],l)):u}var zn=t=>e=>1-t(1-e),js=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,fc=t=>e=>Math.pow(e,t),Ka=t=>e=>e*e*((t+1)*e-t),mc=t=>{let e=Ka(t);return r=>(r*=2)<1?.5*e(r):.5*(2-Math.pow(2,-10*(r-1)))};var gc=1.525,Vh=4/11,Bh=8/11,Hh=9/10;var wc=fc(2),Im=zn(wc),vc=js(wc),zh=t=>1-Math.sin(Math.acos(t)),Fh=zn(zh),Lm=js(Fh),yc=Ka(gc),jm=zn(yc),Tm=js(yc),Dm=mc(gc),Nh=4356/361,qh=35442/1805,Zh=16061/1805,Wh=t=>{if(t===1||t===0)return t;let e=t*t;return t<Vh?7.5625*e:t<Bh?9.075*e-9.9*t+3.4:t<Hh?Nh*e-qh*t+Zh:10.8*t*t-20.52*t+10.72},Om=zn(Wh);function Gh(t,e){return t.map(()=>e||vc).splice(0,t.length-1)}function Kh(t){let e=t.length;return t.map((r,n)=>n!==0?n/(e-1):0)}function Jh(t,e){return t.map(r=>r*e)}function Fn({from:t=0,to:e=1,ease:r,offset:n,duration:i=300}){let s={done:!1,value:t},a=Array.isArray(e)?e:[t,e],u=Jh(n&&n.length===a.length?n:Kh(a),i);function l(){return Ls(u,a,{ease:Array.isArray(r)?r:Gh(a,r)})}let c=l();return{next:p=>(s.value=c(p),s.done=p>=i,s),flipTarget:()=>{a.reverse(),c=l()}}}function bc({velocity:t=0,from:e=0,power:r=.8,timeConstant:n=350,restDelta:i=.5,modifyTarget:s}){let a={done:!1,value:e},u=r*t,l=e+u,c=s===void 0?l:s(l);return c!==l&&(u=c-e),{next:p=>{let f=-u*Math.exp(-p/n);return a.done=!(f>i||f<-i),a.value=a.done?c:c+f,a},flipTarget:()=>{}}}var xc={keyframes:Fn,spring:ks,decay:bc};function kc(t){if(Array.isArray(t.to))return Fn;if(xc[t.type])return xc[t.type];let e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Fn:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?ks:Fn}var Ja=16.666666666666668,Xh=typeof performance<"u"?()=>performance.now():()=>Date.now(),Xa=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Xh()),Ja);function Cc(t){let e=[],r=[],n=0,i=!1,s=!1,a=new WeakSet,u={schedule:(l,c=!1,p=!1)=>{let f=p&&i,v=f?e:r;return c&&a.add(l),v.indexOf(l)===-1&&(v.push(l),f&&i&&(n=e.length)),l},cancel:l=>{let c=r.indexOf(l);c!==-1&&r.splice(c,1),a.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 c=0;c<n;c++){let p=e[c];p(l),a.has(p)&&(u.schedule(p),t())}i=!1,s&&(s=!1,u.process(l))}};return u}var Yh=40,Ya=!0,qn=!1,Qa=!1,Nn={delta:0,timestamp:0},Zn=["read","update","preRender","render","postRender"],Ts=Zn.reduce((t,e)=>(t[e]=Cc(()=>qn=!0),t),{}),Qh=Zn.reduce((t,e)=>{let r=Ts[e];return t[e]=(n,i=!1,s=!1)=>(qn||tp(),r.schedule(n,i,s)),t},{}),$c=Zn.reduce((t,e)=>(t[e]=Ts[e].cancel,t),{}),Km=Zn.reduce((t,e)=>(t[e]=()=>Ts[e].process(Nn),t),{}),ep=t=>Ts[t].process(Nn),Sc=t=>{qn=!1,Nn.delta=Ya?Ja:Math.max(Math.min(t-Nn.timestamp,Yh),1),Nn.timestamp=t,Qa=!0,Zn.forEach(ep),Qa=!1,qn&&(Ya=!1,Xa(Sc))},tp=()=>{qn=!0,Ya=!0,Qa||Xa(Sc)};var Ec=Qh;function el(t,e,r=0){return t-e-r}function _c(t,e,r=0,n=!0){return n?el(e+-t,e,r):e-(t-e)+r}function Mc(t,e,r,n){return n?t>=e+r:t<=-r}var rp=t=>{let e=({delta:r})=>t(r);return{start:()=>Ec.update(e,!0),stop:()=>$c.update(e)}};function tl(t){var e,r,{from:n,autoplay:i=!0,driver:s=rp,elapsed:a=0,repeat:u=0,repeatType:l="loop",repeatDelay:c=0,onPlay:p,onStop:f,onComplete:v,onRepeat:x,onUpdate:S}=t,T=ys(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:k}=T,M,C=0,_=T.duration,L,F=!1,te=!0,se,R=kc(T);!((r=(e=R).needsInterpolation)===null||r===void 0)&&r.call(e,n,k)&&(se=Ls([0,100],[n,k],{clamp:!1}),n=0,k=100);let oe=R(Object.assign(Object.assign({},T),{from:n,to:k}));function pe(){C++,l==="reverse"?(te=C%2===0,a=_c(a,_,c,te)):(a=el(a,_,c),l==="mirror"&&oe.flipTarget()),F=!1,x&&x()}function fo(){M.stop(),v&&v()}function ft(G){if(te||(G=-G),a+=G,!F){let ae=oe.next(Math.max(0,a));L=ae.value,se&&(L=se(L)),F=te?ae.done:a<=0}S?.(L),F&&(C===0&&(_??(_=a)),C<u?Mc(a,_,c,te)&&pe():fo())}function wi(){p?.(),M=s(ft),M.start()}return i&&wi(),{stop:()=>{f?.(),M.stop()}}}var z,Ac,Ds,Ic,Os,Lc,jc,Tc,Ps,Us=class Us extends A($){constructor(){super();d(this,z);this.product=void 0,this.labels={addToCart:"Add to cart",color:"Color",size:"Size"},this._currentImageIndex=0,this._isValidUrl=!1}willUpdate(r){r.has("product")&&m(this,z,Ac).call(this)}get images(){return this.product?.images||[]}render(){if(!this.product)return h`
|
|
2067
|
-
<div class="my-2 w-full rounded-3xl border bg-white p-4">
|
|
2068
|
-
<div class="relative mx-auto mb-4 max-w-[240px]">
|
|
2069
|
-
<div class="h-[180px] w-full animate-pulse rounded-2xl bg-gray-200"></div>
|
|
2070
|
-
</div>
|
|
2071
|
-
<div class="mb-2 flex items-end justify-between">
|
|
2072
|
-
<div>
|
|
2073
|
-
<div class="mb-1 h-4 w-20 animate-pulse rounded bg-gray-200"></div>
|
|
2074
|
-
<div class="h-6 w-32 animate-pulse rounded bg-gray-200"></div>
|
|
2075
|
-
</div>
|
|
2076
|
-
<div class="h-6 w-16 animate-pulse rounded bg-gray-200"></div>
|
|
2077
|
-
</div>
|
|
2078
|
-
<div class="mb-4 h-4 w-3/4 animate-pulse rounded bg-gray-200"></div>
|
|
2079
|
-
<div class="my-4 border-t border-gray-200"></div>
|
|
2080
|
-
<div class="flex items-end justify-between gap-3">
|
|
2081
|
-
<div class="h-6 w-16 animate-pulse rounded bg-gray-200"></div>
|
|
2082
|
-
<div class="h-8 flex-auto animate-pulse rounded-xl bg-gray-200"></div>
|
|
2083
|
-
</div>
|
|
2084
|
-
</div>
|
|
2085
|
-
`;if(this.product.layout==="horizontal")return h` <mw-product-card-horizontal product="${JSON.stringify(this.product)}"></mw-product-card-horizontal> `;let{name:r,description:n,price:i,category:s}=this.product;return h`
|
|
2086
|
-
<div class="my-2 w-full rounded-3xl border-[0.5px] border-[#5e5d59]/25 bg-white p-4 hover:shadow-sm">
|
|
2087
|
-
<div class="pointer-events-auto mx-auto mb-4">
|
|
2088
|
-
<div class="group relative overflow-hidden rounded-2xl">
|
|
2089
|
-
<div class="image-slider z-0 flex transition-transform duration-300 ease-in-out" style="transform: translateX(-${this._currentImageIndex*100}%)">
|
|
2090
|
-
${this.images.length>0?Ee(this.images,a=>a,(a,u)=>h`
|
|
2091
|
-
<!-- TODO: add srcset with 1x/2x variants for high DPI displays -->
|
|
2092
|
-
<img src="${a}" alt="image ${u+1}: ${r}" class="h-auto w-full flex-shrink-0 object-scale-down" loading="lazy" />
|
|
2093
|
-
`):h`
|
|
2094
|
-
<div class="h-full w-full flex-shrink-0 object-scale-down"></div>
|
|
2095
|
-
<svg class="rounded-lg" height="144" viewBox="0 0 100 133" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2096
|
-
<rect width="100" height="133" rx="2" fill="#EEEEEE" style="" transform="matrix(0.9999999999999999, 0, 0, 0.9999999999999999, 0, -7.105427357601002e-15)" />
|
|
2097
|
-
<g transform="matrix(0.6458070278167725, 0, 0, 0.5434090495109558, -19.74715805053711, -14.242161750793464)">
|
|
2098
|
-
<rect x="92" y="135.169" width="32" height="26.831" rx="2" stroke-width="4" style="isolation: isolate; stroke: rgb(187, 187, 187); fill: none;" />
|
|
2099
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M 109.142 156.857 L 104 149 L 94 160 L 108 160 L 114 160 L 122 160 L 115 153 L 109.142 156.857 Z" fill="#BBBBBB" style="" />
|
|
2100
|
-
<circle cx="110" cy="146" r="3" fill="#BBBBBB" style="" />
|
|
2101
|
-
</g>
|
|
2102
|
-
</svg>
|
|
2103
|
-
`}
|
|
2104
|
-
</div>
|
|
2105
|
-
${this.images.length>1?h`
|
|
2106
|
-
<div class="absolute inset-0 flex items-center justify-between px-4">
|
|
2107
|
-
<button
|
|
2108
|
-
@click="${m(this,z,jc)}"
|
|
2109
|
-
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">
|
|
2110
|
-
<hi-outline class="block h-6 w-3" name="chevron-left"></hi-outline>
|
|
2111
|
-
</button>
|
|
2112
|
-
<button
|
|
2113
|
-
@click="${m(this,z,Lc)}"
|
|
2114
|
-
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">
|
|
2115
|
-
<hi-outline class="block h-6 w-3" name="chevron-right"></hi-outline>
|
|
2116
|
-
</button>
|
|
2117
|
-
</div>
|
|
2118
|
-
`:null}
|
|
2119
|
-
${this.images?.length>1?h`
|
|
2120
|
-
<div class="slider-dots absolute bottom-3 left-1/2 flex -translate-x-1/2 gap-2">
|
|
2121
|
-
${this.images.map((a,u)=>h`
|
|
2122
|
-
<button
|
|
2123
|
-
@click="${()=>m(this,z,Tc).call(this,u)}"
|
|
2124
|
-
class="${u===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>
|
|
2125
|
-
`)}
|
|
2126
|
-
</div>
|
|
2127
|
-
`:null}
|
|
2128
|
-
</div>
|
|
2129
|
-
</div>
|
|
2130
|
-
<div @click="${m(this,z,Ds)}" class="cursor-pointer">
|
|
2131
|
-
${s?h`<a @click="${m(this,z,Ds)}" class="${this._isValidUrl?"":"pointer-events-none"} line-clamp-1 text-xs text-gray-600 hover:underline"> ${s} </a>`:null}
|
|
2132
|
-
|
|
2133
|
-
<h3
|
|
2134
|
-
@click="${m(this,z,Ds)}"
|
|
2135
|
-
class="${this._isValidUrl?"":"pointer-events-none cursor-default"} mb-1 line-clamp-2 cursor-pointer text-lg font-semibold transition-all hover:underline">
|
|
2136
|
-
${r||h`<span class="inline-block h-6 w-32 animate-pulse rounded bg-gray-200"></span>`}
|
|
2137
|
-
</h3>
|
|
2138
|
-
${n?h`<p class="mb-2 line-clamp-2 text-sm text-gray-600">${n}</p>`:h`<div class="mb-2 h-4 w-3/4 animate-pulse rounded bg-gray-200"></div>`}
|
|
2139
|
-
<span class="text-lg font-bold"> ${i||h`<span class="inline-block h-6 w-16 animate-pulse rounded bg-gray-200"></span>`} </span>
|
|
2140
|
-
|
|
2141
|
-
<!-- <div class="my-4 border-t border-gray-200"></div> -->
|
|
2142
|
-
|
|
2143
|
-
<!-- <button
|
|
2144
|
-
@click="${m(this,z,Ic)}"
|
|
2145
|
-
?disabled="${!this._isValidUrl}"
|
|
2146
|
-
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">
|
|
2147
|
-
${this.labels.addToCart}
|
|
2148
|
-
</button> -->
|
|
2149
|
-
</div>
|
|
2150
|
-
</div>
|
|
2151
|
-
`}};z=new WeakSet,Ac=function(){if(!this.product?.url){this._isValidUrl=!1;return}try{let r=new URL(this.product.url);this._isValidUrl=r.protocol==="http:"||r.protocol==="https:"}catch{this._isValidUrl=!1}},Ds=function(r){r.preventDefault(),!(!this.product?.url||!this._isValidUrl)&&window.open(this.product.url,"_blank")},Ic=function(r){!this.product?.url||!this._isValidUrl||(window.open(this.product.url,"_blank"),this.dispatchEvent(new Us.AddToCartEvent(this.product)))},Os=function(r,n){o(this,z,Ps)&&tl({from:r,to:n,duration:300,onUpdate:i=>{o(this,z,Ps)&&(o(this,z,Ps).style.transform=`translateX(${i}%)`)}})},Lc=function(){if(!this.product?.images?.length)return;let r=this._currentImageIndex,n=(r+1)%this.product.images.length,i=-(r*100),s=-(n*100);m(this,z,Os).call(this,i,s),this._currentImageIndex=n},jc=function(){if(!this.product?.images?.length)return;let r=this._currentImageIndex,n=(r-1+this.product.images.length)%this.product.images.length,i=-(r*100),s=-(n*100);m(this,z,Os).call(this,i,s),this._currentImageIndex=n},Tc=function(r){if(!this.product?.images?.length)return;let n=this._currentImageIndex,i=Math.max(0,Math.min(r,this.product.images.length-1)),s=-(n*100),a=-(i*100);m(this,z,Os).call(this,s,a),this._currentImageIndex=i},Ps=function(){return this.renderRoot.querySelector(".image-slider")},w(Us,"properties",{product:{type:Object},labels:{type:Object},_currentImageIndex:{type:Number,state:!0},_isValidUrl:{type:Boolean,state:!0}});var Wn=Us,rl;Wn.AddToCartEvent=(rl=class extends CustomEvent{constructor(e,r={}){super(Wn.AddToCartEvent.type,{detail:{product:e},...r})}},w(rl,"type","mw-product-card:add-to-cart"),rl);customElements.get("mw-product-card")||customElements.define("mw-product-card",Wn);function Dr(t){return Array.isArray(t)?t:t?[t]:[]}function Dc(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 Rs=class extends A($){constructor(){super(),this.orderDetails=null,this.streaming=!1,this.linksNewTab=!1}render(){let e=Dr(this.orderDetails?.order_status?.step||[]),r=Dr(this.orderDetails?.items?.item||[]),n=Dr(this.orderDetails?.actions||[]);return h`
|
|
2152
|
-
<div class="flex w-full max-w-md flex-col rounded-3xl border bg-white p-4">
|
|
2153
|
-
<!-- Header with order ID -->
|
|
2154
|
-
<div class="mb-2">
|
|
2155
|
-
${this.orderDetails?.order_id?.label||!this.streaming?h`<h2 class="text-lg font-semibold">${this.orderDetails?.order_id?.label} ${this.orderDetails?.order_id?.value}</h2>`:h`<div class="h-7 w-full animate-pulse rounded bg-gray-200"></div>`}
|
|
2156
|
-
</div>
|
|
2157
|
-
|
|
2158
|
-
<!-- Progress Timeline -->
|
|
2159
|
-
<div>
|
|
2160
|
-
<ol role="list" class="w-full overflow-hidden">
|
|
2161
|
-
${this.streaming&&!this.orderDetails?h`
|
|
2162
|
-
<!-- Loading for status timeline -->
|
|
2163
|
-
${[1,2,3].map((i,s)=>h`
|
|
2164
|
-
<li class="w-full pb-8">
|
|
2165
|
-
${s<2?h`<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>`:""}
|
|
2166
|
-
<div class="group relative flex items-start">
|
|
2167
|
-
<span class="flex h-6 items-center">
|
|
2168
|
-
<span class="h-4 w-4 animate-pulse rounded-full bg-gray-200"></span>
|
|
2169
|
-
</span>
|
|
2170
|
-
<span class="ml-3 flex min-w-0 flex-col">
|
|
2171
|
-
<span class="h-5 w-24 animate-pulse rounded bg-gray-200"></span>
|
|
2172
|
-
</span>
|
|
2173
|
-
</div>
|
|
2174
|
-
</li>
|
|
2175
|
-
`)}
|
|
2176
|
-
`:Ee(e,i=>i.label,(i,s)=>{let a=i.status==="completed",u=i.status==="in_progress",l=s===e.length-1;return h`<li class="relative pb-4">
|
|
2177
|
-
${l?"":h`<div class="${`absolute left-2 top-2 -ml-px mt-0.5 h-full w-0.5 ${a?"bg-[#601feb]":"bg-gray-300"}`}" aria-hidden="true"></div>`}
|
|
2178
|
-
|
|
2179
|
-
<div class="group relative flex items-start">
|
|
2180
|
-
${ws(i.status,[["pending",()=>h` <span class="flex h-6 items-center">
|
|
2181
|
-
<span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-gray-300 bg-white">
|
|
2182
|
-
<span class="h-1.5 w-1.5 rounded-full bg-transparent"></span>
|
|
2183
|
-
</span>
|
|
2184
|
-
</span>`],["in_progress",()=>h`<span class="flex h-6 items-center">
|
|
2185
|
-
<span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-[#601feb] bg-white">
|
|
2186
|
-
<span class="h-1.5 w-1.5 rounded-full bg-[#601feb]"></span>
|
|
2187
|
-
</span>
|
|
2188
|
-
</span>`],["completed",()=>h`
|
|
2189
|
-
<span class="flex h-6 items-center">
|
|
2190
|
-
<span class="flex h-4 w-4 items-center justify-center rounded-full bg-[#601feb]">
|
|
2191
|
-
<hi-outline class="mb-3 block h-3 w-3 text-white" name="check"></hi-outline>
|
|
2192
|
-
</span>
|
|
2193
|
-
</span>
|
|
2194
|
-
`]],()=>h`<span class="flex h-6 items-center">
|
|
2195
|
-
<span class="flex h-4 w-4 items-center justify-center rounded-full border-2 border-[#601feb] bg-white">
|
|
2196
|
-
<span class="h-1.5 w-1.5 rounded-full bg-[#601feb]"></span>
|
|
2197
|
-
</span>
|
|
2198
|
-
</span>`)}
|
|
2199
|
-
|
|
2200
|
-
<span class="ml-3 flex min-w-0 flex-col">
|
|
2201
|
-
<span class="${`text-sm font-medium ${u?"text-[#601feb]":a?"text-gray-900":"text-gray-500"}`}"> ${i.label} </span>
|
|
2202
|
-
</span>
|
|
2203
|
-
</div>
|
|
2204
|
-
</li>`})}
|
|
2205
|
-
</ol>
|
|
2206
|
-
</div>
|
|
2207
|
-
|
|
2208
|
-
<!-- Products list with order items -->
|
|
2209
|
-
<div class="mb-2 w-full">
|
|
2210
|
-
${r.length===0&&!this.orderDetails?.total?.amount&&this.streaming?h`
|
|
2211
|
-
<!-- Loading shimmer for products -->
|
|
2212
|
-
<div class="w-full space-y-4">
|
|
2213
|
-
<div class="flex items-center gap-2">
|
|
2214
|
-
<div class="h-12 w-12 animate-pulse rounded-lg bg-gray-200"></div>
|
|
2215
|
-
<div class="flex-1 space-y-2">
|
|
2216
|
-
<div class="h-4 w-32 animate-pulse rounded bg-gray-200"></div>
|
|
2217
|
-
<div class="h-4 w-24 animate-pulse rounded bg-gray-200"></div>
|
|
2218
|
-
</div>
|
|
2219
|
-
</div>
|
|
2220
|
-
<div class="flex items-center justify-between">
|
|
2221
|
-
<div class="h-4 w-12 animate-pulse rounded bg-gray-200"></div>
|
|
2222
|
-
<div class="h-4 w-10 animate-pulse rounded bg-gray-200"></div>
|
|
2223
|
-
</div>
|
|
2224
|
-
</div>
|
|
2225
|
-
`:h`
|
|
2226
|
-
<div class="divide-y divide-gray-100">
|
|
2227
|
-
${this.streaming&&!r.length?h`
|
|
2228
|
-
<!-- Loading shimmer for individual products -->
|
|
2229
|
-
${[1,2].map(()=>h`
|
|
2230
|
-
<div class="flex items-center gap-2 py-1.5">
|
|
2231
|
-
<div class="h-12 w-12 animate-pulse rounded-lg bg-gray-200"></div>
|
|
2232
|
-
<div class="min-w-0 flex-1">
|
|
2233
|
-
<div class="h-4 w-32 animate-pulse rounded bg-gray-200"></div>
|
|
2234
|
-
</div>
|
|
2235
|
-
<div class="h-4 w-24 animate-pulse rounded bg-gray-200"></div>
|
|
2236
|
-
</div>
|
|
2237
|
-
`)}
|
|
2238
|
-
`:r?.map(i=>{let s=i?.image_url;return h`
|
|
2239
|
-
<div class="flex items-center gap-2 py-1.5">
|
|
2240
|
-
<img src="${ce(s)}" class="block h-12 w-12 rounded-lg bg-gray-100 object-contain" loading="lazy" />
|
|
2163
|
+
`}};w(Js,"styles",H`
|
|
2164
|
+
:host {
|
|
2165
|
+
--w-hover-arrow--hovered: 0;
|
|
2166
|
+
}
|
|
2241
2167
|
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
</div>
|
|
2247
|
-
`})}
|
|
2248
|
-
</div>
|
|
2249
|
-
<!-- Order total -->
|
|
2250
|
-
<div class="mt-1 border-t border-gray-200 pt-1">
|
|
2251
|
-
<div class="flex justify-between font-medium">
|
|
2252
|
-
<span>${this.orderDetails?.total?.label}</span>
|
|
2253
|
-
<span>${this.orderDetails?.total?.amount}</span>
|
|
2254
|
-
</div>
|
|
2255
|
-
</div>
|
|
2256
|
-
`}
|
|
2257
|
-
</div>
|
|
2168
|
+
[part='line'] {
|
|
2169
|
+
opacity: calc(var(--w-hover-arrow--hovered) * 1);
|
|
2170
|
+
transition: opacity 0.3s ease-in-out;
|
|
2171
|
+
}
|
|
2258
2172
|
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2173
|
+
[part='tip'] {
|
|
2174
|
+
transform: translateX(calc(var(--w-hover-arrow--hovered) * 3px));
|
|
2175
|
+
transition: transform 0.3s ease-in-out;
|
|
2176
|
+
}
|
|
2177
|
+
`);customElements.define("w-hover-arrow",Js);var Tp=["primary","secondary","black","transparent","gradient","transparent-hover","link","transparent-rounded","dialog-primary","dialog-primary-danger","dialog-secondary","ninja-solid","ninja-outline"],ei=class extends Vt($){constructor(){super(),this.variant="primary",this.disabled=!1,this.isLoading=!1,this.bgColor="#FCBF0B",this.textColor="black"}renderPrimary(){return h`
|
|
2178
|
+
<span
|
|
2179
|
+
class="group relative inline-block h-auto w-full rounded-full border border-black/20 bg-transparent p-[1px] shadow-[0px_0px_3.13px_0px_#0000001a] duration-200 ease-[cubic-bezier(0.33,1,0.68,1)] disabled:cursor-default disabled:opacity-80 lg:hover:border-transparent lg:hover:shadow-none"
|
|
2180
|
+
?disabled="${this.disabled}">
|
|
2181
|
+
<span
|
|
2182
|
+
part="btn-rainbow-gradient"
|
|
2183
|
+
class="absolute top-1/2 left-1/2 block h-[calc(100%_+_4px)] w-[calc(100%_+_6px)] -translate-x-1/2 -translate-y-1/2 rounded-[80px] bg-transparent bg-cover bg-no-repeat transition-all duration-200 ease-in-out">
|
|
2184
|
+
</span>
|
|
2185
|
+
<span
|
|
2186
|
+
class="to-violet relative flex h-full w-full flex-row items-center justify-center gap-1 rounded-full bg-gradient-to-r from-[#8d00ff] from-40% px-8 py-2 text-center font-sans text-base leading-6 font-medium text-white transition-all ease-[cubic-bezier(0.33,1,0.68,1)] hover:from-[#0a2540] hover:to-[#0a2540] hover:shadow-xl">
|
|
2187
|
+
${this.isLoading?h`<m-svg-icon class="absolute h-5 w-5 stroke-2" icon="loading"></m-svg-icon>`:null}
|
|
2188
|
+
<span class="${this.isLoading?"opacity-0":""} transition-opacity">
|
|
2189
|
+
<slot></slot>
|
|
2190
|
+
</span>
|
|
2191
|
+
</span>
|
|
2192
|
+
</span>
|
|
2193
|
+
`}renderSecondary(){return h`
|
|
2194
|
+
<span
|
|
2195
|
+
class="group inline-block rounded-full border-[0.5px] border-current bg-current px-6 py-1.5 text-center font-sans text-sm leading-6 font-medium transition-[color,opacity,box-shadow] duration-200 ease-[cubic-bezier(0.215,0.61,0.355,1)] hover:opacity-90 hover:shadow-xl disabled:cursor-default disabled:opacity-80"
|
|
2196
|
+
?disabled="${this.disabled}">
|
|
2197
|
+
<span class="flex items-center justify-center gap-3 whitespace-nowrap text-white">
|
|
2198
|
+
${this.isLoading?h`<m-svg-icon class="absolute h-5 w-5 stroke-2" icon="loading"></m-svg-icon>`:null}
|
|
2199
|
+
<span class="${this.isLoading?"opacity-0":""} transition-opacity">
|
|
2200
|
+
<slot></slot>
|
|
2201
|
+
</span>
|
|
2202
|
+
<w-hover-arrow class="group-hover:[--w-hover-arrow--hovered:1]"></w-hover-arrow>
|
|
2203
|
+
</span>
|
|
2204
|
+
</span>
|
|
2205
|
+
`}renderBlack(){return h`
|
|
2206
|
+
<span
|
|
2207
|
+
class="${this.disabled?"pointer-events-none opacity-50":""} inline-flex h-9 items-center justify-center gap-3 rounded-md bg-[#18181A] px-4 py-2 text-sm font-medium whitespace-nowrap text-[#FAFAFA] shadow transition-colors hover:bg-[#18181A]/80">
|
|
2208
|
+
${this.isLoading?h`<m-svg-icon class="h-5 w-5 stroke-2" icon="loading"></m-svg-icon>`:null}
|
|
2209
|
+
<slot></slot>
|
|
2210
|
+
</span>
|
|
2211
|
+
`}renderLink(){return h`
|
|
2212
|
+
<span
|
|
2213
|
+
class="group relative flex items-center justify-center gap-3 font-sans text-sm font-semibold whitespace-nowrap text-black disabled:cursor-default disabled:opacity-80 lg:hover:text-[#8D00FF]"
|
|
2214
|
+
?disabled="${this.disabled}">
|
|
2215
|
+
${this.isLoading?h`<m-svg-icon class="absolute h-5 w-5 stroke-2" icon="loading"></m-svg-icon>`:null}
|
|
2216
|
+
<span class="${this.isLoading?"opacity-0":""} transition-opacity">
|
|
2217
|
+
<slot></slot>
|
|
2218
|
+
</span>
|
|
2219
|
+
<w-hover-arrow class="group-hover:[--w-hover-arrow--hovered:1]"></w-hover-arrow>
|
|
2220
|
+
</span>
|
|
2221
|
+
`}renderTransparent(){return h`
|
|
2222
|
+
<span
|
|
2223
|
+
class="relative inline-block h-auto w-full rounded-full border border-black/20 bg-transparent p-[1px] shadow-[0px_0px_3.13px_0px_#0000001a] duration-200 ease-[cubic-bezier(0.33,1,0.68,1)] lg:hover:shadow-none">
|
|
2224
|
+
<span class="hover:border-violet relative inline-block w-full rounded-full border border-gray-500">
|
|
2225
|
+
<span
|
|
2226
|
+
class="hover:text-violet relative flex h-full w-full flex-row items-center justify-center gap-1 rounded-full bg-transparent px-8 py-[7px] text-center font-sans text-base leading-6 font-medium text-[#0A2540] transition-all ease-[cubic-bezier(0.33,1,0.68,1)] hover:cursor-pointer hover:shadow-xl disabled:cursor-default disabled:opacity-80">
|
|
2227
|
+
${this.isLoading?h`<m-svg-icon class="absolute h-5 w-5 stroke-2" icon="loading"></m-svg-icon>`:null}
|
|
2228
|
+
<span class="${this.isLoading?"opacity-0":""} transition-opacity">
|
|
2229
|
+
<slot></slot>
|
|
2230
|
+
</span>
|
|
2231
|
+
</span>
|
|
2232
|
+
</span>
|
|
2233
|
+
</span>
|
|
2234
|
+
`}renderTransparentRounded(){return h`
|
|
2235
|
+
<span
|
|
2236
|
+
class="inline-block h-12 w-full overflow-hidden rounded-3xl border-[0.5px] border-[#0A254033] bg-[#EEEDF133] p-[2px] shadow-[0px_0px_3.13px_0px_#0000001a] duration-200 ease-[cubic-bezier(0.33,1,0.68,1)]">
|
|
2237
|
+
<span
|
|
2238
|
+
class="lg:hover:border-violet lg:hover:text-violet flex h-full w-full items-center justify-center gap-5 rounded-3xl border border-[#0A2540] bg-transparent py-2 font-sans text-[15px] leading-[18px] font-semibold text-[#0A2540] disabled:cursor-default disabled:opacity-80 lg:text-lg lg:hover:border-2 lg:hover:bg-transparent">
|
|
2239
|
+
${this.isLoading?h`<m-svg-icon class="absolute h-5 w-5 stroke-2" icon="loading"></m-svg-icon>`:null}
|
|
2240
|
+
<span class="${this.isLoading?"opacity-0":""} transition-opacity">
|
|
2241
|
+
<slot></slot>
|
|
2242
|
+
</span>
|
|
2243
|
+
</span>
|
|
2244
|
+
</span>
|
|
2245
|
+
`}renderTransparentHover(){return h`
|
|
2246
|
+
<span
|
|
2247
|
+
class="hover:shadow[#e0e0e033] group relative inline-block w-full overflow-hidden rounded-full border-[0.5px] border-[#EEEDF133] p-[2px] shadow-[0px_0px_3.13px_0px_#0000001a] duration-200 ease-[cubic-bezier(0.33,1,0.68,1)] group-hover:bg-transparent hover:shadow-sm">
|
|
2248
|
+
<span
|
|
2249
|
+
class="absolute -top-[5px] -left-[5px] block h-[calc(100%+10px)] w-[calc(100%+10px)] rounded-[80px] bg-transparent bg-cover bg-no-repeat duration-200 ease-[cubic-bezier(0.33,1,0.68,1)] lg:group-hover:blur-[6px]">
|
|
2250
|
+
</span>
|
|
2251
|
+
<span
|
|
2252
|
+
class="relative flex h-auto w-auto items-center justify-center gap-5 rounded-full border px-6 py-2 font-sans text-base font-semibold text-white duration-200 ease-[cubic-bezier(0.33,1,0.68,1)] disabled:cursor-default disabled:opacity-80 sm:text-[15px] lg:group-hover:border-transparent lg:group-hover:bg-white lg:group-hover:text-black">
|
|
2253
|
+
${this.isLoading?h`<m-svg-icon class="absolute h-5 w-5 stroke-2" icon="loading"></m-svg-icon>`:null}
|
|
2254
|
+
<span class="${this.isLoading?"opacity-0":""} transition-opacity">
|
|
2255
|
+
<slot></slot>
|
|
2256
|
+
</span>
|
|
2291
2257
|
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2258
|
+
<!-- right arrow -->
|
|
2259
|
+
<svg width="20" height="19" viewBox="0 0 20 19" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2260
|
+
<path
|
|
2261
|
+
d="M19 9.49473C19 9.38257 18.9681 9.27259 18.9077 9.17697C18.8474 9.08136 18.761 9.00384 18.6581 8.95299L2.80405 1.12543C2.56474 1.01069 2.29394 0.973353 2.03124 1.01886C1.76854 1.06437 1.5277 1.19035 1.34392 1.37839C1.16014 1.56642 1.04305 1.80665 1.00977 2.06397C0.976486 2.3213 1.02875 2.58222 1.15893 2.80861L5.37636 9.49433L1.15893 16.1914C1.02875 16.4178 0.976486 16.6787 1.00977 16.936C1.04305 17.1933 1.16014 17.4336 1.34392 17.6216C1.5277 17.8096 1.76854 17.9356 2.03124 17.9811C2.29394 18.0266 2.56474 17.9893 2.80405 17.8746L18.6581 10.0365C18.761 9.98563 18.8474 9.9081 18.9077 9.81249C18.9681 9.71687 19 9.6069 19 9.49473ZM19 9.49473L5.37219 9.49433"
|
|
2262
|
+
class="lg:group-hover:stroke-black"
|
|
2263
|
+
stroke="white"
|
|
2264
|
+
stroke-width="1.2"
|
|
2265
|
+
stroke-linecap="round"
|
|
2266
|
+
stroke-linejoin="round" />
|
|
2267
|
+
</svg>
|
|
2268
|
+
</span>
|
|
2269
|
+
</span>
|
|
2270
|
+
`}renderGradient(){return h`
|
|
2271
|
+
<span class="group inline-block rounded-full border border-black/20 p-[1px]">
|
|
2272
|
+
<span
|
|
2273
|
+
class="to-violet hover:from-violet hover:to-violet flex flex-row items-center justify-center gap-1 rounded-full bg-gradient-to-r from-[#8d00ff] from-40% px-8 py-[5px] text-center font-sans text-sm leading-6 font-medium text-white transition-[background-image,box-shadow] hover:cursor-pointer hover:shadow-xl disabled:cursor-default disabled:opacity-80">
|
|
2274
|
+
${this.isLoading?h`<m-svg-icon class="absolute h-5 w-5 stroke-2" icon="loading"></m-svg-icon>`:null}
|
|
2275
|
+
<span class="${this.isLoading?"opacity-0":""} transition-opacity">
|
|
2276
|
+
<slot></slot>
|
|
2277
|
+
</span>
|
|
2278
|
+
</span>
|
|
2279
|
+
</span>
|
|
2280
|
+
`}renderDialogPrimary(){return h`
|
|
2281
|
+
<span class="inline-block rounded-full border border-violet-400/20 p-[1px]">
|
|
2282
|
+
<span
|
|
2283
|
+
class="flex flex-row items-center justify-center gap-1 rounded-full bg-gradient-to-r from-violet-600 to-violet-500 px-8 py-[5px] text-center font-sans text-sm leading-6 font-medium text-white transition-all hover:cursor-pointer hover:from-violet-500 hover:to-violet-500">
|
|
2284
|
+
${this.isLoading?h`<m-svg-icon class="absolute h-5 w-5 stroke-2" icon="loading"></m-svg-icon>`:null}
|
|
2285
|
+
<span class="${this.isLoading?"opacity-0":""} transition-opacity">
|
|
2286
|
+
<slot></slot>
|
|
2287
|
+
</span>
|
|
2288
|
+
</span>
|
|
2289
|
+
</span>
|
|
2290
|
+
`}renderDialogPrimaryDanger(){return h`
|
|
2291
|
+
<span class="inline-block rounded-full border border-red-400/20 p-[1px]">
|
|
2292
|
+
<span
|
|
2293
|
+
class="flex flex-row items-center justify-center gap-1 rounded-full bg-gradient-to-r from-red-600 to-red-500 px-8 py-[5px] text-center font-sans text-sm leading-6 font-medium text-white transition-all hover:cursor-pointer hover:from-red-500 hover:to-red-500">
|
|
2294
|
+
${this.isLoading?h`<m-svg-icon class="absolute h-5 w-5 stroke-2" icon="loading"></m-svg-icon>`:null}
|
|
2295
|
+
<span class="${this.isLoading?"opacity-0":""} transition-opacity">
|
|
2296
|
+
<slot></slot>
|
|
2297
|
+
</span>
|
|
2298
|
+
</span>
|
|
2299
|
+
</span>
|
|
2300
|
+
`}renderDialogSecondary(){return h`
|
|
2301
|
+
<span class="inline-block rounded-full p-[1px]">
|
|
2302
|
+
<span
|
|
2303
|
+
class="hover:text-violet flex flex-row items-center justify-center gap-1 rounded-full bg-neutral-400/10 bg-gradient-to-r px-8 py-[5px] text-center font-sans text-sm leading-6 font-medium transition-all hover:cursor-pointer">
|
|
2304
|
+
${this.isLoading?h`<m-svg-icon class="absolute h-5 w-5 stroke-2" icon="loading"></m-svg-icon>`:null}
|
|
2305
|
+
<span class="${this.isLoading?"opacity-0":""} transition-opacity">
|
|
2306
|
+
<slot></slot>
|
|
2307
|
+
</span>
|
|
2308
|
+
</span>
|
|
2309
|
+
</span>
|
|
2310
|
+
`}renderNinjaSolid(){return h`
|
|
2311
|
+
<span
|
|
2312
|
+
class="text-${this.textColor} inline-flex h-10 items-center justify-center gap-2 rounded-2xl px-4 py-1.5 text-sm font-medium whitespace-nowrap transition-all duration-200 ease-[cubic-bezier(0.33,1,0.68,1)] hover:opacity-80 hover:shadow-md disabled:cursor-default disabled:opacity-50"
|
|
2313
|
+
style="background-color: ${this.bgColor}"
|
|
2314
|
+
?disabled="${this.disabled}">
|
|
2315
|
+
${this.isLoading?h`<m-svg-icon class="text-${this.textColor==="black"?"white":"black"} absolute h-4 w-4 stroke-2" icon="loading"></m-svg-icon>`:null}
|
|
2316
|
+
<span class="${this.isLoading?"opacity-0":""} transition-opacity">
|
|
2317
|
+
<slot></slot>
|
|
2318
|
+
</span>
|
|
2319
|
+
</span>
|
|
2320
|
+
`}renderNinjaOutline(){return h`
|
|
2321
|
+
<span
|
|
2322
|
+
class="inline-flex h-10 items-center justify-center gap-2 rounded-2xl border border-[#ffffff20] bg-transparent px-4 py-1.5 text-sm font-medium whitespace-nowrap text-white transition-all duration-200 ease-[cubic-bezier(0.33,1,0.68,1)] hover:bg-[#ffffff10] disabled:cursor-default disabled:opacity-50"
|
|
2323
|
+
?disabled="${this.disabled}">
|
|
2324
|
+
${this.isLoading?h`<m-svg-icon class="absolute h-4 w-4 stroke-2" style="color: #FCBF0B;" icon="loading"></m-svg-icon>`:null}
|
|
2325
|
+
<span class="${this.isLoading?"opacity-0":""} transition-opacity">
|
|
2326
|
+
<slot></slot>
|
|
2327
|
+
</span>
|
|
2328
|
+
</span>
|
|
2329
|
+
`}render(){switch(me(Tp.includes(this.variant),`invalid variant: ${this.variant}`),this.variant){case"primary":return this.renderPrimary();case"secondary":return this.renderSecondary();case"black":return this.renderBlack();case"transparent":return this.renderTransparent();case"gradient":return this.renderGradient();case"transparent-hover":return this.renderTransparentHover();case"link":return this.renderLink();case"transparent-rounded":return this.renderTransparentRounded();case"dialog-primary":return this.renderDialogPrimary();case"dialog-primary-danger":return this.renderDialogPrimaryDanger();case"dialog-secondary":return this.renderDialogSecondary();case"ninja-solid":return this.renderNinjaSolid();case"ninja-outline":return this.renderNinjaOutline()}}};w(ei,"styles",H`
|
|
2330
|
+
:host {
|
|
2331
|
+
display: inline-block;
|
|
2332
|
+
line-height: 0;
|
|
2333
|
+
}
|
|
2320
2334
|
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2335
|
+
@media (min-width: 1024px) {
|
|
2336
|
+
.group:hover [part='btn-rainbow-gradient'] {
|
|
2337
|
+
background: conic-gradient(
|
|
2338
|
+
from 180deg at 50% 50%,
|
|
2339
|
+
#ffba71 0deg,
|
|
2340
|
+
#bc82f3 45deg,
|
|
2341
|
+
#f5b9eac9 90deg,
|
|
2342
|
+
#8d99ff 135deg,
|
|
2343
|
+
#aa6eeecf 180deg,
|
|
2344
|
+
#ff6778c2 225deg,
|
|
2345
|
+
#ffba71 270deg,
|
|
2346
|
+
#bc82f3 315deg,
|
|
2347
|
+
#ffba71 360deg
|
|
2348
|
+
);
|
|
2349
|
+
filter: blur(6.5px);
|
|
2350
|
+
}
|
|
2351
|
+
}
|
|
2352
|
+
`),w(ei,"properties",{variant:{type:String},disabled:{type:Boolean},isLoading:{type:Boolean,attribute:"loading"},bgColor:{type:String,attribute:"bg-color"},textColor:{type:String,attribute:"text-color"}});customElements.define("w-button",ei);var ie,ru,nu,iu,su,ou,au,lu,vl,Br=class Br extends _($){constructor(){super();d(this,ie);this.title="",this.type="star-rating",this.color="#8B5CF6",this._hoverRating=0}render(){return h`
|
|
2353
|
+
<div
|
|
2354
|
+
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}]">
|
|
2355
|
+
<div class="flex flex-col gap-2 p-4">
|
|
2356
|
+
${Ws(this.type,[["star-rating",()=>f(this,ie,nu).call(this)],["binary-vote",()=>f(this,ie,iu).call(this)],["new-conversation-button",()=>f(this,ie,ru).call(this)]],()=>h`<span class="text-sm text-gray-500">Unsupported input type</span>`)}
|
|
2334
2357
|
</div>
|
|
2335
2358
|
</div>
|
|
2336
|
-
`}};
|
|
2337
|
-
|
|
2359
|
+
`}};ie=new WeakSet,ru=function(){return h`
|
|
2360
|
+
<button
|
|
2361
|
+
type="button"
|
|
2362
|
+
@click="${()=>this.dispatchEvent(new Br.SubmitEvent({type:"new-conversation-button"}))}">
|
|
2363
|
+
<w-button variant="link">${this.title||"Start a new conversation"}</w-button>
|
|
2364
|
+
</button>
|
|
2365
|
+
`},nu=function(){return h`
|
|
2366
|
+
${this.title?h`<p class="text-sm font-medium text-gray-700">${this.title}</p>`:null}
|
|
2367
|
+
<div class="flex justify-center gap-1">
|
|
2368
|
+
${[1,2,3,4,5].map(r=>h`
|
|
2369
|
+
<button
|
|
2370
|
+
type="button"
|
|
2371
|
+
@click="${()=>f(this,ie,ou).call(this,r)}"
|
|
2372
|
+
@mouseenter="${()=>f(this,ie,au).call(this,r)}"
|
|
2373
|
+
@mouseleave="${f(this,ie,lu)}"
|
|
2374
|
+
class="p-1 transition-transform hover:scale-110"
|
|
2375
|
+
aria-label="${r} star${r>1?"s":""}">
|
|
2376
|
+
${f(this,ie,su).call(this,r)}
|
|
2377
|
+
</button>
|
|
2378
|
+
`)}
|
|
2379
|
+
</div>
|
|
2380
|
+
`},iu=function(){return h`
|
|
2381
|
+
${this.title?h`<p class="text-sm font-medium text-gray-700">${this.title}</p>`:null}
|
|
2382
|
+
<div class="flex justify-center gap-4">
|
|
2383
|
+
<button
|
|
2384
|
+
type="button"
|
|
2385
|
+
@click="${()=>f(this,ie,vl).call(this,"positive")}"
|
|
2386
|
+
class="flex flex-col items-center gap-1 rounded-lg border-2 border-gray-300 p-1 transition-all hover:border-green-400">
|
|
2387
|
+
<svg class="h-6 w-6 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
2388
|
+
<path
|
|
2389
|
+
stroke-linecap="round"
|
|
2390
|
+
stroke-linejoin="round"
|
|
2391
|
+
stroke-width="2"
|
|
2392
|
+
d="M14 10h4.764a2 2 0 011.789 2.894l-3.5 7A2 2 0 0115.263 21h-4.017c-.163 0-.326-.02-.485-.06L7 20m7-10V5a2 2 0 00-2-2h-.095c-.5 0-.905.405-.905.905 0 .714-.211 1.412-.608 2.006L7 11v9m7-10h-2M7 20H5a2 2 0 01-2-2v-6a2 2 0 012-2h2.5" />
|
|
2393
|
+
</svg>
|
|
2394
|
+
</button>
|
|
2395
|
+
<button
|
|
2396
|
+
type="button"
|
|
2397
|
+
@click="${()=>f(this,ie,vl).call(this,"negative")}"
|
|
2398
|
+
class="flex flex-col items-center gap-1 rounded-lg border-2 border-gray-300 p-1 transition-all hover:border-red-400">
|
|
2399
|
+
<svg class="h-6 w-6 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
2400
|
+
<path
|
|
2401
|
+
stroke-linecap="round"
|
|
2402
|
+
stroke-linejoin="round"
|
|
2403
|
+
stroke-width="2"
|
|
2404
|
+
d="M10 14H5.236a2 2 0 01-1.789-2.894l3.5-7A2 2 0 018.736 3h4.018a2 2 0 01.485.06l3.76.94m-7 10v5a2 2 0 002 2h.096c.5 0 .905-.405.905-.904 0-.715.211-1.413.608-2.008L17 13V4m-7 10h2m5-10h2a2 2 0 012 2v6a2 2 0 01-2 2h-2.5" />
|
|
2405
|
+
</svg>
|
|
2406
|
+
</button>
|
|
2407
|
+
</div>
|
|
2408
|
+
`},su=function(r){let n=r<=this._hoverRating;return h`
|
|
2409
|
+
<svg class="${n?"text-yellow-400":"text-gray-300"} h-6 w-6" fill="${n?"currentColor":"none"}" stroke="currentColor" viewBox="0 0 24 24">
|
|
2410
|
+
<path
|
|
2411
|
+
stroke-linecap="round"
|
|
2412
|
+
stroke-linejoin="round"
|
|
2413
|
+
stroke-width="2"
|
|
2414
|
+
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" />
|
|
2415
|
+
</svg>
|
|
2416
|
+
`},ou=function(r){this._hoverRating=0,this.dispatchEvent(new Br.SubmitEvent({type:"star-rating",rating:r}))},au=function(r){this._hoverRating=r},lu=function(){this._hoverRating=0},vl=function(r){this.dispatchEvent(new Br.SubmitEvent({type:"binary-vote",vote:r}))},w(Br,"properties",{title:{type:String},type:{type:String},color:{type:String},_hoverRating:{type:Number,state:!0}});var ti=Br,wl;ti.SubmitEvent=(wl=class extends CustomEvent{constructor(e,r={}){super(ti.SubmitEvent.type,{detail:e,bubbles:!0,composed:!0,...r})}},w(wl,"type","mw-request-input:submit"),wl);customElements.get("mw-request-input")||customElements.define("mw-request-input",ti);var cu=P1(Ze({name:X(),description:X(),price:X(),image_url:hr([X(),cr(X())]),category:X(),url:X()}));function uu(t,e,r,{imagesByProductUrl:n,linksNewTab:i=!0,searchParams:s,messageIsStreaming:a=!1,isSupportAgent:u,color:l="#601feb",apiBaseUrl:c=""}){if(!t)return h``;let p=e>0&&r[e-1]&&"data"in r[e-1],m=e<r.length-1||!a;if("text"in t)return h`<p>${t.text}</p>`;if("html"in t)return h`${eu(t.html)}`;if("data"in t)switch(t.tag){case"product-card":case"product-card-v1":case"product-card-horizontal":{let v=bn(cu,t.data);if(v.success){let b={...v.output,images:[]};return b.images=Rr(b.image_url),h`
|
|
2417
|
+
${p?h`<div class="my-3 w-full border-t border-gray-200/50"></div>`:null}
|
|
2338
2418
|
<mw-product-card-horizontal
|
|
2339
|
-
product="${JSON.stringify(
|
|
2340
|
-
?streaming="${!
|
|
2419
|
+
product="${JSON.stringify(b)}"
|
|
2420
|
+
?streaming="${!m}"
|
|
2341
2421
|
?links-new-tab="${i}"
|
|
2342
2422
|
.searchParams="${s}"
|
|
2343
2423
|
.imagesByProductUrl="${n}"></mw-product-card-horizontal>
|
|
2344
|
-
`}console.warn(
|
|
2345
|
-
|
|
2424
|
+
`}console.warn(v.issues);break}case"order-status-card-v1":return h`<mw-product-order-status-card
|
|
2425
|
+
order-details="${JSON.stringify(t.data)}"
|
|
2426
|
+
?streaming="${!m}"
|
|
2427
|
+
?links-new-tab="${i}"
|
|
2428
|
+
color="${l}"></mw-product-order-status-card> `;case"live-chat-wait-card-v1":{let v=t.data||{};return u?h`<p><i>${v.message}</i></p>`:h`<mw-chat-wait-timer
|
|
2429
|
+
title="${v.title||""}"
|
|
2430
|
+
message="${v.message||""}"
|
|
2431
|
+
completeMessage="${v.completeMessage||""}"
|
|
2432
|
+
gameButton="${v.gameButton||""}"
|
|
2433
|
+
target-end-time="${v.targetEndTime||""}"
|
|
2434
|
+
question="${v.firstQuestion||""}"
|
|
2435
|
+
.options="${v.options?.option||["Yes","No","Not sure"]}"
|
|
2436
|
+
game-title="${v.gameTitle||""}"
|
|
2437
|
+
result-prefix="${v.resultPrefix||""}"
|
|
2438
|
+
color="${l}"
|
|
2439
|
+
apiBaseUrl="${c}"></mw-chat-wait-timer>`}case"request-input-v1":return h``}return console.warn("could not render part:",t),h`<p><i>data type not supported</i></p>`}var ri,Hr,ct,Ht,Ys,hu,Ks=class{constructor(e,r,{timeoutMs:n=2e3}={}){d(this,Ys);d(this,ri);d(this,Hr);d(this,ct);d(this,Ht,!1);w(this,"timeoutMs");g(this,ri,e),g(this,Hr,r),this.timeoutMs=n,e.addController(this)}get isTyping(){return o(this,Ht)}hostDisconnected(){clearTimeout(o(this,ct)),g(this,ct,void 0)}onInput(e){if(o(this,ri).isConnected){if(!e.trim()){this.typingStopped();return}clearTimeout(o(this,ct)),g(this,ct,setTimeout(()=>this.typingStopped(),this.timeoutMs)),o(this,Ht)||f(this,Ys,hu).call(this)}}typingStopped(){clearTimeout(o(this,ct)),g(this,Ht,!1),o(this,Hr).typingStopped()}};ri=new WeakMap,Hr=new WeakMap,ct=new WeakMap,Ht=new WeakMap,Ys=new WeakSet,hu=function(){g(this,Ht,!0),o(this,Hr).typingStarted()};function pu(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 du(t){t?.body?.cancel().catch(console.warn)}var ut,qe,xl,ni,yl=class{constructor(e=window.localStorage){d(this,qe);d(this,ut);g(this,ut,e)}setex(e,r,n){return o(this,ut).setItem(e,f(this,qe,ni).call(this,{value:f(this,qe,ni).call(this,r),expiresAt:Date.now()+n*1e3})||"")}set(e,r){return o(this,ut).setItem(e,f(this,qe,ni).call(this,{value:f(this,qe,ni).call(this,r)})||"")}get(e){let r=o(this,ut).getItem(e);if(!r)return;let n=f(this,qe,xl).call(this,r);if(n){if(n.expiresAt&&n.expiresAt<Date.now()){o(this,ut).removeItem(e);return}return f(this,qe,xl).call(this,n.value)}}get molin_shop_assistant_distinct_id(){return localStorage.getItem("molin_shop_assistant_distinct_id")}set molin_shop_assistant_distinct_id(e){e===null?localStorage.removeItem("molin_shop_assistant_distinct_id"):localStorage.setItem("molin_shop_assistant_distinct_id",e)}get molin_widget_open_state(){return ke.get("molin-shop-ai-widget-open")??null}set molin_widget_open_state(e){ke.set("molin-shop-ai-widget-open",e)}resetWidgetData(){ke.molin_shop_assistant_distinct_id=null,ke.molin_widget_open_state=null}};ut=new WeakMap,qe=new WeakSet,xl=function(e){if(!(typeof e!="string"||e===""))try{return JSON.parse(e)}catch{return}},ni=function(e){if(e!==void 0)try{return JSON.stringify(e)}catch{return}};var ke=new yl;var he,Ye,Xs,ii,qr,bl=class{constructor(){d(this,he,[]);d(this,Ye);d(this,Xs,10);d(this,ii,5e3);d(this,qr,!1)}async add(e,r){if(o(this,he).push(gu(e,r)),o(this,he).length>=o(this,Xs))return this.flush();o(this,Ye)||g(this,Ye,setTimeout(()=>{this.flush().catch(console.error)},o(this,ii)))}async flush(){if(o(this,qr)||o(this,he).length===0)return;let e=[...o(this,he)];try{g(this,qr,!0),clearTimeout(o(this,Ye)),g(this,Ye,void 0),g(this,he,[]);let r=new AbortController,n=setTimeout(()=>r.abort(),5e3);await mu(e,{signal:r.signal}),clearTimeout(n)}catch(r){if(r.name==="AbortError")console.error("Request timed out, retrying events"),g(this,he,[...e,...o(this,he)]);else{console.error("Failed to send events to backend:",r);let n=e.filter(i=>i.event.includes("error"));g(this,he,[...n,...o(this,he)])}}finally{g(this,qr,!1),o(this,he).length>0&&!o(this,Ye)&&g(this,Ye,setTimeout(()=>{this.flush().catch(console.error)},o(this,ii)))}}async flushBeforeUnload(){if(o(this,he).length>0)try{let e=new FormData;e.set("events",JSON.stringify(o(this,he))),navigator.sendBeacon(new URL("/widgets/data/collect",Qs()).href,e)}catch(e){console.error("Failed to send final events:",e)}}};he=new WeakMap,Ye=new WeakMap,Xs=new WeakMap,ii=new WeakMap,qr=new WeakMap;var fu=new bl;window.addEventListener("beforeunload",()=>{fu.flushBeforeUnload().catch(console.error)});async function q(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"&&Pp("molin_link_click",e),r?.immediate){await mu([gu(t,e)]);return}else return fu.add(t,e)}catch(n){console.error("Failed to send event:",n)}}async function mu(t,{signal:e}={}){let r=new FormData;r.set("events",JSON.stringify(t));let n=await fetch(new URL("/widgets/data/collect",Qs()),{method:"POST",body:r,signal:e});if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);du(n)}function gu(t,e){return{event:t,widget_id:e.widgetId,properties:Object.assign({},e,Op()),distinct_id:Dp(),timestamp:new Date().toISOString()}}function Dp(){try{let t=ke.molin_shop_assistant_distinct_id;return t||(t=crypto.randomUUID(),ke.molin_shop_assistant_distinct_id=t),t}catch(t){console.error("Failed to deserialize distinct_id:",t);let e=crypto.randomUUID();try{ke.molin_shop_assistant_distinct_id=e}catch(r){console.error("Failed to store new distinct_id:",r)}return e}}function Op(){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 Qs(){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 Pp(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 qt,si,ht,zt,to,vu,eo=class{constructor(e,r,n){d(this,to);d(this,qt);d(this,si);d(this,ht);d(this,zt);w(this,"isLoading",!1);w(this,"data");g(this,qt,e),g(this,si,r),g(this,ht,n),e.addController(this)}fetch(){if(this.isLoading)return;o(this,zt)?.abort();let e=new AbortController;g(this,zt,e),this.isLoading=!0,this.data=void 0,o(this,qt).requestUpdate(),(async()=>{let r=f(this,to,vu).call(this);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 o(this,ht)?.transform=="function"?await o(this,ht).transform(r):r,o(this,qt).requestUpdate()}).catch(r=>{o(this,ht)?.onError?.(r),this.isLoading=!1,this.data=void 0,o(this,qt).requestUpdate()}).finally(()=>{e.abort()})}hostConnected(){this.isLoading||o(this,ht)?.fetchWhenConnected&&this.fetch()}hostDisconnected(){o(this,zt)?.abort(),g(this,zt,void 0)}};qt=new WeakMap,si=new WeakMap,ht=new WeakMap,zt=new WeakMap,to=new WeakSet,vu=function(){let e=o(this,si);if(typeof e=="function"&&(e=e()),!e)throw new Error("missing request");return new Request(e)};function pt(){return window.molinSettings&&typeof window.molinSettings=="object"?window.molinSettings:null}var ro,li,no,Xe,yu,oi,ai=class ai extends _($){constructor(){super();d(this,Xe);d(this,ro,new dt(this,{onError:console.error}));d(this,li);d(this,no,{onError:r=>{alert(r.error),console.error(r.widgetId,r.error),q("ShopAssistant: error",{...r},{immediate:!0})},onNewMessageStartedStreaming:r=>{q("ShopAssistant: user received bot message (streaming started)",r)},onMessageEndedStreaming:r=>{q("ShopAssistant: user received bot message (streaming ended)",r)},onUserCanceledStreaming:r=>{q("ShopAssistant: user canceled streaming",r)},onUserClickedLink:r=>{q("ShopAssistant: user clicked link",r)},onUserSentInput:r=>{q("ShopAssistant: user sent input",r)}});this.cdn="https://widget.molin.ai",this.widgetId="",this.showClose=!1,this.xUserData=pt()?.userData,this.xCustomInstructions=pt()?.customInstructions}get config(){return o(this,li)||o(this,ro).data}render(){return this.config?h`
|
|
2440
|
+
<mw-context-widget .widgetId="${this.widgetId}" .config="${this.config}" .callbacks="${o(this,no)}" .xUserData="${this.xUserData}" .xCustomInstructions="${this.xCustomInstructions}">
|
|
2346
2441
|
<!-- embed our chat component forwarding props -->
|
|
2347
|
-
<mw-chat ?show-close="${this.showClose}" @mw:close-click="${
|
|
2442
|
+
<mw-chat ?show-close="${this.showClose}" @mw:close-click="${f(this,Xe,yu)}">
|
|
2348
2443
|
<slot name="banner" slot="banner"></slot>
|
|
2349
2444
|
</mw-chat>
|
|
2350
2445
|
</mw-context-widget>
|
|
2351
|
-
`:null}injectConfig(r){g(this,
|
|
2446
|
+
`:null}injectConfig(r){g(this,li,r),this.requestUpdate()}reloadConfig(){o(this,Xe,oi)?.reloadConfig()}reset(){this.xUserData={},this.xCustomInstructions="",o(this,Xe,oi)?.reset(),this.requestUpdate()}get conversationId(){return o(this,Xe,oi)?.conversationId??""}get messages(){return o(this,Xe,oi)?.messages??[]}};ro=new WeakMap,li=new WeakMap,no=new WeakMap,Xe=new WeakSet,yu=function(){this.dispatchEvent(new ai.CloseClickEvent)},oi=function(){return this.renderRoot.querySelector("mw-chat")},w(ai,"styles",H`
|
|
2352
2447
|
:host {
|
|
2353
2448
|
all: initial; /* reset all properties that can pierce the shadow DOM */
|
|
2354
2449
|
}
|
|
2355
|
-
`),w(
|
|
2450
|
+
`),w(ai,"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=ai;customElements.get("molin-shop-ai-chat")||customElements.define("molin-shop-ai-chat",Ft);var kl;Ft.CloseClickEvent=(kl=class extends CustomEvent{constructor(e={}){super(Ft.CloseClickEvent.type,{...e})}},w(kl,"type","mw:close-click"),kl);var Cl=class{constructor({hidden:e=!1}){w(this,"hidden");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 De&&e.showLauncher()}hideLauncher(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof De&&e.hideLauncher()}openChat(e){let{message:r,autoSend:n}=e||{};for(let i of document.querySelectorAll("molin-shop-ai"))i instanceof De&&i.openChat({message:r,autoSend:n})}closeChat(){for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof De&&e.closeChat()}reset(){ke.resetWidgetData();for(let e of document.querySelectorAll("molin-shop-ai"))e instanceof De&&e.reset();for(let e of document.querySelectorAll("molin-shop-ai-chat"))e instanceof Ft&&e.reset()}};function xu({hidden:t}){let e=new Cl({hidden:t});return window.Molin=e,e}function io(){let t=window.Molin;if(!t)throw new Error("window.Molin global not initialized");return t}window.__INIT_MOLIN_SHOP_AI=function(e){Up(e);let r=pt(),n=typeof r?.hidden=="boolean"?r.hidden:window.self!==window.top;if(xu({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 Up(t){window.__INIT_MOLIN_SHOP_AI_OPTIONS=t}function bu(){return window.__INIT_MOLIN_SHOP_AI_OPTIONS}var Ae,ci,zr,Fr,dt=class{constructor(e,r){d(this,Ae);d(this,ci);d(this,zr);d(this,Fr);g(this,Ae,e),g(this,ci,r),e.addController(this)}get data(){return o(this,Fr)||o(this,zr)?.data}hostConnected(){if(o(this,zr)||o(this,Fr))return;let e=bu();e&&e.widgetId===o(this,Ae).widgetId?g(this,Fr,e.config):g(this,zr,new eo(o(this,Ae),()=>{if(o(this,Ae).cdn&&o(this,Ae).widgetId)return`${o(this,Ae).cdn}/config?w=${o(this,Ae).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:o(this,Ae).cdn,widgetId:o(this,Ae).widgetId,config:n}),n},onError:o(this,ci)?.onError}))}};Ae=new WeakMap,ci=new WeakMap,zr=new WeakMap,Fr=new WeakMap;function ku(){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"}var Rp="\xB7 \xB7 \xB7",Vp=["star-rating","binary-vote","new-conversation-button"],j,Oe,pi,pe,Nr,oo,ao,lo,D,Cu,$u,Su,Eu,_u,so,Mu,Sl,Bp,Au,Iu,Lu,ui,ju,Hp,Nt,co=class co extends _($){constructor(){super();d(this,D);d(this,j,F1(this));d(this,Oe,[]);d(this,pi,new Ks(this,{typingStarted:()=>o(this,j).value?.sendUserTypingStart(),typingStopped:()=>o(this,j).value?.sendUserTypingStop()}));d(this,pe,new ps(this,{onImageDelete:r=>{if(!o(this,j).value){console.warn("widget context not available, cannot delete image");return}o(this,j).value.sendImageDelete(r),o(this,D,Nt)?.focus()},uploadUrl:new URL("/v1/uploads",ku()).href}));d(this,Nr,"single");d(this,oo,r=>{let n=r,{pendingImages:i}=n.detail;Array.isArray(i)&&o(this,pe).restoreImages(i)});d(this,ao,r=>{let n=r,{questionIndex:i,question:s,answer:a,totalQuestions:u}=n.detail;this.callbacks.onWaitGameQuestionAnswered?.({widgetId:this.widgetId,conversationId:this.conversationId,questionIndex:i,question:s,answer:a,totalQuestions:u})});d(this,lo,r=>{let n=r,{guessedProfession:i,questionCount:s}=n.detail;this.callbacks.onWaitGameCompleted?.({widgetId:this.widgetId,conversationId:this.conversationId,guessedProfession:i,questionCount:s})});this.showClose=!1,this._currentRequestInputIndex=0}get conversationId(){return o(this,j).value?.conversationId||""}get messages(){return o(this,j).value?.messages||[]}get config(){return o(this,j).value?.config}get callbacks(){return o(this,j).value?.callbacks||{}}get widgetId(){return o(this,j).value?.widgetId||""}get typingIndicator(){return o(this,j).value?.typingIndicator}get isStreaming(){return o(this,j).value?.isStreaming}get ranOutOfCredits(){return o(this,j).value?.ranOutOfCredits}get isLiveMode(){return o(this,j).value?.isLiveMode}get lastMsg(){return o(this,j).value?.lastMsg}get hasQueuedMessages(){return o(this,j).value?.hasQueuedMessages}firstUpdated(){document.addEventListener("mw-context-widget:connected",o(this,oo),{once:!0}),this.addEventListener("mw-chat-wait-game:question-answered",o(this,ao)),this.addEventListener("mw-chat-wait-game:game-completed",o(this,lo))}updated(){o(this,j).value?.widgetId&&o(this,pe).updateUploadOptions({conversationId:this.conversationId,widgetId:o(this,j).value?.widgetId,enabled:this.config?.enableImageUpload})}render(){me(this.config,"config is required");let r=Xc(this.messages,n=>{try{let i=new Date(n.timestamp),s=Math.floor(i.getUTCMinutes()/5)*5;return i.setUTCMinutes(s,0,0),i.valueOf().toString()}catch(i){console.error(i)}});return h`
|
|
2356
2451
|
<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]">
|
|
2357
2452
|
<div
|
|
2358
2453
|
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]">
|
|
2359
2454
|
<mw-chat-header
|
|
2360
2455
|
class="absolute top-1.5 right-1.5 left-1.5"
|
|
2361
2456
|
.content="${{logoUrl:this.config.logoUrl,title:this.config.title,color:this.config.color}}"
|
|
2362
|
-
?show-new-chat="${!this.isLiveMode&&this.messages.length>0&&!o(this,D,
|
|
2457
|
+
?show-new-chat="${!this.isLiveMode&&this.messages.length>0&&!o(this,D,ju)}"
|
|
2363
2458
|
?show-close="${this.showClose}"
|
|
2364
|
-
@mw:new-chat-click="${
|
|
2365
|
-
@mw:close-click="${
|
|
2459
|
+
@mw:new-chat-click="${f(this,D,so)}"
|
|
2460
|
+
@mw:close-click="${f(this,D,Mu)}">
|
|
2366
2461
|
</mw-chat-header>
|
|
2367
2462
|
|
|
2368
2463
|
<!-- used by the dashboard to inject content -->
|
|
@@ -2371,7 +2466,7 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
2371
2466
|
</div>
|
|
2372
2467
|
|
|
2373
2468
|
<!-- drag overlay -->
|
|
2374
|
-
${this.config.enableImageUpload&&o(this,
|
|
2469
|
+
${this.config.enableImageUpload&&o(this,pe).isDragging?h`
|
|
2375
2470
|
<div class="bg-opacity-90 absolute inset-0 z-50 flex items-center justify-center bg-white sm:rounded-[30px]">
|
|
2376
2471
|
<div class="p-8 text-center">
|
|
2377
2472
|
<lucide-icon name="image-plus" class="mx-auto mb-4 h-12 w-12 text-blue-500"></lucide-icon>
|
|
@@ -2383,7 +2478,7 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
2383
2478
|
|
|
2384
2479
|
<!-- this structure of 2 divs is required for the browser native stick/scroll to bottom -->
|
|
2385
2480
|
<div id="scrollable-content" class="mt-6 flex h-full flex-shrink flex-grow flex-col-reverse overflow-auto">
|
|
2386
|
-
${this.config.enableImageUpload&&o(this,
|
|
2481
|
+
${this.config.enableImageUpload&&o(this,pe).error?h`<mw-info-banner variant="error" text="${o(this,pe).error}" auto-dismissable></mw-info-banner> `:null}
|
|
2387
2482
|
${this.config?.showStillLearningBanner?h`<mw-info-banner variant="info" text="I'm still learning!"></mw-info-banner>`:h`
|
|
2388
2483
|
<!-- this makes the chat stick to bottom when the banner is hidden -->
|
|
2389
2484
|
<div class="flex p-1"></div>
|
|
@@ -2392,12 +2487,17 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
2392
2487
|
<!-- the padding at the top makes empty room at the top when scrolling and content is hidden behind header -->
|
|
2393
2488
|
<!-- this is the 2nd (inner) div that will natively stick/scroll to bottom -->
|
|
2394
2489
|
<div class="${this.messages.length>0?"pt-20":""}">
|
|
2395
|
-
${
|
|
2396
|
-
<div class="my-2 text-center text-xs text-gray-500">${
|
|
2397
|
-
${
|
|
2398
|
-
${s.images?
|
|
2399
|
-
<div data-id="${s.id}" class="${l?"mb-[1px]":"mb-3"}
|
|
2400
|
-
<mw-chat-image
|
|
2490
|
+
${_e(Array.from(r),([n])=>n,([n,i])=>h`
|
|
2491
|
+
<div class="my-2 text-center text-xs text-gray-500">${pu(new Date(Number(n)),window.navigator.language)}</div>
|
|
2492
|
+
${_e(i??[],s=>s.id,(s,a)=>{let l=i[a+1]?.role===s.role,p=(a>0?i[a-1]:void 0)?.role===s.role,v=(i.length>0?i[i.length-1]:void 0)?.id===s.id;g(this,Nr,v&&!p&&!l?"single-current":!p&&!l?"single":!p&&l?"first":v&&p&&!l?"last-current":p&&!l?"last":p&&l?"middle":"single");let S=this.isLiveMode&&s.role==="user"&&s.id===this.lastMsg?.id?"sent":"",T=(s.content.includes("<request-input-v1>")||!s.content)&&s.parts?.every(k=>"data"in k&&k.tag==="request-input-v1");return h`
|
|
2493
|
+
${s.images?_e(s.images,k=>k,k=>h`
|
|
2494
|
+
<div data-id="${s.id}" class="${l?"mb-[1px]":"mb-3"} mr-2 ml-[15px] flex-row">
|
|
2495
|
+
<mw-chat-image
|
|
2496
|
+
src="${k}"
|
|
2497
|
+
alt="User uploaded image"
|
|
2498
|
+
.side="${s.role==="user"?"right":"left"}"
|
|
2499
|
+
position=${o(this,Nr)}
|
|
2500
|
+
width="300px"></mw-chat-image>
|
|
2401
2501
|
</div>
|
|
2402
2502
|
`):null}
|
|
2403
2503
|
${(s.content||s.parts)&&!T?h` <div data-id="${s.id}" class="${l?"mb-[1px]":"mb-3"} mx-2 flex-row">
|
|
@@ -2406,11 +2506,11 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
2406
2506
|
status="${S}"
|
|
2407
2507
|
logo="${s.metadata?.avatar||this.config?.logoUrl}"
|
|
2408
2508
|
side="${s.role}"
|
|
2409
|
-
position=${o(this,
|
|
2410
|
-
@click="${
|
|
2509
|
+
position=${o(this,Nr)}
|
|
2510
|
+
@click="${f(this,D,Cu)}">
|
|
2411
2511
|
<div
|
|
2412
2512
|
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">
|
|
2413
|
-
${s.content===
|
|
2513
|
+
${s.content===Rp?h`<mw-loading class="-mx-2 block h-8 max-h-[24px] w-8 fill-[${this.config?.color}]"></mw-loading>`:s.parts?_e(s.parts,(k,A)=>A,(k,A)=>uu(k,A,s.parts??[],{imagesByProductUrl:s.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:s.streaming,color:this.config?.color,apiBaseUrl:Qs()})):h`<p>${s.content}</p>`}
|
|
2414
2514
|
</div>
|
|
2415
2515
|
</mw-chat-message>
|
|
2416
2516
|
</div>`:null}
|
|
@@ -2432,9 +2532,15 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
2432
2532
|
class="flex-grow"
|
|
2433
2533
|
.examples="${this.messages.length>0?[]:this.config.examples}"
|
|
2434
2534
|
color="${this.config.color}"
|
|
2435
|
-
@mw:example-click="${
|
|
2535
|
+
@mw:example-click="${f(this,D,$u)}"></mw-chat-background>
|
|
2436
2536
|
</div>
|
|
2437
2537
|
|
|
2538
|
+
${this.messages.length===0&&this.config.disclaimerFloating?h`
|
|
2539
|
+
<div class="mx-4 mb-2 rounded-xl bg-[#eeedf1] px-3 py-2">
|
|
2540
|
+
<mw-disclaimer .text="${this.config.disclaimerFloating}" .color="${this.config.color}"></mw-disclaimer>
|
|
2541
|
+
</div>
|
|
2542
|
+
`:null}
|
|
2543
|
+
|
|
2438
2544
|
<div class="m-1.5 flex-shrink-0 flex-grow-0 space-y-2 rounded-3xl bg-[#eeedf1] p-1.5">
|
|
2439
2545
|
${this.config.disclaimer&&!this.config.removePoweredBy?h`
|
|
2440
2546
|
<!-- spacing between input box and disclaimer or bottom -->
|
|
@@ -2442,7 +2548,7 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
2442
2548
|
<mw-disclaimer .text="${this.config.disclaimer}" .color="${this.config.color}"></mw-disclaimer>
|
|
2443
2549
|
</div>
|
|
2444
2550
|
`:null}
|
|
2445
|
-
${o(this,D,
|
|
2551
|
+
${o(this,D,ui).length>0?f(this,D,Au).call(this,o(this,D,ui)):f(this,D,Sl).call(this)}
|
|
2446
2552
|
${this.config.removePoweredBy?this.config.disclaimer?h`
|
|
2447
2553
|
<!-- spacing between input box and disclaimer or bottom -->
|
|
2448
2554
|
<div class="mt-1.5">
|
|
@@ -2457,41 +2563,41 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
2457
2563
|
</div>
|
|
2458
2564
|
</div>
|
|
2459
2565
|
</div>
|
|
2460
|
-
`}reloadConfig(){o(this,j).value?.reloadConfig(),this.requestUpdate()}async sendMessage(r){if(
|
|
2566
|
+
`}reloadConfig(){o(this,j).value?.reloadConfig(),this.requestUpdate()}async sendMessage(r){if(me(o(this,j).value,"widget context is required"),!r||typeof r!="string")return console.warn("sendMessage requires a valid string message"),!1;let n=await o(this,j).value.enqueueUserInput(r,{xUserData:o(this,j).value?.xUserData,xCustomInstructions:o(this,j).value?.xCustomInstructions,role:"user",expectStreaming:!0});return n&&o(this,D,Nt)?.setValue(""),n??!1}setInputValue(r){if(!r||typeof r!="string"){console.warn("setInputValue requires a valid string value");return}let n=o(this,D,Nt);if(!n){console.warn("input element not found, cannot set value");return}n.setValue?n.setValue(r):console.warn("input element does not have setValue method")}focusInput(){window.requestAnimationFrame(()=>{o(this,D,Nt)?.focus()})}reset(){this._currentRequestInputIndex=0,g(this,Oe,[]),o(this,j).value?.reset()}};j=new WeakMap,Oe=new WeakMap,pi=new WeakMap,pe=new WeakMap,Nr=new WeakMap,oo=new WeakMap,ao=new WeakMap,lo=new WeakMap,D=new WeakSet,Cu=function(r){let i=r.composedPath().find(s=>s instanceof HTMLAnchorElement);if(i){if(r.preventDefault(),this.callbacks.onUserClickedLink?.({widgetId:this.widgetId,url:i.href,conversationId:this.conversationId}),window.self!==window.top){window.open(i.href,"_blank");return}let a=this.config?.linksNewTab?"_blank":"_self";window.open(i.href,i.target||a)}},$u=function(r){if(me(o(this,j).value,"widget context is required"),this.isStreaming)return;r.preventDefault();let n=r.detail.example;o(this,j).value.enqueueUserInput(n,{xUserData:o(this,j).value?.xUserData,xCustomInstructions:o(this,j).value?.xCustomInstructions}).then(i=>{i&&(o(this,D,Nt)?.setValue(""),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:n,example:!0,conversationId:this.conversationId}))}).catch(console.warn)},Su=function(r){if(me(o(this,j).value,"widget context is required"),r.preventDefault(),this.config?.enableImageUpload&&o(this,pe).hasPendingImages)return;let n=r.detail;o(this,j).value.enqueueUserInput(n,{xUserData:o(this,j).value?.xUserData,xCustomInstructions:o(this,j).value?.xCustomInstructions}).then(i=>{i&&(o(this,D,Nt)?.setValue(""),o(this,pe).clearImages(),o(this,pi).typingStopped(),this.callbacks.onUserSentInput?.({widgetId:this.widgetId,text:n,example:!1,conversationId:this.conversationId}))}).catch(console.warn)},Eu=function(r){o(this,pi).onInput(r.detail.full)},_u=function(){me(o(this,j).value,"widget context is required"),o(this,j).value.sendUserCancel(),this.callbacks.onUserCanceledStreaming?.({widgetId:this.widgetId})},so=function(){me(o(this,j).value,"widget context is required"),this._currentRequestInputIndex=0,g(this,Oe,[]),o(this,j).value.reset()},Mu=function(){this.dispatchEvent(new co.CloseClickEvent)},Sl=function(){return h`
|
|
2461
2567
|
<mw-chat-input
|
|
2462
|
-
@mw:change="${
|
|
2463
|
-
@mw:submit="${
|
|
2464
|
-
@mw:cancel="${
|
|
2568
|
+
@mw:change="${f(this,D,Eu)}"
|
|
2569
|
+
@mw:submit="${f(this,D,Su)}"
|
|
2570
|
+
@mw:cancel="${f(this,D,_u)}"
|
|
2465
2571
|
placeholder="${this.config?.input?.placeholder??""}"
|
|
2466
|
-
?disabled="${this.ranOutOfCredits||this.hasQueuedMessages||o(this,
|
|
2572
|
+
?disabled="${this.ranOutOfCredits||this.hasQueuedMessages||o(this,pe).hasPendingImages}"
|
|
2467
2573
|
?streaming="${this.isStreaming??!0}"
|
|
2468
|
-
?loading="${this.hasQueuedMessages||o(this,
|
|
2574
|
+
?loading="${this.hasQueuedMessages||o(this,pe).hasPendingImages}"
|
|
2469
2575
|
?enableImageUpload="${this.config?.enableImageUpload&&!this.ranOutOfCredits}"
|
|
2470
2576
|
color="${this.config?.color??""}"
|
|
2471
|
-
.onImageUploadClick="${this.config?.enableImageUpload?o(this,
|
|
2472
|
-
.images="${this.config?.enableImageUpload?o(this,
|
|
2473
|
-
.onImageDelete="${this.config?.enableImageUpload?o(this,
|
|
2577
|
+
.onImageUploadClick="${this.config?.enableImageUpload?o(this,pe).openImagePicker:void 0}"
|
|
2578
|
+
.images="${this.config?.enableImageUpload?o(this,pe).selectedImages:[]}"
|
|
2579
|
+
.onImageDelete="${this.config?.enableImageUpload?o(this,pe).onImageDelete:void 0}">
|
|
2474
2580
|
</mw-chat-input>
|
|
2475
|
-
`},
|
|
2581
|
+
`},Bp=function(){return h`
|
|
2476
2582
|
<div
|
|
2477
2583
|
class="focus-within:ring-opacity-50 min-h-[32px] 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.config?.color??"#000"}]">
|
|
2478
2584
|
<button
|
|
2479
|
-
@click="${
|
|
2585
|
+
@click="${f(this,D,so)}"
|
|
2480
2586
|
class="flex w-full items-center justify-center gap-2 rounded-2xl bg-white px-6 py-3 font-medium text-black shadow-sm transition-colors hover:bg-gray-50">
|
|
2481
2587
|
<lucide-icon name="plus" class="h-5 w-5"></lucide-icon>
|
|
2482
2588
|
<span>Start New Conversation</span>
|
|
2483
2589
|
</button>
|
|
2484
2590
|
</div>
|
|
2485
|
-
`},
|
|
2486
|
-
<mw-request-input .title="${n.title}" .type="${n.type}" .color="${this.config?.color??"#8B5CF6"}" @mw-request-input:submit="${
|
|
2591
|
+
`},Au=function(r){if(r.length===0||this._currentRequestInputIndex>=r.length)return f(this,D,Sl).call(this);let n=r[this._currentRequestInputIndex];return h`
|
|
2592
|
+
<mw-request-input .title="${n.title}" .type="${n.type}" .color="${this.config?.color??"#8B5CF6"}" @mw-request-input:submit="${f(this,D,Iu)}">
|
|
2487
2593
|
</mw-request-input>
|
|
2488
|
-
`},
|
|
2594
|
+
`},Iu=function(r){me(o(this,j).value,"widget context is required");let n=o(this,D,ui),i=n[this._currentRequestInputIndex];if(!i){console.warn("no current state found for request input");return}switch(r.detail.type){case"star-rating":{let{rating:s,type:a}=r.detail;o(this,Oe).push({type:a,rating:s,id:i.id,title:i.title});break}case"binary-vote":{let{vote:s,type:a}=r.detail;o(this,Oe).push({type:a,vote:s,id:i.id,title:i.title});break}case"new-conversation-button":{f(this,D,so).call(this),this.requestUpdate();return}default:console.warn("unknown request input type",r.detail);return}this._currentRequestInputIndex+=1,this._currentRequestInputIndex>=n.length&&f(this,D,Lu).call(this),this.requestUpdate()},Lu=async function(){if(me(o(this,j).value,"widget context is required"),o(this,Oe).length===0)return;if(!o(this,j).value.lastMsg?.id){console.warn("cannot submit request inputs without message ID");return}await o(this,j).value.enqueueUserInput("",{role:"user",expectStreaming:!1,requestInputResponse:o(this,Oe)})&&g(this,Oe,[]),this.requestUpdate()},ui=function(){me(o(this,j).value,"widget context is required");let r=o(this,j).value.lastMsg;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)||!Vp.includes(i.data.type)?null:{title:i.data.title,type:i.data.type,id:i.data.id}).filter(i=>i!==null)},ju=function(){let r=o(this,D,ui).length;return r===0?!1:o(this,Oe).length<r},Hp=function(){return this.renderRoot.querySelector("#scrollable-content")},Nt=function(){return this.renderRoot.querySelector("mw-chat-input")},w(co,"properties",{showClose:{type:Boolean,attribute:"show-close"},_currentRequestInputIndex:{type:Number,state:!0}});var hi=co,$l;hi.CloseClickEvent=($l=class extends CustomEvent{constructor(e={}){super(hi.CloseClickEvent.type,{...e})}},w($l,"type","mw:close-click"),$l);customElements.get("mw-chat")||customElements.define("mw-chat",hi);var Wr,Tu,Du,Zr=class Zr extends _($){constructor(){super();d(this,Wr);w(this,"render",()=>h`
|
|
2489
2595
|
<div class="popup-desktop group relative w-[300px] cursor-pointer rounded-[17px] shadow-2xl select-none">
|
|
2490
2596
|
<mw-spinning-border .color="${this.color}" .border="${"transparent"}" .radius="${"17px"}">
|
|
2491
2597
|
<!-- wrapper -->
|
|
2492
2598
|
<div class="relative z-[2147483647] m-[1px] w-[300px] rounded-2xl bg-white font-sans text-base leading-normal">
|
|
2493
2599
|
<!-- content -->
|
|
2494
|
-
<div class="p-4 text-left text-gray-800" @click="${
|
|
2600
|
+
<div class="p-4 text-left text-gray-800" @click="${f(this,Wr,Du)}">
|
|
2495
2601
|
<p>${this.text}</p>
|
|
2496
2602
|
</div>
|
|
2497
2603
|
</div>
|
|
@@ -2500,12 +2606,12 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
2500
2606
|
<!-- close button -->
|
|
2501
2607
|
<button
|
|
2502
2608
|
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"
|
|
2503
|
-
@click="${
|
|
2609
|
+
@click="${f(this,Wr,Tu)}"
|
|
2504
2610
|
aria-label="Close">
|
|
2505
2611
|
×
|
|
2506
2612
|
</button>
|
|
2507
2613
|
</div>
|
|
2508
|
-
`);this.text="Hello there. How can we help?",this.color="#601feb"}};
|
|
2614
|
+
`);this.text="Hello there. How can we help?",this.color="#601feb"}};Wr=new WeakSet,Tu=function(){this.dispatchEvent(new Zr.CloseEvent)},Du=function(){this.dispatchEvent(new Zr.ClickEvent)},w(Zr,"properties",{text:{type:String},color:{type:String}}),w(Zr,"styles",H`
|
|
2509
2615
|
.popup-desktop:hover button {
|
|
2510
2616
|
transition-delay: 0s !important;
|
|
2511
2617
|
}
|
|
@@ -2513,19 +2619,19 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
2513
2619
|
.popup-desktop button {
|
|
2514
2620
|
transition-delay: 1s;
|
|
2515
2621
|
}
|
|
2516
|
-
`);var
|
|
2622
|
+
`);var Zt=Zr,El;Zt.CloseEvent=(El=class extends CustomEvent{constructor(e={}){super(Zt.CloseEvent.type,{...e})}},w(El,"type","mw:close"),El);var _l;Zt.ClickEvent=(_l=class extends CustomEvent{constructor(e={}){super(Zt.ClickEvent.type,{...e})}},w(_l,"type","mw:click"),_l);customElements.get("mw-popup-desktop")||customElements.define("mw-popup-desktop",Zt);var Gr,Ou,Pu,di=class di extends _($){constructor(){super();d(this,Gr);w(this,"render",()=>h`
|
|
2517
2623
|
<!-- wrapper -->
|
|
2518
2624
|
<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">
|
|
2519
2625
|
<!-- close button -->
|
|
2520
2626
|
<button
|
|
2521
2627
|
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"
|
|
2522
|
-
@click="${
|
|
2628
|
+
@click="${f(this,Gr,Ou)}"
|
|
2523
2629
|
aria-label="Close">
|
|
2524
2630
|
×
|
|
2525
2631
|
</button>
|
|
2526
2632
|
|
|
2527
2633
|
<!-- content -->
|
|
2528
|
-
<div class="p-4 text-gray-800" @click="${
|
|
2634
|
+
<div class="p-4 text-gray-800" @click="${f(this,Gr,Pu)}">
|
|
2529
2635
|
<h1 class="font-display mr-8 py-2.5 text-left text-lg font-bold">${this.title}</h1>
|
|
2530
2636
|
<p class="py-2.5 text-left">${this.text}</p>
|
|
2531
2637
|
<div class="h-4"></div>
|
|
@@ -2538,30 +2644,30 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
2538
2644
|
<!-- can append any other content -->
|
|
2539
2645
|
<slot name="footer"></slot>
|
|
2540
2646
|
</div>
|
|
2541
|
-
`);this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}};
|
|
2647
|
+
`);this.title="Chat with Molin AI",this.text="Hello there. How can we help?",this.button="Chat now",this.color="#601feb"}};Gr=new WeakSet,Ou=function(){this.dispatchEvent(new di.CloseEvent)},Pu=function(){this.dispatchEvent(new di.ClickEvent)},w(di,"properties",{title:{type:String},text:{type:String},button:{type:String},color:{type:String}});var Wt=di,Ml;Wt.CloseEvent=(Ml=class extends CustomEvent{constructor(e={}){super(Wt.CloseEvent.type,{...e})}},w(Ml,"type","mw:close"),Ml);var Al;Wt.ClickEvent=(Al=class extends CustomEvent{constructor(e={}){super(Wt.ClickEvent.type,{...e})}},w(Al,"type","mw:click"),Al);customElements.get("mw-popup-mobile")||customElements.define("mw-popup-mobile",Wt);var Jr,fi,Gt,uo=class{constructor(e,r){d(this,Jr);d(this,fi,!1);d(this,Gt,()=>{o(this,fi)||(o(this,Jr).userFirstInteracted?.(),g(this,fi,!0)),o(this,Jr).userInteracted?.()});g(this,Jr,r),e.addController(this)}hostConnected(){this.startListening()}hostDisconnected(){this.stopListening()}startListening(){window.addEventListener("click",o(this,Gt)),window.addEventListener("keydown",o(this,Gt))}stopListening(){window.removeEventListener("click",o(this,Gt)),window.removeEventListener("keydown",o(this,Gt))}};Jr=new WeakMap,fi=new WeakMap,Gt=new WeakMap;var qp=1440*60*1e3,Kr,Ce,Jt,mi,Kt,gi,po,Uu,ho=class{constructor(e,r,n=Date){d(this,po);d(this,Kr);d(this,Ce);d(this,Jt);d(this,mi);d(this,Kt,!1);d(this,gi,!1);g(this,Kr,e),g(this,Ce,r),g(this,Jt,n),e.addController(this)}get showing(){return o(this,Kt)}hostDisconnected(){this.abortAutoShowTimer()}show({sound:e}={}){if(this.abortAutoShowTimer(),!o(this,Kt)&&(g(this,Kt,!0),o(this,Kr).requestUpdate(),e)){o(this,Ce).playPopupSound();let r=o(this,Ce).getPersistedState();o(this,Ce).setPersistedState({...r,playedSoundOnce:!0})}}hide(){g(this,gi,!0),this.abortAutoShowTimer(),g(this,Kt,!1),o(this,Kr).requestUpdate()}abortAutoShowTimer(){clearTimeout(o(this,mi))}onCloseClick(){let e=o(this,Ce).getPersistedState();o(this,Ce).setPersistedState({...e,userDismissedAt:o(this,Jt).now()}),this.hide()}onContentClick(){let e=o(this,Ce).getPersistedState();o(this,Ce).setPersistedState({...e,userDismissedAt:o(this,Jt).now()}),this.hide()}userFirstInteracted(){this.abortAutoShowTimer(),o(this,gi)||g(this,mi,setTimeout(()=>f(this,po,Uu).call(this),o(this,Ce).getDelayMs()))}};Kr=new WeakMap,Ce=new WeakMap,Jt=new WeakMap,mi=new WeakMap,Kt=new WeakMap,gi=new WeakMap,po=new WeakSet,Uu=function(){let e=o(this,Ce).getPersistedState(),r=!!e?.playedSoundOnce;e?.userDismissedAt&&o(this,Jt).now()-e.userDismissedAt<qp||this.show({sound:!r})};var ft,jl,Qe,fo,Ll,mo=class mo extends _($){constructor(){super();d(this,Qe);d(this,ft,new ho(this,{getDelayMs:()=>this.delayMs,playPopupSound:()=>{this.soundUrl&&new Audio(this.soundUrl).play().then(()=>{}).catch(r=>{console.error("Error playing audio:",r,{})})},setPersistedState:r=>{r?localStorage.setItem("_molin_popup",JSON.stringify(r)):localStorage.removeItem("_molin_popup")},getPersistedState:()=>{let r=localStorage.getItem("_molin_popup");try{return r?JSON.parse(r):null}catch{return null}}}));d(this,jl,new uo(this,o(this,ft)));this.positionClasses="",this.delayMs=0,this.soundUrl="",this.content={desktop:{text:"",color:""},mobile:{title:"",text:"",button:"",color:"",poweredBy:!0}}}render(){let r=o(this,ft).showing?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3",n=this.content;return h`
|
|
2542
2648
|
<!-- mobile shadow backdrop -->
|
|
2543
|
-
<div @click="${
|
|
2649
|
+
<div @click="${f(this,Qe,fo)}" class="${r} fixed inset-0 z-[2147483647] bg-black/50 transition-[opacity,visibility] sm:hidden"></div>
|
|
2544
2650
|
|
|
2545
2651
|
<!-- mobile overlay -->
|
|
2546
2652
|
<div class="${r} fixed right-0 bottom-0 left-0 z-[2147483647] sm:hidden">
|
|
2547
|
-
<mw-popup-mobile title="${n.mobile.title}" text="${n.mobile.text}" button="${n.mobile.button}" color="${n.mobile.color}" @mw:click="${
|
|
2653
|
+
<mw-popup-mobile title="${n.mobile.title}" text="${n.mobile.text}" button="${n.mobile.button}" color="${n.mobile.color}" @mw:click="${f(this,Qe,Ll)}" @mw:close="${f(this,Qe,fo)}">
|
|
2548
2654
|
${n.mobile.poweredBy?h`<mw-powered-by class="block p-4" slot="footer"></mw-powered-by>`:null}
|
|
2549
2655
|
</mw-popup-mobile>
|
|
2550
2656
|
</div>
|
|
2551
2657
|
|
|
2552
2658
|
<!-- desktop -->
|
|
2553
2659
|
<div class="${r} ${this.positionClasses} fixed z-[2147483647] transition-[opacity,translate,visibility] max-sm:hidden">
|
|
2554
|
-
<mw-popup-desktop color="${n.desktop.color}" text="${n.desktop.text}" @mw:click="${
|
|
2660
|
+
<mw-popup-desktop color="${n.desktop.color}" text="${n.desktop.text}" @mw:click="${f(this,Qe,Ll)}" @mw:close="${f(this,Qe,fo)}"></mw-popup-desktop>
|
|
2555
2661
|
</div>
|
|
2556
|
-
`}hide(){o(this,
|
|
2662
|
+
`}hide(){o(this,ft).hide()}};ft=new WeakMap,jl=new WeakMap,Qe=new WeakSet,fo=function(){o(this,ft).onCloseClick()},Ll=function(){this.dispatchEvent(new mo.ClickEvent),o(this,ft).onContentClick()},w(mo,"properties",{positionClasses:{type:String,attribute:"position"},delayMs:{type:Number,attribute:"delay"},soundUrl:{type:String,attribute:"sound"},content:{type:Object}});var wi=mo,Il;wi.ClickEvent=(Il=class extends CustomEvent{constructor(e={}){super(wi.ClickEvent.type,{...e})}},w(Il,"type","mw:click"),Il);customElements.get("mw-popup")||customElements.define("mw-popup",wi);var wo,Ru,go=class extends _($){constructor(){super();d(this,wo);w(this,"render",()=>h`
|
|
2557
2663
|
<span class="relative inline-flex">
|
|
2558
2664
|
<slot></slot>
|
|
2559
|
-
<span class="${o(this,
|
|
2665
|
+
<span class="${o(this,wo,Ru)} pointer-events-none absolute z-10 flex h-3 w-3">
|
|
2560
2666
|
<span class="bg-${this.color} absolute inline-flex h-3 w-3 animate-ping rounded-full opacity-75"></span>
|
|
2561
2667
|
<span class="bg-${this.color} relative inline-flex h-3 w-3 rounded-full"></span>
|
|
2562
2668
|
</span>
|
|
2563
2669
|
</span>
|
|
2564
|
-
`);this.color="sky-500",this.position="top-right"}};
|
|
2670
|
+
`);this.color="sky-500",this.position="top-right"}};wo=new WeakSet,Ru=function(){switch(this.position){case"top-left":return"top-0 left-0 -mt-1 -ml-1";case"top-right":return"top-0 right-0 -mt-1 -mr-1";case"bottom-left":return"bottom-0 left-0 -mb-1 -ml-1";case"bottom-right":return"bottom-0 right-0 -mb-1 -mr-1";default:throw new Error(`Invalid position: ${this.position}`)}},w(go,"properties",{color:{type:String,attribute:"color"},position:{type:String,attribute:"position"}});customElements.get("mw-pulse-dot")||customElements.define("mw-pulse-dot",go);var vo=class extends _($){constructor(){super();w(this,"render",()=>h`
|
|
2565
2671
|
<div class="${this.positionClasses} fixed right-6 bottom-24 z-10 flex animate-bounce flex-col items-center justify-center font-sans text-base">
|
|
2566
2672
|
<p class="mb-2 -translate-x-4 -rotate-12 transform text-lg leading-normal font-bold text-gray-800">${this.text}</p>
|
|
2567
2673
|
|
|
@@ -2574,7 +2680,7 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
2574
2680
|
stroke-linecap="round"></path>
|
|
2575
2681
|
</svg>
|
|
2576
2682
|
</div>
|
|
2577
|
-
`);this.positionClasses="",this.text="Try it out"}};w(
|
|
2683
|
+
`);this.positionClasses="",this.text="Try it out"}};w(vo,"properties",{positionClasses:{type:String,attribute:"position"},text:{type:String}});customElements.get("mw-try-it-out")||customElements.define("mw-try-it-out",vo);var yo,vi=class extends _($){constructor(){super();d(this,yo,new dt(this,{onError:console.error}));this.cdn="https://widget.molin.ai",this.widgetId="",this.state="open"}get config(){return o(this,yo).data}render(){return this.config?h`
|
|
2578
2684
|
<!-- embed our bubble component forwarding props -->
|
|
2579
2685
|
<!-- these props are never internally updated by mw-bubble so we pass them down only one way -->
|
|
2580
2686
|
<mw-bubble
|
|
@@ -2582,38 +2688,38 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
2582
2688
|
.color="${this.config?.bubble?.color||this.config?.color}"
|
|
2583
2689
|
.bubbleStyle="${this.config?.bubble?.style}"
|
|
2584
2690
|
.src="${this.config?.bubble?.bubbleUrl}"
|
|
2585
|
-
width="${
|
|
2586
|
-
height="${
|
|
2587
|
-
`:null}};
|
|
2691
|
+
width="${ue(this.config?.bubble?.size?.width)}"
|
|
2692
|
+
height="${ue(this.config?.bubble?.size?.height)}"></mw-bubble>
|
|
2693
|
+
`:null}};yo=new WeakMap,w(vi,"styles",H`
|
|
2588
2694
|
:host {
|
|
2589
2695
|
all: initial; /* reset all properties that can pierce the shadow DOM */
|
|
2590
2696
|
}
|
|
2591
|
-
`),w(
|
|
2697
|
+
`),w(vi,"properties",{cdn:{type:String},widgetId:{type:String,attribute:"widget"},state:{type:String}});customElements.get("molin-shop-ai-launcher")||customElements.define("molin-shop-ai-launcher",vi);var kw="navigator"in globalThis&&/Mobi|Android|iPhone/i.test(navigator.userAgent),Cw="navigator"in globalThis&&"share"in navigator,zp=Object.freeze({sm:640,md:768,lg:1024,xl:1280,"2xl":1536});function Fp(t){if(typeof window>"u")return!1;let e=zp[t];return typeof e!="number"?(console.warn(`Invalid breakpoint: ${t}`),!1):window.matchMedia(`(min-width: ${e}px)`).matches}function Tl(){return Fp("sm")}var bo,Yr,Xr,Yt,yi,ko,xo=class{constructor(e,r,n,i=window.history){d(this,bo);d(this,Yr);d(this,Xr);d(this,Yt);d(this,yi,!1);d(this,ko,()=>{o(this,Yr).test(window.location.pathname)&&o(this,Xr).navigated()});g(this,bo,e),g(this,Yr,r),g(this,Xr,n),g(this,Yt,i),e.addController(this)}hostConnected(){o(this,ko).call(this);let e=o(this,Yt).pushState;o(this,Yt).pushState=(...r)=>{if(e.call(o(this,Yt),...r),!o(this,yi))try{let n=new URL(r[2],window.location.origin);o(this,Yr).test(n.pathname)&&o(this,Xr).navigated()}catch{}}}hostDisconnected(){g(this,yi,!0)}};bo=new WeakMap,Yr=new WeakMap,Xr=new WeakMap,Yt=new WeakMap,yi=new WeakMap,ko=new WeakMap;function Vu({minMs:t,maxMs:e}){return Math.random()*(e-t)+t}function Co(t,e=""){return Object.entries(t).filter(([r,n])=>n).map(([r,n])=>`${e}${r}-[${n}]`).join(" ")}function Bu(t,e={}){return[Co(t),Co(e,"max-sm:")].join(" ")}function Hu(t){return Co(t)}function qu(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 zu(t){let e=Co(t),n=`sm:bottom-[${t.bottom?`calc(${t.bottom}+72px)`:"72px"}]`;return[e,n].filter(Boolean).join(" ")}var Qr,en,xi,bi,ki,$o,Dl=class{constructor(e,r,{threshold:n=5}={}){d(this,Qr,0);d(this,en,!1);d(this,xi);d(this,bi);d(this,ki,()=>{o(this,en)||(requestAnimationFrame(o(this,$o)),g(this,en,!0))});d(this,$o,()=>{let e=window.scrollY,r=e-o(this,Qr);if(Math.abs(r)>=o(this,bi)){let n=r>0?"down":"up";o(this,xi).call(this,{scrollY:e,direction:n,deltaY:Math.abs(r)}),g(this,Qr,e)}g(this,en,!1)});g(this,xi,r),g(this,bi,n),e.addController(this)}hostConnected(){g(this,Qr,window.scrollY),window.addEventListener("scroll",o(this,ki),{passive:!0})}hostDisconnected(){window.removeEventListener("scroll",o(this,ki))}};Qr=new WeakMap,en=new WeakMap,xi=new WeakMap,bi=new WeakMap,ki=new WeakMap,$o=new WeakMap;function Fu(t,e,r){return new Dl(t,e,r)}var So,ql,$i,zl,et,Eo,I,Ol,Pl,Ul,Ci,mt,Rl,Nu,Zu,Wu,_o,Vl,Bl,Hl,Xt,De=class extends _($){constructor(){super();d(this,I);d(this,So,new dt(this,{onError:console.error}));d(this,ql,Fu(this,r=>{o(this,I,Pl)&&!this._dialogShown&&(r.direction==="down"?this._floatingInputVisible=!1:r.direction==="up"&&(this._floatingInputVisible=!0),this.requestUpdate())},{threshold:20}));d(this,$i);d(this,zl,new xo(this,/.*/i,{navigated:()=>{if(this.requestUpdate(),!this.widgetId){console.warn("No widgetId set, cannot track page view");return}let r=o(this,I,mt)?.conversationId,n=pr.restore(this.widgetId)?.conversationId,i=r||n;i&&q("ShopAssistant: pageview",{widgetId:this.widgetId,conversationId:i,url:document.location.href,title:document.title,hidden:this.config?this.config.hidden||!1:void 0,shouldHideForCurrentUrl:o(this,I,Ul)})}}));d(this,et,!1);d(this,Eo,{onError:r=>{alert(r.error),console.error(r.widgetId,r.error),q("ShopAssistant: error",{...r},{immediate:!0})},onNewMessageStartedStreaming:r=>{q("ShopAssistant: user received bot message (streaming started)",r)},onMessageEndedStreaming:r=>{q("ShopAssistant: user received bot message (streaming ended)",r)},onUserCanceledStreaming:r=>{q("ShopAssistant: user canceled streaming",r)},onUserClickedLink:r=>{q("ShopAssistant: user clicked link",r)},onUserSentInput:r=>{q("ShopAssistant: user sent input",r)},onWaitGameQuestionAnswered:r=>{q("ShopAssistant: wait game question answered",r)},onWaitGameCompleted:r=>{q("ShopAssistant: wait game completed",r)}});d(this,_o,r=>{let n=r.detail.text,i=o(this,I,Rl);i&&typeof i.connect=="function"&&i.connect(),this._dialogShown=!0,g(this,et,!0),this.requestUpdate(),f(this,I,Xt).call(this,!0),setTimeout(()=>{f(this,I,Hl).call(this,n),f(this,I,Bl).call(this,n).catch(console.warn)},100),q("ShopAssistant: user sent input",{widgetId:this.widgetId,text:n,example:!1,conversationId:o(this,I,mt)?.conversationId||"",source:"ask-ai"})});this.cdn="https://widget.molin.ai",this.widgetId="",this._floatingInputVisible=!0,this._dialogShown=!1,this.xUserData=pt()?.userData,this.xCustomInstructions=pt()?.customInstructions}get config(){return o(this,$i)||o(this,So).data}render(){if(!this.config)return null;let r=Bu(this.config.bubble.position,this.config.bubble.mobilePosition),n=Hu(this.config.bubble.position),i=qu(this.config.bubble.position),s=zu(this.config.bubble.position);return this.config.hidden||io().hidden||o(this,I,Ul)?null:h`
|
|
2592
2698
|
<mw-context-widget
|
|
2593
2699
|
.widgetId="${this.widgetId}"
|
|
2594
2700
|
.config="${this.config}"
|
|
2595
|
-
.callbacks="${o(this,
|
|
2701
|
+
.callbacks="${o(this,Eo)}"
|
|
2596
2702
|
.xUserData="${this.xUserData}"
|
|
2597
2703
|
.xCustomInstructions="${this.xCustomInstructions}"
|
|
2598
|
-
.autoConnect="${o(this,
|
|
2704
|
+
.autoConnect="${o(this,et)}">
|
|
2599
2705
|
<mw-bubble
|
|
2600
|
-
class="${r} ${this._dialogShown?"opacity-0":"opacity-100"} fixed z-[${o(this,I,
|
|
2601
|
-
@click="${
|
|
2706
|
+
class="${r} ${this._dialogShown?"opacity-0":"opacity-100"} fixed z-[${o(this,I,Ol)}] transition-opacity"
|
|
2707
|
+
@click="${f(this,I,Zu)}"
|
|
2602
2708
|
state="${this._dialogShown?"close":"open"}"
|
|
2603
2709
|
.color="${this.config?.bubble?.color||this.config?.color}"
|
|
2604
2710
|
.bubbleStyle="${this.config?.bubble?.style}"
|
|
2605
2711
|
.src="${this.config?.bubble?.bubbleUrl}"
|
|
2606
|
-
width="${
|
|
2607
|
-
height="${
|
|
2712
|
+
width="${ue(this.config?.bubble?.size?.width)}"
|
|
2713
|
+
height="${ue(this.config?.bubble?.size?.height)}"></mw-bubble>
|
|
2608
2714
|
|
|
2609
2715
|
<!-- only load the component if enabled on any platform -->
|
|
2610
2716
|
${this.isPopupEnabled?h`
|
|
2611
2717
|
<mw-popup
|
|
2612
2718
|
position="${s}"
|
|
2613
|
-
delay="${this.config.popup?.delayMs||
|
|
2719
|
+
delay="${this.config.popup?.delayMs||Vu({minMs:2e3,maxMs:5e3})}"
|
|
2614
2720
|
sound="${this.config.popup?.muteSounds?"":this.config.popup?.soundUrl||""}"
|
|
2615
2721
|
.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}}}"
|
|
2616
|
-
@mw:click="${
|
|
2722
|
+
@mw:click="${f(this,I,Nu)}"></mw-popup>
|
|
2617
2723
|
`:null}
|
|
2618
2724
|
|
|
2619
2725
|
<!-- show "Try it out" if enabled (even if the chat window is showing) -->
|
|
@@ -2625,27 +2731,27 @@ var ku=Object.create;var mo=Object.defineProperty;var Cu=Object.getOwnPropertyDe
|
|
|
2625
2731
|
<!-- 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. -->
|
|
2626
2732
|
<div
|
|
2627
2733
|
class="${this._dialogShown?"visible opacity-100 translate-y-0":"invisible opacity-0 translate-y-3"} ${i} fixed inset-0 z-[2147483647] bg-white font-sans text-[16px] leading-normal text-gray-800 shadow-2xl transition-all sm:top-auto sm:bottom-[1.5rem] sm:h-[92%] sm:max-h-[800px] sm:w-[calc(100dvh*0.50)] sm:max-w-[400px] sm:min-w-[300px] sm:rounded-[36px] 2xl:max-w-[420px]">
|
|
2628
|
-
<mw-chat ?show-close="${!0}" @mw:close-click="${
|
|
2734
|
+
<mw-chat ?show-close="${!0}" @mw:close-click="${f(this,I,Wu)}">
|
|
2629
2735
|
<slot name="banner" slot="banner"></slot>
|
|
2630
2736
|
</mw-chat>
|
|
2631
2737
|
</div>
|
|
2632
2738
|
|
|
2633
2739
|
<!-- Floating input only visible when enabled, in center, on desktop only -->
|
|
2634
|
-
${this.config?.floatingAskAI?.enabled&&o(this,I,
|
|
2740
|
+
${this.config?.floatingAskAI?.enabled&&o(this,I,Pl)?h`
|
|
2635
2741
|
<mw-floating-ask-ai
|
|
2636
2742
|
?dark="${this.config?.floatingAskAI?.darkMode}"
|
|
2637
2743
|
.color="${this.config.color||this.config?.bubble?.color}"
|
|
2638
|
-
placeholder="${
|
|
2639
|
-
class="${!this._dialogShown&&this._floatingInputVisible?"opacity-100 translate-y-0":"opacity-0 translate-y-full"} fixed left-1/2 z-[${o(this,I,
|
|
2744
|
+
placeholder="${ue(this.config?.floatingAskAI?.placeholder)}"
|
|
2745
|
+
class="${!this._dialogShown&&this._floatingInputVisible?"opacity-100 translate-y-0":"opacity-0 translate-y-full"} fixed left-1/2 z-[${o(this,I,Ol)}] hidden -translate-x-1/2 transition-all duration-300 ease-in-out max-md:hidden sm:block"
|
|
2640
2746
|
style="bottom: ${this.config.bubble.position.bottom||"1.5rem"}"
|
|
2641
|
-
@mw-floating-ask-ai:submit="${o(this,
|
|
2747
|
+
@mw-floating-ask-ai:submit="${o(this,_o)}"></mw-floating-ask-ai>
|
|
2642
2748
|
`:null}
|
|
2643
2749
|
</mw-context-widget>
|
|
2644
|
-
`}get isPopupEnabled(){return
|
|
2750
|
+
`}get isPopupEnabled(){return Tl()?!!this.config?.popup?.desktopEnabled:!!this.config?.popup?.mobileEnabled}updated(){this._dialogShown&&o(this,I,Ci)?.hide(),this._dialogShown&&setTimeout(()=>{o(this,I,mt)?.focusInput()},0)}firstUpdated(){Tl()&&ke.molin_widget_open_state?.isOpen&&!this._dialogShown&&(this._dialogShown=!0,g(this,et,!0),this.requestUpdate())}openChat(r){let{message:n,autoSend:i}=r||{};if(this._dialogShown){f(this,I,Vl).call(this,{message:n,autoSend:i});return}let s=o(this,I,Rl);s&&typeof s.connect=="function"&&s.connect(),this._dialogShown=!0,g(this,et,!0),this.requestUpdate(),f(this,I,Xt).call(this,!0),o(this,I,Ci)?.hide(),setTimeout(()=>{f(this,I,Vl).call(this,{message:n,autoSend:i})},200),q("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(),f(this,I,Xt).call(this,!1),o(this,I,Ci)?.hide(),q("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"programmatic-method",state:this._dialogShown?"open":"close"}))}showLauncher(){let r=io();r.hidden=!1,this.requestUpdate(),q("ShopAssistant: called show launcher",{widgetId:this.widgetId,source:"programmatic-method"})}hideLauncher(){let r=io();r.hidden=!0,this.requestUpdate(),q("ShopAssistant: called hide launcher",{widgetId:this.widgetId,source:"programmatic-method"})}injectConfig(r){g(this,$i,r),this.requestUpdate()}reset(){this.xUserData={},this.xCustomInstructions="",o(this,I,mt)?.reset(),this.requestUpdate()}};So=new WeakMap,ql=new WeakMap,$i=new WeakMap,zl=new WeakMap,et=new WeakMap,Eo=new WeakMap,I=new WeakSet,Ol=function(){return typeof this.config?.bubble?.zIndex=="number"?this.config.bubble.zIndex:2147483647},Pl=function(){return this.config?.floatingAskAI?.enabled||!0},Ul=function(){if(!this.config?.hideUrls||!Array.isArray(this.config.hideUrls))return!1;let r=window.location.href,n=window.location.pathname;return this.config.hideUrls.some(i=>{if(!i||typeof i!="string")return!1;let s=i.endsWith("*"),a=s?i.slice(0,-1):i;return i.startsWith("http")?s?r.startsWith(a):r===a:s?n.startsWith(a):n===a})},Ci=function(){return this.renderRoot.querySelector("mw-popup")},mt=function(){return this.renderRoot.querySelector("mw-chat")},Rl=function(){return this.renderRoot.querySelector("mw-context-widget")},Nu=function(){this._dialogShown=!0,g(this,et,!0),this.requestUpdate(),f(this,I,Xt).call(this,!0),q("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"popup-click",state:this._dialogShown?"open":"close"})},Zu=function(){this._dialogShown=!this._dialogShown,g(this,et,!0),this.requestUpdate(),f(this,I,Xt).call(this,this._dialogShown),o(this,I,Ci)?.hide(),q("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"bubble-toggle",state:this._dialogShown?"open":"close"})},Wu=function(){this._dialogShown=!1,this._floatingInputVisible=!0,this.requestUpdate(),f(this,I,Xt).call(this,!1),q("ShopAssistant: user toggled window",{widgetId:this.widgetId,source:"top-right-close-button",state:this._dialogShown?"open":"close"})},_o=new WeakMap,Vl=function({message:r,autoSend:n=!1}={}){if(!r)return;f(this,I,Hl).call(this,r);let i=o(this,I,mt)?.isLiveMode;i||this.reset(),n&&!i&&f(this,I,Bl).call(this,r).catch(console.warn)},Bl=async function(r){let n=o(this,I,mt);if(!n){console.warn("Chat element not found, cannot send message");return}n.sendMessage?await n.sendMessage(r):console.warn("Chat element does not have sendMessage method")},Hl=function(r){let n=o(this,I,mt);if(!n){console.warn("Chat element not found, cannot set input value");return}n.setInputValue?n.setInputValue(r):console.warn("Chat element does not have setInputValue method")},Xt=function(r){ke.molin_widget_open_state={isOpen:r}},w(De,"styles",H`
|
|
2645
2751
|
:host {
|
|
2646
2752
|
all: initial; /* reset all properties that can pierce the shadow DOM */
|
|
2647
2753
|
}
|
|
2648
|
-
`),w(
|
|
2754
|
+
`),w(De,"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",De);export{De as MolinShopAI};
|
|
2649
2755
|
/*! Bundled license information:
|
|
2650
2756
|
|
|
2651
2757
|
@lit/reactive-element/css-tag.js:
|