🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@andrewshell/socklog

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@andrewshell/socklog - npm Package Compare versions

Comparing version
0.2.2
to
0.2.3
+1
-0
dist/components/socklog-viewer.d.ts

@@ -22,2 +22,3 @@ import { LitElement } from 'lit';

private formatTimestamp;
private tokenizeJson;
private formatJson;

@@ -24,0 +25,0 @@ render(): import("lit").TemplateResult<1>;

+45
-24

@@ -5,25 +5,25 @@ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});/**

* SPDX-License-Identifier: BSD-3-Clause
*/const L=globalThis,J=L.ShadowRoot&&(L.ShadyCSS===void 0||L.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,K=Symbol(),Q=new WeakMap;let lt=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==K)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(J&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=Q.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Q.set(e,t))}return t}toString(){return this.cssText}};const mt=o=>new lt(typeof o=="string"?o:o+"",void 0,K),ht=(o,...t)=>{const e=o.length===1?o[0]:t.reduce(((s,i,n)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[n+1]),o[0]);return new lt(e,o,K)},vt=(o,t)=>{if(J)o.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const e of t){const s=document.createElement("style"),i=L.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},X=J?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return mt(e)})(o):o;/**
*/const R=globalThis,q=R.ShadowRoot&&(R.ShadyCSS===void 0||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,K=Symbol(),Q=new WeakMap;let lt=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==K)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(q&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=Q.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&Q.set(e,t))}return t}toString(){return this.cssText}};const vt=o=>new lt(typeof o=="string"?o:o+"",void 0,K),ct=(o,...t)=>{const e=o.length===1?o[0]:t.reduce(((s,i,n)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[n+1]),o[0]);return new lt(e,o,K)},mt=(o,t)=>{if(q)o.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const e of t){const s=document.createElement("style"),i=R.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},X=q?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return vt(e)})(o):o;/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const{is:yt,defineProperty:bt,getOwnPropertyDescriptor:At,getOwnPropertyNames:St,getOwnPropertySymbols:Et,getPrototypeOf:wt}=Object,$=globalThis,Y=$.trustedTypes,xt=Y?Y.emptyScript:"",V=$.reactiveElementPolyfillSupport,C=(o,t)=>o,I={toAttribute(o,t){switch(t){case Boolean:o=o?xt:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},Z=(o,t)=>!yt(o,t),tt={attribute:!0,type:String,converter:I,reflect:!1,useDefault:!1,hasChanged:Z};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),$.litPropertyMetadata??($.litPropertyMetadata=new WeakMap);let S=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=tt){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);i!==void 0&&bt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:n}=At(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get:i,set(r){const c=i==null?void 0:i.call(this);n==null||n.call(this,r),this.requestUpdate(t,c,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??tt}static _$Ei(){if(this.hasOwnProperty(C("elementProperties")))return;const t=wt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(C("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C("properties"))){const e=this.properties,s=[...St(e),...Et(e)];for(const i of s)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}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 i of s)e.unshift(X(i))}else t!==void 0&&e.push(X(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach((e=>e(this)))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.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 vt(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach((e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)}))}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach((e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){var n;const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const r=(((n=s.converter)==null?void 0:n.toAttribute)!==void 0?s.converter:I).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){var n,r;const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const c=s.getPropertyOptions(i),a=typeof c.converter=="function"?{fromAttribute:c.converter}:((n=c.converter)==null?void 0:n.fromAttribute)!==void 0?c.converter:I;this._$Em=i;const h=a.fromAttribute(e,c.type);this[i]=h??((r=this._$Ej)==null?void 0:r.get(i))??h,this._$Em=null}}requestUpdate(t,e,s){var i;if(t!==void 0){const n=this.constructor,r=this[t];if(s??(s=n.getPropertyOptions(t)),!((s.hasChanged??Z)(r,e)||s.useDefault&&s.reflect&&r===((i=this._$Ej)==null?void 0:i.get(t))&&!this.hasAttribute(n._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:i,wrapped:n},r){s&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,r??e??this[t]),n!==!0||r!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),i===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[n,r]of this._$Ep)this[n]=r;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[n,r]of i){const{wrapped:c}=r,a=this[n];c!==!0||this._$AL.has(n)||a===void 0||this.C(n,void 0,r,a)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach((i=>{var n;return(n=i.hostUpdate)==null?void 0:n.call(i)})),this.update(e)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach((s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)})),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=this._$Eq.forEach((e=>this._$ET(e,this[e])))),this._$EM()}updated(t){}firstUpdated(t){}};S.elementStyles=[],S.shadowRootOptions={mode:"open"},S[C("elementProperties")]=new Map,S[C("finalized")]=new Map,V==null||V({ReactiveElement:S}),($.reactiveElementVersions??($.reactiveElementVersions=[])).push("2.1.1");/**
*/const{is:_t,defineProperty:yt,getOwnPropertyDescriptor:bt,getOwnPropertyNames:At,getOwnPropertySymbols:wt,getPrototypeOf:St}=Object,$=globalThis,Y=$.trustedTypes,Et=Y?Y.emptyScript:"",j=$.reactiveElementPolyfillSupport,C=(o,t)=>o,I={toAttribute(o,t){switch(t){case Boolean:o=o?Et:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},Z=(o,t)=>!_t(o,t),tt={attribute:!0,type:String,converter:I,reflect:!1,useDefault:!1,hasChanged:Z};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),$.litPropertyMetadata??($.litPropertyMetadata=new WeakMap);let w=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=tt){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);i!==void 0&&yt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:n}=bt(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get:i,set(r){const l=i==null?void 0:i.call(this);n==null||n.call(this,r),this.requestUpdate(t,l,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??tt}static _$Ei(){if(this.hasOwnProperty(C("elementProperties")))return;const t=St(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(C("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(C("properties"))){const e=this.properties,s=[...At(e),...wt(e)];for(const i of s)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}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 i of s)e.unshift(X(i))}else t!==void 0&&e.push(X(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach((e=>e(this)))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.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 mt(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach((e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)}))}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach((e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){var n;const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const r=(((n=s.converter)==null?void 0:n.toAttribute)!==void 0?s.converter:I).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){var n,r;const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const l=s.getPropertyOptions(i),a=typeof l.converter=="function"?{fromAttribute:l.converter}:((n=l.converter)==null?void 0:n.fromAttribute)!==void 0?l.converter:I;this._$Em=i;const h=a.fromAttribute(e,l.type);this[i]=h??((r=this._$Ej)==null?void 0:r.get(i))??h,this._$Em=null}}requestUpdate(t,e,s){var i;if(t!==void 0){const n=this.constructor,r=this[t];if(s??(s=n.getPropertyOptions(t)),!((s.hasChanged??Z)(r,e)||s.useDefault&&s.reflect&&r===((i=this._$Ej)==null?void 0:i.get(t))&&!this.hasAttribute(n._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:i,wrapped:n},r){s&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,r??e??this[t]),n!==!0||r!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),i===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[n,r]of this._$Ep)this[n]=r;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[n,r]of i){const{wrapped:l}=r,a=this[n];l!==!0||this._$AL.has(n)||a===void 0||this.C(n,void 0,r,a)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach((i=>{var n;return(n=i.hostUpdate)==null?void 0:n.call(i)})),this.update(e)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach((s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)})),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=this._$Eq.forEach((e=>this._$ET(e,this[e])))),this._$EM()}updated(t){}firstUpdated(t){}};w.elementStyles=[],w.shadowRootOptions={mode:"open"},w[C("elementProperties")]=new Map,w[C("finalized")]=new Map,j==null||j({ReactiveElement:w}),($.reactiveElementVersions??($.reactiveElementVersions=[])).push("2.1.1");/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const P=globalThis,z=P.trustedTypes,et=z?z.createPolicy("lit-html",{createHTML:o=>o}):void 0,dt="$lit$",f=`lit$${Math.random().toFixed(9).slice(2)}$`,pt="?"+f,kt=`<${pt}>`,b=document,O=()=>b.createComment(""),T=o=>o===null||typeof o!="object"&&typeof o!="function",G=Array.isArray,Ct=o=>G(o)||typeof(o==null?void 0:o[Symbol.iterator])=="function",B=`[
*/const P=globalThis,z=P.trustedTypes,et=z?z.createPolicy("lit-html",{createHTML:o=>o}):void 0,ht="$lit$",f=`lit$${Math.random().toFixed(9).slice(2)}$`,dt="?"+f,xt=`<${dt}>`,b=document,U=()=>b.createComment(""),O=o=>o===null||typeof o!="object"&&typeof o!="function",G=Array.isArray,kt=o=>G(o)||typeof(o==null?void 0:o[Symbol.iterator])=="function",B=`[
\f\r]`,k=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,st=/-->/g,it=/>/g,m=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`,"g"),ot=/'/g,rt=/"/g,ut=/^(?:script|style|textarea|title)$/i,Pt=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),R=Pt(1),A=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),nt=new WeakMap,v=b.createTreeWalker(b,129);function gt(o,t){if(!G(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}const Ot=(o,t)=>{const e=o.length-1,s=[];let i,n=t===2?"<svg>":t===3?"<math>":"",r=k;for(let c=0;c<e;c++){const a=o[c];let h,p,l=-1,u=0;for(;u<a.length&&(r.lastIndex=u,p=r.exec(a),p!==null);)u=r.lastIndex,r===k?p[1]==="!--"?r=st:p[1]!==void 0?r=it:p[2]!==void 0?(ut.test(p[2])&&(i=RegExp("</"+p[2],"g")),r=m):p[3]!==void 0&&(r=m):r===m?p[0]===">"?(r=i??k,l=-1):p[1]===void 0?l=-2:(l=r.lastIndex-p[2].length,h=p[1],r=p[3]===void 0?m:p[3]==='"'?rt:ot):r===rt||r===ot?r=m:r===st||r===it?r=k:(r=m,i=void 0);const g=r===m&&o[c+1].startsWith("/>")?" ":"";n+=r===k?a+kt:l>=0?(s.push(h),a.slice(0,l)+dt+a.slice(l)+f+g):a+f+(l===-2?c:g)}return[gt(o,n+(o[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class U{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,r=0;const c=t.length-1,a=this.parts,[h,p]=Ot(t,e);if(this.el=U.createElement(h,s),v.currentNode=this.el.content,e===2||e===3){const l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=v.nextNode())!==null&&a.length<c;){if(i.nodeType===1){if(i.hasAttributes())for(const l of i.getAttributeNames())if(l.endsWith(dt)){const u=p[r++],g=i.getAttribute(l).split(f),N=/([.?@])?(.*)/.exec(u);a.push({type:1,index:n,name:N[2],strings:g,ctor:N[1]==="."?Ut:N[1]==="?"?Mt:N[1]==="@"?Ht:D}),i.removeAttribute(l)}else l.startsWith(f)&&(a.push({type:6,index:n}),i.removeAttribute(l));if(ut.test(i.tagName)){const l=i.textContent.split(f),u=l.length-1;if(u>0){i.textContent=z?z.emptyScript:"";for(let g=0;g<u;g++)i.append(l[g],O()),v.nextNode(),a.push({type:2,index:++n});i.append(l[u],O())}}}else if(i.nodeType===8)if(i.data===pt)a.push({type:2,index:n});else{let l=-1;for(;(l=i.data.indexOf(f,l+1))!==-1;)a.push({type:7,index:n}),l+=f.length-1}n++}}static createElement(t,e){const s=b.createElement("template");return s.innerHTML=t,s}}function w(o,t,e=o,s){var r,c;if(t===A)return t;let i=s!==void 0?(r=e._$Co)==null?void 0:r[s]:e._$Cl;const n=T(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==n&&((c=i==null?void 0:i._$AO)==null||c.call(i,!1),n===void 0?i=void 0:(i=new n(o),i._$AT(o,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=i:e._$Cl=i),i!==void 0&&(t=w(o,i._$AS(o,t.values),i,s)),t}class Tt{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==null?void 0:t.creationScope)??b).importNode(e,!0);v.currentNode=i;let n=v.nextNode(),r=0,c=0,a=s[0];for(;a!==void 0;){if(r===a.index){let h;a.type===2?h=new M(n,n.nextSibling,this,t):a.type===1?h=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(h=new Nt(n,this,t)),this._$AV.push(h),a=s[++c]}r!==(a==null?void 0:a.index)&&(n=v.nextNode(),r++)}return v.currentNode=b,i}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class M{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=w(this,t,e),T(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==A&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Ct(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!==d&&T(this._$AH)?this._$AA.nextSibling.data=t:this.T(b.createTextNode(t)),this._$AH=t}$(t){var n;const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=U.createElement(gt(s.h,s.h[0]),this.options)),s);if(((n=this._$AH)==null?void 0:n._$AD)===i)this._$AH.p(e);else{const r=new Tt(i,this),c=r.u(this.options);r.p(e),this.T(c),this._$AH=r}}_$AC(t){let e=nt.get(t.strings);return e===void 0&&nt.set(t.strings,e=new U(t)),e}k(t){G(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 M(this.O(O()),this.O(O()),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){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class D{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=d,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=d}_$AI(t,e=this,s,i){const n=this.strings;let r=!1;if(n===void 0)t=w(this,t,e,0),r=!T(t)||t!==this._$AH&&t!==A,r&&(this._$AH=t);else{const c=t;let a,h;for(t=n[0],a=0;a<n.length-1;a++)h=w(this,c[s+a],e,a),h===A&&(h=this._$AH[a]),r||(r=!T(h)||h!==this._$AH[a]),h===d?t=d:t!==d&&(t+=(h??"")+n[a+1]),this._$AH[a]=h}r&&!i&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Ut extends D{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}}class Mt extends D{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==d)}}class Ht extends D{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=w(this,t,e,0)??d)===A)return;const s=this._$AH,i=t===d&&s!==d||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==d&&(s===d||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Nt{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){w(this,t)}}const W=P.litHtmlPolyfillSupport;W==null||W(U,M),(P.litHtmlVersions??(P.litHtmlVersions=[])).push("3.3.1");const Lt=(o,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let i=s._$litPart$;if(i===void 0){const n=(e==null?void 0:e.renderBefore)??null;s._$litPart$=i=new M(t.insertBefore(O(),n),n,void 0,e??{})}return i._$AI(o),i};/**
\f\r"'\`<>=]|("|')|))|$)`,"g"),ot=/'/g,rt=/"/g,pt=/^(?:script|style|textarea|title)$/i,Ct=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),L=Ct(1),A=Symbol.for("lit-noChange"),p=Symbol.for("lit-nothing"),nt=new WeakMap,_=b.createTreeWalker(b,129);function ut(o,t){if(!G(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}const Pt=(o,t)=>{const e=o.length-1,s=[];let i,n=t===2?"<svg>":t===3?"<math>":"",r=k;for(let l=0;l<e;l++){const a=o[l];let h,d,c=-1,u=0;for(;u<a.length&&(r.lastIndex=u,d=r.exec(a),d!==null);)u=r.lastIndex,r===k?d[1]==="!--"?r=st:d[1]!==void 0?r=it:d[2]!==void 0?(pt.test(d[2])&&(i=RegExp("</"+d[2],"g")),r=m):d[3]!==void 0&&(r=m):r===m?d[0]===">"?(r=i??k,c=-1):d[1]===void 0?c=-2:(c=r.lastIndex-d[2].length,h=d[1],r=d[3]===void 0?m:d[3]==='"'?rt:ot):r===rt||r===ot?r=m:r===st||r===it?r=k:(r=m,i=void 0);const g=r===m&&o[l+1].startsWith("/>")?" ":"";n+=r===k?a+xt:c>=0?(s.push(h),a.slice(0,c)+ht+a.slice(c)+f+g):a+f+(c===-2?l:g)}return[ut(o,n+(o[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class T{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,r=0;const l=t.length-1,a=this.parts,[h,d]=Pt(t,e);if(this.el=T.createElement(h,s),_.currentNode=this.el.content,e===2||e===3){const c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(i=_.nextNode())!==null&&a.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(const c of i.getAttributeNames())if(c.endsWith(ht)){const u=d[r++],g=i.getAttribute(c).split(f),N=/([.?@])?(.*)/.exec(u);a.push({type:1,index:n,name:N[2],strings:g,ctor:N[1]==="."?Ot:N[1]==="?"?Tt:N[1]==="@"?Mt:D}),i.removeAttribute(c)}else c.startsWith(f)&&(a.push({type:6,index:n}),i.removeAttribute(c));if(pt.test(i.tagName)){const c=i.textContent.split(f),u=c.length-1;if(u>0){i.textContent=z?z.emptyScript:"";for(let g=0;g<u;g++)i.append(c[g],U()),_.nextNode(),a.push({type:2,index:++n});i.append(c[u],U())}}}else if(i.nodeType===8)if(i.data===dt)a.push({type:2,index:n});else{let c=-1;for(;(c=i.data.indexOf(f,c+1))!==-1;)a.push({type:7,index:n}),c+=f.length-1}n++}}static createElement(t,e){const s=b.createElement("template");return s.innerHTML=t,s}}function E(o,t,e=o,s){var r,l;if(t===A)return t;let i=s!==void 0?(r=e._$Co)==null?void 0:r[s]:e._$Cl;const n=O(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==n&&((l=i==null?void 0:i._$AO)==null||l.call(i,!1),n===void 0?i=void 0:(i=new n(o),i._$AT(o,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=i:e._$Cl=i),i!==void 0&&(t=E(o,i._$AS(o,t.values),i,s)),t}class Ut{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==null?void 0:t.creationScope)??b).importNode(e,!0);_.currentNode=i;let n=_.nextNode(),r=0,l=0,a=s[0];for(;a!==void 0;){if(r===a.index){let h;a.type===2?h=new M(n,n.nextSibling,this,t):a.type===1?h=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(h=new Ht(n,this,t)),this._$AV.push(h),a=s[++l]}r!==(a==null?void 0:a.index)&&(n=_.nextNode(),r++)}return _.currentNode=b,i}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class M{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=p,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=E(this,t,e),O(t)?t===p||t==null||t===""?(this._$AH!==p&&this._$AR(),this._$AH=p):t!==this._$AH&&t!==A&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):kt(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!==p&&O(this._$AH)?this._$AA.nextSibling.data=t:this.T(b.createTextNode(t)),this._$AH=t}$(t){var n;const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=T.createElement(ut(s.h,s.h[0]),this.options)),s);if(((n=this._$AH)==null?void 0:n._$AD)===i)this._$AH.p(e);else{const r=new Ut(i,this),l=r.u(this.options);r.p(e),this.T(l),this._$AH=r}}_$AC(t){let e=nt.get(t.strings);return e===void 0&&nt.set(t.strings,e=new T(t)),e}k(t){G(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 M(this.O(U()),this.O(U()),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){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class D{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=p,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=p}_$AI(t,e=this,s,i){const n=this.strings;let r=!1;if(n===void 0)t=E(this,t,e,0),r=!O(t)||t!==this._$AH&&t!==A,r&&(this._$AH=t);else{const l=t;let a,h;for(t=n[0],a=0;a<n.length-1;a++)h=E(this,l[s+a],e,a),h===A&&(h=this._$AH[a]),r||(r=!O(h)||h!==this._$AH[a]),h===p?t=p:t!==p&&(t+=(h??"")+n[a+1]),this._$AH[a]=h}r&&!i&&this.j(t)}j(t){t===p?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Ot extends D{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===p?void 0:t}}class Tt extends D{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==p)}}class Mt extends D{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=E(this,t,e,0)??p)===A)return;const s=this._$AH,i=t===p&&s!==p||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==p&&(s===p||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Ht{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){E(this,t)}}const W=P.litHtmlPolyfillSupport;W==null||W(T,M),(P.litHtmlVersions??(P.litHtmlVersions=[])).push("3.3.1");const Nt=(o,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let i=s._$litPart$;if(i===void 0){const n=(e==null?void 0:e.renderBefore)??null;s._$litPart$=i=new M(t.insertBefore(U(),n),n,void 0,e??{})}return i._$AI(o),i};/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const y=globalThis;let E=class extends S{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Lt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return A}};var ct;E._$litElement$=!0,E.finalized=!0,(ct=y.litElementHydrateSupport)==null||ct.call(y,{LitElement:E});const q=y.litElementPolyfillSupport;q==null||q({LitElement:E});(y.litElementVersions??(y.litElementVersions=[])).push("4.2.1");/**
*/const y=globalThis;let S=class extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Nt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return A}};var at;S._$litElement$=!0,S.finalized=!0,(at=y.litElementHydrateSupport)==null||at.call(y,{LitElement:S});const F=y.litElementPolyfillSupport;F==null||F({LitElement:S});(y.litElementVersions??(y.litElementVersions=[])).push("4.2.1");/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const ft=o=>(t,e)=>{e!==void 0?e.addInitializer((()=>{customElements.define(o,t)})):customElements.define(o,t)};/**
*/const gt=o=>(t,e)=>{e!==void 0?e.addInitializer((()=>{customElements.define(o,t)})):customElements.define(o,t)};/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const Rt={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:Z},It=(o=Rt,t,e)=>{const{kind:s,metadata:i}=e;let n=globalThis.litPropertyMetadata.get(i);if(n===void 0&&globalThis.litPropertyMetadata.set(i,n=new Map),s==="setter"&&((o=Object.create(o)).wrapped=!0),n.set(e.name,o),s==="accessor"){const{name:r}=e;return{set(c){const a=t.get.call(this);t.set.call(this,c),this.requestUpdate(r,a,o)},init(c){return c!==void 0&&this.C(r,void 0,o,c),c}}}if(s==="setter"){const{name:r}=e;return function(c){const a=this[r];t.call(this,c),this.requestUpdate(r,a,o)}}throw Error("Unsupported decorator location: "+s)};function H(o){return(t,e)=>typeof e=="object"?It(o,t,e):((s,i,n)=>{const r=i.hasOwnProperty(n);return i.constructor.createProperty(n,s),r?Object.getOwnPropertyDescriptor(i,n):void 0})(o,t,e)}/**
*/const Rt={attribute:!0,type:String,converter:I,reflect:!1,hasChanged:Z},Lt=(o=Rt,t,e)=>{const{kind:s,metadata:i}=e;let n=globalThis.litPropertyMetadata.get(i);if(n===void 0&&globalThis.litPropertyMetadata.set(i,n=new Map),s==="setter"&&((o=Object.create(o)).wrapped=!0),n.set(e.name,o),s==="accessor"){const{name:r}=e;return{set(l){const a=t.get.call(this);t.set.call(this,l),this.requestUpdate(r,a,o)},init(l){return l!==void 0&&this.C(r,void 0,o,l),l}}}if(s==="setter"){const{name:r}=e;return function(l){const a=this[r];t.call(this,l),this.requestUpdate(r,a,o)}}throw Error("Unsupported decorator location: "+s)};function H(o){return(t,e)=>typeof e=="object"?Lt(o,t,e):((s,i,n)=>{const r=i.hasOwnProperty(n);return i.constructor.createProperty(n,s),r?Object.getOwnPropertyDescriptor(i,n):void 0})(o,t,e)}/**
* @license

@@ -36,7 +36,7 @@ * Copyright 2017 Google LLC

* SPDX-License-Identifier: BSD-3-Clause
*/const zt={CHILD:2},Dt=o=>(...t)=>({_$litDirective$:o,values:t});class jt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/**
*/const It={CHILD:2},zt=o=>(...t)=>({_$litDirective$:o,values:t});class Dt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/class F extends jt{constructor(t){if(super(t),this.it=d,t.type!==zt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===d||t==null)return this._t=void 0,this.it=t;if(t===A)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}F.directiveName="unsafeHTML",F.resultType=1;const at=Dt(F);class $t extends EventTarget{constructor(t){super(),this.ws=null,this.reconnectAttempts=0,this._status="disconnected",this.config={reconnect:!0,reconnectInterval:3e3,maxReconnectAttempts:10,...t}}get status(){return this._status}connect(){var t;if(((t=this.ws)==null?void 0:t.readyState)!==WebSocket.OPEN){this._status="connecting",this.dispatchEvent(new CustomEvent("statuschange",{detail:this._status}));try{this.ws=new WebSocket(this.config.url),this.setupEventHandlers()}catch{this._status="error",this.dispatchEvent(new CustomEvent("statuschange",{detail:this._status}))}}}disconnect(){var t;this.reconnectAttempts=this.config.maxReconnectAttempts??10,(t=this.ws)==null||t.close()}setupEventHandlers(){this.ws&&(this.ws.onopen=()=>{this._status="connected",this.reconnectAttempts=0,this.dispatchEvent(new CustomEvent("statuschange",{detail:this._status}))},this.ws.onclose=()=>{this._status="disconnected",this.dispatchEvent(new CustomEvent("statuschange",{detail:this._status})),this.attemptReconnect()},this.ws.onerror=()=>{this._status="error",this.dispatchEvent(new CustomEvent("statuschange",{detail:this._status}))},this.ws.onmessage=t=>{const e=t.data;let s;try{s=JSON.parse(e)}catch{s=e}const i={id:crypto.randomUUID(),timestamp:new Date,data:s,raw:e};this.dispatchEvent(new CustomEvent("log",{detail:i}))})}attemptReconnect(){this.config.reconnect&&(this.reconnectAttempts>=(this.config.maxReconnectAttempts??10)||(this.reconnectAttempts++,setTimeout(()=>this.connect(),this.config.reconnectInterval)))}}class _t extends EventTarget{constructor(t=1e3){super(),this.logs=[],this._filter={},this._paused=!1,this.maxLogs=t}get filter(){return this._filter}set filter(t){this._filter=t,this.dispatchEvent(new CustomEvent("filterchange",{detail:this._filter}))}get paused(){return this._paused}set paused(t){this._paused=t,this.dispatchEvent(new CustomEvent("pausechange",{detail:this._paused}))}add(t){this._paused||(this.logs.unshift(t),this.logs.length>this.maxLogs&&this.logs.pop(),this.dispatchEvent(new CustomEvent("logadded",{detail:t})))}clear(){this.logs=[],this.dispatchEvent(new CustomEvent("logscleared"))}getAll(){return[...this.logs]}getFiltered(){return this.logs.filter(t=>this.matchesFilter(t))}matchesFilter(t){const{search:e}=this._filter;if(e){const s=e.toLowerCase();return t.raw.toLowerCase().includes(s)}return!0}get count(){return this.logs.length}}var Vt=Object.defineProperty,Bt=Object.getOwnPropertyDescriptor,_=(o,t,e,s)=>{for(var i=s>1?void 0:s?Bt(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&Vt(t,e,i),i};exports.SocklogViewer=class extends E{constructor(){super(...arguments),this.url="",this.maxLogs=1e3,this.indent=4,this.logs=[],this.status="disconnected",this.searchTerm="",this.expandedIds=new Set,this.client=null,this.store=null}connectedCallback(){super.connectedCallback(),this.initializeStore(),this.url&&this.connect()}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.client)==null||t.disconnect()}initializeStore(){this.store=new _t(this.maxLogs),this.store.addEventListener("logadded",()=>{var t;this.logs=((t=this.store)==null?void 0:t.getFiltered())??[]}),this.store.addEventListener("filterchange",()=>{var t,e;this.logs=((t=this.store)==null?void 0:t.getFiltered())??[],this.searchTerm=((e=this.store)==null?void 0:e.filter.search)??""}),this.store.addEventListener("logscleared",()=>{this.logs=[]})}connect(){this.url&&(this.client=new $t({url:this.url}),this.client.addEventListener("statuschange",(t=>{this.status=t.detail})),this.client.addEventListener("log",(t=>{var e;(e=this.store)==null||e.add(t.detail)})),this.client.connect())}clear(){var t;(t=this.store)==null||t.clear()}getStore(){return this.store}toggleExpanded(t){this.expandedIds.has(t)?this.expandedIds.delete(t):this.expandedIds.add(t),this.expandedIds=new Set(this.expandedIds)}formatTimestamp(t){return t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}formatJson(t,e=!1){let s;typeof t=="string"?s=t:s=e?JSON.stringify(t,null,this.indent):JSON.stringify(t);const n=s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/(&quot;|")([^"\\]|\\.)*?\1(?=\s*:)/g,'<span class="json-key">$&</span>');if(!this.searchTerm)return at(n);const r=this.searchTerm.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=new RegExp(`(${r})`,"gi"),a=n.replace(/(<[^>]*>)|([^<]+)/g,(h,p,l)=>p||l.replace(c,'<span class="search-highlight">$1</span>'));return at(a)}render(){return this.logs.length===0?R`
*/class J extends Dt{constructor(t){if(super(t),this.it=p,t.type!==It.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===p||t==null)return this._t=void 0,this.it=t;if(t===A)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}J.directiveName="unsafeHTML",J.resultType=1;const Vt=zt(J);function jt(){if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const o=new Uint8Array(16);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(o);else for(let e=0;e<16;e++)o[e]=Math.random()*256|0;o[6]=o[6]&15|64,o[8]=o[8]&63|128;const t=Array.from(o,e=>e.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}class ft extends EventTarget{constructor(t){super(),this.ws=null,this.reconnectAttempts=0,this._status="disconnected",this.config={reconnect:!0,reconnectInterval:3e3,maxReconnectAttempts:10,...t}}get status(){return this._status}connect(){var t;if(((t=this.ws)==null?void 0:t.readyState)!==WebSocket.OPEN){typeof location<"u"&&location.protocol==="https:"&&this.config.url.startsWith("ws://")&&console.warn("[socklog] Connecting with ws:// from an HTTPS page will be blocked as mixed content. Use wss:// instead."),this._status="connecting",this.dispatchEvent(new CustomEvent("statuschange",{detail:this._status}));try{this.ws=new WebSocket(this.config.url),this.setupEventHandlers()}catch{this._status="error",this.dispatchEvent(new CustomEvent("statuschange",{detail:this._status}))}}}disconnect(){var t;this.reconnectAttempts=this.config.maxReconnectAttempts??10,(t=this.ws)==null||t.close()}setupEventHandlers(){this.ws&&(this.ws.onopen=()=>{this._status="connected",this.reconnectAttempts=0,this.dispatchEvent(new CustomEvent("statuschange",{detail:this._status}))},this.ws.onclose=()=>{this._status="disconnected",this.dispatchEvent(new CustomEvent("statuschange",{detail:this._status})),this.attemptReconnect()},this.ws.onerror=()=>{this._status="error",this.dispatchEvent(new CustomEvent("statuschange",{detail:this._status}))},this.ws.onmessage=t=>{const e=t.data;let s;try{s=JSON.parse(e)}catch{s=e}const i={id:jt(),timestamp:new Date,data:s,raw:e};this.dispatchEvent(new CustomEvent("log",{detail:i}))})}attemptReconnect(){this.config.reconnect&&(this.reconnectAttempts>=(this.config.maxReconnectAttempts??10)||(this.reconnectAttempts++,setTimeout(()=>this.connect(),this.config.reconnectInterval)))}}class $t extends EventTarget{constructor(t=1e3){super(),this.logs=[],this._filter={},this._paused=!1,this.maxLogs=t}get filter(){return this._filter}set filter(t){this._filter=t,this.dispatchEvent(new CustomEvent("filterchange",{detail:this._filter}))}get paused(){return this._paused}set paused(t){this._paused=t,this.dispatchEvent(new CustomEvent("pausechange",{detail:this._paused}))}add(t){this._paused||(this.logs.unshift(t),this.logs.length>this.maxLogs&&this.logs.pop(),this.dispatchEvent(new CustomEvent("logadded",{detail:t})))}clear(){this.logs=[],this.dispatchEvent(new CustomEvent("logscleared"))}getAll(){return[...this.logs]}getFiltered(){return this.logs.filter(t=>this.matchesFilter(t))}matchesFilter(t){const{search:e}=this._filter;if(e){const s=e.toLowerCase();return t.raw.toLowerCase().includes(s)}return!0}get count(){return this.logs.length}}var Bt=Object.defineProperty,Wt=Object.getOwnPropertyDescriptor,v=(o,t,e,s)=>{for(var i=s>1?void 0:s?Wt(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&Bt(t,e,i),i};exports.SocklogViewer=class extends S{constructor(){super(...arguments),this.url="",this.maxLogs=1e3,this.indent=4,this.logs=[],this.status="disconnected",this.searchTerm="",this.expandedIds=new Set,this.client=null,this.store=null}connectedCallback(){super.connectedCallback(),this.initializeStore(),this.url&&this.connect()}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.client)==null||t.disconnect()}initializeStore(){this.store=new $t(this.maxLogs),this.store.addEventListener("logadded",()=>{var t;this.logs=((t=this.store)==null?void 0:t.getFiltered())??[]}),this.store.addEventListener("filterchange",()=>{var t,e;this.logs=((t=this.store)==null?void 0:t.getFiltered())??[],this.searchTerm=((e=this.store)==null?void 0:e.filter.search)??""}),this.store.addEventListener("logscleared",()=>{this.logs=[]})}connect(){this.url&&(this.client=new ft({url:this.url}),this.client.addEventListener("statuschange",(t=>{this.status=t.detail})),this.client.addEventListener("log",(t=>{var e;(e=this.store)==null||e.add(t.detail)})),this.client.connect())}clear(){var t;(t=this.store)==null||t.clear()}getStore(){return this.store}toggleExpanded(t){this.expandedIds.has(t)?this.expandedIds.delete(t):this.expandedIds.add(t),this.expandedIds=new Set(this.expandedIds)}formatTimestamp(t){return t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}tokenizeJson(t){const e=[];let s=0;for(;s<t.length;){const i=t[s];if(/\s/.test(i)){let r="";for(;s<t.length&&/\s/.test(t[s]);)r+=t[s],s++;e.push({type:"whitespace",value:r});continue}if(i==="{"||i==="}"||i==="["||i==="]"||i===":"||i===","){e.push({type:"punctuation",value:i}),s++;continue}if(i==='"'){let r='"';for(s++;s<t.length;)if(t[s]==="\\"&&s+1<t.length)r+=t[s]+t[s+1],s+=2;else if(t[s]==='"'){r+='"',s++;break}else r+=t[s],s++;e.push({type:"string",value:r});continue}let n="";for(;s<t.length&&!/[\s{}[\]:,"]/.test(t[s]);)n+=t[s],s++;n&&e.push({type:"value",value:n})}return e}formatJson(t,e=!1){let s;typeof t=="string"?s=t:s=e?JSON.stringify(t,null,this.indent):JSON.stringify(t);const i=this.tokenizeJson(s),n=[];for(let l=0;l<i.length;l++){const a=i[l],h=i[l+1],d=a.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),c=a.type==="string"&&(h==null?void 0:h.value)===":";a.type==="whitespace"?n.push(d):a.type==="punctuation"?n.push(`<span class="json-punct">${d}</span>`):c?n.push(`<span class="json-key">${d}</span>`):a.type==="string"?n.push(`<span class="json-string">${d}</span>`):n.push(`<span class="json-value">${d}</span>`)}let r=e?n.join(""):n.join("<wbr>");if(this.searchTerm){const l=this.searchTerm.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`(${l})`,"gi");r=r.replace(/(<[^>]*>)|([^<]+)/g,(h,d,c)=>d||c.replace(a,'<span class="search-highlight">$1</span>'))}return Vt(r)}render(){return this.logs.length===0?L`
<div class="log-container">

@@ -47,18 +47,17 @@ <div class="empty-state">

</div>
`:R`
`:L`
<div class="log-container">
${this.logs.map(t=>R`
${this.logs.map(t=>L`
<div class="log-entry">
<div class="log-header"
@click=${()=>this.toggleExpanded(t.id)}>
<span class="expand-toggle">
${this.expandedIds.has(t.id)?"⏷":"⏵"}
</span>
<div class="log-header" @click=${()=>this.toggleExpanded(t.id)}>
<span class="expand-toggle"> ${this.expandedIds.has(t.id)?"⏷":"⏵"} </span>
<span class="timestamp">${this.formatTimestamp(t.timestamp)}</span>
</div>
<div class="json">${this.formatJson(t.data,this.expandedIds.has(t.id))}</div>
<div class="json ${this.expandedIds.has(t.id)?"expanded":""}">
${this.formatJson(t.data,this.expandedIds.has(t.id))}
</div>
</div>
`)}
</div>
`}};exports.SocklogViewer.styles=ht`
`}};exports.SocklogViewer.styles=ct`
:host {

@@ -110,5 +109,9 @@ display: block;

white-space: pre-wrap;
word-break: break-word;
}
.json.expanded {
white-space: pre;
overflow-x: auto;
}
.empty-state {

@@ -119,2 +122,10 @@ padding: var(--socklog-padding, 8px);

.json-key,
.json-string,
.json-value,
.json-punct {
display: inline;
white-space: nowrap;
}
.json-key {

@@ -127,3 +138,3 @@ color: var(--socklog-key-color, #5c7cba);

}
`;_([H({type:String})],exports.SocklogViewer.prototype,"url",2);_([H({type:Number})],exports.SocklogViewer.prototype,"maxLogs",2);_([H({type:Number})],exports.SocklogViewer.prototype,"indent",2);_([x()],exports.SocklogViewer.prototype,"logs",2);_([x()],exports.SocklogViewer.prototype,"status",2);_([x()],exports.SocklogViewer.prototype,"searchTerm",2);_([x()],exports.SocklogViewer.prototype,"expandedIds",2);exports.SocklogViewer=_([ft("socklog-viewer")],exports.SocklogViewer);var Wt=Object.defineProperty,qt=Object.getOwnPropertyDescriptor,j=(o,t,e,s)=>{for(var i=s>1?void 0:s?qt(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&Wt(t,e,i),i};exports.SocklogControls=class extends E{constructor(){super(...arguments),this.store=null,this.searchValue="",this.paused=!1}connectedCallback(){super.connectedCallback(),this.setupStoreListeners()}updated(t){t.has("store")&&this.setupStoreListeners()}setupStoreListeners(){this.store&&this.store.addEventListener("pausechange",(t=>{this.paused=t.detail}))}handleSearch(t){const e=t.target;this.searchValue=e.value,this.updateFilter()}updateFilter(){if(!this.store)return;const t={};this.searchValue&&(t.search=this.searchValue),this.store.filter=t}togglePause(){this.store&&(this.store.paused=!this.store.paused)}clear(){var t;(t=this.store)==null||t.clear()}render(){return R`
`;v([H({type:String})],exports.SocklogViewer.prototype,"url",2);v([H({type:Number})],exports.SocklogViewer.prototype,"maxLogs",2);v([H({type:Number})],exports.SocklogViewer.prototype,"indent",2);v([x()],exports.SocklogViewer.prototype,"logs",2);v([x()],exports.SocklogViewer.prototype,"status",2);v([x()],exports.SocklogViewer.prototype,"searchTerm",2);v([x()],exports.SocklogViewer.prototype,"expandedIds",2);exports.SocklogViewer=v([gt("socklog-viewer")],exports.SocklogViewer);var Ft=Object.defineProperty,Jt=Object.getOwnPropertyDescriptor,V=(o,t,e,s)=>{for(var i=s>1?void 0:s?Jt(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&Ft(t,e,i),i};exports.SocklogControls=class extends S{constructor(){super(...arguments),this.store=null,this.searchValue="",this.paused=!1}connectedCallback(){super.connectedCallback(),this.setupStoreListeners()}updated(t){t.has("store")&&this.setupStoreListeners()}setupStoreListeners(){this.store&&this.store.addEventListener("pausechange",(t=>{this.paused=t.detail}))}handleSearch(t){const e=t.target;this.searchValue=e.value,this.updateFilter()}updateFilter(){if(!this.store)return;const t={};this.searchValue&&(t.search=this.searchValue),this.store.filter=t}togglePause(){this.store&&(this.store.paused=!this.store.paused)}clear(){var t;(t=this.store)==null||t.clear()}render(){return L`
<div class="controls-inner">

@@ -140,3 +151,6 @@ <div class="search-container">

<div class="actions">
<button class="action-btn pause ${this.paused?"active":""}" @click=${this.togglePause}>
<button
class="action-btn pause ${this.paused?"active":""}"
@click=${this.togglePause}
>
${this.paused?"Resume":"Pause"}

@@ -147,3 +161,3 @@ </button>

</div>
`}};exports.SocklogControls.styles=ht`
`}};exports.SocklogControls.styles=ct`
:host {

@@ -163,3 +177,10 @@ display: block;

border-bottom: 1px solid var(--socklog-border-color, #e0e0e0);
font-family: var(--socklog-ui-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
font-family: var(
--socklog-ui-font-family,
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
sans-serif
);
font-size: 13px;

@@ -222,3 +243,3 @@ color: var(--socklog-color, inherit);

}
`;j([H({attribute:!1})],exports.SocklogControls.prototype,"store",2);j([x()],exports.SocklogControls.prototype,"searchValue",2);j([x()],exports.SocklogControls.prototype,"paused",2);exports.SocklogControls=j([ft("socklog-controls")],exports.SocklogControls);exports.LogStore=_t;exports.WebSocketClient=$t;
`;V([H({attribute:!1})],exports.SocklogControls.prototype,"store",2);V([x()],exports.SocklogControls.prototype,"searchValue",2);V([x()],exports.SocklogControls.prototype,"paused",2);exports.SocklogControls=V([gt("socklog-controls")],exports.SocklogControls);exports.LogStore=$t;exports.WebSocketClient=ft;
//# sourceMappingURL=socklog.cjs.map

@@ -7,5 +7,5 @@ /**

const I = globalThis, Z = I.ShadowRoot && (I.ShadyCSS === void 0 || I.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, G = Symbol(), Y = /* @__PURE__ */ new WeakMap();
let dt = class {
constructor(t, e, s) {
if (this._$cssResult$ = !0, s !== G) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
let ht = class {
constructor(t, e, i) {
if (this._$cssResult$ = !0, i !== G) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
this.cssText = t, this.t = e;

@@ -17,4 +17,4 @@ }

if (Z && t === void 0) {
const s = e !== void 0 && e.length === 1;
s && (t = Y.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && Y.set(e, t));
const i = e !== void 0 && e.length === 1;
i && (t = Y.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && Y.set(e, t));
}

@@ -27,20 +27,20 @@ return t;

};
const mt = (r) => new dt(typeof r == "string" ? r : r + "", void 0, G), pt = (r, ...t) => {
const e = r.length === 1 ? r[0] : t.reduce(((s, i, n) => s + ((o) => {
if (o._$cssResult$ === !0) return o.cssText;
if (typeof o == "number") return o;
throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
})(i) + r[n + 1]), r[0]);
return new dt(e, r, G);
}, vt = (r, t) => {
if (Z) r.adoptedStyleSheets = t.map(((e) => e instanceof CSSStyleSheet ? e : e.styleSheet));
const vt = (s) => new ht(typeof s == "string" ? s : s + "", void 0, G), dt = (s, ...t) => {
const e = s.length === 1 ? s[0] : t.reduce(((i, r, o) => i + ((n) => {
if (n._$cssResult$ === !0) return n.cssText;
if (typeof n == "number") return n;
throw Error("Value passed to 'css' function must be a 'css' function result: " + n + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
})(r) + s[o + 1]), s[0]);
return new ht(e, s, G);
}, _t = (s, t) => {
if (Z) s.adoptedStyleSheets = t.map(((e) => e instanceof CSSStyleSheet ? e : e.styleSheet));
else for (const e of t) {
const s = document.createElement("style"), i = I.litNonce;
i !== void 0 && s.setAttribute("nonce", i), s.textContent = e.cssText, r.appendChild(s);
const i = document.createElement("style"), r = I.litNonce;
r !== void 0 && i.setAttribute("nonce", r), i.textContent = e.cssText, s.appendChild(i);
}
}, tt = Z ? (r) => r : (r) => r instanceof CSSStyleSheet ? ((t) => {
}, tt = Z ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => {
let e = "";
for (const s of t.cssRules) e += s.cssText;
return mt(e);
})(r) : r;
for (const i of t.cssRules) e += i.cssText;
return vt(e);
})(s) : s;
/**

@@ -51,20 +51,20 @@ * @license

*/
const { is: yt, defineProperty: bt, getOwnPropertyDescriptor: At, getOwnPropertyNames: Et, getOwnPropertySymbols: xt, getPrototypeOf: wt } = Object, _ = globalThis, et = _.trustedTypes, St = et ? et.emptyScript : "", W = _.reactiveElementPolyfillSupport, O = (r, t) => r, D = { toAttribute(r, t) {
const { is: mt, defineProperty: yt, getOwnPropertyDescriptor: bt, getOwnPropertyNames: At, getOwnPropertySymbols: Et, getPrototypeOf: wt } = Object, v = globalThis, et = v.trustedTypes, xt = et ? et.emptyScript : "", W = v.reactiveElementPolyfillSupport, U = (s, t) => s, D = { toAttribute(s, t) {
switch (t) {
case Boolean:
r = r ? St : null;
s = s ? xt : null;
break;
case Object:
case Array:
r = r == null ? r : JSON.stringify(r);
s = s == null ? s : JSON.stringify(s);
}
return r;
}, fromAttribute(r, t) {
let e = r;
return s;
}, fromAttribute(s, t) {
let e = s;
switch (t) {
case Boolean:
e = r !== null;
e = s !== null;
break;
case Number:
e = r === null ? null : Number(r);
e = s === null ? null : Number(s);
break;

@@ -74,3 +74,3 @@ case Object:

try {
e = JSON.parse(r);
e = JSON.parse(s);
} catch {

@@ -81,5 +81,5 @@ e = null;

return e;
} }, Q = (r, t) => !yt(r, t), st = { attribute: !0, type: String, converter: D, reflect: !1, useDefault: !1, hasChanged: Q };
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), _.litPropertyMetadata ?? (_.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
let x = class extends HTMLElement {
} }, Q = (s, t) => !mt(s, t), st = { attribute: !0, type: String, converter: D, reflect: !1, useDefault: !1, hasChanged: Q };
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), v.litPropertyMetadata ?? (v.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
let w = class extends HTMLElement {
static addInitializer(t) {

@@ -93,15 +93,15 @@ this._$Ei(), (this.l ?? (this.l = [])).push(t);

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);
i !== void 0 && bt(this.prototype, t, i);
const i = Symbol(), r = this.getPropertyDescriptor(t, i, e);
r !== void 0 && yt(this.prototype, t, r);
}
}
static getPropertyDescriptor(t, e, s) {
const { get: i, set: n } = At(this.prototype, t) ?? { get() {
static getPropertyDescriptor(t, e, i) {
const { get: r, set: o } = bt(this.prototype, t) ?? { get() {
return this[e];
}, set(o) {
this[e] = o;
}, set(n) {
this[e] = n;
} };
return { get: i, set(o) {
const h = i == null ? void 0 : i.call(this);
n == null || n.call(this, o), this.requestUpdate(t, h, s);
return { get: r, set(n) {
const c = r == null ? void 0 : r.call(this);
o == null || o.call(this, n), this.requestUpdate(t, c, i);
}, configurable: !0, enumerable: !0 };

@@ -113,3 +113,3 @@ }

static _$Ei() {
if (this.hasOwnProperty(O("elementProperties"))) return;
if (this.hasOwnProperty(U("elementProperties"))) return;
const t = wt(this);

@@ -119,6 +119,6 @@ t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);

static finalize() {
if (this.hasOwnProperty(O("finalized"))) return;
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(O("properties"))) {
const e = this.properties, s = [...Et(e), ...xt(e)];
for (const i of s) this.createProperty(i, e[i]);
if (this.hasOwnProperty(U("finalized"))) return;
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(U("properties"))) {
const e = this.properties, i = [...At(e), ...Et(e)];
for (const r of i) this.createProperty(r, e[r]);
}

@@ -128,8 +128,8 @@ const t = this[Symbol.metadata];

const e = litPropertyMetadata.get(t);
if (e !== void 0) for (const [s, i] of e) this.elementProperties.set(s, i);
if (e !== void 0) for (const [i, r] of e) this.elementProperties.set(i, r);
}
this._$Eh = /* @__PURE__ */ new Map();
for (const [e, s] of this.elementProperties) {
const i = this._$Eu(e, s);
i !== void 0 && this._$Eh.set(i, e);
for (const [e, i] of this.elementProperties) {
const r = this._$Eu(e, i);
r !== void 0 && this._$Eh.set(r, e);
}

@@ -141,4 +141,4 @@ this.elementStyles = this.finalizeStyles(this.styles);

if (Array.isArray(t)) {
const s = new Set(t.flat(1 / 0).reverse());
for (const i of s) e.unshift(tt(i));
const i = new Set(t.flat(1 / 0).reverse());
for (const r of i) e.unshift(tt(r));
} else t !== void 0 && e.push(tt(t));

@@ -148,4 +148,4 @@ return e;

static _$Eu(t, e) {
const s = e.attribute;
return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
const i = e.attribute;
return i === !1 ? void 0 : typeof i == "string" ? i : typeof t == "string" ? t.toLowerCase() : void 0;
}

@@ -169,3 +169,3 @@ constructor() {

const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
for (const s of e.keys()) this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
for (const i of e.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
t.size > 0 && (this._$Ep = t);

@@ -175,3 +175,3 @@ }

const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
return vt(t, this.constructor.elementStyles), t;
return _t(t, this.constructor.elementStyles), t;
}

@@ -181,4 +181,4 @@ connectedCallback() {

this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach(((e) => {
var s;
return (s = e.hostConnected) == null ? void 0 : s.call(e);
var i;
return (i = e.hostConnected) == null ? void 0 : i.call(e);
}));

@@ -191,38 +191,38 @@ }

(t = this._$EO) == null || t.forEach(((e) => {
var s;
return (s = e.hostDisconnected) == null ? void 0 : s.call(e);
var i;
return (i = e.hostDisconnected) == null ? void 0 : i.call(e);
}));
}
attributeChangedCallback(t, e, s) {
this._$AK(t, s);
attributeChangedCallback(t, e, i) {
this._$AK(t, i);
}
_$ET(t, e) {
var n;
const s = this.constructor.elementProperties.get(t), i = this.constructor._$Eu(t, s);
if (i !== void 0 && s.reflect === !0) {
const o = (((n = s.converter) == null ? void 0 : n.toAttribute) !== void 0 ? s.converter : D).toAttribute(e, s.type);
this._$Em = t, o == null ? this.removeAttribute(i) : this.setAttribute(i, o), this._$Em = null;
var o;
const i = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, i);
if (r !== void 0 && i.reflect === !0) {
const n = (((o = i.converter) == null ? void 0 : o.toAttribute) !== void 0 ? i.converter : D).toAttribute(e, i.type);
this._$Em = t, n == null ? this.removeAttribute(r) : this.setAttribute(r, n), this._$Em = null;
}
}
_$AK(t, e) {
var n, o;
const s = this.constructor, i = s._$Eh.get(t);
if (i !== void 0 && this._$Em !== i) {
const h = s.getPropertyOptions(i), a = typeof h.converter == "function" ? { fromAttribute: h.converter } : ((n = h.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? h.converter : D;
this._$Em = i;
const c = a.fromAttribute(e, h.type);
this[i] = c ?? ((o = this._$Ej) == null ? void 0 : o.get(i)) ?? c, this._$Em = null;
var o, n;
const i = this.constructor, r = i._$Eh.get(t);
if (r !== void 0 && this._$Em !== r) {
const c = i.getPropertyOptions(r), a = typeof c.converter == "function" ? { fromAttribute: c.converter } : ((o = c.converter) == null ? void 0 : o.fromAttribute) !== void 0 ? c.converter : D;
this._$Em = r;
const l = a.fromAttribute(e, c.type);
this[r] = l ?? ((n = this._$Ej) == null ? void 0 : n.get(r)) ?? l, this._$Em = null;
}
}
requestUpdate(t, e, s) {
var i;
requestUpdate(t, e, i) {
var r;
if (t !== void 0) {
const n = this.constructor, o = this[t];
if (s ?? (s = n.getPropertyOptions(t)), !((s.hasChanged ?? Q)(o, e) || s.useDefault && s.reflect && o === ((i = this._$Ej) == null ? void 0 : i.get(t)) && !this.hasAttribute(n._$Eu(t, s)))) return;
this.C(t, e, s);
const o = this.constructor, n = this[t];
if (i ?? (i = o.getPropertyOptions(t)), !((i.hasChanged ?? Q)(n, e) || i.useDefault && i.reflect && n === ((r = this._$Ej) == null ? void 0 : r.get(t)) && !this.hasAttribute(o._$Eu(t, i)))) return;
this.C(t, e, i);
}
this.isUpdatePending === !1 && (this._$ES = this._$EP());
}
C(t, e, { useDefault: s, reflect: i, wrapped: n }, o) {
s && !(this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Map())).has(t) && (this._$Ej.set(t, o ?? e ?? this[t]), n !== !0 || o !== void 0) || (this._$AL.has(t) || (this.hasUpdated || s || (e = void 0), this._$AL.set(t, e)), i === !0 && this._$Em !== t && (this._$Eq ?? (this._$Eq = /* @__PURE__ */ new Set())).add(t));
C(t, e, { useDefault: i, reflect: r, wrapped: o }, n) {
i && !(this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Map())).has(t) && (this._$Ej.set(t, n ?? e ?? this[t]), o !== !0 || n !== void 0) || (this._$AL.has(t) || (this.hasUpdated || i || (e = void 0), this._$AL.set(t, e)), r === !0 && this._$Em !== t && (this._$Eq ?? (this._$Eq = /* @__PURE__ */ new Set())).add(t));
}

@@ -243,13 +243,13 @@ async _$EP() {

performUpdate() {
var s;
var i;
if (!this.isUpdatePending) return;
if (!this.hasUpdated) {
if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
for (const [n, o] of this._$Ep) this[n] = o;
for (const [o, n] of this._$Ep) this[o] = n;
this._$Ep = void 0;
}
const i = this.constructor.elementProperties;
if (i.size > 0) for (const [n, o] of i) {
const { wrapped: h } = o, a = this[n];
h !== !0 || this._$AL.has(n) || a === void 0 || this.C(n, void 0, o, a);
const r = this.constructor.elementProperties;
if (r.size > 0) for (const [o, n] of r) {
const { wrapped: c } = n, a = this[o];
c !== !0 || this._$AL.has(o) || a === void 0 || this.C(o, void 0, n, a);
}

@@ -260,8 +260,8 @@ }

try {
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach(((i) => {
var n;
return (n = i.hostUpdate) == null ? void 0 : n.call(i);
t = this.shouldUpdate(e), t ? (this.willUpdate(e), (i = this._$EO) == null || i.forEach(((r) => {
var o;
return (o = r.hostUpdate) == null ? void 0 : o.call(r);
})), this.update(e)) : this._$EM();
} catch (i) {
throw t = !1, this._$EM(), i;
} catch (r) {
throw t = !1, this._$EM(), r;
}

@@ -274,5 +274,5 @@ t && this._$AE(e);

var e;
(e = this._$EO) == null || e.forEach(((s) => {
var i;
return (i = s.hostUpdated) == null ? void 0 : i.call(s);
(e = this._$EO) == null || e.forEach(((i) => {
var r;
return (r = i.hostUpdated) == null ? void 0 : r.call(i);
})), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);

@@ -300,3 +300,3 @@ }

};
x.elementStyles = [], x.shadowRootOptions = { mode: "open" }, x[O("elementProperties")] = /* @__PURE__ */ new Map(), x[O("finalized")] = /* @__PURE__ */ new Map(), W == null || W({ ReactiveElement: x }), (_.reactiveElementVersions ?? (_.reactiveElementVersions = [])).push("2.1.1");
w.elementStyles = [], w.shadowRootOptions = { mode: "open" }, w[U("elementProperties")] = /* @__PURE__ */ new Map(), w[U("finalized")] = /* @__PURE__ */ new Map(), W == null || W({ ReactiveElement: w }), (v.reactiveElementVersions ?? (v.reactiveElementVersions = [])).push("2.1.1");
/**

@@ -307,66 +307,66 @@ * @license

*/
const T = globalThis, j = T.trustedTypes, it = j ? j.createPolicy("lit-html", { createHTML: (r) => r }) : void 0, ut = "$lit$", $ = `lit$${Math.random().toFixed(9).slice(2)}$`, gt = "?" + $, Ct = `<${gt}>`, A = document, U = () => A.createComment(""), M = (r) => r === null || typeof r != "object" && typeof r != "function", X = Array.isArray, kt = (r) => X(r) || typeof (r == null ? void 0 : r[Symbol.iterator]) == "function", q = `[
\f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, rt = /-->/g, ot = />/g, v = RegExp(`>|${q}(?:([^\\s"'>=/]+)(${q}*=${q}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`, "g"), nt = /'/g, at = /"/g, ft = /^(?:script|style|textarea|title)$/i, Pt = (r) => (t, ...e) => ({ _$litType$: r, strings: t, values: e }), z = Pt(1), E = Symbol.for("lit-noChange"), d = Symbol.for("lit-nothing"), ht = /* @__PURE__ */ new WeakMap(), y = A.createTreeWalker(A, 129);
function $t(r, t) {
if (!X(r) || !r.hasOwnProperty("raw")) throw Error("invalid template strings array");
const O = globalThis, j = O.trustedTypes, it = j ? j.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, pt = "$lit$", $ = `lit$${Math.random().toFixed(9).slice(2)}$`, ut = "?" + $, St = `<${ut}>`, A = document, T = () => A.createComment(""), M = (s) => s === null || typeof s != "object" && typeof s != "function", X = Array.isArray, Ct = (s) => X(s) || typeof (s == null ? void 0 : s[Symbol.iterator]) == "function", F = `[
\f\r]`, P = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, rt = /-->/g, ot = />/g, m = RegExp(`>|${F}(?:([^\\s"'>=/]+)(${F}*=${F}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`, "g"), nt = /'/g, at = /"/g, gt = /^(?:script|style|textarea|title)$/i, kt = (s) => (t, ...e) => ({ _$litType$: s, strings: t, values: e }), z = kt(1), E = Symbol.for("lit-noChange"), p = Symbol.for("lit-nothing"), ct = /* @__PURE__ */ new WeakMap(), y = A.createTreeWalker(A, 129);
function ft(s, t) {
if (!X(s) || !s.hasOwnProperty("raw")) throw Error("invalid template strings array");
return it !== void 0 ? it.createHTML(t) : t;
}
const Ot = (r, t) => {
const e = r.length - 1, s = [];
let i, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = P;
for (let h = 0; h < e; h++) {
const a = r[h];
let c, p, l = -1, g = 0;
for (; g < a.length && (o.lastIndex = g, p = o.exec(a), p !== null); ) g = o.lastIndex, o === P ? p[1] === "!--" ? o = rt : p[1] !== void 0 ? o = ot : p[2] !== void 0 ? (ft.test(p[2]) && (i = RegExp("</" + p[2], "g")), o = v) : p[3] !== void 0 && (o = v) : o === v ? p[0] === ">" ? (o = i ?? P, l = -1) : p[1] === void 0 ? l = -2 : (l = o.lastIndex - p[2].length, c = p[1], o = p[3] === void 0 ? v : p[3] === '"' ? at : nt) : o === at || o === nt ? o = v : o === rt || o === ot ? o = P : (o = v, i = void 0);
const f = o === v && r[h + 1].startsWith("/>") ? " " : "";
n += o === P ? a + Ct : l >= 0 ? (s.push(c), a.slice(0, l) + ut + a.slice(l) + $ + f) : a + $ + (l === -2 ? h : f);
const Pt = (s, t) => {
const e = s.length - 1, i = [];
let r, o = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", n = P;
for (let c = 0; c < e; c++) {
const a = s[c];
let l, d, h = -1, g = 0;
for (; g < a.length && (n.lastIndex = g, d = n.exec(a), d !== null); ) g = n.lastIndex, n === P ? d[1] === "!--" ? n = rt : d[1] !== void 0 ? n = ot : d[2] !== void 0 ? (gt.test(d[2]) && (r = RegExp("</" + d[2], "g")), n = m) : d[3] !== void 0 && (n = m) : n === m ? d[0] === ">" ? (n = r ?? P, h = -1) : d[1] === void 0 ? h = -2 : (h = n.lastIndex - d[2].length, l = d[1], n = d[3] === void 0 ? m : d[3] === '"' ? at : nt) : n === at || n === nt ? n = m : n === rt || n === ot ? n = P : (n = m, r = void 0);
const f = n === m && s[c + 1].startsWith("/>") ? " " : "";
o += n === P ? a + St : h >= 0 ? (i.push(l), a.slice(0, h) + pt + a.slice(h) + $ + f) : a + $ + (h === -2 ? c : f);
}
return [$t(r, n + (r[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), s];
return [ft(s, o + (s[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
};
class H {
constructor({ strings: t, _$litType$: e }, s) {
let i;
constructor({ strings: t, _$litType$: e }, i) {
let r;
this.parts = [];
let n = 0, o = 0;
const h = t.length - 1, a = this.parts, [c, p] = Ot(t, e);
if (this.el = H.createElement(c, s), y.currentNode = this.el.content, e === 2 || e === 3) {
const l = this.el.content.firstChild;
l.replaceWith(...l.childNodes);
let o = 0, n = 0;
const c = t.length - 1, a = this.parts, [l, d] = Pt(t, e);
if (this.el = H.createElement(l, i), y.currentNode = this.el.content, e === 2 || e === 3) {
const h = this.el.content.firstChild;
h.replaceWith(...h.childNodes);
}
for (; (i = y.nextNode()) !== null && a.length < h; ) {
if (i.nodeType === 1) {
if (i.hasAttributes()) for (const l of i.getAttributeNames()) if (l.endsWith(ut)) {
const g = p[o++], f = i.getAttribute(l).split($), L = /([.?@])?(.*)/.exec(g);
a.push({ type: 1, index: n, name: L[2], strings: f, ctor: L[1] === "." ? Ut : L[1] === "?" ? Mt : L[1] === "@" ? Ht : V }), i.removeAttribute(l);
} else l.startsWith($) && (a.push({ type: 6, index: n }), i.removeAttribute(l));
if (ft.test(i.tagName)) {
const l = i.textContent.split($), g = l.length - 1;
for (; (r = y.nextNode()) !== null && a.length < c; ) {
if (r.nodeType === 1) {
if (r.hasAttributes()) for (const h of r.getAttributeNames()) if (h.endsWith(pt)) {
const g = d[n++], f = r.getAttribute(h).split($), L = /([.?@])?(.*)/.exec(g);
a.push({ type: 1, index: o, name: L[2], strings: f, ctor: L[1] === "." ? Ot : L[1] === "?" ? Tt : L[1] === "@" ? Mt : V }), r.removeAttribute(h);
} else h.startsWith($) && (a.push({ type: 6, index: o }), r.removeAttribute(h));
if (gt.test(r.tagName)) {
const h = r.textContent.split($), g = h.length - 1;
if (g > 0) {
i.textContent = j ? j.emptyScript : "";
for (let f = 0; f < g; f++) i.append(l[f], U()), y.nextNode(), a.push({ type: 2, index: ++n });
i.append(l[g], U());
r.textContent = j ? j.emptyScript : "";
for (let f = 0; f < g; f++) r.append(h[f], T()), y.nextNode(), a.push({ type: 2, index: ++o });
r.append(h[g], T());
}
}
} else if (i.nodeType === 8) if (i.data === gt) a.push({ type: 2, index: n });
} else if (r.nodeType === 8) if (r.data === ut) a.push({ type: 2, index: o });
else {
let l = -1;
for (; (l = i.data.indexOf($, l + 1)) !== -1; ) a.push({ type: 7, index: n }), l += $.length - 1;
let h = -1;
for (; (h = r.data.indexOf($, h + 1)) !== -1; ) a.push({ type: 7, index: o }), h += $.length - 1;
}
n++;
o++;
}
}
static createElement(t, e) {
const s = A.createElement("template");
return s.innerHTML = t, s;
const i = A.createElement("template");
return i.innerHTML = t, i;
}
}
function S(r, t, e = r, s) {
var o, h;
function S(s, t, e = s, i) {
var n, c;
if (t === E) return t;
let i = s !== void 0 ? (o = e._$Co) == null ? void 0 : o[s] : e._$Cl;
const n = M(t) ? void 0 : t._$litDirective$;
return (i == null ? void 0 : i.constructor) !== n && ((h = i == null ? void 0 : i._$AO) == null || h.call(i, !1), n === void 0 ? i = void 0 : (i = new n(r), i._$AT(r, e, s)), s !== void 0 ? (e._$Co ?? (e._$Co = []))[s] = i : e._$Cl = i), i !== void 0 && (t = S(r, i._$AS(r, t.values), i, s)), t;
let r = i !== void 0 ? (n = e._$Co) == null ? void 0 : n[i] : e._$Cl;
const o = M(t) ? void 0 : t._$litDirective$;
return (r == null ? void 0 : r.constructor) !== o && ((c = r == null ? void 0 : r._$AO) == null || c.call(r, !1), o === void 0 ? r = void 0 : (r = new o(s), r._$AT(s, e, i)), i !== void 0 ? (e._$Co ?? (e._$Co = []))[i] = r : e._$Cl = r), r !== void 0 && (t = S(s, r._$AS(s, t.values), r, i)), t;
}
class Tt {
class Ut {
constructor(t, e) {

@@ -382,17 +382,17 @@ this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;

u(t) {
const { el: { content: e }, parts: s } = this._$AD, i = ((t == null ? void 0 : t.creationScope) ?? A).importNode(e, !0);
y.currentNode = i;
let n = y.nextNode(), o = 0, h = 0, a = s[0];
const { el: { content: e }, parts: i } = this._$AD, r = ((t == null ? void 0 : t.creationScope) ?? A).importNode(e, !0);
y.currentNode = r;
let o = y.nextNode(), n = 0, c = 0, a = i[0];
for (; a !== void 0; ) {
if (o === a.index) {
let c;
a.type === 2 ? c = new N(n, n.nextSibling, this, t) : a.type === 1 ? c = new a.ctor(n, a.name, a.strings, this, t) : a.type === 6 && (c = new Nt(n, this, t)), this._$AV.push(c), a = s[++h];
if (n === a.index) {
let l;
a.type === 2 ? l = new N(o, o.nextSibling, this, t) : a.type === 1 ? l = new a.ctor(o, a.name, a.strings, this, t) : a.type === 6 && (l = new Ht(o, this, t)), this._$AV.push(l), a = i[++c];
}
o !== (a == null ? void 0 : a.index) && (n = y.nextNode(), o++);
n !== (a == null ? void 0 : a.index) && (o = y.nextNode(), n++);
}
return y.currentNode = A, i;
return y.currentNode = A, r;
}
p(t) {
let e = 0;
for (const s of this._$AV) s !== void 0 && (s.strings !== void 0 ? (s._$AI(t, s, e), e += s.strings.length - 2) : s._$AI(t[e])), e++;
for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
}

@@ -405,4 +405,4 @@ }

}
constructor(t, e, s, i) {
this.type = 2, this._$AH = d, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = s, this.options = i, this._$Cv = (i == null ? void 0 : i.isConnected) ?? !0;
constructor(t, e, i, r) {
this.type = 2, this._$AH = p, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = r, this._$Cv = (r == null ? void 0 : r.isConnected) ?? !0;
}

@@ -421,3 +421,3 @@ get parentNode() {

_$AI(t, e = this) {
t = S(this, t, e), M(t) ? t === d || t == null || t === "" ? (this._$AH !== d && this._$AR(), this._$AH = d) : t !== this._$AH && t !== E && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : kt(t) ? this.k(t) : this._(t);
t = S(this, t, e), M(t) ? t === p || t == null || t === "" ? (this._$AH !== p && this._$AR(), this._$AH = p) : t !== this._$AH && t !== E && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Ct(t) ? this.k(t) : this._(t);
}

@@ -431,16 +431,16 @@ O(t) {

_(t) {
this._$AH !== d && M(this._$AH) ? this._$AA.nextSibling.data = t : this.T(A.createTextNode(t)), this._$AH = t;
this._$AH !== p && M(this._$AH) ? this._$AA.nextSibling.data = t : this.T(A.createTextNode(t)), this._$AH = t;
}
$(t) {
var n;
const { values: e, _$litType$: s } = t, i = typeof s == "number" ? this._$AC(t) : (s.el === void 0 && (s.el = H.createElement($t(s.h, s.h[0]), this.options)), s);
if (((n = this._$AH) == null ? void 0 : n._$AD) === i) this._$AH.p(e);
var o;
const { values: e, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = H.createElement(ft(i.h, i.h[0]), this.options)), i);
if (((o = this._$AH) == null ? void 0 : o._$AD) === r) this._$AH.p(e);
else {
const o = new Tt(i, this), h = o.u(this.options);
o.p(e), this.T(h), this._$AH = o;
const n = new Ut(r, this), c = n.u(this.options);
n.p(e), this.T(c), this._$AH = n;
}
}
_$AC(t) {
let e = ht.get(t.strings);
return e === void 0 && ht.set(t.strings, e = new H(t)), e;
let e = ct.get(t.strings);
return e === void 0 && ct.set(t.strings, e = new H(t)), e;
}

@@ -450,11 +450,11 @@ k(t) {

const e = this._$AH;
let s, i = 0;
for (const n of t) i === e.length ? e.push(s = new N(this.O(U()), this.O(U()), this, this.options)) : s = e[i], s._$AI(n), i++;
i < e.length && (this._$AR(s && s._$AB.nextSibling, i), e.length = i);
let i, r = 0;
for (const o of t) r === e.length ? e.push(i = new N(this.O(T()), this.O(T()), this, this.options)) : i = e[r], i._$AI(o), r++;
r < e.length && (this._$AR(i && i._$AB.nextSibling, r), e.length = r);
}
_$AR(t = this._$AA.nextSibling, e) {
var s;
for ((s = this._$AP) == null ? void 0 : s.call(this, !1, !0, e); t !== this._$AB; ) {
const i = t.nextSibling;
t.remove(), t = i;
var i;
for ((i = this._$AP) == null ? void 0 : i.call(this, !1, !0, e); t !== this._$AB; ) {
const r = t.nextSibling;
t.remove(), t = r;
}

@@ -474,21 +474,21 @@ }

}
constructor(t, e, s, i, n) {
this.type = 1, this._$AH = d, 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 = d;
constructor(t, e, i, r, o) {
this.type = 1, this._$AH = p, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = o, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = p;
}
_$AI(t, e = this, s, i) {
const n = this.strings;
let o = !1;
if (n === void 0) t = S(this, t, e, 0), o = !M(t) || t !== this._$AH && t !== E, o && (this._$AH = t);
_$AI(t, e = this, i, r) {
const o = this.strings;
let n = !1;
if (o === void 0) t = S(this, t, e, 0), n = !M(t) || t !== this._$AH && t !== E, n && (this._$AH = t);
else {
const h = t;
let a, c;
for (t = n[0], a = 0; a < n.length - 1; a++) c = S(this, h[s + a], e, a), c === E && (c = this._$AH[a]), o || (o = !M(c) || c !== this._$AH[a]), c === d ? t = d : t !== d && (t += (c ?? "") + n[a + 1]), this._$AH[a] = c;
const c = t;
let a, l;
for (t = o[0], a = 0; a < o.length - 1; a++) l = S(this, c[i + a], e, a), l === E && (l = this._$AH[a]), n || (n = !M(l) || l !== this._$AH[a]), l === p ? t = p : t !== p && (t += (l ?? "") + o[a + 1]), this._$AH[a] = l;
}
o && !i && this.j(t);
n && !r && this.j(t);
}
j(t) {
t === d ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
t === p ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
}
}
class Ut extends V {
class Ot extends V {
constructor() {

@@ -498,6 +498,6 @@ super(...arguments), this.type = 3;

j(t) {
this.element[this.name] = t === d ? void 0 : t;
this.element[this.name] = t === p ? void 0 : t;
}
}
class Mt extends V {
class Tt extends V {
constructor() {

@@ -507,13 +507,13 @@ super(...arguments), this.type = 4;

j(t) {
this.element.toggleAttribute(this.name, !!t && t !== d);
this.element.toggleAttribute(this.name, !!t && t !== p);
}
}
class Ht extends V {
constructor(t, e, s, i, n) {
super(t, e, s, i, n), this.type = 5;
class Mt extends V {
constructor(t, e, i, r, o) {
super(t, e, i, r, o), this.type = 5;
}
_$AI(t, e = this) {
if ((t = S(this, t, e, 0) ?? d) === E) return;
const s = this._$AH, i = t === d && s !== d || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, n = t !== d && (s === d || i);
i && this.element.removeEventListener(this.name, this, s), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
if ((t = S(this, t, e, 0) ?? p) === E) return;
const i = this._$AH, r = t === p && i !== p || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, o = t !== p && (i === p || r);
r && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, t), this._$AH = t;
}

@@ -525,5 +525,5 @@ handleEvent(t) {

}
class Nt {
constructor(t, e, s) {
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = s;
class Ht {
constructor(t, e, i) {
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
}

@@ -537,12 +537,12 @@ get _$AU() {

}
const F = T.litHtmlPolyfillSupport;
F == null || F(H, N), (T.litHtmlVersions ?? (T.litHtmlVersions = [])).push("3.3.1");
const Rt = (r, t, e) => {
const s = (e == null ? void 0 : e.renderBefore) ?? t;
let i = s._$litPart$;
if (i === void 0) {
const n = (e == null ? void 0 : e.renderBefore) ?? null;
s._$litPart$ = i = new N(t.insertBefore(U(), n), n, void 0, e ?? {});
const J = O.litHtmlPolyfillSupport;
J == null || J(H, N), (O.litHtmlVersions ?? (O.litHtmlVersions = [])).push("3.3.1");
const Nt = (s, t, e) => {
const i = (e == null ? void 0 : e.renderBefore) ?? t;
let r = i._$litPart$;
if (r === void 0) {
const o = (e == null ? void 0 : e.renderBefore) ?? null;
i._$litPart$ = r = new N(t.insertBefore(T(), o), o, void 0, e ?? {});
}
return i._$AI(r), i;
return r._$AI(s), r;
};

@@ -555,3 +555,3 @@ /**

const b = globalThis;
let w = class extends x {
let x = class extends w {
constructor() {

@@ -567,3 +567,3 @@ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;

const e = this.render();
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Rt(e, this.renderRoot, this.renderOptions);
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Nt(e, this.renderRoot, this.renderOptions);
}

@@ -583,5 +583,5 @@ connectedCallback() {

var lt;
w._$litElement$ = !0, w.finalized = !0, (lt = b.litElementHydrateSupport) == null || lt.call(b, { LitElement: w });
const J = b.litElementPolyfillSupport;
J == null || J({ LitElement: w });
x._$litElement$ = !0, x.finalized = !0, (lt = b.litElementHydrateSupport) == null || lt.call(b, { LitElement: x });
const q = b.litElementPolyfillSupport;
q == null || q({ LitElement: x });
(b.litElementVersions ?? (b.litElementVersions = [])).push("4.2.1");

@@ -593,6 +593,6 @@ /**

*/
const _t = (r) => (t, e) => {
const $t = (s) => (t, e) => {
e !== void 0 ? e.addInitializer((() => {
customElements.define(r, t);
})) : customElements.define(r, t);
customElements.define(s, t);
})) : customElements.define(s, t);
};

@@ -604,28 +604,28 @@ /**

*/
const Lt = { attribute: !0, type: String, converter: D, reflect: !1, hasChanged: Q }, It = (r = Lt, t, e) => {
const { kind: s, metadata: i } = e;
let n = globalThis.litPropertyMetadata.get(i);
if (n === void 0 && globalThis.litPropertyMetadata.set(i, n = /* @__PURE__ */ new Map()), s === "setter" && ((r = Object.create(r)).wrapped = !0), n.set(e.name, r), s === "accessor") {
const { name: o } = e;
return { set(h) {
const Rt = { attribute: !0, type: String, converter: D, reflect: !1, hasChanged: Q }, Lt = (s = Rt, t, e) => {
const { kind: i, metadata: r } = e;
let o = globalThis.litPropertyMetadata.get(r);
if (o === void 0 && globalThis.litPropertyMetadata.set(r, o = /* @__PURE__ */ new Map()), i === "setter" && ((s = Object.create(s)).wrapped = !0), o.set(e.name, s), i === "accessor") {
const { name: n } = e;
return { set(c) {
const a = t.get.call(this);
t.set.call(this, h), this.requestUpdate(o, a, r);
}, init(h) {
return h !== void 0 && this.C(o, void 0, r, h), h;
t.set.call(this, c), this.requestUpdate(n, a, s);
}, init(c) {
return c !== void 0 && this.C(n, void 0, s, c), c;
} };
}
if (s === "setter") {
const { name: o } = e;
return function(h) {
const a = this[o];
t.call(this, h), this.requestUpdate(o, a, r);
if (i === "setter") {
const { name: n } = e;
return function(c) {
const a = this[n];
t.call(this, c), this.requestUpdate(n, a, s);
};
}
throw Error("Unsupported decorator location: " + s);
throw Error("Unsupported decorator location: " + i);
};
function R(r) {
return (t, e) => typeof e == "object" ? It(r, t, e) : ((s, i, n) => {
const o = i.hasOwnProperty(n);
return i.constructor.createProperty(n, s), o ? Object.getOwnPropertyDescriptor(i, n) : void 0;
})(r, t, e);
function R(s) {
return (t, e) => typeof e == "object" ? Lt(s, t, e) : ((i, r, o) => {
const n = r.hasOwnProperty(o);
return r.constructor.createProperty(o, i), n ? Object.getOwnPropertyDescriptor(r, o) : void 0;
})(s, t, e);
}

@@ -637,4 +637,4 @@ /**

*/
function k(r) {
return R({ ...r, state: !0, attribute: !1 });
function k(s) {
return R({ ...s, state: !0, attribute: !1 });
}

@@ -646,4 +646,4 @@ /**

*/
const zt = { CHILD: 2 }, Dt = (r) => (...t) => ({ _$litDirective$: r, values: t });
class jt {
const It = { CHILD: 2 }, zt = (s) => (...t) => ({ _$litDirective$: s, values: t });
class Dt {
constructor(t) {

@@ -654,4 +654,4 @@ }

}
_$AT(t, e, s) {
this._$Ct = t, this._$AM = e, this._$Ci = s;
_$AT(t, e, i) {
this._$Ct = t, this._$AM = e, this._$Ci = i;
}

@@ -670,8 +670,8 @@ _$AS(t, e) {

*/
class K extends jt {
class K extends Dt {
constructor(t) {
if (super(t), this.it = d, t.type !== zt.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
if (super(t), this.it = p, t.type !== It.CHILD) throw Error(this.constructor.directiveName + "() can only be used in child bindings");
}
render(t) {
if (t === d || t == null) return this._t = void 0, this.it = t;
if (t === p || t == null) return this._t = void 0, this.it = t;
if (t === E) return t;

@@ -686,4 +686,16 @@ if (typeof t != "string") throw Error(this.constructor.directiveName + "() called with a non-string value");

K.directiveName = "unsafeHTML", K.resultType = 1;
const ct = Dt(K);
class Vt extends EventTarget {
const jt = zt(K);
function Vt() {
if (typeof crypto < "u" && crypto.randomUUID)
return crypto.randomUUID();
const s = new Uint8Array(16);
if (typeof crypto < "u" && crypto.getRandomValues)
crypto.getRandomValues(s);
else
for (let e = 0; e < 16; e++) s[e] = Math.random() * 256 | 0;
s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128;
const t = Array.from(s, (e) => e.toString(16).padStart(2, "0")).join("");
return `${t.slice(0, 8)}-${t.slice(8, 12)}-${t.slice(12, 16)}-${t.slice(16, 20)}-${t.slice(20)}`;
}
class Bt extends EventTarget {
constructor(t) {

@@ -703,3 +715,5 @@ super(), this.ws = null, this.reconnectAttempts = 0, this._status = "disconnected", this.config = {

if (((t = this.ws) == null ? void 0 : t.readyState) !== WebSocket.OPEN) {
this._status = "connecting", this.dispatchEvent(new CustomEvent("statuschange", { detail: this._status }));
typeof location < "u" && location.protocol === "https:" && this.config.url.startsWith("ws://") && console.warn(
"[socklog] Connecting with ws:// from an HTTPS page will be blocked as mixed content. Use wss:// instead."
), this._status = "connecting", this.dispatchEvent(new CustomEvent("statuschange", { detail: this._status }));
try {

@@ -725,15 +739,15 @@ this.ws = new WebSocket(this.config.url), this.setupEventHandlers();

const e = t.data;
let s;
let i;
try {
s = JSON.parse(e);
i = JSON.parse(e);
} catch {
s = e;
i = e;
}
const i = {
id: crypto.randomUUID(),
const r = {
id: Vt(),
timestamp: /* @__PURE__ */ new Date(),
data: s,
data: i,
raw: e
};
this.dispatchEvent(new CustomEvent("log", { detail: i }));
this.dispatchEvent(new CustomEvent("log", { detail: r }));
});

@@ -745,3 +759,3 @@ }

}
class Bt extends EventTarget {
class Wt extends EventTarget {
constructor(t = 1e3) {

@@ -777,4 +791,4 @@ super(), this.logs = [], this._filter = {}, this._paused = !1, this.maxLogs = t;

if (e) {
const s = e.toLowerCase();
return t.raw.toLowerCase().includes(s);
const i = e.toLowerCase();
return t.raw.toLowerCase().includes(i);
}

@@ -787,8 +801,8 @@ return !0;

}
var Wt = Object.defineProperty, qt = Object.getOwnPropertyDescriptor, m = (r, t, e, s) => {
for (var i = s > 1 ? void 0 : s ? qt(t, e) : t, n = r.length - 1, o; n >= 0; n--)
(o = r[n]) && (i = (s ? o(t, e, i) : o(i)) || i);
return s && i && Wt(t, e, i), i;
var Ft = Object.defineProperty, Jt = Object.getOwnPropertyDescriptor, _ = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? Jt(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
return i && r && Ft(t, e, r), r;
};
let u = class extends w {
let u = class extends x {
constructor() {

@@ -801,12 +815,12 @@ super(...arguments), this.url = "", this.maxLogs = 1e3, this.indent = 4, this.logs = [], this.status = "disconnected", this.searchTerm = "", this.expandedIds = /* @__PURE__ */ new Set(), this.client = null, this.store = null;

disconnectedCallback() {
var r;
super.disconnectedCallback(), (r = this.client) == null || r.disconnect();
var s;
super.disconnectedCallback(), (s = this.client) == null || s.disconnect();
}
initializeStore() {
this.store = new Bt(this.maxLogs), this.store.addEventListener("logadded", () => {
var r;
this.logs = ((r = this.store) == null ? void 0 : r.getFiltered()) ?? [];
this.store = new Wt(this.maxLogs), this.store.addEventListener("logadded", () => {
var s;
this.logs = ((s = this.store) == null ? void 0 : s.getFiltered()) ?? [];
}), this.store.addEventListener("filterchange", () => {
var r, t;
this.logs = ((r = this.store) == null ? void 0 : r.getFiltered()) ?? [], this.searchTerm = ((t = this.store) == null ? void 0 : t.filter.search) ?? "";
var s, t;
this.logs = ((s = this.store) == null ? void 0 : s.getFiltered()) ?? [], this.searchTerm = ((t = this.store) == null ? void 0 : t.filter.search) ?? "";
}), this.store.addEventListener("logscleared", () => {

@@ -817,12 +831,12 @@ this.logs = [];

connect() {
this.url && (this.client = new Vt({ url: this.url }), this.client.addEventListener("statuschange", ((r) => {
this.status = r.detail;
})), this.client.addEventListener("log", ((r) => {
this.url && (this.client = new Bt({ url: this.url }), this.client.addEventListener("statuschange", ((s) => {
this.status = s.detail;
})), this.client.addEventListener("log", ((s) => {
var t;
(t = this.store) == null || t.add(r.detail);
(t = this.store) == null || t.add(s.detail);
})), this.client.connect());
}
clear() {
var r;
(r = this.store) == null || r.clear();
var s;
(s = this.store) == null || s.clear();
}

@@ -832,7 +846,7 @@ getStore() {

}
toggleExpanded(r) {
this.expandedIds.has(r) ? this.expandedIds.delete(r) : this.expandedIds.add(r), this.expandedIds = new Set(this.expandedIds);
toggleExpanded(s) {
this.expandedIds.has(s) ? this.expandedIds.delete(s) : this.expandedIds.add(s), this.expandedIds = new Set(this.expandedIds);
}
formatTimestamp(r) {
return r.toLocaleTimeString("en-US", {
formatTimestamp(s) {
return s.toLocaleTimeString("en-US", {
hour12: !1,

@@ -845,16 +859,52 @@ hour: "2-digit",

}
formatJson(r, t = !1) {
tokenizeJson(s) {
const t = [];
let e = 0;
for (; e < s.length; ) {
const i = s[e];
if (/\s/.test(i)) {
let o = "";
for (; e < s.length && /\s/.test(s[e]); )
o += s[e], e++;
t.push({ type: "whitespace", value: o });
continue;
}
if (i === "{" || i === "}" || i === "[" || i === "]" || i === ":" || i === ",") {
t.push({ type: "punctuation", value: i }), e++;
continue;
}
if (i === '"') {
let o = '"';
for (e++; e < s.length; )
if (s[e] === "\\" && e + 1 < s.length)
o += s[e] + s[e + 1], e += 2;
else if (s[e] === '"') {
o += '"', e++;
break;
} else
o += s[e], e++;
t.push({ type: "string", value: o });
continue;
}
let r = "";
for (; e < s.length && !/[\s{}[\]:,"]/.test(s[e]); )
r += s[e], e++;
r && t.push({ type: "value", value: r });
}
return t;
}
formatJson(s, t = !1) {
let e;
typeof r == "string" ? e = r : e = t ? JSON.stringify(r, null, this.indent) : JSON.stringify(r);
const i = e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(
/(&quot;|")([^"\\]|\\.)*?\1(?=\s*:)/g,
'<span class="json-key">$&</span>'
);
if (!this.searchTerm)
return ct(i);
const n = this.searchTerm.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), o = new RegExp(`(${n})`, "gi"), h = i.replace(
/(<[^>]*>)|([^<]+)/g,
(a, c, p) => c || p.replace(o, '<span class="search-highlight">$1</span>')
);
return ct(h);
typeof s == "string" ? e = s : e = t ? JSON.stringify(s, null, this.indent) : JSON.stringify(s);
const i = this.tokenizeJson(e), r = [];
for (let n = 0; n < i.length; n++) {
const c = i[n], a = i[n + 1], l = c.value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), d = c.type === "string" && (a == null ? void 0 : a.value) === ":";
c.type === "whitespace" ? r.push(l) : c.type === "punctuation" ? r.push(`<span class="json-punct">${l}</span>`) : d ? r.push(`<span class="json-key">${l}</span>`) : c.type === "string" ? r.push(`<span class="json-string">${l}</span>`) : r.push(`<span class="json-value">${l}</span>`);
}
let o = t ? r.join("") : r.join("<wbr>");
if (this.searchTerm) {
const n = this.searchTerm.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), c = new RegExp(`(${n})`, "gi");
o = o.replace(/(<[^>]*>)|([^<]+)/g, (a, l, d) => l || d.replace(c, '<span class="search-highlight">$1</span>'));
}
return jt(o);
}

@@ -871,12 +921,11 @@ render() {

${this.logs.map(
(r) => z`
(s) => z`
<div class="log-entry">
<div class="log-header"
@click=${() => this.toggleExpanded(r.id)}>
<span class="expand-toggle">
${this.expandedIds.has(r.id) ? "⏷" : "⏵"}
</span>
<span class="timestamp">${this.formatTimestamp(r.timestamp)}</span>
<div class="log-header" @click=${() => this.toggleExpanded(s.id)}>
<span class="expand-toggle"> ${this.expandedIds.has(s.id) ? "⏷" : "⏵"} </span>
<span class="timestamp">${this.formatTimestamp(s.timestamp)}</span>
</div>
<div class="json">${this.formatJson(r.data, this.expandedIds.has(r.id))}</div>
<div class="json ${this.expandedIds.has(s.id) ? "expanded" : ""}">
${this.formatJson(s.data, this.expandedIds.has(s.id))}
</div>
</div>

@@ -889,3 +938,3 @@ `

};
u.styles = pt`
u.styles = dt`
:host {

@@ -937,5 +986,9 @@ display: block;

white-space: pre-wrap;
word-break: break-word;
}
.json.expanded {
white-space: pre;
overflow-x: auto;
}
.empty-state {

@@ -946,2 +999,10 @@ padding: var(--socklog-padding, 8px);

.json-key,
.json-string,
.json-value,
.json-punct {
display: inline;
white-space: nowrap;
}
.json-key {

@@ -955,32 +1016,32 @@ color: var(--socklog-key-color, #5c7cba);

`;
m([
_([
R({ type: String })
], u.prototype, "url", 2);
m([
_([
R({ type: Number })
], u.prototype, "maxLogs", 2);
m([
_([
R({ type: Number })
], u.prototype, "indent", 2);
m([
_([
k()
], u.prototype, "logs", 2);
m([
_([
k()
], u.prototype, "status", 2);
m([
_([
k()
], u.prototype, "searchTerm", 2);
m([
_([
k()
], u.prototype, "expandedIds", 2);
u = m([
_t("socklog-viewer")
u = _([
$t("socklog-viewer")
], u);
var Ft = Object.defineProperty, Jt = Object.getOwnPropertyDescriptor, B = (r, t, e, s) => {
for (var i = s > 1 ? void 0 : s ? Jt(t, e) : t, n = r.length - 1, o; n >= 0; n--)
(o = r[n]) && (i = (s ? o(t, e, i) : o(i)) || i);
return s && i && Ft(t, e, i), i;
var qt = Object.defineProperty, Kt = Object.getOwnPropertyDescriptor, B = (s, t, e, i) => {
for (var r = i > 1 ? void 0 : i ? Kt(t, e) : t, o = s.length - 1, n; o >= 0; o--)
(n = s[o]) && (r = (i ? n(t, e, r) : n(r)) || r);
return i && r && qt(t, e, r), r;
};
let C = class extends w {
let C = class extends x {
constructor() {

@@ -992,12 +1053,12 @@ super(...arguments), this.store = null, this.searchValue = "", this.paused = !1;

}
updated(r) {
r.has("store") && this.setupStoreListeners();
updated(s) {
s.has("store") && this.setupStoreListeners();
}
setupStoreListeners() {
this.store && this.store.addEventListener("pausechange", ((r) => {
this.paused = r.detail;
this.store && this.store.addEventListener("pausechange", ((s) => {
this.paused = s.detail;
}));
}
handleSearch(r) {
const t = r.target;
handleSearch(s) {
const t = s.target;
this.searchValue = t.value, this.updateFilter();

@@ -1007,4 +1068,4 @@ }

if (!this.store) return;
const r = {};
this.searchValue && (r.search = this.searchValue), this.store.filter = r;
const s = {};
this.searchValue && (s.search = this.searchValue), this.store.filter = s;
}

@@ -1015,4 +1076,4 @@ togglePause() {

clear() {
var r;
(r = this.store) == null || r.clear();
var s;
(s = this.store) == null || s.clear();
}

@@ -1032,3 +1093,6 @@ render() {

<div class="actions">
<button class="action-btn pause ${this.paused ? "active" : ""}" @click=${this.togglePause}>
<button
class="action-btn pause ${this.paused ? "active" : ""}"
@click=${this.togglePause}
>
${this.paused ? "Resume" : "Pause"}

@@ -1042,3 +1106,3 @@ </button>

};
C.styles = pt`
C.styles = dt`
:host {

@@ -1058,3 +1122,10 @@ display: block;

border-bottom: 1px solid var(--socklog-border-color, #e0e0e0);
font-family: var(--socklog-ui-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
font-family: var(
--socklog-ui-font-family,
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
sans-serif
);
font-size: 13px;

@@ -1128,10 +1199,10 @@ color: var(--socklog-color, inherit);

C = B([
_t("socklog-controls")
$t("socklog-controls")
], C);
export {
Bt as LogStore,
Wt as LogStore,
C as SocklogControls,
u as SocklogViewer,
Vt as WebSocketClient
Bt as WebSocketClient
};
//# sourceMappingURL=socklog.js.map

@@ -1,20 +0,20 @@

(function(h,f){typeof exports=="object"&&typeof module<"u"?f(exports):typeof define=="function"&&define.amd?define(["exports"],f):(h=typeof globalThis<"u"?globalThis:h||self,f(h.Socklog={}))})(this,(function(h){"use strict";/**
(function(d,f){typeof exports=="object"&&typeof module<"u"?f(exports):typeof define=="function"&&define.amd?define(["exports"],f):(d=typeof globalThis<"u"?globalThis:d||self,f(d.Socklog={}))})(this,(function(d){"use strict";/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/var mt;const f=globalThis,B=f.ShadowRoot&&(f.ShadyCSS===void 0||f.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,W=Symbol(),X=new WeakMap;let Y=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==W)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(B&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=X.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&X.set(e,t))}return t}toString(){return this.cssText}};const vt=o=>new Y(typeof o=="string"?o:o+"",void 0,W),tt=(o,...t)=>{const e=o.length===1?o[0]:t.reduce(((s,i,n)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[n+1]),o[0]);return new Y(e,o,W)},yt=(o,t)=>{if(B)o.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const e of t){const s=document.createElement("style"),i=f.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},et=B?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return vt(e)})(o):o;/**
*/var mt;const f=globalThis,B=f.ShadowRoot&&(f.ShadyCSS===void 0||f.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,W=Symbol(),X=new WeakMap;let Y=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==W)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(B&&t===void 0){const s=e!==void 0&&e.length===1;s&&(t=X.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&X.set(e,t))}return t}toString(){return this.cssText}};const vt=o=>new Y(typeof o=="string"?o:o+"",void 0,W),tt=(o,...t)=>{const e=o.length===1?o[0]:t.reduce(((s,i,n)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[n+1]),o[0]);return new Y(e,o,W)},_t=(o,t)=>{if(B)o.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(const e of t){const s=document.createElement("style"),i=f.litNonce;i!==void 0&&s.setAttribute("nonce",i),s.textContent=e.cssText,o.appendChild(s)}},et=B?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return vt(e)})(o):o;/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const{is:bt,defineProperty:At,getOwnPropertyDescriptor:St,getOwnPropertyNames:Et,getOwnPropertySymbols:wt,getPrototypeOf:xt}=Object,$=globalThis,st=$.trustedTypes,kt=st?st.emptyScript:"",q=$.reactiveElementPolyfillSupport,P=(o,t)=>o,R={toAttribute(o,t){switch(t){case Boolean:o=o?kt:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},F=(o,t)=>!bt(o,t),it={attribute:!0,type:String,converter:R,reflect:!1,useDefault:!1,hasChanged:F};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),$.litPropertyMetadata??($.litPropertyMetadata=new WeakMap);let w=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=it){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);i!==void 0&&At(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:n}=St(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get:i,set(r){const c=i==null?void 0:i.call(this);n==null||n.call(this,r),this.requestUpdate(t,c,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??it}static _$Ei(){if(this.hasOwnProperty(P("elementProperties")))return;const t=xt(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(P("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(P("properties"))){const e=this.properties,s=[...Et(e),...wt(e)];for(const i of s)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}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 i of s)e.unshift(et(i))}else t!==void 0&&e.push(et(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach((e=>e(this)))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.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 yt(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach((e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)}))}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach((e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){var n;const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const r=(((n=s.converter)==null?void 0:n.toAttribute)!==void 0?s.converter:R).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){var n,r;const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const c=s.getPropertyOptions(i),a=typeof c.converter=="function"?{fromAttribute:c.converter}:((n=c.converter)==null?void 0:n.fromAttribute)!==void 0?c.converter:R;this._$Em=i;const d=a.fromAttribute(e,c.type);this[i]=d??((r=this._$Ej)==null?void 0:r.get(i))??d,this._$Em=null}}requestUpdate(t,e,s){var i;if(t!==void 0){const n=this.constructor,r=this[t];if(s??(s=n.getPropertyOptions(t)),!((s.hasChanged??F)(r,e)||s.useDefault&&s.reflect&&r===((i=this._$Ej)==null?void 0:i.get(t))&&!this.hasAttribute(n._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:i,wrapped:n},r){s&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,r??e??this[t]),n!==!0||r!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),i===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[n,r]of this._$Ep)this[n]=r;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[n,r]of i){const{wrapped:c}=r,a=this[n];c!==!0||this._$AL.has(n)||a===void 0||this.C(n,void 0,r,a)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach((i=>{var n;return(n=i.hostUpdate)==null?void 0:n.call(i)})),this.update(e)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach((s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)})),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=this._$Eq.forEach((e=>this._$ET(e,this[e])))),this._$EM()}updated(t){}firstUpdated(t){}};w.elementStyles=[],w.shadowRootOptions={mode:"open"},w[P("elementProperties")]=new Map,w[P("finalized")]=new Map,q==null||q({ReactiveElement:w}),($.reactiveElementVersions??($.reactiveElementVersions=[])).push("2.1.1");/**
*/const{is:yt,defineProperty:bt,getOwnPropertyDescriptor:At,getOwnPropertyNames:wt,getOwnPropertySymbols:St,getPrototypeOf:Et}=Object,$=globalThis,st=$.trustedTypes,kt=st?st.emptyScript:"",F=$.reactiveElementPolyfillSupport,P=(o,t)=>o,L={toAttribute(o,t){switch(t){case Boolean:o=o?kt:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},J=(o,t)=>!yt(o,t),it={attribute:!0,type:String,converter:L,reflect:!1,useDefault:!1,hasChanged:J};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),$.litPropertyMetadata??($.litPropertyMetadata=new WeakMap);let E=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=it){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);i!==void 0&&bt(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:n}=At(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get:i,set(r){const l=i==null?void 0:i.call(this);n==null||n.call(this,r),this.requestUpdate(t,l,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??it}static _$Ei(){if(this.hasOwnProperty(P("elementProperties")))return;const t=Et(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(P("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(P("properties"))){const e=this.properties,s=[...wt(e),...St(e)];for(const i of s)this.createProperty(i,e[i])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[s,i]of e)this.elementProperties.set(s,i)}this._$Eh=new Map;for(const[e,s]of this.elementProperties){const i=this._$Eu(e,s);i!==void 0&&this._$Eh.set(i,e)}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 i of s)e.unshift(et(i))}else t!==void 0&&e.push(et(t));return e}static _$Eu(t,e){const s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach((e=>e(this)))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.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 _t(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach((e=>{var s;return(s=e.hostConnected)==null?void 0:s.call(e)}))}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach((e=>{var s;return(s=e.hostDisconnected)==null?void 0:s.call(e)}))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){var n;const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(i!==void 0&&s.reflect===!0){const r=(((n=s.converter)==null?void 0:n.toAttribute)!==void 0?s.converter:L).toAttribute(e,s.type);this._$Em=t,r==null?this.removeAttribute(i):this.setAttribute(i,r),this._$Em=null}}_$AK(t,e){var n,r;const s=this.constructor,i=s._$Eh.get(t);if(i!==void 0&&this._$Em!==i){const l=s.getPropertyOptions(i),a=typeof l.converter=="function"?{fromAttribute:l.converter}:((n=l.converter)==null?void 0:n.fromAttribute)!==void 0?l.converter:L;this._$Em=i;const h=a.fromAttribute(e,l.type);this[i]=h??((r=this._$Ej)==null?void 0:r.get(i))??h,this._$Em=null}}requestUpdate(t,e,s){var i;if(t!==void 0){const n=this.constructor,r=this[t];if(s??(s=n.getPropertyOptions(t)),!((s.hasChanged??J)(r,e)||s.useDefault&&s.reflect&&r===((i=this._$Ej)==null?void 0:i.get(t))&&!this.hasAttribute(n._$Eu(t,s))))return;this.C(t,e,s)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:i,wrapped:n},r){s&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,r??e??this[t]),n!==!0||r!==void 0)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),i===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var s;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[n,r]of this._$Ep)this[n]=r;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[n,r]of i){const{wrapped:l}=r,a=this[n];l!==!0||this._$AL.has(n)||a===void 0||this.C(n,void 0,r,a)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(s=this._$EO)==null||s.forEach((i=>{var n;return(n=i.hostUpdate)==null?void 0:n.call(i)})),this.update(e)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach((s=>{var i;return(i=s.hostUpdated)==null?void 0:i.call(s)})),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=this._$Eq.forEach((e=>this._$ET(e,this[e])))),this._$EM()}updated(t){}firstUpdated(t){}};E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[P("elementProperties")]=new Map,E[P("finalized")]=new Map,F==null||F({ReactiveElement:E}),($.reactiveElementVersions??($.reactiveElementVersions=[])).push("2.1.1");/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const T=globalThis,I=T.trustedTypes,ot=I?I.createPolicy("lit-html",{createHTML:o=>o}):void 0,rt="$lit$",_=`lit$${Math.random().toFixed(9).slice(2)}$`,nt="?"+_,Ct=`<${nt}>`,y=document,O=()=>y.createComment(""),U=o=>o===null||typeof o!="object"&&typeof o!="function",J=Array.isArray,Pt=o=>J(o)||typeof(o==null?void 0:o[Symbol.iterator])=="function",K=`[
\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,at=/-->/g,ct=/>/g,b=RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`,"g"),lt=/'/g,ht=/"/g,dt=/^(?:script|style|textarea|title)$/i,Tt=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),z=Tt(1),A=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),ut=new WeakMap,S=y.createTreeWalker(y,129);function pt(o,t){if(!J(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return ot!==void 0?ot.createHTML(t):t}const Ot=(o,t)=>{const e=o.length-1,s=[];let i,n=t===2?"<svg>":t===3?"<math>":"",r=M;for(let c=0;c<e;c++){const a=o[c];let d,p,l=-1,g=0;for(;g<a.length&&(r.lastIndex=g,p=r.exec(a),p!==null);)g=r.lastIndex,r===M?p[1]==="!--"?r=at:p[1]!==void 0?r=ct:p[2]!==void 0?(dt.test(p[2])&&(i=RegExp("</"+p[2],"g")),r=b):p[3]!==void 0&&(r=b):r===b?p[0]===">"?(r=i??M,l=-1):p[1]===void 0?l=-2:(l=r.lastIndex-p[2].length,d=p[1],r=p[3]===void 0?b:p[3]==='"'?ht:lt):r===ht||r===lt?r=b:r===at||r===ct?r=M:(r=b,i=void 0);const v=r===b&&o[c+1].startsWith("/>")?" ":"";n+=r===M?a+Ct:l>=0?(s.push(d),a.slice(0,l)+rt+a.slice(l)+_+v):a+_+(l===-2?c:v)}return[pt(o,n+(o[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class H{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,r=0;const c=t.length-1,a=this.parts,[d,p]=Ot(t,e);if(this.el=H.createElement(d,s),S.currentNode=this.el.content,e===2||e===3){const l=this.el.content.firstChild;l.replaceWith(...l.childNodes)}for(;(i=S.nextNode())!==null&&a.length<c;){if(i.nodeType===1){if(i.hasAttributes())for(const l of i.getAttributeNames())if(l.endsWith(rt)){const g=p[r++],v=i.getAttribute(l).split(_),V=/([.?@])?(.*)/.exec(g);a.push({type:1,index:n,name:V[2],strings:v,ctor:V[1]==="."?Mt:V[1]==="?"?Ht:V[1]==="@"?Nt:j}),i.removeAttribute(l)}else l.startsWith(_)&&(a.push({type:6,index:n}),i.removeAttribute(l));if(dt.test(i.tagName)){const l=i.textContent.split(_),g=l.length-1;if(g>0){i.textContent=I?I.emptyScript:"";for(let v=0;v<g;v++)i.append(l[v],O()),S.nextNode(),a.push({type:2,index:++n});i.append(l[g],O())}}}else if(i.nodeType===8)if(i.data===nt)a.push({type:2,index:n});else{let l=-1;for(;(l=i.data.indexOf(_,l+1))!==-1;)a.push({type:7,index:n}),l+=_.length-1}n++}}static createElement(t,e){const s=y.createElement("template");return s.innerHTML=t,s}}function x(o,t,e=o,s){var r,c;if(t===A)return t;let i=s!==void 0?(r=e._$Co)==null?void 0:r[s]:e._$Cl;const n=U(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==n&&((c=i==null?void 0:i._$AO)==null||c.call(i,!1),n===void 0?i=void 0:(i=new n(o),i._$AT(o,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=i:e._$Cl=i),i!==void 0&&(t=x(o,i._$AS(o,t.values),i,s)),t}class Ut{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==null?void 0:t.creationScope)??y).importNode(e,!0);S.currentNode=i;let n=S.nextNode(),r=0,c=0,a=s[0];for(;a!==void 0;){if(r===a.index){let d;a.type===2?d=new N(n,n.nextSibling,this,t):a.type===1?d=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(d=new Lt(n,this,t)),this._$AV.push(d),a=s[++c]}r!==(a==null?void 0:a.index)&&(n=S.nextNode(),r++)}return S.currentNode=y,i}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class N{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=u,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=x(this,t,e),U(t)?t===u||t==null||t===""?(this._$AH!==u&&this._$AR(),this._$AH=u):t!==this._$AH&&t!==A&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Pt(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!==u&&U(this._$AH)?this._$AA.nextSibling.data=t:this.T(y.createTextNode(t)),this._$AH=t}$(t){var n;const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=H.createElement(pt(s.h,s.h[0]),this.options)),s);if(((n=this._$AH)==null?void 0:n._$AD)===i)this._$AH.p(e);else{const r=new Ut(i,this),c=r.u(this.options);r.p(e),this.T(c),this._$AH=r}}_$AC(t){let e=ut.get(t.strings);return e===void 0&&ut.set(t.strings,e=new H(t)),e}k(t){J(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 N(this.O(O()),this.O(O()),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){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class j{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=u,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=u}_$AI(t,e=this,s,i){const n=this.strings;let r=!1;if(n===void 0)t=x(this,t,e,0),r=!U(t)||t!==this._$AH&&t!==A,r&&(this._$AH=t);else{const c=t;let a,d;for(t=n[0],a=0;a<n.length-1;a++)d=x(this,c[s+a],e,a),d===A&&(d=this._$AH[a]),r||(r=!U(d)||d!==this._$AH[a]),d===u?t=u:t!==u&&(t+=(d??"")+n[a+1]),this._$AH[a]=d}r&&!i&&this.j(t)}j(t){t===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Mt extends j{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===u?void 0:t}}class Ht extends j{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==u)}}class Nt extends j{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=x(this,t,e,0)??u)===A)return;const s=this._$AH,i=t===u&&s!==u||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==u&&(s===u||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Lt{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){x(this,t)}}const Z=T.litHtmlPolyfillSupport;Z==null||Z(H,N),(T.litHtmlVersions??(T.litHtmlVersions=[])).push("3.3.1");const Rt=(o,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let i=s._$litPart$;if(i===void 0){const n=(e==null?void 0:e.renderBefore)??null;s._$litPart$=i=new N(t.insertBefore(O(),n),n,void 0,e??{})}return i._$AI(o),i};/**
*/const T=globalThis,I=T.trustedTypes,ot=I?I.createPolicy("lit-html",{createHTML:o=>o}):void 0,rt="$lit$",m=`lit$${Math.random().toFixed(9).slice(2)}$`,nt="?"+m,xt=`<${nt}>`,y=document,U=()=>y.createComment(""),O=o=>o===null||typeof o!="object"&&typeof o!="function",q=Array.isArray,Ct=o=>q(o)||typeof(o==null?void 0:o[Symbol.iterator])=="function",K=`[
\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,at=/-->/g,lt=/>/g,b=RegExp(`>|${K}(?:([^\\s"'>=/]+)(${K}*=${K}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`,"g"),ct=/'/g,ht=/"/g,dt=/^(?:script|style|textarea|title)$/i,Pt=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),z=Pt(1),A=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),pt=new WeakMap,w=y.createTreeWalker(y,129);function ut(o,t){if(!q(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return ot!==void 0?ot.createHTML(t):t}const Tt=(o,t)=>{const e=o.length-1,s=[];let i,n=t===2?"<svg>":t===3?"<math>":"",r=M;for(let l=0;l<e;l++){const a=o[l];let h,p,c=-1,g=0;for(;g<a.length&&(r.lastIndex=g,p=r.exec(a),p!==null);)g=r.lastIndex,r===M?p[1]==="!--"?r=at:p[1]!==void 0?r=lt:p[2]!==void 0?(dt.test(p[2])&&(i=RegExp("</"+p[2],"g")),r=b):p[3]!==void 0&&(r=b):r===b?p[0]===">"?(r=i??M,c=-1):p[1]===void 0?c=-2:(c=r.lastIndex-p[2].length,h=p[1],r=p[3]===void 0?b:p[3]==='"'?ht:ct):r===ht||r===ct?r=b:r===at||r===lt?r=M:(r=b,i=void 0);const _=r===b&&o[l+1].startsWith("/>")?" ":"";n+=r===M?a+xt:c>=0?(s.push(h),a.slice(0,c)+rt+a.slice(c)+m+_):a+m+(c===-2?l:_)}return[ut(o,n+(o[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),s]};class H{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,r=0;const l=t.length-1,a=this.parts,[h,p]=Tt(t,e);if(this.el=H.createElement(h,s),w.currentNode=this.el.content,e===2||e===3){const c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(i=w.nextNode())!==null&&a.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(const c of i.getAttributeNames())if(c.endsWith(rt)){const g=p[r++],_=i.getAttribute(c).split(m),j=/([.?@])?(.*)/.exec(g);a.push({type:1,index:n,name:j[2],strings:_,ctor:j[1]==="."?Ot:j[1]==="?"?Mt:j[1]==="@"?Ht:D}),i.removeAttribute(c)}else c.startsWith(m)&&(a.push({type:6,index:n}),i.removeAttribute(c));if(dt.test(i.tagName)){const c=i.textContent.split(m),g=c.length-1;if(g>0){i.textContent=I?I.emptyScript:"";for(let _=0;_<g;_++)i.append(c[_],U()),w.nextNode(),a.push({type:2,index:++n});i.append(c[g],U())}}}else if(i.nodeType===8)if(i.data===nt)a.push({type:2,index:n});else{let c=-1;for(;(c=i.data.indexOf(m,c+1))!==-1;)a.push({type:7,index:n}),c+=m.length-1}n++}}static createElement(t,e){const s=y.createElement("template");return s.innerHTML=t,s}}function k(o,t,e=o,s){var r,l;if(t===A)return t;let i=s!==void 0?(r=e._$Co)==null?void 0:r[s]:e._$Cl;const n=O(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==n&&((l=i==null?void 0:i._$AO)==null||l.call(i,!1),n===void 0?i=void 0:(i=new n(o),i._$AT(o,e,s)),s!==void 0?(e._$Co??(e._$Co=[]))[s]=i:e._$Cl=i),i!==void 0&&(t=k(o,i._$AS(o,t.values),i,s)),t}class Ut{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==null?void 0:t.creationScope)??y).importNode(e,!0);w.currentNode=i;let n=w.nextNode(),r=0,l=0,a=s[0];for(;a!==void 0;){if(r===a.index){let h;a.type===2?h=new N(n,n.nextSibling,this,t):a.type===1?h=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(h=new Nt(n,this,t)),this._$AV.push(h),a=s[++l]}r!==(a==null?void 0:a.index)&&(n=w.nextNode(),r++)}return w.currentNode=y,i}p(t){let e=0;for(const s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class N{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=u,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=k(this,t,e),O(t)?t===u||t==null||t===""?(this._$AH!==u&&this._$AR(),this._$AH=u):t!==this._$AH&&t!==A&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Ct(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!==u&&O(this._$AH)?this._$AA.nextSibling.data=t:this.T(y.createTextNode(t)),this._$AH=t}$(t){var n;const{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=H.createElement(ut(s.h,s.h[0]),this.options)),s);if(((n=this._$AH)==null?void 0:n._$AD)===i)this._$AH.p(e);else{const r=new Ut(i,this),l=r.u(this.options);r.p(e),this.T(l),this._$AH=r}}_$AC(t){let e=pt.get(t.strings);return e===void 0&&pt.set(t.strings,e=new H(t)),e}k(t){q(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 N(this.O(U()),this.O(U()),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){var s;for((s=this._$AP)==null?void 0:s.call(this,!1,!0,e);t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class D{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=u,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=u}_$AI(t,e=this,s,i){const n=this.strings;let r=!1;if(n===void 0)t=k(this,t,e,0),r=!O(t)||t!==this._$AH&&t!==A,r&&(this._$AH=t);else{const l=t;let a,h;for(t=n[0],a=0;a<n.length-1;a++)h=k(this,l[s+a],e,a),h===A&&(h=this._$AH[a]),r||(r=!O(h)||h!==this._$AH[a]),h===u?t=u:t!==u&&(t+=(h??"")+n[a+1]),this._$AH[a]=h}r&&!i&&this.j(t)}j(t){t===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class Ot extends D{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===u?void 0:t}}class Mt extends D{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==u)}}class Ht extends D{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=k(this,t,e,0)??u)===A)return;const s=this._$AH,i=t===u&&s!==u||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==u&&(s===u||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Nt{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){k(this,t)}}const Z=T.litHtmlPolyfillSupport;Z==null||Z(H,N),(T.litHtmlVersions??(T.litHtmlVersions=[])).push("3.3.1");const Rt=(o,t,e)=>{const s=(e==null?void 0:e.renderBefore)??t;let i=s._$litPart$;if(i===void 0){const n=(e==null?void 0:e.renderBefore)??null;s._$litPart$=i=new N(t.insertBefore(U(),n),n,void 0,e??{})}return i._$AI(o),i};/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const E=globalThis;let k=class extends w{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Rt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return A}};k._$litElement$=!0,k.finalized=!0,(mt=E.litElementHydrateSupport)==null||mt.call(E,{LitElement:k});const G=E.litElementPolyfillSupport;G==null||G({LitElement:k}),(E.litElementVersions??(E.litElementVersions=[])).push("4.2.1");/**
*/const S=globalThis;let x=class extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Rt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return A}};x._$litElement$=!0,x.finalized=!0,(mt=S.litElementHydrateSupport)==null||mt.call(S,{LitElement:x});const G=S.litElementPolyfillSupport;G==null||G({LitElement:x}),(S.litElementVersions??(S.litElementVersions=[])).push("4.2.1");/**
* @license

@@ -27,15 +27,15 @@ * Copyright 2017 Google LLC

* SPDX-License-Identifier: BSD-3-Clause
*/const It={attribute:!0,type:String,converter:R,reflect:!1,hasChanged:F},zt=(o=It,t,e)=>{const{kind:s,metadata:i}=e;let n=globalThis.litPropertyMetadata.get(i);if(n===void 0&&globalThis.litPropertyMetadata.set(i,n=new Map),s==="setter"&&((o=Object.create(o)).wrapped=!0),n.set(e.name,o),s==="accessor"){const{name:r}=e;return{set(c){const a=t.get.call(this);t.set.call(this,c),this.requestUpdate(r,a,o)},init(c){return c!==void 0&&this.C(r,void 0,o,c),c}}}if(s==="setter"){const{name:r}=e;return function(c){const a=this[r];t.call(this,c),this.requestUpdate(r,a,o)}}throw Error("Unsupported decorator location: "+s)};function L(o){return(t,e)=>typeof e=="object"?zt(o,t,e):((s,i,n)=>{const r=i.hasOwnProperty(n);return i.constructor.createProperty(n,s),r?Object.getOwnPropertyDescriptor(i,n):void 0})(o,t,e)}/**
*/const Lt={attribute:!0,type:String,converter:L,reflect:!1,hasChanged:J},It=(o=Lt,t,e)=>{const{kind:s,metadata:i}=e;let n=globalThis.litPropertyMetadata.get(i);if(n===void 0&&globalThis.litPropertyMetadata.set(i,n=new Map),s==="setter"&&((o=Object.create(o)).wrapped=!0),n.set(e.name,o),s==="accessor"){const{name:r}=e;return{set(l){const a=t.get.call(this);t.set.call(this,l),this.requestUpdate(r,a,o)},init(l){return l!==void 0&&this.C(r,void 0,o,l),l}}}if(s==="setter"){const{name:r}=e;return function(l){const a=this[r];t.call(this,l),this.requestUpdate(r,a,o)}}throw Error("Unsupported decorator location: "+s)};function R(o){return(t,e)=>typeof e=="object"?It(o,t,e):((s,i,n)=>{const r=i.hasOwnProperty(n);return i.constructor.createProperty(n,s),r?Object.getOwnPropertyDescriptor(i,n):void 0})(o,t,e)}/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/function C(o){return L({...o,state:!0,attribute:!1})}/**
*/function C(o){return R({...o,state:!0,attribute:!1})}/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const jt={CHILD:2},Dt=o=>(...t)=>({_$litDirective$:o,values:t});class Vt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/**
*/const zt={CHILD:2},Dt=o=>(...t)=>({_$litDirective$:o,values:t});class Vt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/class Q extends Vt{constructor(t){if(super(t),this.it=u,t.type!==jt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===u||t==null)return this._t=void 0,this.it=t;if(t===A)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}Q.directiveName="unsafeHTML",Q.resultType=1;const ft=Dt(Q);class $t extends EventTarget{constructor(t){super(),this.ws=null,this.reconnectAttempts=0,this._status="disconnected",this.config={reconnect:!0,reconnectInterval:3e3,maxReconnectAttempts:10,...t}}get status(){return this._status}connect(){var t;if(((t=this.ws)==null?void 0:t.readyState)!==WebSocket.OPEN){this._status="connecting",this.dispatchEvent(new CustomEvent("statuschange",{detail:this._status}));try{this.ws=new WebSocket(this.config.url),this.setupEventHandlers()}catch{this._status="error",this.dispatchEvent(new CustomEvent("statuschange",{detail:this._status}))}}}disconnect(){var t;this.reconnectAttempts=this.config.maxReconnectAttempts??10,(t=this.ws)==null||t.close()}setupEventHandlers(){this.ws&&(this.ws.onopen=()=>{this._status="connected",this.reconnectAttempts=0,this.dispatchEvent(new CustomEvent("statuschange",{detail:this._status}))},this.ws.onclose=()=>{this._status="disconnected",this.dispatchEvent(new CustomEvent("statuschange",{detail:this._status})),this.attemptReconnect()},this.ws.onerror=()=>{this._status="error",this.dispatchEvent(new CustomEvent("statuschange",{detail:this._status}))},this.ws.onmessage=t=>{const e=t.data;let s;try{s=JSON.parse(e)}catch{s=e}const i={id:crypto.randomUUID(),timestamp:new Date,data:s,raw:e};this.dispatchEvent(new CustomEvent("log",{detail:i}))})}attemptReconnect(){this.config.reconnect&&(this.reconnectAttempts>=(this.config.maxReconnectAttempts??10)||(this.reconnectAttempts++,setTimeout(()=>this.connect(),this.config.reconnectInterval)))}}class _t extends EventTarget{constructor(t=1e3){super(),this.logs=[],this._filter={},this._paused=!1,this.maxLogs=t}get filter(){return this._filter}set filter(t){this._filter=t,this.dispatchEvent(new CustomEvent("filterchange",{detail:this._filter}))}get paused(){return this._paused}set paused(t){this._paused=t,this.dispatchEvent(new CustomEvent("pausechange",{detail:this._paused}))}add(t){this._paused||(this.logs.unshift(t),this.logs.length>this.maxLogs&&this.logs.pop(),this.dispatchEvent(new CustomEvent("logadded",{detail:t})))}clear(){this.logs=[],this.dispatchEvent(new CustomEvent("logscleared"))}getAll(){return[...this.logs]}getFiltered(){return this.logs.filter(t=>this.matchesFilter(t))}matchesFilter(t){const{search:e}=this._filter;if(e){const s=e.toLowerCase();return t.raw.toLowerCase().includes(s)}return!0}get count(){return this.logs.length}}var Bt=Object.defineProperty,Wt=Object.getOwnPropertyDescriptor,m=(o,t,e,s)=>{for(var i=s>1?void 0:s?Wt(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&Bt(t,e,i),i};h.SocklogViewer=class extends k{constructor(){super(...arguments),this.url="",this.maxLogs=1e3,this.indent=4,this.logs=[],this.status="disconnected",this.searchTerm="",this.expandedIds=new Set,this.client=null,this.store=null}connectedCallback(){super.connectedCallback(),this.initializeStore(),this.url&&this.connect()}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.client)==null||t.disconnect()}initializeStore(){this.store=new _t(this.maxLogs),this.store.addEventListener("logadded",()=>{var t;this.logs=((t=this.store)==null?void 0:t.getFiltered())??[]}),this.store.addEventListener("filterchange",()=>{var t,e;this.logs=((t=this.store)==null?void 0:t.getFiltered())??[],this.searchTerm=((e=this.store)==null?void 0:e.filter.search)??""}),this.store.addEventListener("logscleared",()=>{this.logs=[]})}connect(){this.url&&(this.client=new $t({url:this.url}),this.client.addEventListener("statuschange",(t=>{this.status=t.detail})),this.client.addEventListener("log",(t=>{var e;(e=this.store)==null||e.add(t.detail)})),this.client.connect())}clear(){var t;(t=this.store)==null||t.clear()}getStore(){return this.store}toggleExpanded(t){this.expandedIds.has(t)?this.expandedIds.delete(t):this.expandedIds.add(t),this.expandedIds=new Set(this.expandedIds)}formatTimestamp(t){return t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}formatJson(t,e=!1){let s;typeof t=="string"?s=t:s=e?JSON.stringify(t,null,this.indent):JSON.stringify(t);const n=s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/(&quot;|")([^"\\]|\\.)*?\1(?=\s*:)/g,'<span class="json-key">$&</span>');if(!this.searchTerm)return ft(n);const r=this.searchTerm.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),c=new RegExp(`(${r})`,"gi"),a=n.replace(/(<[^>]*>)|([^<]+)/g,(d,p,l)=>p||l.replace(c,'<span class="search-highlight">$1</span>'));return ft(a)}render(){return this.logs.length===0?z`
*/class Q extends Vt{constructor(t){if(super(t),this.it=u,t.type!==zt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===u||t==null)return this._t=void 0,this.it=t;if(t===A)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}Q.directiveName="unsafeHTML",Q.resultType=1;const jt=Dt(Q);function Bt(){if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const o=new Uint8Array(16);if(typeof crypto<"u"&&crypto.getRandomValues)crypto.getRandomValues(o);else for(let e=0;e<16;e++)o[e]=Math.random()*256|0;o[6]=o[6]&15|64,o[8]=o[8]&63|128;const t=Array.from(o,e=>e.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}class ft extends EventTarget{constructor(t){super(),this.ws=null,this.reconnectAttempts=0,this._status="disconnected",this.config={reconnect:!0,reconnectInterval:3e3,maxReconnectAttempts:10,...t}}get status(){return this._status}connect(){var t;if(((t=this.ws)==null?void 0:t.readyState)!==WebSocket.OPEN){typeof location<"u"&&location.protocol==="https:"&&this.config.url.startsWith("ws://")&&console.warn("[socklog] Connecting with ws:// from an HTTPS page will be blocked as mixed content. Use wss:// instead."),this._status="connecting",this.dispatchEvent(new CustomEvent("statuschange",{detail:this._status}));try{this.ws=new WebSocket(this.config.url),this.setupEventHandlers()}catch{this._status="error",this.dispatchEvent(new CustomEvent("statuschange",{detail:this._status}))}}}disconnect(){var t;this.reconnectAttempts=this.config.maxReconnectAttempts??10,(t=this.ws)==null||t.close()}setupEventHandlers(){this.ws&&(this.ws.onopen=()=>{this._status="connected",this.reconnectAttempts=0,this.dispatchEvent(new CustomEvent("statuschange",{detail:this._status}))},this.ws.onclose=()=>{this._status="disconnected",this.dispatchEvent(new CustomEvent("statuschange",{detail:this._status})),this.attemptReconnect()},this.ws.onerror=()=>{this._status="error",this.dispatchEvent(new CustomEvent("statuschange",{detail:this._status}))},this.ws.onmessage=t=>{const e=t.data;let s;try{s=JSON.parse(e)}catch{s=e}const i={id:Bt(),timestamp:new Date,data:s,raw:e};this.dispatchEvent(new CustomEvent("log",{detail:i}))})}attemptReconnect(){this.config.reconnect&&(this.reconnectAttempts>=(this.config.maxReconnectAttempts??10)||(this.reconnectAttempts++,setTimeout(()=>this.connect(),this.config.reconnectInterval)))}}class $t extends EventTarget{constructor(t=1e3){super(),this.logs=[],this._filter={},this._paused=!1,this.maxLogs=t}get filter(){return this._filter}set filter(t){this._filter=t,this.dispatchEvent(new CustomEvent("filterchange",{detail:this._filter}))}get paused(){return this._paused}set paused(t){this._paused=t,this.dispatchEvent(new CustomEvent("pausechange",{detail:this._paused}))}add(t){this._paused||(this.logs.unshift(t),this.logs.length>this.maxLogs&&this.logs.pop(),this.dispatchEvent(new CustomEvent("logadded",{detail:t})))}clear(){this.logs=[],this.dispatchEvent(new CustomEvent("logscleared"))}getAll(){return[...this.logs]}getFiltered(){return this.logs.filter(t=>this.matchesFilter(t))}matchesFilter(t){const{search:e}=this._filter;if(e){const s=e.toLowerCase();return t.raw.toLowerCase().includes(s)}return!0}get count(){return this.logs.length}}var Wt=Object.defineProperty,Ft=Object.getOwnPropertyDescriptor,v=(o,t,e,s)=>{for(var i=s>1?void 0:s?Ft(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&Wt(t,e,i),i};d.SocklogViewer=class extends x{constructor(){super(...arguments),this.url="",this.maxLogs=1e3,this.indent=4,this.logs=[],this.status="disconnected",this.searchTerm="",this.expandedIds=new Set,this.client=null,this.store=null}connectedCallback(){super.connectedCallback(),this.initializeStore(),this.url&&this.connect()}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.client)==null||t.disconnect()}initializeStore(){this.store=new $t(this.maxLogs),this.store.addEventListener("logadded",()=>{var t;this.logs=((t=this.store)==null?void 0:t.getFiltered())??[]}),this.store.addEventListener("filterchange",()=>{var t,e;this.logs=((t=this.store)==null?void 0:t.getFiltered())??[],this.searchTerm=((e=this.store)==null?void 0:e.filter.search)??""}),this.store.addEventListener("logscleared",()=>{this.logs=[]})}connect(){this.url&&(this.client=new ft({url:this.url}),this.client.addEventListener("statuschange",(t=>{this.status=t.detail})),this.client.addEventListener("log",(t=>{var e;(e=this.store)==null||e.add(t.detail)})),this.client.connect())}clear(){var t;(t=this.store)==null||t.clear()}getStore(){return this.store}toggleExpanded(t){this.expandedIds.has(t)?this.expandedIds.delete(t):this.expandedIds.add(t),this.expandedIds=new Set(this.expandedIds)}formatTimestamp(t){return t.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3})}tokenizeJson(t){const e=[];let s=0;for(;s<t.length;){const i=t[s];if(/\s/.test(i)){let r="";for(;s<t.length&&/\s/.test(t[s]);)r+=t[s],s++;e.push({type:"whitespace",value:r});continue}if(i==="{"||i==="}"||i==="["||i==="]"||i===":"||i===","){e.push({type:"punctuation",value:i}),s++;continue}if(i==='"'){let r='"';for(s++;s<t.length;)if(t[s]==="\\"&&s+1<t.length)r+=t[s]+t[s+1],s+=2;else if(t[s]==='"'){r+='"',s++;break}else r+=t[s],s++;e.push({type:"string",value:r});continue}let n="";for(;s<t.length&&!/[\s{}[\]:,"]/.test(t[s]);)n+=t[s],s++;n&&e.push({type:"value",value:n})}return e}formatJson(t,e=!1){let s;typeof t=="string"?s=t:s=e?JSON.stringify(t,null,this.indent):JSON.stringify(t);const i=this.tokenizeJson(s),n=[];for(let l=0;l<i.length;l++){const a=i[l],h=i[l+1],p=a.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),c=a.type==="string"&&(h==null?void 0:h.value)===":";a.type==="whitespace"?n.push(p):a.type==="punctuation"?n.push(`<span class="json-punct">${p}</span>`):c?n.push(`<span class="json-key">${p}</span>`):a.type==="string"?n.push(`<span class="json-string">${p}</span>`):n.push(`<span class="json-value">${p}</span>`)}let r=e?n.join(""):n.join("<wbr>");if(this.searchTerm){const l=this.searchTerm.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`(${l})`,"gi");r=r.replace(/(<[^>]*>)|([^<]+)/g,(h,p,c)=>p||c.replace(a,'<span class="search-highlight">$1</span>'))}return jt(r)}render(){return this.logs.length===0?z`
<div class="log-container">

@@ -50,14 +50,13 @@ <div class="empty-state">

<div class="log-entry">
<div class="log-header"
@click=${()=>this.toggleExpanded(t.id)}>
<span class="expand-toggle">
${this.expandedIds.has(t.id)?"⏷":"⏵"}
</span>
<div class="log-header" @click=${()=>this.toggleExpanded(t.id)}>
<span class="expand-toggle"> ${this.expandedIds.has(t.id)?"⏷":"⏵"} </span>
<span class="timestamp">${this.formatTimestamp(t.timestamp)}</span>
</div>
<div class="json">${this.formatJson(t.data,this.expandedIds.has(t.id))}</div>
<div class="json ${this.expandedIds.has(t.id)?"expanded":""}">
${this.formatJson(t.data,this.expandedIds.has(t.id))}
</div>
</div>
`)}
</div>
`}},h.SocklogViewer.styles=tt`
`}},d.SocklogViewer.styles=tt`
:host {

@@ -109,5 +108,9 @@ display: block;

white-space: pre-wrap;
word-break: break-word;
}
.json.expanded {
white-space: pre;
overflow-x: auto;
}
.empty-state {

@@ -118,2 +121,10 @@ padding: var(--socklog-padding, 8px);

.json-key,
.json-string,
.json-value,
.json-punct {
display: inline;
white-space: nowrap;
}
.json-key {

@@ -126,3 +137,3 @@ color: var(--socklog-key-color, #5c7cba);

}
`,m([L({type:String})],h.SocklogViewer.prototype,"url",2),m([L({type:Number})],h.SocklogViewer.prototype,"maxLogs",2),m([L({type:Number})],h.SocklogViewer.prototype,"indent",2),m([C()],h.SocklogViewer.prototype,"logs",2),m([C()],h.SocklogViewer.prototype,"status",2),m([C()],h.SocklogViewer.prototype,"searchTerm",2),m([C()],h.SocklogViewer.prototype,"expandedIds",2),h.SocklogViewer=m([gt("socklog-viewer")],h.SocklogViewer);var qt=Object.defineProperty,Ft=Object.getOwnPropertyDescriptor,D=(o,t,e,s)=>{for(var i=s>1?void 0:s?Ft(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&qt(t,e,i),i};h.SocklogControls=class extends k{constructor(){super(...arguments),this.store=null,this.searchValue="",this.paused=!1}connectedCallback(){super.connectedCallback(),this.setupStoreListeners()}updated(t){t.has("store")&&this.setupStoreListeners()}setupStoreListeners(){this.store&&this.store.addEventListener("pausechange",(t=>{this.paused=t.detail}))}handleSearch(t){const e=t.target;this.searchValue=e.value,this.updateFilter()}updateFilter(){if(!this.store)return;const t={};this.searchValue&&(t.search=this.searchValue),this.store.filter=t}togglePause(){this.store&&(this.store.paused=!this.store.paused)}clear(){var t;(t=this.store)==null||t.clear()}render(){return z`
`,v([R({type:String})],d.SocklogViewer.prototype,"url",2),v([R({type:Number})],d.SocklogViewer.prototype,"maxLogs",2),v([R({type:Number})],d.SocklogViewer.prototype,"indent",2),v([C()],d.SocklogViewer.prototype,"logs",2),v([C()],d.SocklogViewer.prototype,"status",2),v([C()],d.SocklogViewer.prototype,"searchTerm",2),v([C()],d.SocklogViewer.prototype,"expandedIds",2),d.SocklogViewer=v([gt("socklog-viewer")],d.SocklogViewer);var Jt=Object.defineProperty,qt=Object.getOwnPropertyDescriptor,V=(o,t,e,s)=>{for(var i=s>1?void 0:s?qt(t,e):t,n=o.length-1,r;n>=0;n--)(r=o[n])&&(i=(s?r(t,e,i):r(i))||i);return s&&i&&Jt(t,e,i),i};d.SocklogControls=class extends x{constructor(){super(...arguments),this.store=null,this.searchValue="",this.paused=!1}connectedCallback(){super.connectedCallback(),this.setupStoreListeners()}updated(t){t.has("store")&&this.setupStoreListeners()}setupStoreListeners(){this.store&&this.store.addEventListener("pausechange",(t=>{this.paused=t.detail}))}handleSearch(t){const e=t.target;this.searchValue=e.value,this.updateFilter()}updateFilter(){if(!this.store)return;const t={};this.searchValue&&(t.search=this.searchValue),this.store.filter=t}togglePause(){this.store&&(this.store.paused=!this.store.paused)}clear(){var t;(t=this.store)==null||t.clear()}render(){return z`
<div class="controls-inner">

@@ -139,3 +150,6 @@ <div class="search-container">

<div class="actions">
<button class="action-btn pause ${this.paused?"active":""}" @click=${this.togglePause}>
<button
class="action-btn pause ${this.paused?"active":""}"
@click=${this.togglePause}
>
${this.paused?"Resume":"Pause"}

@@ -146,3 +160,3 @@ </button>

</div>
`}},h.SocklogControls.styles=tt`
`}},d.SocklogControls.styles=tt`
:host {

@@ -162,3 +176,10 @@ display: block;

border-bottom: 1px solid var(--socklog-border-color, #e0e0e0);
font-family: var(--socklog-ui-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
font-family: var(
--socklog-ui-font-family,
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
sans-serif
);
font-size: 13px;

@@ -221,3 +242,3 @@ color: var(--socklog-color, inherit);

}
`,D([L({attribute:!1})],h.SocklogControls.prototype,"store",2),D([C()],h.SocklogControls.prototype,"searchValue",2),D([C()],h.SocklogControls.prototype,"paused",2),h.SocklogControls=D([gt("socklog-controls")],h.SocklogControls),h.LogStore=_t,h.WebSocketClient=$t,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})}));
`,V([R({attribute:!1})],d.SocklogControls.prototype,"store",2),V([C()],d.SocklogControls.prototype,"searchValue",2),V([C()],d.SocklogControls.prototype,"paused",2),d.SocklogControls=V([gt("socklog-controls")],d.SocklogControls),d.LogStore=$t,d.WebSocketClient=ft,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})}));
//# sourceMappingURL=socklog.umd.js.map
{
"name": "@andrewshell/socklog",
"version": "0.2.2",
"version": "0.2.3",
"description": "WebSocket-based logging web components using Lit",

@@ -40,3 +40,3 @@ "type": "module",

"type": "git",
"url": "https://github.com/andrewshell/socklog.git"
"url": "git+https://github.com/andrewshell/socklog.git"
},

@@ -43,0 +43,0 @@ "bugs": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display