Back to Good Morning
SOURCE / PINNED RELEASE

Made of little things.

Good Morning

Release
1af1d78bec89…
Author-recorded commit
Not provided
License
Check the original source

The hash-verified playable HTML, which may contain bundled or minified code. This view does not execute it.

index.html
<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" /><title>Good Morning</title><meta name="description" content="A GM inbox: good-morning notes from the people you follow, marking the ones you have greeted back."><meta name="napplet-id" content="good-morning"><meta name="napplet-requires" content="identity outbox"><meta name="napplet-optional" content="intent link resource theme"><link rel="icon" href="data:image/png;base64,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" type="image/png">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    
    <script type="module" crossorigin>var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};function n(){let e=window;if(!e.napplet)throw Error(`window.napplet is unavailable -- runtime did not inject the napplet namespace`);return e.napplet}function r(e){let t=n()[e];if(!t)throw Error(`window.napplet.${String(e)} is unavailable -- runtime did not inject this domain`);return t}var i=`identity`,a=`theme`;function o(){let e=window;if(!e.napplet?.theme)throw Error(`window.napplet.theme is unavailable -- runtime did not inject this domain`);return e.napplet.theme}function s(){return o().get()}function c(e){return o().onChanged(e)}var l=`resource`,u=`outbox`,d=`intent`;function f(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function p(e,t,n=``){let r=f(e),i=e?.length,a=t!==void 0;if(!r||a&&i!==t){let o=n&&`"${n}" `,s=a?` of length ${t}`:``,c=r?`length=${i}`:`type=${typeof e}`;throw Error(o+`expected Uint8Array`+s+`, got `+c)}return e}var m=typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`,h=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function g(e){if(p(e),m)return e.toHex();let t=``;for(let n=0;n<e.length;n++)t+=h[e[n]];return t}var _={_0:48,_9:57,A:65,F:70,a:97,f:102};function v(e){if(e>=_._0&&e<=_._9)return e-_._0;if(e>=_.A&&e<=_.F)return e-(_.A-10);if(e>=_.a&&e<=_.f)return e-(_.a-10)}function y(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);if(m)return Uint8Array.fromHex(e);let t=e.length,n=t/2;if(t%2)throw Error(`hex string expected, got unpadded hex of length `+t);let r=new Uint8Array(n);for(let t=0,i=0;t<n;t++,i+=2){let n=v(e.charCodeAt(i)),a=v(e.charCodeAt(i+1));if(n===void 0||a===void 0){let t=e[i]+e[i+1];throw Error(`hex string expected, got non-hex character "`+t+`" at index `+i)}r[t]=n*16+a}return r}function b(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];p(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let i=e[t];n.set(i,r),r+=i.length}return n}function x(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===`Uint8Array`}function S(e,t){return Array.isArray(t)?t.length===0?!0:e?t.every(e=>typeof e==`string`):t.every(e=>Number.isSafeInteger(e)):!1}function C(e){if(typeof e!=`function`)throw Error(`function expected`);return!0}function ee(e,t){if(typeof t!=`string`)throw Error(`${e}: string expected`);return!0}function te(e){if(!Number.isSafeInteger(e))throw Error(`invalid integer: ${e}`)}function w(e){if(!Array.isArray(e))throw Error(`array expected`)}function ne(e,t){if(!S(!0,t))throw Error(`${e}: array of strings expected`)}function re(e,t){if(!S(!1,t))throw Error(`${e}: array of numbers expected`)}function T(...e){let t=e=>e,n=(e,t)=>n=>e(t(n));return{encode:e.map(e=>e.encode).reduceRight(n,t),decode:e.map(e=>e.decode).reduce(n,t)}}function E(e){let t=typeof e==`string`?e.split(``):e,n=t.length;ne(`alphabet`,t);let r=new Map(t.map((e,t)=>[e,t]));return{encode:r=>(w(r),r.map(r=>{if(!Number.isSafeInteger(r)||r<0||r>=n)throw Error(`alphabet.encode: digit index outside alphabet "${r}". Allowed: ${e}`);return t[r]})),decode:t=>(w(t),t.map(t=>{ee(`alphabet.decode`,t);let n=r.get(t);if(n===void 0)throw Error(`Unknown letter: "${t}". Allowed: ${e}`);return n}))}}function D(e=``){return ee(`join`,e),{encode:t=>(ne(`join.decode`,t),t.join(e)),decode:t=>(ee(`join.decode`,t),t.split(e))}}function ie(e,t=`=`){return te(e),ee(`padding`,t),{encode(n){for(ne(`padding.encode`,n);n.length*e%8;)n.push(t);return n},decode(n){ne(`padding.decode`,n);let r=n.length;if(r*e%8)throw Error(`padding: invalid, string should have whole number of bytes`);for(;r>0&&n[r-1]===t;r--)if((r-1)*e%8==0)throw Error(`padding: invalid, string has too much padding`);return n.slice(0,r)}}}function ae(e){return C(e),{encode:e=>e,decode:t=>e(t)}}var oe=(e,t)=>t===0?e:oe(t,e%t),se=(e,t)=>e+(t-oe(e,t)),ce=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function le(e,t,n,r){if(w(e),t<=0||t>32)throw Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw Error(`convertRadix2: wrong to=${n}`);if(se(t,n)>32)throw Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${se(t,n)}`);let i=0,a=0,o=ce[t],s=ce[n]-1,c=[];for(let r of e){if(te(r),r>=o)throw Error(`convertRadix2: invalid data word=${r} from=${t}`);if(i=i<<t|r,a+t>32)throw Error(`convertRadix2: carry overflow pos=${a} from=${t}`);for(a+=t;a>=n;a-=n)c.push((i>>a-n&s)>>>0);let e=ce[a];if(e===void 0)throw Error(`invalid carry`);i&=e-1}if(i=i<<n-a&s,!r&&a>=t)throw Error(`Excess padding`);if(!r&&i>0)throw Error(`Non-zero padding: ${i}`);return r&&a>0&&c.push(i>>>0),c}function ue(e,t=!1){if(te(e),e<=0||e>32)throw Error(`radix2: bits should be in (0..32]`);if(se(8,e)>32||se(e,8)>32)throw Error(`radix2: carry overflow`);return{encode:n=>{if(!x(n))throw Error(`radix2.encode input should be Uint8Array`);return le(Array.from(n),8,e,!t)},decode:n=>(re(`radix2.decode`,n),Uint8Array.from(le(n,e,8,t)))}}function de(e){return C(e),function(...t){try{return e.apply(null,t)}catch{}}}T(ue(4),E(`0123456789ABCDEF`),D(``)),T(ue(5),E(`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`),ie(5),D(``)),T(ue(5),E(`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`),D(``)),T(ue(5),E(`0123456789ABCDEFGHIJKLMNOPQRSTUV`),ie(5),D(``)),T(ue(5),E(`0123456789ABCDEFGHIJKLMNOPQRSTUV`),D(``)),T(ue(5),E(`0123456789ABCDEFGHJKMNPQRSTVWXYZ`),D(``),ae(e=>e.toUpperCase().replace(/O/g,`0`).replace(/[IL]/g,`1`)));var fe=typeof Uint8Array.from([]).toBase64==`function`&&typeof Uint8Array.fromBase64==`function`;fe||T(ue(6),E(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`),ie(6),D(``)),T(ue(6),E(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`),D(``)),fe||T(ue(6),E(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`),ie(6),D(``)),T(ue(6),E(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`),D(``));var pe=T(E(`qpzry9x8gf2tvdw0s3jn54khce6mua7l`),D(``)),me=[996825010,642813549,513874426,1027748829,705979059];function he(e){let t=e>>25,n=(e&33554431)<<5;for(let e=0;e<me.length;e++)(t>>e&1)==1&&(n^=me[e]);return n}function ge(e,t,n=1){let r=e.length,i=1;for(let t=0;t<r;t++){let n=e.charCodeAt(t);if(n<33||n>126)throw Error(`Invalid prefix (${e})`);i=he(i)^n>>5}i=he(i);for(let t=0;t<r;t++)i=he(i)^e.charCodeAt(t)&31;for(let e of t)i=he(i)^e;for(let e=0;e<6;e++)i=he(i);return i^=n,pe.encode(le([i%ce[30]],30,5,!1))}function _e(e){let t=e===`bech32`?1:734539939,n=ue(5),r=n.decode,i=n.encode,a=de(r);function o(e,n,r=90){ee(`bech32.encode prefix`,e),x(n)&&(n=Array.from(n)),re(`bech32.encode`,n);let i=e.length;if(i===0)throw TypeError(`Invalid prefix length ${i}`);let a=i+7+n.length;if(r!==!1&&a>r)throw TypeError(`Length ${a} exceeds limit ${r}`);let o=e.toLowerCase(),s=ge(o,n,t);return`${o}1${pe.encode(n)}${s}`}function s(e,n=90){ee(`bech32.decode input`,e);let r=e.length;if(r<8||n!==!1&&r>n)throw TypeError(`invalid string length: ${r} (${e}). Expected (8..${n})`);let i=e.toLowerCase();if(e!==i&&e!==e.toUpperCase())throw Error(`String must be lowercase or uppercase`);let a=i.lastIndexOf(`1`);if(a===0||a===-1)throw Error(`Letter "1" must be present between prefix and data only`);let o=i.slice(0,a),s=i.slice(a+1);if(s.length<6)throw Error(`Data must be at least 6 characters long`);let c=pe.decode(s).slice(0,-6),l=ge(o,c,t);if(!s.endsWith(l))throw Error(`Invalid checksum in ${e}: expected "${l}"`);return{prefix:o,words:c}}let c=de(s);function l(e){let{prefix:t,words:n}=s(e,!1);return{prefix:t,words:n,bytes:r(n)}}function u(e,t){return o(e,i(t))}return{encode:o,decode:s,encodeFromBytes:u,decodeToBytes:l,decodeUnsafe:c,fromWords:r,fromWordsUnsafe:a,toWords:i}}var ve=_e(`bech32`);_e(`bech32m`),typeof Uint8Array.from([]).toHex==`function`&&typeof Uint8Array.fromHex==`function`||T(ue(4),E(`0123456789abcdef`),D(``),ae(e=>{if(typeof e!=`string`||e.length%2!=0)throw TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));var ye=new TextDecoder(`utf-8`),be=new TextEncoder,xe=5e3;function Se(e){let t=new Uint8Array(4);return t[0]=e>>24&255,t[1]=e>>16&255,t[2]=e>>8&255,t[3]=e&255,t}function Ce(e){let{prefix:t,words:n}=ve.decode(e,xe),r=new Uint8Array(ve.fromWords(n));switch(t){case`nprofile`:{let e=we(r);if(!e[0]?.[0])throw Error(`missing TLV 0 for nprofile`);if(e[0][0].length!==32)throw Error(`TLV 0 should be 32 bytes`);return{type:`nprofile`,data:{pubkey:g(e[0][0]),relays:e[1]?e[1].map(e=>ye.decode(e)):[]}}}case`nevent`:{let e=we(r);if(!e[0]?.[0])throw Error(`missing TLV 0 for nevent`);if(e[0][0].length!==32)throw Error(`TLV 0 should be 32 bytes`);if(e[2]&&e[2][0].length!==32)throw Error(`TLV 2 should be 32 bytes`);if(e[3]&&e[3][0].length!==4)throw Error(`TLV 3 should be 4 bytes`);return{type:`nevent`,data:{id:g(e[0][0]),relays:e[1]?e[1].map(e=>ye.decode(e)):[],author:e[2]?.[0]?g(e[2][0]):void 0,kind:e[3]?.[0]?parseInt(g(e[3][0]),16):void 0}}}case`naddr`:{let e=we(r);if(!e[0]?.[0])throw Error(`missing TLV 0 for naddr`);if(!e[2]?.[0])throw Error(`missing TLV 2 for naddr`);if(e[2][0].length!==32)throw Error(`TLV 2 should be 32 bytes`);if(!e[3]?.[0])throw Error(`missing TLV 3 for naddr`);if(e[3][0].length!==4)throw Error(`TLV 3 should be 4 bytes`);return{type:`naddr`,data:{identifier:ye.decode(e[0][0]),pubkey:g(e[2][0]),kind:parseInt(g(e[3][0]),16),relays:e[1]?e[1].map(e=>ye.decode(e)):[]}}}case`nsec`:return{type:t,data:r};case`npub`:case`note`:return{type:t,data:g(r)};default:throw Error(`unknown prefix ${t}`)}}function we(e){let t={},n=e;for(;n.length>0;){if(n.length<2)throw Error(`not enough data to read TLV`);let e=n[0],r=n[1],i=n.slice(2,2+r);if(n=n.slice(2+r),i.length<r)throw Error(`not enough data to read on TLV ${e}`);t[e]=t[e]||[],t[e].push(i)}return t}function Te(e){return De(`npub`,y(e))}function Ee(e,t){let n=ve.toWords(t);return ve.encode(e,n,xe)}function De(e,t){return Ee(e,t)}function Oe(e){let t;return e.kind!==void 0&&(t=Se(e.kind)),Ee(`nevent`,Ae({0:[y(e.id)],1:(e.relays||[]).map(e=>be.encode(e)),2:e.author?[y(e.author)]:[],3:t?[new Uint8Array(t)]:[]}))}function ke(e){let t=new ArrayBuffer(4);return new DataView(t).setUint32(0,e.kind,!1),Ee(`naddr`,Ae({0:[be.encode(e.identifier)],1:(e.relays||[]).map(e=>be.encode(e)),2:[y(e.pubkey)],3:[new Uint8Array(t)]}))}function Ae(e){let t=[];return Object.entries(e).reverse().forEach(([e,n])=>{n.forEach(n=>{let r=new Uint8Array(n.length+2);r.set([parseInt(e)],0),r.set([n.length],1),r.set(n,2),t.push(r)})}),b(...t)}var je=`link`,Me={getPublicKey(){return r(`identity`).getPublicKey()},onChanged(e){return r(`identity`).onChanged(e)},getRelays(){return r(`identity`).getRelays()},getProfile(){return r(`identity`).getProfile()},getFollows(){return r(`identity`).getFollows()},getList(e){return r(`identity`).getList(e)},getZaps(){return r(`identity`).getZaps()},getMutes(){return r(`identity`).getMutes()},getBlocked(){return r(`identity`).getBlocked()},getBadges(){return r(`identity`).getBadges()}},Ne={info(){return r(`resource`).info()},bytes(e,t){return r(`resource`).bytes(e,t)},bytesMany(e,t){return r(`resource`).bytesMany(e,t)},bytesAsObjectURL(e){return r(`resource`).bytesAsObjectURL(e)}},Pe={getEvent(e,t){return r(`outbox`).getEvent(e,t)},query(e,t){return r(`outbox`).query(e,t)},subscribe(e,t){return r(`outbox`).subscribe(e,t)},publish(e,t){return r(`outbox`).publish(e,t)},resolveRelays(e){return r(`outbox`).resolveRelays(e)}},Fe={invoke(e,t){return r(`intent`).invoke(e,t)},open(e,t){return r(`intent`).open(e,t)},available(e){return r(`intent`).available(e)},handlers(){return r(`intent`).handlers()},onChanged(e){return r(`intent`).onChanged(e)},onDelivery(e){return r(`intent`).onDelivery(e)}},Ie={open(e,t){return r(`link`).open(e,t)}},Le={"--hg-color-scheme":`dark`,"--hg-bg-base":`#14110c`,"--hg-bg-surface":`#1a1a1a`,"--hg-bg-elevated":`#242016`,"--hg-bg-overlay":`#080706`,"--hg-border-default":`#4a453c`,"--hg-border-dim":`#3a3a3a`,"--hg-text-primary":`#f5f1e8`,"--hg-text-secondary":`#d8d0c0`,"--hg-text-muted":`#b8b1a4`,"--hg-text-dim":`#776f62`,"--hg-accent-green":`#9be564`,"--hg-accent-amber":`#e5c464`,"--hg-accent-red":`#ff7369`,"--hg-font-body":`ui-monospace, 'JetBrains Mono', SFMono-Regular, Menlo, Consolas, monospace`,"--hg-font-mono":`ui-monospace, 'JetBrains Mono', SFMono-Regular, Menlo, Consolas, monospace`},Re={background:`--hg-bg-base`,text:`--hg-text-primary`,primary:`--hg-accent-green`};function ze(e){return Math.max(0,Math.min(255,Math.round(e)))}function Be(e){if(!e)return null;let t=/^#([0-9a-f]{6})$/i.exec(e.trim());if(!t)return null;let n=t[1];return[parseInt(n.slice(0,2),16),parseInt(n.slice(2,4),16),parseInt(n.slice(4,6),16)]}function Ve([e,t,n]){return`#${[e,t,n].map(e=>ze(e).toString(16).padStart(2,`0`)).join(``)}`}function He(e,t,n){return e.map((e,r)=>e+(t[r]-e)*n)}function Ue([e,t,n]){let[r,i,a]=[e,t,n].map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*r+.7152*i+.0722*a}function We(e){let t=document.documentElement.style;for(let[n,r]of Object.entries(e))t.setProperty(n,r);let n=e[`--hg-color-scheme`];(n===`light`||n===`dark`)&&(document.documentElement.dataset.hgTheme=n);for(let[n,r]of Object.entries(e)){let e=/^#([0-9a-f]{6})$/i.exec(r.trim());if(!e)continue;let i=e[1];t.setProperty(`${n}-rgb`,`${parseInt(i.slice(0,2),16)} ${parseInt(i.slice(2,4),16)} ${parseInt(i.slice(4,6),16)}`)}}function Ge(e){let t={},n=e.fonts?.body?.name;typeof n==`string`&&n.trim()&&(t[`--hg-font-body`]=n);let r=Be(e.colors.background),i=Be(e.colors.text),a=Be(e.colors.primary);if(r&&i&&a){for(let[n,r]of Object.entries(Re)){let i=e.colors[n];typeof i==`string`&&i.trim()&&(t[r]=i)}let n=Ue(r)>.56,o=n?[255,255,255]:[0,0,0],s=n?[48,42,30]:[255,255,255];t[`--hg-color-scheme`]=n?`light`:`dark`,t[`--hg-bg-surface`]=Ve(He(r,o,n?.44:.12)),t[`--hg-bg-elevated`]=Ve(He(r,o,n?.68:.2)),t[`--hg-bg-overlay`]=Ve(He(r,o,n?.82:.48)),t[`--hg-border-default`]=Ve(He(r,s,n?.2:.28)),t[`--hg-border-dim`]=Ve(He(r,s,n?.12:.18)),t[`--hg-text-secondary`]=Ve(He(i,r,.32)),t[`--hg-text-muted`]=Ve(He(i,r,.48)),t[`--hg-text-dim`]=Ve(He(i,r,.64)),t[`--hg-accent-amber`]=Ve(n?He(a,[245,158,11],.72):He(a,[229,196,100],.72)),t[`--hg-accent-red`]=Ve(n?He(a,[220,38,38],.76):He(a,[255,115,105],.76))}return t}function Ke(){if(We(Le),!globalThis.napplet?.theme)return{close:()=>void 0};try{s().then(e=>We(Ge(e))).catch(()=>void 0)}catch{}let e=null;try{e=c(e=>We(Ge(e)))}catch{}return{close:()=>e?.close()}}var qe=Ke,Je=Array.isArray,Ye=Array.prototype.indexOf,Xe=Array.prototype.includes,Ze=Array.from,Qe=Object.defineProperty,$e=Object.getOwnPropertyDescriptor,et=Object.getOwnPropertyDescriptors,tt=Object.prototype,nt=Array.prototype,rt=Object.getPrototypeOf,it=Object.isExtensible,at=()=>{};function ot(e){for(var t=0;t<e.length;t++)e[t]()}function st(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var ct=1024,lt=2048,ut=4096,dt=8192,ft=16384,pt=32768,mt=1<<25,ht=65536,gt=1<<19,_t=1<<20,vt=1<<25,yt=1<<21,bt=1<<22,xt=1<<23,St=Symbol(`$state`),Ct=Symbol(`component`),wt=Symbol(`legacy props`),Tt=Symbol(``),Et=Symbol(`attributes`),Dt=Symbol(`class`),Ot=Symbol(`style`),kt=Symbol(`text`),At=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},jt=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`),Mt={},O=Symbol(`uninitialized`),Nt=`http://www.w3.org/1999/xhtml`;function Pt(){console.warn(`https://svelte.dev/e/derived_inert`)}function Ft(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function It(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var k=!1;function Lt(e){k=e}var A;function Rt(e){if(e===null)throw Ft(),Mt;return A=e}function zt(){return Rt(fr(A))}function j(e){if(k){if(fr(A)!==null)throw Ft(),Mt;A=e}}function Bt(e=1){if(k){for(var t=e,n=A;t--;)n=fr(n);A=n}}function Vt(e=!0){for(var t=0,n=A;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else(r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=fr(n);e&&n.remove(),n=i}}function Ht(e){if(!e||e.nodeType!==8)throw Ft(),Mt;return e.data}function Ut(e){return e===this.v}function Wt(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function Gt(e){return!Wt(e,this.v)}function Kt(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function qt(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function Jt(e,t,n){throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Yt(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Xt(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Zt(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Qt(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function $t(e){throw Error(`https://svelte.dev/e/props_invalid_value`)}function en(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function tn(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function nn(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function rn(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var M=null;function an(e){M=e}function on(e,t=!1,n){M={p:M,i:!1,c:null,e:null,s:e,x:null,r:U,l:null}}function sn(e){var t=M,n=t.e;if(n!==null){t.e=null;for(var r of n)Er(r)}return e!==void 0&&(t.x=e),t.i=!0,M=t.p,cn(e)}function cn(e={}){return Qe(e,Ct,{value:!0}),e}function ln(){return!0}var un=[];function dn(){var e=un;un=[],ot(e)}function fn(e){if(un.length===0&&!Pn){var t=un;queueMicrotask(()=>{t===un&&dn()})}un.push(e)}var pn=~(lt|ut|ct);function N(e,t){e.f=e.f&pn|t}function mn(e){e.f&512||e.deps===null?N(e,ct):N(e,ut)}function hn(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),N(e,ct)}function gn(e){var t=H,n=U;Jr(null),Yr(null);try{return e()}finally{Jr(t),Yr(n)}}function _n(e,t,n,r){let i=ln()?xn:wn;var a=e.filter(e=>!e.settled),o=t.map(i);if(n.length===0&&a.length===0){r(o);return}var s=U,c=vn(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function u(e){if(!(s.f&16384)){c();try{r([...o,...e])}catch(e){yr(e,s)}yn()}}var d=bn();if(n.length===0){l.then(()=>u([])).finally(d);return}function f(){Promise.all(n.map(e=>Cn(e))).then(u).catch(e=>yr(e,s)).finally(d)}l?l.then(()=>{s.f&16384?d():(c(),f(),yn())}):f()}function vn(){var e=U,t=H,n=M,r=F;return function(i=!0){Yr(e),Jr(t),an(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function yn(e=!0){Yr(null),Jr(null),an(null),e&&F?.deactivate()}function bn(){var e=U,t=e.b,n=F,r=!!t?.is_rendered();return t?.update_pending_count(1,n),n.increment(r,e),()=>{t?.update_pending_count(-1,n),n.decrement(r,e)}}function xn(e){var t=2|lt;return U!==null&&(U.f|=gt),{ctx:M,deps:null,effects:null,equals:Ut,f:t,fn:e,reactions:null,rv:0,v:O,wv:0,parent:U,ac:null}}var Sn=Symbol(`obsolete`);function Cn(e,t,n){let r=U;r===null&&qt();var i=void 0,a=Xn(O),o=!H,s=new Set;return kr(()=>{var t=U,n=st();i=n.promise;try{Promise.resolve(e()).then(n.resolve,e=>{e!==At&&n.reject(e)}).finally(yn)}catch(e){n.reject(e),yn()}var c=F;if(o){if(t.f&32768)var l=bn();if(r.b?.is_rendered())c.async_deriveds.get(t)?.reject(Sn);else for(let e of s.values())e.reject(Sn);s.add(n),c.async_deriveds.set(t,n)}let u=(e,t=void 0)=>{l?.(),s.delete(n),t!==Sn&&(c.activate(),t?(a.f|=xt,er(a,t)):(a.f&8388608&&(a.f^=xt),er(a,e)),c.deactivate())};n.promise.then(u,e=>u(null,e||`unknown`))}),wr(()=>{for(let e of s)e.reject(Sn)}),new Promise(e=>{function t(n){function r(){n===i?e(a):t(i)}n.then(r,r)}t(i)})}function P(e){let t=xn(e);return Zr(t),t}function wn(e){let t=xn(e);return t.equals=Gt,t}function Tn(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)Ir(t[n])}}function En(e){var t,n=U,r=e.parent;if(!Gr&&r!==null&&e.v!==O&&r.f&24576)return Pt(),e.v;Yr(r);try{Tn(e),t=li(e)}finally{Yr(n)}return t}function Dn(e){var t=En(e);!e.equals(t)&&(e.wv=oi(),(!F?.is_fork||e.deps===null)&&(F===null?e.v=t:(F.capture(e,t,!0),jn?.capture(e,t,!0)),e.deps===null))?N(e,ct):Gr||(Mn===null?mn(e):(Cr()||F?.is_fork)&&Mn.set(e,t))}function On(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac!==null&&gn(()=>{t.ac.abort(At),t.ac=null}),t.fn!==null&&(t.teardown=at),fi(t,0),Pr(t))}function kn(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&t.fn!==null&&pi(t)}var An=null,F=null,jn=null,Mn=null,Nn=null,Pn=!1,Fn=!1,In=null,Ln=null,Rn=0,zn=1,Bn=class e{id=zn++;#e=!1;linked=!0;#t=null;#n=null;async_deriveds=new Map;current=new Map;previous=new Map;#r=new Set;#i=new Set;#a=0;#o=new Map;#s=null;#c=[];#l=[];#u=new Set;#d=new Set;#f=new Map;#p=new Set;is_fork=!1;#m=!1;constructor(){An===null?An=this:(An.#n=this,this.#t=An),An=this}#h(){if(this.is_fork)return!0;for(let n of this.#o.keys()){for(var e=n,t=!1;e.parent!==null;){if(this.#f.has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1}skip_effect(e){this.#f.has(e)||this.#f.set(e,{d:[],m:[]}),this.#p.delete(e)}unskip_effect(e,t=e=>this.schedule(e)){var n=this.#f.get(e);if(n){this.#f.delete(e);for(var r of n.d)N(r,lt),t(r);for(r of n.m)N(r,ut),t(r)}this.#p.add(e)}#g(){var e=[];for(let i of this.#c)if(!(i.f&16384||!(i.f&6144))){for(var t=i,n=!1;t.parent!==null;){t=t.parent;var r=t.f;if(r&96){if(!(r&1024)){n=!0;break}t.f^=ct}}n||e.push(t)}return this.#c=[],e}#_(){this.#e=!0;for(let e of this.#u)this.#d.delete(e),N(e,lt),this.schedule(e);for(let e of this.#d)N(e,ut),this.schedule(e);this.apply();for(var t=In=[],n=[],r=Ln=[];this.#c.length>0;){Rn++>1e3&&(this.#S(),Vn());for(let e of this.#g())try{this.#v(e,t,n)}catch(t){throw Kn(e),this.#h()||this.discard(),t}}if(F=null,r.length>0){var i=e.ensure();for(let e of r)i.schedule(e)}if(In=null,Ln=null,this.#h()){this.#x(n),this.#x(t);for(let[e,t]of this.#f)Gn(e,t);r.length>0&&F.#_();return}let a=this.#y();if(a)this.#x(n),this.#x(t),a.#b(this);else{this.#u.clear(),this.#d.clear();for(let e of this.#r)e(this);this.#r.clear(),jn=this,Un(n),Un(t),jn=null,this.#s?.resolve();var o=F;if(this.#a===0&&(this.#c.length===0||o!==null)&&this.#S(),this.#c.length>0){if(o!==null){for(let e of this.#c)o.#c.push(e);this.#c=[]}else o=this}o!==null&&(Jn.clear(),o.#_())}}#v(e,t,n){e.f^=ct;for(var r=e.first;r!==null;){var i=r.f,a=!!(i&96);if(!(a&&i&1024||i&8192||this.#f.has(r))&&r.fn!==null){a?r.f^=ct:i&4?t.push(r):si(r)&&(i&16&&this.#d.add(r),pi(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#y(){for(var e=this.#t;e!==null;){if(!e.is_fork){for(let[t,[,n]]of this.current)if(e.current.has(t)&&!n)return e}e=e.#t}return null}#b(e){for(let[t,n]of e.current)!this.previous.has(t)&&e.previous.has(t)&&this.previous.set(t,e.previous.get(t)),this.current.set(t,n);for(let[t,n]of e.async_deriveds){let e=this.async_deriveds.get(t);e&&n.promise.then(e.resolve).catch(e.reject)}e.async_deriveds.clear(),this.transfer_effects(e.#u,e.#d);let t=e=>{var n=e.reactions;if(n!==null&&!(e.f&2&&!(e.f&6144)))for(let e of n){var r=e.f;if(r&2)t(e);else{var i=e;r&4194320&&!this.async_deriveds.has(i)&&(this.#d.delete(i),N(i,lt),this.schedule(i))}}};for(let e of this.current.keys())t(e);this.oncommit(()=>e.discard()),e.#S(),F=this,this.#_()}#x(e){for(var t=0;t<e.length;t+=1)hn(e[t],this.#u,this.#d)}capture(e,t,n=!1){e.v!==O&&!this.previous.has(e)&&this.previous.set(e,e.v),e.f&8388608||(this.current.set(e,[t,n]),Mn?.set(e,t)),this.is_fork||(e.v=t)}activate(){F=this}deactivate(){F=null,Mn=null}flush(){try{Fn=!0,F=this,this.#_()}finally{Rn=0,Nn=null,In=null,Ln=null,Fn=!1,F=null,Mn=null,Jn.clear()}}discard(){for(let e of this.#i)e(this);this.#i.clear();for(let e of this.async_deriveds.values())e.reject(Sn);this.#S(),this.#s?.resolve()}register_created_effect(e){this.#l.push(e)}increment(e,t){if(this.#a+=1,e){let e=this.#o.get(t)??0;this.#o.set(t,e+1)}}decrement(e,t){if(--this.#a,e){let e=this.#o.get(t)??0;e===1?this.#o.delete(t):this.#o.set(t,e-1)}this.#m||(this.#m=!0,fn(()=>{this.#m=!1,this.linked&&this.flush()}))}transfer_effects(e,t){for(let t of e)this.#u.add(t);for(let e of t)this.#d.add(e);e.clear(),t.clear()}oncommit(e){this.#r.add(e)}ondiscard(e){this.#i.add(e)}settled(){return(this.#s??=st()).promise}static ensure(){if(F===null){let t=F=new e;!Fn&&fn(()=>{t.#e||t.flush()})}return F}apply(){Mn=null}schedule(e){Nn=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)?e.b.defer_effect(e):this.#c.push(e)}#S(){if(this.linked){var e=this.#t,t=this.#n;e===null||(e.#n=t),t===null?An=e:t.#t=e,this.linked=!1}}};function Vn(){try{Qt()}catch(e){yr(e,Nn)}}var Hn=null;function Un(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&si(r)&&(Hn=new Set,pi(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Rr(r),Hn?.size>0)){Jn.clear();for(let e of Hn){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)Hn.has(n)&&(Hn.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||pi(n)}}Hn.clear()}}Hn=null}}function Wn(e){F.schedule(e)}function Gn(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),N(e,ct);for(var n=e.first;n!==null;)Gn(n,t),n=n.next}}function Kn(e){N(e,ct);for(var t=e.first;t!==null;)Kn(t),t=t.next}var qn=new Set,Jn=new Map,Yn=!1;function Xn(e,t){return{f:0,v:e,reactions:null,equals:Ut,rv:0,wv:0}}function I(e,t){let n=Xn(e,t);return Zr(n),n}function Zn(e,t=!1,n=!0){let r=Xn(e);return t||(r.equals=Gt),r}function L(e,t,n=!1){return H!==null&&(!qr||H.f&131072)&&ln()&&H.f&4325394&&(Xr===null||!Xr.has(e))&&nn(),er(e,n?ir(t):t,Ln)}var Qn=null,$n=0;function er(e,t,n=null){if(!e.equals(t)){Gr?Jn.set(e,t):Jn.has(e)||Jn.set(e,e.v);var r=Bn.ensure();if(r.capture(e,t),e.f&2){let t=e;e.f&2048&&En(t),Mn===null&&mn(t)}e.wv=oi(),Qn=null,$n=0,rr(e,lt,n),Qn=null,ln()&&U!==null&&U.f&1024&&!(U.f&96)&&(ei===null?ti([e]):ei.push(e)),!r.is_fork&&qn.size>0&&!Yn&&tr()}return t}function tr(){Yn=!1;for(let e of qn){e.f&1024&&N(e,ut);let t;try{t=si(e)}catch{t=!0}t&&pi(e)}qn.clear()}function nr(e){L(e,e.v+1)}function rr(e,t,n){var r=e.reactions;if(r!==null){var i=ln(),a=r.length;if($n+=a,$n>1e5&&Qn===null&&(Qn=new Set),Qn!==null){if(Qn.has(e))return;Qn.add(e)}for(var o=0;o<a;o++){var s=r[o],c=s.f;if(i||s!==U){var l=(c&lt)===0;if(l&&N(s,t),c&131072)qn.add(s);else if(c&2){var u=s;Mn?.delete(u),rr(u,ut,n)}else if(l){var d=s;c&16&&Hn!==null&&Hn.add(d),n===null?Wn(d):n.push(d)}}}}}function ir(e){if(typeof e!=`object`||!e||St in e||Ct in e)return e;let t=rt(e);if(t!==tt&&t!==nt)return e;var n=new Map,r=Je(e),i=I(0),a=null,o=ii,s=e=>{if(ii===o)return e();var t=H,n=ii;Jr(null),ai(o);var r=e();return Jr(t),ai(n),r};return r&&n.set(`length`,I(e.length,a)),new Proxy(e,{defineProperty(e,t,r){(!(`value`in r)||r.configurable===!1||r.enumerable===!1||r.writable===!1)&&en();var i=n.get(t);return i===void 0?s(()=>{var e=I(r.value,a);return n.set(t,e),e}):L(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=s(()=>I(O,a));n.set(t,e),nr(i)}}else L(r,O),nr(i);return!0},get(t,r,i){if(r===St)return e;var o=n.get(r),c=r in t;if(o===void 0&&(!c||$e(t,r)?.writable)&&(o=s(()=>I(ir(c?t[r]:O),a)),n.set(r,o)),o!==void 0){var l=W(o);return l===O?void 0:l}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){this.has?.(e,t);var r=Reflect.getOwnPropertyDescriptor(e,t),i=n.get(t);if(i!==void 0){var a=W(i);if(a===O)return;if(r&&`value`in r)r.value=a;else return{enumerable:!0,configurable:!0,value:a,writable:!0}}return r},has(e,t){if(t===St)return!0;var r=n.get(t),i=r!==void 0&&r.v!==O||Reflect.has(e,t);return(r!==void 0||U!==null&&(!i||$e(e,t)?.writable))&&(r===void 0&&(r=s(()=>I(i?ir(e[t]):O,a)),n.set(t,r)),W(r)===O)?!1:i},set(e,t,o,c){var l=n.get(t),u=t in e;if(r&&t===`length`)for(var d=o;d<l.v;d+=1){var f=n.get(d+``);f===void 0?d in e&&(f=s(()=>I(O,a)),n.set(d+``,f)):L(f,O)}if(l===void 0)(!u||$e(e,t)?.writable)&&(l=s(()=>I(void 0,a)),L(l,ir(o)),n.set(t,l));else{u=l.v!==O;var p=s(()=>ir(o));L(l,p)}var m=Reflect.getOwnPropertyDescriptor(e,t);if(m?.set&&m.set.call(c,o),!u){if(r&&typeof t==`string`){var h=n.get(`length`),g=Number(t);Number.isInteger(g)&&g>=h.v&&L(h,g+1)}nr(i)}return!0},ownKeys(e){W(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==O});for(var[r,a]of n)a.v!==O&&!(r in e)&&t.push(r);return t},setPrototypeOf(){tn()}})}var ar,or,sr,cr;function lr(){if(ar===void 0){ar=window,or=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;sr=$e(t,`firstChild`).get,cr=$e(t,`nextSibling`).get,it(e)&&(e[Dt]=void 0,e[Et]=null,e[Ot]=void 0,e.__e=void 0),it(n)&&(n[kt]=void 0)}}function ur(e=``){return document.createTextNode(e)}function dr(e){return sr.call(e)}function fr(e){return cr.call(e)}function R(e,t){if(!k)return dr(e);var n=dr(A);if(n===null)n=A.appendChild(ur());else if(t&&n.nodeType!==3){var r=ur();return n?.before(r),Rt(r),r}return t&&_r(n),Rt(n),n}function pr(e,t=!1){if(!k){var n=dr(e);return n instanceof Comment&&n.data===``?fr(n):n}if(t){if(A?.nodeType!==3){var r=ur();return A?.before(r),Rt(r),r}_r(A)}return A}function z(e,t=!1){if(!k)return dr(e);var n=R(e,t);return j(e),n}function B(e,t=1,n=!1){let r=k?A:e;for(var i;t--;)i=r,r=fr(r);if(!k)return r;if(n){if(r?.nodeType!==3){var a=ur();return r===null?i?.after(a):r.before(a),Rt(a),a}_r(r)}return Rt(r),r}function mr(e){e.textContent=``}function hr(){return!1}function gr(e,t,n){return t==null||t===`http://www.w3.org/1999/xhtml`?n?document.createElement(e,{is:n}):document.createElement(e):n?document.createElementNS(t,e,{is:n}):document.createElementNS(t,e)}function _r(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function vr(e){var t=U;if(t===null)return H.f|=xt,e;if(!(t.f&32768)&&!(t.f&4))throw e;yr(e,t)}function yr(e,t){if(e===Mt)throw e;if(!(t!==null&&t.f&16384)){for(;t!==null;){if(t.f&128&&!(t.f&33570816)){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}}function br(e){U===null&&(H===null&&Zt(e),Xt()),Gr&&Yt(e)}function xr(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function Sr(e,t){var n=U;n!==null&&n.f&8192&&(e|=dt);var r={ctx:M,deps:null,nodes:null,f:e|lt|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};F?.register_created_effect(r);var i=r;if(e&4)In===null?Bn.ensure().schedule(r):In.push(r);else if(t!==null){try{pi(r)}catch(e){throw Ir(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=ht))}if(i!==null&&(i.parent=n,n!==null&&xr(i,n),H!==null&&H.f&2&&!(e&64))){var a=H;(a.effects??=[]).push(i)}return r}function Cr(){return H!==null&&!qr}function wr(e){let t=Sr(8,null);return N(t,ct),t.teardown=e,t}function Tr(e){br(`$effect`);var t=U.f;if(!H&&t&32&&M!==null&&!M.i){var n=M;(n.e??=[]).push(e)}else return Er(e)}function Er(e){return Sr(4|_t,e)}function Dr(e){Bn.ensure();let t=Sr(64|gt,e);return(e={})=>new Promise(n=>{e.outro?zr(t,()=>{Ir(t),n(void 0)}):(Ir(t),n(void 0))})}function Or(e){return Sr(4,e)}function kr(e){return Sr(bt|gt,e)}function Ar(e,t=0){return Sr(8|t,e)}function V(e,t=[],n=[],r=[]){_n(r,t,n,t=>{Sr(8,()=>{e(...t.map(W))})})}function jr(e,t=0){return Sr(16|t,e)}function Mr(e){return Sr(32|gt,e)}function Nr(e){var t=e.teardown;if(t!==null){let n=Gr,r=H;Kr(!0),Jr(null);try{t.call(null)}catch(t){yr(t,e.parent)}finally{Kr(n),Jr(r)}}}function Pr(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&gn(()=>{e.abort(At)});var r=n.next;n.f&64?n.parent=null:Ir(n,t),n=r}}function Fr(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||Ir(t),t=n}}function Ir(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(Lr(e.nodes.start,e.nodes.end),n=!0),e.f|=mt,Pr(e,t&&!n),fi(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();Nr(e),e.f^=mt,e.f|=ft;var i=e.parent;i!==null&&i.first!==null&&Rr(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=e.b=null}function Lr(e,t){for(;e!==null;){var n=e===t?null:fr(e);e.remove(),e=n}}function Rr(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function zr(e,t,n=!0){var r=[];e.f|=256,Br(e,r,!0);var i=()=>{n&&Ir(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Br(e,t,n){if(!(e.f&8192)){e.f^=dt;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next;if(!(i.f&64)){var o=!!(i.f&65536)||!!(i.f&32)&&!!(e.f&16);Br(i,t,o?n:!1)}i=a}}}function Vr(e){e.f&=-257,Hr(e,!0)}function Hr(e,t){if(!(e.f&256)&&e.f&8192){e.f^=dt,e.f&1024||(N(e,lt),Bn.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=!!(n.f&65536)||!!(n.f&32);Hr(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function Ur(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:fr(n);t.append(n),n=i}}var Wr=null,Gr=!1;function Kr(e){Gr=e}var H=null,qr=!1;function Jr(e){H=e}var U=null;function Yr(e){U=e}var Xr=null;function Zr(e){H!==null&&(H.f&2097152||H.f&2)&&(Xr??=new Set).add(e)}var Qr=null,$r=0,ei=null;function ti(e){ei=e}var ni=1,ri=0,ii=ri;function ai(e){ii=e}function oi(){return++ni}function si(e){var t=e.f;if(t&2048)return!0;if(t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(si(a)&&Dn(a),a.wv>e.wv)return!0}t&512&&Mn===null&&N(e,ct)}return!1}function ci(e,t,n=!0){var r=e.reactions;if(r!==null&&!(Xr!==null&&Xr.has(e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?ci(a,t,!1):t===a&&(n?N(a,lt):a.f&1024&&N(a,ut),Wn(a))}}function li(e){var t=Qr,n=$r,r=ei,i=H,a=Xr,o=M,s=qr,c=ii,l=e.f;Qr=null,$r=0,ei=null,H=l&96?null:e,Xr=null,an(e.ctx),qr=!1,ii=++ri,e.ac!==null&&(gn(()=>{e.ac.abort(At)}),e.ac=null);try{e.f|=yt;var u=e.fn,d=u();e.f|=pt;var f=ui(e);if(ln()&&ei!==null&&!qr&&f!==null&&!(e.f&6146))for(var p=0;p<ei.length;p++)ci(ei[p],e);if(i!==null&&i!==e){if(ri++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=ri;if(t!==null)for(let e of t)e.rv=ri;ei!==null&&(r===null?r=ei:r.push(...ei))}return e.f&8388608&&(e.f^=xt),d}catch(t){return ui(e),vr(t)}finally{e.f^=yt,Qr=t,$r=n,ei=r,H=i,Xr=a,an(o),qr=s,ii=c}}function ui(e){var t=e.deps,n=F?.is_fork;if(Qr!==null){var r;if(n||fi(e,$r),t!==null&&$r>0)for(t.length=$r+Qr.length,r=0;r<Qr.length;r++)t[$r+r]=Qr[r];else e.deps=t=Qr;if(Cr()&&e.f&512)for(r=$r;r<t.length;r++)(t[r].reactions??=[]).push(e)}else!n&&t!==null&&$r<t.length&&(fi(e,$r),t.length=$r);return t}function di(e,t){let n=t.reactions;if(n!==null){var r=Ye.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&t.f&2&&(Qr===null||!Xe.call(Qr,t))){var a=t;a.f&512&&(a.f^=512),a.v!==O&&mn(a),a.ac!==null&&gn(()=>{a.ac.abort(At),a.ac=null,N(a,lt)}),On(a),fi(a,0)}}function fi(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)di(e,n[r])}function pi(e){var t=e.f;if(!(t&16384)){N(e,ct);var n=U;U=e;try{t&16777232?Fr(e):Pr(e),Nr(e);var r=li(e);e.teardown=typeof r==`function`?r:null,e.wv=ni}finally{U=n}}}function W(e){var t=!!(e.f&2);if(Wr?.add(e),H!==null&&!qr&&!(U!==null&&U.f&16384)&&(Xr===null||!Xr.has(e))){var n=H.deps;if(H.f&2097152)e.rv<ri&&(e.rv=ri,Qr===null&&n!==null&&n[$r]===e?$r++:Qr===null?Qr=[e]:Qr.push(e));else{H.deps??=[],Xe.call(H.deps,e)||H.deps.push(e);var r=e.reactions;r===null?e.reactions=[H]:Xe.call(r,H)||r.push(H)}}if(Gr&&Jn.has(e))return Jn.get(e);if(t){var i=e;if(Gr){var a=i.v;return(!(i.f&1024)&&i.reactions!==null||hi(i))&&(a=En(i)),Jn.set(i,a),a}var o=!(i.f&512)&&!qr&&H!==null&&!!(H.f&512),s=(i.f&pt)===0;si(i)&&(o&&(i.f|=512),Dn(i)),o&&!s&&(kn(i),mi(i))}if(Mn?.has(e))return Mn.get(e);if(e.f&8388608)throw e.v;return e.v}function mi(e){if(e.f|=512,e.deps!==null)for(let n of e.deps){var t=n.reactions;t===null?n.reactions=[e]:Xe.call(t,e)||t.push(e),n.f&2&&!(n.f&512)&&(kn(n),mi(n))}}function hi(e){if(e.v===O)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(Jn.has(t)||t.f&2&&hi(t))return!0;return!1}function gi(e){var t=qr;try{return qr=!0,e()}finally{qr=t}}function _i(e){if(!(typeof e!=`object`||!e||e instanceof EventTarget)){if(St in e)vi(e);else if(!Array.isArray(e))for(let t in e){let n=e[t];typeof n==`object`&&n&&St in n&&vi(n)}}}function vi(e,t=new Set){if(typeof e==`object`&&e&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let n in e)try{vi(e[n],t)}catch{}let n=rt(e);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){let t=et(n);for(let n in t){let r=t[n].get;if(r)try{r.call(e)}catch{}}}}}[...`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`)];var yi=[`touchstart`,`touchmove`];function bi(e){return yi.includes(e)}var xi=Symbol(`events`),Si=new Set,Ci=new Set;function wi(e){if(!k)return;e.removeAttribute(`onload`),e.removeAttribute(`onerror`);let t=e.__e;t!==void 0&&(e.__e=void 0,queueMicrotask(()=>{e.isConnected&&e.dispatchEvent(t)}))}function Ti(e,t,n){(t[xi]??={})[e]=n}function Ei(e){for(var t=0;t<e.length;t++)Si.add(e[t]);for(var n of Ci)n(e)}var Di=null,Oi=!1;function ki(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;Di=e,Oi||(Oi=!0,setTimeout(()=>{Oi=!1,Di=null}));var o=0,s=Di===e&&e[xi];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[xi]=t;return}var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if(a=i[o]||e.target,a!==t){Qe(e,`currentTarget`,{configurable:!0,get(){return a||n}});var u=H,d=U;Jr(null),Yr(null);try{for(var f,p=[];a!==null&&a!==t;){try{var m=a[xi]?.[r];m!=null&&(!a.disabled||e.target===a)&&m.call(a,e)}catch(e){f?p.push(e):f=e}if(e.cancelBubble)break;o++,a=o<i.length?i[o]:null}if(f){for(let e of p)queueMicrotask(()=>{throw e});throw f}}finally{e[xi]=t,delete e.currentTarget,Jr(u),Yr(d)}}}var Ai=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function ji(e){return Ai?.createHTML(e)??e}function Mi(e){var t=gr(`template`);return t.innerHTML=ji(e.replaceAll(`<!>`,`\x3C!---->`)),t.content}function Ni(e,t){var n=U;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function G(e,t){var n=!!(t&1),r=!!(t&2),i,a=!e.startsWith(`<!>`);return()=>{if(k)return Ni(A,null),A;i===void 0&&(i=Mi(a?e:`<!>`+e),n||(i=dr(i)));var t=r||or?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=dr(t),s=t.lastChild;Ni(o,s)}else Ni(t,t);return t}}function Pi(e=``){if(!k){var t=ur(e+``);return Ni(t,t),t}var n=A;return n.nodeType===3?_r(n):(n.before(n=ur()),Rt(n)),Ni(n,n),n}function Fi(){if(k)return Ni(A,null),A;var e=document.createDocumentFragment(),t=document.createComment(``),n=ur();return e.append(t,n),Ni(t,n),e}function K(e,t){if(k){var n=U;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=A),zt()}else e!==null&&e.before(t)}function Ii(e){let t=0,n=Xn(0),r;return()=>{Cr()&&(W(n),Ar(()=>(t===0&&(r=gi(()=>e(()=>nr(n)))),t+=1,()=>{fn(()=>{--t,t===0&&(r?.(),r=void 0,nr(n))})})))}}var Li=ht|gt;function Ri(e,t,n,r){new zi(e,t,n,r)}var zi=class{parent;is_pending=!1;transform_error;#e;#t=k?A:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=Ii(()=>(this.#m=Xn(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=U;t.b=this,t.f|=128,n(e)},this.parent=U.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=jr(()=>{if(k){let e=Ht(this.#t);zt();let t=e===`[!`;if(e.startsWith(`[?`)){let t=JSON.parse(e.slice(2));this.#_(t)}else t?this.#b():this.#g()}else this.#x()},Li),k&&(this.#e=A)}#g(){try{this.#a=Mr(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed,{reset:n,invoke_onerror:r}=this.#v(e);fn(r),t&&(this.#s=Mr(()=>{t(this.#e,()=>e,()=>n)}))}#v(e){var t=!1,n=!1;let r=()=>{this.#y()||(t?It():(t=!0,n&&rn(),this.#s!==null&&zr(this.#s,()=>{this.#s=null}),this.#C(()=>{this.#x()})))};return{reset:r,invoke_onerror:()=>{if(!this.#y())try{n=!0,this.#n.onerror?.(e,r),n=!1}catch(e){yr(e,this.#i&&this.#i.parent)}}}}#y(){return(this.#i.f&(ft|mt))!==0}#b(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=Mr(()=>e(this.#e)),fn(()=>{if(!this.#y()){var e=this.#c=document.createDocumentFragment(),t=ur(),n=!1;e.append(t),this.#a=this.#C(()=>{try{return Mr(()=>this.#r(t))}catch(e){try{this.error(e),n=!0}catch(e){yr(e,this.#i.parent)}return null}}),this.#a===null?(this.#c=null,n&&this.#S(F)):this.#u===0&&(this.#e.before(e),this.#c=null,zr(this.#o,()=>{this.#o=null}),this.#S(F))}}))}#x(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=Mr(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();Ur(this.#a,e);let t=this.#n.pending;this.#o=Mr(()=>t(this.#e))}else this.#S(F)}catch(e){this.error(e)}}#S(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){hn(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#C(e){var t=U,n=H,r=M;Yr(this.#i),Jr(this.#i),an(this.#i.ctx);try{return Bn.ensure(),e()}finally{Yr(t),Jr(n),an(r)}}#w(e,t){this.has_pending_snippet()?(this.#u+=e,this.#u===0&&(this.#S(t),this.#o&&zr(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))):this.parent&&this.parent.#w(e,t)}update_pending_count(e,t){this.#w(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,fn(()=>{this.#d=!1,this.#m&&er(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),W(this.#m)}error(e){if(e===Mt||!this.#n.onerror&&!this.#n.failed)throw e;F?.is_fork?(this.#a&&F.skip_effect(this.#a),this.#o&&F.skip_effect(this.#o),this.#s&&F.skip_effect(this.#s),F.oncommit(()=>{this.#y()||this.#T(e)})):this.#T(e)}#T(e){this.#a&&=(Ir(this.#a),null),this.#o&&=(Ir(this.#o),null),this.#s&&=(Ir(this.#s),null),k&&(Rt(this.#t),Bt(),Rt(Vt()));let t=this.#n.failed,n=e=>{if(this.#y())return;let{reset:n,invoke_onerror:r}=this.#v(e);r(),t&&!this.#y()&&(this.#s=this.#C(()=>{try{return Mr(()=>{var r=U;r.b=this,r.f|=128,t(this.#e,()=>e,()=>n)})}catch(e){return yr(e,this.#i.parent),null}}))};fn(()=>{if(!this.#y()){var t;try{t=this.transform_error(e)}catch(e){yr(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(n,e=>yr(e,this.#i&&this.#i.parent)):n(t)}})}};function q(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e[kt]??=e.nodeValue)&&(e[kt]=n,e.nodeValue=`${n}`)}function Bi(e,t){return Hi(e,t)}var Vi=new Map;function Hi(e,{target:t,anchor:n,props:r={},events:i,context:a,intro:o=!0,transformError:s}){lr();var c=void 0,l=Dr(()=>{var o=n??t.appendChild(ur());Ri(o,{pending:()=>{}},t=>{on({});var n=M;if(a&&(n.c=a),i&&(r.$$events=i),k&&Ni(t,null),c=e(t,r)||cn(),k&&(U.nodes.end=A,A===null||A.nodeType!==8||A.data!==`]`))throw Ft(),Mt;sn()},s);var l=new Set,u=e=>{for(var n=0;n<e.length;n++){var r=e[n];if(!l.has(r)){l.add(r);var i=bi(r);for(let e of[t,document]){var a=Vi.get(e);a===void 0&&(a=new Map,Vi.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,ki,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return u(Ze(Si)),Ci.add(u),()=>{for(var e of l)for(let n of[t,document]){var r=Vi.get(n),i=r.get(e);--i==0?(n.removeEventListener(e,ki),r.delete(e),r.size===0&&Vi.delete(n)):r.set(e,i)}Ci.delete(u),o!==n&&o.parentNode?.removeChild(o)}});return Ui.set(c,l),c}var Ui=new WeakMap,Wi=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)Vr(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(Vr(r.effect),this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(Ir(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();Ur(r,t),t.append(ur()),this.#n.set(e,{effect:r,fragment:t})}else Ir(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),zr(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(Ir(n.effect),this.#n.delete(e))};ensure(e,t){var n=F,r=hr();if(t&&!this.#t.has(e)&&!this.#n.has(e)){if(r){var i=document.createDocumentFragment(),a=ur();i.append(a),this.#n.set(e,{effect:Mr(()=>t(a)),fragment:i})}else this.#t.set(e,Mr(()=>t(this.anchor)))}if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else k&&(this.anchor=A),this.#a(n)}};function J(e,t,n=!1){var r;k&&(r=A,zt());var i=new Wi(e),a=n?ht:0;function o(e,t){if(k){var n=Ht(r);if(e!==parseInt(n.substring(1))){var a=Vt();Rt(a),i.anchor=a,Lt(!1),i.ensure(e,t),Lt(!0);return}}i.ensure(e,t)}jr(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}function Gi(e,t,n){for(var r=[],i=t.length,a,o=t.length,s=0;s<i;s++){let n=t[s];zr(n,()=>{if(a){if(a.pending.delete(n),a.done.add(n),a.pending.size===0){var t=e.outrogroups;Ki(e,Ze(a.done)),t.delete(a),t.size===0&&(e.outrogroups=null)}}else--o},!1)}if(o===0){var c=r.length===0&&n!==null&&e.pending.size===0;if(c){var l=n,u=l.parentNode;mr(u),u.append(l),e.items.clear()}Ki(e,t,!c)}else a={pending:new Set(t),done:new Set},(e.outrogroups??=new Set).add(a)}function Ki(e,t,n=!0){var r;if(e.pending.size>0){r=new Set;for(let t of e.pending.values())for(let n of t)r.add(e.items.get(n).e)}for(var i=0;i<t.length;i++){var a=t[i];r?.has(a)?(a.f|=vt,Ur(a,document.createDocumentFragment())):Ir(t[i],n)}}var qi;function Ji(e,t,n,r,i,a=null){var o=e,s=new Map;if(t&4){var c=e;o=k?Rt(dr(c)):c.appendChild(ur())}k&&zt();var l=null,u=wn(()=>{var e=n();return Je(e)?e:e==null?[]:Ze(e)}),d=new Map,f=!0;function p(e){if(!(h.effect.f&16384)){h.pending.delete(e);var n=W(u);h.fallback=l,Xi(h,n,o,t,r),l!==null&&(n.length===0?l.f&33554432?(l.f^=vt,Qi(l,null,o)):Vr(l):zr(l,()=>{l=null}))}}function m(e){h.pending.delete(e)}var h={effect:jr(()=>{var e=W(u),c=e.length;let h=!1;k&&Ht(o)===`[!`!=(c===0)&&(o=Vt(),Rt(o),Lt(!1),h=!0);for(var g=new Set,_=F,v=hr(),y=0;y<c;y+=1){k&&A.nodeType===8&&A.data===`]`&&(o=A,h=!0,Lt(!1));var b=e[y],x=r(b,y),S=f?null:s.get(x);S?(S.v&&er(S.v,b),S.i&&er(S.i,y),v&&_.unskip_effect(S.e)):(S=Zi(s,f?o:qi??=ur(),b,x,y,i,t,n),f||(S.e.f|=vt),s.set(x,S)),g.add(x)}if(c===0&&a&&!l&&(f?l=Mr(()=>a(o)):(l=Mr(()=>a(qi??=ur())),l.f|=vt)),c>g.size&&Jt(``,``,``),k&&c>0&&Rt(Vt()),!f){if(d.set(_,g),v){for(let[e,t]of s)g.has(e)||_.skip_effect(t.e);_.oncommit(p),_.ondiscard(m)}else p(_)}h&&Lt(!0),W(u)}),flags:t,items:s,pending:d,outrogroups:null,fallback:l};f=!1,k&&(o=A)}function Yi(e){for(;e!==null&&!(e.f&32);)e=e.next;return e}function Xi(e,t,n,r,i){var a=!!(r&8),o=t.length,s=e.items,c=Yi(e.effect.first),l,u=null,d,f=[],p=[],m,h,g,_;if(a)for(_=0;_<o;_+=1)m=t[_],h=i(m,_),g=s.get(h).e,g.f&33554432||(g.nodes?.a?.measure(),(d??=new Set).add(g));for(_=0;_<o;_+=1){if(m=t[_],h=i(m,_),g=s.get(h).e,e.outrogroups!==null)for(let t of e.outrogroups)t.pending.delete(g),t.done.delete(g);if(g.f&8192&&(Vr(g),a&&(g.nodes?.a?.unfix(),(d??=new Set).delete(g))),g.f&33554432){if(g.f^=vt,g===c)Qi(g,null,n);else{var v=u?u.next:c;g===e.effect.last&&(e.effect.last=g.prev),g.prev&&(g.prev.next=g.next),g.next&&(g.next.prev=g.prev),$i(e,u,g),$i(e,g,v),Qi(g,v,n),u=g,f=[],p=[],c=Yi(u.next);continue}}if(g!==c){if(l!==void 0&&l.has(g)){if(f.length<p.length){var y=p[0],b;u=y.prev;var x=f[0],S=f[f.length-1];for(b=0;b<f.length;b+=1)Qi(f[b],y,n);for(b=0;b<p.length;b+=1)l.delete(p[b]);$i(e,x.prev,S.next),$i(e,u,x),$i(e,S,y),c=y,u=S,--_,f=[],p=[]}else l.delete(g),Qi(g,c,n),$i(e,g.prev,g.next),$i(e,g,u===null?e.effect.first:u.next),$i(e,u,g),u=g;continue}for(f=[],p=[];c!==null&&c!==g;)(l??=new Set).add(c),p.push(c),c=Yi(c.next);if(c===null)continue}g.f&33554432||f.push(g),u=g,c=Yi(g.next)}if(e.outrogroups!==null){for(let t of e.outrogroups)t.pending.size===0&&(Ki(e,Ze(t.done)),e.outrogroups?.delete(t));e.outrogroups.size===0&&(e.outrogroups=null)}if(c!==null||l!==void 0){var C=[];if(l!==void 0)for(g of l)g.f&8192||C.push(g);for(;c!==null;)!(c.f&8192)&&c!==e.fallback&&C.push(c),c=Yi(c.next);var ee=C.length;if(ee>0){var te=r&4&&o===0?n:null;if(a){for(_=0;_<ee;_+=1)C[_].nodes?.a?.measure();for(_=0;_<ee;_+=1)C[_].nodes?.a?.fix()}Gi(e,C,te)}}a&&fn(()=>{if(d!==void 0)for(g of d)g.nodes?.a?.apply()})}function Zi(e,t,n,r,i,a,o,s){var c=o&1?o&16?Xn(n):Zn(n,!1,!1):null,l=o&2?Xn(i):null;return{v:c,i:l,e:Mr(()=>(a(t,c??n,l??i,s),()=>{e.delete(r)}))}}function Qi(e,t,n){if(e.nodes)for(var r=e.nodes.start,i=e.nodes.end,a=t&&!(t.f&33554432)?t.nodes.start:n;r!==null;){var o=fr(r);if(a.before(r),r===i)return;r=o}}function $i(e,t,n){t===null?e.effect.first=n:t.next=n,n===null?e.effect.last=t:n.prev=t}function ea(e,t,n){Or(()=>{var r=gi(()=>t(e,n?.())||{});if(n&&r?.update){var i=!1,a={};Ar(()=>{var e=n();_i(e),i&&Wt(a,e)&&(a=e,r.update(e))}),i=!0}if(r?.destroy)return()=>r.destroy()})}var ta=[...` 	
\r\f\xA0\v`];function na(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||ta.includes(r[o-1]))&&(s===r.length||ta.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function ra(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function ia(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function aa(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\/\*.*?\*\//g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(ia)),i&&c.push(...Object.keys(i).map(ia));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=ia(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=ra(r)),i&&(n+=ra(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function oa(e,t,n,r,i,a){var o=e[Dt];if(k||o!==n||o===void 0){var s=na(n,r,a);(!k||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e[Dt]=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function sa(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function ca(e,t,n,r){var i=e[Ot];if(k||i!==t){var a=aa(t,r);(!k||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e[Ot]=t}else r&&(Array.isArray(r)?(sa(e,n?.[0],r[0]),sa(e,n?.[1],r[1],`important`)):sa(e,n,r));return r}var la=Symbol(`is custom element`),ua=Symbol(`is html`),da=jt?`link`:`LINK`;function Y(e,t,n,r){var i=fa(e);k&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===da)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[Tt]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&ma(e).has(t)?e[t]=n:e.setAttribute(t,n))}function fa(e){return e[Et]??={[la]:e.nodeName.includes(`-`),[ua]:e.namespaceURI===Nt}}var pa=new Map;function ma(e){var t=e.getAttribute(`is`)||e.nodeName,n=pa.get(t);if(n)return n;pa.set(t,n=new Set);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=et(i),r)r[o].set&&o!==`innerHTML`&&o!==`textContent`&&o!==`innerText`&&n.add(o);i=rt(i)}return n}var ha=!1;function ga(e){var t=ha;try{return ha=!1,[e(),ha]}finally{ha=t}}function _a(e,t,n,r){var i=!0,a=!!(n&8),o=!!(n&16),s=r,c=!0,l=void 0,u=()=>o&&i?(l??=xn(r),W(l)):(c&&(c=!1,s=o?gi(r):r),s);let d;if(a){var f=St in e||wt in e;d=$e(e,t)?.set??(f&&t in e?n=>e[t]=n:void 0)}var p,m=!1;a?[p,m]=ga(()=>e[t]):p=e[t],p===void 0&&r!==void 0&&(p=u(),d&&(i&&$t(t),d(p)));var h=i?()=>{var n=e[t];return n===void 0?u():(c=!0,n)}:()=>{var n=e[t];return n!==void 0&&(s=void 0),n===void 0?s:n};if(i&&!(n&4))return h;if(d){var g=e.$$legacy;return(function(e,t){return arguments.length>0?((!i||!t||g||m)&&d(t?h():e),e):h()})}var _=!1,v=(n&1?xn:wn)(()=>(_=!1,h()));a&&W(v);var y=U;return(function(e,t){if(arguments.length>0){let n=t?W(v):i&&a?ir(e):e;return L(v,n),_=!0,s!==void 0&&(s=n),e}return Gr&&_||y.f&16384?v.v:W(v)})}function va(e){M===null&&Kt(`onMount`),Tr(()=>{let t=gi(e);if(typeof t==`function`)return t})}typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var ya=300;function ba(e,t){return typeof e==`string`&&e.length>0&&(!t||t(e))}function xa(e,t){return t?.aborted?Promise.resolve():new Promise(n=>{let r=window.setTimeout(n,e);t?.addEventListener(`abort`,()=>{window.clearTimeout(r),n()},{once:!0})})}async function Sa(e,t={}){let n=Math.max(1,t.intervalMs??ya),r=Date.now(),i=0,a=new Set,o=null;if(typeof e.onChanged==`function`)try{o=e.onChanged(()=>{for(let e of a)e()})}catch(e){t.onError?.(e)}let s=e=>t.signal?.aborted?Promise.resolve():new Promise(n=>{let r=null,i=()=>{r!==null&&window.clearTimeout(r),a.delete(i),n()};a.add(i),r=window.setTimeout(i,e),t.signal?.addEventListener(`abort`,i,{once:!0})});try{for(;!t.signal?.aborted;){i++;try{let n=await e.getPublicKey();if(ba(n,t.isValidPubkey))return n}catch(e){t.onError?.(e)}if(t.maxAttempts!==void 0&&i>=t.maxAttempts)return null;if(t.timeoutMs!==void 0){let e=Date.now()-r;if(e>=t.timeoutMs)return null;await s(Math.min(n,t.timeoutMs-e))}else o?await s(n):await xa(n,t.signal)}return null}finally{o?.close(),a.clear()}}function Ca(e){return/(?:^|[\s.,!?;:'"\-—()\[\]{}])(gm|good\s+morning)(?=$|[\s.,!?;:'"\-—()\[\]{}])/i.test(e)}function wa(e,t){return!t||Object.keys(t).length===0?e:e.map(e=>({...e,...t}))}function Ta(e,t,n){let r=wa(e.filters,n),i=e.authors&&e.authors.length>0?{authors:[...e.authors]}:{},a=null,o=!1;function s(){o||(o=!0,a?.close(),a=null)}let c=Pe.subscribe(r,i);return c.on(`event`,e=>{o||t.onEvent(e.event)}),a={close:()=>{c.close()}},o?(c.close(),{close:s}):((async()=>{try{let{events:e}=await Pe.query(r,i);if(o)return;for(let n of e)t.onEvent(n.event)}catch{}finally{o||t.onScanSettled()}})(),{close:s})}var Ea=1,Da=500;function Oa(e=new Date){let t=new Date(e);return t.setHours(0,0,0,0),Math.floor(t.getTime()/1e3)}function ka(e){return e.tags.some(e=>e[0]===`e`)}function Aa(e,t){let n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}function ja(e,t){let n=new Set;for(let e of t.values())for(let t of e.tags)t[0]===`e`&&typeof t[1]==`string`&&n.add(t[1]);return[...e.values()].filter(e=>!ka(e)).map(e=>({note:e,isRead:n.has(e.id)})).sort((e,t)=>t.note.created_at-e.note.created_at)}function Ma(e){let t={gmNotes:new Map,userReplies:new Map,contactCount:0,contactsLoaded:!1,scanning:!1,pubkey:null,error:null},n=null,r=[],i=Oa(),a=0,o=0;function s(){for(let e of r)e.close();r=[]}function c(){o+=1,n?.close(),n=null,s()}function l(n){if(s(),n.length===0){t.scanning=!1,e();return}let o=Aa(n,Da);a=o.length,t.scanning=!0,e();for(let n of o){let o=Ta({filters:[{kinds:[Ea],authors:n,since:i}],origin:`outbox`,authors:n},{onEvent:n=>{n.kind===Ea&&Ca(n.content)&&(t.gmNotes.has(n.id)||(t.gmNotes.set(n.id,n),e()))},onScanSettled:()=>{a>0&&--a,a===0&&t.scanning&&(t.scanning=!1,e())}});r.push(o)}}function u(r){n=Ta({filters:[{kinds:[Ea],authors:[r],since:i}],origin:`outbox`,authors:[r]},{onEvent:n=>{n.kind===Ea&&Ca(n.content)&&ka(n)&&(t.userReplies.has(n.id)||(t.userReplies.set(n.id,n),e()))},onScanSettled:()=>{}})}async function d(){let n=o,r;try{r=await Me.getFollows()}catch(r){if(n!==o)return;t.contactsLoaded=!0,t.scanning=!1,t.error=r instanceof Error?r.message:`failed to load contacts`,e();return}n===o&&(t.contactCount=r.length,t.contactsLoaded=!0,e(),l(r))}function f(){c(),t.gmNotes=new Map,t.userReplies=new Map,t.contactCount=0,t.contactsLoaded=!1,t.scanning=!1,t.error=null,a=0,i=Oa()}function p(n){n!==t.pubkey&&(f(),t.pubkey=n,n?(t.scanning=!0,e(),d(),u(n)):e())}function m(){c()}return{get state(){return t},setPubkey:p,destroy:m}}var Na={close:()=>{}};function Pa(e){return typeof e==`string`&&e.length>0?e:void 0}function Fa(e){if(e.kind!==0)return null;try{let t=JSON.parse(e.content);return{name:Pa(t.name),display_name:Pa(t.display_name),displayName:Pa(t.displayName),nip05:Pa(t.nip05),picture:Pa(t.picture)}}catch{return null}}function Ia(e,t,n=()=>{}){let r=[...new Set(e.filter(e=>e.length>0))];if(r.length===0)return n(),Na;let i=new Map,a=null,o=!1;function s(){o||(o=!0,a?.close(),a=null)}function c(e){if(o||e.kind!==0||!r.includes(e.pubkey))return;let n=i.get(e.pubkey);if(n!==void 0&&n>e.created_at)return;let a=Fa(e);a&&(i.set(e.pubkey,e.created_at),t(e.pubkey,a))}let l=!1;function u(){l||(l=!0,n())}let d=r.map(e=>({kinds:[0],authors:[e],limit:1})),f={authors:r},p=Pe.subscribe(d,f);return p.on(`event`,e=>c(e.event)),a={close:()=>p.close()},o?(p.close(),{close:s}):((async()=>{try{let{events:e}=await Pe.query(d,f);if(o)return;for(let t of e)c(t.event)}catch{}finally{o||u()}})(),{close:s})}var La=[`second`,`minute`,`hour`,`day`,`week`,`month`,`year`];function Ra(e,t){if(t===0)return[`just now`,`right now`];var n=La[Math.floor(t/2)];return e>1&&(n+=`s`),[e+` `+n+` ago`,`in `+e+` `+n]}var za=[`秒`,`分钟`,`小时`,`天`,`周`,`个月`,`年`];function Ba(e,t){if(t===0)return[`刚刚`,`片刻后`];var n=za[~~(t/2)];return[e+` `+n+`前`,e+` `+n+`后`]}var Va={},Ha=function(e,t){Va[e]=t},Ua=function(e){return Va[e]||Va.en_US},Wa=[60,60,24,7,365/7/12,12];function Ga(e){return e instanceof Date?e:!isNaN(e)||/^\d+$/.test(e)?new Date(parseInt(e)):(e=(e||``).trim().replace(/\.\d+/,``).replace(/-/,`/`).replace(/-/,`/`).replace(/(\d)T(\d)/,`$1 $2`).replace(/Z/,` UTC`).replace(/([+-]\d\d):?(\d\d)/,` $1$2`),new Date(e))}function Ka(e,t){var n=+(e<0);e=Math.abs(e);for(var r=e,i=0;e>=Wa[i]&&i<Wa.length;i++)e/=Wa[i];return e=Math.floor(e),i*=2,e>(i===0?9:1)&&(i+=1),t(e,i,r)[n].replace(`%s`,e.toString())}function qa(e,t){return(+(t?Ga(t):new Date)-Ga(e))/1e3}var Ja=function(e,t,n){return Ka(qa(e,n&&n.relativeDate),Ua(t))};Ha(`en_US`,Ra),Ha(`zh_CN`,Ba);var Ya=/^[0-9a-f]{64}$/;function Xa(e){return typeof e==`string`&&Ya.test(e)}var Za=/^[0-9a-f]{64}$/i,Qa=`hsl(180 60% 68%)`;function $a(e){let t=e.trim().toLowerCase();if(!Za.test(t))return Qa;let n=2166136261,r=`${t.slice(0,16)}${t.slice(-16)}`;for(let e=0;e<r.length;e++)n^=r.charCodeAt(e),n=Math.imul(n,16777619);return`hsl(${(n>>>0)%360} 72% 66%)`}function eo(e){return`color: ${$a(e)}`}function to(e){let t=globalThis.napplet;return t!=null&&t[e]!=null}var no=/^[a-zA-Z][a-zA-Z0-9+.-]*:/;function ro(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function io(e){if(!no.test(e))return!1;try{let t=new URL(e).protocol.toLowerCase();return t!==`data:`&&t!==`blob:`}catch{return!0}}function ao(e){return typeof e==`object`&&e&&`source`in e?ro(e.source):ro(e)}function oo(e,t){let n=null,r=null,i=null,a=0;function o(){r&&URL.revokeObjectURL(r),r=null}function s(t){t?e.src=t:e.removeAttribute(`src`)}function c(e){let t=ao(e);if(t===n)return;if(n=t,a++,i?.abort(),i=null,o(),!t){s(null);return}if(!io(t)){s(t);return}if(s(null),!to(`resource`))return;let c=a,l=new AbortController;i=l;let u;try{u=Ne.bytes(t,{signal:l.signal})}catch{i=null;return}u.then(e=>{if(c!==a||l.signal.aborted)return;let t=URL.createObjectURL(e);c!==a||l.signal.aborted?URL.revokeObjectURL(t):(o(),r=t,s(t))}).catch(()=>{c===a&&s(null)}).finally(()=>{i===l&&(i=null)})}return c(t),{update:c,destroy(){a++,i?.abort(),i=null,o(),e.removeAttribute(`src`)}}}function so(e,t){return oo(e,t)}function co(e,t){return oo(e,t)}var lo=/^[0-9a-f]{64}$/;function uo(e){if(!fo(e.target))return null;let t=e.relays?.filter((e,t,n)=>e.length>0&&n.indexOf(e)===t);return{target:t&&t.length>0?po(e.target,t):e.target,...t&&t.length>0?{relays:t}:{},...e.source?{source:e.source}:{},...e.behavior?{behavior:e.behavior}:{}}}function fo(e){return e.type===`event`?lo.test(e.id)&&(e.kind===void 0||Number.isInteger(e.kind))&&(e.pubkey===void 0||lo.test(e.pubkey)):Number.isInteger(e.kind)&&lo.test(e.pubkey)&&typeof e.identifier==`string`}function po(e,t){try{return e.type===`event`?{...e,nip19:Oe({id:e.id,relays:t,...e.pubkey?{author:e.pubkey}:{},...e.kind===void 0?{}:{kind:e.kind}})}:{...e,nip19:ke({kind:e.kind,pubkey:e.pubkey,identifier:e.identifier,relays:t})}}catch{return e}}var mo=e=>e instanceof Object;function ho(e){if(!mo(e)||typeof e.kind!=`number`||typeof e.content!=`string`||typeof e.created_at!=`number`||typeof e.pubkey!=`string`||!e.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(e.tags))return!1;for(let t=0;t<e.tags.length;t++){let n=e.tags[t];if(!Array.isArray(n))return!1;for(let e=0;e<n.length;e++)if(typeof n[e]!=`string`)return!1}return!0}function go(e){return 3e4<=e&&e<4e4}function _o(e,t){let n=t instanceof Array?t:[t];return ho(e)&&n.includes(e.kind)||!1}var vo=1059,yo=1e4,bo=10003,xo=10004,So=10005,Co=10007,wo=10015,To=3e4,Eo=30002,Do=30003,Oo=30004,ko=30015,Ao=30024;function jo(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`Wrong positive integer: ${e}`)}function Mo(e,...t){if(!(e instanceof Uint8Array))throw Error(`Expected Uint8Array`);if(t.length>0&&!t.includes(e.length))throw Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function No(e){if(typeof e!=`function`||typeof e.create!=`function`)throw Error(`Hash should be wrapped by utils.wrapConstructor`);jo(e.outputLen),jo(e.blockLen)}function Po(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function Fo(e,t){Mo(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least ${n}`)}var Io=typeof globalThis==`object`&&`crypto`in globalThis?globalThis.crypto:void 0,Lo=e=>e instanceof Uint8Array,Ro=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),zo=(e,t)=>e<<32-t|e>>>t;if(new Uint8Array(new Uint32Array([287454020]).buffer)[0]!==68)throw Error(`Non little-endian hardware is not supported`);function Bo(e){if(typeof e!=`string`)throw Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Vo(e){if(typeof e==`string`&&(e=Bo(e)),!Lo(e))throw Error(`expected Uint8Array, got ${typeof e}`);return e}function Ho(...e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;return e.forEach(e=>{if(!Lo(e))throw Error(`Uint8Array expected`);t.set(e,n),n+=e.length}),t}var Uo=class{clone(){return this._cloneInto()}};({}).toString;function Wo(e){let t=t=>e().update(Vo(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function Go(e=32){if(Io&&typeof Io.getRandomValues==`function`)return Io.getRandomValues(new Uint8Array(e));throw Error(`crypto.getRandomValues must be defined`)}function Ko(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}var qo=class extends Uo{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Ro(this.buffer)}update(e){Po(this);let{view:t,buffer:n,blockLen:r}=this;e=Vo(e);let i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=Ro(e);for(;r<=i-a;a+=r)this.process(t,a)}else n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Po(this),Fo(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;Ko(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=Ro(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen should be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.length=r,e.pos=o,e.finished=i,e.destroyed=a,r%t&&e.buffer.set(n),e}},Jo=(e,t,n)=>e&t^~e&n,Yo=(e,t,n)=>e&t^e&n^t&n,Xo=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,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Zo=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Qo=new Uint32Array(64),$o=class extends qo{constructor(){super(64,32,8,!1),this.A=Zo[0]|0,this.B=Zo[1]|0,this.C=Zo[2]|0,this.D=Zo[3]|0,this.E=Zo[4]|0,this.F=Zo[5]|0,this.G=Zo[6]|0,this.H=Zo[7]|0}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let n=0;n<16;n++,t+=4)Qo[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=Qo[e-15],n=Qo[e-2],r=zo(t,7)^zo(t,18)^t>>>3,i=zo(n,17)^zo(n,19)^n>>>10;Qo[e]=i+Qo[e-7]+r+Qo[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=zo(o,6)^zo(o,11)^zo(o,25),u=l+t+Jo(o,s,c)+Xo[e]+Qo[e]|0,d=(zo(n,2)^zo(n,13)^zo(n,22))+Yo(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){Qo.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},es=Wo(()=>new $o),ts=t({bitGet:()=>bs,bitLen:()=>ys,bitMask:()=>Ss,bitSet:()=>xs,bytesToHex:()=>ss,bytesToNumberBE:()=>ds,bytesToNumberLE:()=>fs,concatBytes:()=>gs,createHmacDrbg:()=>Ts,ensureBytes:()=>X,equalBytes:()=>_s,hexToBytes:()=>us,hexToNumber:()=>ls,numberToBytesBE:()=>ps,numberToBytesLE:()=>ms,numberToHexUnpadded:()=>cs,numberToVarBytesBE:()=>hs,utf8ToBytes:()=>vs,validateObject:()=>Ds}),ns=BigInt(0),rs=BigInt(1),is=BigInt(2),as=e=>e instanceof Uint8Array,os=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function ss(e){if(!as(e))throw Error(`Uint8Array expected`);let t=``;for(let n=0;n<e.length;n++)t+=os[e[n]];return t}function cs(e){let t=e.toString(16);return t.length&1?`0${t}`:t}function ls(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);return BigInt(e===``?`0`:`0x${e}`)}function us(e){if(typeof e!=`string`)throw Error(`hex string expected, got `+typeof e);let t=e.length;if(t%2)throw Error(`padded hex string expected, got unpadded hex of length `+t);let n=new Uint8Array(t/2);for(let t=0;t<n.length;t++){let r=t*2,i=e.slice(r,r+2),a=Number.parseInt(i,16);if(Number.isNaN(a)||a<0)throw Error(`Invalid byte sequence`);n[t]=a}return n}function ds(e){return ls(ss(e))}function fs(e){if(!as(e))throw Error(`Uint8Array expected`);return ls(ss(Uint8Array.from(e).reverse()))}function ps(e,t){return us(e.toString(16).padStart(t*2,`0`))}function ms(e,t){return ps(e,t).reverse()}function hs(e){return us(cs(e))}function X(e,t,n){let r;if(typeof t==`string`)try{r=us(t)}catch(n){throw Error(`${e} must be valid hex string, got "${t}". Cause: ${n}`)}else if(as(t))r=Uint8Array.from(t);else throw Error(`${e} must be hex string or Uint8Array`);let i=r.length;if(typeof n==`number`&&i!==n)throw Error(`${e} expected ${n} bytes, got ${i}`);return r}function gs(...e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;return e.forEach(e=>{if(!as(e))throw Error(`Uint8Array expected`);t.set(e,n),n+=e.length}),t}function _s(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function vs(e){if(typeof e!=`string`)throw Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function ys(e){let t=0;for(;e>ns;e>>=rs,t+=1);return t}function bs(e,t){return e>>BigInt(t)&rs}var xs=(e,t,n)=>e|(n?rs:ns)<<BigInt(t),Ss=e=>(is<<BigInt(e-1))-rs,Cs=e=>new Uint8Array(e),ws=e=>Uint8Array.from(e);function Ts(e,t,n){if(typeof e!=`number`||e<2)throw Error(`hashLen must be a number`);if(typeof t!=`number`||t<2)throw Error(`qByteLen must be a number`);if(typeof n!=`function`)throw Error(`hmacFn must be a function`);let r=Cs(e),i=Cs(e),a=0,o=()=>{r.fill(1),i.fill(0),a=0},s=(...e)=>n(i,r,...e),c=(e=Cs())=>{i=s(ws([0]),e),r=s(),e.length!==0&&(i=s(ws([1]),e),r=s())},l=()=>{if(a++>=1e3)throw Error(`drbg: tried 1000 values`);let e=0,n=[];for(;e<t;){r=s();let t=r.slice();n.push(t),e+=r.length}return gs(...n)};return(e,t)=>{o(),c(e);let n;for(;!(n=t(l()));)c();return o(),n}}var Es={bigint:e=>typeof e==`bigint`,function:e=>typeof e==`function`,boolean:e=>typeof e==`boolean`,string:e=>typeof e==`string`,stringOrUint8Array:e=>typeof e==`string`||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e==`function`&&Number.isSafeInteger(e.outputLen)};function Ds(e,t,n={}){let r=(t,n,r)=>{let i=Es[n];if(typeof i!=`function`)throw Error(`Invalid validator "${n}", expected function`);let a=e[t];if(!(r&&a===void 0)&&!i(a,e))throw Error(`Invalid param ${String(t)}=${a} (${typeof a}), expected ${n}`)};for(let[e,n]of Object.entries(t))r(e,n,!1);for(let[e,t]of Object.entries(n))r(e,t,!0);return e}var Z=BigInt(0),Q=BigInt(1),Os=BigInt(2),ks=BigInt(3),As=BigInt(4),js=BigInt(5),Ms=BigInt(8),Ns=BigInt(16);function $(e,t){let n=e%t;return n>=Z?n:t+n}function Ps(e,t,n){if(n<=Z||t<Z)throw Error(`Expected power/modulo > 0`);if(n===Q)return Z;let r=Q;for(;t>Z;)t&Q&&(r=r*e%n),e=e*e%n,t>>=Q;return r}function Fs(e,t,n){let r=e;for(;t-->Z;)r*=r,r%=n;return r}function Is(e,t){if(e===Z||t<=Z)throw Error(`invert: expected positive integers, got n=${e} mod=${t}`);let n=$(e,t),r=t,i=Z,a=Q,o=Q,s=Z;for(;n!==Z;){let e=r/n,t=r%n,c=i-o*e,l=a-s*e;r=n,n=t,i=o,a=s,o=c,s=l}if(r!==Q)throw Error(`invert: does not exist`);return $(i,t)}function Ls(e){let t=(e-Q)/Os,n,r,i;for(n=e-Q,r=0;n%Os===Z;n/=Os,r++);for(i=Os;i<e&&Ps(i,t,e)!==e-Q;i++);if(r===1){let t=(e+Q)/As;return function(e,n){let r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw Error(`Cannot find square root`);return r}}let a=(n+Q)/Os;return function(e,o){if(e.pow(o,t)===e.neg(e.ONE))throw Error(`Cannot find square root`);let s=r,c=e.pow(e.mul(e.ONE,i),n),l=e.pow(o,a),u=e.pow(o,n);for(;!e.eql(u,e.ONE);){if(e.eql(u,e.ZERO))return e.ZERO;let t=1;for(let n=e.sqr(u);t<s&&!e.eql(n,e.ONE);t++)n=e.sqr(n);let n=e.pow(c,Q<<BigInt(s-t-1));c=e.sqr(n),l=e.mul(l,n),u=e.mul(u,c),s=t}return l}}function Rs(e){if(e%As===ks){let t=(e+Q)/As;return function(e,n){let r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw Error(`Cannot find square root`);return r}}if(e%Ms===js){let t=(e-js)/Ms;return function(e,n){let r=e.mul(n,Os),i=e.pow(r,t),a=e.mul(n,i),o=e.mul(e.mul(a,Os),i),s=e.mul(a,e.sub(o,e.ONE));if(!e.eql(e.sqr(s),n))throw Error(`Cannot find square root`);return s}}return e%Ns,Ls(e)}var zs=[`create`,`isValid`,`is0`,`neg`,`inv`,`sqrt`,`sqr`,`eql`,`add`,`sub`,`mul`,`pow`,`div`,`addN`,`subN`,`mulN`,`sqrN`];function Bs(e){return Ds(e,zs.reduce((e,t)=>(e[t]=`function`,e),{ORDER:`bigint`,MASK:`bigint`,BYTES:`isSafeInteger`,BITS:`isSafeInteger`}))}function Vs(e,t,n){if(n<Z)throw Error(`Expected power > 0`);if(n===Z)return e.ONE;if(n===Q)return t;let r=e.ONE,i=t;for(;n>Z;)n&Q&&(r=e.mul(r,i)),i=e.sqr(i),n>>=Q;return r}function Hs(e,t){let n=Array(t.length),r=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),i=e.inv(r);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),i),n}function Us(e,t){let n=t===void 0?e.toString(2).length:t;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function Ws(e,t,n=!1,r={}){if(e<=Z)throw Error(`Expected Field ORDER > 0, got ${e}`);let{nBitLength:i,nByteLength:a}=Us(e,t);if(a>2048)throw Error(`Field lengths over 2048 bytes are not supported`);let o=Rs(e),s=Object.freeze({ORDER:e,BITS:i,BYTES:a,MASK:Ss(i),ZERO:Z,ONE:Q,create:t=>$(t,e),isValid:t=>{if(typeof t!=`bigint`)throw Error(`Invalid field element: expected bigint, got ${typeof t}`);return Z<=t&&t<e},is0:e=>e===Z,isOdd:e=>(e&Q)===Q,neg:t=>$(-t,e),eql:(e,t)=>e===t,sqr:t=>$(t*t,e),add:(t,n)=>$(t+n,e),sub:(t,n)=>$(t-n,e),mul:(t,n)=>$(t*n,e),pow:(e,t)=>Vs(s,e,t),div:(t,n)=>$(t*Is(n,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>Is(t,e),sqrt:r.sqrt||(e=>o(s,e)),invertBatch:e=>Hs(s,e),cmov:(e,t,n)=>n?t:e,toBytes:e=>n?ms(e,a):ps(e,a),fromBytes:e=>{if(e.length!==a)throw Error(`Fp.fromBytes: expected ${a}, got ${e.length}`);return n?fs(e):ds(e)}});return Object.freeze(s)}function Gs(e){if(typeof e!=`bigint`)throw Error(`field order must be bigint`);let t=e.toString(2).length;return Math.ceil(t/8)}function Ks(e){let t=Gs(e);return t+Math.ceil(t/2)}function qs(e,t,n=!1){let r=e.length,i=Gs(t),a=Ks(t);if(r<16||r<a||r>1024)throw Error(`expected ${a}-1024 bytes of input, got ${r}`);let o=$(n?ds(e):fs(e),t-Q)+Q;return n?ms(o,i):ps(o,i)}var Js=BigInt(0),Ys=BigInt(1);function Xs(e,t){let n=(e,t)=>{let n=t.negate();return e?n:t},r=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:n,unsafeLadder(t,n){let r=e.ZERO,i=t;for(;n>Js;)n&Ys&&(r=r.add(i)),i=i.double(),n>>=Ys;return r},precomputeWindow(e,t){let{windows:n,windowSize:i}=r(t),a=[],o=e,s=o;for(let e=0;e<n;e++){s=o,a.push(s);for(let e=1;e<i;e++)s=s.add(o),a.push(s);o=s.double()}return a},wNAF(t,i,a){let{windows:o,windowSize:s}=r(t),c=e.ZERO,l=e.BASE,u=BigInt(2**t-1),d=2**t,f=BigInt(t);for(let e=0;e<o;e++){let t=e*s,r=Number(a&u);a>>=f,r>s&&(r-=d,a+=Ys);let o=t,p=t+Math.abs(r)-1,m=e%2!=0,h=r<0;r===0?l=l.add(n(m,i[o])):c=c.add(n(h,i[p]))}return{p:c,f:l}},wNAFCached(e,t,n,r){let i=e._WINDOW_SIZE||1,a=t.get(e);return a||(a=this.precomputeWindow(e,i),i!==1&&t.set(e,r(a))),this.wNAF(i,a,n)}}}function Zs(e){return Bs(e.Fp),Ds(e,{n:`bigint`,h:`bigint`,Gx:`field`,Gy:`field`},{nBitLength:`isSafeInteger`,nByteLength:`isSafeInteger`}),Object.freeze({...Us(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}function Qs(e){let t=Zs(e);Ds(t,{a:`field`,b:`field`},{allowedPrivateKeyLengths:`array`,wrapPrivateKey:`boolean`,isTorsionFree:`function`,clearCofactor:`function`,allowInfinityPoint:`boolean`,fromBytes:`function`,toBytes:`function`});let{endo:n,Fp:r,a:i}=t;if(n){if(!r.eql(i,r.ZERO))throw Error(`Endomorphism can only be defined for Koblitz curves that have a=0`);if(typeof n!=`object`||typeof n.beta!=`bigint`||typeof n.splitScalar!=`function`)throw Error(`Expected endomorphism with beta: bigint and splitScalar: function`)}return Object.freeze({...t})}var{bytesToNumberBE:$s,hexToBytes:ec}=ts,tc={Err:class extends Error{constructor(e=``){super(e)}},_parseInt(e){let{Err:t}=tc;if(e.length<2||e[0]!==2)throw new t(`Invalid signature integer tag`);let n=e[1],r=e.subarray(2,n+2);if(!n||r.length!==n)throw new t(`Invalid signature integer: wrong length`);if(r[0]&128)throw new t(`Invalid signature integer: negative`);if(r[0]===0&&!(r[1]&128))throw new t(`Invalid signature integer: unnecessary leading zero`);return{d:$s(r),l:e.subarray(n+2)}},toSig(e){let{Err:t}=tc,n=typeof e==`string`?ec(e):e;if(!(n instanceof Uint8Array))throw Error(`ui8a expected`);let r=n.length;if(r<2||n[0]!=48)throw new t(`Invalid signature tag`);if(n[1]!==r-2)throw new t(`Invalid signature: incorrect length`);let{d:i,l:a}=tc._parseInt(n.subarray(2)),{d:o,l:s}=tc._parseInt(a);if(s.length)throw new t(`Invalid signature: left bytes after parsing`);return{r:i,s:o}},hexFromSig(e){let t=e=>Number.parseInt(e[0],16)&8?`00`+e:e,n=e=>{let t=e.toString(16);return t.length&1?`0${t}`:t},r=t(n(e.s)),i=t(n(e.r)),a=r.length/2,o=i.length/2,s=n(a),c=n(o);return`30${n(o+a+4)}02${c}${i}02${s}${r}`}},nc=BigInt(0),rc=BigInt(1),ic=BigInt(3);function ac(e){let t=Qs(e),{Fp:n}=t,r=t.toBytes||((e,t,r)=>{let i=t.toAffine();return gs(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))}),i=t.fromBytes||(e=>{let t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function a(e){let{a:r,b:i}=t,a=n.sqr(e),o=n.mul(a,e);return n.add(n.add(o,n.mul(e,r)),i)}if(!n.eql(n.sqr(t.Gy),a(t.Gx)))throw Error(`bad generator point: equation left != right`);function o(e){return typeof e==`bigint`&&nc<e&&e<t.n}function s(e){if(!o(e))throw Error(`Expected valid bigint: 0 < bigint < curve.n`)}function c(e){let{allowedPrivateKeyLengths:n,nByteLength:r,wrapPrivateKey:i,n:a}=t;if(n&&typeof e!=`bigint`){if(e instanceof Uint8Array&&(e=ss(e)),typeof e!=`string`||!n.includes(e.length))throw Error(`Invalid key`);e=e.padStart(r*2,`0`)}let o;try{o=typeof e==`bigint`?e:ds(X(`private key`,e,r))}catch{throw Error(`private key must be ${r} bytes, hex or bigint, not ${typeof e}`)}return i&&(o=$(o,a)),s(o),o}let l=new Map;function u(e){if(!(e instanceof d))throw Error(`ProjectivePoint expected`)}class d{constructor(e,t,r){if(this.px=e,this.py=t,this.pz=r,e==null||!n.isValid(e))throw Error(`x required`);if(t==null||!n.isValid(t))throw Error(`y required`);if(r==null||!n.isValid(r))throw Error(`z required`)}static fromAffine(e){let{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw Error(`invalid affine point`);if(e instanceof d)throw Error(`projective point not allowed`);let i=e=>n.eql(e,n.ZERO);return i(t)&&i(r)?d.ZERO:new d(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){let t=n.invertBatch(e.map(e=>e.pz));return e.map((e,n)=>e.toAffine(t[n])).map(d.fromAffine)}static fromHex(e){let t=d.fromAffine(i(X(`pointHex`,e)));return t.assertValidity(),t}static fromPrivateKey(e){return d.BASE.multiply(c(e))}_setWindowSize(e){this._WINDOW_SIZE=e,l.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!n.is0(this.py))return;throw Error(`bad point: ZERO`)}let{x:e,y:r}=this.toAffine();if(!n.isValid(e)||!n.isValid(r))throw Error(`bad point: x or y not FE`);let i=n.sqr(r),o=a(e);if(!n.eql(i,o))throw Error(`bad point: equation left != right`);if(!this.isTorsionFree())throw Error(`bad point: not in prime-order subgroup`)}hasEvenY(){let{y:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw Error(`Field doesn't support isOdd`)}equals(e){u(e);let{px:t,py:r,pz:i}=this,{px:a,py:o,pz:s}=e,c=n.eql(n.mul(t,s),n.mul(a,i)),l=n.eql(n.mul(r,s),n.mul(o,i));return c&&l}negate(){return new d(this.px,n.neg(this.py),this.pz)}double(){let{a:e,b:r}=t,i=n.mul(r,ic),{px:a,py:o,pz:s}=this,c=n.ZERO,l=n.ZERO,u=n.ZERO,f=n.mul(a,a),p=n.mul(o,o),m=n.mul(s,s),h=n.mul(a,o);return h=n.add(h,h),u=n.mul(a,s),u=n.add(u,u),c=n.mul(e,u),l=n.mul(i,m),l=n.add(c,l),c=n.sub(p,l),l=n.add(p,l),l=n.mul(c,l),c=n.mul(h,c),u=n.mul(i,u),m=n.mul(e,m),h=n.sub(f,m),h=n.mul(e,h),h=n.add(h,u),u=n.add(f,f),f=n.add(u,f),f=n.add(f,m),f=n.mul(f,h),l=n.add(l,f),m=n.mul(o,s),m=n.add(m,m),f=n.mul(m,h),c=n.sub(c,f),u=n.mul(m,p),u=n.add(u,u),u=n.add(u,u),new d(c,l,u)}add(e){u(e);let{px:r,py:i,pz:a}=this,{px:o,py:s,pz:c}=e,l=n.ZERO,f=n.ZERO,p=n.ZERO,m=t.a,h=n.mul(t.b,ic),g=n.mul(r,o),_=n.mul(i,s),v=n.mul(a,c),y=n.add(r,i),b=n.add(o,s);y=n.mul(y,b),b=n.add(g,_),y=n.sub(y,b),b=n.add(r,a);let x=n.add(o,c);return b=n.mul(b,x),x=n.add(g,v),b=n.sub(b,x),x=n.add(i,a),l=n.add(s,c),x=n.mul(x,l),l=n.add(_,v),x=n.sub(x,l),p=n.mul(m,b),l=n.mul(h,v),p=n.add(l,p),l=n.sub(_,p),p=n.add(_,p),f=n.mul(l,p),_=n.add(g,g),_=n.add(_,g),v=n.mul(m,v),b=n.mul(h,b),_=n.add(_,v),v=n.sub(g,v),v=n.mul(m,v),b=n.add(b,v),g=n.mul(_,b),f=n.add(f,g),g=n.mul(x,b),l=n.mul(y,l),l=n.sub(l,g),g=n.mul(y,_),p=n.mul(x,p),p=n.add(p,g),new d(l,f,p)}subtract(e){return this.add(e.negate())}is0(){return this.equals(d.ZERO)}wNAF(e){return p.wNAFCached(this,l,e,e=>{let t=n.invertBatch(e.map(e=>e.pz));return e.map((e,n)=>e.toAffine(t[n])).map(d.fromAffine)})}multiplyUnsafe(e){let r=d.ZERO;if(e===nc)return r;if(s(e),e===rc)return this;let{endo:i}=t;if(!i)return p.unsafeLadder(this,e);let{k1neg:a,k1:o,k2neg:c,k2:l}=i.splitScalar(e),u=r,f=r,m=this;for(;o>nc||l>nc;)o&rc&&(u=u.add(m)),l&rc&&(f=f.add(m)),m=m.double(),o>>=rc,l>>=rc;return a&&(u=u.negate()),c&&(f=f.negate()),f=new d(n.mul(f.px,i.beta),f.py,f.pz),u.add(f)}multiply(e){s(e);let r=e,i,a,{endo:o}=t;if(o){let{k1neg:e,k1:t,k2neg:s,k2:c}=o.splitScalar(r),{p:l,f:u}=this.wNAF(t),{p:f,f:m}=this.wNAF(c);l=p.constTimeNegate(e,l),f=p.constTimeNegate(s,f),f=new d(n.mul(f.px,o.beta),f.py,f.pz),i=l.add(f),a=u.add(m)}else{let{p:e,f:t}=this.wNAF(r);i=e,a=t}return d.normalizeZ([i,a])[0]}multiplyAndAddUnsafe(e,t,n){let r=d.BASE,i=(e,t)=>t===nc||t===rc||!e.equals(r)?e.multiplyUnsafe(t):e.multiply(t),a=i(this,t).add(i(e,n));return a.is0()?void 0:a}toAffine(e){let{px:t,py:r,pz:i}=this,a=this.is0();e??=a?n.ONE:n.inv(i);let o=n.mul(t,e),s=n.mul(r,e),c=n.mul(i,e);if(a)return{x:n.ZERO,y:n.ZERO};if(!n.eql(c,n.ONE))throw Error(`invZ was invalid`);return{x:o,y:s}}isTorsionFree(){let{h:e,isTorsionFree:n}=t;if(e===rc)return!0;if(n)return n(d,this);throw Error(`isTorsionFree() has not been declared for the elliptic curve`)}clearCofactor(){let{h:e,clearCofactor:n}=t;return e===rc?this:n?n(d,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return this.assertValidity(),r(d,this,e)}toHex(e=!0){return ss(this.toRawBytes(e))}}d.BASE=new d(t.Gx,t.Gy,n.ONE),d.ZERO=new d(n.ZERO,n.ONE,n.ZERO);let f=t.nBitLength,p=Xs(d,t.endo?Math.ceil(f/2):f);return{CURVE:t,ProjectivePoint:d,normPrivateKeyToScalar:c,weierstrassEquation:a,isWithinCurveOrder:o}}function oc(e){let t=Zs(e);return Ds(t,{hash:`hash`,hmac:`function`,randomBytes:`function`},{bits2int:`function`,bits2int_modN:`function`,lowS:`boolean`}),Object.freeze({lowS:!0,...t})}function sc(e){let t=oc(e),{Fp:n,n:r}=t,i=n.BYTES+1,a=2*n.BYTES+1;function o(e){return nc<e&&e<n.ORDER}function s(e){return $(e,r)}function c(e){return Is(e,r)}let{ProjectivePoint:l,normPrivateKeyToScalar:u,weierstrassEquation:d,isWithinCurveOrder:f}=ac({...t,toBytes(e,t,r){let i=t.toAffine(),a=n.toBytes(i.x),o=gs;return r?o(Uint8Array.from([t.hasEvenY()?2:3]),a):o(Uint8Array.from([4]),a,n.toBytes(i.y))},fromBytes(e){let t=e.length,r=e[0],s=e.subarray(1);if(t===i&&(r===2||r===3)){let e=ds(s);if(!o(e))throw Error(`Point is not on curve`);let t=d(e),i=n.sqrt(t),a=(i&rc)===rc;return(r&1)==1!==a&&(i=n.neg(i)),{x:e,y:i}}if(t===a&&r===4)return{x:n.fromBytes(s.subarray(0,n.BYTES)),y:n.fromBytes(s.subarray(n.BYTES,2*n.BYTES))};throw Error(`Point of length ${t} was invalid. Expected ${i} compressed bytes or ${a} uncompressed bytes`)}}),p=e=>ss(ps(e,t.nByteLength));function m(e){return e>r>>rc}function h(e){return m(e)?s(-e):e}let g=(e,t,n)=>ds(e.slice(t,n));class _{constructor(e,t,n){this.r=e,this.s=t,this.recovery=n,this.assertValidity()}static fromCompact(e){let n=t.nByteLength;return e=X(`compactSignature`,e,n*2),new _(g(e,0,n),g(e,n,2*n))}static fromDER(e){let{r:t,s:n}=tc.toSig(X(`DER`,e));return new _(t,n)}assertValidity(){if(!f(this.r))throw Error(`r must be 0 < r < CURVE.n`);if(!f(this.s))throw Error(`s must be 0 < s < CURVE.n`)}addRecoveryBit(e){return new _(this.r,this.s,e)}recoverPublicKey(e){let{r,s:i,recovery:a}=this,o=C(X(`msgHash`,e));if(a==null||![0,1,2,3].includes(a))throw Error(`recovery id invalid`);let u=a===2||a===3?r+t.n:r;if(u>=n.ORDER)throw Error(`recovery id 2 or 3 invalid`);let d=a&1?`03`:`02`,f=l.fromHex(d+p(u)),m=c(u),h=s(-o*m),g=s(i*m),_=l.BASE.multiplyAndAddUnsafe(f,h,g);if(!_)throw Error(`point at infinify`);return _.assertValidity(),_}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new _(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return us(this.toDERHex())}toDERHex(){return tc.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return us(this.toCompactHex())}toCompactHex(){return p(this.r)+p(this.s)}}let v={isValidPrivateKey(e){try{return u(e),!0}catch{return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{let e=Ks(t.n);return qs(t.randomBytes(e),t.n)},precompute(e=8,t=l.BASE){return t._setWindowSize(e),t.multiply(BigInt(3)),t}};function y(e,t=!0){return l.fromPrivateKey(e).toRawBytes(t)}function b(e){let t=e instanceof Uint8Array,n=typeof e==`string`,r=(t||n)&&e.length;return t?r===i||r===a:n?r===2*i||r===2*a:e instanceof l}function x(e,t,n=!0){if(b(e))throw Error(`first arg must be private key`);if(!b(t))throw Error(`second arg must be public key`);return l.fromHex(t).multiply(u(e)).toRawBytes(n)}let S=t.bits2int||function(e){let n=ds(e),r=e.length*8-t.nBitLength;return r>0?n>>BigInt(r):n},C=t.bits2int_modN||function(e){return s(S(e))},ee=Ss(t.nBitLength);function te(e){if(typeof e!=`bigint`)throw Error(`bigint expected`);if(!(nc<=e&&e<ee))throw Error(`bigint expected < 2^${t.nBitLength}`);return ps(e,t.nByteLength)}function w(e,r,i=ne){if([`recovered`,`canonical`].some(e=>e in i))throw Error(`sign() legacy options not supported`);let{hash:a,randomBytes:o}=t,{lowS:d,prehash:p,extraEntropy:g}=i;d??=!0,e=X(`msgHash`,e),p&&(e=X(`prehashed msgHash`,a(e)));let v=C(e),y=u(r),b=[te(y),te(v)];if(g!=null){let e=g===!0?o(n.BYTES):g;b.push(X(`extraEntropy`,e))}let x=gs(...b),ee=v;function w(e){let t=S(e);if(!f(t))return;let n=c(t),r=l.BASE.multiply(t).toAffine(),i=s(r.x);if(i===nc)return;let a=s(n*s(ee+i*y));if(a===nc)return;let o=(r.x===i?0:2)|Number(r.y&rc),u=a;return d&&m(a)&&(u=h(a),o^=1),new _(i,u,o)}return{seed:x,k2sig:w}}let ne={lowS:t.lowS,prehash:!1},re={lowS:t.lowS,prehash:!1};function T(e,n,r=ne){let{seed:i,k2sig:a}=w(e,n,r),o=t;return Ts(o.hash.outputLen,o.nByteLength,o.hmac)(i,a)}l.BASE._setWindowSize(8);function E(e,n,r,i=re){let a=e;if(n=X(`msgHash`,n),r=X(`publicKey`,r),`strict`in i)throw Error(`options.strict was renamed to lowS`);let{lowS:o,prehash:u}=i,d,f;try{if(typeof a==`string`||a instanceof Uint8Array)try{d=_.fromDER(a)}catch(e){if(!(e instanceof tc.Err))throw e;d=_.fromCompact(a)}else if(typeof a==`object`&&typeof a.r==`bigint`&&typeof a.s==`bigint`){let{r:e,s:t}=a;d=new _(e,t)}else throw Error(`PARSE`);f=l.fromHex(r)}catch(e){if(e.message===`PARSE`)throw Error(`signature must be Signature instance, Uint8Array or hex string`);return!1}if(o&&d.hasHighS())return!1;u&&(n=t.hash(n));let{r:p,s:m}=d,h=C(n),g=c(m),v=s(h*g),y=s(p*g),b=l.BASE.multiplyAndAddUnsafe(f,v,y)?.toAffine();return b?s(b.x)===p:!1}return{CURVE:t,getPublicKey:y,getSharedSecret:x,sign:T,verify:E,ProjectivePoint:l,Signature:_,utils:v}}var cc=class extends Uo{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,No(e);let n=Vo(t);if(this.iHash=e.create(),typeof this.iHash.update!=`function`)throw Error(`Expected instance of class which extends utils.Hash`);this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?e.create().update(n).digest():n);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),i.fill(0)}update(e){return Po(this),this.iHash.update(e),this}digestInto(e){Po(this),Mo(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:n,finished:r,destroyed:i,blockLen:a,outputLen:o}=this;return e=e,e.finished=r,e.destroyed=i,e.blockLen=a,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}},lc=(e,t,n)=>new cc(e,t).update(n).digest();lc.create=(e,t)=>new cc(e,t);function uc(e){return{hash:e,hmac:(t,...n)=>lc(e,t,Ho(...n)),randomBytes:Go}}function dc(e,t){let n=t=>sc({...e,...uc(t)});return Object.freeze({...n(t),create:n})}var fc=BigInt(`0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f`),pc=BigInt(`0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141`),mc=BigInt(1),hc=BigInt(2),gc=(e,t)=>(e+t/hc)/t;function _c(e){let t=fc,n=BigInt(3),r=BigInt(6),i=BigInt(11),a=BigInt(22),o=BigInt(23),s=BigInt(44),c=BigInt(88),l=e*e*e%t,u=l*l*e%t,d=Fs(Fs(Fs(u,n,t)*u%t,n,t)*u%t,hc,t)*l%t,f=Fs(d,i,t)*d%t,p=Fs(f,a,t)*f%t,m=Fs(p,s,t)*p%t,h=Fs(Fs(Fs(Fs(Fs(Fs(m,c,t)*m%t,s,t)*p%t,n,t)*u%t,o,t)*f%t,r,t)*l%t,hc,t);if(!vc.eql(vc.sqr(h),e))throw Error(`Cannot find square root`);return h}var vc=Ws(fc,void 0,void 0,{sqrt:_c}),yc=dc({a:BigInt(0),b:BigInt(7),Fp:vc,n:pc,Gx:BigInt(`55066263022277343669578718895168534326250603453777594175500187360389116729240`),Gy:BigInt(`32670510020758816978083085130507043184471273380659243275938904335757337482424`),h:BigInt(1),lowS:!0,endo:{beta:BigInt(`0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee`),splitScalar:e=>{let t=pc,n=BigInt(`0x3086d221a7d46bcde86c90e49284eb15`),r=-mc*BigInt(`0xe4437ed6010e88286f547fa90abfe4c3`),i=BigInt(`0x114ca50f7a8e2f3f657c1108d9d44cfd8`),a=n,o=BigInt(`0x100000000000000000000000000000000`),s=gc(a*e,t),c=gc(-r*e,t),l=$(e-s*n-c*i,t),u=$(-s*r-c*a,t),d=l>o,f=u>o;if(d&&(l=t-l),f&&(u=t-u),l>o||u>o)throw Error(`splitScalar: Endomorphism failed, k=`+e);return{k1neg:d,k1:l,k2neg:f,k2:u}}}},es),bc=BigInt(0),xc=e=>typeof e==`bigint`&&bc<e&&e<fc,Sc=e=>typeof e==`bigint`&&bc<e&&e<pc,Cc={};function wc(e,...t){let n=Cc[e];if(n===void 0){let t=es(Uint8Array.from(e,e=>e.charCodeAt(0)));n=gs(t,t),Cc[e]=n}return es(gs(n,...t))}var Tc=e=>e.toRawBytes(!0).slice(1),Ec=e=>ps(e,32),Dc=e=>$(e,fc),Oc=e=>$(e,pc),kc=yc.ProjectivePoint,Ac=(e,t,n)=>kc.BASE.multiplyAndAddUnsafe(e,t,n);function jc(e){let t=yc.utils.normPrivateKeyToScalar(e),n=kc.fromPrivateKey(t);return{scalar:n.hasEvenY()?t:Oc(-t),bytes:Tc(n)}}function Mc(e){if(!xc(e))throw Error(`bad x: need 0 < x < p`);let t=_c(Dc(Dc(e*e)*e+BigInt(7)));t%hc!==bc&&(t=Dc(-t));let n=new kc(e,t,mc);return n.assertValidity(),n}function Nc(...e){return Oc(ds(wc(`BIP0340/challenge`,...e)))}function Pc(e){return jc(e).bytes}function Fc(e,t,n=Go(32)){let r=X(`message`,e),{bytes:i,scalar:a}=jc(t),o=Oc(ds(wc(`BIP0340/nonce`,Ec(a^ds(wc(`BIP0340/aux`,X(`auxRand`,n,32)))),i,r)));if(o===bc)throw Error(`sign failed: k is zero`);let{bytes:s,scalar:c}=jc(o),l=Nc(s,i,r),u=new Uint8Array(64);if(u.set(s,0),u.set(Ec(Oc(c+l*a)),32),!Ic(u,r,i))throw Error(`sign: Invalid signature produced`);return u}function Ic(e,t,n){let r=X(`signature`,e,64),i=X(`message`,t),a=X(`publicKey`,n,32);try{let e=Mc(ds(a)),t=ds(r.subarray(0,32));if(!xc(t))return!1;let n=ds(r.subarray(32,64));if(!Sc(n))return!1;let o=Ac(e,n,Oc(-Nc(Ec(t),Tc(e),i)));return!(!o||!o.hasEvenY()||o.toAffine().x!==t)}catch{return!1}}var Lc={getPublicKey:Pc,sign:Fc,verify:Ic,utils:{randomPrivateKey:yc.utils.randomPrivateKey,lift_x:Mc,pointToBytes:Tc,numberToBytesBE:ps,bytesToNumberBE:ds,taggedHash:wc,mod:$}};typeof globalThis==`object`&&`crypto`in globalThis&&globalThis.crypto;var Rc=e=>e instanceof Uint8Array,zc=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Bc=(e,t)=>e<<32-t|e>>>t;if(new Uint8Array(new Uint32Array([287454020]).buffer)[0]!==68)throw Error(`Non little-endian hardware is not supported`);var Vc=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`));function Hc(e){if(!Rc(e))throw Error(`Uint8Array expected`);let t=``;for(let n=0;n<e.length;n++)t+=Vc[e[n]];return t}function Uc(e){if(typeof e!=`string`)throw Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function Wc(e){if(typeof e==`string`&&(e=Uc(e)),!Rc(e))throw Error(`expected Uint8Array, got ${typeof e}`);return e}var Gc=class{clone(){return this._cloneInto()}};function Kc(e){let t=t=>e().update(Wc(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function qc(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`Wrong positive integer: ${e}`)}function Jc(e){if(typeof e!=`boolean`)throw Error(`Expected boolean, not ${e}`)}function Yc(e,...t){if(!(e instanceof Uint8Array))throw Error(`Expected Uint8Array`);if(t.length>0&&!t.includes(e.length))throw Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function Xc(e){if(typeof e!=`function`||typeof e.create!=`function`)throw Error(`Hash should be wrapped by utils.wrapConstructor`);qc(e.outputLen),qc(e.blockLen)}function Zc(e,t=!0){if(e.destroyed)throw Error(`Hash instance has been destroyed`);if(t&&e.finished)throw Error(`Hash#digest() has already been called`)}function Qc(e,t){Yc(e);let n=t.outputLen;if(e.length<n)throw Error(`digestInto() expects output buffer of length at least ${n}`)}var $c={number:qc,bool:Jc,bytes:Yc,hash:Xc,exists:Zc,output:Qc};function el(e,t,n,r){if(typeof e.setBigUint64==`function`)return e.setBigUint64(t,n,r);let i=BigInt(32),a=BigInt(4294967295),o=Number(n>>i&a),s=Number(n&a),c=r?4:0,l=r?0:4;e.setUint32(t+c,o,r),e.setUint32(t+l,s,r)}var tl=class extends Gc{constructor(e,t,n,r){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=zc(this.buffer)}update(e){$c.exists(this);let{view:t,buffer:n,blockLen:r}=this;e=Wc(e);let i=e.length;for(let a=0;a<i;){let o=Math.min(r-this.pos,i-a);if(o===r){let t=zc(e);for(;r<=i-a;a+=r)this.process(t,a)}else n.set(e.subarray(a,a+o),this.pos),this.pos+=o,a+=o,this.pos===r&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){$c.exists(this),$c.output(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:r,isLE:i}=this,{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>r-a&&(this.process(n,0),a=0);for(let e=a;e<r;e++)t[e]=0;el(n,r-8,BigInt(this.length*8),i),this.process(n,0);let o=zc(e),s=this.outputLen;if(s%4)throw Error(`_sha2: outputLen should be aligned to 32bit`);let c=s/4,l=this.get();if(c>l.length)throw Error(`_sha2: outputLen bigger than state`);for(let e=0;e<c;e++)o.setUint32(4*e,l[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:n,length:r,finished:i,destroyed:a,pos:o}=this;return e.length=r,e.pos=o,e.finished=i,e.destroyed=a,r%t&&e.buffer.set(n),e}},nl=(e,t,n)=>e&t^~e&n,rl=(e,t,n)=>e&t^e&n^t&n,il=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,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),al=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ol=new Uint32Array(64),sl=class extends tl{constructor(){super(64,32,8,!1),this.A=al[0]|0,this.B=al[1]|0,this.C=al[2]|0,this.D=al[3]|0,this.E=al[4]|0,this.F=al[5]|0,this.G=al[6]|0,this.H=al[7]|0}get(){let{A:e,B:t,C:n,D:r,E:i,F:a,G:o,H:s}=this;return[e,t,n,r,i,a,o,s]}set(e,t,n,r,i,a,o,s){this.A=e|0,this.B=t|0,this.C=n|0,this.D=r|0,this.E=i|0,this.F=a|0,this.G=o|0,this.H=s|0}process(e,t){for(let n=0;n<16;n++,t+=4)ol[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=ol[e-15],n=ol[e-2],r=Bc(t,7)^Bc(t,18)^t>>>3,i=Bc(n,17)^Bc(n,19)^n>>>10;ol[e]=i+ol[e-7]+r+ol[e-16]|0}let{A:n,B:r,C:i,D:a,E:o,F:s,G:c,H:l}=this;for(let e=0;e<64;e++){let t=Bc(o,6)^Bc(o,11)^Bc(o,25),u=l+t+nl(o,s,c)+il[e]+ol[e]|0,d=(Bc(n,2)^Bc(n,13)^Bc(n,22))+rl(n,r,i)|0;l=c,c=s,s=o,o=a+u|0,a=i,i=r,r=n,n=u+d|0}n=n+this.A|0,r=r+this.B|0,i=i+this.C|0,a=a+this.D|0,o=o+this.E|0,s=s+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,r,i,a,o,s,c,l)}roundClean(){ol.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},cl=class extends sl{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}},ll=Kc(()=>new sl);Kc(()=>new cl);var ul=Symbol(`verified`),dl=e=>e instanceof Object;function fl(e){if(!dl(e)||typeof e.kind!=`number`||typeof e.content!=`string`||typeof e.created_at!=`number`||typeof e.pubkey!=`string`||!e.pubkey.match(/^[a-f0-9]{64}$/)||!Array.isArray(e.tags))return!1;for(let t=0;t<e.tags.length;t++){let n=e.tags[t];if(!Array.isArray(n))return!1;for(let e=0;e<n.length;e++)if(typeof n[e]!=`string`)return!1}return!0}new TextDecoder(`utf-8`);var pl=new TextEncoder,ml=class{generateSecretKey(){return Lc.utils.randomPrivateKey()}getPublicKey(e){return Hc(Lc.getPublicKey(e))}finalizeEvent(e,t){let n=e;return n.pubkey=Hc(Lc.getPublicKey(t)),n.id=gl(n),n.sig=Hc(Lc.sign(gl(n),t)),n[ul]=!0,n}verifyEvent(e){if(typeof e[ul]==`boolean`)return e[ul];let t=gl(e);if(t!==e.id)return e[ul]=!1,!1;try{let n=Lc.verify(e.sig,t,e.pubkey);return e[ul]=n,n}catch{return e[ul]=!1,!1}}};function hl(e){if(!fl(e))throw Error(`can't serialize event with wrong or missing properties`);return JSON.stringify([0,e.pubkey,e.created_at,e.kind,e.tags,e.content])}function gl(e){return Hc(ll(pl.encode(hl(e))))}var _l=new ml;_l.generateSecretKey;var vl=_l.getPublicKey;_l.finalizeEvent,_l.verifyEvent;function yl(e,t,n){if(Reflect.has(e,t))return Reflect.get(e,t);{let r=n();return Reflect.set(e,t,r),r}}var bl=Symbol.for(`event-store`);function xl(e){return e!=null&&e.id?.length===64&&typeof e.sig==`string`&&typeof e.pubkey==`string`&&e.pubkey.length===64&&typeof e.content==`string`&&Array.isArray(e.tags)&&typeof e.created_at==`number`&&e.created_at>0}function Sl(e){return Reflect.get(e,bl)}function Cl(e){if(!xl(e))return;let t=Sl(e);t&&t.update(e)}var wl=Symbol.for(`encrypted-content`),Tl={4:`nip04`,13:`nip44`,[vo]:`nip44`};function El(e,t){return Tl[e]=t,e}function Dl(e,t,n){let r=n??Tl[e];if(!r)throw Error(`Event kind ${e} does not support encrypted content`);let i=t[r];if(!i)throw Error(`Signer does not support ${r} encryption`);return i}function Ol(e){return Tl[e]!==void 0}function kl(e){return e.content.length>0}function Al(e){return Reflect.get(e,wl)}function jl(e){return Reflect.has(e,wl)===!0}function Ml(e,t){Reflect.set(e,wl,t),Cl(e)}var Nl=new Set([wl]);function Pl(e){return e}function Fl(...e){return Rl(e.filter(e=>!!e),Nl)}function Il(...e){return Rl(e.filter(e=>!!e))}function Ll(){return e=>e}function Rl(e,t){return e.length===0?Pl:async function(n){return e.reduce(async(e,n)=>{let r=await n(await e);if(t&&typeof r==`object`&&r&&typeof e==`object`&&e){let e=Reflect.ownKeys(r).filter(e=>typeof e==`symbol`);for(let n of e)t.has(n)||Reflect.deleteProperty(r,n)}return r},n)}}function zl(){return Math.round(Date.now()/1e3)}function Bl(e,t,n,r){return async i=>{if(!n)throw Error(`Signer required for encrypted content`);let a=await Dl(i.kind,n,r).encrypt(e,t);return{...i,content:a,[wl]:t}}}var Vl=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`,Hl=(e=21)=>{let t=``,n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=Vl[n[e]&63];return t};function Ul(e,t){return e[0]!==void 0&&e[1]!==void 0&&(!t||e[0]===t)}function Wl(e){return Ul(e,`p`)}function Gl(e,t=2){e=e.slice();for(let n=e.length-1;n>=0;n--)(e[n]===void 0||e[n]===null||e[n]===``)&&(n+1===e.length&&n>=t?e.pop():e[n]=``);return e}function Kl(e,t,n=!0){let r=e.find(e=>e[0]===t[0]);return r?n?e.map(e=>e===r?t:e):e:[...e,t]}function ql(e,t,n=!0,r){let i=e.find(e=>e[0]===t[0]&&e[1]&&(r?r(e[1],t[1]):e[1]===t[1]));return i?n?e.map(e=>e===i?t:e):e:[...e,t]}function Jl(e){if(!Number.isSafeInteger(e))throw Error(`Wrong integer: ${e}`)}function Yl(...e){let t=(e,t)=>n=>e(t(n));return{encode:Array.from(e).reverse().reduce((e,n)=>e?t(e,n.encode):n.encode,void 0),decode:e.reduce((e,n)=>e?t(e,n.decode):n.decode,void 0)}}function Xl(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!=`number`)throw Error(`alphabet.encode input should be an array of numbers`);return t.map(t=>{if(Jl(t),t<0||t>=e.length)throw Error(`Digit index outside alphabet: ${t} (alphabet: ${e.length})`);return e[t]})},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!=`string`)throw Error(`alphabet.decode input should be array of strings`);return t.map(t=>{if(typeof t!=`string`)throw Error(`alphabet.decode: not string element=${t}`);let n=e.indexOf(t);if(n===-1)throw Error(`Unknown letter: "${t}". Allowed: ${e}`);return n})}}}function Zl(e=``){if(typeof e!=`string`)throw Error(`join separator should be string`);return{encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!=`string`)throw Error(`join.encode input should be array of strings`);for(let e of t)if(typeof e!=`string`)throw Error(`join.encode: non-string input=${e}`);return t.join(e)},decode:t=>{if(typeof t!=`string`)throw Error(`join.decode input should be string`);return t.split(e)}}}function Ql(e,t=`=`){if(Jl(e),typeof t!=`string`)throw Error(`padding chr should be string`);return{encode(n){if(!Array.isArray(n)||n.length&&typeof n[0]!=`string`)throw Error(`padding.encode input should be array of strings`);for(let e of n)if(typeof e!=`string`)throw Error(`padding.encode: non-string input=${e}`);for(;n.length*e%8;)n.push(t);return n},decode(n){if(!Array.isArray(n)||n.length&&typeof n[0]!=`string`)throw Error(`padding.encode input should be array of strings`);for(let e of n)if(typeof e!=`string`)throw Error(`padding.decode: non-string input=${e}`);let r=n.length;if(r*e%8)throw Error(`Invalid padding: string should have whole number of bytes`);for(;r>0&&n[r-1]===t;r--)if(!((r-1)*e%8))throw Error(`Invalid padding: string has too much padding`);return n.slice(0,r)}}}function $l(e){if(typeof e!=`function`)throw Error(`normalize fn should be function`);return{encode:e=>e,decode:t=>e(t)}}function eu(e,t,n){if(t<2)throw Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw Error(`convertRadix: data should be array`);if(!e.length)return[];let r=0,i=[],a=Array.from(e);for(a.forEach(e=>{if(Jl(e),e<0||e>=t)throw Error(`Wrong integer: ${e}`)});;){let e=0,o=!0;for(let i=r;i<a.length;i++){let s=a[i],c=t*e+s;if(!Number.isSafeInteger(c)||t*e/t!==e||c-s!==t*e||(e=c%n,a[i]=Math.floor(c/n),!Number.isSafeInteger(a[i])||a[i]*n+e!==c))throw Error(`convertRadix: carry overflow`);if(o)a[i]?o=!1:r=i;else continue}if(i.push(e),o)break}for(let t=0;t<e.length-1&&e[t]===0;t++)i.push(0);return i.reverse()}var tu=(e,t)=>t?tu(t,e%t):e,nu=(e,t)=>e+(t-tu(e,t));function ru(e,t,n,r){if(!Array.isArray(e))throw Error(`convertRadix2: data should be array`);if(t<=0||t>32)throw Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw Error(`convertRadix2: wrong to=${n}`);if(nu(t,n)>32)throw Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${nu(t,n)}`);let i=0,a=0,o=2**n-1,s=[];for(let r of e){if(Jl(r),r>=2**t)throw Error(`convertRadix2: invalid data word=${r} from=${t}`);if(i=i<<t|r,a+t>32)throw Error(`convertRadix2: carry overflow pos=${a} from=${t}`);for(a+=t;a>=n;a-=n)s.push((i>>a-n&o)>>>0);i&=2**a-1}if(i=i<<n-a&o,!r&&a>=t)throw Error(`Excess padding`);if(!r&&i)throw Error(`Non-zero padding: ${i}`);return r&&a>0&&s.push(i>>>0),s}function iu(e){return Jl(e),{encode:t=>{if(!(t instanceof Uint8Array))throw Error(`radix.encode input should be Uint8Array`);return eu(Array.from(t),256,e)},decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!=`number`)throw Error(`radix.decode input should be array of strings`);return Uint8Array.from(eu(t,e,256))}}}function au(e,t=!1){if(Jl(e),e<=0||e>32)throw Error(`radix2: bits should be in (0..32]`);if(nu(8,e)>32||nu(e,8)>32)throw Error(`radix2: carry overflow`);return{encode:n=>{if(!(n instanceof Uint8Array))throw Error(`radix2.encode input should be Uint8Array`);return ru(Array.from(n),8,e,!t)},decode:n=>{if(!Array.isArray(n)||n.length&&typeof n[0]!=`number`)throw Error(`radix2.decode input should be array of strings`);return Uint8Array.from(ru(n,e,8,t))}}}function ou(e){if(typeof e!=`function`)throw Error(`unsafeWrapper fn should be function`);return function(...t){try{return e.apply(null,t)}catch{}}}var su=Yl(au(4),Xl(`0123456789ABCDEF`),Zl(``)),cu=Yl(au(5),Xl(`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`),Ql(5),Zl(``));Yl(au(5),Xl(`0123456789ABCDEFGHIJKLMNOPQRSTUV`),Ql(5),Zl(``)),Yl(au(5),Xl(`0123456789ABCDEFGHJKMNPQRSTVWXYZ`),Zl(``),$l(e=>e.toUpperCase().replace(/O/g,`0`).replace(/[IL]/g,`1`)));var lu=Yl(au(6),Xl(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`),Ql(6),Zl(``)),uu=Yl(au(6),Xl(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`),Ql(6),Zl(``)),du=e=>Yl(iu(58),Xl(e),Zl(``)),fu=du(`123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`);du(`123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ`),du(`rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz`);var pu=[0,2,3,5,6,7,9,10,11],mu={encode(e){let t=``;for(let n=0;n<e.length;n+=8){let r=e.subarray(n,n+8);t+=fu.encode(r).padStart(pu[r.length],`1`)}return t},decode(e){let t=[];for(let n=0;n<e.length;n+=11){let r=e.slice(n,n+11),i=pu.indexOf(r.length),a=fu.decode(r);for(let e=0;e<a.length-i;e++)if(a[e]!==0)throw Error(`base58xmr: wrong padding`);t=t.concat(Array.from(a.slice(a.length-i)))}return Uint8Array.from(t)}},hu=Yl(Xl(`qpzry9x8gf2tvdw0s3jn54khce6mua7l`),Zl(``)),gu=[996825010,642813549,513874426,1027748829,705979059];function _u(e){let t=e>>25,n=(e&33554431)<<5;for(let e=0;e<gu.length;e++)(t>>e&1)==1&&(n^=gu[e]);return n}function vu(e,t,n=1){let r=e.length,i=1;for(let t=0;t<r;t++){let n=e.charCodeAt(t);if(n<33||n>126)throw Error(`Invalid prefix (${e})`);i=_u(i)^n>>5}i=_u(i);for(let t=0;t<r;t++)i=_u(i)^e.charCodeAt(t)&31;for(let e of t)i=_u(i)^e;for(let e=0;e<6;e++)i=_u(i);return i^=n,hu.encode(ru([i%2**30],30,5,!1))}function yu(e){let t=e===`bech32`?1:734539939,n=au(5),r=n.decode,i=n.encode,a=ou(r);function o(e,n,r=90){if(typeof e!=`string`)throw Error(`bech32.encode prefix should be string, not ${typeof e}`);if(!Array.isArray(n)||n.length&&typeof n[0]!=`number`)throw Error(`bech32.encode words should be array of numbers, not ${typeof n}`);let i=e.length+7+n.length;if(r!==!1&&i>r)throw TypeError(`Length ${i} exceeds limit ${r}`);return e=e.toLowerCase(),`${e}1${hu.encode(n)}${vu(e,n,t)}`}function s(e,n=90){if(typeof e!=`string`)throw Error(`bech32.decode input should be string, not ${typeof e}`);if(e.length<8||n!==!1&&e.length>n)throw TypeError(`Wrong string length: ${e.length} (${e}). Expected (8..${n})`);let r=e.toLowerCase();if(e!==r&&e!==e.toUpperCase())throw Error(`String must be lowercase or uppercase`);e=r;let i=e.lastIndexOf(`1`);if(i===0||i===-1)throw Error(`Letter "1" must be present between prefix and data only`);let a=e.slice(0,i),o=e.slice(i+1);if(o.length<6)throw Error(`Data must be at least 6 characters long`);let s=hu.decode(o).slice(0,-6),c=vu(a,s,t);if(!o.endsWith(c))throw Error(`Invalid checksum in ${e}: expected "${c}"`);return{prefix:a,words:s}}let c=ou(s);function l(e){let{prefix:t,words:n}=s(e,!1);return{prefix:t,words:n,bytes:r(n)}}return{encode:o,decode:s,decodeToBytes:l,decodeUnsafe:c,fromWords:r,fromWordsUnsafe:a,toWords:i}}var bu=yu(`bech32`);yu(`bech32m`);var xu={utf8:{encode:e=>new TextDecoder().decode(e),decode:e=>new TextEncoder().encode(e)},hex:Yl(au(4),Xl(`0123456789abcdef`),Zl(``),$l(e=>{if(typeof e!=`string`||e.length%2)throw TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})),base16:su,base32:cu,base64:lu,base64url:uu,base58:fu,base58xmr:mu};`${Object.keys(xu).join(`, `)}`;var Su=new TextDecoder(`utf-8`);new TextEncoder;var Cu=5e3;function wu(e){let{prefix:t,words:n}=bu.decode(e,Cu),r=new Uint8Array(bu.fromWords(n));switch(t){case`nprofile`:{let e=Tu(r);if(!e[0]?.[0])throw Error(`missing TLV 0 for nprofile`);if(e[0][0].length!==32)throw Error(`TLV 0 should be 32 bytes`);return{type:`nprofile`,data:{pubkey:Hc(e[0][0]),relays:e[1]?e[1].map(e=>Su.decode(e)):[]}}}case`nevent`:{let e=Tu(r);if(!e[0]?.[0])throw Error(`missing TLV 0 for nevent`);if(e[0][0].length!==32)throw Error(`TLV 0 should be 32 bytes`);if(e[2]&&e[2][0].length!==32)throw Error(`TLV 2 should be 32 bytes`);if(e[3]&&e[3][0].length!==4)throw Error(`TLV 3 should be 4 bytes`);return{type:`nevent`,data:{id:Hc(e[0][0]),relays:e[1]?e[1].map(e=>Su.decode(e)):[],author:e[2]?.[0]?Hc(e[2][0]):void 0,kind:e[3]?.[0]?parseInt(Hc(e[3][0]),16):void 0}}}case`naddr`:{let e=Tu(r);if(!e[0]?.[0])throw Error(`missing TLV 0 for naddr`);if(!e[2]?.[0])throw Error(`missing TLV 2 for naddr`);if(e[2][0].length!==32)throw Error(`TLV 2 should be 32 bytes`);if(!e[3]?.[0])throw Error(`missing TLV 3 for naddr`);if(e[3][0].length!==4)throw Error(`TLV 3 should be 4 bytes`);return{type:`naddr`,data:{identifier:Su.decode(e[0][0]),pubkey:Hc(e[2][0]),kind:parseInt(Hc(e[3][0]),16),relays:e[1]?e[1].map(e=>Su.decode(e)):[]}}}case`nsec`:return{type:t,data:r};case`npub`:case`note`:return{type:t,data:Hc(r)};default:throw Error(`unknown prefix ${t}`)}}function Tu(e){let t={},n=e;for(;n.length>0;){let e=n[0],r=n[1],i=n.slice(2,2+r);if(n=n.slice(2+r),i.length<r)throw Error(`not enough data to read on TLV ${e}`);t[e]=t[e]||[],t[e].push(i)}return t}var Eu={get url(){return/(?:https?|wss?|ircs?|s?ftp):\/\/((?:(?:\d{1,3}\.){3}\d{1,3}|localhost|[a-zA-Z0-9\.\-]+\.[a-zA-Z]+)(?::\d+)?)([\/\?#][\p{L}\p{N}\p{M}&\.-\/\?=#\-@%\+_,:!~*]*)?/gu},get link(){return/https?:\/\/((?:(?:\d{1,3}\.){3}\d{1,3}|localhost|[a-zA-Z0-9\.\-]+\.[a-zA-Z]+)(?::\d+)?)([\/\?#][\p{L}\p{N}\p{M}&\.-\/\?=#\-@%\+_,:!~*]*)?/gu},get cashu(){return/(?:cashu:\/{0,2})?(cashu(?:A|B)[A-Za-z0-9_-]{100,}={0,3})/gi},get nostrLink(){return/(?:nostr:)?((npub|note|nprofile|nevent|naddr)1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{58,})/gi},get emoji(){return/:([a-zA-Z0-9_-]+):/gi},get hashtag(){return/(?<=^|[^\p{L}#\/])#([\p{L}\p{N}\p{M}]+)(?=\p{Z}|$|\s)/gu},get lightning(){return/(?:lightning:)?(LNBC[A-Za-z0-9]+)/gim},get blossom(){return/blossom:([0-9a-f]{64})\.([a-zA-Z0-9]+)(\?[^\s]*)?/g}},Du={get url(){return Eu.url},get link(){return Eu.link},get cashu(){return RegExp(`(?<=^|\\s|\\s\\()${Eu.cashu.source}`,`gi`)},get nostrLink(){return RegExp(`(?<=^|\\s|\\s\\()${Eu.nostrLink.source}`,`gi`)},get emoji(){return Eu.emoji},get hashtag(){return Eu.hashtag},get lightning(){return RegExp(`(?<=^|\\s|\\s\\()${Eu.lightning.source}`,`gim`)},get blossom(){return RegExp(`(?<=^|\\s|\\s\\()${Eu.blossom.source}`,`g`)}};function Ou(e){let t=new URL(e);return t.pathname=t.pathname.replace(/\/+/g,`/`),(t.port===`80`&&(t.protocol===`ws:`||t.protocol===`http:`)||t.port===`443`&&(t.protocol===`wss:`||t.protocol===`https:`))&&(t.port=``),typeof e==`string`?t.toString():t}var ku=/^wss?:\/\/([-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}|localhost)\b([-a-zA-Z0-9()@:%_\+.~#?&\/\/=]*)$/;function Au(e){return e.length>=8&&ku.test(e)}function ju(e){return!e||e.length!==64?!1:!!e.toLowerCase().match(/^[0-9a-f]{64}$/)}function Mu(e){try{return wu(e)}catch{return null}}function Nu(e,t=!1){let n=e.split(`:`),r=n[0]?parseInt(n[0]):void 0,i=n[1];if(r===void 0||i===void 0||i===``||!ju(i))return null;let a=n.slice(2).join(`:`);return t&&a===``?null:{kind:r,pubkey:i,identifier:a}}function Pu(e){if(e)switch(e.type){case`naddr`:case`nprofile`:return e.data.pubkey;case`npub`:return e.data;case`nsec`:return vl(e.data);default:return}}function Fu(e){if(!e[1])return null;let t=Nu(e[1]);return t?(e[2]&&Au(e[2])&&(t.relays=[Ou(e[2])]),t):null}function Iu(e){return e.kind+`:`+e.pubkey+`:`+e.identifier}function Lu(e){let t=e.matchAll(Du.nostrLink),n=[];for(let[e,r]of t)try{let e=Mu(r);if(!e)continue;n.push(e)}catch{}return n}function Ru(e,t){return Gl([`e`,e.id,e.relays?.[0],t,e.author])}function zu(e){return Gl([`p`,e.pubkey,e.relays?.[0]])}function Bu(e){return Gl([`q`,e.id,e.relays?.[0],e.author])}function Vu(e,t){let n=e.find(e=>e[0]===`q`&&e[1]===t.id);if(n){let r=Gl([`q`,t.id,n[2]||t.relays?.[0],n[3]||t.author]);return e.map(e=>e===n?r:e)}return[...e,Bu(t)]}function Hu(e,t,n){let r=e.find(e=>e[0]===`e`&&e[1]===t.id&&(e[3]??``)===(n??``));if(r){let i=Gl([`e`,t.id,r[2]||t.relays?.[0],n,r[4]||t.author]);return e.map(e=>e===r?i:e)}return[...e,Ru(t,n)]}function Uu(e,t){let n=e.find(e=>e[0]===`p`&&e[1]===t.pubkey);if(n){let r=Gl([`p`,t.pubkey,n[2]||t.relays?.[0]]);return e.map(e=>e===n?r:e)}return[...e,zu(t)]}var Wu=wl,Gu=Dl,Ku=new Set([El(Ao,`nip04`)]);function qu(e,t){return Ku.add(El(e,t)),e}function Ju(e){return Ol(e)&&Ku.has(e)}function Yu(e){return Ju(e.kind)&&kl(e)}function Xu(e){return Ju(e.kind)?jl(e)&&Reflect.has(e,Wu)===!0:!1}function Zu(e){if(Ju(e.kind))return Wu in e?Reflect.get(e,Wu):Al(e)}async function Qu(e,t,n){if(!Ju(e.kind))throw Error(`Event kind does not support hidden content`);if(Wu in e)return Reflect.get(e,Wu);let r=await Dl(e.kind,t,n).decrypt(e.pubkey,e.content);return $u(e,r),r}function $u(e,t){if(!Ju(e.kind))throw Error(`Event kind does not support hidden content`);Ml(e,t)}var ed=10009,td=Symbol.for(`hidden-tags`),nd=new Set([qu(bo,`nip04`),qu(wo,`nip04`),qu(yo,`nip04`),qu(xo,`nip04`),qu(So,`nip04`),qu(Co,`nip04`),qu(ed,`nip04`),qu(Do,`nip04`),qu(Eo,`nip04`),qu(To,`nip04`),qu(Oo,`nip04`),qu(ko,`nip04`)]);function rd(e){return Ju(e)&&nd.has(e)}function id(e){return rd(e.kind)&&Yu(e)}function ad(e,t){return Gu(e,t)}function od(e){if(!rd(e.kind))return!1;try{return td in e||Xu(e)&&sd(e)!==void 0}catch{}return!1}function sd(e){if(!rd(e.kind))return;if(td in e)return e[td];let t=Zu(e);if(t===void 0)return;let n=JSON.parse(t);if(!Array.isArray(n))throw Error(`Content is not an array of tags`);let r=n.filter(e=>Array.isArray(e)).map(e=>e.map(e=>String(e)));return Reflect.set(e,td,r),r}async function cd(e,t,n){if(!rd(e.kind))throw Error(`Event kind does not support hidden tags`);if(od(e))return e[td];await Qu(e,t,n);let r=sd(e);if(r===void 0)throw Error(`Failed to unlock hidden tags`);return ld(e,r),r}function ld(e,t){if(!rd(e.kind))throw Error(`Event kind does not support hidden tags`);Reflect.set(e,td,t),$u(e,JSON.stringify(t))}function ud(e,t=!0,n){return r=>t?ql(r,e,!0,n):[...r,e]}function dd(e,t=!0){return n=>Kl(n,e,t)}function fd(e){return t=>t.filter(t=>t[0]!==e)}function pd(e,t=!0){return hd(dd(e,t))}function md(e,t=!0){return hd(ud(e,t))}function hd(...e){return async t=>({...t,tags:await Il(...e)(Array.from(t.tags))})}function gd(e,...t){return t=t.filter(e=>!!e),t.length===0?Ll():async n=>{if(!e)throw Error(`Missing signer for hidden tags`);if(!rd(n.kind))throw Error(`Event kind does not support hidden tags`);let r,i;if(id(n)?(i=sd(n),i===void 0&&(id(n)?(r=await e.getPublicKey(),i=await cd({...n,pubkey:r},e)):i=[])):i=[],i===void 0)throw Error(`Failed to find hidden tags`);let a=await Il(...t)(i),o=ad(n.kind,e);r||=await e.getPublicKey();let s=JSON.stringify(a),c=await o.encrypt(r,s);return{...n,content:c,[wl]:s}}}function _d(e,t){let n=[],r=[];return e===void 0?n=r=[]:Array.isArray(e)?n=e:typeof e==`function`?n=[e]:(typeof e.public==`function`?n=[e.public]:e.public&&(n=e.public),typeof e.hidden==`function`?r=[e.hidden]:e.hidden&&(r=e.hidden)),Fl(n.length>0?hd(...n):void 0,r.length>0?gd(t,...r):void 0)}function vd(e){return pd([`alt`,e])}function yd(e){return pd([`expiration`,e.toString()],!0)}function bd(e=!0){return hd(e?dd([`-`]):fd(`-`))}function xd(e){return Fl(e?.protected?bd(!0):Ll(),e?.expiration?yd(e.expiration):Ll(),e?.alt?vd(e.alt):Ll())}function Sd(e){return async t=>{if(!e)throw Error(`Missing signer`);Reflect.deleteProperty(t,`id`),Reflect.deleteProperty(t,`sig`);let n=await e.getPublicKey(),r={...t,pubkey:n};return Reflect.has(t,wl)&&Reflect.set(r,wl,Reflect.get(t,wl)),r}}function Cd(e){return async t=>{if(!e)throw Error(`Missing signer`);let n=await Sd(e)(t),r=await e.signEvent(n);if(Reflect.has(t,`pubkey`)&&Reflect.get(t,`pubkey`)!==r.pubkey)throw Error(`Signer modified pubkey`);if(!_o(r,t.kind))throw Error(`Signer modified event kind`);return Reflect.has(t,wl)&&Reflect.set(r,wl,Reflect.get(t,wl)),r}}function wd(e){return async t=>(t={...t,content:e},Reflect.deleteProperty(t,wl),t)}function Td(){return e=>({...e,content:e.content.replaceAll(/(?<=^|\s)(?:@)?((?:npub|note|nprofile|nevent|naddr)1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{58,})/gi,`nostr:$1`)})}function Ed(){return e=>{let t=Array.from(e.tags),n=Lu(e.content);for(let e of n){let n=Pu(e);n&&(t=Uu(t,e.type===`nprofile`?e.data:{pubkey:n}))}return{...e,tags:t}}}function Dd(e){return t=>{let n=Array.from(t.tags);return n=n.filter(e=>e[0]!==`content-warning`),typeof e==`string`?n.push([`content-warning`,e]):e===!0&&n.push([`content-warning`]),{...t,tags:n}}}function Od(){return e=>{let t=Array.from(e.tags),n=Lu(e.content);for(let e of n)switch(e.type){case`note`:t=Vu(t,{id:e.data});break;case`nevent`:t=Vu(t,e.data)}return{...e,tags:t}}}function kd(){return e=>{let t=Array.from(e.tags),n=e.content.matchAll(Eu.hashtag);for(let[e,r]of n){let e=r.toLocaleLowerCase();t=ql(t,[`t`,e])}return{...e,tags:t}}}function Ad(e=[]){return t=>{let n=Array.from(t.tags),r=t.content.matchAll(Eu.emoji);for(let[t,i]of r){let t=e.find(e=>e.shortcode===i);t?.url&&n.push(t.address?[`emoji`,t.shortcode,t.url,Iu(t.address)]:[`emoji`,t.shortcode,t.url])}return{...t,tags:n}}}function jd(e,t){return Fl(wd(e),Td(),Ed(),Od(),kd(),t?.emojis?Ad(t.emojis):Ll(),t?.contentWarning===void 0?Ll():Dd(t.contentWarning))}function Md(e){let t=go(e)?[[`d`,Hl()]]:[];return{kind:e,created_at:zl(),tags:t,content:``}}function Nd(e){return{kind:e.kind,created_at:zl(),tags:Array.from(e.tags),content:e.content}}var Pd=class e extends Promise{static fromKind(t){return new e(e=>e({kind:t,created_at:zl(),tags:[],content:``}))}static fromEvent(t){return new e(e=>e(Nd(t)))}_signerRef={};get signer(){return this._signerRef.signer}set signer(e){this._signerRef.signer=e}chain(e){let t=this.constructor,n=new t(t=>t(this.then(async t=>{let n=await e(t);for(let e of Reflect.ownKeys(n))typeof e==`symbol`&&!Nl.has(e)&&Reflect.deleteProperty(n,e);return n})));return n._signerRef=this._signerRef,n}as(e){return this._signerRef.signer=e,this}strip(){return new e(e=>e(this.then(e=>({content:e.content,tags:e.tags,created_at:e.created_at,kind:e.kind}))))}stamp(t=this.signer){return new e((e,n)=>{if(t)e(this.then(e=>Sd(t)(e)));else return n(Error(`Signer required for stamping`))})}async sign(e=this.signer){if(!e)throw Error(`Missing signer`);this.signer||=e;let t=await this,n=await Cd(e)(t);if(Reflect.has(t,`pubkey`)&&Reflect.get(t,`pubkey`)!==n.pubkey)throw Error(`Signer modified pubkey`);if(_o(n,t.kind))return n;throw Error(`Signer modified event kind`)}kind(t){return new e(e=>({...e,kind:t}))}content(e){return this.chain(t=>({...t,content:e}))}created(e=zl()){return e instanceof Date&&(e=Math.floor(e.getTime()/1e3)),this.chain(t=>({...t,created_at:e}))}meta(e){return this.chain(xd(e))}alt(e){return this.chain(vd(e))}expiration(e){return this.chain(yd(e))}contentWarning(e){return this.chain(Dd(e))}protected(e){return this.chain(bd(e))}modifyTags(...e){let t;return t=this.chain(n=>_d(e[0],t.signer)(n)),t}modifyPublicTags(...e){return this.chain(hd(...e))}modifyHiddenTags(...e){let t;return t=this.chain(n=>gd(t.signer,...e)(n)),t}encryptedContent(e,t,n){let r;return r=this.chain(i=>{let a=r.signer;if(!a)throw Error(`Signer required for encrypted content`);return Bl(e,t,a,n)(i)}),r}},Fd=Symbol.for(`nip10-thread-refs`);function Id(e){if(!e[1])throw Error(`Missing event id in tag`);let t={id:e[1]};return e[2]&&Au(e[2])&&(t.relays=[e[2]]),e[0]===`e`&&(e[3]===`root`||e[3]===`reply`||e[3]===`mention`)&&e[4]&&e[4].length===64&&(t.author=e[4]),t}function Ld(e){let t=e.filter(e=>e[0]===`e`&&e[1]),n=e.filter(e=>e[0]===`a`&&e[1]),r=t.find(e=>e[3]===`root`),i=t.find(e=>e[3]===`reply`),a=n.find(e=>e[3]===`root`),o=n.find(e=>e[3]===`reply`);if((!r||!i)&&(r=i=r||i),(!a||!o)&&(a=o=a||o),!r&&!i){let e=t.filter(e=>!e[3]);e.length>=1&&(r=e[0],i=e[e.length-1]??r)}return{root:r||a?{e:r,a}:void 0,reply:i||o?{e:i,a:o}:void 0}}function Rd(e){return yl(e,Fd,()=>{let t=Ld(e.tags),n;if(t.root)try{n={e:t.root.e&&Id(t.root.e),a:t.root.a&&Fu(t.root.a)}}catch{}let r;if(t.reply)try{r={e:t.reply.e&&Id(t.reply.e),a:t.reply.a&&Fu(t.reply.a)}}catch{}return{root:n,reply:r}})}function zd(e,t){if(e.kind!==1)throw Error(`Parent must be a short text note`);return async n=>{let r=Array.from(n.tags),i={id:e.id,author:e.pubkey,kind:e.kind};if(t){let n=await t(e.id);n&&(i.relays=[n])}let a=Rd(e).root?.e??i,o=i;return r=Hu(r,a,`root`),r=Hu(r,o,`reply`),{...n,tags:r}}}function Bd(e,t){return async n=>{let r=Array.from(n.tags);for(let t of e.tags)Wl(t)&&t[3]!==`mention`&&r.push(t);let i=t?await t(e.pubkey):void 0;return r=Uu(r,{pubkey:e.pubkey,relays:i?[i]:void 0}),{...n,tags:r}}}function Vd(e){return hd(ud([`t`,(e.startsWith(`#`)?e.slice(1):e).toLocaleLowerCase()],!0))}function Hd(e){return hd(...e.map(e=>ud([`t`,e.toLocaleLowerCase()])))}function Ud(e,t){return async n=>{let r=Array.from(n.tags);r=r.filter(e=>e[0]!==`zap`);for(let n of e){let e=t?await t(n.pubkey):void 0;r.push(Gl([`zap`,n.pubkey,e,String(n.weight)]))}return{...n,tags:r}}}function Wd(e,t){return e?.splits?Ud(e.splits,t):Ll()}var Gd=class e extends Pd{static create(t,n){let r=new e(e=>e(Md(1)));return r=t?r.text(t,n):r,n&&(r=r.meta(n).zapSplit(n)),r}static reply(t,n,r){if(!_o(t,1))throw Error(`Kind 1 replies should only be used to reply to kind 1 notes`);let i=new e(e=>e(Md(1))).replyTo(t);return i=n?i.text(n,r):i,r&&(i=i.meta(r).zapSplit(r)),i}replyTo(e){return this.chain(Rl([zd(e,void 0),Bd(e,void 0)]))}text(e,t){return this.chain(jd(e,t))}mention(e){let t=typeof e==`string`?{pubkey:e}:e;return this.modifyPublicTags(e=>Uu(e,t))}subject(e){return this.chain(md([`subject`,e]))}addHashtag(e){return this.chain(Vd(e))}hashtags(e){return this.chain(Hd(e))}zapSplit(e){return this.chain(Wd(e,void 0))}},Kd=`good-morning`,qd=[`client`,`@napplelets/good-morning`];function Jd(e){return uo({target:{type:`event`,id:e.id,kind:e.kind,pubkey:e.pubkey},behavior:{focus:!0},source:{napplet:Kd}})}function Yd(e){let t=e.trim().replace(/^nostr:/i,``);if(!t)return null;try{let e=Ce(t);if(e.type===`note`)return uo({target:{type:`event`,id:e.data,nip19:t},behavior:{focus:!0},source:{napplet:Kd}});if(e.type===`nevent`){let n=e.data;return uo({target:{type:`event`,id:n.id,...typeof n.kind==`number`?{kind:n.kind}:{},...typeof n.author==`string`?{pubkey:n.author}:{},nip19:t},...Array.isArray(n.relays)?{relays:n.relays}:{},behavior:{focus:!0},source:{napplet:Kd}})}if(e.type===`naddr`){let n=e.data;return uo({target:{type:`address`,kind:n.kind,pubkey:n.pubkey,identifier:n.identifier,nip19:t},...Array.isArray(n.relays)?{relays:n.relays}:{},behavior:{focus:!0},source:{napplet:Kd}})}}catch{return null}return null}async function Xd(e){let t=await Gd.reply(e,`GM`);return{...t,tags:[...t.tags,[...qd]]}}async function Zd(e){let t=await Xd(e);return Pe.publish(t)}function Qd(e){return{source:{napplet:Kd},intent:`reply`,replyTo:{id:e.id,pubkey:e.pubkey,kind:e.kind,...typeof e.content==`string`?{content:e.content}:{},...typeof e.created_at==`number`?{created_at:e.created_at}:{}}}}var $d=`note`,ef=`profile`,tf=`composer`,nf=`napplet:note/open`,rf=`napplet:profile/open`,af=`napplet:composer/open`;function of(e){return new Set(e.filter(e=>e.available).map(e=>e.archetype))}async function sf(){if(!to(`intent`))return new Set;try{return of(await Fe.handlers())}catch{return new Set}}function cf(e){if(!to(`intent`))return null;try{return Fe.onChanged(e)}catch{return null}}async function lf(e,t){if(!to(`intent`))return!1;try{return(await Fe.open(e,{payload:t,behavior:{focus:!0,reuse:!0}})).ok}catch{return!1}}function uf(e){return lf(nf,e)}function df(e){return lf(rf,{pubkey:e})}function ff(e){return lf(af,e)}var pf=/\b(?:nostr:)?((?:npub|nprofile|note|nevent|naddr)1[023456789acdefghjklmnpqrstuvwxyz]+)\b/gi,mf=/\bhttps?:\/\/[^\s<>"']+/gi,hf=/\bblossom:sha256:[0-9a-f]{64}\b/gi,gf=/:([A-Za-z0-9_-]+):/g,_f=/^[A-Za-z0-9_-]+$/,vf=/\.(?:png|jpe?g|gif|webp|avif)(?:[?#].*)?$/i,yf=/\.(?:mp4|webm|mov|m4v)(?:[?#].*)?$/i;function bf(e,t=[]){let n=Sf(e,t),r=[],i=0;for(let t of n)t.start<i||(t.start>i&&r.push({type:`text`,value:e.slice(i,t.start)}),r.push(t.block),i=t.end);return i<e.length&&r.push({type:`text`,value:e.slice(i)}),r}function xf(e,t=6,n={}){let r=n.includeProfiles??!0,i=n.includeEvents??!0,a=n.includeAddresses??!0,o=n.includeImageUrls??!0,s=n.includeVideoUrls??!0,c=n.includeResources??!0,l=[],u=new Set;for(let n of bf(e)){if(n.type===`text`||n.type===`url`||n.type===`emoji`||n.type===`profile`&&!r||n.type===`event`&&!i||n.type===`address`&&!a||n.type===`resource`&&!c||n.type===`media`&&n.mediaType===`image`&&!o||n.type===`media`&&n.mediaType===`video`&&!s)continue;let e=`${n.type}:${n.value}`;u.has(e)||l.length>=t||(u.add(e),l.push(n))}return l}function Sf(e,t){let n=[],r=Cf(t);for(let t of e.matchAll(gf)){let e=t[1],i=e?r.get(e):void 0;if(!e||!i)continue;let a=t[0],o=t.index??0;n.push({start:o,end:o+a.length,block:{type:`emoji`,value:e,source:a,imageUrl:i}})}for(let t of e.matchAll(pf)){let e=t[1];if(!e)continue;let r=wf(e,t[0].startsWith(`nostr:`)?t[0]:`nostr:${e}`);if(r){let e=t.index??0;n.push({start:e,end:e+t[0].length,block:r})}}for(let t of e.matchAll(mf)){let e=t[0].replace(/[),.;!?]+$/g,``),r=t.index??0;n.push({start:r,end:r+e.length,block:Tf(e)??{type:`url`,value:e,source:e}})}for(let t of e.matchAll(hf)){let e=t[0].toLowerCase(),r=t.index??0;n.push({start:r,end:r+t[0].length,block:{type:`resource`,mediaType:`image`,value:e,source:e}})}return n.sort((e,t)=>e.start-t.start||t.end-t.start-(e.end-e.start))}function Cf(e){let t=new Map;for(let n of e){let e=n[1],r=n[2];n[0]===`emoji`&&typeof e==`string`&&typeof r==`string`&&_f.test(e)&&t.set(e,r)}return t}function wf(e,t){try{let n=Ce(e);return n.type===`npub`?{type:`profile`,value:n.data,source:t}:n.type===`note`?{type:`event`,value:n.data,source:t}:n.type===`nprofile`?{type:`profile`,value:n.data.pubkey,source:t}:n.type===`nevent`?{type:`event`,value:n.data.id,source:t}:n.type===`naddr`?{type:`address`,value:`${n.data.kind}:${n.data.pubkey}:${n.data.identifier}`,source:t}:null}catch{return null}}function Tf(e){return vf.test(e)?{type:`media`,mediaType:`image`,value:e,source:e}:yf.test(e)?{type:`media`,mediaType:`video`,value:e,source:e}:null}async function Ef(e){if(!to(`link`))return!1;try{return(await Ie.open(e)).status===`opened`}catch{return!1}}var Df=G(`<button type="button" class="gm-inline-link svelte-oqbg4h"> </button>`),Of=G(`<a class="gm-inline-link svelte-oqbg4h"> </a>`),kf=G(`<span class="gm-inline-resource svelte-oqbg4h"><img alt="Good morning media" loading="lazy" class="svelte-oqbg4h"/></span>`),Af=G(`<span class="text-text-muted">[media unavailable]</span>`),jf=G(`<span class="gm-inline-resource svelte-oqbg4h"><video controls="" preload="auto" class="svelte-oqbg4h"></video></span>`,2),Mf=G(`<span class="gm-inline-resource svelte-oqbg4h"><img alt="GM attachment" loading="lazy" class="svelte-oqbg4h"/></span>`),Nf=G(`<span class="text-text-muted">[attachment unavailable]</span>`),Pf=G(`<img class="gm-inline-emoji svelte-oqbg4h" loading="lazy"/>`),Ff=G(`<span class="gm-note-content svelte-oqbg4h"></span>`);function If(e,t){on(t,!0);let n=_a(t,`emojiTags`,19,()=>[]),r=P(()=>t.availableArchetypes.has($d)),i=P(()=>t.availableArchetypes.has(ef)),a=to(`resource`),o=P(()=>bf(t.content,n()));function s(e){Xa(e)&&df(e)}function c(e,t){e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),Ef(t))}function l(e){let t=Yd(e);t&&uf(t)}var u=Ff();Ji(u,23,()=>W(o),(e,t)=>`${t}:${e.type}:${e.value}`,(e,n)=>{var o=Fi(),u=pr(o),d=e=>{var t=Pi();V(()=>q(t,W(n).value)),K(e,t)},f=e=>{var r=Df(),i=z(r);V(e=>q(i,`@${e??``}`),[()=>t.profileLabel?.(W(n).value)??W(n).source.replace(/^nostr:/,``).slice(0,16)]),Ti(`click`,r,()=>s(W(n).value)),K(e,r)},p=e=>{var t=Df(),r=z(t);V(e=>q(r,`${e??``}...`),[()=>W(n).source.replace(/^nostr:/,``).slice(0,24)]),Ti(`click`,t,()=>l(W(n).source)),K(e,t)},m=e=>{var t=Of(),r=z(t,!0);V(()=>{Y(t,`href`,W(n).value),q(r,W(n).value)}),Ti(`click`,t,e=>c(e,W(n).value)),K(e,t)},h=e=>{var t=Fi(),r=pr(t),i=e=>{var t=kf(),r=R(t);ea(r,(e,t)=>so?.(e,t),()=>W(n).value),j(t),wi(r),K(e,t)},o=e=>{K(e,Af())};J(r,e=>{a?e(i):e(o,-1)}),K(e,t)},g=e=>{var t=Fi(),r=pr(t),i=e=>{var t=jf();ea(R(t),(e,t)=>co?.(e,t),()=>W(n).value),j(t),K(e,t)},o=e=>{K(e,Af())};J(r,e=>{a?e(i):e(o,-1)}),K(e,t)},_=e=>{var t=Fi(),r=pr(t),i=e=>{var t=Mf(),r=R(t);ea(r,(e,t)=>so?.(e,t),()=>W(n).source),j(t),wi(r),K(e,t)},o=e=>{K(e,Nf())};J(r,e=>{a?e(i):e(o,-1)}),K(e,t)},v=e=>{var t=Fi(),r=pr(t),i=e=>{var t=Pf();ea(t,(e,t)=>so?.(e,t),()=>W(n).imageUrl),V(()=>Y(t,`alt`,W(n).source)),wi(t),K(e,t)},o=e=>{var t=Pi();V(()=>q(t,W(n).source)),K(e,t)};J(r,e=>{a?e(i):e(o,-1)}),K(e,t)},y=e=>{var t=Pi();V(()=>q(t,W(n).source)),K(e,t)};J(u,e=>{W(n).type===`text`?e(d):W(n).type===`profile`&&W(i)?e(f,1):(W(n).type===`event`||W(n).type===`address`)&&W(r)?e(p,2):W(n).type===`url`?e(m,3):W(n).type===`media`&&W(n).mediaType===`image`?e(h,4):W(n).type===`media`&&W(n).mediaType===`video`?e(g,5):W(n).type===`resource`?e(_,6):W(n).type===`emoji`?e(v,7):e(y,-1)}),K(e,o)}),j(u),K(e,u),sn()}Ei([`click`]);var Lf=G(`<img class="w-full h-full object-cover" loading="lazy"/>`),Rf=G(`<span class="text-text-muted text-xs font-mono"> </span>`),zf=G(`<button type="button" class="w-8 h-8 rounded-full overflow-hidden cursor-pointer bg-bg-surface border border-border-dim flex items-center justify-center"><!></button>`),Bf=G(`<div class="w-8 h-8 rounded-full overflow-hidden bg-bg-surface border border-border-dim flex items-center justify-center"><span class="text-text-muted text-xs font-mono"> </span></div>`),Vf=G(`<span class="gm-check mt-2 w-7 h-7 rounded-full bg-accent-green text-bg-base flex items-center justify-center" title="You replied with a GM" aria-label="Responded with a GM"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg></span>`),Hf=G(`<button type="button" class="text-sm font-semibold font-mono truncate hover:underline cursor-pointer bg-transparent border-none p-0"> </button>`),Uf=G(`<span class="text-sm font-semibold font-mono truncate"> </span>`),Wf=G(`<button type="button" class="gm-action svelte-foj49s" data-gm-action="open">Open</button>`),Gf=G(`<button type="button" class="gm-action svelte-foj49s" data-gm-action="reply">GM Reply</button>`),Kf=G(`<div><div class="flex flex-col items-center flex-shrink-0"><!> <div class="flex-1"></div> <!></div> <div class="flex-1 min-w-0"><div class="flex items-baseline gap-2 mb-1"><!> <span class="text-text-muted text-xs flex-shrink-0"> </span></div> <div class="text-text-primary text-sm leading-relaxed break-words"><!></div> <div class="flex flex-wrap gap-2 mt-2"><!> <button type="button" class="gm-action gm-action-primary svelte-foj49s" data-gm-action="quick-gm"> </button> <!></div></div></div>`);function qf(e,t){on(t,!0);let n=P(()=>t.availableArchetypes.has($d)),r=P(()=>t.availableArchetypes.has(ef)),i=P(()=>t.availableArchetypes.has(tf)),a=to(`resource`),o=I(`idle`);function s(e){try{return Te(e).slice(0,16)+`...`}catch{return e.slice(0,12)+`...`}}let c=P(()=>t.profile?.display_name??t.profile?.name??s(t.event.pubkey)),l=P(()=>t.profile?.picture??null),u=P(()=>(t.profile?.name??t.profile?.display_name??``).slice(0,2).toUpperCase()||t.event.pubkey.slice(0,2).toUpperCase()),d=P(()=>Ja(t.event.created_at*1e3));function f(){let e=Jd(t.event);e&&uf(e)}async function p(){if(!(W(o)===`sending`||t.isRead)){L(o,`sending`);try{await Zd(t.event),L(o,`sent`)}catch(e){console.error(`[good-morning] Quick GM publish failed:`,e),L(o,`error`)}}}function m(){ff(Qd(t.event))}function h(){Xa(t.event.pubkey)&&df(t.event.pubkey)}function g(e){let n=t.profiles.get(e);return n?.display_name??n?.name??s(e)}let _=P(()=>W(o)===`sending`||t.isRead),v=P(()=>W(o)===`sending`?`sending…`:t.isRead||W(o)===`sent`?`GM sent ✓`:W(o)===`error`?`retry GM`:`Quick GM`);var y=Kf(),b=R(y),x=R(b),S=e=>{var t=zf(),n=R(t),r=e=>{var t=Lf();ea(t,(e,t)=>so?.(e,t),()=>W(l)),V(()=>Y(t,`alt`,W(c))),wi(t),K(e,t)},i=e=>{var t=Rf(),n=z(t,!0);V(()=>q(n,W(u))),K(e,t)};J(n,e=>{a&&W(l)!=null?e(r):e(i,-1)}),j(t),V(()=>Y(t,`aria-label`,`Open profile for ${W(c)??``}`)),Ti(`click`,t,h),K(e,t)},C=e=>{var t=Bf(),n=z(R(t),!0);j(t),V(()=>q(n,W(u))),K(e,t)};J(x,e=>{W(r)?e(S):e(C,-1)});var ee=B(x,4),te=e=>{K(e,Vf())};J(ee,e=>{t.isRead&&e(te)}),j(b);var w=B(b,2),ne=R(w),re=R(ne),T=e=>{var n=Hf(),r=z(n,!0);V(e=>{ca(n,e),Y(n,`data-gm-author-pubkey`,t.event.pubkey),q(r,W(c))},[()=>eo(t.event.pubkey)]),Ti(`click`,n,h),K(e,n)},E=e=>{var n=Uf(),r=z(n,!0);V(e=>{ca(n,e),q(r,W(c))},[()=>eo(t.event.pubkey)]),K(e,n)};J(re,e=>{W(r)?e(T):e(E,-1)});var D=z(B(re,2),!0);j(ne);var ie=B(ne,2);If(R(ie),{get content(){return t.event.content},get emojiTags(){return t.event.tags},profileLabel:g,get availableArchetypes(){return t.availableArchetypes}}),j(ie);var ae=B(ie,2),oe=R(ae),se=e=>{var t=Wf();Ti(`click`,t,f),K(e,t)};J(oe,e=>{W(n)&&e(se)});var ce=B(oe,2),le=z(ce,!0),ue=B(ce,2),de=e=>{var t=Gf();Ti(`click`,t,m),K(e,t)};J(ue,e=>{W(i)&&e(de)}),j(ae),j(w),j(y),V(()=>{oa(y,1,`gm-row flex gap-2 p-2 border-b border-border-dim transition-colors ${t.isRead?`opacity-80`:`bg-accent-green/5`}`),Y(y,`data-gm-note-id`,t.event.id),Y(y,`data-gm-is-read`,t.isRead),q(D,W(d)),ce.disabled=W(_),Y(ce,`data-gm-quick-state`,W(o)),q(le,W(v))}),Ti(`click`,ce,p),K(e,y),sn()}Ei([`click`]);function Jf(e){let t=xf(e,1,{includeProfiles:!1,includeEvents:!1,includeAddresses:!1,includeImageUrls:!0,includeVideoUrls:!1,includeResources:!0})[0];return t?t.source:null}function Yf(e){let t=[];for(let n of e){let e=Jf(n.content);e&&t.push({note:n,imageSource:e})}return t}var Xf=G(`<div class="p-4 text-text-muted font-mono text-sm">no GM images to show today</div>`),Zf=G(`<img loading="lazy" class="svelte-1cxt3ee"/>`),Qf=G(`<span class="gm-tile-unavailable svelte-1cxt3ee">media unavailable</span>`),$f=G(`<span class="gm-tile-avatar-fallback svelte-1cxt3ee"> </span>`),ep=G(`<span class="gm-tile-check svelte-1cxt3ee" title="You replied with a GM" aria-label="Responded with a GM"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg></span>`),tp=G(`<button type="button" class="gm-tile-image svelte-1cxt3ee" aria-label="Open GM note"><!> <span class="gm-tile-avatar svelte-1cxt3ee"><!></span> <!></button>`),np=G(`<div class="gm-tile-image svelte-1cxt3ee"><!></div>`),rp=G(`<figure class="gm-tile svelte-1cxt3ee"><!> <figcaption class="gm-tile-caption svelte-1cxt3ee"> </figcaption></figure>`),ip=G(`<div class="gm-gallery svelte-1cxt3ee"></div>`);function ap(e,t){on(t,!0);let n=P(()=>t.availableArchetypes.has($d)),r=to(`resource`),i=P(()=>Yf(t.threads.map(e=>e.note))),a=P(()=>new Map(t.threads.map(e=>[e.note.id,e.isRead])));function o(e){try{return Te(e).slice(0,16)+`...`}catch{return e.slice(0,12)+`...`}}function s(e){let n=t.profiles.get(e);return n?.display_name??n?.name??o(e)}function c(e){return t.profiles.get(e)?.picture??null}function l(e){let n=t.profiles.get(e);return(n?.name??n?.display_name??``).slice(0,2).toUpperCase()||e.slice(0,2).toUpperCase()}function u(e){let t=Jd(e);t&&uf(t)}var d=Fi(),f=pr(d),p=e=>{K(e,Xf())},m=e=>{var t=ip();Ji(t,21,()=>W(i),e=>e.note.id,(e,t)=>{var i=rp(),o=R(i),d=e=>{var n=tp(),i=R(n),o=e=>{var n=Zf();ea(n,(e,t)=>so?.(e,t),()=>W(t).imageSource),V(()=>Y(n,`alt`,W(t).note.content)),wi(n),K(e,n)},d=e=>{K(e,Qf())};J(i,e=>{r?e(o):e(d,-1)});var f=B(i,2),p=R(f),m=e=>{var n=Zf();ea(n,(e,t)=>so?.(e,t),()=>c(W(t).note.pubkey)),V(e=>Y(n,`alt`,e),[()=>s(W(t).note.pubkey)]),wi(n),K(e,n)},h=P(()=>r&&c(W(t).note.pubkey)!=null),g=e=>{var n=$f(),r=z(n,!0);V(e=>q(r,e),[()=>l(W(t).note.pubkey)]),K(e,n)};J(p,e=>{W(h)?e(m):e(g,-1)}),j(f);var _=B(f,2),v=e=>{K(e,ep())},y=P(()=>W(a).get(W(t).note.id));J(_,e=>{W(y)&&e(v)}),j(n),V(e=>{Y(n,`data-gm-note-id`,W(t).note.id),Y(f,`title`,e),Y(f,`data-gm-author-pubkey`,W(t).note.pubkey)},[()=>s(W(t).note.pubkey)]),Ti(`click`,n,()=>u(W(t).note)),K(e,n)},f=e=>{var n=np(),i=R(n),a=e=>{var n=Zf();ea(n,(e,t)=>so?.(e,t),()=>W(t).imageSource),V(()=>Y(n,`alt`,W(t).note.content)),wi(n),K(e,n)},o=e=>{K(e,Qf())};J(i,e=>{r?e(a):e(o,-1)}),j(n),V(()=>Y(n,`data-gm-note-id`,W(t).note.id)),K(e,n)};J(o,e=>{W(n)?e(d):e(f,-1)});var p=B(o,2),m=z(p,!0);j(i),V(()=>{Y(p,`title`,W(t).note.content),q(m,W(t).note.content)}),K(e,i)}),j(t),K(e,t)};J(f,e=>{W(i).length===0?e(p):e(m,-1)}),K(e,d),sn()}Ei([`click`]);var op=G(`<button type="button" role="radio"> </button>`),sp=G(`<button type="button" role="radio"> <span class="gm-filter-count svelte-1midz0k"> </span></button>`),cp=G(`<div class="p-4 text-text-muted font-mono text-sm animate-pulse">loading contacts…</div>`),lp=G(`<div class="p-4 text-text-muted font-mono text-sm animate-pulse">scanning for GMs…</div>`),up=G(`<div class="p-4 text-text-muted font-mono text-sm">no GMs from your contacts today</div>`),dp=G(`<div class="p-4 text-text-muted font-mono text-sm"> </div>`),fp=G(`<div class="gm-inbox flex flex-col h-full bg-bg-base"><div class="flex items-center gap-2 px-3 py-2 border-b border-border-dim flex-shrink-0"><span class="text-sm font-semibold font-mono text-accent-green">GM</span> <span class="text-text-muted text-xs"> </span> <div class="flex-1"></div> <div class="gm-filter flex svelte-1midz0k" role="radiogroup" aria-label="View mode"></div> <div class="gm-filter flex svelte-1midz0k" role="radiogroup" aria-label="Filter GMs"></div></div> <div class="flex-1 overflow-y-auto"><!></div></div>`);function pp(e,t){on(t,!0);let n=I(ir(new Map)),r=I(ir(new Map)),i=I(0),a=I(!1),o=I(!1),s=I(ir(new Set));function c(){let e=l.state;L(n,new Map(e.gmNotes),!0),L(r,new Map(e.userReplies),!0),L(i,e.contactCount,!0),L(a,e.contactsLoaded,!0),L(o,e.scanning,!0),ee([...e.gmNotes.values()])}let l=Ma(c),u=P(()=>ja(W(n),W(r))),d=P(()=>W(u).filter(e=>!e.isRead).length),f=P(()=>W(u).length-W(d)),p=I(`all`),m=[{id:`all`,label:`All`},{id:`unreplied`,label:`Unreplied`},{id:`replied`,label:`Replied`}];function h(e){return e===`replied`?W(f):e===`unreplied`?W(d):W(u).length}let g=P(()=>W(p)===`all`?W(u):W(p)===`replied`?W(u).filter(e=>e.isRead):W(u).filter(e=>!e.isRead)),_=I(`list`),v=[{id:`list`,label:`List`},{id:`gallery`,label:`Gallery`}],y=I(ir(new Map)),b=new Set,x=new Set,S=new Set,C=null;function ee(e){let t=e.map(e=>e.pubkey).filter(e=>e.length>0&&!b.has(e)&&!W(y).has(e));if(t.length!==0){for(let e of t)S.add(e);C===null&&(C=setTimeout(()=>{C=null,te()},250))}}function te(){let e=[...S].filter(e=>!b.has(e)&&!W(y).has(e));if(S.clear(),e.length!==0){for(let t of e)b.add(t);try{let t=Ia(e,(e,t)=>{L(y,new Map(W(y)).set(e,t),!0),b.delete(e)});x.add(t)}catch{for(let t of e)b.delete(t)}}}Tr(()=>{l.setPubkey(t.pubkey)}),va(()=>{let e=null;return sf().then(e=>{L(s,e,!0)}),e=cf(e=>{let t=new Set(W(s));e.available?t.add(e.archetype):t.delete(e.archetype),L(s,t,!0)}),()=>{C!==null&&(clearTimeout(C),C=null);for(let e of x)e.close();x.clear(),l.destroy(),e?.close()}});var w=fp(),ne=R(w),re=B(R(ne),2),T=z(re),E=B(re,4);Ji(E,21,()=>v,e=>e.id,(e,t)=>{var n=op(),r=z(n,!0);V(()=>{Y(n,`aria-checked`,W(_)===W(t).id),oa(n,1,`gm-filter-btn ${W(_)===W(t).id?`is-active`:``}`,`svelte-1midz0k`),Y(n,`data-gm-view-option`,W(t).id),q(r,W(t).label)}),Ti(`click`,n,()=>L(_,W(t).id,!0)),K(e,n)}),j(E);var D=B(E,2);Ji(D,21,()=>m,e=>e.id,(e,t)=>{var n=sp(),r=R(n),i=z(B(r),!0);j(n),V(e=>{Y(n,`aria-checked`,W(p)===W(t).id),oa(n,1,`gm-filter-btn ${W(p)===W(t).id?`is-active`:``}`,`svelte-1midz0k`),Y(n,`data-gm-filter-option`,W(t).id),q(r,`${W(t).label??``} `),q(i,e)},[()=>h(W(t).id)]),Ti(`click`,n,()=>L(p,W(t).id,!0)),K(e,n)}),j(D),j(ne);var ie=B(ne,2),ae=R(ie),oe=e=>{K(e,cp())},se=e=>{K(e,lp())},ce=e=>{K(e,up())},le=e=>{var t=dp(),n=z(t,!0);V(()=>q(n,W(p)===`replied`?`no replied GMs yet`:`no unreplied GMs — all caught up`)),K(e,t)},ue=e=>{ap(e,{get threads(){return W(g)},get profiles(){return W(y)},get availableArchetypes(){return W(s)}})},de=e=>{var t=Fi();Ji(pr(t),17,()=>W(g),e=>e.note.id,(e,t)=>{{let n=P(()=>W(y).get(W(t).note.pubkey));qf(e,{get event(){return W(t).note},get isRead(){return W(t).isRead},get profile(){return W(n)},get profiles(){return W(y)},get availableArchetypes(){return W(s)}})}}),K(e,t)};J(ae,e=>{W(a)?W(u).length===0&&W(o)?e(se,1):W(u).length===0?e(ce,2):W(g).length===0?e(le,3):W(_)===`gallery`?e(ue,4):e(de,-1):e(oe)}),j(ie),j(w),V(()=>{Y(w,`data-gm-contact-count`,W(i)),Y(w,`data-gm-pending`,W(d)),Y(w,`data-gm-thread-count`,W(u).length),Y(w,`data-gm-filter`,W(p)),Y(w,`data-gm-view`,W(_)),Y(w,`data-gm-visible-count`,W(g).length),q(T,`${W(i)??``} contacts`)}),K(e,w),sn()}Ei([`click`]);var mp=G(`<div class="gm-nap-banner flex items-center gap-2 px-3 py-2 border-b border-border-dim bg-accent-amber/10 text-xs font-mono flex-shrink-0" role="status" data-gm-nap-banner=""><span class="text-accent-amber font-semibold flex-shrink-0">⚠ limited runtime</span> <span class="text-text-secondary truncate"> </span> <div class="flex-1"></div> <button type="button" class="gm-nap-dismiss text-text-muted hover:text-text-primary flex-shrink-0" aria-label="Dismiss runtime warning">dismiss</button></div>`),hp=G(`<li class="border border-accent-red/40 rounded p-3 bg-accent-red/5" data-gm-nap-severity="essential"><div class="flex items-center gap-2 mb-1"><span class="text-[10px] uppercase tracking-wide text-accent-red border border-accent-red/50 rounded px-1.5 py-0.5">required</span> <code class="text-sm text-text-primary font-semibold"> </code></div> <p class="text-text-secondary text-xs leading-relaxed"> </p></li>`),gp=G(`<li class="border border-border-dim rounded p-3" data-gm-nap-severity="degraded"><div class="flex items-center gap-2 mb-1"><span class="text-[10px] uppercase tracking-wide text-accent-amber border border-accent-amber/50 rounded px-1.5 py-0.5">optional</span> <code class="text-sm text-text-primary font-semibold"> </code></div> <p class="text-text-secondary text-xs leading-relaxed"> </p></li>`),_p=G(`<details class="mt-4" data-gm-degraded-details=""><summary class="text-text-muted text-xs cursor-pointer hover:text-text-primary"> </summary> <ul class="flex flex-col gap-2 mt-2"></ul></details>`),vp=G(`<div class="gm-nap-screen h-full w-full overflow-y-auto bg-bg-base text-text-primary font-mono" role="alert" data-gm-nap-screen=""><div class="max-w-lg mx-auto px-5 py-8"><div class="text-accent-red text-sm font-semibold mb-1">⛔ Runtime missing NAP APIs</div> <h1 class="text-lg font-semibold mb-2">good-morning can't start here</h1> <p class="text-text-secondary text-sm leading-relaxed mb-2">This napplet needs host capabilities (NAPs) that the current runtime does not expose. It's a
        debugging napplet, so instead of failing silently it lists exactly what's missing.</p> <div class="text-text-muted text-xs uppercase tracking-wide mt-4 mb-2">Required — missing</div> <ul class="flex flex-col gap-2"></ul> <!></div></div>`);function yp(e,t){on(t,!0);let n=_a(t,`variant`,3,`screen`),r=I(!1),i=P(()=>t.report.missingEssential),a=P(()=>t.report.missingDegraded),o=P(()=>W(a).map(e=>e.label).join(`, `));var s=Fi(),c=pr(s),l=e=>{var t=Fi(),n=pr(t),i=e=>{var t=mp(),n=B(R(t),2),i=z(n),s=B(n,4);j(t),V(()=>{Y(t,`data-gm-missing-degraded`,W(a).length),q(i,`${W(o)??``} unavailable — ${W(a).length===1?`that feature is`:`those features are`}
        degraded.`)}),Ti(`click`,s,()=>L(r,!0)),K(e,t)};J(n,e=>{W(r)||e(i)}),K(e,t)},u=e=>{var t=vp(),n=R(t),r=B(R(n),8);Ji(r,21,()=>W(i),e=>e.domain,(e,t)=>{var n=hp(),r=R(n),i=z(B(R(r),2),!0);j(r);var a=z(B(r,2),!0);j(n),V(()=>{Y(n,`data-gm-missing-nap`,W(t).domain),q(i,W(t).label),q(a,W(t).purpose)}),K(e,n)}),j(r);var o=B(r,2),s=e=>{var t=_p(),n=R(t),r=z(n),i=B(n,2);Ji(i,21,()=>W(a),e=>e.domain,(e,t)=>{var n=gp(),r=R(n),i=z(B(R(r),2),!0);j(r);var a=z(B(r,2),!0);j(n),V(()=>{Y(n,`data-gm-missing-nap`,W(t).domain),q(i,W(t).label),q(a,W(t).purpose)}),K(e,n)}),j(i),j(t),V(()=>q(r,`${W(a).length??``} optional NAP${W(a).length===1?``:`s`} also unavailable`)),K(e,t)};J(o,e=>{W(a).length>0&&e(s)}),j(n),j(t),V(()=>Y(t,`data-gm-missing-essential`,W(i).length)),K(e,t)};J(c,e=>{n()===`banner`?e(l):e(u,-1)}),K(e,s),sn()}Ei([`click`]);var bp=[{domain:i,label:`NAP-IDENTITY`,purpose:`Reads your public key and follow list (kind 3) so the inbox knows whose GMs to load.`,severity:`essential`},{domain:u,label:`NAP-OUTBOX`,purpose:`Routes note fetches to each author's own relays and publishes your Quick GM replies.`,severity:`essential`},{domain:l,label:`NAP-RESOURCE`,purpose:`Loads contact avatar images. Falls back to initials when absent.`,severity:`degraded`},{domain:a,label:`NAP-THEME`,purpose:`Applies the host shell theme. Falls back to built-in colors when absent.`,severity:`degraded`},{domain:d,label:`NAP-INTENT`,purpose:`Opens notes, profiles, and the composer through installed archetype handlers. Related controls hide when unavailable.`,severity:`degraded`},{domain:je,label:`NAP-LINK`,purpose:`Opens external URLs through the shell-owned opener. Links are dead without it.`,severity:`degraded`}];function xp(e,t){let n=e.map(e=>{let n=t(e.domain);return{...e,domainPresent:n,available:n}}),r=n.filter(e=>!e.available);return{statuses:n,missing:r,missingEssential:r.filter(e=>e.severity===`essential`),missingDegraded:r.filter(e=>e.severity===`degraded`),ok:r.every(e=>e.severity!==`essential`)}}function Sp(e=bp){return xp(e,to)}var Cp=G(`<div class="flex items-center justify-center h-full"><p class="text-text-muted text-sm animate-pulse">checking runtime…</p></div>`),wp=G(`<div class="flex items-center justify-center h-full"><p class="text-text-muted text-sm">not logged in</p></div>`),Tp=G(`<div class="flex flex-col h-full"><!> <div class="flex-1 min-h-0"><!></div></div>`),Ep=G(`<div class="app h-screen w-screen overflow-hidden bg-bg-base text-text-primary font-mono"><!></div>`);function Dp(e,t){on(t,!0);let n=I(null),r=ir(Sp());va(()=>{if(!r?.ok)return;let e=new AbortController,t=t=>{e.signal.aborted||L(n,t,!0)},i=null;try{i=Me.onChanged(t)}catch{i=null}return Sa(Me,{signal:e.signal,onError:e=>console.error(`[good-morning/App] getPublicKey failed:`,e)}).then(t=>{!e.signal.aborted&&!W(n)&&t&&L(n,t,!0)}),()=>{e.abort(),i?.close()}});var i=Ep(),a=R(i),o=e=>{K(e,Cp())},s=e=>{yp(e,{get report(){return r}})},c=e=>{var t=Tp(),i=R(t),a=e=>{yp(e,{get report(){return r},variant:`banner`})};J(i,e=>{r.missingDegraded.length>0&&e(a)});var o=B(i,2),s=R(o),c=e=>{pp(e,{get pubkey(){return W(n)}})},l=e=>{K(e,wp())};J(s,e=>{W(n)==null?e(l,-1):e(c)}),j(o),j(t),K(e,t)};J(a,e=>{r==null?e(o):r.missingEssential.length>0?e(s,1):e(c,-1)}),j(i),K(e,i),sn()}qe(),Bi(Dp,{target:document.getElementById(`app`)});</script>
    <style rel="stylesheet" crossorigin>*,:before,:after{box-sizing:border-box;border-style:solid;border-width:0;border-color:var(--un-default-border-color,#e5e7eb)}:before,:after{--un-content:""}html,:host{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{line-height:inherit;margin:0}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-feature-settings:normal;font-variation-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-feature-settings:inherit;font-variation-settings:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:#0000;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{margin:0;padding:0;list-style:none}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}html,body,#app{width:100%;height:100%;margin:0}*,:before,:after,::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 #0000;--un-ring-shadow:0 0 #0000;--un-shadow-inset: ;--un-shadow:0 0 #0000;--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:#93c5fd80;--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.absolute{position:absolute}.relative{position:relative}.grid{display:grid}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.block{display:block}.inline-block{display:inline-block}.hidden{display:none}.h-7{height:1.75rem}.h-8{height:2rem}.h-full{height:100%}.h-screen{height:100vh}.max-w-lg{max-width:32rem}.min-h-0{min-height:0}.min-w-0{min-width:0}.w-7{width:1.75rem}.w-8{width:2rem}.w-full{width:100%}.w-screen{width:100vw}.flex{display:flex}.inline-flex{display:inline-flex}.flex-1{flex:1}.flex-shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.transform{transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.animate-pulse{animation:2s cubic-bezier(.4,0,.6,1) infinite pulse}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-center{justify-content:center}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.break-words{overflow-wrap:break-word}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-accent-amber\/50{border-color:rgb(var(--hg-accent-amber-rgb) / .5)}.border-accent-red\/40{border-color:rgb(var(--hg-accent-red-rgb) / .4)}.border-accent-red\/50{border-color:rgb(var(--hg-accent-red-rgb) / .5)}.border-border-dim{--un-border-opacity:1;border-color:rgb(var(--hg-border-dim-rgb) / var(--un-border-opacity))}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.border-none{border-style:none}.bg-accent-amber\/10{background-color:rgb(var(--hg-accent-amber-rgb) / .1)}.bg-accent-green{--un-bg-opacity:1;background-color:rgb(var(--hg-accent-green-rgb) / var(--un-bg-opacity))}.bg-accent-green\/5{background-color:rgb(var(--hg-accent-green-rgb) / .05)}.bg-accent-red\/5{background-color:rgb(var(--hg-accent-red-rgb) / .05)}.bg-bg-base{--un-bg-opacity:1;background-color:rgb(var(--hg-bg-base-rgb) / var(--un-bg-opacity))}.bg-bg-surface{--un-bg-opacity:1;background-color:rgb(var(--hg-bg-surface-rgb) / var(--un-bg-opacity))}.bg-transparent{background-color:#0000}.object-cover{object-fit:cover}.p-0{padding:0}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.text-\[10px\]{font-size:10px}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.text-accent-amber{--un-text-opacity:1;color:rgb(var(--hg-accent-amber-rgb) / var(--un-text-opacity))}.text-accent-green{--un-text-opacity:1;color:rgb(var(--hg-accent-green-rgb) / var(--un-text-opacity))}.text-accent-red{--un-text-opacity:1;color:rgb(var(--hg-accent-red-rgb) / var(--un-text-opacity))}.text-bg-base{--un-text-opacity:1;color:rgb(var(--hg-bg-base-rgb) / var(--un-text-opacity))}.text-text-muted{--un-text-opacity:1;color:rgb(var(--hg-text-muted-rgb) / var(--un-text-opacity))}.text-text-primary{--un-text-opacity:1;color:rgb(var(--hg-text-primary-rgb) / var(--un-text-opacity))}.text-text-secondary{--un-text-opacity:1;color:rgb(var(--hg-text-secondary-rgb) / var(--un-text-opacity))}.hover\:text-text-primary:hover{--un-text-opacity:1;color:rgb(var(--hg-text-primary-rgb) / var(--un-text-opacity))}.font-semibold{font-weight:600}.leading-relaxed{line-height:1.625}.tracking-wide{letter-spacing:.025em}.font-mono{font-family:var(--hg-font-mono,ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace)}.uppercase{text-transform:uppercase}.underline,.hover\:underline:hover{text-decoration-line:underline}.opacity-80{opacity:.8}.filter{filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter,backdrop-filter;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.gm-note-content.svelte-oqbg4h{white-space:pre-wrap}.gm-inline-link.svelte-oqbg4h{color:var(--hg-accent-green,#9be564);font:inherit;cursor:pointer;overflow-wrap:anywhere;background:0 0;border:none;padding:0;text-decoration:underline}.gm-inline-resource.svelte-oqbg4h{margin-top:6px;display:block}.gm-inline-resource.svelte-oqbg4h img:where(.svelte-oqbg4h),.gm-inline-resource.svelte-oqbg4h video:where(.svelte-oqbg4h){border:1px solid var(--hg-border-dim,#3a3a3a);object-fit:contain;border-radius:6px;max-width:min(100%,360px);max-height:260px}.gm-inline-emoji.svelte-oqbg4h{vertical-align:-.2em;object-fit:contain;width:1.25em;height:1.25em;display:inline-block}.gm-action.svelte-foj49s{border:1px solid var(--hg-border-dim,#3a3a3a);font-size:12px;font-family:var(--hg-font-mono,monospace);color:var(--hg-text-muted,#b8b1a4);cursor:pointer;background:0 0;border-radius:4px;padding:2px 10px;transition:color .12s,border-color .12s,background .12s}.gm-action.svelte-foj49s:hover:not(:disabled){color:var(--hg-text-primary,#f5f1e8);border-color:var(--hg-text-muted,#b8b1a4)}.gm-action.svelte-foj49s:disabled{opacity:.6;cursor:default}.gm-action-primary.svelte-foj49s{color:var(--hg-accent-green,#9be564);border-color:color-mix(in srgb, var(--hg-accent-green,#9be564) 45%, transparent)}.gm-action-primary.svelte-foj49s:hover:not(:disabled){color:var(--hg-accent-green,#9be564);background:color-mix(in srgb, var(--hg-accent-green,#9be564) 12%, transparent);border-color:var(--hg-accent-green,#9be564)}.gm-gallery.svelte-1cxt3ee{grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:12px;padding:12px;display:grid}.gm-tile.svelte-1cxt3ee{flex-direction:column;gap:6px;margin:0;display:flex}.gm-tile-image.svelte-1cxt3ee{aspect-ratio:1;border:1px solid var(--hg-border-dim,#3a3a3a);background:var(--hg-bg-surface,#1a1a1a);cursor:pointer;border-radius:6px;width:100%;padding:0;transition:border-color .12s,transform .12s;display:block;position:relative;overflow:hidden}.gm-tile-unavailable.svelte-1cxt3ee{width:100%;height:100%;color:var(--hg-text-muted,#b8b1a4);place-items:center;font-size:.75rem;display:grid}.gm-tile-avatar.svelte-1cxt3ee,.gm-tile-check.svelte-1cxt3ee{z-index:1;pointer-events:none;justify-content:center;align-items:center;display:flex;position:absolute;overflow:hidden}.gm-tile-avatar.svelte-1cxt3ee{border:2px solid var(--hg-bg-base,#14110c);background:var(--hg-bg-surface,#1a1a1a);border-radius:9999px;width:28px;height:28px;top:6px;left:6px;box-shadow:0 1px 3px #00000073}.gm-tile-avatar.svelte-1cxt3ee img:where(.svelte-1cxt3ee){object-fit:cover;width:100%;height:100%;display:block}.gm-tile-avatar-fallback.svelte-1cxt3ee{font-size:10px;font-family:var(--hg-font-mono,monospace);color:var(--hg-text-muted,#b8b1a4)}.gm-tile-check.svelte-1cxt3ee{width:24px;height:24px;color:var(--hg-bg-base,#14110c);background:var(--hg-accent-green,#9be564);border-radius:9999px;bottom:6px;right:6px;box-shadow:0 1px 3px #00000073}.gm-tile-image.svelte-1cxt3ee:hover{border-color:var(--hg-accent-green,#9be564);transform:translateY(-1px)}.gm-tile-image.svelte-1cxt3ee img:where(.svelte-1cxt3ee){object-fit:cover;width:100%;height:100%;display:block}.gm-tile-caption.svelte-1cxt3ee{font-size:11px;line-height:1.4;font-family:var(--hg-font-mono,monospace);color:var(--hg-text-muted,#b8b1a4);-webkit-line-clamp:2;word-break:break-word;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.gm-filter.svelte-1midz0k{border:1px solid var(--hg-border-dim,#3a3a3a);border-radius:4px;overflow:hidden}.gm-filter-btn.svelte-1midz0k{font-size:11px;font-family:var(--hg-font-mono,monospace);color:var(--hg-text-muted,#b8b1a4);border:none;border-left:1px solid var(--hg-border-dim,#3a3a3a);cursor:pointer;background:0 0;align-items:center;gap:5px;padding:2px 8px;transition:color .12s,background .12s;display:inline-flex}.gm-filter-btn.svelte-1midz0k:first-child{border-left:none}.gm-filter-btn.svelte-1midz0k:hover{color:var(--hg-text-primary,#f5f1e8)}.gm-filter-btn.is-active.svelte-1midz0k{color:var(--hg-accent-green,#9be564);background:color-mix(in srgb, var(--hg-accent-green,#9be564) 14%, transparent)}.gm-filter-count.svelte-1midz0k{opacity:.75;font-size:10px}
/*$vite$:1*/</style>
  </head>
  <body>
    <div id="app"></div>
  </body>
</html>