@konemono/nostr-login 1.13.6 → 1.13.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/unpkg.js +2 -2
- package/package.json +2 -2
- package/src/utils/nip44.ts +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{chacha20 as chacha20$1}from"@noble/ciphers/chacha";import{equalBytes as equalBytes$1}from"@noble/ciphers/utils";var BUILD={allRenderFn:!1,cmpDidLoad:!0,cmpDidUnload:!1,cmpDidUpdate:!0,cmpDidRender:!0,cmpWillLoad:!0,cmpWillUpdate:!0,cmpWillRender:!0,connectedCallback:!0,disconnectedCallback:!0,element:!0,event:!0,hasRenderFn:!0,lifecycle:!0,hostListener:!0,hostListenerTargetWindow:!0,hostListenerTargetDocument:!0,hostListenerTargetBody:!0,hostListenerTargetParent:!1,hostListenerTarget:!0,member:!0,method:!0,mode:!0,observeAttribute:!0,prop:!0,propMutable:!0,reflect:!0,scoped:!0,shadowDom:!0,slot:!0,cssAnnotations:!0,state:!0,style:!0,formAssociated:!1,svg:!0,updatable:!0,vdomAttribute:!0,vdomXlink:!0,vdomClass:!0,vdomFunctional:!0,vdomKey:!0,vdomListener:!0,vdomRef:!0,vdomPropOrAttr:!0,vdomRender:!0,vdomStyle:!0,vdomText:!0,watchCallback:!0,taskQueue:!0,hotModuleReplacement:!1,isDebug:!1,isDev:!1,isTesting:!1,hydrateServerSide:!1,hydrateClientSide:!1,lifecycleDOMEvents:!1,lazyLoad:!1,profile:!1,slotRelocation:!0,appendChildSlotFix:!1,cloneNodeFix:!1,hydratedAttribute:!1,hydratedClass:!0,scriptDataOpts:!1,scopedSlotTextContentFix:!1,shadowDomShim:!1,slotChildNodesFix:!1,invisiblePrehydration:!0,propBoolean:!0,propNumber:!0,propString:!0,constructableCSS:!0,cmpShouldUpdate:!0,devTools:!1,shadowDelegatesFocus:!0,initializeNextTick:!1,asyncLoading:!1,asyncQueue:!1,transformTagName:!1,attachStyles:!0,experimentalSlotFixes:!1},__defProp$1=Object.defineProperty,__export$1=(e,t)=>{for(var n in t)__defProp$1(e,n,{get:t[n],enumerable:!0})},hostRefs=new WeakMap,getHostRef=e=>hostRefs.get(e),registerHost=(e,t)=>{const n={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};return hostRefs.set(e,n)},isMemberInElement=(e,t)=>t in e,consoleError=(e,t)=>(0,console.error)(e,t),styles=new Map,modeResolutionChain=[],SLOT_FB_CSS="slot-fb{display:contents}slot-fb[hidden]{display:none}",XLINK_NS="http://www.w3.org/1999/xlink",win="undefined"!=typeof window?window:{},doc=win.document||{head:{}},H=win.HTMLElement||class{},plt={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,o)=>e.addEventListener(t,n,o),rel:(e,t,n,o)=>e.removeEventListener(t,n,o),ce:(e,t)=>new CustomEvent(e,t)},supportsListenerOptions=(()=>{let e=!1;try{doc.addEventListener("e",null,Object.defineProperty({},"passive",{get(){e=!0}}))}catch(e){}return e})(),promiseResolve=e=>Promise.resolve(e),supportsConstructableStylesheets=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),queuePending=!1,queueDomReads=[],queueDomWrites=[],queueTask=(e,t)=>n=>{e.push(n),queuePending||(queuePending=!0,t&&4&plt.$flags$?nextTick(flush):plt.raf(flush))},consume=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){consoleError(e)}e.length=0},flush=()=>{consume(queueDomReads),consume(queueDomWrites),(queuePending=queueDomReads.length>0)&&plt.raf(flush)},nextTick=e=>promiseResolve().then(e),writeTask=queueTask(queueDomWrites,!0),EMPTY_OBJ={},SVG_NS="http://www.w3.org/2000/svg",HTML_NS="http://www.w3.org/1999/xhtml",isDef=e=>null!=e,isComplexType=e=>"object"===(e=typeof e)||"function"===e;function queryNonceMetaTagContent(e){var t,n,o;return null!=(o=null==(n=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}var result_exports={};__export$1(result_exports,{err:()=>err,map:()=>map,ok:()=>ok,unwrap:()=>unwrap$1,unwrapErr:()=>unwrapErr});var ok=e=>({isOk:!0,isErr:!1,value:e}),err=e=>({isOk:!1,isErr:!0,value:e});function map(e,t){if(e.isOk){const n=t(e.value);return n instanceof Promise?n.then((e=>ok(e))):ok(n)}if(e.isErr){const t=e.value;return err(t)}throw"should never get here"}var unwrap$1=e=>{if(e.isOk)return e.value;throw e.value},unwrapErr=e=>{if(e.isErr)return e.value;throw e.value},createTime=(e,t="")=>()=>{},h=(e,t,...n)=>{let o=null,r=null,s=null,i=!1,a=!1;const c=[],l=t=>{for(let n=0;n<t.length;n++)o=t[n],Array.isArray(o)?l(o):null!=o&&"boolean"!=typeof o&&((i="function"!=typeof e&&!isComplexType(o))&&(o=String(o)),i&&a?c[c.length-1].$text$+=o:c.push(i?newVNode(null,o):o),a=i)};if(l(n),t){t.key&&(r=t.key),t.name&&(s=t.name);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}if("function"==typeof e)return e(null===t?{}:t,c,vdomFnUtils);const d=newVNode(e,null);return d.$attrs$=t,c.length>0&&(d.$children$=c),d.$key$=r,d.$name$=s,d},newVNode=(e,t)=>{const n={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null,$attrs$:null,$key$:null,$name$:null};return n},Host={},isHost=e=>e&&e.$tag$===Host,vdomFnUtils={forEach:(e,t)=>e.map(convertToPublic).forEach(t),map:(e,t)=>e.map(convertToPublic).map(t).map(convertToPrivate)},convertToPublic=e=>({vattrs:e.$attrs$,vchildren:e.$children$,vkey:e.$key$,vname:e.$name$,vtag:e.$tag$,vtext:e.$text$}),convertToPrivate=e=>{if("function"==typeof e.vtag){const t={...e.vattrs};return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),h(e.vtag,t,...e.vchildren||[])}const t=newVNode(e.vtag,e.vtext);return t.$attrs$=e.vattrs,t.$children$=e.vchildren,t.$key$=e.vkey,t.$name$=e.vname,t},computeMode=e=>modeResolutionChain.map((t=>t(e))).find((e=>!!e)),parsePropertyValue=(e,t)=>null==e||isComplexType(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?String(e):e,getElement=e=>e,createEvent$1=(e,t,n)=>{const o=getElement(e);return{emit:e=>emitEvent(o,t,{bubbles:!0,composed:!0,cancelable:!0,detail:e})}},emitEvent=(e,t,n)=>{const o=plt.ce(t,n);return e.dispatchEvent(o),o},rootAppliedStyles=new WeakMap,registerStyle=(e,t,n)=>{let o=styles.get(e);supportsConstructableStylesheets&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=t:o.replaceSync(t)):o=t,styles.set(e,o)},addStyle=(e,t,n)=>{var o;const r=getScopeId(t,n),s=styles.get(r);if(e=11===e.nodeType?e:doc,s)if("string"==typeof s){e=e.head||e;let n,i=rootAppliedStyles.get(e);if(i||rootAppliedStyles.set(e,i=new Set),!i.has(r)){{n=doc.createElement("style"),n.innerHTML=s;const r=null!=(o=plt.$nonce$)?o:queryNonceMetaTagContent(doc);null!=r&&n.setAttribute("nonce",r);(!(1&t.$flags$)||1&t.$flags$&&"HEAD"!==e.nodeName)&&e.insertBefore(n,e.querySelector("link"))}4&t.$flags$&&(n.innerHTML+=SLOT_FB_CSS),i&&i.add(r)}}else e.adoptedStyleSheets.includes(s)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,s]);return r},attachStyles=e=>{const t=e.$cmpMeta$,n=e.$hostElement$,o=t.$flags$,r=createTime("attachStyles",t.$tagName$),s=addStyle(n.shadowRoot?n.shadowRoot:n.getRootNode(),t,e.$modeName$);10&o&&2&o&&(n["s-sc"]=s,n.classList.add(s+"-h"),2&o&&n.classList.add(s+"-s")),r()},getScopeId=(e,t)=>"sc-"+(t&&32&e.$flags$?e.$tagName$+"-"+t:e.$tagName$),setAccessor=(e,t,n,o,r,s)=>{if(n!==o){let i=isMemberInElement(e,t),a=t.toLowerCase();if("class"===t){const t=e.classList,r=parseClassList(n),s=parseClassList(o);t.remove(...r.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!r.includes(e))))}else if("style"===t){for(const t in n)o&&null!=o[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in o)n&&o[t]===n[t]||(t.includes("-")?e.style.setProperty(t,o[t]):e.style[t]=o[t])}else if("key"===t);else if("ref"===t)o&&o(e);else if(e.__lookupSetter__(t)||"o"!==t[0]||"n"!==t[1]){const c=isComplexType(o);if((i||c&&null!==o)&&!r)try{if(e.tagName.includes("-"))e[t]=o;else{const r=null==o?"":o;"list"===t?i=!1:null!=n&&e[t]==r||(e[t]=r)}}catch(e){}let l=!1;a!==(a=a.replace(/^xlink\:?/,""))&&(t=a,l=!0),null==o||!1===o?!1===o&&""!==e.getAttribute(t)||(l?e.removeAttributeNS(XLINK_NS,t):e.removeAttribute(t)):(!i||4&s||r)&&!c&&(o=!0===o?"":o,l?e.setAttributeNS(XLINK_NS,t,o):e.setAttribute(t,o))}else if(t="-"===t[2]?t.slice(3):isMemberInElement(win,a)?a.slice(2):a[2]+t.slice(3),n||o){const r=t.endsWith(CAPTURE_EVENT_SUFFIX);t=t.replace(CAPTURE_EVENT_REGEX,""),n&&plt.rel(e,t,n,r),o&&plt.ael(e,t,o,r)}}},parseClassListRegex=/\s/,parseClassList=e=>e?e.split(parseClassListRegex):[],CAPTURE_EVENT_SUFFIX="Capture",CAPTURE_EVENT_REGEX=new RegExp(CAPTURE_EVENT_SUFFIX+"$"),updateElement=(e,t,n)=>{const o=11===t.$elm$.nodeType&&t.$elm$.host?t.$elm$.host:t.$elm$,r=e&&e.$attrs$||EMPTY_OBJ,s=t.$attrs$||EMPTY_OBJ;for(const e of sortedAttrNames(Object.keys(r)))e in s||setAccessor(o,e,r[e],void 0,n,t.$flags$);for(const e of sortedAttrNames(Object.keys(s)))setAccessor(o,e,r[e],s[e],n,t.$flags$)},scopeId,contentRef,hostTagName;function sortedAttrNames(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var useNativeShadowDom=!1,checkSlotFallbackVisibility=!1,checkSlotRelocate=!1,isSvgMode=!1,createElm=(e,t,n,o)=>{var r;const s=t.$children$[n];let i,a,c,l=0;if(useNativeShadowDom||(checkSlotRelocate=!0,"slot"===s.$tag$&&(scopeId&&o.classList.add(scopeId+"-s"),s.$flags$|=s.$children$?2:1)),null!==s.$text$)i=s.$elm$=doc.createTextNode(s.$text$);else if(1&s.$flags$)i=s.$elm$=doc.createTextNode("");else{isSvgMode||(isSvgMode="svg"===s.$tag$),i=s.$elm$=doc.createElementNS(isSvgMode?SVG_NS:HTML_NS,!useNativeShadowDom&&BUILD.slotRelocation&&2&s.$flags$?"slot-fb":s.$tag$),isSvgMode&&"foreignObject"===s.$tag$&&(isSvgMode=!1),updateElement(null,s,isSvgMode);if(!!i.getRootNode().querySelector("body")&&BUILD.scoped&&isDef(scopeId)&&i["s-si"]!==scopeId&&i.classList.add(i["s-si"]=scopeId),updateElementScopeIds(i,o),s.$children$)for(l=0;l<s.$children$.length;++l)a=createElm(e,s,l,i),a&&i.appendChild(a);"svg"===s.$tag$?isSvgMode=!1:"foreignObject"===i.tagName&&(isSvgMode=!0)}return i["s-hn"]=hostTagName,3&s.$flags$&&(i["s-sr"]=!0,i["s-cr"]=contentRef,i["s-sn"]=s.$name$||"",i["s-rf"]=null==(r=s.$attrs$)?void 0:r.ref,c=e&&e.$children$&&e.$children$[n],c&&c.$tag$===s.$tag$&&e.$elm$&&putBackInOriginalLocation(e.$elm$,!1)),i},putBackInOriginalLocation=(e,t)=>{plt.$flags$|=1;const n=Array.from(e.childNodes);e["s-sr"]&&BUILD.experimentalSlotFixes;for(let e=n.length-1;e>=0;e--){const o=n[e];o["s-hn"]!==hostTagName&&o["s-ol"]&&(insertBefore(parentReferenceNode(o),o,referenceNode(o)),o["s-ol"].remove(),o["s-ol"]=void 0,o["s-sh"]=void 0,checkSlotRelocate=!0),t&&putBackInOriginalLocation(o,t)}plt.$flags$&=-2},addVnodes=(e,t,n,o,r,s)=>{let i,a=e["s-cr"]&&e["s-cr"].parentNode||e;for(a.shadowRoot&&a.tagName===hostTagName&&(a=a.shadowRoot);r<=s;++r)o[r]&&(i=createElm(null,n,r,e),i&&(o[r].$elm$=i,insertBefore(a,i,referenceNode(t))))},removeVnodes=(e,t,n)=>{for(let o=t;o<=n;++o){const t=e[o];if(t){const e=t.$elm$;nullifyVNodeRefs(t),e&&(checkSlotFallbackVisibility=!0,e["s-ol"]?e["s-ol"].remove():putBackInOriginalLocation(e,!0),e.remove())}}},updateChildren=(e,t,n,o,r=!1)=>{let s,i,a=0,c=0,l=0,d=0,h=t.length-1,u=t[0],f=t[h],p=o.length-1,g=o[0],m=o[p];for(;a<=h&&c<=p;)if(null==u)u=t[++a];else if(null==f)f=t[--h];else if(null==g)g=o[++c];else if(null==m)m=o[--p];else if(isSameVnode(u,g,r))patch(u,g,r),u=t[++a],g=o[++c];else if(isSameVnode(f,m,r))patch(f,m,r),f=t[--h],m=o[--p];else if(isSameVnode(u,m,r))"slot"!==u.$tag$&&"slot"!==m.$tag$||putBackInOriginalLocation(u.$elm$.parentNode,!1),patch(u,m,r),insertBefore(e,u.$elm$,f.$elm$.nextSibling),u=t[++a],m=o[--p];else if(isSameVnode(f,g,r))"slot"!==u.$tag$&&"slot"!==m.$tag$||putBackInOriginalLocation(f.$elm$.parentNode,!1),patch(f,g,r),insertBefore(e,f.$elm$,u.$elm$),f=t[--h],g=o[++c];else{for(l=-1,d=a;d<=h;++d)if(t[d]&&null!==t[d].$key$&&t[d].$key$===g.$key$){l=d;break}l>=0?(i=t[l],i.$tag$!==g.$tag$?s=createElm(t&&t[c],n,l,e):(patch(i,g,r),t[l]=void 0,s=i.$elm$),g=o[++c]):(s=createElm(t&&t[c],n,c,e),g=o[++c]),s&&insertBefore(parentReferenceNode(u.$elm$),s,referenceNode(u.$elm$))}a>h?addVnodes(e,null==o[p+1]?null:o[p+1].$elm$,n,o,c,p):c>p&&removeVnodes(t,a,h)},isSameVnode=(e,t,n=!1)=>e.$tag$===t.$tag$&&("slot"===e.$tag$?(!("$nodeId$"in e)||!n||8===e.$elm$.nodeType)&&e.$name$===t.$name$:!!n||e.$key$===t.$key$),referenceNode=e=>e&&e["s-ol"]||e,parentReferenceNode=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,patch=(e,t,n=!1)=>{const o=t.$elm$=e.$elm$,r=e.$children$,s=t.$children$,i=t.$tag$,a=t.$text$;let c;null===a?(isSvgMode="svg"===i||"foreignObject"!==i&&isSvgMode,("slot"!==i||useNativeShadowDom)&&updateElement(e,t,isSvgMode),null!==r&&null!==s?updateChildren(o,r,t,s,n):null!==s?(null!==e.$text$&&(o.textContent=""),addVnodes(o,null,t,s,0,s.length-1)):!n&&BUILD.updatable&&null!==r&&removeVnodes(r,0,r.length-1),isSvgMode&&"svg"===i&&(isSvgMode=!1)):(c=o["s-cr"])?c.parentNode.textContent=a:e.$text$!==a&&(o.data=a)},updateFallbackSlotVisibility=e=>{const t=e.childNodes;for(const e of t)if(1===e.nodeType){if(e["s-sr"]){const n=e["s-sn"];e.hidden=!1;for(const o of t)if(o!==e)if(o["s-hn"]!==e["s-hn"]||""!==n){if(1===o.nodeType&&(n===o.getAttribute("slot")||n===o["s-sn"])||3===o.nodeType&&n===o["s-sn"]){e.hidden=!0;break}}else if(1===o.nodeType||3===o.nodeType&&""!==o.textContent.trim()){e.hidden=!0;break}}updateFallbackSlotVisibility(e)}},relocateNodes=[],markSlotContentForRelocation=e=>{let t,n,o;for(const r of e.childNodes){if(r["s-sr"]&&(t=r["s-cr"])&&t.parentNode){n=t.parentNode.childNodes;const e=r["s-sn"];for(o=n.length-1;o>=0;o--)if(t=n[o],!t["s-cn"]&&!t["s-nr"]&&t["s-hn"]!==r["s-hn"])if(isNodeLocatedInSlot(t,e)){let n=relocateNodes.find((e=>e.$nodeToRelocate$===t));checkSlotFallbackVisibility=!0,t["s-sn"]=t["s-sn"]||e,n?(n.$nodeToRelocate$["s-sh"]=r["s-hn"],n.$slotRefNode$=r):(t["s-sh"]=r["s-hn"],relocateNodes.push({$slotRefNode$:r,$nodeToRelocate$:t})),t["s-sr"]&&relocateNodes.map((e=>{isNodeLocatedInSlot(e.$nodeToRelocate$,t["s-sn"])&&(n=relocateNodes.find((e=>e.$nodeToRelocate$===t)),n&&!e.$slotRefNode$&&(e.$slotRefNode$=n.$slotRefNode$))}))}else relocateNodes.some((e=>e.$nodeToRelocate$===t))||relocateNodes.push({$nodeToRelocate$:t})}1===r.nodeType&&markSlotContentForRelocation(r)}},isNodeLocatedInSlot=(e,t)=>1===e.nodeType?null===e.getAttribute("slot")&&""===t||e.getAttribute("slot")===t:e["s-sn"]===t||""===t,nullifyVNodeRefs=e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map(nullifyVNodeRefs)},insertBefore=(e,t,n)=>{const o=null==e?void 0:e.insertBefore(t,n);return updateElementScopeIds(t,e),o},findScopeIds=e=>{const t=[];return e&&t.push(...e["s-scs"]||[],e["s-si"],e["s-sc"],...findScopeIds(e.parentElement)),t},updateElementScopeIds=(e,t,n=!1)=>{var o;if(e&&t&&1===e.nodeType){const r=new Set(findScopeIds(t).filter(Boolean));if(r.size&&(null==(o=e.classList)||o.add(...e["s-scs"]=[...r]),e["s-ol"]||n))for(const t of Array.from(e.childNodes))updateElementScopeIds(t,e,!0)}},renderVdom=(e,t,n=!1)=>{var o,r,s,i,a;const c=e.$hostElement$,l=e.$cmpMeta$,d=e.$vnode$||newVNode(null,null),u=isHost(t)?t:h(null,null,t);if(hostTagName=c.tagName,l.$attrsToReflect$&&(u.$attrs$=u.$attrs$||{},l.$attrsToReflect$.map((([e,t])=>u.$attrs$[t]=c[e]))),n&&u.$attrs$)for(const e of Object.keys(u.$attrs$))c.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(u.$attrs$[e]=c[e]);if(u.$tag$=null,u.$flags$|=4,e.$vnode$=u,u.$elm$=d.$elm$=c.shadowRoot||c,scopeId=c["s-sc"],useNativeShadowDom=!!(1&l.$flags$),contentRef=c["s-cr"],checkSlotFallbackVisibility=!1,patch(d,u,n),plt.$flags$|=1,checkSlotRelocate){markSlotContentForRelocation(u.$elm$);for(const e of relocateNodes){const t=e.$nodeToRelocate$;if(!t["s-ol"]){const e=doc.createTextNode("");e["s-nr"]=t,insertBefore(t.parentNode,t["s-ol"]=e,t)}}for(const e of relocateNodes){const t=e.$nodeToRelocate$,a=e.$slotRefNode$;if(a){const e=a.parentNode;let n=a.nextSibling;{let s=null==(o=t["s-ol"])?void 0:o.previousSibling;for(;s;){let o=null!=(r=s["s-nr"])?r:null;if(o&&o["s-sn"]===t["s-sn"]&&e===o.parentNode){for(o=o.nextSibling;o===t||(null==o?void 0:o["s-sr"]);)o=null==o?void 0:o.nextSibling;if(!o||!o["s-nr"]){n=o;break}}s=s.previousSibling}}(!n&&e!==t.parentNode||t.nextSibling!==n)&&t!==n&&(!t["s-hn"]&&t["s-ol"]&&(t["s-hn"]=t["s-ol"].parentNode.nodeName),insertBefore(e,t,n),1===t.nodeType&&(t.hidden=null!=(s=t["s-ih"])&&s)),t&&"function"==typeof a["s-rf"]&&a["s-rf"](t)}else 1===t.nodeType&&(n&&(t["s-ih"]=null!=(i=t.hidden)&&i),t.hidden=!0)}}if(checkSlotFallbackVisibility&&updateFallbackSlotVisibility(u.$elm$),plt.$flags$&=-2,relocateNodes.length=0,BUILD.experimentalScopedSlotChanges&&2&l.$flags$)for(const e of u.$elm$.childNodes)e["s-hn"]===hostTagName||e["s-sh"]||(n&&null==e["s-ih"]&&(e["s-ih"]=null!=(a=e.hidden)&&a),e.hidden=!0);contentRef=void 0},attachToAncestor=(e,t)=>{},scheduleUpdate=(e,t)=>{e.$flags$|=16,attachToAncestor(e,e.$ancestorComponent$);return writeTask((()=>dispatchHooks(e,t)))},dispatchHooks=(e,t)=>{const n=e.$hostElement$,o=createTime("scheduleUpdate",e.$cmpMeta$.$tagName$),r=n;if(!r)throw new Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let s;return s=safeCall(r,t?"componentWillLoad":"componentWillUpdate"),s=enqueue(s,(()=>safeCall(r,"componentWillRender"))),o(),enqueue(s,(()=>updateComponent(e,r,t)))},enqueue=(e,t)=>isPromisey(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),isPromisey=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,updateComponent=async(e,t,n)=>{const o=e.$hostElement$,r=createTime("update",e.$cmpMeta$.$tagName$);o["s-rc"],n&&attachStyles(e);const s=createTime("render",e.$cmpMeta$.$tagName$);callRender(e,t,o,n),s(),r(),postUpdateComponent(e)},renderingRef=null,callRender=(e,t,n,o)=>{try{renderingRef=t,t=t.render&&t.render(),e.$flags$&=-17,e.$flags$|=2,(BUILD.hasRenderFn||BUILD.reflect)&&(BUILD.vdomRender||BUILD.reflect)&&(BUILD.hydrateServerSide||renderVdom(e,t,o))}catch(t){consoleError(t,e.$hostElement$)}return renderingRef=null,null},getRenderingRef=()=>renderingRef,postUpdateComponent=e=>{const t=e.$cmpMeta$.$tagName$,n=e.$hostElement$,o=createTime("postUpdate",t),r=n;e.$ancestorComponent$,safeCall(r,"componentDidRender"),64&e.$flags$?(safeCall(r,"componentDidUpdate"),o()):(e.$flags$|=64,safeCall(r,"componentDidLoad"),o())},forceUpdate=e=>{{const t=getHostRef(e),n=t.$hostElement$.isConnected;return n&&2==(18&t.$flags$)&&scheduleUpdate(t,!1),n}},safeCall=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){consoleError(e)}},getValue=(e,t)=>getHostRef(e).$instanceValues$.get(t),setValue=(e,t,n,o)=>{const r=getHostRef(e),s=e,i=r.$instanceValues$.get(t),a=r.$flags$,c=s;n=parsePropertyValue(n,o.$members$[t][0]);const l=Number.isNaN(i)&&Number.isNaN(n);if(n!==i&&!l){if(r.$instanceValues$.set(t,n),o.$watchers$&&128&a){const e=o.$watchers$[t];e&&e.map((e=>{try{c[e](n,i,t)}catch(e){consoleError(e,s)}}))}if(2==(18&a)){if(c.componentShouldUpdate&&!1===c.componentShouldUpdate(n,i,t))return;scheduleUpdate(r,!1)}}},proxyComponent=(e,t,n)=>{var o,r;const s=e.prototype;if(t.$members$||t.$watchers$||e.watchers){e.watchers&&!t.$watchers$&&(t.$watchers$=e.watchers);const n=Object.entries(null!=(o=t.$members$)?o:{});n.map((([e,[n]])=>{(31&n||32&n)&&Object.defineProperty(s,e,{get(){return getValue(this,e)},set(n){setValue(this,e,n,t)},configurable:!0,enumerable:!0})}));{const o=new Map;s.attributeChangedCallback=function(e,n,r){plt.jmp((()=>{var i;const a=o.get(e);if(this.hasOwnProperty(a))r=this[a],delete this[a];else{if(s.hasOwnProperty(a)&&"number"==typeof this[a]&&this[a]==r)return;if(null==a){const o=getHostRef(this),s=null==o?void 0:o.$flags$;if(s&&!(8&s)&&128&s&&r!==n){const o=this,s=null==(i=t.$watchers$)?void 0:i[e];null==s||s.forEach((t=>{null!=o[t]&&o[t].call(o,r,n,e)}))}return}}this[a]=(null!==r||"boolean"!=typeof this[a])&&r}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(r=t.$watchers$)?r:{}),...n.filter((([e,t])=>15&t[0])).map((([e,n])=>{var r;const s=n[1]||e;return o.set(s,e),512&n[0]&&(null==(r=t.$attrsToReflect$)||r.push([e,s])),s}))]))}}return e},initializeComponent=async(e,t,n,o)=>{let r;if(!(32&t.$flags$)){t.$flags$|=32,n.$lazyBundleId$;{r=e.constructor;const n=e.localName;customElements.whenDefined(n).then((()=>t.$flags$|=128))}if(r&&r.style){let o;"string"==typeof r.style?o=r.style:"string"!=typeof r.style&&(t.$modeName$=computeMode(e),t.$modeName$&&(o=r.style[t.$modeName$]));const s=getScopeId(n,t.$modeName$);if(!styles.has(s)){const e=createTime("registerStyles",n.$tagName$);registerStyle(s,o,!!(1&n.$flags$)),e()}}}t.$ancestorComponent$;scheduleUpdate(t,!0)},fireConnectedCallback=e=>{},connectedCallback=e=>{if(!(1&plt.$flags$)){const t=getHostRef(e),n=t.$cmpMeta$,o=createTime("connectedCallback",n.$tagName$);1&t.$flags$?(addHostEventListeners(e,t,n.$listeners$),(null==t?void 0:t.$lazyInstance$)?fireConnectedCallback(t.$lazyInstance$):(null==t?void 0:t.$onReadyPromise$)&&t.$onReadyPromise$.then((()=>fireConnectedCallback(t.$lazyInstance$)))):(t.$flags$|=1,12&n.$flags$&&setContentReference(e),n.$members$&&Object.entries(n.$members$).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),initializeComponent(e,t,n)),o()}},setContentReference=e=>{const t=e["s-cr"]=doc.createComment("");t["s-cn"]=!0,insertBefore(e,t,e.firstChild)},disconnectedCallback=async e=>{if(!(1&plt.$flags$)){const t=getHostRef(e);t.$rmListeners$&&(t.$rmListeners$.map((e=>e())),t.$rmListeners$=void 0)}},proxyCustomElement=(e,t)=>{const n={$flags$:t[0],$tagName$:t[1]};n.$members$=t[2],n.$listeners$=t[3],n.$watchers$=e.$watchers$,n.$attrsToReflect$=[];const o=e.prototype.connectedCallback,r=e.prototype.disconnectedCallback;return Object.assign(e.prototype,{__registerHost(){registerHost(this,n)},connectedCallback(){const e=getHostRef(this);addHostEventListeners(this,e,n.$listeners$),connectedCallback(this),o&&o.call(this)},disconnectedCallback(){disconnectedCallback(this),r&&r.call(this)},__attachShadow(){if(this.shadowRoot){if("open"!==this.shadowRoot.mode)throw new Error(`Unable to re-use existing shadow root for ${n.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else this.attachShadow({mode:"open",delegatesFocus:!!(16&n.$flags$)})}}),e.is=n.$tagName$,proxyComponent(e,n)},Fragment=(e,t)=>t,addHostEventListeners=(e,t,n,o)=>{n&&n.map((([n,o,r])=>{const s=getHostListenerTarget(e,n),i=hostListenerProxy(t,r),a=hostListenerOpts(n);plt.ael(s,o,i,a),(t.$rmListeners$=t.$rmListeners$||[]).push((()=>plt.rel(s,o,i,a)))}))},hostListenerProxy=(e,t)=>n=>{try{BUILD.lazyLoad||e.$hostElement$[t](n)}catch(e){consoleError(e)}},getHostListenerTarget=(e,t)=>4&t?doc:8&t?win:16&t?doc.body:e,hostListenerOpts=e=>supportsListenerOptions?{passive:!!(1&e),capture:!!(2&e)}:!!(2&e),CURRENT_MODULE,METHOD_MODULE;!function(e){e.WELCOME="welcome",e.WELCOME_LOGIN="welcome-login",e.WELCOME_SIGNUP="welcome-signup",e.INFO="info",e.LOGIN_BUNKER_URL="login-bunker-url",e.LOGIN_READ_ONLY="login-read-only",e.CONFIRM_LOGOUT="confirm-logout",e.IMPORT_FLOW="import",e.IMPORT_OTP="import-otp",e.LOGIN="login",e.SIGNUP="signup",e.LOCAL_SIGNUP="local-signup",e.EXTENSION="extension",e.LOADING="loading",e.PREVIOUSLY_LOGGED="switch-account",e.LOGIN_OTP="otp",e.LOGIN_NSEC="login-nsec",e.CONNECT="connect",e.CONNECTION_STRING="connection-string",e.IFRAME="iframe"}(CURRENT_MODULE||(CURRENT_MODULE={})),function(e){e.LOGIN="login",e.SIGNUP="signup",e.LOGOUT="logout",e.CONFIRM="confirm"}(METHOD_MODULE||(METHOD_MODULE={}));const appendToMap=(e,t,n)=>{const o=e.get(t);o?o.includes(n)||o.push(n):e.set(t,[n])},debounce=(e,t)=>{let n;return(...o)=>{n&&clearTimeout(n),n=setTimeout((()=>{n=0,e(...o)}),t)}},isConnected=e=>!("isConnected"in e)||e.isConnected,cleanupElements=debounce((e=>{for(let t of e.keys())e.set(t,e.get(t).filter(isConnected))}),2e3),stencilSubscription=()=>{if("function"!=typeof getRenderingRef)return{};const e=new Map;return{dispose:()=>e.clear(),get:t=>{const n=getRenderingRef();n&&appendToMap(e,t,n)},set:t=>{const n=e.get(t);n&&e.set(t,n.filter(forceUpdate)),cleanupElements(e)},reset:()=>{e.forEach((e=>e.forEach(forceUpdate))),cleanupElements(e)}}},unwrap=e=>"function"==typeof e?e():e,createObservableMap=(e,t=((e,t)=>e!==t))=>{const n=unwrap(e);let o=new Map(Object.entries(null!=n?n:{}));const r={dispose:[],get:[],set:[],reset:[]},s=()=>{var t;o=new Map(Object.entries(null!==(t=unwrap(e))&&void 0!==t?t:{})),r.reset.forEach((e=>e()))},i=e=>(r.get.forEach((t=>t(e))),o.get(e)),a=(e,n)=>{const s=o.get(e);t(n,s,e)&&(o.set(e,n),r.set.forEach((t=>t(e,n,s))))},c="undefined"==typeof Proxy?{}:new Proxy(n,{get:(e,t)=>i(t),ownKeys:e=>Array.from(o.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(e,t)=>o.has(t),set:(e,t,n)=>(a(t,n),!0)}),l=(e,t)=>(r[e].push(t),()=>{removeFromArray(r[e],t)});return{state:c,get:i,set:a,on:l,onChange:(t,n)=>{const o=l("set",((e,o)=>{e===t&&n(o)})),r=l("reset",(()=>n(unwrap(e)[t])));return()=>{o(),r()}},use:(...e)=>{const t=e.reduce(((e,t)=>(t.set&&e.push(l("set",t.set)),t.get&&e.push(l("get",t.get)),t.reset&&e.push(l("reset",t.reset)),t.dispose&&e.push(l("dispose",t.dispose)),e)),[]);return()=>t.forEach((e=>e()))},dispose:()=>{r.dispose.forEach((e=>e())),s()},reset:s,forceUpdate:e=>{const t=o.get(e);r.set.forEach((n=>n(e,t,t)))}}},removeFromArray=(e,t)=>{const n=e.indexOf(t);n>=0&&(e[n]=e[e.length-1],e.length--)},createStore=(e,t)=>{const n=createObservableMap(e,t);return n.use(stencilSubscription()),n},loadCustomRelays=()=>{try{const e=localStorage.getItem("customNip46Relays");if(e){const t=JSON.parse(e);if(Array.isArray(t)&&t.length>0)return t}}catch(e){console.error("Failed to load custom relays from localStorage",e)}return["wss://relay.nsec.app/","wss://ephemeral.snowflare.cc/"]},{state:state,onChange:onChange,reset:reset}=createStore({screen:CURRENT_MODULE.WELCOME,prevScreen:CURRENT_MODULE.WELCOME,path:[CURRENT_MODULE.WELCOME],error:"",isLoading:!1,isLoadingExtension:!1,isOTP:!1,authUrl:"",iframeUrl:"",njumpIframe:"",customNip46Relays:loadCustomRelays(),nlSignin:{loginName:""},nlSignup:{signupName:"",domain:"",servers:[{name:"@nsec.app",value:"nsec.app"},{name:"@highlighter.com",value:"highlighter.com"}]},nlSigninBunkerUrl:{loginName:""},nlSigninReadOnly:{loginName:""},nlSigninOTP:{loginName:"",code:""},nlSigninNsec:{nsecValue:""},nlImport:null});onChange("customNip46Relays",(e=>{try{localStorage.setItem("customNip46Relays",JSON.stringify(e))}catch(e){console.error("Failed to save custom relays to localStorage",e)}})),onChange("screen",(()=>{state.error="",state.nlSignin.loginName="",state.nlSignup.signupName="",state.nlSignup.domain="",state.nlSigninNsec.nsecValue=""}));const baseCss="/*! tailwindcss v3.4.10 | MIT License | https://tailwindcss.com*/*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-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;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-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,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;color:#6b7280;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}[multiple],[type=date],[type=datetime-local],[type=email],[type=month],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=time],[type=url],[type=week],input:where(:not([type])),select,textarea{--tw-shadow:0 0 #0000;appearance:none;background-color:#fff;border-color:#6b7280;border-radius:0;border-width:1px;font-size:1rem;line-height:1.5rem;padding:.5rem .75rem}[multiple]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=email]:focus,[type=month]:focus,[type=number]:focus,[type=password]:focus,[type=search]:focus,[type=tel]:focus,[type=text]:focus,[type=time]:focus,[type=url]:focus,[type=week]:focus,input:where(:not([type])):focus,select:focus,textarea:focus{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);border-color:#2563eb;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-year-field{padding-bottom:0;padding-top:0}select{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E\");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem;print-color-adjust:exact}[multiple],[size]:where(select:not([size=\"1\"])){background-image:none;background-position:0 0;background-repeat:unset;background-size:initial;padding-right:.75rem;print-color-adjust:unset}[type=checkbox],[type=radio]{--tw-shadow:0 0 #0000;appearance:none;background-color:#fff;background-origin:border-box;border-color:#6b7280;border-width:1px;color:#2563eb;display:inline-block;flex-shrink:0;height:1rem;padding:0;print-color-adjust:exact;user-select:none;vertical-align:middle;width:1rem}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}[type=checkbox]:checked,[type=radio]:checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:transparent}[type=checkbox]:checked{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E\")}@media (forced-colors:active){[type=checkbox]:checked{appearance:auto}}[type=radio]:checked{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3C/svg%3E\")}@media (forced-colors:active){[type=radio]:checked{appearance:auto}}[type=checkbox]:checked:focus,[type=checkbox]:checked:hover,[type=radio]:checked:focus,[type=radio]:checked:hover{background-color:currentColor;border-color:transparent}[type=checkbox]:indeterminate{background-color:currentColor;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3E%3C/svg%3E\");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:transparent}@media (forced-colors:active){[type=checkbox]:indeterminate{appearance:auto}}[type=checkbox]:indeterminate:focus,[type=checkbox]:indeterminate:hover{background-color:currentColor;border-color:transparent}[type=file]{background:unset;border-color:inherit;border-radius:0;border-width:0;font-size:unset;line-height:inherit;padding:0}[type=file]:focus{outline:1px solid ButtonText;outline:1px auto -webkit-focus-ring-color}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}.block{display:block}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.theme-default .nl-bg{--tw-bg-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);background-color:rgb(255 255 255/var(--tw-bg-opacity));box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.theme-default .dark .nl-bg{--tw-bg-opacity:1;--tw-shadow-color:rgba(51,65,85,.7);--tw-shadow:var(--tw-shadow-colored);background-color:rgb(31 41 55/var(--tw-bg-opacity))}.theme-default .nl-description,.theme-default .nl-logo,.theme-default .nl-title{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}.theme-default .dark .nl-description,.theme-default .dark .nl-logo,.theme-default .dark .nl-title{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.theme-default .nl-description a{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity));text-decoration-line:underline}.theme-default .dark .nl-description a{--tw-text-opacity:1;color:rgb(191 219 254/var(--tw-text-opacity));text-decoration-line:underline}.theme-default .nl-action-button{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.theme-default .nl-action-button:hover{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.theme-default .dark .nl-action-button{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.theme-default .dark .nl-action-button:hover{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.theme-default .nl-title{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}.theme-default .dark .nl-title{--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}.theme-default .nl-button{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(229 231 235/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(31 41 55/var(--tw-text-opacity))}.theme-default .nl-button:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity))}.theme-default .dark .nl-button{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(15 23 42/var(--tw-bg-opacity));border-color:rgb(55 65 81/var(--tw-border-opacity));color:rgb(209 213 219/var(--tw-text-opacity))}.theme-default .dark .nl-button:hover{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity))}.theme-default .nl-divider{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.theme-default .nl-divider:before{border-top-width:1px}.theme-default .nl-divider:after,.theme-default .nl-divider:before{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity));content:var(--tw-content)}.theme-default .dark .nl-divider{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.theme-default .dark .nl-divider:after,.theme-default .dark .nl-divider:before{--tw-border-opacity:1;border-color:rgb(75 85 99/var(--tw-border-opacity));content:var(--tw-content)}.theme-default .nl-footer{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}.theme-default .dark .nl-footer{--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}.theme-default .nl-error{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity))}.theme-default .dark .nl-error{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity))}.theme-default .nl-input{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.theme-default .nl-input:focus{--tw-border-opacity:1;--tw-ring-opacity:1;--tw-ring-color:rgb(168 85 247/var(--tw-ring-opacity));border-color:rgb(168 85 247/var(--tw-border-opacity))}.theme-default .dark .nl-input{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity));color:rgb(156 163 175/var(--tw-text-opacity))}.theme-default .dark .nl-input:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(75 85 99/var(--tw-ring-opacity))}.theme-default .nl-select{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.theme-default .nl-select:focus{--tw-border-opacity:1;--tw-ring-opacity:1;--tw-ring-color:rgb(168 85 247/var(--tw-ring-opacity));border-color:rgb(168 85 247/var(--tw-border-opacity))}.theme-default .dark .nl-select{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity));color:rgb(156 163 175/var(--tw-text-opacity))}.theme-default .dark .nl-select:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(75 85 99/var(--tw-ring-opacity))}.theme-default .nl-select-list{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.theme-default .dark .nl-select-list{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.theme-default .nl-select-option{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}.theme-default .nl-select-option:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.theme-default .nl-select-option.active-option{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity));color:rgb(30 58 138/var(--tw-text-opacity))}.theme-default .dark .nl-select-option{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.theme-default .dark .nl-select-option:hover{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity));color:rgb(209 213 219/var(--tw-text-opacity))}.theme-default .nl-text-error{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity))}.theme-default .nl-text-success{--tw-text-opacity:1;color:rgb(45 212 191/var(--tw-text-opacity))}.theme-default .nl-banner{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(229 231 235/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(31 41 55/var(--tw-text-opacity))}.theme-default .dark .nl-banner{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(15 23 42/var(--tw-bg-opacity));border-color:rgb(55 65 81/var(--tw-border-opacity));color:rgb(209 213 219/var(--tw-text-opacity))}.theme-ocean .nl-bg{--tw-bg-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);background-color:rgb(191 219 254/var(--tw-bg-opacity));box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.theme-ocean .dark .nl-bg{--tw-bg-opacity:1;--tw-shadow-color:rgba(51,65,85,.7);--tw-shadow:var(--tw-shadow-colored);background-color:rgb(8 47 73/var(--tw-bg-opacity))}.theme-ocean .nl-description,.theme-ocean .nl-logo,.theme-ocean .nl-title{--tw-text-opacity:1;color:rgb(8 47 73/var(--tw-text-opacity))}.theme-ocean .dark .nl-description,.theme-ocean .dark .nl-logo,.theme-ocean .dark .nl-title{--tw-text-opacity:1;color:rgb(186 230 253/var(--tw-text-opacity))}.theme-ocean .nl-action-button{--tw-text-opacity:1;color:rgb(8 47 73/var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.theme-ocean .nl-action-button:hover{--tw-bg-opacity:1;background-color:rgb(224 242 254/var(--tw-bg-opacity))}.theme-ocean .dark .nl-action-button{--tw-text-opacity:1;color:rgb(186 230 253/var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.theme-ocean .dark .nl-action-button:hover{--tw-bg-opacity:1;background-color:rgb(12 74 110/var(--tw-bg-opacity))}.theme-ocean .nl-button{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);background-color:rgb(224 242 254/var(--tw-bg-opacity));border-color:rgb(186 230 253/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(8 47 73/var(--tw-text-opacity))}.theme-ocean .nl-button:hover{--tw-bg-opacity:1;background-color:rgb(240 249 255/var(--tw-bg-opacity))}.theme-ocean .dark .nl-button{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(7 89 133/var(--tw-bg-opacity));border-color:rgb(8 47 73/var(--tw-border-opacity));color:rgb(186 230 253/var(--tw-text-opacity))}.theme-ocean .dark .nl-button:hover{--tw-bg-opacity:1;background-color:rgb(12 74 110/var(--tw-bg-opacity))}.theme-ocean .nl-divider{--tw-text-opacity:1;color:rgb(8 47 73/var(--tw-text-opacity))}.theme-ocean .nl-divider:after,.theme-ocean .nl-divider:before{--tw-border-opacity:1;border-color:rgb(8 47 73/var(--tw-border-opacity));content:var(--tw-content)}.theme-ocean .dark .nl-divider{--tw-text-opacity:1;color:rgb(186 230 253/var(--tw-text-opacity))}.theme-ocean .dark .nl-divider:after,.theme-ocean .dark .nl-divider:before{--tw-border-opacity:1;border-color:rgb(186 230 253/var(--tw-border-opacity));content:var(--tw-content)}.theme-ocean .nl-footer{--tw-text-opacity:1;color:rgb(8 47 73/var(--tw-text-opacity))}.theme-ocean .dark .nl-footer{--tw-text-opacity:1;color:rgb(186 230 253/var(--tw-text-opacity))}.theme-ocean .nl-error{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity))}.theme-ocean .dark .nl-error{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity))}.theme-ocean .nl-input{--tw-bg-opacity:1;background-color:rgb(224 242 254/var(--tw-bg-opacity))}.theme-ocean .nl-input:focus{--tw-border-opacity:1;--tw-ring-opacity:1;--tw-ring-color:rgb(14 165 233/var(--tw-ring-opacity));border-color:rgb(14 165 233/var(--tw-border-opacity))}.theme-ocean .dark .nl-input{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(12 74 110/var(--tw-bg-opacity));color:rgb(56 189 248/var(--tw-text-opacity))}.theme-ocean .dark .nl-input:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(2 132 199/var(--tw-ring-opacity))}.theme-ocean .nl-select{--tw-bg-opacity:1;background-color:rgb(224 242 254/var(--tw-bg-opacity))}.theme-ocean .nl-select:focus{--tw-border-opacity:1;--tw-ring-opacity:1;--tw-ring-color:rgb(14 165 233/var(--tw-ring-opacity));border-color:rgb(14 165 233/var(--tw-border-opacity))}.theme-ocean .dark .nl-select{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(12 74 110/var(--tw-bg-opacity));color:rgb(56 189 248/var(--tw-text-opacity))}.theme-ocean .dark .nl-select:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(2 132 199/var(--tw-ring-opacity))}.theme-ocean .nl-select-list{--tw-bg-opacity:1;background-color:rgb(224 242 254/var(--tw-bg-opacity))}.theme-ocean .dark .nl-select-list{--tw-bg-opacity:1;background-color:rgb(3 105 161/var(--tw-bg-opacity))}.theme-ocean .nl-select-option{--tw-text-opacity:1;color:rgb(7 89 133/var(--tw-text-opacity))}.theme-ocean .nl-select-option:hover{--tw-bg-opacity:1;background-color:rgb(186 230 253/var(--tw-bg-opacity))}.theme-ocean .dark .nl-select-option{--tw-text-opacity:1;color:rgb(56 189 248/var(--tw-text-opacity))}.theme-ocean .dark .nl-select-option:hover{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(7 89 133/var(--tw-bg-opacity));color:rgb(125 211 252/var(--tw-text-opacity))}.theme-ocean .nl-text-error{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity))}.theme-ocean .dark .nl-text-error{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity))}.theme-ocean .nl-text-success{--tw-text-opacity:1;color:rgb(13 148 136/var(--tw-text-opacity))}.theme-ocean .dark .nl-text-success{--tw-text-opacity:1;color:rgb(45 212 191/var(--tw-text-opacity))}.theme-lemonade .nl-bg{--tw-bg-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);background-color:rgb(187 247 208/var(--tw-bg-opacity));box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.theme-lemonade .dark .nl-bg{--tw-bg-opacity:1;--tw-shadow-color:rgba(51,65,85,.7);--tw-shadow:var(--tw-shadow-colored);background-color:rgb(5 46 22/var(--tw-bg-opacity))}.theme-lemonade .nl-description,.theme-lemonade .nl-logo,.theme-lemonade .nl-title{--tw-text-opacity:1;color:rgb(5 46 22/var(--tw-text-opacity))}.theme-lemonade .dark .nl-description,.theme-lemonade .dark .nl-logo,.theme-lemonade .dark .nl-title{--tw-text-opacity:1;color:rgb(187 247 208/var(--tw-text-opacity))}.theme-lemonade .nl-action-button{--tw-text-opacity:1;color:rgb(5 46 22/var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.theme-lemonade .nl-action-button:hover{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity))}.theme-lemonade .dark .nl-action-button{--tw-text-opacity:1;color:rgb(187 247 208/var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.theme-lemonade .dark .nl-action-button:hover{--tw-bg-opacity:1;background-color:rgb(20 83 45/var(--tw-bg-opacity))}.theme-lemonade .nl-button{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);background-color:rgb(220 252 231/var(--tw-bg-opacity));border-color:rgb(187 247 208/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(5 46 22/var(--tw-text-opacity))}.theme-lemonade .nl-button:hover{--tw-bg-opacity:1;background-color:rgb(240 253 244/var(--tw-bg-opacity))}.theme-lemonade .dark .nl-button{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(22 101 52/var(--tw-bg-opacity));border-color:rgb(5 46 22/var(--tw-border-opacity));color:rgb(187 247 208/var(--tw-text-opacity))}.theme-lemonade .dark .nl-button:hover{--tw-bg-opacity:1;background-color:rgb(20 83 45/var(--tw-bg-opacity))}.theme-lemonade .nl-divider{--tw-text-opacity:1;color:rgb(5 46 22/var(--tw-text-opacity))}.theme-lemonade .nl-divider:after,.theme-lemonade .nl-divider:before{--tw-border-opacity:1;border-color:rgb(5 46 22/var(--tw-border-opacity));content:var(--tw-content)}.theme-lemonade .dark .nl-divider{--tw-text-opacity:1;color:rgb(187 247 208/var(--tw-text-opacity))}.theme-lemonade .dark .nl-divider:after,.theme-lemonade .dark .nl-divider:before{--tw-border-opacity:1;border-color:rgb(187 247 208/var(--tw-border-opacity));content:var(--tw-content)}.theme-lemonade .nl-footer{--tw-text-opacity:1;color:rgb(5 46 22/var(--tw-text-opacity))}.theme-lemonade .dark .nl-footer{--tw-text-opacity:1;color:rgb(187 247 208/var(--tw-text-opacity))}.theme-lemonade .nl-error{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity))}.theme-lemonade .dark .nl-error{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity))}.theme-lemonade .nl-input{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity))}.theme-lemonade .nl-input:focus{--tw-border-opacity:1;--tw-ring-opacity:1;--tw-ring-color:rgb(34 197 94/var(--tw-ring-opacity));border-color:rgb(34 197 94/var(--tw-border-opacity))}.theme-lemonade .dark .nl-input{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(20 83 45/var(--tw-bg-opacity));color:rgb(74 222 128/var(--tw-text-opacity))}.theme-lemonade .dark .nl-input:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(22 163 74/var(--tw-ring-opacity))}.theme-lemonade .nl-select{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity))}.theme-lemonade .nl-select:focus{--tw-border-opacity:1;--tw-ring-opacity:1;--tw-ring-color:rgb(34 197 94/var(--tw-ring-opacity));border-color:rgb(34 197 94/var(--tw-border-opacity))}.theme-lemonade .dark .nl-select{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(20 83 45/var(--tw-bg-opacity));color:rgb(74 222 128/var(--tw-text-opacity))}.theme-lemonade .dark .nl-select:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(22 163 74/var(--tw-ring-opacity))}.theme-lemonade .nl-select-list{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity))}.theme-lemonade .dark .nl-select-list{--tw-bg-opacity:1;background-color:rgb(21 128 61/var(--tw-bg-opacity))}.theme-lemonade .nl-select-option{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity))}.theme-lemonade .nl-select-option:hover{--tw-bg-opacity:1;background-color:rgb(187 247 208/var(--tw-bg-opacity))}.theme-lemonade .dark .nl-select-option{--tw-text-opacity:1;color:rgb(74 222 128/var(--tw-text-opacity))}.theme-lemonade .dark .nl-select-option:hover{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(22 101 52/var(--tw-bg-opacity));color:rgb(134 239 172/var(--tw-text-opacity))}.theme-lemonade .nl-text-error{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity))}.theme-lemonade .dark .nl-text-error{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity))}.theme-lemonade .nl-text-success{--tw-text-opacity:1;color:rgb(13 148 136/var(--tw-text-opacity))}.theme-lemonade .dark .nl-text-success{--tw-text-opacity:1;color:rgb(45 212 191/var(--tw-text-opacity))}.theme-purple .nl-bg{--tw-bg-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);background-color:rgb(233 213 255/var(--tw-bg-opacity));box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.theme-purple .dark .nl-bg{--tw-bg-opacity:1;--tw-shadow-color:rgba(51,65,85,.7);--tw-shadow:var(--tw-shadow-colored);background-color:rgb(59 7 100/var(--tw-bg-opacity))}.theme-purple .nl-description,.theme-purple .nl-logo,.theme-purple .nl-title{--tw-text-opacity:1;color:rgb(59 7 100/var(--tw-text-opacity))}.theme-purple .dark .nl-description,.theme-purple .dark .nl-logo,.theme-purple .dark .nl-title{--tw-text-opacity:1;color:rgb(233 213 255/var(--tw-text-opacity))}.theme-purple .nl-action-button{--tw-text-opacity:1;color:rgb(59 7 100/var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.theme-purple .nl-action-button:hover{--tw-bg-opacity:1;background-color:rgb(243 232 255/var(--tw-bg-opacity))}.theme-purple .dark .nl-action-button{--tw-text-opacity:1;color:rgb(233 213 255/var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.theme-purple .dark .nl-action-button:hover{--tw-bg-opacity:1;background-color:rgb(88 28 135/var(--tw-bg-opacity))}.theme-purple .nl-button{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);background-color:rgb(243 232 255/var(--tw-bg-opacity));border-color:rgb(233 213 255/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(59 7 100/var(--tw-text-opacity))}.theme-purple .nl-button:hover{--tw-bg-opacity:1;background-color:rgb(250 245 255/var(--tw-bg-opacity))}.theme-purple .dark .nl-button{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(107 33 168/var(--tw-bg-opacity));border-color:rgb(59 7 100/var(--tw-border-opacity));color:rgb(233 213 255/var(--tw-text-opacity))}.theme-purple .dark .nl-button:hover{--tw-bg-opacity:1;background-color:rgb(88 28 135/var(--tw-bg-opacity))}.theme-purple .nl-divider{--tw-text-opacity:1;color:rgb(59 7 100/var(--tw-text-opacity))}.theme-purple .nl-divider:after,.theme-purple .nl-divider:before{--tw-border-opacity:1;border-color:rgb(59 7 100/var(--tw-border-opacity));content:var(--tw-content)}.theme-purple .dark .nl-divider{--tw-text-opacity:1;color:rgb(233 213 255/var(--tw-text-opacity))}.theme-purple .dark .nl-divider:after,.theme-purple .dark .nl-divider:before{--tw-border-opacity:1;border-color:rgb(233 213 255/var(--tw-border-opacity));content:var(--tw-content)}.theme-purple .nl-footer{--tw-text-opacity:1;color:rgb(59 7 100/var(--tw-text-opacity))}.theme-purple .dark .nl-footer{--tw-text-opacity:1;color:rgb(233 213 255/var(--tw-text-opacity))}.theme-purple .nl-error{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity))}.theme-purple .dark .nl-error{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity))}.theme-purple .nl-input{--tw-bg-opacity:1;background-color:rgb(243 232 255/var(--tw-bg-opacity))}.theme-purple .nl-input:focus{--tw-border-opacity:1;--tw-ring-opacity:1;--tw-ring-color:rgb(168 85 247/var(--tw-ring-opacity));border-color:rgb(168 85 247/var(--tw-border-opacity))}.theme-purple .dark .nl-input{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(88 28 135/var(--tw-bg-opacity));color:rgb(192 132 252/var(--tw-text-opacity))}.theme-purple .dark .nl-input:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(147 51 234/var(--tw-ring-opacity))}.theme-purple .nl-select{--tw-bg-opacity:1;background-color:rgb(243 232 255/var(--tw-bg-opacity))}.theme-purple .nl-select:focus{--tw-border-opacity:1;--tw-ring-opacity:1;--tw-ring-color:rgb(168 85 247/var(--tw-ring-opacity));border-color:rgb(168 85 247/var(--tw-border-opacity))}.theme-purple .dark .nl-select{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(88 28 135/var(--tw-bg-opacity));color:rgb(192 132 252/var(--tw-text-opacity))}.theme-purple .dark .nl-select:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(147 51 234/var(--tw-ring-opacity))}.theme-purple .nl-select-list{--tw-bg-opacity:1;background-color:rgb(243 232 255/var(--tw-bg-opacity))}.theme-purple .dark .nl-select-list{--tw-bg-opacity:1;background-color:rgb(126 34 206/var(--tw-bg-opacity))}.theme-purple .nl-select-option{--tw-text-opacity:1;color:rgb(107 33 168/var(--tw-text-opacity))}.theme-purple .nl-select-option:hover{--tw-bg-opacity:1;background-color:rgb(233 213 255/var(--tw-bg-opacity))}.theme-purple .dark .nl-select-option{--tw-text-opacity:1;color:rgb(192 132 252/var(--tw-text-opacity))}.theme-purple .dark .nl-select-option:hover{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(107 33 168/var(--tw-bg-opacity));color:rgb(216 180 254/var(--tw-text-opacity))}.theme-purple .nl-text-error{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity))}.theme-purple .dark .nl-text-error{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity))}.theme-purple .nl-text-success{--tw-text-opacity:1;color:rgb(13 148 136/var(--tw-text-opacity))}.theme-purple .dark .nl-text-success{--tw-text-opacity:1;color:rgb(45 212 191/var(--tw-text-opacity))}.theme-crab .nl-button{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);background-color:rgb(254 226 226/var(--tw-bg-opacity));border-color:rgb(254 202 202/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(69 10 10/var(--tw-text-opacity))}.theme-crab .nl-button:hover{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity))}.theme-crab .dark .nl-button{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(153 27 27/var(--tw-bg-opacity));border-color:rgb(69 10 10/var(--tw-border-opacity));color:rgb(254 202 202/var(--tw-text-opacity))}.theme-crab .dark .nl-button:hover{--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity))}.show-slow{display:none;opacity:0;transition:.1s}.isOpen .show-slow{display:block;opacity:1;transition:.2s;transition-delay:.2s}:host{display:block}.animate-spin-loading{animation:spin2 1s linear infinite;background:var(--qa-dark-color)}@keyframes spin2{to{transform:rotate(1turn)}}.active{animation:blink .7s infinite alternate}@keyframes blink{0%{opacity:1}to{opacity:0}}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.left-0{left:0}.start-0{inset-inline-start:0}.top-0{top:0}.z-\\[80\\]{z-index:80}.z-\\[81\\]{z-index:81}.mx-auto{margin-left:auto;margin-right:auto}.flex{display:flex}.h-5{height:20px}.h-7{height:28px}.h-full{height:100%}.w-5{width:20px}.w-7{width:28px}.w-full{width:100%}.max-w-96{max-width:384px}.flex-shrink-0{flex-shrink:0}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:4px}.gap-2{gap:8px}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.rounded-full{border-radius:9999px}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-transparent{border-color:transparent}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}.bg-opacity-75{--tw-bg-opacity:0.75}.p-4{padding:16px}.px-4{padding-left:16px;padding-right:16px}.py-3{padding-bottom:12px}.pt-3,.py-3{padding-top:12px}.text-center{text-align:center}.text-base{font-size:16px;line-height:24px}.text-sm{font-size:14px;line-height:20px}.font-bold{font-weight:700}.font-light{font-weight:300}.font-semibold{font-weight:600}.text-blue-400{--tw-text-opacity:1;color:rgb(96 165 250/var(--tw-text-opacity))}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.dark\\:focus\\:outline-none:focus:is(.dark *){outline:2px solid transparent;outline-offset:2px}.dark\\:focus\\:ring-1:focus:is(.dark *){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.dark\\:focus\\:ring-gray-600:focus:is(.dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(75 85 99/var(--tw-ring-opacity))}@media (min-width:640px){.sm\\:mx-auto{margin-left:auto;margin-right:auto}.sm\\:w-full{width:100%}.sm\\:max-w-lg{max-width:512px}}.pointer-events-none{pointer-events:none}.inset-y-0{bottom:0;top:0}.end-0{inset-inline-end:0}.mb-2{margin-bottom:8px}.mt-10{margin-top:40px}.inline-block{display:inline-block}.h-4{height:16px}.h-\\[20px\\]{height:20px}.w-4{width:16px}.w-\\[20px\\]{width:20px}.max-w-72{max-width:288px}.rounded-lg{border-radius:.5rem}.border-\\[2px\\]{border-width:2px}.border-current{border-color:currentColor}.border-t-transparent{border-top-color:transparent}.p-2{padding:8px}.pe-11{padding-inline-end:44px}.ps-11{padding-inline-start:44px}.ps-4{padding-inline-start:16px}.pt-2{padding-top:8px}.text-2xl{font-size:24px;line-height:32px}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-slate-900{--tw-text-opacity:1;color:rgb(15 23 42/var(--tw-text-opacity))}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:opacity-50:disabled{opacity:.5}.peer:disabled~.peer-disabled\\:pointer-events-none{pointer-events:none}.peer:disabled~.peer-disabled\\:opacity-50{opacity:.5}.dark\\:border-transparent:is(.dark *){border-color:transparent}.dark\\:text-gray-300:is(.dark *){--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}.right-\\[-2px\\]{right:-2px}.right-\\[-3px\\]{right:-3px}.top-\\[-2px\\]{top:-2px}.top-\\[-3px\\]{top:-3px}.ml-auto,.mx-auto{margin-left:auto}.h-1\\.5{height:6px}.h-3{height:12px}.h-6{height:24px}.w-1\\.5{width:6px}.w-3{width:12px}.max-w-6{max-width:24px}.max-w-7{max-width:28px}.gap-0\\.5{gap:2px}.gap-x-3\\.5{column-gap:14px}.overflow-hidden,.truncate{overflow:hidden}.truncate{text-overflow:ellipsis;white-space:nowrap}.border-2{border-width:2px}.border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.border-gray-400{--tw-border-opacity:1;border-color:rgb(156 163 175/var(--tw-border-opacity))}.border-white{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}.bg-green-500{--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.px-3{padding-left:12px;padding-right:12px}.py-2{padding-bottom:8px;padding-top:8px}.pb-1\\.5{padding-bottom:6px}.pb-3{padding-bottom:12px}.pt-0{padding-top:0}.pt-5{padding-top:20px}.text-4xl{font-size:36px;line-height:40px}.text-lg{font-size:18px;line-height:28px}.font-medium{font-weight:500}.uppercase{text-transform:uppercase}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.hover\\:bg-gray-400:hover{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity))}.hover\\:text-red-600:hover{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity))}.group:hover .group-hover\\:border-blue-400{--tw-border-opacity:1;border-color:rgb(96 165 250/var(--tw-border-opacity))}.max-w-52{max-width:208px}.gap-3{gap:12px}.pb-5{padding-bottom:20px}.text-3xl{font-size:30px;line-height:36px}.inline-flex{display:inline-flex}.gap-x-2{column-gap:8px}.py-2\\.5{padding-bottom:10px;padding-top:10px}.w-auto{width:auto}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity))}.border-orange-300{--tw-border-opacity:1;border-color:rgb(253 186 116/var(--tw-border-opacity))}.border-red-300{--tw-border-opacity:1;border-color:rgb(252 165 165/var(--tw-border-opacity))}.border-teal-300{--tw-border-opacity:1;border-color:rgb(94 234 212/var(--tw-border-opacity))}.border-yellow-300{--tw-border-opacity:1;border-color:rgb(253 224 71/var(--tw-border-opacity))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.bg-orange-100{--tw-bg-opacity:1;background-color:rgb(255 237 213/var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity))}.bg-teal-100{--tw-bg-opacity:1;background-color:rgb(204 251 241/var(--tw-bg-opacity))}.bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity))}.px-1{padding-left:4px;padding-right:4px}.text-\\[10px\\]{font-size:10px}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.text-orange-600{--tw-text-opacity:1;color:rgb(234 88 12/var(--tw-text-opacity))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity))}.text-teal-600{--tw-text-opacity:1;color:rgb(13 148 136/var(--tw-text-opacity))}.text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity))}.mt-1{margin-top:4px}.hidden{display:none}.min-w-\\[15rem\\]{min-width:15rem}.rotate-0{--tw-rotate:0deg}.rotate-0,.rotate-180{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate:180deg}.overflow-hidden,.truncate{overflow:hidden}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.duration-300{transition-duration:.3s}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:-top-4:before{content:var(--tw-content);top:-16px}.before\\:start-0:before{content:var(--tw-content);inset-inline-start:0}.before\\:h-4:before{content:var(--tw-content);height:16px}.before\\:w-full:before{content:var(--tw-content);width:100%}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:-bottom-4:after{bottom:-16px;content:var(--tw-content)}.after\\:start-0:after{content:var(--tw-content);inset-inline-start:0}.after\\:h-4:after{content:var(--tw-content);height:16px}.after\\:w-full:after{content:var(--tw-content);width:100%}.mr-auto{margin-right:auto}.mt-3{margin-top:12px}.w-60{width:240px}.mb-10{margin-bottom:40px}.ml-auto{margin-left:auto}.h-20{height:80px}.w-20{width:80px}.w-72{width:288px}.border-\\[4px\\]{border-width:4px}.pe-4{padding-inline-end:16px}.ml-2{margin-left:8px}.mt-0{margin-top:0}.max-h-0{max-height:0}.max-h-\\[500px\\]{max-height:500px}.cursor-default{cursor:default}.border-b-\\[1px\\]{border-bottom-width:1px}.border-dashed{border-style:dashed}.border-blue-500{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity))}.pb-1{padding-bottom:4px}.text-xs{font-size:12px;line-height:16px}.decoration-dashed{text-decoration-style:dashed}.opacity-50{opacity:.5}.grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.duration-\\[0\\.25s\\]{transition-duration:.25s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.hover\\:bg-gray-300:hover{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity))}.border-\\[3px\\]{border-width:3px}.mb-0\\.5{margin-bottom:2px}.mb-5{margin-bottom:20px}.pb-2{padding-bottom:8px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.h-12{height:48px}.w-12{width:48px}.text-green-800{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity))}.dark\\:text-green-200:is(.dark *){--tw-text-opacity:1;color:rgb(187 247 208/var(--tw-text-opacity))}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}.mt-2{margin-top:8px}.flex-1{flex:1 1 0%}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(4px*var(--tw-space-y-reverse));margin-top:calc(4px*(1 - var(--tw-space-y-reverse)))}.rounded{border-radius:.25rem}.bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity))}.p-3{padding:12px}.px-2{padding-left:8px;padding-right:8px}.py-1{padding-bottom:4px;padding-top:4px}.py-1\\.5{padding-bottom:6px;padding-top:6px}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.underline{text-decoration-line:underline}.hover\\:bg-blue-600:hover{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity))}.hover\\:text-blue-700:hover{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity))}.hover\\:text-gray-700:hover{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.hover\\:text-red-700:hover{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity))}.dark\\:border-gray-600:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 85 99/var(--tw-border-opacity))}.dark\\:bg-gray-700:is(.dark *){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.dark\\:bg-gray-800:is(.dark *){--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity))}.dark\\:text-blue-400:is(.dark *){--tw-text-opacity:1;color:rgb(96 165 250/var(--tw-text-opacity))}.dark\\:text-gray-100:is(.dark *){--tw-text-opacity:1;color:rgb(243 244 246/var(--tw-text-opacity))}.dark\\:text-gray-400:is(.dark *){--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.dark\\:text-red-400:is(.dark *){--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity))}.dark\\:hover\\:text-blue-300:hover:is(.dark *){--tw-text-opacity:1;color:rgb(147 197 253/var(--tw-text-opacity))}.dark\\:hover\\:text-gray-300:hover:is(.dark *){--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}.dark\\:hover\\:text-red-300:hover:is(.dark *){--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity))}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}.mt-0\\.5{margin-top:2px}.items-start{align-items:flex-start}.border-yellow-400{--tw-border-opacity:1;border-color:rgb(250 204 21/var(--tw-border-opacity))}.bg-yellow-50{--tw-bg-opacity:1;background-color:rgb(254 252 232/var(--tw-bg-opacity))}.dark\\:border-yellow-600:is(.dark *){--tw-border-opacity:1;border-color:rgb(202 138 4/var(--tw-border-opacity))}.dark\\:bg-yellow-900\\/20:is(.dark *){background-color:rgba(113,63,18,.2)}.right-0{right:0}.right-2{right:8px}.top-2{top:8px}.top-52{top:208px}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.m-auto{margin:auto}.ml-0{margin-left:0}.ml-\\[2px\\]{margin-left:2px}.mr-0{margin-right:0}.mr-2{margin-right:8px}.mr-3\\.5{margin-right:14px}.grid{display:grid}.h-0{height:0}.h-8{height:32px}.h-\\[46px\\]{height:46px}.h-auto{height:auto}.w-0{width:0}.w-16{width:64px}.w-52{width:208px}.w-6{width:24px}.w-8{width:32px}.w-\\[48px\\]{width:48px}.min-w-40{min-width:160px}.max-w-40{max-width:160px}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.place-items-center{place-items:center}.text-nowrap{text-wrap:nowrap}.rounded-r-lg{border-bottom-right-radius:.5rem;border-top-right-radius:.5rem}.rounded-r-none{border-bottom-right-radius:0;border-top-right-radius:0}.border-\\[0px\\]{border-width:0}.pl-\\[11px\\]{padding-left:11px}.opacity-0{opacity:0}.transition-all{transition-duration:.15s;transition-property:all}.ease-in-out,.transition-all{transition-timing-function:cubic-bezier(.4,0,.2,1)}.hover\\:right-2:hover{right:8px}.hover\\:rounded-r-lg:hover{border-bottom-right-radius:.5rem;border-top-right-radius:.5rem}",buttonBaseCss=baseCss,ButtonBaseStyle0=buttonBaseCss,ButtonBase=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.theme="default",this.darkMode=!1,this.titleBtn="Open modal",this.disabled=!1}componentDidRender(){const e=this.element.querySelector("svg");e&&(e.classList.add("flex-shrink-0","w-4","h-4","block"),e.removeAttribute("style"))}render(){return h("div",{key:"1048576f0a9839c56cac030b1de7899b25b5f39e",class:`theme-${this.theme}`},h("div",{key:"ea29f74a1f7e4268802c6e4aaca5867dfd2e4c9b",class:"animate-spin-loading active"}),h("button",{key:"71f84d47b11aa3971818b686f8dddb74e0d36eb0",disabled:this.disabled,type:"button",class:"nl-button py-2.5 px-3 w-full inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-lg disabled:opacity-50 disabled:pointer-events-none dark:focus:outline-none dark:focus:ring-1 dark:focus:ring-gray-600"},h("slot",{key:"91a91994e20dc10e3bbb2576e4214fa98533be8e",name:"icon-start"}),this.titleBtn))}get element(){return this}static get style(){return ButtonBaseStyle0}},[4,"button-base",{theme:[1025],darkMode:[1028,"dark-mode"],titleBtn:[1,"title-btn"],disabled:[4]}]);function defineCustomElement$s(){if("undefined"==typeof customElements)return;["button-base"].forEach((e=>{if("button-base"===e)customElements.get(e)||customElements.define(e,ButtonBase)}))}defineCustomElement$s();const nlConfirmLogoutCss=baseCss,NlConfirmLogoutStyle0=nlConfirmLogoutCss,NlConfirmLogout$1=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.handleLogoutBanner=createEvent$1(this,"handleLogoutBanner"),this.handleBackUpModal=createEvent$1(this,"handleBackUpModal"),this.nlCloseModal=createEvent$1(this,"nlCloseModal"),this.titleModal="Delete keys?",this.description="Your profile keys are stored in this browser tab and will be deleted if you log out, and your profile will be inaccessible."}handleLogout(){this.handleLogoutBanner.emit(METHOD_MODULE.LOGOUT),this.nlCloseModal.emit()}handleCancel(){this.nlCloseModal.emit()}handleBackUp(){state.path=[CURRENT_MODULE.IMPORT_FLOW]}render(){return h("div",{key:"fe605f38f9d0a440fe53e21f19288c41e4762c22",class:"p-4 overflow-y-auto"},h("h1",{key:"84d14a59035515b2fd612d262400a038887a10d7",class:"nl-title font-bold text-center text-4xl"},this.titleModal),h("p",{key:"83ef73271c76309561be95e0207f8130d75a161c",class:"nl-description font-light text-center text-lg pt-2 max-w-96 mx-auto"},this.description),h("div",{key:"fce0f132846beb95dd9e41357f5ab87be7229a56",class:"mt-3 ml-auto mr-auto w-60 flex flex-col gap-2"},h("button-base",{key:"c4fc722a7c98d84e797963ed7fe928164411b701",onClick:()=>this.handleBackUp(),titleBtn:"Backup keys",theme:"lemonade"}),h("button-base",{key:"39df385a9a8dc3fcd74f4196d4191bc4a308a16d",onClick:()=>this.handleLogout(),theme:"crab",titleBtn:"Logout and delete keys"})))}static get style(){return NlConfirmLogoutStyle0}},[0,"nl-confirm-logout",{titleModal:[1,"title-modal"],description:[1]}]);function defineCustomElement$r(){if("undefined"==typeof customElements)return;["nl-confirm-logout","button-base"].forEach((e=>{switch(e){case"nl-confirm-logout":customElements.get(e)||customElements.define(e,NlConfirmLogout$1);break;case"button-base":customElements.get(e)||defineCustomElement$s()}}))}defineCustomElement$r();const nlNip46RelaySettingsCss=baseCss,NlNip46RelaySettingsStyle0=nlNip46RelaySettingsCss,FACTORY_DEFAULT_RELAYS=["wss://relay.nsec.app/","wss://ephemeral.snowflare.cc/"],NlNip46RelaySettings=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlRelaysChanged=createEvent$1(this,"nlRelaysChanged"),this.defaultRelays=[...FACTORY_DEFAULT_RELAYS],this.relays=[],this.newRelay="",this.showSettings=!1}componentWillLoad(){this.relays=[...this.defaultRelays]}addRelay(){const e=this.newRelay.trim();e&&(e.startsWith("wss://")||e.startsWith("ws://"))&&(this.relays.includes(e)||(this.relays=[...this.relays,e],this.newRelay="",this.nlRelaysChanged.emit(this.relays)))}removeRelay(e){this.relays=this.relays.filter(((t,n)=>n!==e)),this.nlRelaysChanged.emit(this.relays)}resetToDefaults(){this.relays=[...FACTORY_DEFAULT_RELAYS],this.nlRelaysChanged.emit(this.relays)}render(){return h("div",{key:"b21c3d9935218ccd1d552b9f635bd2a5577f50c0",class:"nip46-relay-settings mb-4"},h("button",{key:"aa9bd7bb3bd4310b1a02edfc1c010a7907dc79ce",type:"button",class:"text-xs text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 underline cursor-pointer",onClick:()=>this.showSettings=!this.showSettings},this.showSettings?"▼":"▶"," Advanced: Relay Settings"),this.showSettings&&h("div",{key:"bfafd2a8bfae6b9829c553f286d5d80f16011b2e",class:"mt-2 p-3 border border-gray-300 dark:border-gray-600 rounded bg-gray-50 dark:bg-gray-800"},h("div",{key:"6bcfc31c24f3eb074e0101cdb319b19806550db9",class:"flex justify-between items-center mb-2"},h("div",{key:"32d87ef74ecfd3f330ce88ab1802878bed40d680",class:"text-xs font-semibold text-gray-700 dark:text-gray-300"},"Nip46 Relays:"),h("button",{key:"26c7843cff229b73d33e86238eadbbdbde33955e",type:"button",class:"text-xs text-blue-500 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300 underline cursor-pointer",onClick:()=>this.resetToDefaults()},"Reset to defaults")),h("ul",{key:"d6419de90eb296e91df6e6ede131d41c22d9e0e8",class:"text-xs mb-3 space-y-1"},this.relays.map(((e,t)=>h("li",{class:"flex justify-between items-center py-1 px-2 bg-white dark:bg-gray-700 rounded"},h("span",{class:"truncate text-gray-700 dark:text-gray-300 flex-1"},e),h("button",{type:"button",class:"ml-2 text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 font-bold cursor-pointer",onClick:()=>this.removeRelay(t),title:"Remove relay"},"✕"))))),h("div",{key:"0544da279bb32591f78dff61ecb5372e3a069b06",class:"flex gap-2"},h("input",{key:"eaf3009c8d711dbbf6bc0a3f954e042d5865a669",type:"text",class:"flex-1 text-xs px-2 py-1.5 border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100",placeholder:"wss://relay.example.com",value:this.newRelay,onInput:e=>this.newRelay=e.target.value,onKeyPress:e=>{"Enter"===e.key&&(e.preventDefault(),this.addRelay())}}),h("button",{key:"1223d35e9155b6716715f0685777370e8afa32d1",type:"button",class:"text-xs px-3 py-1.5 bg-blue-500 hover:bg-blue-600 text-white rounded cursor-pointer",onClick:()=>this.addRelay()},"Add"))))}static get style(){return NlNip46RelaySettingsStyle0}},[0,"nl-nip46-relay-settings",{defaultRelays:[16],relays:[32],newRelay:[32],showSettings:[32]}]);function defineCustomElement$q(){if("undefined"==typeof customElements)return;["nl-nip46-relay-settings"].forEach((e=>{if("nl-nip46-relay-settings"===e)customElements.get(e)||customElements.define(e,NlNip46RelaySettings)}))}defineCustomElement$q();const nlConnectCss=baseCss,NlConnectStyle0=nlConnectCss,NlConnect=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlNostrConnect=createEvent$1(this,"nlNostrConnect"),this.titleWelcome="Connect to key store",this.authMethods=[],this.hasOTP=!1,this.connectionStringServices=[],this.isOpenAdvancedLogin=!1}handleChangeScreen(e){state.path=[...state.path,e]}handleOpenAdvanced(){this.isOpenAdvancedLogin=!this.isOpenAdvancedLogin}allowAuthMethod(e){return!this.authMethods.length||this.authMethods.includes(e)}componentWillLoad(){}handleOpenLink(e,t){e.preventDefault(),this.nlNostrConnect.emit(t)}handleConnectionString(){this.handleChangeScreen(CURRENT_MODULE.CONNECTION_STRING)}render(){const e=(this.isOpenAdvancedLogin?"rotate-180":"rotate-0")+" duration-300 flex-shrink-0 w-4 h-4 text-blue-500";return h(Fragment,{key:"7361ac64cb9b8b02f85a97bc8dc01e2c9ab8b01c"},h("div",{key:"6e9a8335ae521f6e9a67ed433cb9ca9501f2e062",class:"p-4 overflow-y-auto"},h("h1",{key:"3ba01b15367e43824fea55967fa949da53bd956c",class:"nl-title font-bold text-center text-3xl"},this.titleWelcome)),h("div",{key:"0a7995f42d602d73f3ad23bff7d8a6995763acbc",class:"p-4"},Boolean(this.connectionStringServices.length)&&h("div",{key:"dd90d4a123c1940aa4cace1291262811d21352a8",class:"max-w-96 mx-auto pt-5"},h("p",{key:"2e122c0d1274fe996f37aadb54e2b1135084b906",class:"nl-description font-medium text-sm pb-1.5"},"Select key store:"),h("ul",{key:"54c38861f6bbb2eb1198ad8a7aeddd38104b33e4",class:"p-2 rounded-lg border border-gray-200 flex flex-col w-full gap-0.5"},this.connectionStringServices.map((e=>{const t="loading"===e.available,n=!1===e.available,o=t||n;return h("li",{class:o?"opacity-50 pointer-events-none":""},h("a",{href:o?void 0:e.link,target:"_blank",onClick:t=>{o?t.preventDefault():this.handleOpenLink(t,e)},class:"flex items-center gap-x-3.5 w-full py-2 px-3 rounded-lg text-sm justify-between "+(o?"cursor-default":"hover:bg-gray-300 cursor-pointer")},h("div",{class:"w-full max-w-7 h-7 flex relative"},h("div",{class:"uppercase font-bold w-full h-full rounded-full border border-gray-400 flex justify-center items-center"},Boolean(e.img)?h("img",{class:"w-full rounded-full "+(n?"grayscale":""),src:e.img,alt:e.name}):h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"#9ca3af",class:"w-4 h-4 block"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"})))),h("div",{class:"overflow-hidden flex flex-col w-full"},h("div",{class:"nl-title truncate overflow-hidden"},e.name,t&&h("span",{class:"nl-description text-xs ml-2"},"checking..."),n&&h("span",{class:"nl-description text-xs ml-2"},"offline")))))}))))),h("div",{key:"c372f1e8bd0cceb7b9660612eb6158d5ec625d3e",class:"ps-4 pe-4 overflow-y-auto"},h("p",{key:"0b6c50602854cf06554c92505cfce1ef215e8f7d",class:"nl-error font-light text-center text-sm max-w-96 mx-auto"},state.error)),h("div",{key:"a67dd79c1f13bdc0636a34e4f0c6c0df80293aa6",class:"max-w-72 mx-auto"},h("nl-nip46-relay-settings",{key:"0f358c327060445e14313331ca5e1ee8175d1493",defaultRelays:state.customNip46Relays,onNlRelaysChanged:e=>{state.customNip46Relays=e.detail}})),h("div",{key:"beccc66491904a50dc44c720fa5e32208e1ff61e",class:"max-w-52 mx-auto pb-5"},(this.allowAuthMethod("connect")||this.allowAuthMethod("readOnly"))&&h("div",{key:"7e670e898fd405c82cb749699a73d087525f4475",class:"flex justify-center"},h("div",{key:"634509b97941ceeda9338cc29d431dcafab17b04",onClick:()=>this.handleOpenAdvanced(),class:"text-blue-500 mt-3 decoration-dashed cursor-pointer inline-flex gap-2 items-center pb-1 border-dashed border-b-[1px] border-blue-500 text-sm font-light"},"Advanced",h("svg",{key:"3e14d6c45fb72b1ad47beea455b36001ecb6c394",class:e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},h("path",{key:"0ebce63b4caffd049c6e5a110792ca138e2e914b",d:"m6 9 6 6 6-6"})))),h("div",{key:"7d22deba5c378a53056eae0884e0d051504d7c5b",class:(this.isOpenAdvancedLogin?"max-h-[500px] mt-3 duration-300":"max-h-0 mt-0 duration-[0.25s]")+" transition-max-height ease-in flex gap-3 flex-col overflow-hidden"},this.allowAuthMethod("connect")&&h("button-base",{key:"c4bbb92fcbf14048429099e26ab6e886a87e62f6",titleBtn:"User name",onClick:()=>this.handleChangeScreen(CURRENT_MODULE.LOGIN)},h("svg",{key:"8482dadd22930b1c17b328441a15609d41bc6c8d",style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},h("path",{key:"ce5b427cba70a646c07ce61ea738765322e6c4ff","stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"}))),this.allowAuthMethod("connect")&&h("button-base",{key:"2859b956807892b0fcbbd88433733c7a905ad4f1",titleBtn:"Connection string",onClick:()=>this.handleConnectionString()},h("svg",{key:"8e2f155b9c5bfbec2f88a97013111739065c9914",style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{key:"3071eb6d992c31d5fb11a03ec5c3c9dabde9eff1","stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 4.875c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5A1.125 1.125 0 0 1 3.75 9.375v-4.5ZM3.75 14.625c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5a1.125 1.125 0 0 1-1.125-1.125v-4.5ZM13.5 4.875c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5A1.125 1.125 0 0 1 13.5 9.375v-4.5Z"}),h("path",{key:"fa667a1e898b232c1db217d10458c926b559568f","stroke-linecap":"round","stroke-linejoin":"round",d:"M6.75 6.75h.75v.75h-.75v-.75ZM6.75 16.5h.75v.75h-.75v-.75ZM16.5 6.75h.75v.75h-.75v-.75ZM13.5 13.5h.75v.75h-.75v-.75ZM13.5 19.5h.75v.75h-.75v-.75ZM19.5 13.5h.75v.75h-.75v-.75ZM19.5 19.5h.75v.75h-.75v-.75ZM16.5 16.5h.75v.75h-.75v-.75Z"}))),this.allowAuthMethod("connect")&&h("button-base",{key:"5c66ae1e86bae7a9c3fbc975a92eefae2d4253ec",onClick:()=>this.handleChangeScreen(CURRENT_MODULE.LOGIN_BUNKER_URL),titleBtn:"Bunker URL"},h("svg",{key:"04d85bf0ac2f66b44a9ddd95815dd20d81935bad",style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{key:"763ef4a4f3f6f7807187e4d6aef8eecb7b858a44","stroke-linecap":"round","stroke-linejoin":"round",d:"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"}))))))}static get style(){return NlConnectStyle0}},[0,"nl-connect",{titleWelcome:[1,"title-welcome"],authMethods:[16],hasOTP:[4,"has-o-t-p"],connectionStringServices:[16],isOpenAdvancedLogin:[32]}]);function defineCustomElement$p(){if("undefined"==typeof customElements)return;["nl-connect","button-base","nl-nip46-relay-settings"].forEach((e=>{switch(e){case"nl-connect":customElements.get(e)||customElements.define(e,NlConnect);break;case"button-base":customElements.get(e)||defineCustomElement$s();break;case"nl-nip46-relay-settings":customElements.get(e)||defineCustomElement$q()}}))}defineCustomElement$p();const nlIframeCss=baseCss,NlIframeStyle0=nlIframeCss,NlConfirmLogout=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlCloseModal=createEvent$1(this,"nlCloseModal"),this.titleModal="Confirm",this.description="Your profile keys are stored in this browser tab and will be deleted if you log out, and your profile will be inaccessible.",this.iframeUrl=""}handleCancel(){this.nlCloseModal.emit()}render(){return h("div",{key:"954ed56c0b6069cbcaae788121d82733c772e5d6",class:"p-4 overflow-y-auto"},h("div",{key:"4f62e37fc1d19d9da953eef1d5e7df66256c2e50",class:"mt-3 flex flex-col gap-2"},this.iframeUrl&&h("iframe",{key:"26aee24e31d903e2207b6664b29904fd5b94deac",src:this.iframeUrl,style:{width:"100%",height:"600px",border:"1px solid #ccc",borderRadius:"8px"}})))}static get style(){return NlIframeStyle0}},[0,"nl-iframe",{titleModal:[1,"title-modal"],description:[1],iframeUrl:[1,"iframe-url"]}]);function defineCustomElement$o(){if("undefined"==typeof customElements)return;["nl-iframe"].forEach((e=>{if("nl-iframe"===e)customElements.get(e)||customElements.define(e,NlConfirmLogout)}))}defineCustomElement$o();const nlSelectCss=baseCss,NlSelectStyle0=nlSelectCss,NlSelect=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.selectDomain=createEvent$1(this,"selectDomain"),this.isOpen=!1,this.value=null,this.options=void 0,this.selected=void 0,this.mode=!1,this.darkMode=!1,this.themeState="default",this.theme="default"}handleWindowClick(){this.wrapperRef.querySelector(".listClass")&&(this.isOpen=!1)}toggleDropdown(){this.isOpen=!this.isOpen,this.calculateDropdownPosition()}watchPropHandler(e){this.themeState=e}watchModeHandler(e){this.mode=e}connectedCallback(){this.themeState=this.theme,this.mode=this.darkMode,this.value=this.options[this.selected],this.selectDomain.emit(this.value.value)}calculateDropdownPosition(){if(this.isOpen&&this.buttonRef){const e=this.buttonRef.getBoundingClientRect();this.ulRef.style.top=`${e.height}px`}}handleChange(e){this.value=e,this.isOpen=!1,this.selectDomain.emit(this.value.value)}render(){const e=(this.isOpen?"listClass":"hidden")+" min-w-[15rem] nl-select-list absolute left-0 shadow-md rounded-lg p-2 mt-1 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full",t=(this.isOpen?"rotate-180":"rotate-0")+" duration-300 flex-shrink-0 w-4 h-4 text-gray-500";return h("div",{key:"c86084c50712455e04682a4392e490bc0e20eb1d",class:`theme-${this.themeState}`},h("div",{key:"a90d9b4af52845a9971c39cec69c13493d511381",class:"relative",ref:e=>this.wrapperRef=e},h("button",{key:"1391137997bf8fcd0a5466cd9fa20c79b4ce27ba",ref:e=>this.buttonRef=e,onClick:()=>this.toggleDropdown(),type:"button",class:"nl-select peer py-3 px-4 flex items-center w-full justify-between border-transparent rounded-lg text-sm disabled:opacity-50 disabled:pointer-events-none dark:border-transparent"},h("span",{key:"224425ab92ba3599595924972e98a0fc9cb1a189",class:"truncate overflow-hidden"},this.value.name),h("svg",{key:"8eb2a2b552cb9ea36fb1abc61d804efb423afda6",class:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},h("path",{key:"feea1a7f54f4a111b7bf01e3945445311b97ab82",d:"m6 9 6 6 6-6"}))),h("ul",{key:"fca4982f04f4133d5c2a2f613a7e7d977dd5c241",ref:e=>this.ulRef=e,class:e},this.options.map((e=>h("li",{onClick:()=>this.handleChange(e),class:"nl-select-option flex cursor-pointer items-center gap-x-3.5 py-2 px-3 rounded-lg text-sm"},e.name))))))}get element(){return this}static get watchers(){return{theme:["watchPropHandler"],darkMode:["watchModeHandler"]}}static get style(){return NlSelectStyle0}},[0,"nl-select",{options:[16],selected:[2],darkMode:[4,"dark-mode"],theme:[1],isOpen:[32],value:[32],mode:[32],themeState:[32]},[[8,"click","handleWindowClick"]],{theme:["watchPropHandler"],darkMode:["watchModeHandler"]}]);function defineCustomElement$n(){if("undefined"==typeof customElements)return;["nl-select"].forEach((e=>{if("nl-select"===e)customElements.get(e)||customElements.define(e,NlSelect)}))}defineCustomElement$n();const nlImportFlowCss=baseCss,NlImportFlowStyle0=nlImportFlowCss,NlImportFlow$1=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlImportAccount=createEvent$1(this,"nlImportAccount"),this.nlExportKeys=createEvent$1(this,"nlExportKeys"),this.titleInfo="Back up your keys",this.titleImport="Choose a service",this.services=[],this.isContinued=!1,this.isKeyBackup=!1,this.isCopy=!1}handleDomainSelect(e){const t=this.services.find((t=>t.domain===e.detail));state.nlImport=t}handleCreateAccount(e){e.preventDefault(),this.nlImportAccount.emit(state.nlImport)}handleContinue(){this.isContinued=!0}handleContinueKeyBackup(){this.isKeyBackup=!0}async copyToClipboard(){this.nlExportKeys.emit(),this.isCopy=!0,setTimeout((()=>{this.isCopy=!1}),1500)}render(){if(!this.isContinued&&!this.isKeyBackup)return h("div",{class:"p-4 overflow-y-auto"},h("h1",{class:"nl-title font-bold text-center text-2xl"},this.titleInfo),h("p",{class:"nl-description font-light text-sm pt-2 pb-2 max-w-96 mx-auto"},"Nostr profiles are controlled by cryptographic keys.",h("br",null),h("br",null),"Your keys are currently only stored in this browser tab, and may be lost if you close it.",h("br",null),h("br",null),"You should backup your keys.",h("br",null),h("br",null),"We recommend to import your keys into a key store service, to protect them and to use with other apps."),h("div",{class:"ml-auto mr-auto mb-2 w-72"},h("button-base",{onClick:()=>this.handleContinue(),titleBtn:"Import to key store"})),h("div",{class:"ml-auto mr-auto w-72"},h("button-base",{onClick:()=>this.handleContinueKeyBackup(),titleBtn:"Export keys"})));if(this.isKeyBackup)return h("div",{class:"p-4 overflow-y-auto"},h("h1",{class:"nl-title font-bold text-center text-2xl"},"Key export"),h("p",{class:"nl-description font-light text-sm pt-2 pb-2 max-w-96 mx-auto"},"Copy your keys and store them in a safe place, like a password manager.",h("br",null),h("br",null),"You can sign into other Nostr apps by pasting your keys into them.",h("br",null),h("br",null),"Your keys must be kept secret, never share them with anyone."),h("div",{class:"max-w-72 mx-auto"},h("div",{class:"ml-auto mr-auto mb-2 w-72"},h("button-base",{onClick:()=>this.copyToClipboard(),titleBtn:this.isCopy?"Copied!":"Copy to clipboard"}))));const e=this.services.filter((e=>e.canImport)).map((e=>({name:e.domain,value:e.domain})));return h(Fragment,null,h("div",{class:"p-4 overflow-y-auto"},h("h1",{class:"nl-title font-bold text-center text-2xl"},this.titleImport),h("p",{class:"nl-description font-light text-center text-sm pt-2 max-w-96 mx-auto"},"Your Nostr keys will be imported into the service you choose. You will manage your keys on their website.")),h("div",{class:"max-w-72 mx-auto mb-5"},h("div",{class:"mb-0.5"},h("nl-select",{onSelectDomain:e=>this.handleDomainSelect(e),selected:0,options:e})),h("p",{class:"nl-title font-light text-sm mb-2"},"Default provider is a fine choice to start with."),h("div",{class:"ps-4 pe-4 overflow-y-auto"},h("p",{class:"nl-error font-light text-center text-sm max-w-96 mx-auto"},state.error)),h("button-base",{disabled:state.isLoading,onClick:e=>this.handleCreateAccount(e),titleBtn:"Start importing"},state.isLoading?h("span",{slot:"icon-start",class:"animate-spin-loading inline-block w-4 h-4 border-[3px] border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"}):h("svg",{slot:"icon-start",style:{display:"none"},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M18 7.5v3m0 0v3m0-3h3m-3 0h-3m-2.25-4.125a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0ZM3 19.235v-.11a6.375 6.375 0 0 1 12.75 0v.109A12.318 12.318 0 0 1 9.374 21c-2.331 0-4.512-.645-6.374-1.766Z"})))))}static get style(){return NlImportFlowStyle0}},[0,"nl-import-flow",{titleInfo:[1025,"title-info"],titleImport:[1,"title-import"],services:[16],isContinued:[32],isKeyBackup:[32],isCopy:[32]}]);function defineCustomElement$m(){if("undefined"==typeof customElements)return;["nl-import-flow","button-base","nl-select"].forEach((e=>{switch(e){case"nl-import-flow":customElements.get(e)||customElements.define(e,NlImportFlow$1);break;case"button-base":customElements.get(e)||defineCustomElement$s();break;case"nl-select":customElements.get(e)||defineCustomElement$n()}}))}defineCustomElement$m();const nlInfoCss=baseCss,NlInfoStyle0=nlInfoCss,NlInfo=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost()}render(){return h("div",{key:"ff51154f6dd944fd5de65bc2e8835c6b4b1cfa57",class:"p-4 overflow-y-auto"},h("svg",{key:"c04db0af7e108551b3b9de37dfe5c2175b6439f4",class:"w-12 h-12 mx-auto mb-2",width:"225",height:"224",viewBox:"0 0 225 224",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("rect",{key:"6a4d8f9847e857973d4e089a74fec6f8e50fc09d",width:"224.047",height:"224",rx:"64",fill:"#6951FA"}),h("path",{key:"a5bddb82b767722286b2165bc03e6d7aec7fee98",d:"M162.441 135.941V88.0593C170.359 85.1674 176 77.5348 176 68.6696C176 57.2919 166.708 48 155.33 48C143.953 48 134.661 57.2444 134.661 68.6696C134.661 77.5822 140.302 85.1674 148.219 88.0593V135.941C147.698 136.13 147.176 136.367 146.655 136.604L87.3956 77.3452C88.6282 74.6904 89.2919 71.7511 89.2919 68.6696C89.2919 57.2444 80.0474 48 68.6696 48C57.2919 48 48 57.2444 48 68.6696C48 77.5822 53.6415 85.1674 61.5585 88.0593V135.941C53.6415 138.833 48 146.465 48 155.33C48 166.708 57.2444 176 68.6696 176C80.0948 176 89.3393 166.708 89.3393 155.33C89.3393 146.418 83.6978 138.833 75.7807 135.941V88.0593C76.3022 87.8696 76.8237 87.6326 77.3452 87.3956L136.604 146.655C135.372 149.31 134.708 152.249 134.708 155.33C134.708 166.708 143.953 176 155.378 176C166.803 176 176.047 166.708 176.047 155.33C176.047 146.418 170.406 138.833 162.489 135.941H162.441Z",fill:"white"})),h("h1",{key:"b3264a68c05a73a83c01c2e54c7088bb234ca40d",class:"nl-title font-bold text-center text-4xl"},"Nostr ",h("span",{key:"ace01503f2160f1589229fbc732c7b5cf5aeedcc",class:"font-light"},"Login")),h("p",{key:"204c3ce4a21857081eb6e65c4b4a8d5356ab2722",class:"text-green-800 dark:text-green-200 font-light text-center text-lg pt-2 max-w-96 mx-auto"},"Version: 1.7.11"),h("p",{key:"88790a07beaad70f1d6e77ce77b30b87c7a73f3c",class:"nl-description font-light text-center text-lg pt-2 max-w-96 mx-auto"},"Learn more about Nostr"," ",h("a",{key:"129c8383ab18b01fba2b13c5b805435b24056e18",target:"_blank",href:"https://nostr.how"},"here"),".",h("br",{key:"8c1cca37a0992068c94a22ec8dea3e859db97e4a"}),"This is an"," ",h("a",{key:"eb270824dba82f0a707715724b165af90f86d25b",target:"_blank",href:"https://github.com/nostrband/nostr-login"},"open-source")," ","tool by"," ",h("a",{key:"d64434bf56e2083bf82ad90a2daf003a3c368ddc",target:"_blank",href:"https://nostr.band"},"Nostr.Band"),"."))}static get style(){return NlInfoStyle0}},[0,"nl-info"]);function defineCustomElement$l(){if("undefined"==typeof customElements)return;["nl-info"].forEach((e=>{if("nl-info"===e)customElements.get(e)||customElements.define(e,NlInfo)}))}defineCustomElement$l();const nlInfoExtensionCss=baseCss,NlInfoExtensionStyle0=nlInfoExtensionCss,NlInfoExtension=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost()}render(){return h("div",{key:"1d919493f0e640d5394470dd77ad586c8ad949d4",class:"p-4 overflow-y-auto"},state.isLoadingExtension?h("div",null,h("h1",{class:"nl-title font-bold text-center text-4xl"},"Signing in..."),h("div",{class:"mt-10 mb-10 ml-auto mr-auto w-20"},h("span",{slot:"icon-start",class:"animate-spin-loading ml-auto mr-auto inline-block w-20 h-20 border-[4px] border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"})),h("div",{class:"ps-4 pe-4 overflow-y-auto"},h("p",{class:"nl-error font-light text-center text-sm max-w-96 mx-auto"},state.error))):h("div",null,h("h1",{class:"nl-title font-bold text-center text-4xl"},"Install browser extension!"),h("p",{class:"nl-description font-light text-center text-lg pt-2 max-w-96 mx-auto"},"Try"," ",h("a",{href:"https://getalby.com",target:"_blank"},"Alby"),","," ",h("a",{href:"https://chromewebstore.google.com/detail/nos2x/kpgefcfmnafjgpblomihpgmejjdanjjp",target:"_blank"},"nos2x")," ","or"," ",h("a",{href:"https://apps.apple.com/us/app/nostore/id1666553677",target:"_blank"},"Nostore"))))}static get style(){return NlInfoExtensionStyle0}},[0,"nl-info-extension"]);function defineCustomElement$k(){if("undefined"==typeof customElements)return;["nl-info-extension"].forEach((e=>{if("nl-info-extension"===e)customElements.get(e)||customElements.define(e,NlInfoExtension)}))}defineCustomElement$k();const nlLoadingCss=baseCss,NlLoadingStyle0=nlLoadingCss,NlLoading=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.stopFetchHandler=createEvent$1(this,"stopFetchHandler"),this.handleContinue=createEvent$1(this,"handleContinue"),this.path=void 0}handleStop(e){e.preventDefault(),this.stopFetchHandler.emit()}handleContinueClick(e){e.preventDefault(),this.handleContinue.emit()}render(){let e="Connecting...",t="Establishing connection to your key storage.";state.njumpIframe?(e="",t=""):this.path===CURRENT_MODULE.LOCAL_SIGNUP?(e="Creating...",t="Publishing your profile on Nostr."):state.authUrl&&(state.isLoading?(e="Confirming...",t="Please confirm the connection in your key storage app."):(e="Almost ready!",t="Continue to confirm the connection to your key storage."));const n=this.path!==CURRENT_MODULE.LOCAL_SIGNUP,o=!state.isLoading&&state.iframeUrl&&state.authUrl,r=state.iframeUrl?`${state.iframeUrl}?connect=${encodeURIComponent(state.authUrl)}`:"";return h("div",{key:"db647721e5ca60eed1502bf784f11973106938ff",class:"p-4 overflow-y-auto"},e&&h("h1",{key:"605d32178383840ea53a3fc16c2d760dccea0812",class:"nl-title font-bold text-center text-4xl"},e),t&&h("p",{key:"8dc819ba9544242ef05256a12f866cd88b3603cf",class:"nl-description font-light text-center text-lg pt-2 max-w-96 mx-auto"},t),!state.njumpIframe&&!state.authUrl&&state.isLoading&&h("div",{key:"f392c2a856018c4d35b01a76b77f0eec8342fb86",class:"mt-10 mb-10 ml-auto mr-auto w-20"},h("span",{key:"90541216f412c9c8d77be8988c6f9e5b654ce115",slot:"icon-start",class:"animate-spin-loading ml-auto mr-auto inline-block w-20 h-20 border-[4px] border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"})),h("div",{key:"a870a4e31048a13f400970aad850e7eab418ef06",class:"ps-4 pe-4 overflow-y-auto"},h("p",{key:"5bf2c4a5b94a4dfe1331a2fa5fb11ea4d414f353",class:"nl-error font-light text-center text-sm max-w-96 mx-auto"},state.error)),r&&h("div",{key:"854f1920def8e2354801a819f9e564ae1658e34b",class:"mt-3 ml-auto mr-auto w-72 flex justify-center"},h("iframe",{key:"a5056dbe483013c20515b8c6576af60f612e132b",src:r,width:"180px",height:"80px",style:{display:o?"block":"none",border:"0"}})),state.njumpIframe&&h("div",{key:"848d0c6cf74610b8793ade84a5c1f32fd5944b62",class:"mt-3 ml-auto mr-auto flex justify-center"},h("iframe",{key:"456702bd5c9e9b290d532aef0ec245e1212ea79f",srcdoc:state.njumpIframe,width:"600px",style:{border:"0",height:"80vh",borderRadius:"8px"}})),n&&h("div",{key:"d7b82c1fd76a8cf4edf38d2cbe2386e2ce698a81",class:"mt-3 ml-auto mr-auto w-72"},h("button-base",{key:"8465e32b53c4b86e3b1b488fddcc5937a018768f",onClick:e=>{state.authUrl&&!state.isLoading?this.handleContinueClick(e):this.handleStop(e)},titleBtn:state.isLoading?"Cancel":"Continue"})))}static get style(){return NlLoadingStyle0}},[0,"nl-loading",{path:[1]}]);function defineCustomElement$j(){if("undefined"==typeof customElements)return;["nl-loading","button-base"].forEach((e=>{switch(e){case"nl-loading":customElements.get(e)||customElements.define(e,NlLoading);break;case"button-base":customElements.get(e)||defineCustomElement$s()}}))}defineCustomElement$j();const nlLocalSignupCss=baseCss,NlLocalSignupStyle0=nlLocalSignupCss,NlLocalSignup=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlLocalSignup=createEvent$1(this,"nlLocalSignup"),this.nlSignupNjump=createEvent$1(this,"nlSignupNjump"),this.fetchHandler=createEvent$1(this,"fetchHandler"),this.titleSignup="Create Nostr profile",this.description="Choose any username, you can always change it later.",this.descriptionNjump="Proceed to creating your Nostr profile in a new tab.",this.signupNjump=!1,this.isAvailable=!1}handleInputChange(e){state.nlSignup.signupName=e.target.value}handleCreateAccount(e){e.preventDefault(),this.signupNjump?this.nlSignupNjump.emit():this.nlLocalSignup.emit(`${state.nlSignup.signupName}`)}render(){return h(Fragment,{key:"4e2e1cb4e43c985fbcc79af1b085389a38c2805d"},h("div",{key:"ed3e90f3eeef7d1354b6e36d8f29c7348176b989",class:"p-4 overflow-y-auto"},h("h1",{key:"8b47eb2e2221b61d8b75e297ae9b954cd2a0ef89",class:"nl-title font-bold text-center text-2xl"},this.titleSignup),h("p",{key:"af517d0c92652d1e4fd14f57bf593eb1510865e7",class:"nl-description font-light text-center text-sm pt-2 max-w-96 mx-auto"},this.signupNjump?this.descriptionNjump:this.description)),h("div",{key:"54dd6ee361785bf45b760333104dc946a5a8f941",class:"max-w-72 mx-auto"},!this.signupNjump&&h("div",{key:"af4d8a26c1da84d2a07f1086c69b9776b361d484",class:"relative mb-2"},h("input",{key:"dc30806eefb1b2210e4960401de95578256becbd",onInput:e=>this.handleInputChange(e),type:"text",class:"nl-input peer py-3 px-4 ps-11 block w-full border-transparent rounded-lg text-sm disabled:opacity-50 disabled:pointer-events-none dark:border-transparent",placeholder:"Enter username",value:state.nlSignup.signupName}),h("div",{key:"64cfe0fe240b2e04216485915b3e6f034c5d0229",class:"absolute inset-y-0 start-0 flex items-center pointer-events-none ps-4 peer-disabled:opacity-50 peer-disabled:pointer-events-none"},h("svg",{key:"434077af1de7ee510325e84b64bc02981b039792",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:this.isAvailable?"#00cc00":"currentColor",class:"flex-shrink-0 w-4 h-4 text-gray-500"},h("path",{key:"5f9aae2d279fd8807b1798518f33da878e30f8ff","stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"})))),h("div",{key:"39115be409b0cc01e098e05fdeb370e15673f8e1",class:"ps-4 pe-4 overflow-y-auto"},h("p",{key:"cd7556b84e69f372b6aa9c834794e5bded78c228",class:"nl-error font-light text-center text-sm max-w-96 mx-auto"},state.error)),h("button-base",{key:"d29de7bb01cf5fb0b3ba76b9cf52aa846e3db638",disabled:state.isLoading,onClick:e=>this.handleCreateAccount(e),titleBtn:this.signupNjump?"Get started":"Create profile"},state.isLoading?h("span",{slot:"icon-start",class:"animate-spin-loading inline-block w-4 h-4 border-[3px] border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"}):h("svg",{slot:"icon-start",style:{display:"none"},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M18 7.5v3m0 0v3m0-3h3m-3 0h-3m-2.25-4.125a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0ZM3 19.235v-.11a6.375 6.375 0 0 1 12.75 0v.109A12.318 12.318 0 0 1 9.374 21c-2.331 0-4.512-.645-6.374-1.766Z"})))))}static get style(){return NlLocalSignupStyle0}},[0,"nl-local-signup",{titleSignup:[1,"title-signup"],description:[1],descriptionNjump:[1,"description-njump"],signupNjump:[4,"signup-njump"],isAvailable:[32]}]);function defineCustomElement$i(){if("undefined"==typeof customElements)return;["nl-local-signup","button-base"].forEach((e=>{switch(e){case"nl-local-signup":customElements.get(e)||customElements.define(e,NlLocalSignup);break;case"button-base":customElements.get(e)||defineCustomElement$s()}}))}defineCustomElement$i();const NlLoginStatus=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.info=void 0}render(){let e="",t="";if("extension"===this.info.authMethod)e="Extension",t="border-yellow-300 text-yellow-500 bg-yellow-100";else if("readOnly"===this.info.authMethod)e="Read only",t="border-gray-300 text-gray-400 bg-gray-100";else if("connect"===this.info.authMethod)e="Connect",t="border-teal-300 text-teal-600 bg-teal-100";else if("local"===this.info.authMethod)e="Temporary",t="border-red-300 text-red-600 bg-red-100";else{if("otp"!==this.info.authMethod)throw console.log("unknown auth method",this.info),new Error("Unknown auth method");e="Delegated",t="border-orange-300 text-orange-600 bg-orange-100"}return h("div",{key:"8b5236e4bc47388d9e55ff92b3c5837bd77833d6"},h("span",{key:"066cb55933afc54e17831a3fe4c6fbc4b66aec15",class:`${t} rounded-xl border w-auto text-[10px] px-1 `},e))}},[0,"nl-login-status",{info:[16]}]);function defineCustomElement$h(){if("undefined"==typeof customElements)return;["nl-login-status"].forEach((e=>{if("nl-login-status"===e)customElements.get(e)||customElements.define(e,NlLoginStatus)}))}defineCustomElement$h();const nlOtpMigrateCss=baseCss,NlOtpMigrateStyle0=nlOtpMigrateCss,NlImportFlow=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlImportAccount=createEvent$1(this,"nlImportAccount"),this.titleInfo="Import keys to storage service",this.titleImport="Choose a service",this.textImport="You will be prompted to import keys to the chosen service, and this website will connect to your keys.",this.services=[]}handleDomainSelect(e){const t=this.services.find((t=>t.domain===e.detail));state.nlImport=t}handleCreateAccount(e){e.preventDefault(),this.nlImportAccount.emit(state.nlImport)}render(){const e=this.services.filter((e=>e.canImport)).map((e=>({name:e.domain,value:e.domain})));return h(Fragment,{key:"12693d07250ca52865a5a04d454e11e43b651e13"},h("div",{key:"1fa49c196cfb54cc7da20925dc61490d3cea4f1d",class:"p-4 overflow-y-auto"},h("h1",{key:"ff29ef7de0954e75bf17ee260eea556ba364ecdd",class:"nl-title font-bold text-center text-2xl"},this.titleImport),h("p",{key:"626e164f92be79d655384e631c982bc4e06fdbfc",class:"nl-description font-light text-center text-sm pt-2 max-w-96 mx-auto"},this.textImport)),h("div",{key:"7d3b75101d0531c41a7bfcbb5ece1ffa67821810",class:"max-w-72 mx-auto mb-5"},h("div",{key:"7a11b1c4668f0172ce4535fe0c4931221b147509",class:"mb-0.5"},h("nl-select",{key:"1c7dbbd077d06f19745f2c53d1100b74e5498a17",onSelectDomain:e=>this.handleDomainSelect(e),selected:0,options:e})),h("p",{key:"da6a4528697951de8b31b4697ba9b19d71b33b4f",class:"nl-title font-light text-sm mb-2"},"Default provider is a fine choice to start with."),h("div",{key:"a57b965e8ad521ab36d81d8962a723ddfa735757",class:"ps-4 pe-4 overflow-y-auto"},h("p",{key:"cb748be936c8204d67b1fa49fe2f2f8ed11cb604",class:"nl-error font-light text-center text-sm max-w-96 mx-auto"},state.error)),h("button-base",{key:"dd31a190750a945c5a4f71830e8177bd7172a7bc",disabled:state.isLoading,onClick:e=>this.handleCreateAccount(e),titleBtn:"Start importing"},state.isLoading?h("span",{slot:"icon-start",class:"animate-spin-loading inline-block w-4 h-4 border-[3px] border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"}):h("svg",{slot:"icon-start",style:{display:"none"},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M18 7.5v3m0 0v3m0-3h3m-3 0h-3m-2.25-4.125a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0ZM3 19.235v-.11a6.375 6.375 0 0 1 12.75 0v.109A12.318 12.318 0 0 1 9.374 21c-2.331 0-4.512-.645-6.374-1.766Z"})))))}static get style(){return NlOtpMigrateStyle0}},[0,"nl-otp-migrate",{titleInfo:[1025,"title-info"],titleImport:[1,"title-import"],textImport:[1,"text-import"],services:[16]}]);function defineCustomElement$g(){if("undefined"==typeof customElements)return;["nl-otp-migrate","button-base","nl-select"].forEach((e=>{switch(e){case"nl-otp-migrate":customElements.get(e)||customElements.define(e,NlImportFlow);break;case"button-base":customElements.get(e)||defineCustomElement$s();break;case"nl-select":customElements.get(e)||defineCustomElement$n()}}))}defineCustomElement$g();const nlPreviouslyLoggedCss=baseCss,NlPreviouslyLoggedStyle0=nlPreviouslyLoggedCss,NlPreviouslyLogged=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlSwitchAccount=createEvent$1(this,"nlSwitchAccount"),this.nlLoginRecentAccount=createEvent$1(this,"nlLoginRecentAccount"),this.nlRemoveRecent=createEvent$1(this,"nlRemoveRecent"),this.titlePage="Your profiles",this.description="Switch between active profiles or choose a recent one for fast login.",this.accounts=[],this.recents=[]}handleGoToWelcome(){state.path=[CURRENT_MODULE.WELCOME]}switchToWelcomeIfEmpty(){this.recents.length||this.accounts.length||(state.path=[CURRENT_MODULE.WELCOME])}watchAccounts(){this.switchToWelcomeIfEmpty()}watchRecents(){this.switchToWelcomeIfEmpty()}handleRemoveRecent(e){this.nlRemoveRecent.emit(e)}handleSwitch(e){this.nlSwitchAccount.emit(e)}handleLoginRecentAccount(e){this.nlLoginRecentAccount.emit(e)}render(){return h(Fragment,{key:"433be12e7eb9f18f10afa828a53920c85410940c"},h("div",{key:"080f439a9910e8fe8217a914d04e2a2cc8ca97ad",class:"p-4 pt-0 overflow-y-auto"},h("h1",{key:"332f960bc2b1727277dade6d5236f41f9a81116c",class:"nl-title font-bold text-center text-4xl"},this.titlePage),h("p",{key:"2a1fb42c969f6266eb782d3f4f01a935ff88d779",class:"nl-description font-light text-center text-lg pt-2 max-w-96 mx-auto"},this.description)),h("div",{key:"679d3e53e352631f704c997c8ec206d122e4f8a6",class:"p-4"},Boolean(this.accounts.length)&&h("div",{key:"4f2d266c86cc05c5030c432eeb8611f12ccfe52b",class:"max-w-96 mx-auto"},h("p",{key:"94baf6a179142c0f3d6e0f15d2d98be35ee4cbcc",class:"nl-description font-medium text-sm pb-1.5"},"Active profiles"),h("ul",{key:"5d7971661fbb7e6cc992df82f73639d9d1b5c69d",class:"p-2 rounded-lg border border-blue-200 flex flex-col w-full gap-0.5"},this.accounts.map((e=>{const t=Boolean(null==e?void 0:e.picture),n=e.name||e.nip05||e.pubkey,o=Boolean(n);return h("li",{onClick:()=>this.handleSwitch(e),class:"group hover:bg-gray-400 flex cursor-pointer gap-x-3.5 py-2 px-3 rounded-lg text-sm items-center justify-between"},h("div",{class:"flex items-center gap-x-3.5 w-full"},h("div",{class:"w-full max-w-7 h-7 flex relative"},h("div",{class:"absolute top-[-2px] right-[-2px] bg-white border-2 border-white rounded-xl"},h("div",{class:"active h-1.5 w-1.5 bg-green-500 rounded-xl"})),h("div",{class:"group-hover:border-blue-400 uppercase font-bold w-full h-full rounded-full border border-gray-400 flex justify-center items-center"},t?h("img",{class:"w-full rounded-full",src:e.picture,alt:"Logo"}):o?n[0]:h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})))),h("div",{class:"overflow-hidden flex flex-col w-full"},h("div",{class:"nl-title truncate overflow-hidden"},n),h("nl-login-status",{info:e}))))})))),Boolean(this.recents.length)&&h("div",{key:"c66d7eda3b667f736052dc27709a343ddb74b54a",class:"max-w-96 mx-auto pt-5"},h("p",{key:"d31c7a93df4b7583cb00b4e0d55c1118adae0b32",class:"nl-description font-medium text-sm pb-1.5"},"Recent profiles"),h("ul",{key:"c03f0135c7e3dc4fe5db91aeff7cb8e1ccd436b6",class:"p-2 rounded-lg border border-gray-200 flex flex-col w-full gap-0.5"},this.recents.map((e=>{const t=Boolean(null==e?void 0:e.picture),n=e.name||e.nip05||e.pubkey,o=Boolean(n);return h("li",{onClick:()=>this.handleLoginRecentAccount(e),class:"flex items-center gap-x-3.5 w-full hover:bg-gray-400 flex cursor-pointer items-center gap-x-3.5 py-2 px-3 rounded-lg text-sm justify-between"},h("div",{class:"w-full max-w-7 h-7 flex relative"},h("div",{class:"absolute top-[-3px] right-[-3px] bg-white border border-white rounded-xl"},h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-3 h-3"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))),h("div",{class:"uppercase font-bold w-full h-full rounded-full border border-gray-400 flex justify-center items-center"},t?h("img",{class:"w-full rounded-full",src:e.picture,alt:"Logo"}):o?n[0]:h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})))),h("div",{class:"overflow-hidden flex flex-col w-full"},h("div",{class:"nl-title truncate overflow-hidden"},n),h("nl-login-status",{info:e})),h("svg",{onClick:t=>{t.stopPropagation(),this.handleRemoveRecent(e)},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full max-w-6 h-6 text-red-500 hover:text-red-600 ml-auto"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"})))}))))),h("div",{key:"bf85231e1b0cd2a3490564507ec9f41e9277a64f",class:"p-4 overflow-y-auto"},h("p",{key:"c88a893c3833de4ad97637abd10507b76921c0c5",class:"nl-footer font-light text-center text-sm max-w-96 mx-auto"},"You can also"," ",h("span",{key:"767425be179794ec16efe01c66f11d01954c70df",onClick:()=>this.handleGoToWelcome(),class:"cursor-pointer pb-3 text-blue-500"},"add another profile"))))}static get watchers(){return{accounts:["watchAccounts"],recents:["watchRecents"]}}static get style(){return NlPreviouslyLoggedStyle0}},[0,"nl-previously-logged",{titlePage:[1,"title-page"],description:[1],accounts:[16],recents:[16]},void 0,{accounts:["watchAccounts"],recents:["watchRecents"]}]);function defineCustomElement$f(){if("undefined"==typeof customElements)return;["nl-previously-logged","nl-login-status"].forEach((e=>{switch(e){case"nl-previously-logged":customElements.get(e)||customElements.define(e,NlPreviouslyLogged);break;case"nl-login-status":customElements.get(e)||defineCustomElement$h()}}))}defineCustomElement$f();const nlSigninCss=baseCss,NlSigninStyle0=nlSigninCss,NlSignin=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlLogin=createEvent$1(this,"nlLogin"),this.nlCheckLogin=createEvent$1(this,"nlCheckLogin"),this.titleLogin="Connect to key store",this.description="Please enter your user name.",this.isGood=!1}handleInputChange(e){state.nlSignin.loginName=e.target.value,this.nlCheckLogin.emit(e.target.value)}handleLogin(e){e.preventDefault(),this.nlLogin.emit(state.nlSignin.loginName)}render(){return h(Fragment,{key:"a498d75f074f6df3cda28a845c783cbd8568747a"},h("div",{key:"32c20383fd595cd977c5163f14806fd1dcdab210",class:"p-4 overflow-y-auto"},h("h1",{key:"4a0d7b438e34497072df509f8b7196342f30964c",class:"nl-title font-bold text-center text-2xl"},this.titleLogin),h("p",{key:"1a48de557c4544eb38c9c826848171cdcebead9f",class:"nl-description font-light text-center text-sm pt-2 max-w-96 mx-auto"},this.description)),h("div",{key:"9c74d29c7f007f2dd3e795cfb3fbc3bccd03549a",class:"max-w-72 mx-auto"},h("div",{key:"97d4c6367bfa6bf581a3bb4283ee6d8958cbc7c6",class:"relative mb-2"},h("input",{key:"5b5ba0b7268576680f40508cfd2f6fa771cd1acd",onInput:e=>this.handleInputChange(e),type:"text",class:"nl-input peer py-3 px-4 ps-11 block w-full border-transparent rounded-lg text-sm disabled:opacity-50 disabled:pointer-events-none dark:border-transparent",placeholder:"name@domain.com",value:state.nlSignin.loginName}),h("div",{key:"971b0e66f94f20fa3406786e8f6fc66e858b82aa",class:"absolute inset-y-0 start-0 flex items-center pointer-events-none ps-4 peer-disabled:opacity-50 peer-disabled:pointer-events-none"},h("svg",{key:"e267ffa5f7a5cf560732da01645f771c24555927",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:this.isGood?"#00cc00":"currentColor",class:"flex-shrink-0 w-4 h-4 text-gray-500"},h("path",{key:"c694ee22fe4198b58f0d750cea98a34cf2a9bc14","stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"})))),h("div",{key:"41828dc382da40b4a7b11dc094d20f4913480a8a",class:"ps-4 pe-4 overflow-y-auto"},h("p",{key:"b619b41116fc3d6ae33363dd1be6ac67f3521f14",class:"nl-error font-light text-center text-sm max-w-96 mx-auto"},state.error)),h("button-base",{key:"81797cde8acbaf0aeeb204aa07885ba27f27c08d",titleBtn:"Connect",disabled:state.isLoading,onClick:e=>this.handleLogin(e)},state.isLoading?h("span",{slot:"icon-start",class:"animate-spin-loading inline-block w-4 h-4 border-[3px] border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"}):h("svg",{style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 9V5.25A2.25 2.25 0 0 1 10.5 3h6a2.25 2.25 0 0 1 2.25 2.25v13.5A2.25 2.25 0 0 1 16.5 21h-6a2.25 2.25 0 0 1-2.25-2.25V15M12 9l3 3m0 0-3 3m3-3H2.25"})))))}static get style(){return NlSigninStyle0}},[0,"nl-signin",{titleLogin:[1,"title-login"],description:[1],isGood:[32]}]);function defineCustomElement$e(){if("undefined"==typeof customElements)return;["nl-signin","button-base"].forEach((e=>{switch(e){case"nl-signin":customElements.get(e)||customElements.define(e,NlSignin);break;case"button-base":customElements.get(e)||defineCustomElement$s()}}))}defineCustomElement$e();class e{constructor(t,n,o,r,s){this._legacyCanvasSize=e.DEFAULT_CANVAS_SIZE,this._preferredCamera="environment",this._maxScansPerSecond=25,this._lastScanTimestamp=-1,this._destroyed=this._flashOn=this._paused=this._active=!1,this.$video=t,this.$canvas=document.createElement("canvas"),o&&"object"==typeof o?this._onDecode=n:(o||r||s?console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future"):console.warn("Note that the type of the scan result passed to onDecode will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),this._legacyOnDecode=n),n="object"==typeof o?o:{},this._onDecodeError=n.onDecodeError||("function"==typeof o?o:this._onDecodeError),this._calculateScanRegion=n.calculateScanRegion||("function"==typeof r?r:this._calculateScanRegion),this._preferredCamera=n.preferredCamera||s||this._preferredCamera,this._legacyCanvasSize="number"==typeof o?o:"number"==typeof r?r:this._legacyCanvasSize,this._maxScansPerSecond=n.maxScansPerSecond||this._maxScansPerSecond,this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._updateOverlay=this._updateOverlay.bind(this),t.disablePictureInPicture=!0,t.playsInline=!0,t.muted=!0;let i=!1;if(t.hidden&&(t.hidden=!1,i=!0),document.body.contains(t)||(document.body.appendChild(t),i=!0),o=t.parentElement,n.highlightScanRegion||n.highlightCodeOutline){if(r=!!n.overlay,this.$overlay=n.overlay||document.createElement("div"),(s=this.$overlay.style).position="absolute",s.display="none",s.pointerEvents="none",this.$overlay.classList.add("scan-region-highlight"),!r&&n.highlightScanRegion){this.$overlay.innerHTML='<svg class="scan-region-highlight-svg" viewBox="0 0 238 238" preserveAspectRatio="none" style="position:absolute;width:100%;height:100%;left:0;top:0;fill:none;stroke:#e9b213;stroke-width:4;stroke-linecap:round;stroke-linejoin:round"><path d="M31 2H10a8 8 0 0 0-8 8v21M207 2h21a8 8 0 0 1 8 8v21m0 176v21a8 8 0 0 1-8 8h-21m-176 0H10a8 8 0 0 1-8-8v-21"/></svg>';try{this.$overlay.firstElementChild.animate({transform:["scale(.98)","scale(1.01)"]},{duration:400,iterations:1/0,direction:"alternate",easing:"ease-in-out"})}catch(e){}o.insertBefore(this.$overlay,this.$video.nextSibling)}n.highlightCodeOutline&&(this.$overlay.insertAdjacentHTML("beforeend",'<svg class="code-outline-highlight" preserveAspectRatio="none" style="display:none;width:100%;height:100%;fill:none;stroke:#e9b213;stroke-width:5;stroke-dasharray:25;stroke-linecap:round;stroke-linejoin:round"><polygon/></svg>'),this.$codeOutlineHighlight=this.$overlay.lastElementChild)}this._scanRegion=this._calculateScanRegion(t),requestAnimationFrame((()=>{let e=window.getComputedStyle(t);"none"===e.display&&(t.style.setProperty("display","block","important"),i=!0),"visible"!==e.visibility&&(t.style.setProperty("visibility","visible","important"),i=!0),i&&(console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."),t.style.opacity="0",t.style.width="0",t.style.height="0",this.$overlay&&this.$overlay.parentElement&&this.$overlay.parentElement.removeChild(this.$overlay),delete this.$overlay,delete this.$codeOutlineHighlight),this.$overlay&&this._updateOverlay()})),t.addEventListener("play",this._onPlay),t.addEventListener("loadedmetadata",this._onLoadedMetaData),document.addEventListener("visibilitychange",this._onVisibilityChange),window.addEventListener("resize",this._updateOverlay),this._qrEnginePromise=e.createQrEngine()}static set WORKER_PATH(e){console.warn("Setting QrScanner.WORKER_PATH is not required and not supported anymore. Have a look at the README for new setup instructions.")}static async hasCamera(){try{return!!(await e.listCameras(!1)).length}catch(e){return!1}}static async listCameras(t=!1){if(!navigator.mediaDevices)return[];let n,o=async()=>(await navigator.mediaDevices.enumerateDevices()).filter((e=>"videoinput"===e.kind));try{t&&(await o()).every((e=>!e.label))&&(n=await navigator.mediaDevices.getUserMedia({audio:!1,video:!0}))}catch(e){}try{return(await o()).map(((e,t)=>({id:e.deviceId,label:e.label||(0===t?"Default Camera":`Camera ${t+1}`)})))}finally{n&&(console.warn("Call listCameras after successfully starting a QR scanner to avoid creating a temporary video stream"),e._stopVideoStream(n))}}async hasFlash(){let t;try{if(this.$video.srcObject){if(!(this.$video.srcObject instanceof MediaStream))return!1;t=this.$video.srcObject}else t=(await this._getCameraStream()).stream;return"torch"in t.getVideoTracks()[0].getSettings()}catch(e){return!1}finally{t&&t!==this.$video.srcObject&&(console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),e._stopVideoStream(t))}}isFlashOn(){return this._flashOn}async toggleFlash(){this._flashOn?await this.turnFlashOff():await this.turnFlashOn()}async turnFlashOn(){if(!this._flashOn&&!this._destroyed&&(this._flashOn=!0,this._active&&!this._paused))try{if(!await this.hasFlash())throw"No flash available";await this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]})}catch(e){throw this._flashOn=!1,e}}async turnFlashOff(){this._flashOn&&(this._flashOn=!1,await this._restartVideoStream())}destroy(){this.$video.removeEventListener("loadedmetadata",this._onLoadedMetaData),this.$video.removeEventListener("play",this._onPlay),document.removeEventListener("visibilitychange",this._onVisibilityChange),window.removeEventListener("resize",this._updateOverlay),this._destroyed=!0,this._flashOn=!1,this.stop(),e._postWorkerMessage(this._qrEnginePromise,"close")}async start(){if(this._destroyed)throw Error("The QR scanner can not be started as it had been destroyed.");if((!this._active||this._paused)&&("https:"!==window.location.protocol&&console.warn("The camera stream is only accessible if the page is transferred via https."),this._active=!0,!document.hidden))if(this._paused=!1,this.$video.srcObject)await this.$video.play();else try{let{stream:t,facingMode:n}=await this._getCameraStream();!this._active||this._paused?e._stopVideoStream(t):(this._setVideoMirror(n),this.$video.srcObject=t,await this.$video.play(),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch((()=>{}))))}catch(e){if(!this._paused)throw this._active=!1,e}}stop(){this.pause(),this._active=!1}async pause(t=!1){if(this._paused=!0,!this._active)return!0;this.$video.pause(),this.$overlay&&(this.$overlay.style.display="none");let n=()=>{this.$video.srcObject instanceof MediaStream&&(e._stopVideoStream(this.$video.srcObject),this.$video.srcObject=null)};return t?(n(),!0):(await new Promise((e=>setTimeout(e,300))),!!this._paused&&(n(),!0))}async setCamera(e){e!==this._preferredCamera&&(this._preferredCamera=e,await this._restartVideoStream())}static async scanImage(t,n,o,r,s=!1,i=!1){let a,c=!1;n&&("scanRegion"in n||"qrEngine"in n||"canvas"in n||"disallowCanvasResizing"in n||"alsoTryWithoutScanRegion"in n||"returnDetailedScanResult"in n)?(a=n.scanRegion,o=n.qrEngine,r=n.canvas,s=n.disallowCanvasResizing||!1,i=n.alsoTryWithoutScanRegion||!1,c=!0):n||o||r||s||i?console.warn("You're using a deprecated api for scanImage which will be removed in the future."):console.warn("Note that the return type of scanImage will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),n=!!o;try{let l,d,h;if([o,l]=await Promise.all([o||e.createQrEngine(),e._loadImage(t)]),[r,d]=e._drawToCanvas(l,a,r,s),o instanceof Worker){let t=o;n||e._postWorkerMessageSync(t,"inversionMode","both"),h=await new Promise(((n,o)=>{let s,i,c,l=-1;i=r=>{r.data.id===l&&(t.removeEventListener("message",i),t.removeEventListener("error",c),clearTimeout(s),null!==r.data.data?n({data:r.data.data,cornerPoints:e._convertPoints(r.data.cornerPoints,a)}):o(e.NO_QR_CODE_FOUND))},c=e=>{t.removeEventListener("message",i),t.removeEventListener("error",c),clearTimeout(s),o("Scanner error: "+(e?e.message||e:"Unknown Error"))},t.addEventListener("message",i),t.addEventListener("error",c),s=setTimeout((()=>c("timeout")),1e4);let h=d.getImageData(0,0,r.width,r.height);l=e._postWorkerMessageSync(t,"decode",h,[h.data.buffer])}))}else h=await Promise.race([new Promise(((e,t)=>window.setTimeout((()=>t("Scanner error: timeout")),1e4))),(async()=>{try{var[n]=await o.detect(r);if(!n)throw e.NO_QR_CODE_FOUND;return{data:n.rawValue,cornerPoints:e._convertPoints(n.cornerPoints,a)}}catch(o){if(n=o.message||o,/not implemented|service unavailable/.test(n))return e._disableBarcodeDetector=!0,e.scanImage(t,{scanRegion:a,canvas:r,disallowCanvasResizing:s,alsoTryWithoutScanRegion:i});throw`Scanner error: ${n}`}})()]);return c?h:h.data}catch(n){if(!a||!i)throw n;let l=await e.scanImage(t,{qrEngine:o,canvas:r,disallowCanvasResizing:s});return c?l:l.data}finally{n||e._postWorkerMessage(o,"close")}}setGrayscaleWeights(t,n,o,r=!0){e._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:t,green:n,blue:o,useIntegerApproximation:r})}setInversionMode(t){e._postWorkerMessage(this._qrEnginePromise,"inversionMode",t)}static async createQrEngine(t){if(t&&console.warn("Specifying a worker path is not required and not supported anymore."),t=()=>Promise.resolve().then((function(){return qrScannerWorker_min})).then((e=>e.createWorker())),e._disableBarcodeDetector||!("BarcodeDetector"in window)||!BarcodeDetector.getSupportedFormats||!(await BarcodeDetector.getSupportedFormats()).includes("qr_code"))return t();let n=navigator.userAgentData;return n&&n.brands.some((({brand:e})=>/Chromium/i.test(e)))&&/mac ?OS/i.test(n.platform)&&await n.getHighEntropyValues(["architecture","platformVersion"]).then((({architecture:e,platformVersion:t})=>/arm/i.test(e||"arm")&&13<=parseInt(t||"13"))).catch((()=>!0))?t():new BarcodeDetector({formats:["qr_code"]})}_onPlay(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay(),this.$overlay&&(this.$overlay.style.display=""),this._scanFrame()}_onLoadedMetaData(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay()}_onVisibilityChange(){document.hidden?this.pause():this._active&&this.start()}_calculateScanRegion(e){let t=Math.round(2/3*Math.min(e.videoWidth,e.videoHeight));return{x:Math.round((e.videoWidth-t)/2),y:Math.round((e.videoHeight-t)/2),width:t,height:t,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}_updateOverlay(){requestAnimationFrame((()=>{if(this.$overlay){var e=this.$video,t=e.videoWidth,n=e.videoHeight,o=e.offsetWidth,r=e.offsetHeight,s=e.offsetLeft,i=e.offsetTop,a=window.getComputedStyle(e),c=a.objectFit,l=t/n,d=o/r;switch(c){case"none":var h=t,u=n;break;case"fill":h=o,u=r;break;default:("cover"===c?l>d:l<d)?h=(u=r)*l:u=(h=o)/l,"scale-down"===c&&(h=Math.min(h,t),u=Math.min(u,n))}var[f,p]=a.objectPosition.split(" ").map(((e,t)=>{const n=parseFloat(e);return e.endsWith("%")?(t?r-u:o-h)*n/100:n}));a=this._scanRegion.width||t,d=this._scanRegion.height||n,c=this._scanRegion.x||0;var g=this._scanRegion.y||0;(l=this.$overlay.style).width=a/t*h+"px",l.height=d/n*u+"px",l.top=`${i+p+g/n*u}px`,n=/scaleX\(-1\)/.test(e.style.transform),l.left=`${s+(n?o-f-h:f)+(n?t-c-a:c)/t*h}px`,l.transform=e.style.transform}}))}static _convertPoints(e,t){if(!t)return e;let n=t.x||0,o=t.y||0,r=t.width&&t.downScaledWidth?t.width/t.downScaledWidth:1;t=t.height&&t.downScaledHeight?t.height/t.downScaledHeight:1;for(let s of e)s.x=s.x*r+n,s.y=s.y*t+o;return e}_scanFrame(){!this._active||this.$video.paused||this.$video.ended||("requestVideoFrameCallback"in this.$video?this.$video.requestVideoFrameCallback.bind(this.$video):requestAnimationFrame)((async()=>{if(!(1>=this.$video.readyState)){var t=Date.now()-this._lastScanTimestamp,n=1e3/this._maxScansPerSecond;t<n&&await new Promise((e=>setTimeout(e,n-t))),this._lastScanTimestamp=Date.now();try{var o=await e.scanImage(this.$video,{scanRegion:this._scanRegion,qrEngine:this._qrEnginePromise,canvas:this.$canvas})}catch(e){if(!this._active)return;this._onDecodeError(e)}!e._disableBarcodeDetector||await this._qrEnginePromise instanceof Worker||(this._qrEnginePromise=e.createQrEngine()),o?(this._onDecode?this._onDecode(o):this._legacyOnDecode&&this._legacyOnDecode(o.data),this.$codeOutlineHighlight&&(clearTimeout(this._codeOutlineHighlightRemovalTimeout),this._codeOutlineHighlightRemovalTimeout=void 0,this.$codeOutlineHighlight.setAttribute("viewBox",`${this._scanRegion.x||0} ${this._scanRegion.y||0} ${this._scanRegion.width||this.$video.videoWidth} ${this._scanRegion.height||this.$video.videoHeight}`),this.$codeOutlineHighlight.firstElementChild.setAttribute("points",o.cornerPoints.map((({x:e,y:t})=>`${e},${t}`)).join(" ")),this.$codeOutlineHighlight.style.display="")):this.$codeOutlineHighlight&&!this._codeOutlineHighlightRemovalTimeout&&(this._codeOutlineHighlightRemovalTimeout=setTimeout((()=>this.$codeOutlineHighlight.style.display="none"),100))}this._scanFrame()}))}_onDecodeError(t){t!==e.NO_QR_CODE_FOUND&&console.log(t)}async _getCameraStream(){if(!navigator.mediaDevices)throw"Camera not found.";let e=/^(environment|user)$/.test(this._preferredCamera)?"facingMode":"deviceId",t=[{width:{min:1024}},{width:{min:768}},{}],n=t.map((t=>Object.assign({},t,{[e]:{exact:this._preferredCamera}})));for(let e of[...n,...t])try{let t=await navigator.mediaDevices.getUserMedia({video:e,audio:!1});return{stream:t,facingMode:this._getFacingMode(t)||(e.facingMode?this._preferredCamera:"environment"===this._preferredCamera?"user":"environment")}}catch(e){}throw"Camera not found."}async _restartVideoStream(){let e=this._paused;await this.pause(!0)&&!e&&this._active&&await this.start()}static _stopVideoStream(e){for(let t of e.getTracks())t.stop(),e.removeTrack(t)}_setVideoMirror(e){this.$video.style.transform="scaleX("+("user"===e?-1:1)+")"}_getFacingMode(e){return(e=e.getVideoTracks()[0])?/rear|back|environment/i.test(e.label)?"environment":/front|user|face/i.test(e.label)?"user":null:null}static _drawToCanvas(e,t,n,o=!1){n=n||document.createElement("canvas");let r=t&&t.x?t.x:0,s=t&&t.y?t.y:0,i=t&&t.width?t.width:e.videoWidth||e.width,a=t&&t.height?t.height:e.videoHeight||e.height;return o||(o=t&&t.downScaledWidth?t.downScaledWidth:i,t=t&&t.downScaledHeight?t.downScaledHeight:a,n.width!==o&&(n.width=o),n.height!==t&&(n.height=t)),(t=n.getContext("2d",{alpha:!1})).imageSmoothingEnabled=!1,t.drawImage(e,r,s,i,a,0,0,n.width,n.height),[n,t]}static async _loadImage(t){if(t instanceof Image)return await e._awaitImageLoad(t),t;if(t instanceof HTMLVideoElement||t instanceof HTMLCanvasElement||t instanceof SVGImageElement||"OffscreenCanvas"in window&&t instanceof OffscreenCanvas||"ImageBitmap"in window&&t instanceof ImageBitmap)return t;if(!(t instanceof File||t instanceof Blob||t instanceof URL||"string"==typeof t))throw"Unsupported image type.";{let n=new Image;n.src=t instanceof File||t instanceof Blob?URL.createObjectURL(t):t.toString();try{return await e._awaitImageLoad(n),n}finally{(t instanceof File||t instanceof Blob)&&URL.revokeObjectURL(n.src)}}}static async _awaitImageLoad(e){e.complete&&0!==e.naturalWidth||await new Promise(((t,n)=>{let o=r=>{e.removeEventListener("load",o),e.removeEventListener("error",o),r instanceof ErrorEvent?n("Image load error"):t()};e.addEventListener("load",o),e.addEventListener("error",o)}))}static async _postWorkerMessage(t,n,o,r){return e._postWorkerMessageSync(await t,n,o,r)}static _postWorkerMessageSync(t,n,o,r){if(!(t instanceof Worker))return-1;let s=e._workerMessageId++;return t.postMessage({id:s,type:n,data:o},r),s}}e.DEFAULT_CANVAS_SIZE=400,e.NO_QR_CODE_FOUND="No QR code found",e._disableBarcodeDetector=!1,e._workerMessageId=0;const nlSigninBunkerUrlCss=baseCss,NlSigninBunkerUrlStyle0=nlSigninBunkerUrlCss,NlSigninBunkerUrl=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlLogin=createEvent$1(this,"nlLogin"),this.nlCheckLogin=createEvent$1(this,"nlCheckLogin"),this.videoEl=null,this.stream=null,this.scanInterval=null,this.titleLogin="Connect with bunker url",this.description="Please enter a bunker url provided by key store.",this.isGood=!1,this.isScanning=!1,this.scanError=""}handleInputChange(e){state.nlSigninBunkerUrl.loginName=e.target.value,this.nlCheckLogin.emit(e.target.value)}handleLogin(e){e.preventDefault(),this.nlLogin.emit(state.nlSigninBunkerUrl.loginName)}async startScan(){if(this.scanError="",this.isScanning=!0,await new Promise((e=>requestAnimationFrame((()=>requestAnimationFrame(e))))),!this.scannerContainer)return this.scanError="Camera not available",void(this.isScanning=!1);try{this.stream=await navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"},audio:!1}),this.videoEl=document.createElement("video"),this.videoEl.setAttribute("playsinline",""),this.videoEl.setAttribute("autoplay",""),this.videoEl.muted=!0,this.videoEl.style.width="100%",this.videoEl.style.height="100%",this.videoEl.style.objectFit="cover",this.videoEl.style.display="block",this.videoEl.srcObject=this.stream,this.scannerContainer.appendChild(this.videoEl),await this.videoEl.play(),this.scanInterval=setInterval((async()=>{if(this.videoEl&&!(this.videoEl.readyState<2))try{const t=(await e.scanImage(this.videoEl,{returnDetailedScanResult:!0})).data;t&&(t.startsWith("bunker://")||t.startsWith("nostrconnect://"))&&(state.nlSigninBunkerUrl.loginName=t,this.nlCheckLogin.emit(t),this.stopScan())}catch(e){}}),250)}catch(e){console.error("QR Scanner error:",e),this.scanError=e instanceof Error?e.message:"Failed to access camera",this.isScanning=!1}}stopScan(){this.scanInterval&&(clearInterval(this.scanInterval),this.scanInterval=null),this.stream&&(this.stream.getTracks().forEach((e=>e.stop())),this.stream=null),this.videoEl&&(this.videoEl.srcObject=null,this.videoEl.remove(),this.videoEl=null),this.isScanning=!1}disconnectedCallback(){this.stopScan()}render(){return h(Fragment,{key:"1ee10a09c7f6782b5f89530c9331a3144f73a8ba"},h("div",{key:"68b5bef4961ddc8cf24ef98f7452d8ae5b0f6aae",class:"p-4 overflow-y-auto"},h("h1",{key:"be4da63776a4fc4f2228b22e95a1f31380e6d0f6",class:"nl-title font-bold text-center text-2xl"},this.titleLogin),h("p",{key:"d2e9c469206c4e71544416760090751dbe33cb4b",class:"nl-description font-light text-center text-sm pt-2 max-w-96 mx-auto"},this.description)),h("div",{key:"f2219e9bfc0262b5e1bfcfb3761515a26332c3d6",class:"max-w-72 mx-auto"},h("div",{key:"bd25646ec291c36aa20088108056bd6ae80f851a",class:"relative mb-2"},h("input",{key:"659665fa5c9b1247c5e81afc86a11b61e236b67a",onInput:e=>this.handleInputChange(e),type:"text",class:"nl-input peer py-3 px-4 ps-11 block w-full border-transparent rounded-lg text-sm disabled:opacity-50 disabled:pointer-events-none dark:border-transparent",placeholder:"bunker://...",value:state.nlSigninBunkerUrl.loginName}),h("div",{key:"4e0fe1bfaa82a05256a716c329ae9f8e6696b1d3",class:"absolute inset-y-0 start-0 flex items-center pointer-events-none ps-4 peer-disabled:opacity-50 peer-disabled:pointer-events-none"},h("svg",{key:"795ba20efa3fc317ccb0e91489ee7d96dc36b0e7",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:this.isGood?"#00cc00":"currentColor",class:"flex-shrink-0 w-4 h-4 text-gray-500"},h("path",{key:"0d856bf29de693b6424256da7491993692edde1b","stroke-linecap":"round","stroke-linejoin":"round",d:"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"})))),this.isScanning?h("div",{class:"mb-3"},h("div",{ref:e=>this.scannerContainer=e,class:"relative rounded-lg overflow-hidden bg-black",style:{aspectRatio:"1",width:"100%"}}),h("button",{type:"button",onClick:()=>this.stopScan(),class:"nl-action-button mt-2 w-full py-2 px-4 text-sm font-medium rounded-lg border border-transparent"},"Cancel")):h("div",{class:"mb-3"},h("button",{type:"button",onClick:()=>this.startScan(),class:"nl-action-button w-full py-2 px-4 inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent"},h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6.827 6.175A2.31 2.31 0 0 1 5.186 7.23c-.38.054-.757.112-1.134.175C2.999 7.58 2.25 8.507 2.25 9.574V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9.574c0-1.067-.75-1.994-1.802-2.169a47.865 47.865 0 0 0-1.134-.175 2.31 2.31 0 0 1-1.64-1.055l-.822-1.316a2.192 2.192 0 0 0-1.736-1.039 48.774 48.774 0 0 0-5.232 0 2.192 2.192 0 0 0-1.736 1.039l-.821 1.316Z"}),h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.5 12.75a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0ZM18.75 10.5h.008v.008h-.008V10.5Z"})),"Scan QR Code")),this.scanError&&h("div",{key:"dfc914e494b41c2381fe9f4d699632ecb4fd33c9",class:"mb-2"},h("p",{key:"043fa75931e800a25afa0d6d02de0aab7718ed4c",class:"nl-error font-light text-center text-sm"},this.scanError)),h("div",{key:"d908c3d8c8a8054ce944a47a27e3b18c8dc40ce5",class:"ps-4 pe-4 overflow-y-auto"},h("p",{key:"8293556d3e2a1f714e2a776ab69d1e1609806bbb",class:"nl-error font-light text-center text-sm max-w-96 mx-auto"},state.error)),h("button-base",{key:"305e5badc3dd35dcbadc0e1ff123eee5bb1580a6",titleBtn:"Connect",disabled:state.isLoading,onClick:e=>this.handleLogin(e)},state.isLoading?h("span",{slot:"icon-start",class:"animate-spin-loading inline-block w-4 h-4 border-[3px] border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"}):h("svg",{style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 9V5.25A2.25 2.25 0 0 1 10.5 3h6a2.25 2.25 0 0 1 2.25 2.25v13.5A2.25 2.25 0 0 1 16.5 21h-6a2.25 2.25 0 0 1-2.25-2.25V15M12 9l3 3m0 0-3 3m3-3H2.25"})))))}static get style(){return NlSigninBunkerUrlStyle0}},[0,"nl-signin-bunker-url",{titleLogin:[1,"title-login"],description:[1],isGood:[32],isScanning:[32],scanError:[32]}]);function defineCustomElement$d(){if("undefined"==typeof customElements)return;["nl-signin-bunker-url","button-base"].forEach((e=>{switch(e){case"nl-signin-bunker-url":customElements.get(e)||customElements.define(e,NlSigninBunkerUrl);break;case"button-base":customElements.get(e)||defineCustomElement$s()}}))}defineCustomElement$d();var browser={},canPromise$1=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then},qrcode={},utils$1$1={};let toSJISFunction;const CODEWORDS_COUNT=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];utils$1$1.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},utils$1$1.getSymbolTotalCodewords=function(e){return CODEWORDS_COUNT[e]},utils$1$1.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},utils$1$1.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');toSJISFunction=e},utils$1$1.isKanjiModeEnabled=function(){return void 0!==toSJISFunction},utils$1$1.toSJIS=function(e){return toSJISFunction(e)};var errorCorrectionLevel={},exports$1;function BitBuffer$1(){this.buffer=[],this.length=0}exports$1=errorCorrectionLevel,exports$1.L={bit:1},exports$1.M={bit:0},exports$1.Q={bit:3},exports$1.H={bit:2},exports$1.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},exports$1.from=function(e,t){if(exports$1.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return exports$1.L;case"m":case"medium":return exports$1.M;case"q":case"quartile":return exports$1.Q;case"h":case"high":return exports$1.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return t}},BitBuffer$1.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let n=0;n<t;n++)this.putBit(1==(e>>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var bitBuffer=BitBuffer$1;function BitMatrix$1(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}BitMatrix$1.prototype.set=function(e,t,n,o){const r=e*this.size+t;this.data[r]=n,o&&(this.reservedBit[r]=!0)},BitMatrix$1.prototype.get=function(e,t){return this.data[e*this.size+t]},BitMatrix$1.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},BitMatrix$1.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var bitMatrix=BitMatrix$1,alignmentPattern={};!function(e){const t=utils$1$1.getSymbolSize;e.getRowColCoords=function(e){if(1===e)return[];const n=Math.floor(e/7)+2,o=t(e),r=145===o?26:2*Math.ceil((o-13)/(2*n-2)),s=[o-7];for(let e=1;e<n-1;e++)s[e]=s[e-1]-r;return s.push(6),s.reverse()},e.getPositions=function(t){const n=[],o=e.getRowColCoords(t),r=o.length;for(let e=0;e<r;e++)for(let t=0;t<r;t++)0===e&&0===t||0===e&&t===r-1||e===r-1&&0===t||n.push([o[e],o[t]]);return n}}(alignmentPattern);var finderPattern={};const getSymbolSize=utils$1$1.getSymbolSize,FINDER_PATTERN_SIZE=7;finderPattern.getPositions=function(e){const t=getSymbolSize(e);return[[0,0],[t-FINDER_PATTERN_SIZE,0],[0,t-FINDER_PATTERN_SIZE]]};var maskPattern={};!function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t=3,n=3,o=40,r=10;function s(t,n,o){switch(t){case e.Patterns.PATTERN000:return(n+o)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return o%3==0;case e.Patterns.PATTERN011:return(n+o)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(o/3))%2==0;case e.Patterns.PATTERN101:return n*o%2+n*o%3==0;case e.Patterns.PATTERN110:return(n*o%2+n*o%3)%2==0;case e.Patterns.PATTERN111:return(n*o%3+(n+o)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}}e.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){const n=e.size;let o=0,r=0,s=0,i=null,a=null;for(let c=0;c<n;c++){r=s=0,i=a=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===i?r++:(r>=5&&(o+=t+(r-5)),i=n,r=1),n=e.get(l,c),n===a?s++:(s>=5&&(o+=t+(s-5)),a=n,s=1)}r>=5&&(o+=t+(r-5)),s>=5&&(o+=t+(s-5))}return o},e.getPenaltyN2=function(e){const t=e.size;let o=0;for(let n=0;n<t-1;n++)for(let r=0;r<t-1;r++){const t=e.get(n,r)+e.get(n,r+1)+e.get(n+1,r)+e.get(n+1,r+1);4!==t&&0!==t||o++}return o*n},e.getPenaltyN3=function(e){const t=e.size;let n=0,r=0,s=0;for(let o=0;o<t;o++){r=s=0;for(let i=0;i<t;i++)r=r<<1&2047|e.get(o,i),i>=10&&(1488===r||93===r)&&n++,s=s<<1&2047|e.get(i,o),i>=10&&(1488===s||93===s)&&n++}return n*o},e.getPenaltyN4=function(e){let t=0;const n=e.data.length;for(let o=0;o<n;o++)t+=e.data[o];return Math.abs(Math.ceil(100*t/n/5)-10)*r},e.applyMask=function(e,t){const n=t.size;for(let o=0;o<n;o++)for(let r=0;r<n;r++)t.isReserved(r,o)||t.xor(r,o,s(e,r,o))},e.getBestMask=function(t,n){const o=Object.keys(e.Patterns).length;let r=0,s=1/0;for(let i=0;i<o;i++){n(i),e.applyMask(i,t);const o=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(i,t),o<s&&(s=o,r=i)}return r}}(maskPattern);var errorCorrectionCode={};const ECLevel$1=errorCorrectionLevel,EC_BLOCKS_TABLE=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],EC_CODEWORDS_TABLE=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];errorCorrectionCode.getBlocksCount=function(e,t){switch(t){case ECLevel$1.L:return EC_BLOCKS_TABLE[4*(e-1)+0];case ECLevel$1.M:return EC_BLOCKS_TABLE[4*(e-1)+1];case ECLevel$1.Q:return EC_BLOCKS_TABLE[4*(e-1)+2];case ECLevel$1.H:return EC_BLOCKS_TABLE[4*(e-1)+3];default:return}},errorCorrectionCode.getTotalCodewordsCount=function(e,t){switch(t){case ECLevel$1.L:return EC_CODEWORDS_TABLE[4*(e-1)+0];case ECLevel$1.M:return EC_CODEWORDS_TABLE[4*(e-1)+1];case ECLevel$1.Q:return EC_CODEWORDS_TABLE[4*(e-1)+2];case ECLevel$1.H:return EC_CODEWORDS_TABLE[4*(e-1)+3];default:return}};var polynomial={},galoisField={};const EXP_TABLE=new Uint8Array(512),LOG_TABLE=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)EXP_TABLE[t]=e,LOG_TABLE[e]=t,e<<=1,256&e&&(e^=285);for(let e=255;e<512;e++)EXP_TABLE[e]=EXP_TABLE[e-255]}(),galoisField.log=function(e){if(e<1)throw new Error("log("+e+")");return LOG_TABLE[e]},galoisField.exp=function(e){return EXP_TABLE[e]},galoisField.mul=function(e,t){return 0===e||0===t?0:EXP_TABLE[LOG_TABLE[e]+LOG_TABLE[t]]},function(e){const t=galoisField;e.mul=function(e,n){const o=new Uint8Array(e.length+n.length-1);for(let r=0;r<e.length;r++)for(let s=0;s<n.length;s++)o[r+s]^=t.mul(e[r],n[s]);return o},e.mod=function(e,n){let o=new Uint8Array(e);for(;o.length-n.length>=0;){const e=o[0];for(let r=0;r<n.length;r++)o[r]^=t.mul(n[r],e);let r=0;for(;r<o.length&&0===o[r];)r++;o=o.slice(r)}return o},e.generateECPolynomial=function(n){let o=new Uint8Array([1]);for(let r=0;r<n;r++)o=e.mul(o,new Uint8Array([1,t.exp(r)]));return o}}(polynomial);const Polynomial=polynomial;function ReedSolomonEncoder$1(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}ReedSolomonEncoder$1.prototype.initialize=function(e){this.degree=e,this.genPoly=Polynomial.generateECPolynomial(this.degree)},ReedSolomonEncoder$1.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const n=Polynomial.mod(t,this.genPoly),o=this.degree-n.length;if(o>0){const e=new Uint8Array(this.degree);return e.set(n,o),e}return n};var reedSolomonEncoder=ReedSolomonEncoder$1,version={},mode={},versionCheck={isValid:function(e){return!isNaN(e)&&e>=1&&e<=40}},regex$1={};const numeric="[0-9]+",alphanumeric="[A-Z $%*+\\-./:]+";let kanji="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";kanji=kanji.replace(/u/g,"\\u");const byte="(?:(?![A-Z0-9 $%*+\\-./:]|"+kanji+")(?:.|[\r\n]))+";regex$1.KANJI=new RegExp(kanji,"g"),regex$1.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),regex$1.BYTE=new RegExp(byte,"g"),regex$1.NUMERIC=new RegExp(numeric,"g"),regex$1.ALPHANUMERIC=new RegExp(alphanumeric,"g");const TEST_KANJI=new RegExp("^"+kanji+"$"),TEST_NUMERIC=new RegExp("^"+numeric+"$"),TEST_ALPHANUMERIC=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");regex$1.testKanji=function(e){return TEST_KANJI.test(e)},regex$1.testNumeric=function(e){return TEST_NUMERIC.test(e)},regex$1.testAlphanumeric=function(e){return TEST_ALPHANUMERIC.test(e)},function(e){const t=versionCheck,n=regex$1;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!t.isValid(n))throw new Error("Invalid version: "+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},e.isValid=function(e){return e&&e.bit&&e.ccBits},e.from=function(t,n){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+t)}}(t)}catch(e){return n}}}(mode),function(e){const t=utils$1$1,n=errorCorrectionCode,o=errorCorrectionLevel,r=mode,s=versionCheck,i=t.getBCHDigit(7973);function a(e,t){return r.getCharCountIndicator(e,t)+4}function c(e,t){let n=0;return e.forEach((function(e){const o=a(e.mode,t);n+=o+e.getBitsLength()})),n}e.from=function(e,t){return s.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,o,i){if(!s.isValid(e))throw new Error("Invalid QR Code version");void 0===i&&(i=r.BYTE);const c=8*(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,o));if(i===r.MIXED)return c;const l=c-a(i,e);switch(i){case r.NUMERIC:return Math.floor(l/10*3);case r.ALPHANUMERIC:return Math.floor(l/11*2);case r.KANJI:return Math.floor(l/13);case r.BYTE:default:return Math.floor(l/8)}},e.getBestVersionForData=function(t,n){let s;const i=o.from(n,o.M);if(Array.isArray(t)){if(t.length>1)return function(t,n){for(let o=1;o<=40;o++)if(c(t,o)<=e.getCapacity(o,n,r.MIXED))return o}(t,i);if(0===t.length)return 1;s=t[0]}else s=t;return function(t,n,o){for(let r=1;r<=40;r++)if(n<=e.getCapacity(r,o,t))return r}(s.mode,s.getLength(),i)},e.getEncodedBits=function(e){if(!s.isValid(e)||e<7)throw new Error("Invalid QR Code version");let n=e<<12;for(;t.getBCHDigit(n)-i>=0;)n^=7973<<t.getBCHDigit(n)-i;return e<<12|n}}(version);var formatInfo={};const Utils$3=utils$1$1,G15=1335,G15_MASK=21522,G15_BCH=Utils$3.getBCHDigit(G15);formatInfo.getEncodedBits=function(e,t){const n=e.bit<<3|t;let o=n<<10;for(;Utils$3.getBCHDigit(o)-G15_BCH>=0;)o^=G15<<Utils$3.getBCHDigit(o)-G15_BCH;return(n<<10|o)^G15_MASK};var segments={};const Mode$4=mode;function NumericData(e){this.mode=Mode$4.NUMERIC,this.data=e.toString()}NumericData.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},NumericData.prototype.getLength=function(){return this.data.length},NumericData.prototype.getBitsLength=function(){return NumericData.getBitsLength(this.data.length)},NumericData.prototype.write=function(e){let t,n,o;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),o=parseInt(n,10),e.put(o,10);const r=this.data.length-t;r>0&&(n=this.data.substr(t),o=parseInt(n,10),e.put(o,3*r+1))};var numericData=NumericData;const Mode$3=mode,ALPHA_NUM_CHARS=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function AlphanumericData(e){this.mode=Mode$3.ALPHANUMERIC,this.data=e}AlphanumericData.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},AlphanumericData.prototype.getLength=function(){return this.data.length},AlphanumericData.prototype.getBitsLength=function(){return AlphanumericData.getBitsLength(this.data.length)},AlphanumericData.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=45*ALPHA_NUM_CHARS.indexOf(this.data[t]);n+=ALPHA_NUM_CHARS.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(ALPHA_NUM_CHARS.indexOf(this.data[t]),6)};var alphanumericData=AlphanumericData;const Mode$2=mode;function ByteData(e){this.mode=Mode$2.BYTE,this.data="string"==typeof e?(new TextEncoder).encode(e):new Uint8Array(e)}ByteData.getBitsLength=function(e){return 8*e},ByteData.prototype.getLength=function(){return this.data.length},ByteData.prototype.getBitsLength=function(){return ByteData.getBitsLength(this.data.length)},ByteData.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)};var byteData=ByteData;const Mode$1=mode,Utils$2=utils$1$1;function KanjiData(e){this.mode=Mode$1.KANJI,this.data=e}KanjiData.getBitsLength=function(e){return 13*e},KanjiData.prototype.getLength=function(){return this.data.length},KanjiData.prototype.getBitsLength=function(){return KanjiData.getBitsLength(this.data.length)},KanjiData.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=Utils$2.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else{if(!(n>=57408&&n<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");n-=49472}n=192*(n>>>8&255)+(255&n),e.put(n,13)}};var kanjiData=KanjiData,dijkstra={exports:{}};!function(e){var t={single_source_shortest_paths:function(e,n,o){var r={},s={};s[n]=0;var i,a,c,l,d,h,u,f=t.PriorityQueue.make();for(f.push(n,0);!f.empty();)for(c in a=(i=f.pop()).value,l=i.cost,d=e[a]||{})d.hasOwnProperty(c)&&(h=l+d[c],u=s[c],(void 0===s[c]||u>h)&&(s[c]=h,f.push(c,h),r[c]=a));if(void 0!==o&&void 0===s[o]){var p=["Could not find a path from ",n," to ",o,"."].join("");throw new Error(p)}return r},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],o=t;o;)n.push(o),o=e[o];return n.reverse(),n},find_path:function(e,n,o){var r=t.single_source_shortest_paths(e,n,o);return t.extract_shortest_path_from_predecessor_list(r,o)},PriorityQueue:{make:function(e){var n,o=t.PriorityQueue,r={};for(n in e=e||{},o)o.hasOwnProperty(n)&&(r[n]=o[n]);return r.queue=[],r.sorter=e.sorter||o.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t}(dijkstra),function(e){const t=mode,n=numericData,o=alphanumericData,r=byteData,s=kanjiData,i=regex$1,a=utils$1$1,c=dijkstra.exports;function l(e){return unescape(encodeURIComponent(e)).length}function d(e,t,n){const o=[];let r;for(;null!==(r=e.exec(n));)o.push({data:r[0],index:r.index,mode:t,length:r[0].length});return o}function h(e){const n=d(i.NUMERIC,t.NUMERIC,e),o=d(i.ALPHANUMERIC,t.ALPHANUMERIC,e);let r,s;a.isKanjiModeEnabled()?(r=d(i.BYTE,t.BYTE,e),s=d(i.KANJI,t.KANJI,e)):(r=d(i.BYTE_KANJI,t.BYTE,e),s=[]);return n.concat(o,r,s).sort((function(e,t){return e.index-t.index})).map((function(e){return{data:e.data,mode:e.mode,length:e.length}}))}function u(e,i){switch(i){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return o.getBitsLength(e);case t.KANJI:return s.getBitsLength(e);case t.BYTE:return r.getBitsLength(e)}}function f(e,i){let c;const l=t.getBestModeForData(e);if(c=t.from(i,l),c!==t.BYTE&&c.bit<l.bit)throw new Error('"'+e+'" cannot be encoded with mode '+t.toString(c)+".\n Suggested mode is: "+t.toString(l));switch(c!==t.KANJI||a.isKanjiModeEnabled()||(c=t.BYTE),c){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new o(e);case t.KANJI:return new s(e);case t.BYTE:return new r(e)}}e.fromArray=function(e){return e.reduce((function(e,t){return"string"==typeof t?e.push(f(t,null)):t.data&&e.push(f(t.data,t.mode)),e}),[])},e.fromString=function(n,o){const r=function(e){const n=[];for(let o=0;o<e.length;o++){const r=e[o];switch(r.mode){case t.NUMERIC:n.push([r,{data:r.data,mode:t.ALPHANUMERIC,length:r.length},{data:r.data,mode:t.BYTE,length:r.length}]);break;case t.ALPHANUMERIC:n.push([r,{data:r.data,mode:t.BYTE,length:r.length}]);break;case t.KANJI:n.push([r,{data:r.data,mode:t.BYTE,length:l(r.data)}]);break;case t.BYTE:n.push([{data:r.data,mode:t.BYTE,length:l(r.data)}])}}return n}(h(n,a.isKanjiModeEnabled())),s=function(e,n){const o={},r={start:{}};let s=["start"];for(let i=0;i<e.length;i++){const a=e[i],c=[];for(let e=0;e<a.length;e++){const l=a[e],d=""+i+e;c.push(d),o[d]={node:l,lastCount:0},r[d]={};for(let e=0;e<s.length;e++){const i=s[e];o[i]&&o[i].node.mode===l.mode?(r[i][d]=u(o[i].lastCount+l.length,l.mode)-u(o[i].lastCount,l.mode),o[i].lastCount+=l.length):(o[i]&&(o[i].lastCount=l.length),r[i][d]=u(l.length,l.mode)+4+t.getCharCountIndicator(l.mode,n))}}s=c}for(let e=0;e<s.length;e++)r[s[e]].end=0;return{map:r,table:o}}(r,o),i=c.find_path(s.map,"start","end"),d=[];for(let e=1;e<i.length-1;e++)d.push(s.table[i[e]].node);return e.fromArray(function(e){return e.reduce((function(e,t){const n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)}),[])}(d))},e.rawSplit=function(t){return e.fromArray(h(t,a.isKanjiModeEnabled()))}}(segments);const Utils$1=utils$1$1,ECLevel=errorCorrectionLevel,BitBuffer=bitBuffer,BitMatrix=bitMatrix,AlignmentPattern=alignmentPattern,FinderPattern=finderPattern,MaskPattern=maskPattern,ECCode=errorCorrectionCode,ReedSolomonEncoder=reedSolomonEncoder,Version=version,FormatInfo=formatInfo,Mode$5=mode,Segments=segments;function setupFinderPattern(e,t){const n=e.size,o=FinderPattern.getPositions(t);for(let t=0;t<o.length;t++){const r=o[t][0],s=o[t][1];for(let t=-1;t<=7;t++)if(!(r+t<=-1||n<=r+t))for(let o=-1;o<=7;o++)s+o<=-1||n<=s+o||(t>=0&&t<=6&&(0===o||6===o)||o>=0&&o<=6&&(0===t||6===t)||t>=2&&t<=4&&o>=2&&o<=4?e.set(r+t,s+o,!0,!0):e.set(r+t,s+o,!1,!0))}}function setupTimingPattern(e){const t=e.size;for(let n=8;n<t-8;n++){const t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}function setupAlignmentPattern(e,t){const n=AlignmentPattern.getPositions(t);for(let t=0;t<n.length;t++){const o=n[t][0],r=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)-2===t||2===t||-2===n||2===n||0===t&&0===n?e.set(o+t,r+n,!0,!0):e.set(o+t,r+n,!1,!0)}}function setupVersionInfo(e,t){const n=e.size,o=Version.getEncodedBits(t);let r,s,i;for(let t=0;t<18;t++)r=Math.floor(t/3),s=t%3+n-8-3,i=1==(o>>t&1),e.set(r,s,i,!0),e.set(s,r,i,!0)}function setupFormatInfo(e,t,n){const o=e.size,r=FormatInfo.getEncodedBits(t,n);let s,i;for(s=0;s<15;s++)i=1==(r>>s&1),s<6?e.set(s,8,i,!0):s<8?e.set(s+1,8,i,!0):e.set(o-15+s,8,i,!0),s<8?e.set(8,o-s-1,i,!0):s<9?e.set(8,15-s-1+1,i,!0):e.set(8,15-s-1,i,!0);e.set(o-8,8,1,!0)}function setupData(e,t){const n=e.size;let o=-1,r=n-1,s=7,i=0;for(let a=n-1;a>0;a-=2)for(6===a&&a--;;){for(let n=0;n<2;n++)if(!e.isReserved(r,a-n)){let o=!1;i<t.length&&(o=1==(t[i]>>>s&1)),e.set(r,a-n,o),s--,-1===s&&(i++,s=7)}if(r+=o,r<0||n<=r){r-=o,o=-o;break}}}function createData(e,t,n){const o=new BitBuffer;n.forEach((function(t){o.put(t.mode.bit,4),o.put(t.getLength(),Mode$5.getCharCountIndicator(t.mode,e)),t.write(o)}));const r=8*(Utils$1.getSymbolTotalCodewords(e)-ECCode.getTotalCodewordsCount(e,t));for(o.getLengthInBits()+4<=r&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(0);const s=(r-o.getLengthInBits())/8;for(let e=0;e<s;e++)o.put(e%2?17:236,8);return createCodewords(o,e,t)}function createCodewords(e,t,n){const o=Utils$1.getSymbolTotalCodewords(t),r=o-ECCode.getTotalCodewordsCount(t,n),s=ECCode.getBlocksCount(t,n),i=s-o%s,a=Math.floor(o/s),c=Math.floor(r/s),l=c+1,d=a-c,h=new ReedSolomonEncoder(d);let u=0;const f=new Array(s),p=new Array(s);let g=0;const m=new Uint8Array(e.buffer);for(let e=0;e<s;e++){const t=e<i?c:l;f[e]=m.slice(u,u+t),p[e]=h.encode(f[e]),u+=t,g=Math.max(g,t)}const b=new Uint8Array(o);let y,w,v=0;for(y=0;y<g;y++)for(w=0;w<s;w++)y<f[w].length&&(b[v++]=f[w][y]);for(y=0;y<d;y++)for(w=0;w<s;w++)b[v++]=p[w][y];return b}function createSymbol(e,t,n,o){let r;if(Array.isArray(e))r=Segments.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let o=t;if(!o){const t=Segments.rawSplit(e);o=Version.getBestVersionForData(t,n)}r=Segments.fromString(e,o||40)}}const s=Version.getBestVersionForData(r,n);if(!s)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<s)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+s+".\n")}else t=s;const i=createData(t,n,r),a=Utils$1.getSymbolSize(t),c=new BitMatrix(a);return setupFinderPattern(c,t),setupTimingPattern(c),setupAlignmentPattern(c,t),setupFormatInfo(c,n,0),t>=7&&setupVersionInfo(c,t),setupData(c,i),isNaN(o)&&(o=MaskPattern.getBestMask(c,setupFormatInfo.bind(null,c,n))),MaskPattern.applyMask(o,c),setupFormatInfo(c,n,o),{modules:c,version:t,errorCorrectionLevel:n,maskPattern:o,segments:r}}qrcode.create=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let n,o,r=ECLevel.M;return void 0!==t&&(r=ECLevel.from(t.errorCorrectionLevel,ECLevel.M),n=Version.from(t.version),o=MaskPattern.from(t.maskPattern),t.toSJISFunc&&Utils$1.setToSJISFunction(t.toSJISFunc)),createSymbol(e,n,r,o)};var canvas={},utils$2={};!function(e){function t(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map((function(e){return[e,e]})))),6===t.length&&t.push("F","F");const n=parseInt(t.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:"#"+t.slice(0,6).join("")}}e.getOptions=function(e){e||(e={}),e.color||(e.color={});const n=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,o=e.width&&e.width>=21?e.width:void 0,r=e.scale||4;return{width:o,scale:o?4:r,margin:n,color:{dark:t(e.color.dark||"#000000ff"),light:t(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},e.getImageWidth=function(t,n){const o=e.getScale(t,n);return Math.floor((t+2*n.margin)*o)},e.qrToImageData=function(t,n,o){const r=n.modules.size,s=n.modules.data,i=e.getScale(r,o),a=Math.floor((r+2*o.margin)*i),c=o.margin*i,l=[o.color.light,o.color.dark];for(let e=0;e<a;e++)for(let n=0;n<a;n++){let d=4*(e*a+n),h=o.color.light;if(e>=c&&n>=c&&e<a-c&&n<a-c){h=l[s[Math.floor((e-c)/i)*r+Math.floor((n-c)/i)]?1:0]}t[d++]=h.r,t[d++]=h.g,t[d++]=h.b,t[d]=h.a}}}(utils$2),function(e){const t=utils$2;e.render=function(e,n,o){let r=o,s=n;void 0!==r||n&&n.getContext||(r=n,n=void 0),n||(s=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),r=t.getOptions(r);const i=t.getImageWidth(e.modules.size,r),a=s.getContext("2d"),c=a.createImageData(i,i);return t.qrToImageData(c.data,e,r),function(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=n,t.width=n,t.style.height=n+"px",t.style.width=n+"px"}(a,s,i),a.putImageData(c,0,0),s},e.renderToDataURL=function(t,n,o){let r=o;void 0!==r||n&&n.getContext||(r=n,n=void 0),r||(r={});const s=e.render(t,n,r),i=r.type||"image/png",a=r.rendererOpts||{};return s.toDataURL(i,a.quality)}}(canvas);var svgTag={};const Utils=utils$2;function getColorAttrib(e,t){const n=e.a/255,o=t+'="'+e.hex+'"';return n<1?o+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':o}function svgCmd(e,t,n){let o=e+t;return void 0!==n&&(o+=" "+n),o}function qrToPath(e,t,n){let o="",r=0,s=!1,i=0;for(let a=0;a<e.length;a++){const c=Math.floor(a%t),l=Math.floor(a/t);c||s||(s=!0),e[a]?(i++,a>0&&c>0&&e[a-1]||(o+=s?svgCmd("M",c+n,.5+l+n):svgCmd("m",r,0),r=0,s=!1),c+1<t&&e[a+1]||(o+=svgCmd("h",i),i=0)):r++}return o}svgTag.render=function(e,t,n){const o=Utils.getOptions(t),r=e.modules.size,s=e.modules.data,i=r+2*o.margin,a=o.color.light.a?"<path "+getColorAttrib(o.color.light,"fill")+' d="M0 0h'+i+"v"+i+'H0z"/>':"",c="<path "+getColorAttrib(o.color.dark,"stroke")+' d="'+qrToPath(s,r,o.margin)+'"/>',l='viewBox="0 0 '+i+" "+i+'"',d='<svg xmlns="http://www.w3.org/2000/svg" '+(o.width?'width="'+o.width+'" height="'+o.width+'" ':"")+l+' shape-rendering="crispEdges">'+a+c+"</svg>\n";return"function"==typeof n&&n(null,d),d};const canPromise=canPromise$1,QRCode=qrcode,CanvasRenderer=canvas,SvgRenderer=svgTag;function renderCanvas(e,t,n,o,r){const s=[].slice.call(arguments,1),i=s.length,a="function"==typeof s[i-1];if(!a&&!canPromise())throw new Error("Callback required as last argument");if(!a){if(i<1)throw new Error("Too few arguments provided");return 1===i?(n=t,t=o=void 0):2!==i||t.getContext||(o=n,n=t,t=void 0),new Promise((function(r,s){try{const s=QRCode.create(n,o);r(e(s,t,o))}catch(e){s(e)}}))}if(i<2)throw new Error("Too few arguments provided");2===i?(r=n,n=t,t=o=void 0):3===i&&(t.getContext&&void 0===r?(r=o,o=void 0):(r=o,o=n,n=t,t=void 0));try{const s=QRCode.create(n,o);r(null,e(s,t,o))}catch(e){r(e)}}browser.create=QRCode.create,browser.toCanvas=renderCanvas.bind(null,CanvasRenderer.render),browser.toDataURL=renderCanvas.bind(null,CanvasRenderer.renderToDataURL),browser.toString=renderCanvas.bind(null,(function(e,t,n){return SvgRenderer.render(e,n)}));const nlSigninConnectionStringCss=baseCss,NlSigninConnectionStringStyle0=nlSigninConnectionStringCss,NlSigninConnectionString=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlNostrConnectDefault=createEvent$1(this,"nlNostrConnectDefault"),this.titleLogin="Connection string",this.description="Scan or copy the connection string with key store app",this.connectionString="",this.isCopy=!1}componentDidLoad(){this.nlNostrConnectDefault.emit(),this.generateQRCode()}async generateQRCode(){if(this.connectionString&&this.canvasElement)try{await browser.toCanvas(this.canvasElement,this.connectionString)}catch(e){console.error("Error generating QR Code:",e)}}async copyToClipboard(){try{await navigator.clipboard.writeText(this.connectionString),this.isCopy=!0,setTimeout((()=>{this.isCopy=!1}),1500)}catch(e){console.error("Failed to copy connectionString: ",e)}}render(){return h(Fragment,{key:"739ccc5ccbb2d95dd79e61bca0734603c071fa0c"},h("div",{key:"e0e55217f18f113364c874a7a749eeb4e7747da2",class:"p-4 overflow-y-auto"},h("h1",{key:"536646c9e2f14b5a26eb7cf537a2aba27108480f",class:"nl-title font-bold text-center text-2xl"},this.titleLogin),h("p",{key:"319cce0772500eb08061d62542e09e7dc31886fc",class:"nl-description font-light text-center text-sm pt-2 max-w-96 mx-auto"},this.description)),h("canvas",{key:"acbb64df286dadd9cfc209df904bcdae06781fd7",class:"mx-auto mb-2",ref:e=>this.canvasElement=e}),h("div",{key:"5d6569013d81f1235a2e0fce79d63a358662e19b",class:"px-4"},h("div",{key:"4d6651551f297ba8065b6a8a28d00edc804ff597",class:"max-w-72 mx-auto"},h("div",{key:"32d3e176ea2b5f9aaee1a68c85a36a5f4c560414",class:"relative mb-2"},h("input",{key:"e4a0c9bcb80ec84ba545c427616e16d77f4c8581",type:"text",class:"nl-input peer py-3 px-4 pe-11 ps-11 block w-full border-transparent rounded-lg text-sm disabled:opacity-50 disabled:pointer-events-none dark:border-transparent",placeholder:"npub or name@domain",value:this.connectionString,disabled:!0}),h("div",{key:"e1af97f16bf9dbedef178ea4c8e6f1b656ad10b2",class:"absolute inset-y-0 start-0 flex items-center pointer-events-none ps-4 peer-disabled:opacity-50 peer-disabled:pointer-events-none"},h("svg",{key:"e53e6e030b0173fde047dabbb5d5a84a37c36562",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"flex-shrink-0 w-4 h-4 text-gray-500"},h("path",{key:"ad082553497803daeb16eb3a1b1acd4afbf173d3","stroke-linecap":"round","stroke-linejoin":"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),h("path",{key:"25438a495668108eeca317c69ed60ef830c7b76d","stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))),this.isCopy?h("div",{class:"absolute inset-y-0 end-0 flex items-center p-2 rounded-lg"},h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"#00cc00",class:"flex-shrink-0 w-4 h-4 text-gray-500"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))):h("div",{class:"absolute inset-y-0 end-0 flex items-center cursor-pointer p-2 rounded-lg",onClick:()=>this.copyToClipboard()},h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"flex-shrink-0 w-4 h-4 text-gray-500"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.5 8.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v8.25A2.25 2.25 0 0 0 6 16.5h2.25m8.25-8.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-7.5A2.25 2.25 0 0 1 8.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 0 0-2.25 2.25v6"})))),h("div",{key:"557a946f96cf2e1d9e16d7d0b617ceae63a20ba4",class:"mt-10 justify-center items-center flex gap-2"},h("span",{key:"223239887aa24dfc350605137a18857c2944bb8a",slot:"icon-start",class:"animate-spin-loading inline-block w-[20px] h-[20px] border-[2px] border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"}),h("span",{key:"919c6ab74a39b4d8e124de850be72f4c30817b6a",class:"nl-footer"},"Waiting for connection")))))}static get style(){return NlSigninConnectionStringStyle0}},[0,"nl-signin-connection-string",{titleLogin:[1,"title-login"],description:[1],connectionString:[1,"connection-string"],isCopy:[32]}]);function defineCustomElement$c(){if("undefined"==typeof customElements)return;["nl-signin-connection-string"].forEach((e=>{if("nl-signin-connection-string"===e)customElements.get(e)||customElements.define(e,NlSigninConnectionString)}))}defineCustomElement$c();const nlSigninNsecCss=baseCss,NlSigninNsecStyle0=nlSigninNsecCss,NlSigninNsec=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlLoginNsec=createEvent$1(this,"nlLoginNsec"),this.titleLogin="Login with nsec",this.description="Enter your private key (nsec) to log in."}handleInputChange(e){state.nlSigninNsec.nsecValue=e.target.value}handleLogin(e){e.preventDefault(),this.nlLoginNsec.emit(state.nlSigninNsec.nsecValue)}render(){return h(Fragment,{key:"96b364ced9e063e319692f6796856eb88ece7dc7"},h("div",{key:"6eb8a90f07aa52abe93af9f1cb1f98df67925c90",class:"p-4 overflow-y-auto"},h("h1",{key:"395ea33533887d43be9663e671a381614af32ec8",class:"nl-title font-bold text-center text-2xl"},this.titleLogin),h("p",{key:"775bfeedda38d2a52d439f85e6fc1c471a14df06",class:"nl-description font-light text-center text-sm pt-2 max-w-96 mx-auto"},this.description)),h("div",{key:"335af1f09ccdeac29cb17e9e671edbc06f251de7",class:"max-w-72 mx-auto"},h("div",{key:"e7949c50411f44ddc2e666e4a6efd4c1ced0bc51",class:"p-3 mb-3 rounded-lg border border-yellow-400 bg-yellow-50 dark:bg-yellow-900/20 dark:border-yellow-600"},h("div",{key:"3bbb8da9a9a66ba779af864b18726f367fa39b37",class:"flex items-start gap-2"},h("svg",{key:"e78c62977f057b46df3af6e6aa6d34bca86bedf1",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"#ca8a04",class:"flex-shrink-0 w-5 h-5 mt-0.5"},h("path",{key:"38fa5ad1e1e09b768a1fc17a6354f67ef6182e5f","stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})),h("div",{key:"e4df5e35b96ac61ce48f151988167d70c44478f4"},h("p",{key:"04d1b231d1fc9b5773bde43f7d48f7654442a8e3",class:"nl-title text-xs font-semibold",style:{color:"#ca8a04"}},"Use at your own risk"),h("p",{key:"57d626346430f8f0a09a38b10ba699252da3fe2e",class:"nl-description text-xs mt-1",style:{color:"#a16207"}},"Entering your private key directly is not recommended. We suggest migrating to a key store service for better security.")))),h("div",{key:"a00f417138ef4abf1ca2e22800a3d2a11d7fde10",class:"relative mb-2"},h("input",{key:"17d2f098263f3744de65361e09e18a0c8e1b0868",onInput:e=>this.handleInputChange(e),type:"password",class:"nl-input peer py-3 px-4 ps-11 block w-full border-transparent rounded-lg text-sm disabled:opacity-50 disabled:pointer-events-none dark:border-transparent",placeholder:"nsec1...",value:state.nlSigninNsec.nsecValue}),h("div",{key:"7ee9540e35b72d2678c51528f7f0302cbdbc271a",class:"absolute inset-y-0 start-0 flex items-center pointer-events-none ps-4 peer-disabled:opacity-50 peer-disabled:pointer-events-none"},h("svg",{key:"0a85157080fd2363d30f002c181c32b497b6dd60",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"flex-shrink-0 w-4 h-4 text-gray-500"},h("path",{key:"819466744f8729a1ba2c6f14f3e6eb96ef6a09af","stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"})))),h("div",{key:"3773ee73ac8f9bc7eb115dbd7120d3b0d3f6d9aa",class:"ps-4 pe-4 overflow-y-auto"},h("p",{key:"10325d69b4fbc0cdde6dd0fd0a0b940d82636fa7",class:"nl-error font-light text-center text-sm max-w-96 mx-auto"},state.error)),h("button-base",{key:"f31975f0fd11bef77ebf1282fa4505c2f70dfcba",titleBtn:"Log in",disabled:state.isLoading,onClick:e=>this.handleLogin(e)},state.isLoading&&h("span",{key:"37f2a1a4e24c508511549515754b452398cd83d6",slot:"icon-start",class:"animate-spin-loading inline-block w-4 h-4 border-[3px] border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"}))))}static get style(){return NlSigninNsecStyle0}},[0,"nl-signin-nsec",{titleLogin:[1,"title-login"],description:[1]}]);function defineCustomElement$b(){if("undefined"==typeof customElements)return;["nl-signin-nsec","button-base"].forEach((e=>{switch(e){case"nl-signin-nsec":customElements.get(e)||customElements.define(e,NlSigninNsec);break;case"button-base":customElements.get(e)||defineCustomElement$s()}}))}defineCustomElement$b();const nlSigninOtpCss=baseCss,NlSigninOtpStyle0=nlSigninOtpCss,NlSigninOtp=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlLoginOTPUser=createEvent$1(this,"nlLoginOTPUser"),this.nlLoginOTPCode=createEvent$1(this,"nlLoginOTPCode"),this.nlCheckLogin=createEvent$1(this,"nlCheckLogin"),this.titleLogin="Log in with DM",this.description="Please enter your user name or npub, and we will send you a direct message with a one-time code.",this.titleLoginOTP="Enter the code",this.descriptionOTP="Please enter the one-time code we sent to you as a direct message on Nostr.",this.isGood=!1}handleInputChange(e){state.isOTP?state.nlSigninOTP.code=e.target.value:(state.nlSigninOTP.loginName=e.target.value,this.nlCheckLogin.emit(state.nlSigninOTP.loginName))}handleLogin(e){e.preventDefault(),state.isOTP?this.nlLoginOTPCode.emit(state.nlSigninOTP.code):this.nlLoginOTPUser.emit(state.nlSigninOTP.loginName)}render(){return h(Fragment,{key:"709d350659757afd0ab48e36c71d8c4383bfefe0"},h("div",{key:"b0f5f62a5f154bfcc2f7a7af58cfc05614110c34",class:"p-4 overflow-y-auto"},h("h1",{key:"b846587dd89240232ae5e80812073b88e8885ebf",class:"nl-title font-bold text-center text-2xl"},state.isOTP?this.titleLoginOTP:this.titleLogin),h("p",{key:"41e3ffb50a451af98c5864e53cf9b29b6f9954eb",class:"nl-description font-light text-center text-sm pt-2 max-w-96 mx-auto"},state.isOTP?this.descriptionOTP:this.description)),h("div",{key:"ef89992613d828c4522af37be614e03c00ca181f",class:"max-w-72 mx-auto"},h("div",{key:"bea6fbf173fdc9a248d96318547a3e4d72df1b21",class:"relative mb-2"},h("input",{key:"2c5dce83b126cfc0c10c5609da99c124944a3050",onInput:e=>this.handleInputChange(e),type:"text",class:"nl-input peer py-3 px-4 ps-11 block w-full border-transparent rounded-lg text-sm disabled:opacity-50 disabled:pointer-events-none dark:border-transparent",placeholder:state.isOTP?"code from direct message":"npub or name@domain",value:state.isOTP?state.nlSigninOTP.code:state.nlSigninOTP.loginName}),h("div",{key:"ca758a6f68f12dbd6913378de1f167cc59df86f2",class:"absolute inset-y-0 start-0 flex items-center pointer-events-none ps-4 peer-disabled:opacity-50 peer-disabled:pointer-events-none"},h("svg",{key:"c6d6fd56d5ea9b01983578e6a182c71e80156088",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:this.isGood?"#00cc00":"currentColor",class:"flex-shrink-0 w-4 h-4 text-gray-500"},h("path",{key:"89553d48fa3519fe42ea3ad3f6a8d4de90db9c66","stroke-linecap":"round","stroke-linejoin":"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),h("path",{key:"4a4ae482c3095537b30be245c4aabc9d5c65902d","stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})))),h("div",{key:"94ccf98dadf388302f8269a822accac872c1a1bb",class:"ps-4 pe-4 overflow-y-auto"},h("p",{key:"dc167d95b9aa12f1a8034af58d652671d345c07e",class:"nl-error font-light text-center text-sm max-w-96 mx-auto"},state.error)),h("button-base",{key:"98b1b8d1b2cc4547be2862db89f684a7278184b2",titleBtn:"Log in",disabled:state.isLoading,onClick:e=>this.handleLogin(e)},state.isLoading&&h("span",{key:"2edccf4b93a7daf6bb33b0ff373248ee1ff84970",slot:"icon-start",class:"animate-spin-loading inline-block w-4 h-4 border-[3px] border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"}))))}static get style(){return NlSigninOtpStyle0}},[0,"nl-signin-otp",{titleLogin:[1,"title-login"],description:[1],titleLoginOTP:[1,"title-login-o-t-p"],descriptionOTP:[1,"description-o-t-p"],isGood:[32]}]);function defineCustomElement$a(){if("undefined"==typeof customElements)return;["nl-signin-otp","button-base"].forEach((e=>{switch(e){case"nl-signin-otp":customElements.get(e)||customElements.define(e,NlSigninOtp);break;case"button-base":customElements.get(e)||defineCustomElement$s()}}))}defineCustomElement$a();const nlSigninReadOnlyCss=baseCss,NlSigninReadOnlyStyle0=nlSigninReadOnlyCss,NlSigninReadOnly=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlLoginReadOnly=createEvent$1(this,"nlLoginReadOnly"),this.nlCheckLogin=createEvent$1(this,"nlCheckLogin"),this.titleLogin="Log in to read only",this.description="Please enter the user name or npub of any Nostr user.",this.isGood=!1}handleInputChange(e){state.nlSigninReadOnly.loginName=e.target.value,this.nlCheckLogin.emit(e.target.value)}handleLogin(e){e.preventDefault(),this.nlLoginReadOnly.emit(state.nlSigninReadOnly.loginName)}render(){return h(Fragment,{key:"ab72934e6f777bd62e5065cee268b2dff4209a05"},h("div",{key:"c8b77eac4c36dc67d1e550dbef1969aefa0db3b9",class:"p-4 overflow-y-auto"},h("h1",{key:"711b4d81bc446a4e1925ea6772d8724492410492",class:"nl-title font-bold text-center text-2xl"},this.titleLogin),h("p",{key:"1bd45ccdcf760a0428e979bea6cd5d4946efa440",class:"nl-description font-light text-center text-sm pt-2 max-w-96 mx-auto"},this.description)),h("div",{key:"1c086de3f2d458c9f3163314e17ee056bd30b89e",class:"max-w-72 mx-auto"},h("div",{key:"29baadba904448aff56f5b490e4684b4f5669817",class:"relative mb-2"},h("input",{key:"85a2266a004e7832f3a8bf6586fdab68364441ed",onInput:e=>this.handleInputChange(e),type:"text",class:"nl-input peer py-3 px-4 ps-11 block w-full border-transparent rounded-lg text-sm disabled:opacity-50 disabled:pointer-events-none dark:border-transparent",placeholder:"npub or name@domain",value:state.nlSigninReadOnly.loginName}),h("div",{key:"d563c7cdd5c7dd560d7a3c6c5e5b7a36798d2fe3",class:"absolute inset-y-0 start-0 flex items-center pointer-events-none ps-4 peer-disabled:opacity-50 peer-disabled:pointer-events-none"},h("svg",{key:"57bf5e498bb4ce520de1665555618be2a191660a",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:this.isGood?"#00cc00":"currentColor",class:"flex-shrink-0 w-4 h-4 text-gray-500"},h("path",{key:"354d1a2b42d1590430b13b63fa8b54d365743d17","stroke-linecap":"round","stroke-linejoin":"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),h("path",{key:"3fd555ef4b8ef4d6d38fa8d417c0c8745412b70a","stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})))),h("div",{key:"47991d46b02ede704b99e3958e81871cc733a874",class:"ps-4 pe-4 overflow-y-auto"},h("p",{key:"9bf3a572a89d85d5da61c6665060b5f5b2e8f46c",class:"nl-error font-light text-center text-sm max-w-96 mx-auto"},state.error)),h("button-base",{key:"bee14c47813853dcdcba90ae29a10cded60e902a",titleBtn:"Log in",disabled:state.isLoading,onClick:e=>this.handleLogin(e)},state.isLoading&&h("span",{key:"acf228ea98993476107e394f6a74f27a5b6efa84",slot:"icon-start",class:"animate-spin-loading inline-block w-4 h-4 border-[3px] border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"}))))}static get style(){return NlSigninReadOnlyStyle0}},[0,"nl-signin-read-only",{titleLogin:[1,"title-login"],description:[1],isGood:[32]}]);function defineCustomElement$9(){if("undefined"==typeof customElements)return;["nl-signin-read-only","button-base"].forEach((e=>{switch(e){case"nl-signin-read-only":customElements.get(e)||customElements.define(e,NlSigninReadOnly);break;case"button-base":customElements.get(e)||defineCustomElement$s()}}))}defineCustomElement$9();const nlSignupCss=baseCss,NlSignupStyle0=nlSignupCss,NlSignup=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlSignup=createEvent$1(this,"nlSignup"),this.nlCheckSignup=createEvent$1(this,"nlCheckSignup"),this.fetchHandler=createEvent$1(this,"fetchHandler"),this.titleSignup="Create keys with key store",this.description="Choose some username and a key store service.",this.bunkers="nsec.app,highlighter.com",this.isAvailable=!1}formatServers(e){return e.split(",").map((e=>({name:"@"+e,value:e})))}handleInputChange(e){state.nlSignup.signupName=e.target.value,this.nlCheckSignup.emit(`${e.target.value}@${state.nlSignup.domain}`)}handleDomainSelect(e){state.nlSignup.domain=e.detail,this.nlCheckSignup.emit(`${state.nlSignup.signupName}@${e.detail}`)}handleCreateAccount(e){e.preventDefault(),this.nlSignup.emit(`${state.nlSignup.signupName}@${state.nlSignup.domain}`)}watchBunkersHandler(e){state.nlSignup.servers=this.formatServers(e)}componentWillLoad(){state.nlSignup.servers=this.formatServers(this.bunkers)}render(){return h(Fragment,{key:"100d9330a518e02431bd21dce3247225d2e148a6"},h("div",{key:"f6ca0cc88094790a2ec0dd7ee8e03073b5aed315",class:"p-4 overflow-y-auto"},h("h1",{key:"341daf884a33b81946265dd688910e411b87f90a",class:"nl-title font-bold text-center text-2xl"},this.titleSignup),h("p",{key:"9e8a890c91b026739a71b00a06ba0dd6c52a0a94",class:"nl-description font-light text-center text-sm pt-2 max-w-96 mx-auto"},this.description)),h("div",{key:"0d1cae8ceea504f40f49fff35d3a3e2162801c48",class:"max-w-72 mx-auto"},h("div",{key:"0aa970acebd3392d3c2b91a57bf18982397cbfd2",class:"relative mb-2"},h("input",{key:"861f95f3dfe8cbedaeabe5e80d310cee8ec6b3ef",onInput:e=>this.handleInputChange(e),type:"text",class:"nl-input peer py-3 px-4 ps-11 block w-full border-transparent rounded-lg text-sm disabled:opacity-50 disabled:pointer-events-none dark:border-transparent",placeholder:"Name",value:state.nlSignup.signupName}),h("div",{key:"687cd576c83a67e4ad946da7d675153eb1c249cd",class:"absolute inset-y-0 start-0 flex items-center pointer-events-none ps-4 peer-disabled:opacity-50 peer-disabled:pointer-events-none"},h("svg",{key:"d870596edf59c8d747c08d887af7d3b33060f9f4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:this.isAvailable?"#00cc00":"currentColor",class:"flex-shrink-0 w-4 h-4 text-gray-500"},h("path",{key:"2669def09130b54c40ab3fb9ac044490c6465e32","stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"})))),h("div",{key:"b2dbdd050024352b399a7fb1925dd530680d1b3a",class:"mb-2"},h("nl-select",{key:"c6f4c4a5c5854a1980ab67dd43958dc5120ba0aa",onSelectDomain:e=>this.handleDomainSelect(e),selected:0,options:state.nlSignup.servers})),h("div",{key:"e92991946bcf756880fb607365e8415943af393e",class:"ps-4 pe-4 overflow-y-auto"},h("p",{key:"8e5d4f08c0996a5b80364ab2abfcbf869a45a066",class:"nl-error font-light text-center text-sm max-w-96 mx-auto"},state.error)),h("button-base",{key:"04a486b8a81f3750d048362689365b3a975ef0d1",disabled:state.isLoading,onClick:e=>this.handleCreateAccount(e),titleBtn:"Create profile"},state.isLoading?h("span",{slot:"icon-start",class:"animate-spin-loading inline-block w-4 h-4 border-[3px] border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"}):h("svg",{slot:"icon-start",style:{display:"none"},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M18 7.5v3m0 0v3m0-3h3m-3 0h-3m-2.25-4.125a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0ZM3 19.235v-.11a6.375 6.375 0 0 1 12.75 0v.109A12.318 12.318 0 0 1 9.374 21c-2.331 0-4.512-.645-6.374-1.766Z"})))))}static get watchers(){return{bunkers:["watchBunkersHandler"]}}static get style(){return NlSignupStyle0}},[0,"nl-signup",{titleSignup:[1,"title-signup"],description:[1],bunkers:[1],isAvailable:[32]},void 0,{bunkers:["watchBunkersHandler"]}]);function defineCustomElement$8(){if("undefined"==typeof customElements)return;["nl-signup","button-base","nl-select"].forEach((e=>{switch(e){case"nl-signup":customElements.get(e)||customElements.define(e,NlSignup);break;case"button-base":customElements.get(e)||defineCustomElement$s();break;case"nl-select":customElements.get(e)||defineCustomElement$n()}}))}defineCustomElement$8();const nlWelcomeCss=baseCss,NlWelcomeStyle0=nlWelcomeCss,NlWelcome=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.titleWelcome="Welcome to Nostr!",this.description="This website is part of the Nostr network. Log in with your Nostr profile or sign up to join."}handleChangeScreen(e){state.path=[...state.path,e]}render(){return h(Fragment,{key:"6f0a48d82976e4148caf8ff8c4a000355696de48"},h("div",{key:"ceaf09713ee4cdd7fba07db76aa64b3e7aabef52",class:"p-4 overflow-y-auto"},h("h1",{key:"dee6b8c58bed8216c8929550231860b7fab9600f",class:"nl-title font-bold text-center text-4xl"},this.titleWelcome),h("p",{key:"d63d6c7f040b32886f4a2c165640cbff5bae525f",class:"nl-description font-light text-center text-lg pt-2 max-w-96 mx-auto"},this.description)),h("div",{key:"bdfd30799af7e1c0d003cbce2e1c97f0c4d8345e",class:"max-w-52 mx-auto pb-5"},h("div",{key:"c1845b8823b5992647eedc8d0de4106adad2905f",class:"flex gap-3 flex-col mb-2"},h("button-base",{key:"92a35fd59f02a3f1b35757f36a111e6978dccd4e",titleBtn:"Log in",onClick:()=>this.handleChangeScreen(CURRENT_MODULE.WELCOME_LOGIN)},h("svg",{key:"1fbcbe9b48913334b7cb96571d527de2ede1083f",style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{key:"0cebc8b3d0747c9598d08b6b81f95e5dd1a325c1","stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"})))),h("button-base",{key:"1d94662ed04041cf8246ba75792c88288694769d",onClick:()=>this.handleChangeScreen(CURRENT_MODULE.WELCOME_SIGNUP),titleBtn:"Sign up"},h("svg",{key:"4b610e3752bc18c40f2afb2385d3ec64ee71f656",style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{key:"23f217c6d17f81aa55bdc153bc8fb26dcebae9dc","stroke-linecap":"round","stroke-linejoin":"round",d:"M18 7.5v3m0 0v3m0-3h3m-3 0h-3m-2.25-4.125a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0ZM3 19.235v-.11a6.375 6.375 0 0 1 12.75 0v.109A12.318 12.318 0 0 1 9.374 21c-2.331 0-4.512-.645-6.374-1.766Z"})))))}static get style(){return NlWelcomeStyle0}},[0,"nl-welcome",{titleWelcome:[1,"title-welcome"],description:[1]}]);function defineCustomElement$7(){if("undefined"==typeof customElements)return;["nl-welcome","button-base"].forEach((e=>{switch(e){case"nl-welcome":customElements.get(e)||customElements.define(e,NlWelcome);break;case"button-base":customElements.get(e)||defineCustomElement$s()}}))}defineCustomElement$7();const nlWelcomeSigninCss=baseCss,NlWelcomeSigninStyle0=nlWelcomeSigninCss,NlWelcomeSignIn=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlLoginExtension=createEvent$1(this,"nlLoginExtension"),this.titleWelcome="Log in",this.hasExtension=!1,this.authMethods=[],this.hasOTP=!1}handleChangeScreen(e){state.path=[...state.path,e],e===CURRENT_MODULE.EXTENSION&&this.nlLoginExtension.emit()}allowAuthMethod(e){return!this.authMethods.length||this.authMethods.includes(e)}renderSignInWithExtension(){return h("button-base",{onClick:()=>this.handleChangeScreen(CURRENT_MODULE.EXTENSION),titleBtn:"With extension"},h("svg",{style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 8.25V18a2.25 2.25 0 0 0 2.25 2.25h13.5A2.25 2.25 0 0 0 21 18V8.25m-18 0V6a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 6v2.25m-18 0h18M5.25 6h.008v.008H5.25V6ZM7.5 6h.008v.008H7.5V6Zm2.25 0h.008v.008H9.75V6Z"})))}render(){return h(Fragment,{key:"037b8d2ba99338efd13be6a1ec49accace64218b"},h("div",{key:"cedab2e7f1a4b8df177d5b6fd4c609aa45ff5965",class:"p-4 overflow-y-auto"},h("h1",{key:"0bbae7bd31433baa6f8572cd7fdcd60b64cb3abb",class:"nl-title font-bold text-center text-3xl"},this.titleWelcome)),h("div",{key:"d1cd467c79e0034e93522045990f7d1f10e95f42",class:"max-w-52 mx-auto pb-5"},h("div",{key:"f89c6551de4b27d04f07051049093c43bd77dd9b",class:"flex gap-3 flex-col"},this.allowAuthMethod("connect")&&h("button-base",{key:"a86482667df33e31dff35544364576cd0fbeec0b",titleBtn:"Connect",onClick:()=>this.handleChangeScreen(CURRENT_MODULE.CONNECT)},h("svg",{key:"b0b8f37580302000950c4a89a0239132b1aca88a",style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{key:"feef73e7c96f9f494abc9f3946c2c96446c117fb","stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 9V5.25A2.25 2.25 0 0 1 10.5 3h6a2.25 2.25 0 0 1 2.25 2.25v13.5A2.25 2.25 0 0 1 16.5 21h-6a2.25 2.25 0 0 1-2.25-2.25V15M12 9l3 3m0 0-3 3m3-3H2.25"}))),this.allowAuthMethod("readOnly")&&h("button-base",{key:"75cb54d6ba1961239c89f2e2e0699a0f7a3b3841",onClick:()=>this.handleChangeScreen(CURRENT_MODULE.LOGIN_READ_ONLY),titleBtn:"Read only"},h("svg",{key:"4d3741e46c24963e3373d308916e04f1b9cdddad",style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{key:"109481732e23a555dabb8bd2aaf072984ac2642c","stroke-linecap":"round","stroke-linejoin":"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),h("path",{key:"7c571b8540f5d4f89c3f10c05d1f029cb2184e84","stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))),this.hasOTP&&this.allowAuthMethod("otp")&&h("button-base",{key:"b3f78d5917f4efef7551e093d6cb5ef3d906eaa6",titleBtn:"One-time code",onClick:()=>this.handleChangeScreen(CURRENT_MODULE.LOGIN_OTP)},h("svg",{key:"f4dac958561ba1710d262cb07886f9dc15ebeb9e",style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{key:"da957eadb59492f7c907b35dd20a4eb5bdabe559","stroke-linecap":"round","stroke-linejoin":"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))),this.hasExtension&&this.allowAuthMethod("extension")&&this.renderSignInWithExtension(),h("button-base",{key:"fa26358ebee467e4926b3a820c38a34b6f2ea1b4",onClick:()=>this.handleChangeScreen(CURRENT_MODULE.LOGIN_NSEC),titleBtn:"With nsec"},h("svg",{key:"b3a248c229e2571c038a88c8d93c802927ec2b43",style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{key:"ac007bbc3bf0e6e8654fdcaa57cfbdecf1f67fb9","stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"}))),!this.allowAuthMethod("connect")&&!this.hasExtension&&h("p",{key:"fa06ff007947dee35315b6311097fc03cc55da78",class:"nl-description font-light text-center text-lg pt-2 max-w-96 mx-auto"},"No Nostr extension!"),!this.allowAuthMethod("connect")&&this.hasExtension&&!this.allowAuthMethod("extension")&&h("p",{key:"0080e835c7024ed6f867f96399b604651ea74483",class:"nl-description font-light text-center text-lg pt-2 max-w-96 mx-auto"},"Use advanced options."))))}static get style(){return NlWelcomeSigninStyle0}},[0,"nl-welcome-signin",{titleWelcome:[1,"title-welcome"],hasExtension:[4,"has-extension"],authMethods:[16],hasOTP:[4,"has-o-t-p"]}]);function defineCustomElement$6(){if("undefined"==typeof customElements)return;["nl-welcome-signin","button-base"].forEach((e=>{switch(e){case"nl-welcome-signin":customElements.get(e)||customElements.define(e,NlWelcomeSignIn);break;case"button-base":customElements.get(e)||defineCustomElement$s()}}))}defineCustomElement$6();const nlWelcomeSignupCss=baseCss,NlWelcomeSignupStyle0=nlWelcomeSignupCss,NlWelcomeSignUp=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.titleWelcome="Sign up",this.description="Nostr profiles are based on cryptographic keys. You can create keys right here, or with a key storage app."}handleChangeScreen(e){state.path=[...state.path,e]}render(){return h(Fragment,{key:"164e5da760f1609d604bbc85867bd3ae788ce924"},h("div",{key:"03691d670c29b844cae9a771c12c37b1e9540e95",class:"p-4 overflow-y-auto"},h("h1",{key:"0b60f6cf4c8a9cd9ecf3161c64761c7d7c9fb57e",class:"nl-title font-bold text-center text-3xl"},this.titleWelcome),h("p",{key:"91a2e92660873d45f2e92d60a0a7adc3114a0d8d",class:"nl-description font-light text-center text-lg pt-2 max-w-96 mx-auto"},this.description)),h("div",{key:"a14d1a9ac594806be23679b59d9081e2ec1ef92d",class:"max-w-52 mx-auto pb-5"},h("div",{key:"6c8c856efe85e19a3a432c856ddd658aea7e2bd2",class:"flex gap-3 flex-col"},h("button-base",{key:"50c470453b16b552a4070c451f57baa4e366eb7d",onClick:()=>this.handleChangeScreen(CURRENT_MODULE.LOCAL_SIGNUP),titleBtn:"Create keys"},h("svg",{key:"da1d5889dbbc208bafed0d460a65cae6523b2269",style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{key:"ccae3b5c13c1953fe47f5fe416d35b031cf84c3d","stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"}))),h("button-base",{key:"6a557e8d6f926fd0f185c280ae4a372139f8aa5b",onClick:()=>this.handleChangeScreen(CURRENT_MODULE.SIGNUP),titleBtn:"With key store"},h("svg",{key:"08ea855bea4186d1f73a6fde7264585930fe6f91",style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{key:"4cc3dc620843a3a970f558b8702ad109411eaf0c","stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"}))))))}static get style(){return NlWelcomeSignupStyle0}},[0,"nl-welcome-signup",{titleWelcome:[1,"title-welcome"],description:[1]}]);function defineCustomElement$5(){if("undefined"==typeof customElements)return;["nl-welcome-signup","button-base"].forEach((e=>{switch(e){case"nl-welcome-signup":customElements.get(e)||customElements.define(e,NlWelcomeSignUp);break;case"button-base":customElements.get(e)||defineCustomElement$s()}}))}defineCustomElement$5();const nlAuthCss=baseCss,NlAuthStyle0=nlAuthCss,NlAuth=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.nlCloseModal=createEvent$1(this,"nlCloseModal"),this.nlChangeDarkMode=createEvent$1(this,"nlChangeDarkMode"),this.nlNostrConnectDefaultCancel=createEvent$1(this,"nlNostrConnectDefaultCancel"),this.prevPath="",this.theme="default",this.bunkers="",this.startScreen=CURRENT_MODULE.WELCOME,this.authMethods=[],this.hasExtension=!1,this.hasOTP=!1,this.isLoading=!1,this.isLoadingExtension=!1,this.isOTP=!1,this.authUrl="",this.iframeUrl="",this.error="",this.localSignup=!1,this.signupNjump=!1,this.njumpIframe="",this.accounts=[],this.recents=[],this.darkMode=!1,this.welcomeTitle="",this.welcomeDescription="",this.connectionString="",this.connectionStringServices=[]}watchLoadingHandler(e){state.isLoading=e}watchLoadingExtensionHandler(e){state.isLoadingExtension=e}watchOTPHandler(e){state.isOTP=e}watchAuthUrlHandler(e){state.authUrl=e}watchIframeUrlHandler(e){state.iframeUrl=e}watchNjumpIframeHandler(e){state.njumpIframe=e}watchErrorHandler(e){state.error=e}handleClose(){this.nlCloseModal.emit()}handleChangeDarkMode(){this.nlChangeDarkMode.emit(!this.darkMode)}componentWillLoad(){state.path=[this.startScreen],state.error="",state.iframeUrl="",state.authUrl="",state.isLoading=!1,state.isLoadingExtension=!1,state.isOTP=!1,console.log("path",state.path)}handleClickToBack(){state.path.pop(),state.path=[...state.path],state.isLoading=!1,state.isLoadingExtension=!1,state.authUrl="",state.isOTP=!1}switchSignSignUpStrategy(e){CURRENT_MODULE.LOCAL_SIGNUP!==e?state.path=[CURRENT_MODULE.WELCOME,e]:state.path=[CURRENT_MODULE.WELCOME,CURRENT_MODULE.WELCOME_SIGNUP,e]}render(){const e="w-full h-full fixed top-0 start-0 z-[80] overflow-x-hidden overflow-y-auto flex items-center "+(this.darkMode?"dark":""),t=state.path.at(-1);t!==this.prevPath&&this.prevPath===CURRENT_MODULE.CONNECTION_STRING&&this.nlNostrConnectDefaultCancel.emit(),this.prevPath=t;const n=state.isOTP||t!==CURRENT_MODULE.INFO&&t!==CURRENT_MODULE.CONFIRM_LOGOUT&&t!==CURRENT_MODULE.IMPORT_FLOW&&t!==CURRENT_MODULE.WELCOME&&t!==CURRENT_MODULE.EXTENSION&&t!==CURRENT_MODULE.IFRAME&&t!==CURRENT_MODULE.PREVIOUSLY_LOGGED,o=t!==CURRENT_MODULE.IFRAME&&(!this.authMethods.length||!this.localSignup&&this.authMethods.includes("connect")||this.localSignup&&this.authMethods.includes("local"));return h("div",{class:`theme-${this.theme}`,dir:"ltr"},h("div",{class:e},h("div",{onClick:()=>this.handleClose(),class:"absolute top-0 left-0 w-full h-full bg-gray-500 bg-opacity-75 z-[80]"}),h("div",{class:"nl-bg relative z-[81] w-full flex flex-col rounded-xl sm:max-w-lg sm:w-full sm:mx-auto"},h("div",{class:"flex justify-between items-center py-3 px-4"},h("div",{class:"flex gap-2 items-center"},h("svg",{class:"w-7 h-7",width:"225",height:"224",viewBox:"0 0 225 224",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("rect",{width:"224.047",height:"224",rx:"64",fill:"#6951FA"}),h("path",{d:"M162.441 135.941V88.0593C170.359 85.1674 176 77.5348 176 68.6696C176 57.2919 166.708 48 155.33 48C143.953 48 134.661 57.2444 134.661 68.6696C134.661 77.5822 140.302 85.1674 148.219 88.0593V135.941C147.698 136.13 147.176 136.367 146.655 136.604L87.3956 77.3452C88.6282 74.6904 89.2919 71.7511 89.2919 68.6696C89.2919 57.2444 80.0474 48 68.6696 48C57.2919 48 48 57.2444 48 68.6696C48 77.5822 53.6415 85.1674 61.5585 88.0593V135.941C53.6415 138.833 48 146.465 48 155.33C48 166.708 57.2444 176 68.6696 176C80.0948 176 89.3393 166.708 89.3393 155.33C89.3393 146.418 83.6978 138.833 75.7807 135.941V88.0593C76.3022 87.8696 76.8237 87.6326 77.3452 87.3956L136.604 146.655C135.372 149.31 134.708 152.249 134.708 155.33C134.708 166.708 143.953 176 155.378 176C166.803 176 176.047 166.708 176.047 155.33C176.047 146.418 170.406 138.833 162.489 135.941H162.441Z",fill:"white"})),h("p",{class:"font-bold nl-logo text-base"},"Nostr ",h("span",{class:"font-light"},"Login"))),h("div",{class:"flex gap-1"},h("button",{onClick:()=>this.handleChangeDarkMode(),type:"button",class:"nl-action-button flex justify-center items-center w-7 h-7 text-sm font-semibold rounded-full border border-transparent"},h("span",{class:"sr-only"},"Change theme"),this.darkMode?h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"flex-shrink-0 w-5 h-5"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"})):h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"flex-shrink-0 w-5 h-5"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"}))),!state.isLoading&&h("button",{onClick:()=>state.path=[...state.path,CURRENT_MODULE.INFO],type:"button",class:"nl-action-button flex justify-center items-center w-7 h-7 text-sm font-semibold rounded-full border border-transparent"},h("span",{class:"sr-only"},"Info"),h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"flex-shrink-0 w-5 h-5"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))),h("button",{onClick:()=>this.handleClose(),type:"button",class:"nl-action-button flex justify-center items-center w-7 h-7 text-sm font-semibold rounded-full border border-transparent"},h("span",{class:"sr-only"},"Close"),h("svg",{class:"flex-shrink-0 w-5 h-5",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},h("path",{d:"M18 6 6 18"}),h("path",{d:"m6 6 12 12"}))))),state.path.length>1&&!state.isLoading&&h("div",{class:"p-4"},h("button",{onClick:()=>this.handleClickToBack(),type:"button",class:"nl-action-button flex justify-center items-center w-7 h-7 text-sm font-semibold rounded-full border border-transparent dark:focus:outline-none dark:focus:ring-1 dark:focus:ring-gray-600","data-hs-overlay":"#hs-vertically-centered-modal"},h("span",{class:"sr-only"},"Back"),h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"flex-shrink-0 w-5 h-5"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"})))),state.isLoading||state.authUrl?h("nl-loading",{path:t}):h(Fragment,null,(()=>{if(state.isOTP)return h("nl-signin-otp",null);switch(t){case CURRENT_MODULE.WELCOME:return h("nl-welcome",{titleWelcome:this.welcomeTitle||void 0,description:this.welcomeDescription||void 0});case CURRENT_MODULE.LOGIN:return h("nl-signin",null);case CURRENT_MODULE.SIGNUP:return h("nl-signup",{bunkers:this.bunkers});case CURRENT_MODULE.LOCAL_SIGNUP:return h("nl-local-signup",{signupNjump:this.signupNjump});case CURRENT_MODULE.CONFIRM_LOGOUT:return h("nl-confirm-logout",null);case CURRENT_MODULE.IMPORT_FLOW:return h("nl-import-flow",{services:this.connectionStringServices});case CURRENT_MODULE.IMPORT_OTP:return h("nl-otp-migrate",{services:this.connectionStringServices});case CURRENT_MODULE.INFO:return h("nl-info",null);case CURRENT_MODULE.EXTENSION:return h("nl-info-extension",null);case CURRENT_MODULE.LOGIN_READ_ONLY:return h("nl-signin-read-only",null);case CURRENT_MODULE.LOGIN_BUNKER_URL:return h("nl-signin-bunker-url",null);case CURRENT_MODULE.LOGIN_OTP:return h("nl-signin-otp",null);case CURRENT_MODULE.LOGIN_NSEC:return h("nl-signin-nsec",null);case CURRENT_MODULE.WELCOME_LOGIN:return h("nl-welcome-signin",{hasOTP:this.hasOTP,authMethods:this.authMethods,hasExtension:this.hasExtension});case CURRENT_MODULE.WELCOME_SIGNUP:return h("nl-welcome-signup",null);case CURRENT_MODULE.CONNECTION_STRING:return h("nl-signin-connection-string",{connectionString:this.connectionString});case CURRENT_MODULE.CONNECT:return h("nl-connect",{connectionStringServices:this.connectionStringServices,authMethods:this.authMethods});case CURRENT_MODULE.PREVIOUSLY_LOGGED:return h("nl-previously-logged",{accounts:this.accounts,recents:this.recents});case CURRENT_MODULE.IFRAME:return h("nl-iframe",{iframeUrl:this.authUrl});default:return h("nl-welcome",null)}})(),n&&h(Fragment,null,t===CURRENT_MODULE.WELCOME_SIGNUP||t===CURRENT_MODULE.SIGNUP||t===CURRENT_MODULE.LOCAL_SIGNUP?h("div",{class:"p-4 overflow-y-auto"},h("p",{class:"nl-footer font-light text-center text-sm pt-3 max-w-96 mx-auto"},"If you already have a profile please"," ",h("span",{onClick:()=>this.switchSignSignUpStrategy(CURRENT_MODULE.WELCOME_LOGIN),class:"cursor-pointer text-blue-400"},"log in"),".")):o&&h("div",{class:"p-4 overflow-y-auto"},h("p",{class:"nl-footer font-light text-center text-sm pt-3 max-w-96 mx-auto"},"If you don't have a profile please"," ",h("span",{onClick:()=>this.localSignup?this.switchSignSignUpStrategy(CURRENT_MODULE.LOCAL_SIGNUP):this.switchSignSignUpStrategy(CURRENT_MODULE.WELCOME_SIGNUP),class:"cursor-pointer text-blue-400"},"sign up"),".")))))))}static get watchers(){return{isLoading:["watchLoadingHandler"],isLoadingExtension:["watchLoadingExtensionHandler"],isOTP:["watchOTPHandler"],authUrl:["watchAuthUrlHandler"],iframeUrl:["watchIframeUrlHandler"],njumpIframe:["watchNjumpIframeHandler"],error:["watchErrorHandler"]}}static get style(){return NlAuthStyle0}},[1,"nl-auth",{theme:[1025],bunkers:[1],startScreen:[1,"start-screen"],authMethods:[16],hasExtension:[4,"has-extension"],hasOTP:[4,"has-o-t-p"],isLoading:[4,"is-loading"],isLoadingExtension:[4,"is-loading-extension"],isOTP:[4,"is-o-t-p"],authUrl:[1,"auth-url"],iframeUrl:[1,"iframe-url"],error:[1],localSignup:[4,"local-signup"],signupNjump:[4,"signup-njump"],njumpIframe:[1,"njump-iframe"],accounts:[1040],recents:[1040],darkMode:[1028,"dark-mode"],welcomeTitle:[1,"welcome-title"],welcomeDescription:[1,"welcome-description"],connectionString:[1,"connection-string"],connectionStringServices:[16]},void 0,{isLoading:["watchLoadingHandler"],isLoadingExtension:["watchLoadingExtensionHandler"],isOTP:["watchOTPHandler"],authUrl:["watchAuthUrlHandler"],iframeUrl:["watchIframeUrlHandler"],njumpIframe:["watchNjumpIframeHandler"],error:["watchErrorHandler"]}]);function defineCustomElement$4(){if("undefined"==typeof customElements)return;["nl-auth","button-base","nl-confirm-logout","nl-connect","nl-iframe","nl-import-flow","nl-info","nl-info-extension","nl-loading","nl-local-signup","nl-login-status","nl-nip46-relay-settings","nl-otp-migrate","nl-previously-logged","nl-select","nl-signin","nl-signin-bunker-url","nl-signin-connection-string","nl-signin-nsec","nl-signin-otp","nl-signin-read-only","nl-signup","nl-welcome","nl-welcome-signin","nl-welcome-signup"].forEach((e=>{switch(e){case"nl-auth":customElements.get(e)||customElements.define(e,NlAuth);break;case"button-base":customElements.get(e)||defineCustomElement$s();break;case"nl-confirm-logout":customElements.get(e)||defineCustomElement$r();break;case"nl-connect":customElements.get(e)||defineCustomElement$p();break;case"nl-iframe":customElements.get(e)||defineCustomElement$o();break;case"nl-import-flow":customElements.get(e)||defineCustomElement$m();break;case"nl-info":customElements.get(e)||defineCustomElement$l();break;case"nl-info-extension":customElements.get(e)||defineCustomElement$k();break;case"nl-loading":customElements.get(e)||defineCustomElement$j();break;case"nl-local-signup":customElements.get(e)||defineCustomElement$i();break;case"nl-login-status":customElements.get(e)||defineCustomElement$h();break;case"nl-nip46-relay-settings":customElements.get(e)||defineCustomElement$q();break;case"nl-otp-migrate":customElements.get(e)||defineCustomElement$g();break;case"nl-previously-logged":customElements.get(e)||defineCustomElement$f();break;case"nl-select":customElements.get(e)||defineCustomElement$n();break;case"nl-signin":customElements.get(e)||defineCustomElement$e();break;case"nl-signin-bunker-url":customElements.get(e)||defineCustomElement$d();break;case"nl-signin-connection-string":customElements.get(e)||defineCustomElement$c();break;case"nl-signin-nsec":customElements.get(e)||defineCustomElement$b();break;case"nl-signin-otp":customElements.get(e)||defineCustomElement$a();break;case"nl-signin-read-only":customElements.get(e)||defineCustomElement$9();break;case"nl-signup":customElements.get(e)||defineCustomElement$8();break;case"nl-welcome":customElements.get(e)||defineCustomElement$7();break;case"nl-welcome-signin":customElements.get(e)||defineCustomElement$6();break;case"nl-welcome-signup":customElements.get(e)||defineCustomElement$5()}}))}defineCustomElement$4();const NlButton=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.theme="default",this.darkMode=!1,this.titleBtn="Open modal",this.disabled=!1}render(){return h("button-base",{key:"9f7936090efc7263cce71d1ad89490d7f5445991",theme:this.theme,darkMode:this.darkMode,titleBtn:this.titleBtn,disabled:this.disabled})}},[1,"nl-button",{theme:[1],darkMode:[4,"dark-mode"],titleBtn:[1,"title-btn"],disabled:[4]}]);function defineCustomElement$3(){if("undefined"==typeof customElements)return;["nl-button","button-base"].forEach((e=>{switch(e){case"nl-button":customElements.get(e)||customElements.define(e,NlButton);break;case"button-base":customElements.get(e)||defineCustomElement$s()}}))}defineCustomElement$3();const nlChangeAccountCss=baseCss,NlChangeAccountStyle0=nlChangeAccountCss,NLChangeAccount=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.handleOpenWelcomeModal=createEvent$1(this,"handleOpenWelcomeModal"),this.handleSwitchAccount=createEvent$1(this,"handleSwitchAccount"),this.isOpen=!1,this.options=[],this.accounts=[],this.currentAccount=null,this.mode=!1,this.darkMode=!1,this.themeState="default",this.theme="default"}handleWindowClick(){this.wrapperRef.querySelector(".listClass")&&(this.isOpen=!1)}toggleDropdown(){this.isOpen=!this.isOpen,this.calculateDropdownPosition()}watchPropHandler(e){this.themeState=e}watchModeHandler(e){this.mode=e}watchAccountsHandler(e){this.options=e}connectedCallback(){this.themeState=this.theme,this.mode=this.darkMode}calculateDropdownPosition(){if(this.isOpen&&this.buttonRef){const e=this.buttonRef.getBoundingClientRect();this.ulRef.style.top=`${e.height}px`}}handleChange(e){this.handleSwitchAccount.emit(e)}handleOpenModal(){this.handleOpenWelcomeModal.emit()}render(){const e=(this.isOpen?"listClass flex flex-col gap-2":"hidden")+" w-full nl-select-list absolute z-10 left-0 shadow-md rounded-lg p-2 mt-1 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full",t=(this.isOpen?"rotate-180":"rotate-0")+" duration-300 flex-shrink-0 w-4 h-4 text-gray-500",n=this.options&&this.currentAccount?this.options.filter((e=>e.pubkey!==this.currentAccount.pubkey||e.authMethod!==this.currentAccount.authMethod)):[];return h("div",{key:"4e15e39f7ac6a552bfc772396e3e9ef8eeca95cc",class:`theme-${this.themeState}`},h("div",{key:"eae10769ce35dc4cc072d2361c1ee1390c79c822",class:"relative",ref:e=>this.wrapperRef=e},h("button",{key:"e585a44168809f27b99201f7e13bd5db5e4f6569",ref:e=>this.buttonRef=e,onClick:()=>this.toggleDropdown(),type:"button",class:"nl-select peer py-3 px-4 flex items-center w-full justify-between border-transparent rounded-lg text-sm disabled:opacity-50 disabled:pointer-events-none dark:border-transparent"},h("span",{key:"006ed9a67b57227d4dab51f0b6bcb8290cd9d3ac",class:"text-gray-500"},"Switch profile"),h("svg",{key:"5f824a479165929698fab31b8837b89418587652",class:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},h("path",{key:"600914907723c9f8d01a15da357ccb825c1d1e6a",d:"m6 9 6 6 6-6"}))),h("ul",{key:"9b5b68724a3bce995e6b8b0a9d0eb653baedf79a",ref:e=>this.ulRef=e,class:e},this.options&&n.map((e=>{const t=Boolean(null==e?void 0:e.picture),n=e.name||e.nip05||e.pubkey,o=Boolean(n);return h("li",{onClick:()=>this.handleChange(e),class:"nl-select-option flex cursor-pointer items-center gap-x-3.5 py-2 px-3 rounded-lg text-sm"},h("div",{class:"uppercase font-bold w-full max-w-6 h-6 rounded-full border border-gray-400 flex justify-center items-center"},t?h("img",{class:"w-full rounded-full",src:e.picture,alt:"Logo"}):o?n[0]:h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))),h("div",{class:"overflow-hidden flex flex-col w-full"},h("div",{class:"truncate overflow-hidden"},n),h("nl-login-status",{info:e})))})),h("li",{key:"936f2b75ca2dfca3483650d5d62fc50182cfc8f2",class:"first:pt-0 pt-2 border-t-[1px] first:border-none border-gray-300"},h("div",{key:"be0b4f29e70d8e2bc9fd1cc04c0fb43ad3dd5cac",onClick:()=>this.handleOpenModal(),class:"nl-select-option flex cursor-pointer items-center gap-x-3.5 py-2 px-3 rounded-lg text-sm"},h("div",{key:"bdd2a67e5763726666fcea91b0e7de67fe855994",class:"uppercase font-bold w-6 h-6 rounded-full border border-gray-400 flex justify-center items-center"},h("svg",{key:"f3a258f3e510ccb83b95bf3abecf65c248c8b0f1",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4"},h("path",{key:"dafaa898f3e042531a923a9a77b94511895c6102","stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"}))),"Add profile")))))}get element(){return this}static get watchers(){return{theme:["watchPropHandler"],darkMode:["watchModeHandler"],accounts:["watchAccountsHandler"]}}static get style(){return NlChangeAccountStyle0}},[0,"nl-change-account",{accounts:[16],currentAccount:[16],darkMode:[4,"dark-mode"],theme:[1],isOpen:[32],options:[32],mode:[32],themeState:[32]},[[8,"click","handleWindowClick"]],{theme:["watchPropHandler"],darkMode:["watchModeHandler"],accounts:["watchAccountsHandler"]}]);function defineCustomElement$2(){if("undefined"==typeof customElements)return;["nl-change-account","nl-login-status"].forEach((e=>{switch(e){case"nl-change-account":customElements.get(e)||customElements.define(e,NLChangeAccount);break;case"nl-login-status":customElements.get(e)||defineCustomElement$h()}}))}defineCustomElement$2();const nlDialogCss=baseCss,NlDialogStyle0=nlDialogCss,NlDialog=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.__attachShadow()}componentDidLoad(){var e;null===(e=this.dialogElement)||void 0===e||e.showModal()}disconnectedCallback(){var e;null===(e=this.dialogElement)||void 0===e||e.close()}render(){return h("dialog",{key:"236049861cbba1f18e4bccfed48d3211aaefabec",ref:e=>this.dialogElement=e,class:"m-auto nl-banner-dialog",style:{border:"0",backgroundColor:"transparent"}},h("slot",{key:"b0396bb61e95d6ea66ad520e68c84f917de9db8a"}))}static get style(){return NlDialogStyle0}},[1,"nl-dialog"]);function defineCustomElement$1(){if("undefined"==typeof customElements)return;["nl-dialog"].forEach((e=>{if("nl-dialog"===e)customElements.get(e)||customElements.define(e,NlDialog)}))}defineCustomElement$1();const nlBannerCss=baseCss,NlBannerStyle0=nlBannerCss,NlBanner=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.handleNotifyConfirmBanner=createEvent$1(this,"handleNotifyConfirmBanner"),this.handleNotifyConfirmBannerIframe=createEvent$1(this,"handleNotifyConfirmBannerIframe"),this.handleLoginBanner=createEvent$1(this,"handleLoginBanner"),this.handleLogoutBanner=createEvent$1(this,"handleLogoutBanner"),this.handleOpenWelcomeModal=createEvent$1(this,"handleOpenWelcomeModal"),this.handleConfirmLogout=createEvent$1(this,"handleConfirmLogout"),this.handleImportModal=createEvent$1(this,"handleImportModal"),this.handleCancelTimeout=createEvent$1(this,"handleCancelTimeout"),this.theme="default",this.darkMode=!1,this.hiddenMode=!1,this.titleBanner="",this.isOpen=!1,this.isLoading=!1,this.notify=null,this.userInfo=null,this.accounts=[],this.isUserImgError=!1,this.domain="",this.mode="",this.url="",this.isOpenConfirm=!1}watchNotifyHandler(e){var t,n,o,r;this.isOpen=!0,this.isOpenConfirm=!0,this.domain=(null===(t=this.userInfo)||void 0===t?void 0:t.domain)||(null===(r=null===(o=null===(n=this.userInfo)||void 0===n?void 0:n.nip05)||void 0===o?void 0:o.split("@"))||void 0===r?void 0:r[1])||"",this.mode=e.mode,this.url=e.url,this.mode||(this.isOpenConfirm=!1,this.isOpen=!1)}handleOpen(){this.userInfo?this.isOpen=!0:this.handleOpenWelcomeModal.emit()}handleClose(){this.isOpen=!1}handleLogin(){this.handleLoginBanner.emit(METHOD_MODULE.LOGIN),this.handleClose()}handleSignup(){this.handleLoginBanner.emit(METHOD_MODULE.SIGNUP),this.handleClose()}handleImport(){this.handleImportModal.emit(),this.handleClose()}handleLogout(){if(localStorage.getItem("backupKey"))return this.handleLogoutBanner.emit(METHOD_MODULE.LOGOUT),this.handleClose(),void localStorage.removeItem("backupKey");"local"===this.userInfo.authMethod?this.handleConfirmLogout.emit():this.handleLogoutBanner.emit(METHOD_MODULE.LOGOUT),this.handleClose()}handleConfirm(){switch(this.mode){case"authUrl":this.handleNotifyConfirmBanner.emit(this.url);break;case"iframeAuthUrl":this.handleNotifyConfirmBannerIframe.emit(this.url)}this.handleClose()}render(){var e,t,n,o,r,s;const i=Boolean(null===(e=this.userInfo)||void 0===e?void 0:e.picture),a=(null===(t=this.userInfo)||void 0===t?void 0:t.name)||(null===(r=null===(o=null===(n=this.userInfo)||void 0===n?void 0:n.nip05)||void 0===o?void 0:o.split("@"))||void 0===r?void 0:r[0])||(null===(s=this.userInfo)||void 0===s?void 0:s.pubkey)||"",c=Boolean(a),l=h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})),d=h(Fragment,null,h("div",{class:"block w-[48px] h-[46px] relative z-10"},h("div",{onClick:()=>this.handleOpen(),class:"flex w-52 h-[46px] items-center pl-[11px]"},h("span",{class:(this.isLoading?"w-5 h-5 border-[2px] mr-3.5 ml-[2px] opacity-1":"w-0 h-0 border-[0px] mr-0 opacity-0 ml-0")+" animate-spin transition-all duration-300 ease-in-out inline-block border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"}),this.userInfo?h("div",{class:"uppercase font-bold w-6 h-6 mr-2 rounded-full border border-gray-200 flex justify-center items-center"},i?this.isUserImgError?l:h("img",{class:"w-full rounded-full",src:this.userInfo.picture,alt:"Logo",onError:()=>this.isUserImgError=!0}):c?a[0]:l):h("div",{class:"flex justify-center items-center"},h("svg",{class:"w-6 h-6",width:"225",height:"224",viewBox:"0 0 225 224",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("rect",{width:"224.047",height:"224",rx:"64",fill:"#6951FA"}),h("path",{d:"M162.441 135.941V88.0593C170.359 85.1674 176 77.5348 176 68.6696C176 57.2919 166.708 48 155.33 48C143.953 48 134.661 57.2444 134.661 68.6696C134.661 77.5822 140.302 85.1674 148.219 88.0593V135.941C147.698 136.13 147.176 136.367 146.655 136.604L87.3956 77.3452C88.6282 74.6904 89.2919 71.7511 89.2919 68.6696C89.2919 57.2444 80.0474 48 68.6696 48C57.2919 48 48 57.2444 48 68.6696C48 77.5822 53.6415 85.1674 61.5585 88.0593V135.941C53.6415 138.833 48 146.465 48 155.33C48 166.708 57.2444 176 68.6696 176C80.0948 176 89.3393 166.708 89.3393 155.33C89.3393 146.418 83.6978 138.833 75.7807 135.941V88.0593C76.3022 87.8696 76.8237 87.6326 77.3452 87.3956L136.604 146.655C135.372 149.31 134.708 152.249 134.708 155.33C134.708 166.708 143.953 176 155.378 176C166.803 176 176.047 166.708 176.047 155.33C176.047 146.418 170.406 138.833 162.489 135.941H162.441Z",fill:"white"})),this.isOpen&&h("span",{class:"px-2"},h("b",null,"Nostr")," Login")),this.isOpen&&c&&h("div",{class:"show-slow truncate w-16 text-xs"},a),this.isOpen&&c&&h("nl-login-status",{info:this.userInfo}))),h("button",{onClick:()=>this.handleClose(),type:"button",class:(this.isOpen?"z-20":"z-0")+" nl-action-button absolute right-2 top-2 z-0 show-slow grid place-items-center w-7 h-7 text-sm font-semibold rounded-full border border-transparent"},h("span",{class:"sr-only"},"Close"),h("svg",{class:"flex-shrink-0 w-5 h-5",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},h("path",{d:"M18 6 6 18"}),h("path",{d:"m6 6 12 12"}))),h("div",{class:"p-3 show-slow"},this.isOpenConfirm?h("div",null,h("div",{class:"w-8 h-8 p-1/2 rounded-full border border-gray-200 bg-white mb-2 mt-2 show-slow m-auto"},h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"#5a68ff",class:"w-full"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))),h("p",{class:"mb-2 text-center max-w-40 min-w-40 mx-auto"},"timeout"===this.mode?"Keys not responding, check your key storage app":`Confirmation required at ${this.domain}`),"timeout"===this.mode?h("div",null,h("a",{onClick:()=>this.handleClose(),href:`https://${this.domain}`,target:"_blank",class:"nl-button text-nowrap py-2.5 px-3 w-full inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-lg disabled:opacity-50 disabled:pointer-events-none dark:focus:outline-none dark:focus:ring-1 dark:focus:ring-gray-600 mb-2"},"Go to ",this.domain),h("button-base",{onClick:()=>{this.handleCancelTimeout.emit(),this.handleClose()},titleBtn:"Cancel"})):"rebind"===this.mode?h("iframe",{src:this.url,width:"180",height:"80",frameBorder:"0"}):h("button-base",{onClick:()=>this.handleConfirm(),titleBtn:"Confirm"})):h("div",null,h("div",null,this.titleBanner&&h("p",{class:"mb-2 text-center show-slow max-w-40 min-w-40 mx-auto"},this.titleBanner),h("div",{class:"mb-2"},h("nl-change-account",{currentAccount:this.userInfo,accounts:this.accounts})),this.userInfo?h("button-base",{onClick:()=>this.handleLogout(),titleBtn:"Log out"}):h("div",null,h("button-base",{onClick:()=>this.handleLogin(),titleBtn:"Log in"},h("svg",{style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"flex-shrink-0 w-4 h-4"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"}))),h("button-base",{onClick:()=>this.handleSignup(),titleBtn:"Sign up"},h("svg",{style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"flex-shrink-0 w-4 h-4"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M18 7.5v3m0 0v3m0-3h3m-3 0h-3m-2.25-4.125a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0ZM3 19.235v-.11a6.375 6.375 0 0 1 12.75 0v.109A12.318 12.318 0 0 1 9.374 21c-2.331 0-4.512-.645-6.374-1.766Z"}))))))));const u=function e(t,n){n=n||document.body;const o=Array.from(n.querySelectorAll(t)),r=function(n){e(t,n).forEach((e=>{o.includes(e)||o.push(e)}))};n.shadowRoot&&r(n.shadowRoot);for(const e of Array.from(n.querySelectorAll("*")))e.shadowRoot&&r(e.shadowRoot);return o}("dialog"),f=!!u.find((e=>e.open&&!e.classList.contains("nl-banner-dialog")));return h("div",{class:`theme-${this.theme} ${!this.isOpen&&this.hiddenMode?"hidden":""}`},h("div",{class:this.darkMode&&"dark",dir:"ltr"},this.isOpenConfirm&&f?h("nl-dialog",null,h("div",{class:`nl-banner ${this.isOpen?"w-52 h-auto right-2 rounded-r-lg isOpen ":"rounded-r-none hover:rounded-r-lg cursor-pointer"} z-50 w-12 h-12 fixed top-52 right-0 inline-block gap-x-2 text-sm font-medium rounded-lg hover:right-2 transition-all duration-300 ease-in-out`},d)):h("div",{class:`nl-banner ${this.isOpen?"w-52 h-auto right-2 rounded-r-lg isOpen":"rounded-r-none hover:rounded-r-lg cursor-pointer"} z-50 w-12 h-12 fixed top-52 right-0 inline-block gap-x-2 text-sm font-medium rounded-lg hover:right-2 transition-all duration-300 ease-in-out`},d)))}static get watchers(){return{notify:["watchNotifyHandler"]}}static get style(){return NlBannerStyle0}},[1,"nl-banner",{theme:[1025],darkMode:[1028,"dark-mode"],hiddenMode:[1028,"hidden-mode"],titleBanner:[1,"title-banner"],isOpen:[1028,"is-open"],isLoading:[4,"is-loading"],notify:[16],userInfo:[16],accounts:[1040],isUserImgError:[32],domain:[32],mode:[32],url:[32],isOpenConfirm:[32]},void 0,{notify:["watchNotifyHandler"]}]);function defineCustomElement(){if("undefined"==typeof customElements)return;["nl-banner","button-base","nl-change-account","nl-dialog","nl-login-status"].forEach((e=>{switch(e){case"nl-banner":customElements.get(e)||customElements.define(e,NlBanner);break;case"button-base":customElements.get(e)||defineCustomElement$s();break;case"nl-change-account":customElements.get(e)||defineCustomElement$2();break;case"nl-dialog":customElements.get(e)||defineCustomElement$1();break;case"nl-login-status":customElements.get(e)||defineCustomElement$h()}}))}defineCustomElement();var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},lib={},types={};Object.defineProperty(types,"__esModule",{value:!0});var ee={},taskCollection$1={},taskCollection={},utils$1={};function _fast_remove_single(e,t){-1!==t&&(0===t?e.shift():t===e.length-1?e.length=e.length-1:e.splice(t,1))}Object.defineProperty(utils$1,"__esModule",{value:!0}),utils$1._fast_remove_single=void 0,utils$1._fast_remove_single=_fast_remove_single;var bakeCollection={};(function(exports$1){Object.defineProperty(exports$1,"__esModule",{value:!0}),exports$1.bakeCollectionVariadic=exports$1.bakeCollectionAwait=exports$1.bakeCollection=exports$1.BAKED_EMPTY_FUNC=void 0,exports$1.BAKED_EMPTY_FUNC=function(){};var FORLOOP_FALLBACK=1500;function generateArgsDefCode(e){var t="";if(0===e)return t;for(var n=0;n<e-1;++n)t+="arg"+String(n)+", ";return t+="arg"+String(e-1)}function generateBodyPartsCode(e,t){for(var n="",o="",r=0;r<t;++r)n+="var f".concat(r," = collection[").concat(r,"];\n"),o+="f".concat(r,"(").concat(e,")\n");return{funcDefCode:n,funcCallCode:o}}function generateBodyPartsVariadicCode(e){for(var t="",n="",o=0;o<e;++o)t+="var f".concat(o," = collection[").concat(o,"];\n"),n+="f".concat(o,".apply(undefined, arguments)\n");return{funcDefCode:t,funcCallCode:n}}function bakeCollection(collection,fixedArgsNum){if(0===collection.length)return exports$1.BAKED_EMPTY_FUNC;if(1===collection.length)return collection[0];var funcFactoryCode;if(collection.length<FORLOOP_FALLBACK){var argsDefCode=generateArgsDefCode(fixedArgsNum),_a=generateBodyPartsCode(argsDefCode,collection.length),funcDefCode=_a.funcDefCode,funcCallCode=_a.funcCallCode;funcFactoryCode="(function(collection) {\n ".concat(funcDefCode,"\n collection = undefined;\n return (function(").concat(argsDefCode,") {\n ").concat(funcCallCode,"\n });\n })")}else{var argsDefCode=generateArgsDefCode(fixedArgsNum);funcFactoryCode=collection.length%10==0?"(function(collection) {\n return (function(".concat(argsDefCode,") {\n for (var i = 0; i < collection.length; i += 10) {\n collection[i](").concat(argsDefCode,");\n collection[i+1](").concat(argsDefCode,");\n collection[i+2](").concat(argsDefCode,");\n collection[i+3](").concat(argsDefCode,");\n collection[i+4](").concat(argsDefCode,");\n collection[i+5](").concat(argsDefCode,");\n collection[i+6](").concat(argsDefCode,");\n collection[i+7](").concat(argsDefCode,");\n collection[i+8](").concat(argsDefCode,");\n collection[i+9](").concat(argsDefCode,");\n }\n });\n })"):collection.length%4==0?"(function(collection) {\n return (function(".concat(argsDefCode,") {\n for (var i = 0; i < collection.length; i += 4) {\n collection[i](").concat(argsDefCode,");\n collection[i+1](").concat(argsDefCode,");\n collection[i+2](").concat(argsDefCode,");\n collection[i+3](").concat(argsDefCode,");\n }\n });\n })"):collection.length%3==0?"(function(collection) {\n return (function(".concat(argsDefCode,") {\n for (var i = 0; i < collection.length; i += 3) {\n collection[i](").concat(argsDefCode,");\n collection[i+1](").concat(argsDefCode,");\n collection[i+2](").concat(argsDefCode,");\n }\n });\n })"):"(function(collection) {\n return (function(".concat(argsDefCode,") {\n for (var i = 0; i < collection.length; ++i) {\n collection[i](").concat(argsDefCode,");\n }\n });\n })")}var funcFactory=eval(funcFactoryCode);return funcFactory(collection)}function bakeCollectionAwait(collection,fixedArgsNum){if(0===collection.length)return exports$1.BAKED_EMPTY_FUNC;if(1===collection.length)return collection[0];var funcFactoryCode;if(collection.length<FORLOOP_FALLBACK){var argsDefCode=generateArgsDefCode(fixedArgsNum),_a=generateBodyPartsCode(argsDefCode,collection.length),funcDefCode=_a.funcDefCode,funcCallCode=_a.funcCallCode;funcFactoryCode="(function(collection) {\n ".concat(funcDefCode,"\n collection = undefined;\n return (function(").concat(argsDefCode,") {\n return Promise.all([ ").concat(funcCallCode," ]);\n });\n })")}else{var argsDefCode=generateArgsDefCode(fixedArgsNum);funcFactoryCode="(function(collection) {\n return (function(".concat(argsDefCode,") {\n var promises = Array(collection.length);\n for (var i = 0; i < collection.length; ++i) {\n promises[i] = collection[i](").concat(argsDefCode,");\n }\n return Promise.all(promises);\n });\n })")}var funcFactory=eval(funcFactoryCode);return funcFactory(collection)}function bakeCollectionVariadic(collection){if(0===collection.length)return exports$1.BAKED_EMPTY_FUNC;if(1===collection.length)return collection[0];var funcFactoryCode;if(collection.length<FORLOOP_FALLBACK){var _a=generateBodyPartsVariadicCode(collection.length),funcDefCode=_a.funcDefCode,funcCallCode=_a.funcCallCode;funcFactoryCode="(function(collection) {\n ".concat(funcDefCode,"\n collection = undefined;\n return (function() {\n ").concat(funcCallCode,"\n });\n })")}else funcFactoryCode="(function(collection) {\n return (function() {\n for (var i = 0; i < collection.length; ++i) {\n collection[i].apply(undefined, arguments);\n }\n });\n })";var funcFactory=eval(funcFactoryCode);return funcFactory(collection)}exports$1.bakeCollection=bakeCollection,exports$1.bakeCollectionAwait=bakeCollectionAwait,exports$1.bakeCollectionVariadic=bakeCollectionVariadic})(bakeCollection);var __spreadArray$1=commonjsGlobal&&commonjsGlobal.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var o,r=0,s=t.length;r<s;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(taskCollection,"__esModule",{value:!0}),taskCollection.TaskCollection=void 0;var utils_1$1=utils$1,bake_collection_1=bakeCollection;function push_norebuild(e,t){var n,o=this.length;if(o>1)t?((n=this._tasks).push.apply(n,arguments),this.length+=arguments.length):(this._tasks.push(e),this.length++);else if(t){var r;if(1===o)(r=Array(1+arguments.length)).push(r),r.push.apply(r,arguments),this._tasks=r;else(r=Array(arguments.length)).push.apply(r,arguments),this._tasks=r;this.length+=arguments.length}else this._tasks=1===o?[this._tasks,e]:e,this.length++}function push_rebuild(e,t){var n,o=this.length;if(o>1)t?((n=this._tasks).push.apply(n,arguments),this.length+=arguments.length):(this._tasks.push(e),this.length++);else if(t){var r;if(1===o)(r=Array(1+arguments.length)).push(r),r.push.apply(r,arguments),this._tasks=r;else(r=Array(arguments.length)).push.apply(r,arguments),this._tasks=r;this.length+=arguments.length}else this._tasks=1===o?[this._tasks,e]:e,this.length++;this.firstEmitBuildStrategy?this.call=rebuild_on_first_call:this.rebuild()}function removeLast_norebuild(e){0!==this.length&&(1===this.length?this._tasks===e&&(this.length=0):((0,utils_1$1._fast_remove_single)(this._tasks,this._tasks.lastIndexOf(e)),1===this._tasks.length?(this._tasks=this._tasks[0],this.length=1):this.length=this._tasks.length))}function removeLast_rebuild(e){if(0!==this.length){if(1===this.length)return this._tasks===e&&(this.length=0),this.firstEmitBuildStrategy?void(this.call=bake_collection_1.BAKED_EMPTY_FUNC):void this.rebuild();(0,utils_1$1._fast_remove_single)(this._tasks,this._tasks.lastIndexOf(e)),1===this._tasks.length?(this._tasks=this._tasks[0],this.length=1):this.length=this._tasks.length,this.firstEmitBuildStrategy?this.call=rebuild_on_first_call:this.rebuild()}}function insert_norebuild(e){for(var t,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];0===this.length?(this._tasks=n,this.length=1):1===this.length?(n.unshift(this._tasks),this._tasks=n,this.length=this._tasks.length):((t=this._tasks).splice.apply(t,__spreadArray$1([e,0],n,!1)),this.length=this._tasks.length)}function insert_rebuild(e){for(var t,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];0===this.length?(this._tasks=n,this.length=1):1===this.length?(n.unshift(this._tasks),this._tasks=n,this.length=this._tasks.length):((t=this._tasks).splice.apply(t,__spreadArray$1([e,0],n,!1)),this.length=this._tasks.length),this.firstEmitBuildStrategy?this.call=rebuild_on_first_call:this.rebuild()}function rebuild_noawait(){0===this.length?this.call=bake_collection_1.BAKED_EMPTY_FUNC:1===this.length?this.call=this._tasks:this.call=(0,bake_collection_1.bakeCollection)(this._tasks,this.argsNum)}function rebuild_await(){0===this.length?this.call=bake_collection_1.BAKED_EMPTY_FUNC:1===this.length?this.call=this._tasks:this.call=(0,bake_collection_1.bakeCollectionAwait)(this._tasks,this.argsNum)}function rebuild_on_first_call(){this.rebuild(),this.call.apply(void 0,arguments)}var TaskCollection=function(e,t,n,o){void 0===t&&(t=!0),void 0===n&&(n=null),void 0===o&&(o=!1),this.awaitTasks=o,this.call=bake_collection_1.BAKED_EMPTY_FUNC,this.argsNum=e,this.firstEmitBuildStrategy=!0,this.rebuild=o?rebuild_await.bind(this):rebuild_noawait.bind(this),this.setAutoRebuild(t),n?"function"==typeof n?(this._tasks=n,this.length=1):(this._tasks=n,this.length=n.length):(this._tasks=null,this.length=0),t&&this.rebuild()};function fastClear(){this._tasks=null,this.length=0,this.call=bake_collection_1.BAKED_EMPTY_FUNC}function clear(){this._tasks=null,this.length=0,this.call=bake_collection_1.BAKED_EMPTY_FUNC}function growArgsNum(e){this.argsNum<e&&(this.argsNum=e,this.firstEmitBuildStrategy?this.call=rebuild_on_first_call:this.rebuild())}function setAutoRebuild(e){e?(this.push=push_rebuild.bind(this),this.insert=insert_rebuild.bind(this),this.removeLast=removeLast_rebuild.bind(this)):(this.push=push_norebuild.bind(this),this.insert=insert_norebuild.bind(this),this.removeLast=removeLast_norebuild.bind(this))}function tasksAsArray(){return 0===this.length?[]:1===this.length?[this._tasks]:this._tasks}function setTasks(e){0===e.length?(this.length=0,this.call=bake_collection_1.BAKED_EMPTY_FUNC):1===e.length?(this.length=1,this.call=e[0],this._tasks=e[0]):(this.length=e.length,this._tasks=e,this.firstEmitBuildStrategy?this.call=rebuild_on_first_call:this.rebuild())}taskCollection.TaskCollection=TaskCollection,TaskCollection.prototype.fastClear=fastClear,TaskCollection.prototype.clear=clear,TaskCollection.prototype.growArgsNum=growArgsNum,TaskCollection.prototype.setAutoRebuild=setAutoRebuild,TaskCollection.prototype.tasksAsArray=tasksAsArray,TaskCollection.prototype.setTasks=setTasks,function(e){var t=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),n=commonjsGlobal&&commonjsGlobal.__exportStar||function(e,n){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(n,o)||t(n,e,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(taskCollection,e)}(taskCollection$1);var utils={};function nullObj(){var e={__proto__:null};return e}Object.defineProperty(utils,"__esModule",{value:!0}),utils.nullObj=void 0,utils.nullObj=nullObj;var __spreadArray=commonjsGlobal&&commonjsGlobal.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var o,r=0,s=t.length;r<s;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(ee,"__esModule",{value:!0}),ee.EventEmitter=void 0;var task_collection_1=taskCollection$1,utils_1=utils$1,utils_2=utils;function emit(e,t,n,o,r,s){var i=this.events[e];if(i){if(0===i.length)return!1;if(i.argsNum<6)i.call(t,n,o,r,s);else{for(var a=new Array(i.argsNum),c=0,l=a.length;c<l;++c)a[c]=arguments[c+1];i.call.apply(void 0,a)}return!0}return!1}function emitHasOnce(e,t,n,o,r,s){var i,a=this.events[e];if(void 0!==a){if(0===a.length)return!1;if(a.argsNum<6)a.call(t,n,o,r,s);else{for(var c=0,l=(i=new Array(a.argsNum)).length;c<l;++c)i[c]=arguments[c+1];a.call.apply(void 0,i)}}var d=this.onceEvents[e];if(d){if("function"==typeof d)if(this.onceEvents[e]=void 0,arguments.length<6)d(t,n,o,r,s);else{if(void 0===i)for(c=0,l=(i=new Array(arguments.length-1)).length;c<l;++c)i[c]=arguments[c+1];d.apply(void 0,i)}else{var h=d;if(this.onceEvents[e]=void 0,arguments.length<6)for(c=0;c<h.length;++c)h[c](t,n,o,r,s);else{if(void 0===i)for(c=0,l=(i=new Array(arguments.length-1)).length;c<l;++c)i[c]=arguments[c+1];for(c=0;c<h.length;++c)h[c].apply(void 0,i)}}return!0}return void 0!==a}var EventEmitter=function(){function e(){this.events=(0,utils_2.nullObj)(),this.onceEvents=(0,utils_2.nullObj)(),this._symbolKeys=new Set,this.maxListeners=1/0}return Object.defineProperty(e.prototype,"_eventsCount",{get:function(){return this.eventNames().length},enumerable:!1,configurable:!0}),e}();function once(e,t){switch(this.emit===emit&&(this.emit=emitHasOnce),typeof this.onceEvents[e]){case"undefined":this.onceEvents[e]=t,"symbol"==typeof e&&this._symbolKeys.add(e);break;case"function":this.onceEvents[e]=[this.onceEvents[e],t];break;case"object":this.onceEvents[e].push(t)}return this}function addListener(e,t,n){if(void 0===n&&(n=t.length),"function"!=typeof t)throw new TypeError("The listener must be a function");var o=this.events[e];return o?(o.push(t),o.growArgsNum(n),this.maxListeners!==1/0&&this.maxListeners<=o.length&&console.warn('Maximum event listeners for "'.concat(String(e),'" event!'))):(this.events[e]=new task_collection_1.TaskCollection(n,!0,t,!1),"symbol"==typeof e&&this._symbolKeys.add(e)),this}function removeListener(e,t){var n=this.events[e];n&&n.removeLast(t);var o=this.onceEvents[e];return o&&("function"==typeof o?this.onceEvents[e]=void 0:"object"==typeof o&&(1===o.length&&o[0]===t?this.onceEvents[e]=void 0:(0,utils_1._fast_remove_single)(o,o.lastIndexOf(t)))),this}function addListenerBound(e,t,n,o){void 0===n&&(n=this),void 0===o&&(o=t.length),this.boundFuncs||(this.boundFuncs=new Map);var r=t.bind(n);return this.boundFuncs.set(t,r),this.addListener(e,r,o)}function removeListenerBound(e,t){var n,o,r=null===(n=this.boundFuncs)||void 0===n?void 0:n.get(t);return null===(o=this.boundFuncs)||void 0===o||o.delete(t),this.removeListener(e,r)}function hasListeners(e){return this.events[e]&&!!this.events[e].length}function prependListener(e,t,n){if(void 0===n&&(n=t.length),"function"!=typeof t)throw new TypeError("The listener must be a function");var o=this.events[e];return o&&o instanceof task_collection_1.TaskCollection?(o.insert(0,t),o.growArgsNum(n),this.maxListeners!==1/0&&this.maxListeners<=o.length&&console.warn('Maximum event listeners for "'.concat(String(e),'" event!'))):(o=this.events[e]=new task_collection_1.TaskCollection(n,!0,t,!1),"symbol"==typeof e&&this._symbolKeys.add(e)),this}function prependOnceListener(e,t){this.emit===emit&&(this.emit=emitHasOnce);var n=this.onceEvents[e];return n?"object"!=typeof n?(this.onceEvents[e]=[t,n],"symbol"==typeof e&&this._symbolKeys.add(e)):(n.unshift(t),this.maxListeners!==1/0&&this.maxListeners<=n.length&&console.warn('Maximum event listeners for "'.concat(String(e),'" once event!'))):(this.onceEvents[e]=[t],"symbol"==typeof e&&this._symbolKeys.add(e)),this}function removeAllListeners(e){return void 0===e?(this.events=(0,utils_2.nullObj)(),this.onceEvents=(0,utils_2.nullObj)(),this._symbolKeys=new Set):(this.events[e]=void 0,this.onceEvents[e]=void 0,"symbol"==typeof e&&this._symbolKeys.delete(e)),this}function setMaxListeners(e){return this.maxListeners=e,this}function getMaxListeners(){return this.maxListeners}function listeners(e){return this.emit===emit?this.events[e]?this.events[e].tasksAsArray().slice():[]:this.events[e]&&this.onceEvents[e]?__spreadArray(__spreadArray([],this.events[e].tasksAsArray(),!0),"function"==typeof this.onceEvents[e]?[this.onceEvents[e]]:this.onceEvents[e],!0):this.events[e]?this.events[e].tasksAsArray():this.onceEvents[e]?"function"==typeof this.onceEvents[e]?[this.onceEvents[e]]:this.onceEvents[e]:[]}function eventNames(){var e=this;if(this.emit===emit){var t=Object.keys(this.events);return __spreadArray(__spreadArray([],t,!0),Array.from(this._symbolKeys),!0).filter((function(t){return t in e.events&&e.events[t]&&e.events[t].length}))}t=Object.keys(this.events).filter((function(t){return e.events[t]&&e.events[t].length}));var n=Object.keys(this.onceEvents).filter((function(t){return e.onceEvents[t]&&e.onceEvents[t].length}));return __spreadArray(__spreadArray(__spreadArray([],t,!0),n,!0),Array.from(this._symbolKeys).filter((function(t){return t in e.events&&e.events[t]&&e.events[t].length||t in e.onceEvents&&e.onceEvents[t]&&e.onceEvents[t].length})),!0)}function listenerCount(e){return this.emit===emit?this.events[e]&&this.events[e].length||0:(this.events[e]&&this.events[e].length||0)+(this.onceEvents[e]&&this.onceEvents[e].length||0)}
|
|
1
|
+
var BUILD={allRenderFn:!1,cmpDidLoad:!0,cmpDidUnload:!1,cmpDidUpdate:!0,cmpDidRender:!0,cmpWillLoad:!0,cmpWillUpdate:!0,cmpWillRender:!0,connectedCallback:!0,disconnectedCallback:!0,element:!0,event:!0,hasRenderFn:!0,lifecycle:!0,hostListener:!0,hostListenerTargetWindow:!0,hostListenerTargetDocument:!0,hostListenerTargetBody:!0,hostListenerTargetParent:!1,hostListenerTarget:!0,member:!0,method:!0,mode:!0,observeAttribute:!0,prop:!0,propMutable:!0,reflect:!0,scoped:!0,shadowDom:!0,slot:!0,cssAnnotations:!0,state:!0,style:!0,formAssociated:!1,svg:!0,updatable:!0,vdomAttribute:!0,vdomXlink:!0,vdomClass:!0,vdomFunctional:!0,vdomKey:!0,vdomListener:!0,vdomRef:!0,vdomPropOrAttr:!0,vdomRender:!0,vdomStyle:!0,vdomText:!0,watchCallback:!0,taskQueue:!0,hotModuleReplacement:!1,isDebug:!1,isDev:!1,isTesting:!1,hydrateServerSide:!1,hydrateClientSide:!1,lifecycleDOMEvents:!1,lazyLoad:!1,profile:!1,slotRelocation:!0,appendChildSlotFix:!1,cloneNodeFix:!1,hydratedAttribute:!1,hydratedClass:!0,scriptDataOpts:!1,scopedSlotTextContentFix:!1,shadowDomShim:!1,slotChildNodesFix:!1,invisiblePrehydration:!0,propBoolean:!0,propNumber:!0,propString:!0,constructableCSS:!0,cmpShouldUpdate:!0,devTools:!1,shadowDelegatesFocus:!0,initializeNextTick:!1,asyncLoading:!1,asyncQueue:!1,transformTagName:!1,attachStyles:!0,experimentalSlotFixes:!1},__defProp$1=Object.defineProperty,__export$1=(e,t)=>{for(var n in t)__defProp$1(e,n,{get:t[n],enumerable:!0})},hostRefs=new WeakMap,getHostRef=e=>hostRefs.get(e),registerHost=(e,t)=>{const n={$flags$:0,$hostElement$:e,$cmpMeta$:t,$instanceValues$:new Map};return hostRefs.set(e,n)},isMemberInElement=(e,t)=>t in e,consoleError=(e,t)=>(0,console.error)(e,t),styles=new Map,modeResolutionChain=[],SLOT_FB_CSS="slot-fb{display:contents}slot-fb[hidden]{display:none}",XLINK_NS="http://www.w3.org/1999/xlink",win="undefined"!=typeof window?window:{},doc=win.document||{head:{}},H=win.HTMLElement||class{},plt={$flags$:0,$resourcesUrl$:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,o)=>e.addEventListener(t,n,o),rel:(e,t,n,o)=>e.removeEventListener(t,n,o),ce:(e,t)=>new CustomEvent(e,t)},supportsListenerOptions=(()=>{let e=!1;try{doc.addEventListener("e",null,Object.defineProperty({},"passive",{get(){e=!0}}))}catch(e){}return e})(),promiseResolve=e=>Promise.resolve(e),supportsConstructableStylesheets=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),queuePending=!1,queueDomReads=[],queueDomWrites=[],queueTask=(e,t)=>n=>{e.push(n),queuePending||(queuePending=!0,t&&4&plt.$flags$?nextTick(flush):plt.raf(flush))},consume=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){consoleError(e)}e.length=0},flush=()=>{consume(queueDomReads),consume(queueDomWrites),(queuePending=queueDomReads.length>0)&&plt.raf(flush)},nextTick=e=>promiseResolve().then(e),writeTask=queueTask(queueDomWrites,!0),EMPTY_OBJ={},SVG_NS="http://www.w3.org/2000/svg",HTML_NS="http://www.w3.org/1999/xhtml",isDef=e=>null!=e,isComplexType=e=>"object"===(e=typeof e)||"function"===e;function queryNonceMetaTagContent(e){var t,n,o;return null!=(o=null==(n=null==(t=e.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?o:void 0}var result_exports={};__export$1(result_exports,{err:()=>err,map:()=>map,ok:()=>ok,unwrap:()=>unwrap$1,unwrapErr:()=>unwrapErr});var ok=e=>({isOk:!0,isErr:!1,value:e}),err=e=>({isOk:!1,isErr:!0,value:e});function map(e,t){if(e.isOk){const n=t(e.value);return n instanceof Promise?n.then((e=>ok(e))):ok(n)}if(e.isErr){const t=e.value;return err(t)}throw"should never get here"}var unwrap$1=e=>{if(e.isOk)return e.value;throw e.value},unwrapErr=e=>{if(e.isErr)return e.value;throw e.value},createTime=(e,t="")=>()=>{},h=(e,t,...n)=>{let o=null,r=null,s=null,i=!1,a=!1;const c=[],l=t=>{for(let n=0;n<t.length;n++)o=t[n],Array.isArray(o)?l(o):null!=o&&"boolean"!=typeof o&&((i="function"!=typeof e&&!isComplexType(o))&&(o=String(o)),i&&a?c[c.length-1].$text$+=o:c.push(i?newVNode(null,o):o),a=i)};if(l(n),t){t.key&&(r=t.key),t.name&&(s=t.name);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}if("function"==typeof e)return e(null===t?{}:t,c,vdomFnUtils);const d=newVNode(e,null);return d.$attrs$=t,c.length>0&&(d.$children$=c),d.$key$=r,d.$name$=s,d},newVNode=(e,t)=>{const n={$flags$:0,$tag$:e,$text$:t,$elm$:null,$children$:null,$attrs$:null,$key$:null,$name$:null};return n},Host={},isHost=e=>e&&e.$tag$===Host,vdomFnUtils={forEach:(e,t)=>e.map(convertToPublic).forEach(t),map:(e,t)=>e.map(convertToPublic).map(t).map(convertToPrivate)},convertToPublic=e=>({vattrs:e.$attrs$,vchildren:e.$children$,vkey:e.$key$,vname:e.$name$,vtag:e.$tag$,vtext:e.$text$}),convertToPrivate=e=>{if("function"==typeof e.vtag){const t={...e.vattrs};return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),h(e.vtag,t,...e.vchildren||[])}const t=newVNode(e.vtag,e.vtext);return t.$attrs$=e.vattrs,t.$children$=e.vchildren,t.$key$=e.vkey,t.$name$=e.vname,t},computeMode=e=>modeResolutionChain.map((t=>t(e))).find((e=>!!e)),parsePropertyValue=(e,t)=>null==e||isComplexType(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?String(e):e,getElement=e=>e,createEvent$1=(e,t,n)=>{const o=getElement(e);return{emit:e=>emitEvent(o,t,{bubbles:!0,composed:!0,cancelable:!0,detail:e})}},emitEvent=(e,t,n)=>{const o=plt.ce(t,n);return e.dispatchEvent(o),o},rootAppliedStyles=new WeakMap,registerStyle=(e,t,n)=>{let o=styles.get(e);supportsConstructableStylesheets&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=t:o.replaceSync(t)):o=t,styles.set(e,o)},addStyle=(e,t,n)=>{var o;const r=getScopeId(t,n),s=styles.get(r);if(e=11===e.nodeType?e:doc,s)if("string"==typeof s){e=e.head||e;let n,i=rootAppliedStyles.get(e);if(i||rootAppliedStyles.set(e,i=new Set),!i.has(r)){{n=doc.createElement("style"),n.innerHTML=s;const r=null!=(o=plt.$nonce$)?o:queryNonceMetaTagContent(doc);null!=r&&n.setAttribute("nonce",r);(!(1&t.$flags$)||1&t.$flags$&&"HEAD"!==e.nodeName)&&e.insertBefore(n,e.querySelector("link"))}4&t.$flags$&&(n.innerHTML+=SLOT_FB_CSS),i&&i.add(r)}}else e.adoptedStyleSheets.includes(s)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,s]);return r},attachStyles=e=>{const t=e.$cmpMeta$,n=e.$hostElement$,o=t.$flags$,r=createTime("attachStyles",t.$tagName$),s=addStyle(n.shadowRoot?n.shadowRoot:n.getRootNode(),t,e.$modeName$);10&o&&2&o&&(n["s-sc"]=s,n.classList.add(s+"-h"),2&o&&n.classList.add(s+"-s")),r()},getScopeId=(e,t)=>"sc-"+(t&&32&e.$flags$?e.$tagName$+"-"+t:e.$tagName$),setAccessor=(e,t,n,o,r,s)=>{if(n!==o){let i=isMemberInElement(e,t),a=t.toLowerCase();if("class"===t){const t=e.classList,r=parseClassList(n),s=parseClassList(o);t.remove(...r.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!r.includes(e))))}else if("style"===t){for(const t in n)o&&null!=o[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in o)n&&o[t]===n[t]||(t.includes("-")?e.style.setProperty(t,o[t]):e.style[t]=o[t])}else if("key"===t);else if("ref"===t)o&&o(e);else if(e.__lookupSetter__(t)||"o"!==t[0]||"n"!==t[1]){const c=isComplexType(o);if((i||c&&null!==o)&&!r)try{if(e.tagName.includes("-"))e[t]=o;else{const r=null==o?"":o;"list"===t?i=!1:null!=n&&e[t]==r||(e[t]=r)}}catch(e){}let l=!1;a!==(a=a.replace(/^xlink\:?/,""))&&(t=a,l=!0),null==o||!1===o?!1===o&&""!==e.getAttribute(t)||(l?e.removeAttributeNS(XLINK_NS,t):e.removeAttribute(t)):(!i||4&s||r)&&!c&&(o=!0===o?"":o,l?e.setAttributeNS(XLINK_NS,t,o):e.setAttribute(t,o))}else if(t="-"===t[2]?t.slice(3):isMemberInElement(win,a)?a.slice(2):a[2]+t.slice(3),n||o){const r=t.endsWith(CAPTURE_EVENT_SUFFIX);t=t.replace(CAPTURE_EVENT_REGEX,""),n&&plt.rel(e,t,n,r),o&&plt.ael(e,t,o,r)}}},parseClassListRegex=/\s/,parseClassList=e=>e?e.split(parseClassListRegex):[],CAPTURE_EVENT_SUFFIX="Capture",CAPTURE_EVENT_REGEX=new RegExp(CAPTURE_EVENT_SUFFIX+"$"),updateElement=(e,t,n)=>{const o=11===t.$elm$.nodeType&&t.$elm$.host?t.$elm$.host:t.$elm$,r=e&&e.$attrs$||EMPTY_OBJ,s=t.$attrs$||EMPTY_OBJ;for(const e of sortedAttrNames(Object.keys(r)))e in s||setAccessor(o,e,r[e],void 0,n,t.$flags$);for(const e of sortedAttrNames(Object.keys(s)))setAccessor(o,e,r[e],s[e],n,t.$flags$)},scopeId,contentRef,hostTagName;function sortedAttrNames(e){return e.includes("ref")?[...e.filter((e=>"ref"!==e)),"ref"]:e}var useNativeShadowDom=!1,checkSlotFallbackVisibility=!1,checkSlotRelocate=!1,isSvgMode=!1,createElm=(e,t,n,o)=>{var r;const s=t.$children$[n];let i,a,c,l=0;if(useNativeShadowDom||(checkSlotRelocate=!0,"slot"===s.$tag$&&(scopeId&&o.classList.add(scopeId+"-s"),s.$flags$|=s.$children$?2:1)),null!==s.$text$)i=s.$elm$=doc.createTextNode(s.$text$);else if(1&s.$flags$)i=s.$elm$=doc.createTextNode("");else{isSvgMode||(isSvgMode="svg"===s.$tag$),i=s.$elm$=doc.createElementNS(isSvgMode?SVG_NS:HTML_NS,!useNativeShadowDom&&BUILD.slotRelocation&&2&s.$flags$?"slot-fb":s.$tag$),isSvgMode&&"foreignObject"===s.$tag$&&(isSvgMode=!1),updateElement(null,s,isSvgMode);if(!!i.getRootNode().querySelector("body")&&BUILD.scoped&&isDef(scopeId)&&i["s-si"]!==scopeId&&i.classList.add(i["s-si"]=scopeId),updateElementScopeIds(i,o),s.$children$)for(l=0;l<s.$children$.length;++l)a=createElm(e,s,l,i),a&&i.appendChild(a);"svg"===s.$tag$?isSvgMode=!1:"foreignObject"===i.tagName&&(isSvgMode=!0)}return i["s-hn"]=hostTagName,3&s.$flags$&&(i["s-sr"]=!0,i["s-cr"]=contentRef,i["s-sn"]=s.$name$||"",i["s-rf"]=null==(r=s.$attrs$)?void 0:r.ref,c=e&&e.$children$&&e.$children$[n],c&&c.$tag$===s.$tag$&&e.$elm$&&putBackInOriginalLocation(e.$elm$,!1)),i},putBackInOriginalLocation=(e,t)=>{plt.$flags$|=1;const n=Array.from(e.childNodes);e["s-sr"]&&BUILD.experimentalSlotFixes;for(let e=n.length-1;e>=0;e--){const o=n[e];o["s-hn"]!==hostTagName&&o["s-ol"]&&(insertBefore(parentReferenceNode(o),o,referenceNode(o)),o["s-ol"].remove(),o["s-ol"]=void 0,o["s-sh"]=void 0,checkSlotRelocate=!0),t&&putBackInOriginalLocation(o,t)}plt.$flags$&=-2},addVnodes=(e,t,n,o,r,s)=>{let i,a=e["s-cr"]&&e["s-cr"].parentNode||e;for(a.shadowRoot&&a.tagName===hostTagName&&(a=a.shadowRoot);r<=s;++r)o[r]&&(i=createElm(null,n,r,e),i&&(o[r].$elm$=i,insertBefore(a,i,referenceNode(t))))},removeVnodes=(e,t,n)=>{for(let o=t;o<=n;++o){const t=e[o];if(t){const e=t.$elm$;nullifyVNodeRefs(t),e&&(checkSlotFallbackVisibility=!0,e["s-ol"]?e["s-ol"].remove():putBackInOriginalLocation(e,!0),e.remove())}}},updateChildren=(e,t,n,o,r=!1)=>{let s,i,a=0,c=0,l=0,d=0,h=t.length-1,u=t[0],f=t[h],p=o.length-1,g=o[0],m=o[p];for(;a<=h&&c<=p;)if(null==u)u=t[++a];else if(null==f)f=t[--h];else if(null==g)g=o[++c];else if(null==m)m=o[--p];else if(isSameVnode(u,g,r))patch(u,g,r),u=t[++a],g=o[++c];else if(isSameVnode(f,m,r))patch(f,m,r),f=t[--h],m=o[--p];else if(isSameVnode(u,m,r))"slot"!==u.$tag$&&"slot"!==m.$tag$||putBackInOriginalLocation(u.$elm$.parentNode,!1),patch(u,m,r),insertBefore(e,u.$elm$,f.$elm$.nextSibling),u=t[++a],m=o[--p];else if(isSameVnode(f,g,r))"slot"!==u.$tag$&&"slot"!==m.$tag$||putBackInOriginalLocation(f.$elm$.parentNode,!1),patch(f,g,r),insertBefore(e,f.$elm$,u.$elm$),f=t[--h],g=o[++c];else{for(l=-1,d=a;d<=h;++d)if(t[d]&&null!==t[d].$key$&&t[d].$key$===g.$key$){l=d;break}l>=0?(i=t[l],i.$tag$!==g.$tag$?s=createElm(t&&t[c],n,l,e):(patch(i,g,r),t[l]=void 0,s=i.$elm$),g=o[++c]):(s=createElm(t&&t[c],n,c,e),g=o[++c]),s&&insertBefore(parentReferenceNode(u.$elm$),s,referenceNode(u.$elm$))}a>h?addVnodes(e,null==o[p+1]?null:o[p+1].$elm$,n,o,c,p):c>p&&removeVnodes(t,a,h)},isSameVnode=(e,t,n=!1)=>e.$tag$===t.$tag$&&("slot"===e.$tag$?(!("$nodeId$"in e)||!n||8===e.$elm$.nodeType)&&e.$name$===t.$name$:!!n||e.$key$===t.$key$),referenceNode=e=>e&&e["s-ol"]||e,parentReferenceNode=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,patch=(e,t,n=!1)=>{const o=t.$elm$=e.$elm$,r=e.$children$,s=t.$children$,i=t.$tag$,a=t.$text$;let c;null===a?(isSvgMode="svg"===i||"foreignObject"!==i&&isSvgMode,("slot"!==i||useNativeShadowDom)&&updateElement(e,t,isSvgMode),null!==r&&null!==s?updateChildren(o,r,t,s,n):null!==s?(null!==e.$text$&&(o.textContent=""),addVnodes(o,null,t,s,0,s.length-1)):!n&&BUILD.updatable&&null!==r&&removeVnodes(r,0,r.length-1),isSvgMode&&"svg"===i&&(isSvgMode=!1)):(c=o["s-cr"])?c.parentNode.textContent=a:e.$text$!==a&&(o.data=a)},updateFallbackSlotVisibility=e=>{const t=e.childNodes;for(const e of t)if(1===e.nodeType){if(e["s-sr"]){const n=e["s-sn"];e.hidden=!1;for(const o of t)if(o!==e)if(o["s-hn"]!==e["s-hn"]||""!==n){if(1===o.nodeType&&(n===o.getAttribute("slot")||n===o["s-sn"])||3===o.nodeType&&n===o["s-sn"]){e.hidden=!0;break}}else if(1===o.nodeType||3===o.nodeType&&""!==o.textContent.trim()){e.hidden=!0;break}}updateFallbackSlotVisibility(e)}},relocateNodes=[],markSlotContentForRelocation=e=>{let t,n,o;for(const r of e.childNodes){if(r["s-sr"]&&(t=r["s-cr"])&&t.parentNode){n=t.parentNode.childNodes;const e=r["s-sn"];for(o=n.length-1;o>=0;o--)if(t=n[o],!t["s-cn"]&&!t["s-nr"]&&t["s-hn"]!==r["s-hn"])if(isNodeLocatedInSlot(t,e)){let n=relocateNodes.find((e=>e.$nodeToRelocate$===t));checkSlotFallbackVisibility=!0,t["s-sn"]=t["s-sn"]||e,n?(n.$nodeToRelocate$["s-sh"]=r["s-hn"],n.$slotRefNode$=r):(t["s-sh"]=r["s-hn"],relocateNodes.push({$slotRefNode$:r,$nodeToRelocate$:t})),t["s-sr"]&&relocateNodes.map((e=>{isNodeLocatedInSlot(e.$nodeToRelocate$,t["s-sn"])&&(n=relocateNodes.find((e=>e.$nodeToRelocate$===t)),n&&!e.$slotRefNode$&&(e.$slotRefNode$=n.$slotRefNode$))}))}else relocateNodes.some((e=>e.$nodeToRelocate$===t))||relocateNodes.push({$nodeToRelocate$:t})}1===r.nodeType&&markSlotContentForRelocation(r)}},isNodeLocatedInSlot=(e,t)=>1===e.nodeType?null===e.getAttribute("slot")&&""===t||e.getAttribute("slot")===t:e["s-sn"]===t||""===t,nullifyVNodeRefs=e=>{e.$attrs$&&e.$attrs$.ref&&e.$attrs$.ref(null),e.$children$&&e.$children$.map(nullifyVNodeRefs)},insertBefore=(e,t,n)=>{const o=null==e?void 0:e.insertBefore(t,n);return updateElementScopeIds(t,e),o},findScopeIds=e=>{const t=[];return e&&t.push(...e["s-scs"]||[],e["s-si"],e["s-sc"],...findScopeIds(e.parentElement)),t},updateElementScopeIds=(e,t,n=!1)=>{var o;if(e&&t&&1===e.nodeType){const r=new Set(findScopeIds(t).filter(Boolean));if(r.size&&(null==(o=e.classList)||o.add(...e["s-scs"]=[...r]),e["s-ol"]||n))for(const t of Array.from(e.childNodes))updateElementScopeIds(t,e,!0)}},renderVdom=(e,t,n=!1)=>{var o,r,s,i,a;const c=e.$hostElement$,l=e.$cmpMeta$,d=e.$vnode$||newVNode(null,null),u=isHost(t)?t:h(null,null,t);if(hostTagName=c.tagName,l.$attrsToReflect$&&(u.$attrs$=u.$attrs$||{},l.$attrsToReflect$.map((([e,t])=>u.$attrs$[t]=c[e]))),n&&u.$attrs$)for(const e of Object.keys(u.$attrs$))c.hasAttribute(e)&&!["key","ref","style","class"].includes(e)&&(u.$attrs$[e]=c[e]);if(u.$tag$=null,u.$flags$|=4,e.$vnode$=u,u.$elm$=d.$elm$=c.shadowRoot||c,scopeId=c["s-sc"],useNativeShadowDom=!!(1&l.$flags$),contentRef=c["s-cr"],checkSlotFallbackVisibility=!1,patch(d,u,n),plt.$flags$|=1,checkSlotRelocate){markSlotContentForRelocation(u.$elm$);for(const e of relocateNodes){const t=e.$nodeToRelocate$;if(!t["s-ol"]){const e=doc.createTextNode("");e["s-nr"]=t,insertBefore(t.parentNode,t["s-ol"]=e,t)}}for(const e of relocateNodes){const t=e.$nodeToRelocate$,a=e.$slotRefNode$;if(a){const e=a.parentNode;let n=a.nextSibling;{let s=null==(o=t["s-ol"])?void 0:o.previousSibling;for(;s;){let o=null!=(r=s["s-nr"])?r:null;if(o&&o["s-sn"]===t["s-sn"]&&e===o.parentNode){for(o=o.nextSibling;o===t||(null==o?void 0:o["s-sr"]);)o=null==o?void 0:o.nextSibling;if(!o||!o["s-nr"]){n=o;break}}s=s.previousSibling}}(!n&&e!==t.parentNode||t.nextSibling!==n)&&t!==n&&(!t["s-hn"]&&t["s-ol"]&&(t["s-hn"]=t["s-ol"].parentNode.nodeName),insertBefore(e,t,n),1===t.nodeType&&(t.hidden=null!=(s=t["s-ih"])&&s)),t&&"function"==typeof a["s-rf"]&&a["s-rf"](t)}else 1===t.nodeType&&(n&&(t["s-ih"]=null!=(i=t.hidden)&&i),t.hidden=!0)}}if(checkSlotFallbackVisibility&&updateFallbackSlotVisibility(u.$elm$),plt.$flags$&=-2,relocateNodes.length=0,BUILD.experimentalScopedSlotChanges&&2&l.$flags$)for(const e of u.$elm$.childNodes)e["s-hn"]===hostTagName||e["s-sh"]||(n&&null==e["s-ih"]&&(e["s-ih"]=null!=(a=e.hidden)&&a),e.hidden=!0);contentRef=void 0},attachToAncestor=(e,t)=>{},scheduleUpdate=(e,t)=>{e.$flags$|=16,attachToAncestor(e,e.$ancestorComponent$);return writeTask((()=>dispatchHooks(e,t)))},dispatchHooks=(e,t)=>{const n=e.$hostElement$,o=createTime("scheduleUpdate",e.$cmpMeta$.$tagName$),r=n;if(!r)throw new Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let s;return s=safeCall(r,t?"componentWillLoad":"componentWillUpdate"),s=enqueue(s,(()=>safeCall(r,"componentWillRender"))),o(),enqueue(s,(()=>updateComponent(e,r,t)))},enqueue=(e,t)=>isPromisey(e)?e.then(t).catch((e=>{console.error(e),t()})):t(),isPromisey=e=>e instanceof Promise||e&&e.then&&"function"==typeof e.then,updateComponent=async(e,t,n)=>{const o=e.$hostElement$,r=createTime("update",e.$cmpMeta$.$tagName$);o["s-rc"],n&&attachStyles(e);const s=createTime("render",e.$cmpMeta$.$tagName$);callRender(e,t,o,n),s(),r(),postUpdateComponent(e)},renderingRef=null,callRender=(e,t,n,o)=>{try{renderingRef=t,t=t.render&&t.render(),e.$flags$&=-17,e.$flags$|=2,(BUILD.hasRenderFn||BUILD.reflect)&&(BUILD.vdomRender||BUILD.reflect)&&(BUILD.hydrateServerSide||renderVdom(e,t,o))}catch(t){consoleError(t,e.$hostElement$)}return renderingRef=null,null},getRenderingRef=()=>renderingRef,postUpdateComponent=e=>{const t=e.$cmpMeta$.$tagName$,n=e.$hostElement$,o=createTime("postUpdate",t),r=n;e.$ancestorComponent$,safeCall(r,"componentDidRender"),64&e.$flags$?(safeCall(r,"componentDidUpdate"),o()):(e.$flags$|=64,safeCall(r,"componentDidLoad"),o())},forceUpdate=e=>{{const t=getHostRef(e),n=t.$hostElement$.isConnected;return n&&2==(18&t.$flags$)&&scheduleUpdate(t,!1),n}},safeCall=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){consoleError(e)}},getValue=(e,t)=>getHostRef(e).$instanceValues$.get(t),setValue=(e,t,n,o)=>{const r=getHostRef(e),s=e,i=r.$instanceValues$.get(t),a=r.$flags$,c=s;n=parsePropertyValue(n,o.$members$[t][0]);const l=Number.isNaN(i)&&Number.isNaN(n);if(n!==i&&!l){if(r.$instanceValues$.set(t,n),o.$watchers$&&128&a){const e=o.$watchers$[t];e&&e.map((e=>{try{c[e](n,i,t)}catch(e){consoleError(e,s)}}))}if(2==(18&a)){if(c.componentShouldUpdate&&!1===c.componentShouldUpdate(n,i,t))return;scheduleUpdate(r,!1)}}},proxyComponent=(e,t,n)=>{var o,r;const s=e.prototype;if(t.$members$||t.$watchers$||e.watchers){e.watchers&&!t.$watchers$&&(t.$watchers$=e.watchers);const n=Object.entries(null!=(o=t.$members$)?o:{});n.map((([e,[n]])=>{(31&n||32&n)&&Object.defineProperty(s,e,{get(){return getValue(this,e)},set(n){setValue(this,e,n,t)},configurable:!0,enumerable:!0})}));{const o=new Map;s.attributeChangedCallback=function(e,n,r){plt.jmp((()=>{var i;const a=o.get(e);if(this.hasOwnProperty(a))r=this[a],delete this[a];else{if(s.hasOwnProperty(a)&&"number"==typeof this[a]&&this[a]==r)return;if(null==a){const o=getHostRef(this),s=null==o?void 0:o.$flags$;if(s&&!(8&s)&&128&s&&r!==n){const o=this,s=null==(i=t.$watchers$)?void 0:i[e];null==s||s.forEach((t=>{null!=o[t]&&o[t].call(o,r,n,e)}))}return}}this[a]=(null!==r||"boolean"!=typeof this[a])&&r}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(r=t.$watchers$)?r:{}),...n.filter((([e,t])=>15&t[0])).map((([e,n])=>{var r;const s=n[1]||e;return o.set(s,e),512&n[0]&&(null==(r=t.$attrsToReflect$)||r.push([e,s])),s}))]))}}return e},initializeComponent=async(e,t,n,o)=>{let r;if(!(32&t.$flags$)){t.$flags$|=32,n.$lazyBundleId$;{r=e.constructor;const n=e.localName;customElements.whenDefined(n).then((()=>t.$flags$|=128))}if(r&&r.style){let o;"string"==typeof r.style?o=r.style:"string"!=typeof r.style&&(t.$modeName$=computeMode(e),t.$modeName$&&(o=r.style[t.$modeName$]));const s=getScopeId(n,t.$modeName$);if(!styles.has(s)){const e=createTime("registerStyles",n.$tagName$);registerStyle(s,o,!!(1&n.$flags$)),e()}}}t.$ancestorComponent$;scheduleUpdate(t,!0)},fireConnectedCallback=e=>{},connectedCallback=e=>{if(!(1&plt.$flags$)){const t=getHostRef(e),n=t.$cmpMeta$,o=createTime("connectedCallback",n.$tagName$);1&t.$flags$?(addHostEventListeners(e,t,n.$listeners$),(null==t?void 0:t.$lazyInstance$)?fireConnectedCallback(t.$lazyInstance$):(null==t?void 0:t.$onReadyPromise$)&&t.$onReadyPromise$.then((()=>fireConnectedCallback(t.$lazyInstance$)))):(t.$flags$|=1,12&n.$flags$&&setContentReference(e),n.$members$&&Object.entries(n.$members$).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),initializeComponent(e,t,n)),o()}},setContentReference=e=>{const t=e["s-cr"]=doc.createComment("");t["s-cn"]=!0,insertBefore(e,t,e.firstChild)},disconnectedCallback=async e=>{if(!(1&plt.$flags$)){const t=getHostRef(e);t.$rmListeners$&&(t.$rmListeners$.map((e=>e())),t.$rmListeners$=void 0)}},proxyCustomElement=(e,t)=>{const n={$flags$:t[0],$tagName$:t[1]};n.$members$=t[2],n.$listeners$=t[3],n.$watchers$=e.$watchers$,n.$attrsToReflect$=[];const o=e.prototype.connectedCallback,r=e.prototype.disconnectedCallback;return Object.assign(e.prototype,{__registerHost(){registerHost(this,n)},connectedCallback(){const e=getHostRef(this);addHostEventListeners(this,e,n.$listeners$),connectedCallback(this),o&&o.call(this)},disconnectedCallback(){disconnectedCallback(this),r&&r.call(this)},__attachShadow(){if(this.shadowRoot){if("open"!==this.shadowRoot.mode)throw new Error(`Unable to re-use existing shadow root for ${n.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else this.attachShadow({mode:"open",delegatesFocus:!!(16&n.$flags$)})}}),e.is=n.$tagName$,proxyComponent(e,n)},Fragment=(e,t)=>t,addHostEventListeners=(e,t,n,o)=>{n&&n.map((([n,o,r])=>{const s=getHostListenerTarget(e,n),i=hostListenerProxy(t,r),a=hostListenerOpts(n);plt.ael(s,o,i,a),(t.$rmListeners$=t.$rmListeners$||[]).push((()=>plt.rel(s,o,i,a)))}))},hostListenerProxy=(e,t)=>n=>{try{BUILD.lazyLoad||e.$hostElement$[t](n)}catch(e){consoleError(e)}},getHostListenerTarget=(e,t)=>4&t?doc:8&t?win:16&t?doc.body:e,hostListenerOpts=e=>supportsListenerOptions?{passive:!!(1&e),capture:!!(2&e)}:!!(2&e),CURRENT_MODULE,METHOD_MODULE;!function(e){e.WELCOME="welcome",e.WELCOME_LOGIN="welcome-login",e.WELCOME_SIGNUP="welcome-signup",e.INFO="info",e.LOGIN_BUNKER_URL="login-bunker-url",e.LOGIN_READ_ONLY="login-read-only",e.CONFIRM_LOGOUT="confirm-logout",e.IMPORT_FLOW="import",e.IMPORT_OTP="import-otp",e.LOGIN="login",e.SIGNUP="signup",e.LOCAL_SIGNUP="local-signup",e.EXTENSION="extension",e.LOADING="loading",e.PREVIOUSLY_LOGGED="switch-account",e.LOGIN_OTP="otp",e.LOGIN_NSEC="login-nsec",e.CONNECT="connect",e.CONNECTION_STRING="connection-string",e.IFRAME="iframe"}(CURRENT_MODULE||(CURRENT_MODULE={})),function(e){e.LOGIN="login",e.SIGNUP="signup",e.LOGOUT="logout",e.CONFIRM="confirm"}(METHOD_MODULE||(METHOD_MODULE={}));const appendToMap=(e,t,n)=>{const o=e.get(t);o?o.includes(n)||o.push(n):e.set(t,[n])},debounce=(e,t)=>{let n;return(...o)=>{n&&clearTimeout(n),n=setTimeout((()=>{n=0,e(...o)}),t)}},isConnected=e=>!("isConnected"in e)||e.isConnected,cleanupElements=debounce((e=>{for(let t of e.keys())e.set(t,e.get(t).filter(isConnected))}),2e3),stencilSubscription=()=>{if("function"!=typeof getRenderingRef)return{};const e=new Map;return{dispose:()=>e.clear(),get:t=>{const n=getRenderingRef();n&&appendToMap(e,t,n)},set:t=>{const n=e.get(t);n&&e.set(t,n.filter(forceUpdate)),cleanupElements(e)},reset:()=>{e.forEach((e=>e.forEach(forceUpdate))),cleanupElements(e)}}},unwrap=e=>"function"==typeof e?e():e,createObservableMap=(e,t=((e,t)=>e!==t))=>{const n=unwrap(e);let o=new Map(Object.entries(null!=n?n:{}));const r={dispose:[],get:[],set:[],reset:[]},s=()=>{var t;o=new Map(Object.entries(null!==(t=unwrap(e))&&void 0!==t?t:{})),r.reset.forEach((e=>e()))},i=e=>(r.get.forEach((t=>t(e))),o.get(e)),a=(e,n)=>{const s=o.get(e);t(n,s,e)&&(o.set(e,n),r.set.forEach((t=>t(e,n,s))))},c="undefined"==typeof Proxy?{}:new Proxy(n,{get:(e,t)=>i(t),ownKeys:e=>Array.from(o.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(e,t)=>o.has(t),set:(e,t,n)=>(a(t,n),!0)}),l=(e,t)=>(r[e].push(t),()=>{removeFromArray(r[e],t)});return{state:c,get:i,set:a,on:l,onChange:(t,n)=>{const o=l("set",((e,o)=>{e===t&&n(o)})),r=l("reset",(()=>n(unwrap(e)[t])));return()=>{o(),r()}},use:(...e)=>{const t=e.reduce(((e,t)=>(t.set&&e.push(l("set",t.set)),t.get&&e.push(l("get",t.get)),t.reset&&e.push(l("reset",t.reset)),t.dispose&&e.push(l("dispose",t.dispose)),e)),[]);return()=>t.forEach((e=>e()))},dispose:()=>{r.dispose.forEach((e=>e())),s()},reset:s,forceUpdate:e=>{const t=o.get(e);r.set.forEach((n=>n(e,t,t)))}}},removeFromArray=(e,t)=>{const n=e.indexOf(t);n>=0&&(e[n]=e[e.length-1],e.length--)},createStore=(e,t)=>{const n=createObservableMap(e,t);return n.use(stencilSubscription()),n},loadCustomRelays=()=>{try{const e=localStorage.getItem("customNip46Relays");if(e){const t=JSON.parse(e);if(Array.isArray(t)&&t.length>0)return t}}catch(e){console.error("Failed to load custom relays from localStorage",e)}return["wss://relay.nsec.app/","wss://ephemeral.snowflare.cc/"]},{state:state,onChange:onChange,reset:reset}=createStore({screen:CURRENT_MODULE.WELCOME,prevScreen:CURRENT_MODULE.WELCOME,path:[CURRENT_MODULE.WELCOME],error:"",isLoading:!1,isLoadingExtension:!1,isOTP:!1,authUrl:"",iframeUrl:"",njumpIframe:"",customNip46Relays:loadCustomRelays(),nlSignin:{loginName:""},nlSignup:{signupName:"",domain:"",servers:[{name:"@nsec.app",value:"nsec.app"},{name:"@highlighter.com",value:"highlighter.com"}]},nlSigninBunkerUrl:{loginName:""},nlSigninReadOnly:{loginName:""},nlSigninOTP:{loginName:"",code:""},nlSigninNsec:{nsecValue:""},nlImport:null});onChange("customNip46Relays",(e=>{try{localStorage.setItem("customNip46Relays",JSON.stringify(e))}catch(e){console.error("Failed to save custom relays to localStorage",e)}})),onChange("screen",(()=>{state.error="",state.nlSignin.loginName="",state.nlSignup.signupName="",state.nlSignup.domain="",state.nlSigninNsec.nsecValue=""}));const baseCss="/*! tailwindcss v3.4.10 | MIT License | https://tailwindcss.com*/*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:\"\"}:host,html{-webkit-text-size-adjust:100%;font-feature-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;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-feature-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-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,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{color:#9ca3af;color:#6b7280;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}[multiple],[type=date],[type=datetime-local],[type=email],[type=month],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=time],[type=url],[type=week],input:where(:not([type])),select,textarea{--tw-shadow:0 0 #0000;appearance:none;background-color:#fff;border-color:#6b7280;border-radius:0;border-width:1px;font-size:1rem;line-height:1.5rem;padding:.5rem .75rem}[multiple]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=email]:focus,[type=month]:focus,[type=number]:focus,[type=password]:focus,[type=search]:focus,[type=tel]:focus,[type=text]:focus,[type=time]:focus,[type=url]:focus,[type=week]:focus,input:where(:not([type])):focus,select:focus,textarea:focus{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);border-color:#2563eb;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-year-field{padding-bottom:0;padding-top:0}select{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E\");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem;print-color-adjust:exact}[multiple],[size]:where(select:not([size=\"1\"])){background-image:none;background-position:0 0;background-repeat:unset;background-size:initial;padding-right:.75rem;print-color-adjust:unset}[type=checkbox],[type=radio]{--tw-shadow:0 0 #0000;appearance:none;background-color:#fff;background-origin:border-box;border-color:#6b7280;border-width:1px;color:#2563eb;display:inline-block;flex-shrink:0;height:1rem;padding:0;print-color-adjust:exact;user-select:none;vertical-align:middle;width:1rem}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}[type=checkbox]:checked,[type=radio]:checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:transparent}[type=checkbox]:checked{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E\")}@media (forced-colors:active){[type=checkbox]:checked{appearance:auto}}[type=radio]:checked{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3C/svg%3E\")}@media (forced-colors:active){[type=radio]:checked{appearance:auto}}[type=checkbox]:checked:focus,[type=checkbox]:checked:hover,[type=radio]:checked:focus,[type=radio]:checked:hover{background-color:currentColor;border-color:transparent}[type=checkbox]:indeterminate{background-color:currentColor;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3E%3C/svg%3E\");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:transparent}@media (forced-colors:active){[type=checkbox]:indeterminate{appearance:auto}}[type=checkbox]:indeterminate:focus,[type=checkbox]:indeterminate:hover{background-color:currentColor;border-color:transparent}[type=file]{background:unset;border-color:inherit;border-radius:0;border-width:0;font-size:unset;line-height:inherit;padding:0}[type=file]:focus{outline:1px solid ButtonText;outline:1px auto -webkit-focus-ring-color}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}.block{display:block}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.theme-default .nl-bg{--tw-bg-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);background-color:rgb(255 255 255/var(--tw-bg-opacity));box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.theme-default .dark .nl-bg{--tw-bg-opacity:1;--tw-shadow-color:rgba(51,65,85,.7);--tw-shadow:var(--tw-shadow-colored);background-color:rgb(31 41 55/var(--tw-bg-opacity))}.theme-default .nl-description,.theme-default .nl-logo,.theme-default .nl-title{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}.theme-default .dark .nl-description,.theme-default .dark .nl-logo,.theme-default .dark .nl-title{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.theme-default .nl-description a{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity));text-decoration-line:underline}.theme-default .dark .nl-description a{--tw-text-opacity:1;color:rgb(191 219 254/var(--tw-text-opacity));text-decoration-line:underline}.theme-default .nl-action-button{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.theme-default .nl-action-button:hover{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.theme-default .dark .nl-action-button{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.theme-default .dark .nl-action-button:hover{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.theme-default .nl-title{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}.theme-default .dark .nl-title{--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}.theme-default .nl-button{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(229 231 235/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(31 41 55/var(--tw-text-opacity))}.theme-default .nl-button:hover{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity))}.theme-default .dark .nl-button{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(15 23 42/var(--tw-bg-opacity));border-color:rgb(55 65 81/var(--tw-border-opacity));color:rgb(209 213 219/var(--tw-text-opacity))}.theme-default .dark .nl-button:hover{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity))}.theme-default .nl-divider{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.theme-default .nl-divider:before{border-top-width:1px}.theme-default .nl-divider:after,.theme-default .nl-divider:before{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity));content:var(--tw-content)}.theme-default .dark .nl-divider{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.theme-default .dark .nl-divider:after,.theme-default .dark .nl-divider:before{--tw-border-opacity:1;border-color:rgb(75 85 99/var(--tw-border-opacity));content:var(--tw-content)}.theme-default .nl-footer{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}.theme-default .dark .nl-footer{--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}.theme-default .nl-error{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity))}.theme-default .dark .nl-error{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity))}.theme-default .nl-input{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.theme-default .nl-input:focus{--tw-border-opacity:1;--tw-ring-opacity:1;--tw-ring-color:rgb(168 85 247/var(--tw-ring-opacity));border-color:rgb(168 85 247/var(--tw-border-opacity))}.theme-default .dark .nl-input{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity));color:rgb(156 163 175/var(--tw-text-opacity))}.theme-default .dark .nl-input:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(75 85 99/var(--tw-ring-opacity))}.theme-default .nl-select{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.theme-default .nl-select:focus{--tw-border-opacity:1;--tw-ring-opacity:1;--tw-ring-color:rgb(168 85 247/var(--tw-ring-opacity));border-color:rgb(168 85 247/var(--tw-border-opacity))}.theme-default .dark .nl-select{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity));color:rgb(156 163 175/var(--tw-text-opacity))}.theme-default .dark .nl-select:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(75 85 99/var(--tw-ring-opacity))}.theme-default .nl-select-list{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.theme-default .dark .nl-select-list{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.theme-default .nl-select-option{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}.theme-default .nl-select-option:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.theme-default .nl-select-option.active-option{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity));color:rgb(30 58 138/var(--tw-text-opacity))}.theme-default .dark .nl-select-option{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.theme-default .dark .nl-select-option:hover{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity));color:rgb(209 213 219/var(--tw-text-opacity))}.theme-default .nl-text-error{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity))}.theme-default .nl-text-success{--tw-text-opacity:1;color:rgb(45 212 191/var(--tw-text-opacity))}.theme-default .nl-banner{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);background-color:rgb(255 255 255/var(--tw-bg-opacity));border-color:rgb(229 231 235/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(31 41 55/var(--tw-text-opacity))}.theme-default .dark .nl-banner{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(15 23 42/var(--tw-bg-opacity));border-color:rgb(55 65 81/var(--tw-border-opacity));color:rgb(209 213 219/var(--tw-text-opacity))}.theme-ocean .nl-bg{--tw-bg-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);background-color:rgb(191 219 254/var(--tw-bg-opacity));box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.theme-ocean .dark .nl-bg{--tw-bg-opacity:1;--tw-shadow-color:rgba(51,65,85,.7);--tw-shadow:var(--tw-shadow-colored);background-color:rgb(8 47 73/var(--tw-bg-opacity))}.theme-ocean .nl-description,.theme-ocean .nl-logo,.theme-ocean .nl-title{--tw-text-opacity:1;color:rgb(8 47 73/var(--tw-text-opacity))}.theme-ocean .dark .nl-description,.theme-ocean .dark .nl-logo,.theme-ocean .dark .nl-title{--tw-text-opacity:1;color:rgb(186 230 253/var(--tw-text-opacity))}.theme-ocean .nl-action-button{--tw-text-opacity:1;color:rgb(8 47 73/var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.theme-ocean .nl-action-button:hover{--tw-bg-opacity:1;background-color:rgb(224 242 254/var(--tw-bg-opacity))}.theme-ocean .dark .nl-action-button{--tw-text-opacity:1;color:rgb(186 230 253/var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.theme-ocean .dark .nl-action-button:hover{--tw-bg-opacity:1;background-color:rgb(12 74 110/var(--tw-bg-opacity))}.theme-ocean .nl-button{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);background-color:rgb(224 242 254/var(--tw-bg-opacity));border-color:rgb(186 230 253/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(8 47 73/var(--tw-text-opacity))}.theme-ocean .nl-button:hover{--tw-bg-opacity:1;background-color:rgb(240 249 255/var(--tw-bg-opacity))}.theme-ocean .dark .nl-button{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(7 89 133/var(--tw-bg-opacity));border-color:rgb(8 47 73/var(--tw-border-opacity));color:rgb(186 230 253/var(--tw-text-opacity))}.theme-ocean .dark .nl-button:hover{--tw-bg-opacity:1;background-color:rgb(12 74 110/var(--tw-bg-opacity))}.theme-ocean .nl-divider{--tw-text-opacity:1;color:rgb(8 47 73/var(--tw-text-opacity))}.theme-ocean .nl-divider:after,.theme-ocean .nl-divider:before{--tw-border-opacity:1;border-color:rgb(8 47 73/var(--tw-border-opacity));content:var(--tw-content)}.theme-ocean .dark .nl-divider{--tw-text-opacity:1;color:rgb(186 230 253/var(--tw-text-opacity))}.theme-ocean .dark .nl-divider:after,.theme-ocean .dark .nl-divider:before{--tw-border-opacity:1;border-color:rgb(186 230 253/var(--tw-border-opacity));content:var(--tw-content)}.theme-ocean .nl-footer{--tw-text-opacity:1;color:rgb(8 47 73/var(--tw-text-opacity))}.theme-ocean .dark .nl-footer{--tw-text-opacity:1;color:rgb(186 230 253/var(--tw-text-opacity))}.theme-ocean .nl-error{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity))}.theme-ocean .dark .nl-error{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity))}.theme-ocean .nl-input{--tw-bg-opacity:1;background-color:rgb(224 242 254/var(--tw-bg-opacity))}.theme-ocean .nl-input:focus{--tw-border-opacity:1;--tw-ring-opacity:1;--tw-ring-color:rgb(14 165 233/var(--tw-ring-opacity));border-color:rgb(14 165 233/var(--tw-border-opacity))}.theme-ocean .dark .nl-input{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(12 74 110/var(--tw-bg-opacity));color:rgb(56 189 248/var(--tw-text-opacity))}.theme-ocean .dark .nl-input:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(2 132 199/var(--tw-ring-opacity))}.theme-ocean .nl-select{--tw-bg-opacity:1;background-color:rgb(224 242 254/var(--tw-bg-opacity))}.theme-ocean .nl-select:focus{--tw-border-opacity:1;--tw-ring-opacity:1;--tw-ring-color:rgb(14 165 233/var(--tw-ring-opacity));border-color:rgb(14 165 233/var(--tw-border-opacity))}.theme-ocean .dark .nl-select{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(12 74 110/var(--tw-bg-opacity));color:rgb(56 189 248/var(--tw-text-opacity))}.theme-ocean .dark .nl-select:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(2 132 199/var(--tw-ring-opacity))}.theme-ocean .nl-select-list{--tw-bg-opacity:1;background-color:rgb(224 242 254/var(--tw-bg-opacity))}.theme-ocean .dark .nl-select-list{--tw-bg-opacity:1;background-color:rgb(3 105 161/var(--tw-bg-opacity))}.theme-ocean .nl-select-option{--tw-text-opacity:1;color:rgb(7 89 133/var(--tw-text-opacity))}.theme-ocean .nl-select-option:hover{--tw-bg-opacity:1;background-color:rgb(186 230 253/var(--tw-bg-opacity))}.theme-ocean .dark .nl-select-option{--tw-text-opacity:1;color:rgb(56 189 248/var(--tw-text-opacity))}.theme-ocean .dark .nl-select-option:hover{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(7 89 133/var(--tw-bg-opacity));color:rgb(125 211 252/var(--tw-text-opacity))}.theme-ocean .nl-text-error{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity))}.theme-ocean .dark .nl-text-error{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity))}.theme-ocean .nl-text-success{--tw-text-opacity:1;color:rgb(13 148 136/var(--tw-text-opacity))}.theme-ocean .dark .nl-text-success{--tw-text-opacity:1;color:rgb(45 212 191/var(--tw-text-opacity))}.theme-lemonade .nl-bg{--tw-bg-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);background-color:rgb(187 247 208/var(--tw-bg-opacity));box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.theme-lemonade .dark .nl-bg{--tw-bg-opacity:1;--tw-shadow-color:rgba(51,65,85,.7);--tw-shadow:var(--tw-shadow-colored);background-color:rgb(5 46 22/var(--tw-bg-opacity))}.theme-lemonade .nl-description,.theme-lemonade .nl-logo,.theme-lemonade .nl-title{--tw-text-opacity:1;color:rgb(5 46 22/var(--tw-text-opacity))}.theme-lemonade .dark .nl-description,.theme-lemonade .dark .nl-logo,.theme-lemonade .dark .nl-title{--tw-text-opacity:1;color:rgb(187 247 208/var(--tw-text-opacity))}.theme-lemonade .nl-action-button{--tw-text-opacity:1;color:rgb(5 46 22/var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.theme-lemonade .nl-action-button:hover{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity))}.theme-lemonade .dark .nl-action-button{--tw-text-opacity:1;color:rgb(187 247 208/var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.theme-lemonade .dark .nl-action-button:hover{--tw-bg-opacity:1;background-color:rgb(20 83 45/var(--tw-bg-opacity))}.theme-lemonade .nl-button{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);background-color:rgb(220 252 231/var(--tw-bg-opacity));border-color:rgb(187 247 208/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(5 46 22/var(--tw-text-opacity))}.theme-lemonade .nl-button:hover{--tw-bg-opacity:1;background-color:rgb(240 253 244/var(--tw-bg-opacity))}.theme-lemonade .dark .nl-button{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(22 101 52/var(--tw-bg-opacity));border-color:rgb(5 46 22/var(--tw-border-opacity));color:rgb(187 247 208/var(--tw-text-opacity))}.theme-lemonade .dark .nl-button:hover{--tw-bg-opacity:1;background-color:rgb(20 83 45/var(--tw-bg-opacity))}.theme-lemonade .nl-divider{--tw-text-opacity:1;color:rgb(5 46 22/var(--tw-text-opacity))}.theme-lemonade .nl-divider:after,.theme-lemonade .nl-divider:before{--tw-border-opacity:1;border-color:rgb(5 46 22/var(--tw-border-opacity));content:var(--tw-content)}.theme-lemonade .dark .nl-divider{--tw-text-opacity:1;color:rgb(187 247 208/var(--tw-text-opacity))}.theme-lemonade .dark .nl-divider:after,.theme-lemonade .dark .nl-divider:before{--tw-border-opacity:1;border-color:rgb(187 247 208/var(--tw-border-opacity));content:var(--tw-content)}.theme-lemonade .nl-footer{--tw-text-opacity:1;color:rgb(5 46 22/var(--tw-text-opacity))}.theme-lemonade .dark .nl-footer{--tw-text-opacity:1;color:rgb(187 247 208/var(--tw-text-opacity))}.theme-lemonade .nl-error{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity))}.theme-lemonade .dark .nl-error{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity))}.theme-lemonade .nl-input{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity))}.theme-lemonade .nl-input:focus{--tw-border-opacity:1;--tw-ring-opacity:1;--tw-ring-color:rgb(34 197 94/var(--tw-ring-opacity));border-color:rgb(34 197 94/var(--tw-border-opacity))}.theme-lemonade .dark .nl-input{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(20 83 45/var(--tw-bg-opacity));color:rgb(74 222 128/var(--tw-text-opacity))}.theme-lemonade .dark .nl-input:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(22 163 74/var(--tw-ring-opacity))}.theme-lemonade .nl-select{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity))}.theme-lemonade .nl-select:focus{--tw-border-opacity:1;--tw-ring-opacity:1;--tw-ring-color:rgb(34 197 94/var(--tw-ring-opacity));border-color:rgb(34 197 94/var(--tw-border-opacity))}.theme-lemonade .dark .nl-select{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(20 83 45/var(--tw-bg-opacity));color:rgb(74 222 128/var(--tw-text-opacity))}.theme-lemonade .dark .nl-select:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(22 163 74/var(--tw-ring-opacity))}.theme-lemonade .nl-select-list{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity))}.theme-lemonade .dark .nl-select-list{--tw-bg-opacity:1;background-color:rgb(21 128 61/var(--tw-bg-opacity))}.theme-lemonade .nl-select-option{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity))}.theme-lemonade .nl-select-option:hover{--tw-bg-opacity:1;background-color:rgb(187 247 208/var(--tw-bg-opacity))}.theme-lemonade .dark .nl-select-option{--tw-text-opacity:1;color:rgb(74 222 128/var(--tw-text-opacity))}.theme-lemonade .dark .nl-select-option:hover{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(22 101 52/var(--tw-bg-opacity));color:rgb(134 239 172/var(--tw-text-opacity))}.theme-lemonade .nl-text-error{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity))}.theme-lemonade .dark .nl-text-error{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity))}.theme-lemonade .nl-text-success{--tw-text-opacity:1;color:rgb(13 148 136/var(--tw-text-opacity))}.theme-lemonade .dark .nl-text-success{--tw-text-opacity:1;color:rgb(45 212 191/var(--tw-text-opacity))}.theme-purple .nl-bg{--tw-bg-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);background-color:rgb(233 213 255/var(--tw-bg-opacity));box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.theme-purple .dark .nl-bg{--tw-bg-opacity:1;--tw-shadow-color:rgba(51,65,85,.7);--tw-shadow:var(--tw-shadow-colored);background-color:rgb(59 7 100/var(--tw-bg-opacity))}.theme-purple .nl-description,.theme-purple .nl-logo,.theme-purple .nl-title{--tw-text-opacity:1;color:rgb(59 7 100/var(--tw-text-opacity))}.theme-purple .dark .nl-description,.theme-purple .dark .nl-logo,.theme-purple .dark .nl-title{--tw-text-opacity:1;color:rgb(233 213 255/var(--tw-text-opacity))}.theme-purple .nl-action-button{--tw-text-opacity:1;color:rgb(59 7 100/var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.theme-purple .nl-action-button:hover{--tw-bg-opacity:1;background-color:rgb(243 232 255/var(--tw-bg-opacity))}.theme-purple .dark .nl-action-button{--tw-text-opacity:1;color:rgb(233 213 255/var(--tw-text-opacity));outline:2px solid transparent;outline-offset:2px}.theme-purple .dark .nl-action-button:hover{--tw-bg-opacity:1;background-color:rgb(88 28 135/var(--tw-bg-opacity))}.theme-purple .nl-button{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);background-color:rgb(243 232 255/var(--tw-bg-opacity));border-color:rgb(233 213 255/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(59 7 100/var(--tw-text-opacity))}.theme-purple .nl-button:hover{--tw-bg-opacity:1;background-color:rgb(250 245 255/var(--tw-bg-opacity))}.theme-purple .dark .nl-button{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(107 33 168/var(--tw-bg-opacity));border-color:rgb(59 7 100/var(--tw-border-opacity));color:rgb(233 213 255/var(--tw-text-opacity))}.theme-purple .dark .nl-button:hover{--tw-bg-opacity:1;background-color:rgb(88 28 135/var(--tw-bg-opacity))}.theme-purple .nl-divider{--tw-text-opacity:1;color:rgb(59 7 100/var(--tw-text-opacity))}.theme-purple .nl-divider:after,.theme-purple .nl-divider:before{--tw-border-opacity:1;border-color:rgb(59 7 100/var(--tw-border-opacity));content:var(--tw-content)}.theme-purple .dark .nl-divider{--tw-text-opacity:1;color:rgb(233 213 255/var(--tw-text-opacity))}.theme-purple .dark .nl-divider:after,.theme-purple .dark .nl-divider:before{--tw-border-opacity:1;border-color:rgb(233 213 255/var(--tw-border-opacity));content:var(--tw-content)}.theme-purple .nl-footer{--tw-text-opacity:1;color:rgb(59 7 100/var(--tw-text-opacity))}.theme-purple .dark .nl-footer{--tw-text-opacity:1;color:rgb(233 213 255/var(--tw-text-opacity))}.theme-purple .nl-error{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity))}.theme-purple .dark .nl-error{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity))}.theme-purple .nl-input{--tw-bg-opacity:1;background-color:rgb(243 232 255/var(--tw-bg-opacity))}.theme-purple .nl-input:focus{--tw-border-opacity:1;--tw-ring-opacity:1;--tw-ring-color:rgb(168 85 247/var(--tw-ring-opacity));border-color:rgb(168 85 247/var(--tw-border-opacity))}.theme-purple .dark .nl-input{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(88 28 135/var(--tw-bg-opacity));color:rgb(192 132 252/var(--tw-text-opacity))}.theme-purple .dark .nl-input:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(147 51 234/var(--tw-ring-opacity))}.theme-purple .nl-select{--tw-bg-opacity:1;background-color:rgb(243 232 255/var(--tw-bg-opacity))}.theme-purple .nl-select:focus{--tw-border-opacity:1;--tw-ring-opacity:1;--tw-ring-color:rgb(168 85 247/var(--tw-ring-opacity));border-color:rgb(168 85 247/var(--tw-border-opacity))}.theme-purple .dark .nl-select{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(88 28 135/var(--tw-bg-opacity));color:rgb(192 132 252/var(--tw-text-opacity))}.theme-purple .dark .nl-select:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(147 51 234/var(--tw-ring-opacity))}.theme-purple .nl-select-list{--tw-bg-opacity:1;background-color:rgb(243 232 255/var(--tw-bg-opacity))}.theme-purple .dark .nl-select-list{--tw-bg-opacity:1;background-color:rgb(126 34 206/var(--tw-bg-opacity))}.theme-purple .nl-select-option{--tw-text-opacity:1;color:rgb(107 33 168/var(--tw-text-opacity))}.theme-purple .nl-select-option:hover{--tw-bg-opacity:1;background-color:rgb(233 213 255/var(--tw-bg-opacity))}.theme-purple .dark .nl-select-option{--tw-text-opacity:1;color:rgb(192 132 252/var(--tw-text-opacity))}.theme-purple .dark .nl-select-option:hover{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(107 33 168/var(--tw-bg-opacity));color:rgb(216 180 254/var(--tw-text-opacity))}.theme-purple .nl-text-error{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity))}.theme-purple .dark .nl-text-error{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity))}.theme-purple .nl-text-success{--tw-text-opacity:1;color:rgb(13 148 136/var(--tw-text-opacity))}.theme-purple .dark .nl-text-success{--tw-text-opacity:1;color:rgb(45 212 191/var(--tw-text-opacity))}.theme-crab .nl-button{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);background-color:rgb(254 226 226/var(--tw-bg-opacity));border-color:rgb(254 202 202/var(--tw-border-opacity));border-width:1px;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);color:rgb(69 10 10/var(--tw-text-opacity))}.theme-crab .nl-button:hover{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity))}.theme-crab .dark .nl-button{--tw-border-opacity:1;--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(153 27 27/var(--tw-bg-opacity));border-color:rgb(69 10 10/var(--tw-border-opacity));color:rgb(254 202 202/var(--tw-text-opacity))}.theme-crab .dark .nl-button:hover{--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity))}.show-slow{display:none;opacity:0;transition:.1s}.isOpen .show-slow{display:block;opacity:1;transition:.2s;transition-delay:.2s}:host{display:block}.animate-spin-loading{animation:spin2 1s linear infinite;background:var(--qa-dark-color)}@keyframes spin2{to{transform:rotate(1turn)}}.active{animation:blink .7s infinite alternate}@keyframes blink{0%{opacity:1}to{opacity:0}}.sr-only{clip:rect(0,0,0,0);border-width:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.right-0{right:0}.right-2{right:8px}.top-2{top:8px}.top-52{top:208px}.z-0{z-index:0}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.m-auto{margin:auto}.mx-auto{margin-left:auto;margin-right:auto}.mb-2{margin-bottom:8px}.ml-0{margin-left:0}.ml-\\[2px\\]{margin-left:2px}.mr-0{margin-right:0}.mr-2{margin-right:8px}.mr-3\\.5{margin-right:14px}.mt-2{margin-top:8px}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-0{height:0}.h-12{height:48px}.h-4{height:16px}.h-5{height:20px}.h-6{height:24px}.h-7{height:28px}.h-8{height:32px}.h-\\[46px\\]{height:46px}.h-auto{height:auto}.w-0{width:0}.w-12{width:48px}.w-16{width:64px}.w-4{width:16px}.w-5{width:20px}.w-52{width:208px}.w-6{width:24px}.w-7{width:28px}.w-8{width:32px}.w-\\[48px\\]{width:48px}.w-full{width:100%}.min-w-40{min-width:160px}.max-w-40{max-width:160px}.flex-shrink-0{flex-shrink:0}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.place-items-center{place-items:center}.items-center{align-items:center}.justify-center{justify-content:center}.gap-x-2{column-gap:8px}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-nowrap{text-wrap:nowrap}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-r-lg{border-bottom-right-radius:.5rem;border-top-right-radius:.5rem}.rounded-r-none{border-bottom-right-radius:0;border-top-right-radius:0}.border{border-width:1px}.border-\\[0px\\]{border-width:0}.border-\\[2px\\]{border-width:2px}.border-current{border-color:currentColor}.border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.border-transparent{border-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.p-3{padding:12px}.px-2{padding-left:8px;padding-right:8px}.px-3{padding-left:12px;padding-right:12px}.py-2\\.5{padding-bottom:10px;padding-top:10px}.pl-\\[11px\\]{padding-left:11px}.text-center{text-align:center}.text-sm{font-size:14px;line-height:20px}.text-xs{font-size:12px;line-height:16px}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.text-slate-900{--tw-text-opacity:1;color:rgb(15 23 42/var(--tw-text-opacity))}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.hover\\:right-2:hover{right:8px}.hover\\:rounded-r-lg:hover{border-bottom-right-radius:.5rem;border-top-right-radius:.5rem}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:opacity-50:disabled{opacity:.5}.dark\\:text-gray-300:is(.dark *){--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}.dark\\:focus\\:outline-none:focus:is(.dark *){outline:2px solid transparent;outline-offset:2px}.dark\\:focus\\:ring-1:focus:is(.dark *){--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.dark\\:focus\\:ring-gray-600:focus:is(.dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(75 85 99/var(--tw-ring-opacity))}.w-auto{width:auto}.rounded-xl{border-radius:.75rem}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity))}.border-orange-300{--tw-border-opacity:1;border-color:rgb(253 186 116/var(--tw-border-opacity))}.border-red-300{--tw-border-opacity:1;border-color:rgb(252 165 165/var(--tw-border-opacity))}.border-teal-300{--tw-border-opacity:1;border-color:rgb(94 234 212/var(--tw-border-opacity))}.border-yellow-300{--tw-border-opacity:1;border-color:rgb(253 224 71/var(--tw-border-opacity))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.bg-orange-100{--tw-bg-opacity:1;background-color:rgb(255 237 213/var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity))}.bg-teal-100{--tw-bg-opacity:1;background-color:rgb(204 251 241/var(--tw-bg-opacity))}.bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity))}.px-1{padding-left:4px;padding-right:4px}.text-\\[10px\\]{font-size:10px}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.text-orange-600{--tw-text-opacity:1;color:rgb(234 88 12/var(--tw-text-opacity))}.text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity))}.text-teal-600{--tw-text-opacity:1;color:rgb(13 148 136/var(--tw-text-opacity))}.text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity))}.left-0{left:0}.start-0{inset-inline-start:0}.top-0{top:0}.z-\\[80\\]{z-index:80}.z-\\[81\\]{z-index:81}.h-full{height:100%}.max-w-96{max-width:384px}.flex-col{flex-direction:column}.justify-between{justify-content:space-between}.gap-1{gap:4px}.gap-2{gap:8px}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}.bg-opacity-75{--tw-bg-opacity:0.75}.p-4{padding:16px}.px-4{padding-left:16px;padding-right:16px}.py-3{padding-bottom:12px}.pt-3,.py-3{padding-top:12px}.text-base{font-size:16px;line-height:24px}.font-light{font-weight:300}.text-blue-400{--tw-text-opacity:1;color:rgb(96 165 250/var(--tw-text-opacity))}@media (min-width:640px){.sm\\:mx-auto{margin-left:auto;margin-right:auto}.sm\\:w-full{width:100%}.sm\\:max-w-lg{max-width:512px}}.pointer-events-none{pointer-events:none}.inset-y-0{bottom:0;top:0}.max-w-72{max-width:288px}.border-\\[3px\\]{border-width:3px}.pe-4{padding-inline-end:16px}.ps-11{padding-inline-start:44px}.ps-4{padding-inline-start:16px}.pt-2{padding-top:8px}.text-2xl{font-size:24px;line-height:32px}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.peer:disabled~.peer-disabled\\:pointer-events-none{pointer-events:none}.peer:disabled~.peer-disabled\\:opacity-50{opacity:.5}.dark\\:border-transparent:is(.dark *){border-color:transparent}.mb-3{margin-bottom:12px}.mb-4{margin-bottom:16px}.ml-2{margin-left:8px}.flex-1{flex:1 1 0%}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(4px*var(--tw-space-y-reverse));margin-top:calc(4px*(1 - var(--tw-space-y-reverse)))}.rounded{border-radius:.25rem}.bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity))}.py-1{padding-bottom:4px;padding-top:4px}.py-1\\.5{padding-bottom:6px;padding-top:6px}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.underline{text-decoration-line:underline}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.hover\\:bg-blue-600:hover{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity))}.hover\\:text-blue-700:hover{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity))}.hover\\:text-gray-700:hover{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.hover\\:text-red-700:hover{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity))}.dark\\:border-gray-600:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 85 99/var(--tw-border-opacity))}.dark\\:bg-gray-700:is(.dark *){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.dark\\:bg-gray-800:is(.dark *){--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity))}.dark\\:text-blue-400:is(.dark *){--tw-text-opacity:1;color:rgb(96 165 250/var(--tw-text-opacity))}.dark\\:text-gray-100:is(.dark *){--tw-text-opacity:1;color:rgb(243 244 246/var(--tw-text-opacity))}.dark\\:text-gray-400:is(.dark *){--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.dark\\:text-red-400:is(.dark *){--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity))}.dark\\:hover\\:text-blue-300:hover:is(.dark *){--tw-text-opacity:1;color:rgb(147 197 253/var(--tw-text-opacity))}.dark\\:hover\\:text-gray-300:hover:is(.dark *){--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}.dark\\:hover\\:text-red-300:hover:is(.dark *){--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity))}.max-w-52{max-width:208px}.gap-3{gap:12px}.pb-5{padding-bottom:20px}.text-3xl{font-size:30px;line-height:36px}.text-lg{font-size:18px;line-height:28px}.mt-3{margin-top:12px}.mb-0\\.5{margin-bottom:2px}.mb-5{margin-bottom:20px}.ml-auto{margin-left:auto}.mr-auto{margin-right:auto}.w-72{width:288px}.pb-2{padding-bottom:8px}.mb-10{margin-bottom:40px}.mt-10{margin-top:40px}.h-20{height:80px}.w-20{width:80px}.border-\\[4px\\]{border-width:4px}.text-4xl{font-size:36px;line-height:40px}.mt-0{margin-top:0}.max-h-0{max-height:0}.max-h-\\[500px\\]{max-height:500px}.max-w-7{max-width:28px}.rotate-0{--tw-rotate:0deg}.rotate-0,.rotate-180{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate:180deg}.cursor-default{cursor:default}.gap-0\\.5{gap:2px}.gap-x-3\\.5{column-gap:14px}.overflow-hidden{overflow:hidden}.border-b-\\[1px\\]{border-bottom-width:1px}.border-dashed{border-style:dashed}.border-blue-500{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity))}.border-gray-400{--tw-border-opacity:1;border-color:rgb(156 163 175/var(--tw-border-opacity))}.p-2{padding:8px}.py-2{padding-bottom:8px;padding-top:8px}.pb-1{padding-bottom:4px}.pb-1\\.5{padding-bottom:6px}.pt-5{padding-top:20px}.decoration-dashed{text-decoration-style:dashed}.opacity-50{opacity:.5}.grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.duration-\\[0\\.25s\\]{transition-duration:.25s}.ease-in{transition-timing-function:cubic-bezier(.4,0,1,1)}.hover\\:bg-gray-300:hover{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity))}.text-green-800{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity))}.dark\\:text-green-200:is(.dark *){--tw-text-opacity:1;color:rgb(187 247 208/var(--tw-text-opacity))}.ml-auto,.mx-auto{margin-left:auto}.w-60{width:240px}.right-\\[-2px\\]{right:-2px}.right-\\[-3px\\]{right:-3px}.top-\\[-2px\\]{top:-2px}.top-\\[-3px\\]{top:-3px}.h-1\\.5{height:6px}.h-3{height:12px}.w-1\\.5{width:6px}.w-3{width:12px}.max-w-6{max-width:24px}.border-2{border-width:2px}.border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity))}.border-white{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}.bg-green-500{--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity))}.pb-3{padding-bottom:12px}.pt-0{padding-top:0}.hover\\:bg-gray-400:hover{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity))}.hover\\:text-red-600:hover{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity))}.group:hover .group-hover\\:border-blue-400{--tw-border-opacity:1;border-color:rgb(96 165 250/var(--tw-border-opacity))}.mt-1{margin-top:4px}.min-w-\\[15rem\\]{min-width:15rem}.overflow-hidden,.truncate{overflow:hidden}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:-top-4:before{content:var(--tw-content);top:-16px}.before\\:start-0:before{content:var(--tw-content);inset-inline-start:0}.before\\:h-4:before{content:var(--tw-content);height:16px}.before\\:w-full:before{content:var(--tw-content);width:100%}.after\\:absolute:after{content:var(--tw-content);position:absolute}.after\\:-bottom-4:after{bottom:-16px;content:var(--tw-content)}.after\\:start-0:after{content:var(--tw-content);inset-inline-start:0}.after\\:h-4:after{content:var(--tw-content);height:16px}.after\\:w-full:after{content:var(--tw-content);width:100%}.end-0{inset-inline-end:0}.h-\\[20px\\]{height:20px}.w-\\[20px\\]{width:20px}.pe-11{padding-inline-end:44px}.mt-0\\.5{margin-top:2px}.items-start{align-items:flex-start}.border-yellow-400{--tw-border-opacity:1;border-color:rgb(250 204 21/var(--tw-border-opacity))}.bg-yellow-50{--tw-bg-opacity:1;background-color:rgb(254 252 232/var(--tw-bg-opacity))}.dark\\:border-yellow-600:is(.dark *){--tw-border-opacity:1;border-color:rgb(202 138 4/var(--tw-border-opacity))}.dark\\:bg-yellow-900\\/20:is(.dark *){background-color:rgba(113,63,18,.2)}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}",buttonBaseCss=baseCss,ButtonBaseStyle0=buttonBaseCss,ButtonBase=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.theme="default",this.darkMode=!1,this.titleBtn="Open modal",this.disabled=!1}componentDidRender(){const e=this.element.querySelector("svg");e&&(e.classList.add("flex-shrink-0","w-4","h-4","block"),e.removeAttribute("style"))}render(){return h("div",{key:"1048576f0a9839c56cac030b1de7899b25b5f39e",class:`theme-${this.theme}`},h("div",{key:"ea29f74a1f7e4268802c6e4aaca5867dfd2e4c9b",class:"animate-spin-loading active"}),h("button",{key:"71f84d47b11aa3971818b686f8dddb74e0d36eb0",disabled:this.disabled,type:"button",class:"nl-button py-2.5 px-3 w-full inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-lg disabled:opacity-50 disabled:pointer-events-none dark:focus:outline-none dark:focus:ring-1 dark:focus:ring-gray-600"},h("slot",{key:"91a91994e20dc10e3bbb2576e4214fa98533be8e",name:"icon-start"}),this.titleBtn))}get element(){return this}static get style(){return ButtonBaseStyle0}},[4,"button-base",{theme:[1025],darkMode:[1028,"dark-mode"],titleBtn:[1,"title-btn"],disabled:[4]}]);function defineCustomElement$s(){if("undefined"==typeof customElements)return;["button-base"].forEach((e=>{if("button-base"===e)customElements.get(e)||customElements.define(e,ButtonBase)}))}defineCustomElement$s();const nlConfirmLogoutCss=baseCss,NlConfirmLogoutStyle0=nlConfirmLogoutCss,NlConfirmLogout$1=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.handleLogoutBanner=createEvent$1(this,"handleLogoutBanner"),this.handleBackUpModal=createEvent$1(this,"handleBackUpModal"),this.nlCloseModal=createEvent$1(this,"nlCloseModal"),this.titleModal="Delete keys?",this.description="Your profile keys are stored in this browser tab and will be deleted if you log out, and your profile will be inaccessible."}handleLogout(){this.handleLogoutBanner.emit(METHOD_MODULE.LOGOUT),this.nlCloseModal.emit()}handleCancel(){this.nlCloseModal.emit()}handleBackUp(){state.path=[CURRENT_MODULE.IMPORT_FLOW]}render(){return h("div",{key:"fe605f38f9d0a440fe53e21f19288c41e4762c22",class:"p-4 overflow-y-auto"},h("h1",{key:"84d14a59035515b2fd612d262400a038887a10d7",class:"nl-title font-bold text-center text-4xl"},this.titleModal),h("p",{key:"83ef73271c76309561be95e0207f8130d75a161c",class:"nl-description font-light text-center text-lg pt-2 max-w-96 mx-auto"},this.description),h("div",{key:"fce0f132846beb95dd9e41357f5ab87be7229a56",class:"mt-3 ml-auto mr-auto w-60 flex flex-col gap-2"},h("button-base",{key:"c4fc722a7c98d84e797963ed7fe928164411b701",onClick:()=>this.handleBackUp(),titleBtn:"Backup keys",theme:"lemonade"}),h("button-base",{key:"39df385a9a8dc3fcd74f4196d4191bc4a308a16d",onClick:()=>this.handleLogout(),theme:"crab",titleBtn:"Logout and delete keys"})))}static get style(){return NlConfirmLogoutStyle0}},[0,"nl-confirm-logout",{titleModal:[1,"title-modal"],description:[1]}]);function defineCustomElement$r(){if("undefined"==typeof customElements)return;["nl-confirm-logout","button-base"].forEach((e=>{switch(e){case"nl-confirm-logout":customElements.get(e)||customElements.define(e,NlConfirmLogout$1);break;case"button-base":customElements.get(e)||defineCustomElement$s()}}))}defineCustomElement$r();const nlNip46RelaySettingsCss=baseCss,NlNip46RelaySettingsStyle0=nlNip46RelaySettingsCss,FACTORY_DEFAULT_RELAYS=["wss://relay.nsec.app/","wss://ephemeral.snowflare.cc/"],NlNip46RelaySettings=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlRelaysChanged=createEvent$1(this,"nlRelaysChanged"),this.defaultRelays=[...FACTORY_DEFAULT_RELAYS],this.relays=[],this.newRelay="",this.showSettings=!1}componentWillLoad(){this.relays=[...this.defaultRelays]}addRelay(){const e=this.newRelay.trim();e&&(e.startsWith("wss://")||e.startsWith("ws://"))&&(this.relays.includes(e)||(this.relays=[...this.relays,e],this.newRelay="",this.nlRelaysChanged.emit(this.relays)))}removeRelay(e){this.relays=this.relays.filter(((t,n)=>n!==e)),this.nlRelaysChanged.emit(this.relays)}resetToDefaults(){this.relays=[...FACTORY_DEFAULT_RELAYS],this.nlRelaysChanged.emit(this.relays)}render(){return h("div",{key:"b21c3d9935218ccd1d552b9f635bd2a5577f50c0",class:"nip46-relay-settings mb-4"},h("button",{key:"aa9bd7bb3bd4310b1a02edfc1c010a7907dc79ce",type:"button",class:"text-xs text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 underline cursor-pointer",onClick:()=>this.showSettings=!this.showSettings},this.showSettings?"▼":"▶"," Advanced: Relay Settings"),this.showSettings&&h("div",{key:"bfafd2a8bfae6b9829c553f286d5d80f16011b2e",class:"mt-2 p-3 border border-gray-300 dark:border-gray-600 rounded bg-gray-50 dark:bg-gray-800"},h("div",{key:"6bcfc31c24f3eb074e0101cdb319b19806550db9",class:"flex justify-between items-center mb-2"},h("div",{key:"32d87ef74ecfd3f330ce88ab1802878bed40d680",class:"text-xs font-semibold text-gray-700 dark:text-gray-300"},"Nip46 Relays:"),h("button",{key:"26c7843cff229b73d33e86238eadbbdbde33955e",type:"button",class:"text-xs text-blue-500 hover:text-blue-700 dark:text-blue-400 dark:hover:text-blue-300 underline cursor-pointer",onClick:()=>this.resetToDefaults()},"Reset to defaults")),h("ul",{key:"d6419de90eb296e91df6e6ede131d41c22d9e0e8",class:"text-xs mb-3 space-y-1"},this.relays.map(((e,t)=>h("li",{class:"flex justify-between items-center py-1 px-2 bg-white dark:bg-gray-700 rounded"},h("span",{class:"truncate text-gray-700 dark:text-gray-300 flex-1"},e),h("button",{type:"button",class:"ml-2 text-red-500 hover:text-red-700 dark:text-red-400 dark:hover:text-red-300 font-bold cursor-pointer",onClick:()=>this.removeRelay(t),title:"Remove relay"},"✕"))))),h("div",{key:"0544da279bb32591f78dff61ecb5372e3a069b06",class:"flex gap-2"},h("input",{key:"eaf3009c8d711dbbf6bc0a3f954e042d5865a669",type:"text",class:"flex-1 text-xs px-2 py-1.5 border border-gray-300 dark:border-gray-600 rounded bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100",placeholder:"wss://relay.example.com",value:this.newRelay,onInput:e=>this.newRelay=e.target.value,onKeyPress:e=>{"Enter"===e.key&&(e.preventDefault(),this.addRelay())}}),h("button",{key:"1223d35e9155b6716715f0685777370e8afa32d1",type:"button",class:"text-xs px-3 py-1.5 bg-blue-500 hover:bg-blue-600 text-white rounded cursor-pointer",onClick:()=>this.addRelay()},"Add"))))}static get style(){return NlNip46RelaySettingsStyle0}},[0,"nl-nip46-relay-settings",{defaultRelays:[16],relays:[32],newRelay:[32],showSettings:[32]}]);function defineCustomElement$q(){if("undefined"==typeof customElements)return;["nl-nip46-relay-settings"].forEach((e=>{if("nl-nip46-relay-settings"===e)customElements.get(e)||customElements.define(e,NlNip46RelaySettings)}))}defineCustomElement$q();const nlConnectCss=baseCss,NlConnectStyle0=nlConnectCss,NlConnect=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlNostrConnect=createEvent$1(this,"nlNostrConnect"),this.titleWelcome="Connect to key store",this.authMethods=[],this.hasOTP=!1,this.connectionStringServices=[],this.isOpenAdvancedLogin=!1}handleChangeScreen(e){state.path=[...state.path,e]}handleOpenAdvanced(){this.isOpenAdvancedLogin=!this.isOpenAdvancedLogin}allowAuthMethod(e){return!this.authMethods.length||this.authMethods.includes(e)}componentWillLoad(){}handleOpenLink(e,t){e.preventDefault(),this.nlNostrConnect.emit(t)}handleConnectionString(){this.handleChangeScreen(CURRENT_MODULE.CONNECTION_STRING)}render(){const e=(this.isOpenAdvancedLogin?"rotate-180":"rotate-0")+" duration-300 flex-shrink-0 w-4 h-4 text-blue-500";return h(Fragment,{key:"7361ac64cb9b8b02f85a97bc8dc01e2c9ab8b01c"},h("div",{key:"6e9a8335ae521f6e9a67ed433cb9ca9501f2e062",class:"p-4 overflow-y-auto"},h("h1",{key:"3ba01b15367e43824fea55967fa949da53bd956c",class:"nl-title font-bold text-center text-3xl"},this.titleWelcome)),h("div",{key:"0a7995f42d602d73f3ad23bff7d8a6995763acbc",class:"p-4"},Boolean(this.connectionStringServices.length)&&h("div",{key:"dd90d4a123c1940aa4cace1291262811d21352a8",class:"max-w-96 mx-auto pt-5"},h("p",{key:"2e122c0d1274fe996f37aadb54e2b1135084b906",class:"nl-description font-medium text-sm pb-1.5"},"Select key store:"),h("ul",{key:"54c38861f6bbb2eb1198ad8a7aeddd38104b33e4",class:"p-2 rounded-lg border border-gray-200 flex flex-col w-full gap-0.5"},this.connectionStringServices.map((e=>{const t="loading"===e.available,n=!1===e.available,o=t||n;return h("li",{class:o?"opacity-50 pointer-events-none":""},h("a",{href:o?void 0:e.link,target:"_blank",onClick:t=>{o?t.preventDefault():this.handleOpenLink(t,e)},class:"flex items-center gap-x-3.5 w-full py-2 px-3 rounded-lg text-sm justify-between "+(o?"cursor-default":"hover:bg-gray-300 cursor-pointer")},h("div",{class:"w-full max-w-7 h-7 flex relative"},h("div",{class:"uppercase font-bold w-full h-full rounded-full border border-gray-400 flex justify-center items-center"},Boolean(e.img)?h("img",{class:"w-full rounded-full "+(n?"grayscale":""),src:e.img,alt:e.name}):h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"#9ca3af",class:"w-4 h-4 block"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"})))),h("div",{class:"overflow-hidden flex flex-col w-full"},h("div",{class:"nl-title truncate overflow-hidden"},e.name,t&&h("span",{class:"nl-description text-xs ml-2"},"checking..."),n&&h("span",{class:"nl-description text-xs ml-2"},"offline")))))}))))),h("div",{key:"c372f1e8bd0cceb7b9660612eb6158d5ec625d3e",class:"ps-4 pe-4 overflow-y-auto"},h("p",{key:"0b6c50602854cf06554c92505cfce1ef215e8f7d",class:"nl-error font-light text-center text-sm max-w-96 mx-auto"},state.error)),h("div",{key:"a67dd79c1f13bdc0636a34e4f0c6c0df80293aa6",class:"max-w-72 mx-auto"},h("nl-nip46-relay-settings",{key:"0f358c327060445e14313331ca5e1ee8175d1493",defaultRelays:state.customNip46Relays,onNlRelaysChanged:e=>{state.customNip46Relays=e.detail}})),h("div",{key:"beccc66491904a50dc44c720fa5e32208e1ff61e",class:"max-w-52 mx-auto pb-5"},(this.allowAuthMethod("connect")||this.allowAuthMethod("readOnly"))&&h("div",{key:"7e670e898fd405c82cb749699a73d087525f4475",class:"flex justify-center"},h("div",{key:"634509b97941ceeda9338cc29d431dcafab17b04",onClick:()=>this.handleOpenAdvanced(),class:"text-blue-500 mt-3 decoration-dashed cursor-pointer inline-flex gap-2 items-center pb-1 border-dashed border-b-[1px] border-blue-500 text-sm font-light"},"Advanced",h("svg",{key:"3e14d6c45fb72b1ad47beea455b36001ecb6c394",class:e,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},h("path",{key:"0ebce63b4caffd049c6e5a110792ca138e2e914b",d:"m6 9 6 6 6-6"})))),h("div",{key:"7d22deba5c378a53056eae0884e0d051504d7c5b",class:(this.isOpenAdvancedLogin?"max-h-[500px] mt-3 duration-300":"max-h-0 mt-0 duration-[0.25s]")+" transition-max-height ease-in flex gap-3 flex-col overflow-hidden"},this.allowAuthMethod("connect")&&h("button-base",{key:"c4bbb92fcbf14048429099e26ab6e886a87e62f6",titleBtn:"User name",onClick:()=>this.handleChangeScreen(CURRENT_MODULE.LOGIN)},h("svg",{key:"8482dadd22930b1c17b328441a15609d41bc6c8d",style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},h("path",{key:"ce5b427cba70a646c07ce61ea738765322e6c4ff","stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"}))),this.allowAuthMethod("connect")&&h("button-base",{key:"2859b956807892b0fcbbd88433733c7a905ad4f1",titleBtn:"Connection string",onClick:()=>this.handleConnectionString()},h("svg",{key:"8e2f155b9c5bfbec2f88a97013111739065c9914",style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{key:"3071eb6d992c31d5fb11a03ec5c3c9dabde9eff1","stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 4.875c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5A1.125 1.125 0 0 1 3.75 9.375v-4.5ZM3.75 14.625c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5a1.125 1.125 0 0 1-1.125-1.125v-4.5ZM13.5 4.875c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5A1.125 1.125 0 0 1 13.5 9.375v-4.5Z"}),h("path",{key:"fa667a1e898b232c1db217d10458c926b559568f","stroke-linecap":"round","stroke-linejoin":"round",d:"M6.75 6.75h.75v.75h-.75v-.75ZM6.75 16.5h.75v.75h-.75v-.75ZM16.5 6.75h.75v.75h-.75v-.75ZM13.5 13.5h.75v.75h-.75v-.75ZM13.5 19.5h.75v.75h-.75v-.75ZM19.5 13.5h.75v.75h-.75v-.75ZM19.5 19.5h.75v.75h-.75v-.75ZM16.5 16.5h.75v.75h-.75v-.75Z"}))),this.allowAuthMethod("connect")&&h("button-base",{key:"5c66ae1e86bae7a9c3fbc975a92eefae2d4253ec",onClick:()=>this.handleChangeScreen(CURRENT_MODULE.LOGIN_BUNKER_URL),titleBtn:"Bunker URL"},h("svg",{key:"04d85bf0ac2f66b44a9ddd95815dd20d81935bad",style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{key:"763ef4a4f3f6f7807187e4d6aef8eecb7b858a44","stroke-linecap":"round","stroke-linejoin":"round",d:"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"}))))))}static get style(){return NlConnectStyle0}},[0,"nl-connect",{titleWelcome:[1,"title-welcome"],authMethods:[16],hasOTP:[4,"has-o-t-p"],connectionStringServices:[16],isOpenAdvancedLogin:[32]}]);function defineCustomElement$p(){if("undefined"==typeof customElements)return;["nl-connect","button-base","nl-nip46-relay-settings"].forEach((e=>{switch(e){case"nl-connect":customElements.get(e)||customElements.define(e,NlConnect);break;case"button-base":customElements.get(e)||defineCustomElement$s();break;case"nl-nip46-relay-settings":customElements.get(e)||defineCustomElement$q()}}))}defineCustomElement$p();const nlIframeCss=baseCss,NlIframeStyle0=nlIframeCss,NlConfirmLogout=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlCloseModal=createEvent$1(this,"nlCloseModal"),this.titleModal="Confirm",this.description="Your profile keys are stored in this browser tab and will be deleted if you log out, and your profile will be inaccessible.",this.iframeUrl=""}handleCancel(){this.nlCloseModal.emit()}render(){return h("div",{key:"954ed56c0b6069cbcaae788121d82733c772e5d6",class:"p-4 overflow-y-auto"},h("div",{key:"4f62e37fc1d19d9da953eef1d5e7df66256c2e50",class:"mt-3 flex flex-col gap-2"},this.iframeUrl&&h("iframe",{key:"26aee24e31d903e2207b6664b29904fd5b94deac",src:this.iframeUrl,style:{width:"100%",height:"600px",border:"1px solid #ccc",borderRadius:"8px"}})))}static get style(){return NlIframeStyle0}},[0,"nl-iframe",{titleModal:[1,"title-modal"],description:[1],iframeUrl:[1,"iframe-url"]}]);function defineCustomElement$o(){if("undefined"==typeof customElements)return;["nl-iframe"].forEach((e=>{if("nl-iframe"===e)customElements.get(e)||customElements.define(e,NlConfirmLogout)}))}defineCustomElement$o();const nlSelectCss=baseCss,NlSelectStyle0=nlSelectCss,NlSelect=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.selectDomain=createEvent$1(this,"selectDomain"),this.isOpen=!1,this.value=null,this.options=void 0,this.selected=void 0,this.mode=!1,this.darkMode=!1,this.themeState="default",this.theme="default"}handleWindowClick(){this.wrapperRef.querySelector(".listClass")&&(this.isOpen=!1)}toggleDropdown(){this.isOpen=!this.isOpen,this.calculateDropdownPosition()}watchPropHandler(e){this.themeState=e}watchModeHandler(e){this.mode=e}connectedCallback(){this.themeState=this.theme,this.mode=this.darkMode,this.value=this.options[this.selected],this.selectDomain.emit(this.value.value)}calculateDropdownPosition(){if(this.isOpen&&this.buttonRef){const e=this.buttonRef.getBoundingClientRect();this.ulRef.style.top=`${e.height}px`}}handleChange(e){this.value=e,this.isOpen=!1,this.selectDomain.emit(this.value.value)}render(){const e=(this.isOpen?"listClass":"hidden")+" min-w-[15rem] nl-select-list absolute left-0 shadow-md rounded-lg p-2 mt-1 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full",t=(this.isOpen?"rotate-180":"rotate-0")+" duration-300 flex-shrink-0 w-4 h-4 text-gray-500";return h("div",{key:"c86084c50712455e04682a4392e490bc0e20eb1d",class:`theme-${this.themeState}`},h("div",{key:"a90d9b4af52845a9971c39cec69c13493d511381",class:"relative",ref:e=>this.wrapperRef=e},h("button",{key:"1391137997bf8fcd0a5466cd9fa20c79b4ce27ba",ref:e=>this.buttonRef=e,onClick:()=>this.toggleDropdown(),type:"button",class:"nl-select peer py-3 px-4 flex items-center w-full justify-between border-transparent rounded-lg text-sm disabled:opacity-50 disabled:pointer-events-none dark:border-transparent"},h("span",{key:"224425ab92ba3599595924972e98a0fc9cb1a189",class:"truncate overflow-hidden"},this.value.name),h("svg",{key:"8eb2a2b552cb9ea36fb1abc61d804efb423afda6",class:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},h("path",{key:"feea1a7f54f4a111b7bf01e3945445311b97ab82",d:"m6 9 6 6 6-6"}))),h("ul",{key:"fca4982f04f4133d5c2a2f613a7e7d977dd5c241",ref:e=>this.ulRef=e,class:e},this.options.map((e=>h("li",{onClick:()=>this.handleChange(e),class:"nl-select-option flex cursor-pointer items-center gap-x-3.5 py-2 px-3 rounded-lg text-sm"},e.name))))))}get element(){return this}static get watchers(){return{theme:["watchPropHandler"],darkMode:["watchModeHandler"]}}static get style(){return NlSelectStyle0}},[0,"nl-select",{options:[16],selected:[2],darkMode:[4,"dark-mode"],theme:[1],isOpen:[32],value:[32],mode:[32],themeState:[32]},[[8,"click","handleWindowClick"]],{theme:["watchPropHandler"],darkMode:["watchModeHandler"]}]);function defineCustomElement$n(){if("undefined"==typeof customElements)return;["nl-select"].forEach((e=>{if("nl-select"===e)customElements.get(e)||customElements.define(e,NlSelect)}))}defineCustomElement$n();const nlImportFlowCss=baseCss,NlImportFlowStyle0=nlImportFlowCss,NlImportFlow$1=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlImportAccount=createEvent$1(this,"nlImportAccount"),this.nlExportKeys=createEvent$1(this,"nlExportKeys"),this.titleInfo="Back up your keys",this.titleImport="Choose a service",this.services=[],this.isContinued=!1,this.isKeyBackup=!1,this.isCopy=!1}handleDomainSelect(e){const t=this.services.find((t=>t.domain===e.detail));state.nlImport=t}handleCreateAccount(e){e.preventDefault(),this.nlImportAccount.emit(state.nlImport)}handleContinue(){this.isContinued=!0}handleContinueKeyBackup(){this.isKeyBackup=!0}async copyToClipboard(){this.nlExportKeys.emit(),this.isCopy=!0,setTimeout((()=>{this.isCopy=!1}),1500)}render(){if(!this.isContinued&&!this.isKeyBackup)return h("div",{class:"p-4 overflow-y-auto"},h("h1",{class:"nl-title font-bold text-center text-2xl"},this.titleInfo),h("p",{class:"nl-description font-light text-sm pt-2 pb-2 max-w-96 mx-auto"},"Nostr profiles are controlled by cryptographic keys.",h("br",null),h("br",null),"Your keys are currently only stored in this browser tab, and may be lost if you close it.",h("br",null),h("br",null),"You should backup your keys.",h("br",null),h("br",null),"We recommend to import your keys into a key store service, to protect them and to use with other apps."),h("div",{class:"ml-auto mr-auto mb-2 w-72"},h("button-base",{onClick:()=>this.handleContinue(),titleBtn:"Import to key store"})),h("div",{class:"ml-auto mr-auto w-72"},h("button-base",{onClick:()=>this.handleContinueKeyBackup(),titleBtn:"Export keys"})));if(this.isKeyBackup)return h("div",{class:"p-4 overflow-y-auto"},h("h1",{class:"nl-title font-bold text-center text-2xl"},"Key export"),h("p",{class:"nl-description font-light text-sm pt-2 pb-2 max-w-96 mx-auto"},"Copy your keys and store them in a safe place, like a password manager.",h("br",null),h("br",null),"You can sign into other Nostr apps by pasting your keys into them.",h("br",null),h("br",null),"Your keys must be kept secret, never share them with anyone."),h("div",{class:"max-w-72 mx-auto"},h("div",{class:"ml-auto mr-auto mb-2 w-72"},h("button-base",{onClick:()=>this.copyToClipboard(),titleBtn:this.isCopy?"Copied!":"Copy to clipboard"}))));const e=this.services.filter((e=>e.canImport)).map((e=>({name:e.domain,value:e.domain})));return h(Fragment,null,h("div",{class:"p-4 overflow-y-auto"},h("h1",{class:"nl-title font-bold text-center text-2xl"},this.titleImport),h("p",{class:"nl-description font-light text-center text-sm pt-2 max-w-96 mx-auto"},"Your Nostr keys will be imported into the service you choose. You will manage your keys on their website.")),h("div",{class:"max-w-72 mx-auto mb-5"},h("div",{class:"mb-0.5"},h("nl-select",{onSelectDomain:e=>this.handleDomainSelect(e),selected:0,options:e})),h("p",{class:"nl-title font-light text-sm mb-2"},"Default provider is a fine choice to start with."),h("div",{class:"ps-4 pe-4 overflow-y-auto"},h("p",{class:"nl-error font-light text-center text-sm max-w-96 mx-auto"},state.error)),h("button-base",{disabled:state.isLoading,onClick:e=>this.handleCreateAccount(e),titleBtn:"Start importing"},state.isLoading?h("span",{slot:"icon-start",class:"animate-spin-loading inline-block w-4 h-4 border-[3px] border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"}):h("svg",{slot:"icon-start",style:{display:"none"},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M18 7.5v3m0 0v3m0-3h3m-3 0h-3m-2.25-4.125a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0ZM3 19.235v-.11a6.375 6.375 0 0 1 12.75 0v.109A12.318 12.318 0 0 1 9.374 21c-2.331 0-4.512-.645-6.374-1.766Z"})))))}static get style(){return NlImportFlowStyle0}},[0,"nl-import-flow",{titleInfo:[1025,"title-info"],titleImport:[1,"title-import"],services:[16],isContinued:[32],isKeyBackup:[32],isCopy:[32]}]);function defineCustomElement$m(){if("undefined"==typeof customElements)return;["nl-import-flow","button-base","nl-select"].forEach((e=>{switch(e){case"nl-import-flow":customElements.get(e)||customElements.define(e,NlImportFlow$1);break;case"button-base":customElements.get(e)||defineCustomElement$s();break;case"nl-select":customElements.get(e)||defineCustomElement$n()}}))}defineCustomElement$m();const nlInfoCss=baseCss,NlInfoStyle0=nlInfoCss,NlInfo=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost()}render(){return h("div",{key:"ff51154f6dd944fd5de65bc2e8835c6b4b1cfa57",class:"p-4 overflow-y-auto"},h("svg",{key:"c04db0af7e108551b3b9de37dfe5c2175b6439f4",class:"w-12 h-12 mx-auto mb-2",width:"225",height:"224",viewBox:"0 0 225 224",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("rect",{key:"6a4d8f9847e857973d4e089a74fec6f8e50fc09d",width:"224.047",height:"224",rx:"64",fill:"#6951FA"}),h("path",{key:"a5bddb82b767722286b2165bc03e6d7aec7fee98",d:"M162.441 135.941V88.0593C170.359 85.1674 176 77.5348 176 68.6696C176 57.2919 166.708 48 155.33 48C143.953 48 134.661 57.2444 134.661 68.6696C134.661 77.5822 140.302 85.1674 148.219 88.0593V135.941C147.698 136.13 147.176 136.367 146.655 136.604L87.3956 77.3452C88.6282 74.6904 89.2919 71.7511 89.2919 68.6696C89.2919 57.2444 80.0474 48 68.6696 48C57.2919 48 48 57.2444 48 68.6696C48 77.5822 53.6415 85.1674 61.5585 88.0593V135.941C53.6415 138.833 48 146.465 48 155.33C48 166.708 57.2444 176 68.6696 176C80.0948 176 89.3393 166.708 89.3393 155.33C89.3393 146.418 83.6978 138.833 75.7807 135.941V88.0593C76.3022 87.8696 76.8237 87.6326 77.3452 87.3956L136.604 146.655C135.372 149.31 134.708 152.249 134.708 155.33C134.708 166.708 143.953 176 155.378 176C166.803 176 176.047 166.708 176.047 155.33C176.047 146.418 170.406 138.833 162.489 135.941H162.441Z",fill:"white"})),h("h1",{key:"b3264a68c05a73a83c01c2e54c7088bb234ca40d",class:"nl-title font-bold text-center text-4xl"},"Nostr ",h("span",{key:"ace01503f2160f1589229fbc732c7b5cf5aeedcc",class:"font-light"},"Login")),h("p",{key:"204c3ce4a21857081eb6e65c4b4a8d5356ab2722",class:"text-green-800 dark:text-green-200 font-light text-center text-lg pt-2 max-w-96 mx-auto"},"Version: 1.7.11"),h("p",{key:"88790a07beaad70f1d6e77ce77b30b87c7a73f3c",class:"nl-description font-light text-center text-lg pt-2 max-w-96 mx-auto"},"Learn more about Nostr"," ",h("a",{key:"129c8383ab18b01fba2b13c5b805435b24056e18",target:"_blank",href:"https://nostr.how"},"here"),".",h("br",{key:"8c1cca37a0992068c94a22ec8dea3e859db97e4a"}),"This is an"," ",h("a",{key:"eb270824dba82f0a707715724b165af90f86d25b",target:"_blank",href:"https://github.com/nostrband/nostr-login"},"open-source")," ","tool by"," ",h("a",{key:"d64434bf56e2083bf82ad90a2daf003a3c368ddc",target:"_blank",href:"https://nostr.band"},"Nostr.Band"),"."))}static get style(){return NlInfoStyle0}},[0,"nl-info"]);function defineCustomElement$l(){if("undefined"==typeof customElements)return;["nl-info"].forEach((e=>{if("nl-info"===e)customElements.get(e)||customElements.define(e,NlInfo)}))}defineCustomElement$l();const nlInfoExtensionCss=baseCss,NlInfoExtensionStyle0=nlInfoExtensionCss,NlInfoExtension=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost()}render(){return h("div",{key:"1d919493f0e640d5394470dd77ad586c8ad949d4",class:"p-4 overflow-y-auto"},state.isLoadingExtension?h("div",null,h("h1",{class:"nl-title font-bold text-center text-4xl"},"Signing in..."),h("div",{class:"mt-10 mb-10 ml-auto mr-auto w-20"},h("span",{slot:"icon-start",class:"animate-spin-loading ml-auto mr-auto inline-block w-20 h-20 border-[4px] border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"})),h("div",{class:"ps-4 pe-4 overflow-y-auto"},h("p",{class:"nl-error font-light text-center text-sm max-w-96 mx-auto"},state.error))):h("div",null,h("h1",{class:"nl-title font-bold text-center text-4xl"},"Install browser extension!"),h("p",{class:"nl-description font-light text-center text-lg pt-2 max-w-96 mx-auto"},"Try"," ",h("a",{href:"https://getalby.com",target:"_blank"},"Alby"),","," ",h("a",{href:"https://chromewebstore.google.com/detail/nos2x/kpgefcfmnafjgpblomihpgmejjdanjjp",target:"_blank"},"nos2x")," ","or"," ",h("a",{href:"https://apps.apple.com/us/app/nostore/id1666553677",target:"_blank"},"Nostore"))))}static get style(){return NlInfoExtensionStyle0}},[0,"nl-info-extension"]);function defineCustomElement$k(){if("undefined"==typeof customElements)return;["nl-info-extension"].forEach((e=>{if("nl-info-extension"===e)customElements.get(e)||customElements.define(e,NlInfoExtension)}))}defineCustomElement$k();const nlLoadingCss=baseCss,NlLoadingStyle0=nlLoadingCss,NlLoading=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.stopFetchHandler=createEvent$1(this,"stopFetchHandler"),this.handleContinue=createEvent$1(this,"handleContinue"),this.path=void 0}handleStop(e){e.preventDefault(),this.stopFetchHandler.emit()}handleContinueClick(e){e.preventDefault(),this.handleContinue.emit()}render(){let e="Connecting...",t="Establishing connection to your key storage.";state.njumpIframe?(e="",t=""):this.path===CURRENT_MODULE.LOCAL_SIGNUP?(e="Creating...",t="Publishing your profile on Nostr."):state.authUrl&&(state.isLoading?(e="Confirming...",t="Please confirm the connection in your key storage app."):(e="Almost ready!",t="Continue to confirm the connection to your key storage."));const n=this.path!==CURRENT_MODULE.LOCAL_SIGNUP,o=!state.isLoading&&state.iframeUrl&&state.authUrl,r=state.iframeUrl?`${state.iframeUrl}?connect=${encodeURIComponent(state.authUrl)}`:"";return h("div",{key:"db647721e5ca60eed1502bf784f11973106938ff",class:"p-4 overflow-y-auto"},e&&h("h1",{key:"605d32178383840ea53a3fc16c2d760dccea0812",class:"nl-title font-bold text-center text-4xl"},e),t&&h("p",{key:"8dc819ba9544242ef05256a12f866cd88b3603cf",class:"nl-description font-light text-center text-lg pt-2 max-w-96 mx-auto"},t),!state.njumpIframe&&!state.authUrl&&state.isLoading&&h("div",{key:"f392c2a856018c4d35b01a76b77f0eec8342fb86",class:"mt-10 mb-10 ml-auto mr-auto w-20"},h("span",{key:"90541216f412c9c8d77be8988c6f9e5b654ce115",slot:"icon-start",class:"animate-spin-loading ml-auto mr-auto inline-block w-20 h-20 border-[4px] border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"})),h("div",{key:"a870a4e31048a13f400970aad850e7eab418ef06",class:"ps-4 pe-4 overflow-y-auto"},h("p",{key:"5bf2c4a5b94a4dfe1331a2fa5fb11ea4d414f353",class:"nl-error font-light text-center text-sm max-w-96 mx-auto"},state.error)),r&&h("div",{key:"854f1920def8e2354801a819f9e564ae1658e34b",class:"mt-3 ml-auto mr-auto w-72 flex justify-center"},h("iframe",{key:"a5056dbe483013c20515b8c6576af60f612e132b",src:r,width:"180px",height:"80px",style:{display:o?"block":"none",border:"0"}})),state.njumpIframe&&h("div",{key:"848d0c6cf74610b8793ade84a5c1f32fd5944b62",class:"mt-3 ml-auto mr-auto flex justify-center"},h("iframe",{key:"456702bd5c9e9b290d532aef0ec245e1212ea79f",srcdoc:state.njumpIframe,width:"600px",style:{border:"0",height:"80vh",borderRadius:"8px"}})),n&&h("div",{key:"d7b82c1fd76a8cf4edf38d2cbe2386e2ce698a81",class:"mt-3 ml-auto mr-auto w-72"},h("button-base",{key:"8465e32b53c4b86e3b1b488fddcc5937a018768f",onClick:e=>{state.authUrl&&!state.isLoading?this.handleContinueClick(e):this.handleStop(e)},titleBtn:state.isLoading?"Cancel":"Continue"})))}static get style(){return NlLoadingStyle0}},[0,"nl-loading",{path:[1]}]);function defineCustomElement$j(){if("undefined"==typeof customElements)return;["nl-loading","button-base"].forEach((e=>{switch(e){case"nl-loading":customElements.get(e)||customElements.define(e,NlLoading);break;case"button-base":customElements.get(e)||defineCustomElement$s()}}))}defineCustomElement$j();const nlLocalSignupCss=baseCss,NlLocalSignupStyle0=nlLocalSignupCss,NlLocalSignup=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlLocalSignup=createEvent$1(this,"nlLocalSignup"),this.nlSignupNjump=createEvent$1(this,"nlSignupNjump"),this.fetchHandler=createEvent$1(this,"fetchHandler"),this.titleSignup="Create Nostr profile",this.description="Choose any username, you can always change it later.",this.descriptionNjump="Proceed to creating your Nostr profile in a new tab.",this.signupNjump=!1,this.isAvailable=!1}handleInputChange(e){state.nlSignup.signupName=e.target.value}handleCreateAccount(e){e.preventDefault(),this.signupNjump?this.nlSignupNjump.emit():this.nlLocalSignup.emit(`${state.nlSignup.signupName}`)}render(){return h(Fragment,{key:"4e2e1cb4e43c985fbcc79af1b085389a38c2805d"},h("div",{key:"ed3e90f3eeef7d1354b6e36d8f29c7348176b989",class:"p-4 overflow-y-auto"},h("h1",{key:"8b47eb2e2221b61d8b75e297ae9b954cd2a0ef89",class:"nl-title font-bold text-center text-2xl"},this.titleSignup),h("p",{key:"af517d0c92652d1e4fd14f57bf593eb1510865e7",class:"nl-description font-light text-center text-sm pt-2 max-w-96 mx-auto"},this.signupNjump?this.descriptionNjump:this.description)),h("div",{key:"54dd6ee361785bf45b760333104dc946a5a8f941",class:"max-w-72 mx-auto"},!this.signupNjump&&h("div",{key:"af4d8a26c1da84d2a07f1086c69b9776b361d484",class:"relative mb-2"},h("input",{key:"dc30806eefb1b2210e4960401de95578256becbd",onInput:e=>this.handleInputChange(e),type:"text",class:"nl-input peer py-3 px-4 ps-11 block w-full border-transparent rounded-lg text-sm disabled:opacity-50 disabled:pointer-events-none dark:border-transparent",placeholder:"Enter username",value:state.nlSignup.signupName}),h("div",{key:"64cfe0fe240b2e04216485915b3e6f034c5d0229",class:"absolute inset-y-0 start-0 flex items-center pointer-events-none ps-4 peer-disabled:opacity-50 peer-disabled:pointer-events-none"},h("svg",{key:"434077af1de7ee510325e84b64bc02981b039792",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:this.isAvailable?"#00cc00":"currentColor",class:"flex-shrink-0 w-4 h-4 text-gray-500"},h("path",{key:"5f9aae2d279fd8807b1798518f33da878e30f8ff","stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"})))),h("div",{key:"39115be409b0cc01e098e05fdeb370e15673f8e1",class:"ps-4 pe-4 overflow-y-auto"},h("p",{key:"cd7556b84e69f372b6aa9c834794e5bded78c228",class:"nl-error font-light text-center text-sm max-w-96 mx-auto"},state.error)),h("button-base",{key:"d29de7bb01cf5fb0b3ba76b9cf52aa846e3db638",disabled:state.isLoading,onClick:e=>this.handleCreateAccount(e),titleBtn:this.signupNjump?"Get started":"Create profile"},state.isLoading?h("span",{slot:"icon-start",class:"animate-spin-loading inline-block w-4 h-4 border-[3px] border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"}):h("svg",{slot:"icon-start",style:{display:"none"},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M18 7.5v3m0 0v3m0-3h3m-3 0h-3m-2.25-4.125a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0ZM3 19.235v-.11a6.375 6.375 0 0 1 12.75 0v.109A12.318 12.318 0 0 1 9.374 21c-2.331 0-4.512-.645-6.374-1.766Z"})))))}static get style(){return NlLocalSignupStyle0}},[0,"nl-local-signup",{titleSignup:[1,"title-signup"],description:[1],descriptionNjump:[1,"description-njump"],signupNjump:[4,"signup-njump"],isAvailable:[32]}]);function defineCustomElement$i(){if("undefined"==typeof customElements)return;["nl-local-signup","button-base"].forEach((e=>{switch(e){case"nl-local-signup":customElements.get(e)||customElements.define(e,NlLocalSignup);break;case"button-base":customElements.get(e)||defineCustomElement$s()}}))}defineCustomElement$i();const NlLoginStatus=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.info=void 0}render(){let e="",t="";if("extension"===this.info.authMethod)e="Extension",t="border-yellow-300 text-yellow-500 bg-yellow-100";else if("readOnly"===this.info.authMethod)e="Read only",t="border-gray-300 text-gray-400 bg-gray-100";else if("connect"===this.info.authMethod)e="Connect",t="border-teal-300 text-teal-600 bg-teal-100";else if("local"===this.info.authMethod)e="Temporary",t="border-red-300 text-red-600 bg-red-100";else{if("otp"!==this.info.authMethod)throw console.log("unknown auth method",this.info),new Error("Unknown auth method");e="Delegated",t="border-orange-300 text-orange-600 bg-orange-100"}return h("div",{key:"8b5236e4bc47388d9e55ff92b3c5837bd77833d6"},h("span",{key:"066cb55933afc54e17831a3fe4c6fbc4b66aec15",class:`${t} rounded-xl border w-auto text-[10px] px-1 `},e))}},[0,"nl-login-status",{info:[16]}]);function defineCustomElement$h(){if("undefined"==typeof customElements)return;["nl-login-status"].forEach((e=>{if("nl-login-status"===e)customElements.get(e)||customElements.define(e,NlLoginStatus)}))}defineCustomElement$h();const nlOtpMigrateCss=baseCss,NlOtpMigrateStyle0=nlOtpMigrateCss,NlImportFlow=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlImportAccount=createEvent$1(this,"nlImportAccount"),this.titleInfo="Import keys to storage service",this.titleImport="Choose a service",this.textImport="You will be prompted to import keys to the chosen service, and this website will connect to your keys.",this.services=[]}handleDomainSelect(e){const t=this.services.find((t=>t.domain===e.detail));state.nlImport=t}handleCreateAccount(e){e.preventDefault(),this.nlImportAccount.emit(state.nlImport)}render(){const e=this.services.filter((e=>e.canImport)).map((e=>({name:e.domain,value:e.domain})));return h(Fragment,{key:"12693d07250ca52865a5a04d454e11e43b651e13"},h("div",{key:"1fa49c196cfb54cc7da20925dc61490d3cea4f1d",class:"p-4 overflow-y-auto"},h("h1",{key:"ff29ef7de0954e75bf17ee260eea556ba364ecdd",class:"nl-title font-bold text-center text-2xl"},this.titleImport),h("p",{key:"626e164f92be79d655384e631c982bc4e06fdbfc",class:"nl-description font-light text-center text-sm pt-2 max-w-96 mx-auto"},this.textImport)),h("div",{key:"7d3b75101d0531c41a7bfcbb5ece1ffa67821810",class:"max-w-72 mx-auto mb-5"},h("div",{key:"7a11b1c4668f0172ce4535fe0c4931221b147509",class:"mb-0.5"},h("nl-select",{key:"1c7dbbd077d06f19745f2c53d1100b74e5498a17",onSelectDomain:e=>this.handleDomainSelect(e),selected:0,options:e})),h("p",{key:"da6a4528697951de8b31b4697ba9b19d71b33b4f",class:"nl-title font-light text-sm mb-2"},"Default provider is a fine choice to start with."),h("div",{key:"a57b965e8ad521ab36d81d8962a723ddfa735757",class:"ps-4 pe-4 overflow-y-auto"},h("p",{key:"cb748be936c8204d67b1fa49fe2f2f8ed11cb604",class:"nl-error font-light text-center text-sm max-w-96 mx-auto"},state.error)),h("button-base",{key:"dd31a190750a945c5a4f71830e8177bd7172a7bc",disabled:state.isLoading,onClick:e=>this.handleCreateAccount(e),titleBtn:"Start importing"},state.isLoading?h("span",{slot:"icon-start",class:"animate-spin-loading inline-block w-4 h-4 border-[3px] border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"}):h("svg",{slot:"icon-start",style:{display:"none"},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M18 7.5v3m0 0v3m0-3h3m-3 0h-3m-2.25-4.125a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0ZM3 19.235v-.11a6.375 6.375 0 0 1 12.75 0v.109A12.318 12.318 0 0 1 9.374 21c-2.331 0-4.512-.645-6.374-1.766Z"})))))}static get style(){return NlOtpMigrateStyle0}},[0,"nl-otp-migrate",{titleInfo:[1025,"title-info"],titleImport:[1,"title-import"],textImport:[1,"text-import"],services:[16]}]);function defineCustomElement$g(){if("undefined"==typeof customElements)return;["nl-otp-migrate","button-base","nl-select"].forEach((e=>{switch(e){case"nl-otp-migrate":customElements.get(e)||customElements.define(e,NlImportFlow);break;case"button-base":customElements.get(e)||defineCustomElement$s();break;case"nl-select":customElements.get(e)||defineCustomElement$n()}}))}defineCustomElement$g();const nlPreviouslyLoggedCss=baseCss,NlPreviouslyLoggedStyle0=nlPreviouslyLoggedCss,NlPreviouslyLogged=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlSwitchAccount=createEvent$1(this,"nlSwitchAccount"),this.nlLoginRecentAccount=createEvent$1(this,"nlLoginRecentAccount"),this.nlRemoveRecent=createEvent$1(this,"nlRemoveRecent"),this.titlePage="Your profiles",this.description="Switch between active profiles or choose a recent one for fast login.",this.accounts=[],this.recents=[]}handleGoToWelcome(){state.path=[CURRENT_MODULE.WELCOME]}switchToWelcomeIfEmpty(){this.recents.length||this.accounts.length||(state.path=[CURRENT_MODULE.WELCOME])}watchAccounts(){this.switchToWelcomeIfEmpty()}watchRecents(){this.switchToWelcomeIfEmpty()}handleRemoveRecent(e){this.nlRemoveRecent.emit(e)}handleSwitch(e){this.nlSwitchAccount.emit(e)}handleLoginRecentAccount(e){this.nlLoginRecentAccount.emit(e)}render(){return h(Fragment,{key:"433be12e7eb9f18f10afa828a53920c85410940c"},h("div",{key:"080f439a9910e8fe8217a914d04e2a2cc8ca97ad",class:"p-4 pt-0 overflow-y-auto"},h("h1",{key:"332f960bc2b1727277dade6d5236f41f9a81116c",class:"nl-title font-bold text-center text-4xl"},this.titlePage),h("p",{key:"2a1fb42c969f6266eb782d3f4f01a935ff88d779",class:"nl-description font-light text-center text-lg pt-2 max-w-96 mx-auto"},this.description)),h("div",{key:"679d3e53e352631f704c997c8ec206d122e4f8a6",class:"p-4"},Boolean(this.accounts.length)&&h("div",{key:"4f2d266c86cc05c5030c432eeb8611f12ccfe52b",class:"max-w-96 mx-auto"},h("p",{key:"94baf6a179142c0f3d6e0f15d2d98be35ee4cbcc",class:"nl-description font-medium text-sm pb-1.5"},"Active profiles"),h("ul",{key:"5d7971661fbb7e6cc992df82f73639d9d1b5c69d",class:"p-2 rounded-lg border border-blue-200 flex flex-col w-full gap-0.5"},this.accounts.map((e=>{const t=Boolean(null==e?void 0:e.picture),n=e.name||e.nip05||e.pubkey,o=Boolean(n);return h("li",{onClick:()=>this.handleSwitch(e),class:"group hover:bg-gray-400 flex cursor-pointer gap-x-3.5 py-2 px-3 rounded-lg text-sm items-center justify-between"},h("div",{class:"flex items-center gap-x-3.5 w-full"},h("div",{class:"w-full max-w-7 h-7 flex relative"},h("div",{class:"absolute top-[-2px] right-[-2px] bg-white border-2 border-white rounded-xl"},h("div",{class:"active h-1.5 w-1.5 bg-green-500 rounded-xl"})),h("div",{class:"group-hover:border-blue-400 uppercase font-bold w-full h-full rounded-full border border-gray-400 flex justify-center items-center"},t?h("img",{class:"w-full rounded-full",src:e.picture,alt:"Logo"}):o?n[0]:h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})))),h("div",{class:"overflow-hidden flex flex-col w-full"},h("div",{class:"nl-title truncate overflow-hidden"},n),h("nl-login-status",{info:e}))))})))),Boolean(this.recents.length)&&h("div",{key:"c66d7eda3b667f736052dc27709a343ddb74b54a",class:"max-w-96 mx-auto pt-5"},h("p",{key:"d31c7a93df4b7583cb00b4e0d55c1118adae0b32",class:"nl-description font-medium text-sm pb-1.5"},"Recent profiles"),h("ul",{key:"c03f0135c7e3dc4fe5db91aeff7cb8e1ccd436b6",class:"p-2 rounded-lg border border-gray-200 flex flex-col w-full gap-0.5"},this.recents.map((e=>{const t=Boolean(null==e?void 0:e.picture),n=e.name||e.nip05||e.pubkey,o=Boolean(n);return h("li",{onClick:()=>this.handleLoginRecentAccount(e),class:"flex items-center gap-x-3.5 w-full hover:bg-gray-400 flex cursor-pointer items-center gap-x-3.5 py-2 px-3 rounded-lg text-sm justify-between"},h("div",{class:"w-full max-w-7 h-7 flex relative"},h("div",{class:"absolute top-[-3px] right-[-3px] bg-white border border-white rounded-xl"},h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-3 h-3"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))),h("div",{class:"uppercase font-bold w-full h-full rounded-full border border-gray-400 flex justify-center items-center"},t?h("img",{class:"w-full rounded-full",src:e.picture,alt:"Logo"}):o?n[0]:h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})))),h("div",{class:"overflow-hidden flex flex-col w-full"},h("div",{class:"nl-title truncate overflow-hidden"},n),h("nl-login-status",{info:e})),h("svg",{onClick:t=>{t.stopPropagation(),this.handleRemoveRecent(e)},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full max-w-6 h-6 text-red-500 hover:text-red-600 ml-auto"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"})))}))))),h("div",{key:"bf85231e1b0cd2a3490564507ec9f41e9277a64f",class:"p-4 overflow-y-auto"},h("p",{key:"c88a893c3833de4ad97637abd10507b76921c0c5",class:"nl-footer font-light text-center text-sm max-w-96 mx-auto"},"You can also"," ",h("span",{key:"767425be179794ec16efe01c66f11d01954c70df",onClick:()=>this.handleGoToWelcome(),class:"cursor-pointer pb-3 text-blue-500"},"add another profile"))))}static get watchers(){return{accounts:["watchAccounts"],recents:["watchRecents"]}}static get style(){return NlPreviouslyLoggedStyle0}},[0,"nl-previously-logged",{titlePage:[1,"title-page"],description:[1],accounts:[16],recents:[16]},void 0,{accounts:["watchAccounts"],recents:["watchRecents"]}]);function defineCustomElement$f(){if("undefined"==typeof customElements)return;["nl-previously-logged","nl-login-status"].forEach((e=>{switch(e){case"nl-previously-logged":customElements.get(e)||customElements.define(e,NlPreviouslyLogged);break;case"nl-login-status":customElements.get(e)||defineCustomElement$h()}}))}defineCustomElement$f();const nlSigninCss=baseCss,NlSigninStyle0=nlSigninCss,NlSignin=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlLogin=createEvent$1(this,"nlLogin"),this.nlCheckLogin=createEvent$1(this,"nlCheckLogin"),this.titleLogin="Connect to key store",this.description="Please enter your user name.",this.isGood=!1}handleInputChange(e){state.nlSignin.loginName=e.target.value,this.nlCheckLogin.emit(e.target.value)}handleLogin(e){e.preventDefault(),this.nlLogin.emit(state.nlSignin.loginName)}render(){return h(Fragment,{key:"a498d75f074f6df3cda28a845c783cbd8568747a"},h("div",{key:"32c20383fd595cd977c5163f14806fd1dcdab210",class:"p-4 overflow-y-auto"},h("h1",{key:"4a0d7b438e34497072df509f8b7196342f30964c",class:"nl-title font-bold text-center text-2xl"},this.titleLogin),h("p",{key:"1a48de557c4544eb38c9c826848171cdcebead9f",class:"nl-description font-light text-center text-sm pt-2 max-w-96 mx-auto"},this.description)),h("div",{key:"9c74d29c7f007f2dd3e795cfb3fbc3bccd03549a",class:"max-w-72 mx-auto"},h("div",{key:"97d4c6367bfa6bf581a3bb4283ee6d8958cbc7c6",class:"relative mb-2"},h("input",{key:"5b5ba0b7268576680f40508cfd2f6fa771cd1acd",onInput:e=>this.handleInputChange(e),type:"text",class:"nl-input peer py-3 px-4 ps-11 block w-full border-transparent rounded-lg text-sm disabled:opacity-50 disabled:pointer-events-none dark:border-transparent",placeholder:"name@domain.com",value:state.nlSignin.loginName}),h("div",{key:"971b0e66f94f20fa3406786e8f6fc66e858b82aa",class:"absolute inset-y-0 start-0 flex items-center pointer-events-none ps-4 peer-disabled:opacity-50 peer-disabled:pointer-events-none"},h("svg",{key:"e267ffa5f7a5cf560732da01645f771c24555927",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:this.isGood?"#00cc00":"currentColor",class:"flex-shrink-0 w-4 h-4 text-gray-500"},h("path",{key:"c694ee22fe4198b58f0d750cea98a34cf2a9bc14","stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"})))),h("div",{key:"41828dc382da40b4a7b11dc094d20f4913480a8a",class:"ps-4 pe-4 overflow-y-auto"},h("p",{key:"b619b41116fc3d6ae33363dd1be6ac67f3521f14",class:"nl-error font-light text-center text-sm max-w-96 mx-auto"},state.error)),h("button-base",{key:"81797cde8acbaf0aeeb204aa07885ba27f27c08d",titleBtn:"Connect",disabled:state.isLoading,onClick:e=>this.handleLogin(e)},state.isLoading?h("span",{slot:"icon-start",class:"animate-spin-loading inline-block w-4 h-4 border-[3px] border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"}):h("svg",{style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 9V5.25A2.25 2.25 0 0 1 10.5 3h6a2.25 2.25 0 0 1 2.25 2.25v13.5A2.25 2.25 0 0 1 16.5 21h-6a2.25 2.25 0 0 1-2.25-2.25V15M12 9l3 3m0 0-3 3m3-3H2.25"})))))}static get style(){return NlSigninStyle0}},[0,"nl-signin",{titleLogin:[1,"title-login"],description:[1],isGood:[32]}]);function defineCustomElement$e(){if("undefined"==typeof customElements)return;["nl-signin","button-base"].forEach((e=>{switch(e){case"nl-signin":customElements.get(e)||customElements.define(e,NlSignin);break;case"button-base":customElements.get(e)||defineCustomElement$s()}}))}defineCustomElement$e();class e{constructor(t,n,o,r,s){this._legacyCanvasSize=e.DEFAULT_CANVAS_SIZE,this._preferredCamera="environment",this._maxScansPerSecond=25,this._lastScanTimestamp=-1,this._destroyed=this._flashOn=this._paused=this._active=!1,this.$video=t,this.$canvas=document.createElement("canvas"),o&&"object"==typeof o?this._onDecode=n:(o||r||s?console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future"):console.warn("Note that the type of the scan result passed to onDecode will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),this._legacyOnDecode=n),n="object"==typeof o?o:{},this._onDecodeError=n.onDecodeError||("function"==typeof o?o:this._onDecodeError),this._calculateScanRegion=n.calculateScanRegion||("function"==typeof r?r:this._calculateScanRegion),this._preferredCamera=n.preferredCamera||s||this._preferredCamera,this._legacyCanvasSize="number"==typeof o?o:"number"==typeof r?r:this._legacyCanvasSize,this._maxScansPerSecond=n.maxScansPerSecond||this._maxScansPerSecond,this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._updateOverlay=this._updateOverlay.bind(this),t.disablePictureInPicture=!0,t.playsInline=!0,t.muted=!0;let i=!1;if(t.hidden&&(t.hidden=!1,i=!0),document.body.contains(t)||(document.body.appendChild(t),i=!0),o=t.parentElement,n.highlightScanRegion||n.highlightCodeOutline){if(r=!!n.overlay,this.$overlay=n.overlay||document.createElement("div"),(s=this.$overlay.style).position="absolute",s.display="none",s.pointerEvents="none",this.$overlay.classList.add("scan-region-highlight"),!r&&n.highlightScanRegion){this.$overlay.innerHTML='<svg class="scan-region-highlight-svg" viewBox="0 0 238 238" preserveAspectRatio="none" style="position:absolute;width:100%;height:100%;left:0;top:0;fill:none;stroke:#e9b213;stroke-width:4;stroke-linecap:round;stroke-linejoin:round"><path d="M31 2H10a8 8 0 0 0-8 8v21M207 2h21a8 8 0 0 1 8 8v21m0 176v21a8 8 0 0 1-8 8h-21m-176 0H10a8 8 0 0 1-8-8v-21"/></svg>';try{this.$overlay.firstElementChild.animate({transform:["scale(.98)","scale(1.01)"]},{duration:400,iterations:1/0,direction:"alternate",easing:"ease-in-out"})}catch(e){}o.insertBefore(this.$overlay,this.$video.nextSibling)}n.highlightCodeOutline&&(this.$overlay.insertAdjacentHTML("beforeend",'<svg class="code-outline-highlight" preserveAspectRatio="none" style="display:none;width:100%;height:100%;fill:none;stroke:#e9b213;stroke-width:5;stroke-dasharray:25;stroke-linecap:round;stroke-linejoin:round"><polygon/></svg>'),this.$codeOutlineHighlight=this.$overlay.lastElementChild)}this._scanRegion=this._calculateScanRegion(t),requestAnimationFrame((()=>{let e=window.getComputedStyle(t);"none"===e.display&&(t.style.setProperty("display","block","important"),i=!0),"visible"!==e.visibility&&(t.style.setProperty("visibility","visible","important"),i=!0),i&&(console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."),t.style.opacity="0",t.style.width="0",t.style.height="0",this.$overlay&&this.$overlay.parentElement&&this.$overlay.parentElement.removeChild(this.$overlay),delete this.$overlay,delete this.$codeOutlineHighlight),this.$overlay&&this._updateOverlay()})),t.addEventListener("play",this._onPlay),t.addEventListener("loadedmetadata",this._onLoadedMetaData),document.addEventListener("visibilitychange",this._onVisibilityChange),window.addEventListener("resize",this._updateOverlay),this._qrEnginePromise=e.createQrEngine()}static set WORKER_PATH(e){console.warn("Setting QrScanner.WORKER_PATH is not required and not supported anymore. Have a look at the README for new setup instructions.")}static async hasCamera(){try{return!!(await e.listCameras(!1)).length}catch(e){return!1}}static async listCameras(t=!1){if(!navigator.mediaDevices)return[];let n,o=async()=>(await navigator.mediaDevices.enumerateDevices()).filter((e=>"videoinput"===e.kind));try{t&&(await o()).every((e=>!e.label))&&(n=await navigator.mediaDevices.getUserMedia({audio:!1,video:!0}))}catch(e){}try{return(await o()).map(((e,t)=>({id:e.deviceId,label:e.label||(0===t?"Default Camera":`Camera ${t+1}`)})))}finally{n&&(console.warn("Call listCameras after successfully starting a QR scanner to avoid creating a temporary video stream"),e._stopVideoStream(n))}}async hasFlash(){let t;try{if(this.$video.srcObject){if(!(this.$video.srcObject instanceof MediaStream))return!1;t=this.$video.srcObject}else t=(await this._getCameraStream()).stream;return"torch"in t.getVideoTracks()[0].getSettings()}catch(e){return!1}finally{t&&t!==this.$video.srcObject&&(console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),e._stopVideoStream(t))}}isFlashOn(){return this._flashOn}async toggleFlash(){this._flashOn?await this.turnFlashOff():await this.turnFlashOn()}async turnFlashOn(){if(!this._flashOn&&!this._destroyed&&(this._flashOn=!0,this._active&&!this._paused))try{if(!await this.hasFlash())throw"No flash available";await this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]})}catch(e){throw this._flashOn=!1,e}}async turnFlashOff(){this._flashOn&&(this._flashOn=!1,await this._restartVideoStream())}destroy(){this.$video.removeEventListener("loadedmetadata",this._onLoadedMetaData),this.$video.removeEventListener("play",this._onPlay),document.removeEventListener("visibilitychange",this._onVisibilityChange),window.removeEventListener("resize",this._updateOverlay),this._destroyed=!0,this._flashOn=!1,this.stop(),e._postWorkerMessage(this._qrEnginePromise,"close")}async start(){if(this._destroyed)throw Error("The QR scanner can not be started as it had been destroyed.");if((!this._active||this._paused)&&("https:"!==window.location.protocol&&console.warn("The camera stream is only accessible if the page is transferred via https."),this._active=!0,!document.hidden))if(this._paused=!1,this.$video.srcObject)await this.$video.play();else try{let{stream:t,facingMode:n}=await this._getCameraStream();!this._active||this._paused?e._stopVideoStream(t):(this._setVideoMirror(n),this.$video.srcObject=t,await this.$video.play(),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch((()=>{}))))}catch(e){if(!this._paused)throw this._active=!1,e}}stop(){this.pause(),this._active=!1}async pause(t=!1){if(this._paused=!0,!this._active)return!0;this.$video.pause(),this.$overlay&&(this.$overlay.style.display="none");let n=()=>{this.$video.srcObject instanceof MediaStream&&(e._stopVideoStream(this.$video.srcObject),this.$video.srcObject=null)};return t?(n(),!0):(await new Promise((e=>setTimeout(e,300))),!!this._paused&&(n(),!0))}async setCamera(e){e!==this._preferredCamera&&(this._preferredCamera=e,await this._restartVideoStream())}static async scanImage(t,n,o,r,s=!1,i=!1){let a,c=!1;n&&("scanRegion"in n||"qrEngine"in n||"canvas"in n||"disallowCanvasResizing"in n||"alsoTryWithoutScanRegion"in n||"returnDetailedScanResult"in n)?(a=n.scanRegion,o=n.qrEngine,r=n.canvas,s=n.disallowCanvasResizing||!1,i=n.alsoTryWithoutScanRegion||!1,c=!0):n||o||r||s||i?console.warn("You're using a deprecated api for scanImage which will be removed in the future."):console.warn("Note that the return type of scanImage will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),n=!!o;try{let l,d,h;if([o,l]=await Promise.all([o||e.createQrEngine(),e._loadImage(t)]),[r,d]=e._drawToCanvas(l,a,r,s),o instanceof Worker){let t=o;n||e._postWorkerMessageSync(t,"inversionMode","both"),h=await new Promise(((n,o)=>{let s,i,c,l=-1;i=r=>{r.data.id===l&&(t.removeEventListener("message",i),t.removeEventListener("error",c),clearTimeout(s),null!==r.data.data?n({data:r.data.data,cornerPoints:e._convertPoints(r.data.cornerPoints,a)}):o(e.NO_QR_CODE_FOUND))},c=e=>{t.removeEventListener("message",i),t.removeEventListener("error",c),clearTimeout(s),o("Scanner error: "+(e?e.message||e:"Unknown Error"))},t.addEventListener("message",i),t.addEventListener("error",c),s=setTimeout((()=>c("timeout")),1e4);let h=d.getImageData(0,0,r.width,r.height);l=e._postWorkerMessageSync(t,"decode",h,[h.data.buffer])}))}else h=await Promise.race([new Promise(((e,t)=>window.setTimeout((()=>t("Scanner error: timeout")),1e4))),(async()=>{try{var[n]=await o.detect(r);if(!n)throw e.NO_QR_CODE_FOUND;return{data:n.rawValue,cornerPoints:e._convertPoints(n.cornerPoints,a)}}catch(o){if(n=o.message||o,/not implemented|service unavailable/.test(n))return e._disableBarcodeDetector=!0,e.scanImage(t,{scanRegion:a,canvas:r,disallowCanvasResizing:s,alsoTryWithoutScanRegion:i});throw`Scanner error: ${n}`}})()]);return c?h:h.data}catch(n){if(!a||!i)throw n;let l=await e.scanImage(t,{qrEngine:o,canvas:r,disallowCanvasResizing:s});return c?l:l.data}finally{n||e._postWorkerMessage(o,"close")}}setGrayscaleWeights(t,n,o,r=!0){e._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:t,green:n,blue:o,useIntegerApproximation:r})}setInversionMode(t){e._postWorkerMessage(this._qrEnginePromise,"inversionMode",t)}static async createQrEngine(t){if(t&&console.warn("Specifying a worker path is not required and not supported anymore."),t=()=>Promise.resolve().then((function(){return qrScannerWorker_min})).then((e=>e.createWorker())),e._disableBarcodeDetector||!("BarcodeDetector"in window)||!BarcodeDetector.getSupportedFormats||!(await BarcodeDetector.getSupportedFormats()).includes("qr_code"))return t();let n=navigator.userAgentData;return n&&n.brands.some((({brand:e})=>/Chromium/i.test(e)))&&/mac ?OS/i.test(n.platform)&&await n.getHighEntropyValues(["architecture","platformVersion"]).then((({architecture:e,platformVersion:t})=>/arm/i.test(e||"arm")&&13<=parseInt(t||"13"))).catch((()=>!0))?t():new BarcodeDetector({formats:["qr_code"]})}_onPlay(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay(),this.$overlay&&(this.$overlay.style.display=""),this._scanFrame()}_onLoadedMetaData(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay()}_onVisibilityChange(){document.hidden?this.pause():this._active&&this.start()}_calculateScanRegion(e){let t=Math.round(2/3*Math.min(e.videoWidth,e.videoHeight));return{x:Math.round((e.videoWidth-t)/2),y:Math.round((e.videoHeight-t)/2),width:t,height:t,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}_updateOverlay(){requestAnimationFrame((()=>{if(this.$overlay){var e=this.$video,t=e.videoWidth,n=e.videoHeight,o=e.offsetWidth,r=e.offsetHeight,s=e.offsetLeft,i=e.offsetTop,a=window.getComputedStyle(e),c=a.objectFit,l=t/n,d=o/r;switch(c){case"none":var h=t,u=n;break;case"fill":h=o,u=r;break;default:("cover"===c?l>d:l<d)?h=(u=r)*l:u=(h=o)/l,"scale-down"===c&&(h=Math.min(h,t),u=Math.min(u,n))}var[f,p]=a.objectPosition.split(" ").map(((e,t)=>{const n=parseFloat(e);return e.endsWith("%")?(t?r-u:o-h)*n/100:n}));a=this._scanRegion.width||t,d=this._scanRegion.height||n,c=this._scanRegion.x||0;var g=this._scanRegion.y||0;(l=this.$overlay.style).width=a/t*h+"px",l.height=d/n*u+"px",l.top=`${i+p+g/n*u}px`,n=/scaleX\(-1\)/.test(e.style.transform),l.left=`${s+(n?o-f-h:f)+(n?t-c-a:c)/t*h}px`,l.transform=e.style.transform}}))}static _convertPoints(e,t){if(!t)return e;let n=t.x||0,o=t.y||0,r=t.width&&t.downScaledWidth?t.width/t.downScaledWidth:1;t=t.height&&t.downScaledHeight?t.height/t.downScaledHeight:1;for(let s of e)s.x=s.x*r+n,s.y=s.y*t+o;return e}_scanFrame(){!this._active||this.$video.paused||this.$video.ended||("requestVideoFrameCallback"in this.$video?this.$video.requestVideoFrameCallback.bind(this.$video):requestAnimationFrame)((async()=>{if(!(1>=this.$video.readyState)){var t=Date.now()-this._lastScanTimestamp,n=1e3/this._maxScansPerSecond;t<n&&await new Promise((e=>setTimeout(e,n-t))),this._lastScanTimestamp=Date.now();try{var o=await e.scanImage(this.$video,{scanRegion:this._scanRegion,qrEngine:this._qrEnginePromise,canvas:this.$canvas})}catch(e){if(!this._active)return;this._onDecodeError(e)}!e._disableBarcodeDetector||await this._qrEnginePromise instanceof Worker||(this._qrEnginePromise=e.createQrEngine()),o?(this._onDecode?this._onDecode(o):this._legacyOnDecode&&this._legacyOnDecode(o.data),this.$codeOutlineHighlight&&(clearTimeout(this._codeOutlineHighlightRemovalTimeout),this._codeOutlineHighlightRemovalTimeout=void 0,this.$codeOutlineHighlight.setAttribute("viewBox",`${this._scanRegion.x||0} ${this._scanRegion.y||0} ${this._scanRegion.width||this.$video.videoWidth} ${this._scanRegion.height||this.$video.videoHeight}`),this.$codeOutlineHighlight.firstElementChild.setAttribute("points",o.cornerPoints.map((({x:e,y:t})=>`${e},${t}`)).join(" ")),this.$codeOutlineHighlight.style.display="")):this.$codeOutlineHighlight&&!this._codeOutlineHighlightRemovalTimeout&&(this._codeOutlineHighlightRemovalTimeout=setTimeout((()=>this.$codeOutlineHighlight.style.display="none"),100))}this._scanFrame()}))}_onDecodeError(t){t!==e.NO_QR_CODE_FOUND&&console.log(t)}async _getCameraStream(){if(!navigator.mediaDevices)throw"Camera not found.";let e=/^(environment|user)$/.test(this._preferredCamera)?"facingMode":"deviceId",t=[{width:{min:1024}},{width:{min:768}},{}],n=t.map((t=>Object.assign({},t,{[e]:{exact:this._preferredCamera}})));for(let e of[...n,...t])try{let t=await navigator.mediaDevices.getUserMedia({video:e,audio:!1});return{stream:t,facingMode:this._getFacingMode(t)||(e.facingMode?this._preferredCamera:"environment"===this._preferredCamera?"user":"environment")}}catch(e){}throw"Camera not found."}async _restartVideoStream(){let e=this._paused;await this.pause(!0)&&!e&&this._active&&await this.start()}static _stopVideoStream(e){for(let t of e.getTracks())t.stop(),e.removeTrack(t)}_setVideoMirror(e){this.$video.style.transform="scaleX("+("user"===e?-1:1)+")"}_getFacingMode(e){return(e=e.getVideoTracks()[0])?/rear|back|environment/i.test(e.label)?"environment":/front|user|face/i.test(e.label)?"user":null:null}static _drawToCanvas(e,t,n,o=!1){n=n||document.createElement("canvas");let r=t&&t.x?t.x:0,s=t&&t.y?t.y:0,i=t&&t.width?t.width:e.videoWidth||e.width,a=t&&t.height?t.height:e.videoHeight||e.height;return o||(o=t&&t.downScaledWidth?t.downScaledWidth:i,t=t&&t.downScaledHeight?t.downScaledHeight:a,n.width!==o&&(n.width=o),n.height!==t&&(n.height=t)),(t=n.getContext("2d",{alpha:!1})).imageSmoothingEnabled=!1,t.drawImage(e,r,s,i,a,0,0,n.width,n.height),[n,t]}static async _loadImage(t){if(t instanceof Image)return await e._awaitImageLoad(t),t;if(t instanceof HTMLVideoElement||t instanceof HTMLCanvasElement||t instanceof SVGImageElement||"OffscreenCanvas"in window&&t instanceof OffscreenCanvas||"ImageBitmap"in window&&t instanceof ImageBitmap)return t;if(!(t instanceof File||t instanceof Blob||t instanceof URL||"string"==typeof t))throw"Unsupported image type.";{let n=new Image;n.src=t instanceof File||t instanceof Blob?URL.createObjectURL(t):t.toString();try{return await e._awaitImageLoad(n),n}finally{(t instanceof File||t instanceof Blob)&&URL.revokeObjectURL(n.src)}}}static async _awaitImageLoad(e){e.complete&&0!==e.naturalWidth||await new Promise(((t,n)=>{let o=r=>{e.removeEventListener("load",o),e.removeEventListener("error",o),r instanceof ErrorEvent?n("Image load error"):t()};e.addEventListener("load",o),e.addEventListener("error",o)}))}static async _postWorkerMessage(t,n,o,r){return e._postWorkerMessageSync(await t,n,o,r)}static _postWorkerMessageSync(t,n,o,r){if(!(t instanceof Worker))return-1;let s=e._workerMessageId++;return t.postMessage({id:s,type:n,data:o},r),s}}e.DEFAULT_CANVAS_SIZE=400,e.NO_QR_CODE_FOUND="No QR code found",e._disableBarcodeDetector=!1,e._workerMessageId=0;const nlSigninBunkerUrlCss=baseCss,NlSigninBunkerUrlStyle0=nlSigninBunkerUrlCss,NlSigninBunkerUrl=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlLogin=createEvent$1(this,"nlLogin"),this.nlCheckLogin=createEvent$1(this,"nlCheckLogin"),this.videoEl=null,this.stream=null,this.scanInterval=null,this.titleLogin="Connect with bunker url",this.description="Please enter a bunker url provided by key store.",this.isGood=!1,this.isScanning=!1,this.scanError=""}handleInputChange(e){state.nlSigninBunkerUrl.loginName=e.target.value,this.nlCheckLogin.emit(e.target.value)}handleLogin(e){e.preventDefault(),this.nlLogin.emit(state.nlSigninBunkerUrl.loginName)}async startScan(){if(this.scanError="",this.isScanning=!0,await new Promise((e=>requestAnimationFrame((()=>requestAnimationFrame(e))))),!this.scannerContainer)return this.scanError="Camera not available",void(this.isScanning=!1);try{this.stream=await navigator.mediaDevices.getUserMedia({video:{facingMode:"environment"},audio:!1}),this.videoEl=document.createElement("video"),this.videoEl.setAttribute("playsinline",""),this.videoEl.setAttribute("autoplay",""),this.videoEl.muted=!0,this.videoEl.style.width="100%",this.videoEl.style.height="100%",this.videoEl.style.objectFit="cover",this.videoEl.style.display="block",this.videoEl.srcObject=this.stream,this.scannerContainer.appendChild(this.videoEl),await this.videoEl.play(),this.scanInterval=setInterval((async()=>{if(this.videoEl&&!(this.videoEl.readyState<2))try{const t=(await e.scanImage(this.videoEl,{returnDetailedScanResult:!0})).data;t&&(t.startsWith("bunker://")||t.startsWith("nostrconnect://"))&&(state.nlSigninBunkerUrl.loginName=t,this.nlCheckLogin.emit(t),this.stopScan())}catch(e){}}),250)}catch(e){console.error("QR Scanner error:",e),this.scanError=e instanceof Error?e.message:"Failed to access camera",this.isScanning=!1}}stopScan(){this.scanInterval&&(clearInterval(this.scanInterval),this.scanInterval=null),this.stream&&(this.stream.getTracks().forEach((e=>e.stop())),this.stream=null),this.videoEl&&(this.videoEl.srcObject=null,this.videoEl.remove(),this.videoEl=null),this.isScanning=!1}disconnectedCallback(){this.stopScan()}render(){return h(Fragment,{key:"1ee10a09c7f6782b5f89530c9331a3144f73a8ba"},h("div",{key:"68b5bef4961ddc8cf24ef98f7452d8ae5b0f6aae",class:"p-4 overflow-y-auto"},h("h1",{key:"be4da63776a4fc4f2228b22e95a1f31380e6d0f6",class:"nl-title font-bold text-center text-2xl"},this.titleLogin),h("p",{key:"d2e9c469206c4e71544416760090751dbe33cb4b",class:"nl-description font-light text-center text-sm pt-2 max-w-96 mx-auto"},this.description)),h("div",{key:"f2219e9bfc0262b5e1bfcfb3761515a26332c3d6",class:"max-w-72 mx-auto"},h("div",{key:"bd25646ec291c36aa20088108056bd6ae80f851a",class:"relative mb-2"},h("input",{key:"659665fa5c9b1247c5e81afc86a11b61e236b67a",onInput:e=>this.handleInputChange(e),type:"text",class:"nl-input peer py-3 px-4 ps-11 block w-full border-transparent rounded-lg text-sm disabled:opacity-50 disabled:pointer-events-none dark:border-transparent",placeholder:"bunker://...",value:state.nlSigninBunkerUrl.loginName}),h("div",{key:"4e0fe1bfaa82a05256a716c329ae9f8e6696b1d3",class:"absolute inset-y-0 start-0 flex items-center pointer-events-none ps-4 peer-disabled:opacity-50 peer-disabled:pointer-events-none"},h("svg",{key:"795ba20efa3fc317ccb0e91489ee7d96dc36b0e7",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:this.isGood?"#00cc00":"currentColor",class:"flex-shrink-0 w-4 h-4 text-gray-500"},h("path",{key:"0d856bf29de693b6424256da7491993692edde1b","stroke-linecap":"round","stroke-linejoin":"round",d:"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"})))),this.isScanning?h("div",{class:"mb-3"},h("div",{ref:e=>this.scannerContainer=e,class:"relative rounded-lg overflow-hidden bg-black",style:{aspectRatio:"1",width:"100%"}}),h("button",{type:"button",onClick:()=>this.stopScan(),class:"nl-action-button mt-2 w-full py-2 px-4 text-sm font-medium rounded-lg border border-transparent"},"Cancel")):h("div",{class:"mb-3"},h("button",{type:"button",onClick:()=>this.startScan(),class:"nl-action-button w-full py-2 px-4 inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent"},h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6.827 6.175A2.31 2.31 0 0 1 5.186 7.23c-.38.054-.757.112-1.134.175C2.999 7.58 2.25 8.507 2.25 9.574V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9.574c0-1.067-.75-1.994-1.802-2.169a47.865 47.865 0 0 0-1.134-.175 2.31 2.31 0 0 1-1.64-1.055l-.822-1.316a2.192 2.192 0 0 0-1.736-1.039 48.774 48.774 0 0 0-5.232 0 2.192 2.192 0 0 0-1.736 1.039l-.821 1.316Z"}),h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.5 12.75a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0ZM18.75 10.5h.008v.008h-.008V10.5Z"})),"Scan QR Code")),this.scanError&&h("div",{key:"dfc914e494b41c2381fe9f4d699632ecb4fd33c9",class:"mb-2"},h("p",{key:"043fa75931e800a25afa0d6d02de0aab7718ed4c",class:"nl-error font-light text-center text-sm"},this.scanError)),h("div",{key:"d908c3d8c8a8054ce944a47a27e3b18c8dc40ce5",class:"ps-4 pe-4 overflow-y-auto"},h("p",{key:"8293556d3e2a1f714e2a776ab69d1e1609806bbb",class:"nl-error font-light text-center text-sm max-w-96 mx-auto"},state.error)),h("button-base",{key:"305e5badc3dd35dcbadc0e1ff123eee5bb1580a6",titleBtn:"Connect",disabled:state.isLoading,onClick:e=>this.handleLogin(e)},state.isLoading?h("span",{slot:"icon-start",class:"animate-spin-loading inline-block w-4 h-4 border-[3px] border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"}):h("svg",{style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 9V5.25A2.25 2.25 0 0 1 10.5 3h6a2.25 2.25 0 0 1 2.25 2.25v13.5A2.25 2.25 0 0 1 16.5 21h-6a2.25 2.25 0 0 1-2.25-2.25V15M12 9l3 3m0 0-3 3m3-3H2.25"})))))}static get style(){return NlSigninBunkerUrlStyle0}},[0,"nl-signin-bunker-url",{titleLogin:[1,"title-login"],description:[1],isGood:[32],isScanning:[32],scanError:[32]}]);function defineCustomElement$d(){if("undefined"==typeof customElements)return;["nl-signin-bunker-url","button-base"].forEach((e=>{switch(e){case"nl-signin-bunker-url":customElements.get(e)||customElements.define(e,NlSigninBunkerUrl);break;case"button-base":customElements.get(e)||defineCustomElement$s()}}))}defineCustomElement$d();var browser={},canPromise$1=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then},qrcode={},utils$1$1={};let toSJISFunction;const CODEWORDS_COUNT=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];utils$1$1.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},utils$1$1.getSymbolTotalCodewords=function(e){return CODEWORDS_COUNT[e]},utils$1$1.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},utils$1$1.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');toSJISFunction=e},utils$1$1.isKanjiModeEnabled=function(){return void 0!==toSJISFunction},utils$1$1.toSJIS=function(e){return toSJISFunction(e)};var errorCorrectionLevel={},exports$1;function BitBuffer$1(){this.buffer=[],this.length=0}exports$1=errorCorrectionLevel,exports$1.L={bit:1},exports$1.M={bit:0},exports$1.Q={bit:3},exports$1.H={bit:2},exports$1.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},exports$1.from=function(e,t){if(exports$1.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return exports$1.L;case"m":case"medium":return exports$1.M;case"q":case"quartile":return exports$1.Q;case"h":case"high":return exports$1.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return t}},BitBuffer$1.prototype={get:function(e){const t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(let n=0;n<t;n++)this.putBit(1==(e>>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var bitBuffer=BitBuffer$1;function BitMatrix$1(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}BitMatrix$1.prototype.set=function(e,t,n,o){const r=e*this.size+t;this.data[r]=n,o&&(this.reservedBit[r]=!0)},BitMatrix$1.prototype.get=function(e,t){return this.data[e*this.size+t]},BitMatrix$1.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},BitMatrix$1.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var bitMatrix=BitMatrix$1,alignmentPattern={};!function(e){const t=utils$1$1.getSymbolSize;e.getRowColCoords=function(e){if(1===e)return[];const n=Math.floor(e/7)+2,o=t(e),r=145===o?26:2*Math.ceil((o-13)/(2*n-2)),s=[o-7];for(let e=1;e<n-1;e++)s[e]=s[e-1]-r;return s.push(6),s.reverse()},e.getPositions=function(t){const n=[],o=e.getRowColCoords(t),r=o.length;for(let e=0;e<r;e++)for(let t=0;t<r;t++)0===e&&0===t||0===e&&t===r-1||e===r-1&&0===t||n.push([o[e],o[t]]);return n}}(alignmentPattern);var finderPattern={};const getSymbolSize=utils$1$1.getSymbolSize,FINDER_PATTERN_SIZE=7;finderPattern.getPositions=function(e){const t=getSymbolSize(e);return[[0,0],[t-FINDER_PATTERN_SIZE,0],[0,t-FINDER_PATTERN_SIZE]]};var maskPattern={};!function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t=3,n=3,o=40,r=10;function s(t,n,o){switch(t){case e.Patterns.PATTERN000:return(n+o)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return o%3==0;case e.Patterns.PATTERN011:return(n+o)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(o/3))%2==0;case e.Patterns.PATTERN101:return n*o%2+n*o%3==0;case e.Patterns.PATTERN110:return(n*o%2+n*o%3)%2==0;case e.Patterns.PATTERN111:return(n*o%3+(n+o)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}}e.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){const n=e.size;let o=0,r=0,s=0,i=null,a=null;for(let c=0;c<n;c++){r=s=0,i=a=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===i?r++:(r>=5&&(o+=t+(r-5)),i=n,r=1),n=e.get(l,c),n===a?s++:(s>=5&&(o+=t+(s-5)),a=n,s=1)}r>=5&&(o+=t+(r-5)),s>=5&&(o+=t+(s-5))}return o},e.getPenaltyN2=function(e){const t=e.size;let o=0;for(let n=0;n<t-1;n++)for(let r=0;r<t-1;r++){const t=e.get(n,r)+e.get(n,r+1)+e.get(n+1,r)+e.get(n+1,r+1);4!==t&&0!==t||o++}return o*n},e.getPenaltyN3=function(e){const t=e.size;let n=0,r=0,s=0;for(let o=0;o<t;o++){r=s=0;for(let i=0;i<t;i++)r=r<<1&2047|e.get(o,i),i>=10&&(1488===r||93===r)&&n++,s=s<<1&2047|e.get(i,o),i>=10&&(1488===s||93===s)&&n++}return n*o},e.getPenaltyN4=function(e){let t=0;const n=e.data.length;for(let o=0;o<n;o++)t+=e.data[o];return Math.abs(Math.ceil(100*t/n/5)-10)*r},e.applyMask=function(e,t){const n=t.size;for(let o=0;o<n;o++)for(let r=0;r<n;r++)t.isReserved(r,o)||t.xor(r,o,s(e,r,o))},e.getBestMask=function(t,n){const o=Object.keys(e.Patterns).length;let r=0,s=1/0;for(let i=0;i<o;i++){n(i),e.applyMask(i,t);const o=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(i,t),o<s&&(s=o,r=i)}return r}}(maskPattern);var errorCorrectionCode={};const ECLevel$1=errorCorrectionLevel,EC_BLOCKS_TABLE=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],EC_CODEWORDS_TABLE=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];errorCorrectionCode.getBlocksCount=function(e,t){switch(t){case ECLevel$1.L:return EC_BLOCKS_TABLE[4*(e-1)+0];case ECLevel$1.M:return EC_BLOCKS_TABLE[4*(e-1)+1];case ECLevel$1.Q:return EC_BLOCKS_TABLE[4*(e-1)+2];case ECLevel$1.H:return EC_BLOCKS_TABLE[4*(e-1)+3];default:return}},errorCorrectionCode.getTotalCodewordsCount=function(e,t){switch(t){case ECLevel$1.L:return EC_CODEWORDS_TABLE[4*(e-1)+0];case ECLevel$1.M:return EC_CODEWORDS_TABLE[4*(e-1)+1];case ECLevel$1.Q:return EC_CODEWORDS_TABLE[4*(e-1)+2];case ECLevel$1.H:return EC_CODEWORDS_TABLE[4*(e-1)+3];default:return}};var polynomial={},galoisField={};const EXP_TABLE=new Uint8Array(512),LOG_TABLE=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)EXP_TABLE[t]=e,LOG_TABLE[e]=t,e<<=1,256&e&&(e^=285);for(let e=255;e<512;e++)EXP_TABLE[e]=EXP_TABLE[e-255]}(),galoisField.log=function(e){if(e<1)throw new Error("log("+e+")");return LOG_TABLE[e]},galoisField.exp=function(e){return EXP_TABLE[e]},galoisField.mul=function(e,t){return 0===e||0===t?0:EXP_TABLE[LOG_TABLE[e]+LOG_TABLE[t]]},function(e){const t=galoisField;e.mul=function(e,n){const o=new Uint8Array(e.length+n.length-1);for(let r=0;r<e.length;r++)for(let s=0;s<n.length;s++)o[r+s]^=t.mul(e[r],n[s]);return o},e.mod=function(e,n){let o=new Uint8Array(e);for(;o.length-n.length>=0;){const e=o[0];for(let r=0;r<n.length;r++)o[r]^=t.mul(n[r],e);let r=0;for(;r<o.length&&0===o[r];)r++;o=o.slice(r)}return o},e.generateECPolynomial=function(n){let o=new Uint8Array([1]);for(let r=0;r<n;r++)o=e.mul(o,new Uint8Array([1,t.exp(r)]));return o}}(polynomial);const Polynomial=polynomial;function ReedSolomonEncoder$1(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}ReedSolomonEncoder$1.prototype.initialize=function(e){this.degree=e,this.genPoly=Polynomial.generateECPolynomial(this.degree)},ReedSolomonEncoder$1.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(e.length+this.degree);t.set(e);const n=Polynomial.mod(t,this.genPoly),o=this.degree-n.length;if(o>0){const e=new Uint8Array(this.degree);return e.set(n,o),e}return n};var reedSolomonEncoder=ReedSolomonEncoder$1,version={},mode={},versionCheck={isValid:function(e){return!isNaN(e)&&e>=1&&e<=40}},regex$1={};const numeric="[0-9]+",alphanumeric="[A-Z $%*+\\-./:]+";let kanji="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";kanji=kanji.replace(/u/g,"\\u");const byte="(?:(?![A-Z0-9 $%*+\\-./:]|"+kanji+")(?:.|[\r\n]))+";regex$1.KANJI=new RegExp(kanji,"g"),regex$1.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),regex$1.BYTE=new RegExp(byte,"g"),regex$1.NUMERIC=new RegExp(numeric,"g"),regex$1.ALPHANUMERIC=new RegExp(alphanumeric,"g");const TEST_KANJI=new RegExp("^"+kanji+"$"),TEST_NUMERIC=new RegExp("^"+numeric+"$"),TEST_ALPHANUMERIC=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");regex$1.testKanji=function(e){return TEST_KANJI.test(e)},regex$1.testNumeric=function(e){return TEST_NUMERIC.test(e)},regex$1.testAlphanumeric=function(e){return TEST_ALPHANUMERIC.test(e)},function(e){const t=versionCheck,n=regex$1;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!t.isValid(n))throw new Error("Invalid version: "+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},e.isValid=function(e){return e&&e.bit&&e.ccBits},e.from=function(t,n){if(e.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+t)}}(t)}catch(e){return n}}}(mode),function(e){const t=utils$1$1,n=errorCorrectionCode,o=errorCorrectionLevel,r=mode,s=versionCheck,i=t.getBCHDigit(7973);function a(e,t){return r.getCharCountIndicator(e,t)+4}function c(e,t){let n=0;return e.forEach((function(e){const o=a(e.mode,t);n+=o+e.getBitsLength()})),n}e.from=function(e,t){return s.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,o,i){if(!s.isValid(e))throw new Error("Invalid QR Code version");void 0===i&&(i=r.BYTE);const c=8*(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,o));if(i===r.MIXED)return c;const l=c-a(i,e);switch(i){case r.NUMERIC:return Math.floor(l/10*3);case r.ALPHANUMERIC:return Math.floor(l/11*2);case r.KANJI:return Math.floor(l/13);case r.BYTE:default:return Math.floor(l/8)}},e.getBestVersionForData=function(t,n){let s;const i=o.from(n,o.M);if(Array.isArray(t)){if(t.length>1)return function(t,n){for(let o=1;o<=40;o++)if(c(t,o)<=e.getCapacity(o,n,r.MIXED))return o}(t,i);if(0===t.length)return 1;s=t[0]}else s=t;return function(t,n,o){for(let r=1;r<=40;r++)if(n<=e.getCapacity(r,o,t))return r}(s.mode,s.getLength(),i)},e.getEncodedBits=function(e){if(!s.isValid(e)||e<7)throw new Error("Invalid QR Code version");let n=e<<12;for(;t.getBCHDigit(n)-i>=0;)n^=7973<<t.getBCHDigit(n)-i;return e<<12|n}}(version);var formatInfo={};const Utils$3=utils$1$1,G15=1335,G15_MASK=21522,G15_BCH=Utils$3.getBCHDigit(G15);formatInfo.getEncodedBits=function(e,t){const n=e.bit<<3|t;let o=n<<10;for(;Utils$3.getBCHDigit(o)-G15_BCH>=0;)o^=G15<<Utils$3.getBCHDigit(o)-G15_BCH;return(n<<10|o)^G15_MASK};var segments={};const Mode$4=mode;function NumericData(e){this.mode=Mode$4.NUMERIC,this.data=e.toString()}NumericData.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},NumericData.prototype.getLength=function(){return this.data.length},NumericData.prototype.getBitsLength=function(){return NumericData.getBitsLength(this.data.length)},NumericData.prototype.write=function(e){let t,n,o;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),o=parseInt(n,10),e.put(o,10);const r=this.data.length-t;r>0&&(n=this.data.substr(t),o=parseInt(n,10),e.put(o,3*r+1))};var numericData=NumericData;const Mode$3=mode,ALPHA_NUM_CHARS=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function AlphanumericData(e){this.mode=Mode$3.ALPHANUMERIC,this.data=e}AlphanumericData.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},AlphanumericData.prototype.getLength=function(){return this.data.length},AlphanumericData.prototype.getBitsLength=function(){return AlphanumericData.getBitsLength(this.data.length)},AlphanumericData.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=45*ALPHA_NUM_CHARS.indexOf(this.data[t]);n+=ALPHA_NUM_CHARS.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(ALPHA_NUM_CHARS.indexOf(this.data[t]),6)};var alphanumericData=AlphanumericData;const Mode$2=mode;function ByteData(e){this.mode=Mode$2.BYTE,this.data="string"==typeof e?(new TextEncoder).encode(e):new Uint8Array(e)}ByteData.getBitsLength=function(e){return 8*e},ByteData.prototype.getLength=function(){return this.data.length},ByteData.prototype.getBitsLength=function(){return ByteData.getBitsLength(this.data.length)},ByteData.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)};var byteData=ByteData;const Mode$1=mode,Utils$2=utils$1$1;function KanjiData(e){this.mode=Mode$1.KANJI,this.data=e}KanjiData.getBitsLength=function(e){return 13*e},KanjiData.prototype.getLength=function(){return this.data.length},KanjiData.prototype.getBitsLength=function(){return KanjiData.getBitsLength(this.data.length)},KanjiData.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=Utils$2.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else{if(!(n>=57408&&n<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");n-=49472}n=192*(n>>>8&255)+(255&n),e.put(n,13)}};var kanjiData=KanjiData,dijkstra={exports:{}};!function(e){var t={single_source_shortest_paths:function(e,n,o){var r={},s={};s[n]=0;var i,a,c,l,d,h,u,f=t.PriorityQueue.make();for(f.push(n,0);!f.empty();)for(c in a=(i=f.pop()).value,l=i.cost,d=e[a]||{})d.hasOwnProperty(c)&&(h=l+d[c],u=s[c],(void 0===s[c]||u>h)&&(s[c]=h,f.push(c,h),r[c]=a));if(void 0!==o&&void 0===s[o]){var p=["Could not find a path from ",n," to ",o,"."].join("");throw new Error(p)}return r},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],o=t;o;)n.push(o),o=e[o];return n.reverse(),n},find_path:function(e,n,o){var r=t.single_source_shortest_paths(e,n,o);return t.extract_shortest_path_from_predecessor_list(r,o)},PriorityQueue:{make:function(e){var n,o=t.PriorityQueue,r={};for(n in e=e||{},o)o.hasOwnProperty(n)&&(r[n]=o[n]);return r.queue=[],r.sorter=e.sorter||o.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t}(dijkstra),function(e){const t=mode,n=numericData,o=alphanumericData,r=byteData,s=kanjiData,i=regex$1,a=utils$1$1,c=dijkstra.exports;function l(e){return unescape(encodeURIComponent(e)).length}function d(e,t,n){const o=[];let r;for(;null!==(r=e.exec(n));)o.push({data:r[0],index:r.index,mode:t,length:r[0].length});return o}function h(e){const n=d(i.NUMERIC,t.NUMERIC,e),o=d(i.ALPHANUMERIC,t.ALPHANUMERIC,e);let r,s;a.isKanjiModeEnabled()?(r=d(i.BYTE,t.BYTE,e),s=d(i.KANJI,t.KANJI,e)):(r=d(i.BYTE_KANJI,t.BYTE,e),s=[]);return n.concat(o,r,s).sort((function(e,t){return e.index-t.index})).map((function(e){return{data:e.data,mode:e.mode,length:e.length}}))}function u(e,i){switch(i){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return o.getBitsLength(e);case t.KANJI:return s.getBitsLength(e);case t.BYTE:return r.getBitsLength(e)}}function f(e,i){let c;const l=t.getBestModeForData(e);if(c=t.from(i,l),c!==t.BYTE&&c.bit<l.bit)throw new Error('"'+e+'" cannot be encoded with mode '+t.toString(c)+".\n Suggested mode is: "+t.toString(l));switch(c!==t.KANJI||a.isKanjiModeEnabled()||(c=t.BYTE),c){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new o(e);case t.KANJI:return new s(e);case t.BYTE:return new r(e)}}e.fromArray=function(e){return e.reduce((function(e,t){return"string"==typeof t?e.push(f(t,null)):t.data&&e.push(f(t.data,t.mode)),e}),[])},e.fromString=function(n,o){const r=function(e){const n=[];for(let o=0;o<e.length;o++){const r=e[o];switch(r.mode){case t.NUMERIC:n.push([r,{data:r.data,mode:t.ALPHANUMERIC,length:r.length},{data:r.data,mode:t.BYTE,length:r.length}]);break;case t.ALPHANUMERIC:n.push([r,{data:r.data,mode:t.BYTE,length:r.length}]);break;case t.KANJI:n.push([r,{data:r.data,mode:t.BYTE,length:l(r.data)}]);break;case t.BYTE:n.push([{data:r.data,mode:t.BYTE,length:l(r.data)}])}}return n}(h(n,a.isKanjiModeEnabled())),s=function(e,n){const o={},r={start:{}};let s=["start"];for(let i=0;i<e.length;i++){const a=e[i],c=[];for(let e=0;e<a.length;e++){const l=a[e],d=""+i+e;c.push(d),o[d]={node:l,lastCount:0},r[d]={};for(let e=0;e<s.length;e++){const i=s[e];o[i]&&o[i].node.mode===l.mode?(r[i][d]=u(o[i].lastCount+l.length,l.mode)-u(o[i].lastCount,l.mode),o[i].lastCount+=l.length):(o[i]&&(o[i].lastCount=l.length),r[i][d]=u(l.length,l.mode)+4+t.getCharCountIndicator(l.mode,n))}}s=c}for(let e=0;e<s.length;e++)r[s[e]].end=0;return{map:r,table:o}}(r,o),i=c.find_path(s.map,"start","end"),d=[];for(let e=1;e<i.length-1;e++)d.push(s.table[i[e]].node);return e.fromArray(function(e){return e.reduce((function(e,t){const n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)}),[])}(d))},e.rawSplit=function(t){return e.fromArray(h(t,a.isKanjiModeEnabled()))}}(segments);const Utils$1=utils$1$1,ECLevel=errorCorrectionLevel,BitBuffer=bitBuffer,BitMatrix=bitMatrix,AlignmentPattern=alignmentPattern,FinderPattern=finderPattern,MaskPattern=maskPattern,ECCode=errorCorrectionCode,ReedSolomonEncoder=reedSolomonEncoder,Version=version,FormatInfo=formatInfo,Mode$5=mode,Segments=segments;function setupFinderPattern(e,t){const n=e.size,o=FinderPattern.getPositions(t);for(let t=0;t<o.length;t++){const r=o[t][0],s=o[t][1];for(let t=-1;t<=7;t++)if(!(r+t<=-1||n<=r+t))for(let o=-1;o<=7;o++)s+o<=-1||n<=s+o||(t>=0&&t<=6&&(0===o||6===o)||o>=0&&o<=6&&(0===t||6===t)||t>=2&&t<=4&&o>=2&&o<=4?e.set(r+t,s+o,!0,!0):e.set(r+t,s+o,!1,!0))}}function setupTimingPattern(e){const t=e.size;for(let n=8;n<t-8;n++){const t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}function setupAlignmentPattern(e,t){const n=AlignmentPattern.getPositions(t);for(let t=0;t<n.length;t++){const o=n[t][0],r=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)-2===t||2===t||-2===n||2===n||0===t&&0===n?e.set(o+t,r+n,!0,!0):e.set(o+t,r+n,!1,!0)}}function setupVersionInfo(e,t){const n=e.size,o=Version.getEncodedBits(t);let r,s,i;for(let t=0;t<18;t++)r=Math.floor(t/3),s=t%3+n-8-3,i=1==(o>>t&1),e.set(r,s,i,!0),e.set(s,r,i,!0)}function setupFormatInfo(e,t,n){const o=e.size,r=FormatInfo.getEncodedBits(t,n);let s,i;for(s=0;s<15;s++)i=1==(r>>s&1),s<6?e.set(s,8,i,!0):s<8?e.set(s+1,8,i,!0):e.set(o-15+s,8,i,!0),s<8?e.set(8,o-s-1,i,!0):s<9?e.set(8,15-s-1+1,i,!0):e.set(8,15-s-1,i,!0);e.set(o-8,8,1,!0)}function setupData(e,t){const n=e.size;let o=-1,r=n-1,s=7,i=0;for(let a=n-1;a>0;a-=2)for(6===a&&a--;;){for(let n=0;n<2;n++)if(!e.isReserved(r,a-n)){let o=!1;i<t.length&&(o=1==(t[i]>>>s&1)),e.set(r,a-n,o),s--,-1===s&&(i++,s=7)}if(r+=o,r<0||n<=r){r-=o,o=-o;break}}}function createData(e,t,n){const o=new BitBuffer;n.forEach((function(t){o.put(t.mode.bit,4),o.put(t.getLength(),Mode$5.getCharCountIndicator(t.mode,e)),t.write(o)}));const r=8*(Utils$1.getSymbolTotalCodewords(e)-ECCode.getTotalCodewordsCount(e,t));for(o.getLengthInBits()+4<=r&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(0);const s=(r-o.getLengthInBits())/8;for(let e=0;e<s;e++)o.put(e%2?17:236,8);return createCodewords(o,e,t)}function createCodewords(e,t,n){const o=Utils$1.getSymbolTotalCodewords(t),r=o-ECCode.getTotalCodewordsCount(t,n),s=ECCode.getBlocksCount(t,n),i=s-o%s,a=Math.floor(o/s),c=Math.floor(r/s),l=c+1,d=a-c,h=new ReedSolomonEncoder(d);let u=0;const f=new Array(s),p=new Array(s);let g=0;const m=new Uint8Array(e.buffer);for(let e=0;e<s;e++){const t=e<i?c:l;f[e]=m.slice(u,u+t),p[e]=h.encode(f[e]),u+=t,g=Math.max(g,t)}const b=new Uint8Array(o);let y,w,v=0;for(y=0;y<g;y++)for(w=0;w<s;w++)y<f[w].length&&(b[v++]=f[w][y]);for(y=0;y<d;y++)for(w=0;w<s;w++)b[v++]=p[w][y];return b}function createSymbol(e,t,n,o){let r;if(Array.isArray(e))r=Segments.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");{let o=t;if(!o){const t=Segments.rawSplit(e);o=Version.getBestVersionForData(t,n)}r=Segments.fromString(e,o||40)}}const s=Version.getBestVersionForData(r,n);if(!s)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<s)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+s+".\n")}else t=s;const i=createData(t,n,r),a=Utils$1.getSymbolSize(t),c=new BitMatrix(a);return setupFinderPattern(c,t),setupTimingPattern(c),setupAlignmentPattern(c,t),setupFormatInfo(c,n,0),t>=7&&setupVersionInfo(c,t),setupData(c,i),isNaN(o)&&(o=MaskPattern.getBestMask(c,setupFormatInfo.bind(null,c,n))),MaskPattern.applyMask(o,c),setupFormatInfo(c,n,o),{modules:c,version:t,errorCorrectionLevel:n,maskPattern:o,segments:r}}qrcode.create=function(e,t){if(void 0===e||""===e)throw new Error("No input text");let n,o,r=ECLevel.M;return void 0!==t&&(r=ECLevel.from(t.errorCorrectionLevel,ECLevel.M),n=Version.from(t.version),o=MaskPattern.from(t.maskPattern),t.toSJISFunc&&Utils$1.setToSJISFunction(t.toSJISFunc)),createSymbol(e,n,r,o)};var canvas={},utils$2={};!function(e){function t(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map((function(e){return[e,e]})))),6===t.length&&t.push("F","F");const n=parseInt(t.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:255&n,hex:"#"+t.slice(0,6).join("")}}e.getOptions=function(e){e||(e={}),e.color||(e.color={});const n=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,o=e.width&&e.width>=21?e.width:void 0,r=e.scale||4;return{width:o,scale:o?4:r,margin:n,color:{dark:t(e.color.dark||"#000000ff"),light:t(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},e.getImageWidth=function(t,n){const o=e.getScale(t,n);return Math.floor((t+2*n.margin)*o)},e.qrToImageData=function(t,n,o){const r=n.modules.size,s=n.modules.data,i=e.getScale(r,o),a=Math.floor((r+2*o.margin)*i),c=o.margin*i,l=[o.color.light,o.color.dark];for(let e=0;e<a;e++)for(let n=0;n<a;n++){let d=4*(e*a+n),h=o.color.light;if(e>=c&&n>=c&&e<a-c&&n<a-c){h=l[s[Math.floor((e-c)/i)*r+Math.floor((n-c)/i)]?1:0]}t[d++]=h.r,t[d++]=h.g,t[d++]=h.b,t[d]=h.a}}}(utils$2),function(e){const t=utils$2;e.render=function(e,n,o){let r=o,s=n;void 0!==r||n&&n.getContext||(r=n,n=void 0),n||(s=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),r=t.getOptions(r);const i=t.getImageWidth(e.modules.size,r),a=s.getContext("2d"),c=a.createImageData(i,i);return t.qrToImageData(c.data,e,r),function(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=n,t.width=n,t.style.height=n+"px",t.style.width=n+"px"}(a,s,i),a.putImageData(c,0,0),s},e.renderToDataURL=function(t,n,o){let r=o;void 0!==r||n&&n.getContext||(r=n,n=void 0),r||(r={});const s=e.render(t,n,r),i=r.type||"image/png",a=r.rendererOpts||{};return s.toDataURL(i,a.quality)}}(canvas);var svgTag={};const Utils=utils$2;function getColorAttrib(e,t){const n=e.a/255,o=t+'="'+e.hex+'"';return n<1?o+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':o}function svgCmd(e,t,n){let o=e+t;return void 0!==n&&(o+=" "+n),o}function qrToPath(e,t,n){let o="",r=0,s=!1,i=0;for(let a=0;a<e.length;a++){const c=Math.floor(a%t),l=Math.floor(a/t);c||s||(s=!0),e[a]?(i++,a>0&&c>0&&e[a-1]||(o+=s?svgCmd("M",c+n,.5+l+n):svgCmd("m",r,0),r=0,s=!1),c+1<t&&e[a+1]||(o+=svgCmd("h",i),i=0)):r++}return o}svgTag.render=function(e,t,n){const o=Utils.getOptions(t),r=e.modules.size,s=e.modules.data,i=r+2*o.margin,a=o.color.light.a?"<path "+getColorAttrib(o.color.light,"fill")+' d="M0 0h'+i+"v"+i+'H0z"/>':"",c="<path "+getColorAttrib(o.color.dark,"stroke")+' d="'+qrToPath(s,r,o.margin)+'"/>',l='viewBox="0 0 '+i+" "+i+'"',d='<svg xmlns="http://www.w3.org/2000/svg" '+(o.width?'width="'+o.width+'" height="'+o.width+'" ':"")+l+' shape-rendering="crispEdges">'+a+c+"</svg>\n";return"function"==typeof n&&n(null,d),d};const canPromise=canPromise$1,QRCode=qrcode,CanvasRenderer=canvas,SvgRenderer=svgTag;function renderCanvas(e,t,n,o,r){const s=[].slice.call(arguments,1),i=s.length,a="function"==typeof s[i-1];if(!a&&!canPromise())throw new Error("Callback required as last argument");if(!a){if(i<1)throw new Error("Too few arguments provided");return 1===i?(n=t,t=o=void 0):2!==i||t.getContext||(o=n,n=t,t=void 0),new Promise((function(r,s){try{const s=QRCode.create(n,o);r(e(s,t,o))}catch(e){s(e)}}))}if(i<2)throw new Error("Too few arguments provided");2===i?(r=n,n=t,t=o=void 0):3===i&&(t.getContext&&void 0===r?(r=o,o=void 0):(r=o,o=n,n=t,t=void 0));try{const s=QRCode.create(n,o);r(null,e(s,t,o))}catch(e){r(e)}}browser.create=QRCode.create,browser.toCanvas=renderCanvas.bind(null,CanvasRenderer.render),browser.toDataURL=renderCanvas.bind(null,CanvasRenderer.renderToDataURL),browser.toString=renderCanvas.bind(null,(function(e,t,n){return SvgRenderer.render(e,n)}));const nlSigninConnectionStringCss=baseCss,NlSigninConnectionStringStyle0=nlSigninConnectionStringCss,NlSigninConnectionString=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlNostrConnectDefault=createEvent$1(this,"nlNostrConnectDefault"),this.titleLogin="Connection string",this.description="Scan or copy the connection string with key store app",this.connectionString="",this.isCopy=!1}componentDidLoad(){this.nlNostrConnectDefault.emit(),this.generateQRCode()}async generateQRCode(){if(this.connectionString&&this.canvasElement)try{await browser.toCanvas(this.canvasElement,this.connectionString)}catch(e){console.error("Error generating QR Code:",e)}}async copyToClipboard(){try{await navigator.clipboard.writeText(this.connectionString),this.isCopy=!0,setTimeout((()=>{this.isCopy=!1}),1500)}catch(e){console.error("Failed to copy connectionString: ",e)}}render(){return h(Fragment,{key:"739ccc5ccbb2d95dd79e61bca0734603c071fa0c"},h("div",{key:"e0e55217f18f113364c874a7a749eeb4e7747da2",class:"p-4 overflow-y-auto"},h("h1",{key:"536646c9e2f14b5a26eb7cf537a2aba27108480f",class:"nl-title font-bold text-center text-2xl"},this.titleLogin),h("p",{key:"319cce0772500eb08061d62542e09e7dc31886fc",class:"nl-description font-light text-center text-sm pt-2 max-w-96 mx-auto"},this.description)),h("canvas",{key:"acbb64df286dadd9cfc209df904bcdae06781fd7",class:"mx-auto mb-2",ref:e=>this.canvasElement=e}),h("div",{key:"5d6569013d81f1235a2e0fce79d63a358662e19b",class:"px-4"},h("div",{key:"4d6651551f297ba8065b6a8a28d00edc804ff597",class:"max-w-72 mx-auto"},h("div",{key:"32d3e176ea2b5f9aaee1a68c85a36a5f4c560414",class:"relative mb-2"},h("input",{key:"e4a0c9bcb80ec84ba545c427616e16d77f4c8581",type:"text",class:"nl-input peer py-3 px-4 pe-11 ps-11 block w-full border-transparent rounded-lg text-sm disabled:opacity-50 disabled:pointer-events-none dark:border-transparent",placeholder:"npub or name@domain",value:this.connectionString,disabled:!0}),h("div",{key:"e1af97f16bf9dbedef178ea4c8e6f1b656ad10b2",class:"absolute inset-y-0 start-0 flex items-center pointer-events-none ps-4 peer-disabled:opacity-50 peer-disabled:pointer-events-none"},h("svg",{key:"e53e6e030b0173fde047dabbb5d5a84a37c36562",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"flex-shrink-0 w-4 h-4 text-gray-500"},h("path",{key:"ad082553497803daeb16eb3a1b1acd4afbf173d3","stroke-linecap":"round","stroke-linejoin":"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),h("path",{key:"25438a495668108eeca317c69ed60ef830c7b76d","stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))),this.isCopy?h("div",{class:"absolute inset-y-0 end-0 flex items-center p-2 rounded-lg"},h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"#00cc00",class:"flex-shrink-0 w-4 h-4 text-gray-500"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))):h("div",{class:"absolute inset-y-0 end-0 flex items-center cursor-pointer p-2 rounded-lg",onClick:()=>this.copyToClipboard()},h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"flex-shrink-0 w-4 h-4 text-gray-500"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.5 8.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v8.25A2.25 2.25 0 0 0 6 16.5h2.25m8.25-8.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-7.5A2.25 2.25 0 0 1 8.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 0 0-2.25 2.25v6"})))),h("div",{key:"557a946f96cf2e1d9e16d7d0b617ceae63a20ba4",class:"mt-10 justify-center items-center flex gap-2"},h("span",{key:"223239887aa24dfc350605137a18857c2944bb8a",slot:"icon-start",class:"animate-spin-loading inline-block w-[20px] h-[20px] border-[2px] border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"}),h("span",{key:"919c6ab74a39b4d8e124de850be72f4c30817b6a",class:"nl-footer"},"Waiting for connection")))))}static get style(){return NlSigninConnectionStringStyle0}},[0,"nl-signin-connection-string",{titleLogin:[1,"title-login"],description:[1],connectionString:[1,"connection-string"],isCopy:[32]}]);function defineCustomElement$c(){if("undefined"==typeof customElements)return;["nl-signin-connection-string"].forEach((e=>{if("nl-signin-connection-string"===e)customElements.get(e)||customElements.define(e,NlSigninConnectionString)}))}defineCustomElement$c();const nlSigninNsecCss=baseCss,NlSigninNsecStyle0=nlSigninNsecCss,NlSigninNsec=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlLoginNsec=createEvent$1(this,"nlLoginNsec"),this.titleLogin="Login with nsec",this.description="Enter your private key (nsec) to log in."}handleInputChange(e){state.nlSigninNsec.nsecValue=e.target.value}handleLogin(e){e.preventDefault(),this.nlLoginNsec.emit(state.nlSigninNsec.nsecValue)}render(){return h(Fragment,{key:"96b364ced9e063e319692f6796856eb88ece7dc7"},h("div",{key:"6eb8a90f07aa52abe93af9f1cb1f98df67925c90",class:"p-4 overflow-y-auto"},h("h1",{key:"395ea33533887d43be9663e671a381614af32ec8",class:"nl-title font-bold text-center text-2xl"},this.titleLogin),h("p",{key:"775bfeedda38d2a52d439f85e6fc1c471a14df06",class:"nl-description font-light text-center text-sm pt-2 max-w-96 mx-auto"},this.description)),h("div",{key:"335af1f09ccdeac29cb17e9e671edbc06f251de7",class:"max-w-72 mx-auto"},h("div",{key:"e7949c50411f44ddc2e666e4a6efd4c1ced0bc51",class:"p-3 mb-3 rounded-lg border border-yellow-400 bg-yellow-50 dark:bg-yellow-900/20 dark:border-yellow-600"},h("div",{key:"3bbb8da9a9a66ba779af864b18726f367fa39b37",class:"flex items-start gap-2"},h("svg",{key:"e78c62977f057b46df3af6e6aa6d34bca86bedf1",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"#ca8a04",class:"flex-shrink-0 w-5 h-5 mt-0.5"},h("path",{key:"38fa5ad1e1e09b768a1fc17a6354f67ef6182e5f","stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})),h("div",{key:"e4df5e35b96ac61ce48f151988167d70c44478f4"},h("p",{key:"04d1b231d1fc9b5773bde43f7d48f7654442a8e3",class:"nl-title text-xs font-semibold",style:{color:"#ca8a04"}},"Use at your own risk"),h("p",{key:"57d626346430f8f0a09a38b10ba699252da3fe2e",class:"nl-description text-xs mt-1",style:{color:"#a16207"}},"Entering your private key directly is not recommended. We suggest migrating to a key store service for better security.")))),h("div",{key:"a00f417138ef4abf1ca2e22800a3d2a11d7fde10",class:"relative mb-2"},h("input",{key:"17d2f098263f3744de65361e09e18a0c8e1b0868",onInput:e=>this.handleInputChange(e),type:"password",class:"nl-input peer py-3 px-4 ps-11 block w-full border-transparent rounded-lg text-sm disabled:opacity-50 disabled:pointer-events-none dark:border-transparent",placeholder:"nsec1...",value:state.nlSigninNsec.nsecValue}),h("div",{key:"7ee9540e35b72d2678c51528f7f0302cbdbc271a",class:"absolute inset-y-0 start-0 flex items-center pointer-events-none ps-4 peer-disabled:opacity-50 peer-disabled:pointer-events-none"},h("svg",{key:"0a85157080fd2363d30f002c181c32b497b6dd60",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"flex-shrink-0 w-4 h-4 text-gray-500"},h("path",{key:"819466744f8729a1ba2c6f14f3e6eb96ef6a09af","stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"})))),h("div",{key:"3773ee73ac8f9bc7eb115dbd7120d3b0d3f6d9aa",class:"ps-4 pe-4 overflow-y-auto"},h("p",{key:"10325d69b4fbc0cdde6dd0fd0a0b940d82636fa7",class:"nl-error font-light text-center text-sm max-w-96 mx-auto"},state.error)),h("button-base",{key:"f31975f0fd11bef77ebf1282fa4505c2f70dfcba",titleBtn:"Log in",disabled:state.isLoading,onClick:e=>this.handleLogin(e)},state.isLoading&&h("span",{key:"37f2a1a4e24c508511549515754b452398cd83d6",slot:"icon-start",class:"animate-spin-loading inline-block w-4 h-4 border-[3px] border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"}))))}static get style(){return NlSigninNsecStyle0}},[0,"nl-signin-nsec",{titleLogin:[1,"title-login"],description:[1]}]);function defineCustomElement$b(){if("undefined"==typeof customElements)return;["nl-signin-nsec","button-base"].forEach((e=>{switch(e){case"nl-signin-nsec":customElements.get(e)||customElements.define(e,NlSigninNsec);break;case"button-base":customElements.get(e)||defineCustomElement$s()}}))}defineCustomElement$b();const nlSigninOtpCss=baseCss,NlSigninOtpStyle0=nlSigninOtpCss,NlSigninOtp=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlLoginOTPUser=createEvent$1(this,"nlLoginOTPUser"),this.nlLoginOTPCode=createEvent$1(this,"nlLoginOTPCode"),this.nlCheckLogin=createEvent$1(this,"nlCheckLogin"),this.titleLogin="Log in with DM",this.description="Please enter your user name or npub, and we will send you a direct message with a one-time code.",this.titleLoginOTP="Enter the code",this.descriptionOTP="Please enter the one-time code we sent to you as a direct message on Nostr.",this.isGood=!1}handleInputChange(e){state.isOTP?state.nlSigninOTP.code=e.target.value:(state.nlSigninOTP.loginName=e.target.value,this.nlCheckLogin.emit(state.nlSigninOTP.loginName))}handleLogin(e){e.preventDefault(),state.isOTP?this.nlLoginOTPCode.emit(state.nlSigninOTP.code):this.nlLoginOTPUser.emit(state.nlSigninOTP.loginName)}render(){return h(Fragment,{key:"709d350659757afd0ab48e36c71d8c4383bfefe0"},h("div",{key:"b0f5f62a5f154bfcc2f7a7af58cfc05614110c34",class:"p-4 overflow-y-auto"},h("h1",{key:"b846587dd89240232ae5e80812073b88e8885ebf",class:"nl-title font-bold text-center text-2xl"},state.isOTP?this.titleLoginOTP:this.titleLogin),h("p",{key:"41e3ffb50a451af98c5864e53cf9b29b6f9954eb",class:"nl-description font-light text-center text-sm pt-2 max-w-96 mx-auto"},state.isOTP?this.descriptionOTP:this.description)),h("div",{key:"ef89992613d828c4522af37be614e03c00ca181f",class:"max-w-72 mx-auto"},h("div",{key:"bea6fbf173fdc9a248d96318547a3e4d72df1b21",class:"relative mb-2"},h("input",{key:"2c5dce83b126cfc0c10c5609da99c124944a3050",onInput:e=>this.handleInputChange(e),type:"text",class:"nl-input peer py-3 px-4 ps-11 block w-full border-transparent rounded-lg text-sm disabled:opacity-50 disabled:pointer-events-none dark:border-transparent",placeholder:state.isOTP?"code from direct message":"npub or name@domain",value:state.isOTP?state.nlSigninOTP.code:state.nlSigninOTP.loginName}),h("div",{key:"ca758a6f68f12dbd6913378de1f167cc59df86f2",class:"absolute inset-y-0 start-0 flex items-center pointer-events-none ps-4 peer-disabled:opacity-50 peer-disabled:pointer-events-none"},h("svg",{key:"c6d6fd56d5ea9b01983578e6a182c71e80156088",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:this.isGood?"#00cc00":"currentColor",class:"flex-shrink-0 w-4 h-4 text-gray-500"},h("path",{key:"89553d48fa3519fe42ea3ad3f6a8d4de90db9c66","stroke-linecap":"round","stroke-linejoin":"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),h("path",{key:"4a4ae482c3095537b30be245c4aabc9d5c65902d","stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})))),h("div",{key:"94ccf98dadf388302f8269a822accac872c1a1bb",class:"ps-4 pe-4 overflow-y-auto"},h("p",{key:"dc167d95b9aa12f1a8034af58d652671d345c07e",class:"nl-error font-light text-center text-sm max-w-96 mx-auto"},state.error)),h("button-base",{key:"98b1b8d1b2cc4547be2862db89f684a7278184b2",titleBtn:"Log in",disabled:state.isLoading,onClick:e=>this.handleLogin(e)},state.isLoading&&h("span",{key:"2edccf4b93a7daf6bb33b0ff373248ee1ff84970",slot:"icon-start",class:"animate-spin-loading inline-block w-4 h-4 border-[3px] border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"}))))}static get style(){return NlSigninOtpStyle0}},[0,"nl-signin-otp",{titleLogin:[1,"title-login"],description:[1],titleLoginOTP:[1,"title-login-o-t-p"],descriptionOTP:[1,"description-o-t-p"],isGood:[32]}]);function defineCustomElement$a(){if("undefined"==typeof customElements)return;["nl-signin-otp","button-base"].forEach((e=>{switch(e){case"nl-signin-otp":customElements.get(e)||customElements.define(e,NlSigninOtp);break;case"button-base":customElements.get(e)||defineCustomElement$s()}}))}defineCustomElement$a();const nlSigninReadOnlyCss=baseCss,NlSigninReadOnlyStyle0=nlSigninReadOnlyCss,NlSigninReadOnly=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlLoginReadOnly=createEvent$1(this,"nlLoginReadOnly"),this.nlCheckLogin=createEvent$1(this,"nlCheckLogin"),this.titleLogin="Log in to read only",this.description="Please enter the user name or npub of any Nostr user.",this.isGood=!1}handleInputChange(e){state.nlSigninReadOnly.loginName=e.target.value,this.nlCheckLogin.emit(e.target.value)}handleLogin(e){e.preventDefault(),this.nlLoginReadOnly.emit(state.nlSigninReadOnly.loginName)}render(){return h(Fragment,{key:"ab72934e6f777bd62e5065cee268b2dff4209a05"},h("div",{key:"c8b77eac4c36dc67d1e550dbef1969aefa0db3b9",class:"p-4 overflow-y-auto"},h("h1",{key:"711b4d81bc446a4e1925ea6772d8724492410492",class:"nl-title font-bold text-center text-2xl"},this.titleLogin),h("p",{key:"1bd45ccdcf760a0428e979bea6cd5d4946efa440",class:"nl-description font-light text-center text-sm pt-2 max-w-96 mx-auto"},this.description)),h("div",{key:"1c086de3f2d458c9f3163314e17ee056bd30b89e",class:"max-w-72 mx-auto"},h("div",{key:"29baadba904448aff56f5b490e4684b4f5669817",class:"relative mb-2"},h("input",{key:"85a2266a004e7832f3a8bf6586fdab68364441ed",onInput:e=>this.handleInputChange(e),type:"text",class:"nl-input peer py-3 px-4 ps-11 block w-full border-transparent rounded-lg text-sm disabled:opacity-50 disabled:pointer-events-none dark:border-transparent",placeholder:"npub or name@domain",value:state.nlSigninReadOnly.loginName}),h("div",{key:"d563c7cdd5c7dd560d7a3c6c5e5b7a36798d2fe3",class:"absolute inset-y-0 start-0 flex items-center pointer-events-none ps-4 peer-disabled:opacity-50 peer-disabled:pointer-events-none"},h("svg",{key:"57bf5e498bb4ce520de1665555618be2a191660a",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:this.isGood?"#00cc00":"currentColor",class:"flex-shrink-0 w-4 h-4 text-gray-500"},h("path",{key:"354d1a2b42d1590430b13b63fa8b54d365743d17","stroke-linecap":"round","stroke-linejoin":"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),h("path",{key:"3fd555ef4b8ef4d6d38fa8d417c0c8745412b70a","stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})))),h("div",{key:"47991d46b02ede704b99e3958e81871cc733a874",class:"ps-4 pe-4 overflow-y-auto"},h("p",{key:"9bf3a572a89d85d5da61c6665060b5f5b2e8f46c",class:"nl-error font-light text-center text-sm max-w-96 mx-auto"},state.error)),h("button-base",{key:"bee14c47813853dcdcba90ae29a10cded60e902a",titleBtn:"Log in",disabled:state.isLoading,onClick:e=>this.handleLogin(e)},state.isLoading&&h("span",{key:"acf228ea98993476107e394f6a74f27a5b6efa84",slot:"icon-start",class:"animate-spin-loading inline-block w-4 h-4 border-[3px] border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"}))))}static get style(){return NlSigninReadOnlyStyle0}},[0,"nl-signin-read-only",{titleLogin:[1,"title-login"],description:[1],isGood:[32]}]);function defineCustomElement$9(){if("undefined"==typeof customElements)return;["nl-signin-read-only","button-base"].forEach((e=>{switch(e){case"nl-signin-read-only":customElements.get(e)||customElements.define(e,NlSigninReadOnly);break;case"button-base":customElements.get(e)||defineCustomElement$s()}}))}defineCustomElement$9();const nlSignupCss=baseCss,NlSignupStyle0=nlSignupCss,NlSignup=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlSignup=createEvent$1(this,"nlSignup"),this.nlCheckSignup=createEvent$1(this,"nlCheckSignup"),this.fetchHandler=createEvent$1(this,"fetchHandler"),this.titleSignup="Create keys with key store",this.description="Choose some username and a key store service.",this.bunkers="nsec.app,highlighter.com",this.isAvailable=!1}formatServers(e){return e.split(",").map((e=>({name:"@"+e,value:e})))}handleInputChange(e){state.nlSignup.signupName=e.target.value,this.nlCheckSignup.emit(`${e.target.value}@${state.nlSignup.domain}`)}handleDomainSelect(e){state.nlSignup.domain=e.detail,this.nlCheckSignup.emit(`${state.nlSignup.signupName}@${e.detail}`)}handleCreateAccount(e){e.preventDefault(),this.nlSignup.emit(`${state.nlSignup.signupName}@${state.nlSignup.domain}`)}watchBunkersHandler(e){state.nlSignup.servers=this.formatServers(e)}componentWillLoad(){state.nlSignup.servers=this.formatServers(this.bunkers)}render(){return h(Fragment,{key:"100d9330a518e02431bd21dce3247225d2e148a6"},h("div",{key:"f6ca0cc88094790a2ec0dd7ee8e03073b5aed315",class:"p-4 overflow-y-auto"},h("h1",{key:"341daf884a33b81946265dd688910e411b87f90a",class:"nl-title font-bold text-center text-2xl"},this.titleSignup),h("p",{key:"9e8a890c91b026739a71b00a06ba0dd6c52a0a94",class:"nl-description font-light text-center text-sm pt-2 max-w-96 mx-auto"},this.description)),h("div",{key:"0d1cae8ceea504f40f49fff35d3a3e2162801c48",class:"max-w-72 mx-auto"},h("div",{key:"0aa970acebd3392d3c2b91a57bf18982397cbfd2",class:"relative mb-2"},h("input",{key:"861f95f3dfe8cbedaeabe5e80d310cee8ec6b3ef",onInput:e=>this.handleInputChange(e),type:"text",class:"nl-input peer py-3 px-4 ps-11 block w-full border-transparent rounded-lg text-sm disabled:opacity-50 disabled:pointer-events-none dark:border-transparent",placeholder:"Name",value:state.nlSignup.signupName}),h("div",{key:"687cd576c83a67e4ad946da7d675153eb1c249cd",class:"absolute inset-y-0 start-0 flex items-center pointer-events-none ps-4 peer-disabled:opacity-50 peer-disabled:pointer-events-none"},h("svg",{key:"d870596edf59c8d747c08d887af7d3b33060f9f4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:this.isAvailable?"#00cc00":"currentColor",class:"flex-shrink-0 w-4 h-4 text-gray-500"},h("path",{key:"2669def09130b54c40ab3fb9ac044490c6465e32","stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"})))),h("div",{key:"b2dbdd050024352b399a7fb1925dd530680d1b3a",class:"mb-2"},h("nl-select",{key:"c6f4c4a5c5854a1980ab67dd43958dc5120ba0aa",onSelectDomain:e=>this.handleDomainSelect(e),selected:0,options:state.nlSignup.servers})),h("div",{key:"e92991946bcf756880fb607365e8415943af393e",class:"ps-4 pe-4 overflow-y-auto"},h("p",{key:"8e5d4f08c0996a5b80364ab2abfcbf869a45a066",class:"nl-error font-light text-center text-sm max-w-96 mx-auto"},state.error)),h("button-base",{key:"04a486b8a81f3750d048362689365b3a975ef0d1",disabled:state.isLoading,onClick:e=>this.handleCreateAccount(e),titleBtn:"Create profile"},state.isLoading?h("span",{slot:"icon-start",class:"animate-spin-loading inline-block w-4 h-4 border-[3px] border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"}):h("svg",{slot:"icon-start",style:{display:"none"},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M18 7.5v3m0 0v3m0-3h3m-3 0h-3m-2.25-4.125a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0ZM3 19.235v-.11a6.375 6.375 0 0 1 12.75 0v.109A12.318 12.318 0 0 1 9.374 21c-2.331 0-4.512-.645-6.374-1.766Z"})))))}static get watchers(){return{bunkers:["watchBunkersHandler"]}}static get style(){return NlSignupStyle0}},[0,"nl-signup",{titleSignup:[1,"title-signup"],description:[1],bunkers:[1],isAvailable:[32]},void 0,{bunkers:["watchBunkersHandler"]}]);function defineCustomElement$8(){if("undefined"==typeof customElements)return;["nl-signup","button-base","nl-select"].forEach((e=>{switch(e){case"nl-signup":customElements.get(e)||customElements.define(e,NlSignup);break;case"button-base":customElements.get(e)||defineCustomElement$s();break;case"nl-select":customElements.get(e)||defineCustomElement$n()}}))}defineCustomElement$8();const nlWelcomeCss=baseCss,NlWelcomeStyle0=nlWelcomeCss,NlWelcome=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.titleWelcome="Welcome to Nostr!",this.description="This website is part of the Nostr network. Log in with your Nostr profile or sign up to join."}handleChangeScreen(e){state.path=[...state.path,e]}render(){return h(Fragment,{key:"6f0a48d82976e4148caf8ff8c4a000355696de48"},h("div",{key:"ceaf09713ee4cdd7fba07db76aa64b3e7aabef52",class:"p-4 overflow-y-auto"},h("h1",{key:"dee6b8c58bed8216c8929550231860b7fab9600f",class:"nl-title font-bold text-center text-4xl"},this.titleWelcome),h("p",{key:"d63d6c7f040b32886f4a2c165640cbff5bae525f",class:"nl-description font-light text-center text-lg pt-2 max-w-96 mx-auto"},this.description)),h("div",{key:"bdfd30799af7e1c0d003cbce2e1c97f0c4d8345e",class:"max-w-52 mx-auto pb-5"},h("div",{key:"c1845b8823b5992647eedc8d0de4106adad2905f",class:"flex gap-3 flex-col mb-2"},h("button-base",{key:"92a35fd59f02a3f1b35757f36a111e6978dccd4e",titleBtn:"Log in",onClick:()=>this.handleChangeScreen(CURRENT_MODULE.WELCOME_LOGIN)},h("svg",{key:"1fbcbe9b48913334b7cb96571d527de2ede1083f",style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{key:"0cebc8b3d0747c9598d08b6b81f95e5dd1a325c1","stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"})))),h("button-base",{key:"1d94662ed04041cf8246ba75792c88288694769d",onClick:()=>this.handleChangeScreen(CURRENT_MODULE.WELCOME_SIGNUP),titleBtn:"Sign up"},h("svg",{key:"4b610e3752bc18c40f2afb2385d3ec64ee71f656",style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{key:"23f217c6d17f81aa55bdc153bc8fb26dcebae9dc","stroke-linecap":"round","stroke-linejoin":"round",d:"M18 7.5v3m0 0v3m0-3h3m-3 0h-3m-2.25-4.125a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0ZM3 19.235v-.11a6.375 6.375 0 0 1 12.75 0v.109A12.318 12.318 0 0 1 9.374 21c-2.331 0-4.512-.645-6.374-1.766Z"})))))}static get style(){return NlWelcomeStyle0}},[0,"nl-welcome",{titleWelcome:[1,"title-welcome"],description:[1]}]);function defineCustomElement$7(){if("undefined"==typeof customElements)return;["nl-welcome","button-base"].forEach((e=>{switch(e){case"nl-welcome":customElements.get(e)||customElements.define(e,NlWelcome);break;case"button-base":customElements.get(e)||defineCustomElement$s()}}))}defineCustomElement$7();const nlWelcomeSigninCss=baseCss,NlWelcomeSigninStyle0=nlWelcomeSigninCss,NlWelcomeSignIn=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.nlLoginExtension=createEvent$1(this,"nlLoginExtension"),this.titleWelcome="Log in",this.hasExtension=!1,this.authMethods=[],this.hasOTP=!1}handleChangeScreen(e){state.path=[...state.path,e],e===CURRENT_MODULE.EXTENSION&&this.nlLoginExtension.emit()}allowAuthMethod(e){return!this.authMethods.length||this.authMethods.includes(e)}renderSignInWithExtension(){return h("button-base",{onClick:()=>this.handleChangeScreen(CURRENT_MODULE.EXTENSION),titleBtn:"With extension"},h("svg",{style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 8.25V18a2.25 2.25 0 0 0 2.25 2.25h13.5A2.25 2.25 0 0 0 21 18V8.25m-18 0V6a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 6v2.25m-18 0h18M5.25 6h.008v.008H5.25V6ZM7.5 6h.008v.008H7.5V6Zm2.25 0h.008v.008H9.75V6Z"})))}render(){return h(Fragment,{key:"037b8d2ba99338efd13be6a1ec49accace64218b"},h("div",{key:"cedab2e7f1a4b8df177d5b6fd4c609aa45ff5965",class:"p-4 overflow-y-auto"},h("h1",{key:"0bbae7bd31433baa6f8572cd7fdcd60b64cb3abb",class:"nl-title font-bold text-center text-3xl"},this.titleWelcome)),h("div",{key:"d1cd467c79e0034e93522045990f7d1f10e95f42",class:"max-w-52 mx-auto pb-5"},h("div",{key:"f89c6551de4b27d04f07051049093c43bd77dd9b",class:"flex gap-3 flex-col"},this.allowAuthMethod("connect")&&h("button-base",{key:"a86482667df33e31dff35544364576cd0fbeec0b",titleBtn:"Connect",onClick:()=>this.handleChangeScreen(CURRENT_MODULE.CONNECT)},h("svg",{key:"b0b8f37580302000950c4a89a0239132b1aca88a",style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{key:"feef73e7c96f9f494abc9f3946c2c96446c117fb","stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 9V5.25A2.25 2.25 0 0 1 10.5 3h6a2.25 2.25 0 0 1 2.25 2.25v13.5A2.25 2.25 0 0 1 16.5 21h-6a2.25 2.25 0 0 1-2.25-2.25V15M12 9l3 3m0 0-3 3m3-3H2.25"}))),this.allowAuthMethod("readOnly")&&h("button-base",{key:"75cb54d6ba1961239c89f2e2e0699a0f7a3b3841",onClick:()=>this.handleChangeScreen(CURRENT_MODULE.LOGIN_READ_ONLY),titleBtn:"Read only"},h("svg",{key:"4d3741e46c24963e3373d308916e04f1b9cdddad",style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{key:"109481732e23a555dabb8bd2aaf072984ac2642c","stroke-linecap":"round","stroke-linejoin":"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),h("path",{key:"7c571b8540f5d4f89c3f10c05d1f029cb2184e84","stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))),this.hasOTP&&this.allowAuthMethod("otp")&&h("button-base",{key:"b3f78d5917f4efef7551e093d6cb5ef3d906eaa6",titleBtn:"One-time code",onClick:()=>this.handleChangeScreen(CURRENT_MODULE.LOGIN_OTP)},h("svg",{key:"f4dac958561ba1710d262cb07886f9dc15ebeb9e",style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{key:"da957eadb59492f7c907b35dd20a4eb5bdabe559","stroke-linecap":"round","stroke-linejoin":"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))),this.hasExtension&&this.allowAuthMethod("extension")&&this.renderSignInWithExtension(),h("button-base",{key:"fa26358ebee467e4926b3a820c38a34b6f2ea1b4",onClick:()=>this.handleChangeScreen(CURRENT_MODULE.LOGIN_NSEC),titleBtn:"With nsec"},h("svg",{key:"b3a248c229e2571c038a88c8d93c802927ec2b43",style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{key:"ac007bbc3bf0e6e8654fdcaa57cfbdecf1f67fb9","stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"}))),!this.allowAuthMethod("connect")&&!this.hasExtension&&h("p",{key:"fa06ff007947dee35315b6311097fc03cc55da78",class:"nl-description font-light text-center text-lg pt-2 max-w-96 mx-auto"},"No Nostr extension!"),!this.allowAuthMethod("connect")&&this.hasExtension&&!this.allowAuthMethod("extension")&&h("p",{key:"0080e835c7024ed6f867f96399b604651ea74483",class:"nl-description font-light text-center text-lg pt-2 max-w-96 mx-auto"},"Use advanced options."))))}static get style(){return NlWelcomeSigninStyle0}},[0,"nl-welcome-signin",{titleWelcome:[1,"title-welcome"],hasExtension:[4,"has-extension"],authMethods:[16],hasOTP:[4,"has-o-t-p"]}]);function defineCustomElement$6(){if("undefined"==typeof customElements)return;["nl-welcome-signin","button-base"].forEach((e=>{switch(e){case"nl-welcome-signin":customElements.get(e)||customElements.define(e,NlWelcomeSignIn);break;case"button-base":customElements.get(e)||defineCustomElement$s()}}))}defineCustomElement$6();const nlWelcomeSignupCss=baseCss,NlWelcomeSignupStyle0=nlWelcomeSignupCss,NlWelcomeSignUp=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.titleWelcome="Sign up",this.description="Nostr profiles are based on cryptographic keys. You can create keys right here, or with a key storage app."}handleChangeScreen(e){state.path=[...state.path,e]}render(){return h(Fragment,{key:"164e5da760f1609d604bbc85867bd3ae788ce924"},h("div",{key:"03691d670c29b844cae9a771c12c37b1e9540e95",class:"p-4 overflow-y-auto"},h("h1",{key:"0b60f6cf4c8a9cd9ecf3161c64761c7d7c9fb57e",class:"nl-title font-bold text-center text-3xl"},this.titleWelcome),h("p",{key:"91a2e92660873d45f2e92d60a0a7adc3114a0d8d",class:"nl-description font-light text-center text-lg pt-2 max-w-96 mx-auto"},this.description)),h("div",{key:"a14d1a9ac594806be23679b59d9081e2ec1ef92d",class:"max-w-52 mx-auto pb-5"},h("div",{key:"6c8c856efe85e19a3a432c856ddd658aea7e2bd2",class:"flex gap-3 flex-col"},h("button-base",{key:"50c470453b16b552a4070c451f57baa4e366eb7d",onClick:()=>this.handleChangeScreen(CURRENT_MODULE.LOCAL_SIGNUP),titleBtn:"Create keys"},h("svg",{key:"da1d5889dbbc208bafed0d460a65cae6523b2269",style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{key:"ccae3b5c13c1953fe47f5fe416d35b031cf84c3d","stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"}))),h("button-base",{key:"6a557e8d6f926fd0f185c280ae4a372139f8aa5b",onClick:()=>this.handleChangeScreen(CURRENT_MODULE.SIGNUP),titleBtn:"With key store"},h("svg",{key:"08ea855bea4186d1f73a6fde7264585930fe6f91",style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},h("path",{key:"4cc3dc620843a3a970f558b8702ad109411eaf0c","stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"}))))))}static get style(){return NlWelcomeSignupStyle0}},[0,"nl-welcome-signup",{titleWelcome:[1,"title-welcome"],description:[1]}]);function defineCustomElement$5(){if("undefined"==typeof customElements)return;["nl-welcome-signup","button-base"].forEach((e=>{switch(e){case"nl-welcome-signup":customElements.get(e)||customElements.define(e,NlWelcomeSignUp);break;case"button-base":customElements.get(e)||defineCustomElement$s()}}))}defineCustomElement$5();const nlAuthCss=baseCss,NlAuthStyle0=nlAuthCss,NlAuth=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.nlCloseModal=createEvent$1(this,"nlCloseModal"),this.nlChangeDarkMode=createEvent$1(this,"nlChangeDarkMode"),this.nlNostrConnectDefaultCancel=createEvent$1(this,"nlNostrConnectDefaultCancel"),this.prevPath="",this.theme="default",this.bunkers="",this.startScreen=CURRENT_MODULE.WELCOME,this.authMethods=[],this.hasExtension=!1,this.hasOTP=!1,this.isLoading=!1,this.isLoadingExtension=!1,this.isOTP=!1,this.authUrl="",this.iframeUrl="",this.error="",this.localSignup=!1,this.signupNjump=!1,this.njumpIframe="",this.accounts=[],this.recents=[],this.darkMode=!1,this.welcomeTitle="",this.welcomeDescription="",this.connectionString="",this.connectionStringServices=[]}watchLoadingHandler(e){state.isLoading=e}watchLoadingExtensionHandler(e){state.isLoadingExtension=e}watchOTPHandler(e){state.isOTP=e}watchAuthUrlHandler(e){state.authUrl=e}watchIframeUrlHandler(e){state.iframeUrl=e}watchNjumpIframeHandler(e){state.njumpIframe=e}watchErrorHandler(e){state.error=e}handleClose(){this.nlCloseModal.emit()}handleChangeDarkMode(){this.nlChangeDarkMode.emit(!this.darkMode)}componentWillLoad(){state.path=[this.startScreen],state.error="",state.iframeUrl="",state.authUrl="",state.isLoading=!1,state.isLoadingExtension=!1,state.isOTP=!1,console.log("path",state.path)}handleClickToBack(){state.path.pop(),state.path=[...state.path],state.isLoading=!1,state.isLoadingExtension=!1,state.authUrl="",state.isOTP=!1}switchSignSignUpStrategy(e){CURRENT_MODULE.LOCAL_SIGNUP!==e?state.path=[CURRENT_MODULE.WELCOME,e]:state.path=[CURRENT_MODULE.WELCOME,CURRENT_MODULE.WELCOME_SIGNUP,e]}render(){const e="w-full h-full fixed top-0 start-0 z-[80] overflow-x-hidden overflow-y-auto flex items-center "+(this.darkMode?"dark":""),t=state.path.at(-1);t!==this.prevPath&&this.prevPath===CURRENT_MODULE.CONNECTION_STRING&&this.nlNostrConnectDefaultCancel.emit(),this.prevPath=t;const n=state.isOTP||t!==CURRENT_MODULE.INFO&&t!==CURRENT_MODULE.CONFIRM_LOGOUT&&t!==CURRENT_MODULE.IMPORT_FLOW&&t!==CURRENT_MODULE.WELCOME&&t!==CURRENT_MODULE.EXTENSION&&t!==CURRENT_MODULE.IFRAME&&t!==CURRENT_MODULE.PREVIOUSLY_LOGGED,o=t!==CURRENT_MODULE.IFRAME&&(!this.authMethods.length||!this.localSignup&&this.authMethods.includes("connect")||this.localSignup&&this.authMethods.includes("local"));return h("div",{class:`theme-${this.theme}`,dir:"ltr"},h("div",{class:e},h("div",{onClick:()=>this.handleClose(),class:"absolute top-0 left-0 w-full h-full bg-gray-500 bg-opacity-75 z-[80]"}),h("div",{class:"nl-bg relative z-[81] w-full flex flex-col rounded-xl sm:max-w-lg sm:w-full sm:mx-auto"},h("div",{class:"flex justify-between items-center py-3 px-4"},h("div",{class:"flex gap-2 items-center"},h("svg",{class:"w-7 h-7",width:"225",height:"224",viewBox:"0 0 225 224",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("rect",{width:"224.047",height:"224",rx:"64",fill:"#6951FA"}),h("path",{d:"M162.441 135.941V88.0593C170.359 85.1674 176 77.5348 176 68.6696C176 57.2919 166.708 48 155.33 48C143.953 48 134.661 57.2444 134.661 68.6696C134.661 77.5822 140.302 85.1674 148.219 88.0593V135.941C147.698 136.13 147.176 136.367 146.655 136.604L87.3956 77.3452C88.6282 74.6904 89.2919 71.7511 89.2919 68.6696C89.2919 57.2444 80.0474 48 68.6696 48C57.2919 48 48 57.2444 48 68.6696C48 77.5822 53.6415 85.1674 61.5585 88.0593V135.941C53.6415 138.833 48 146.465 48 155.33C48 166.708 57.2444 176 68.6696 176C80.0948 176 89.3393 166.708 89.3393 155.33C89.3393 146.418 83.6978 138.833 75.7807 135.941V88.0593C76.3022 87.8696 76.8237 87.6326 77.3452 87.3956L136.604 146.655C135.372 149.31 134.708 152.249 134.708 155.33C134.708 166.708 143.953 176 155.378 176C166.803 176 176.047 166.708 176.047 155.33C176.047 146.418 170.406 138.833 162.489 135.941H162.441Z",fill:"white"})),h("p",{class:"font-bold nl-logo text-base"},"Nostr ",h("span",{class:"font-light"},"Login"))),h("div",{class:"flex gap-1"},h("button",{onClick:()=>this.handleChangeDarkMode(),type:"button",class:"nl-action-button flex justify-center items-center w-7 h-7 text-sm font-semibold rounded-full border border-transparent"},h("span",{class:"sr-only"},"Change theme"),this.darkMode?h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"flex-shrink-0 w-5 h-5"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"})):h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"flex-shrink-0 w-5 h-5"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"}))),!state.isLoading&&h("button",{onClick:()=>state.path=[...state.path,CURRENT_MODULE.INFO],type:"button",class:"nl-action-button flex justify-center items-center w-7 h-7 text-sm font-semibold rounded-full border border-transparent"},h("span",{class:"sr-only"},"Info"),h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"flex-shrink-0 w-5 h-5"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))),h("button",{onClick:()=>this.handleClose(),type:"button",class:"nl-action-button flex justify-center items-center w-7 h-7 text-sm font-semibold rounded-full border border-transparent"},h("span",{class:"sr-only"},"Close"),h("svg",{class:"flex-shrink-0 w-5 h-5",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},h("path",{d:"M18 6 6 18"}),h("path",{d:"m6 6 12 12"}))))),state.path.length>1&&!state.isLoading&&h("div",{class:"p-4"},h("button",{onClick:()=>this.handleClickToBack(),type:"button",class:"nl-action-button flex justify-center items-center w-7 h-7 text-sm font-semibold rounded-full border border-transparent dark:focus:outline-none dark:focus:ring-1 dark:focus:ring-gray-600","data-hs-overlay":"#hs-vertically-centered-modal"},h("span",{class:"sr-only"},"Back"),h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"flex-shrink-0 w-5 h-5"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"})))),state.isLoading||state.authUrl?h("nl-loading",{path:t}):h(Fragment,null,(()=>{if(state.isOTP)return h("nl-signin-otp",null);switch(t){case CURRENT_MODULE.WELCOME:return h("nl-welcome",{titleWelcome:this.welcomeTitle||void 0,description:this.welcomeDescription||void 0});case CURRENT_MODULE.LOGIN:return h("nl-signin",null);case CURRENT_MODULE.SIGNUP:return h("nl-signup",{bunkers:this.bunkers});case CURRENT_MODULE.LOCAL_SIGNUP:return h("nl-local-signup",{signupNjump:this.signupNjump});case CURRENT_MODULE.CONFIRM_LOGOUT:return h("nl-confirm-logout",null);case CURRENT_MODULE.IMPORT_FLOW:return h("nl-import-flow",{services:this.connectionStringServices});case CURRENT_MODULE.IMPORT_OTP:return h("nl-otp-migrate",{services:this.connectionStringServices});case CURRENT_MODULE.INFO:return h("nl-info",null);case CURRENT_MODULE.EXTENSION:return h("nl-info-extension",null);case CURRENT_MODULE.LOGIN_READ_ONLY:return h("nl-signin-read-only",null);case CURRENT_MODULE.LOGIN_BUNKER_URL:return h("nl-signin-bunker-url",null);case CURRENT_MODULE.LOGIN_OTP:return h("nl-signin-otp",null);case CURRENT_MODULE.LOGIN_NSEC:return h("nl-signin-nsec",null);case CURRENT_MODULE.WELCOME_LOGIN:return h("nl-welcome-signin",{hasOTP:this.hasOTP,authMethods:this.authMethods,hasExtension:this.hasExtension});case CURRENT_MODULE.WELCOME_SIGNUP:return h("nl-welcome-signup",null);case CURRENT_MODULE.CONNECTION_STRING:return h("nl-signin-connection-string",{connectionString:this.connectionString});case CURRENT_MODULE.CONNECT:return h("nl-connect",{connectionStringServices:this.connectionStringServices,authMethods:this.authMethods});case CURRENT_MODULE.PREVIOUSLY_LOGGED:return h("nl-previously-logged",{accounts:this.accounts,recents:this.recents});case CURRENT_MODULE.IFRAME:return h("nl-iframe",{iframeUrl:this.authUrl});default:return h("nl-welcome",null)}})(),n&&h(Fragment,null,t===CURRENT_MODULE.WELCOME_SIGNUP||t===CURRENT_MODULE.SIGNUP||t===CURRENT_MODULE.LOCAL_SIGNUP?h("div",{class:"p-4 overflow-y-auto"},h("p",{class:"nl-footer font-light text-center text-sm pt-3 max-w-96 mx-auto"},"If you already have a profile please"," ",h("span",{onClick:()=>this.switchSignSignUpStrategy(CURRENT_MODULE.WELCOME_LOGIN),class:"cursor-pointer text-blue-400"},"log in"),".")):o&&h("div",{class:"p-4 overflow-y-auto"},h("p",{class:"nl-footer font-light text-center text-sm pt-3 max-w-96 mx-auto"},"If you don't have a profile please"," ",h("span",{onClick:()=>this.localSignup?this.switchSignSignUpStrategy(CURRENT_MODULE.LOCAL_SIGNUP):this.switchSignSignUpStrategy(CURRENT_MODULE.WELCOME_SIGNUP),class:"cursor-pointer text-blue-400"},"sign up"),".")))))))}static get watchers(){return{isLoading:["watchLoadingHandler"],isLoadingExtension:["watchLoadingExtensionHandler"],isOTP:["watchOTPHandler"],authUrl:["watchAuthUrlHandler"],iframeUrl:["watchIframeUrlHandler"],njumpIframe:["watchNjumpIframeHandler"],error:["watchErrorHandler"]}}static get style(){return NlAuthStyle0}},[1,"nl-auth",{theme:[1025],bunkers:[1],startScreen:[1,"start-screen"],authMethods:[16],hasExtension:[4,"has-extension"],hasOTP:[4,"has-o-t-p"],isLoading:[4,"is-loading"],isLoadingExtension:[4,"is-loading-extension"],isOTP:[4,"is-o-t-p"],authUrl:[1,"auth-url"],iframeUrl:[1,"iframe-url"],error:[1],localSignup:[4,"local-signup"],signupNjump:[4,"signup-njump"],njumpIframe:[1,"njump-iframe"],accounts:[1040],recents:[1040],darkMode:[1028,"dark-mode"],welcomeTitle:[1,"welcome-title"],welcomeDescription:[1,"welcome-description"],connectionString:[1,"connection-string"],connectionStringServices:[16]},void 0,{isLoading:["watchLoadingHandler"],isLoadingExtension:["watchLoadingExtensionHandler"],isOTP:["watchOTPHandler"],authUrl:["watchAuthUrlHandler"],iframeUrl:["watchIframeUrlHandler"],njumpIframe:["watchNjumpIframeHandler"],error:["watchErrorHandler"]}]);function defineCustomElement$4(){if("undefined"==typeof customElements)return;["nl-auth","button-base","nl-confirm-logout","nl-connect","nl-iframe","nl-import-flow","nl-info","nl-info-extension","nl-loading","nl-local-signup","nl-login-status","nl-nip46-relay-settings","nl-otp-migrate","nl-previously-logged","nl-select","nl-signin","nl-signin-bunker-url","nl-signin-connection-string","nl-signin-nsec","nl-signin-otp","nl-signin-read-only","nl-signup","nl-welcome","nl-welcome-signin","nl-welcome-signup"].forEach((e=>{switch(e){case"nl-auth":customElements.get(e)||customElements.define(e,NlAuth);break;case"button-base":customElements.get(e)||defineCustomElement$s();break;case"nl-confirm-logout":customElements.get(e)||defineCustomElement$r();break;case"nl-connect":customElements.get(e)||defineCustomElement$p();break;case"nl-iframe":customElements.get(e)||defineCustomElement$o();break;case"nl-import-flow":customElements.get(e)||defineCustomElement$m();break;case"nl-info":customElements.get(e)||defineCustomElement$l();break;case"nl-info-extension":customElements.get(e)||defineCustomElement$k();break;case"nl-loading":customElements.get(e)||defineCustomElement$j();break;case"nl-local-signup":customElements.get(e)||defineCustomElement$i();break;case"nl-login-status":customElements.get(e)||defineCustomElement$h();break;case"nl-nip46-relay-settings":customElements.get(e)||defineCustomElement$q();break;case"nl-otp-migrate":customElements.get(e)||defineCustomElement$g();break;case"nl-previously-logged":customElements.get(e)||defineCustomElement$f();break;case"nl-select":customElements.get(e)||defineCustomElement$n();break;case"nl-signin":customElements.get(e)||defineCustomElement$e();break;case"nl-signin-bunker-url":customElements.get(e)||defineCustomElement$d();break;case"nl-signin-connection-string":customElements.get(e)||defineCustomElement$c();break;case"nl-signin-nsec":customElements.get(e)||defineCustomElement$b();break;case"nl-signin-otp":customElements.get(e)||defineCustomElement$a();break;case"nl-signin-read-only":customElements.get(e)||defineCustomElement$9();break;case"nl-signup":customElements.get(e)||defineCustomElement$8();break;case"nl-welcome":customElements.get(e)||defineCustomElement$7();break;case"nl-welcome-signin":customElements.get(e)||defineCustomElement$6();break;case"nl-welcome-signup":customElements.get(e)||defineCustomElement$5()}}))}defineCustomElement$4();const NlButton=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.theme="default",this.darkMode=!1,this.titleBtn="Open modal",this.disabled=!1}render(){return h("button-base",{key:"9f7936090efc7263cce71d1ad89490d7f5445991",theme:this.theme,darkMode:this.darkMode,titleBtn:this.titleBtn,disabled:this.disabled})}},[1,"nl-button",{theme:[1],darkMode:[4,"dark-mode"],titleBtn:[1,"title-btn"],disabled:[4]}]);function defineCustomElement$3(){if("undefined"==typeof customElements)return;["nl-button","button-base"].forEach((e=>{switch(e){case"nl-button":customElements.get(e)||customElements.define(e,NlButton);break;case"button-base":customElements.get(e)||defineCustomElement$s()}}))}defineCustomElement$3();const nlChangeAccountCss=baseCss,NlChangeAccountStyle0=nlChangeAccountCss,NLChangeAccount=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.handleOpenWelcomeModal=createEvent$1(this,"handleOpenWelcomeModal"),this.handleSwitchAccount=createEvent$1(this,"handleSwitchAccount"),this.isOpen=!1,this.options=[],this.accounts=[],this.currentAccount=null,this.mode=!1,this.darkMode=!1,this.themeState="default",this.theme="default"}handleWindowClick(){this.wrapperRef.querySelector(".listClass")&&(this.isOpen=!1)}toggleDropdown(){this.isOpen=!this.isOpen,this.calculateDropdownPosition()}watchPropHandler(e){this.themeState=e}watchModeHandler(e){this.mode=e}watchAccountsHandler(e){this.options=e}connectedCallback(){this.themeState=this.theme,this.mode=this.darkMode}calculateDropdownPosition(){if(this.isOpen&&this.buttonRef){const e=this.buttonRef.getBoundingClientRect();this.ulRef.style.top=`${e.height}px`}}handleChange(e){this.handleSwitchAccount.emit(e)}handleOpenModal(){this.handleOpenWelcomeModal.emit()}render(){const e=(this.isOpen?"listClass flex flex-col gap-2":"hidden")+" w-full nl-select-list absolute z-10 left-0 shadow-md rounded-lg p-2 mt-1 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full",t=(this.isOpen?"rotate-180":"rotate-0")+" duration-300 flex-shrink-0 w-4 h-4 text-gray-500",n=this.options&&this.currentAccount?this.options.filter((e=>e.pubkey!==this.currentAccount.pubkey||e.authMethod!==this.currentAccount.authMethod)):[];return h("div",{key:"4e15e39f7ac6a552bfc772396e3e9ef8eeca95cc",class:`theme-${this.themeState}`},h("div",{key:"eae10769ce35dc4cc072d2361c1ee1390c79c822",class:"relative",ref:e=>this.wrapperRef=e},h("button",{key:"e585a44168809f27b99201f7e13bd5db5e4f6569",ref:e=>this.buttonRef=e,onClick:()=>this.toggleDropdown(),type:"button",class:"nl-select peer py-3 px-4 flex items-center w-full justify-between border-transparent rounded-lg text-sm disabled:opacity-50 disabled:pointer-events-none dark:border-transparent"},h("span",{key:"006ed9a67b57227d4dab51f0b6bcb8290cd9d3ac",class:"text-gray-500"},"Switch profile"),h("svg",{key:"5f824a479165929698fab31b8837b89418587652",class:t,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},h("path",{key:"600914907723c9f8d01a15da357ccb825c1d1e6a",d:"m6 9 6 6 6-6"}))),h("ul",{key:"9b5b68724a3bce995e6b8b0a9d0eb653baedf79a",ref:e=>this.ulRef=e,class:e},this.options&&n.map((e=>{const t=Boolean(null==e?void 0:e.picture),n=e.name||e.nip05||e.pubkey,o=Boolean(n);return h("li",{onClick:()=>this.handleChange(e),class:"nl-select-option flex cursor-pointer items-center gap-x-3.5 py-2 px-3 rounded-lg text-sm"},h("div",{class:"uppercase font-bold w-full max-w-6 h-6 rounded-full border border-gray-400 flex justify-center items-center"},t?h("img",{class:"w-full rounded-full",src:e.picture,alt:"Logo"}):o?n[0]:h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))),h("div",{class:"overflow-hidden flex flex-col w-full"},h("div",{class:"truncate overflow-hidden"},n),h("nl-login-status",{info:e})))})),h("li",{key:"936f2b75ca2dfca3483650d5d62fc50182cfc8f2",class:"first:pt-0 pt-2 border-t-[1px] first:border-none border-gray-300"},h("div",{key:"be0b4f29e70d8e2bc9fd1cc04c0fb43ad3dd5cac",onClick:()=>this.handleOpenModal(),class:"nl-select-option flex cursor-pointer items-center gap-x-3.5 py-2 px-3 rounded-lg text-sm"},h("div",{key:"bdd2a67e5763726666fcea91b0e7de67fe855994",class:"uppercase font-bold w-6 h-6 rounded-full border border-gray-400 flex justify-center items-center"},h("svg",{key:"f3a258f3e510ccb83b95bf3abecf65c248c8b0f1",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4"},h("path",{key:"dafaa898f3e042531a923a9a77b94511895c6102","stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"}))),"Add profile")))))}get element(){return this}static get watchers(){return{theme:["watchPropHandler"],darkMode:["watchModeHandler"],accounts:["watchAccountsHandler"]}}static get style(){return NlChangeAccountStyle0}},[0,"nl-change-account",{accounts:[16],currentAccount:[16],darkMode:[4,"dark-mode"],theme:[1],isOpen:[32],options:[32],mode:[32],themeState:[32]},[[8,"click","handleWindowClick"]],{theme:["watchPropHandler"],darkMode:["watchModeHandler"],accounts:["watchAccountsHandler"]}]);function defineCustomElement$2(){if("undefined"==typeof customElements)return;["nl-change-account","nl-login-status"].forEach((e=>{switch(e){case"nl-change-account":customElements.get(e)||customElements.define(e,NLChangeAccount);break;case"nl-login-status":customElements.get(e)||defineCustomElement$h()}}))}defineCustomElement$2();const nlDialogCss=baseCss,NlDialogStyle0=nlDialogCss,NlDialog=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.__attachShadow()}componentDidLoad(){var e;null===(e=this.dialogElement)||void 0===e||e.showModal()}disconnectedCallback(){var e;null===(e=this.dialogElement)||void 0===e||e.close()}render(){return h("dialog",{key:"236049861cbba1f18e4bccfed48d3211aaefabec",ref:e=>this.dialogElement=e,class:"m-auto nl-banner-dialog",style:{border:"0",backgroundColor:"transparent"}},h("slot",{key:"b0396bb61e95d6ea66ad520e68c84f917de9db8a"}))}static get style(){return NlDialogStyle0}},[1,"nl-dialog"]);function defineCustomElement$1(){if("undefined"==typeof customElements)return;["nl-dialog"].forEach((e=>{if("nl-dialog"===e)customElements.get(e)||customElements.define(e,NlDialog)}))}defineCustomElement$1();const nlBannerCss=baseCss,NlBannerStyle0=nlBannerCss,NlBanner=proxyCustomElement(class extends H{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.handleNotifyConfirmBanner=createEvent$1(this,"handleNotifyConfirmBanner"),this.handleNotifyConfirmBannerIframe=createEvent$1(this,"handleNotifyConfirmBannerIframe"),this.handleLoginBanner=createEvent$1(this,"handleLoginBanner"),this.handleLogoutBanner=createEvent$1(this,"handleLogoutBanner"),this.handleOpenWelcomeModal=createEvent$1(this,"handleOpenWelcomeModal"),this.handleConfirmLogout=createEvent$1(this,"handleConfirmLogout"),this.handleImportModal=createEvent$1(this,"handleImportModal"),this.handleCancelTimeout=createEvent$1(this,"handleCancelTimeout"),this.theme="default",this.darkMode=!1,this.hiddenMode=!1,this.titleBanner="",this.isOpen=!1,this.isLoading=!1,this.notify=null,this.userInfo=null,this.accounts=[],this.isUserImgError=!1,this.domain="",this.mode="",this.url="",this.isOpenConfirm=!1}watchNotifyHandler(e){var t,n,o,r;this.isOpen=!0,this.isOpenConfirm=!0,this.domain=(null===(t=this.userInfo)||void 0===t?void 0:t.domain)||(null===(r=null===(o=null===(n=this.userInfo)||void 0===n?void 0:n.nip05)||void 0===o?void 0:o.split("@"))||void 0===r?void 0:r[1])||"",this.mode=e.mode,this.url=e.url,this.mode||(this.isOpenConfirm=!1,this.isOpen=!1)}handleOpen(){this.userInfo?this.isOpen=!0:this.handleOpenWelcomeModal.emit()}handleClose(){this.isOpen=!1}handleLogin(){this.handleLoginBanner.emit(METHOD_MODULE.LOGIN),this.handleClose()}handleSignup(){this.handleLoginBanner.emit(METHOD_MODULE.SIGNUP),this.handleClose()}handleImport(){this.handleImportModal.emit(),this.handleClose()}handleLogout(){if(localStorage.getItem("backupKey"))return this.handleLogoutBanner.emit(METHOD_MODULE.LOGOUT),this.handleClose(),void localStorage.removeItem("backupKey");"local"===this.userInfo.authMethod?this.handleConfirmLogout.emit():this.handleLogoutBanner.emit(METHOD_MODULE.LOGOUT),this.handleClose()}handleConfirm(){switch(this.mode){case"authUrl":this.handleNotifyConfirmBanner.emit(this.url);break;case"iframeAuthUrl":this.handleNotifyConfirmBannerIframe.emit(this.url)}this.handleClose()}render(){var e,t,n,o,r,s;const i=Boolean(null===(e=this.userInfo)||void 0===e?void 0:e.picture),a=(null===(t=this.userInfo)||void 0===t?void 0:t.name)||(null===(r=null===(o=null===(n=this.userInfo)||void 0===n?void 0:n.nip05)||void 0===o?void 0:o.split("@"))||void 0===r?void 0:r[0])||(null===(s=this.userInfo)||void 0===s?void 0:s.pubkey)||"",c=Boolean(a),l=h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})),d=h(Fragment,null,h("div",{class:"block w-[48px] h-[46px] relative z-10"},h("div",{onClick:()=>this.handleOpen(),class:"flex w-52 h-[46px] items-center pl-[11px]"},h("span",{class:(this.isLoading?"w-5 h-5 border-[2px] mr-3.5 ml-[2px] opacity-1":"w-0 h-0 border-[0px] mr-0 opacity-0 ml-0")+" animate-spin transition-all duration-300 ease-in-out inline-block border-current border-t-transparent text-slate-900 dark:text-gray-300 rounded-full",role:"status","aria-label":"loading"}),this.userInfo?h("div",{class:"uppercase font-bold w-6 h-6 mr-2 rounded-full border border-gray-200 flex justify-center items-center"},i?this.isUserImgError?l:h("img",{class:"w-full rounded-full",src:this.userInfo.picture,alt:"Logo",onError:()=>this.isUserImgError=!0}):c?a[0]:l):h("div",{class:"flex justify-center items-center"},h("svg",{class:"w-6 h-6",width:"225",height:"224",viewBox:"0 0 225 224",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("rect",{width:"224.047",height:"224",rx:"64",fill:"#6951FA"}),h("path",{d:"M162.441 135.941V88.0593C170.359 85.1674 176 77.5348 176 68.6696C176 57.2919 166.708 48 155.33 48C143.953 48 134.661 57.2444 134.661 68.6696C134.661 77.5822 140.302 85.1674 148.219 88.0593V135.941C147.698 136.13 147.176 136.367 146.655 136.604L87.3956 77.3452C88.6282 74.6904 89.2919 71.7511 89.2919 68.6696C89.2919 57.2444 80.0474 48 68.6696 48C57.2919 48 48 57.2444 48 68.6696C48 77.5822 53.6415 85.1674 61.5585 88.0593V135.941C53.6415 138.833 48 146.465 48 155.33C48 166.708 57.2444 176 68.6696 176C80.0948 176 89.3393 166.708 89.3393 155.33C89.3393 146.418 83.6978 138.833 75.7807 135.941V88.0593C76.3022 87.8696 76.8237 87.6326 77.3452 87.3956L136.604 146.655C135.372 149.31 134.708 152.249 134.708 155.33C134.708 166.708 143.953 176 155.378 176C166.803 176 176.047 166.708 176.047 155.33C176.047 146.418 170.406 138.833 162.489 135.941H162.441Z",fill:"white"})),this.isOpen&&h("span",{class:"px-2"},h("b",null,"Nostr")," Login")),this.isOpen&&c&&h("div",{class:"show-slow truncate w-16 text-xs"},a),this.isOpen&&c&&h("nl-login-status",{info:this.userInfo}))),h("button",{onClick:()=>this.handleClose(),type:"button",class:(this.isOpen?"z-20":"z-0")+" nl-action-button absolute right-2 top-2 z-0 show-slow grid place-items-center w-7 h-7 text-sm font-semibold rounded-full border border-transparent"},h("span",{class:"sr-only"},"Close"),h("svg",{class:"flex-shrink-0 w-5 h-5",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},h("path",{d:"M18 6 6 18"}),h("path",{d:"m6 6 12 12"}))),h("div",{class:"p-3 show-slow"},this.isOpenConfirm?h("div",null,h("div",{class:"w-8 h-8 p-1/2 rounded-full border border-gray-200 bg-white mb-2 mt-2 show-slow m-auto"},h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"#5a68ff",class:"w-full"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))),h("p",{class:"mb-2 text-center max-w-40 min-w-40 mx-auto"},"timeout"===this.mode?"Keys not responding, check your key storage app":`Confirmation required at ${this.domain}`),"timeout"===this.mode?h("div",null,h("a",{onClick:()=>this.handleClose(),href:`https://${this.domain}`,target:"_blank",class:"nl-button text-nowrap py-2.5 px-3 w-full inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-lg disabled:opacity-50 disabled:pointer-events-none dark:focus:outline-none dark:focus:ring-1 dark:focus:ring-gray-600 mb-2"},"Go to ",this.domain),h("button-base",{onClick:()=>{this.handleCancelTimeout.emit(),this.handleClose()},titleBtn:"Cancel"})):"rebind"===this.mode?h("iframe",{src:this.url,width:"180",height:"80",frameBorder:"0"}):h("button-base",{onClick:()=>this.handleConfirm(),titleBtn:"Confirm"})):h("div",null,h("div",null,this.titleBanner&&h("p",{class:"mb-2 text-center show-slow max-w-40 min-w-40 mx-auto"},this.titleBanner),h("div",{class:"mb-2"},h("nl-change-account",{currentAccount:this.userInfo,accounts:this.accounts})),this.userInfo?h("button-base",{onClick:()=>this.handleLogout(),titleBtn:"Log out"}):h("div",null,h("button-base",{onClick:()=>this.handleLogin(),titleBtn:"Log in"},h("svg",{style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"flex-shrink-0 w-4 h-4"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"}))),h("button-base",{onClick:()=>this.handleSignup(),titleBtn:"Sign up"},h("svg",{style:{display:"none"},slot:"icon-start",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"flex-shrink-0 w-4 h-4"},h("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M18 7.5v3m0 0v3m0-3h3m-3 0h-3m-2.25-4.125a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0ZM3 19.235v-.11a6.375 6.375 0 0 1 12.75 0v.109A12.318 12.318 0 0 1 9.374 21c-2.331 0-4.512-.645-6.374-1.766Z"}))))))));const u=function e(t,n){n=n||document.body;const o=Array.from(n.querySelectorAll(t)),r=function(n){e(t,n).forEach((e=>{o.includes(e)||o.push(e)}))};n.shadowRoot&&r(n.shadowRoot);for(const e of Array.from(n.querySelectorAll("*")))e.shadowRoot&&r(e.shadowRoot);return o}("dialog"),f=!!u.find((e=>e.open&&!e.classList.contains("nl-banner-dialog")));return h("div",{class:`theme-${this.theme} ${!this.isOpen&&this.hiddenMode?"hidden":""}`},h("div",{class:this.darkMode&&"dark",dir:"ltr"},this.isOpenConfirm&&f?h("nl-dialog",null,h("div",{class:`nl-banner ${this.isOpen?"w-52 h-auto right-2 rounded-r-lg isOpen ":"rounded-r-none hover:rounded-r-lg cursor-pointer"} z-50 w-12 h-12 fixed top-52 right-0 inline-block gap-x-2 text-sm font-medium rounded-lg hover:right-2 transition-all duration-300 ease-in-out`},d)):h("div",{class:`nl-banner ${this.isOpen?"w-52 h-auto right-2 rounded-r-lg isOpen":"rounded-r-none hover:rounded-r-lg cursor-pointer"} z-50 w-12 h-12 fixed top-52 right-0 inline-block gap-x-2 text-sm font-medium rounded-lg hover:right-2 transition-all duration-300 ease-in-out`},d)))}static get watchers(){return{notify:["watchNotifyHandler"]}}static get style(){return NlBannerStyle0}},[1,"nl-banner",{theme:[1025],darkMode:[1028,"dark-mode"],hiddenMode:[1028,"hidden-mode"],titleBanner:[1,"title-banner"],isOpen:[1028,"is-open"],isLoading:[4,"is-loading"],notify:[16],userInfo:[16],accounts:[1040],isUserImgError:[32],domain:[32],mode:[32],url:[32],isOpenConfirm:[32]},void 0,{notify:["watchNotifyHandler"]}]);function defineCustomElement(){if("undefined"==typeof customElements)return;["nl-banner","button-base","nl-change-account","nl-dialog","nl-login-status"].forEach((e=>{switch(e){case"nl-banner":customElements.get(e)||customElements.define(e,NlBanner);break;case"button-base":customElements.get(e)||defineCustomElement$s();break;case"nl-change-account":customElements.get(e)||defineCustomElement$2();break;case"nl-dialog":customElements.get(e)||defineCustomElement$1();break;case"nl-login-status":customElements.get(e)||defineCustomElement$h()}}))}defineCustomElement();var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},lib={},types={};Object.defineProperty(types,"__esModule",{value:!0});var ee={},taskCollection$1={},taskCollection={},utils$1={};function _fast_remove_single(e,t){-1!==t&&(0===t?e.shift():t===e.length-1?e.length=e.length-1:e.splice(t,1))}Object.defineProperty(utils$1,"__esModule",{value:!0}),utils$1._fast_remove_single=void 0,utils$1._fast_remove_single=_fast_remove_single;var bakeCollection={};(function(exports$1){Object.defineProperty(exports$1,"__esModule",{value:!0}),exports$1.bakeCollectionVariadic=exports$1.bakeCollectionAwait=exports$1.bakeCollection=exports$1.BAKED_EMPTY_FUNC=void 0,exports$1.BAKED_EMPTY_FUNC=function(){};var FORLOOP_FALLBACK=1500;function generateArgsDefCode(e){var t="";if(0===e)return t;for(var n=0;n<e-1;++n)t+="arg"+String(n)+", ";return t+="arg"+String(e-1)}function generateBodyPartsCode(e,t){for(var n="",o="",r=0;r<t;++r)n+="var f".concat(r," = collection[").concat(r,"];\n"),o+="f".concat(r,"(").concat(e,")\n");return{funcDefCode:n,funcCallCode:o}}function generateBodyPartsVariadicCode(e){for(var t="",n="",o=0;o<e;++o)t+="var f".concat(o," = collection[").concat(o,"];\n"),n+="f".concat(o,".apply(undefined, arguments)\n");return{funcDefCode:t,funcCallCode:n}}function bakeCollection(collection,fixedArgsNum){if(0===collection.length)return exports$1.BAKED_EMPTY_FUNC;if(1===collection.length)return collection[0];var funcFactoryCode;if(collection.length<FORLOOP_FALLBACK){var argsDefCode=generateArgsDefCode(fixedArgsNum),_a=generateBodyPartsCode(argsDefCode,collection.length),funcDefCode=_a.funcDefCode,funcCallCode=_a.funcCallCode;funcFactoryCode="(function(collection) {\n ".concat(funcDefCode,"\n collection = undefined;\n return (function(").concat(argsDefCode,") {\n ").concat(funcCallCode,"\n });\n })")}else{var argsDefCode=generateArgsDefCode(fixedArgsNum);funcFactoryCode=collection.length%10==0?"(function(collection) {\n return (function(".concat(argsDefCode,") {\n for (var i = 0; i < collection.length; i += 10) {\n collection[i](").concat(argsDefCode,");\n collection[i+1](").concat(argsDefCode,");\n collection[i+2](").concat(argsDefCode,");\n collection[i+3](").concat(argsDefCode,");\n collection[i+4](").concat(argsDefCode,");\n collection[i+5](").concat(argsDefCode,");\n collection[i+6](").concat(argsDefCode,");\n collection[i+7](").concat(argsDefCode,");\n collection[i+8](").concat(argsDefCode,");\n collection[i+9](").concat(argsDefCode,");\n }\n });\n })"):collection.length%4==0?"(function(collection) {\n return (function(".concat(argsDefCode,") {\n for (var i = 0; i < collection.length; i += 4) {\n collection[i](").concat(argsDefCode,");\n collection[i+1](").concat(argsDefCode,");\n collection[i+2](").concat(argsDefCode,");\n collection[i+3](").concat(argsDefCode,");\n }\n });\n })"):collection.length%3==0?"(function(collection) {\n return (function(".concat(argsDefCode,") {\n for (var i = 0; i < collection.length; i += 3) {\n collection[i](").concat(argsDefCode,");\n collection[i+1](").concat(argsDefCode,");\n collection[i+2](").concat(argsDefCode,");\n }\n });\n })"):"(function(collection) {\n return (function(".concat(argsDefCode,") {\n for (var i = 0; i < collection.length; ++i) {\n collection[i](").concat(argsDefCode,");\n }\n });\n })")}var funcFactory=eval(funcFactoryCode);return funcFactory(collection)}function bakeCollectionAwait(collection,fixedArgsNum){if(0===collection.length)return exports$1.BAKED_EMPTY_FUNC;if(1===collection.length)return collection[0];var funcFactoryCode;if(collection.length<FORLOOP_FALLBACK){var argsDefCode=generateArgsDefCode(fixedArgsNum),_a=generateBodyPartsCode(argsDefCode,collection.length),funcDefCode=_a.funcDefCode,funcCallCode=_a.funcCallCode;funcFactoryCode="(function(collection) {\n ".concat(funcDefCode,"\n collection = undefined;\n return (function(").concat(argsDefCode,") {\n return Promise.all([ ").concat(funcCallCode," ]);\n });\n })")}else{var argsDefCode=generateArgsDefCode(fixedArgsNum);funcFactoryCode="(function(collection) {\n return (function(".concat(argsDefCode,") {\n var promises = Array(collection.length);\n for (var i = 0; i < collection.length; ++i) {\n promises[i] = collection[i](").concat(argsDefCode,");\n }\n return Promise.all(promises);\n });\n })")}var funcFactory=eval(funcFactoryCode);return funcFactory(collection)}function bakeCollectionVariadic(collection){if(0===collection.length)return exports$1.BAKED_EMPTY_FUNC;if(1===collection.length)return collection[0];var funcFactoryCode;if(collection.length<FORLOOP_FALLBACK){var _a=generateBodyPartsVariadicCode(collection.length),funcDefCode=_a.funcDefCode,funcCallCode=_a.funcCallCode;funcFactoryCode="(function(collection) {\n ".concat(funcDefCode,"\n collection = undefined;\n return (function() {\n ").concat(funcCallCode,"\n });\n })")}else funcFactoryCode="(function(collection) {\n return (function() {\n for (var i = 0; i < collection.length; ++i) {\n collection[i].apply(undefined, arguments);\n }\n });\n })";var funcFactory=eval(funcFactoryCode);return funcFactory(collection)}exports$1.bakeCollection=bakeCollection,exports$1.bakeCollectionAwait=bakeCollectionAwait,exports$1.bakeCollectionVariadic=bakeCollectionVariadic})(bakeCollection);var __spreadArray$1=commonjsGlobal&&commonjsGlobal.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var o,r=0,s=t.length;r<s;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(taskCollection,"__esModule",{value:!0}),taskCollection.TaskCollection=void 0;var utils_1$1=utils$1,bake_collection_1=bakeCollection;function push_norebuild(e,t){var n,o=this.length;if(o>1)t?((n=this._tasks).push.apply(n,arguments),this.length+=arguments.length):(this._tasks.push(e),this.length++);else if(t){var r;if(1===o)(r=Array(1+arguments.length)).push(r),r.push.apply(r,arguments),this._tasks=r;else(r=Array(arguments.length)).push.apply(r,arguments),this._tasks=r;this.length+=arguments.length}else this._tasks=1===o?[this._tasks,e]:e,this.length++}function push_rebuild(e,t){var n,o=this.length;if(o>1)t?((n=this._tasks).push.apply(n,arguments),this.length+=arguments.length):(this._tasks.push(e),this.length++);else if(t){var r;if(1===o)(r=Array(1+arguments.length)).push(r),r.push.apply(r,arguments),this._tasks=r;else(r=Array(arguments.length)).push.apply(r,arguments),this._tasks=r;this.length+=arguments.length}else this._tasks=1===o?[this._tasks,e]:e,this.length++;this.firstEmitBuildStrategy?this.call=rebuild_on_first_call:this.rebuild()}function removeLast_norebuild(e){0!==this.length&&(1===this.length?this._tasks===e&&(this.length=0):((0,utils_1$1._fast_remove_single)(this._tasks,this._tasks.lastIndexOf(e)),1===this._tasks.length?(this._tasks=this._tasks[0],this.length=1):this.length=this._tasks.length))}function removeLast_rebuild(e){if(0!==this.length){if(1===this.length)return this._tasks===e&&(this.length=0),this.firstEmitBuildStrategy?void(this.call=bake_collection_1.BAKED_EMPTY_FUNC):void this.rebuild();(0,utils_1$1._fast_remove_single)(this._tasks,this._tasks.lastIndexOf(e)),1===this._tasks.length?(this._tasks=this._tasks[0],this.length=1):this.length=this._tasks.length,this.firstEmitBuildStrategy?this.call=rebuild_on_first_call:this.rebuild()}}function insert_norebuild(e){for(var t,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];0===this.length?(this._tasks=n,this.length=1):1===this.length?(n.unshift(this._tasks),this._tasks=n,this.length=this._tasks.length):((t=this._tasks).splice.apply(t,__spreadArray$1([e,0],n,!1)),this.length=this._tasks.length)}function insert_rebuild(e){for(var t,n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];0===this.length?(this._tasks=n,this.length=1):1===this.length?(n.unshift(this._tasks),this._tasks=n,this.length=this._tasks.length):((t=this._tasks).splice.apply(t,__spreadArray$1([e,0],n,!1)),this.length=this._tasks.length),this.firstEmitBuildStrategy?this.call=rebuild_on_first_call:this.rebuild()}function rebuild_noawait(){0===this.length?this.call=bake_collection_1.BAKED_EMPTY_FUNC:1===this.length?this.call=this._tasks:this.call=(0,bake_collection_1.bakeCollection)(this._tasks,this.argsNum)}function rebuild_await(){0===this.length?this.call=bake_collection_1.BAKED_EMPTY_FUNC:1===this.length?this.call=this._tasks:this.call=(0,bake_collection_1.bakeCollectionAwait)(this._tasks,this.argsNum)}function rebuild_on_first_call(){this.rebuild(),this.call.apply(void 0,arguments)}var TaskCollection=function(e,t,n,o){void 0===t&&(t=!0),void 0===n&&(n=null),void 0===o&&(o=!1),this.awaitTasks=o,this.call=bake_collection_1.BAKED_EMPTY_FUNC,this.argsNum=e,this.firstEmitBuildStrategy=!0,this.rebuild=o?rebuild_await.bind(this):rebuild_noawait.bind(this),this.setAutoRebuild(t),n?"function"==typeof n?(this._tasks=n,this.length=1):(this._tasks=n,this.length=n.length):(this._tasks=null,this.length=0),t&&this.rebuild()};function fastClear(){this._tasks=null,this.length=0,this.call=bake_collection_1.BAKED_EMPTY_FUNC}function clear(){this._tasks=null,this.length=0,this.call=bake_collection_1.BAKED_EMPTY_FUNC}function growArgsNum(e){this.argsNum<e&&(this.argsNum=e,this.firstEmitBuildStrategy?this.call=rebuild_on_first_call:this.rebuild())}function setAutoRebuild(e){e?(this.push=push_rebuild.bind(this),this.insert=insert_rebuild.bind(this),this.removeLast=removeLast_rebuild.bind(this)):(this.push=push_norebuild.bind(this),this.insert=insert_norebuild.bind(this),this.removeLast=removeLast_norebuild.bind(this))}function tasksAsArray(){return 0===this.length?[]:1===this.length?[this._tasks]:this._tasks}function setTasks(e){0===e.length?(this.length=0,this.call=bake_collection_1.BAKED_EMPTY_FUNC):1===e.length?(this.length=1,this.call=e[0],this._tasks=e[0]):(this.length=e.length,this._tasks=e,this.firstEmitBuildStrategy?this.call=rebuild_on_first_call:this.rebuild())}taskCollection.TaskCollection=TaskCollection,TaskCollection.prototype.fastClear=fastClear,TaskCollection.prototype.clear=clear,TaskCollection.prototype.growArgsNum=growArgsNum,TaskCollection.prototype.setAutoRebuild=setAutoRebuild,TaskCollection.prototype.tasksAsArray=tasksAsArray,TaskCollection.prototype.setTasks=setTasks,function(e){var t=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),n=commonjsGlobal&&commonjsGlobal.__exportStar||function(e,n){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(n,o)||t(n,e,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(taskCollection,e)}(taskCollection$1);var utils={};function nullObj(){var e={__proto__:null};return e}Object.defineProperty(utils,"__esModule",{value:!0}),utils.nullObj=void 0,utils.nullObj=nullObj;var __spreadArray=commonjsGlobal&&commonjsGlobal.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var o,r=0,s=t.length;r<s;r++)!o&&r in t||(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(ee,"__esModule",{value:!0}),ee.EventEmitter=void 0;var task_collection_1=taskCollection$1,utils_1=utils$1,utils_2=utils;function emit(e,t,n,o,r,s){var i=this.events[e];if(i){if(0===i.length)return!1;if(i.argsNum<6)i.call(t,n,o,r,s);else{for(var a=new Array(i.argsNum),c=0,l=a.length;c<l;++c)a[c]=arguments[c+1];i.call.apply(void 0,a)}return!0}return!1}function emitHasOnce(e,t,n,o,r,s){var i,a=this.events[e];if(void 0!==a){if(0===a.length)return!1;if(a.argsNum<6)a.call(t,n,o,r,s);else{for(var c=0,l=(i=new Array(a.argsNum)).length;c<l;++c)i[c]=arguments[c+1];a.call.apply(void 0,i)}}var d=this.onceEvents[e];if(d){if("function"==typeof d)if(this.onceEvents[e]=void 0,arguments.length<6)d(t,n,o,r,s);else{if(void 0===i)for(c=0,l=(i=new Array(arguments.length-1)).length;c<l;++c)i[c]=arguments[c+1];d.apply(void 0,i)}else{var h=d;if(this.onceEvents[e]=void 0,arguments.length<6)for(c=0;c<h.length;++c)h[c](t,n,o,r,s);else{if(void 0===i)for(c=0,l=(i=new Array(arguments.length-1)).length;c<l;++c)i[c]=arguments[c+1];for(c=0;c<h.length;++c)h[c].apply(void 0,i)}}return!0}return void 0!==a}var EventEmitter=function(){function e(){this.events=(0,utils_2.nullObj)(),this.onceEvents=(0,utils_2.nullObj)(),this._symbolKeys=new Set,this.maxListeners=1/0}return Object.defineProperty(e.prototype,"_eventsCount",{get:function(){return this.eventNames().length},enumerable:!1,configurable:!0}),e}();function once(e,t){switch(this.emit===emit&&(this.emit=emitHasOnce),typeof this.onceEvents[e]){case"undefined":this.onceEvents[e]=t,"symbol"==typeof e&&this._symbolKeys.add(e);break;case"function":this.onceEvents[e]=[this.onceEvents[e],t];break;case"object":this.onceEvents[e].push(t)}return this}function addListener(e,t,n){if(void 0===n&&(n=t.length),"function"!=typeof t)throw new TypeError("The listener must be a function");var o=this.events[e];return o?(o.push(t),o.growArgsNum(n),this.maxListeners!==1/0&&this.maxListeners<=o.length&&console.warn('Maximum event listeners for "'.concat(String(e),'" event!'))):(this.events[e]=new task_collection_1.TaskCollection(n,!0,t,!1),"symbol"==typeof e&&this._symbolKeys.add(e)),this}function removeListener(e,t){var n=this.events[e];n&&n.removeLast(t);var o=this.onceEvents[e];return o&&("function"==typeof o?this.onceEvents[e]=void 0:"object"==typeof o&&(1===o.length&&o[0]===t?this.onceEvents[e]=void 0:(0,utils_1._fast_remove_single)(o,o.lastIndexOf(t)))),this}function addListenerBound(e,t,n,o){void 0===n&&(n=this),void 0===o&&(o=t.length),this.boundFuncs||(this.boundFuncs=new Map);var r=t.bind(n);return this.boundFuncs.set(t,r),this.addListener(e,r,o)}function removeListenerBound(e,t){var n,o,r=null===(n=this.boundFuncs)||void 0===n?void 0:n.get(t);return null===(o=this.boundFuncs)||void 0===o||o.delete(t),this.removeListener(e,r)}function hasListeners(e){return this.events[e]&&!!this.events[e].length}function prependListener(e,t,n){if(void 0===n&&(n=t.length),"function"!=typeof t)throw new TypeError("The listener must be a function");var o=this.events[e];return o&&o instanceof task_collection_1.TaskCollection?(o.insert(0,t),o.growArgsNum(n),this.maxListeners!==1/0&&this.maxListeners<=o.length&&console.warn('Maximum event listeners for "'.concat(String(e),'" event!'))):(o=this.events[e]=new task_collection_1.TaskCollection(n,!0,t,!1),"symbol"==typeof e&&this._symbolKeys.add(e)),this}function prependOnceListener(e,t){this.emit===emit&&(this.emit=emitHasOnce);var n=this.onceEvents[e];return n?"object"!=typeof n?(this.onceEvents[e]=[t,n],"symbol"==typeof e&&this._symbolKeys.add(e)):(n.unshift(t),this.maxListeners!==1/0&&this.maxListeners<=n.length&&console.warn('Maximum event listeners for "'.concat(String(e),'" once event!'))):(this.onceEvents[e]=[t],"symbol"==typeof e&&this._symbolKeys.add(e)),this}function removeAllListeners(e){return void 0===e?(this.events=(0,utils_2.nullObj)(),this.onceEvents=(0,utils_2.nullObj)(),this._symbolKeys=new Set):(this.events[e]=void 0,this.onceEvents[e]=void 0,"symbol"==typeof e&&this._symbolKeys.delete(e)),this}function setMaxListeners(e){return this.maxListeners=e,this}function getMaxListeners(){return this.maxListeners}function listeners(e){return this.emit===emit?this.events[e]?this.events[e].tasksAsArray().slice():[]:this.events[e]&&this.onceEvents[e]?__spreadArray(__spreadArray([],this.events[e].tasksAsArray(),!0),"function"==typeof this.onceEvents[e]?[this.onceEvents[e]]:this.onceEvents[e],!0):this.events[e]?this.events[e].tasksAsArray():this.onceEvents[e]?"function"==typeof this.onceEvents[e]?[this.onceEvents[e]]:this.onceEvents[e]:[]}function eventNames(){var e=this;if(this.emit===emit){var t=Object.keys(this.events);return __spreadArray(__spreadArray([],t,!0),Array.from(this._symbolKeys),!0).filter((function(t){return t in e.events&&e.events[t]&&e.events[t].length}))}t=Object.keys(this.events).filter((function(t){return e.events[t]&&e.events[t].length}));var n=Object.keys(this.onceEvents).filter((function(t){return e.onceEvents[t]&&e.onceEvents[t].length}));return __spreadArray(__spreadArray(__spreadArray([],t,!0),n,!0),Array.from(this._symbolKeys).filter((function(t){return t in e.events&&e.events[t]&&e.events[t].length||t in e.onceEvents&&e.onceEvents[t]&&e.onceEvents[t].length})),!0)}function listenerCount(e){return this.emit===emit?this.events[e]&&this.events[e].length||0:(this.events[e]&&this.events[e].length||0)+(this.onceEvents[e]&&this.onceEvents[e].length||0)}
|
|
2
2
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
3
3
|
function isBytes$4(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function anumber$4(e,t=""){if(!Number.isSafeInteger(e)||e<0){throw new Error(`${t&&`"${t}" `}expected integer >= 0, got ${e}`)}}function abytes$4(e,t,n=""){const o=isBytes$4(e),r=e?.length,s=void 0!==t;if(!o||s&&r!==t){throw new Error((n&&`"${n}" `)+"expected Uint8Array"+(s?` of length ${t}`:"")+", got "+(o?`length=${r}`:"type="+typeof e))}return e}function ahash$1(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash must wrapped by utils.createHasher");anumber$4(e.outputLen),anumber$4(e.blockLen)}function aexists$1(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function aoutput$1(e,t){abytes$4(e,void 0,"digestInto() output");const n=t.outputLen;if(e.length<n)throw new Error('"digestInto() output" expected to be of length >='+n)}function clean$2(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function createView$1(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function rotr$1(e,t){return e<<32-t|e>>>t}ee.EventEmitter=EventEmitter,EventEmitter.prototype.emit=emit,EventEmitter.prototype.on=addListener,EventEmitter.prototype.once=once,EventEmitter.prototype.addListener=addListener,EventEmitter.prototype.removeListener=removeListener,EventEmitter.prototype.addListenerBound=addListenerBound,EventEmitter.prototype.removeListenerBound=removeListenerBound,EventEmitter.prototype.hasListeners=hasListeners,EventEmitter.prototype.prependListener=prependListener,EventEmitter.prototype.prependOnceListener=prependOnceListener,EventEmitter.prototype.off=removeListener,EventEmitter.prototype.removeAllListeners=removeAllListeners,EventEmitter.prototype.setMaxListeners=setMaxListeners,EventEmitter.prototype.getMaxListeners=getMaxListeners,EventEmitter.prototype.listeners=listeners,EventEmitter.prototype.eventNames=eventNames,EventEmitter.prototype.listenerCount=listenerCount,function(e){var t=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),n=commonjsGlobal&&commonjsGlobal.__exportStar||function(e,n){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(n,o)||t(n,e,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(types,e),n(ee,e)}(lib);const hasHexBuiltin$1=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),hexes$1=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function bytesToHex$1(e){if(abytes$4(e),hasHexBuiltin$1)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=hexes$1[e[n]];return t}const asciis$1={_0:48,_9:57,A:65,F:70,a:97,f:102};function asciiToBase16$1(e){return e>=asciis$1._0&&e<=asciis$1._9?e-asciis$1._0:e>=asciis$1.A&&e<=asciis$1.F?e-(asciis$1.A-10):e>=asciis$1.a&&e<=asciis$1.f?e-(asciis$1.a-10):void 0}function hexToBytes$1(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(hasHexBuiltin$1)return Uint8Array.fromHex(e);const t=e.length,n=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const o=new Uint8Array(n);for(let t=0,r=0;t<n;t++,r+=2){const n=asciiToBase16$1(e.charCodeAt(r)),s=asciiToBase16$1(e.charCodeAt(r+1));if(void 0===n||void 0===s){const t=e[r]+e[r+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+r)}o[t]=16*n+s}return o}function concatBytes$1(...e){let t=0;for(let n=0;n<e.length;n++){const o=e[n];abytes$4(o),t+=o.length}const n=new Uint8Array(t);for(let t=0,o=0;t<e.length;t++){const r=e[t];n.set(r,o),o+=r.length}return n}function createHasher$1(e,t={}){const n=(t,n)=>e(n).update(t).digest(),o=e(void 0);return n.outputLen=o.outputLen,n.blockLen=o.blockLen,n.create=t=>e(t),Object.assign(n,t),Object.freeze(n)}function randomBytes$1(e=32){const t="object"==typeof globalThis?globalThis.crypto:null;if("function"!=typeof t?.getRandomValues)throw new Error("crypto.getRandomValues must be defined");return t.getRandomValues(new Uint8Array(e))}const oidNist=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function Chi$1(e,t,n){return e&t^~e&n}function Maj$1(e,t,n){return e&t^e&n^t&n}let HashMD$1=class{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,n,o){this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=o,this.buffer=new Uint8Array(e),this.view=createView$1(this.buffer)}update(e){aexists$1(this),abytes$4(e);const{view:t,buffer:n,blockLen:o}=this,r=e.length;for(let s=0;s<r;){const i=Math.min(o-this.pos,r-s);if(i!==o)n.set(e.subarray(s,s+i),this.pos),this.pos+=i,s+=i,this.pos===o&&(this.process(t,0),this.pos=0);else{const t=createView$1(e);for(;o<=r-s;s+=o)this.process(t,s)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){aexists$1(this),aoutput$1(e,this),this.finished=!0;const{buffer:t,view:n,blockLen:o,isLE:r}=this;let{pos:s}=this;t[s++]=128,clean$2(this.buffer.subarray(s)),this.padOffset>o-s&&(this.process(n,0),s=0);for(let e=s;e<o;e++)t[e]=0;n.setBigUint64(o-8,BigInt(8*this.length),r),this.process(n,0);const i=createView$1(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const c=a/4,l=this.get();if(c>l.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)i.setUint32(4*e,l[e],r)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||=new this.constructor,e.set(...this.get());const{blockLen:t,buffer:n,length:o,finished:r,destroyed:s,pos:i}=this;return e.destroyed=s,e.finished=r,e.length=o,e.pos=i,o%t&&e.buffer.set(n),e}clone(){return this._cloneInto()}};const SHA256_IV$1=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SHA256_K$1=Uint32Array.from([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]),SHA256_W$1=new Uint32Array(64);class SHA2_32B extends HashMD$1{constructor(e){super(64,e,8,!1)}get(){const{A:e,B:t,C:n,D:o,E:r,F:s,G:i,H:a}=this;return[e,t,n,o,r,s,i,a]}set(e,t,n,o,r,s,i,a){this.A=0|e,this.B=0|t,this.C=0|n,this.D=0|o,this.E=0|r,this.F=0|s,this.G=0|i,this.H=0|a}process(e,t){for(let n=0;n<16;n++,t+=4)SHA256_W$1[n]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=SHA256_W$1[e-15],n=SHA256_W$1[e-2],o=rotr$1(t,7)^rotr$1(t,18)^t>>>3,r=rotr$1(n,17)^rotr$1(n,19)^n>>>10;SHA256_W$1[e]=r+SHA256_W$1[e-7]+o+SHA256_W$1[e-16]|0}let{A:n,B:o,C:r,D:s,E:i,F:a,G:c,H:l}=this;for(let e=0;e<64;e++){const t=l+(rotr$1(i,6)^rotr$1(i,11)^rotr$1(i,25))+Chi$1(i,a,c)+SHA256_K$1[e]+SHA256_W$1[e]|0,d=(rotr$1(n,2)^rotr$1(n,13)^rotr$1(n,22))+Maj$1(n,o,r)|0;l=c,c=a,a=i,i=s+t|0,s=r,r=o,o=n,n=t+d|0}n=n+this.A|0,o=o+this.B|0,r=r+this.C|0,s=s+this.D|0,i=i+this.E|0,a=a+this.F|0,c=c+this.G|0,l=l+this.H|0,this.set(n,o,r,s,i,a,c,l)}roundClean(){clean$2(SHA256_W$1)}destroy(){this.set(0,0,0,0,0,0,0,0),clean$2(this.buffer)}}class _SHA256 extends SHA2_32B{A=0|SHA256_IV$1[0];B=0|SHA256_IV$1[1];C=0|SHA256_IV$1[2];D=0|SHA256_IV$1[3];E=0|SHA256_IV$1[4];F=0|SHA256_IV$1[5];G=0|SHA256_IV$1[6];H=0|SHA256_IV$1[7];constructor(){super(32)}}const sha256$2=createHasher$1((()=>new _SHA256),oidNist(1)),_0n$8=BigInt(0),_1n$7=BigInt(1);
|
|
4
4
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function abool$1(e,t=""){if("boolean"!=typeof e){throw new Error((t&&`"${t}" `)+"expected boolean, got type="+typeof e)}return e}function abignumber(e){if("bigint"==typeof e){if(!isPosBig$1(e))throw new Error("positive bigint expected, got "+e)}else anumber$4(e);return e}function numberToHexUnpadded$1(e){const t=abignumber(e).toString(16);return 1&t.length?"0"+t:t}function hexToNumber$1(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?_0n$8:BigInt("0x"+e)}function bytesToNumberBE$1(e){return hexToNumber$1(bytesToHex$1(e))}function bytesToNumberLE$1(e){return hexToNumber$1(bytesToHex$1(copyBytes$1(abytes$4(e)).reverse()))}function numberToBytesBE$1(e,t){anumber$4(t);const n=hexToBytes$1((e=abignumber(e)).toString(16).padStart(2*t,"0"));if(n.length!==t)throw new Error("number too large");return n}function numberToBytesLE$1(e,t){return numberToBytesBE$1(e,t).reverse()}function copyBytes$1(e){return Uint8Array.from(e)}function asciiToBytes(e){return Uint8Array.from(e,((t,n)=>{const o=t.charCodeAt(0);if(1!==t.length||o>127)throw new Error(`string contains non-ASCII character "${e[n]}" with code ${o} at position ${n}`);return o}))}const isPosBig$1=e=>"bigint"==typeof e&&_0n$8<=e;function inRange$1(e,t,n){return isPosBig$1(e)&&isPosBig$1(t)&&isPosBig$1(n)&&t<=e&&e<n}function aInRange$1(e,t,n,o){if(!inRange$1(t,n,o))throw new Error("expected valid "+e+": "+n+" <= n < "+o+", got "+t)}function bitLen$1(e){let t;for(t=0;e>_0n$8;e>>=_1n$7,t+=1);return t}const bitMask$1=e=>(_1n$7<<BigInt(e))-_1n$7;function createHmacDrbg$1(e,t,n){if(anumber$4(e,"hashLen"),anumber$4(t,"qByteLen"),"function"!=typeof n)throw new Error("hmacFn must be a function");const o=e=>new Uint8Array(e),r=Uint8Array.of(),s=Uint8Array.of(0),i=Uint8Array.of(1);let a=o(e),c=o(e),l=0;const d=()=>{a.fill(1),c.fill(0),l=0},h=(...e)=>n(c,concatBytes$1(a,...e)),u=(e=r)=>{c=h(s,e),a=h(),0!==e.length&&(c=h(i,e),a=h())},f=()=>{if(l++>=1e3)throw new Error("drbg: tried max amount of iterations");let e=0;const n=[];for(;e<t;){a=h();const t=a.slice();n.push(t),e+=a.length}return concatBytes$1(...n)};return(e,t)=>{let n;for(d(),u(e);!(n=t(f()));)u();return d(),n}}function validateObject(e,t={},n={}){if(!e||"object"!=typeof e)throw new Error("expected valid options object");const o=(t,n)=>Object.entries(t).forEach((([t,o])=>function(t,n,o){const r=e[t];if(o&&void 0===r)return;const s=typeof r;if(s!==n||null===r)throw new Error(`param "${t}" is invalid: expected ${n}, got ${s}`)}(t,o,n)));o(t,!1),o(n,!0)}function memoized$1(e){const t=new WeakMap;return(n,...o)=>{const r=t.get(n);if(void 0!==r)return r;const s=e(n,...o);return t.set(n,s),s}}
|
|
@@ -15,5 +15,5 @@ function isBytes$4(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Ui
|
|
|
15
15
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const divNearest=(e,t)=>(e+(e>=0?t:-t)/_2n$1)/t;function _splitEndoScalar(e,t,n){const[[o,r],[s,i]]=t,a=divNearest(i*e,n),c=divNearest(-r*e,n);let l=e-a*o-c*s,d=-a*r-c*i;const h=l<_0n,u=d<_0n;h&&(l=-l),u&&(d=-d);const f=bitMask(Math.ceil(bitLen(n)/2))+_1n;if(l<_0n||l>=f||d<_0n||d>=f)throw new Error("splitScalar (endomorphism): failed, k="+e);return{k1neg:h,k1:l,k2neg:u,k2:d}}function validateSigFormat(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function validateSigOpts(e,t){const n={};for(let o of Object.keys(t))n[o]=void 0===e[o]?t[o]:e[o];return _abool2(n.lowS,"lowS"),_abool2(n.prehash,"prehash"),void 0!==n.format&&validateSigFormat(n.format),n}class DERErr extends Error{constructor(e=""){super(e)}}const DER={Err:DERErr,_tlv:{encode:(e,t)=>{const{Err:n}=DER;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(1&t.length)throw new n("tlv.encode: unpadded data");const o=t.length/2,r=numberToHexUnpadded(o);if(r.length/2&128)throw new n("tlv.encode: long form length too big");const s=o>127?numberToHexUnpadded(r.length/2|128):"";return numberToHexUnpadded(e)+s+r+t},decode(e,t){const{Err:n}=DER;let o=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[o++]!==e)throw new n("tlv.decode: wrong tlv");const r=t[o++];let s=0;if(!!(128&r)){const e=127&r;if(!e)throw new n("tlv.decode(long): indefinite length not supported");if(e>4)throw new n("tlv.decode(long): byte length is too big");const i=t.subarray(o,o+e);if(i.length!==e)throw new n("tlv.decode: length bytes not complete");if(0===i[0])throw new n("tlv.decode(long): zero leftmost byte");for(const e of i)s=s<<8|e;if(o+=e,s<128)throw new n("tlv.decode(long): not minimal encoding")}else s=r;const i=t.subarray(o,o+s);if(i.length!==s)throw new n("tlv.decode: wrong value length");return{v:i,l:t.subarray(o+s)}}},_int:{encode(e){const{Err:t}=DER;if(e<_0n)throw new t("integer: negative integers are not allowed");let n=numberToHexUnpadded(e);if(8&Number.parseInt(n[0],16)&&(n="00"+n),1&n.length)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=DER;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return bytesToNumberBE(e)}},toSig(e){const{Err:t,_int:n,_tlv:o}=DER,r=ensureBytes("signature",e),{v:s,l:i}=o.decode(48,r);if(i.length)throw new t("invalid signature: left bytes after parsing");const{v:a,l:c}=o.decode(2,s),{v:l,l:d}=o.decode(2,c);if(d.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(a),s:n.decode(l)}},hexFromSig(e){const{_tlv:t,_int:n}=DER,o=t.encode(2,n.encode(e.r))+t.encode(2,n.encode(e.s));return t.encode(48,o)}},_0n=BigInt(0),_1n=BigInt(1),_2n$1=BigInt(2),_3n=BigInt(3),_4n=BigInt(4);function _normFnElement(e,t){const{BYTES:n}=e;let o;if("bigint"==typeof t)o=t;else{let r=ensureBytes("private key",t);try{o=e.fromBytes(r)}catch(e){throw new Error(`invalid private key: expected ui8a of size ${n}, got ${typeof t}`)}}if(!e.isValidNot0(o))throw new Error("invalid private key: out of range [1..N-1]");return o}function weierstrassN(e,t={}){const n=_createCurveFields("weierstrass",e,t),{Fp:o,Fn:r}=n;let s=n.CURVE;const{h:i,n:a}=s;_validateObject(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:c}=t;if(c&&(!o.is0(s.a)||"bigint"!=typeof c.beta||!Array.isArray(c.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const l=getWLengths(o,r);function d(){if(!o.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}const h=t.toBytes||function(e,t,n){const{x:r,y:s}=t.toAffine(),i=o.toBytes(r);if(_abool2(n,"isCompressed"),n){d();return concatBytes(pprefix(!o.isOdd(s)),i)}return concatBytes(Uint8Array.of(4),i,o.toBytes(s))},u=t.fromBytes||function(e){_abytes2(e,void 0,"Point");const{publicKey:t,publicKeyUncompressed:n}=l,r=e.length,s=e[0],i=e.subarray(1);if(r!==t||2!==s&&3!==s){if(r===n&&4===s){const e=o.BYTES,t=o.fromBytes(i.subarray(0,e)),n=o.fromBytes(i.subarray(e,2*e));if(!p(t,n))throw new Error("bad point: is not on curve");return{x:t,y:n}}throw new Error(`bad point: got length ${r}, expected compressed=${t} or uncompressed=${n}`)}{const e=o.fromBytes(i);if(!o.isValid(e))throw new Error("bad point: is not on curve, wrong x");const t=f(e);let n;try{n=o.sqrt(t)}catch(e){const t=e instanceof Error?": "+e.message:"";throw new Error("bad point: is not on curve, sqrt error"+t)}d();return!(1&~s)!==o.isOdd(n)&&(n=o.neg(n)),{x:e,y:n}}};function f(e){const t=o.sqr(e),n=o.mul(t,e);return o.add(o.add(n,o.mul(e,s.a)),s.b)}function p(e,t){const n=o.sqr(t),r=f(e);return o.eql(n,r)}if(!p(s.Gx,s.Gy))throw new Error("bad curve params: generator point");const g=o.mul(o.pow(s.a,_3n),_4n),m=o.mul(o.sqr(s.b),BigInt(27));if(o.is0(o.add(g,m)))throw new Error("bad curve params: a or b");function b(e,t,n=!1){if(!o.isValid(t)||n&&o.is0(t))throw new Error(`bad point coordinate ${e}`);return t}function y(e){if(!(e instanceof x))throw new Error("ProjectivePoint expected")}function w(e){if(!c||!c.basises)throw new Error("no endo");return _splitEndoScalar(e,c.basises,r.ORDER)}const v=memoized(((e,t)=>{const{X:n,Y:r,Z:s}=e;if(o.eql(s,o.ONE))return{x:n,y:r};const i=e.is0();null==t&&(t=i?o.ONE:o.inv(s));const a=o.mul(n,t),c=o.mul(r,t),l=o.mul(s,t);if(i)return{x:o.ZERO,y:o.ZERO};if(!o.eql(l,o.ONE))throw new Error("invZ was invalid");return{x:a,y:c}})),k=memoized((e=>{if(e.is0()){if(t.allowInfinityPoint&&!o.is0(e.Y))return;throw new Error("bad point: ZERO")}const{x:n,y:r}=e.toAffine();if(!o.isValid(n)||!o.isValid(r))throw new Error("bad point: x or y not field elements");if(!p(n,r))throw new Error("bad point: equation left != right");if(!e.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0}));function E(e,t,n,r,s){return n=new x(o.mul(n.X,e),n.Y,n.Z),t=negateCt(r,t),n=negateCt(s,n),t.add(n)}class x{constructor(e,t,n){this.X=b("x",e),this.Y=b("y",t,!0),this.Z=b("z",n),Object.freeze(this)}static CURVE(){return s}static fromAffine(e){const{x:t,y:n}=e||{};if(!e||!o.isValid(t)||!o.isValid(n))throw new Error("invalid affine point");if(e instanceof x)throw new Error("projective point not allowed");return o.is0(t)&&o.is0(n)?x.ZERO:new x(t,n,o.ONE)}static fromBytes(e){const t=x.fromAffine(u(_abytes2(e,void 0,"point")));return t.assertValidity(),t}static fromHex(e){return x.fromBytes(ensureBytes("pointHex",e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return B.createCache(this,e),t||this.multiply(_3n),this}assertValidity(){k(this)}hasEvenY(){const{y:e}=this.toAffine();if(!o.isOdd)throw new Error("Field doesn't support isOdd");return!o.isOdd(e)}equals(e){y(e);const{X:t,Y:n,Z:r}=this,{X:s,Y:i,Z:a}=e,c=o.eql(o.mul(t,a),o.mul(s,r)),l=o.eql(o.mul(n,a),o.mul(i,r));return c&&l}negate(){return new x(this.X,o.neg(this.Y),this.Z)}double(){const{a:e,b:t}=s,n=o.mul(t,_3n),{X:r,Y:i,Z:a}=this;let c=o.ZERO,l=o.ZERO,d=o.ZERO,h=o.mul(r,r),u=o.mul(i,i),f=o.mul(a,a),p=o.mul(r,i);return p=o.add(p,p),d=o.mul(r,a),d=o.add(d,d),c=o.mul(e,d),l=o.mul(n,f),l=o.add(c,l),c=o.sub(u,l),l=o.add(u,l),l=o.mul(c,l),c=o.mul(p,c),d=o.mul(n,d),f=o.mul(e,f),p=o.sub(h,f),p=o.mul(e,p),p=o.add(p,d),d=o.add(h,h),h=o.add(d,h),h=o.add(h,f),h=o.mul(h,p),l=o.add(l,h),f=o.mul(i,a),f=o.add(f,f),h=o.mul(f,p),c=o.sub(c,h),d=o.mul(f,u),d=o.add(d,d),d=o.add(d,d),new x(c,l,d)}add(e){y(e);const{X:t,Y:n,Z:r}=this,{X:i,Y:a,Z:c}=e;let l=o.ZERO,d=o.ZERO,h=o.ZERO;const u=s.a,f=o.mul(s.b,_3n);let p=o.mul(t,i),g=o.mul(n,a),m=o.mul(r,c),b=o.add(t,n),w=o.add(i,a);b=o.mul(b,w),w=o.add(p,g),b=o.sub(b,w),w=o.add(t,r);let v=o.add(i,c);return w=o.mul(w,v),v=o.add(p,m),w=o.sub(w,v),v=o.add(n,r),l=o.add(a,c),v=o.mul(v,l),l=o.add(g,m),v=o.sub(v,l),h=o.mul(u,w),l=o.mul(f,m),h=o.add(l,h),l=o.sub(g,h),h=o.add(g,h),d=o.mul(l,h),g=o.add(p,p),g=o.add(g,p),m=o.mul(u,m),w=o.mul(f,w),g=o.add(g,m),m=o.sub(p,m),m=o.mul(u,m),w=o.add(w,m),p=o.mul(g,w),d=o.add(d,p),p=o.mul(v,w),l=o.mul(b,l),l=o.sub(l,p),p=o.mul(b,g),h=o.mul(v,h),h=o.add(h,p),new x(l,d,h)}subtract(e){return this.add(e.negate())}is0(){return this.equals(x.ZERO)}multiply(e){const{endo:n}=t;if(!r.isValidNot0(e))throw new Error("invalid scalar: out of range");let o,s;const i=e=>B.cached(this,e,(e=>normalizeZ(x,e)));if(n){const{k1neg:t,k1:r,k2neg:a,k2:c}=w(e),{p:l,f:d}=i(r),{p:h,f:u}=i(c);s=d.add(u),o=E(n.beta,l,h,t,a)}else{const{p:t,f:n}=i(e);o=t,s=n}return normalizeZ(x,[o,s])[0]}multiplyUnsafe(e){const{endo:n}=t,o=this;if(!r.isValid(e))throw new Error("invalid scalar: out of range");if(e===_0n||o.is0())return x.ZERO;if(e===_1n)return o;if(B.hasCache(this))return this.multiply(e);if(n){const{k1neg:t,k1:r,k2neg:s,k2:i}=w(e),{p1:a,p2:c}=mulEndoUnsafe(x,o,r,i);return E(n.beta,a,c,t,s)}return B.unsafe(o,e)}multiplyAndAddUnsafe(e,t,n){const o=this.multiplyUnsafe(t).add(e.multiplyUnsafe(n));return o.is0()?void 0:o}toAffine(e){return v(this,e)}isTorsionFree(){const{isTorsionFree:e}=t;return i===_1n||(e?e(x,this):B.unsafe(this,a).is0())}clearCofactor(){const{clearCofactor:e}=t;return i===_1n?this:e?e(x,this):this.multiplyUnsafe(i)}isSmallOrder(){return this.multiplyUnsafe(i).is0()}toBytes(e=!0){return _abool2(e,"isCompressed"),this.assertValidity(),h(x,this,e)}toHex(e=!0){return bytesToHex(this.toBytes(e))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(e=!0){return this.toBytes(e)}_setWindowSize(e){this.precompute(e)}static normalizeZ(e){return normalizeZ(x,e)}static msm(e,t){return pippenger(x,r,e,t)}static fromPrivateKey(e){return x.BASE.multiply(_normFnElement(r,e))}}x.BASE=new x(s.Gx,s.Gy,o.ONE),x.ZERO=new x(o.ZERO,o.ONE,o.ZERO),x.Fp=o,x.Fn=r;const C=r.BITS,B=new wNAF(x,t.endo?Math.ceil(C/2):C);return x.BASE.precompute(8),x}function pprefix(e){return Uint8Array.of(e?2:3)}function getWLengths(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function ecdh(e,t={}){const{Fn:n}=e,o=t.randomBytes||randomBytes,r=Object.assign(getWLengths(e.Fp,n),{seed:getMinHashLength(n.ORDER)});function s(e){try{return!!_normFnElement(n,e)}catch(e){return!1}}function i(e=o(r.seed)){return mapHashToField(_abytes2(e,r.seed,"seed"),n.ORDER)}function a(t,o=!0){return e.BASE.multiply(_normFnElement(n,t)).toBytes(o)}function c(t){if("bigint"==typeof t)return!1;if(t instanceof e)return!0;const{secretKey:o,publicKey:s,publicKeyUncompressed:i}=r;if(n.allowedLengths||o===s)return;const a=ensureBytes("key",t).length;return a===s||a===i}const l={isValidSecretKey:s,isValidPublicKey:function(t,n){const{publicKey:o,publicKeyUncompressed:s}=r;try{const r=t.length;return(!0!==n||r===o)&&((!1!==n||r===s)&&!!e.fromBytes(t))}catch(e){return!1}},randomSecretKey:i,isValidPrivateKey:s,randomPrivateKey:i,normPrivateKeyToScalar:e=>_normFnElement(n,e),precompute:(t=8,n=e.BASE)=>n.precompute(t,!1)};return Object.freeze({getPublicKey:a,getSharedSecret:function(t,o,r=!0){if(!0===c(t))throw new Error("first arg must be private key");if(!1===c(o))throw new Error("second arg must be public key");const s=_normFnElement(n,t);return e.fromHex(o).multiply(s).toBytes(r)},keygen:function(e){const t=i(e);return{secretKey:t,publicKey:a(t)}},Point:e,utils:l,lengths:r})}function ecdsa(e,t,n={}){ahash(t),_validateObject(n,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const o=n.randomBytes||randomBytes,r=n.hmac||((e,...n)=>hmac(t,e,concatBytes(...n))),{Fp:s,Fn:i}=e,{ORDER:a,BITS:c}=i,{keygen:l,getPublicKey:d,getSharedSecret:h,utils:u,lengths:f}=ecdh(e,n),p={prehash:!1,lowS:"boolean"==typeof n.lowS&&n.lowS,format:void 0,extraEntropy:!1},g="compact";function m(e){return e>a>>_1n}function b(e,t){if(!i.isValidNot0(t))throw new Error(`invalid signature ${e}: out of range 1..Point.Fn.ORDER`);return t}class y{constructor(e,t,n){this.r=b("r",e),this.s=b("s",t),null!=n&&(this.recovery=n),Object.freeze(this)}static fromBytes(e,t=g){let n;if(function(e,t){validateSigFormat(t);const n=f.signature;_abytes2(e,"compact"===t?n:"recovered"===t?n+1:void 0,`${t} signature`)}(e,t),"der"===t){const{r:t,s:n}=DER.toSig(_abytes2(e));return new y(t,n)}"recovered"===t&&(n=e[0],t="compact",e=e.subarray(1));const o=i.BYTES,r=e.subarray(0,o),s=e.subarray(o,2*o);return new y(i.fromBytes(r),i.fromBytes(s),n)}static fromHex(e,t){return this.fromBytes(hexToBytes(e),t)}addRecoveryBit(e){return new y(this.r,this.s,e)}recoverPublicKey(t){const n=s.ORDER,{r:o,s:r,recovery:c}=this;if(null==c||![0,1,2,3].includes(c))throw new Error("recovery id invalid");if(a*_2n$1<n&&c>1)throw new Error("recovery id is ambiguous for h>1 curve");const l=2===c||3===c?o+a:o;if(!s.isValid(l))throw new Error("recovery id 2 or 3 invalid");const d=s.toBytes(l),h=e.fromBytes(concatBytes(pprefix(!(1&c)),d)),u=i.inv(l),f=v(ensureBytes("msgHash",t)),p=i.create(-f*u),g=i.create(r*u),m=e.BASE.multiplyUnsafe(p).add(h.multiplyUnsafe(g));if(m.is0())throw new Error("point at infinify");return m.assertValidity(),m}hasHighS(){return m(this.s)}toBytes(e=g){if(validateSigFormat(e),"der"===e)return hexToBytes(DER.hexFromSig(this));const t=i.toBytes(this.r),n=i.toBytes(this.s);if("recovered"===e){if(null==this.recovery)throw new Error("recovery bit must be present");return concatBytes(Uint8Array.of(this.recovery),t,n)}return concatBytes(t,n)}toHex(e){return bytesToHex(this.toBytes(e))}assertValidity(){}static fromCompact(e){return y.fromBytes(ensureBytes("sig",e),"compact")}static fromDER(e){return y.fromBytes(ensureBytes("sig",e),"der")}normalizeS(){return this.hasHighS()?new y(this.r,i.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return bytesToHex(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return bytesToHex(this.toBytes("compact"))}}const w=n.bits2int||function(e){if(e.length>8192)throw new Error("input is too large");const t=bytesToNumberBE(e),n=8*e.length-c;return n>0?t>>BigInt(n):t},v=n.bits2int_modN||function(e){return i.create(w(e))},k=bitMask(c);function E(e){return aInRange("num < 2^"+c,e,_0n,k),i.toBytes(e)}function x(e,n){return _abytes2(e,void 0,"message"),n?_abytes2(t(e),void 0,"prehashed message"):e}return Object.freeze({keygen:l,getPublicKey:d,getSharedSecret:h,utils:u,lengths:f,Point:e,sign:function(n,s,a={}){n=ensureBytes("message",n);const{seed:c,k2sig:l}=function(t,n,r){if(["recovered","canonical"].some((e=>e in r)))throw new Error("sign() legacy options not supported");const{lowS:s,prehash:a,extraEntropy:c}=validateSigOpts(r,p);t=x(t,a);const l=v(t),d=_normFnElement(i,n),h=[E(d),E(l)];if(null!=c&&!1!==c){const e=!0===c?o(f.secretKey):c;h.push(ensureBytes("extraEntropy",e))}const u=concatBytes(...h),g=l;return{seed:u,k2sig:function(t){const n=w(t);if(!i.isValidNot0(n))return;const o=i.inv(n),r=e.BASE.multiply(n).toAffine(),a=i.create(r.x);if(a===_0n)return;const c=i.create(o*i.create(g+a*d));if(c===_0n)return;let l=(r.x===a?0:2)|Number(r.y&_1n),h=c;return s&&m(c)&&(h=i.neg(c),l^=1),new y(a,h,l)}}}(n,s,a);return createHmacDrbg(t.outputLen,i.BYTES,r)(c,l)},verify:function(t,n,o,r={}){const{lowS:s,prehash:a,format:c}=validateSigOpts(r,p);if(o=ensureBytes("publicKey",o),n=x(ensureBytes("message",n),a),"strict"in r)throw new Error("options.strict was renamed to lowS");const l=void 0===c?function(e){let t;const n="string"==typeof e||isBytes$1(e),o=!n&&null!==e&&"object"==typeof e&&"bigint"==typeof e.r&&"bigint"==typeof e.s;if(!n&&!o)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(o)t=new y(e.r,e.s);else if(n){try{t=y.fromBytes(ensureBytes("sig",e),"der")}catch(e){if(!(e instanceof DER.Err))throw e}if(!t)try{t=y.fromBytes(ensureBytes("sig",e),"compact")}catch(e){return!1}}return t||!1}(t):y.fromBytes(ensureBytes("sig",t),c);if(!1===l)return!1;try{const t=e.fromBytes(o);if(s&&l.hasHighS())return!1;const{r:r,s:a}=l,c=v(n),d=i.inv(a),h=i.create(c*d),u=i.create(r*d),f=e.BASE.multiplyUnsafe(h).add(t.multiplyUnsafe(u));if(f.is0())return!1;return i.create(f.x)===r}catch(e){return!1}},recoverPublicKey:function(e,t,n={}){const{prehash:o}=validateSigOpts(n,p);return t=x(t,o),y.fromBytes(e,"recovered").recoverPublicKey(t).toBytes()},Signature:y,hash:t})}function _weierstrass_legacy_opts_to_new(e){const t={a:e.a,b:e.b,p:e.Fp.ORDER,n:e.n,h:e.h,Gx:e.Gx,Gy:e.Gy},n=e.Fp;let o=e.allowedPrivateKeyLengths?Array.from(new Set(e.allowedPrivateKeyLengths.map((e=>Math.ceil(e/2))))):void 0;return{CURVE:t,curveOpts:{Fp:n,Fn:Field(t.n,{BITS:e.nBitLength,allowedLengths:o,modFromBytes:e.wrapPrivateKey}),allowInfinityPoint:e.allowInfinityPoint,endo:e.endo,isTorsionFree:e.isTorsionFree,clearCofactor:e.clearCofactor,fromBytes:e.fromBytes,toBytes:e.toBytes}}}function _ecdsa_legacy_opts_to_new(e){const{CURVE:t,curveOpts:n}=_weierstrass_legacy_opts_to_new(e),o={hmac:e.hmac,randomBytes:e.randomBytes,lowS:e.lowS,bits2int:e.bits2int,bits2int_modN:e.bits2int_modN};return{CURVE:t,curveOpts:n,hash:e.hash,ecdsaOpts:o}}function _ecdsa_new_output_to_legacy(e,t){const n=t.Point;return Object.assign({},t,{ProjectivePoint:n,CURVE:Object.assign({},e,nLength(n.Fn.ORDER,n.Fn.BITS))})}function weierstrass(e){const{CURVE:t,curveOpts:n,hash:o,ecdsaOpts:r}=_ecdsa_legacy_opts_to_new(e);return _ecdsa_new_output_to_legacy(e,ecdsa(weierstrassN(t,n),o,r))}
|
|
16
16
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function createCurve(e,t){const n=t=>weierstrass({...e,hash:t});return{...n(t),create:n}}
|
|
17
17
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const secp256k1_CURVE={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},secp256k1_ENDO={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},_2n=BigInt(2);function sqrtMod(e){const t=secp256k1_CURVE.p,n=BigInt(3),o=BigInt(6),r=BigInt(11),s=BigInt(22),i=BigInt(23),a=BigInt(44),c=BigInt(88),l=e*e*e%t,d=l*l*e%t,h=pow2(d,n,t)*d%t,u=pow2(h,n,t)*d%t,f=pow2(u,_2n,t)*l%t,p=pow2(f,r,t)*f%t,g=pow2(p,s,t)*p%t,m=pow2(g,a,t)*g%t,b=pow2(m,c,t)*m%t,y=pow2(b,a,t)*g%t,w=pow2(y,n,t)*d%t,v=pow2(w,i,t)*p%t,k=pow2(v,o,t)*l%t,E=pow2(k,_2n,t);if(!Fpk1.eql(Fpk1.sqr(E),e))throw new Error("Cannot find square root");return E}const Fpk1=Field(secp256k1_CURVE.p,{sqrt:sqrtMod}),secp256k1=createCurve({...secp256k1_CURVE,Fp:Fpk1,lowS:!0,endo:secp256k1_ENDO},sha256$1);function extract(e,t,n){return ahash(e),hmac(e,toBytes(n),toBytes(t))}const HKDF_COUNTER=Uint8Array.from([0]),EMPTY_BUFFER=Uint8Array.of();function expand(e,t,n,o=32){ahash(e),anumber$1(o);const r=e.outputLen;if(o>255*r)throw new Error("Length should be <= 255*HashLen");const s=Math.ceil(o/r);void 0===n&&(n=EMPTY_BUFFER);const i=new Uint8Array(s*r),a=hmac.create(e,t),c=a._cloneInto(),l=new Uint8Array(a.outputLen);for(let e=0;e<s;e++)HKDF_COUNTER[0]=e+1,c.update(0===e?EMPTY_BUFFER:l).update(n).update(HKDF_COUNTER).digestInto(l),i.set(l,r*e),a._cloneInto(c);return a.destroy(),c.destroy(),clean(l,HKDF_COUNTER),i.slice(0,o)}const sha256=sha256$1;
|
|
18
|
-
/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function isBytes(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function abytes(e,...t){if(!isBytes(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function isArrayOf(e,t){return!!Array.isArray(t)&&(0===t.length||(e?t.every((e=>"string"==typeof e)):t.every((e=>Number.isSafeInteger(e)))))}function astr(e,t){if("string"!=typeof t)throw new Error(`${e}: string expected`);return!0}function anumber(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function aArr(e){if(!Array.isArray(e))throw new Error("array expected")}function astrArr(e,t){if(!isArrayOf(!0,t))throw new Error(`${e}: array of strings expected`)}function anumArr(e,t){if(!isArrayOf(!1,t))throw new Error(`${e}: array of numbers expected`)}function chain(...e){const 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 alphabet(e){const t="string"==typeof e?e.split(""):e,n=t.length;astrArr("alphabet",t);const o=new Map(t.map(((e,t)=>[e,t])));return{encode:o=>(aArr(o),o.map((o=>{if(!Number.isSafeInteger(o)||o<0||o>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${o}". Allowed: ${e}`);return t[o]}))),decode:t=>(aArr(t),t.map((t=>{astr("alphabet.decode",t);const n=o.get(t);if(void 0===n)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return n})))}}function join(e=""){return astr("join",e),{encode:t=>(astrArr("join.decode",t),t.join(e)),decode:t=>(astr("join.decode",t),t.split(e))}}function padding(e,t="="){return anumber(e),astr("padding",t),{encode(n){for(astrArr("padding.encode",n);n.length*e%8;)n.push(t);return n},decode(n){astrArr("padding.decode",n);let o=n.length;if(o*e%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;o>0&&n[o-1]===t;o--){if((o-1)*e%8==0)throw new Error("padding: invalid, string has too much padding")}return n.slice(0,o)}}}const gcd=(e,t)=>0===t?e:gcd(t,e%t),radix2carry=(e,t)=>e+(t-gcd(e,t)),powers=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function convertRadix2(e,t,n,o){if(aArr(e),t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(radix2carry(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${radix2carry(t,n)}`);let r=0,s=0;const i=powers[t],a=powers[n]-1,c=[];for(const o of e){if(anumber(o),o>=i)throw new Error(`convertRadix2: invalid data word=${o} from=${t}`);if(r=r<<t|o,s+t>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${t}`);for(s+=t;s>=n;s-=n)c.push((r>>s-n&a)>>>0);const e=powers[s];if(void 0===e)throw new Error("invalid carry");r&=e-1}if(r=r<<n-s&a,!o&&s>=t)throw new Error("Excess padding");if(!o&&r>0)throw new Error(`Non-zero padding: ${r}`);return o&&s>0&&c.push(r>>>0),c}function radix2(e,t=!1){if(anumber(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(radix2carry(8,e)>32||radix2carry(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!isBytes(n))throw new Error("radix2.encode input should be Uint8Array");return convertRadix2(Array.from(n),8,e,!t)},decode:n=>(anumArr("radix2.decode",n),Uint8Array.from(convertRadix2(n,e,8,t)))}}const hasBase64Builtin=(()=>"function"==typeof Uint8Array.from([]).toBase64&&"function"==typeof Uint8Array.fromBase64)(),decodeBase64Builtin=(e,t)=>{astr("base64",e);if(e.length>0&&!/^[A-Za-z0-9=+/]+$/.test(e))throw new Error("invalid base64");return Uint8Array.fromBase64(e,{alphabet:"base64",lastChunkHandling:"strict"})},base64=hasBase64Builtin?{encode:e=>(abytes(e),e.toBase64()),decode:e=>decodeBase64Builtin(e)}:chain(radix2(6),alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),padding(6),join("")),decoder=new TextDecoder,u={minPlaintextSize:1,maxPlaintextSize:65535,utf8Encode:utf8ToBytes,utf8Decode:e=>decoder.decode(e),getConversationKey(e,t){const n=secp256k1.getSharedSecret(e,"02"+t).subarray(1,33);return extract(sha256,n,"nip44-v2")},getMessageKeys(e,t){const n=expand(sha256,e,t,76);return{chacha_key:n.subarray(0,32),chacha_nonce:n.subarray(32,44),hmac_key:n.subarray(44,76)}},calcPaddedLen(e){if(!Number.isSafeInteger(e)||e<1)throw new Error("expected positive integer");if(e<=32)return 32;const t=1<<Math.floor(Math.log2(e-1))+1,n=t<=256?32:t/8;return n*(Math.floor((e-1)/n)+1)},writeU16BE(e){if(!Number.isSafeInteger(e)||e<u.minPlaintextSize||e>u.maxPlaintextSize)throw new Error("invalid plaintext size: must be between 1 and 65535 bytes");const t=new Uint8Array(2);return new DataView(t.buffer).setUint16(0,e,!1),t},pad(e){const t=u.utf8Encode(e),n=t.length;return concatBytes(u.writeU16BE(n),t,new Uint8Array(u.calcPaddedLen(n)-n))},unpad(e){const t=new DataView(e.buffer).getUint16(0),n=e.subarray(2,2+t);if(t<u.minPlaintextSize||t>u.maxPlaintextSize||n.length!==t||e.length!==2+u.calcPaddedLen(t))throw new Error("invalid padding");return u.utf8Decode(n)},hmacAad(e,t,n){if(32!==n.length)throw new Error("AAD associated data must be 32 bytes");const o=concatBytes(n,t);return hmac(sha256,e,o)},decodePayload(e){if("string"!=typeof e)throw new Error("payload must be a valid string");const t=e.length;if(t<132||t>87472)throw new Error("invalid payload length: "+t);if("#"===e[0])throw new Error("unknown encryption version");let n;try{n=base64.decode(e)}catch(e){throw new Error("invalid base64: "+e.message)}const o=n.length;if(o<99||o>65603)throw new Error("invalid data length: "+o);const r=n[0];if(2!==r)throw new Error("unknown encryption version "+r);return{nonce:n.subarray(1,33),ciphertext:n.subarray(33,-32),mac:n.subarray(-32)}}};function encryptNip44(e,t,n=randomBytes(32)){const{chacha_key:o,chacha_nonce:r,hmac_key:s}=u.getMessageKeys(t,n),i=u.pad(e),a=chacha20$1(o,r,i),c=u.hmacAad(s,a,n);return base64.encode(concatBytes(new Uint8Array([2]),n,a,c))}function decryptNip44(e,t){const{nonce:n,ciphertext:o,mac:r}=u.decodePayload(e),{chacha_key:s,chacha_nonce:i,hmac_key:a}=u.getMessageKeys(t,n),c=u.hmacAad(a,o,n);if(!equalBytes$1(c,r))throw new Error("invalid MAC");const l=chacha20$1(s,i,o);return u.unpad(l)}class Nip44{cache=new Map;createKey(e,t){return u.getConversationKey(e,t)}getKey(e,t,n){const o=getPublicKey(hexToBytes(e))+t;let r=this.cache.get(o);if(r)return r;const s=this.createKey(e,t);return this.cache.set(o,s),s}encrypt(e,t,n){return encryptNip44(n,this.getKey(e,t))}decrypt(e,t,n){return decryptNip44(n,this.getKey(e,t))}}class PrivateKeySigner{nip44Codec=new Nip44;privateKey;_secretKey;pubkey;constructor(e){this.privateKey=e,this._secretKey=hexToBytes(e),this.pubkey=getPublicKey(this._secretKey)}async sign(e){const t={kind:e.kind,created_at:e.created_at,tags:e.tags,content:e.content};return finalizeEvent(t,this._secretKey).sig}async user(){return{pubkey:this.pubkey}}async encrypt(e,t){return nip04_exports.encrypt(this.privateKey,e.pubkey,t)}async decrypt(e,t){return nip04_exports.decrypt(this.privateKey,e.pubkey,t)}encryptNip44(e,t){return Promise.resolve(this.nip44Codec.encrypt(this.privateKey,e.pubkey,t))}decryptNip44(e,t){return Promise.resolve(this.nip44Codec.decrypt(this.privateKey,e.pubkey,t))}}const OUTBOX_RELAYS=["wss://user.kindpag.es","wss://purplepag.es","wss://relay.nos.social"],NOSTRCONNECT_APPS=[{name:"Nsec.app",domain:"nsec.app",canImport:!0,img:"https://nsec.app/assets/favicon.ico",link:"https://use.nsec.app/<nostrconnect>"},{name:"Amber",img:"https://raw.githubusercontent.com/greenart7c3/Amber/refs/heads/master/assets/android-icon.svg",link:"<nostrconnect>"},{name:"Other key stores",img:"",link:"<nostrconnect>"}],nostrJsonCache=new Map,NOSTR_JSON_CACHE_TTL=3e5,NOSTR_JSON_FETCH_TIMEOUT=5e3;async function fetchNostrJson(e){const t=nostrJsonCache.get(e);if(t&&Date.now()-t.timestamp<NOSTR_JSON_CACHE_TTL)return t.data;const n=new AbortController,o=setTimeout((()=>n.abort()),NOSTR_JSON_FETCH_TIMEOUT);try{const t=await(await fetch(`https://${e}/.well-known/nostr.json`,{signal:n.signal})).json();return nostrJsonCache.set(e,{data:t,timestamp:Date.now()}),t}finally{clearTimeout(o)}}function generatePrivateKey(){return bytesToHex(generateSecretKey())}class AuthNostrService extends lib.EventEmitter{pool;profilePool;signer=null;localSigner=null;params;signerPromise;signerErrCallback;readyPromise;readyCallback;nip44Codec=new Nip44;nostrConnectKey="";nostrConnectSecret="";iframe;starterReady;nip04;nip44;constructor(e){super(),this.params=e,this.pool=new RelayPool,this.profilePool=new RelayPool;for(const e of OUTBOX_RELAYS)this.profilePool.addRelay(e);this.profilePool.connect().catch((e=>console.warn("profilePool connect failed",e))),this.nip04={encrypt:this.encrypt04.bind(this),decrypt:this.decrypt04.bind(this)},this.nip44={encrypt:this.encrypt44.bind(this),decrypt:this.decrypt44.bind(this)}}isIframe(){return!!this.iframe}async waitReady(){if(this.signerPromise)try{await this.signerPromise}catch{}if(this.readyPromise)try{await this.readyPromise}catch{}}cancelNostrConnect(){console.log("cancelNostrConnect called"),this.releaseSigner(),this.resetAuth(),this.signerErrCallback&&(this.signerErrCallback("cancelled"),this.signerErrCallback=void 0)}cancelSignerInit(){this.cancelNostrConnect()}cancelPendingRequests(){if(console.log("cancelPendingRequests called (signer preserved)"),this.signer&&this.signer.rpc)try{this.signer.rpc.clearPendingRequests?.()}catch(e){console.warn("Failed to clear pending requests",e)}}async nostrConnect(e,{domain:t="",link:n="",iframeUrl:o="",importConnect:r=!1,customRelays:s}={}){console.log("[nostrConnect] Called",{relay:e,domain:t,link:n,iframeUrl:o,importConnect:r,customRelays:s});const i=s&&s.length>0?s:e?[e]:DEFAULT_NIP46_RELAYS,a={authMethod:"connect",pubkey:"",signerPubkey:"",sk:this.nostrConnectKey,domain:t,relays:i,iframeUrl:o};console.log("[nostrConnect] Created info",a,n),n&&!o&&(console.log("[nostrConnect] Opening Amber"),window.open(n,"_blank","width=400,height=700"));try{console.log("[nostrConnect] Calling initSigner with listen=true"),await this.initSigner(a,{listen:!0}),this.signerPromise&&(console.log("[nostrConnect] Waiting for signerPromise to complete"),await this.signerPromise,console.log("[nostrConnect] signerPromise completed"))}catch(e){throw console.error("[nostrConnect] Failed to initialize signer:",e),new Error(`Connection failed: ${e instanceof Error?e.message:"Unknown error"}`)}if(console.log("[nostrConnect] Checking pubkeys",{pubkey:a.pubkey,signerPubkey:a.signerPubkey}),!a.pubkey||!a.signerPubkey)throw console.error("[nostrConnect] Missing pubkeys after initialization"),new Error("Failed to get pubkey from signer");const c=i.map((e=>`relay=${encodeURIComponent(e)}`)).join("&");return a.bunkerUrl=`bunker://${a.signerPubkey}?${c}`,console.log("[nostrConnect] Generated bunkerUrl",a.bunkerUrl),r||(console.log("[nostrConnect] Calling onAuth"),this.onAuth("login",a)),console.log("[nostrConnect] Completed successfully"),a}async createNostrConnect(){this.nostrConnectKey=generatePrivateKey(),this.nostrConnectSecret=Math.random().toString(36).substring(7);const e=getPublicKey(hexToBytes(this.nostrConnectKey)),t=encodeURIComponent(document.location.host),n=encodeURIComponent(document.location.origin);return`nostrconnect://${e}?image=${encodeURIComponent(await getIcon())}&url=${n}&name=${t}&perms=${encodeURIComponent(this.params.optionsModal.perms||"")}&secret=${this.nostrConnectSecret}`}async getNostrConnectServices(e,t){const n=await this.createNostrConnect(),o=NOSTRCONNECT_APPS.map((e=>({...e}))),r=e&&e.length>0?e:DEFAULT_NIP46_RELAYS;for(const e of o)if(e.link.startsWith("https://")){e.available="loading";const t=r.map((e=>`&relay=${encodeURIComponent(e)}`)).join("");e.link=n+t}else{e.available=!0;const t=r.map((e=>`&relay=${encodeURIComponent(e)}`)).join(""),o=n+t;e.link=e.link.replace("<nostrconnect>",o)}t&&t([...o.map((e=>({...e})))]);const s=o.filter((e=>"loading"===e.available)).map((async s=>{const i=s.domain||"";try{const t=await fetchNostrJson(i),o=t.names._;let a=r;const c=t.nip46[o];!c||!c.length||e&&0!==e.length||(a=c),s.iframeUrl=t.nip46.iframe_url||"";const l=a.map((e=>`&relay=${encodeURIComponent(e)}`)).join(""),d=n+l;s.link=s.iframeUrl?d:s.link,s.available=!0}catch(e){console.log("Service unavailable",i,e),s.available=!1}t&&t([...o.map((e=>({...e})))])}));return await Promise.all(s),[n,o]}async localSignup(e,t){const n=!t;t=t||generatePrivateKey();const o={pubkey:getPublicKey(hexToBytes(t)),sk:t,name:e,authMethod:"local"};console.log(`localSignup name: ${e}`),await this.setLocal(o,n)}async setLocal(e,t){this.releaseSigner(),this.localSigner=new PrivateKeySigner(e.sk),t&&await createProfile(e,this.profilePool,this.localSigner,this.params.optionsModal.signupRelays,this.params.optionsModal.outboxRelays),this.onAuth(t?"signup":"login",e)}prepareImportUrl(e){if("otp"===this.params.userInfo?.authMethod)return e+"&import=true";if(!this.localSigner||"local"!==this.params.userInfo?.authMethod)throw new Error("Most be local keys");return e+"#import="+nip19_exports.nsecEncode(hexToBytes(this.localSigner.privateKey))}async importAndConnect(e){const{relay:t,domain:n,link:o,iframeUrl:r}=e;if(!n)throw new Error("Domain required");const s=await this.nostrConnect(t,{domain:n,link:o,importConnect:!0,iframeUrl:r});await this.logout(!0),this.localSigner=null,this.onAuth("login",s)}setReadOnly(e){const t={pubkey:e,authMethod:"readOnly"};this.onAuth("login",t)}setExtension(e){const t={pubkey:e,authMethod:"extension"};this.onAuth("login",t)}setOTP(e,t){const n={pubkey:e,authMethod:"otp",otpData:t};this.onAuth("login",n)}async setConnect(e){this.releaseSigner();try{if(await this.startAuth(),await this.initSigner(e,{connect:!0}),!e.pubkey||!e.signerPubkey)throw new Error("Failed to initialize signer: missing pubkey");this.onAuth("login",e),await this.endAuth()}catch(e){throw console.error("Failed to set connect:",e),this.resetAuth(),this.releaseSigner(),e}}async createAccount(e){const[t,n]=e.split("@"),o=await getBunkerUrl(`_@${n}`,this.params.optionsModal);console.log("create account bunker's url",o);const r=bunkerUrlToInfo(o);if(!r.signerPubkey)throw new Error("Bad bunker url");const s=Boolean(this.params.userInfo);await this.initSigner(r,{eventToAddAccount:s});return{bunkerUrl:`bunker://${await this.signer.createAccount2({bunkerPubkey:r.signerPubkey,name:t,domain:n,perms:this.params.optionsModal.perms})}?relay=${r.relays?.[0]}`,sk:r.sk}}releaseSigner(){if(console.log("releaseSigner called"),this.signer&&this.signer.rpc){try{this.signer.rpc.clearPendingRequests?.()}catch(e){console.warn("Failed to clear pending requests",e)}try{this.signer.rpc.stop?.()}catch(e){console.warn("Failed to stop RPC subscription",e)}}this.signer=null,this.signerErrCallback&&(this.signerErrCallback("cancelled"),this.signerErrCallback=void 0),this.localSigner=null,this.pool.removeAllRelays(),this.signerPromise=void 0}async logout(e=!1){e||this.releaseSigner(),localStorageRemoveCurrentAccount(),this.onAuth("logout"),this.emit("updateAccounts")}setUserInfo(e){this.params.userInfo=e,this.emit("onUserInfo",e),e&&(localStorageAddAccount(e),this.emit("updateAccounts"))}exportKeys(){return this.params.userInfo?"local"!==this.params.userInfo.authMethod?"":nip19_exports.nsecEncode(hexToBytes(this.params.userInfo.sk)):""}onAuth(e,t=null){if("logout"!==e&&!t)throw new Error("No user info in onAuth");if(t&&this.params.userInfo&&(t.pubkey!==this.params.userInfo.pubkey||t.authMethod!==this.params.userInfo.authMethod)){const e=new CustomEvent("nlAuth",{detail:{type:"logout"}});console.log("nostr-login auth",e.detail),document.dispatchEvent(e)}this.setUserInfo(t),t&&fetchProfile(t,this.profilePool).then((e=>{if(this.params.userInfo!==t)return;const n={...this.params.userInfo,picture:e?.image||e?.picture,name:e?.name||e?.displayName||e?.nip05||nip19_exports.npubEncode(t.pubkey)};this.setUserInfo(n)}));try{const n=t?nip19_exports.npubEncode(t.pubkey):"",o={type:e};"logout"===e?(this.iframe&&this.iframe.remove(),this.iframe=void 0):(o.pubkey=t.pubkey,o.name=t.name,t.sk&&(o.localNsec=nip19_exports.nsecEncode(hexToBytes(t.sk))),t.relays&&(o.relays=t.relays),t.otpData&&(o.otpData=t.otpData),o.method=t.authMethod||"connect");const r=new CustomEvent("nlAuth",{detail:o});console.log("nostr-login auth",o),document.dispatchEvent(r),this.params.optionsModal.onAuth&&this.params.optionsModal.onAuth(n,o)}catch(e){console.log("onAuth error",e)}}async createIframe(e){if(!e)return;const t=new URL(e);let n;const o="__nostr-login-worker-iframe-"+t.hostname.replaceAll(".","-");n=document.querySelector(`#${o}`),console.log("iframe",o,n),n||(n=document.createElement("iframe"),n.setAttribute("width","0"),n.setAttribute("height","0"),n.setAttribute("border","0"),n.style.display="none",n.id=o,document.body.append(n)),n.setAttribute("src",e);const r=new ReadyListener(["workerReady","workerError"],t.origin);await new Promise((e=>{n.addEventListener("load",e)}));const s=await r.wait();return console.log("nostr-login iframe ready",e,s),{iframe:n,port:s[1]}}async sendNeedAuth(){const[e]=await this.getNostrConnectServices(),t=new CustomEvent("nlNeedAuth",{detail:{nostrconnect:e}});console.log("nostr-login need auth",e),document.dispatchEvent(t)}isAuthing(){return!!this.readyCallback}async startAuth(){console.log("startAuth"),this.readyCallback&&(console.log("startAuth: previous auth still active, cancelling it first"),this.cancelNostrConnect()),this.readyPromise=new Promise((e=>this.readyCallback=e))}async endAuth(){if(console.log("endAuth",this.params.userInfo),this.params.userInfo&&this.params.userInfo.iframeUrl){const{iframe:e,port:t}=await this.createIframe(this.params.userInfo.iframeUrl)||{};if(this.iframe=e,!this.iframe||!t)return;this.signer.rpc.setWorkerIframePort(t)}this.readyCallback&&(this.readyCallback(),this.readyCallback=void 0)}resetAuth(){this.readyCallback&&(this.readyCallback(),this.readyCallback=void 0)}async listen(e){if(!e.iframeUrl)return this.signer.listen(this.nostrConnectSecret);const t=await this.starterReady.wait();if("starterError"===t[0])throw new Error(t[1]);return this.signer.setListenReply(t[1],this.nostrConnectSecret)}async connect(e,t){return this.signer.connect(e.token,t)}async initSigner(e,{listen:t=!1,connect:n=!1,eventToAddAccount:o=!1}={}){if(this.signerPromise)try{await this.signerPromise}catch(e){"cancelled"!==e&&console.error("Previous signer promise failed:",e)}console.log("initSigner info",e);const r=e.iframeUrl?new URL(e.iframeUrl).origin:void 0;return r&&(this.starterReady=new ReadyListener(["starterDone","starterError"],r)),this.emit("onIframeUrl",e.iframeUrl),this.signerPromise=new Promise((async(s,i)=>{this.signerErrCallback=e=>{console.log("Signer initialization cancelled or failed:",e),i(e)};try{if(e.relays&&!e.iframeUrl)for(const t of e.relays)this.pool.addRelay(t);await this.pool.connect(1e4);const i=new PrivateKeySigner(e.sk);this.signer=new Nip46Signer(this.pool,i,e.signerPubkey,r),this.signer.on("iframeRestart",(async()=>{const t=e.iframeUrl+(e.iframeUrl.includes("?")?"&":"?")+"pubkey="+e.pubkey+"&rebind="+i.pubkey;this.emit("iframeRestart",{pubkey:e.pubkey,iframeUrl:t})})),this.signer.on("authUrl",(t=>{console.log("nostr login auth url",t),this.emit("onAuthUrl",{url:t,iframeUrl:e.iframeUrl,eventToAddAccount:o})})),t?await this.listen(e):n?await this.connect(e,this.params.optionsModal.perms):await this.signer.initUserPubkey(e.pubkey),e.pubkey=this.signer.userPubkey,e.signerPubkey=this.signer.bunkerPubkey,console.log("Signer initialized successfully. User pubkey:",e.pubkey,"Signer pubkey:",e.signerPubkey),this.signerErrCallback=void 0,s()}catch(e){console.error("initSigner failure",e),this.signer=null,this.signerErrCallback=void 0,i(e)}})),this.signerPromise}async authNip46(e,{name:t,bunkerUrl:n,sk:o="",domain:r="",iframeUrl:s="",customRelays:i}){try{const a=bunkerUrlToInfo(n,o);if(isBunkerUrl(t)?a.bunkerUrl=t:(a.nip05=t,a.domain=t.split("@")[1]),r&&(a.domain=r),s&&(a.iframeUrl=s),i&&i.length>0&&(a.relays=i),!a.signerPubkey||!a.sk||!a.relays?.[0])throw new Error(`Bad bunker url ${n}`);const c=Boolean(this.params.userInfo);console.log("authNip46",e,a),await this.initSigner(a,{connect:!0,eventToAddAccount:c}),this.onAuth(e,a)}catch(e){throw console.error("nostr login auth failed",e),e}}async signEvent(e){if(this.localSigner)return e.pubkey=this.localSigner.pubkey,e.id=getEventHash(e),e.sig=await this.localSigner.sign(e),console.log("signed (local)",{event:e}),e;let t;for(let n=0;n<=2;n++)try{if(!this.signer)throw new Error("Signer is not initialized. Please reconnect.");await this.ensureRelayConnection(),e.pubkey=this.signer.userPubkey,e.id=getEventHash(e);const t=await(this.signer?.sign(e));return"object"==typeof t&&t.sig?(e.pubkey=t.pubkey||e.pubkey,e.id=t.id||e.id,e.sig=t.sig):e.sig=t,console.log("signed",{event:e,attempt:n}),e}catch(e){t=e;const o=e instanceof Nip46Error&&"SIGNER_REJECTED"===e.code,r=e instanceof Error&&("Cancelled by user"===e.message||"cancelled"===e.message);if(n<2&&!o&&!r){console.warn(`signEvent attempt ${n+1}/3 failed, retrying...`,e);try{await this.forceReconnect()}catch(e){console.warn("forceReconnect failed during retry, will try sign anyway",e)}continue}break}throw t}async forceReconnect(){console.log("forceReconnect: forcing clean relay reconnection..."),this.pool.disconnectAll(),this.ensureRelaysInPool(),await this.pool.connect(1e4),await this.waitForAtLeastOneRelay(8e3),await this.ensureSubscription()}async ensureRelayConnection(){this.ensureRelaysInPool();const e=this.pool.isAnyConnected(),t=!this.signer?.rpc||!1!==this.signer.rpc.isSubscriptionActive?.();e?t||(console.log("ensureRelayConnection: relay connected but subscription dead, resubscribing..."),await this.ensureSubscription()):(console.log("ensureRelayConnection: relay disconnected, forcing clean reconnect..."),this.pool.disconnectAll(),this.ensureRelaysInPool(),await this.pool.connect(1e4),await this.waitForAtLeastOneRelay(8e3),await this.ensureSubscription())}ensureRelaysInPool(){if(0===this.pool.relayUrls.length){console.warn("ensureRelaysInPool: no relays in pool, adding relays");const e=this.params.userInfo?.relays?.length?this.params.userInfo.relays:DEFAULT_NIP46_RELAYS;for(const t of e)this.pool.addRelay(t)}}async ensureSubscription(){if(this.signer&&this.signer.rpc)try{this.signer.rpc.resubscribe?.(),console.log("ensureSubscription: subscription re-established")}catch(e){console.warn("ensureSubscription: failed to resubscribe",e)}}async waitForAtLeastOneRelay(e){const t=Date.now();for(;Date.now()-t<e;){if(this.pool.isAnyConnected())return;await new Promise((e=>setTimeout(e,300)))}if(!this.pool.isAnyConnected())throw new Nip46Error("Failed to connect to any relay","RELAY_DISCONNECTED")}async codec_call(e,t,n){return new Promise(((o,r)=>{this.signer.rpc.sendRequest(this.signer.bunkerPubkey,e,[t,n],24133,(e=>{e.error?e.error.includes("timeout")||"Request timeout"===e.error?r(new Nip46Error(e.error,"TIMEOUT")):r(new Nip46Error(e.error,"SIGNER_REJECTED")):o(e.result)}))}))}async encrypt04(e,t){return await this.ensureRelayConnection(),this.localSigner?this.localSigner.encrypt({pubkey:e},t):this.signer.encrypt(e,t)}async decrypt04(e,t){return await this.ensureRelayConnection(),this.localSigner?this.localSigner.decrypt({pubkey:e},t):this.codec_call("nip04_decrypt",e,t)}async encrypt44(e,t){return await this.ensureRelayConnection(),this.localSigner?this.nip44Codec.encrypt(this.localSigner.privateKey,e,t):this.codec_call("nip44_encrypt",e,t)}async decrypt44(e,t){return await this.ensureRelayConnection(),this.localSigner?this.nip44Codec.decrypt(this.localSigner.privateKey,e,t):this.codec_call("nip44_decrypt",e,t)}}function loadCustomNip46Relays(){try{const e=localStorage.getItem("customNip46Relays");if(e){const t=JSON.parse(e);if(Array.isArray(t)&&t.length>0)return t}}catch(e){console.error("Failed to load custom relays from localStorage",e)}return[...DEFAULT_NIP46_RELAYS]}class ModalManager extends lib.EventEmitter{modal=null;params;extensionService;authNostrService;launcherPromise;accounts=[];recents=[];opt;customNip46Relays=loadCustomNip46Relays();constructor(e,t,n){super(),this.params=e,this.extensionService=n,this.authNostrService=t}async waitReady(){if(this.launcherPromise){try{await this.launcherPromise}catch{}this.launcherPromise=void 0}}async launch(e){console.log("nostr-login launch",e),this.launcherPromise&&await this.waitReady(),this.authNostrService.isAuthing()&&this.authNostrService.resetAuth(),this.customNip46Relays=loadCustomNip46Relays(),this.opt=e;const t=document.createElement("dialog");if(this.modal=document.createElement("nl-auth"),this.modal.accounts=this.accounts,this.modal.recents=this.recents,this.modal.setAttribute("dark-mode",String(getDarkMode(e))),e.theme&&this.modal.setAttribute("theme",e.theme),e.startScreen&&this.modal.setAttribute("start-screen",e.startScreen),e.bunkers)this.modal.setAttribute("bunkers",e.bunkers);else{let e="nsec.app,highlighter.com";this.modal.setAttribute("bunkers",e)}void 0!==e.methods&&(this.modal.authMethods=e.methods),void 0!==e.localSignup&&(this.modal.localSignup=e.localSignup),void 0!==e.signupNstart&&(this.modal.signupNjump=e.signupNstart),e.title&&(this.modal.welcomeTitle=e.title),e.description&&(this.modal.welcomeDescription=e.description),this.modal.hasExtension=this.extensionService.hasExtension(),this.modal.hasOTP=!!e.otpRequestUrl&&!!e.otpReplyUrl,this.modal.isLoadingExtension=!1,this.modal.isLoading=!1,t.appendChild(this.modal),document.body.appendChild(t),this.authNostrService.getNostrConnectServices(this.customNip46Relays,(e=>{this.modal&&(this.modal.connectionStringServices=e)})).then((([e,t])=>{this.modal&&(this.modal.connectionString=e,this.modal.connectionStringServices=t)})).catch((e=>{console.log("Failed to load nostr connect services",e)}));let n="";return this.launcherPromise=new Promise(((e,o)=>{t.addEventListener("close",(()=>{o(new Error("Closed")),this.authNostrService.resetAuth(),this.modal&&(document.body.removeChild(this.modal.parentNode),this.modal=null)}));const r=async e=>{this.modal&&(this.modal.isLoading=!1),await this.authNostrService.endAuth(),e(),t.close(),this.modal=null},s=async(t,n)=>{this.modal&&(this.modal.isLoading=!0);try{n&&!n.start||await this.authNostrService.startAuth(),await t(),n&&!n.end||await r(e)}catch(e){console.log("error",e),this.modal&&(this.modal.isLoading=!1,this.modal.authUrl="",this.modal.iframeUrl="","cancelled"!==e&&(this.modal.error=e.toString()))}},i=async(e,t)=>{await s((async()=>{const n=await getBunkerUrl(e,this.params.optionsModal);await this.authNostrService.authNip46("login",{name:e,bunkerUrl:n,domain:t,customRelays:this.customNip46Relays})}))},a=async e=>{await s((async()=>{const{bunkerUrl:t,sk:n}=await this.authNostrService.createAccount(e);await this.authNostrService.authNip46("signup",{name:e,bunkerUrl:t,sk:n})}))},c=async()=>{try{await navigator.clipboard.writeText(this.authNostrService.exportKeys()),localStorageSetItem("backupKey","true")}catch(e){console.error("Failed to copy to clipboard: ",e)}},l=async e=>{await s((async()=>{const{iframeUrl:t}=e;e.link=this.authNostrService.prepareImportUrl(e.link),this.modal&&t&&(this.modal.authUrl=e.link,this.modal.iframeUrl=t,console.log("nostrconnect authUrl",this.modal.authUrl,this.modal.iframeUrl)),await this.authNostrService.importAndConnect(e)}))},d=async e=>{await s((async()=>{const{relay:t,domain:n,link:o,iframeUrl:r}=e||{};console.log("nostrConnect",e,t,n,o,r),this.modal&&r&&(this.modal.authUrl=o,this.modal.iframeUrl=r,console.log("nostrconnect authUrl",this.modal.authUrl,this.modal.iframeUrl)),!e&&this.modal&&(this.modal.isLoading=!1),await this.authNostrService.nostrConnect(t,{domain:n,link:o,iframeUrl:r,customRelays:this.customNip46Relays})}))},h=async e=>{await s((async()=>{if(!e)throw new Error("Please enter some nickname");await this.authNostrService.localSignup(e)}))},u=async()=>{await s((async()=>{const e=new URL(window.location.href),t=e.hostname.toLocaleLowerCase().replace(/^www\./i,"").charAt(0).toUpperCase()+e.hostname.slice(1),n=prepareSignupRelays(this.params.optionsModal.signupRelays);return this.modal.njumpIframe=`\n <html><body>\n <script src='https://start.njump.me/modal.js'><\/script>\n <script>\n new NstartModal({\n baseUrl: 'https://start.njump.me',\n // Required parameters\n an: '${t}',\n // Optional parameters\n s: [${this.opt.followNpubs?`'${this.opt.followNpubs}'`:""}],\n afb: false, // forceBunker\n asb: false, // skipBunker\n aan: false, // avoidNsec\n aac: true, // avoidNcryptsec\n ahc: true, // hide close button\n arr: ${JSON.stringify(n)}, //readRelays\n awr: ${JSON.stringify(n)}, //writeRelays\n // Callbacks\n onComplete: (result) => {\n console.log('Login token:', result.nostrLogin);\n window.parent.location.href='${window.location.href}#nostr-login='+result.nostrLogin;\n },\n onCancel: () => {\n window.parent.location.href='${window.location.href}#nostr-login=null';\n },\n }).open();\n <\/script>\n </body></html>\n `.replaceAll("&","&"),new Promise(((e,t)=>{const n=async n=>{if(console.log("nsecOrBunker",n),n.startsWith("nsec1")){let t;try{t=nip19_exports.decode(n)}catch(e){throw new Error("Bad nsec value")}if("nsec"!==t.type)throw new Error("Bad bech32 type");await this.authNostrService.localSignup("",bytesToHex(t.data)),e()}else n.startsWith("bunker:")?(await this.authNostrService.authNip46("login",{name:"",bunkerUrl:n}),e()):t("null"===n?"Cancelled":"Unknown return value")};window.addEventListener("hashchange",(async()=>{if(window.location.hash.startsWith("#nostr-login=")){const e=window.location.hash.split("#nostr-login=")[1],t=new URL(window.location.toString());t.hash="",window.history.replaceState({},"",t.toString()),n(e)}}))}))}))};if(!this.modal)throw new Error("WTH?");this.modal.addEventListener("handleContinue",(()=>{this.modal&&(this.modal.isLoading=!0,this.emit("onAuthUrlClick",this.modal.authUrl))})),this.modal.addEventListener("nlLogin",(e=>{i(e.detail)})),this.modal.addEventListener("nlRelaysChanged",(async e=>{if(this.customNip46Relays=e.detail,console.log("Custom Nip46 relays updated:",this.customNip46Relays),this.modal){const e=this.modal;await this.authNostrService.getNostrConnectServices(this.customNip46Relays,(t=>{e.connectionStringServices=t})).then((([t,n])=>{e.connectionString=t,e.connectionStringServices=n}))}})),this.modal.addEventListener("nlSignup",(e=>{a(e.detail)})),this.modal.addEventListener("nlLocalSignup",(e=>{h(e.detail)})),this.modal.addEventListener("nlLoginNsec",(async e=>{await s((async()=>{const t=e.detail;if(!t)throw new Error("Please enter your nsec");let n;try{n=nip19_exports.decode(t)}catch(e){throw new Error("Invalid nsec format")}if("nsec"!==n.type)throw new Error("Invalid key type, expected nsec");await this.authNostrService.localSignup("",bytesToHex(n.data))}))})),this.modal.addEventListener("nlSignupNjump",(e=>{u()})),this.modal.addEventListener("nlImportAccount",(e=>{l(e.detail)})),this.modal.addEventListener("nlExportKeys",(e=>{c()})),this.modal.addEventListener("handleLogoutBanner",(()=>{this.emit("onLogoutBanner")})),this.modal.addEventListener("nlNostrConnect",(e=>{d(e.detail)})),this.modal.addEventListener("nlNostrConnectDefault",(()=>{this.authNostrService.isAuthing()||d()})),this.modal.addEventListener("nlNostrConnectDefaultCancel",(()=>{console.log("nlNostrConnectDefaultCancel"),this.authNostrService.cancelNostrConnect()})),this.modal.addEventListener("nlSwitchAccount",(e=>{const n=e.detail;this.emit("onSwitchAccount",n),setTimeout((()=>t.close()),300)})),this.modal.addEventListener("nlLoginRecentAccount",(async e=>{const n=e.detail;if("readOnly"===n.authMethod)this.authNostrService.setReadOnly(n.pubkey),t.close();else if("otp"===n.authMethod)try{this.modal.dispatchEvent(new CustomEvent("nlLoginOTPUser",{detail:n.nip05||n.pubkey}))}catch(e){console.error(e)}else if("extension"===n.authMethod)await this.extensionService.trySetExtensionForPubkey(n.pubkey),t.close();else{const e=n.bunkerUrl||n.nip05;if(!e)throw new Error("Bad connect info");i(e,n.domain)}})),this.modal.addEventListener("nlRemoveRecent",(e=>{localStorageRemoveRecent(e.detail),this.emit("updateAccounts")}));const f=async e=>{let t="";if(e.includes("@")){const{error:n,pubkey:o}=await checkNip05(e);if(!o)throw new Error(n);t=o}else if(e.startsWith("npub")){const{type:n,data:o}=nip19_exports.decode(e);if("npub"!==n)throw new Error("Bad npub");t=o}else 64===e.trim().length&&(t=e.trim(),nip19_exports.npubEncode(t));return t};this.modal.addEventListener("nlLoginReadOnly",(async e=>{await s((async()=>{const t=e.detail,n=await f(t);this.authNostrService.setReadOnly(n)}))})),this.modal.addEventListener("nlLoginExtension",(async()=>{if(!this.extensionService.hasExtension())throw new Error("No extension");await s((async()=>{this.modal&&(this.modal.isLoadingExtension=!0,await this.extensionService.setExtension(),this.modal.isLoadingExtension=!1)}))})),this.modal.addEventListener("nlLoginOTPUser",(async e=>{await s((async()=>{if(!this.modal)return;const t=e.detail,o=await f(t),r=this.opt.otpRequestUrl+(this.opt.otpRequestUrl.includes("?")?"&":"?")+"pubkey="+o,s=await fetch(r);if(200!==s.status)throw console.warn("nostr-login: bad otp reply",s),new Error("Failed to send DM");this.modal.isOTP=!0,n=o,this.modal.isLoading=!1}),{start:!0})})),this.modal.addEventListener("nlLoginOTPCode",(async e=>{await s((async()=>{if(!this.modal)return;const t=e.detail,o=this.opt.otpReplyUrl+(this.opt.otpRequestUrl.includes("?")?"&":"?")+"pubkey="+n+"&code="+t,r=await fetch(o);if(200!==r.status)throw console.warn("nostr-login: bad otp reply",r),new Error("Invalid code");const s=await r.text();this.authNostrService.setOTP(n,s),this.modal.isOTP=!1}),{end:!0})})),this.modal.addEventListener("nlCheckSignup",(async e=>{const{available:t,taken:n,error:o}=await checkNip05(e.detail);this.modal&&(this.modal.error=String(o),!o&&n&&(this.modal.error="Already taken"),this.modal.signupNameIsAvailable=t)})),this.modal.addEventListener("nlCheckLogin",(async e=>{const{available:t,taken:n,error:o}=await checkNip05(e.detail);this.modal&&(this.modal.error=String(o),t&&(this.modal.error="Name not found"),this.modal.loginIsGood=n)}));const p=()=>{this.modal&&(this.modal.isLoading=!1),this.authNostrService.isAuthing()&&this.authNostrService.cancelSignerInit(),t.close(),o(new Error("Cancelled"))};this.modal.addEventListener("stopFetchHandler",p),this.modal.addEventListener("nlCloseModal",p),this.modal.addEventListener("nlChangeDarkMode",(e=>{setDarkMode(e.detail),document.dispatchEvent(new CustomEvent("nlDarkMode",{detail:e.detail}))})),this.on("onIframeAuthUrlCallEnd",(()=>{t.close(),this.modal=null,e()})),t.showModal()})),this.launcherPromise}async showIframeUrl(e){await this.waitReady(),this.launch({startScreen:"iframe"}).catch((()=>console.log("closed auth iframe"))),this.modal.authUrl=e}connectModals(e){const t=async e=>{await this.launch(e)},n=document.getElementsByTagName("nl-button");for(let o=0;o<n.length;o++){const r=n[o].getAttribute("nl-theme"),s=n[o].getAttribute("start-screen"),i={...e};switch(r&&(i.theme=r),s){case"login":case"login-bunker-url":case"login-read-only":case"signup":case"switch-account":case"welcome":i.startScreen=s}n[o].addEventListener("click",(function(){t(i)}))}}onAuthUrl(e){this.modal&&(this.modal.authUrl=e,this.modal.isLoading=!1)}onIframeUrl(e){this.modal&&(console.log("modal iframe url",e),this.modal.iframeUrl=e)}onCallEnd(){this.modal&&this.modal.authUrl&&this.params.userInfo?.iframeUrl&&this.emit("onIframeAuthUrlCallEnd")}onUpdateAccounts(e,t){this.accounts=e,this.recents=t,this.modal&&(this.modal.accounts=e,this.modal.recents=t)}onDarkMode(e){this.modal&&(this.modal.darkMode=e)}}class Nostr{#e;nip04;nip44;constructor(e){this.#e=e,this.getPublicKey=this.getPublicKey.bind(this),this.signEvent=this.signEvent.bind(this),this.getRelays=this.getRelays.bind(this),this.nip04={encrypt:this.encrypt04.bind(this),decrypt:this.decrypt04.bind(this)},this.nip44={encrypt:this.encrypt44.bind(this),decrypt:this.decrypt44.bind(this)}}async ensureAuth(){if(await this.#e.waitReady(),!this.#e.getUserInfo()&&(await this.#e.launch(),!this.#e.getUserInfo()))throw new Error("Rejected by user")}async getPublicKey(){await this.ensureAuth();const e=this.#e.getUserInfo();if(e)return e.pubkey;throw new Error("No user")}async signEvent(e){return await this.ensureAuth(),this.#e.wait((async()=>await this.#e.getSigner().signEvent(e)))}async getRelays(){return{}}async encrypt04(e,t){return await this.ensureAuth(),this.#e.wait((async()=>await this.#e.getSigner().nip04.encrypt(e,t)))}async decrypt04(e,t){return await this.ensureAuth(),this.#e.wait((async()=>await this.#e.getSigner().nip04.decrypt(e,t)))}async encrypt44(e,t){return await this.ensureAuth(),this.#e.wait((async()=>await this.#e.getSigner().nip44.encrypt(e,t)))}async decrypt44(e,t){return await this.ensureAuth(),this.#e.wait((async()=>await this.#e.getSigner().nip44.decrypt(e,t)))}}class NostrExtensionService extends lib.EventEmitter{params;nostrExtension;constructor(e){super(),this.params=e}startCheckingExtension(e){if(this.checkExtension(e))return;const t=setInterval((()=>{this.checkExtension(e)&&clearTimeout(t)}),100)}checkExtension(e){return!(this.nostrExtension||!window.nostr||window.nostr===e)&&(this.initExtension(e),!0)}async initExtension(e,t){this.nostrExtension=window.nostr,window.nostr=e,"extension"===this.params.userInfo?.authMethod&&await this.trySetExtensionForPubkey(this.params.userInfo.pubkey),t||setTimeout((()=>{window.nostr!==e&&this.nostrExtension!==window.nostr&&this.initExtension(e,!0)}),300)}async setExtensionReadPubkey(e){window.nostr=this.nostrExtension;const t=await window.nostr.getPublicKey();e&&e!==t?this.emit("extensionLogout"):this.emit("extensionLogin",t)}async trySetExtensionForPubkey(e){if(this.nostrExtension)return this.setExtensionReadPubkey(e)}async setExtension(){return this.setExtensionReadPubkey()}unsetExtension(e){window.nostr===this.nostrExtension&&(window.nostr=e)}getExtension(){return this.nostrExtension}hasExtension(){return!!this.nostrExtension}}class NostrParams{userInfo;optionsModal;constructor(){this.userInfo=null,this.optionsModal={theme:"default",startScreen:"welcome",devOverrideBunkerOrigin:""}}}class Popup{popup=null;constructor(){}openPopup(e){if((!this.popup||this.popup.closed)&&(this.popup=window.open(e,"_blank","width=400,height=700"),console.log("popup",this.popup),!this.popup))throw new Error("Popup blocked. Try again, please!")}closePopup(){try{this.popup?.close(),this.popup=null}catch{}}}class ProcessManager extends lib.EventEmitter{callCount=0;callTimer;pendingCalls=new Map;callIdCounter=0;constructor(){super()}cancelAllPendingCalls(){for(const[e,{reject:t}]of this.pendingCalls.entries())t(new Error("Cancelled by user"));this.pendingCalls.clear(),this.callTimer&&(clearTimeout(this.callTimer),this.callTimer=void 0),this.callCount=0}onAuthUrl(){this.callTimer&&(clearTimeout(this.callTimer),this.callTimer=setTimeout((()=>this.emit("onCallTimeout")),AUTH_URL_CALL_TIMEOUT))}onIframeUrl(){Boolean(this.callTimer)&&clearTimeout(this.callTimer)}async wait(e){this.callTimer||(this.callTimer=setTimeout((()=>this.emit("onCallTimeout")),CALL_TIMEOUT)),this.callCount||this.emit("onCallStart"),this.callCount++;const t=this.callIdCounter++;let n,o;try{o=await new Promise((async(n,o)=>{this.pendingCalls.set(t,{reject:o});try{const o=await e();this.pendingCalls.delete(t),n(o)}catch(e){this.pendingCalls.delete(t),o(e)}}))}catch(e){n=e}if(this.callCount--,this.emit("onCallEnd"),this.callTimer&&clearTimeout(this.callTimer),this.callTimer=void 0,n)throw n;return o}}class NostrLoginInitializer{extensionService;params;authNostrService;nostr;processManager;popupManager;bannerManager;modalManager;customLaunchCallback;constructor(){this.params=new NostrParams,this.processManager=new ProcessManager,this.popupManager=new Popup,this.bannerManager=new BannerManager(this.params),this.authNostrService=new AuthNostrService(this.params),this.extensionService=new NostrExtensionService(this.params),this.modalManager=new ModalManager(this.params,this.authNostrService,this.extensionService);const e={waitReady:async()=>{await this.authNostrService.waitReady(),await this.modalManager.waitReady()},getUserInfo:()=>this.params.userInfo,getSigner:()=>{if("readOnly"===this.params.userInfo.authMethod)throw new Error("Read only");return"extension"===this.params.userInfo.authMethod?this.extensionService.getExtension():this.authNostrService},launch:()=>this.launch(),wait:e=>this.processManager.wait(e)};this.nostr=new Nostr(e),this.processManager.on("onCallTimeout",(()=>{this.bannerManager.onCallTimeout()})),this.processManager.on("onCallEnd",(()=>{this.bannerManager.onCallEnd(),this.modalManager.onCallEnd()})),this.processManager.on("onCallStart",(()=>{this.bannerManager.onCallStart()})),this.authNostrService.on("onIframeUrl",(e=>{this.modalManager.onIframeUrl(e)})),this.authNostrService.on("iframeRestart",(({iframeUrl:e})=>{this.processManager.onIframeUrl(),this.bannerManager.onIframeRestart(e)})),this.authNostrService.on("onAuthUrl",(({url:e,iframeUrl:t,eventToAddAccount:n})=>{this.processManager.onAuthUrl(),n?this.modalManager.onAuthUrl(e):this.params.userInfo?this.bannerManager.onAuthUrl(e,t):this.modalManager.onAuthUrl(e)})),this.authNostrService.on("updateAccounts",(()=>{this.updateAccounts()})),this.authNostrService.on("onUserInfo",(e=>{this.bannerManager.onUserInfo(e)})),this.modalManager.on("onAuthUrlClick",(e=>{this.openPopup(e)})),this.bannerManager.on("onIframeAuthUrlClick",(e=>{this.modalManager.showIframeUrl(e)})),this.modalManager.on("onSwitchAccount",(async e=>{this.switchAccount(e)})),this.modalManager.on("onLogoutBanner",(async e=>{logout()})),this.bannerManager.on("onConfirmLogout",(async()=>{this.launch("confirm-logout")})),this.modalManager.on("updateAccounts",(()=>{this.updateAccounts()})),this.bannerManager.on("logout",(()=>{logout()})),this.bannerManager.on("onAuthUrlClick",(e=>{this.openPopup(e)})),this.bannerManager.on("onSwitchAccount",(async e=>{this.switchAccount(e)})),this.bannerManager.on("import",(()=>{this.launch("import")})),this.extensionService.on("extensionLogin",(e=>{this.authNostrService.setExtension(e)})),this.extensionService.on("extensionLogout",(()=>{logout()})),this.bannerManager.on("launch",(e=>{this.launch(e)})),this.bannerManager.on("cancelTimeout",(()=>{this.authNostrService.cancelPendingRequests(),this.processManager.cancelAllPendingCalls(),this.bannerManager.onCallEnd()}))}openPopup(e){this.popupManager.openPopup(e)}async switchAccount(e,t=!1){if(console.log("nostr login switch to info",e),this.extensionService.unsetExtension(this.nostr),"readOnly"===e.authMethod)this.authNostrService.setReadOnly(e.pubkey);else if("otp"===e.authMethod)this.authNostrService.setOTP(e.pubkey,e.otpData||"");else if("local"===e.authMethod&&e.sk)this.authNostrService.setLocal(e,t);else if("extension"===e.authMethod)await this.extensionService.trySetExtensionForPubkey(e.pubkey);else{if(!("connect"===e.authMethod&&e.sk&&e.relays&&e.relays[0]))throw new Error("Bad auth info");this.authNostrService.setConnect(e)}}updateAccounts(){const e=localStorageGetAccounts(),t=localStorageGetRecents();this.bannerManager.onUpdateAccounts(e),this.modalManager.onUpdateAccounts(e,t)}async launchCustomNostrConnect(){try{this.authNostrService.isAuthing()&&this.authNostrService.cancelNostrConnect();const e=new Promise((e=>this.customLaunchCallback=e));await this.authNostrService.startAuth(),await this.authNostrService.sendNeedAuth();try{await this.authNostrService.nostrConnect(),await this.authNostrService.endAuth()}catch(t){"cancelled"===t&&await e}}catch(e){console.error("launchCustomNostrConnect",e)}}fulfillCustomLaunchPromise(){if(this.customLaunchCallback){const e=this.customLaunchCallback;this.customLaunchCallback=void 0,e()}}launch=async e=>{if(!e&&this.params.optionsModal.customNostrConnect)return this.launchCustomNostrConnect();const t=localStorageGetRecents(),n=localStorageGetAccounts(),o={...this.params.optionsModal};e&&"default"!==e?o.startScreen=e:(Boolean(t?.length)||Boolean(n?.length))&&(o.startScreen="switch-account"),this.customLaunchCallback&&this.authNostrService.cancelNostrConnect();try{await this.modalManager.launch(o),this.fulfillCustomLaunchPromise()}catch(e){console.log("nostr-login failed",e)}};init=async e=>{this.extensionService.startCheckingExtension(this.nostr),window.nostr=this.nostr,this.modalManager.connectModals(e),this.bannerManager.launchAuthBanner(e),e&&(this.params.optionsModal={...e});try{const e=localStorageGetCurrent();if(e){if(!e.pubkey)throw new Error("Bad stored info");await this.switchAccount(e)}}catch(e){console.log("nostr login init error",e),await logout()}this.updateAccounts()};logout=async()=>{this.extensionService.unsetExtension(this.nostr),await this.authNostrService.logout()};setDarkMode=e=>{localStorageSetItem("nl-dark-mode",`${e}`),this.bannerManager.onDarkMode(e),this.modalManager.onDarkMode(e)};setAuth=async e=>{if(!e.type)throw new Error("Invalid auth event");if("login"!==e.type&&"logout"!==e.type&&"signup"!==e.type)throw new Error("Invalid auth event");if(e.method&&"connect"!==e.method&&"extension"!==e.method&&"local"!==e.method&&"otp"!==e.method&&"readOnly"!==e.method)throw new Error("Invalid auth event");if("logout"===e.type)return this.logout();if(!e.method||!e.pubkey)throw new Error("Invalid pubkey");const t={authMethod:e.method,pubkey:e.pubkey,relays:e.relays,sk:e.localNsec,otpData:e.otpData,name:e.name};await this.switchAccount(t,"signup"===e.type)};cancelNeedAuth=()=>{console.log("cancelNeedAuth"),this.fulfillCustomLaunchPromise(),this.authNostrService.cancelNostrConnect()}}const initializer=new NostrLoginInitializer,{init:init,launch:launch,logout:logout,setDarkMode:setDarkMode,setAuth:setAuth,cancelNeedAuth:cancelNeedAuth}=initializer;document.addEventListener("nlLogout",logout),document.addEventListener("nlLaunch",(e=>{launch(e.detail||"")})),document.addEventListener("nlNeedAuthCancel",(()=>{cancelNeedAuth()})),document.addEventListener("nlDarkMode",(e=>{setDarkMode(!!e.detail)})),document.addEventListener("nlSetAuth",(e=>{setAuth(e.detail)}));const createWorker=()=>new Worker(URL.createObjectURL(new Blob(['class x{constructor(a,b){this.width=b;this.height=a.length/b;this.data=a}static createEmpty(a,b){return new x(new Uint8ClampedArray(a*b),a)}get(a,b){return 0>a||a>=this.width||0>b||b>=this.height?!1:!!this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c?1:0}setRegion(a,b,c,d,e){for(let f=b;f<b+d;f++)for(let g=a;g<a+c;g++)this.set(g,f,!!e)}}\nclass A{constructor(a,b,c){this.width=a;a*=b;if(c&&c.length!==a)throw Error("Wrong buffer size");this.data=c||new Uint8ClampedArray(a)}get(a,b){return this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c}}\nclass ba{constructor(a){this.bitOffset=this.byteOffset=0;this.bytes=a}readBits(a){if(1>a||32<a||a>this.available())throw Error("Cannot read "+a.toString()+" bits");var b=0;if(0<this.bitOffset){b=8-this.bitOffset;var c=a<b?a:b;b-=c;b=(this.bytes[this.byteOffset]&255>>8-c<<b)>>b;a-=c;this.bitOffset+=c;8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(0<a){for(;8<=a;)b=b<<8|this.bytes[this.byteOffset]&255,this.byteOffset++,a-=8;0<a&&(c=8-a,b=b<<a|(this.bytes[this.byteOffset]&255>>c<<c)>>c,\nthis.bitOffset+=a)}return b}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var B,C=B||(B={});C.Numeric="numeric";C.Alphanumeric="alphanumeric";C.Byte="byte";C.Kanji="kanji";C.ECI="eci";C.StructuredAppend="structuredappend";var D,E=D||(D={});E[E.Terminator=0]="Terminator";E[E.Numeric=1]="Numeric";E[E.Alphanumeric=2]="Alphanumeric";E[E.Byte=4]="Byte";E[E.Kanji=8]="Kanji";E[E.ECI=7]="ECI";E[E.StructuredAppend=3]="StructuredAppend";let F="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".split("");\nfunction ca(a,b){let c=[],d="";b=a.readBits([8,16,16][b]);for(let e=0;e<b;e++){let f=a.readBits(8);c.push(f)}try{d+=decodeURIComponent(c.map(e=>`%${("0"+e.toString(16)).substr(-2)}`).join(""))}catch(e){}return{bytes:c,text:d}}\nfunction da(a,b){a=new ba(a);let c=9>=b?0:26>=b?1:2;for(b={text:"",bytes:[],chunks:[],version:b};4<=a.available();){var d=a.readBits(4);if(d===D.Terminator)return b;if(d===D.ECI)0===a.readBits(1)?b.chunks.push({type:B.ECI,assignmentNumber:a.readBits(7)}):0===a.readBits(1)?b.chunks.push({type:B.ECI,assignmentNumber:a.readBits(14)}):0===a.readBits(1)?b.chunks.push({type:B.ECI,assignmentNumber:a.readBits(21)}):b.chunks.push({type:B.ECI,assignmentNumber:-1});else if(d===D.Numeric){var e=a,f=[];d="";for(var g=\ne.readBits([10,12,14][c]);3<=g;){var h=e.readBits(10);if(1E3<=h)throw Error("Invalid numeric value above 999");var k=Math.floor(h/100),m=Math.floor(h/10)%10;h%=10;f.push(48+k,48+m,48+h);d+=k.toString()+m.toString()+h.toString();g-=3}if(2===g){g=e.readBits(7);if(100<=g)throw Error("Invalid numeric value above 99");e=Math.floor(g/10);g%=10;f.push(48+e,48+g);d+=e.toString()+g.toString()}else if(1===g){e=e.readBits(4);if(10<=e)throw Error("Invalid numeric value above 9");f.push(48+e);d+=e.toString()}b.text+=\nd;b.bytes.push(...f);b.chunks.push({type:B.Numeric,text:d})}else if(d===D.Alphanumeric){e=a;f=[];d="";for(g=e.readBits([9,11,13][c]);2<=g;)m=e.readBits(11),k=Math.floor(m/45),m%=45,f.push(F[k].charCodeAt(0),F[m].charCodeAt(0)),d+=F[k]+F[m],g-=2;1===g&&(e=e.readBits(6),f.push(F[e].charCodeAt(0)),d+=F[e]);b.text+=d;b.bytes.push(...f);b.chunks.push({type:B.Alphanumeric,text:d})}else if(d===D.Byte)d=ca(a,c),b.text+=d.text,b.bytes.push(...d.bytes),b.chunks.push({type:B.Byte,bytes:d.bytes,text:d.text});\nelse if(d===D.Kanji){f=a;d=[];e=f.readBits([8,10,12][c]);for(g=0;g<e;g++)k=f.readBits(13),k=Math.floor(k/192)<<8|k%192,k=7936>k?k+33088:k+49472,d.push(k>>8,k&255);f=(new TextDecoder("shift-jis")).decode(Uint8Array.from(d));b.text+=f;b.bytes.push(...d);b.chunks.push({type:B.Kanji,bytes:d,text:f})}else d===D.StructuredAppend&&b.chunks.push({type:B.StructuredAppend,currentSequence:a.readBits(4),totalSequence:a.readBits(4),parity:a.readBits(8)})}if(0===a.available()||0===a.readBits(a.available()))return b}\nclass G{constructor(a,b){if(0===b.length)throw Error("No coefficients.");this.field=a;let c=b.length;if(1<c&&0===b[0]){let d=1;for(;d<c&&0===b[d];)d++;if(d===c)this.coefficients=a.zero.coefficients;else for(this.coefficients=new Uint8ClampedArray(c-d),a=0;a<this.coefficients.length;a++)this.coefficients[a]=b[d+a]}else this.coefficients=b}degree(){return this.coefficients.length-1}isZero(){return 0===this.coefficients[0]}getCoefficient(a){return this.coefficients[this.coefficients.length-1-a]}addOrSubtract(a){if(this.isZero())return a;\nif(a.isZero())return this;let b=this.coefficients;a=a.coefficients;b.length>a.length&&([b,a]=[a,b]);let c=new Uint8ClampedArray(a.length),d=a.length-b.length;for(var e=0;e<d;e++)c[e]=a[e];for(e=d;e<a.length;e++)c[e]=b[e-d]^a[e];return new G(this.field,c)}multiply(a){if(0===a)return this.field.zero;if(1===a)return this;let b=this.coefficients.length,c=new Uint8ClampedArray(b);for(let d=0;d<b;d++)c[d]=this.field.multiply(this.coefficients[d],a);return new G(this.field,c)}multiplyPoly(a){if(this.isZero()||\na.isZero())return this.field.zero;let b=this.coefficients,c=b.length;a=a.coefficients;let d=a.length,e=new Uint8ClampedArray(c+d-1);for(let f=0;f<c;f++){let g=b[f];for(let h=0;h<d;h++)e[f+h]=H(e[f+h],this.field.multiply(g,a[h]))}return new G(this.field,e)}multiplyByMonomial(a,b){if(0>a)throw Error("Invalid degree less than 0");if(0===b)return this.field.zero;let c=this.coefficients.length;a=new Uint8ClampedArray(c+a);for(let d=0;d<c;d++)a[d]=this.field.multiply(this.coefficients[d],b);return new G(this.field,\na)}evaluateAt(a){let b=0;if(0===a)return this.getCoefficient(0);let c=this.coefficients.length;if(1===a)return this.coefficients.forEach(d=>{b^=d}),b;b=this.coefficients[0];for(let d=1;d<c;d++)b=H(this.field.multiply(a,b),this.coefficients[d]);return b}}function H(a,b){return a^b}\nclass ea{constructor(a,b,c){this.primitive=a;this.size=b;this.generatorBase=c;this.expTable=Array(this.size);this.logTable=Array(this.size);a=1;for(b=0;b<this.size;b++)this.expTable[b]=a,a*=2,a>=this.size&&(a=(a^this.primitive)&this.size-1);for(a=0;a<this.size-1;a++)this.logTable[this.expTable[a]]=a;this.zero=new G(this,Uint8ClampedArray.from([0]));this.one=new G(this,Uint8ClampedArray.from([1]))}multiply(a,b){return 0===a||0===b?0:this.expTable[(this.logTable[a]+this.logTable[b])%(this.size-1)]}inverse(a){if(0===\na)throw Error("Can\'t invert 0");return this.expTable[this.size-this.logTable[a]-1]}buildMonomial(a,b){if(0>a)throw Error("Invalid monomial degree less than 0");if(0===b)return this.zero;a=new Uint8ClampedArray(a+1);a[0]=b;return new G(this,a)}log(a){if(0===a)throw Error("Can\'t take log(0)");return this.logTable[a]}exp(a){return this.expTable[a]}}\nfunction fa(a,b,c,d){b.degree()<c.degree()&&([b,c]=[c,b]);let e=a.zero;for(var f=a.one;c.degree()>=d/2;){var g=b;let h=e;b=c;e=f;if(b.isZero())return null;c=g;f=a.zero;g=b.getCoefficient(b.degree());for(g=a.inverse(g);c.degree()>=b.degree()&&!c.isZero();){let k=c.degree()-b.degree(),m=a.multiply(c.getCoefficient(c.degree()),g);f=f.addOrSubtract(a.buildMonomial(k,m));c=c.addOrSubtract(b.multiplyByMonomial(k,m))}f=f.multiplyPoly(e).addOrSubtract(h);if(c.degree()>=b.degree())return null}d=f.getCoefficient(0);\nif(0===d)return null;a=a.inverse(d);return[f.multiply(a),c.multiply(a)]}\nfunction ha(a,b){let c=new Uint8ClampedArray(a.length);c.set(a);a=new ea(285,256,0);var d=new G(a,c),e=new Uint8ClampedArray(b),f=!1;for(var g=0;g<b;g++){var h=d.evaluateAt(a.exp(g+a.generatorBase));e[e.length-1-g]=h;0!==h&&(f=!0)}if(!f)return c;d=new G(a,e);d=fa(a,a.buildMonomial(b,1),d,b);if(null===d)return null;b=d[0];g=b.degree();if(1===g)b=[b.getCoefficient(1)];else{e=Array(g);f=0;for(h=1;h<a.size&&f<g;h++)0===b.evaluateAt(h)&&(e[f]=a.inverse(h),f++);b=f!==g?null:e}if(null==b)return null;e=d[1];\nf=b.length;d=Array(f);for(g=0;g<f;g++){h=a.inverse(b[g]);let k=1;for(let m=0;m<f;m++)g!==m&&(k=a.multiply(k,H(1,a.multiply(b[m],h))));d[g]=a.multiply(e.evaluateAt(h),a.inverse(k));0!==a.generatorBase&&(d[g]=a.multiply(d[g],h))}for(e=0;e<b.length;e++){f=c.length-1-a.log(b[e]);if(0>f)return null;c[f]^=d[e]}return c}\nlet I=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:13}]},{ecCodewordsPerBlock:17,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:2,alignmentPatternCenters:[6,18],errorCorrectionLevels:[{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,\ndataCodewordsPerBlock:34}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:28}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]}]},{infoBits:null,versionNumber:3,alignmentPatternCenters:[6,22],errorCorrectionLevels:[{ecCodewordsPerBlock:15,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:55}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:18,\necBlocks:[{numBlocks:2,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:13}]}]},{infoBits:null,versionNumber:4,alignmentPatternCenters:[6,26],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:80}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:32}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:9}]}]},\n{infoBits:null,versionNumber:5,alignmentPatternCenters:[6,30],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:43}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:11},{numBlocks:2,dataCodewordsPerBlock:12}]}]},{infoBits:null,versionNumber:6,alignmentPatternCenters:[6,\n34],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:27}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:31892,versionNumber:7,alignmentPatternCenters:[6,22,38],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:78}]},{ecCodewordsPerBlock:18,\necBlocks:[{numBlocks:4,dataCodewordsPerBlock:31}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:13},{numBlocks:1,dataCodewordsPerBlock:14}]}]},{infoBits:34236,versionNumber:8,alignmentPatternCenters:[6,24,42],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:97}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:38},\n{numBlocks:2,dataCodewordsPerBlock:39}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:18},{numBlocks:2,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:14},{numBlocks:2,dataCodewordsPerBlock:15}]}]},{infoBits:39577,versionNumber:9,alignmentPatternCenters:[6,26,46],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:36},\n{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:12},{numBlocks:4,dataCodewordsPerBlock:13}]}]},{infoBits:42195,versionNumber:10,alignmentPatternCenters:[6,28,50],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68},{numBlocks:2,dataCodewordsPerBlock:69}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,\ndataCodewordsPerBlock:43},{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]}]},{infoBits:48118,versionNumber:11,alignmentPatternCenters:[6,30,54],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:81}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,\ndataCodewordsPerBlock:50},{numBlocks:4,dataCodewordsPerBlock:51}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:22},{numBlocks:4,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:12},{numBlocks:8,dataCodewordsPerBlock:13}]}]},{infoBits:51042,versionNumber:12,alignmentPatternCenters:[6,32,58],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:92},{numBlocks:2,dataCodewordsPerBlock:93}]},\n{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:20},{numBlocks:6,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:55367,versionNumber:13,alignmentPatternCenters:[6,34,62],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:107}]},\n{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:37},{numBlocks:1,dataCodewordsPerBlock:38}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:20},{numBlocks:4,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:11},{numBlocks:4,dataCodewordsPerBlock:12}]}]},{infoBits:58893,versionNumber:14,alignmentPatternCenters:[6,26,46,66],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:115},\n{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:40},{numBlocks:5,dataCodewordsPerBlock:41}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:16},{numBlocks:5,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:5,dataCodewordsPerBlock:13}]}]},{infoBits:63784,versionNumber:15,alignmentPatternCenters:[6,26,48,70],errorCorrectionLevels:[{ecCodewordsPerBlock:22,\necBlocks:[{numBlocks:5,dataCodewordsPerBlock:87},{numBlocks:1,dataCodewordsPerBlock:88}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:41},{numBlocks:5,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:7,dataCodewordsPerBlock:13}]}]},{infoBits:68472,versionNumber:16,alignmentPatternCenters:[6,26,50,\n74],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:98},{numBlocks:1,dataCodewordsPerBlock:99}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:70749,\nversionNumber:17,alignmentPatternCenters:[6,30,54,78],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:1,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22},{numBlocks:15,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:17,\ndataCodewordsPerBlock:15}]}]},{infoBits:76311,versionNumber:18,alignmentPatternCenters:[6,30,56,82],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:120},{numBlocks:1,dataCodewordsPerBlock:121}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:43},{numBlocks:4,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:1,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,\ndataCodewordsPerBlock:14},{numBlocks:19,dataCodewordsPerBlock:15}]}]},{infoBits:79154,versionNumber:19,alignmentPatternCenters:[6,30,58,86],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:113},{numBlocks:4,dataCodewordsPerBlock:114}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:44},{numBlocks:11,dataCodewordsPerBlock:45}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:21},{numBlocks:4,dataCodewordsPerBlock:22}]},\n{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:13},{numBlocks:16,dataCodewordsPerBlock:14}]}]},{infoBits:84390,versionNumber:20,alignmentPatternCenters:[6,34,62,90],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:41},{numBlocks:13,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},\n{numBlocks:5,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:15},{numBlocks:10,dataCodewordsPerBlock:16}]}]},{infoBits:87683,versionNumber:21,alignmentPatternCenters:[6,28,50,72,94],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:116},{numBlocks:4,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},\n{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:16},{numBlocks:6,dataCodewordsPerBlock:17}]}]},{infoBits:92361,versionNumber:22,alignmentPatternCenters:[6,26,50,74,98],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:111},{numBlocks:7,dataCodewordsPerBlock:112}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},\n{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:13}]}]},{infoBits:96236,versionNumber:23,alignmentPatternCenters:[6,30,54,74,102],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:121},{numBlocks:5,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:47},{numBlocks:14,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},\n{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:16,dataCodewordsPerBlock:15},{numBlocks:14,dataCodewordsPerBlock:16}]}]},{infoBits:102084,versionNumber:24,alignmentPatternCenters:[6,28,54,80,106],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:45},{numBlocks:14,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,\necBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:30,dataCodewordsPerBlock:16},{numBlocks:2,dataCodewordsPerBlock:17}]}]},{infoBits:102881,versionNumber:25,alignmentPatternCenters:[6,32,58,84,110],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:106},{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:47},{numBlocks:13,\ndataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:110507,versionNumber:26,alignmentPatternCenters:[6,30,58,86,114],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:114},{numBlocks:2,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,\ndataCodewordsPerBlock:46},{numBlocks:4,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:28,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:33,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]}]},{infoBits:110734,versionNumber:27,alignmentPatternCenters:[6,34,62,90,118],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},\n{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:23},{numBlocks:26,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:117786,versionNumber:28,alignmentPatternCenters:[6,26,50,74,98,122],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:117},\n{numBlocks:10,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:45},{numBlocks:23,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:24},{numBlocks:31,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:31,dataCodewordsPerBlock:16}]}]},{infoBits:119615,versionNumber:29,alignmentPatternCenters:[6,30,54,78,102,126],errorCorrectionLevels:[{ecCodewordsPerBlock:30,\necBlocks:[{numBlocks:7,dataCodewordsPerBlock:116},{numBlocks:7,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:21,dataCodewordsPerBlock:45},{numBlocks:7,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:23},{numBlocks:37,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:26,dataCodewordsPerBlock:16}]}]},{infoBits:126325,versionNumber:30,alignmentPatternCenters:[6,\n26,52,78,104,130],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:115},{numBlocks:10,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:47},{numBlocks:10,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:25,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:25,dataCodewordsPerBlock:16}]}]},\n{infoBits:127568,versionNumber:31,alignmentPatternCenters:[6,30,56,82,108,134],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:3,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:46},{numBlocks:29,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:24},{numBlocks:1,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},\n{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:133589,versionNumber:32,alignmentPatternCenters:[6,34,60,86,112,138],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:24},{numBlocks:35,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,\ndataCodewordsPerBlock:15},{numBlocks:35,dataCodewordsPerBlock:16}]}]},{infoBits:136944,versionNumber:33,alignmentPatternCenters:[6,30,58,86,114,142],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:21,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:24},{numBlocks:19,dataCodewordsPerBlock:25}]},\n{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:141498,versionNumber:34,alignmentPatternCenters:[6,34,62,90,118,146],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:6,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:44,\ndataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:59,dataCodewordsPerBlock:16},{numBlocks:1,dataCodewordsPerBlock:17}]}]},{infoBits:145311,versionNumber:35,alignmentPatternCenters:[6,30,54,78,102,126,150],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:121},{numBlocks:7,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:47},{numBlocks:26,dataCodewordsPerBlock:48}]},\n{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:39,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:41,dataCodewordsPerBlock:16}]}]},{infoBits:150283,versionNumber:36,alignmentPatternCenters:[6,24,50,76,102,128,154],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:121},{numBlocks:14,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,\ndataCodewordsPerBlock:47},{numBlocks:34,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:46,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:64,dataCodewordsPerBlock:16}]}]},{infoBits:152622,versionNumber:37,alignmentPatternCenters:[6,28,54,80,106,132,158],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},\n{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:46},{numBlocks:14,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:49,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:24,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:158308,versionNumber:38,alignmentPatternCenters:[6,32,58,84,110,136,162],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,\ndataCodewordsPerBlock:122},{numBlocks:18,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:46},{numBlocks:32,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:48,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:15},{numBlocks:32,dataCodewordsPerBlock:16}]}]},{infoBits:161089,versionNumber:39,alignmentPatternCenters:[6,26,54,82,110,138,166],\nerrorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:40,dataCodewordsPerBlock:47},{numBlocks:7,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:43,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:15},{numBlocks:67,dataCodewordsPerBlock:16}]}]},{infoBits:167017,\nversionNumber:40,alignmentPatternCenters:[6,30,58,86,114,142,170],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:118},{numBlocks:6,dataCodewordsPerBlock:119}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:18,dataCodewordsPerBlock:47},{numBlocks:31,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:24},{numBlocks:34,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:15},\n{numBlocks:61,dataCodewordsPerBlock:16}]}]}];function J(a,b){a^=b;for(b=0;a;)b++,a&=a-1;return b}function K(a,b){return b<<1|a}\nlet ia=[{bits:21522,formatInfo:{errorCorrectionLevel:1,dataMask:0}},{bits:20773,formatInfo:{errorCorrectionLevel:1,dataMask:1}},{bits:24188,formatInfo:{errorCorrectionLevel:1,dataMask:2}},{bits:23371,formatInfo:{errorCorrectionLevel:1,dataMask:3}},{bits:17913,formatInfo:{errorCorrectionLevel:1,dataMask:4}},{bits:16590,formatInfo:{errorCorrectionLevel:1,dataMask:5}},{bits:20375,formatInfo:{errorCorrectionLevel:1,dataMask:6}},{bits:19104,formatInfo:{errorCorrectionLevel:1,dataMask:7}},{bits:30660,formatInfo:{errorCorrectionLevel:0,\ndataMask:0}},{bits:29427,formatInfo:{errorCorrectionLevel:0,dataMask:1}},{bits:32170,formatInfo:{errorCorrectionLevel:0,dataMask:2}},{bits:30877,formatInfo:{errorCorrectionLevel:0,dataMask:3}},{bits:26159,formatInfo:{errorCorrectionLevel:0,dataMask:4}},{bits:25368,formatInfo:{errorCorrectionLevel:0,dataMask:5}},{bits:27713,formatInfo:{errorCorrectionLevel:0,dataMask:6}},{bits:26998,formatInfo:{errorCorrectionLevel:0,dataMask:7}},{bits:5769,formatInfo:{errorCorrectionLevel:3,dataMask:0}},{bits:5054,\nformatInfo:{errorCorrectionLevel:3,dataMask:1}},{bits:7399,formatInfo:{errorCorrectionLevel:3,dataMask:2}},{bits:6608,formatInfo:{errorCorrectionLevel:3,dataMask:3}},{bits:1890,formatInfo:{errorCorrectionLevel:3,dataMask:4}},{bits:597,formatInfo:{errorCorrectionLevel:3,dataMask:5}},{bits:3340,formatInfo:{errorCorrectionLevel:3,dataMask:6}},{bits:2107,formatInfo:{errorCorrectionLevel:3,dataMask:7}},{bits:13663,formatInfo:{errorCorrectionLevel:2,dataMask:0}},{bits:12392,formatInfo:{errorCorrectionLevel:2,\ndataMask:1}},{bits:16177,formatInfo:{errorCorrectionLevel:2,dataMask:2}},{bits:14854,formatInfo:{errorCorrectionLevel:2,dataMask:3}},{bits:9396,formatInfo:{errorCorrectionLevel:2,dataMask:4}},{bits:8579,formatInfo:{errorCorrectionLevel:2,dataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],ja=[a=>0===(a.y+a.x)%2,a=>0===a.y%2,a=>0===a.x%3,a=>0===(a.y+a.x)%3,a=>0===(Math.floor(a.y/2)+Math.floor(a.x/3))%2,a=>0===a.x*a.y%\n2+a.x*a.y%3,a=>0===(a.y*a.x%2+a.y*a.x%3)%2,a=>0===((a.y+a.x)%2+a.y*a.x%3)%2];\nfunction ka(a,b,c){c=ja[c.dataMask];let d=a.height;var e=17+4*b.versionNumber;let f=x.createEmpty(e,e);f.setRegion(0,0,9,9,!0);f.setRegion(e-8,0,8,9,!0);f.setRegion(0,e-8,9,8,!0);for(var g of b.alignmentPatternCenters)for(var h of b.alignmentPatternCenters)6===g&&6===h||6===g&&h===e-7||g===e-7&&6===h||f.setRegion(g-2,h-2,5,5,!0);f.setRegion(6,9,1,e-17,!0);f.setRegion(9,6,e-17,1,!0);6<b.versionNumber&&(f.setRegion(e-11,0,3,6,!0),f.setRegion(0,e-11,6,3,!0));b=[];h=g=0;e=!0;for(let k=d-1;0<k;k-=2){6===\nk&&k--;for(let m=0;m<d;m++){let l=e?d-1-m:m;for(let n=0;2>n;n++){let q=k-n;if(!f.get(q,l)){h++;let r=a.get(q,l);c({y:l,x:q})&&(r=!r);g=g<<1|r;8===h&&(b.push(g),g=h=0)}}}e=!e}return b}\nfunction la(a){var b=a.height,c=Math.floor((b-17)/4);if(6>=c)return I[c-1];c=0;for(var d=5;0<=d;d--)for(var e=b-9;e>=b-11;e--)c=K(a.get(e,d),c);d=0;for(e=5;0<=e;e--)for(let g=b-9;g>=b-11;g--)d=K(a.get(e,g),d);a=Infinity;let f;for(let g of I){if(g.infoBits===c||g.infoBits===d)return g;b=J(c,g.infoBits);b<a&&(f=g,a=b);b=J(d,g.infoBits);b<a&&(f=g,a=b)}if(3>=a)return f}\nfunction ma(a){let b=0;for(var c=0;8>=c;c++)6!==c&&(b=K(a.get(c,8),b));for(c=7;0<=c;c--)6!==c&&(b=K(a.get(8,c),b));var d=a.height;c=0;for(var e=d-1;e>=d-7;e--)c=K(a.get(8,e),c);for(e=d-8;e<d;e++)c=K(a.get(e,8),c);a=Infinity;d=null;for(let {bits:f,formatInfo:g}of ia){if(f===b||f===c)return g;e=J(b,f);e<a&&(d=g,a=e);b!==c&&(e=J(c,f),e<a&&(d=g,a=e))}return 3>=a?d:null}\nfunction na(a,b,c){let d=b.errorCorrectionLevels[c],e=[],f=0;d.ecBlocks.forEach(h=>{for(let k=0;k<h.numBlocks;k++)e.push({numDataCodewords:h.dataCodewordsPerBlock,codewords:[]}),f+=h.dataCodewordsPerBlock+d.ecCodewordsPerBlock});if(a.length<f)return null;a=a.slice(0,f);b=d.ecBlocks[0].dataCodewordsPerBlock;for(c=0;c<b;c++)for(var g of e)g.codewords.push(a.shift());if(1<d.ecBlocks.length)for(g=d.ecBlocks[0].numBlocks,b=d.ecBlocks[1].numBlocks,c=0;c<b;c++)e[g+c].codewords.push(a.shift());for(;0<a.length;)for(let h of e)h.codewords.push(a.shift());\nreturn e}function L(a){let b=la(a);if(!b)return null;var c=ma(a);if(!c)return null;a=ka(a,b,c);var d=na(a,b,c.errorCorrectionLevel);if(!d)return null;c=d.reduce((e,f)=>e+f.numDataCodewords,0);c=new Uint8ClampedArray(c);a=0;for(let e of d){d=ha(e.codewords,e.codewords.length-e.numDataCodewords);if(!d)return null;for(let f=0;f<e.numDataCodewords;f++)c[a++]=d[f]}try{return da(c,b.versionNumber)}catch(e){return null}}\nfunction M(a,b,c,d){var e=a.x-b.x+c.x-d.x;let f=a.y-b.y+c.y-d.y;if(0===e&&0===f)return{a11:b.x-a.x,a12:b.y-a.y,a13:0,a21:c.x-b.x,a22:c.y-b.y,a23:0,a31:a.x,a32:a.y,a33:1};let g=b.x-c.x;var h=d.x-c.x;let k=b.y-c.y,m=d.y-c.y;c=g*m-h*k;h=(e*m-h*f)/c;e=(g*f-e*k)/c;return{a11:b.x-a.x+h*b.x,a12:b.y-a.y+h*b.y,a13:h,a21:d.x-a.x+e*d.x,a22:d.y-a.y+e*d.y,a23:e,a31:a.x,a32:a.y,a33:1}}\nfunction oa(a,b,c,d){a=M(a,b,c,d);return{a11:a.a22*a.a33-a.a23*a.a32,a12:a.a13*a.a32-a.a12*a.a33,a13:a.a12*a.a23-a.a13*a.a22,a21:a.a23*a.a31-a.a21*a.a33,a22:a.a11*a.a33-a.a13*a.a31,a23:a.a13*a.a21-a.a11*a.a23,a31:a.a21*a.a32-a.a22*a.a31,a32:a.a12*a.a31-a.a11*a.a32,a33:a.a11*a.a22-a.a12*a.a21}}\nfunction pa(a,b){var c=oa({x:3.5,y:3.5},{x:b.dimension-3.5,y:3.5},{x:b.dimension-6.5,y:b.dimension-6.5},{x:3.5,y:b.dimension-3.5}),d=M(b.topLeft,b.topRight,b.alignmentPattern,b.bottomLeft),e=d.a11*c.a11+d.a21*c.a12+d.a31*c.a13,f=d.a12*c.a11+d.a22*c.a12+d.a32*c.a13,g=d.a13*c.a11+d.a23*c.a12+d.a33*c.a13,h=d.a11*c.a21+d.a21*c.a22+d.a31*c.a23,k=d.a12*c.a21+d.a22*c.a22+d.a32*c.a23,m=d.a13*c.a21+d.a23*c.a22+d.a33*c.a23,l=d.a11*c.a31+d.a21*c.a32+d.a31*c.a33,n=d.a12*c.a31+d.a22*c.a32+d.a32*c.a33,q=d.a13*\nc.a31+d.a23*c.a32+d.a33*c.a33;c=x.createEmpty(b.dimension,b.dimension);d=(r,u)=>{const p=g*r+m*u+q;return{x:(e*r+h*u+l)/p,y:(f*r+k*u+n)/p}};for(let r=0;r<b.dimension;r++)for(let u=0;u<b.dimension;u++){let p=d(u+.5,r+.5);c.set(u,r,a.get(Math.floor(p.x),Math.floor(p.y)))}return{matrix:c,mappingFunction:d}}let N=(a,b)=>Math.sqrt(Math.pow(b.x-a.x,2)+Math.pow(b.y-a.y,2));function O(a){return a.reduce((b,c)=>b+c)}\nfunction qa(a,b,c){let d=N(a,b),e=N(b,c),f=N(a,c),g,h,k;e>=d&&e>=f?[g,h,k]=[b,a,c]:f>=e&&f>=d?[g,h,k]=[a,b,c]:[g,h,k]=[a,c,b];0>(k.x-h.x)*(g.y-h.y)-(k.y-h.y)*(g.x-h.x)&&([g,k]=[k,g]);return{bottomLeft:g,topLeft:h,topRight:k}}\nfunction ra(a,b,c,d){d=(O(P(a,c,d,5))/7+O(P(a,b,d,5))/7+O(P(c,a,d,5))/7+O(P(b,a,d,5))/7)/4;if(1>d)throw Error("Invalid module size");b=Math.round(N(a,b)/d);a=Math.round(N(a,c)/d);a=Math.floor((b+a)/2)+7;switch(a%4){case 0:a++;break;case 2:a--}return{dimension:a,moduleSize:d}}\nfunction Q(a,b,c,d){let e=[{x:Math.floor(a.x),y:Math.floor(a.y)}];var f=Math.abs(b.y-a.y)>Math.abs(b.x-a.x);if(f){var g=Math.floor(a.y);var h=Math.floor(a.x);a=Math.floor(b.y);b=Math.floor(b.x)}else g=Math.floor(a.x),h=Math.floor(a.y),a=Math.floor(b.x),b=Math.floor(b.y);let k=Math.abs(a-g),m=Math.abs(b-h),l=Math.floor(-k/2),n=g<a?1:-1,q=h<b?1:-1,r=!0;for(let u=g,p=h;u!==a+n;u+=n){g=f?p:u;h=f?u:p;if(c.get(g,h)!==r&&(r=!r,e.push({x:g,y:h}),e.length===d+1))break;l+=m;if(0<l){if(p===b)break;p+=q;l-=k}}c=\n[];for(f=0;f<d;f++)e[f]&&e[f+1]?c.push(N(e[f],e[f+1])):c.push(0);return c}function P(a,b,c,d){let e=b.y-a.y,f=b.x-a.x;b=Q(a,b,c,Math.ceil(d/2));a=Q(a,{x:a.x-f,y:a.y-e},c,Math.ceil(d/2));c=b.shift()+a.shift()-1;return a.concat(c).concat(...b)}function R(a,b){let c=O(a)/O(b),d=0;b.forEach((e,f)=>{d+=Math.pow(a[f]-e*c,2)});return{averageSize:c,error:d}}\nfunction S(a,b,c){try{let d=P(a,{x:-1,y:a.y},c,b.length),e=P(a,{x:a.x,y:-1},c,b.length),f=P(a,{x:Math.max(0,a.x-a.y)-1,y:Math.max(0,a.y-a.x)-1},c,b.length),g=P(a,{x:Math.min(c.width,a.x+a.y)+1,y:Math.min(c.height,a.y+a.x)+1},c,b.length),h=R(d,b),k=R(e,b),m=R(f,b),l=R(g,b),n=(h.averageSize+k.averageSize+m.averageSize+l.averageSize)/4;return Math.sqrt(h.error*h.error+k.error*k.error+m.error*m.error+l.error*l.error)+(Math.pow(h.averageSize-n,2)+Math.pow(k.averageSize-n,2)+Math.pow(m.averageSize-n,2)+\nMath.pow(l.averageSize-n,2))/n}catch(d){return Infinity}}function T(a,b){for(var c=Math.round(b.x);a.get(c,Math.round(b.y));)c--;for(var d=Math.round(b.x);a.get(d,Math.round(b.y));)d++;c=(c+d)/2;for(d=Math.round(b.y);a.get(Math.round(c),d);)d--;for(b=Math.round(b.y);a.get(Math.round(c),b);)b++;return{x:c,y:(d+b)/2}}\nfunction sa(a){var b=[],c=[];let d=[];var e=[];for(let p=0;p<=a.height;p++){var f=0,g=!1;let t=[0,0,0,0,0];for(let v=-1;v<=a.width;v++){var h=a.get(v,p);if(h===g)f++;else{t=[t[1],t[2],t[3],t[4],f];f=1;g=h;var k=O(t)/7;k=Math.abs(t[0]-k)<k&&Math.abs(t[1]-k)<k&&Math.abs(t[2]-3*k)<3*k&&Math.abs(t[3]-k)<k&&Math.abs(t[4]-k)<k&&!h;var m=O(t.slice(-3))/3;h=Math.abs(t[2]-m)<m&&Math.abs(t[3]-m)<m&&Math.abs(t[4]-m)<m&&h;if(k){let z=v-t[3]-t[4],y=z-t[2];k={startX:y,endX:z,y:p};m=c.filter(w=>y>=w.bottom.startX&&\ny<=w.bottom.endX||z>=w.bottom.startX&&y<=w.bottom.endX||y<=w.bottom.startX&&z>=w.bottom.endX&&1.5>t[2]/(w.bottom.endX-w.bottom.startX)&&.5<t[2]/(w.bottom.endX-w.bottom.startX));0<m.length?m[0].bottom=k:c.push({top:k,bottom:k})}if(h){let z=v-t[4],y=z-t[3];h={startX:y,y:p,endX:z};k=e.filter(w=>y>=w.bottom.startX&&y<=w.bottom.endX||z>=w.bottom.startX&&y<=w.bottom.endX||y<=w.bottom.startX&&z>=w.bottom.endX&&1.5>t[2]/(w.bottom.endX-w.bottom.startX)&&.5<t[2]/(w.bottom.endX-w.bottom.startX));0<k.length?\nk[0].bottom=h:e.push({top:h,bottom:h})}}}b.push(...c.filter(v=>v.bottom.y!==p&&2<=v.bottom.y-v.top.y));c=c.filter(v=>v.bottom.y===p);d.push(...e.filter(v=>v.bottom.y!==p));e=e.filter(v=>v.bottom.y===p)}b.push(...c.filter(p=>2<=p.bottom.y-p.top.y));d.push(...e);c=[];for(var l of b)2>l.bottom.y-l.top.y||(b=(l.top.startX+l.top.endX+l.bottom.startX+l.bottom.endX)/4,e=(l.top.y+l.bottom.y+1)/2,a.get(Math.round(b),Math.round(e))&&(f=[l.top.endX-l.top.startX,l.bottom.endX-l.bottom.startX,l.bottom.y-l.top.y+\n1],f=O(f)/f.length,g=S({x:Math.round(b),y:Math.round(e)},[1,1,3,1,1],a),c.push({score:g,x:b,y:e,size:f})));if(3>c.length)return null;c.sort((p,t)=>p.score-t.score);l=[];for(b=0;b<Math.min(c.length,5);++b){e=c[b];f=[];for(var n of c)n!==e&&f.push(Object.assign(Object.assign({},n),{score:n.score+Math.pow(n.size-e.size,2)/e.size}));f.sort((p,t)=>p.score-t.score);l.push({points:[e,f[0],f[1]],score:e.score+f[0].score+f[1].score})}l.sort((p,t)=>p.score-t.score);let {topRight:q,topLeft:r,bottomLeft:u}=qa(...l[0].points);\nl=U(a,d,q,r,u);n=[];l&&n.push({alignmentPattern:{x:l.alignmentPattern.x,y:l.alignmentPattern.y},bottomLeft:{x:u.x,y:u.y},dimension:l.dimension,topLeft:{x:r.x,y:r.y},topRight:{x:q.x,y:q.y}});l=T(a,q);b=T(a,r);c=T(a,u);(a=U(a,d,l,b,c))&&n.push({alignmentPattern:{x:a.alignmentPattern.x,y:a.alignmentPattern.y},bottomLeft:{x:c.x,y:c.y},topLeft:{x:b.x,y:b.y},topRight:{x:l.x,y:l.y},dimension:a.dimension});return 0===n.length?null:n}\nfunction U(a,b,c,d,e){let f,g;try{({dimension:f,moduleSize:g}=ra(d,c,e,a))}catch(l){return null}var h=c.x-d.x+e.x,k=c.y-d.y+e.y;c=(N(d,e)+N(d,c))/2/g;e=1-3/c;let m={x:d.x+e*(h-d.x),y:d.y+e*(k-d.y)};b=b.map(l=>{const n=(l.top.startX+l.top.endX+l.bottom.startX+l.bottom.endX)/4;l=(l.top.y+l.bottom.y+1)/2;if(a.get(Math.floor(n),Math.floor(l))){var q=S({x:Math.floor(n),y:Math.floor(l)},[1,1,1],a)+N({x:n,y:l},m);return{x:n,y:l,score:q}}}).filter(l=>!!l).sort((l,n)=>l.score-n.score);return{alignmentPattern:15<=\nc&&b.length?b[0]:m,dimension:f}}\nfunction V(a){var b=sa(a);if(!b)return null;for(let e of b){b=pa(a,e);var c=b.matrix;if(null==c)c=null;else{var d=L(c);if(d)c=d;else{for(d=0;d<c.width;d++)for(let f=d+1;f<c.height;f++)c.get(d,f)!==c.get(f,d)&&(c.set(d,f,!c.get(d,f)),c.set(f,d,!c.get(f,d)));c=L(c)}}if(c)return{binaryData:c.bytes,data:c.text,chunks:c.chunks,version:c.version,location:{topRightCorner:b.mappingFunction(e.dimension,0),topLeftCorner:b.mappingFunction(0,0),bottomRightCorner:b.mappingFunction(e.dimension,e.dimension),bottomLeftCorner:b.mappingFunction(0,\ne.dimension),topRightFinderPattern:e.topRight,topLeftFinderPattern:e.topLeft,bottomLeftFinderPattern:e.bottomLeft,bottomRightAlignmentPattern:e.alignmentPattern},matrix:b.matrix}}return null}let ta={inversionAttempts:"attemptBoth",greyScaleWeights:{red:.2126,green:.7152,blue:.0722,useIntegerApproximation:!1},canOverwriteImage:!0};function W(a,b){Object.keys(b).forEach(c=>{a[c]=b[c]})}\nfunction X(a,b,c,d={}){let e=Object.create(null);W(e,ta);W(e,d);d="onlyInvert"===e.inversionAttempts||"invertFirst"===e.inversionAttempts;var f="attemptBoth"===e.inversionAttempts||d;var g=e.greyScaleWeights,h=e.canOverwriteImage,k=b*c;if(a.length!==4*k)throw Error("Malformed data passed to binarizer.");var m=0;if(h){var l=new Uint8ClampedArray(a.buffer,m,k);m+=k}l=new A(b,c,l);if(g.useIntegerApproximation)for(var n=0;n<c;n++)for(var q=0;q<b;q++){var r=4*(n*b+q);l.set(q,n,g.red*a[r]+g.green*a[r+1]+\ng.blue*a[r+2]+128>>8)}else for(n=0;n<c;n++)for(q=0;q<b;q++)r=4*(n*b+q),l.set(q,n,g.red*a[r]+g.green*a[r+1]+g.blue*a[r+2]);g=Math.ceil(b/8);n=Math.ceil(c/8);q=g*n;if(h){var u=new Uint8ClampedArray(a.buffer,m,q);m+=q}u=new A(g,n,u);for(q=0;q<n;q++)for(r=0;r<g;r++){var p=Infinity,t=0;for(var v=0;8>v;v++)for(let w=0;8>w;w++){let aa=l.get(8*r+w,8*q+v);p=Math.min(p,aa);t=Math.max(t,aa)}v=(p+t)/2;v=Math.min(255,1.11*v);24>=t-p&&(v=p/2,0<q&&0<r&&(t=(u.get(r,q-1)+2*u.get(r-1,q)+u.get(r-1,q-1))/4,p<t&&(v=t)));\nu.set(r,q,v)}h?(q=new Uint8ClampedArray(a.buffer,m,k),m+=k,q=new x(q,b)):q=x.createEmpty(b,c);r=null;f&&(h?(a=new Uint8ClampedArray(a.buffer,m,k),r=new x(a,b)):r=x.createEmpty(b,c));for(b=0;b<n;b++)for(a=0;a<g;a++){c=g-3;c=2>a?2:a>c?c:a;h=n-3;h=2>b?2:b>h?h:b;k=0;for(m=-2;2>=m;m++)for(p=-2;2>=p;p++)k+=u.get(c+m,h+p);c=k/25;for(h=0;8>h;h++)for(k=0;8>k;k++)m=8*a+h,p=8*b+k,t=l.get(m,p),q.set(m,p,t<=c),f&&r.set(m,p,!(t<=c))}f=f?{binarized:q,inverted:r}:{binarized:q};let {binarized:z,inverted:y}=f;(f=V(d?\ny:z))||"attemptBoth"!==e.inversionAttempts&&"invertFirst"!==e.inversionAttempts||(f=V(d?z:y));return f}X.default=X;let Y="dontInvert",Z={red:77,green:150,blue:29,useIntegerApproximation:!0};\nself.onmessage=a=>{let b=a.data.id,c=a.data.data;switch(a.data.type){case "decode":(a=X(c.data,c.width,c.height,{inversionAttempts:Y,greyScaleWeights:Z}))?self.postMessage({id:b,type:"qrResult",data:a.data,cornerPoints:[a.location.topLeftCorner,a.location.topRightCorner,a.location.bottomRightCorner,a.location.bottomLeftCorner]}):self.postMessage({id:b,type:"qrResult",data:null});break;case "grayscaleWeights":Z.red=c.red;Z.green=c.green;Z.blue=c.blue;Z.useIntegerApproximation=c.useIntegerApproximation;\nbreak;case "inversionMode":switch(c){case "original":Y="dontInvert";break;case "invert":Y="onlyInvert";break;case "both":Y="attemptBoth";break;default:throw Error("Invalid inversion mode");}break;case "close":self.close()}}\n']),{type:"application/javascript"}));var qrScannerWorker_min=Object.freeze({__proto__:null,createWorker:createWorker});export{NostrLoginInitializer,cancelNeedAuth,init,launch,logout,setAuth,setDarkMode};
|
|
18
|
+
/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */function isBytes(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function abytes(e,...t){if(!isBytes(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function isArrayOf(e,t){return!!Array.isArray(t)&&(0===t.length||(e?t.every((e=>"string"==typeof e)):t.every((e=>Number.isSafeInteger(e)))))}function astr(e,t){if("string"!=typeof t)throw new Error(`${e}: string expected`);return!0}function anumber(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function aArr(e){if(!Array.isArray(e))throw new Error("array expected")}function astrArr(e,t){if(!isArrayOf(!0,t))throw new Error(`${e}: array of strings expected`)}function anumArr(e,t){if(!isArrayOf(!1,t))throw new Error(`${e}: array of numbers expected`)}function chain(...e){const 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 alphabet(e){const t="string"==typeof e?e.split(""):e,n=t.length;astrArr("alphabet",t);const o=new Map(t.map(((e,t)=>[e,t])));return{encode:o=>(aArr(o),o.map((o=>{if(!Number.isSafeInteger(o)||o<0||o>=n)throw new Error(`alphabet.encode: digit index outside alphabet "${o}". Allowed: ${e}`);return t[o]}))),decode:t=>(aArr(t),t.map((t=>{astr("alphabet.decode",t);const n=o.get(t);if(void 0===n)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return n})))}}function join(e=""){return astr("join",e),{encode:t=>(astrArr("join.decode",t),t.join(e)),decode:t=>(astr("join.decode",t),t.split(e))}}function padding(e,t="="){return anumber(e),astr("padding",t),{encode(n){for(astrArr("padding.encode",n);n.length*e%8;)n.push(t);return n},decode(n){astrArr("padding.decode",n);let o=n.length;if(o*e%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;o>0&&n[o-1]===t;o--){if((o-1)*e%8==0)throw new Error("padding: invalid, string has too much padding")}return n.slice(0,o)}}}const gcd=(e,t)=>0===t?e:gcd(t,e%t),radix2carry=(e,t)=>e+(t-gcd(e,t)),powers=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function convertRadix2(e,t,n,o){if(aArr(e),t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(radix2carry(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${radix2carry(t,n)}`);let r=0,s=0;const i=powers[t],a=powers[n]-1,c=[];for(const o of e){if(anumber(o),o>=i)throw new Error(`convertRadix2: invalid data word=${o} from=${t}`);if(r=r<<t|o,s+t>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${t}`);for(s+=t;s>=n;s-=n)c.push((r>>s-n&a)>>>0);const e=powers[s];if(void 0===e)throw new Error("invalid carry");r&=e-1}if(r=r<<n-s&a,!o&&s>=t)throw new Error("Excess padding");if(!o&&r>0)throw new Error(`Non-zero padding: ${r}`);return o&&s>0&&c.push(r>>>0),c}function radix2(e,t=!1){if(anumber(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(radix2carry(8,e)>32||radix2carry(e,8)>32)throw new Error("radix2: carry overflow");return{encode:n=>{if(!isBytes(n))throw new Error("radix2.encode input should be Uint8Array");return convertRadix2(Array.from(n),8,e,!t)},decode:n=>(anumArr("radix2.decode",n),Uint8Array.from(convertRadix2(n,e,8,t)))}}const hasBase64Builtin=(()=>"function"==typeof Uint8Array.from([]).toBase64&&"function"==typeof Uint8Array.fromBase64)(),decodeBase64Builtin=(e,t)=>{astr("base64",e);if(e.length>0&&!/^[A-Za-z0-9=+/]+$/.test(e))throw new Error("invalid base64");return Uint8Array.fromBase64(e,{alphabet:"base64",lastChunkHandling:"strict"})},base64=hasBase64Builtin?{encode:e=>(abytes(e),e.toBase64()),decode:e=>decodeBase64Builtin(e)}:chain(radix2(6),alphabet("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),padding(6),join("")),decoder=new TextDecoder,u={minPlaintextSize:1,maxPlaintextSize:65535,utf8Encode:utf8ToBytes,utf8Decode:e=>decoder.decode(e),getConversationKey(e,t){const n=secp256k1.getSharedSecret(e,"02"+t).subarray(1,33);return extract(sha256,n,"nip44-v2")},getMessageKeys(e,t){const n=expand(sha256,e,t,76);return{chacha_key:n.subarray(0,32),chacha_nonce:n.subarray(32,44),hmac_key:n.subarray(44,76)}},calcPaddedLen(e){if(!Number.isSafeInteger(e)||e<1)throw new Error("expected positive integer");if(e<=32)return 32;const t=1<<Math.floor(Math.log2(e-1))+1,n=t<=256?32:t/8;return n*(Math.floor((e-1)/n)+1)},writeU16BE(e){if(!Number.isSafeInteger(e)||e<u.minPlaintextSize||e>u.maxPlaintextSize)throw new Error("invalid plaintext size: must be between 1 and 65535 bytes");const t=new Uint8Array(2);return new DataView(t.buffer).setUint16(0,e,!1),t},pad(e){const t=u.utf8Encode(e),n=t.length;return concatBytes(u.writeU16BE(n),t,new Uint8Array(u.calcPaddedLen(n)-n))},unpad(e){const t=new DataView(e.buffer).getUint16(0),n=e.subarray(2,2+t);if(t<u.minPlaintextSize||t>u.maxPlaintextSize||n.length!==t||e.length!==2+u.calcPaddedLen(t))throw new Error("invalid padding");return u.utf8Decode(n)},hmacAad(e,t,n){if(32!==n.length)throw new Error("AAD associated data must be 32 bytes");const o=concatBytes(n,t);return hmac(sha256,e,o)},decodePayload(e){if("string"!=typeof e)throw new Error("payload must be a valid string");const t=e.length;if(t<132||t>87472)throw new Error("invalid payload length: "+t);if("#"===e[0])throw new Error("unknown encryption version");let n;try{n=base64.decode(e)}catch(e){throw new Error("invalid base64: "+e.message)}const o=n.length;if(o<99||o>65603)throw new Error("invalid data length: "+o);const r=n[0];if(2!==r)throw new Error("unknown encryption version "+r);return{nonce:n.subarray(1,33),ciphertext:n.subarray(33,-32),mac:n.subarray(-32)}}};function encryptNip44(e,t,n=randomBytes(32)){const{chacha_key:o,chacha_nonce:r,hmac_key:s}=u.getMessageKeys(t,n),i=u.pad(e),a=chacha20(o,r,i),c=u.hmacAad(s,a,n);return base64.encode(concatBytes(new Uint8Array([2]),n,a,c))}function decryptNip44(e,t){const{nonce:n,ciphertext:o,mac:r}=u.decodePayload(e),{chacha_key:s,chacha_nonce:i,hmac_key:a}=u.getMessageKeys(t,n);if(!equalBytes(u.hmacAad(a,o,n),r))throw new Error("invalid MAC");const c=chacha20(s,i,o);return u.unpad(c)}class Nip44{cache=new Map;createKey(e,t){return u.getConversationKey(e,t)}getKey(e,t,n){const o=getPublicKey(hexToBytes(e))+t;let r=this.cache.get(o);if(r)return r;const s=this.createKey(e,t);return this.cache.set(o,s),s}encrypt(e,t,n){return encryptNip44(n,this.getKey(e,t))}decrypt(e,t,n){return decryptNip44(n,this.getKey(e,t))}}class PrivateKeySigner{nip44Codec=new Nip44;privateKey;_secretKey;pubkey;constructor(e){this.privateKey=e,this._secretKey=hexToBytes(e),this.pubkey=getPublicKey(this._secretKey)}async sign(e){const t={kind:e.kind,created_at:e.created_at,tags:e.tags,content:e.content};return finalizeEvent(t,this._secretKey).sig}async user(){return{pubkey:this.pubkey}}async encrypt(e,t){return nip04_exports.encrypt(this.privateKey,e.pubkey,t)}async decrypt(e,t){return nip04_exports.decrypt(this.privateKey,e.pubkey,t)}encryptNip44(e,t){return Promise.resolve(this.nip44Codec.encrypt(this.privateKey,e.pubkey,t))}decryptNip44(e,t){return Promise.resolve(this.nip44Codec.decrypt(this.privateKey,e.pubkey,t))}}const OUTBOX_RELAYS=["wss://user.kindpag.es","wss://purplepag.es","wss://relay.nos.social"],NOSTRCONNECT_APPS=[{name:"Nsec.app",domain:"nsec.app",canImport:!0,img:"https://nsec.app/assets/favicon.ico",link:"https://use.nsec.app/<nostrconnect>"},{name:"Amber",img:"https://raw.githubusercontent.com/greenart7c3/Amber/refs/heads/master/assets/android-icon.svg",link:"<nostrconnect>"},{name:"Other key stores",img:"",link:"<nostrconnect>"}],nostrJsonCache=new Map,NOSTR_JSON_CACHE_TTL=3e5,NOSTR_JSON_FETCH_TIMEOUT=5e3;async function fetchNostrJson(e){const t=nostrJsonCache.get(e);if(t&&Date.now()-t.timestamp<NOSTR_JSON_CACHE_TTL)return t.data;const n=new AbortController,o=setTimeout((()=>n.abort()),NOSTR_JSON_FETCH_TIMEOUT);try{const t=await(await fetch(`https://${e}/.well-known/nostr.json`,{signal:n.signal})).json();return nostrJsonCache.set(e,{data:t,timestamp:Date.now()}),t}finally{clearTimeout(o)}}function generatePrivateKey(){return bytesToHex(generateSecretKey())}class AuthNostrService extends lib.EventEmitter{pool;profilePool;signer=null;localSigner=null;params;signerPromise;signerErrCallback;readyPromise;readyCallback;nip44Codec=new Nip44;nostrConnectKey="";nostrConnectSecret="";iframe;starterReady;nip04;nip44;constructor(e){super(),this.params=e,this.pool=new RelayPool,this.profilePool=new RelayPool;for(const e of OUTBOX_RELAYS)this.profilePool.addRelay(e);this.profilePool.connect().catch((e=>console.warn("profilePool connect failed",e))),this.nip04={encrypt:this.encrypt04.bind(this),decrypt:this.decrypt04.bind(this)},this.nip44={encrypt:this.encrypt44.bind(this),decrypt:this.decrypt44.bind(this)}}isIframe(){return!!this.iframe}async waitReady(){if(this.signerPromise)try{await this.signerPromise}catch{}if(this.readyPromise)try{await this.readyPromise}catch{}}cancelNostrConnect(){console.log("cancelNostrConnect called"),this.releaseSigner(),this.resetAuth(),this.signerErrCallback&&(this.signerErrCallback("cancelled"),this.signerErrCallback=void 0)}cancelSignerInit(){this.cancelNostrConnect()}cancelPendingRequests(){if(console.log("cancelPendingRequests called (signer preserved)"),this.signer&&this.signer.rpc)try{this.signer.rpc.clearPendingRequests?.()}catch(e){console.warn("Failed to clear pending requests",e)}}async nostrConnect(e,{domain:t="",link:n="",iframeUrl:o="",importConnect:r=!1,customRelays:s}={}){console.log("[nostrConnect] Called",{relay:e,domain:t,link:n,iframeUrl:o,importConnect:r,customRelays:s});const i=s&&s.length>0?s:e?[e]:DEFAULT_NIP46_RELAYS,a={authMethod:"connect",pubkey:"",signerPubkey:"",sk:this.nostrConnectKey,domain:t,relays:i,iframeUrl:o};console.log("[nostrConnect] Created info",a,n),n&&!o&&(console.log("[nostrConnect] Opening Amber"),window.open(n,"_blank","width=400,height=700"));try{console.log("[nostrConnect] Calling initSigner with listen=true"),await this.initSigner(a,{listen:!0}),this.signerPromise&&(console.log("[nostrConnect] Waiting for signerPromise to complete"),await this.signerPromise,console.log("[nostrConnect] signerPromise completed"))}catch(e){throw console.error("[nostrConnect] Failed to initialize signer:",e),new Error(`Connection failed: ${e instanceof Error?e.message:"Unknown error"}`)}if(console.log("[nostrConnect] Checking pubkeys",{pubkey:a.pubkey,signerPubkey:a.signerPubkey}),!a.pubkey||!a.signerPubkey)throw console.error("[nostrConnect] Missing pubkeys after initialization"),new Error("Failed to get pubkey from signer");const c=i.map((e=>`relay=${encodeURIComponent(e)}`)).join("&");return a.bunkerUrl=`bunker://${a.signerPubkey}?${c}`,console.log("[nostrConnect] Generated bunkerUrl",a.bunkerUrl),r||(console.log("[nostrConnect] Calling onAuth"),this.onAuth("login",a)),console.log("[nostrConnect] Completed successfully"),a}async createNostrConnect(){this.nostrConnectKey=generatePrivateKey(),this.nostrConnectSecret=Math.random().toString(36).substring(7);const e=getPublicKey(hexToBytes(this.nostrConnectKey)),t=encodeURIComponent(document.location.host),n=encodeURIComponent(document.location.origin);return`nostrconnect://${e}?image=${encodeURIComponent(await getIcon())}&url=${n}&name=${t}&perms=${encodeURIComponent(this.params.optionsModal.perms||"")}&secret=${this.nostrConnectSecret}`}async getNostrConnectServices(e,t){const n=await this.createNostrConnect(),o=NOSTRCONNECT_APPS.map((e=>({...e}))),r=e&&e.length>0?e:DEFAULT_NIP46_RELAYS;for(const e of o)if(e.link.startsWith("https://")){e.available="loading";const t=r.map((e=>`&relay=${encodeURIComponent(e)}`)).join("");e.link=n+t}else{e.available=!0;const t=r.map((e=>`&relay=${encodeURIComponent(e)}`)).join(""),o=n+t;e.link=e.link.replace("<nostrconnect>",o)}t&&t([...o.map((e=>({...e})))]);const s=o.filter((e=>"loading"===e.available)).map((async s=>{const i=s.domain||"";try{const t=await fetchNostrJson(i),o=t.names._;let a=r;const c=t.nip46[o];!c||!c.length||e&&0!==e.length||(a=c),s.iframeUrl=t.nip46.iframe_url||"";const l=a.map((e=>`&relay=${encodeURIComponent(e)}`)).join(""),d=n+l;s.link=s.iframeUrl?d:s.link,s.available=!0}catch(e){console.log("Service unavailable",i,e),s.available=!1}t&&t([...o.map((e=>({...e})))])}));return await Promise.all(s),[n,o]}async localSignup(e,t){const n=!t;t=t||generatePrivateKey();const o={pubkey:getPublicKey(hexToBytes(t)),sk:t,name:e,authMethod:"local"};console.log(`localSignup name: ${e}`),await this.setLocal(o,n)}async setLocal(e,t){this.releaseSigner(),this.localSigner=new PrivateKeySigner(e.sk),t&&await createProfile(e,this.profilePool,this.localSigner,this.params.optionsModal.signupRelays,this.params.optionsModal.outboxRelays),this.onAuth(t?"signup":"login",e)}prepareImportUrl(e){if("otp"===this.params.userInfo?.authMethod)return e+"&import=true";if(!this.localSigner||"local"!==this.params.userInfo?.authMethod)throw new Error("Most be local keys");return e+"#import="+nip19_exports.nsecEncode(hexToBytes(this.localSigner.privateKey))}async importAndConnect(e){const{relay:t,domain:n,link:o,iframeUrl:r}=e;if(!n)throw new Error("Domain required");const s=await this.nostrConnect(t,{domain:n,link:o,importConnect:!0,iframeUrl:r});await this.logout(!0),this.localSigner=null,this.onAuth("login",s)}setReadOnly(e){const t={pubkey:e,authMethod:"readOnly"};this.onAuth("login",t)}setExtension(e){const t={pubkey:e,authMethod:"extension"};this.onAuth("login",t)}setOTP(e,t){const n={pubkey:e,authMethod:"otp",otpData:t};this.onAuth("login",n)}async setConnect(e){this.releaseSigner();try{if(await this.startAuth(),await this.initSigner(e,{connect:!0}),!e.pubkey||!e.signerPubkey)throw new Error("Failed to initialize signer: missing pubkey");this.onAuth("login",e),await this.endAuth()}catch(e){throw console.error("Failed to set connect:",e),this.resetAuth(),this.releaseSigner(),e}}async createAccount(e){const[t,n]=e.split("@"),o=await getBunkerUrl(`_@${n}`,this.params.optionsModal);console.log("create account bunker's url",o);const r=bunkerUrlToInfo(o);if(!r.signerPubkey)throw new Error("Bad bunker url");const s=Boolean(this.params.userInfo);await this.initSigner(r,{eventToAddAccount:s});return{bunkerUrl:`bunker://${await this.signer.createAccount2({bunkerPubkey:r.signerPubkey,name:t,domain:n,perms:this.params.optionsModal.perms})}?relay=${r.relays?.[0]}`,sk:r.sk}}releaseSigner(){if(console.log("releaseSigner called"),this.signer&&this.signer.rpc){try{this.signer.rpc.clearPendingRequests?.()}catch(e){console.warn("Failed to clear pending requests",e)}try{this.signer.rpc.stop?.()}catch(e){console.warn("Failed to stop RPC subscription",e)}}this.signer=null,this.signerErrCallback&&(this.signerErrCallback("cancelled"),this.signerErrCallback=void 0),this.localSigner=null,this.pool.removeAllRelays(),this.signerPromise=void 0}async logout(e=!1){e||this.releaseSigner(),localStorageRemoveCurrentAccount(),this.onAuth("logout"),this.emit("updateAccounts")}setUserInfo(e){this.params.userInfo=e,this.emit("onUserInfo",e),e&&(localStorageAddAccount(e),this.emit("updateAccounts"))}exportKeys(){return this.params.userInfo?"local"!==this.params.userInfo.authMethod?"":nip19_exports.nsecEncode(hexToBytes(this.params.userInfo.sk)):""}onAuth(e,t=null){if("logout"!==e&&!t)throw new Error("No user info in onAuth");if(t&&this.params.userInfo&&(t.pubkey!==this.params.userInfo.pubkey||t.authMethod!==this.params.userInfo.authMethod)){const e=new CustomEvent("nlAuth",{detail:{type:"logout"}});console.log("nostr-login auth",e.detail),document.dispatchEvent(e)}this.setUserInfo(t),t&&fetchProfile(t,this.profilePool).then((e=>{if(this.params.userInfo!==t)return;const n={...this.params.userInfo,picture:e?.image||e?.picture,name:e?.name||e?.displayName||e?.nip05||nip19_exports.npubEncode(t.pubkey)};this.setUserInfo(n)}));try{const n=t?nip19_exports.npubEncode(t.pubkey):"",o={type:e};"logout"===e?(this.iframe&&this.iframe.remove(),this.iframe=void 0):(o.pubkey=t.pubkey,o.name=t.name,t.sk&&(o.localNsec=nip19_exports.nsecEncode(hexToBytes(t.sk))),t.relays&&(o.relays=t.relays),t.otpData&&(o.otpData=t.otpData),o.method=t.authMethod||"connect");const r=new CustomEvent("nlAuth",{detail:o});console.log("nostr-login auth",o),document.dispatchEvent(r),this.params.optionsModal.onAuth&&this.params.optionsModal.onAuth(n,o)}catch(e){console.log("onAuth error",e)}}async createIframe(e){if(!e)return;const t=new URL(e);let n;const o="__nostr-login-worker-iframe-"+t.hostname.replaceAll(".","-");n=document.querySelector(`#${o}`),console.log("iframe",o,n),n||(n=document.createElement("iframe"),n.setAttribute("width","0"),n.setAttribute("height","0"),n.setAttribute("border","0"),n.style.display="none",n.id=o,document.body.append(n)),n.setAttribute("src",e);const r=new ReadyListener(["workerReady","workerError"],t.origin);await new Promise((e=>{n.addEventListener("load",e)}));const s=await r.wait();return console.log("nostr-login iframe ready",e,s),{iframe:n,port:s[1]}}async sendNeedAuth(){const[e]=await this.getNostrConnectServices(),t=new CustomEvent("nlNeedAuth",{detail:{nostrconnect:e}});console.log("nostr-login need auth",e),document.dispatchEvent(t)}isAuthing(){return!!this.readyCallback}async startAuth(){console.log("startAuth"),this.readyCallback&&(console.log("startAuth: previous auth still active, cancelling it first"),this.cancelNostrConnect()),this.readyPromise=new Promise((e=>this.readyCallback=e))}async endAuth(){if(console.log("endAuth",this.params.userInfo),this.params.userInfo&&this.params.userInfo.iframeUrl){const{iframe:e,port:t}=await this.createIframe(this.params.userInfo.iframeUrl)||{};if(this.iframe=e,!this.iframe||!t)return;this.signer.rpc.setWorkerIframePort(t)}this.readyCallback&&(this.readyCallback(),this.readyCallback=void 0)}resetAuth(){this.readyCallback&&(this.readyCallback(),this.readyCallback=void 0)}async listen(e){if(!e.iframeUrl)return this.signer.listen(this.nostrConnectSecret);const t=await this.starterReady.wait();if("starterError"===t[0])throw new Error(t[1]);return this.signer.setListenReply(t[1],this.nostrConnectSecret)}async connect(e,t){return this.signer.connect(e.token,t)}async initSigner(e,{listen:t=!1,connect:n=!1,eventToAddAccount:o=!1}={}){if(this.signerPromise)try{await this.signerPromise}catch(e){"cancelled"!==e&&console.error("Previous signer promise failed:",e)}console.log("initSigner info",e);const r=e.iframeUrl?new URL(e.iframeUrl).origin:void 0;return r&&(this.starterReady=new ReadyListener(["starterDone","starterError"],r)),this.emit("onIframeUrl",e.iframeUrl),this.signerPromise=new Promise((async(s,i)=>{this.signerErrCallback=e=>{console.log("Signer initialization cancelled or failed:",e),i(e)};try{if(e.relays&&!e.iframeUrl)for(const t of e.relays)this.pool.addRelay(t);await this.pool.connect(1e4);const i=new PrivateKeySigner(e.sk);this.signer=new Nip46Signer(this.pool,i,e.signerPubkey,r),this.signer.on("iframeRestart",(async()=>{const t=e.iframeUrl+(e.iframeUrl.includes("?")?"&":"?")+"pubkey="+e.pubkey+"&rebind="+i.pubkey;this.emit("iframeRestart",{pubkey:e.pubkey,iframeUrl:t})})),this.signer.on("authUrl",(t=>{console.log("nostr login auth url",t),this.emit("onAuthUrl",{url:t,iframeUrl:e.iframeUrl,eventToAddAccount:o})})),t?await this.listen(e):n?await this.connect(e,this.params.optionsModal.perms):await this.signer.initUserPubkey(e.pubkey),e.pubkey=this.signer.userPubkey,e.signerPubkey=this.signer.bunkerPubkey,console.log("Signer initialized successfully. User pubkey:",e.pubkey,"Signer pubkey:",e.signerPubkey),this.signerErrCallback=void 0,s()}catch(e){console.error("initSigner failure",e),this.signer=null,this.signerErrCallback=void 0,i(e)}})),this.signerPromise}async authNip46(e,{name:t,bunkerUrl:n,sk:o="",domain:r="",iframeUrl:s="",customRelays:i}){try{const a=bunkerUrlToInfo(n,o);if(isBunkerUrl(t)?a.bunkerUrl=t:(a.nip05=t,a.domain=t.split("@")[1]),r&&(a.domain=r),s&&(a.iframeUrl=s),i&&i.length>0&&(a.relays=i),!a.signerPubkey||!a.sk||!a.relays?.[0])throw new Error(`Bad bunker url ${n}`);const c=Boolean(this.params.userInfo);console.log("authNip46",e,a),await this.initSigner(a,{connect:!0,eventToAddAccount:c}),this.onAuth(e,a)}catch(e){throw console.error("nostr login auth failed",e),e}}async signEvent(e){if(this.localSigner)return e.pubkey=this.localSigner.pubkey,e.id=getEventHash(e),e.sig=await this.localSigner.sign(e),console.log("signed (local)",{event:e}),e;let t;for(let n=0;n<=2;n++)try{if(!this.signer)throw new Error("Signer is not initialized. Please reconnect.");await this.ensureRelayConnection(),e.pubkey=this.signer.userPubkey,e.id=getEventHash(e);const t=await(this.signer?.sign(e));return"object"==typeof t&&t.sig?(e.pubkey=t.pubkey||e.pubkey,e.id=t.id||e.id,e.sig=t.sig):e.sig=t,console.log("signed",{event:e,attempt:n}),e}catch(e){t=e;const o=e instanceof Nip46Error&&"SIGNER_REJECTED"===e.code,r=e instanceof Error&&("Cancelled by user"===e.message||"cancelled"===e.message);if(n<2&&!o&&!r){console.warn(`signEvent attempt ${n+1}/3 failed, retrying...`,e);try{await this.forceReconnect()}catch(e){console.warn("forceReconnect failed during retry, will try sign anyway",e)}continue}break}throw t}async forceReconnect(){console.log("forceReconnect: forcing clean relay reconnection..."),this.pool.disconnectAll(),this.ensureRelaysInPool(),await this.pool.connect(1e4),await this.waitForAtLeastOneRelay(8e3),await this.ensureSubscription()}async ensureRelayConnection(){this.ensureRelaysInPool();const e=this.pool.isAnyConnected(),t=!this.signer?.rpc||!1!==this.signer.rpc.isSubscriptionActive?.();e?t||(console.log("ensureRelayConnection: relay connected but subscription dead, resubscribing..."),await this.ensureSubscription()):(console.log("ensureRelayConnection: relay disconnected, forcing clean reconnect..."),this.pool.disconnectAll(),this.ensureRelaysInPool(),await this.pool.connect(1e4),await this.waitForAtLeastOneRelay(8e3),await this.ensureSubscription())}ensureRelaysInPool(){if(0===this.pool.relayUrls.length){console.warn("ensureRelaysInPool: no relays in pool, adding relays");const e=this.params.userInfo?.relays?.length?this.params.userInfo.relays:DEFAULT_NIP46_RELAYS;for(const t of e)this.pool.addRelay(t)}}async ensureSubscription(){if(this.signer&&this.signer.rpc)try{this.signer.rpc.resubscribe?.(),console.log("ensureSubscription: subscription re-established")}catch(e){console.warn("ensureSubscription: failed to resubscribe",e)}}async waitForAtLeastOneRelay(e){const t=Date.now();for(;Date.now()-t<e;){if(this.pool.isAnyConnected())return;await new Promise((e=>setTimeout(e,300)))}if(!this.pool.isAnyConnected())throw new Nip46Error("Failed to connect to any relay","RELAY_DISCONNECTED")}async codec_call(e,t,n){return new Promise(((o,r)=>{this.signer.rpc.sendRequest(this.signer.bunkerPubkey,e,[t,n],24133,(e=>{e.error?e.error.includes("timeout")||"Request timeout"===e.error?r(new Nip46Error(e.error,"TIMEOUT")):r(new Nip46Error(e.error,"SIGNER_REJECTED")):o(e.result)}))}))}async encrypt04(e,t){return await this.ensureRelayConnection(),this.localSigner?this.localSigner.encrypt({pubkey:e},t):this.signer.encrypt(e,t)}async decrypt04(e,t){return await this.ensureRelayConnection(),this.localSigner?this.localSigner.decrypt({pubkey:e},t):this.codec_call("nip04_decrypt",e,t)}async encrypt44(e,t){return await this.ensureRelayConnection(),this.localSigner?this.nip44Codec.encrypt(this.localSigner.privateKey,e,t):this.codec_call("nip44_encrypt",e,t)}async decrypt44(e,t){return await this.ensureRelayConnection(),this.localSigner?this.nip44Codec.decrypt(this.localSigner.privateKey,e,t):this.codec_call("nip44_decrypt",e,t)}}function loadCustomNip46Relays(){try{const e=localStorage.getItem("customNip46Relays");if(e){const t=JSON.parse(e);if(Array.isArray(t)&&t.length>0)return t}}catch(e){console.error("Failed to load custom relays from localStorage",e)}return[...DEFAULT_NIP46_RELAYS]}class ModalManager extends lib.EventEmitter{modal=null;params;extensionService;authNostrService;launcherPromise;accounts=[];recents=[];opt;customNip46Relays=loadCustomNip46Relays();constructor(e,t,n){super(),this.params=e,this.extensionService=n,this.authNostrService=t}async waitReady(){if(this.launcherPromise){try{await this.launcherPromise}catch{}this.launcherPromise=void 0}}async launch(e){console.log("nostr-login launch",e),this.launcherPromise&&await this.waitReady(),this.authNostrService.isAuthing()&&this.authNostrService.resetAuth(),this.customNip46Relays=loadCustomNip46Relays(),this.opt=e;const t=document.createElement("dialog");if(this.modal=document.createElement("nl-auth"),this.modal.accounts=this.accounts,this.modal.recents=this.recents,this.modal.setAttribute("dark-mode",String(getDarkMode(e))),e.theme&&this.modal.setAttribute("theme",e.theme),e.startScreen&&this.modal.setAttribute("start-screen",e.startScreen),e.bunkers)this.modal.setAttribute("bunkers",e.bunkers);else{let e="nsec.app,highlighter.com";this.modal.setAttribute("bunkers",e)}void 0!==e.methods&&(this.modal.authMethods=e.methods),void 0!==e.localSignup&&(this.modal.localSignup=e.localSignup),void 0!==e.signupNstart&&(this.modal.signupNjump=e.signupNstart),e.title&&(this.modal.welcomeTitle=e.title),e.description&&(this.modal.welcomeDescription=e.description),this.modal.hasExtension=this.extensionService.hasExtension(),this.modal.hasOTP=!!e.otpRequestUrl&&!!e.otpReplyUrl,this.modal.isLoadingExtension=!1,this.modal.isLoading=!1,t.appendChild(this.modal),document.body.appendChild(t),this.authNostrService.getNostrConnectServices(this.customNip46Relays,(e=>{this.modal&&(this.modal.connectionStringServices=e)})).then((([e,t])=>{this.modal&&(this.modal.connectionString=e,this.modal.connectionStringServices=t)})).catch((e=>{console.log("Failed to load nostr connect services",e)}));let n="";return this.launcherPromise=new Promise(((e,o)=>{t.addEventListener("close",(()=>{o(new Error("Closed")),this.authNostrService.resetAuth(),this.modal&&(document.body.removeChild(this.modal.parentNode),this.modal=null)}));const r=async e=>{this.modal&&(this.modal.isLoading=!1),await this.authNostrService.endAuth(),e(),t.close(),this.modal=null},s=async(t,n)=>{this.modal&&(this.modal.isLoading=!0);try{n&&!n.start||await this.authNostrService.startAuth(),await t(),n&&!n.end||await r(e)}catch(e){console.log("error",e),this.modal&&(this.modal.isLoading=!1,this.modal.authUrl="",this.modal.iframeUrl="","cancelled"!==e&&(this.modal.error=e.toString()))}},i=async(e,t)=>{await s((async()=>{const n=await getBunkerUrl(e,this.params.optionsModal);await this.authNostrService.authNip46("login",{name:e,bunkerUrl:n,domain:t,customRelays:this.customNip46Relays})}))},a=async e=>{await s((async()=>{const{bunkerUrl:t,sk:n}=await this.authNostrService.createAccount(e);await this.authNostrService.authNip46("signup",{name:e,bunkerUrl:t,sk:n})}))},c=async()=>{try{await navigator.clipboard.writeText(this.authNostrService.exportKeys()),localStorageSetItem("backupKey","true")}catch(e){console.error("Failed to copy to clipboard: ",e)}},l=async e=>{await s((async()=>{const{iframeUrl:t}=e;e.link=this.authNostrService.prepareImportUrl(e.link),this.modal&&t&&(this.modal.authUrl=e.link,this.modal.iframeUrl=t,console.log("nostrconnect authUrl",this.modal.authUrl,this.modal.iframeUrl)),await this.authNostrService.importAndConnect(e)}))},d=async e=>{await s((async()=>{const{relay:t,domain:n,link:o,iframeUrl:r}=e||{};console.log("nostrConnect",e,t,n,o,r),this.modal&&r&&(this.modal.authUrl=o,this.modal.iframeUrl=r,console.log("nostrconnect authUrl",this.modal.authUrl,this.modal.iframeUrl)),!e&&this.modal&&(this.modal.isLoading=!1),await this.authNostrService.nostrConnect(t,{domain:n,link:o,iframeUrl:r,customRelays:this.customNip46Relays})}))},h=async e=>{await s((async()=>{if(!e)throw new Error("Please enter some nickname");await this.authNostrService.localSignup(e)}))},u=async()=>{await s((async()=>{const e=new URL(window.location.href),t=e.hostname.toLocaleLowerCase().replace(/^www\./i,"").charAt(0).toUpperCase()+e.hostname.slice(1),n=prepareSignupRelays(this.params.optionsModal.signupRelays);return this.modal.njumpIframe=`\n <html><body>\n <script src='https://start.njump.me/modal.js'><\/script>\n <script>\n new NstartModal({\n baseUrl: 'https://start.njump.me',\n // Required parameters\n an: '${t}',\n // Optional parameters\n s: [${this.opt.followNpubs?`'${this.opt.followNpubs}'`:""}],\n afb: false, // forceBunker\n asb: false, // skipBunker\n aan: false, // avoidNsec\n aac: true, // avoidNcryptsec\n ahc: true, // hide close button\n arr: ${JSON.stringify(n)}, //readRelays\n awr: ${JSON.stringify(n)}, //writeRelays\n // Callbacks\n onComplete: (result) => {\n console.log('Login token:', result.nostrLogin);\n window.parent.location.href='${window.location.href}#nostr-login='+result.nostrLogin;\n },\n onCancel: () => {\n window.parent.location.href='${window.location.href}#nostr-login=null';\n },\n }).open();\n <\/script>\n </body></html>\n `.replaceAll("&","&"),new Promise(((e,t)=>{const n=async n=>{if(console.log("nsecOrBunker",n),n.startsWith("nsec1")){let t;try{t=nip19_exports.decode(n)}catch(e){throw new Error("Bad nsec value")}if("nsec"!==t.type)throw new Error("Bad bech32 type");await this.authNostrService.localSignup("",bytesToHex(t.data)),e()}else n.startsWith("bunker:")?(await this.authNostrService.authNip46("login",{name:"",bunkerUrl:n}),e()):t("null"===n?"Cancelled":"Unknown return value")};window.addEventListener("hashchange",(async()=>{if(window.location.hash.startsWith("#nostr-login=")){const e=window.location.hash.split("#nostr-login=")[1],t=new URL(window.location.toString());t.hash="",window.history.replaceState({},"",t.toString()),n(e)}}))}))}))};if(!this.modal)throw new Error("WTH?");this.modal.addEventListener("handleContinue",(()=>{this.modal&&(this.modal.isLoading=!0,this.emit("onAuthUrlClick",this.modal.authUrl))})),this.modal.addEventListener("nlLogin",(e=>{i(e.detail)})),this.modal.addEventListener("nlRelaysChanged",(async e=>{if(this.customNip46Relays=e.detail,console.log("Custom Nip46 relays updated:",this.customNip46Relays),this.modal){const e=this.modal;await this.authNostrService.getNostrConnectServices(this.customNip46Relays,(t=>{e.connectionStringServices=t})).then((([t,n])=>{e.connectionString=t,e.connectionStringServices=n}))}})),this.modal.addEventListener("nlSignup",(e=>{a(e.detail)})),this.modal.addEventListener("nlLocalSignup",(e=>{h(e.detail)})),this.modal.addEventListener("nlLoginNsec",(async e=>{await s((async()=>{const t=e.detail;if(!t)throw new Error("Please enter your nsec");let n;try{n=nip19_exports.decode(t)}catch(e){throw new Error("Invalid nsec format")}if("nsec"!==n.type)throw new Error("Invalid key type, expected nsec");await this.authNostrService.localSignup("",bytesToHex(n.data))}))})),this.modal.addEventListener("nlSignupNjump",(e=>{u()})),this.modal.addEventListener("nlImportAccount",(e=>{l(e.detail)})),this.modal.addEventListener("nlExportKeys",(e=>{c()})),this.modal.addEventListener("handleLogoutBanner",(()=>{this.emit("onLogoutBanner")})),this.modal.addEventListener("nlNostrConnect",(e=>{d(e.detail)})),this.modal.addEventListener("nlNostrConnectDefault",(()=>{this.authNostrService.isAuthing()||d()})),this.modal.addEventListener("nlNostrConnectDefaultCancel",(()=>{console.log("nlNostrConnectDefaultCancel"),this.authNostrService.cancelNostrConnect()})),this.modal.addEventListener("nlSwitchAccount",(e=>{const n=e.detail;this.emit("onSwitchAccount",n),setTimeout((()=>t.close()),300)})),this.modal.addEventListener("nlLoginRecentAccount",(async e=>{const n=e.detail;if("readOnly"===n.authMethod)this.authNostrService.setReadOnly(n.pubkey),t.close();else if("otp"===n.authMethod)try{this.modal.dispatchEvent(new CustomEvent("nlLoginOTPUser",{detail:n.nip05||n.pubkey}))}catch(e){console.error(e)}else if("extension"===n.authMethod)await this.extensionService.trySetExtensionForPubkey(n.pubkey),t.close();else{const e=n.bunkerUrl||n.nip05;if(!e)throw new Error("Bad connect info");i(e,n.domain)}})),this.modal.addEventListener("nlRemoveRecent",(e=>{localStorageRemoveRecent(e.detail),this.emit("updateAccounts")}));const f=async e=>{let t="";if(e.includes("@")){const{error:n,pubkey:o}=await checkNip05(e);if(!o)throw new Error(n);t=o}else if(e.startsWith("npub")){const{type:n,data:o}=nip19_exports.decode(e);if("npub"!==n)throw new Error("Bad npub");t=o}else 64===e.trim().length&&(t=e.trim(),nip19_exports.npubEncode(t));return t};this.modal.addEventListener("nlLoginReadOnly",(async e=>{await s((async()=>{const t=e.detail,n=await f(t);this.authNostrService.setReadOnly(n)}))})),this.modal.addEventListener("nlLoginExtension",(async()=>{if(!this.extensionService.hasExtension())throw new Error("No extension");await s((async()=>{this.modal&&(this.modal.isLoadingExtension=!0,await this.extensionService.setExtension(),this.modal.isLoadingExtension=!1)}))})),this.modal.addEventListener("nlLoginOTPUser",(async e=>{await s((async()=>{if(!this.modal)return;const t=e.detail,o=await f(t),r=this.opt.otpRequestUrl+(this.opt.otpRequestUrl.includes("?")?"&":"?")+"pubkey="+o,s=await fetch(r);if(200!==s.status)throw console.warn("nostr-login: bad otp reply",s),new Error("Failed to send DM");this.modal.isOTP=!0,n=o,this.modal.isLoading=!1}),{start:!0})})),this.modal.addEventListener("nlLoginOTPCode",(async e=>{await s((async()=>{if(!this.modal)return;const t=e.detail,o=this.opt.otpReplyUrl+(this.opt.otpRequestUrl.includes("?")?"&":"?")+"pubkey="+n+"&code="+t,r=await fetch(o);if(200!==r.status)throw console.warn("nostr-login: bad otp reply",r),new Error("Invalid code");const s=await r.text();this.authNostrService.setOTP(n,s),this.modal.isOTP=!1}),{end:!0})})),this.modal.addEventListener("nlCheckSignup",(async e=>{const{available:t,taken:n,error:o}=await checkNip05(e.detail);this.modal&&(this.modal.error=String(o),!o&&n&&(this.modal.error="Already taken"),this.modal.signupNameIsAvailable=t)})),this.modal.addEventListener("nlCheckLogin",(async e=>{const{available:t,taken:n,error:o}=await checkNip05(e.detail);this.modal&&(this.modal.error=String(o),t&&(this.modal.error="Name not found"),this.modal.loginIsGood=n)}));const p=()=>{this.modal&&(this.modal.isLoading=!1),this.authNostrService.isAuthing()&&this.authNostrService.cancelSignerInit(),t.close(),o(new Error("Cancelled"))};this.modal.addEventListener("stopFetchHandler",p),this.modal.addEventListener("nlCloseModal",p),this.modal.addEventListener("nlChangeDarkMode",(e=>{setDarkMode(e.detail),document.dispatchEvent(new CustomEvent("nlDarkMode",{detail:e.detail}))})),this.on("onIframeAuthUrlCallEnd",(()=>{t.close(),this.modal=null,e()})),t.showModal()})),this.launcherPromise}async showIframeUrl(e){await this.waitReady(),this.launch({startScreen:"iframe"}).catch((()=>console.log("closed auth iframe"))),this.modal.authUrl=e}connectModals(e){const t=async e=>{await this.launch(e)},n=document.getElementsByTagName("nl-button");for(let o=0;o<n.length;o++){const r=n[o].getAttribute("nl-theme"),s=n[o].getAttribute("start-screen"),i={...e};switch(r&&(i.theme=r),s){case"login":case"login-bunker-url":case"login-read-only":case"signup":case"switch-account":case"welcome":i.startScreen=s}n[o].addEventListener("click",(function(){t(i)}))}}onAuthUrl(e){this.modal&&(this.modal.authUrl=e,this.modal.isLoading=!1)}onIframeUrl(e){this.modal&&(console.log("modal iframe url",e),this.modal.iframeUrl=e)}onCallEnd(){this.modal&&this.modal.authUrl&&this.params.userInfo?.iframeUrl&&this.emit("onIframeAuthUrlCallEnd")}onUpdateAccounts(e,t){this.accounts=e,this.recents=t,this.modal&&(this.modal.accounts=e,this.modal.recents=t)}onDarkMode(e){this.modal&&(this.modal.darkMode=e)}}class Nostr{#e;nip04;nip44;constructor(e){this.#e=e,this.getPublicKey=this.getPublicKey.bind(this),this.signEvent=this.signEvent.bind(this),this.getRelays=this.getRelays.bind(this),this.nip04={encrypt:this.encrypt04.bind(this),decrypt:this.decrypt04.bind(this)},this.nip44={encrypt:this.encrypt44.bind(this),decrypt:this.decrypt44.bind(this)}}async ensureAuth(){if(await this.#e.waitReady(),!this.#e.getUserInfo()&&(await this.#e.launch(),!this.#e.getUserInfo()))throw new Error("Rejected by user")}async getPublicKey(){await this.ensureAuth();const e=this.#e.getUserInfo();if(e)return e.pubkey;throw new Error("No user")}async signEvent(e){return await this.ensureAuth(),this.#e.wait((async()=>await this.#e.getSigner().signEvent(e)))}async getRelays(){return{}}async encrypt04(e,t){return await this.ensureAuth(),this.#e.wait((async()=>await this.#e.getSigner().nip04.encrypt(e,t)))}async decrypt04(e,t){return await this.ensureAuth(),this.#e.wait((async()=>await this.#e.getSigner().nip04.decrypt(e,t)))}async encrypt44(e,t){return await this.ensureAuth(),this.#e.wait((async()=>await this.#e.getSigner().nip44.encrypt(e,t)))}async decrypt44(e,t){return await this.ensureAuth(),this.#e.wait((async()=>await this.#e.getSigner().nip44.decrypt(e,t)))}}class NostrExtensionService extends lib.EventEmitter{params;nostrExtension;constructor(e){super(),this.params=e}startCheckingExtension(e){if(this.checkExtension(e))return;const t=setInterval((()=>{this.checkExtension(e)&&clearTimeout(t)}),100)}checkExtension(e){return!(this.nostrExtension||!window.nostr||window.nostr===e)&&(this.initExtension(e),!0)}async initExtension(e,t){this.nostrExtension=window.nostr,window.nostr=e,"extension"===this.params.userInfo?.authMethod&&await this.trySetExtensionForPubkey(this.params.userInfo.pubkey),t||setTimeout((()=>{window.nostr!==e&&this.nostrExtension!==window.nostr&&this.initExtension(e,!0)}),300)}async setExtensionReadPubkey(e){window.nostr=this.nostrExtension;const t=await window.nostr.getPublicKey();e&&e!==t?this.emit("extensionLogout"):this.emit("extensionLogin",t)}async trySetExtensionForPubkey(e){if(this.nostrExtension)return this.setExtensionReadPubkey(e)}async setExtension(){return this.setExtensionReadPubkey()}unsetExtension(e){window.nostr===this.nostrExtension&&(window.nostr=e)}getExtension(){return this.nostrExtension}hasExtension(){return!!this.nostrExtension}}class NostrParams{userInfo;optionsModal;constructor(){this.userInfo=null,this.optionsModal={theme:"default",startScreen:"welcome",devOverrideBunkerOrigin:""}}}class Popup{popup=null;constructor(){}openPopup(e){if((!this.popup||this.popup.closed)&&(this.popup=window.open(e,"_blank","width=400,height=700"),console.log("popup",this.popup),!this.popup))throw new Error("Popup blocked. Try again, please!")}closePopup(){try{this.popup?.close(),this.popup=null}catch{}}}class ProcessManager extends lib.EventEmitter{callCount=0;callTimer;pendingCalls=new Map;callIdCounter=0;constructor(){super()}cancelAllPendingCalls(){for(const[e,{reject:t}]of this.pendingCalls.entries())t(new Error("Cancelled by user"));this.pendingCalls.clear(),this.callTimer&&(clearTimeout(this.callTimer),this.callTimer=void 0),this.callCount=0}onAuthUrl(){this.callTimer&&(clearTimeout(this.callTimer),this.callTimer=setTimeout((()=>this.emit("onCallTimeout")),AUTH_URL_CALL_TIMEOUT))}onIframeUrl(){Boolean(this.callTimer)&&clearTimeout(this.callTimer)}async wait(e){this.callTimer||(this.callTimer=setTimeout((()=>this.emit("onCallTimeout")),CALL_TIMEOUT)),this.callCount||this.emit("onCallStart"),this.callCount++;const t=this.callIdCounter++;let n,o;try{o=await new Promise((async(n,o)=>{this.pendingCalls.set(t,{reject:o});try{const o=await e();this.pendingCalls.delete(t),n(o)}catch(e){this.pendingCalls.delete(t),o(e)}}))}catch(e){n=e}if(this.callCount--,this.emit("onCallEnd"),this.callTimer&&clearTimeout(this.callTimer),this.callTimer=void 0,n)throw n;return o}}class NostrLoginInitializer{extensionService;params;authNostrService;nostr;processManager;popupManager;bannerManager;modalManager;customLaunchCallback;constructor(){this.params=new NostrParams,this.processManager=new ProcessManager,this.popupManager=new Popup,this.bannerManager=new BannerManager(this.params),this.authNostrService=new AuthNostrService(this.params),this.extensionService=new NostrExtensionService(this.params),this.modalManager=new ModalManager(this.params,this.authNostrService,this.extensionService);const e={waitReady:async()=>{await this.authNostrService.waitReady(),await this.modalManager.waitReady()},getUserInfo:()=>this.params.userInfo,getSigner:()=>{if("readOnly"===this.params.userInfo.authMethod)throw new Error("Read only");return"extension"===this.params.userInfo.authMethod?this.extensionService.getExtension():this.authNostrService},launch:()=>this.launch(),wait:e=>this.processManager.wait(e)};this.nostr=new Nostr(e),this.processManager.on("onCallTimeout",(()=>{this.bannerManager.onCallTimeout()})),this.processManager.on("onCallEnd",(()=>{this.bannerManager.onCallEnd(),this.modalManager.onCallEnd()})),this.processManager.on("onCallStart",(()=>{this.bannerManager.onCallStart()})),this.authNostrService.on("onIframeUrl",(e=>{this.modalManager.onIframeUrl(e)})),this.authNostrService.on("iframeRestart",(({iframeUrl:e})=>{this.processManager.onIframeUrl(),this.bannerManager.onIframeRestart(e)})),this.authNostrService.on("onAuthUrl",(({url:e,iframeUrl:t,eventToAddAccount:n})=>{this.processManager.onAuthUrl(),n?this.modalManager.onAuthUrl(e):this.params.userInfo?this.bannerManager.onAuthUrl(e,t):this.modalManager.onAuthUrl(e)})),this.authNostrService.on("updateAccounts",(()=>{this.updateAccounts()})),this.authNostrService.on("onUserInfo",(e=>{this.bannerManager.onUserInfo(e)})),this.modalManager.on("onAuthUrlClick",(e=>{this.openPopup(e)})),this.bannerManager.on("onIframeAuthUrlClick",(e=>{this.modalManager.showIframeUrl(e)})),this.modalManager.on("onSwitchAccount",(async e=>{this.switchAccount(e)})),this.modalManager.on("onLogoutBanner",(async e=>{logout()})),this.bannerManager.on("onConfirmLogout",(async()=>{this.launch("confirm-logout")})),this.modalManager.on("updateAccounts",(()=>{this.updateAccounts()})),this.bannerManager.on("logout",(()=>{logout()})),this.bannerManager.on("onAuthUrlClick",(e=>{this.openPopup(e)})),this.bannerManager.on("onSwitchAccount",(async e=>{this.switchAccount(e)})),this.bannerManager.on("import",(()=>{this.launch("import")})),this.extensionService.on("extensionLogin",(e=>{this.authNostrService.setExtension(e)})),this.extensionService.on("extensionLogout",(()=>{logout()})),this.bannerManager.on("launch",(e=>{this.launch(e)})),this.bannerManager.on("cancelTimeout",(()=>{this.authNostrService.cancelPendingRequests(),this.processManager.cancelAllPendingCalls(),this.bannerManager.onCallEnd()}))}openPopup(e){this.popupManager.openPopup(e)}async switchAccount(e,t=!1){if(console.log("nostr login switch to info",e),this.extensionService.unsetExtension(this.nostr),"readOnly"===e.authMethod)this.authNostrService.setReadOnly(e.pubkey);else if("otp"===e.authMethod)this.authNostrService.setOTP(e.pubkey,e.otpData||"");else if("local"===e.authMethod&&e.sk)this.authNostrService.setLocal(e,t);else if("extension"===e.authMethod)await this.extensionService.trySetExtensionForPubkey(e.pubkey);else{if(!("connect"===e.authMethod&&e.sk&&e.relays&&e.relays[0]))throw new Error("Bad auth info");this.authNostrService.setConnect(e)}}updateAccounts(){const e=localStorageGetAccounts(),t=localStorageGetRecents();this.bannerManager.onUpdateAccounts(e),this.modalManager.onUpdateAccounts(e,t)}async launchCustomNostrConnect(){try{this.authNostrService.isAuthing()&&this.authNostrService.cancelNostrConnect();const e=new Promise((e=>this.customLaunchCallback=e));await this.authNostrService.startAuth(),await this.authNostrService.sendNeedAuth();try{await this.authNostrService.nostrConnect(),await this.authNostrService.endAuth()}catch(t){"cancelled"===t&&await e}}catch(e){console.error("launchCustomNostrConnect",e)}}fulfillCustomLaunchPromise(){if(this.customLaunchCallback){const e=this.customLaunchCallback;this.customLaunchCallback=void 0,e()}}launch=async e=>{if(!e&&this.params.optionsModal.customNostrConnect)return this.launchCustomNostrConnect();const t=localStorageGetRecents(),n=localStorageGetAccounts(),o={...this.params.optionsModal};e&&"default"!==e?o.startScreen=e:(Boolean(t?.length)||Boolean(n?.length))&&(o.startScreen="switch-account"),this.customLaunchCallback&&this.authNostrService.cancelNostrConnect();try{await this.modalManager.launch(o),this.fulfillCustomLaunchPromise()}catch(e){console.log("nostr-login failed",e)}};init=async e=>{this.extensionService.startCheckingExtension(this.nostr),window.nostr=this.nostr,this.modalManager.connectModals(e),this.bannerManager.launchAuthBanner(e),e&&(this.params.optionsModal={...e});try{const e=localStorageGetCurrent();if(e){if(!e.pubkey)throw new Error("Bad stored info");await this.switchAccount(e)}}catch(e){console.log("nostr login init error",e),await logout()}this.updateAccounts()};logout=async()=>{this.extensionService.unsetExtension(this.nostr),await this.authNostrService.logout()};setDarkMode=e=>{localStorageSetItem("nl-dark-mode",`${e}`),this.bannerManager.onDarkMode(e),this.modalManager.onDarkMode(e)};setAuth=async e=>{if(!e.type)throw new Error("Invalid auth event");if("login"!==e.type&&"logout"!==e.type&&"signup"!==e.type)throw new Error("Invalid auth event");if(e.method&&"connect"!==e.method&&"extension"!==e.method&&"local"!==e.method&&"otp"!==e.method&&"readOnly"!==e.method)throw new Error("Invalid auth event");if("logout"===e.type)return this.logout();if(!e.method||!e.pubkey)throw new Error("Invalid pubkey");const t={authMethod:e.method,pubkey:e.pubkey,relays:e.relays,sk:e.localNsec,otpData:e.otpData,name:e.name};await this.switchAccount(t,"signup"===e.type)};cancelNeedAuth=()=>{console.log("cancelNeedAuth"),this.fulfillCustomLaunchPromise(),this.authNostrService.cancelNostrConnect()}}const initializer=new NostrLoginInitializer,{init:init,launch:launch,logout:logout,setDarkMode:setDarkMode,setAuth:setAuth,cancelNeedAuth:cancelNeedAuth}=initializer;document.addEventListener("nlLogout",logout),document.addEventListener("nlLaunch",(e=>{launch(e.detail||"")})),document.addEventListener("nlNeedAuthCancel",(()=>{cancelNeedAuth()})),document.addEventListener("nlDarkMode",(e=>{setDarkMode(!!e.detail)})),document.addEventListener("nlSetAuth",(e=>{setAuth(e.detail)}));const createWorker=()=>new Worker(URL.createObjectURL(new Blob(['class x{constructor(a,b){this.width=b;this.height=a.length/b;this.data=a}static createEmpty(a,b){return new x(new Uint8ClampedArray(a*b),a)}get(a,b){return 0>a||a>=this.width||0>b||b>=this.height?!1:!!this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c?1:0}setRegion(a,b,c,d,e){for(let f=b;f<b+d;f++)for(let g=a;g<a+c;g++)this.set(g,f,!!e)}}\nclass A{constructor(a,b,c){this.width=a;a*=b;if(c&&c.length!==a)throw Error("Wrong buffer size");this.data=c||new Uint8ClampedArray(a)}get(a,b){return this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c}}\nclass ba{constructor(a){this.bitOffset=this.byteOffset=0;this.bytes=a}readBits(a){if(1>a||32<a||a>this.available())throw Error("Cannot read "+a.toString()+" bits");var b=0;if(0<this.bitOffset){b=8-this.bitOffset;var c=a<b?a:b;b-=c;b=(this.bytes[this.byteOffset]&255>>8-c<<b)>>b;a-=c;this.bitOffset+=c;8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(0<a){for(;8<=a;)b=b<<8|this.bytes[this.byteOffset]&255,this.byteOffset++,a-=8;0<a&&(c=8-a,b=b<<a|(this.bytes[this.byteOffset]&255>>c<<c)>>c,\nthis.bitOffset+=a)}return b}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var B,C=B||(B={});C.Numeric="numeric";C.Alphanumeric="alphanumeric";C.Byte="byte";C.Kanji="kanji";C.ECI="eci";C.StructuredAppend="structuredappend";var D,E=D||(D={});E[E.Terminator=0]="Terminator";E[E.Numeric=1]="Numeric";E[E.Alphanumeric=2]="Alphanumeric";E[E.Byte=4]="Byte";E[E.Kanji=8]="Kanji";E[E.ECI=7]="ECI";E[E.StructuredAppend=3]="StructuredAppend";let F="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".split("");\nfunction ca(a,b){let c=[],d="";b=a.readBits([8,16,16][b]);for(let e=0;e<b;e++){let f=a.readBits(8);c.push(f)}try{d+=decodeURIComponent(c.map(e=>`%${("0"+e.toString(16)).substr(-2)}`).join(""))}catch(e){}return{bytes:c,text:d}}\nfunction da(a,b){a=new ba(a);let c=9>=b?0:26>=b?1:2;for(b={text:"",bytes:[],chunks:[],version:b};4<=a.available();){var d=a.readBits(4);if(d===D.Terminator)return b;if(d===D.ECI)0===a.readBits(1)?b.chunks.push({type:B.ECI,assignmentNumber:a.readBits(7)}):0===a.readBits(1)?b.chunks.push({type:B.ECI,assignmentNumber:a.readBits(14)}):0===a.readBits(1)?b.chunks.push({type:B.ECI,assignmentNumber:a.readBits(21)}):b.chunks.push({type:B.ECI,assignmentNumber:-1});else if(d===D.Numeric){var e=a,f=[];d="";for(var g=\ne.readBits([10,12,14][c]);3<=g;){var h=e.readBits(10);if(1E3<=h)throw Error("Invalid numeric value above 999");var k=Math.floor(h/100),m=Math.floor(h/10)%10;h%=10;f.push(48+k,48+m,48+h);d+=k.toString()+m.toString()+h.toString();g-=3}if(2===g){g=e.readBits(7);if(100<=g)throw Error("Invalid numeric value above 99");e=Math.floor(g/10);g%=10;f.push(48+e,48+g);d+=e.toString()+g.toString()}else if(1===g){e=e.readBits(4);if(10<=e)throw Error("Invalid numeric value above 9");f.push(48+e);d+=e.toString()}b.text+=\nd;b.bytes.push(...f);b.chunks.push({type:B.Numeric,text:d})}else if(d===D.Alphanumeric){e=a;f=[];d="";for(g=e.readBits([9,11,13][c]);2<=g;)m=e.readBits(11),k=Math.floor(m/45),m%=45,f.push(F[k].charCodeAt(0),F[m].charCodeAt(0)),d+=F[k]+F[m],g-=2;1===g&&(e=e.readBits(6),f.push(F[e].charCodeAt(0)),d+=F[e]);b.text+=d;b.bytes.push(...f);b.chunks.push({type:B.Alphanumeric,text:d})}else if(d===D.Byte)d=ca(a,c),b.text+=d.text,b.bytes.push(...d.bytes),b.chunks.push({type:B.Byte,bytes:d.bytes,text:d.text});\nelse if(d===D.Kanji){f=a;d=[];e=f.readBits([8,10,12][c]);for(g=0;g<e;g++)k=f.readBits(13),k=Math.floor(k/192)<<8|k%192,k=7936>k?k+33088:k+49472,d.push(k>>8,k&255);f=(new TextDecoder("shift-jis")).decode(Uint8Array.from(d));b.text+=f;b.bytes.push(...d);b.chunks.push({type:B.Kanji,bytes:d,text:f})}else d===D.StructuredAppend&&b.chunks.push({type:B.StructuredAppend,currentSequence:a.readBits(4),totalSequence:a.readBits(4),parity:a.readBits(8)})}if(0===a.available()||0===a.readBits(a.available()))return b}\nclass G{constructor(a,b){if(0===b.length)throw Error("No coefficients.");this.field=a;let c=b.length;if(1<c&&0===b[0]){let d=1;for(;d<c&&0===b[d];)d++;if(d===c)this.coefficients=a.zero.coefficients;else for(this.coefficients=new Uint8ClampedArray(c-d),a=0;a<this.coefficients.length;a++)this.coefficients[a]=b[d+a]}else this.coefficients=b}degree(){return this.coefficients.length-1}isZero(){return 0===this.coefficients[0]}getCoefficient(a){return this.coefficients[this.coefficients.length-1-a]}addOrSubtract(a){if(this.isZero())return a;\nif(a.isZero())return this;let b=this.coefficients;a=a.coefficients;b.length>a.length&&([b,a]=[a,b]);let c=new Uint8ClampedArray(a.length),d=a.length-b.length;for(var e=0;e<d;e++)c[e]=a[e];for(e=d;e<a.length;e++)c[e]=b[e-d]^a[e];return new G(this.field,c)}multiply(a){if(0===a)return this.field.zero;if(1===a)return this;let b=this.coefficients.length,c=new Uint8ClampedArray(b);for(let d=0;d<b;d++)c[d]=this.field.multiply(this.coefficients[d],a);return new G(this.field,c)}multiplyPoly(a){if(this.isZero()||\na.isZero())return this.field.zero;let b=this.coefficients,c=b.length;a=a.coefficients;let d=a.length,e=new Uint8ClampedArray(c+d-1);for(let f=0;f<c;f++){let g=b[f];for(let h=0;h<d;h++)e[f+h]=H(e[f+h],this.field.multiply(g,a[h]))}return new G(this.field,e)}multiplyByMonomial(a,b){if(0>a)throw Error("Invalid degree less than 0");if(0===b)return this.field.zero;let c=this.coefficients.length;a=new Uint8ClampedArray(c+a);for(let d=0;d<c;d++)a[d]=this.field.multiply(this.coefficients[d],b);return new G(this.field,\na)}evaluateAt(a){let b=0;if(0===a)return this.getCoefficient(0);let c=this.coefficients.length;if(1===a)return this.coefficients.forEach(d=>{b^=d}),b;b=this.coefficients[0];for(let d=1;d<c;d++)b=H(this.field.multiply(a,b),this.coefficients[d]);return b}}function H(a,b){return a^b}\nclass ea{constructor(a,b,c){this.primitive=a;this.size=b;this.generatorBase=c;this.expTable=Array(this.size);this.logTable=Array(this.size);a=1;for(b=0;b<this.size;b++)this.expTable[b]=a,a*=2,a>=this.size&&(a=(a^this.primitive)&this.size-1);for(a=0;a<this.size-1;a++)this.logTable[this.expTable[a]]=a;this.zero=new G(this,Uint8ClampedArray.from([0]));this.one=new G(this,Uint8ClampedArray.from([1]))}multiply(a,b){return 0===a||0===b?0:this.expTable[(this.logTable[a]+this.logTable[b])%(this.size-1)]}inverse(a){if(0===\na)throw Error("Can\'t invert 0");return this.expTable[this.size-this.logTable[a]-1]}buildMonomial(a,b){if(0>a)throw Error("Invalid monomial degree less than 0");if(0===b)return this.zero;a=new Uint8ClampedArray(a+1);a[0]=b;return new G(this,a)}log(a){if(0===a)throw Error("Can\'t take log(0)");return this.logTable[a]}exp(a){return this.expTable[a]}}\nfunction fa(a,b,c,d){b.degree()<c.degree()&&([b,c]=[c,b]);let e=a.zero;for(var f=a.one;c.degree()>=d/2;){var g=b;let h=e;b=c;e=f;if(b.isZero())return null;c=g;f=a.zero;g=b.getCoefficient(b.degree());for(g=a.inverse(g);c.degree()>=b.degree()&&!c.isZero();){let k=c.degree()-b.degree(),m=a.multiply(c.getCoefficient(c.degree()),g);f=f.addOrSubtract(a.buildMonomial(k,m));c=c.addOrSubtract(b.multiplyByMonomial(k,m))}f=f.multiplyPoly(e).addOrSubtract(h);if(c.degree()>=b.degree())return null}d=f.getCoefficient(0);\nif(0===d)return null;a=a.inverse(d);return[f.multiply(a),c.multiply(a)]}\nfunction ha(a,b){let c=new Uint8ClampedArray(a.length);c.set(a);a=new ea(285,256,0);var d=new G(a,c),e=new Uint8ClampedArray(b),f=!1;for(var g=0;g<b;g++){var h=d.evaluateAt(a.exp(g+a.generatorBase));e[e.length-1-g]=h;0!==h&&(f=!0)}if(!f)return c;d=new G(a,e);d=fa(a,a.buildMonomial(b,1),d,b);if(null===d)return null;b=d[0];g=b.degree();if(1===g)b=[b.getCoefficient(1)];else{e=Array(g);f=0;for(h=1;h<a.size&&f<g;h++)0===b.evaluateAt(h)&&(e[f]=a.inverse(h),f++);b=f!==g?null:e}if(null==b)return null;e=d[1];\nf=b.length;d=Array(f);for(g=0;g<f;g++){h=a.inverse(b[g]);let k=1;for(let m=0;m<f;m++)g!==m&&(k=a.multiply(k,H(1,a.multiply(b[m],h))));d[g]=a.multiply(e.evaluateAt(h),a.inverse(k));0!==a.generatorBase&&(d[g]=a.multiply(d[g],h))}for(e=0;e<b.length;e++){f=c.length-1-a.log(b[e]);if(0>f)return null;c[f]^=d[e]}return c}\nlet I=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:13}]},{ecCodewordsPerBlock:17,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:2,alignmentPatternCenters:[6,18],errorCorrectionLevels:[{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,\ndataCodewordsPerBlock:34}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:28}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]}]},{infoBits:null,versionNumber:3,alignmentPatternCenters:[6,22],errorCorrectionLevels:[{ecCodewordsPerBlock:15,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:55}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:18,\necBlocks:[{numBlocks:2,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:13}]}]},{infoBits:null,versionNumber:4,alignmentPatternCenters:[6,26],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:80}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:32}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:9}]}]},\n{infoBits:null,versionNumber:5,alignmentPatternCenters:[6,30],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:43}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:11},{numBlocks:2,dataCodewordsPerBlock:12}]}]},{infoBits:null,versionNumber:6,alignmentPatternCenters:[6,\n34],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:27}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:31892,versionNumber:7,alignmentPatternCenters:[6,22,38],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:78}]},{ecCodewordsPerBlock:18,\necBlocks:[{numBlocks:4,dataCodewordsPerBlock:31}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:13},{numBlocks:1,dataCodewordsPerBlock:14}]}]},{infoBits:34236,versionNumber:8,alignmentPatternCenters:[6,24,42],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:97}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:38},\n{numBlocks:2,dataCodewordsPerBlock:39}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:18},{numBlocks:2,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:14},{numBlocks:2,dataCodewordsPerBlock:15}]}]},{infoBits:39577,versionNumber:9,alignmentPatternCenters:[6,26,46],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:36},\n{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:12},{numBlocks:4,dataCodewordsPerBlock:13}]}]},{infoBits:42195,versionNumber:10,alignmentPatternCenters:[6,28,50],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68},{numBlocks:2,dataCodewordsPerBlock:69}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,\ndataCodewordsPerBlock:43},{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]}]},{infoBits:48118,versionNumber:11,alignmentPatternCenters:[6,30,54],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:81}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,\ndataCodewordsPerBlock:50},{numBlocks:4,dataCodewordsPerBlock:51}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:22},{numBlocks:4,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:12},{numBlocks:8,dataCodewordsPerBlock:13}]}]},{infoBits:51042,versionNumber:12,alignmentPatternCenters:[6,32,58],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:92},{numBlocks:2,dataCodewordsPerBlock:93}]},\n{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:20},{numBlocks:6,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:55367,versionNumber:13,alignmentPatternCenters:[6,34,62],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:107}]},\n{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:37},{numBlocks:1,dataCodewordsPerBlock:38}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:20},{numBlocks:4,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:11},{numBlocks:4,dataCodewordsPerBlock:12}]}]},{infoBits:58893,versionNumber:14,alignmentPatternCenters:[6,26,46,66],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:115},\n{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:40},{numBlocks:5,dataCodewordsPerBlock:41}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:16},{numBlocks:5,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:5,dataCodewordsPerBlock:13}]}]},{infoBits:63784,versionNumber:15,alignmentPatternCenters:[6,26,48,70],errorCorrectionLevels:[{ecCodewordsPerBlock:22,\necBlocks:[{numBlocks:5,dataCodewordsPerBlock:87},{numBlocks:1,dataCodewordsPerBlock:88}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:41},{numBlocks:5,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:7,dataCodewordsPerBlock:13}]}]},{infoBits:68472,versionNumber:16,alignmentPatternCenters:[6,26,50,\n74],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:98},{numBlocks:1,dataCodewordsPerBlock:99}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:70749,\nversionNumber:17,alignmentPatternCenters:[6,30,54,78],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:1,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22},{numBlocks:15,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:17,\ndataCodewordsPerBlock:15}]}]},{infoBits:76311,versionNumber:18,alignmentPatternCenters:[6,30,56,82],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:120},{numBlocks:1,dataCodewordsPerBlock:121}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:43},{numBlocks:4,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:1,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,\ndataCodewordsPerBlock:14},{numBlocks:19,dataCodewordsPerBlock:15}]}]},{infoBits:79154,versionNumber:19,alignmentPatternCenters:[6,30,58,86],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:113},{numBlocks:4,dataCodewordsPerBlock:114}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:44},{numBlocks:11,dataCodewordsPerBlock:45}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:21},{numBlocks:4,dataCodewordsPerBlock:22}]},\n{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:13},{numBlocks:16,dataCodewordsPerBlock:14}]}]},{infoBits:84390,versionNumber:20,alignmentPatternCenters:[6,34,62,90],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:41},{numBlocks:13,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},\n{numBlocks:5,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:15},{numBlocks:10,dataCodewordsPerBlock:16}]}]},{infoBits:87683,versionNumber:21,alignmentPatternCenters:[6,28,50,72,94],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:116},{numBlocks:4,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},\n{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:16},{numBlocks:6,dataCodewordsPerBlock:17}]}]},{infoBits:92361,versionNumber:22,alignmentPatternCenters:[6,26,50,74,98],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:111},{numBlocks:7,dataCodewordsPerBlock:112}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},\n{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:13}]}]},{infoBits:96236,versionNumber:23,alignmentPatternCenters:[6,30,54,74,102],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:121},{numBlocks:5,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:47},{numBlocks:14,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},\n{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:16,dataCodewordsPerBlock:15},{numBlocks:14,dataCodewordsPerBlock:16}]}]},{infoBits:102084,versionNumber:24,alignmentPatternCenters:[6,28,54,80,106],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:45},{numBlocks:14,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,\necBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:30,dataCodewordsPerBlock:16},{numBlocks:2,dataCodewordsPerBlock:17}]}]},{infoBits:102881,versionNumber:25,alignmentPatternCenters:[6,32,58,84,110],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:106},{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:47},{numBlocks:13,\ndataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:110507,versionNumber:26,alignmentPatternCenters:[6,30,58,86,114],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:114},{numBlocks:2,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,\ndataCodewordsPerBlock:46},{numBlocks:4,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:28,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:33,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]}]},{infoBits:110734,versionNumber:27,alignmentPatternCenters:[6,34,62,90,118],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},\n{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:23},{numBlocks:26,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:117786,versionNumber:28,alignmentPatternCenters:[6,26,50,74,98,122],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:117},\n{numBlocks:10,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:45},{numBlocks:23,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:24},{numBlocks:31,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:31,dataCodewordsPerBlock:16}]}]},{infoBits:119615,versionNumber:29,alignmentPatternCenters:[6,30,54,78,102,126],errorCorrectionLevels:[{ecCodewordsPerBlock:30,\necBlocks:[{numBlocks:7,dataCodewordsPerBlock:116},{numBlocks:7,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:21,dataCodewordsPerBlock:45},{numBlocks:7,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:23},{numBlocks:37,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:26,dataCodewordsPerBlock:16}]}]},{infoBits:126325,versionNumber:30,alignmentPatternCenters:[6,\n26,52,78,104,130],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:115},{numBlocks:10,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:47},{numBlocks:10,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:25,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:25,dataCodewordsPerBlock:16}]}]},\n{infoBits:127568,versionNumber:31,alignmentPatternCenters:[6,30,56,82,108,134],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:3,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:46},{numBlocks:29,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:24},{numBlocks:1,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},\n{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:133589,versionNumber:32,alignmentPatternCenters:[6,34,60,86,112,138],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:24},{numBlocks:35,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,\ndataCodewordsPerBlock:15},{numBlocks:35,dataCodewordsPerBlock:16}]}]},{infoBits:136944,versionNumber:33,alignmentPatternCenters:[6,30,58,86,114,142],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:21,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:24},{numBlocks:19,dataCodewordsPerBlock:25}]},\n{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:141498,versionNumber:34,alignmentPatternCenters:[6,34,62,90,118,146],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:6,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:44,\ndataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:59,dataCodewordsPerBlock:16},{numBlocks:1,dataCodewordsPerBlock:17}]}]},{infoBits:145311,versionNumber:35,alignmentPatternCenters:[6,30,54,78,102,126,150],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:121},{numBlocks:7,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:47},{numBlocks:26,dataCodewordsPerBlock:48}]},\n{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:39,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:41,dataCodewordsPerBlock:16}]}]},{infoBits:150283,versionNumber:36,alignmentPatternCenters:[6,24,50,76,102,128,154],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:121},{numBlocks:14,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,\ndataCodewordsPerBlock:47},{numBlocks:34,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:46,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:64,dataCodewordsPerBlock:16}]}]},{infoBits:152622,versionNumber:37,alignmentPatternCenters:[6,28,54,80,106,132,158],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},\n{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:46},{numBlocks:14,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:49,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:24,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:158308,versionNumber:38,alignmentPatternCenters:[6,32,58,84,110,136,162],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,\ndataCodewordsPerBlock:122},{numBlocks:18,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:46},{numBlocks:32,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:48,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:15},{numBlocks:32,dataCodewordsPerBlock:16}]}]},{infoBits:161089,versionNumber:39,alignmentPatternCenters:[6,26,54,82,110,138,166],\nerrorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:40,dataCodewordsPerBlock:47},{numBlocks:7,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:43,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:15},{numBlocks:67,dataCodewordsPerBlock:16}]}]},{infoBits:167017,\nversionNumber:40,alignmentPatternCenters:[6,30,58,86,114,142,170],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:118},{numBlocks:6,dataCodewordsPerBlock:119}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:18,dataCodewordsPerBlock:47},{numBlocks:31,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:24},{numBlocks:34,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:15},\n{numBlocks:61,dataCodewordsPerBlock:16}]}]}];function J(a,b){a^=b;for(b=0;a;)b++,a&=a-1;return b}function K(a,b){return b<<1|a}\nlet ia=[{bits:21522,formatInfo:{errorCorrectionLevel:1,dataMask:0}},{bits:20773,formatInfo:{errorCorrectionLevel:1,dataMask:1}},{bits:24188,formatInfo:{errorCorrectionLevel:1,dataMask:2}},{bits:23371,formatInfo:{errorCorrectionLevel:1,dataMask:3}},{bits:17913,formatInfo:{errorCorrectionLevel:1,dataMask:4}},{bits:16590,formatInfo:{errorCorrectionLevel:1,dataMask:5}},{bits:20375,formatInfo:{errorCorrectionLevel:1,dataMask:6}},{bits:19104,formatInfo:{errorCorrectionLevel:1,dataMask:7}},{bits:30660,formatInfo:{errorCorrectionLevel:0,\ndataMask:0}},{bits:29427,formatInfo:{errorCorrectionLevel:0,dataMask:1}},{bits:32170,formatInfo:{errorCorrectionLevel:0,dataMask:2}},{bits:30877,formatInfo:{errorCorrectionLevel:0,dataMask:3}},{bits:26159,formatInfo:{errorCorrectionLevel:0,dataMask:4}},{bits:25368,formatInfo:{errorCorrectionLevel:0,dataMask:5}},{bits:27713,formatInfo:{errorCorrectionLevel:0,dataMask:6}},{bits:26998,formatInfo:{errorCorrectionLevel:0,dataMask:7}},{bits:5769,formatInfo:{errorCorrectionLevel:3,dataMask:0}},{bits:5054,\nformatInfo:{errorCorrectionLevel:3,dataMask:1}},{bits:7399,formatInfo:{errorCorrectionLevel:3,dataMask:2}},{bits:6608,formatInfo:{errorCorrectionLevel:3,dataMask:3}},{bits:1890,formatInfo:{errorCorrectionLevel:3,dataMask:4}},{bits:597,formatInfo:{errorCorrectionLevel:3,dataMask:5}},{bits:3340,formatInfo:{errorCorrectionLevel:3,dataMask:6}},{bits:2107,formatInfo:{errorCorrectionLevel:3,dataMask:7}},{bits:13663,formatInfo:{errorCorrectionLevel:2,dataMask:0}},{bits:12392,formatInfo:{errorCorrectionLevel:2,\ndataMask:1}},{bits:16177,formatInfo:{errorCorrectionLevel:2,dataMask:2}},{bits:14854,formatInfo:{errorCorrectionLevel:2,dataMask:3}},{bits:9396,formatInfo:{errorCorrectionLevel:2,dataMask:4}},{bits:8579,formatInfo:{errorCorrectionLevel:2,dataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],ja=[a=>0===(a.y+a.x)%2,a=>0===a.y%2,a=>0===a.x%3,a=>0===(a.y+a.x)%3,a=>0===(Math.floor(a.y/2)+Math.floor(a.x/3))%2,a=>0===a.x*a.y%\n2+a.x*a.y%3,a=>0===(a.y*a.x%2+a.y*a.x%3)%2,a=>0===((a.y+a.x)%2+a.y*a.x%3)%2];\nfunction ka(a,b,c){c=ja[c.dataMask];let d=a.height;var e=17+4*b.versionNumber;let f=x.createEmpty(e,e);f.setRegion(0,0,9,9,!0);f.setRegion(e-8,0,8,9,!0);f.setRegion(0,e-8,9,8,!0);for(var g of b.alignmentPatternCenters)for(var h of b.alignmentPatternCenters)6===g&&6===h||6===g&&h===e-7||g===e-7&&6===h||f.setRegion(g-2,h-2,5,5,!0);f.setRegion(6,9,1,e-17,!0);f.setRegion(9,6,e-17,1,!0);6<b.versionNumber&&(f.setRegion(e-11,0,3,6,!0),f.setRegion(0,e-11,6,3,!0));b=[];h=g=0;e=!0;for(let k=d-1;0<k;k-=2){6===\nk&&k--;for(let m=0;m<d;m++){let l=e?d-1-m:m;for(let n=0;2>n;n++){let q=k-n;if(!f.get(q,l)){h++;let r=a.get(q,l);c({y:l,x:q})&&(r=!r);g=g<<1|r;8===h&&(b.push(g),g=h=0)}}}e=!e}return b}\nfunction la(a){var b=a.height,c=Math.floor((b-17)/4);if(6>=c)return I[c-1];c=0;for(var d=5;0<=d;d--)for(var e=b-9;e>=b-11;e--)c=K(a.get(e,d),c);d=0;for(e=5;0<=e;e--)for(let g=b-9;g>=b-11;g--)d=K(a.get(e,g),d);a=Infinity;let f;for(let g of I){if(g.infoBits===c||g.infoBits===d)return g;b=J(c,g.infoBits);b<a&&(f=g,a=b);b=J(d,g.infoBits);b<a&&(f=g,a=b)}if(3>=a)return f}\nfunction ma(a){let b=0;for(var c=0;8>=c;c++)6!==c&&(b=K(a.get(c,8),b));for(c=7;0<=c;c--)6!==c&&(b=K(a.get(8,c),b));var d=a.height;c=0;for(var e=d-1;e>=d-7;e--)c=K(a.get(8,e),c);for(e=d-8;e<d;e++)c=K(a.get(e,8),c);a=Infinity;d=null;for(let {bits:f,formatInfo:g}of ia){if(f===b||f===c)return g;e=J(b,f);e<a&&(d=g,a=e);b!==c&&(e=J(c,f),e<a&&(d=g,a=e))}return 3>=a?d:null}\nfunction na(a,b,c){let d=b.errorCorrectionLevels[c],e=[],f=0;d.ecBlocks.forEach(h=>{for(let k=0;k<h.numBlocks;k++)e.push({numDataCodewords:h.dataCodewordsPerBlock,codewords:[]}),f+=h.dataCodewordsPerBlock+d.ecCodewordsPerBlock});if(a.length<f)return null;a=a.slice(0,f);b=d.ecBlocks[0].dataCodewordsPerBlock;for(c=0;c<b;c++)for(var g of e)g.codewords.push(a.shift());if(1<d.ecBlocks.length)for(g=d.ecBlocks[0].numBlocks,b=d.ecBlocks[1].numBlocks,c=0;c<b;c++)e[g+c].codewords.push(a.shift());for(;0<a.length;)for(let h of e)h.codewords.push(a.shift());\nreturn e}function L(a){let b=la(a);if(!b)return null;var c=ma(a);if(!c)return null;a=ka(a,b,c);var d=na(a,b,c.errorCorrectionLevel);if(!d)return null;c=d.reduce((e,f)=>e+f.numDataCodewords,0);c=new Uint8ClampedArray(c);a=0;for(let e of d){d=ha(e.codewords,e.codewords.length-e.numDataCodewords);if(!d)return null;for(let f=0;f<e.numDataCodewords;f++)c[a++]=d[f]}try{return da(c,b.versionNumber)}catch(e){return null}}\nfunction M(a,b,c,d){var e=a.x-b.x+c.x-d.x;let f=a.y-b.y+c.y-d.y;if(0===e&&0===f)return{a11:b.x-a.x,a12:b.y-a.y,a13:0,a21:c.x-b.x,a22:c.y-b.y,a23:0,a31:a.x,a32:a.y,a33:1};let g=b.x-c.x;var h=d.x-c.x;let k=b.y-c.y,m=d.y-c.y;c=g*m-h*k;h=(e*m-h*f)/c;e=(g*f-e*k)/c;return{a11:b.x-a.x+h*b.x,a12:b.y-a.y+h*b.y,a13:h,a21:d.x-a.x+e*d.x,a22:d.y-a.y+e*d.y,a23:e,a31:a.x,a32:a.y,a33:1}}\nfunction oa(a,b,c,d){a=M(a,b,c,d);return{a11:a.a22*a.a33-a.a23*a.a32,a12:a.a13*a.a32-a.a12*a.a33,a13:a.a12*a.a23-a.a13*a.a22,a21:a.a23*a.a31-a.a21*a.a33,a22:a.a11*a.a33-a.a13*a.a31,a23:a.a13*a.a21-a.a11*a.a23,a31:a.a21*a.a32-a.a22*a.a31,a32:a.a12*a.a31-a.a11*a.a32,a33:a.a11*a.a22-a.a12*a.a21}}\nfunction pa(a,b){var c=oa({x:3.5,y:3.5},{x:b.dimension-3.5,y:3.5},{x:b.dimension-6.5,y:b.dimension-6.5},{x:3.5,y:b.dimension-3.5}),d=M(b.topLeft,b.topRight,b.alignmentPattern,b.bottomLeft),e=d.a11*c.a11+d.a21*c.a12+d.a31*c.a13,f=d.a12*c.a11+d.a22*c.a12+d.a32*c.a13,g=d.a13*c.a11+d.a23*c.a12+d.a33*c.a13,h=d.a11*c.a21+d.a21*c.a22+d.a31*c.a23,k=d.a12*c.a21+d.a22*c.a22+d.a32*c.a23,m=d.a13*c.a21+d.a23*c.a22+d.a33*c.a23,l=d.a11*c.a31+d.a21*c.a32+d.a31*c.a33,n=d.a12*c.a31+d.a22*c.a32+d.a32*c.a33,q=d.a13*\nc.a31+d.a23*c.a32+d.a33*c.a33;c=x.createEmpty(b.dimension,b.dimension);d=(r,u)=>{const p=g*r+m*u+q;return{x:(e*r+h*u+l)/p,y:(f*r+k*u+n)/p}};for(let r=0;r<b.dimension;r++)for(let u=0;u<b.dimension;u++){let p=d(u+.5,r+.5);c.set(u,r,a.get(Math.floor(p.x),Math.floor(p.y)))}return{matrix:c,mappingFunction:d}}let N=(a,b)=>Math.sqrt(Math.pow(b.x-a.x,2)+Math.pow(b.y-a.y,2));function O(a){return a.reduce((b,c)=>b+c)}\nfunction qa(a,b,c){let d=N(a,b),e=N(b,c),f=N(a,c),g,h,k;e>=d&&e>=f?[g,h,k]=[b,a,c]:f>=e&&f>=d?[g,h,k]=[a,b,c]:[g,h,k]=[a,c,b];0>(k.x-h.x)*(g.y-h.y)-(k.y-h.y)*(g.x-h.x)&&([g,k]=[k,g]);return{bottomLeft:g,topLeft:h,topRight:k}}\nfunction ra(a,b,c,d){d=(O(P(a,c,d,5))/7+O(P(a,b,d,5))/7+O(P(c,a,d,5))/7+O(P(b,a,d,5))/7)/4;if(1>d)throw Error("Invalid module size");b=Math.round(N(a,b)/d);a=Math.round(N(a,c)/d);a=Math.floor((b+a)/2)+7;switch(a%4){case 0:a++;break;case 2:a--}return{dimension:a,moduleSize:d}}\nfunction Q(a,b,c,d){let e=[{x:Math.floor(a.x),y:Math.floor(a.y)}];var f=Math.abs(b.y-a.y)>Math.abs(b.x-a.x);if(f){var g=Math.floor(a.y);var h=Math.floor(a.x);a=Math.floor(b.y);b=Math.floor(b.x)}else g=Math.floor(a.x),h=Math.floor(a.y),a=Math.floor(b.x),b=Math.floor(b.y);let k=Math.abs(a-g),m=Math.abs(b-h),l=Math.floor(-k/2),n=g<a?1:-1,q=h<b?1:-1,r=!0;for(let u=g,p=h;u!==a+n;u+=n){g=f?p:u;h=f?u:p;if(c.get(g,h)!==r&&(r=!r,e.push({x:g,y:h}),e.length===d+1))break;l+=m;if(0<l){if(p===b)break;p+=q;l-=k}}c=\n[];for(f=0;f<d;f++)e[f]&&e[f+1]?c.push(N(e[f],e[f+1])):c.push(0);return c}function P(a,b,c,d){let e=b.y-a.y,f=b.x-a.x;b=Q(a,b,c,Math.ceil(d/2));a=Q(a,{x:a.x-f,y:a.y-e},c,Math.ceil(d/2));c=b.shift()+a.shift()-1;return a.concat(c).concat(...b)}function R(a,b){let c=O(a)/O(b),d=0;b.forEach((e,f)=>{d+=Math.pow(a[f]-e*c,2)});return{averageSize:c,error:d}}\nfunction S(a,b,c){try{let d=P(a,{x:-1,y:a.y},c,b.length),e=P(a,{x:a.x,y:-1},c,b.length),f=P(a,{x:Math.max(0,a.x-a.y)-1,y:Math.max(0,a.y-a.x)-1},c,b.length),g=P(a,{x:Math.min(c.width,a.x+a.y)+1,y:Math.min(c.height,a.y+a.x)+1},c,b.length),h=R(d,b),k=R(e,b),m=R(f,b),l=R(g,b),n=(h.averageSize+k.averageSize+m.averageSize+l.averageSize)/4;return Math.sqrt(h.error*h.error+k.error*k.error+m.error*m.error+l.error*l.error)+(Math.pow(h.averageSize-n,2)+Math.pow(k.averageSize-n,2)+Math.pow(m.averageSize-n,2)+\nMath.pow(l.averageSize-n,2))/n}catch(d){return Infinity}}function T(a,b){for(var c=Math.round(b.x);a.get(c,Math.round(b.y));)c--;for(var d=Math.round(b.x);a.get(d,Math.round(b.y));)d++;c=(c+d)/2;for(d=Math.round(b.y);a.get(Math.round(c),d);)d--;for(b=Math.round(b.y);a.get(Math.round(c),b);)b++;return{x:c,y:(d+b)/2}}\nfunction sa(a){var b=[],c=[];let d=[];var e=[];for(let p=0;p<=a.height;p++){var f=0,g=!1;let t=[0,0,0,0,0];for(let v=-1;v<=a.width;v++){var h=a.get(v,p);if(h===g)f++;else{t=[t[1],t[2],t[3],t[4],f];f=1;g=h;var k=O(t)/7;k=Math.abs(t[0]-k)<k&&Math.abs(t[1]-k)<k&&Math.abs(t[2]-3*k)<3*k&&Math.abs(t[3]-k)<k&&Math.abs(t[4]-k)<k&&!h;var m=O(t.slice(-3))/3;h=Math.abs(t[2]-m)<m&&Math.abs(t[3]-m)<m&&Math.abs(t[4]-m)<m&&h;if(k){let z=v-t[3]-t[4],y=z-t[2];k={startX:y,endX:z,y:p};m=c.filter(w=>y>=w.bottom.startX&&\ny<=w.bottom.endX||z>=w.bottom.startX&&y<=w.bottom.endX||y<=w.bottom.startX&&z>=w.bottom.endX&&1.5>t[2]/(w.bottom.endX-w.bottom.startX)&&.5<t[2]/(w.bottom.endX-w.bottom.startX));0<m.length?m[0].bottom=k:c.push({top:k,bottom:k})}if(h){let z=v-t[4],y=z-t[3];h={startX:y,y:p,endX:z};k=e.filter(w=>y>=w.bottom.startX&&y<=w.bottom.endX||z>=w.bottom.startX&&y<=w.bottom.endX||y<=w.bottom.startX&&z>=w.bottom.endX&&1.5>t[2]/(w.bottom.endX-w.bottom.startX)&&.5<t[2]/(w.bottom.endX-w.bottom.startX));0<k.length?\nk[0].bottom=h:e.push({top:h,bottom:h})}}}b.push(...c.filter(v=>v.bottom.y!==p&&2<=v.bottom.y-v.top.y));c=c.filter(v=>v.bottom.y===p);d.push(...e.filter(v=>v.bottom.y!==p));e=e.filter(v=>v.bottom.y===p)}b.push(...c.filter(p=>2<=p.bottom.y-p.top.y));d.push(...e);c=[];for(var l of b)2>l.bottom.y-l.top.y||(b=(l.top.startX+l.top.endX+l.bottom.startX+l.bottom.endX)/4,e=(l.top.y+l.bottom.y+1)/2,a.get(Math.round(b),Math.round(e))&&(f=[l.top.endX-l.top.startX,l.bottom.endX-l.bottom.startX,l.bottom.y-l.top.y+\n1],f=O(f)/f.length,g=S({x:Math.round(b),y:Math.round(e)},[1,1,3,1,1],a),c.push({score:g,x:b,y:e,size:f})));if(3>c.length)return null;c.sort((p,t)=>p.score-t.score);l=[];for(b=0;b<Math.min(c.length,5);++b){e=c[b];f=[];for(var n of c)n!==e&&f.push(Object.assign(Object.assign({},n),{score:n.score+Math.pow(n.size-e.size,2)/e.size}));f.sort((p,t)=>p.score-t.score);l.push({points:[e,f[0],f[1]],score:e.score+f[0].score+f[1].score})}l.sort((p,t)=>p.score-t.score);let {topRight:q,topLeft:r,bottomLeft:u}=qa(...l[0].points);\nl=U(a,d,q,r,u);n=[];l&&n.push({alignmentPattern:{x:l.alignmentPattern.x,y:l.alignmentPattern.y},bottomLeft:{x:u.x,y:u.y},dimension:l.dimension,topLeft:{x:r.x,y:r.y},topRight:{x:q.x,y:q.y}});l=T(a,q);b=T(a,r);c=T(a,u);(a=U(a,d,l,b,c))&&n.push({alignmentPattern:{x:a.alignmentPattern.x,y:a.alignmentPattern.y},bottomLeft:{x:c.x,y:c.y},topLeft:{x:b.x,y:b.y},topRight:{x:l.x,y:l.y},dimension:a.dimension});return 0===n.length?null:n}\nfunction U(a,b,c,d,e){let f,g;try{({dimension:f,moduleSize:g}=ra(d,c,e,a))}catch(l){return null}var h=c.x-d.x+e.x,k=c.y-d.y+e.y;c=(N(d,e)+N(d,c))/2/g;e=1-3/c;let m={x:d.x+e*(h-d.x),y:d.y+e*(k-d.y)};b=b.map(l=>{const n=(l.top.startX+l.top.endX+l.bottom.startX+l.bottom.endX)/4;l=(l.top.y+l.bottom.y+1)/2;if(a.get(Math.floor(n),Math.floor(l))){var q=S({x:Math.floor(n),y:Math.floor(l)},[1,1,1],a)+N({x:n,y:l},m);return{x:n,y:l,score:q}}}).filter(l=>!!l).sort((l,n)=>l.score-n.score);return{alignmentPattern:15<=\nc&&b.length?b[0]:m,dimension:f}}\nfunction V(a){var b=sa(a);if(!b)return null;for(let e of b){b=pa(a,e);var c=b.matrix;if(null==c)c=null;else{var d=L(c);if(d)c=d;else{for(d=0;d<c.width;d++)for(let f=d+1;f<c.height;f++)c.get(d,f)!==c.get(f,d)&&(c.set(d,f,!c.get(d,f)),c.set(f,d,!c.get(f,d)));c=L(c)}}if(c)return{binaryData:c.bytes,data:c.text,chunks:c.chunks,version:c.version,location:{topRightCorner:b.mappingFunction(e.dimension,0),topLeftCorner:b.mappingFunction(0,0),bottomRightCorner:b.mappingFunction(e.dimension,e.dimension),bottomLeftCorner:b.mappingFunction(0,\ne.dimension),topRightFinderPattern:e.topRight,topLeftFinderPattern:e.topLeft,bottomLeftFinderPattern:e.bottomLeft,bottomRightAlignmentPattern:e.alignmentPattern},matrix:b.matrix}}return null}let ta={inversionAttempts:"attemptBoth",greyScaleWeights:{red:.2126,green:.7152,blue:.0722,useIntegerApproximation:!1},canOverwriteImage:!0};function W(a,b){Object.keys(b).forEach(c=>{a[c]=b[c]})}\nfunction X(a,b,c,d={}){let e=Object.create(null);W(e,ta);W(e,d);d="onlyInvert"===e.inversionAttempts||"invertFirst"===e.inversionAttempts;var f="attemptBoth"===e.inversionAttempts||d;var g=e.greyScaleWeights,h=e.canOverwriteImage,k=b*c;if(a.length!==4*k)throw Error("Malformed data passed to binarizer.");var m=0;if(h){var l=new Uint8ClampedArray(a.buffer,m,k);m+=k}l=new A(b,c,l);if(g.useIntegerApproximation)for(var n=0;n<c;n++)for(var q=0;q<b;q++){var r=4*(n*b+q);l.set(q,n,g.red*a[r]+g.green*a[r+1]+\ng.blue*a[r+2]+128>>8)}else for(n=0;n<c;n++)for(q=0;q<b;q++)r=4*(n*b+q),l.set(q,n,g.red*a[r]+g.green*a[r+1]+g.blue*a[r+2]);g=Math.ceil(b/8);n=Math.ceil(c/8);q=g*n;if(h){var u=new Uint8ClampedArray(a.buffer,m,q);m+=q}u=new A(g,n,u);for(q=0;q<n;q++)for(r=0;r<g;r++){var p=Infinity,t=0;for(var v=0;8>v;v++)for(let w=0;8>w;w++){let aa=l.get(8*r+w,8*q+v);p=Math.min(p,aa);t=Math.max(t,aa)}v=(p+t)/2;v=Math.min(255,1.11*v);24>=t-p&&(v=p/2,0<q&&0<r&&(t=(u.get(r,q-1)+2*u.get(r-1,q)+u.get(r-1,q-1))/4,p<t&&(v=t)));\nu.set(r,q,v)}h?(q=new Uint8ClampedArray(a.buffer,m,k),m+=k,q=new x(q,b)):q=x.createEmpty(b,c);r=null;f&&(h?(a=new Uint8ClampedArray(a.buffer,m,k),r=new x(a,b)):r=x.createEmpty(b,c));for(b=0;b<n;b++)for(a=0;a<g;a++){c=g-3;c=2>a?2:a>c?c:a;h=n-3;h=2>b?2:b>h?h:b;k=0;for(m=-2;2>=m;m++)for(p=-2;2>=p;p++)k+=u.get(c+m,h+p);c=k/25;for(h=0;8>h;h++)for(k=0;8>k;k++)m=8*a+h,p=8*b+k,t=l.get(m,p),q.set(m,p,t<=c),f&&r.set(m,p,!(t<=c))}f=f?{binarized:q,inverted:r}:{binarized:q};let {binarized:z,inverted:y}=f;(f=V(d?\ny:z))||"attemptBoth"!==e.inversionAttempts&&"invertFirst"!==e.inversionAttempts||(f=V(d?z:y));return f}X.default=X;let Y="dontInvert",Z={red:77,green:150,blue:29,useIntegerApproximation:!0};\nself.onmessage=a=>{let b=a.data.id,c=a.data.data;switch(a.data.type){case "decode":(a=X(c.data,c.width,c.height,{inversionAttempts:Y,greyScaleWeights:Z}))?self.postMessage({id:b,type:"qrResult",data:a.data,cornerPoints:[a.location.topLeftCorner,a.location.topRightCorner,a.location.bottomRightCorner,a.location.bottomLeftCorner]}):self.postMessage({id:b,type:"qrResult",data:null});break;case "grayscaleWeights":Z.red=c.red;Z.green=c.green;Z.blue=c.blue;Z.useIntegerApproximation=c.useIntegerApproximation;\nbreak;case "inversionMode":switch(c){case "original":Y="dontInvert";break;case "invert":Y="onlyInvert";break;case "both":Y="attemptBoth";break;default:throw Error("Invalid inversion mode");}break;case "close":self.close()}}\n']),{type:"application/javascript"}));var qrScannerWorker_min=Object.freeze({__proto__:null,createWorker:createWorker});export{NostrLoginInitializer,cancelNeedAuth,init,launch,logout,setAuth,setDarkMode};
|
|
19
19
|
//# sourceMappingURL=index.esm.js.map
|