fostr/dist2/code/index-COc6jZBc.js

1661 lines
176 KiB
JavaScript
Raw Normal View History

2025-01-06 06:52:54 +00:00
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(o){if(o.ep)return;o.ep=!0;const i=r(o);fetch(o.href,i)}})();var Ar="";function Sr(e){Ar=e}function ps(e=""){if(!Ar){const t=[...document.getElementsByTagName("script")],r=t.find(n=>n.hasAttribute("data-shoelace"));if(r)Sr(r.getAttribute("data-shoelace"));else{const n=t.find(i=>/shoelace(\.min)?\.js($|\?)/.test(i.src)||/shoelace-autoloader(\.min)?\.js($|\?)/.test(i.src));let o="";n&&(o=n.getAttribute("src")),Sr(o.split("/").slice(0,-1).join("/"))}}return Ar.replace(/\/$/,"")+(e?`/${e.replace(/^\//,"")}`:"")}var go=Object.defineProperty,gs=Object.defineProperties,bs=Object.getOwnPropertyDescriptor,ms=Object.getOwnPropertyDescriptors,Tn=Object.getOwnPropertySymbols,ys=Object.prototype.hasOwnProperty,ws=Object.prototype.propertyIsEnumerable,In=(e,t,r)=>t in e?go(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_e=(e,t)=>{for(var r in t||(t={}))ys.call(t,r)&&In(e,r,t[r]);if(Tn)for(var r of Tn(t))ws.call(t,r)&&In(e,r,t[r]);return e},bo=(e,t)=>gs(e,ms(t)),T=(e,t,r,n)=>{for(var o=n>1?void 0:n?bs(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&go(t,r,o),o},mo=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},vs=(e,t,r)=>(mo(e,t,"read from private field"),t.get(e)),xs=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Es=(e,t,r,n)=>(mo(e,t,"write to private field"),t.set(e,r),r);Sr("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.16.0/cdn/");/**
* @license
* Copyright 2019 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const Be=globalThis,qr=Be.ShadowRoot&&(Be.ShadyCSS===void 0||Be.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,jr=Symbol(),Mn=new WeakMap;let yo=class{constructor(t,r,n){if(this._$cssResult$=!0,n!==jr)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=r}get styleSheet(){let t=this.o;const r=this.t;if(qr&&t===void 0){const n=r!==void 0&&r.length===1;n&&(t=Mn.get(r)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),n&&Mn.set(r,t))}return t}toString(){return this.cssText}};const _s=e=>new yo(typeof e=="string"?e:e+"",void 0,jr),ct=(e,...t)=>{const r=e.length===1?e[0]:t.reduce((n,o,i)=>n+(s=>{if(s._$cssResult$===!0)return s.cssText;if(typeof s=="number")return s;throw Error("Value passed to 'css' function must be a 'css' function result: "+s+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+e[i+1],e[0]);return new yo(r,e,jr)},$s=(e,t)=>{if(qr)e.adoptedStyleSheets=t.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(const r of t){const n=document.createElement("style"),o=Be.litNonce;o!==void 0&&n.setAttribute("nonce",o),n.textContent=r.cssText,e.appendChild(n)}},Rn=qr?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let r="";for(const n of t.cssRules)r+=n.cssText;return _s(r)})(e):e;/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const{is:As,defineProperty:Ss,getOwnPropertyDescriptor:ks,getOwnPropertyNames:Ps,getOwnPropertySymbols:Cs,getPrototypeOf:Bs}=Object,Ve=globalThis,Nn=Ve.trustedTypes,Ls=Nn?Nn.emptyScript:"",Us=Ve.reactiveElementPolyfillSupport,me=(e,t)=>e,Ie={toAttribute(e,t){switch(t){case Boolean:e=e?Ls:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=e!==null;break;case Number:r=e===null?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch{r=null}}return r}},Fr=(e,t)=>!As(e,t),On={attribute:!0,type:String,converter:Ie,reflect:!1,hasChanged:Fr};Symbol.metadata??=Symbol("metadata"),Ve.litPropertyMetadata??=new WeakMap;class Yt extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,r=On){if(r.state&&(r.attribute=!1),this._$Ei(),this.elementProperties.set(t,r),!r.noAccessor){const n=Symbol(),o=this.getPropertyDescriptor(t,n,r);o!==void 0&&Ss(this.prototype,t,o)}}static getPropertyDescriptor(t,r,n){const{get:o,set:i}=ks(this.prototype,t)??{get(){return this[r]},set(s){this[r]=s}};return{get(){return o?.call(this)},set(s){const l=o?.call(this);i.call(this,s),this.requestUpdate(t,l,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??On}static _$Ei(){if(this.hasOwnProperty(me("elementProperties")))return;const t=Bs(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(me("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(me("properties"))){const r=this.properties,n=[...Ps(r),...Cs(r)];for(const o of n)this.createProperty(o,r[o])}const t=this[Symbol.metadata];if(t!==null){const r=litPropertyMetadata.get(t);if(r!==void 0)for(const[n,o]of r)this.elementProperties.set(n,o)}this._$Eh=new Map;for(const[r,n]of this.elementProperties){const o=this._$Eu(r,n);o!==void 0&&this._$Eh.set(o,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const r=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const o of n)r.unshift(Rn(o))}else t!==void 0&&r.push(Rn(t));return r}static _$Eu(t,r){const n=r.attribute;return n===!1?void 0:typeof n=="string"?n: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(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,r=this.constructor.elementProperties;for(const n of r.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return $s(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,r,n){this._$AK(t,n)}_$EC(t,r){const n=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,n);if(o!==void 0&&n.reflect===!0){const i=(n.converter?.toAttribute!==void 0?n.converter:Ie).toAttribute(r,n.type);this._$Em=t,i==null?this.removeAttribute(o):this.setAttribute(o,i),this._$Em=null}}_$AK(t,r){const n=this.constructor,o=n._$Eh.get(t);if(o!==void 0&&this._$Em!==o){const i=n.getPropertyOptions(o),s=typeof i.converter=="function"?{fromAttribute:i.converter}:i.converter?.fromAttribute!==void 0?i.converter:Ie;this._$Em=o,this[o]=s.fromAttribute(r,i.type),this._$Em=null}}requestUpdate(t,r,n){if(t!==void 0){if(n??=this.constructor.getPropertyOptions(t),!(n.hasChanged??Fr)(this[t],r))return
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const Wr=globalThis,Me=Wr.trustedTypes,Hn=Me?Me.createPolicy("lit-html",{createHTML:e=>e}):void 0,wo="$lit$",Ct=`lit$${Math.random().toFixed(9).slice(2)}$`,vo="?"+Ct,Ts=`<${vo}>`,qt=document,ye=()=>qt.createComment(""),we=e=>e===null||typeof e!="object"&&typeof e!="function",Kr=Array.isArray,Is=e=>Kr(e)||typeof e?.[Symbol.iterator]=="function",lr=`[
\f\r]`,de=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,zn=/-->/g,Vn=/>/g,Ot=RegExp(`>|${lr}(?:([^\\s"'>=/]+)(${lr}*=${lr}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`,"g"),Dn=/'/g,qn=/"/g,xo=/^(?:script|style|textarea|title)$/i,Ms=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),G=Ms(1),jt=Symbol.for("lit-noChange"),F=Symbol.for("lit-nothing"),jn=new WeakMap,Vt=qt.createTreeWalker(qt,129);function Eo(e,t){if(!Kr(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Hn!==void 0?Hn.createHTML(t):t}const Rs=(e,t)=>{const r=e.length-1,n=[];let o,i=t===2?"<svg>":t===3?"<math>":"",s=de;for(let l=0;l<r;l++){const a=e[l];let c,u,d=-1,m=0;for(;m<a.length&&(s.lastIndex=m,u=s.exec(a),u!==null);)m=s.lastIndex,s===de?u[1]==="!--"?s=zn:u[1]!==void 0?s=Vn:u[2]!==void 0?(xo.test(u[2])&&(o=RegExp("</"+u[2],"g")),s=Ot):u[3]!==void 0&&(s=Ot):s===Ot?u[0]===">"?(s=o??de,d=-1):u[1]===void 0?d=-2:(d=s.lastIndex-u[2].length,c=u[1],s=u[3]===void 0?Ot:u[3]==='"'?qn:Dn):s===qn||s===Dn?s=Ot:s===zn||s===Vn?s=de:(s=Ot,o=void 0);const g=s===Ot&&e[l+1].startsWith("/>")?" ":"";i+=s===de?a+Ts:d>=0?(n.push(c),a.slice(0,d)+wo+a.slice(d)+Ct+g):a+Ct+(d===-2?l:g)}return[Eo(e,i+(e[r]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),n]};class ve{constructor({strings:t,_$litType$:r},n){let o;this.parts=[];let i=0,s=0;const l=t.length-1,a=this.parts,[c,u]=Rs(t,r);if(this.el=ve.createElement(c,n),Vt.currentNode=this.el.content,r===2||r===3){const d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(o=Vt.nextNode())!==null&&a.length<l;){if(o.nodeType===1){if(o.hasAttributes())for(const d of o.getAttributeNames())if(d.endsWith(wo)){const m=u[s++],g=o.getAttribute(d).split(Ct),p=/([.?@])?(.*)/.exec(m);a.push({type:1,index:i,name:p[2],strings:g,ctor:p[1]==="."?Os:p[1]==="?"?Hs:p[1]==="@"?zs:De}),o.removeAttribute(d)}else d.startsWith(Ct)&&(a.push({type:6,index:i}),o.removeAttribute(d));if(xo.test(o.tagName)){const d=o.textContent.split(Ct),m=d.length-1;if(m>0){o.textContent=Me?Me.emptyScript:"";for(let g=0;g<m;g++)o.append(d[g],ye()),Vt.nextNode(),a.push({type:2,index:++i});o.append(d[m],ye())}}}else if(o.nodeType===8)if(o.data===vo)a.push({type:2,index:i});else{let d=-1;for(;(d=o.data.indexOf(Ct,d+1))!==-1;)a.push({type:7,index:i}),d+=Ct.length-1}i++}}static createElement(t,r){const n=qt.createElement("template");return n.innerHTML=t,n}}function te(e,t,r=e,n){if(t===jt)return t;let o=n!==void 0?r._$Co?.[n]:r._$Cl;const i=we(t)?void 0:t._$litDirective$;return o?.constructor!==i&&(o?._$AO?.(!1),i===void 0?o=void 0:(o=new i(e),o._$AT(e,r,n)),n!==void 0?(r._$Co??=[])[n]=o:r._$Cl=o),o!==void 0&&(t=te(e,o._$AS(e,t.values),o,n)),t}class Ns{constructor(t,r){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:r},parts:n}=this._$AD,o=(t?.creationScope??qt).importNode(r,!0);Vt.currentNode=o;let i=Vt.nextNode(),s=0,l=0,a=n[0];for(;a!==void 0;){if(s===a.index){let c;a.type===2?c=new $e(i,i.nextSibling,this,t):a.type===1?c=new a.ctor(i,a.name,a.strings,this,t):a.type===6&&(c=new Vs(i,this,t)),this._$AV.push(c),a=n[++l]}s!==a?.index&&(i=Vt.nextNode(),s++)}return Vt.currentNode=qt,o}p(t){let r=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(t,n,r),r+=n.strings.length-2):n._$AI(t[r])),r++}}class $e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,r,n,o){this.type=2,this._$AH=F,this._$AN=void 0,this._$AA=t,this._$AB=r,this._$AM=n,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const r=this._$AM;return r!==void 0&&t?.nodeType===11&&(t=r.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,r=this){t=te(this,t,r),we(t)?t===F||t==null||t===""?(this._$AH!==F&&this._$AR(),this._$AH=F):t!==this._$AH&&t!==jt&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Is(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!==F&&we(this._$AH)?this._$AA.nextSibling.data=t:this.T(qt.createTextNode(t)),this._$AH=t}$(t){const{values:r,_$litType$:n}=t,o=typeof n=="number"?this._$AC(t):(n.el=
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/let gt=class extends Yt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=qs(r,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return jt}};gt._$litElement$=!0,gt.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:gt});const js=globalThis.litElementPolyfillSupport;js?.({LitElement:gt});(globalThis.litElementVersions??=[]).push("4.1.1");/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const qe=e=>(t,r)=>{r!==void 0?r.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)};/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const Fs={attribute:!0,type:String,converter:Ie,reflect:!1,hasChanged:Fr},Ws=(e=Fs,t,r)=>{const{kind:n,metadata:o}=r;let i=globalThis.litPropertyMetadata.get(o);if(i===void 0&&globalThis.litPropertyMetadata.set(o,i=new Map),i.set(r.name,e),n==="accessor"){const{name:s}=r;return{set(l){const a=t.get.call(this);t.set.call(this,l),this.requestUpdate(s,a,e)},init(l){return l!==void 0&&this.P(s,void 0,e),l}}}if(n==="setter"){const{name:s}=r;return function(l){const a=this[s];t.call(this,l),this.requestUpdate(s,a,e)}}throw Error("Unsupported decorator location: "+n)};function S(e){return(t,r)=>typeof r=="object"?Ws(e,t,r):((n,o,i)=>{const s=o.hasOwnProperty(i);return o.constructor.createProperty(i,s?{...n,wrapped:!0}:n),s?Object.getOwnPropertyDescriptor(o,i):void 0})(e,t,r)}/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/function Zr(e){return S({...e,state:!0,attribute:!1})}/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const Ks=(e,t,r)=>(r.configurable=!0,r.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(e,t,r),r);/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/function Zs(e,t){return(r,n,o)=>{const i=s=>s.renderRoot?.querySelector(e)??null;return Ks(r,n,{get(){return i(this)}})}}function Fn(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function _o(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function Gs(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Fn(e.outputLen),Fn(e.blockLen)}function Re(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Js(e,t){_o(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}const cr=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const $o=e=>e instanceof Uint8Array,dr=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),ot=(e,t)=>e<<32-t|e>>>t,Ys=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!Ys)throw new Error("Non little-endian hardware is not supported");function Xs(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Gr(e){if(typeof e=="string"&&(e=Xs(e)),!$o(e))throw new Error(`expected Uint8Array, got ${typeof e}`);return e}function Qs(...e){const t=new Uint8Array(e.reduce((n,o)=>n+o.length,0));let r=0;return e.forEach(n=>{if(!$o(n))throw new Error("Uint8Array expected");t.set(n,r),r+=n.length}),t}let Ao=class{clone(){return this._cloneInto()}};function ta(e){const t=n=>e().update(Gr(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function So(e=32){if(cr&&typeof cr.getRandomValues=="function")return cr.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}function ea(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);const o=BigInt(32),i=BigInt(4294967295),s=Number(r>>o&i),l=Number(r&i),a=n?4:0,c=n?0:4;e.setUint32(t+a,s,n),e.setUint32(t+c,l,n)}let ra=class extends Ao{constructor(t,r,n,o){super(),this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=dr(this.buffer)}update(t){Re(this);const{view:r,buffer:n,blockLen:o}=this;t=Gr(t);const i=t.length;for(let s=0;s<i;){const l=Math.min(o-this.pos,i-s);if(l===o){const a=dr(t);for(;o<=i-s;s+=o)this.process(a,s);continue}n.set(t.subarray(s,s+l),this.pos),this.pos+=l,s+=l,this.pos===o&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Re(this),Js(t,this),this.finished=!0;const{buffer:r,view:n,blockLen:o,isLE:i}=this;let{pos:s}=this;r[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>o-s&&(this.process(n,0),s=0);for(let d=s;d<o;d++)r[d]=0;ea(n,o-8,BigInt(this.length*8),i),this.process(n,0);const l=dr(t),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<c;d++)l.setUint32(4*d,u[d],i)}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:r,buffer:n,length:o,finished:i,destroyed:s,pos:l}=this;return t.length=o,t.pos=l,t.finished=i,t.destroyed=s,o%r&&t.buffer.set(n),t}};const na=(e,t,r)=>e&t^~e&r,oa=(e,t,r)=>e&t^e&r^t&r,ia=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,33365
:host {
--border-color: var(--sl-color-neutral-200);
--border-radius: var(--sl-border-radius-medium);
--border-width: 1px;
--padding: var(--sl-spacing-large);
display: inline-block;
}
.card {
display: flex;
flex-direction: column;
background-color: var(--sl-panel-background-color);
box-shadow: var(--sl-shadow-x-small);
border: solid var(--border-width) var(--border-color);
border-radius: var(--border-radius);
}
.card__image {
display: flex;
border-top-left-radius: var(--border-radius);
border-top-right-radius: var(--border-radius);
margin: calc(-1 * var(--border-width));
overflow: hidden;
}
.card__image::slotted(img) {
display: block;
width: 100%;
}
.card:not(.card--has-image) .card__image {
display: none;
}
.card__header {
display: block;
border-bottom: solid var(--border-width) var(--border-color);
padding: calc(var(--padding) / 2) var(--padding);
}
.card:not(.card--has-header) .card__header {
display: none;
}
.card:not(.card--has-image) .card__header {
border-top-left-radius: var(--border-radius);
border-top-right-radius: var(--border-radius);
}
.card__body {
display: block;
padding: var(--padding);
}
.card--has-footer .card__footer {
display: block;
border-top: solid var(--border-width) var(--border-color);
padding: var(--padding);
}
.card:not(.card--has-footer) .card__footer {
display: none;
}
`,ns=class{constructor(e,...t){this.slotNames=[],this.handleSlotChange=r=>{const n=r.target;(this.slotNames.includes("[default]")&&!n.name||n.name&&this.slotNames.includes(n.name))&&this.host.requestUpdate()},(this.host=e).addController(this),this.slotNames=t}hasDefaultSlot(){return[...this.host.childNodes].some(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent.trim()!=="")return!0;if(e.nodeType===e.ELEMENT_NODE){const t=e;if(t.tagName.toLowerCase()==="sl-visually-hidden")return!1;if(!t.hasAttribute("slot"))return!0}return!1})}hasNamedSlot(e){return this.host.querySelector(`:scope > [slot="${e}"]`)!==null}test(e){return e==="[default]"?this.hasDefaultSlot():this.hasNamedSlot(e)}hostConnected(){this.host.shadowRoot.addEventListener("slotchange",this.handleSlotChange)}hostDisconnected(){this.host.shadowRoot.removeEventListener("slotchange",this.handleSlotChange)}},sr=ct`
:host {
box-sizing: border-box;
}
:host *,
:host *::before,
:host *::after {
box-sizing: inherit;
}
[hidden] {
display: none !important;
}
`,Ue,Mt=class extends gt{constructor(){super(),xs(this,Ue,!1),this.initialReflectedProperties=new Map,Object.entries(this.constructor.dependencies).forEach(([e,t])=>{this.constructor.define(e,t)})}emit(e,t){const r=new CustomEvent(e,_e({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(r),r}static define(e,t=this,r={}){const n=customElements.get(e);if(!n){try{customElements.define(e,t,r)}catch{customElements.define(e,class extends t{},r)}return}let o=" (unknown version)",i=o;"version"in t&&t.version&&(o=" v"+t.version),"version"in n&&n.version&&(i=" v"+n.version),!(o&&i&&o===i)&&console.warn(`Attempted to register <${e}>${o}, but <${e}>${i} has already been registered.`)}attributeChangedCallback(e,t,r){vs(this,Ue)||(this.constructor.elementProperties.forEach((n,o)=>{n.reflect&&this[o]!=null&&this.initialReflectedProperties.set(o,this[o])}),Es(this,Ue,!0)),super.attributeChangedCallback(e,t,r)}willUpdate(e){super.willUpdate(e),this.initialReflectedProperties.forEach((t,r)=>{e.has(r)&&this[r]==null&&(this[r]=t)})}};Ue=new WeakMap;Mt.version="2.18.0";Mt.dependencies={};T([S()],Mt.prototype,"dir",2);T([S()],Mt.prototype,"lang",2);/**
* @license
* Copyright 2017 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const Su={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},ku=e=>(...t)=>({_$litDirective$:e,values:t});let Pu=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,r,n){this._$Ct=t,this._$AM=r,this._$Ci=n}_$AS(t,r){return this.update(t,r)}update(t,r){return this.render(...r)}};/**
* @license
* Copyright 2018 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const os=ku(class extends Pu{constructor(e){if(super(e),e.type!==Su.ATTRIBUTE||e.name!=="class"||e.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){if(this.st===void 0){this.st=new Set,e.strings!==void 0&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(n=>n!=="")));for(const n in t)t[n]&&!this.nt?.has(n)&&this.st.add(n);return this.render(t)}const r=e.element.classList;for(const n of this.st)n in t||(r.remove(n),this.st.delete(n));for(const n in t){const o=!!t[n];o===this.st.has(n)||this.nt?.has(n)||(o?(r.add(n),this.st.add(n)):(r.remove(n),this.st.delete(n)))}return jt}});var is=class extends Mt{constructor(){super(...arguments),this.hasSlotController=new ns(this,"footer","header","image")}render(){return G`
<div
part="base"
class=${os({card:!0,"card--has-footer":this.hasSlotController.test("footer"),"card--has-image":this.hasSlotController.test("image"),"card--has-header":this.hasSlotController.test("header")})}
>
<slot name="image" part="image" class="card__image"></slot>
<slot name="header" part="header" class="card__header"></slot>
<slot part="body" class="card__body"></slot>
<slot name="footer" part="footer" class="card__footer"></slot>
</div>
`}};is.styles=[sr,Au];is.define("sl-card");var Cu=ct`
:host {
--track-width: 2px;
--track-color: rgb(128 128 128 / 25%);
--indicator-color: var(--sl-color-primary-600);
--speed: 2s;
display: inline-flex;
width: 1em;
height: 1em;
flex: none;
}
.spinner {
flex: 1 1 auto;
height: 100%;
width: 100%;
}
.spinner__track,
.spinner__indicator {
fill: none;
stroke-width: var(--track-width);
r: calc(0.5em - var(--track-width) / 2);
cx: 0.5em;
cy: 0.5em;
transform-origin: 50% 50%;
}
.spinner__track {
stroke: var(--track-color);
transform-origin: 0% 0%;
}
.spinner__indicator {
stroke: var(--indicator-color);
stroke-linecap: round;
stroke-dasharray: 150% 75%;
animation: spin var(--speed) linear infinite;
}
@keyframes spin {
0% {
transform: rotate(0deg);
stroke-dasharray: 0.05em, 3em;
}
50% {
transform: rotate(450deg);
stroke-dasharray: 1.375em, 1.375em;
}
100% {
transform: rotate(1080deg);
stroke-dasharray: 0.05em, 3em;
}
}
`;const zr=new Set,Qt=new Map;let zt,$n="ltr",An="en";const ss=typeof MutationObserver<"u"&&typeof document<"u"&&typeof document.documentElement<"u";if(ss){const e=new MutationObserver(ls);$n=document.documentElement.dir||"ltr",An=document.documentElement.lang||navigator.language,e.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","lang"]})}function as(...e){e.map(t=>{const r=t.$code.toLowerCase();Qt.has(r)?Qt.set(r,Object.assign(Object.assign({},Qt.get(r)),t)):Qt.set(r,t),zt||(zt=t)}),ls()}function ls(){ss&&($n=document.documentElement.dir||"ltr",An=document.documentElement.lang||navigator.language),[...zr.keys()].map(e=>{typeof e.requestUpdate=="function"&&e.requestUpdate()})}let Bu=class{constructor(t){this.host=t,this.host.addController(this)}hostConnected(){zr.add(this.host)}hostDisconnected(){zr.delete(this.host)}dir(){return`${this.host.dir||$n}`.toLowerCase()}lang(){return`${this.host.lang||An}`.toLowerCase()}getTranslationData(t){var r,n;const o=new Intl.Locale(t.replace(/_/g,"-")),i=o?.language.toLowerCase(),s=(n=(r=o?.region)===null||r===void 0?void 0:r.toLowerCase())!==null&&n!==void 0?n:"",l=Qt.get(`${i}-${s}`),a=Qt.get(i);return{locale:o,language:i,region:s,primary:l,secondary:a}}exists(t,r){var n;const{primary:o,secondary:i}=this.getTranslationData((n=r.lang)!==null&&n!==void 0?n:this.lang());return r=Object.assign({includeFallback:!1},r),!!(o&&o[t]||i&&i[t]||r.includeFallback&&zt&&zt[t])}term(t,...r){const{primary:n,secondary:o}=this.getTranslationData(this.lang());let i;if(n&&n[t])i=n[t];else if(o&&o[t])i=o[t];else if(zt&&zt[t])i=zt[t];else return console.error(`No translation found for: ${String(t)}`),String(t);return typeof i=="function"?i(...r):i}date(t,r){return t=new Date(t),new Intl.DateTimeFormat(this.lang(),r).format(t)}number(t,r){return t=Number(t),isNaN(t)?"":new Intl.NumberFormat(this.lang(),r).format(t)}relativeTime(t,r,n){return new Intl.RelativeTimeFormat(this.lang(),n).format(t,r)}};var cs={$code:"en",$name:"English",$dir:"ltr",carousel:"Carousel",clearEntry:"Clear entry",close:"Close",copied:"Copied",copy:"Copy",currentValue:"Current value",error:"Error",goToSlide:(e,t)=>`Go to slide ${e} of ${t}`,hidePassword:"Hide password",loading:"Loading",nextSlide:"Next slide",numOptionsSelected:e=>e===0?"No options selected":e===1?"1 option selected":`${e} options selected`,previousSlide:"Previous slide",progress:"Progress",remove:"Remove",resize:"Resize",scrollToEnd:"Scroll to end",scrollToStart:"Scroll to start",selectAColorFromTheScreen:"Select a color from the screen",showPassword:"Show password",slideNum:e=>`Slide ${e}`,toggleColorFormat:"Toggle color format"};as(cs);var Lu=cs,ds=class extends Bu{};as(Lu);var us=class extends Mt{constructor(){super(...arguments),this.localize=new ds(this)}render(){return G`
<svg part="base" class="spinner" role="progressbar" aria-label=${this.localize.term("loading")}>
<circle class="spinner__track"></circle>
<circle class="spinner__indicator"></circle>
</svg>
`}};us.styles=[sr,Cu];var fe=new WeakMap,pe=new WeakMap,ge=new WeakMap,vr=new WeakSet,Pe=new WeakMap,Uu=class{constructor(e,t){this.handleFormData=r=>{const n=this.options.disabled(this.host),o=this.options.name(this.host),i=this.options.value(this.host),s=this.host.tagName.toLowerCase()==="sl-button";this.host.isConnected&&!n&&!s&&typeof o=="string"&&o.length>0&&typeof i<"u"&&(Array.isArray(i)?i.forEach(l=>{r.formData.append(o,l.toString())}):r.formData.append(o,i.toString()))},this.handleFormSubmit=r=>{var n;const o=this.options.disabled(this.host),i=this.options.reportValidity;this.form&&!this.form.noValidate&&((n=fe.get(this.form))==null||n.forEach(s=>{this.setUserInteracted(s,!0)})),this.form&&!this.form.noValidate&&!o&&!i(this.host)&&(r.preventDefault(),r.stopImmediatePropagation())},this.handleFormReset=()=>{this.options.setValue(this.host,this.options.defaultValue(this.host)),this.setUserInteracted(this.host,!1),Pe.set(this.host,[])},this.handleInteraction=r=>{const n=Pe.get(this.host);n.includes(r.type)||n.push(r.type),n.length===this.options.assumeInteractionOn.length&&this.setUserInteracted(this.host,!0)},this.checkFormValidity=()=>{if(this.form&&!this.form.noValidate){const r=this.form.querySelectorAll("*");for(const n of r)if(typeof n.checkValidity=="function"&&!n.checkValidity())return!1}return!0},this.reportFormValidity=()=>{if(this.form&&!this.form.noValidate){const r=this.form.querySelectorAll("*");for(const n of r)if(typeof n.reportValidity=="function"&&!n.reportValidity())return!1}return!0},(this.host=e).addController(this),this.options=_e({form:r=>{const n=r.form;if(n){const i=r.getRootNode().querySelector(`#${n}`);if(i)return i}return r.closest("form")},name:r=>r.name,value:r=>r.value,defaultValue:r=>r.defaultValue,disabled:r=>{var n;return(n=r.disabled)!=null?n:!1},reportValidity:r=>typeof r.reportValidity=="function"?r.reportValidity():!0,checkValidity:r=>typeof r.checkValidity=="function"?r.checkValidity():!0,setValue:(r,n)=>r.value=n,assumeInteractionOn:["sl-input"]},t)}hostConnected(){const e=this.options.form(this.host);e&&this.attachForm(e),Pe.set(this.host,[]),this.options.assumeInteractionOn.forEach(t=>{this.host.addEventListener(t,this.handleInteraction)})}hostDisconnected(){this.detachForm(),Pe.delete(this.host),this.options.assumeInteractionOn.forEach(e=>{this.host.removeEventListener(e,this.handleInteraction)})}hostUpdated(){const e=this.options.form(this.host);e||this.detachForm(),e&&this.form!==e&&(this.detachForm(),this.attachForm(e)),this.host.hasUpdated&&this.setValidity(this.host.validity.valid)}attachForm(e){e?(this.form=e,fe.has(this.form)?fe.get(this.form).add(this.host):fe.set(this.form,new Set([this.host])),this.form.addEventListener("formdata",this.handleFormData),this.form.addEventListener("submit",this.handleFormSubmit),this.form.addEventListener("reset",this.handleFormReset),pe.has(this.form)||(pe.set(this.form,this.form.reportValidity),this.form.reportValidity=()=>this.reportFormValidity()),ge.has(this.form)||(ge.set(this.form,this.form.checkValidity),this.form.checkValidity=()=>this.checkFormValidity())):this.form=void 0}detachForm(){if(!this.form)return;const e=fe.get(this.form);e&&(e.delete(this.host),e.size<=0&&(this.form.removeEventListener("formdata",this.handleFormData),this.form.removeEventListener("submit",this.handleFormSubmit),this.form.removeEventListener("reset",this.handleFormReset),pe.has(this.form)&&(this.form.reportValidity=pe.get(this.form),pe.delete(this.form)),ge.has(this.form)&&(this.form.checkValidity=ge.get(this.form),ge.delete(this.form)),this.form=void 0))}setUserInteracted(e,t){t?vr.add(e):vr.delete(e),e.requestUpdate()}doAction(e,t){if(this.form){const r=document.createElement("button");r.type=e,r.style.position="absolute",r.style.width="0",r.style.height="0",r.style.clipPath="inset(50%)",r.style.overflow="hidden",r.style.whiteSpace="nowrap",t&&(r.name=t.name,r.value=t.value,["formaction","formenctype","formmethod","formnovalidate","formtarget"].forEach(n=>{t.hasAttribute(n)&&r.setAttribute(n,t.getAttribute(n))})),this.form.append(r),r.clic
:host {
display: inline-block;
position: relative;
width: auto;
cursor: pointer;
}
.button {
display: inline-flex;
align-items: stretch;
justify-content: center;
width: 100%;
border-style: solid;
border-width: var(--sl-input-border-width);
font-family: var(--sl-input-font-family);
font-weight: var(--sl-font-weight-semibold);
text-decoration: none;
user-select: none;
-webkit-user-select: none;
white-space: nowrap;
vertical-align: middle;
padding: 0;
transition:
var(--sl-transition-x-fast) background-color,
var(--sl-transition-x-fast) color,
var(--sl-transition-x-fast) border,
var(--sl-transition-x-fast) box-shadow;
cursor: inherit;
}
.button::-moz-focus-inner {
border: 0;
}
.button:focus {
outline: none;
}
.button:focus-visible {
outline: var(--sl-focus-ring);
outline-offset: var(--sl-focus-ring-offset);
}
.button--disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* When disabled, prevent mouse events from bubbling up from children */
.button--disabled * {
pointer-events: none;
}
.button__prefix,
.button__suffix {
flex: 0 0 auto;
display: flex;
align-items: center;
pointer-events: none;
}
.button__label {
display: inline-block;
}
.button__label::slotted(sl-icon) {
vertical-align: -2px;
}
/*
* Standard buttons
*/
/* Default */
.button--standard.button--default {
background-color: var(--sl-color-neutral-0);
border-color: var(--sl-input-border-color);
color: var(--sl-color-neutral-700);
}
.button--standard.button--default:hover:not(.button--disabled) {
background-color: var(--sl-color-primary-50);
border-color: var(--sl-color-primary-300);
color: var(--sl-color-primary-700);
}
.button--standard.button--default:active:not(.button--disabled) {
background-color: var(--sl-color-primary-100);
border-color: var(--sl-color-primary-400);
color: var(--sl-color-primary-700);
}
/* Primary */
.button--standard.button--primary {
background-color: var(--sl-color-primary-600);
border-color: var(--sl-color-primary-600);
color: var(--sl-color-neutral-0);
}
.button--standard.button--primary:hover:not(.button--disabled) {
background-color: var(--sl-color-primary-500);
border-color: var(--sl-color-primary-500);
color: var(--sl-color-neutral-0);
}
.button--standard.button--primary:active:not(.button--disabled) {
background-color: var(--sl-color-primary-600);
border-color: var(--sl-color-primary-600);
color: var(--sl-color-neutral-0);
}
/* Success */
.button--standard.button--success {
background-color: var(--sl-color-success-600);
border-color: var(--sl-color-success-600);
color: var(--sl-color-neutral-0);
}
.button--standard.button--success:hover:not(.button--disabled) {
background-color: var(--sl-color-success-500);
border-color: var(--sl-color-success-500);
color: var(--sl-color-neutral-0);
}
.button--standard.button--success:active:not(.button--disabled) {
background-color: var(--sl-color-success-600);
border-color: var(--sl-color-success-600);
color: var(--sl-color-neutral-0);
}
/* Neutral */
.button--standard.button--neutral {
background-color: var(--sl-color-neutral-600);
border-color: var(--sl-color-neutral-600);
color: var(--sl-color-neutral-0);
}
.button--standard.button--neutral:hover:not(.button--disabled) {
background-color: var(--sl-color-neutral-500);
border-color: var(--sl-color-neutral-500);
color: var(--sl-color-neutral-0);
}
.button--standard.button--neutral:active:not(.button--disabled) {
background-color: var(--sl-color-neutral-600);
border-color: var(--sl-color-neutral-600);
color: var(--sl-color-neutral-0);
}
/* Warning */
.button--standard.button--warning {
background-color: var(--sl-color-warning-600);
border-color: var(--sl-color-warning-600);
color: var(--sl-color-neutral-0);
}
.button--standard.button--warning:hover:not(.button--disabled) {
background-color: var(--sl-color-warning-500);
border-color: var(--sl-color-warning-500);
color: var(--sl-color-neutral-0);
}
.button--standard.button--warning:active:not(.button--disabled) {
background-color: var(--sl-color-warning-600);
border-color: var(--sl-color-warning-600);
color: var(--sl-color-neutral-0);
}
/* Danger */
.button--standard.button--danger {
background-color: var(--sl-color-danger-600);
border-color: var(--sl-color-danger-600);
color: var(--sl-color-neutral-0);
}
.button--standard.button--danger:hover:not(.button--disabled) {
background-color: var(--sl-color-danger-500);
border-color: var(--sl-color-danger-500);
color: var(--sl-color-neutral-0);
}
.button--standard.button--danger:active:not(.button--disabled) {
background-color: var(--sl-color-danger-600);
border-color: var(--sl-color-danger-600);
color: var(--sl-color-neutral-0);
}
/*
* Outline buttons
*/
.button--outline {
background: none;
border: solid 1px;
}
/* Default */
.button--outline.button--default {
border-color: var(--sl-input-border-color);
color: var(--sl-color-neutral-700);
}
.button--outline.button--default:hover:not(.button--disabled),
.button--outline.button--default.button--checked:not(.button--disabled) {
border-color: var(--sl-color-primary-600);
background-color: var(--sl-color-primary-600);
color: var(--sl-color-neutral-0);
}
.button--outline.button--default:active:not(.button--disabled) {
border-color: var(--sl-color-primary-700);
background-color: var(--sl-color-primary-700);
color: var(--sl-color-neutral-0);
}
/* Primary */
.button--outline.button--primary {
border-color: var(--sl-color-primary-600);
color: var(--sl-color-primary-600);
}
.button--outline.button--primary:hover:not(.button--disabled),
.button--outline.button--primary.button--checked:not(.button--disabled) {
background-color: var(--sl-color-primary-600);
color: var(--sl-color-neutral-0);
}
.button--outline.button--primary:active:not(.button--disabled) {
border-color: var(--sl-color-primary-700);
background-color: var(--sl-color-primary-700);
color: var(--sl-color-neutral-0);
}
/* Success */
.button--outline.button--success {
border-color: var(--sl-color-success-600);
color: var(--sl-color-success-600);
}
.button--outline.button--success:hover:not(.button--disabled),
.button--outline.button--success.button--checked:not(.button--disabled) {
background-color: var(--sl-color-success-600);
color: var(--sl-color-neutral-0);
}
.button--outline.button--success:active:not(.button--disabled) {
border-color: var(--sl-color-success-700);
background-color: var(--sl-color-success-700);
color: var(--sl-color-neutral-0);
}
/* Neutral */
.button--outline.button--neutral {
border-color: var(--sl-color-neutral-600);
color: var(--sl-color-neutral-600);
}
.button--outline.button--neutral:hover:not(.button--disabled),
.button--outline.button--neutral.button--checked:not(.button--disabled) {
background-color: var(--sl-color-neutral-600);
color: var(--sl-color-neutral-0);
}
.button--outline.button--neutral:active:not(.button--disabled) {
border-color: var(--sl-color-neutral-700);
background-color: var(--sl-color-neutral-700);
color: var(--sl-color-neutral-0);
}
/* Warning */
.button--outline.button--warning {
border-color: var(--sl-color-warning-600);
color: var(--sl-color-warning-600);
}
.button--outline.button--warning:hover:not(.button--disabled),
.button--outline.button--warning.button--checked:not(.button--disabled) {
background-color: var(--sl-color-warning-600);
color: var(--sl-color-neutral-0);
}
.button--outline.button--warning:active:not(.button--disabled) {
border-color: var(--sl-color-warning-700);
background-color: var(--sl-color-warning-700);
color: var(--sl-color-neutral-0);
}
/* Danger */
.button--outline.button--danger {
border-color: var(--sl-color-danger-600);
color: var(--sl-color-danger-600);
}
.button--outline.button--danger:hover:not(.button--disabled),
.button--outline.button--danger.button--checked:not(.button--disabled) {
background-color: var(--sl-color-danger-600);
color: var(--sl-color-neutral-0);
}
.button--outline.button--danger:active:not(.button--disabled) {
border-color: var(--sl-color-danger-700);
background-color: var(--sl-color-danger-700);
color: var(--sl-color-neutral-0);
}
@media (forced-colors: active) {
.button.button--outline.button--checked:not(.button--disabled) {
outline: solid 2px transparent;
}
}
/*
* Text buttons
*/
.button--text {
background-color: transparent;
border-color: transparent;
color: var(--sl-color-primary-600);
}
.button--text:hover:not(.button--disabled) {
background-color: transparent;
border-color: transparent;
color: var(--sl-color-primary-500);
}
.button--text:focus-visible:not(.button--disabled) {
background-color: transparent;
border-color: transparent;
color: var(--sl-color-primary-500);
}
.button--text:active:not(.button--disabled) {
background-color: transparent;
border-color: transparent;
color: var(--sl-color-primary-700);
}
/*
* Size modifiers
*/
.button--small {
height: auto;
min-height: var(--sl-input-height-small);
font-size: var(--sl-button-font-size-small);
line-height: calc(var(--sl-input-height-small) - var(--sl-input-border-width) * 2);
border-radius: var(--sl-input-border-radius-small);
}
.button--medium {
height: auto;
min-height: var(--sl-input-height-medium);
font-size: var(--sl-button-font-size-medium);
line-height: calc(var(--sl-input-height-medium) - var(--sl-input-border-width) * 2);
border-radius: var(--sl-input-border-radius-medium);
}
.button--large {
height: auto;
min-height: var(--sl-input-height-large);
font-size: var(--sl-button-font-size-large);
line-height: calc(var(--sl-input-height-large) - var(--sl-input-border-width) * 2);
border-radius: var(--sl-input-border-radius-large);
}
/*
* Pill modifier
*/
.button--pill.button--small {
border-radius: var(--sl-input-height-small);
}
.button--pill.button--medium {
border-radius: var(--sl-input-height-medium);
}
.button--pill.button--large {
border-radius: var(--sl-input-height-large);
}
/*
* Circle modifier
*/
.button--circle {
padding-left: 0;
padding-right: 0;
}
.button--circle.button--small {
width: var(--sl-input-height-small);
border-radius: 50%;
}
.button--circle.button--medium {
width: var(--sl-input-height-medium);
border-radius: 50%;
}
.button--circle.button--large {
width: var(--sl-input-height-large);
border-radius: 50%;
}
.button--circle .button__prefix,
.button--circle .button__suffix,
.button--circle .button__caret {
display: none;
}
/*
* Caret modifier
*/
.button--caret .button__suffix {
display: none;
}
.button--caret .button__caret {
height: auto;
}
/*
* Loading modifier
*/
.button--loading {
position: relative;
cursor: wait;
}
.button--loading .button__prefix,
.button--loading .button__label,
.button--loading .button__suffix,
.button--loading .button__caret {
visibility: hidden;
}
.button--loading sl-spinner {
--indicator-color: currentColor;
position: absolute;
font-size: 1em;
height: 1em;
width: 1em;
top: calc(50% - 0.5em);
left: calc(50% - 0.5em);
}
/*
* Badges
*/
.button ::slotted(sl-badge) {
position: absolute;
top: 0;
right: 0;
translate: 50% -50%;
pointer-events: none;
}
.button--rtl ::slotted(sl-badge) {
right: auto;
left: 0;
translate: -50% -50%;
}
/*
* Button spacing
*/
.button--has-label.button--small .button__label {
padding: 0 var(--sl-spacing-small);
}
.button--has-label.button--medium .button__label {
padding: 0 var(--sl-spacing-medium);
}
.button--has-label.button--large .button__label {
padding: 0 var(--sl-spacing-large);
}
.button--has-prefix.button--small {
padding-inline-start: var(--sl-spacing-x-small);
}
.button--has-prefix.button--small .button__label {
padding-inline-start: var(--sl-spacing-x-small);
}
.button--has-prefix.button--medium {
padding-inline-start: var(--sl-spacing-small);
}
.button--has-prefix.button--medium .button__label {
padding-inline-start: var(--sl-spacing-small);
}
.button--has-prefix.button--large {
padding-inline-start: var(--sl-spacing-small);
}
.button--has-prefix.button--large .button__label {
padding-inline-start: var(--sl-spacing-small);
}
.button--has-suffix.button--small,
.button--caret.button--small {
padding-inline-end: var(--sl-spacing-x-small);
}
.button--has-suffix.button--small .button__label,
.button--caret.button--small .button__label {
padding-inline-end: var(--sl-spacing-x-small);
}
.button--has-suffix.button--medium,
.button--caret.button--medium {
padding-inline-end: var(--sl-spacing-small);
}
.button--has-suffix.button--medium .button__label,
.button--caret.button--medium .button__label {
padding-inline-end: var(--sl-spacing-small);
}
.button--has-suffix.button--large,
.button--caret.button--large {
padding-inline-end: var(--sl-spacing-small);
}
.button--has-suffix.button--large .button__label,
.button--caret.button--large .button__label {
padding-inline-end: var(--sl-spacing-small);
}
/*
* Button groups support a variety of button types (e.g. buttons with tooltips, buttons as dropdown triggers, etc.).
* This means buttons aren't always direct descendants of the button group, thus we can't target them with the
* ::slotted selector. To work around this, the button group component does some magic to add these special classes to
* buttons and we style them here instead.
*/
:host([data-sl-button-group__button--first]:not([data-sl-button-group__button--last])) .button {
border-start-end-radius: 0;
border-end-end-radius: 0;
}
:host([data-sl-button-group__button--inner]) .button {
border-radius: 0;
}
:host([data-sl-button-group__button--last]:not([data-sl-button-group__button--first])) .button {
border-start-start-radius: 0;
border-end-start-radius: 0;
}
/* All except the first */
:host([data-sl-button-group__button]:not([data-sl-button-group__button--first])) {
margin-inline-start: calc(-1 * var(--sl-input-border-width));
}
/* Add a visual separator between solid buttons */
:host(
[data-sl-button-group__button]:not(
[data-sl-button-group__button--first],
[data-sl-button-group__button--radio],
[variant='default']
):not(:hover)
)
.button:after {
content: '';
position: absolute;
top: 0;
inset-inline-start: 0;
bottom: 0;
border-left: solid 1px rgb(128 128 128 / 33%);
mix-blend-mode: multiply;
}
/* Bump hovered, focused, and checked buttons up so their focus ring isn't clipped */
:host([data-sl-button-group__button--hover]) {
z-index: 1;
}
/* Focus and checked are always on top */
:host([data-sl-button-group__button--focus]),
:host([data-sl-button-group__button][checked]) {
z-index: 2;
}
`,Iu={name:"default",resolver:e=>ps(`assets/icons/${e}.svg`)},Mu=Iu,lo={caret:`
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<polyline points="6 9 12 15 18 9"></polyline>
</svg>
`,check:`
<svg part="checked-icon" class="checkbox__icon" viewBox="0 0 16 16">
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">
<g stroke="currentColor">
<g transform="translate(3.428571, 3.428571)">
<path d="M0,5.71428571 L3.42857143,9.14285714"></path>
<path d="M9.14285714,0 L3.42857143,9.14285714"></path>
</g>
</g>
</g>
</svg>
`,"chevron-down":`
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-down" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/>
</svg>
`,"chevron-left":`
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-left" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z"/>
</svg>
`,"chevron-right":`
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-chevron-right" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z"/>
</svg>
`,copy:`
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-copy" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M4 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V2Zm2-1a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H6ZM2 5a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1v-1h1v1a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h1v1H2Z"/>
</svg>
`,eye:`
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye" viewBox="0 0 16 16">
<path d="M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"/>
<path d="M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0 3.5 3.5 0 0 1-7 0z"/>
</svg>
`,"eye-slash":`
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye-slash" viewBox="0 0 16 16">
<path d="M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7.028 7.028 0 0 0-2.79.588l.77.771A5.944 5.944 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.134 13.134 0 0 1 14.828 8c-.058.087-.122.183-.195.288-.335.48-.83 1.12-1.465 1.755-.165.165-.337.328-.517.486l.708.709z"/>
<path d="M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829l.822.822zm-2.943 1.299.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829z"/>
<path d="M3.35 5.47c-.18.16-.353.322-.518.487A13.134 13.134 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7.029 7.029 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884-12-12 .708-.708 12 12-.708.708z"/>
</svg>
`,eyedropper:`
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eyedropper" viewBox="0 0 16 16">
<path d="M13.354.646a1.207 1.207 0 0 0-1.708 0L8.5 3.793l-.646-.647a.5.5 0 1 0-.708.708L8.293 5l-7.147 7.146A.5.5 0 0 0 1 12.5v1.793l-.854.853a.5.5 0 1 0 .708.707L1.707 15H3.5a.5.5 0 0 0 .354-.146L11 7.707l1.146 1.147a.5.5 0 0 0 .708-.708l-.647-.646 3.147-3.146a1.207 1.207 0 0 0 0-1.708l-2-2zM2 12.707l7-7L10.293 7l-7 7H2v-1.293z"></path>
</svg>
`,"grip-vertical":`
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-grip-vertical" viewBox="0 0 16 16">
<path d="M7 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM7 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"></path>
</svg>
`,indeterminate:`
<svg part="indeterminate-icon" class="checkbox__icon" viewBox="0 0 16 16">
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">
<g stroke="currentColor" stroke-width="2">
<g transform="translate(2.285714, 6.857143)">
<path d="M10.2857143,1.14285714 L1.14285714,1.14285714"></path>
</g>
</g>
</g>
</svg>
`,"person-fill":`
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person-fill" viewBox="0 0 16 16">
<path d="M3 14s-1 0-1-1 1-4 6-4 6 3 6 4-1 1-1 1H3zm5-6a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/>
</svg>
`,"play-fill":`
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-play-fill" viewBox="0 0 16 16">
<path d="m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393z"></path>
</svg>
`,"pause-fill":`
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pause-fill" viewBox="0 0 16 16">
<path d="M5.5 3.5A1.5 1.5 0 0 1 7 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5zm5 0A1.5 1.5 0 0 1 12 5v6a1.5 1.5 0 0 1-3 0V5a1.5 1.5 0 0 1 1.5-1.5z"></path>
</svg>
`,radio:`
<svg part="checked-icon" class="radio__icon" viewBox="0 0 16 16">
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g fill="currentColor">
<circle cx="8" cy="8" r="3.42857143"></circle>
</g>
</g>
</svg>
`,"star-fill":`
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-star-fill" viewBox="0 0 16 16">
<path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"/>
</svg>
`,"x-lg":`
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-lg" viewBox="0 0 16 16">
<path d="M2.146 2.854a.5.5 0 1 1 .708-.708L8 7.293l5.146-5.147a.5.5 0 0 1 .708.708L8.707 8l5.147 5.146a.5.5 0 0 1-.708.708L8 8.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 8 2.146 2.854Z"/>
</svg>
`,"x-circle-fill":`
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-x-circle-fill" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM5.354 4.646a.5.5 0 1 0-.708.708L7.293 8l-2.647 2.646a.5.5 0 0 0 .708.708L8 8.707l2.646 2.647a.5.5 0 0 0 .708-.708L8.707 8l2.647-2.646a.5.5 0 0 0-.708-.708L8 7.293 5.354 4.646z"></path>
</svg>
`},Ru={name:"system",resolver:e=>e in lo?`data:image/svg+xml,${encodeURIComponent(lo[e])}`:""},Nu=Ru,Ou=[Mu,Nu],Vr=[];function Hu(e){Vr.push(e)}function zu(e){Vr=Vr.filter(t=>t!==e)}function co(e){return Ou.find(t=>t.name===e)}var Vu=ct`
:host {
display: inline-block;
width: 1em;
height: 1em;
box-sizing: content-box !important;
}
svg {
display: block;
height: 100%;
width: 100%;
}
`;function kn(e,t){const r=_e({waitUntilFirstUpdate:!1},t);return(n,o)=>{const{update:i}=n,s=Array.isArray(e)?e:[e];n.update=function(l){s.forEach(a=>{const c=a;if(l.has(c)){const u=l.get(c),d=this[c];u!==d&&(!r.waitUntilFirstUpdate||this.hasUpdated)&&this[o](u,d)}}),i.call(this,l)}}}/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const Du=(e,t)=>e?._$litType$!==void 0;var be=Symbol(),Ce=Symbol(),xr,Er=new Map,xt=class extends Mt{constructor(){super(...arguments),this.initialRender=!1,this.svg=null,this.label="",this.library="default"}async resolveIcon(e,t){var r;let n;if(t?.spriteSheet)return this.svg=G`<svg part="svg">
<use part="use" href="${e}"></use>
</svg>`,this.svg;try{if(n=await fetch(e,{mode:"cors"}),!n.ok)return n.status===410?be:Ce}catch{return Ce}try{const o=document.createElement("div");o.innerHTML=await n.text();const i=o.firstElementChild;if(((r=i?.tagName)==null?void 0:r.toLowerCase())!=="svg")return be;xr||(xr=new DOMParser);const l=xr.parseFromString(i.outerHTML,"text/html").body.querySelector("svg");return l?(l.part.add("svg"),document.adoptNode(l)):be}catch{return be}}connectedCallback(){super.connectedCallback(),Hu(this)}firstUpdated(){this.initialRender=!0,this.setIcon()}disconnectedCallback(){super.disconnectedCallback(),zu(this)}getIconSource(){const e=co(this.library);return this.name&&e?{url:e.resolver(this.name),fromLibrary:!0}:{url:this.src,fromLibrary:!1}}handleLabelChange(){typeof this.label=="string"&&this.label.length>0?(this.setAttribute("role","img"),this.setAttribute("aria-label",this.label),this.removeAttribute("aria-hidden")):(this.removeAttribute("role"),this.removeAttribute("aria-label"),this.setAttribute("aria-hidden","true"))}async setIcon(){var e;const{url:t,fromLibrary:r}=this.getIconSource(),n=r?co(this.library):void 0;if(!t){this.svg=null;return}let o=Er.get(t);if(o||(o=this.resolveIcon(t,n),Er.set(t,o)),!this.initialRender)return;const i=await o;if(i===Ce&&Er.delete(t),t===this.getIconSource().url){if(Du(i)){if(this.svg=i,n){await this.updateComplete;const s=this.shadowRoot.querySelector("[part='svg']");typeof n.mutator=="function"&&s&&n.mutator(s)}return}switch(i){case Ce:case be:this.svg=null,this.emit("sl-error");break;default:this.svg=i.cloneNode(!0),(e=n?.mutator)==null||e.call(n,this.svg),this.emit("sl-load")}}}render(){return this.svg}};xt.styles=[sr,Vu];T([Zr()],xt.prototype,"svg",2);T([S({reflect:!0})],xt.prototype,"name",2);T([S()],xt.prototype,"src",2);T([S()],xt.prototype,"label",2);T([S({reflect:!0})],xt.prototype,"library",2);T([kn("label")],xt.prototype,"handleLabelChange",1);T([kn(["name","src","library"])],xt.prototype,"setIcon",1);/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const hs=Symbol.for(""),qu=e=>{if(e?.r===hs)return e?._$litStatic$},uo=(e,...t)=>({_$litStatic$:t.reduce((r,n,o)=>r+(i=>{if(i._$litStatic$!==void 0)return i._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${i}. Use 'unsafeStatic' to pass non-literal values, but
take care to ensure page security.`)})(n)+e[o+1],e[0]),r:hs}),ho=new Map,ju=e=>(t,...r)=>{const n=r.length;let o,i;const s=[],l=[];let a,c=0,u=!1;for(;c<n;){for(a=t[c];c<n&&(i=r[c],(o=qu(i))!==void 0);)a+=o+t[++c],u=!0;c!==n&&l.push(i),s.push(a),c++}if(c===n&&s.push(t[n]),u){const d=s.join("$$lit$$");(t=ho.get(d))===void 0&&(s.raw=s,ho.set(d,t=s)),r=l}return e(t,...r)},_r=ju(G);/**
* @license
* Copyright 2018 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/const ut=e=>e??F;var N=class extends Mt{constructor(){super(...arguments),this.formControlController=new Uu(this,{assumeInteractionOn:["click"]}),this.hasSlotController=new ns(this,"[default]","prefix","suffix"),this.localize=new ds(this),this.hasFocus=!1,this.invalid=!1,this.title="",this.variant="default",this.size="medium",this.caret=!1,this.disabled=!1,this.loading=!1,this.outline=!1,this.pill=!1,this.circle=!1,this.type="button",this.name="",this.value="",this.href="",this.rel="noreferrer noopener"}get validity(){return this.isButton()?this.button.validity:Sn}get validationMessage(){return this.isButton()?this.button.validationMessage:""}firstUpdated(){this.isButton()&&this.formControlController.updateValidity()}handleBlur(){this.hasFocus=!1,this.emit("sl-blur")}handleFocus(){this.hasFocus=!0,this.emit("sl-focus")}handleClick(){this.type==="submit"&&this.formControlController.submit(this),this.type==="reset"&&this.formControlController.reset(this)}handleInvalid(e){this.formControlController.setValidity(!1),this.formControlController.emitInvalidEvent(e)}isButton(){return!this.href}isLink(){return!!this.href}handleDisabledChange(){this.isButton()&&this.formControlController.setValidity(this.disabled)}click(){this.button.click()}focus(e){this.button.focus(e)}blur(){this.button.blur()}checkValidity(){return this.isButton()?this.button.checkValidity():!0}getForm(){return this.formControlController.getForm()}reportValidity(){return this.isButton()?this.button.reportValidity():!0}setCustomValidity(e){this.isButton()&&(this.button.setCustomValidity(e),this.formControlController.updateValidity())}render(){const e=this.isLink(),t=e?uo`a`:uo`button`;return _r`
<${t}
part="base"
class=${os({button:!0,"button--default":this.variant==="default","button--primary":this.variant==="primary","button--success":this.variant==="success","button--neutral":this.variant==="neutral","button--warning":this.variant==="warning","button--danger":this.variant==="danger","button--text":this.variant==="text","button--small":this.size==="small","button--medium":this.size==="medium","button--large":this.size==="large","button--caret":this.caret,"button--circle":this.circle,"button--disabled":this.disabled,"button--focused":this.hasFocus,"button--loading":this.loading,"button--standard":!this.outline,"button--outline":this.outline,"button--pill":this.pill,"button--rtl":this.localize.dir()==="rtl","button--has-label":this.hasSlotController.test("[default]"),"button--has-prefix":this.hasSlotController.test("prefix"),"button--has-suffix":this.hasSlotController.test("suffix")})}
?disabled=${ut(e?void 0:this.disabled)}
type=${ut(e?void 0:this.type)}
title=${this.title}
name=${ut(e?void 0:this.name)}
value=${ut(e?void 0:this.value)}
href=${ut(e&&!this.disabled?this.href:void 0)}
target=${ut(e?this.target:void 0)}
download=${ut(e?this.download:void 0)}
rel=${ut(e?this.rel:void 0)}
role=${ut(e?void 0:"button")}
aria-disabled=${this.disabled?"true":"false"}
tabindex=${this.disabled?"-1":"0"}
@blur=${this.handleBlur}
@focus=${this.handleFocus}
@invalid=${this.isButton()?this.handleInvalid:null}
@click=${this.handleClick}
>
<slot name="prefix" part="prefix" class="button__prefix"></slot>
<slot part="label" class="button__label"></slot>
<slot name="suffix" part="suffix" class="button__suffix"></slot>
${this.caret?_r` <sl-icon part="caret" class="button__caret" library="system" name="caret"></sl-icon> `:""}
${this.loading?_r`<sl-spinner part="spinner"></sl-spinner>`:""}
</${t}>
`}};N.styles=[sr,Tu];N.dependencies={"sl-icon":xt,"sl-spinner":us};T([Zs(".button")],N.prototype,"button",2);T([Zr()],N.prototype,"hasFocus",2);T([Zr()],N.prototype,"invalid",2);T([S()],N.prototype,"title",2);T([S({reflect:!0})],N.prototype,"variant",2);T([S({reflect:!0})],N.prototype,"size",2);T([S({type:Boolean,reflect:!0})],N.prototype,"caret",2);T([S({type:Boolean,reflect:!0})],N.prototype,"disabled",2);T([S({type:Boolean,reflect:!0})],N.prototype,"loading",2);T([S({type:Boolean,reflect:!0})],N.prototype,"outline",2);T([S({type:Boolean,reflect:!0})],N.prototype,"pill",2);T([S({type:Boolean,reflect:!0})],N.prototype,"circle",2);T([S()],N.prototype,"type",2);T([S()],N.prototype,"name",2);T([S()],N.prototype,"value",2);T([S()],N.prototype,"href",2);T([S()],N.prototype,"target",2);T([S()],N.prototype,"rel",2);T([S()],N.prototype,"download",2);T([S()],N.prototype,"form",2);T([S({attribute:"formaction"})],N.prototype,"formAction",2);T([S({attribute:"formenctype"})],N.prototype,"formEnctype",2);T([S({attribute:"formmethod"})],N.prototype,"formMethod",2);T([S({attribute:"formnovalidate",type:Boolean})],N.prototype,"formNoValidate",2);T([S({attribute:"formtarget"})],N.prototype,"formTarget",2);T([kn("disabled",{waitUntilFirstUpdate:!0})],N.prototype,"handleDisabledChange",1);N.define("sl-button");const fs=ct`
@media(min-width: 1000px) {
sl-card {
max-width: 70vw;
}
}
main {
margin-top: 70px;
padding: 12px;
}
.ProseMirror {
position: relative;
word-wrap: break-word;
white-space: pre-wrap;
-webkit-font-variant-ligatures: none;
font-variant-ligatures: none;
padding: 1rem;
line-height: 1.2;
outline: none;
font-family: var(
--markdown-editor-typography-font-family,
var(--mdc-typography-font-family, Montserrat, sans-serif)
);
font-size: var(
--markdown-editor-typography-font-size,
var(--mdc-typography-subtitle1-font-size, 1rem)
);
font-weight: var(
--markdown-editor-typography-font-weight,
var(--mdc-typography-subtitle1-font-weight, 400)
);
letter-spacing: var(
--markdown-editor-typography-letter-spacing,
var(--mdc-typography-subtitle1-letter-spacing, 0.009375em)
);
}
.ProseMirror pre {
white-space: pre-wrap;
}
.ProseMirror li {
position: relative;
}
.ProseMirror p:first-child,
.ProseMirror h1:first-child,
.ProseMirror h2:first-child,
.ProseMirror h3:first-child,
.ProseMirror h4:first-child,
.ProseMirror h5:first-child,
.ProseMirror h6:first-child {
margin-top: 10px;
}
.ProseMirror a {
color: var(--markdown-editor-typography-anchor-color, -webkit-link);
text-decoration: var(--markdown-editor-typography-anchor-text-decoration);
}
.ProseMirror p {
margin-bottom: 1em;
}
.ProseMirror-hideselection {
caret-color: transparent;
}
.ProseMirror-hideselection *::selection,
.ProseMirror-hideselection *::-moz-selection {
background: transparent;
}
.ProseMirror-selectednode {
outline: 2px solid #8cf;
}
/* Make sure li selections wrap around markers */
li.ProseMirror-selectednode {
outline: none;
}
li.ProseMirror-selectednode:after {
content: '';
position: absolute;
left: -32px;
right: -2px;
top: -2px;
bottom: -2px;
border: 2px solid #8cf;
pointer-events: none;
}
.ProseMirror-textblock-dropdown {
min-width: 3em;
}
.ProseMirror-menu {
margin: 0 -4px;
line-height: 1;
}
.ProseMirror-tooltip .ProseMirror-menu {
width: -webkit-fit-content;
width: fit-content;
white-space: pre;
}
.ProseMirror-menuitem {
margin: 0.25rem 0.25rem 0.25rem 0;
display: flex;
justify-content: center;
align-items: center;
border-radius: 4px;
overflow: hidden;
}
.ProseMirror-menuitem:hover {
background-color: #f5f5f5;
}
.ProseMirror-menuseparator {
margin: 0 8px;
}
.ProseMirror-menu-dropdown,
.ProseMirror-menu-dropdown-menu {
font-size: 90%;
white-space: nowrap;
}
.ProseMirror-menu-dropdown {
vertical-align: 1px;
cursor: pointer;
position: relative;
padding-right: 15px;
}
.ProseMirror-menu-dropdown-wrap {
padding: 1px 0 1px 4px;
display: inline-block;
position: relative;
}
.ProseMirror-menu-dropdown:after {
content: '';
border-left: 4px solid transparent;
border-right: 4px solid transparent;
border-top: 4px solid currentColor;
opacity: 0.6;
position: absolute;
right: 4px;
top: calc(50% - 2px);
}
.ProseMirror-menu-dropdown-menu,
.ProseMirror-menu-submenu {
position: absolute;
background: white;
color: #666;
border: 1px solid #aaa;
padding: 2px;
}
.ProseMirror-menu-dropdown-menu {
z-index: 1;
min-width: 6em;
}
.ProseMirror-menu-dropdown-item {
cursor: pointer;
}
.ProseMirror-menu-dropdown-item:hover {
background: #f2f2f2;
}
.ProseMirror-menu-dropdown-item > div {
padding: 0.375rem 0.5rem;
}
.ProseMirror-menu-submenu-wrap {
position: relative;
margin-right: -4px;
}
.ProseMirror-menu-submenu-label:after {
content: '';
border-top: 4px solid transparent;
border-bottom: 4px solid transparent;
border-left: 4px solid currentColor;
opacity: 0.6;
position: absolute;
right: 4px;
top: calc(50% - 4px);
}
.ProseMirror-menu-submenu {
display: none;
min-width: 4em;
left: 100%;
top: -3px;
}
.ProseMirror-menu-active {
background: #eee;
border-radius: 4px;
color: black;
}
.ProseMirror-menu-submenu-wrap:hover .ProseMirror-menu-submenu,
.ProseMirror-menu-submenu-wrap-active .ProseMirror-menu-submenu {
display: block;
}
.ProseMirror-menubar {
display: flex;
flex-wrap: wrap;
position: relative;
background: white;
min-height: 1em;
overflow: visible;
z-index: 2;
top: 0;
left: 0;
right: 0;
color: #666;
padding: 1px 6px;
border-top-left-radius: inherit;
border-top-right-radius: inherit;
border-bottom: 1px solid
var(--markdown-editor-outline-idle-border-color, rgba(0, 0, 0, 0.38));
box-sizing: border-box;
-moz-box-sizing: border-box;
}
.ProseMirror-icon {
display: inline-block;
line-height: 0.8;
vertical-align: -2px;
/* Compensate for padding */
padding: 2px 8px;
cursor: pointer;
}
.ProseMirror-menu-disabled {
color: rgba(0,0,0,0.37);
background-color: rgba(0,0,0,0.12);
cursor: not-allowed;
}
.ProseMirror-menu-disabled.ProseMirror-icon {
cursor: not-allowed;
}
.ProseMirror-icon svg {
fill: currentColor;
height: 1em;
}
.ProseMirror-icon span {
vertical-align: text-top;
}
.ProseMirror-gapcursor {
display: none;
pointer-events: none;
position: absolute;
}
.ProseMirror-gapcursor:after {
content: '';
display: block;
position: absolute;
top: -2px;
width: 20px;
border-top: 1px solid black;
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
}
@keyframes ProseMirror-cursor-blink {
to {
visibility: hidden;
}
}
.ProseMirror-focused .ProseMirror-gapcursor {
display: block;
}
/* Add space around the hr to make clicking it easier */
.ProseMirror-example-setup-style hr {
padding: 2px 10px;
border: none;
margin: 1em 0;
}
.ProseMirror-example-setup-style hr:after {
content: '';
display: block;
height: 1px;
background-color: silver;
line-height: 2px;
}
.ProseMirror ul,
.ProseMirror ol {
padding-left: 30px;
}
.ProseMirror blockquote {
padding-left: 1em;
border-left: 3px solid #eee;
margin-left: 0;
margin-right: 0;
}
.ProseMirror-example-setup-style img {
cursor: default;
}
.ProseMirror-invalid {
background: #ffc;
border: 1px solid #cc7;
border-radius: 4px;
padding: 5px 10px;
position: absolute;
min-width: 10em;
}
.ProseMirror h1.title.empty-node::before,
.ProseMirror h2.instructional-prompt.empty-node::before,
.ProseMirror h3.mechanical-promp.empty-node::before {
content: 'Enter title here...';
}
.ProseMirror div.passage-subtitle.empty-node:first-child::before {
content: 'Enter subtitle here...';
}
.ProseMirror div.passage-author.empty-node:first-child::before,
.ProseMirror div.passage-cast-title.empty-node:first-child::before,
.ProseMirror div.passage-act-title.empty-node:first-child::before,
.ProseMirror div.passage-scene-title.empty-node:first-child::before,
.ProseMirror div.passage-verse.empty-node:first-child::before,
.ProseMirror div.passage-footnotes.empty-node:first-child::before,
.ProseMirror div.paragraph.empty-node:first-child::before {
content: 'Enter text here...';
}
div[contenteditable]:focus h1.title.empty-node::before,
div[contenteditable]:focus h2.instructional-prompt.empty-node::before,
div[contenteditable]:focus h3.mechanical-promp.empty-node::before,
div[contenteditable]:focus
div.passage-subtitle.empty-node:first-child::before,
div[contenteditable]:focus div.passage-author.empty-node:first-child::before,
div[contenteditable]:focus
div.passage-cast-title.empty-node:first-child::before,
div[contenteditable]:focus
div.passage-act-title.empty-node:first-child::before,
div[contenteditable]:focus
div.passage-scene-title.empty-node:first-child::before,
div[contenteditable]:focus div.passage-verse.empty-node:first-child::before,
div[contenteditable]:focus
div.passage-footnotes.empty-node:first-child::before,
div[contenteditable]:focus div.paragraph.empty-node:first-child::before {
content: '';
}
.ProseMirror .empty-node::before {
position: absolute;
color: #aaa;
cursor: text;
font-style: italic;
}
#editor, .editor {
background: white;
color: black;
background-clip: padding-box;
padding: 5px 0;
}
#editor[disabled] .ProseMirror-menubar {
display: none!important;
}
drop-down-editor rich-text .inline-component-button,
expand-collapse rich-text .inline-component-button,
flip-reveal rich-text .inline-component-button,
hint-list rich-text .inline-component-button,
option-list rich-text .inline-component-button,
plankton-passage rich-text .inline-component-button {
pointer-events: none;
color: lightgray;
}
#ProseMirror-icon-collection path {
fill-rule: evenodd;
}
#welcomeBar {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
#welcomeCard,
#infoCard {
padding: 18px;
padding-top: 0px;
}
sl-card::part(footer) {
display: flex;
justify-content: flex-end;
}
@media(min-width: 750px) {
sl-card {
width: 70vw;
}
}
@media (horizontal-viewport-segments: 2) {
#welcomeBar {
flex-direction: row;
align-items: flex-start;
justify-content: space-between;
}
@media (horizontal-viewport-segments: 2) {
#welcomeBar {
flex-direction: row;
align-items: flex-start;
justify-content: space-between;
}
}
.boring {
background: grey;
}
.plus {
position: absolute;
padding: 8px;
background-color: #4CAF50;
color: red;
border: none;
cursor: pointer;
}
.plus:hover {
background-color: #45a049;
}
.ProseMirror-textblock-dropdown {
min-width: 3em;
}
}`;var Fu=Object.defineProperty,Wu=Object.getOwnPropertyDescriptor,Pn=(e,t,r,n)=>{for(var o=n>1?void 0:n?Wu(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&Fu(t,r,o),o};let ie=class extends gt{constructor(){super(...arguments),this.notes=[],this.relayName="",this.note=""}getUserLang(){return navigator.language||"en"}async firstUpdated(){console.log("Here are some recent notes from the neighborhood")}async connectedCallback(){super.connectedCallback(),await Promise.all([this.fetchNotes()])}async fetchNotes(){const e=await tr.connect("wss://notes.miguelalmodo.com");console.log(`connected to ${e.url}`),this.relayName=e.url;const t=e.subscribe([{kinds:[30023],limit:5}],{onevent:async r=>{console.log("Event received:",r),this.notes=[...this.notes,{content:r.content,date:new Date(r.created_at*1e3).toLocaleDateString()}],this.requestUpdate(),console.log(e)},oneose:()=>{t.close(),this.requestUpdate()}})}async displayLongNotes(){}share(){navigator.share&&navigator.share({title:"Nostr Micro Client",text:"Share this with your homie!",url:"https://miguelalmodo.com/"})}render(){return G`
<app-header ?enableBack="${!0}"></app-header>
<main> <div id="welcomeBar">
<sl-card id="WelcomeCard">
<section>
<header class="main-section-header">
<h2 class="main-section-h2">Recent Notes from ${this.relayName}</h2>
</header>
<table class="comment-wall">
${this.notes.map(e=>{const t=e.content.match(/https?:\/\/[^\s]+/),r=e.content.replace(t?.[0]||"","").trim(),n=/(?:https?:\/\/(?:www\.)?youtube\.com\/watch\?v=|https?:\/\/youtu\.be\/)([a-zA-Z0-9_-]{11})/,o=t?.[0].match(n),i=o?o[1]:null,s=i?`https://img.youtube.com/vi/${i}/maxresdefault.jpg`:null,l=/(https?:\/\/[^\s]+\.(?:jpg|jpeg|png|gif))/i,a=t?.find(c=>l.test(c));return G`
<tr>
<td><h3>${e.date}</h3></td>
<td>
<p>${r}</p>
${s?G`<img src="${s}" alt="YouTube thumbnail" style="max-width: 30%; height: 30%;">`:a?G`<img src="${a}" alt="Note image" style="max-width: 30%; height: 30%;">`:""}
</td>
</tr>
`})}
</table>
</section></main>
</sl-card>
`}};ie.styles=[fs,ct`
.comment-wall .main-section-header {
margin-bottom: 3px;
}
.comment-wall .main-section-h2 {
margin-bottom: 0;
}
#comment-counter {
margin-top: 0;
margin-left: 15px;
margin-bottom: 3px;
}
.comment-wall table {
margin: auto;
margin-bottom: 5px;
color: black;
}
.comment-wall th {
width: 158px;
padding: 3px;
vertical-align: top;
}
.comment-wall td {
vertical-align: top;
width: 269px;
padding: 3px;
}
.comment-wall figcaption,
.comment-wall figure {
margin: 0;
}
.comment-wall figcaption {
margin-bottom: 1em;
}
.comment-wall figure {
margin-bottom: 49.33px;
}
.comment-wall h3 {
font-size: 10pt;
margin: 0;
margin-bottom: 3em;
}
.comment-wall p {
font-weight: normal;
text-align: center;
margin: 0;
}
#add-comment {
text-align: right;
margin-right: 10px;
margin-bottom: 5px;
}
`];Pn([S({type:Array})],ie.prototype,"notes",2);Pn([S({type:String})],ie.prototype,"relayName",2);ie=Pn([qe("note-wall")],ie);const Ku=Object.freeze(Object.defineProperty({__proto__:null,get NoteWall(){return ie}},Symbol.toStringTag,{value:"Module"})),Zu="modulepreload",Gu=function(e){return"/"+e},fo={},Te=function(t,r,n){let o=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),l=s?.nonce||s?.getAttribute("nonce");o=Promise.allSettled(r.map(a=>{if(a=Gu(a),a in fo)return;fo[a]=!0;const c=a.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${u}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":Zu,c||(d.as="script"),d.crossOrigin="",d.href=a,l&&d.setAttribute("nonce",l),document.head.appendChild(d),c)return new Promise((m,g)=>{d.addEventListener("load",m),d.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${a}`)))})}))}function i(s){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=s,window.dispatchEvent(l),!l.defaultPrevented)throw s}return o.then(s=>{for(const l of s||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},Cn=Symbol.for("app-tools::log::1.x");globalThis[Cn]={setDebug:Ju,debug:"window"in globalThis?new URL(window.location.href).searchParams.has("app-tools-debug"):!1};function Ju(e){globalThis[Cn].debug=!!e}function Yu(e,t){globalThis[Cn].debug&&(console.groupCollapsed(`[app-tools] ${e}`),t&&console.log(t),console.groupEnd())}function Xu(e){return(t,r)=>{Yu(`${e}: ${t}`,r)}}const Pt=Xu("router");class Qu extends Event{constructor(t){super("route-changed"),this.context=t}}class th extends EventTarget{context={params:{},query:{},title:"",url:new URL(window.location.href)};constructor(t){super(),this.config=t,this.routes=t.routes.map(r=>({...r,urlPattern:new URLPattern({pathname:r.path,baseURL:window.location.href,search:"*",hash:"*"})})),Pt("Initialized routes",this.routes),queueMicrotask(()=>{this.navigate(new URL(window.location.href),{replace:!0})}),window.addEventListener("popstate",this._onPopState),window.addEventListener("click",this._onAnchorClick)}uninstall(){window.removeEventListener("popstate",this._onPopState),window.removeEventListener("click",this._onAnchorClick)}get url(){return new URL(window.location.href)}get fallback(){return new URL(this.config?.fallback||this.baseUrl.href.substring(window.location.origin.length),this.baseUrl)}get baseUrl(){return new URL("./",document.baseURI)}render(){return Pt(`Rendering route ${this.context.url.pathname}${this.context.url.search}${this.context.url.hash}`,{context:this.context,route:this.route}),this.route?.render?.(this.context)}_matchRoute(t){for(const r of this.routes){const n=r.urlPattern.exec(t);if(n){const{title:o}=r,i=Object.fromEntries(new URLSearchParams(t.search)),s=n?.pathname?.groups??{};return this.context={url:t,title:typeof o=="function"?o({params:s,query:i,url:t}):o,params:s,query:i},r}}return Pt(`No route matched for ${t.pathname}${t.search}${t.hash}`,t),null}_notifyUrlChanged(){this.dispatchEvent(new Qu(this.context))}_onPopState=()=>{this.navigate(new URL(window.location.href),{backNav:!0})};_onAnchorClick=t=>{if(t.defaultPrevented||t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey)return;const r=t.composedPath().find(i=>i.tagName==="A");if(!r||!r.href)return;const n=new URL(r.href);if(this.url.href===n.href||n.host!==window.location.host||r.hasAttribute("download")||r.href.includes("mailto:"))return;const o=r.getAttribute("target");o&&o!==""&&o!=="_self"||(t.preventDefault(),this.navigate(n))};_collectPlugins(t){return[...this.config?.plugins??[],...t?.plugins??[]]}async navigate(t,r={}){typeof t=="string"&&(t=new URL(t,this.baseUrl));let n=this._matchRoute(t)||this._matchRoute(this.fallback);Pt(`Navigating to ${t.pathname}${t.search}${t.hash}`,{context:this.context,route:this.route});let o=this._collectPlugins(n);for(const i of o)try{const s=await i?.shouldNavigate?.(this.context);s&&(await s.condition()||(t=new URL(s.redirect,this.baseUrl),n=this._m
<app-header></app-header>
<main>
<div id="welcomeBar">
<sl-card id="welcomeCard">
<div slot="header">
<h2>Welcome to ${this.nostrAddy||"Guest"}'s Profile</h2>
</div>
<p>
You can upgrade your website into
a micro blog client with a social protocol to do things
like browse a feed, compose a note, or post to your network.
</p>
<div class="profile-picture-container">
<img class="profile-pic" src="${this.profilePic||"/assets/img/default_pfp.png"}" alt="Profile Picture" width="200px" height="200px">
<p class="personal-msg"><b>${this.bio||"Welcome, guest! Please sign in to view your profile."}</b></p>
</div>
<div class="nav-button-container">
<sl-button href="${Lt("about")}" variant="primary">About this Web App</sl-button>
<sl-button href="${Lt("note-wall")}" variant="primary">Feed</sl-button>
<sl-button href="${Lt("write")}" variant="primary">Compose a Note</sl-button>
</div>
${"share"in navigator?G`<sl-button slot="footer" variant="default" @click="${this.share}">
<sl-icon slot="prefix" name="share"></sl-icon>
Share this personal website with a friend!
</sl-button>`:null}
</sl-card>
</div>
</main>
`}};mt.styles=[fs,ct`
@media (horizontal-viewport-segments: 2) {
#welcomeBar {
flex-direction: row;
align-items: flex-start;
justify-content: space-between;
}
#welcomeCard {
margin-right: 64px;
}
}
/*
========================================
Profile Picture Container
========================================
*/
.profile-picture-container {
display: grid;
grid-template-columns: 400px 200px;
grid-template-rows: 250px;
grid-column-gap: 15px;
margin-bottom: 12px;
}
.profile-picture-container p {
margin: 0;
}
.profile-pic {
grid-area: 1/1;
margin-top: 25px;
margin-left: 100px;
margin-bottom: 10px;
border-radius: 50%;
}
.personal-msg {
grid-area: 1/2;
align-content: center;
align-items: center;
}
.nav-button-container {
justify-self: center;
align-self: end;
}
`];Wt([S()],mt.prototype,"message",2);Wt([S({type:String})],mt.prototype,"nostrAddy",2);Wt([S({type:String})],mt.prototype,"bio",2);Wt([S({type:String})],mt.prototype,"profilePic",2);Wt([S({type:Boolean})],mt.prototype,"isSignedIn",2);Wt([S({type:String})],mt.prototype,"publicKey",2);mt=Wt([qe("app-home")],mt);var oh=Object.defineProperty,ih=Object.getOwnPropertyDescriptor,Rt=(e,t,r,n)=>{for(var o=n>1?void 0:n?ih(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&oh(t,r,o),o};let lt=class extends gt{constructor(){super(...arguments),this.title="fostr",this.enableBack=!1,this.nostrAddy="",this.bio="",this.profilePic="",this.isSignedIn=!1,this.publicKey=""}connectedCallback(){super.connectedCallback();const e=localStorage.getItem("pubkey");e?(this.isSignedIn=!0,this.fetchProfileMetadata(e)):this.displayGuestView()}displayGuestView(){this.nostrAddy="",this.bio="Welcome, guest! Please sign in with a browser extension to view your profile.",this.profilePic="/public/assets/img/default_pfp.png",this.isSignedIn=!1,this.dispatchUserStateChanged()}async fetchProfileMetadata(e){try{const r=(await tr.connect("wss://notes.miguelalmodo.com")).subscribe([{kinds:[0],authors:[e]}],{onevent:n=>{const o=JSON.parse(n.content);this.profilePic=o.picture||"/assets/img/default_pfp.png",this.nostrAddy=o.nip05||"no addy available",this.bio=o.about||"bio not available",this.dispatchUserStateChanged()},oneose:()=>r.close()})}catch(t){console.error("Failed to fetch profile metadata:",t),this.displayGuestView()}}async signInWithNostr(){if(window.nostr)try{const e=await window.nostr.getPublicKey();this.isSignedIn=!0,localStorage.setItem("pubkey",e),await this.fetchProfileMetadata(e)}catch(e){console.error("Failed to sign in:",e),this.isSignedIn=!1}else alert("Nostr extension not detected. Please install a Nostr extension.")}signOut(){localStorage.removeItem("pubkey"),this.displayGuestView()}dispatchUserStateChanged(){this.dispatchEvent(new CustomEvent("user-state-changed",{detail:{isSignedIn:this.isSignedIn,nostrAddy:this.nostrAddy,bio:this.bio,profilePic:this.profilePic},bubbles:!0,composed:!0}))}render(){return G`
<header>
<div id="back-button-block">
${this.enableBack?G`<sl-button size="small" href="${Lt()}">
Back
</sl-button>`:null}
<h1>${this.title}</h1>
</div>
<sl-button variant="primary" @click="${this.isSignedIn?this.signOut:this.signInWithNostr}">
${this.isSignedIn?"Sign out":"Sign in"}
</sl-button>
</header>
`}};lt.styles=ct`
header {
display: flex;
justify-content: space-between;
align-items: center;
background: var(--app-color-primary);
color: white;
padding: 12px;
padding-top: 4px;
position: fixed;
left: env(titlebar-area-x, 0);
top: env(titlebar-area-y, 0);
height: env(titlebar-area-height, 30px);
width: env(titlebar-area-width, 100%);
-webkit-app-region: drag;
}
header h1 {
margin-top: 0;
margin-bottom: 0;
font-size: 12px;
font-weight: bold;
}
nav a {
margin-left: 10px;
}
#back-button-block {
display: flex;
justify-content: space-between;
align-items: center;
gap: 8px;
}
@media(prefers-color-scheme: light) {
header {
color: black;
}
nav a {
color: initial;
}
}
`;Rt([S({type:String})],lt.prototype,"title",2);Rt([S({type:Boolean})],lt.prototype,"enableBack",2);Rt([S({type:String})],lt.prototype,"nostrAddy",2);Rt([S({type:String})],lt.prototype,"bio",2);Rt([S({type:String})],lt.prototype,"profilePic",2);Rt([S({type:Boolean})],lt.prototype,"isSignedIn",2);Rt([S({type:String})],lt.prototype,"publicKey",2);lt=Rt([qe("app-header")],lt);var sh=Object.defineProperty,ah=Object.getOwnPropertyDescriptor,lh=(e,t,r,n)=>{for(var o=n>1?void 0:n?ah(t,r):t,i=e.length-1,s;i>=0;i--)(s=e[i])&&(o=(n?s(t,r,o):s(o))||o);return n&&o&&sh(t,r,o),o};let Dr=class extends gt{firstUpdated(){po.addEventListener("route-changed",()=>{"startViewTransition"in document?document.startViewTransition(()=>this.requestUpdate()):this.requestUpdate()})}render(){return po.render()}};Dr.styles=ct`
main {
padding-left: 16px;
padding-right: 16px;
padding-bottom: 16px;
}
`;Dr=lh([qe("app-index")],Dr);export{Zs as e,ct as i,S as n,gt as r,fs as s,qe as t,G as x};
//# sourceMappingURL=index-COc6jZBc.js.map