@creaditor/newsletter-starterkit
Version:
Creaditor Newsletter Editor - Starterkit for creating beautiful email newsletters
177 lines (173 loc) • 27.1 kB
JavaScript
/*! For license information please see 2475.creaditor.bundle.js.LICENSE.txt */
"use strict";(("undefined"!=typeof self?self:this).webpackChunkCreaditor=("undefined"!=typeof self?self:this).webpackChunkCreaditor||[]).push([[2475],{82979:(t,e,s)=>{var i=s(8427),n=s(62331),o=s(61828),r=s(9085),h=function(t,e,s,i){var n,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,s,i);else for(var h=t.length-1;h>=0;h--)(n=t[h])&&(r=(o<3?n(r):o>3?n(e,s,r):n(e,s))||r);return o>3&&r&&Object.defineProperty(e,s,r),r};let a=class extends i.oi{constructor(){super(),this.removeable=!0,this.inputValue="",this.placeholder="",this.max="50",this.primaryText="#fff",this.primary="#845EC2",this.maxItems=20,this.focused=!1,this.items=[],this.suggestions=[],this.filtered=[],this.opened=!1,this.freeSolo=!0,this.setFocus=this.setFocus.bind(this),this.addItem=this.addItem.bind(this),this.keypress=this.keypress.bind(this),this.onTabClicked=this.onTabClicked.bind(this),this.keyCount=0,this.items=[],this.focused=!1,this.inputRef=(0,o.V)(),this.suggestionElRef=(0,o.V)()}setFocus(){if(this.inputRef.value!==document.activeElement){this.inputRef.value.focus()}}removeItems(t){this.value=this.items[t];const e=[...this.items];e.splice(t,1),this.items=e;const s=new UIEvent("change",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(s)}addItem(t){const e=[...this.items],s=this.inputRef.value;let i;i=t?t.split(","):s.value.split(","),i.forEach((t=>{const i=t.replace(/,/g,"");if(i&&i.trim()&&-1===this.items.findIndex((t=>t.value===i))){if(!this.freeSolo&&-1===this.suggestions.findIndex((t=>t.value===i)))return;e.push({value:i}),s.value="",this.items=e,this.filtered=this.suggestions.filter((t=>t.value.includes(this.inputValue)&&-1===this.items.findIndex((e=>e.value===t.value))));const t=new UIEvent("change",{view:window,bubbles:!0,cancelable:!0});this.dispatchEvent(t)}}))}onTabClicked(t){const e=this.inputRef.value;"Tab"===t.key&&this.focused&&e.value.trim()&&(this.addItem(),t.preventDefault())}keypress(t){","===t.key||"Enter"===t.key?(this.opened=!1,this.addItem()):this.opened=!0;const e=this.inputRef.value;if(0===e.value.length&&"Backspace"===t.key&&this.keyCount++,"Backspace"===t.key&&""===e.value&&this.keyCount>1){this.keyCount=0;const t=[...this.items];t.pop(),this.items=t}this.inputValue=e.value,this.inputValue.trim()?this.filtered=this.suggestions.filter((t=>t.value.includes(this.inputValue)&&-1===this.items.findIndex((e=>e.value===t.value)))):this.filtered=this.suggestions}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this.onTabClicked),setTimeout((()=>{this.filtered=this.suggestions.filter((t=>t.value.includes(this.inputValue)&&-1===this.items.findIndex((e=>e.value===t.value))))}),50)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.onTabClicked)}render(){return i.dy`<div class="container" =${this.setFocus}>
<span
>${(0,r.r)(this.items,(t=>t.value),((t,e)=>i.dy`<div
.style="background:${this.primary};color:${this.primaryText}"
class="chips"
>
<div>
${t.value}
${this.removeable?i.dy`<button
=${()=>this.removeItems(e)}
class="remove_button"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
width="13"
height="20"
fill="${this.primaryText}"
>
<path fill="none" d="M0 0h24v24H0z" />
<path
d="M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"
/>
</svg>
</button>`:null}
</div>
</div>`))}
<input
dir="auto"
${(0,o.i)(this.inputRef)}
.placeholder=${this.placeholder}
.max=${this.max}
=${this.keypress}
=${()=>{this.focused=!0,this.suggestions.length>0&&setTimeout((()=>{this.opened=!0}),200)}}
=${()=>{this.focused=!1,setTimeout((()=>{this.opened=!1}),200)}}
/></span>
</div>`}};a.styles=i.iv`
.full-width {
width: 100%;
}
.container {
border: 1px solid grey;
border-radius: 0.25rem;
line-height: 1.5;
background: padding-box rgb(255, 255, 255);
outline: 1px solid transparent;
font-family: Arial, Helvetica, sans-serif;
box-sizing: border-box;
position: relative;
}
.container:focus {
border-color: blue;
}
.suggestion-btn {
background: #fff;
}
.suggestion-btn:hover {
background: #f5f5f5;
}
.suggestions-holder {
position: absolute;
top: 105%;
left: 0;
width: 100%;
height: 100%;
background-color: #fff;
/* transition: all 0.3s ease-in-out; */
}
.suggestions-content {
top: 105%;
left: 0;
max-height: 400px;
overflow-y: auto;
overflow-x: hidden;
max-width: 400px;
width: 100%;
padding: 10px;
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
z-index: 99;
}
.chips {
border-radius: 30px;
padding: 0 28px;
background-color: blue;
color: #fff;
display: inline-block;
margin: 5px;
position: relative;
font-family: Arial, Helvetica, sans-serif;
font-size: 14px;
animation: jackInTheBox 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
jackInTheBox {
from {
opacity: 0;
transform: scale(0.1) rotate(30deg);
transform-origin: center bottom;
}
50% {
transform: rotate(-10deg);
}
70% {
transform: rotate(3deg);
}
to {
opacity: 1;
transform: scale(1);
}
}
.remove_button {
padding: 1px;
background-color: #484553a6;
border-radius: 100%;
height: 17px;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
right: 2px;
top: 50%;
transform: translateY(-50%);
transition: transform 0.2s ease-in-out;
}
.remove_button:hover {
transform: translateY(-50%) scale(1.2);
}
input {
height: 30px;
display: inline-block;
padding: 10px;
font-size: 14px;
font-weight: 400;
line-height: 1.5;
color: #212529;
background: #fff;
background-clip: padding-box;
border: 1px solid #ced4da;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
margin: 0;
font-family: Arial;
border: none;
outline: none;
box-sizing: border-box;
}
input:hover {
border: none;
outline: none;
}
button {
position: relative;
display: inline-block;
font-weight: 400;
text-align: center;
white-space: nowrap;
vertical-align: middle;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
border: 1px solid transparent;
font-family: Arial;
padding: 0.375rem 0.35rem;
font-size: 13px;
line-height: 1.5;
border-radius: 3px;
text-transform: none;
transition: color 0.15s ease-in-out, background 0.15s ease-in-out,
border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
`,h([(0,n.Cb)({type:Boolean})],a.prototype,"removeable",void 0),h([(0,n.Cb)({type:String})],a.prototype,"value",void 0),h([(0,n.Cb)({type:String})],a.prototype,"inputValue",void 0),h([(0,n.Cb)({type:String})],a.prototype,"placeholder",void 0),h([(0,n.Cb)({type:String})],a.prototype,"max",void 0),h([(0,n.Cb)({type:String})],a.prototype,"primaryText",void 0),h([(0,n.Cb)({type:String})],a.prototype,"primary",void 0),h([(0,n.Cb)({type:Number})],a.prototype,"maxItems",void 0),h([(0,n.Cb)({type:Boolean})],a.prototype,"focused",void 0),h([(0,n.Cb)({type:Array})],a.prototype,"items",void 0),h([(0,n.Cb)({type:Array})],a.prototype,"suggestions",void 0),h([(0,n.Cb)({type:Array})],a.prototype,"filtered",void 0),h([(0,n.Cb)({type:Boolean})],a.prototype,"opened",void 0),h([(0,n.Cb)({type:Boolean})],a.prototype,"freeSolo",void 0),a=h([(0,n.Mo)("cdtr-chips-input")],a)},62331:(t,e,s)=>{s.d(e,{Mo:()=>i,Cb:()=>o});const i=t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:s,elements:i}=e;return{kind:s,elements:i,finisher(e){customElements.define(t,e)}}})(t,e),n=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(s){s.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(s){s.createProperty(e.key,t)}};function o(t){return(e,s)=>void 0!==s?((t,e,s)=>{e.constructor.createProperty(s,t)})(t,e,s):n(t,e)}var r;null===(r=window.HTMLSlotElement)||void 0===r||r.prototype.assignedElements},9085:(t,e,s)=>{s.d(e,{r:()=>h});var i=s(93311),n=s(47514),o=s(68707);const r=(t,e,s)=>{const i=new Map;for(let n=e;n<=s;n++)i.set(t[n],n);return i},h=(0,n.XM)(class extends n.Xe{constructor(t){if(super(t),t.type!==n.pX.CHILD)throw Error("repeat() can only be used in text expressions")}ht(t,e,s){let i;void 0===s?s=e:void 0!==e&&(i=e);const n=[],o=[];let r=0;for(const e of t)n[r]=i?i(e,r):r,o[r]=s(e,r),r++;return{values:o,keys:n}}render(t,e,s){return this.ht(t,e,s).values}update(t,[e,s,n]){var h;const a=(0,o.i9)(t),{values:l,keys:c}=this.ht(e,s,n);if(!Array.isArray(a))return this.ut=c,l;const d=null!==(h=this.ut)&&void 0!==h?h:this.ut=[],p=[];let u,f,m=0,y=a.length-1,$=0,g=l.length-1;for(;m<=y&&$<=g;)if(null===a[m])m++;else if(null===a[y])y--;else if(d[m]===c[$])p[$]=(0,o.fk)(a[m],l[$]),m++,$++;else if(d[y]===c[g])p[g]=(0,o.fk)(a[y],l[g]),y--,g--;else if(d[m]===c[g])p[g]=(0,o.fk)(a[m],l[g]),(0,o._Y)(t,p[g+1],a[m]),m++,g--;else if(d[y]===c[$])p[$]=(0,o.fk)(a[y],l[$]),(0,o._Y)(t,a[m],a[y]),y--,$++;else if(void 0===u&&(u=r(c,$,g),f=r(d,m,y)),u.has(d[m]))if(u.has(d[y])){const e=f.get(c[$]),s=void 0!==e?a[e]:null;if(null===s){const e=(0,o._Y)(t,a[m]);(0,o.fk)(e,l[$]),p[$]=e}else p[$]=(0,o.fk)(s,l[$]),(0,o._Y)(t,a[m],s),a[e]=null;$++}else(0,o.ws)(a[y]),y--;else(0,o.ws)(a[m]),m++;for(;$<=g;){const e=(0,o._Y)(t,p[g+1]);(0,o.fk)(e,l[$]),p[$++]=e}for(;m<=y;){const t=a[m++];null!==t&&(0,o.ws)(t)}return this.ut=c,(0,o.hl)(t,p),i.Jb}})},3959:(t,e,s)=>{s.d(e,{V:()=>h});var i=s(33692),n=s(50875);const o="important",r=" !"+o,h=(0,n.XM)(class extends n.Xe{constructor(t){if(super(t),t.type!==n.pX.ATTRIBUTE||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,s)=>{const i=t[s];return null==i?e:e+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(t,[e]){const{style:s}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?s.removeProperty(t):s[t]=null);for(const t in e){const i=e[t];if(null!=i){this.ft.add(t);const e="string"==typeof i&&i.endsWith(r);t.includes("-")||e?s.setProperty(t,e?i.slice(0,-11):i,e?o:""):s[t]=i}}return i.Jb}})},78792:(t,e,s)=>{s.d(e,{fl:()=>x,iv:()=>a,Ts:()=>A,Qu:()=>E});const i=globalThis,n=i.ShadowRoot&&(void 0===i.ShadyCSS||i.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),r=new WeakMap;class h{constructor(t,e,s){if(this._$cssResult$=!0,s!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(n&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=r.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&r.set(e,t))}return t}toString(){return this.cssText}}const a=(t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,s,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[i+1]),t[0]);return new h(s,t,o)},l=(t,e)=>{if(n)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const s of e){const e=document.createElement("style"),n=i.litNonce;void 0!==n&&e.setAttribute("nonce",n),e.textContent=s.cssText,t.appendChild(e)}},c=n?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new h("string"==typeof t?t:t+"",void 0,o))(e)})(t):t,{is:d,defineProperty:p,getOwnPropertyDescriptor:u,getOwnPropertyNames:f,getOwnPropertySymbols:m,getPrototypeOf:y}=Object,$=globalThis,g=$.trustedTypes,v=g?g.emptyScript:"",_=$.reactiveElementPolyfillSupport,b=(t,e)=>t,A={toAttribute(t,e){switch(e){case Boolean:t=t?v:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},E=(t,e)=>!d(t,e),w={attribute:!0,type:String,converter:A,reflect:!1,useDefault:!1,hasChanged:E};Symbol.metadata??=Symbol("metadata"),$.litPropertyMetadata??=new WeakMap;class x extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=w){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);void 0!==i&&p(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:n}=u(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:i,set(e){const o=i?.call(this);n?.call(this,e),this.requestUpdate(t,o,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??w}static _$Ei(){if(this.hasOwnProperty(b("elementProperties")))return;const t=y(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(b("properties"))){const t=this.properties,e=[...f(t),...m(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(c(t))}else void 0!==t&&e.push(c(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.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((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return l(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(void 0!==i&&!0===s.reflect){const n=(void 0!==s.converter?.toAttribute?s.converter:A).toAttribute(e,s.type);this._$Em=t,null==n?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){const s=this.constructor,i=s._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=s.getPropertyOptions(i),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:A;this._$Em=i;const o=n.fromAttribute(e,t.type);this[i]=o??this._$Ej?.get(i)??o,this._$Em=null}}requestUpdate(t,e,s){if(void 0!==t){const i=this.constructor,n=this[t];if(s??=i.getPropertyOptions(t),!((s.hasChanged??E)(n,e)||s.useDefault&&s.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,s))))return;this.C(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:i,wrapped:n},o){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??e??this[t]),!0!==n||void 0!==o)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),!0===i&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t){const{wrapped:t}=s,i=this[e];!0!==t||this._$AL.has(e)||void 0===i||this.C(e,void 0,s,i)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM()}updated(t){}firstUpdated(t){}}x.elementStyles=[],x.shadowRootOptions={mode:"open"},x[b("elementProperties")]=new Map,x[b("finalized")]=new Map,_?.({ReactiveElement:x}),($.reactiveElementVersions??=[]).push("2.1.1")},60981:(t,e,s)=>{s.d(e,{Mo:()=>i});const i=t=>(e,s)=>{void 0!==s?s.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)};var n=s(78792);n.Ts,n.Qu},74411:(t,e,s)=>{s.d(e,{oi:()=>V,iv:()=>i.iv,dy:()=>x});var i=s(78792);const n=globalThis,o=n.trustedTypes,r=o?o.createPolicy("lit-html",{createHTML:t=>t}):void 0,h="$lit$",a=`lit$${Math.random().toFixed(9).slice(2)}$`,l="?"+a,c=`<${l}>`,d=document,p=()=>d.createComment(""),u=t=>null===t||"object"!=typeof t&&"function"!=typeof t,f=Array.isArray,m=t=>f(t)||"function"==typeof t?.[Symbol.iterator],y="[ \t\n\f\r]",$=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,g=/-->/g,v=/>/g,_=RegExp(`>|${y}(?:([^\\s"'>=/]+)(${y}*=${y}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),b=/'/g,A=/"/g,E=/^(?:script|style|textarea|title)$/i,w=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),x=w(1),k=(w(2),w(3),Symbol.for("lit-noChange")),C=Symbol.for("lit-nothing"),S=new WeakMap,P=d.createTreeWalker(d,129);function T(t,e){if(!f(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==r?r.createHTML(e):e}const U=(t,e)=>{const s=t.length-1,i=[];let n,o=2===e?"<svg>":3===e?"<math>":"",r=$;for(let e=0;e<s;e++){const s=t[e];let l,d,p=-1,u=0;for(;u<s.length&&(r.lastIndex=u,d=r.exec(s),null!==d);)u=r.lastIndex,r===$?"!--"===d[1]?r=g:void 0!==d[1]?r=v:void 0!==d[2]?(E.test(d[2])&&(n=RegExp("</"+d[2],"g")),r=_):void 0!==d[3]&&(r=_):r===_?">"===d[0]?(r=n??$,p=-1):void 0===d[1]?p=-2:(p=r.lastIndex-d[2].length,l=d[1],r=void 0===d[3]?_:'"'===d[3]?A:b):r===A||r===b?r=_:r===g||r===v?r=$:(r=_,n=void 0);const f=r===_&&t[e+1].startsWith("/>")?" ":"";o+=r===$?s+c:p>=0?(i.push(l),s.slice(0,p)+h+s.slice(p)+a+f):s+a+(-2===p?e:f)}return[T(t,o+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]};class M{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,r=0;const c=t.length-1,d=this.parts,[u,f]=U(t,e);if(this.el=M.createElement(u,s),P.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=P.nextNode())&&d.length<c;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(h)){const e=f[r++],s=i.getAttribute(t).split(a),o=/([.?@])?(.*)/.exec(e);d.push({type:1,index:n,name:o[2],strings:s,ctor:"."===o[1]?N:"?"===o[1]?z:"@"===o[1]?j:I}),i.removeAttribute(t)}else t.startsWith(a)&&(d.push({type:6,index:n}),i.removeAttribute(t));if(E.test(i.tagName)){const t=i.textContent.split(a),e=t.length-1;if(e>0){i.textContent=o?o.emptyScript:"";for(let s=0;s<e;s++)i.append(t[s],p()),P.nextNode(),d.push({type:2,index:++n});i.append(t[e],p())}}}else if(8===i.nodeType)if(i.data===l)d.push({type:2,index:n});else{let t=-1;for(;-1!==(t=i.data.indexOf(a,t+1));)d.push({type:7,index:n}),t+=a.length-1}n++}}static createElement(t,e){const s=d.createElement("template");return s.innerHTML=t,s}}function O(t,e,s=t,i){if(e===k)return e;let n=void 0!==i?s._$Co?.[i]:s._$Cl;const o=u(e)?void 0:e._$litDirective$;return n?.constructor!==o&&(n?._$AO?.(!1),void 0===o?n=void 0:(n=new o(t),n._$AT(t,s,i)),void 0!==i?(s._$Co??=[])[i]=n:s._$Cl=n),void 0!==n&&(e=O(t,n._$AS(t,e.values),n,i)),e}class R{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??d).importNode(e,!0);P.currentNode=i;let n=P.nextNode(),o=0,r=0,h=s[0];for(;void 0!==h;){if(o===h.index){let e;2===h.type?e=new H(n,n.nextSibling,this,t):1===h.type?e=new h.ctor(n,h.name,h.strings,this,t):6===h.type&&(e=new B(n,this,t)),this._$AV.push(e),h=s[++r]}o!==h?.index&&(n=P.nextNode(),o++)}return P.currentNode=d,i}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class H{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=C,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=O(this,t,e),u(t)?t===C||null==t||""===t?(this._$AH!==C&&this._$AR(),this._$AH=C):t!==this._$AH&&t!==k&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):m(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==C&&u(this._$AH)?this._$AA.nextSibling.data=t:this.T(d.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,i="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=M.createElement(T(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{const t=new R(i,this),s=t.u(this.options);t.p(e),this.T(s),this._$AH=t}}_$AC(t){let e=S.get(t.strings);return void 0===e&&S.set(t.strings,e=new M(t)),e}k(t){f(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const n of t)i===e.length?e.push(s=new H(this.O(p()),this.O(p()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class I{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=C,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=C}_$AI(t,e=this,s,i){const n=this.strings;let o=!1;if(void 0===n)t=O(this,t,e,0),o=!u(t)||t!==this._$AH&&t!==k,o&&(this._$AH=t);else{const i=t;let r,h;for(t=n[0],r=0;r<n.length-1;r++)h=O(this,i[s+r],e,r),h===k&&(h=this._$AH[r]),o||=!u(h)||h!==this._$AH[r],h===C?t=C:t!==C&&(t+=(h??"")+n[r+1]),this._$AH[r]=h}o&&!i&&this.j(t)}j(t){t===C?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class N extends I{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===C?void 0:t}}class z extends I{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==C)}}class j extends I{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=O(this,t,e,0)??C)===k)return;const s=this._$AH,i=t===C&&s!==C||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==C&&(s===C||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class B{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){O(this,t)}}const L=n.litHtmlPolyfillSupport;L?.(M,H),(n.litHtmlVersions??=[]).push("3.3.1");const D=globalThis;class V extends i.fl{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,s)=>{const i=s?.renderBefore??e;let n=i._$litPart$;if(void 0===n){const t=s?.renderBefore??null;i._$litPart$=n=new H(e.insertBefore(p(),t),t,void 0,s??{})}return n._$AI(t),n})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return k}}V._$litElement$=!0,V.finalized=!0,D.litElementHydrateSupport?.({LitElement:V});const W=D.litElementPolyfillSupport;W?.({LitElement:V});(D.litElementVersions??=[]).push("4.2.1")}}]);