From 042acd9ed21c37b708775297da275abf6459097e Mon Sep 17 00:00:00 2001 From: mleku Date: Thu, 25 Dec 2025 12:38:54 +0100 Subject: [PATCH] Track all dist assets and remove debug logging --- app/web/dist/bundle.css | 87 +++++++++++++++++++++++++++++++++ app/web/dist/bundle.js | 2 +- app/web/dist/bundle.js.map | 1 + app/web/dist/favicon.png | Bin 0 -> 387663 bytes app/web/dist/global.css | 69 ++++++++++++++++++++++++++ app/web/dist/orly.png | Bin 0 -> 526586 bytes app/web/src/BlossomView.svelte | 4 -- 7 files changed, 158 insertions(+), 5 deletions(-) create mode 100644 app/web/dist/bundle.css create mode 100644 app/web/dist/bundle.js.map create mode 100644 app/web/dist/favicon.png create mode 100644 app/web/dist/global.css create mode 100644 app/web/dist/orly.png diff --git a/app/web/dist/bundle.css b/app/web/dist/bundle.css new file mode 100644 index 0000000..f3ca83b --- /dev/null +++ b/app/web/dist/bundle.css @@ -0,0 +1,87 @@ +.modal-overlay.svelte-4xpfbi.svelte-4xpfbi{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.5);display:flex;justify-content:center;align-items:center;z-index:1000}.modal.svelte-4xpfbi.svelte-4xpfbi{background:var(--bg-color);border-radius:8px;box-shadow:0 4px 20px rgba(0, 0, 0, 0.3);width:90%;max-width:500px;max-height:90vh;overflow-y:auto;border:1px solid var(--border-color)}.modal-header.svelte-4xpfbi.svelte-4xpfbi{display:flex;justify-content:space-between;align-items:center;padding:20px;border-bottom:1px solid var(--border-color)}.modal-header.svelte-4xpfbi h2.svelte-4xpfbi{margin:0;color:var(--text-color);font-size:1.5rem}.close-btn.svelte-4xpfbi.svelte-4xpfbi{background:none;border:none;font-size:1.5rem;cursor:pointer;color:var(--text-color);padding:0;width:30px;height:30px;display:flex;align-items:center;justify-content:center;border-radius:50%;transition:background-color 0.2s}.close-btn.svelte-4xpfbi.svelte-4xpfbi:hover{background-color:var(--tab-hover-bg)}.tab-container.svelte-4xpfbi.svelte-4xpfbi{padding:20px}.tabs.svelte-4xpfbi.svelte-4xpfbi{display:flex;border-bottom:1px solid var(--border-color);margin-bottom:20px}.tab-btn.svelte-4xpfbi.svelte-4xpfbi{flex:1;padding:12px 16px;background:none;border:none;cursor:pointer;color:var(--text-color);font-size:1rem;transition:all 0.2s;border-bottom:2px solid transparent}.tab-btn.svelte-4xpfbi.svelte-4xpfbi:hover{background-color:var(--tab-hover-bg)}.tab-btn.active.svelte-4xpfbi.svelte-4xpfbi{border-bottom-color:var(--primary);color:var(--primary)}.tab-content.svelte-4xpfbi.svelte-4xpfbi{min-height:200px}.extension-login.svelte-4xpfbi.svelte-4xpfbi,.nsec-login.svelte-4xpfbi.svelte-4xpfbi{display:flex;flex-direction:column;gap:16px}.extension-login.svelte-4xpfbi p.svelte-4xpfbi,.nsec-login.svelte-4xpfbi p.svelte-4xpfbi{margin:0;color:var(--text-color);line-height:1.5}.login-extension-btn.svelte-4xpfbi.svelte-4xpfbi,.login-nsec-btn.svelte-4xpfbi.svelte-4xpfbi{padding:12px 24px;background:var(--primary);color:var(--text-color);border:none;border-radius:6px;cursor:pointer;font-size:1rem;transition:background-color 0.2s}.login-extension-btn.svelte-4xpfbi.svelte-4xpfbi:hover:not(:disabled),.login-nsec-btn.svelte-4xpfbi.svelte-4xpfbi:hover:not(:disabled){background:#00acc1}.login-extension-btn.svelte-4xpfbi.svelte-4xpfbi:disabled,.login-nsec-btn.svelte-4xpfbi.svelte-4xpfbi:disabled{background:#ccc;cursor:not-allowed}.nsec-input.svelte-4xpfbi.svelte-4xpfbi{padding:12px;border:1px solid var(--input-border);border-radius:6px;font-size:1rem;background:var(--bg-color);color:var(--text-color)}.nsec-input.svelte-4xpfbi.svelte-4xpfbi:focus{outline:none;border-color:var(--primary)}.generate-btn.svelte-4xpfbi.svelte-4xpfbi{padding:10px 20px;background:var(--success, #4caf50);color:white;border:none;border-radius:6px;cursor:pointer;font-size:0.95rem;transition:background-color 0.2s}.generate-btn.svelte-4xpfbi.svelte-4xpfbi:hover:not(:disabled){background:#45a049}.generate-btn.svelte-4xpfbi.svelte-4xpfbi:disabled{background:#ccc;cursor:not-allowed}.generated-info.svelte-4xpfbi.svelte-4xpfbi{background:var(--card-bg, #f5f5f5);padding:12px;border-radius:6px;border:1px solid var(--border-color)}.generated-info.svelte-4xpfbi label.svelte-4xpfbi{display:block;font-size:0.85rem;color:var(--muted-foreground, #666);margin-bottom:6px}.npub-display.svelte-4xpfbi.svelte-4xpfbi{display:block;word-break:break-all;font-size:0.85rem;background:var(--bg-color);padding:8px;border-radius:4px;color:var(--text-color)}.password-section.svelte-4xpfbi.svelte-4xpfbi{display:flex;flex-direction:column;gap:8px}.password-section.svelte-4xpfbi label.svelte-4xpfbi{font-size:0.9rem;color:var(--text-color);font-weight:500}.password-input.svelte-4xpfbi.svelte-4xpfbi{padding:10px 12px;border:1px solid var(--input-border);border-radius:6px;font-size:0.95rem;background:var(--bg-color);color:var(--text-color)}.password-input.svelte-4xpfbi.svelte-4xpfbi:focus{outline:none;border-color:var(--primary)}.password-hint.svelte-4xpfbi.svelte-4xpfbi{font-size:0.8rem;color:var(--muted-foreground, #888);font-style:italic}.stored-info.svelte-4xpfbi.svelte-4xpfbi{background:var(--card-bg, #f5f5f5);padding:12px;border-radius:6px;border:1px solid var(--border-color)}.stored-info.svelte-4xpfbi label.svelte-4xpfbi{display:block;font-size:0.85rem;color:var(--muted-foreground, #666);margin-bottom:6px}.clear-btn.svelte-4xpfbi.svelte-4xpfbi{padding:10px 20px;background:transparent;color:var(--error, #dc3545);border:1px solid var(--error, #dc3545);border-radius:6px;cursor:pointer;font-size:0.9rem;transition:all 0.2s}.clear-btn.svelte-4xpfbi.svelte-4xpfbi:hover:not(:disabled){background:var(--error, #dc3545);color:white}.clear-btn.svelte-4xpfbi.svelte-4xpfbi:disabled{opacity:0.5;cursor:not-allowed}.message.svelte-4xpfbi.svelte-4xpfbi{padding:10px;border-radius:4px;margin-top:16px;text-align:center}.error-message.svelte-4xpfbi.svelte-4xpfbi{background:#ffebee;color:#c62828;border:1px solid #ffcdd2}.success-message.svelte-4xpfbi.svelte-4xpfbi{background:#e8f5e8;color:#2e7d32;border:1px solid #c8e6c9}.modal.dark-theme.svelte-4xpfbi .error-message.svelte-4xpfbi{background:#4a2c2a;color:#ffcdd2;border:1px solid #6d4c41}.modal.dark-theme.svelte-4xpfbi .success-message.svelte-4xpfbi{background:#2e4a2e;color:#a5d6a7;border:1px solid #4caf50}.deriving-overlay.svelte-4xpfbi.svelte-4xpfbi{position:fixed;top:0;left:0;width:100%;height:100%;background-color:rgba(0, 0, 0, 0.7);display:flex;justify-content:center;align-items:center;z-index:2000}.deriving-modal.svelte-4xpfbi.svelte-4xpfbi{background:var(--bg-color, #fff);border-radius:12px;padding:2rem;text-align:center;box-shadow:0 8px 32px rgba(0, 0, 0, 0.3);min-width:280px}.deriving-modal.svelte-4xpfbi h3.svelte-4xpfbi{margin:1rem 0 0.5rem;color:var(--text-color, #333);font-size:1.2rem}.deriving-timer.svelte-4xpfbi.svelte-4xpfbi{font-size:2.5rem;font-weight:bold;color:var(--primary, #00bcd4);font-family:monospace;margin:0.5rem 0}.deriving-note.svelte-4xpfbi.svelte-4xpfbi{margin:0.5rem 0 0;color:var(--muted-foreground, #666);font-size:0.9rem}.deriving-spinner.svelte-4xpfbi.svelte-4xpfbi{width:48px;height:48px;border:4px solid var(--border-color, #e0e0e0);border-top-color:var(--primary, #00bcd4);border-radius:50%;margin:0 auto;animation:svelte-4xpfbi-spin 1s linear infinite}@keyframes svelte-4xpfbi-spin{to{transform:rotate(360deg)}}.deriving-modal.dark-theme.svelte-4xpfbi.svelte-4xpfbi{background:#1a1a1a}.deriving-modal.dark-theme.svelte-4xpfbi h3.svelte-4xpfbi{color:#fff}.deriving-modal.dark-theme.svelte-4xpfbi .deriving-note.svelte-4xpfbi{color:#aaa} +.header.svelte-1y8wjwc.svelte-1y8wjwc{margin-bottom:30px}.header.svelte-1y8wjwc h2.svelte-1y8wjwc{margin:0 0 10px 0;color:var(--text-color)}.header.svelte-1y8wjwc p.svelte-1y8wjwc{margin:0;color:var(--text-color);opacity:0.8}.owner-only-notice.svelte-1y8wjwc.svelte-1y8wjwc{margin-top:10px;padding:8px 12px;background-color:var(--warning-bg);border:1px solid var(--warning);border-radius:4px;color:var(--text-color);font-size:0.9em}.message.svelte-1y8wjwc.svelte-1y8wjwc{padding:10px 15px;border-radius:4px;margin-bottom:20px}.message.success.svelte-1y8wjwc.svelte-1y8wjwc{background-color:var(--success-bg);color:var(--success-text);border:1px solid var(--success)}.message.error.svelte-1y8wjwc.svelte-1y8wjwc{background-color:var(--error-bg);color:var(--error-text);border:1px solid var(--danger)}.message.info.svelte-1y8wjwc.svelte-1y8wjwc{background-color:var(--primary-bg);color:var(--text-color);border:1px solid var(--info)}.tabs.svelte-1y8wjwc.svelte-1y8wjwc{display:flex;border-bottom:1px solid var(--border-color);margin-bottom:20px}.tab.svelte-1y8wjwc.svelte-1y8wjwc{padding:10px 20px;border:none;background:none;cursor:pointer;border-bottom:2px solid transparent;transition:all 0.2s;color:var(--text-color)}.tab.svelte-1y8wjwc.svelte-1y8wjwc:hover{background-color:var(--button-hover-bg)}.tab.active.svelte-1y8wjwc.svelte-1y8wjwc{border-bottom-color:var(--accent-color);color:var(--accent-color)}.tab-content.svelte-1y8wjwc.svelte-1y8wjwc{min-height:400px}.section.svelte-1y8wjwc.svelte-1y8wjwc{margin-bottom:30px}.section.svelte-1y8wjwc h3.svelte-1y8wjwc{margin:0 0 15px 0;color:var(--text-color)}.add-form.svelte-1y8wjwc.svelte-1y8wjwc{display:flex;gap:10px;margin-bottom:20px;flex-wrap:wrap}.add-form.svelte-1y8wjwc input.svelte-1y8wjwc{padding:8px 12px;border:1px solid var(--input-border);border-radius:4px;background:var(--bg-color);color:var(--text-color);flex:1;min-width:200px}.add-form.svelte-1y8wjwc button.svelte-1y8wjwc{padding:8px 16px;background-color:var(--accent-color);color:var(--text-color);border:none;border-radius:4px;cursor:pointer}.add-form.svelte-1y8wjwc button.svelte-1y8wjwc:disabled{background-color:var(--secondary);cursor:not-allowed}.list.svelte-1y8wjwc.svelte-1y8wjwc{border:1px solid var(--border-color);border-radius:4px;max-height:300px;overflow-y:auto;background:var(--bg-color)}.list-item.svelte-1y8wjwc.svelte-1y8wjwc{padding:10px 15px;border-bottom:1px solid var(--border-color);display:flex;align-items:center;gap:15px;color:var(--text-color)}.list-item.svelte-1y8wjwc.svelte-1y8wjwc:last-child{border-bottom:none}.pubkey.svelte-1y8wjwc.svelte-1y8wjwc,.event-id.svelte-1y8wjwc.svelte-1y8wjwc,.ip.svelte-1y8wjwc.svelte-1y8wjwc,.kind.svelte-1y8wjwc.svelte-1y8wjwc{font-family:monospace;font-size:0.9em;color:var(--text-color)}.reason.svelte-1y8wjwc.svelte-1y8wjwc{color:var(--text-color);opacity:0.7;font-style:italic}.remove-btn.svelte-1y8wjwc.svelte-1y8wjwc{padding:4px 8px;background-color:var(--danger);color:var(--text-color);border:none;border-radius:3px;cursor:pointer;font-size:0.8em}.actions.svelte-1y8wjwc.svelte-1y8wjwc{display:flex;gap:5px;margin-left:auto}.actions.svelte-1y8wjwc button.svelte-1y8wjwc{padding:4px 8px;border:none;border-radius:3px;cursor:pointer;font-size:0.8em}.actions.svelte-1y8wjwc button.svelte-1y8wjwc:first-child{background-color:var(--success);color:var(--text-color)}.actions.svelte-1y8wjwc button.svelte-1y8wjwc:last-child{background-color:var(--danger);color:var(--text-color)}.config-form.svelte-1y8wjwc.svelte-1y8wjwc{display:flex;flex-direction:column;gap:20px}.form-group.svelte-1y8wjwc.svelte-1y8wjwc{display:flex;flex-direction:column;gap:10px}.form-group.svelte-1y8wjwc label.svelte-1y8wjwc{font-weight:bold;color:var(--text-color)}.form-group.svelte-1y8wjwc input.svelte-1y8wjwc,.form-group.svelte-1y8wjwc textarea.svelte-1y8wjwc{padding:8px 12px;border:1px solid var(--input-border);border-radius:4px;background:var(--bg-color);color:var(--text-color)}.form-group.svelte-1y8wjwc textarea.svelte-1y8wjwc{min-height:80px;resize:vertical}.config-actions.svelte-1y8wjwc.svelte-1y8wjwc{margin-bottom:20px;padding:10px;background-color:var(--button-bg);border-radius:4px}.refresh-btn.svelte-1y8wjwc.svelte-1y8wjwc{padding:8px 16px;background-color:var(--success);color:var(--text-color);border:none;border-radius:4px;cursor:pointer;font-size:0.9em}.refresh-btn.svelte-1y8wjwc.svelte-1y8wjwc:hover:not(:disabled){background-color:var(--success);filter:brightness(0.9)}.refresh-btn.svelte-1y8wjwc.svelte-1y8wjwc:disabled{background-color:var(--secondary);cursor:not-allowed}.config-update-section.svelte-1y8wjwc.svelte-1y8wjwc{margin-top:20px;padding:15px;background-color:var(--button-bg);border-radius:6px;text-align:center}.update-all-btn.svelte-1y8wjwc.svelte-1y8wjwc{padding:12px 24px;background-color:var(--success);color:var(--text-color);border:none;border-radius:6px;cursor:pointer;font-size:1em;font-weight:600;min-width:200px}.update-all-btn.svelte-1y8wjwc.svelte-1y8wjwc:hover:not(:disabled){background-color:var(--success);filter:brightness(0.9);transform:translateY(-1px);box-shadow:0 2px 4px rgba(0, 0, 0, 0.1)}.update-all-btn.svelte-1y8wjwc.svelte-1y8wjwc:disabled{background-color:var(--secondary);cursor:not-allowed;transform:none;box-shadow:none}.no-items.svelte-1y8wjwc.svelte-1y8wjwc{padding:20px;text-align:center;color:var(--text-color);opacity:0.7;font-style:italic} +.main-header.svelte-1qkhxam{color:var(--text-color);position:fixed;top:0;left:0;right:0;height:3em;background:var(--header-bg);border:0;z-index:1000;display:flex;align-items:stretch;padding:0 0.25em}.header-content.svelte-1qkhxam{display:flex;align-items:stretch;width:100%;padding:0;margin:0}.logo.svelte-1qkhxam{height:2.5em;width:auto;flex-shrink:0;align-self:center}.header-title.svelte-1qkhxam{flex:1;display:flex;align-items:center;align-self:center}.app-title.svelte-1qkhxam{font-size:1.2em;font-weight:600;color:var(--text-color);display:flex;align-items:center;gap:0.5em}.permission-badge.svelte-1qkhxam{background:var(--primary);color:var(--text-color);padding:0.2em 0.5em;border-radius:0.5em;font-size:0.7em;font-weight:500;text-transform:uppercase;letter-spacing:0.5px}.header-buttons.svelte-1qkhxam{display:flex;align-items:stretch;align-self:stretch;margin-left:auto}.login-btn.svelte-1qkhxam,.user-profile-btn.svelte-1qkhxam{background:transparent;color:var(--button-text);border:0;cursor:pointer;font-size:1em;transition:background-color 0.2s;flex-shrink:0;padding:0.5em;margin:0;display:flex !important;align-items:center !important;justify-content:center}.login-btn.svelte-1qkhxam:hover,.user-profile-btn.svelte-1qkhxam:hover{background:var(--card-bg)}.user-profile-btn.svelte-1qkhxam{gap:0.5em;justify-content:flex-start;padding:0 0.5em}.user-avatar.svelte-1qkhxam{height:2.5em;width:2.5em;border-radius:50%;object-fit:cover;flex-shrink:0;align-self:center;vertical-align:middle}.user-avatar-placeholder.svelte-1qkhxam{height:2.5em;width:2.5em;border-radius:50%;background:var(--bg-color);display:flex;align-items:center;justify-content:center;font-size:1.2em;flex-shrink:0;align-self:center}.user-name.svelte-1qkhxam{font-weight:500;white-space:nowrap;line-height:1;align-self:center;max-width:none !important;overflow:visible !important;text-overflow:unset !important;width:auto !important} +.sidebar.svelte-wfmuj{position:fixed;left:0;top:3em;width:200px;bottom:0;background:var(--sidebar-bg);overflow-y:auto;z-index:100}.sidebar-content.svelte-wfmuj{padding:0;background:var(--sidebar-bg)}.tabs.svelte-wfmuj{display:flex;flex-direction:column;padding:0}.tab.svelte-wfmuj{display:flex;align-items:center;padding:0.75em;padding-left:1em;background:transparent;color:var(--text-color);border:none;cursor:pointer;transition:background-color 0.2s;gap:0.75rem;text-align:left;width:100%}.tab.svelte-wfmuj:hover{background-color:var(--bg-color)}.tab.active.svelte-wfmuj{background-color:var(--bg-color)}.tab-icon.svelte-wfmuj{font-size:1.2em;flex-shrink:0;width:1.5em;text-align:center}.tab-label.svelte-wfmuj{font-size:0.9em;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1}.tab-close-icon.svelte-wfmuj{cursor:pointer;transition:opacity 0.2s;font-size:0.8em;margin-left:auto;padding:0.25rem;flex-shrink:0}.tab-close-icon.svelte-wfmuj:hover{opacity:0.7;background-color:var(--warning);color:var(--text-color)}@media(max-width: 1280px){.sidebar.svelte-wfmuj{width:60px}.tab-label.svelte-wfmuj{display:none}.tab-close-icon.svelte-wfmuj{display:none}.tab.svelte-wfmuj{justify-content:flex-start}}@media(max-width: 640px){.sidebar.svelte-wfmuj{width:160px}.tab-label.svelte-wfmuj{display:block}.tab.svelte-wfmuj{justify-content:flex-start}}.version-link.svelte-wfmuj{position:absolute;bottom:0;left:0;right:0;display:flex;align-items:center;gap:0.5rem;padding:0.75em 1em;color:var(--text-color);text-decoration:none;font-size:0.8em;transition:background-color 0.2s, color 0.2s;background:transparent}.version-link.svelte-wfmuj:hover{background-color:var(--bg-color)}.version-icon.svelte-wfmuj{width:1.2em;height:1.2em;flex-shrink:0;color:#4a9c5d}.version-text.svelte-wfmuj{white-space:nowrap}@media(max-width: 1280px){.version-text.svelte-wfmuj{display:none}.version-link.svelte-wfmuj{justify-content:flex-start;padding-left:1.25em}}@media(max-width: 640px){.version-text.svelte-wfmuj{display:inline}} +.export-section.svelte-jzrdtj.svelte-jzrdtj{border-radius:8px;padding:1em;margin:1em;width:100%;max-width:32em;box-sizing:border-box;background-color:var(--card-bg)}.export-section.svelte-jzrdtj h3.svelte-jzrdtj{margin:0 0 1rem 0;color:var(--text-color);font-size:1.2rem;font-weight:600}.export-section.svelte-jzrdtj p.svelte-jzrdtj{margin:0 0 1.5rem 0;color:var(--text-color);opacity:0.8;line-height:1.4}.export-btn.svelte-jzrdtj.svelte-jzrdtj{background-color:var(--primary);color:var(--text-color);border:none;padding:0.75em 1.5em;border-radius:0.5em;cursor:pointer;font-weight:bold;font-size:0.9em;transition:background-color 0.2s}.export-btn.svelte-jzrdtj.svelte-jzrdtj:hover{background-color:var(--accent-hover-color)}.login-prompt.svelte-jzrdtj.svelte-jzrdtj{text-align:center;padding:2em;background-color:var(--card-bg);border-radius:8px;border:1px solid var(--border-color);width:100%;max-width:32em;box-sizing:border-box}.login-prompt.svelte-jzrdtj p.svelte-jzrdtj{margin:0 0 1.5rem 0;color:var(--text-color);font-size:1.1rem}.login-btn.svelte-jzrdtj.svelte-jzrdtj{background-color:var(--primary);color:var(--text-color);border:none;padding:0.75em 1.5em;border-radius:4px;cursor:pointer;font-weight:bold;font-size:0.9em;transition:background-color 0.2s}.login-btn.svelte-jzrdtj.svelte-jzrdtj:hover{background-color:var(--accent-hover-color)} +.import-section.svelte-nonyqh.svelte-nonyqh{background:transparent;padding:1em;border-radius:8px;margin-bottom:1.5rem;width:100%;max-width:32em;box-sizing:border-box}.import-section.svelte-nonyqh h3.svelte-nonyqh{margin:0 0 1rem 0;color:var(--text-color);font-size:1.2rem;font-weight:600}.import-section.svelte-nonyqh p.svelte-nonyqh{margin:0 0 1.5rem 0;color:var(--text-color);opacity:0.8;line-height:1.4}.recovery-controls-card.svelte-nonyqh.svelte-nonyqh{background-color:var(--card-bg);padding:1em;border:0;display:flex;flex-direction:column;border-radius:0.5em;gap:1em}#import-file.svelte-nonyqh.svelte-nonyqh{padding:0.5em;border:0;background:var(--input-bg);color:var(--input-text-color)}.import-btn.svelte-nonyqh.svelte-nonyqh{background-color:var(--primary);color:var(--text-color);border-radius:0.5em;padding:0.75em 1.5em;border:0;cursor:pointer;font-weight:bold;font-size:0.9em;transition:background-color 0.2s;align-self:flex-start}.import-btn.svelte-nonyqh.svelte-nonyqh:hover:not(:disabled){background-color:var(--accent-hover-color)}.import-btn.svelte-nonyqh.svelte-nonyqh:disabled{background-color:var(--secondary);cursor:not-allowed}.import-row.svelte-nonyqh.svelte-nonyqh{display:flex;align-items:center;gap:1em}.import-message.svelte-nonyqh.svelte-nonyqh{font-size:0.9em;padding:0.25em 0.5em;border-radius:0.25em}.import-message.uploading.svelte-nonyqh.svelte-nonyqh{color:var(--primary)}.import-message.success.svelte-nonyqh.svelte-nonyqh{color:#4caf50}.import-message.error.svelte-nonyqh.svelte-nonyqh{color:#f44336}.permission-denied.svelte-nonyqh.svelte-nonyqh,.login-prompt.svelte-nonyqh.svelte-nonyqh{text-align:center;padding:2em;background-color:var(--card-bg);border:0}.recovery-header.svelte-nonyqh.svelte-nonyqh{margin:0 0 1rem 0;color:var(--text-color);font-size:1.2rem;font-weight:600}.recovery-description.svelte-nonyqh.svelte-nonyqh{margin:0 0 1.5rem 0;color:var(--text-color);line-height:1.4}.login-btn.svelte-nonyqh.svelte-nonyqh{background-color:var(--primary);color:var(--text-color);border:none;padding:0.75em 1.5em;border:0;cursor:pointer;font-weight:bold;font-size:0.9em;transition:background-color 0.2s}.login-btn.svelte-nonyqh.svelte-nonyqh:hover{background-color:var(--accent-hover-color)} +.filter-builder.svelte-1a1v6k0.svelte-1a1v6k0{padding:1em;background:var(--bg-color);border-bottom:1px solid var(--border-color);display:flex;gap:1em}.filter-content.svelte-1a1v6k0.svelte-1a1v6k0{flex:1;min-width:0}.clear-column.svelte-1a1v6k0.svelte-1a1v6k0{display:flex;flex-direction:column;gap:0.5em;flex-shrink:0;width:2.5em}.clear-column.svelte-1a1v6k0 .spacer.svelte-1a1v6k0{flex:1}.clear-all-btn.svelte-1a1v6k0.svelte-1a1v6k0,.json-toggle-btn.svelte-1a1v6k0.svelte-1a1v6k0{background:var(--secondary);color:var(--text-color);border:none;padding:0;border-radius:4px;cursor:pointer;font-size:1em;transition:filter 0.2s, background-color 0.2s;width:100%;aspect-ratio:1;display:flex;align-items:center;justify-content:center;box-sizing:border-box}.clear-all-btn.svelte-1a1v6k0.svelte-1a1v6k0{background:var(--danger)}.clear-all-btn.svelte-1a1v6k0.svelte-1a1v6k0:hover{filter:brightness(1.2)}.json-toggle-btn.svelte-1a1v6k0.svelte-1a1v6k0{font-family:monospace;font-weight:600;background:var(--primary)}.json-toggle-btn.svelte-1a1v6k0.svelte-1a1v6k0:hover{background:var(--accent-hover-color)}.json-toggle-btn.active.svelte-1a1v6k0.svelte-1a1v6k0{background:var(--accent-hover-color)}.filter-grid.svelte-1a1v6k0.svelte-1a1v6k0{display:grid;grid-template-columns:auto 1fr;gap:0.5em 1em;align-items:start}.filter-grid.svelte-1a1v6k0>label.svelte-1a1v6k0{font-weight:600;color:var(--text-color);font-size:0.9em;padding-top:0.6em;white-space:nowrap}.field-content.svelte-1a1v6k0.svelte-1a1v6k0{min-width:0}.filter-input.svelte-1a1v6k0.svelte-1a1v6k0{width:100%;padding:0.6em;border:1px solid var(--border-color);border-radius:4px;background:var(--input-bg);color:var(--input-text-color);font-size:0.9em;box-sizing:border-box}.filter-input.svelte-1a1v6k0.svelte-1a1v6k0:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 2px rgba(0, 123, 255, 0.15)}.picker-toggle-btn.svelte-1a1v6k0.svelte-1a1v6k0{width:100%;padding:0.6em;background:var(--secondary);color:var(--text-color);border:1px solid var(--border-color);border-radius:4px;cursor:pointer;font-size:0.9em;text-align:left;transition:background-color 0.2s}.picker-toggle-btn.svelte-1a1v6k0.svelte-1a1v6k0:hover{background:var(--accent-hover-color)}.kinds-picker.svelte-1a1v6k0.svelte-1a1v6k0{margin-top:0.5em;border:1px solid var(--border-color);border-radius:4px;padding:0.5em;background:var(--card-bg)}.kind-search.svelte-1a1v6k0.svelte-1a1v6k0{margin-bottom:0.5em}.kinds-list.svelte-1a1v6k0.svelte-1a1v6k0{max-height:300px;overflow-y:auto}.kind-checkbox.svelte-1a1v6k0.svelte-1a1v6k0{display:flex;align-items:center;padding:0.4em;cursor:pointer;border-radius:4px;transition:background-color 0.2s}.kind-checkbox.svelte-1a1v6k0.svelte-1a1v6k0:hover{background:var(--bg-color)}.kind-checkbox.svelte-1a1v6k0 input[type="checkbox"].svelte-1a1v6k0{margin-right:0.5em;cursor:pointer}.kind-number.svelte-1a1v6k0.svelte-1a1v6k0{background:var(--primary);color:var(--text-color);padding:0.1em 0.4em;border-radius:3px;font-size:0.8em;font-weight:600;font-family:monospace;margin-right:0.5em;min-width:40px;text-align:center;display:inline-block}.kind-name.svelte-1a1v6k0.svelte-1a1v6k0{font-size:0.85em;color:var(--text-color)}.chips-container.svelte-1a1v6k0.svelte-1a1v6k0{display:flex;flex-wrap:wrap;gap:0.5em;margin-top:0.5em}.chip.svelte-1a1v6k0.svelte-1a1v6k0{display:inline-flex;align-items:center;background:var(--primary);color:var(--text-color);padding:0.2em 0.5em;border-radius:0.5em;font-size:0.7em;font-weight:500;text-transform:uppercase;letter-spacing:0.5px;gap:0.4em}.chip-text.svelte-1a1v6k0.svelte-1a1v6k0{line-height:1}.chip-remove.svelte-1a1v6k0.svelte-1a1v6k0{background:transparent;border:none;color:var(--text-color);cursor:pointer;padding:0;font-size:1em;line-height:1;opacity:0.8;transition:opacity 0.2s}.chip-remove.svelte-1a1v6k0.svelte-1a1v6k0:hover{opacity:1}.input-group.svelte-1a1v6k0.svelte-1a1v6k0{display:flex;gap:0.5em}.input-group.svelte-1a1v6k0 .filter-input.svelte-1a1v6k0{flex:1}.add-btn.svelte-1a1v6k0.svelte-1a1v6k0{background:var(--primary);color:var(--text-color);border:none;padding:0.6em 1.2em;border-radius:4px;cursor:pointer;font-size:0.9em;font-weight:600;transition:background-color 0.2s;white-space:nowrap}.add-btn.svelte-1a1v6k0.svelte-1a1v6k0:hover{background:var(--accent-hover-color)}.error-message.svelte-1a1v6k0.svelte-1a1v6k0{color:var(--danger);font-size:0.85em;margin-top:0.25em}.list-items.svelte-1a1v6k0.svelte-1a1v6k0{margin-top:0.5em;display:flex;flex-direction:column;gap:0.5em}.list-item.svelte-1a1v6k0.svelte-1a1v6k0{display:flex;align-items:center;padding:0.5em;background:var(--card-bg);border:1px solid var(--border-color);border-radius:4px;gap:0.5em}.list-item-text.svelte-1a1v6k0.svelte-1a1v6k0{flex:1;font-family:monospace;font-size:0.85em;color:var(--text-color);word-break:break-all}.list-item-remove.svelte-1a1v6k0.svelte-1a1v6k0{background:var(--danger);color:var(--text-color);border:none;padding:0.25em 0.5em;border-radius:3px;cursor:pointer;font-size:1.2em;line-height:1;transition:background-color 0.2s}.list-item-remove.svelte-1a1v6k0.svelte-1a1v6k0:hover{filter:brightness(0.9)}.tag-input-group.svelte-1a1v6k0.svelte-1a1v6k0{display:flex;gap:0.5em;align-items:center}.hash-prefix.svelte-1a1v6k0.svelte-1a1v6k0{font-weight:700;font-size:1.2em;color:var(--text-color)}.tag-name-input.svelte-1a1v6k0.svelte-1a1v6k0{width:50px}.tag-value-input.svelte-1a1v6k0.svelte-1a1v6k0{flex:1}.timestamp-field.svelte-1a1v6k0.svelte-1a1v6k0{position:relative;display:flex;align-items:center;gap:0.5em}.timestamp-field.svelte-1a1v6k0 .filter-input.svelte-1a1v6k0{flex:1}.clear-timestamp-btn.svelte-1a1v6k0.svelte-1a1v6k0{background:var(--danger);color:var(--text-color);border:none;padding:0.25em 0.5em;border-radius:3px;cursor:pointer;font-size:1em;line-height:1;transition:background-color 0.2s;flex-shrink:0}.clear-timestamp-btn.svelte-1a1v6k0.svelte-1a1v6k0:hover{filter:brightness(0.9)}.json-editor-section.svelte-1a1v6k0.svelte-1a1v6k0{grid-column:1 / -1;margin-top:0.5em;padding-top:1em;border-top:1px solid var(--border-color)}.json-editor-section.svelte-1a1v6k0 label.svelte-1a1v6k0{display:block;font-weight:600;color:var(--text-color);font-size:0.9em;margin-bottom:0.5em}.json-editor.svelte-1a1v6k0.svelte-1a1v6k0{width:100%;padding:0.6em;border:1px solid var(--border-color);border-radius:4px;background:var(--input-bg);color:var(--input-text-color);font-family:monospace;font-size:0.85em;resize:vertical;box-sizing:border-box}.json-editor.svelte-1a1v6k0.svelte-1a1v6k0:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 2px rgba(0, 123, 255, 0.15)}.json-error.svelte-1a1v6k0.svelte-1a1v6k0{color:var(--danger);font-size:0.85em;margin-top:0.25em}.apply-json-btn.svelte-1a1v6k0.svelte-1a1v6k0{margin-top:0.5em;background:var(--primary);color:var(--text-color);border:none;padding:0.5em 1em;border-radius:4px;cursor:pointer;font-size:0.9em;font-weight:600;transition:background-color 0.2s}.apply-json-btn.svelte-1a1v6k0.svelte-1a1v6k0:hover{background:var(--accent-hover-color)}@media(max-width: 768px){.filter-grid.svelte-1a1v6k0.svelte-1a1v6k0{grid-template-columns:1fr}.filter-grid.svelte-1a1v6k0>label.svelte-1a1v6k0{padding-top:0;padding-bottom:0.25em}} +.events-view-container.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{width:100%;height:100%;display:flex;flex-direction:column;box-sizing:border-box}.events-view-content.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{flex:1;overflow-y:auto;padding:0}.events-view-content.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec::-webkit-scrollbar{width:16px;background:var(--bg-color)}.events-view-content.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec::-webkit-scrollbar-track{background:var(--bg-color)}.events-view-content.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec::-webkit-scrollbar-thumb{background:var(--text-color);border-radius:9999px;border:4px solid var(--bg-color)}.events-view-content.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec::-webkit-scrollbar-thumb:hover{background:var(--text-color);filter:brightness(1.2)}.events-view-content.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec::-webkit-scrollbar-button{background:var(--text-color);height:8px;border:4px solid var(--bg-color);border-radius:9999px;background-clip:padding-box}.events-view-item.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{border:0;margin:0;transition:all 0.2s ease}.events-view-item.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec:hover{padding:0}.events-view-row.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{display:flex;align-items:center;padding:0.5em;cursor:pointer;gap:1em}.events-view-avatar.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{flex-shrink:0}.avatar-placeholder.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{width:40px;height:40px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:1.2em;border:0}.events-view-info.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{flex-shrink:0;min-width:120px}.events-view-author.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{font-weight:600;color:var(--text-color);font-size:0.9em;font-family:monospace}.events-view-kind.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{display:flex;align-items:center;gap:0.5em;margin-top:0.25em}.kind-number.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{background:var(--primary);color:var(--text-color);padding:0.1em 0.4em;border:0;font-size:0.7em;font-weight:600;font-family:monospace}.kind-number.delete-event.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{background:var(--danger)}.kind-name.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{font-size:0.8em;color:var(--text-color);opacity:0.8}.event-timestamp.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{font-size:0.8em;color:var(--text-color);opacity:0.6;margin-bottom:0.5em}.delete-event-info.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{background:var(--danger-bg);padding:0.5em;border-radius:4px;border:1px solid var(--danger)}.delete-event-label.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{font-weight:600;color:var(--danger);display:block;margin-bottom:0.25em}.delete-targets.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{display:flex;flex-wrap:wrap;gap:0.25em}.delete-target.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{background:var(--danger);color:var(--text-color);padding:0.1em 0.3em;border-radius:0.2rem;font-size:0.7em;font-family:monospace}.event-content-single-line.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{color:var(--text-color);line-height:1.4;word-wrap:break-word}.delete-btn.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{background:var(--danger);color:var(--text-color);border:none;padding:0.5em;border-radius:4px;cursor:pointer;font-size:0.9em;flex-shrink:0;transition:background-color 0.2s}.delete-btn.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec:hover{background:var(--danger);filter:brightness(0.9)}.events-view-details.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{padding:0;background:var(--bg-color)}.json-container.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{position:relative}.event-json.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{background:var(--code-bg);padding:1em;border:0;font-size:0.8em;line-height:1.4;overflow-x:auto;margin:0;color:var(--code-text)}.copy-json-btn.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{position:absolute;top:1em;right:1em;background:var(--primary);color:var(--text-color);border:none;padding:1em;cursor:pointer;font-size:0.8em;opacity:0.8;transition:opacity 0.2s}.copy-json-btn.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec:hover{opacity:1}.no-events.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{text-align:center;padding:2em;color:var(--text-color);opacity:0.7}.loading-events.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{text-align:center;padding:2em;color:var(--text-color)}.spinner.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{width:20px;height:20px;border:0;border-radius:50%;animation:svelte-5kb1ec-spin 1s linear infinite;margin:0 auto 1em}@keyframes svelte-5kb1ec-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.permission-denied.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{text-align:center;padding:2em;background-color:var(--card-bg);border-radius:8px;border:1px solid var(--border-color);color:var(--text-color)}.events-view-footer.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{position:relative;flex-shrink:0}.events-view-header.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{display:flex;justify-content:space-between;align-items:center;padding:0.5em;border:0;background:var(--header-bg)}.events-view-toggle.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{display:flex;align-items:center}.toggle-container.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{display:flex;align-items:center;gap:0.5em;cursor:pointer}.toggle-container.svelte-5kb1ec input[type="checkbox"].svelte-5kb1ec.svelte-5kb1ec{display:none}.toggle-slider.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{width:40px;height:20px;background:var(--border-color);border-radius:10px;position:relative;transition:background 0.2s}.toggle-slider.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec::before{content:"";position:absolute;width:16px;height:16px;background:var(--text-color);border-radius:50%;top:2px;left:2px;transition:transform 0.2s}.toggle-container.svelte-5kb1ec input.svelte-5kb1ec:checked+.toggle-slider.svelte-5kb1ec{background:var(--primary)}.toggle-container.svelte-5kb1ec input.svelte-5kb1ec:checked+.toggle-slider.svelte-5kb1ec::before{transform:translateX(20px)}.toggle-label.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{font-size:0.9em;color:var(--text-color)}.events-view-buttons.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{display:flex;gap:0.5em}.refresh-btn.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec,.reload-btn.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{background:var(--primary);color:var(--text-color);border:none;padding:0.4em 1em;border-radius:4px;cursor:pointer;font-size:0.9em;transition:background-color 0.2s;display:flex;align-items:center;justify-content:center;gap:0.25em;box-sizing:border-box;line-height:1}.reload-btn.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{width:2.5em;padding:0.4em}.refresh-btn.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec:hover:not(:disabled),.reload-btn.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec:hover:not(:disabled){background:var(--accent-hover-color)}.refresh-btn.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec:disabled,.reload-btn.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec:disabled{background:var(--secondary);cursor:not-allowed;padding:0.4em 1em}.reload-btn.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec:disabled{padding:0.4em}.reload-btn.svelte-5kb1ec .spinner.svelte-5kb1ec.svelte-5kb1ec{width:0.8em;height:0.8em;border:1.5px solid var(--text-color);border-top-color:transparent;border-radius:50%;animation:svelte-5kb1ec-spin 1s linear infinite;margin:0;box-sizing:border-box}.events-view-left.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{display:flex;align-items:center;gap:0.75em}.filter-btn.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{background:var(--primary);color:var(--text-color);border:none;padding:0.4em;border-radius:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background-color 0.2s;width:2.2em;height:2.2em;box-sizing:border-box}.filter-btn.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec:hover{background:var(--accent-hover-color)}.filter-btn.active.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{background:var(--accent-hover-color)}.filter-btn.svelte-5kb1ec svg.svelte-5kb1ec.svelte-5kb1ec{width:1em;height:1em}.filter-panel.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{position:absolute;bottom:100%;left:0;right:0;background:var(--bg-color);border-top:1px solid var(--border-color);max-height:0;overflow:hidden;transition:max-height 0.3s ease-out;z-index:100;padding-right:16px;box-sizing:border-box;display:flex;flex-direction:column-reverse}.filter-panel.open.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec{max-height:60vh;overflow-y:auto}.filter-panel.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec::-webkit-scrollbar{width:16px;background:var(--bg-color)}.filter-panel.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec::-webkit-scrollbar-track{background:var(--bg-color)}.filter-panel.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec::-webkit-scrollbar-thumb{background:var(--text-color);border-radius:9999px;border:4px solid var(--bg-color)}.filter-panel.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec::-webkit-scrollbar-thumb:hover{background:var(--text-color);filter:brightness(1.2)}.filter-panel.svelte-5kb1ec.svelte-5kb1ec.svelte-5kb1ec::-webkit-scrollbar-button{background:var(--text-color);height:8px;border:4px solid var(--bg-color);border-radius:9999px;background-clip:padding-box} +.modal-backdrop.svelte-v55ls1.svelte-v55ls1{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0, 0, 0, 0.7);display:flex;align-items:center;justify-content:center;z-index:1000}.modal-content.svelte-v55ls1.svelte-v55ls1{background:var(--card-bg);border-radius:0.5rem;width:90%;max-width:800px;max-height:85vh;display:flex;flex-direction:column;box-shadow:0 4px 20px rgba(0, 0, 0, 0.3);border:1px solid var(--border-color)}.modal-header.svelte-v55ls1.svelte-v55ls1{display:flex;justify-content:space-between;align-items:center;padding:1rem 1.5rem;border-bottom:1px solid var(--border-color)}.modal-header.svelte-v55ls1 h2.svelte-v55ls1{margin:0;font-size:1.25rem;color:var(--text-color)}.close-btn.svelte-v55ls1.svelte-v55ls1{background:none;border:none;font-size:1.5rem;cursor:pointer;color:var(--text-color);padding:0;width:2rem;height:2rem;display:flex;align-items:center;justify-content:center;border-radius:0.25rem}.close-btn.svelte-v55ls1.svelte-v55ls1:hover{background:var(--button-hover-bg)}.modal-filters.svelte-v55ls1.svelte-v55ls1{padding:1rem 1.5rem;border-bottom:1px solid var(--border-color)}.search-box.svelte-v55ls1.svelte-v55ls1{margin-bottom:0.75rem}.search-input.svelte-v55ls1.svelte-v55ls1{width:100%;padding:0.75rem;border:1px solid var(--border-color);border-radius:0.25rem;background:var(--input-bg);color:var(--input-text-color);font-size:0.9rem}.search-input.svelte-v55ls1.svelte-v55ls1:focus{outline:none;border-color:var(--accent-color)}.category-tabs.svelte-v55ls1.svelte-v55ls1{display:flex;flex-wrap:wrap;gap:0.5rem}.category-tab.svelte-v55ls1.svelte-v55ls1{padding:0.4rem 0.75rem;border:1px solid var(--border-color);border-radius:1rem;background:transparent;color:var(--text-color);font-size:0.75rem;cursor:pointer;transition:all 0.2s}.category-tab.svelte-v55ls1.svelte-v55ls1:hover{background:var(--button-hover-bg)}.category-tab.active.svelte-v55ls1.svelte-v55ls1{background:var(--accent-color);border-color:var(--accent-color);color:white}.modal-body.svelte-v55ls1.svelte-v55ls1{flex:1;overflow-y:auto;padding:1rem 1.5rem}.kinds-list.svelte-v55ls1.svelte-v55ls1{display:flex;flex-direction:column;gap:0.5rem}.kind-item.svelte-v55ls1.svelte-v55ls1{display:block;width:100%;text-align:left;padding:0.75rem 1rem;border:1px solid var(--border-color);border-radius:0.375rem;background:var(--bg-color);cursor:pointer;transition:all 0.2s}.kind-item.svelte-v55ls1.svelte-v55ls1:hover{border-color:var(--accent-color);background:var(--button-hover-bg)}.kind-header.svelte-v55ls1.svelte-v55ls1{display:flex;align-items:center;gap:0.5rem;margin-bottom:0.25rem}.kind-number.svelte-v55ls1.svelte-v55ls1{font-family:monospace;font-size:0.8rem;color:var(--accent-color);font-weight:bold}.kind-badge.svelte-v55ls1.svelte-v55ls1{font-size:0.65rem;padding:0.15rem 0.4rem;border-radius:0.25rem;font-weight:500}.badge-regular.svelte-v55ls1.svelte-v55ls1{background:#6c757d;color:white}.badge-replaceable.svelte-v55ls1.svelte-v55ls1{background:#17a2b8;color:white}.badge-ephemeral.svelte-v55ls1.svelte-v55ls1{background:#ffc107;color:black}.badge-addressable.svelte-v55ls1.svelte-v55ls1{background:#28a745;color:white}.nip-badge.svelte-v55ls1.svelte-v55ls1{font-size:0.65rem;padding:0.15rem 0.4rem;border-radius:0.25rem;background:var(--primary);color:var(--text-color)}.kind-name.svelte-v55ls1.svelte-v55ls1{font-weight:600;color:var(--text-color);margin-bottom:0.25rem}.kind-description.svelte-v55ls1.svelte-v55ls1{font-size:0.85rem;color:var(--text-color);opacity:0.7}.no-results.svelte-v55ls1.svelte-v55ls1{text-align:center;padding:2rem;color:var(--text-color);opacity:0.6}.modal-footer.svelte-v55ls1.svelte-v55ls1{display:flex;justify-content:space-between;align-items:center;padding:1rem 1.5rem;border-top:1px solid var(--border-color)}.result-count.svelte-v55ls1.svelte-v55ls1{font-size:0.85rem;color:var(--text-color);opacity:0.7}.cancel-btn.svelte-v55ls1.svelte-v55ls1{padding:0.5rem 1rem;border:1px solid var(--border-color);border-radius:0.25rem;background:var(--button-bg);color:var(--button-text);cursor:pointer;font-size:0.9rem}.cancel-btn.svelte-v55ls1.svelte-v55ls1:hover{background:var(--button-hover-bg)}@media(max-width: 640px){.modal-content.svelte-v55ls1.svelte-v55ls1{width:95%;max-height:90vh}.category-tabs.svelte-v55ls1.svelte-v55ls1{overflow-x:auto;flex-wrap:nowrap;padding-bottom:0.5rem}.category-tab.svelte-v55ls1.svelte-v55ls1{white-space:nowrap}} +.compose-view.svelte-46pmgb{position:fixed;top:3em;left:200px;right:0;bottom:0;display:flex;flex-direction:column;background:transparent}.compose-header.svelte-46pmgb{display:flex;gap:0.5em;padding:0.5em;background:transparent}.compose-btn.svelte-46pmgb{padding:0.5em 1em;border:1px solid var(--border-color);border-radius:0.25rem;background:var(--button-bg);color:var(--button-text);cursor:pointer;font-size:0.9rem;transition:background-color 0.2s}.compose-btn.svelte-46pmgb:hover{background:var(--button-hover-bg)}.template-btn.svelte-46pmgb{background:var(--primary);color:var(--text-color)}.template-btn.svelte-46pmgb:hover{background:var(--primary);filter:brightness(0.9)}.reformat-btn.svelte-46pmgb{background:var(--info);color:var(--text-color)}.reformat-btn.svelte-46pmgb:hover{background:var(--info);filter:brightness(0.9)}.sign-btn.svelte-46pmgb{background:var(--warning);color:var(--text-color)}.sign-btn.svelte-46pmgb:hover{background:var(--warning);filter:brightness(0.9)}.publish-btn.svelte-46pmgb{background:var(--success);color:var(--text-color)}.publish-btn.svelte-46pmgb:hover{background:var(--success);filter:brightness(0.9)}.error-banner.svelte-46pmgb{display:flex;align-items:center;justify-content:space-between;padding:0.75em 1em;margin:0 0.5em;background:#f8d7da;border:1px solid #f5c6cb;border-radius:0.25rem;color:#721c24}.dark-theme .error-banner.svelte-46pmgb{background:#4a1c24;border-color:#6a2c34;color:#f8d7da}.error-content.svelte-46pmgb{display:flex;align-items:center;gap:0.5em}.error-icon.svelte-46pmgb{font-size:1.2em}.error-message.svelte-46pmgb{font-size:0.9rem;line-height:1.4}.error-dismiss.svelte-46pmgb{background:none;border:none;font-size:1.25rem;cursor:pointer;color:inherit;padding:0 0.25em;opacity:0.7}.error-dismiss.svelte-46pmgb:hover{opacity:1}.compose-editor.svelte-46pmgb{flex:1;display:flex;flex-direction:column;padding:0}.compose-textarea.svelte-46pmgb{flex:1;width:100%;padding:1em;border-radius:0.5em;background:var(--input-bg);color:var(--input-text-color);font-family:monospace;font-size:0.9em;line-height:1.4;resize:vertical;outline:none}.compose-textarea.svelte-46pmgb:focus{border-color:var(--accent-color);box-shadow:0 0 0 2px rgba(0, 123, 255, 0.25)}@media(max-width: 1280px){.compose-view.svelte-46pmgb{left:60px}}@media(max-width: 640px){.compose-view.svelte-46pmgb{left:160px}.compose-header.svelte-46pmgb{flex-wrap:wrap}.compose-btn.svelte-46pmgb{flex:1;min-width:calc(50% - 0.5em)}} +.recovery-tab.svelte-1e1mff9.svelte-1e1mff9{width:100%;max-width:1200px;margin:0;padding:20px;background:var(--header-bg);color:var(--text-color);border-radius:8px;box-sizing:border-box}.recovery-tab.svelte-1e1mff9 h3.svelte-1e1mff9{margin:0 0 0.5rem 0;color:var(--text-color);font-size:1.5rem;font-weight:600}.recovery-tab.svelte-1e1mff9 p.svelte-1e1mff9{margin:0 0 1.5rem 0;color:var(--text-color);opacity:0.8;line-height:1.4}.recovery-controls-card.svelte-1e1mff9.svelte-1e1mff9{background-color:var(--card-bg);border-radius:0.5em;padding:1em;margin-bottom:1.5rem}.recovery-controls.svelte-1e1mff9.svelte-1e1mff9{display:flex;flex-direction:column;gap:1em}.kind-selector.svelte-1e1mff9.svelte-1e1mff9,.custom-kind-input.svelte-1e1mff9.svelte-1e1mff9{display:flex;flex-direction:column;gap:0.5em}.kind-selector.svelte-1e1mff9 label.svelte-1e1mff9,.custom-kind-input.svelte-1e1mff9 label.svelte-1e1mff9{font-weight:600;color:var(--text-color)}.kind-selector.svelte-1e1mff9 select.svelte-1e1mff9,.custom-kind-input.svelte-1e1mff9 input.svelte-1e1mff9{padding:0.5em;border:1px solid var(--border-color);border-radius:4px;background:var(--input-bg);color:var(--input-text-color);font-size:0.9em}.recovery-results.svelte-1e1mff9.svelte-1e1mff9{margin-top:1.5rem}.loading.svelte-1e1mff9.svelte-1e1mff9,.no-events.svelte-1e1mff9.svelte-1e1mff9{text-align:center;padding:2em;color:var(--text-color);opacity:0.7}.events-list.svelte-1e1mff9.svelte-1e1mff9{display:flex;flex-direction:column;gap:1em}.event-item.svelte-1e1mff9.svelte-1e1mff9{background:var(--card-bg);border:1px solid var(--border-color);border-radius:8px;padding:1em}.event-item.old-version.svelte-1e1mff9.svelte-1e1mff9{border-color:var(--warning);background:var(--warning-bg)}.event-header.svelte-1e1mff9.svelte-1e1mff9{display:flex;justify-content:space-between;align-items:center;margin-bottom:1em;flex-wrap:wrap;gap:1em}.event-header-left.svelte-1e1mff9.svelte-1e1mff9{display:flex;flex-direction:column;gap:0.25em}.event-kind.svelte-1e1mff9.svelte-1e1mff9{font-weight:600;color:var(--primary)}.event-timestamp.svelte-1e1mff9.svelte-1e1mff9{font-size:0.9em;color:var(--text-color);opacity:0.7}.event-header-actions.svelte-1e1mff9.svelte-1e1mff9{display:flex;gap:0.5em;flex-wrap:wrap}.repost-all-button.svelte-1e1mff9.svelte-1e1mff9,.repost-button.svelte-1e1mff9.svelte-1e1mff9,.copy-json-btn.svelte-1e1mff9.svelte-1e1mff9{background:var(--accent-color);color:var(--accent-hover-color);border:none;padding:0.5em;border-radius:0.5em;cursor:pointer;font-size:0.8em;transition:background-color 0.2s}.repost-all-button.svelte-1e1mff9.svelte-1e1mff9:hover,.repost-button.svelte-1e1mff9.svelte-1e1mff9:hover,.copy-json-btn.svelte-1e1mff9.svelte-1e1mff9:hover{background:var(--accent-hover-color)}.event-content.svelte-1e1mff9.svelte-1e1mff9{margin-top:1em}.event-json.svelte-1e1mff9.svelte-1e1mff9{background:var(--code-bg);padding:1em;border:0;font-size:0.8em;line-height:1.4;overflow-x:auto;margin:0;color:var(--code-text)}.load-more.svelte-1e1mff9.svelte-1e1mff9{width:100%;padding:12px;background:var(--primary);color:var(--text-color);border:none;border-radius:4px;cursor:pointer;font-size:1em;margin-top:20px;transition:background 0.2s ease}.load-more.svelte-1e1mff9.svelte-1e1mff9:hover:not(:disabled){background:var(--accent-hover-color)}.load-more.svelte-1e1mff9.svelte-1e1mff9:disabled{opacity:0.6;cursor:not-allowed} +.sprocket-view.svelte-fiaj1r.svelte-fiaj1r{width:100%;max-width:1200px;margin:0;padding:20px;background:var(--header-bg);color:var(--text-color);border-radius:8px}.sprocket-view.svelte-fiaj1r h2.svelte-fiaj1r{margin:0 0 1.5rem 0;color:var(--text-color);font-size:1.8rem;font-weight:600}.sprocket-section.svelte-fiaj1r.svelte-fiaj1r{background-color:var(--card-bg);border-radius:8px;padding:1em;margin-bottom:1.5rem;border:1px solid var(--border-color);width:32em}.sprocket-header.svelte-fiaj1r.svelte-fiaj1r{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.sprocket-header.svelte-fiaj1r h3.svelte-fiaj1r{margin:0;color:var(--text-color);font-size:1.2rem;font-weight:600}.sprocket-controls.svelte-fiaj1r.svelte-fiaj1r{display:flex;gap:0.5rem}.sprocket-btn.svelte-fiaj1r.svelte-fiaj1r{background:var(--primary);color:var(--text-color);border:none;padding:0.5em 1em;border-radius:4px;cursor:pointer;font-size:0.9em;transition:background-color 0.2s;display:flex;align-items:center;gap:0.25em}.sprocket-btn.svelte-fiaj1r.svelte-fiaj1r:hover:not(:disabled){background:var(--accent-hover-color)}.sprocket-btn.svelte-fiaj1r.svelte-fiaj1r:disabled{background:var(--secondary);cursor:not-allowed}.restart-btn.svelte-fiaj1r.svelte-fiaj1r{background:var(--warning)}.restart-btn.svelte-fiaj1r.svelte-fiaj1r:hover:not(:disabled){background:var(--warning);filter:brightness(0.9)}.delete-btn.svelte-fiaj1r.svelte-fiaj1r{background:var(--danger)}.delete-btn.svelte-fiaj1r.svelte-fiaj1r:hover:not(:disabled){background:var(--danger);filter:brightness(0.9)}.sprocket-upload-section.svelte-fiaj1r.svelte-fiaj1r{margin-bottom:1.5rem}.sprocket-upload-section.svelte-fiaj1r h4.svelte-fiaj1r{margin:0 0 0.5rem 0;color:var(--text-color);font-size:1rem;font-weight:600}.upload-controls.svelte-fiaj1r.svelte-fiaj1r{display:flex;flex-direction:column;gap:0.5rem}#sprocket-upload-file.svelte-fiaj1r.svelte-fiaj1r{padding:0.5em;border:1px solid var(--border-color);border-radius:4px;background:var(--input-bg);color:var(--input-text-color)}.upload-btn.svelte-fiaj1r.svelte-fiaj1r{background:var(--success);align-self:flex-start}.upload-btn.svelte-fiaj1r.svelte-fiaj1r:hover:not(:disabled){background:var(--success);filter:brightness(0.9)}.sprocket-status.svelte-fiaj1r.svelte-fiaj1r{display:flex;flex-direction:column;gap:0.5rem;margin-bottom:1.5rem;padding:1rem;background:var(--bg-color);border-radius:4px;border:1px solid var(--border-color)}.status-item.svelte-fiaj1r.svelte-fiaj1r{display:flex;justify-content:space-between;align-items:center}.status-label.svelte-fiaj1r.svelte-fiaj1r{font-weight:600;color:var(--text-color)}.status-value.svelte-fiaj1r.svelte-fiaj1r{color:var(--text-color)}.status-value.running.svelte-fiaj1r.svelte-fiaj1r{color:var(--success)}.script-editor-container.svelte-fiaj1r.svelte-fiaj1r{margin-bottom:1.5rem}.script-editor.svelte-fiaj1r.svelte-fiaj1r{width:100%;height:300px;padding:1em;border:1px solid var(--border-color);border-radius:4px;background:var(--input-bg);color:var(--input-text-color);font-family:monospace;font-size:0.9em;line-height:1.4;resize:vertical}.script-editor.svelte-fiaj1r.svelte-fiaj1r:disabled{opacity:0.6;cursor:not-allowed}.script-actions.svelte-fiaj1r.svelte-fiaj1r{display:flex;gap:0.5rem;margin-bottom:1rem}.save-btn.svelte-fiaj1r.svelte-fiaj1r{background:var(--success)}.save-btn.svelte-fiaj1r.svelte-fiaj1r:hover:not(:disabled){background:var(--success);filter:brightness(0.9)}.load-btn.svelte-fiaj1r.svelte-fiaj1r{background:var(--info)}.load-btn.svelte-fiaj1r.svelte-fiaj1r:hover:not(:disabled){background:var(--info);filter:brightness(0.9)}.sprocket-message.svelte-fiaj1r.svelte-fiaj1r{padding:1rem;border-radius:4px;margin-top:1rem;background:var(--success-bg);color:var(--success-text);border:1px solid var(--success)}.sprocket-message.error.svelte-fiaj1r.svelte-fiaj1r{background:var(--danger-bg);color:var(--danger-text);border:1px solid var(--danger)}.versions-list.svelte-fiaj1r.svelte-fiaj1r{display:flex;flex-direction:column;gap:0.5rem;margin-bottom:1rem}.version-item.svelte-fiaj1r.svelte-fiaj1r{display:flex;justify-content:space-between;align-items:center;padding:0.75rem;background:var(--bg-color);border:1px solid var(--border-color);border-radius:4px}.version-item.current.svelte-fiaj1r.svelte-fiaj1r{border-color:var(--primary);background:var(--primary-bg)}.version-info.svelte-fiaj1r.svelte-fiaj1r{flex:1}.version-name.svelte-fiaj1r.svelte-fiaj1r{font-weight:600;color:var(--text-color);margin-bottom:0.25rem}.version-date.svelte-fiaj1r.svelte-fiaj1r{font-size:0.8em;color:var(--text-color);opacity:0.7;display:flex;align-items:center;gap:0.5rem}.current-badge.svelte-fiaj1r.svelte-fiaj1r{background:var(--primary);color:var(--text-color);padding:0.1em 0.4em;border-radius:0.25rem;font-size:0.7em;font-weight:600}.version-actions.svelte-fiaj1r.svelte-fiaj1r{display:flex;gap:0.25rem}.version-btn.svelte-fiaj1r.svelte-fiaj1r{background:var(--primary);color:var(--text-color);border:none;padding:0.25em 0.5em;border-radius:0.25rem;cursor:pointer;font-size:0.8em;transition:background-color 0.2s}.version-btn.svelte-fiaj1r.svelte-fiaj1r:hover:not(:disabled){background:var(--accent-hover-color)}.version-btn.svelte-fiaj1r.svelte-fiaj1r:disabled{background:var(--secondary);cursor:not-allowed}.version-btn.delete-btn.svelte-fiaj1r.svelte-fiaj1r{background:var(--danger)}.version-btn.delete-btn.svelte-fiaj1r.svelte-fiaj1r:hover:not(:disabled){background:var(--danger);filter:brightness(0.9)}.refresh-btn.svelte-fiaj1r.svelte-fiaj1r{background:var(--info)}.refresh-btn.svelte-fiaj1r.svelte-fiaj1r:hover:not(:disabled){background:var(--info);filter:brightness(0.9)}.permission-denied.svelte-fiaj1r.svelte-fiaj1r,.login-prompt.svelte-fiaj1r.svelte-fiaj1r{text-align:center;padding:2em;background-color:var(--card-bg);border-radius:8px;border:1px solid var(--border-color);color:var(--text-color)}.permission-denied.svelte-fiaj1r p.svelte-fiaj1r,.login-prompt.svelte-fiaj1r p.svelte-fiaj1r{margin:0 0 1rem 0;line-height:1.4}.permission-denied.svelte-fiaj1r code.svelte-fiaj1r{background:var(--code-bg);padding:0.2em 0.4em;border-radius:0.25rem;font-family:monospace;font-size:0.9em}.login-btn.svelte-fiaj1r.svelte-fiaj1r{background:var(--primary);color:var(--text-color);border:none;padding:0.75em 1.5em;border-radius:4px;cursor:pointer;font-weight:bold;font-size:0.9em;transition:background-color 0.2s}.login-btn.svelte-fiaj1r.svelte-fiaj1r:hover{background:var(--accent-hover-color)} +.policy-view.svelte-gkxvxc.svelte-gkxvxc{width:100%;max-width:1200px;margin:0;padding:20px;background:var(--header-bg);color:var(--text-color);border-radius:8px;box-sizing:border-box}.policy-view.svelte-gkxvxc h2.svelte-gkxvxc{margin:0 0 1.5rem 0;color:var(--text-color);font-size:1.8rem;font-weight:600}.policy-section.svelte-gkxvxc.svelte-gkxvxc{background-color:var(--card-bg);border-radius:8px;padding:1.5em;margin-bottom:1.5rem;border:1px solid var(--border-color)}.policy-header.svelte-gkxvxc.svelte-gkxvxc{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.policy-header.svelte-gkxvxc h3.svelte-gkxvxc{margin:0;color:var(--text-color);font-size:1.2rem;font-weight:600}.policy-status.svelte-gkxvxc.svelte-gkxvxc{display:flex;gap:0.5rem}.status-badge.svelte-gkxvxc.svelte-gkxvxc{padding:0.25em 0.75em;border-radius:1rem;font-size:0.8em;font-weight:600;background:var(--danger);color:white}.status-badge.enabled.svelte-gkxvxc.svelte-gkxvxc{background:var(--success)}.admin-badge.svelte-gkxvxc.svelte-gkxvxc{padding:0.25em 0.75em;border-radius:1rem;font-size:0.8em;font-weight:600;background:var(--primary);color:white}.policy-info.svelte-gkxvxc.svelte-gkxvxc{margin-bottom:1rem;padding:1rem;background:var(--bg-color);border-radius:4px;border:1px solid var(--border-color)}.policy-info.svelte-gkxvxc p.svelte-gkxvxc{margin:0 0 0.5rem 0;line-height:1.5}.policy-info.svelte-gkxvxc p.svelte-gkxvxc:last-child{margin-bottom:0}.info-note.svelte-gkxvxc.svelte-gkxvxc{font-size:0.9em;opacity:0.8}.editor-container.svelte-gkxvxc.svelte-gkxvxc{margin-bottom:1rem}.policy-editor.svelte-gkxvxc.svelte-gkxvxc{width:100%;height:400px;padding:1em;border:1px solid var(--border-color);border-radius:4px;background:var(--input-bg);color:var(--input-text-color);font-family:'Monaco', 'Menlo', 'Ubuntu Mono', monospace;font-size:0.85em;line-height:1.5;resize:vertical;tab-size:2}.policy-editor.svelte-gkxvxc.svelte-gkxvxc:disabled{opacity:0.6;cursor:not-allowed}.validation-errors.svelte-gkxvxc.svelte-gkxvxc{margin-bottom:1rem;padding:1rem;background:var(--danger-bg, rgba(220, 53, 69, 0.1));border:1px solid var(--danger);border-radius:4px}.validation-errors.svelte-gkxvxc h4.svelte-gkxvxc{margin:0 0 0.5rem 0;color:var(--danger);font-size:1rem}.validation-errors.svelte-gkxvxc ul.svelte-gkxvxc{margin:0;padding-left:1.5rem}.validation-errors.svelte-gkxvxc li.svelte-gkxvxc{color:var(--danger);margin-bottom:0.25rem}.policy-actions.svelte-gkxvxc.svelte-gkxvxc{display:flex;gap:0.5rem;flex-wrap:wrap}.policy-btn.svelte-gkxvxc.svelte-gkxvxc{background:var(--primary);color:white;border:none;padding:0.5em 1em;border-radius:4px;cursor:pointer;font-size:0.9em;transition:background-color 0.2s, filter 0.2s;display:flex;align-items:center;gap:0.25em}.policy-btn.svelte-gkxvxc.svelte-gkxvxc:hover:not(:disabled){filter:brightness(1.1)}.policy-btn.svelte-gkxvxc.svelte-gkxvxc:disabled{background:var(--secondary);cursor:not-allowed}.load-btn.svelte-gkxvxc.svelte-gkxvxc{background:var(--info)}.format-btn.svelte-gkxvxc.svelte-gkxvxc{background:var(--secondary)}.validate-btn.svelte-gkxvxc.svelte-gkxvxc{background:var(--warning)}.save-btn.svelte-gkxvxc.svelte-gkxvxc{background:var(--success)}.policy-message.svelte-gkxvxc.svelte-gkxvxc{padding:1rem;border-radius:4px;margin-top:1rem;background:var(--info-bg, rgba(23, 162, 184, 0.1));color:var(--info-text, var(--text-color));border:1px solid var(--info)}.policy-message.error.svelte-gkxvxc.svelte-gkxvxc{background:var(--danger-bg, rgba(220, 53, 69, 0.1));color:var(--danger-text, var(--danger));border:1px solid var(--danger)}.policy-message.success.svelte-gkxvxc.svelte-gkxvxc{background:var(--success-bg, rgba(40, 167, 69, 0.1));color:var(--success-text, var(--success));border:1px solid var(--success)}.reference-content.svelte-gkxvxc h4.svelte-gkxvxc{margin:1rem 0 0.5rem 0;color:var(--text-color);font-size:1rem}.reference-content.svelte-gkxvxc h4.svelte-gkxvxc:first-child{margin-top:0}.field-list.svelte-gkxvxc.svelte-gkxvxc{margin:0 0 1rem 0;padding-left:1.5rem}.field-list.svelte-gkxvxc li.svelte-gkxvxc{margin-bottom:0.25rem;line-height:1.5}.field-list.svelte-gkxvxc code.svelte-gkxvxc{background:var(--code-bg, rgba(0, 0, 0, 0.1));padding:0.1em 0.4em;border-radius:3px;font-family:'Monaco', 'Menlo', 'Ubuntu Mono', monospace;font-size:0.9em}.example-json.svelte-gkxvxc.svelte-gkxvxc{background:var(--input-bg);color:var(--input-text-color);padding:1rem;border-radius:4px;border:1px solid var(--border-color);font-family:'Monaco', 'Menlo', 'Ubuntu Mono', monospace;font-size:0.8em;line-height:1.4;overflow-x:auto;white-space:pre;margin:0}.permission-denied.svelte-gkxvxc.svelte-gkxvxc,.login-prompt.svelte-gkxvxc.svelte-gkxvxc{text-align:center;padding:2em;background-color:var(--card-bg);border-radius:8px;border:1px solid var(--border-color);color:var(--text-color)}.permission-denied.svelte-gkxvxc p.svelte-gkxvxc,.login-prompt.svelte-gkxvxc p.svelte-gkxvxc{margin:0 0 1rem 0;line-height:1.4}.permission-denied.svelte-gkxvxc code.svelte-gkxvxc{background:var(--code-bg, rgba(0, 0, 0, 0.1));padding:0.2em 0.4em;border-radius:0.25rem;font-family:monospace;font-size:0.9em}.login-btn.svelte-gkxvxc.svelte-gkxvxc{background:var(--primary);color:white;border:none;padding:0.75em 1.5em;border-radius:4px;cursor:pointer;font-weight:bold;font-size:0.9em;transition:background-color 0.2s}.login-btn.svelte-gkxvxc.svelte-gkxvxc:hover{filter:brightness(1.1)}.admin-list.svelte-gkxvxc.svelte-gkxvxc{margin-bottom:1rem}.admin-item.svelte-gkxvxc.svelte-gkxvxc{display:flex;justify-content:space-between;align-items:center;padding:0.5em 0.75em;background:var(--bg-color);border:1px solid var(--border-color);border-radius:4px;margin-bottom:0.5rem}.admin-pubkey.svelte-gkxvxc.svelte-gkxvxc{font-family:'Monaco', 'Menlo', 'Ubuntu Mono', monospace;font-size:0.85em;color:var(--text-color)}.remove-btn.svelte-gkxvxc.svelte-gkxvxc{background:var(--danger);color:white;border:none;width:24px;height:24px;border-radius:50%;cursor:pointer;font-size:0.8em;display:flex;align-items:center;justify-content:center;transition:filter 0.2s}.remove-btn.svelte-gkxvxc.svelte-gkxvxc:hover:not(:disabled){filter:brightness(0.9)}.remove-btn.svelte-gkxvxc.svelte-gkxvxc:disabled{opacity:0.5;cursor:not-allowed}.add-admin.svelte-gkxvxc.svelte-gkxvxc{display:flex;gap:0.5rem}.add-admin.svelte-gkxvxc input.svelte-gkxvxc{flex:1;padding:0.5em 0.75em;border:1px solid var(--border-color);border-radius:4px;background:var(--input-bg);color:var(--input-text-color);font-family:'Monaco', 'Menlo', 'Ubuntu Mono', monospace;font-size:0.85em}.add-btn.svelte-gkxvxc.svelte-gkxvxc{background:var(--success);white-space:nowrap}.no-items.svelte-gkxvxc.svelte-gkxvxc{color:var(--text-color);opacity:0.6;font-style:italic;padding:1rem;text-align:center}.follows-header.svelte-gkxvxc.svelte-gkxvxc{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.follows-count.svelte-gkxvxc.svelte-gkxvxc{font-weight:600;color:var(--text-color)}.refresh-btn.svelte-gkxvxc.svelte-gkxvxc{background:var(--info)}.follows-list.svelte-gkxvxc.svelte-gkxvxc{max-height:300px;overflow-y:auto;border:1px solid var(--border-color);border-radius:4px;background:var(--bg-color)}.follows-grid.svelte-gkxvxc.svelte-gkxvxc{display:grid;grid-template-columns:repeat(auto-fill, minmax(200px, 1fr));gap:0.5rem;padding:0.75rem}.follow-item.svelte-gkxvxc.svelte-gkxvxc{padding:0.4em 0.6em;background:var(--card-bg);border:1px solid var(--border-color);border-radius:4px;font-family:'Monaco', 'Menlo', 'Ubuntu Mono', monospace;font-size:0.75em;color:var(--text-color);text-overflow:ellipsis;overflow:hidden;white-space:nowrap} +.blossom-view.svelte-bz95vx.svelte-bz95vx{padding:1em;max-width:900px}.header-section.svelte-bz95vx.svelte-bz95vx{display:flex;justify-content:space-between;align-items:center;margin-bottom:1em}.header-section.svelte-bz95vx h3.svelte-bz95vx{margin:0;color:var(--text-color);flex:1}.header-buttons.svelte-bz95vx.svelte-bz95vx{display:flex;align-items:center;gap:0.5em}.back-btn.svelte-bz95vx.svelte-bz95vx{background:transparent;border:1px solid var(--border-color);color:var(--text-color);padding:0.5em 1em;border-radius:4px;cursor:pointer;font-size:0.9em;margin-right:0.5em}.back-btn.svelte-bz95vx.svelte-bz95vx:hover{background-color:var(--sidebar-bg)}.admin-btn.svelte-bz95vx.svelte-bz95vx{background-color:var(--primary);color:var(--text-color);border:none;padding:0.5em 1em;border-radius:4px;cursor:pointer;font-size:0.9em}.admin-btn.svelte-bz95vx.svelte-bz95vx:hover:not(:disabled){background-color:var(--accent-hover-color)}.admin-btn.svelte-bz95vx.svelte-bz95vx:disabled{opacity:0.6;cursor:not-allowed}.user-header.svelte-bz95vx.svelte-bz95vx{display:flex;align-items:center;gap:0.5em}.header-avatar.svelte-bz95vx.svelte-bz95vx{width:28px;height:28px;border-radius:50%;object-fit:cover}.refresh-btn.svelte-bz95vx.svelte-bz95vx{background-color:var(--primary);color:var(--text-color);border:none;padding:0.5em 1em;border-radius:4px;cursor:pointer;font-size:0.9em}.refresh-btn.svelte-bz95vx.svelte-bz95vx:hover:not(:disabled){background-color:var(--accent-hover-color)}.refresh-btn.svelte-bz95vx.svelte-bz95vx:disabled{opacity:0.6;cursor:not-allowed}.upload-section.svelte-bz95vx.svelte-bz95vx{display:flex;align-items:center;gap:0.75em;padding:0.75em 1em;background-color:var(--card-bg);border-radius:6px;margin-bottom:1em;flex-wrap:wrap}.file-input-hidden.svelte-bz95vx.svelte-bz95vx{display:none}.select-btn.svelte-bz95vx.svelte-bz95vx{background-color:var(--primary);color:var(--text-color);border:none;padding:0.5em 1em;border-radius:4px;cursor:pointer;font-size:0.9em}.select-btn.svelte-bz95vx.svelte-bz95vx:hover:not(:disabled){background-color:var(--accent-hover-color)}.select-btn.svelte-bz95vx.svelte-bz95vx:disabled{opacity:0.6;cursor:not-allowed}.selected-count.svelte-bz95vx.svelte-bz95vx{color:var(--text-color);font-size:0.9em}.upload-btn.svelte-bz95vx.svelte-bz95vx{background-color:var(--success, #28a745);color:white;border:none;padding:0.5em 1em;border-radius:4px;cursor:pointer;font-size:0.9em;font-weight:bold}.upload-btn.svelte-bz95vx.svelte-bz95vx:hover:not(:disabled){opacity:0.9}.upload-btn.svelte-bz95vx.svelte-bz95vx:disabled{opacity:0.7;cursor:not-allowed}.error-message.svelte-bz95vx.svelte-bz95vx{background-color:var(--warning);color:var(--text-color);padding:0.75em 1em;border-radius:4px;margin-bottom:1em}.loading.svelte-bz95vx.svelte-bz95vx,.empty-state.svelte-bz95vx.svelte-bz95vx{text-align:center;padding:2em;color:var(--text-color);opacity:0.7}.blob-list.svelte-bz95vx.svelte-bz95vx{display:flex;flex-direction:column;gap:0.5em}.blob-item.svelte-bz95vx.svelte-bz95vx{display:flex;align-items:center;gap:1em;padding:0.75em 1em;background-color:var(--card-bg);border-radius:6px;cursor:pointer;transition:background-color 0.2s}.blob-item.svelte-bz95vx.svelte-bz95vx:hover{background-color:var(--sidebar-bg)}.blob-icon.svelte-bz95vx.svelte-bz95vx{font-size:1.5em;width:2em;text-align:center}.blob-info.svelte-bz95vx.svelte-bz95vx{flex:1;min-width:0}.blob-hash.svelte-bz95vx.svelte-bz95vx{font-family:monospace;font-size:0.9em;color:var(--text-color)}.blob-meta.svelte-bz95vx.svelte-bz95vx{display:flex;gap:1em;font-size:0.8em;color:var(--text-color);opacity:0.7;margin-top:0.25em}.blob-date.svelte-bz95vx.svelte-bz95vx{font-size:0.85em;color:var(--text-color);opacity:0.6;white-space:nowrap}.delete-btn.svelte-bz95vx.svelte-bz95vx{background:transparent;border:1px solid var(--warning);color:var(--warning);width:1.75em;height:1.75em;border-radius:4px;cursor:pointer;font-size:0.85em;display:flex;align-items:center;justify-content:center}.delete-btn.svelte-bz95vx.svelte-bz95vx:hover{background-color:var(--warning);color:var(--text-color)}.admin-users-list.svelte-bz95vx.svelte-bz95vx{display:flex;flex-direction:column;gap:0.5em}.user-stat-item.svelte-bz95vx.svelte-bz95vx{display:flex;align-items:center;gap:1em;padding:0.75em 1em;background-color:var(--card-bg);border-radius:6px;cursor:pointer;transition:background-color 0.2s}.user-stat-item.svelte-bz95vx.svelte-bz95vx:hover{background-color:var(--sidebar-bg)}.user-avatar-container.svelte-bz95vx.svelte-bz95vx{flex-shrink:0}.user-avatar.svelte-bz95vx.svelte-bz95vx{width:40px;height:40px;border-radius:50%;object-fit:cover}.user-avatar-placeholder.svelte-bz95vx.svelte-bz95vx{width:40px;height:40px;border-radius:50%;background-color:var(--border-color)}.user-info.svelte-bz95vx.svelte-bz95vx{flex:1;min-width:0}.user-name.svelte-bz95vx.svelte-bz95vx{font-weight:500;color:var(--text-color)}.user-npub.svelte-bz95vx.svelte-bz95vx{font-family:monospace;font-size:0.8em;color:var(--text-color);opacity:0.6;overflow:hidden;text-overflow:ellipsis}.user-stats.svelte-bz95vx.svelte-bz95vx{display:flex;flex-direction:column;align-items:flex-end;gap:0.25em}.user-stats.svelte-bz95vx .blob-count.svelte-bz95vx,.user-stats.svelte-bz95vx .total-size.svelte-bz95vx{font-size:0.85em;color:var(--text-color);opacity:0.7}.login-prompt.svelte-bz95vx.svelte-bz95vx{text-align:center;padding:2em;background-color:var(--card-bg);border-radius:8px;border:1px solid var(--border-color);max-width:32em;margin:1em}.login-prompt.svelte-bz95vx p.svelte-bz95vx{margin:0 0 1.5rem 0;color:var(--text-color);font-size:1.1rem}.login-btn.svelte-bz95vx.svelte-bz95vx{background-color:var(--primary);color:var(--text-color);border:none;padding:0.75em 1.5em;border-radius:4px;cursor:pointer;font-weight:bold;font-size:0.9em}.login-btn.svelte-bz95vx.svelte-bz95vx:hover{background-color:var(--accent-hover-color)}.modal-overlay.svelte-bz95vx.svelte-bz95vx{position:fixed;top:0;left:0;right:0;bottom:0;background-color:rgba(0, 0, 0, 0.8);display:flex;align-items:center;justify-content:center;z-index:1000}.modal-content.svelte-bz95vx.svelte-bz95vx{background-color:var(--bg-color);border-radius:8px;max-width:90vw;max-height:90vh;display:flex;flex-direction:column;overflow:hidden}.modal-header.svelte-bz95vx.svelte-bz95vx{display:flex;justify-content:space-between;align-items:center;padding:0.75em 1em;border-bottom:1px solid var(--border-color);background-color:var(--card-bg)}.modal-title.svelte-bz95vx.svelte-bz95vx{display:flex;align-items:center;gap:1em}.modal-hash.svelte-bz95vx.svelte-bz95vx{font-family:monospace;color:var(--text-color)}.modal-type.svelte-bz95vx.svelte-bz95vx{font-size:0.85em;color:var(--text-color);opacity:0.7}.modal-controls.svelte-bz95vx.svelte-bz95vx{display:flex;align-items:center;gap:0.5em}.zoom-btn.svelte-bz95vx.svelte-bz95vx{background-color:var(--primary);color:var(--text-color);border:none;width:2em;height:2em;border-radius:4px;cursor:pointer;font-size:1em;font-weight:bold}.zoom-btn.svelte-bz95vx.svelte-bz95vx:hover:not(:disabled){background-color:var(--accent-hover-color)}.zoom-btn.svelte-bz95vx.svelte-bz95vx:disabled{opacity:0.5;cursor:not-allowed}.zoom-level.svelte-bz95vx.svelte-bz95vx{font-size:0.85em;color:var(--text-color);min-width:3em;text-align:center}.close-btn.svelte-bz95vx.svelte-bz95vx{background:transparent;border:1px solid var(--border-color);color:var(--text-color);width:2em;height:2em;border-radius:4px;cursor:pointer;font-size:1em;margin-left:0.5em}.close-btn.svelte-bz95vx.svelte-bz95vx:hover{background-color:var(--warning);border-color:var(--warning)}.modal-body.svelte-bz95vx.svelte-bz95vx{flex:1;overflow:auto;display:flex;align-items:center;justify-content:center;padding:1em;min-height:200px}.media-container.svelte-bz95vx.svelte-bz95vx{transition:transform 0.2s ease;transform-origin:center center}.media-container.svelte-bz95vx img.svelte-bz95vx{max-width:80vw;max-height:70vh;object-fit:contain}.media-container.svelte-bz95vx video.svelte-bz95vx{max-width:80vw;max-height:70vh}.media-container.audio.svelte-bz95vx.svelte-bz95vx{width:100%;padding:2em}.media-container.svelte-bz95vx audio.svelte-bz95vx{width:100%}.file-preview.svelte-bz95vx.svelte-bz95vx{text-align:center;padding:2em;color:var(--text-color)}.file-icon.svelte-bz95vx.svelte-bz95vx{font-size:4em;margin-bottom:0.5em}.download-link.svelte-bz95vx.svelte-bz95vx{display:inline-block;margin-top:1em;padding:0.75em 1.5em;background-color:var(--primary);color:var(--text-color);text-decoration:none;border-radius:4px}.download-link.svelte-bz95vx.svelte-bz95vx:hover{background-color:var(--accent-hover-color)}.modal-footer.svelte-bz95vx.svelte-bz95vx{display:flex;flex-direction:column;gap:0.5em;padding:0.75em 1em;border-top:1px solid var(--border-color);background-color:var(--card-bg)}.blob-details.svelte-bz95vx.svelte-bz95vx{display:flex;gap:1.5em;font-size:0.85em;color:var(--text-color);opacity:0.7}.blob-url-section.svelte-bz95vx.svelte-bz95vx{display:flex;gap:0.5em;width:100%}.blob-url-input.svelte-bz95vx.svelte-bz95vx{flex:1;padding:0.4em 0.6em;font-family:monospace;font-size:0.85em;background-color:var(--bg-color);color:var(--text-color);border:1px solid var(--border-color);border-radius:4px;cursor:text}.blob-url-input.svelte-bz95vx.svelte-bz95vx:focus{outline:none;border-color:var(--primary)}.copy-btn.svelte-bz95vx.svelte-bz95vx{padding:0.4em 0.8em;background-color:var(--primary);color:var(--text-color);border:none;border-radius:4px;cursor:pointer;font-size:0.85em}.copy-btn.svelte-bz95vx.svelte-bz95vx:hover{background-color:var(--accent-hover-color)}.modal-actions.svelte-bz95vx.svelte-bz95vx{display:flex;gap:0.5em}.action-btn.svelte-bz95vx.svelte-bz95vx{padding:0.5em 1em;background-color:var(--primary);color:var(--text-color);border:none;border-radius:4px;cursor:pointer;text-decoration:none;font-size:0.9em}.action-btn.svelte-bz95vx.svelte-bz95vx:hover{background-color:var(--accent-hover-color)}.action-btn.danger.svelte-bz95vx.svelte-bz95vx{background-color:transparent;border:1px solid var(--warning);color:var(--warning)}.action-btn.danger.svelte-bz95vx.svelte-bz95vx:hover{background-color:var(--warning);color:var(--text-color)}@media(max-width: 600px){.blob-item.svelte-bz95vx.svelte-bz95vx{flex-wrap:wrap}.blob-date.svelte-bz95vx.svelte-bz95vx{width:100%;margin-top:0.5em;padding-left:3em}.modal-footer.svelte-bz95vx.svelte-bz95vx{flex-direction:column;gap:0.75em}.blob-details.svelte-bz95vx.svelte-bz95vx{flex-direction:column;gap:0.25em}} +.search-results-view.svelte-porghq.svelte-porghq{width:100%;height:100%;display:flex;flex-direction:column}.search-results-header.svelte-porghq.svelte-porghq{display:flex;justify-content:space-between;align-items:center;padding:1em;border-bottom:1px solid var(--border-color);background:var(--header-bg)}.search-results-header.svelte-porghq h2.svelte-porghq{margin:0;color:var(--text-color);font-size:1.2rem;font-weight:600}.refresh-btn.svelte-porghq.svelte-porghq{background:var(--primary);color:var(--text-color);border:none;padding:0.5em 1em;border-radius:4px;cursor:pointer;font-size:0.9em;transition:background-color 0.2s}.refresh-btn.svelte-porghq.svelte-porghq:hover:not(:disabled){background:var(--accent-hover-color)}.refresh-btn.svelte-porghq.svelte-porghq:disabled{background:var(--secondary);cursor:not-allowed}.search-results-content.svelte-porghq.svelte-porghq{flex:1;overflow-y:auto;padding:1em}.search-result-item.svelte-porghq.svelte-porghq{border:1px solid var(--border-color);border-radius:8px;margin-bottom:0.5em;background:var(--card-bg);transition:all 0.2s ease}.search-result-item.svelte-porghq.svelte-porghq:hover{border-color:var(--primary);box-shadow:0 2px 8px rgba(0, 0, 0, 0.1)}.search-result-item.expanded.svelte-porghq.svelte-porghq{border-color:var(--primary);box-shadow:0 4px 12px rgba(0, 0, 0, 0.15)}.search-result-row.svelte-porghq.svelte-porghq{display:flex;align-items:center;padding:1em;cursor:pointer;gap:1em}.search-result-avatar.svelte-porghq.svelte-porghq{flex-shrink:0}.avatar-placeholder.svelte-porghq.svelte-porghq{width:40px;height:40px;border-radius:50%;background:var(--bg-color);display:flex;align-items:center;justify-content:center;font-size:1.2em;border:1px solid var(--border-color)}.search-result-info.svelte-porghq.svelte-porghq{flex-shrink:0;min-width:120px}.search-result-author.svelte-porghq.svelte-porghq{font-weight:600;color:var(--text-color);font-size:0.9em;font-family:monospace}.search-result-kind.svelte-porghq.svelte-porghq{display:flex;align-items:center;gap:0.5em;margin-top:0.25em}.kind-number.svelte-porghq.svelte-porghq{background:var(--primary);color:var(--text-color);padding:0.1em 0.4em;border-radius:0.25rem;font-size:0.7em;font-weight:600;font-family:monospace}.kind-name.svelte-porghq.svelte-porghq{font-size:0.8em;color:var(--text-color);opacity:0.8}.search-result-content.svelte-porghq.svelte-porghq{flex:1;min-width:0}.event-timestamp.svelte-porghq.svelte-porghq{font-size:0.8em;color:var(--text-color);opacity:0.6;margin-bottom:0.5em}.event-content-single-line.svelte-porghq.svelte-porghq{color:var(--text-color);line-height:1.4;word-wrap:break-word}.delete-btn.svelte-porghq.svelte-porghq{background:var(--danger);color:var(--text-color);border:none;padding:0.5em;border-radius:4px;cursor:pointer;font-size:0.9em;flex-shrink:0;transition:background-color 0.2s}.delete-btn.svelte-porghq.svelte-porghq:hover{background:var(--danger);filter:brightness(0.9)}.search-result-details.svelte-porghq.svelte-porghq{border-top:1px solid var(--border-color);padding:1em;background:var(--bg-color)}.json-container.svelte-porghq.svelte-porghq{position:relative}.event-json.svelte-porghq.svelte-porghq{background:var(--code-bg);padding:1em;border:0;font-size:0.8em;line-height:1.4;overflow-x:auto;margin:0;color:var(--code-text)}.copy-json-btn.svelte-porghq.svelte-porghq{position:absolute;top:0.5em;right:0.5em;background:var(--primary);color:var(--text-color);border:none;padding:0.25em 0.5em;border-radius:0.25rem;cursor:pointer;font-size:0.8em;opacity:0.8;transition:opacity 0.2s}.copy-json-btn.svelte-porghq.svelte-porghq:hover{opacity:1}.no-results.svelte-porghq.svelte-porghq{text-align:center;padding:2em;color:var(--text-color);opacity:0.7}.loading-search.svelte-porghq.svelte-porghq{text-align:center;padding:2em;color:var(--text-color)}.spinner.svelte-porghq.svelte-porghq{width:20px;height:20px;border:2px solid var(--border-color);border-top:2px solid var(--primary);border-radius:50%;animation:svelte-porghq-spin 1s linear infinite;margin:0 auto 1em}@keyframes svelte-porghq-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}} +.filter-display.svelte-1tyqaa5.svelte-1tyqaa5{background:var(--card-bg);border:1px solid var(--border-color);border-radius:8px;margin:1em;overflow:hidden}.filter-display-header.svelte-1tyqaa5.svelte-1tyqaa5{display:flex;justify-content:space-between;align-items:center;padding:0.75em 1em;background:var(--bg-color);border-bottom:1px solid var(--border-color)}.filter-display-header.svelte-1tyqaa5 h3.svelte-1tyqaa5{margin:0;font-size:1em;font-weight:600;color:var(--text-color)}.sweep-btn.svelte-1tyqaa5.svelte-1tyqaa5{background:var(--danger);color:var(--text-color);border:none;padding:0.5em 1em;border-radius:4px;cursor:pointer;font-size:0.9em;font-weight:600;transition:all 0.2s}.sweep-btn.svelte-1tyqaa5.svelte-1tyqaa5:hover{filter:brightness(0.9);transform:translateY(-1px);box-shadow:0 2px 8px rgba(255, 0, 0, 0.3)}.filter-json-container.svelte-1tyqaa5.svelte-1tyqaa5{padding:1em;max-height:200px;overflow:auto}.filter-json.svelte-1tyqaa5.svelte-1tyqaa5{background:var(--code-bg);padding:1em;border-radius:4px;font-family:'Courier New', Courier, monospace;font-size:0.85em;line-height:1.5;color:var(--code-text);margin:0;white-space:pre-wrap;word-wrap:break-word;word-break:break-all;overflow-wrap:anywhere}.filter-json-container.svelte-1tyqaa5.svelte-1tyqaa5::-webkit-scrollbar{width:8px;height:8px}.filter-json-container.svelte-1tyqaa5.svelte-1tyqaa5::-webkit-scrollbar-track{background:var(--bg-color)}.filter-json-container.svelte-1tyqaa5.svelte-1tyqaa5::-webkit-scrollbar-thumb{background:var(--border-color);border-radius:4px}.filter-json-container.svelte-1tyqaa5.svelte-1tyqaa5::-webkit-scrollbar-thumb:hover{background:var(--primary)} +html,body{margin:0;padding:0;overflow:hidden;height:100%;--bg-color:#ddd;--header-bg:#eee;--sidebar-bg:#eee;--card-bg:#f8f9fa;--panel-bg:#f8f9fa;--border-color:#dee2e6;--text-color:#444444;--text-muted:#6c757d;--input-border:#ccc;--input-bg:#ffffff;--input-text-color:#495057;--button-bg:#ddd;--button-hover-bg:#eee;--button-text:#444444;--button-hover-border:#adb5bd;--primary:#00bcd4;--primary-bg:rgba(0, 188, 212, 0.1);--secondary:#6c757d;--success:#28a745;--success-bg:#d4edda;--success-text:#155724;--info:#17a2b8;--warning:#ff3e00;--warning-bg:#fff3cd;--danger:#dc3545;--danger-bg:#f8d7da;--danger-text:#721c24;--error-bg:#f8d7da;--error-text:#721c24;--code-bg:#f8f9fa;--code-text:#495057;--tab-inactive-bg:#bbb;--accent-color:#007bff;--accent-hover-color:#0056b3}body.dark-theme{--bg-color:#263238;--header-bg:#1e272c;--sidebar-bg:#1e272c;--card-bg:#37474f;--panel-bg:#37474f;--border-color:#404040;--text-color:#ffffff;--text-muted:#adb5bd;--input-border:#555;--input-bg:#37474f;--input-text-color:#ffffff;--button-bg:#263238;--button-hover-bg:#1e272c;--button-text:#ffffff;--button-hover-border:#6c757d;--primary:#00bcd4;--primary-bg:rgba(0, 188, 212, 0.2);--secondary:#6c757d;--success:#28a745;--success-bg:#1e4620;--success-text:#d4edda;--info:#17a2b8;--warning:#ff3e00;--warning-bg:#4d1f00;--danger:#dc3545;--danger-bg:#4d1319;--danger-text:#f8d7da;--error-bg:#4d1319;--error-text:#f8d7da;--code-bg:#1e272c;--code-text:#ffffff;--tab-inactive-bg:#1a1a1a;--accent-color:#007bff;--accent-hover-color:#0056b3}.login-btn.svelte-u3u5mw.svelte-u3u5mw{padding:0.5em 1em;border:none;border-radius:6px;background-color:#4caf50;color:var(--text-color);cursor:pointer;font-size:1rem;font-weight:500;transition:background-color 0.2s;display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;margin:0 auto;padding:0.5em 1em}.login-btn.svelte-u3u5mw.svelte-u3u5mw:hover{background-color:#45a049}.acl-mode-warning.svelte-u3u5mw.svelte-u3u5mw{padding:1em;background-color:#fff3cd;border:1px solid #ffeaa7;border-radius:8px;color:#856404;margin:20px 0}.acl-mode-warning.svelte-u3u5mw h3.svelte-u3u5mw{margin:0 0 15px 0;color:#856404}.acl-mode-warning.svelte-u3u5mw p.svelte-u3u5mw{margin:10px 0;line-height:1.5}.acl-mode-warning.svelte-u3u5mw code.svelte-u3u5mw{background-color:#f8f9fa;padding:2px 6px;border-radius:4px;font-family:monospace;color:#495057}.app-container.svelte-u3u5mw.svelte-u3u5mw{display:flex;margin-top:3em;height:calc(100vh - 3em)}.main-content.svelte-u3u5mw.svelte-u3u5mw{position:fixed;left:200px;top:3em;right:0;bottom:0;padding:0;overflow-y:auto;background-color:var(--bg-color);color:var(--text-color);display:flex;align-items:flex-start;justify-content:flex-start;flex-direction:column;display:flex}.welcome-message.svelte-u3u5mw.svelte-u3u5mw{text-align:center}.welcome-message.svelte-u3u5mw p.svelte-u3u5mw{font-size:1.2rem}@media(max-width: 640px){.main-content.svelte-u3u5mw.svelte-u3u5mw{left:160px;padding:1rem}}.logout-btn.svelte-u3u5mw.svelte-u3u5mw{padding:0.5rem 1rem;border:none;border-radius:6px;background-color:var(--warning);color:var(--text-color);cursor:pointer;font-size:1rem;font-weight:500;transition:background-color 0.2s;display:flex;align-items:center;justify-content:center;gap:0.5rem}.logout-btn.svelte-u3u5mw.svelte-u3u5mw:hover{background-color:#e53935}.logout-btn.floating.svelte-u3u5mw.svelte-u3u5mw{position:absolute;top:0.5em;right:0.5em;z-index:10;box-shadow:0 2px 8px rgba(0, 0, 0, 0.3)}.drawer-overlay.svelte-u3u5mw.svelte-u3u5mw{position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.5);z-index:1000;display:flex;justify-content:flex-end}.settings-drawer.svelte-u3u5mw.svelte-u3u5mw{width:640px;height:100%;background:var(--bg-color);overflow-y:auto;animation:svelte-u3u5mw-slideIn 0.3s ease}@keyframes svelte-u3u5mw-slideIn{from{transform:translateX(100%)}to{transform:translateX(0)}}.drawer-header.svelte-u3u5mw.svelte-u3u5mw{display:flex;align-items:center;justify-content:space-between;background:var(--header-bg)}.drawer-header.svelte-u3u5mw h2.svelte-u3u5mw{margin:0;color:var(--text-color);font-size:1em;padding:1rem}.close-btn.svelte-u3u5mw.svelte-u3u5mw{background:none;border:none;font-size:1em;cursor:pointer;color:var(--text-color);padding:0.5em;transition:background-color 0.2s;align-items:center}.close-btn.svelte-u3u5mw.svelte-u3u5mw:hover{background:var(--button-hover-bg)}.profile-section.svelte-u3u5mw.svelte-u3u5mw{margin-bottom:2rem}.profile-hero.svelte-u3u5mw.svelte-u3u5mw{position:relative}.profile-banner.svelte-u3u5mw.svelte-u3u5mw{width:100%;height:160px;object-fit:cover;border-radius:0;display:block}.profile-avatar.svelte-u3u5mw.svelte-u3u5mw,.profile-avatar-placeholder.svelte-u3u5mw.svelte-u3u5mw{width:72px;height:72px;border-radius:50%;object-fit:cover;flex-shrink:0;box-shadow:0 2px 8px rgba(0, 0, 0, 0.25);border:2px solid var(--bg-color)}.overlap.svelte-u3u5mw.svelte-u3u5mw{position:absolute;left:12px;bottom:-36px;z-index:2;background:var(--button-hover-bg);display:flex;align-items:center;justify-content:center;font-size:1.5rem}.name-row.svelte-u3u5mw.svelte-u3u5mw{position:absolute;left:calc(12px + 72px + 12px);bottom:8px;right:12px;display:flex;align-items:baseline;gap:8px;z-index:1;background:var(--bg-color);padding:0.2em 0.5em;border-radius:0.5em;width:fit-content}.profile-username.svelte-u3u5mw.svelte-u3u5mw{margin:0;font-size:1.1rem;color:var(--text-color)}.profile-nip05-inline.svelte-u3u5mw.svelte-u3u5mw{font-size:0.85rem;color:var(--text-color);font-family:monospace;opacity:0.95}.about-card.svelte-u3u5mw.svelte-u3u5mw{background:var(--header-bg);padding:12px 12px 12px 96px;position:relative;word-break:auto-phrase}.profile-about.svelte-u3u5mw.svelte-u3u5mw{margin:0;color:var(--text-color);font-size:0.9rem;line-height:1.4}.profile-loading-section.svelte-u3u5mw.svelte-u3u5mw{padding:1rem;text-align:center;position:relative}.profile-loading-section.svelte-u3u5mw h3.svelte-u3u5mw{margin:0 0 1rem 0;color:var(--text-color);font-size:1.1rem}.profile-loading-section.svelte-u3u5mw p.svelte-u3u5mw{margin:0 0 1rem 0;color:var(--text-color);opacity:0.8}.retry-profile-btn.svelte-u3u5mw.svelte-u3u5mw{padding:0.5rem 1rem;background:var(--primary);color:var(--text-color);border:none;border-radius:4px;cursor:pointer;font-size:0.9rem;margin-bottom:1rem;transition:background-color 0.2s}.retry-profile-btn.svelte-u3u5mw.svelte-u3u5mw:hover{background:#00acc1}.user-pubkey-display.svelte-u3u5mw.svelte-u3u5mw{font-family:monospace;font-size:0.8rem;color:var(--text-color);opacity:0.7;background:var(--button-bg);padding:0.5rem;border-radius:4px;word-break:break-all}.managed-acl-view.svelte-u3u5mw.svelte-u3u5mw{padding:20px;max-width:1200px;margin:0;background:var(--header-bg);color:var(--text-color);border-radius:8px}.refresh-btn.svelte-u3u5mw.svelte-u3u5mw{padding:0.5rem 1rem;background:var(--primary);color:var(--text-color);border:none;border-radius:4px;cursor:pointer;font-size:0.875rem;font-weight:500;transition:background-color 0.2s;display:inline-flex;align-items:center;gap:0.25rem;height:2em;margin:1em}.refresh-btn.svelte-u3u5mw.svelte-u3u5mw:hover{background:#00acc1}@keyframes svelte-u3u5mw-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.view-as-section.svelte-u3u5mw.svelte-u3u5mw{color:var(--text-color);padding:1rem;border-radius:0.5em;margin-bottom:1rem}.view-as-section.svelte-u3u5mw h3.svelte-u3u5mw{margin-top:0;margin-bottom:0.5rem;font-size:1rem;color:var(--primary)}.view-as-section.svelte-u3u5mw p.svelte-u3u5mw{margin:0.5rem 0;font-size:0.9rem;opacity:0.8}.radio-group.svelte-u3u5mw.svelte-u3u5mw{display:flex;flex-direction:column;gap:0.5rem}.radio-label.svelte-u3u5mw.svelte-u3u5mw{display:flex;align-items:center;gap:0.5rem;cursor:pointer;padding:0.25rem;border-radius:0.5em;transition:background 0.2s}.radio-label.svelte-u3u5mw.svelte-u3u5mw:hover{background:rgba(255, 255, 255, 0.1)}.radio-label.svelte-u3u5mw input.svelte-u3u5mw{margin:0}.avatar-placeholder.svelte-u3u5mw.svelte-u3u5mw{width:1.5rem;height:1.5rem;border-radius:50%;background:var(--button-bg);display:flex;align-items:center;justify-content:center;font-size:0.7rem}.kind-number.svelte-u3u5mw.svelte-u3u5mw{background:var(--primary);color:var(--text-color);padding:0.125rem 0.375rem;border-radius:0.5em;font-size:0.7rem;font-weight:500;font-family:monospace}.kind-name.svelte-u3u5mw.svelte-u3u5mw{font-size:0.75rem;color:var(--text-color);opacity:0.7;font-weight:500}.event-timestamp.svelte-u3u5mw.svelte-u3u5mw{font-size:0.75rem;color:var(--text-color);opacity:0.7;margin-bottom:0.25rem;font-weight:500}.event-content-single-line.svelte-u3u5mw.svelte-u3u5mw{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.2}.delete-btn.svelte-u3u5mw.svelte-u3u5mw{flex-shrink:0;background:none;border:none;cursor:pointer;padding:0.2rem;border-radius:0.5em;transition:background-color 0.2s;font-size:1.6rem;display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem}.delete-btn.svelte-u3u5mw.svelte-u3u5mw:hover{background:var(--warning);color:var(--text-color)}.json-container.svelte-u3u5mw.svelte-u3u5mw{position:relative}.copy-json-btn.svelte-u3u5mw.svelte-u3u5mw{color:var(--text-color);background:var(--accent-color);border:0;border-radius:0.5rem;padding:0.5rem;font-size:1rem;cursor:pointer;width:auto;height:auto;display:flex;align-items:center;justify-content:center}.copy-json-btn.svelte-u3u5mw.svelte-u3u5mw:hover{background:var(--accent-hover-color)}.event-json.svelte-u3u5mw.svelte-u3u5mw{background:var(--bg-color);padding:1rem;margin:0;font-family:"Courier New", monospace;font-size:0.8rem;line-height:1.4;color:var(--text-color);white-space:pre-wrap;word-break:break-word;overflow-x:auto}.no-events.svelte-u3u5mw.svelte-u3u5mw{padding:2rem;text-align:center;color:var(--text-color);opacity:0.7}.loading-spinner.svelte-u3u5mw.svelte-u3u5mw{width:2rem;height:2rem;border:3px solid var(--border-color);border-top:3px solid var(--primary);border-radius:50%;animation:svelte-u3u5mw-spin 1s linear infinite;margin:0 auto 1rem auto}@keyframes svelte-u3u5mw-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}.search-results-view.svelte-u3u5mw.svelte-u3u5mw{position:fixed;top:3em;left:200px;right:0;bottom:0;background:var(--bg-color);color:var(--text-color);display:flex;flex-direction:column;overflow:hidden}.search-results-header.svelte-u3u5mw.svelte-u3u5mw{padding:0.5rem 1rem;background:var(--header-bg);border-bottom:1px solid var(--border-color);flex-shrink:0;display:flex;justify-content:space-between;align-items:center;height:2.5em}.search-results-header.svelte-u3u5mw h2.svelte-u3u5mw{margin:0;font-size:1rem;font-weight:600;color:var(--text-color)}.search-results-content.svelte-u3u5mw.svelte-u3u5mw{flex:1;overflow-y:auto;padding:0}.search-result-item.svelte-u3u5mw.svelte-u3u5mw{border-bottom:1px solid var(--border-color);transition:background-color 0.2s}.search-result-item.svelte-u3u5mw.svelte-u3u5mw:hover{background:var(--button-hover-bg)}.search-result-item.expanded.svelte-u3u5mw.svelte-u3u5mw{background:var(--button-hover-bg)}.search-result-row.svelte-u3u5mw.svelte-u3u5mw{display:flex;align-items:center;padding:0.75rem 1rem;cursor:pointer;gap:0.75rem;min-height:3rem}.search-result-avatar.svelte-u3u5mw.svelte-u3u5mw{flex-shrink:0;width:2rem;height:2rem;display:flex;align-items:center;justify-content:center}.search-result-info.svelte-u3u5mw.svelte-u3u5mw{flex-shrink:0;width:12rem;display:flex;flex-direction:column;gap:0.25rem}.search-result-author.svelte-u3u5mw.svelte-u3u5mw{font-family:monospace;font-size:0.8rem;color:var(--text-color);opacity:0.8}.search-result-kind.svelte-u3u5mw.svelte-u3u5mw{display:flex;align-items:center;gap:0.5rem}.search-result-content.svelte-u3u5mw.svelte-u3u5mw{flex:1;color:var(--text-color);font-size:0.9rem;line-height:1.3;word-break:break-word}.search-result-content.svelte-u3u5mw .event-timestamp.svelte-u3u5mw{font-size:0.75rem;color:var(--text-color);opacity:0.7;margin-bottom:0.25rem;font-weight:500}.search-result-content.svelte-u3u5mw .event-content-single-line.svelte-u3u5mw{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.2}.search-result-details.svelte-u3u5mw.svelte-u3u5mw{border-top:1px solid var(--border-color);background:var(--header-bg);padding:1rem}.no-search-results.svelte-u3u5mw.svelte-u3u5mw{padding:2rem;text-align:center;color:var(--text-color);opacity:0.7}.no-search-results.svelte-u3u5mw p.svelte-u3u5mw{margin:0;font-size:1rem}.loading-search-results.svelte-u3u5mw.svelte-u3u5mw{padding:2rem;text-align:center;color:var(--text-color);opacity:0.7}.loading-search-results.svelte-u3u5mw p.svelte-u3u5mw{margin:0;font-size:0.9rem}.end-of-search-results.svelte-u3u5mw.svelte-u3u5mw{padding:1rem;text-align:center;color:var(--text-color);opacity:0.5;font-size:0.8rem;border-top:1px solid var(--border-color)}.end-of-search-results.svelte-u3u5mw p.svelte-u3u5mw{margin:0}@media(max-width: 1280px){.main-content.svelte-u3u5mw.svelte-u3u5mw{left:60px}.search-results-view.svelte-u3u5mw.svelte-u3u5mw{left:60px}}@media(max-width: 640px){.settings-drawer.svelte-u3u5mw.svelte-u3u5mw{width:100%}.name-row.svelte-u3u5mw.svelte-u3u5mw{left:calc(8px + 56px + 8px);bottom:6px;right:8px;gap:6px;background:var(--bg-color);padding:0.2em 0.5em;border-radius:0.5em;width:fit-content}.profile-username.svelte-u3u5mw.svelte-u3u5mw{font-size:1rem;color:var(--text-color)}.profile-nip05-inline.svelte-u3u5mw.svelte-u3u5mw{font-size:0.8rem;color:var(--text-color)}.managed-acl-view.svelte-u3u5mw.svelte-u3u5mw{padding:1rem}.kind-name.svelte-u3u5mw.svelte-u3u5mw{font-size:0.7rem}.search-results-view.svelte-u3u5mw.svelte-u3u5mw{left:160px}.search-result-info.svelte-u3u5mw.svelte-u3u5mw{width:8rem}.search-result-author.svelte-u3u5mw.svelte-u3u5mw{font-size:0.7rem}.search-result-content.svelte-u3u5mw.svelte-u3u5mw{font-size:0.8rem}}.recovery-tab.svelte-u3u5mw.svelte-u3u5mw{padding:20px;width:100%;max-width:1200px;margin:0;box-sizing:border-box}.recovery-tab.svelte-u3u5mw h3.svelte-u3u5mw{margin:0 0 10px 0;color:var(--text-color)}.recovery-tab.svelte-u3u5mw p.svelte-u3u5mw{margin:0;color:var(--text-color);opacity:0.7;padding:0.5em}.recovery-controls-card.svelte-u3u5mw.svelte-u3u5mw{background-color:transparent;border:none;border-radius:0.5em;padding:0}.recovery-controls.svelte-u3u5mw.svelte-u3u5mw{display:flex;gap:20px;align-items:center;flex-wrap:wrap}.kind-selector.svelte-u3u5mw.svelte-u3u5mw{display:flex;flex-direction:column;gap:5px}.kind-selector.svelte-u3u5mw label.svelte-u3u5mw{font-weight:500;color:var(--text-color)}.kind-selector.svelte-u3u5mw select.svelte-u3u5mw{padding:8px 12px;border:1px solid var(--border-color);border-radius:0.5em;background:var(--bg-color);color:var(--text-color);min-width:300px}.custom-kind-input.svelte-u3u5mw.svelte-u3u5mw{display:flex;flex-direction:column;gap:5px}.custom-kind-input.svelte-u3u5mw label.svelte-u3u5mw{font-weight:500;color:var(--text-color)}.custom-kind-input.svelte-u3u5mw input.svelte-u3u5mw{padding:8px 12px;border:1px solid var(--border-color);border-radius:0.5em;background:var(--bg-color);color:var(--text-color);min-width:200px}.custom-kind-input.svelte-u3u5mw input.svelte-u3u5mw::placeholder{color:var(--text-color);opacity:0.6}.recovery-results.svelte-u3u5mw.svelte-u3u5mw{margin-top:20px}.loading.svelte-u3u5mw.svelte-u3u5mw,.no-events.svelte-u3u5mw.svelte-u3u5mw{text-align:left;padding:40px 20px;color:var(--text-color);opacity:0.7}.events-list.svelte-u3u5mw.svelte-u3u5mw{display:flex;flex-direction:column;gap:15px}.event-item.svelte-u3u5mw.svelte-u3u5mw{background:var(--surface-bg);border:2px solid var(--primary);border-radius:0.5em;padding:20px;transition:all 0.2s ease;background:var(--header-bg)}.event-item.old-version.svelte-u3u5mw.svelte-u3u5mw{opacity:0.85;border:none;background:var(--header-bg)}.event-header.svelte-u3u5mw.svelte-u3u5mw{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px;flex-wrap:wrap;gap:10px}.event-header-left.svelte-u3u5mw.svelte-u3u5mw{display:flex;align-items:center;gap:15px;flex-wrap:wrap}.event-header-actions.svelte-u3u5mw.svelte-u3u5mw{display:flex;align-items:center;gap:8px}.event-kind.svelte-u3u5mw.svelte-u3u5mw{font-weight:600;color:var(--primary)}.event-timestamp.svelte-u3u5mw.svelte-u3u5mw{color:var(--text-color);font-size:0.9em;opacity:0.7}.repost-all-button.svelte-u3u5mw.svelte-u3u5mw{background:#059669;color:var(--text-color);border:none;padding:6px 12px;border-radius:0.5em;cursor:pointer;font-size:0.9em;transition:background 0.2s ease;margin-right:8px}.repost-all-button.svelte-u3u5mw.svelte-u3u5mw:hover{background:#047857}.repost-button.svelte-u3u5mw.svelte-u3u5mw{background:var(--primary);color:var(--text-color);border:none;padding:6px 12px;border-radius:0.5em;cursor:pointer;font-size:0.9em;transition:background 0.2s ease}.repost-button.svelte-u3u5mw.svelte-u3u5mw:hover{background:#00acc1}.event-content.svelte-u3u5mw.svelte-u3u5mw{margin-bottom:15px}.load-more.svelte-u3u5mw.svelte-u3u5mw{width:100%;padding:12px;background:var(--primary);color:var(--text-color);border:none;border-radius:0.5em;cursor:pointer;font-size:1em;margin-top:20px;transition:background 0.2s ease}.load-more.svelte-u3u5mw.svelte-u3u5mw:hover:not(:disabled){background:#00acc1}.load-more.svelte-u3u5mw.svelte-u3u5mw:disabled{opacity:0.6;cursor:not-allowed}body.dark-theme .event-item.old-version.svelte-u3u5mw.svelte-u3u5mw{background:var(--header-bg);border:none} +html, +body { + position: relative; + width: 100%; + height: 100%; +} + +body { + color: #333; + margin: 0; + padding: 8px; + box-sizing: border-box; + font-family: + -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, + Cantarell, "Helvetica Neue", sans-serif; +} + +a { + color: rgb(0, 100, 200); + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +a:visited { + color: rgb(0, 80, 160); +} + +label { + display: block; +} + +input, +button, +select, +textarea { + font-family: inherit; + font-size: inherit; + -webkit-padding: 0.4em 0; + padding: 0.4em; + margin: 0 0 0.5em 0; + box-sizing: border-box; + border: 1px solid #ccc; + border-radius: 2px; +} + +input:disabled { + color: #ccc; +} + +button { + color: #333; + background-color: #f4f4f4; + outline: none; +} + +button:disabled { + color: #999; +} + +button:not(:disabled):active { + background-color: #ddd; +} + +button:focus { + border-color: #666; +} + diff --git a/app/web/dist/bundle.js b/app/web/dist/bundle.js index 51d24f5..23d98da 100644 --- a/app/web/dist/bundle.js +++ b/app/web/dist/bundle.js @@ -20,5 +20,5 @@ Object.defineProperty(e,"__esModule",{value:!0}),e.bytes=e.stringToBytes=e.str=e * hash-wasm (https://www.npmjs.com/package/hash-wasm) * (c) Dani Biro * @license MIT - */function $p(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((r=r.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;class Up{constructor(){this.mutex=Promise.resolve()}lock(){let e=()=>{};return this.mutex=this.mutex.then(()=>new Promise(e)),new Promise(t=>{e=t})}dispatch(e){return $p(this,void 0,void 0,function*(){const t=yield this.lock();try{return yield Promise.resolve(e())}finally{t()}})}}var Pp;const Rp="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Tp=null!==(Pp=Rp.Buffer)&&void 0!==Pp?Pp:null,Np=Rp.TextEncoder?new Rp.TextEncoder:null;function Op(e,t){return(15&e)+(e>>6|e>>3&8)<<4|(15&t)+(t>>6|t>>3&8)}function Mp(e,t){const n=t.length>>1;for(let r=0;r>>4;e[r++]=n>9?n+Lp:n+_p,n=15&t[i],e[r++]=n>9?n+Lp:n+_p}return String.fromCharCode.apply(null,e)}const jp=null!==Tp?e=>{if("string"==typeof e){const t=Tp.from(e,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.length)}if(Tp.isBuffer(e))return new Uint8Array(e.buffer,e.byteOffset,e.length);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")}:e=>{if("string"==typeof e)return Np.encode(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")},Gp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Jp=new Uint8Array(256);for(let e=0;e<64;e++)Jp[Gp.charCodeAt(e)]=e;function Kp(e,t=!0){const n=e.length,r=n%3,i=[],o=n-r;for(let t=0;t>18&63)+Gp.charAt(n>>12&63)+Gp.charAt(n>>6&63)+Gp.charAt(63&n);i.push(r)}if(1===r){const r=e[n-1],o=Gp.charAt(r>>2),s=Gp.charAt(r<<4&63);i.push(`${o}${s}`),t&&i.push("==")}else if(2===r){const r=(e[n-2]<<8)+e[n-1],o=Gp.charAt(r>>10),s=Gp.charAt(r>>4&63),a=Gp.charAt(r<<2&63);i.push(`${o}${s}${a}`),t&&i.push("=")}return i.join("")}function Vp(e){const t=function(e){let t=Math.floor(.75*e.length);const n=e.length;return"="===e[n-1]&&(t-=1,"="===e[n-2]&&(t-=1)),t}(e),n=e.length,r=new Uint8Array(t);let i=0;for(let t=0;t>4,i+=1,r[i]=(15&o)<<4|s>>2,i+=1,r[i]=(3&s)<<6|63&a,i+=1}return r}const zp=16384,qp=new Up,Yp=new Map;function Wp(e,t){return $p(this,void 0,void 0,function*(){let n=null,r=null,i=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const o=()=>new DataView(n.exports.memory.buffer).getUint32(n.exports.STATE_SIZE,!0),s=qp.dispatch(()=>$p(this,void 0,void 0,function*(){if(!Yp.has(e.name)){const t=Vp(e.data),n=WebAssembly.compile(t);Yp.set(e.name,n)}const t=yield Yp.get(e.name);n=yield WebAssembly.instantiate(t,{})})),a=(e=null)=>{i=!0,n.exports.Hash_Init(e)},l=e=>{if(!i)throw new Error("update() called before init()");(e=>{let t=0;for(;t{if(!i)throw new Error("digest() called before init()");return i=!1,n.exports.Hash_Final(o),"binary"===e?r.slice(0,t):Hp(c,r,t)},d=e=>"string"==typeof e?e.length<4096:e.byteLength!0;break;case"blake2b":case"blake2s":f=(e,t)=>t<=512&&d(e);break;case"blake3":f=(e,t)=>0===t&&d(e);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":f=()=>!1}return yield(()=>$p(this,void 0,void 0,function*(){n||(yield s);const e=n.exports.Hash_GetBuffer(),t=n.exports.memory.buffer;r=new Uint8Array(t,e,zp)}))(),{getMemory:()=>r,writeMemory:(e,t=0)=>{r.set(e,t)},getExports:()=>n.exports,setMemorySize:e=>{n.exports.Hash_SetMemorySize(e);const t=n.exports.Hash_GetBuffer(),i=n.exports.memory.buffer;r=new Uint8Array(i,t,e)},init:a,update:l,digest:u,save:()=>{if(!i)throw new Error("save() can only be called after init() and before digest()");const t=n.exports.Hash_GetState(),r=o(),s=n.exports.memory.buffer,a=new Uint8Array(s,t,r),l=new Uint8Array(4+r);return Mp(l,e.hash),l.set(a,4),l},load:t=>{if(!(t instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const r=n.exports.Hash_GetState(),s=o(),a=4+s,l=n.exports.memory.buffer;if(t.length!==a)throw new Error(`Bad state length (expected ${a} bytes, got ${t.length})`);if(!function(e,t){if(e.length!==2*t.length)return!1;for(let n=0;n{if(!f(e,i))return a(i),l(e),u("hex",o);const s=jp(e);return r.set(s),n.exports.Hash_Calculate(s.length,i,o),Hp(c,r,t)},hashLength:t}})}new Up;var Zp={name:"argon2",data:"AGFzbQEAAAABKQVgAX8Bf2AAAX9gEH9/f39/f39/f39/f39/f38AYAR/f39/AGACf38AAwYFAAECAwQFBgEBAoCAAgYIAX8BQZCoBAsHQQQGbWVtb3J5AgASSGFzaF9TZXRNZW1vcnlTaXplAAAOSGFzaF9HZXRCdWZmZXIAAQ5IYXNoX0NhbGN1bGF0ZQAECvEyBVgBAn9BACEBAkAgAEEAKAKICCICRg0AAkAgACACayIAQRB2IABBgIB8cSAASWoiAEAAQX9HDQBB/wHADwtBACEBQQBBACkDiAggAEEQdK18NwOICAsgAcALcAECfwJAQQAoAoAIIgANAEEAPwBBEHQiADYCgAhBACgCiAgiAUGAgCBGDQACQEGAgCAgAWsiAEEQdiAAQYCAfHEgAElqIgBAAEF/Rw0AQQAPC0EAQQApA4gIIABBEHStfDcDiAhBACgCgAghAAsgAAvcDgECfiAAIAQpAwAiECAAKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAMIBAgDCkDAIVCIIkiEDcDACAIIBAgCCkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgBCAQIAQpAwCFQiiJIhA3AwAgACAQIAApAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAwgECAMKQMAhUIwiSIQNwMAIAggECAIKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAEIBAgBCkDAIVCAYk3AwAgASAFKQMAIhAgASkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDSAQIA0pAwCFQiCJIhA3AwAgCSAQIAkpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAUgECAFKQMAhUIoiSIQNwMAIAEgECABKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACANIBAgDSkDAIVCMIkiEDcDACAJIBAgCSkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBSAQIAUpAwCFQgGJNwMAIAIgBikDACIQIAIpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIA4gECAOKQMAhUIgiSIQNwMAIAogECAKKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAGIBAgBikDAIVCKIkiEDcDACACIBAgAikDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgDiAQIA4pAwCFQjCJIhA3AwAgCiAQIAopAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAYgECAGKQMAhUIBiTcDACADIAcpAwAiECADKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAPIBAgDykDAIVCIIkiEDcDACALIBAgCykDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgByAQIAcpAwCFQiiJIhA3AwAgAyAQIAMpAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIA8gECAPKQMAhUIwiSIQNwMAIAsgECALKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAHIBAgBykDAIVCAYk3AwAgACAFKQMAIhAgACkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDyAQIA8pAwCFQiCJIhA3AwAgCiAQIAopAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAUgECAFKQMAhUIoiSIQNwMAIAAgECAAKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAPIBAgDykDAIVCMIkiEDcDACAKIBAgCikDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBSAQIAUpAwCFQgGJNwMAIAEgBikDACIQIAEpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAwgECAMKQMAhUIgiSIQNwMAIAsgECALKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAGIBAgBikDAIVCKIkiEDcDACABIBAgASkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgDCAQIAwpAwCFQjCJIhA3AwAgCyAQIAspAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAYgECAGKQMAhUIBiTcDACACIAcpAwAiECACKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACANIBAgDSkDAIVCIIkiEDcDACAIIBAgCCkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgByAQIAcpAwCFQiiJIhA3AwAgAiAQIAIpAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIA0gECANKQMAhUIwiSIQNwMAIAggECAIKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAHIBAgBykDAIVCAYk3AwAgAyAEKQMAIhAgAykDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDiAQIA4pAwCFQiCJIhA3AwAgCSAQIAkpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAQgECAEKQMAhUIoiSIQNwMAIAMgECADKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAOIBAgDikDAIVCMIkiEDcDACAJIBAgCSkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBCAQIAQpAwCFQgGJNwMAC98aAQN/QQAhBEEAIAIpAwAgASkDAIU3A5AIQQAgAikDCCABKQMIhTcDmAhBACACKQMQIAEpAxCFNwOgCEEAIAIpAxggASkDGIU3A6gIQQAgAikDICABKQMghTcDsAhBACACKQMoIAEpAyiFNwO4CEEAIAIpAzAgASkDMIU3A8AIQQAgAikDOCABKQM4hTcDyAhBACACKQNAIAEpA0CFNwPQCEEAIAIpA0ggASkDSIU3A9gIQQAgAikDUCABKQNQhTcD4AhBACACKQNYIAEpA1iFNwPoCEEAIAIpA2AgASkDYIU3A/AIQQAgAikDaCABKQNohTcD+AhBACACKQNwIAEpA3CFNwOACUEAIAIpA3ggASkDeIU3A4gJQQAgAikDgAEgASkDgAGFNwOQCUEAIAIpA4gBIAEpA4gBhTcDmAlBACACKQOQASABKQOQAYU3A6AJQQAgAikDmAEgASkDmAGFNwOoCUEAIAIpA6ABIAEpA6ABhTcDsAlBACACKQOoASABKQOoAYU3A7gJQQAgAikDsAEgASkDsAGFNwPACUEAIAIpA7gBIAEpA7gBhTcDyAlBACACKQPAASABKQPAAYU3A9AJQQAgAikDyAEgASkD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",hash:"e4cdc523"},Xp={name:"blake2b",data:"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",hash:"c6f286e6"};function eh(e){return!Number.isInteger(e)||e<8||e>512||e%8!=0?new Error("Invalid variant! Valid values: 8, 16, ..., 512"):null}function th(e=512,t=null){if(eh(e))return Promise.reject(eh(e));let n=null,r=e;if(null!==t){if(n=jp(t),n.length>64)return Promise.reject(new Error("Max key length is 64 bytes"));i=e,o=n.length,r=i|o<<16}var i,o;const s=e/8;return Wp(Xp,s).then(e=>{r>512&&e.writeMemory(n),e.init(r);const t={init:r>512?()=>(e.writeMemory(n),e.init(r),t):()=>(e.init(r),t),update:n=>(e.update(n),t),digest:t=>e.digest(t),save:()=>e.save(),load:n=>(e.load(n),t),blockSize:128,digestSize:s};return t})}new Up;const nh=new DataView(new ArrayBuffer(4));function rh(e){return nh.setInt32(0,e,!0),new Uint8Array(nh.buffer)}function ih(e,t,n){return $p(this,void 0,void 0,function*(){if(n<=64){const e=yield th(8*n);return e.update(rh(n)),e.update(t),e.digest("binary")}const r=Math.ceil(n/32)-2,i=new Uint8Array(n);e.init(),e.update(rh(n)),e.update(t);let o=e.digest("binary");i.set(o.subarray(0,32),0);for(let t=1;t{var t;if(!e||"object"!=typeof e)throw new Error("Invalid options parameter. It requires an object.");if(!e.password)throw new Error("Password must be specified");if(e.password=jp(e.password),e.password.length<1)throw new Error("Password must be specified");if(!e.salt)throw new Error("Salt must be specified");if(e.salt=jp(e.salt),e.salt.length<8)throw new Error("Salt should be at least 8 bytes long");if(e.secret=jp(null!==(t=e.secret)&&void 0!==t?t:""),!Number.isInteger(e.iterations)||e.iterations<1)throw new Error("Iterations should be a positive number");if(!Number.isInteger(e.parallelism)||e.parallelism<1)throw new Error("Parallelism should be a positive number");if(!Number.isInteger(e.hashLength)||e.hashLength<4)throw new Error("Hash length should be at least 4 bytes.");if(!Number.isInteger(e.memorySize))throw new Error("Memory size should be specified.");if(e.memorySize<8*e.parallelism)throw new Error("Memory size should be at least 8 * parallelism.");if(void 0===e.outputType&&(e.outputType="hex"),!["hex","binary","encoded"].includes(e.outputType))throw new Error(`Insupported output type ${e.outputType}. Valid values: ['hex', 'binary', 'encoded']`)})(e),oh(Object.assign(Object.assign({},e),{hashType:"id"}))})}new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up;const ah={parallelism:4,iterations:8,memorySize:262144,hashLength:32,outputType:"binary"};let lh=null,ch=0;const uh=new Map;async function dh(e,t){try{const n=function(){if(lh)return lh;const e=new Blob(["\n importScripts('https://cdn.jsdelivr.net/npm/hash-wasm@4.11.0/dist/argon2.umd.min.js');\n\n const ARGON2_CONFIG = {\n parallelism: 4,\n iterations: 8,\n memorySize: 262144,\n hashLength: 32,\n outputType: \"binary\"\n };\n\n self.onmessage = async function(e) {\n const { password, salt, id } = e.data;\n\n try {\n const result = await hashwasm.argon2id({\n password: password,\n salt: new Uint8Array(salt),\n ...ARGON2_CONFIG\n });\n\n self.postMessage({\n id,\n success: true,\n result: Array.from(result)\n });\n } catch (error) {\n self.postMessage({\n id,\n success: false,\n error: error.message\n });\n }\n };\n "],{type:"application/javascript"});return lh=new Worker(URL.createObjectURL(e)),lh.onmessage=function(e){const{id:t,success:n,result:r,error:i}=e.data,o=uh.get(t);o&&(uh.delete(t),n?o.resolve(new Uint8Array(r)):o.reject(new Error(i)))},lh.onerror=function(e){console.error("Argon2 worker error:",e)},lh}(),r=++ch;return new Promise((i,o)=>{uh.set(r,{resolve:i,reject:o}),n.postMessage({id:r,password:e,salt:Array.from(t)})})}catch(n){console.warn("Worker failed, falling back to main thread:",n);return await sh({password:e,salt:t,...ah})}}const{window:fh}=l;function ph(e){let t,n,i,o,s,a,l,f,h,g,y,b,k,I,C,E,B,S;function Q(e,t){return"extension"===e[2]?gh:hh}let F=Q(e),D=F(e),$=e[10]&&Bh(e),U=e[11]&&Sh(e);return{c(){t=p("div"),n=p("div"),i=p("div"),o=p("h2"),o.textContent="Login to Nostr",s=m(),a=p("button"),a.textContent="×",l=m(),f=p("div"),h=p("div"),g=p("button"),g.textContent="Extension",y=m(),b=p("button"),b.textContent="Nsec",k=m(),I=p("div"),D.c(),C=m(),$&&$.c(),E=m(),U&&U.c(),A(o,"class","svelte-4xpfbi"),A(a,"class","close-btn svelte-4xpfbi"),A(i,"class","modal-header svelte-4xpfbi"),A(g,"class","tab-btn svelte-4xpfbi"),x(g,"active","extension"===e[2]),A(b,"class","tab-btn svelte-4xpfbi"),x(b,"active","nsec"===e[2]),A(h,"class","tabs svelte-4xpfbi"),A(I,"class","tab-content svelte-4xpfbi"),A(f,"class","tab-container svelte-4xpfbi"),A(n,"class","modal svelte-4xpfbi"),x(n,"dark-theme",e[1]),A(t,"class","modal-overlay svelte-4xpfbi"),A(t,"role","button"),A(t,"tabindex","0")},m(r,d){u(r,t,d),c(t,n),c(n,i),c(i,o),c(i,s),c(i,a),c(n,l),c(n,f),c(f,h),c(h,g),c(h,y),c(h,b),c(f,k),c(f,I),D.m(I,null),c(I,C),$&&$.m(I,null),c(I,E),U&&U.m(I,null),B||(S=[v(a,"click",e[17]),v(g,"click",e[26]),v(b,"click",e[27]),v(n,"click",w(e[24])),v(n,"keydown",w(e[25])),v(t,"click",e[17]),v(t,"keydown",e[32])],B=!0)},p(e,t){4&t[0]&&x(g,"active","extension"===e[2]),4&t[0]&&x(b,"active","nsec"===e[2]),F===(F=Q(e))&&D?D.p(e,t):(D.d(1),D=F(e),D&&(D.c(),D.m(I,C))),e[10]?$?$.p(e,t):($=Bh(e),$.c(),$.m(I,E)):$&&($.d(1),$=null),e[11]?U?U.p(e,t):(U=Sh(e),U.c(),U.m(I,null)):U&&(U.d(1),U=null),2&t[0]&&x(n,"dark-theme",e[1])},d(e){e&&d(t),D.d(),$&&$.d(),U&&U.d(),B=!1,r(S)}}}function hh(e){let t;function n(e,t){return e[14]?yh:mh}let r=n(e),i=r(e);return{c(){t=p("div"),i.c(),A(t,"class","nsec-login svelte-4xpfbi")},m(e,n){u(e,t,n),i.m(t,null)},p(e,o){r===(r=n(e))&&i?i.p(e,o):(i.d(1),i=r(e),i&&(i.c(),i.m(t,null)))},d(e){e&&d(t),i.d()}}}function gh(e){let t,n,r,i,o,s,a,l=e[7]?"Connecting...":"Log in using extension";return{c(){t=p("div"),n=p("p"),n.textContent="Login using a NIP-07 compatible browser\n extension like nos2x or Alby.",r=m(),i=p("button"),o=g(l),A(n,"class","svelte-4xpfbi"),A(i,"class","login-extension-btn svelte-4xpfbi"),i.disabled=e[7],A(t,"class","extension-login svelte-4xpfbi")},m(l,d){u(l,t,d),c(t,n),c(t,r),c(t,i),c(i,o),s||(a=v(i,"click",e[21]),s=!0)},p(e,t){128&t[0]&&l!==(l=e[7]?"Connecting...":"Log in using extension")&&k(o,l),128&t[0]&&(i.disabled=e[7])},d(e){e&&d(t),s=!1,a()}}}function mh(e){let t,n,i,o,s,a,l,f,h,y,w,b,C,E,x,B,S,Q,F,D,$,U,P,R=e[8]?"Generating...":"Generate New Key",T=e[12]&&vh(e),N=e[4]&&wh(e);function O(e,t){return e[9]?kh:e[7]?bh:Ah}let M=O(e),L=M(e);return{c(){t=p("p"),t.textContent="Enter your nsec or generate a new one. Optionally\n set a password to encrypt it securely.",n=m(),i=p("button"),o=g(R),a=m(),T&&T.c(),l=m(),f=p("input"),y=m(),w=p("div"),b=p("label"),b.textContent="Encryption Password (optional but recommended):",C=m(),E=p("input"),B=m(),N&&N.c(),S=m(),Q=p("small"),Q.textContent="Password uses Argon2id with ~3 second derivation time for security.",F=m(),D=p("button"),L.c(),A(t,"class","svelte-4xpfbi"),A(i,"class","generate-btn svelte-4xpfbi"),i.disabled=s=e[7]||e[8],A(f,"type","password"),A(f,"placeholder","nsec1..."),f.disabled=h=e[7]||e[9],A(f,"class","nsec-input svelte-4xpfbi"),A(b,"class","svelte-4xpfbi"),A(E,"type","password"),A(E,"placeholder","Enter password (min 8 chars)"),E.disabled=x=e[7]||e[9],A(E,"class","password-input svelte-4xpfbi"),A(Q,"class","password-hint svelte-4xpfbi"),A(w,"class","password-section svelte-4xpfbi"),A(D,"class","login-nsec-btn svelte-4xpfbi"),D.disabled=$=e[7]||e[9]||!e[3].trim()},m(r,s){u(r,t,s),u(r,n,s),u(r,i,s),c(i,o),u(r,a,s),T&&T.m(r,s),u(r,l,s),u(r,f,s),I(f,e[3]),u(r,y,s),u(r,w,s),c(w,b),c(w,C),c(w,E),I(E,e[4]),c(w,B),N&&N.m(w,null),c(w,S),c(w,Q),u(r,F,s),u(r,D,s),L.m(D,null),U||(P=[v(i,"click",e[20]),v(f,"input",e[29]),v(E,"input",e[30]),v(D,"click",e[22])],U=!0)},p(e,t){256&t[0]&&R!==(R=e[8]?"Generating...":"Generate New Key")&&k(o,R),384&t[0]&&s!==(s=e[7]||e[8])&&(i.disabled=s),e[12]?T?T.p(e,t):(T=vh(e),T.c(),T.m(l.parentNode,l)):T&&(T.d(1),T=null),640&t[0]&&h!==(h=e[7]||e[9])&&(f.disabled=h),8&t[0]&&f.value!==e[3]&&I(f,e[3]),640&t[0]&&x!==(x=e[7]||e[9])&&(E.disabled=x),16&t[0]&&E.value!==e[4]&&I(E,e[4]),e[4]?N?N.p(e,t):(N=wh(e),N.c(),N.m(w,S)):N&&(N.d(1),N=null),M!==(M=O(e))&&(L.d(1),L=M(e),L&&(L.c(),L.m(D,null))),648&t[0]&&$!==($=e[7]||e[9]||!e[3].trim())&&(D.disabled=$)},d(e){e&&d(t),e&&d(n),e&&d(i),e&&d(a),T&&T.d(e),e&&d(l),e&&d(f),e&&d(y),e&&d(w),N&&N.d(),e&&d(F),e&&d(D),L.d(),U=!1,r(P)}}}function yh(e){let t,n,i,o,s,a,l,f,h,y,w,b,k,C,E=e[15]&&Ih(e);function x(e,t){return e[9]?xh:e[7]?Eh:Ch}let B=x(e),S=B(e);return{c(){t=p("p"),t.textContent="You have a stored encrypted key. Enter your\n password to unlock it.",n=m(),E&&E.c(),i=m(),o=p("input"),a=m(),l=p("button"),S.c(),h=m(),y=p("button"),w=g("Clear stored key & start fresh"),A(t,"class","svelte-4xpfbi"),A(o,"type","password"),A(o,"placeholder","Enter your password"),o.disabled=s=e[7]||e[9],A(o,"class","password-input svelte-4xpfbi"),A(l,"class","login-nsec-btn svelte-4xpfbi"),l.disabled=f=e[7]||e[9]||!e[6],A(y,"class","clear-btn svelte-4xpfbi"),y.disabled=b=e[7]||e[9]},m(r,s){u(r,t,s),u(r,n,s),E&&E.m(r,s),u(r,i,s),u(r,o,s),I(o,e[6]),u(r,a,s),u(r,l,s),S.m(l,null),u(r,h,s),u(r,y,s),c(y,w),k||(C=[v(o,"input",e[28]),v(l,"click",e[18]),v(y,"click",e[16])],k=!0)},p(e,t){e[15]?E?E.p(e,t):(E=Ih(e),E.c(),E.m(i.parentNode,i)):E&&(E.d(1),E=null),640&t[0]&&s!==(s=e[7]||e[9])&&(o.disabled=s),64&t[0]&&o.value!==e[6]&&I(o,e[6]),B!==(B=x(e))&&(S.d(1),S=B(e),S&&(S.c(),S.m(l,null))),704&t[0]&&f!==(f=e[7]||e[9]||!e[6])&&(l.disabled=f),640&t[0]&&b!==(b=e[7]||e[9])&&(y.disabled=b)},d(e){e&&d(t),e&&d(n),E&&E.d(e),e&&d(i),e&&d(o),e&&d(a),e&&d(l),S.d(),e&&d(h),e&&d(y),k=!1,r(C)}}}function vh(e){let t,n,r,i,o;return{c(){t=p("div"),n=p("label"),n.textContent="Your new public key (npub):",r=m(),i=p("code"),o=g(e[12]),A(n,"class","svelte-4xpfbi"),A(i,"class","npub-display svelte-4xpfbi"),A(t,"class","generated-info svelte-4xpfbi")},m(e,s){u(e,t,s),c(t,n),c(t,r),c(t,i),c(i,o)},p(e,t){4096&t[0]&&k(o,e[12])},d(e){e&&d(t)}}}function wh(e){let t,n,r,i;return{c(){t=p("input"),A(t,"type","password"),A(t,"placeholder","Confirm password"),t.disabled=n=e[7]||e[9],A(t,"class","password-input svelte-4xpfbi")},m(n,o){u(n,t,o),I(t,e[5]),r||(i=v(t,"input",e[31]),r=!0)},p(e,r){640&r[0]&&n!==(n=e[7]||e[9])&&(t.disabled=n),32&r[0]&&t.value!==e[5]&&I(t,e[5])},d(e){e&&d(t),r=!1,i()}}}function Ah(e){let t;return{c(){t=g("Log in with nsec")},m(e,n){u(e,t,n)},d(e){e&&d(t)}}}function bh(e){let t;return{c(){t=g("Logging in...")},m(e,n){u(e,t,n)},d(e){e&&d(t)}}}function kh(e){let t;return{c(){t=g("Deriving key...")},m(e,n){u(e,t,n)},d(e){e&&d(t)}}}function Ih(e){let t,n,r,i,o,s,a,l=e[15].slice(0,16)+"",f=e[15].slice(-8)+"";return{c(){t=p("div"),n=p("label"),n.textContent="Stored public key:",r=m(),i=p("code"),o=g(l),s=g("..."),a=g(f),A(n,"class","svelte-4xpfbi"),A(i,"class","npub-display svelte-4xpfbi"),A(t,"class","stored-info svelte-4xpfbi")},m(e,l){u(e,t,l),c(t,n),c(t,r),c(t,i),c(i,o),c(i,s),c(i,a)},p(e,t){32768&t[0]&&l!==(l=e[15].slice(0,16)+"")&&k(o,l),32768&t[0]&&f!==(f=e[15].slice(-8)+"")&&k(a,f)},d(e){e&&d(t)}}}function Ch(e){let t;return{c(){t=g("Unlock")},m(e,n){u(e,t,n)},d(e){e&&d(t)}}}function Eh(e){let t;return{c(){t=g("Unlocking...")},m(e,n){u(e,t,n)},d(e){e&&d(t)}}}function xh(e){let t;return{c(){t=g("Deriving key...")},m(e,n){u(e,t,n)},d(e){e&&d(t)}}}function Bh(e){let t,n;return{c(){t=p("div"),n=g(e[10]),A(t,"class","message error-message svelte-4xpfbi")},m(e,r){u(e,t,r),c(t,n)},p(e,t){1024&t[0]&&k(n,e[10])},d(e){e&&d(t)}}}function Sh(e){let t,n;return{c(){t=p("div"),n=g(e[11]),A(t,"class","message success-message svelte-4xpfbi")},m(e,r){u(e,t,r),c(t,n)},p(e,t){2048&t[0]&&k(n,e[11])},d(e){e&&d(t)}}}function Qh(e){let t,n,r,i,o,s,a,l,f,h,y,v=e[13].toFixed(1)+"";return{c(){t=p("div"),n=p("div"),r=p("div"),i=m(),o=p("h3"),o.textContent="Deriving encryption key",s=m(),a=p("div"),l=g(v),f=g("s"),h=m(),y=p("p"),y.textContent="This may take 3-6 seconds for security",A(r,"class","deriving-spinner svelte-4xpfbi"),A(o,"class","svelte-4xpfbi"),A(a,"class","deriving-timer svelte-4xpfbi"),A(y,"class","deriving-note svelte-4xpfbi"),A(n,"class","deriving-modal svelte-4xpfbi"),x(n,"dark-theme",e[1]),A(t,"class","deriving-overlay svelte-4xpfbi")},m(e,d){u(e,t,d),c(t,n),c(n,r),c(n,i),c(n,o),c(n,s),c(n,a),c(a,l),c(a,f),c(n,h),c(n,y)},p(e,t){8192&t[0]&&v!==(v=e[13].toFixed(1)+"")&&k(l,v),2&t[0]&&x(n,"dark-theme",e[1])},d(e){e&&d(t)}}}function Fh(t){let n,r,i,o,s=t[0]&&ph(t),a=t[9]&&Qh(t);return{c(){s&&s.c(),n=m(),a&&a.c(),r=y()},m(e,l){s&&s.m(e,l),u(e,n,l),a&&a.m(e,l),u(e,r,l),i||(o=v(fh,"keydown",t[23]),i=!0)},p(e,t){e[0]?s?s.p(e,t):(s=ph(e),s.c(),s.m(n.parentNode,n)):s&&(s.d(1),s=null),e[9]?a?a.p(e,t):(a=Qh(e),a.c(),a.m(r.parentNode,r)):a&&(a.d(1),a=null)},i:e,o:e,d(e){s&&s.d(e),e&&d(n),a&&a.d(e),e&&d(r),i=!1,o()}}}function Dh(e,t,n){const r=$();let{showModal:i=!1}=t,{isDarkTheme:o=!1}=t,s="extension",a="",l="",c="",u="",d=!1,f=!1,p=!1,h="",g="",m="",y="",v=0,w=null,A=null;function b(){n(13,v=0),w=performance.now(),k()}function k(){null!==w&&(n(13,v=(performance.now()-w)/1e3),A=requestAnimationFrame(k))}function I(){w=null,A&&(cancelAnimationFrame(A),A=null)}D(()=>{I()});let C=!1,E="";function x(){n(14,C=!!localStorage.getItem("nostr_privkey_encrypted")),n(15,E=localStorage.getItem("nostr_pubkey")||"")}function B(){n(0,i=!1),n(3,a=""),n(4,l=""),n(5,c=""),n(6,u=""),n(10,h=""),n(11,g=""),m="",n(12,y=""),r("close")}function S(e){n(2,s=e),n(10,h=""),n(11,g=""),m="",n(12,y="")}async function Q(){n(7,d=!0),n(10,h=""),n(11,g="");try{if(!a.trim())throw new Error("Please enter your nsec");if(!function(e){if(!e||!e.startsWith("nsec1"))return!1;try{return"nsec"===mu(e).type}catch{return!1}}(a.trim()))throw new Error("Invalid nsec format or checksum");if(l){if(l.length<8)throw new Error("Password must be at least 8 characters");if(l!==c)throw new Error("Passwords do not match")}const e=kf.fromKey(a.trim()),t=await e.getPublicKey();if(localStorage.setItem("nostr_auth_method","nsec"),localStorage.setItem("nostr_pubkey",t),l){n(9,p=!0),b();const e=await async function(e,t){if(!e.startsWith("nsec1"))throw new Error("Invalid nsec format - must start with nsec1");try{if("nsec"!==mu(e).type)throw new Error("Invalid nsec - wrong type")}catch(e){throw new Error("Invalid nsec - bech32 checksum failed")}const n=crypto.getRandomValues(new Uint8Array(32)),r=crypto.getRandomValues(new Uint8Array(12)),i=await dh(t,n),o=await crypto.subtle.importKey("raw",i,{name:"AES-GCM"},!1,["encrypt"]),s=new TextEncoder,a=await crypto.subtle.encrypt({name:"AES-GCM",iv:r},o,s.encode(e)),l=new Uint8Array(n.length+r.length+a.byteLength);return l.set(n,0),l.set(r,n.length),l.set(new Uint8Array(a),n.length+r.length),btoa(String.fromCharCode(...l))}(a.trim(),l);I(),n(9,p=!1),localStorage.setItem("nostr_privkey_encrypted",e),localStorage.removeItem("nostr_privkey")}else localStorage.setItem("nostr_privkey",a.trim()),localStorage.removeItem("nostr_privkey_encrypted"),n(11,g="Successfully logged in with nsec!");r("login",{method:"nsec",pubkey:t,privateKey:a.trim(),signer:e}),setTimeout(()=>{B()},1500)}catch(e){n(10,h=e.message)}finally{n(7,d=!1)}}F(()=>{x()});return e.$$set=e=>{"showModal"in e&&n(0,i=e.showModal),"isDarkTheme"in e&&n(1,o=e.isDarkTheme)},e.$$.update=()=>{1&e.$$.dirty[0]&&i&&x()},[i,o,s,a,l,c,u,d,f,p,h,g,y,v,C,E,function(){localStorage.removeItem("nostr_privkey_encrypted"),localStorage.removeItem("nostr_privkey"),localStorage.removeItem("nostr_pubkey"),localStorage.removeItem("nostr_auth_method"),n(14,C=!1),n(15,E=""),n(6,u=""),n(10,h=""),n(11,g="")},B,async function(){n(7,d=!0),n(9,p=!0),b(),n(10,h=""),n(11,g="");try{if(!u)throw new Error("Please enter your password");const e=localStorage.getItem("nostr_privkey_encrypted");if(!e)throw new Error("No encrypted key found");const t=await async function(e,t){const n=new Uint8Array(atob(e).split("").map(e=>e.charCodeAt(0)));if(n.length<60)throw new Error("Invalid encrypted data - too short");const r=n.slice(0,32),i=n.slice(32,44),o=n.slice(44),s=await dh(t,r),a=await crypto.subtle.importKey("raw",s,{name:"AES-GCM"},!1,["decrypt"]);let l;try{l=await crypto.subtle.decrypt({name:"AES-GCM",iv:i},a,o)}catch(e){throw new Error("Decryption failed - invalid password or corrupted data")}const c=(new TextDecoder).decode(l);if(!c.startsWith("nsec1"))throw new Error("Decryption produced invalid data - not an nsec");try{if("nsec"!==mu(c).type)throw new Error("Decryption produced invalid nsec type")}catch(e){throw new Error("Decryption produced invalid nsec - bech32 checksum failed")}return c}(e,u);I(),n(9,p=!1);const i=kf.fromKey(t),o=await i.getPublicKey();r("login",{method:"nsec",pubkey:o,privateKey:t,signer:i}),B()}catch(e){I(),e.message.includes("decrypt")||e.message.includes("tag")?n(10,h="Invalid password"):n(10,h=e.message)}finally{n(7,d=!1),n(9,p=!1),I()}},S,async function(){n(8,f=!0),n(10,h=""),n(11,g="");try{const e=Wc(),t=wu("nsec",e),r=vu(Zc(e));m=t,n(12,y=r),n(3,a=t),n(11,g="New key generated! Set an encryption password below to secure it.")}catch(e){n(10,h="Failed to generate key: "+e.message)}finally{n(8,f=!1)}},async function(){n(7,d=!0),n(10,h=""),n(11,g="");try{if(!window.nostr)throw new Error("No Nostr extension found. Please install a NIP-07 compatible extension like nos2x or Alby.");const e=await window.nostr.getPublicKey();e&&(localStorage.setItem("nostr_auth_method","extension"),localStorage.setItem("nostr_pubkey",e),n(11,g="Successfully logged in with extension!"),r("login",{method:"extension",pubkey:e,signer:window.nostr}),setTimeout(()=>{B()},1500))}catch(e){n(10,h=e.message)}finally{n(7,d=!1)}},Q,function(e){"Escape"===e.key&&B(),"Enter"===e.key&&"nsec"===s&&Q()},function(t){U.call(this,e,t)},function(t){U.call(this,e,t)},()=>S("extension"),()=>S("nsec"),function(){u=this.value,n(6,u)},function(){a=this.value,n(3,a)},function(){l=this.value,n(4,l)},function(){c=this.value,n(5,c)},e=>"Escape"===e.key&&B()]}class $h extends ie{constructor(e){super(),re(this,e,Dh,Fh,o,{showModal:0,isDarkTheme:1},null,[-1,-1])}}function Uh(e,t,n){const r=e.slice();return r[72]=t[n],r}function Ph(e,t,n){const r=e.slice();return r[75]=t[n],r}function Rh(e,t,n){const r=e.slice();return r[72]=t[n],r}function Th(e,t,n){const r=e.slice();return r[72]=t[n],r}function Nh(e,t,n){const r=e.slice();return r[72]=t[n],r}function Oh(e,t,n){const r=e.slice();return r[72]=t[n],r}function Mh(e,t,n){const r=e.slice();return r[72]=t[n],r}function Lh(e){let t,n,r;return{c(){t=p("div"),n=g(e[3]),A(t,"class",r="message "+e[4]+" svelte-1y8wjwc")},m(e,r){u(e,t,r),c(t,n)},p(e,i){8&i[0]&&k(n,e[3]),16&i[0]&&r!==(r="message "+e[4]+" svelte-1y8wjwc")&&A(t,"class",r)},d(e){e&&d(t)}}}function _h(e){let t,n,i,o,s,a,l,f,h,y,w,b,k,C,E,x,B,S,Q,F,D,$,U,P,R,T,N,O;function M(e,t){return e[5]&&e[5].length>0?jh:Hh}let L=M(e),_=L(e);function H(e,t){return e[8]&&e[8].length>0?Vh:Kh}let j=H(e),G=j(e);return{c(){t=p("div"),n=p("div"),i=p("h3"),i.textContent="Banned Pubkeys",o=m(),s=p("div"),a=p("input"),l=m(),f=p("input"),h=m(),y=p("button"),w=g("Ban Pubkey"),b=m(),k=p("div"),_.c(),C=m(),E=p("div"),x=p("h3"),x.textContent="Allowed Pubkeys",B=m(),S=p("div"),Q=p("input"),F=m(),D=p("input"),$=m(),U=p("button"),P=g("Allow Pubkey"),R=m(),T=p("div"),G.c(),A(i,"class","svelte-1y8wjwc"),A(a,"type","text"),A(a,"placeholder","Pubkey (64 hex chars)"),A(a,"class","svelte-1y8wjwc"),A(f,"type","text"),A(f,"placeholder","Reason (optional)"),A(f,"class","svelte-1y8wjwc"),y.disabled=e[2],A(y,"class","svelte-1y8wjwc"),A(s,"class","add-form svelte-1y8wjwc"),A(k,"class","list svelte-1y8wjwc"),A(n,"class","section svelte-1y8wjwc"),A(x,"class","svelte-1y8wjwc"),A(Q,"type","text"),A(Q,"placeholder","Pubkey (64 hex chars)"),A(Q,"class","svelte-1y8wjwc"),A(D,"type","text"),A(D,"placeholder","Reason (optional)"),A(D,"class","svelte-1y8wjwc"),U.disabled=e[2],A(U,"class","svelte-1y8wjwc"),A(S,"class","add-form svelte-1y8wjwc"),A(T,"class","list svelte-1y8wjwc"),A(E,"class","section svelte-1y8wjwc"),A(t,"class","pubkeys-section")},m(r,d){u(r,t,d),c(t,n),c(n,i),c(n,o),c(n,s),c(s,a),I(a,e[6]),c(s,l),c(s,f),I(f,e[7]),c(s,h),c(s,y),c(y,w),c(n,b),c(n,k),_.m(k,null),c(t,C),c(t,E),c(E,x),c(E,B),c(E,S),c(S,Q),I(Q,e[9]),c(S,F),c(S,D),I(D,e[10]),c(S,$),c(S,U),c(U,P),c(E,R),c(E,T),G.m(T,null),N||(O=[v(a,"input",e[43]),v(f,"input",e[44]),v(y,"click",e[25]),v(Q,"input",e[45]),v(D,"input",e[46]),v(U,"click",e[26])],N=!0)},p(e,t){64&t[0]&&a.value!==e[6]&&I(a,e[6]),128&t[0]&&f.value!==e[7]&&I(f,e[7]),4&t[0]&&(y.disabled=e[2]),L===(L=M(e))&&_?_.p(e,t):(_.d(1),_=L(e),_&&(_.c(),_.m(k,null))),512&t[0]&&Q.value!==e[9]&&I(Q,e[9]),1024&t[0]&&D.value!==e[10]&&I(D,e[10]),4&t[0]&&(U.disabled=e[2]),j===(j=H(e))&&G?G.p(e,t):(G.d(1),G=j(e),G&&(G.c(),G.m(T,null)))},d(e){e&&d(t),_.d(),G.d(),N=!1,r(O)}}}function Hh(t){let n;return{c(){n=p("div"),n.innerHTML="

No banned pubkeys configured.

",A(n,"class","no-items svelte-1y8wjwc")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function jh(e){let t,n=e[5],r=[];for(let t=0;tNo allowed pubkeys configured.

",A(n,"class","no-items svelte-1y8wjwc")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function Vh(e){let t,n=e[8],r=[];for(let t=0;t0?Zh:Wh}let L=M(e),_=L(e);let H=function(e){return e[22]&&e[22].length>0?ng:tg}(e),j=H(e);return{c(){t=p("div"),n=p("div"),i=p("h3"),i.textContent="Banned Events",o=m(),s=p("div"),a=p("input"),l=m(),f=p("input"),h=m(),y=p("button"),w=g("Ban Event"),b=m(),k=p("div"),_.c(),C=m(),E=p("div"),x=p("h3"),x.textContent="Allowed Events",B=m(),S=p("div"),Q=p("input"),F=m(),D=p("input"),$=m(),U=p("button"),P=g("Allow Event"),R=m(),T=p("div"),j.c(),A(i,"class","svelte-1y8wjwc"),A(a,"type","text"),A(a,"placeholder","Event ID (64 hex chars)"),A(a,"class","svelte-1y8wjwc"),A(f,"type","text"),A(f,"placeholder","Reason (optional)"),A(f,"class","svelte-1y8wjwc"),y.disabled=e[2],A(y,"class","svelte-1y8wjwc"),A(s,"class","add-form svelte-1y8wjwc"),A(k,"class","list svelte-1y8wjwc"),A(n,"class","section svelte-1y8wjwc"),A(x,"class","svelte-1y8wjwc"),A(Q,"type","text"),A(Q,"placeholder","Event ID (64 hex chars)"),A(Q,"class","svelte-1y8wjwc"),A(D,"type","text"),A(D,"placeholder","Reason (optional)"),A(D,"class","svelte-1y8wjwc"),U.disabled=e[2],A(U,"class","svelte-1y8wjwc"),A(S,"class","add-form svelte-1y8wjwc"),A(T,"class","list svelte-1y8wjwc"),A(E,"class","section svelte-1y8wjwc"),A(t,"class","events-section")},m(r,d){u(r,t,d),c(t,n),c(n,i),c(n,o),c(n,s),c(s,a),I(a,e[12]),c(s,l),c(s,f),I(f,e[13]),c(s,h),c(s,y),c(y,w),c(n,b),c(n,k),_.m(k,null),c(t,C),c(t,E),c(E,x),c(E,B),c(E,S),c(S,Q),I(Q,e[14]),c(S,F),c(S,D),I(D,e[15]),c(S,$),c(S,U),c(U,P),c(E,R),c(E,T),j.m(T,null),N||(O=[v(a,"input",e[47]),v(f,"input",e[48]),v(y,"click",e[27]),v(Q,"input",e[49]),v(D,"input",e[50]),v(U,"click",e[28])],N=!0)},p(e,t){4096&t[0]&&a.value!==e[12]&&I(a,e[12]),8192&t[0]&&f.value!==e[13]&&I(f,e[13]),4&t[0]&&(y.disabled=e[2]),L===(L=M(e))&&_?_.p(e,t):(_.d(1),_=L(e),_&&(_.c(),_.m(k,null))),16384&t[0]&&Q.value!==e[14]&&I(Q,e[14]),32768&t[0]&&D.value!==e[15]&&I(D,e[15]),4&t[0]&&(U.disabled=e[2]),j.p(e,t)},d(e){e&&d(t),_.d(),j.d(),N=!1,r(O)}}}function Wh(t){let n;return{c(){n=p("div"),n.innerHTML="

No banned events configured.

",A(n,"class","no-items svelte-1y8wjwc")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function Zh(e){let t,n=e[11],r=[];for(let t=0;tNo allowed events configured.

",A(n,"class","no-items svelte-1y8wjwc")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function ng(e){let t,n=e[22],r=[];for(let t=0;t0?sg:og}let B=x(e),S=B(e);return{c(){t=p("div"),n=p("div"),i=p("h3"),i.textContent="Blocked IPs",o=m(),s=p("div"),a=p("input"),l=m(),f=p("input"),h=m(),y=p("button"),w=g("Block IP"),b=m(),k=p("div"),S.c(),A(i,"class","svelte-1y8wjwc"),A(a,"type","text"),A(a,"placeholder","IP Address"),A(a,"class","svelte-1y8wjwc"),A(f,"type","text"),A(f,"placeholder","Reason (optional)"),A(f,"class","svelte-1y8wjwc"),y.disabled=e[2],A(y,"class","svelte-1y8wjwc"),A(s,"class","add-form svelte-1y8wjwc"),A(k,"class","list svelte-1y8wjwc"),A(n,"class","section svelte-1y8wjwc"),A(t,"class","ips-section")},m(r,d){u(r,t,d),c(t,n),c(n,i),c(n,o),c(n,s),c(s,a),I(a,e[17]),c(s,l),c(s,f),I(f,e[18]),c(s,h),c(s,y),c(y,w),c(n,b),c(n,k),S.m(k,null),C||(E=[v(a,"input",e[51]),v(f,"input",e[52]),v(y,"click",e[29])],C=!0)},p(e,t){131072&t[0]&&a.value!==e[17]&&I(a,e[17]),262144&t[0]&&f.value!==e[18]&&I(f,e[18]),4&t[0]&&(y.disabled=e[2]),B===(B=x(e))&&S?S.p(e,t):(S.d(1),S=B(e),S&&(S.c(),S.m(k,null)))},d(e){e&&d(t),S.d(),C=!1,r(E)}}}function og(t){let n;return{c(){n=p("div"),n.innerHTML="

No blocked IPs configured.

",A(n,"class","no-items svelte-1y8wjwc")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function sg(e){let t,n=e[16],r=[];for(let t=0;t0?dg:ug}let x=E(e),B=x(e);return{c(){t=p("div"),n=p("div"),i=p("h3"),i.textContent="Allowed Event Kinds",o=m(),s=p("div"),a=p("input"),l=m(),f=p("button"),h=g("Allow Kind"),y=m(),w=p("div"),B.c(),A(i,"class","svelte-1y8wjwc"),A(a,"type","number"),A(a,"placeholder","Kind number"),A(a,"class","svelte-1y8wjwc"),f.disabled=e[2],A(f,"class","svelte-1y8wjwc"),A(s,"class","add-form svelte-1y8wjwc"),A(w,"class","list svelte-1y8wjwc"),A(n,"class","section svelte-1y8wjwc"),A(t,"class","kinds-section")},m(r,d){u(r,t,d),c(t,n),c(n,i),c(n,o),c(n,s),c(s,a),I(a,e[20]),c(s,l),c(s,f),c(f,h),c(n,y),c(n,w),B.m(w,null),k||(C=[v(a,"input",e[53]),v(f,"click",e[30])],k=!0)},p(e,t){1048576&t[0]&&b(a.value)!==e[20]&&I(a,e[20]),4&t[0]&&(f.disabled=e[2]),x===(x=E(e))&&B?B.p(e,t):(B.d(1),B=x(e),B&&(B.c(),B.m(w,null)))},d(e){e&&d(t),B.d(),k=!1,r(C)}}}function ug(t){let n;return{c(){n=p("div"),n.innerHTML="

No allowed kinds configured. All kinds are\n allowed by default.

",A(n,"class","no-items svelte-1y8wjwc")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function dg(e){let t,n=e[19],r=[];for(let t=0;t0?gg:hg}let w=y(e),b=w(e);return{c(){t=p("div"),n=p("div"),r=p("h3"),r.textContent="Events Needing Moderation",i=m(),o=p("button"),s=g("Refresh"),a=m(),l=p("div"),b.c(),A(r,"class","svelte-1y8wjwc"),o.disabled=e[2],A(l,"class","list svelte-1y8wjwc"),A(n,"class","section svelte-1y8wjwc"),A(t,"class","moderation-section")},m(d,p){u(d,t,p),c(t,n),c(n,r),c(n,i),c(n,o),c(o,s),c(n,a),c(n,l),b.m(l,null),f||(h=v(o,"click",e[24]),f=!0)},p(e,t){4&t[0]&&(o.disabled=e[2]),w===(w=y(e))&&b?b.p(e,t):(b.d(1),b=w(e),b&&(b.c(),b.m(l,null)))},d(e){e&&d(t),b.d(),f=!1,h()}}}function hg(t){let n;return{c(){n=p("div"),n.innerHTML="

No events need moderation at this time.

",A(n,"class","no-items svelte-1y8wjwc")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function gg(e){let t,n=e[21],r=[];for(let t=0;tManaged ACL Configuration \n

Configure access control using NIP-86 management API

\n
Owner Only: This interface is restricted to relay owners\n only.
',o=m(),z&&z.c(),s=m(),a=p("div"),l=p("button"),f=g("Pubkeys"),y=m(),w=p("button"),b=g("Events"),I=m(),C=p("button"),E=g("IPs"),B=m(),S=p("button"),Q=g("Kinds"),D=m(),$=p("button"),U=g("Moderation"),R=m(),T=p("button"),N=g("Relay Config"),M=m(),L=p("div"),q&&q.c(),_=m(),Y&&Y.c(),H=m(),W&&W.c(),j=m(),Z&&Z.c(),G=m(),X&&X.c(),J=m(),ee&&ee.c(),A(i,"class","header svelte-1y8wjwc"),A(l,"class",h="tab "+("pubkeys"===t[1]?"active":"")+" svelte-1y8wjwc"),A(w,"class",k="tab "+("events"===t[1]?"active":"")+" svelte-1y8wjwc"),A(C,"class",x="tab "+("ips"===t[1]?"active":"")+" svelte-1y8wjwc"),A(S,"class",F="tab "+("kinds"===t[1]?"active":"")+" svelte-1y8wjwc"),A($,"class",P="tab "+("moderation"===t[1]?"active":"")+" svelte-1y8wjwc"),A(T,"class",O="tab "+("relay"===t[1]?"active":"")+" svelte-1y8wjwc"),A(a,"class","tabs svelte-1y8wjwc"),A(L,"class","tab-content svelte-1y8wjwc")},m(e,r){u(e,n,r),c(n,i),c(n,o),z&&z.m(n,null),c(n,s),c(n,a),c(a,l),c(l,f),c(a,y),c(a,w),c(w,b),c(a,I),c(a,C),c(C,E),c(a,B),c(a,S),c(S,Q),c(a,D),c(a,$),c($,U),c(a,R),c(a,T),c(T,N),c(n,M),c(n,L),q&&q.m(L,null),c(L,_),Y&&Y.m(L,null),c(L,H),W&&W.m(L,null),c(L,j),Z&&Z.m(L,null),c(L,G),X&&X.m(L,null),c(L,J),ee&&ee.m(L,null),K||(V=[v(l,"click",t[37]),v(w,"click",t[38]),v(C,"click",t[39]),v(S,"click",t[40]),v($,"click",t[41]),v(T,"click",t[42])],K=!0)},p(e,t){e[3]?z?z.p(e,t):(z=Lh(e),z.c(),z.m(n,s)):z&&(z.d(1),z=null),2&t[0]&&h!==(h="tab "+("pubkeys"===e[1]?"active":"")+" svelte-1y8wjwc")&&A(l,"class",h),2&t[0]&&k!==(k="tab "+("events"===e[1]?"active":"")+" svelte-1y8wjwc")&&A(w,"class",k),2&t[0]&&x!==(x="tab "+("ips"===e[1]?"active":"")+" svelte-1y8wjwc")&&A(C,"class",x),2&t[0]&&F!==(F="tab "+("kinds"===e[1]?"active":"")+" svelte-1y8wjwc")&&A(S,"class",F),2&t[0]&&P!==(P="tab "+("moderation"===e[1]?"active":"")+" svelte-1y8wjwc")&&A($,"class",P),2&t[0]&&O!==(O="tab "+("relay"===e[1]?"active":"")+" svelte-1y8wjwc")&&A(T,"class",O),"pubkeys"===e[1]?q?q.p(e,t):(q=_h(e),q.c(),q.m(L,_)):q&&(q.d(1),q=null),"events"===e[1]?Y?Y.p(e,t):(Y=Yh(e),Y.c(),Y.m(L,H)):Y&&(Y.d(1),Y=null),"ips"===e[1]?W?W.p(e,t):(W=ig(e),W.c(),W.m(L,j)):W&&(W.d(1),W=null),"kinds"===e[1]?Z?Z.p(e,t):(Z=cg(e),Z.c(),Z.m(L,G)):Z&&(Z.d(1),Z=null),"moderation"===e[1]?X?X.p(e,t):(X=pg(e),X.c(),X.m(L,J)):X&&(X.d(1),X=null),"relay"===e[1]?ee?ee.p(e,t):(ee=vg(e),ee.c(),ee.m(L,null)):ee&&(ee.d(1),ee=null)},i:e,o:e,d(e){e&&d(n),z&&z.d(),q&&q.d(),Y&&Y.d(),W&&W.d(),Z&&Z.d(),X&&X.d(),ee&&ee.d(),K=!1,r(V)}}}function kg(e,t,n){let{userSigner:r}=t,{userPubkey:i}=t,o="pubkeys",s=!1,a="",l="info",c=[],u="",d="",f=[],p="",h="",g=[],m="",y="",v="",w="",A=[],k="",I="",C=[],E="",x=[],B={relay_name:"",relay_description:"",relay_icon:""};async function S(){try{n(2,s=!0),console.log("Fetching relay info from /");const e=await fetch(window.location.origin+"/",{headers:{Accept:"application/nostr+json"}});if(console.log("Response status:",e.status),console.log("Response headers:",e.headers),e.ok){const t=await e.json();console.log("Raw relay info:",t),n(0,B={relay_name:t.name||"",relay_description:t.description||"",relay_icon:t.icon||""}),console.log("Updated relayConfig:",B),console.log("Loaded relay info:",t),n(3,a="Relay configuration loaded successfully"),n(4,l="success")}else console.error("Failed to fetch relay info, status:",e.status),n(3,a=`Failed to fetch relay info: ${e.status}`),n(4,l="error")}catch(e){console.error("Failed to fetch relay info:",e),n(3,a=`Failed to fetch relay info: ${e.message}`),n(4,l="error")}finally{n(2,s=!1)}}async function Q(e,t=[]){try{n(2,s=!0),n(3,a="");const o={method:e,params:t},l=await async function(e,t){if(!r)throw new Error("No signer available for authentication. Please log in with a Nostr extension.");if(!i)throw new Error("No user pubkey available for authentication.");const n=window.location.origin+t,o={kind:27235,created_at:Math.floor(Date.now()/1e3),tags:[["u",n],["method",e]],content:"",pubkey:i},s=await r.signEvent(o),a=JSON.stringify(s);return`Nostr ${btoa(a)}`}("POST","/api/nip86"),c=await fetch("/api/nip86",{method:"POST",headers:{"Content-Type":"application/nostr+json+rpc",Authorization:l},body:JSON.stringify(o)});if(!c.ok)throw new Error(`HTTP ${c.status}: ${c.statusText}`);const u=await c.json();if(u.error)throw new Error(u.error);return u.result}catch(e){throw console.error("NIP-86 API error:",e),n(3,a=e.message),n(4,l="error"),e}finally{n(2,s=!1)}}async function D(){try{n(5,c=await Q("listbannedpubkeys"))}catch(e){console.error("Failed to load banned pubkeys:",e)}}async function $(){try{n(8,f=await Q("listallowedpubkeys"))}catch(e){console.error("Failed to load allowed pubkeys:",e)}}async function U(){try{n(11,g=await Q("listbannedevents"))}catch(e){console.error("Failed to load banned events:",e)}}async function P(){try{n(16,A=await Q("listblockedips"))}catch(e){console.error("Failed to load blocked IPs:",e)}}async function R(){try{n(19,C=await Q("listallowedkinds"))}catch(e){console.error("Failed to load allowed kinds:",e)}}async function T(){try{n(2,s=!0),n(21,x=await Q("listeventsneedingmoderation")),console.log("Loaded events needing moderation:",x)}catch(e){console.error("Failed to load events needing moderation:",e),n(3,a=`Failed to load moderation events: ${e.message}`),n(4,l="error"),n(21,x=[])}finally{n(2,s=!1)}}async function N(e){try{await Q("disallowkind",[e]),n(3,a="Kind disallowed successfully"),n(4,l="success"),await R()}catch(e){console.error("Failed to disallow kind:",e)}}async function O(e){try{await Q("allowevent",[e,"Approved from moderation queue"]),n(3,a="Event allowed successfully"),n(4,l="success"),await T()}catch(e){console.error("Failed to allow event from moderation:",e)}}async function M(e){try{await Q("banevent",[e,"Banned from moderation queue"]),n(3,a="Event banned successfully"),n(4,l="success"),await T()}catch(e){console.error("Failed to ban event from moderation:",e)}}F(()=>{setTimeout(()=>{S()},100)}),async function(){await Promise.all([D(),$(),U(),P(),R()])}();return e.$$set=e=>{"userSigner"in e&&n(35,r=e.userSigner),"userPubkey"in e&&n(36,i=e.userPubkey)},e.$$.update=()=>{1&e.$$.dirty[0]&&console.log("relayConfig changed:",B)},[B,o,s,a,l,c,u,d,f,p,h,g,m,y,v,w,A,k,I,C,E,x,[],S,T,async function(){if(u)try{await Q("banpubkey",[u,d]),n(3,a="Pubkey banned successfully"),n(4,l="success"),n(6,u=""),n(7,d=""),await D()}catch(e){console.error("Failed to ban pubkey:",e)}},async function(){if(p)try{await Q("allowpubkey",[p,h]),n(3,a="Pubkey allowed successfully"),n(4,l="success"),n(9,p=""),n(10,h=""),await $()}catch(e){console.error("Failed to allow pubkey:",e)}},async function(){if(m)try{await Q("banevent",[m,y]),n(3,a="Event banned successfully"),n(4,l="success"),n(12,m=""),n(13,y=""),await U()}catch(e){console.error("Failed to ban event:",e)}},async function(){if(v)try{await Q("allowevent",[v,w]),n(3,a="Event allowed successfully"),n(4,l="success"),n(14,v=""),n(15,w="")}catch(e){console.error("Failed to allow event:",e)}},async function(){if(k)try{await Q("blockip",[k,I]),n(3,a="IP blocked successfully"),n(4,l="success"),n(17,k=""),n(18,I=""),await P()}catch(e){console.error("Failed to block IP:",e)}},async function(){if(!E)return;const e=parseInt(E);if(isNaN(e))return n(3,a="Invalid kind number"),void n(4,l="error");try{await Q("allowkind",[e]),n(3,a="Kind allowed successfully"),n(4,l="success"),n(20,E=""),await R()}catch(e){console.error("Failed to allow kind:",e)}},N,async function(){try{n(2,s=!0),n(3,a="");const e=[];if(B.relay_name&&e.push(Q("changerelayname",[B.relay_name])),B.relay_description&&e.push(Q("changerelaydescription",[B.relay_description])),B.relay_icon&&e.push(Q("changerelayicon",[B.relay_icon])),0===e.length)return n(3,a="No changes to update"),void n(4,l="info");await Promise.all(e),n(3,a="Relay configuration updated successfully"),n(4,l="success"),await S()}catch(e){console.error("Failed to update relay configuration:",e),n(3,a=`Failed to update relay configuration: ${e.message}`),n(4,l="error")}finally{n(2,s=!1)}},O,M,r,i,()=>n(1,o="pubkeys"),()=>n(1,o="events"),()=>n(1,o="ips"),()=>n(1,o="kinds"),()=>{n(1,o="moderation"),x&&0!==x.length||T()},()=>n(1,o="relay"),function(){u=this.value,n(6,u)},function(){d=this.value,n(7,d)},function(){p=this.value,n(9,p)},function(){h=this.value,n(10,h)},function(){m=this.value,n(12,m)},function(){y=this.value,n(13,y)},function(){v=this.value,n(14,v)},function(){w=this.value,n(15,w)},function(){k=this.value,n(17,k)},function(){I=this.value,n(18,I)},function(){E=b(this.value),n(20,E)},e=>N(e),e=>O(e.id),e=>M(e.id),function(){B.relay_name=this.value,n(0,B)},function(){B.relay_description=this.value,n(0,B)},function(){B.relay_icon=this.value,n(0,B)}]}class Ig extends ie{constructor(e){super(),re(this,e,kg,bg,o,{userSigner:35,userPubkey:36},null,[-1,-1,-1])}}function Cg(e){let t,n;return{c(){t=p("span"),n=g(e[3]),A(t,"class","permission-badge svelte-1qkhxam")},m(e,r){u(e,t,r),c(t,n)},p(e,t){8&t&&k(n,e[3])},d(e){e&&d(t)}}}function Eg(t){let n,r,i;return{c(){n=p("button"),n.textContent="Log in",A(n,"class","login-btn svelte-1qkhxam")},m(e,o){u(e,n,o),r||(i=v(n,"click",t[7]),r=!0)},p:e,d(e){e&&d(n),r=!1,i()}}}function xg(e){let t,n,r,i,o,s,a=(e[4]?.name||e[5])+"";function l(e,t){return e[4]?.picture?Sg:Bg}let f=l(e),h=f(e);return{c(){t=p("button"),h.c(),n=m(),r=p("span"),i=g(a),A(r,"class","user-name svelte-1qkhxam"),A(t,"class","user-profile-btn svelte-1qkhxam")},m(a,l){u(a,t,l),h.m(t,null),c(t,n),c(t,r),c(r,i),o||(s=v(t,"click",e[6]),o=!0)},p(e,r){f===(f=l(e))&&h?h.p(e,r):(h.d(1),h=f(e),h&&(h.c(),h.m(t,n))),48&r&&a!==(a=(e[4]?.name||e[5])+"")&&k(i,a)},d(e){e&&d(t),h.d(),o=!1,s()}}}function Bg(t){let n;return{c(){n=p("div"),n.textContent="👤",A(n,"class","user-avatar-placeholder svelte-1qkhxam")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function Sg(e){let t,n;return{c(){t=p("img"),a(t.src,n=e[4].picture)||A(t,"src",n),A(t,"alt","User avatar"),A(t,"class","user-avatar svelte-1qkhxam")},m(e,n){u(e,t,n)},p(e,r){16&r&&!a(t.src,n=e[4].picture)&&A(t,"src",n)},d(e){e&&d(t)}}}function Qg(t){let n,r,i,o,s,l,f,h,y,v,w=t[1]&&t[2]&&Cg(t);function b(e,t){return e[1]?xg:Eg}let k=b(t),I=k(t);return{c(){n=p("header"),r=p("div"),i=p("img"),s=m(),l=p("div"),f=p("span"),h=g("ORLY? dashboard\n "),w&&w.c(),y=m(),v=p("div"),I.c(),a(i.src,o="/orly.png")||A(i,"src","/orly.png"),A(i,"alt","ORLY Logo"),A(i,"class","logo svelte-1qkhxam"),A(f,"class","app-title svelte-1qkhxam"),A(l,"class","header-title svelte-1qkhxam"),A(v,"class","header-buttons svelte-1qkhxam"),A(r,"class","header-content svelte-1qkhxam"),A(n,"class","main-header svelte-1qkhxam"),x(n,"dark-theme",t[0])},m(e,t){u(e,n,t),c(n,r),c(r,i),c(r,s),c(r,l),c(l,f),c(f,h),w&&w.m(f,null),c(r,y),c(r,v),I.m(v,null)},p(e,[t]){e[1]&&e[2]?w?w.p(e,t):(w=Cg(e),w.c(),w.m(f,null)):w&&(w.d(1),w=null),k===(k=b(e))&&I?I.p(e,t):(I.d(1),I=k(e),I&&(I.c(),I.m(v,null))),1&t&&x(n,"dark-theme",e[0])},i:e,o:e,d(e){e&&d(n),w&&w.d(),I.d()}}}function Fg(e,t,n){let{isDarkTheme:r=!1}=t,{isLoggedIn:i=!1}=t,{userRole:o=""}=t,{currentEffectiveRole:s=""}=t,{userProfile:a=null}=t,{userPubkey:l=""}=t;const c=$();return e.$$set=e=>{"isDarkTheme"in e&&n(0,r=e.isDarkTheme),"isLoggedIn"in e&&n(1,i=e.isLoggedIn),"userRole"in e&&n(2,o=e.userRole),"currentEffectiveRole"in e&&n(3,s=e.currentEffectiveRole),"userProfile"in e&&n(4,a=e.userProfile),"userPubkey"in e&&n(5,l=e.userPubkey)},[r,i,o,s,a,l,function(){c("openSettingsDrawer")},function(){c("openLoginModal")}]}class Dg extends ie{constructor(e){super(),re(this,e,Fg,Qg,o,{isDarkTheme:0,isLoggedIn:1,userRole:2,currentEffectiveRole:3,userProfile:4,userPubkey:5})}}function $g(e,t,n){const r=e.slice();return r[10]=t[n],r}function Ug(e){let t,n,i;function o(){return e[6](e[10])}function s(...t){return e[7](e[10],...t)}return{c(){t=p("span"),t.textContent="✕",A(t,"class","tab-close-icon svelte-wfmuj"),A(t,"role","button"),A(t,"tabindex","0")},m(e,r){u(e,t,r),n||(i=[v(t,"click",w(o)),v(t,"keydown",s)],n=!0)},p(t,n){e=t},d(e){e&&d(t),n=!1,r(i)}}}function Pg(e){let t,n,r,i,o,s,a,l,f,h,y=e[10].icon+"",w=e[10].label+"",b=e[10].isSearchTab&&Ug(e);function I(){return e[8](e[10])}return{c(){t=p("button"),n=p("span"),r=g(y),i=m(),o=p("span"),s=g(w),a=m(),b&&b.c(),l=m(),A(n,"class","tab-icon svelte-wfmuj"),A(o,"class","tab-label svelte-wfmuj"),A(t,"class","tab svelte-wfmuj"),x(t,"active",e[2]===e[10].id)},m(e,d){u(e,t,d),c(t,n),c(n,r),c(t,i),c(t,o),c(o,s),c(t,a),b&&b.m(t,null),c(t,l),f||(h=v(t,"click",I),f=!0)},p(n,i){e=n,2&i&&y!==(y=e[10].icon+"")&&k(r,y),2&i&&w!==(w=e[10].label+"")&&k(s,w),e[10].isSearchTab?b?b.p(e,i):(b=Ug(e),b.c(),b.m(t,l)):b&&(b.d(1),b=null),6&i&&x(t,"active",e[2]===e[10].id)},d(e){e&&d(t),b&&b.d(),f=!1,h()}}}function Rg(e){let t,n,r,i,o,s,a,l;return{c(){t=p("a"),n=h("svg"),r=h("path"),i=h("path"),o=m(),s=p("span"),a=g("v"),l=g(e[3]),A(r,"d","M5 6h12v2h1.5c1.38 0 2.5 1.12 2.5 2.5v1c0 1.38-1.12 2.5-2.5 2.5H17v1c0 1.66-1.34 3-3 3H8c-1.66 0-3-1.34-3-3V6zm12 6h1.5c.28 0 .5-.22.5-.5v-1c0-.28-.22-.5-.5-.5H17v2z"),A(i,"d","M9 9c1.5 0 3 .5 3 2.5S10.5 14 9 14c0-1.5.5-3.5 2-4.5"),A(i,"stroke","currentColor"),A(i,"stroke-width","1"),A(i,"fill","none"),A(n,"class","version-icon svelte-wfmuj"),A(n,"viewBox","0 0 24 24"),A(n,"fill","currentColor"),A(n,"xmlns","http://www.w3.org/2000/svg"),A(s,"class","version-text svelte-wfmuj"),A(t,"href","https://next.orly.dev"),A(t,"target","_blank"),A(t,"rel","noopener noreferrer"),A(t,"class","version-link svelte-wfmuj")},m(e,d){u(e,t,d),c(t,n),c(n,r),c(n,i),c(t,o),c(t,s),c(s,a),c(s,l)},p(e,t){8&t&&k(l,e[3])},d(e){e&&d(t)}}}function Tg(t){let n,r,i,o,s=t[1],a=[];for(let e=0;e{"isDarkTheme"in e&&n(0,r=e.isDarkTheme),"tabs"in e&&n(1,i=e.tabs),"selectedTab"in e&&n(2,o=e.selectedTab),"version"in e&&n(3,s=e.version)},[r,i,o,s,l,c,e=>c(e.id),(e,t)=>"Enter"===t.key&&c(e.id),e=>l(e.id)]}class Og extends ie{constructor(e){super(),re(this,e,Ng,Tg,o,{isDarkTheme:0,tabs:1,selectedTab:2,version:3})}}function Mg(t){let n,r,i,o,s,a;return{c(){n=p("div"),r=p("p"),r.textContent="Please log in to access export functionality.",i=m(),o=p("button"),o.textContent="Log In",A(r,"class","svelte-jzrdtj"),A(o,"class","login-btn svelte-jzrdtj"),A(n,"class","login-prompt svelte-jzrdtj")},m(e,l){u(e,n,l),c(n,r),c(n,i),c(n,o),s||(a=v(o,"click",t[5]),s=!0)},p:e,d(e){e&&d(n),s=!1,a()}}}function Lg(e){let t,n,r=e[0]&&_g(e),i=e[1]&&Hg(e);return{c(){r&&r.c(),t=m(),i&&i.c(),n=y()},m(e,o){r&&r.m(e,o),u(e,t,o),i&&i.m(e,o),u(e,n,o)},p(e,o){e[0]?r?r.p(e,o):(r=_g(e),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null),e[1]?i?i.p(e,o):(i=Hg(e),i.c(),i.m(n.parentNode,n)):i&&(i.d(1),i=null)},d(e){r&&r.d(e),e&&d(t),i&&i.d(e),e&&d(n)}}}function _g(t){let n,r,i,o,s,a,l,f;return{c(){n=p("div"),r=p("h3"),r.textContent="Export My Events",i=m(),o=p("p"),o.textContent="Download your personal events as a JSONL file.",s=m(),a=p("button"),a.textContent="📤 Export My Events",A(r,"class","svelte-jzrdtj"),A(o,"class","svelte-jzrdtj"),A(a,"class","export-btn svelte-jzrdtj"),A(n,"class","export-section svelte-jzrdtj")},m(e,d){u(e,n,d),c(n,r),c(n,i),c(n,o),c(n,s),c(n,a),l||(f=v(a,"click",t[3]),l=!0)},p:e,d(e){e&&d(n),l=!1,f()}}}function Hg(t){let n,r,i,o,s,a,l,f;return{c(){n=p("div"),r=p("h3"),r.textContent="Export All Events",i=m(),o=p("p"),o.textContent="Download the complete database as a JSONL file. This includes\n all events from all users.",s=m(),a=p("button"),a.textContent="📤 Export All Events",A(r,"class","svelte-jzrdtj"),A(o,"class","svelte-jzrdtj"),A(a,"class","export-btn svelte-jzrdtj"),A(n,"class","export-section svelte-jzrdtj")},m(e,d){u(e,n,d),c(n,r),c(n,i),c(n,o),c(n,s),c(n,a),l||(f=v(a,"click",t[4]),l=!0)},p:e,d(e){e&&d(n),l=!1,f()}}}function jg(t){let n;function r(e,t){return e[2]?Lg:Mg}let i=r(t),o=i(t);return{c(){o.c(),n=y()},m(e,t){o.m(e,t),u(e,n,t)},p(e,[t]){i===(i=r(e))&&o?o.p(e,t):(o.d(1),o=i(e),o&&(o.c(),o.m(n.parentNode,n)))},i:e,o:e,d(e){o.d(e),e&&d(n)}}}function Gg(e,t,n){let r,i,{isLoggedIn:o=!1}=t,{currentEffectiveRole:s=""}=t,{aclMode:a=""}=t;const l=$();return e.$$set=e=>{"isLoggedIn"in e&&n(0,o=e.isLoggedIn),"currentEffectiveRole"in e&&n(6,s=e.currentEffectiveRole),"aclMode"in e&&n(7,a=e.aclMode)},e.$$.update=()=>{129&e.$$.dirty&&n(2,r="none"===a||o),192&e.$$.dirty&&n(1,i="none"===a||"admin"===s||"owner"===s)},[o,i,r,function(){l("exportMyEvents")},function(){l("exportAllEvents")},function(){l("openLoginModal")},s,a]}class Jg extends ie{constructor(e){super(),re(this,e,Gg,jg,o,{isLoggedIn:0,currentEffectiveRole:6,aclMode:7})}}function Kg(t){let n,r,i,o,s,a,l,f;return{c(){n=p("div"),r=p("h3"),r.textContent="Import Events",i=m(),o=p("p"),o.textContent="Please log in to access import functionality.",s=m(),a=p("button"),a.textContent="Log In",A(r,"class","recovery-header svelte-nonyqh"),A(o,"class","recovery-description svelte-nonyqh"),A(a,"class","login-btn svelte-nonyqh"),A(n,"class","login-prompt svelte-nonyqh")},m(e,d){u(e,n,d),c(n,r),c(n,i),c(n,o),c(n,s),c(n,a),l||(f=v(a,"click",t[6]),l=!0)},p:e,d(e){e&&d(n),l=!1,f()}}}function Vg(t){let n;return{c(){n=p("div"),n.innerHTML='

Import Events

\n

Admin or owner permission required for import functionality.

',A(n,"class","permission-denied svelte-nonyqh")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function zg(e){let t,n,i,o,s,a,l,f,h,y,w,b,k,I,C=e[2]&&qg(e);return{c(){t=p("h3"),t.textContent="Import Events",n=m(),i=p("p"),i.textContent="Upload a JSONL file to import events into the database.",o=m(),s=p("div"),a=p("input"),l=m(),f=p("div"),h=p("button"),y=g("Import Events"),b=m(),C&&C.c(),A(t,"class","svelte-nonyqh"),A(i,"class","svelte-nonyqh"),A(a,"type","file"),A(a,"id","import-file"),A(a,"accept",".jsonl,.txt"),A(a,"class","svelte-nonyqh"),A(h,"class","import-btn svelte-nonyqh"),h.disabled=w=!e[1]||"Uploading..."===e[2],A(f,"class","import-row svelte-nonyqh"),A(s,"class","recovery-controls-card svelte-nonyqh")},m(r,d){u(r,t,d),u(r,n,d),u(r,i,d),u(r,o,d),u(r,s,d),c(s,a),c(s,l),c(s,f),c(f,h),c(h,y),c(f,b),C&&C.m(f,null),k||(I=[v(a,"change",e[4]),v(h,"click",e[5])],k=!0)},p(e,t){6&t&&w!==(w=!e[1]||"Uploading..."===e[2])&&(h.disabled=w),e[2]?C?C.p(e,t):(C=qg(e),C.c(),C.m(f,null)):C&&(C.d(1),C=null)},d(e){e&&d(t),e&&d(n),e&&d(i),e&&d(o),e&&d(s),C&&C.d(),k=!1,r(I)}}}function qg(e){let t,n;return{c(){t=p("span"),n=g(e[2]),A(t,"class","import-message svelte-nonyqh"),x(t,"uploading","Uploading..."===e[2]),x(t,"success","Upload complete"===e[2]),x(t,"error",e[2].startsWith("Import failed")||e[2].startsWith("Admin")||e[2].startsWith("Please"))},m(e,r){u(e,t,r),c(t,n)},p(e,r){4&r&&k(n,e[2]),4&r&&x(t,"uploading","Uploading..."===e[2]),4&r&&x(t,"success","Upload complete"===e[2]),4&r&&x(t,"error",e[2].startsWith("Import failed")||e[2].startsWith("Admin")||e[2].startsWith("Please"))},d(e){e&&d(t)}}}function Yg(t){let n;function r(e,t){return e[3]?zg:e[0]?Vg:Kg}let i=r(t),o=i(t);return{c(){n=p("div"),o.c(),A(n,"class","import-section svelte-nonyqh")},m(e,t){u(e,n,t),o.m(n,null)},p(e,[t]){i===(i=r(e))&&o?o.p(e,t):(o.d(1),o=i(e),o&&(o.c(),o.m(n,null)))},i:e,o:e,d(e){e&&d(n),o.d()}}}function Wg(e,t,n){let r,{isLoggedIn:i=!1}=t,{currentEffectiveRole:o=""}=t,{selectedFile:s=null}=t,{aclMode:a=""}=t,{importMessage:l=""}=t;const c=$();return e.$$set=e=>{"isLoggedIn"in e&&n(0,i=e.isLoggedIn),"currentEffectiveRole"in e&&n(7,o=e.currentEffectiveRole),"selectedFile"in e&&n(1,s=e.selectedFile),"aclMode"in e&&n(8,a=e.aclMode),"importMessage"in e&&n(2,l=e.importMessage)},e.$$.update=()=>{385&e.$$.dirty&&n(3,r="none"===a||i&&("admin"===o||"owner"===o))},[i,s,l,r,function(e){c("fileSelect",e)},function(){c("importEvents")},function(){c("openLoginModal")},o,a]}class Zg extends ie{constructor(e){super(),re(this,e,Wg,Yg,o,{isLoggedIn:0,currentEffectiveRole:7,selectedFile:1,aclMode:8,importMessage:2})}}const Xg={0:"Profile Metadata",1:"Text Note",2:"Recommend Relay",3:"Contacts",4:"Encrypted DM",5:"Delete Request",6:"Repost",7:"Reaction",8:"Badge Award",16:"Generic Repost",40:"Channel Creation",41:"Channel Metadata",42:"Channel Message",43:"Channel Hide Message",44:"Channel Mute User",1063:"File Metadata",1311:"Live Chat Message",1984:"Reporting",1985:"Label",9734:"Zap Request",9735:"Zap Receipt",1e4:"Mute List",10001:"Pin List",10002:"Relay List Metadata",10003:"Bookmark List",10004:"Communities List",10005:"Public Chats List",10006:"Blocked Relays List",10007:"Search Relays List",10009:"User Groups",10015:"Interests List",10030:"User Emoji List",13194:"Wallet Info",22242:"Client Auth",23194:"Wallet Request",23195:"Wallet Response",24133:"Nostr Connect",27235:"HTTP Auth",3e4:"Categorized People List",30001:"Categorized Bookmarks",30002:"Categorized Relay List",30003:"Bookmark Sets",30004:"Curation Sets",30005:"Video Sets",30008:"Profile Badges",30009:"Badge Definition",30015:"Interest Sets",30017:"Create/Update Stall",30018:"Create/Update Product",30019:"Marketplace UI/UX",30020:"Product Sold As Auction",30023:"Long-form Content",30024:"Draft Long-form Content",30030:"Emoji Sets",30063:"Release Artifact Sets",30078:"Application-specific Data",30311:"Live Event",30315:"User Statuses",30388:"Slide Set",30402:"Classified Listing",30403:"Draft Classified Listing",30617:"Repository Announcement",30618:"Repository State Announcement",30818:"Wiki Article",30819:"Redirects",31922:"Date-Based Calendar Event",31923:"Time-Based Calendar Event",31924:"Calendar",31925:"Calendar Event RSVP",31989:"Handler Recommendation",31990:"Handler Information",34550:"Community Definition",34551:"Community Post Approval"};function em(e,t=null){if(!e||"string"!=typeof e)return!1;return!!/^[0-9a-fA-F]+$/.test(e)&&(!t||e.length===t)}function tm(e){const t=new Date(1e3*e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}T${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function nm(e){return Math.floor(new Date(e).getTime()/1e3)}function rm(e,t,n){const r=e.slice();return r[62]=t[n],r[64]=n,r}function im(e,t,n){const r=e.slice();return r[65]=t[n],r}function om(e,t,n){const r=e.slice();return r[68]=t[n],r}function sm(e,t,n){const r=e.slice();return r[71]=t[n],r}function am(e,t,n){const r=e.slice();return r[71]=t[n].kind,r[74]=t[n].name,r}function lm(e){let t,n,r,i,o,s,a=e[20],l=[];for(let t=0;t0&&um(t),Ge=t[17]&&fm(t),Je=t[2].length>0&&pm(t),Ke=t[18]&&gm(t),Ve=t[3].length>0&&mm(t),ze=t[19]&&vm(t),qe=t[4].length>0&&wm(t),Ye=t[5]&&bm(t),We=t[6]&&km(t),Ze=t[8]&&Im(t);return{c(){n=p("div"),i=p("div"),o=p("div"),s=p("label"),s.textContent="Search Text (NIP-50)",a=m(),l=p("div"),f=p("input"),h=m(),y=p("label"),y.textContent="Event Kinds",w=m(),C=p("div"),E=p("button"),B=g(Le),S=g(" Select Kinds ("),Q=g(_e),F=g(" selected)"),D=m(),He&&He.c(),$=m(),je&&je.c(),U=m(),P=p("label"),P.textContent="Authors (Pubkeys)",R=m(),T=p("div"),N=p("div"),O=p("input"),M=m(),L=p("button"),L.textContent="Add",_=m(),Ge&&Ge.c(),H=m(),Je&&Je.c(),j=m(),G=p("label"),G.textContent="Event IDs",J=m(),K=p("div"),V=p("div"),z=p("input"),q=m(),Y=p("button"),Y.textContent="Add",W=m(),Ke&&Ke.c(),Z=m(),Ve&&Ve.c(),X=m(),ee=p("label"),ee.textContent="Tags (#e, #p, #a)",te=m(),ne=p("div"),re=p("div"),ie=p("span"),ie.textContent="#",oe=m(),se=p("input"),ae=m(),le=p("input"),ce=m(),ue=p("button"),ue.textContent="Add",de=m(),ze&&ze.c(),fe=m(),qe&&qe.c(),pe=m(),he=p("label"),he.textContent="Since",ge=m(),me=p("div"),ye=p("input"),ve=m(),Ye&&Ye.c(),we=m(),Ae=p("label"),Ae.textContent="Until",be=m(),ke=p("div"),Ie=p("input"),Ce=m(),We&&We.c(),Ee=m(),xe=p("label"),xe.textContent="Limit",Be=m(),Se=p("div"),Qe=p("input"),Fe=m(),Ze&&Ze.c(),De=m(),$e=p("div"),Ue=p("button"),Ue.textContent="🧹",Pe=m(),Re=p("div"),Te=m(),Ne=p("button"),Ne.textContent="",A(s,"for","search-text"),A(s,"class","svelte-1a1v6k0"),A(f,"id","search-text"),A(f,"type","text"),A(f,"placeholder","Search events..."),A(f,"class","filter-input svelte-1a1v6k0"),A(l,"class","field-content svelte-1a1v6k0"),A(y,"class","svelte-1a1v6k0"),A(E,"class","picker-toggle-btn svelte-1a1v6k0"),A(C,"class","field-content svelte-1a1v6k0"),A(P,"class","svelte-1a1v6k0"),A(O,"type","text"),A(O,"placeholder","64 character hex pubkey..."),A(O,"class","filter-input svelte-1a1v6k0"),A(O,"maxlength","64"),A(L,"class","add-btn svelte-1a1v6k0"),A(N,"class","input-group svelte-1a1v6k0"),A(T,"class","field-content svelte-1a1v6k0"),A(G,"class","svelte-1a1v6k0"),A(z,"type","text"),A(z,"placeholder","64 character hex event ID..."),A(z,"class","filter-input svelte-1a1v6k0"),A(z,"maxlength","64"),A(Y,"class","add-btn svelte-1a1v6k0"),A(V,"class","input-group svelte-1a1v6k0"),A(K,"class","field-content svelte-1a1v6k0"),A(ee,"class","svelte-1a1v6k0"),A(ie,"class","hash-prefix svelte-1a1v6k0"),A(se,"type","text"),A(se,"placeholder","Tag"),A(se,"class","filter-input tag-name-input svelte-1a1v6k0"),A(se,"maxlength","1"),A(le,"type","text"),A(le,"placeholder","Value..."),A(le,"class","filter-input tag-value-input svelte-1a1v6k0"),A(ue,"class","add-btn svelte-1a1v6k0"),A(re,"class","tag-input-group svelte-1a1v6k0"),A(ne,"class","field-content svelte-1a1v6k0"),A(he,"for","since-timestamp"),A(he,"class","svelte-1a1v6k0"),A(ye,"id","since-timestamp"),A(ye,"type","datetime-local"),ye.value=t[32](),A(ye,"class","filter-input svelte-1a1v6k0"),A(me,"class","field-content timestamp-field svelte-1a1v6k0"),A(Ae,"for","until-timestamp"),A(Ae,"class","svelte-1a1v6k0"),A(Ie,"id","until-timestamp"),A(Ie,"type","datetime-local"),Ie.value=t[33](),A(Ie,"class","filter-input svelte-1a1v6k0"),A(ke,"class","field-content timestamp-field svelte-1a1v6k0"),A(xe,"for","limit"),A(xe,"class","svelte-1a1v6k0"),A(Qe,"id","limit"),A(Qe,"type","number"),A(Qe,"placeholder","Max events to return"),A(Qe,"class","filter-input svelte-1a1v6k0"),A(Qe,"min","1"),A(Se,"class","field-content svelte-1a1v6k0"),A(o,"class","filter-grid svelte-1a1v6k0"),A(i,"class","filter-content svelte-1a1v6k0"),A(Ue,"class","clear-all-btn svelte-1a1v6k0"),A(Ue,"title","Clear all filters"),A(Re,"class","spacer svelte-1a1v6k0"),A(Ne,"class","json-toggle-btn svelte-1a1v6k0"),A(Ne,"title","Edit filter JSON"),x(Ne,"active",t[8]),A($e,"class","clear-column svelte-1a1v6k0"),A(n,"class","filter-builder svelte-1a1v6k0")},m(e,r){u(e,n,r),c(n,i),c(i,o),c(o,s),c(o,a),c(o,l),c(l,f),I(f,t[0]),c(o,h),c(o,y),c(o,w),c(o,C),c(C,E),c(E,B),c(E,S),c(E,Q),c(E,F),c(C,D),He&&He.m(C,null),c(C,$),je&&je.m(C,null),c(o,U),c(o,P),c(o,R),c(o,T),c(T,N),c(N,O),I(O,t[13]),c(N,M),c(N,L),c(T,_),Ge&&Ge.m(T,null),c(T,H),Je&&Je.m(T,null),c(o,j),c(o,G),c(o,J),c(o,K),c(K,V),c(V,z),I(z,t[14]),c(V,q),c(V,Y),c(K,W),Ke&&Ke.m(K,null),c(K,Z),Ve&&Ve.m(K,null),c(o,X),c(o,ee),c(o,te),c(o,ne),c(ne,re),c(re,ie),c(re,oe),c(re,se),I(se,t[15]),c(re,ae),c(re,le),I(le,t[16]),c(re,ce),c(re,ue),c(ne,de),ze&&ze.m(ne,null),c(ne,fe),qe&&qe.m(ne,null),c(o,pe),c(o,he),c(o,ge),c(o,me),c(me,ye),c(me,ve),Ye&&Ye.m(me,null),c(o,we),c(o,Ae),c(o,be),c(o,ke),c(ke,Ie),c(ke,Ce),We&&We.m(ke,null),c(o,Ee),c(o,xe),c(o,Be),c(o,Se),c(Se,Qe),I(Qe,t[7]),c(o,Fe),Ze&&Ze.m(o,null),c(n,De),c(n,$e),c($e,Ue),c($e,Pe),c($e,Re),c($e,Te),c($e,Ne),Oe||(Me=[v(f,"input",t[38]),v(E,"click",t[39]),v(O,"input",t[43]),v(O,"keydown",t[44]),v(L,"click",t[25]),v(z,"input",t[46]),v(z,"keydown",t[47]),v(Y,"click",t[27]),v(se,"input",t[49]),v(le,"input",t[50]),v(le,"keydown",t[51]),v(ue,"click",t[29]),v(ye,"change",t[34]),v(Ie,"change",t[35]),v(Qe,"input",t[55]),v(Ue,"click",t[31]),v(Ne,"click",t[57])],Oe=!0)},p(e,t){1&t[0]&&f.value!==e[0]&&I(f,e[0]),4096&t[0]&&Le!==(Le=e[12]?"▼":"▶")&&k(B,Le),2&t[0]&&_e!==(_e=e[1].length+"")&&k(Q,_e),e[12]?He?He.p(e,t):(He=lm(e),He.c(),He.m(C,$)):He&&(He.d(1),He=null),e[1].length>0?je?je.p(e,t):(je=um(e),je.c(),je.m(C,null)):je&&(je.d(1),je=null),8192&t[0]&&O.value!==e[13]&&I(O,e[13]),e[17]?Ge?Ge.p(e,t):(Ge=fm(e),Ge.c(),Ge.m(T,H)):Ge&&(Ge.d(1),Ge=null),e[2].length>0?Je?Je.p(e,t):(Je=pm(e),Je.c(),Je.m(T,null)):Je&&(Je.d(1),Je=null),16384&t[0]&&z.value!==e[14]&&I(z,e[14]),e[18]?Ke?Ke.p(e,t):(Ke=gm(e),Ke.c(),Ke.m(K,Z)):Ke&&(Ke.d(1),Ke=null),e[3].length>0?Ve?Ve.p(e,t):(Ve=mm(e),Ve.c(),Ve.m(K,null)):Ve&&(Ve.d(1),Ve=null),32768&t[0]&&se.value!==e[15]&&I(se,e[15]),65536&t[0]&&le.value!==e[16]&&I(le,e[16]),e[19]?ze?ze.p(e,t):(ze=vm(e),ze.c(),ze.m(ne,fe)):ze&&(ze.d(1),ze=null),e[4].length>0?qe?qe.p(e,t):(qe=wm(e),qe.c(),qe.m(ne,null)):qe&&(qe.d(1),qe=null),e[5]?Ye?Ye.p(e,t):(Ye=bm(e),Ye.c(),Ye.m(me,null)):Ye&&(Ye.d(1),Ye=null),e[6]?We?We.p(e,t):(We=km(e),We.c(),We.m(ke,null)):We&&(We.d(1),We=null),128&t[0]&&b(Qe.value)!==e[7]&&I(Qe,e[7]),e[8]?Ze?Ze.p(e,t):(Ze=Im(e),Ze.c(),Ze.m(o,null)):Ze&&(Ze.d(1),Ze=null),256&t[0]&&x(Ne,"active",e[8])},i:e,o:e,d(e){e&&d(n),He&&He.d(),je&&je.d(),Ge&&Ge.d(),Je&&Je.d(),Ke&&Ke.d(),Ve&&Ve.d(),ze&&ze.d(),qe&&qe.d(),Ye&&Ye.d(),We&&We.d(),Ze&&Ze.d(),Oe=!1,r(Me)}}}function xm(e,t,n){let r,i;const o=$();let{searchText:s=""}=t,{selectedKinds:a=[]}=t,{pubkeys:l=[]}=t,{eventIds:c=[]}=t,{tags:u=[]}=t,{sinceTimestamp:d=null}=t,{untilTimestamp:f=null}=t,{limit:p=null}=t,{showJsonEditor:h=!1}=t,g="",m="",y=!1,v="",w="",A="",k="",I="",C="",E="",x="",B=null,S=!1;function Q(e){a.includes(e)?n(1,a=a.filter(t=>t!==e)):n(1,a=[...a,e].sort((e,t)=>e-t))}function F(e){n(1,a=a.filter(t=>t!==e))}function U(){const e=w.trim();e&&(em(e,64)?l.includes(e)?n(17,C="Pubkey already added"):(n(2,l=[...l,e]),n(13,w=""),n(17,C="")):n(17,C="Invalid pubkey: must be 64 character hex string"))}function P(e){n(2,l=l.filter(t=>t!==e))}function R(){const e=A.trim();e&&(em(e,64)?c.includes(e)?n(18,E="Event ID already added"):(n(3,c=[...c,e]),n(14,A=""),n(18,E="")):n(18,E="Invalid event ID: must be 64 character hex string"))}function T(e){n(3,c=c.filter(t=>t!==e))}function N(){const e=k.trim(),t=I.trim();e&&t&&(/^[a-zA-Z]$/.test(e)?u.some(n=>n.name===e&&n.value===t)?n(19,x="Tag already added"):(n(4,u=[...u,{name:e,value:t}]),n(15,k=""),n(16,I=""),n(19,x="")):n(19,x="Invalid tag name: must be single letter a-z or A-Z"))}function O(e){n(4,u=u.filter((t,n)=>n!==e))}function M(){o("apply",{searchText:s,selectedKinds:a,pubkeys:l,eventIds:c,tags:u,sinceTimestamp:d,untilTimestamp:f,limit:p})}D(()=>{B&&clearTimeout(B)});return e.$$set=e=>{"searchText"in e&&n(0,s=e.searchText),"selectedKinds"in e&&n(1,a=e.selectedKinds),"pubkeys"in e&&n(2,l=e.pubkeys),"eventIds"in e&&n(3,c=e.eventIds),"tags"in e&&n(4,u=e.tags),"sinceTimestamp"in e&&n(5,d=e.sinceTimestamp),"untilTimestamp"in e&&n(6,f=e.untilTimestamp),"limit"in e&&n(7,p=e.limit),"showJsonEditor"in e&&n(8,h=e.showJsonEditor)},e.$$.update=()=>{if(256&e.$$.dirty[0]&&h){const e=function(){const e={};return a.length>0&&(e.kinds=a),l.length>0&&(e.authors=l),c.length>0&&(e.ids=c),d&&(e.since=d),f&&(e.until=f),p&&(e.limit=p),s&&(e.search=s),u.forEach(t=>{const n=`#${t.name}`;e[n]||(e[n]=[]),e[n].push(t.value)}),e}();n(10,g=JSON.stringify(e,null,2))}255&e.$$.dirty[0]|32&e.$$.dirty[1]&&(S?(B&&clearTimeout(B),B=setTimeout(()=>{M()},1e3)):n(36,S=!0)),512&e.$$.dirty[0]|64&e.$$.dirty[1]&&n(20,i=r.filter(e=>e.kind.toString().includes(v)||e.name.toLowerCase().includes(v.toLowerCase())))},n(37,r=Object.entries(Xg).map(([e,t])=>({kind:parseInt(e),name:t})).sort((e,t)=>e.kind-t.kind)),[s,a,l,c,u,d,f,p,h,v,g,m,y,w,A,k,I,C,E,x,i,o,function(){try{const e=JSON.parse(g);n(11,m=""),n(1,a=e.kinds||[]),n(2,l=e.authors||[]),n(3,c=e.ids||[]),n(5,d=e.since||null),n(6,f=e.until||null),n(7,p=e.limit||null),n(0,s=e.search||""),n(4,u=[]),Object.keys(e).forEach(t=>{if(t.startsWith("#")&&2===t.length){const n=t.slice(1);(Array.isArray(e[t])?e[t]:[e[t]]).forEach(e=>{u.push({name:n,value:String(e)})})}}),n(4,u),B&&clearTimeout(B),M()}catch(e){n(11,m="Invalid JSON: "+e.message)}},Q,F,U,P,R,T,N,O,function(){n(0,s=""),n(1,a=[]),n(2,l=[]),n(3,c=[]),n(4,u=[]),n(5,d=null),n(6,f=null),n(7,p=null),o("clear")},function(){return d?tm(d):""},function(){return f?tm(f):""},function(e){const t=e.target.value;n(5,d=t?nm(t):null)},function(e){const t=e.target.value;n(6,f=t?nm(t):null)},S,r,function(){s=this.value,n(0,s)},()=>n(12,y=!y),function(){v=this.value,n(9,v)},e=>Q(e),e=>F(e),function(){w=this.value,n(13,w)},e=>"Enter"===e.key&&U(),e=>P(e),function(){A=this.value,n(14,A)},e=>"Enter"===e.key&&R(),e=>T(e),function(){k=this.value,n(15,k)},function(){I=this.value,n(16,I)},e=>"Enter"===e.key&&N(),e=>O(e),()=>n(5,d=null),()=>n(6,f=null),function(){p=b(this.value),n(7,p)},function(){g=this.value,n(10,g),n(8,h)},()=>o("toggleJson")]}class Bm extends ie{constructor(e){super(),re(this,e,xm,Em,o,{searchText:0,selectedKinds:1,pubkeys:2,eventIds:3,tags:4,sinceTimestamp:5,untilTimestamp:6,limit:7,showJsonEditor:8},null,[-1,-1,-1])}}function Sm(e,t,n){const r=e.slice();return r[28]=t[n],r}function Qm(e,t,n){const r=e.slice();return r[31]=t[n],r}function Fm(t){let n;return{c(){n=p("div"),n.innerHTML="

❌ Read, write, admin, or owner permission required to view all\n events.

",A(n,"class","permission-denied svelte-5kb1ec")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function Dm(e){let t,n,r,i;function o(e,t){return e[4].length>0?Um:e[6]?void 0:$m}let s=o(e),a=s&&s(e),l=e[6]&&_m();return{c(){t=p("div"),a&&a.c(),n=m(),l&&l.c(),A(t,"class","events-view-content svelte-5kb1ec")},m(o,s){u(o,t,s),a&&a.m(t,null),c(t,n),l&&l.m(t,null),r||(i=v(t,"scroll",e[9]),r=!0)},p(e,r){s===(s=o(e))&&a?a.p(e,r):(a&&a.d(1),a=s&&s(e),a&&(a.c(),a.m(t,n))),e[6]?l||(l=_m(),l.c(),l.m(t,null)):l&&(l.d(1),l=null)},d(e){e&&d(t),a&&a.d(),l&&l.d(),r=!1,i()}}}function $m(t){let n;return{c(){n=p("div"),n.innerHTML="

No events found.

",A(n,"class","no-events svelte-5kb1ec")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function Um(e){let t,n=e[4],r=[];for(let t=0;t0&&Tm(e);return{c(){t=p("div"),n=p("span"),n.textContent="🗑️ Delete Event",r=m(),i&&i.c(),A(n,"class","delete-event-label svelte-5kb1ec"),A(t,"class","delete-event-info svelte-5kb1ec")},m(e,o){u(e,t,o),c(t,n),c(t,r),i&&i.m(t,null)},p(e,n){e[28].tags&&e[28].tags.length>0?i?i.p(e,n):(i=Tm(e),i.c(),i.m(t,null)):i&&(i.d(1),i=null)},d(e){e&&d(t),i&&i.d()}}}function Tm(e){let t,n=e[28].tags.filter(Ym),r=[];for(let t=0;t👤',o=m(),s=p("div"),a=p("div"),l=g(T),f=m(),h=p("div"),y=p("span"),w=g(N),b=m(),I=p("span"),C=g(O),E=m(),B=p("div"),S=p("div"),Q=g(M),F=m(),j.c(),D=m(),G&&G.c(),$=m(),V&&V.c(),U=m(),A(i,"class","events-view-avatar svelte-5kb1ec"),A(a,"class","events-view-author svelte-5kb1ec"),A(y,"class","kind-number svelte-5kb1ec"),x(y,"delete-event",5===e[28].kind),A(I,"class","kind-name svelte-5kb1ec"),A(h,"class","events-view-kind svelte-5kb1ec"),A(s,"class","events-view-info svelte-5kb1ec"),A(S,"class","event-timestamp svelte-5kb1ec"),A(B,"class","events-view-content svelte-5kb1ec"),A(n,"class","events-view-row svelte-5kb1ec"),A(n,"role","button"),A(n,"tabindex","0"),A(t,"class","events-view-item svelte-5kb1ec"),x(t,"expanded",e[5].has(e[28].id))},m(e,r){u(e,t,r),c(t,n),c(n,i),c(n,o),c(n,s),c(s,a),c(a,l),c(s,f),c(s,h),c(h,y),c(y,w),c(h,b),c(h,I),c(I,C),c(n,E),c(n,B),c(B,S),c(S,Q),c(B,F),j.m(B,null),c(n,D),G&&G.m(n,null),c(t,$),V&&V.m(t,null),c(t,U),P||(R=[v(n,"click",J),v(n,"keydown",K)],P=!0)},p(r,i){e=r,16&i[0]&&T!==(T=Km(e[28].pubkey)+"")&&k(l,T),16&i[0]&&N!==(N=e[28].kind+"")&&k(w,N),16&i[0]&&x(y,"delete-event",5===e[28].kind),16&i[0]&&O!==(O=Vm(e[28].kind)+"")&&k(C,O),16&i[0]&&M!==(M=zm(e[28].created_at)+"")&&k(Q,M),H===(H=_(e))&&j?j.p(e,i):(j.d(1),j=H(e),j&&(j.c(),j.m(B,null))),5!==e[28].kind&&("admin"===e[2]||"owner"===e[2]||"write"===e[2]&&e[28].pubkey&&e[28].pubkey===e[3])?G?G.p(e,i):(G=Om(e),G.c(),G.m(n,null)):G&&(G.d(1),G=null),48&i[0]&&(L=e[5].has(e[28].id)),L?V?V.p(e,i):(V=Mm(e),V.c(),V.m(t,U)):V&&(V.d(1),V=null),48&i[0]&&x(t,"expanded",e[5].has(e[28].id))},d(e){e&&d(t),j.d(),G&&G.d(),V&&V.d(),P=!1,r(R)}}}function _m(e){let t;return{c(){t=p("div"),t.innerHTML='
\n

Loading events...

',A(t,"class","loading-events svelte-5kb1ec")},m(e,n){u(e,t,n)},d(e){e&&d(t)}}}function Hm(e){let t,n,i,o,s,a,l,f,h,y,w,b,k,I,C,E,B,S,Q,F,D,$,U,P;function R(e,t){return e[6]?Gm:jm}i=new Bm({props:{showJsonEditor:e[8]}}),i.$on("apply",e[17]),i.$on("clear",e[18]),i.$on("toggleJson",e[16]);let T=R(e),N=T(e);return{c(){t=p("div"),n=p("div"),X(i.$$.fragment),o=m(),s=p("div"),a=p("div"),l=p("button"),l.innerHTML='',f=m(),h=p("div"),y=p("label"),w=p("input"),b=m(),k=p("span"),I=m(),C=p("span"),C.textContent="Only show my events",E=m(),B=p("div"),S=p("button"),Q=g("🔄 Load More"),F=m(),D=p("button"),N.c(),A(n,"class","filter-panel svelte-5kb1ec"),x(n,"open",e[7]),A(l,"class","filter-btn svelte-5kb1ec"),A(l,"title","Filter events"),x(l,"active",e[7]),A(w,"type","checkbox"),A(w,"class","svelte-5kb1ec"),A(k,"class","toggle-slider svelte-5kb1ec"),A(C,"class","toggle-label svelte-5kb1ec"),A(y,"class","toggle-container svelte-5kb1ec"),A(h,"class","events-view-toggle svelte-5kb1ec"),A(a,"class","events-view-left svelte-5kb1ec"),A(S,"class","refresh-btn svelte-5kb1ec"),S.disabled=e[6],A(D,"class","reload-btn svelte-5kb1ec"),D.disabled=e[6],A(B,"class","events-view-buttons svelte-5kb1ec"),A(s,"class","events-view-header svelte-5kb1ec"),A(t,"class","events-view-footer svelte-5kb1ec")},m(r,d){u(r,t,d),c(t,n),ee(i,n,null),c(t,o),c(t,s),c(s,a),c(a,l),c(a,f),c(a,h),c(h,y),c(y,w),w.checked=e[0],c(y,b),c(y,k),c(y,I),c(y,C),c(s,E),c(s,B),c(B,S),c(S,Q),c(B,F),c(B,D),N.m(D,null),$=!0,U||(P=[v(l,"click",e[15]),v(w,"change",e[23]),v(w,"change",e[24]),v(S,"click",e[25]),v(D,"click",e[26])],U=!0)},p(e,t){const r={};256&t[0]&&(r.showJsonEditor=e[8]),i.$set(r),(!$||128&t[0])&&x(n,"open",e[7]),(!$||128&t[0])&&x(l,"active",e[7]),1&t[0]&&(w.checked=e[0]),(!$||64&t[0])&&(S.disabled=e[6]),T!==(T=R(e))&&(N.d(1),N=T(e),N&&(N.c(),N.m(D,null))),(!$||64&t[0])&&(D.disabled=e[6])},i(e){$||(Y(i.$$.fragment,e),$=!0)},o(e){W(i.$$.fragment,e),$=!1},d(e){e&&d(t),te(i),N.d(),U=!1,r(P)}}}function jm(e){let t;return{c(){t=g("🔄")},m(e,n){u(e,t,n)},d(e){e&&d(t)}}}function Gm(e){let t;return{c(){t=p("div"),A(t,"class","spinner svelte-5kb1ec")},m(e,n){u(e,t,n)},d(e){e&&d(t)}}}function Jm(e){let t,n,r;function i(e,t){return!e[1]||"read"!==e[2]&&"write"!==e[2]&&"admin"!==e[2]&&"owner"!==e[2]?Fm:Dm}let o=i(e),s=o(e),a=e[1]&&("read"===e[2]||"write"===e[2]||"admin"===e[2]||"owner"===e[2])&&Hm(e);return{c(){t=p("div"),s.c(),n=m(),a&&a.c(),A(t,"class","events-view-container svelte-5kb1ec")},m(e,i){u(e,t,i),s.m(t,null),c(t,n),a&&a.m(t,null),r=!0},p(e,r){o===(o=i(e))&&s?s.p(e,r):(s.d(1),s=o(e),s&&(s.c(),s.m(t,n))),!e[1]||"read"!==e[2]&&"write"!==e[2]&&"admin"!==e[2]&&"owner"!==e[2]?a&&(z(),W(a,1,1,()=>{a=null}),q()):a?(a.p(e,r),6&r[0]&&Y(a,1)):(a=Hm(e),a.c(),Y(a,1),a.m(t,null))},i(e){r||(Y(a),r=!0)},o(e){W(a),r=!1},d(e){e&&d(t),s.d(),a&&a.d()}}}function Km(e){return e?e.slice(0,8)+"..."+e.slice(-8):""}function Vm(e){return{0:"Profile",1:"Text Note",2:"Recommend Relay",3:"Contacts",4:"Encrypted DM",5:"Delete",6:"Repost",7:"Reaction",8:"Badge Award",16:"Generic Repost",40:"Channel Creation",41:"Channel Metadata",42:"Channel Message",43:"Channel Hide Message",44:"Channel Mute User",1984:"Reporting",9734:"Zap Request",9735:"Zap",1e4:"Mute List",10001:"Pin List",10002:"Relay List",22242:"Client Auth",24133:"Nostr Connect",27235:"HTTP Auth",3e4:"Categorized People",30001:"Categorized Bookmarks",30008:"Profile Badges",30009:"Badge Definition",30017:"Create or update a stall",30018:"Create or update a product",30023:"Long-form Content",30024:"Draft Long-form Content",30078:"Application-specific Data",30311:"Live Event",30315:"User Statuses",30402:"Classified Listing",30403:"Draft Classified Listing",31922:"Date-Based Calendar Event",31923:"Time-Based Calendar Event",31924:"Calendar",31925:"Calendar Event RSVP",31989:"Handler recommendation",31990:"Handler information",34550:"Community Definition"}[e]||`Kind ${e}`}function zm(e){return new Date(1e3*e).toLocaleString()}function qm(e){return e?e.length>100?e.slice(0,100)+"...":e:""}const Ym=e=>"e"===e[0];function Wm(e,t,n){let{isLoggedIn:r=!1}=t,{userRole:i=""}=t,{userPubkey:o=""}=t,{filteredEvents:s=[]}=t,{expandedEvents:a=new Set}=t,{isLoadingEvents:l=!1}=t,{showOnlyMyEvents:c=!1}=t,{showFilterBuilder:u=!1}=t;const d=$();let f=!1;function p(e){d("toggleEventExpansion",e)}function h(e){d("deleteEvent",e)}function g(e,t){d("copyEventToClipboard",{event:e,e:t})}function m(){d("toggleChange")}function y(e,t){d("loadAllEvents",{refresh:e,authors:t})}return e.$$set=e=>{"isLoggedIn"in e&&n(1,r=e.isLoggedIn),"userRole"in e&&n(2,i=e.userRole),"userPubkey"in e&&n(3,o=e.userPubkey),"filteredEvents"in e&&n(4,s=e.filteredEvents),"expandedEvents"in e&&n(5,a=e.expandedEvents),"isLoadingEvents"in e&&n(6,l=e.isLoadingEvents),"showOnlyMyEvents"in e&&n(0,c=e.showOnlyMyEvents),"showFilterBuilder"in e&&n(7,u=e.showFilterBuilder)},[c,r,i,o,s,a,l,u,f,function(e){d("scroll",e)},p,h,g,m,y,function(){d("toggleFilterBuilder")},function(){n(8,f=!f)},function(e){d("filterApply",e.detail)},function(){d("filterClear")},e=>h(e.id),e=>p(e.id),(e,t)=>"Enter"===t.key&&p(e.id),(e,t)=>g(e,t),function(){c=this.checked,n(0,c)},()=>m(),()=>{y(!1,c&&o?[o]:null)},()=>{y(!0,c&&o?[o]:null)}]}class Zm extends ie{constructor(e){super(),re(this,e,Wm,Jm,o,{isLoggedIn:1,userRole:2,userPubkey:3,filteredEvents:4,expandedEvents:5,isLoadingEvents:6,showOnlyMyEvents:0,showFilterBuilder:7},null,[-1,-1])}}const Xm=[{kind:0,name:"Metadata",description:"User profile information (name, about, picture, nip05, etc.)",nip:"01",isReplaceable:!0,template:{kind:0,content:"",tags:[]}},{kind:1,name:"Short Text Note",description:"Short-form text post (like a tweet)",nip:"01",template:{kind:1,content:"",tags:[]}},{kind:2,name:"Recommend Relay",description:"Relay recommendation",nip:"01",deprecated:!0,template:{kind:2,content:"",tags:[]}},{kind:3,name:"Follows",description:"Following list with optional relay hints",nip:"02",isReplaceable:!0,template:{kind:3,content:"",tags:[]}},{kind:4,name:"Encrypted Direct Message",description:"Private message using NIP-04 encryption",nip:"04",deprecated:!0,template:{kind:4,content:"",tags:[]}},{kind:5,name:"Event Deletion Request",description:"Request to delete events",nip:"09",template:{kind:5,content:"",tags:[]}},{kind:6,name:"Repost",description:"Share/repost another text note",nip:"18",template:{kind:6,content:"",tags:[]}},{kind:7,name:"Reaction",description:"Like, emoji reaction to an event",nip:"25",template:{kind:7,content:"",tags:[]}},{kind:8,name:"Badge Award",description:"Award a badge to someone",nip:"58",template:{kind:8,content:"",tags:[]}},{kind:9,name:"Chat Message",description:"Chat message",nip:"C7",template:{kind:9,content:"",tags:[]}},{kind:10,name:"Group Chat Threaded Reply",description:"Threaded reply in group chat",nip:"29",deprecated:!0,template:{kind:10,content:"",tags:[]}},{kind:11,name:"Thread",description:"Thread event",nip:"7D",template:{kind:11,content:"",tags:[]}},{kind:12,name:"Group Thread Reply",description:"Reply in group thread",nip:"29",deprecated:!0,template:{kind:12,content:"",tags:[]}},{kind:13,name:"Seal",description:"Sealed/encrypted event wrapper",nip:"59",template:{kind:13,content:"",tags:[]}},{kind:14,name:"Direct Message",description:"Private direct message using NIP-17",nip:"17",template:{kind:14,content:"",tags:[]}},{kind:15,name:"File Message",description:"File message in DMs",nip:"17",template:{kind:15,content:"",tags:[]}},{kind:16,name:"Generic Repost",description:"Repost any event kind",nip:"18",template:{kind:16,content:"",tags:[]}},{kind:17,name:"Reaction to Website",description:"Reaction to a website URL",nip:"25",template:{kind:17,content:"",tags:[]}},{kind:20,name:"Picture",description:"Picture-first feed post",nip:"68",template:{kind:20,content:"",tags:[]}},{kind:21,name:"Video Event",description:"Horizontal video event",nip:"71",template:{kind:21,content:"",tags:[]}},{kind:22,name:"Short-form Video",description:"Short-form portrait video (like TikTok)",nip:"71",template:{kind:22,content:"",tags:[]}},{kind:40,name:"Channel Creation",description:"Create a public chat channel",nip:"28",template:{kind:40,content:"",tags:[]}},{kind:41,name:"Channel Metadata",description:"Set channel name, about, picture",nip:"28",template:{kind:41,content:"",tags:[]}},{kind:42,name:"Channel Message",description:"Post message in channel",nip:"28",template:{kind:42,content:"",tags:[]}},{kind:43,name:"Channel Hide Message",description:"Hide a message in channel",nip:"28",template:{kind:43,content:"",tags:[]}},{kind:44,name:"Channel Mute User",description:"Mute a user in channel",nip:"28",template:{kind:44,content:"",tags:[]}},{kind:62,name:"Request to Vanish",description:"Request permanent deletion of all user data",nip:"62",template:{kind:62,content:"",tags:[]}},{kind:64,name:"Chess (PGN)",description:"Chess game in PGN format",nip:"64",template:{kind:64,content:"",tags:[]}},{kind:443,name:"KeyPackage",description:"Marmot protocol key package",nip:null,spec:"Marmot",template:{kind:443,content:"",tags:[]}},{kind:444,name:"Welcome Message",description:"Marmot protocol welcome message",nip:null,spec:"Marmot",template:{kind:444,content:"",tags:[]}},{kind:445,name:"Group Event",description:"Marmot protocol group event",nip:null,spec:"Marmot",template:{kind:445,content:"",tags:[]}},{kind:818,name:"Merge Requests",description:"Git merge request",nip:"54",template:{kind:818,content:"",tags:[]}},{kind:1018,name:"Poll Response",description:"Response to a poll",nip:"88",template:{kind:1018,content:"",tags:[]}},{kind:1021,name:"Bid",description:"Auction bid",nip:"15",template:{kind:1021,content:"",tags:[]}},{kind:1022,name:"Bid Confirmation",description:"Confirmation of auction bid",nip:"15",template:{kind:1022,content:"",tags:[]}},{kind:1040,name:"OpenTimestamps",description:"OpenTimestamps attestation",nip:"03",template:{kind:1040,content:"",tags:[]}},{kind:1059,name:"Gift Wrap",description:"Encrypted gift-wrapped event",nip:"59",template:{kind:1059,content:"",tags:[]}},{kind:1060,name:"Gift Wrap (Kind 4)",description:"Gift wrap variant for NIP-04 compatibility",nip:"59",template:{kind:1060,content:"",tags:[]}},{kind:1063,name:"File Metadata",description:"Metadata for shared files",nip:"94",template:{kind:1063,content:"",tags:[]}},{kind:1068,name:"Poll",description:"Create a poll",nip:"88",template:{kind:1068,content:"",tags:[]}},{kind:1111,name:"Comment",description:"Comment on events or external content",nip:"22",template:{kind:1111,content:"",tags:[]}},{kind:1222,name:"Voice Message",description:"Voice message",nip:"A0",template:{kind:1222,content:"",tags:[]}},{kind:1244,name:"Voice Message Comment",description:"Comment on voice message",nip:"A0",template:{kind:1244,content:"",tags:[]}},{kind:1311,name:"Live Chat Message",description:"Message in live stream chat",nip:"53",template:{kind:1311,content:"",tags:[]}},{kind:1337,name:"Code Snippet",description:"Code snippet post",nip:"C0",template:{kind:1337,content:"",tags:[]}},{kind:1517,name:"Bitcoin Block",description:"Bitcoin block data",nip:null,spec:"Nostrocket",template:{kind:1517,content:"",tags:[]}},{kind:1617,name:"Patches",description:"Git patches",nip:"34",template:{kind:1617,content:"",tags:[]}},{kind:1618,name:"Pull Requests",description:"Git pull request",nip:"34",template:{kind:1618,content:"",tags:[]}},{kind:1619,name:"Pull Request Updates",description:"Updates to git pull request",nip:"34",template:{kind:1619,content:"",tags:[]}},{kind:1621,name:"Issues",description:"Git issues",nip:"34",template:{kind:1621,content:"",tags:[]}},{kind:1622,name:"Git Replies",description:"Replies on git objects",nip:"34",deprecated:!0,template:{kind:1622,content:"",tags:[]}},{kind:1630,name:"Status",description:"Git status",nip:"34",template:{kind:1630,content:"",tags:[]}},{kind:1631,name:"Status",description:"Git status",nip:"34",template:{kind:1631,content:"",tags:[]}},{kind:1632,name:"Status",description:"Git status",nip:"34",template:{kind:1632,content:"",tags:[]}},{kind:1633,name:"Status",description:"Git status",nip:"34",template:{kind:1633,content:"",tags:[]}},{kind:1808,name:"Live Stream",description:"Live streaming event",nip:null,spec:"zap.stream",template:{kind:1808,content:"",tags:[]}},{kind:1971,name:"Problem Tracker",description:"Problem tracking",nip:null,spec:"Nostrocket",template:{kind:1971,content:"",tags:[]}},{kind:1984,name:"Reporting",description:"Report content or users",nip:"56",template:{kind:1984,content:"",tags:[]}},{kind:1985,name:"Label",description:"Label/tag content with namespace",nip:"32",template:{kind:1985,content:"",tags:[]}},{kind:1986,name:"Relay Reviews",description:"Reviews of relays",nip:null,template:{kind:1986,content:"",tags:[]}},{kind:1987,name:"AI Embeddings",description:"AI embeddings/vector lists",nip:null,spec:"NKBIP-02",template:{kind:1987,content:"",tags:[]}},{kind:2003,name:"Torrent",description:"Torrent magnet link",nip:"35",template:{kind:2003,content:"",tags:[]}},{kind:2004,name:"Torrent Comment",description:"Comment on torrent",nip:"35",template:{kind:2004,content:"",tags:[]}},{kind:2022,name:"Coinjoin Pool",description:"Coinjoin coordination",nip:null,spec:"joinstr",template:{kind:2022,content:"",tags:[]}},{kind:4550,name:"Community Post Approval",description:"Approve post in community",nip:"72",template:{kind:4550,content:"",tags:[]}},{kind:5e3,name:"Job Request",description:"Data vending machine job request (start of range)",nip:"90",template:{kind:5e3,content:"",tags:[]}},{kind:6e3,name:"Job Result",description:"Data vending machine job result (start of range)",nip:"90",template:{kind:6e3,content:"",tags:[]}},{kind:7e3,name:"Job Feedback",description:"Feedback on job request/result",nip:"90",template:{kind:7e3,content:"",tags:[]}},{kind:7374,name:"Reserved Cashu Wallet Tokens",description:"Reserved Cashu wallet tokens",nip:"60",template:{kind:7374,content:"",tags:[]}},{kind:7375,name:"Cashu Wallet Tokens",description:"Cashu wallet tokens",nip:"60",template:{kind:7375,content:"",tags:[]}},{kind:7376,name:"Cashu Wallet History",description:"Cashu wallet transaction history",nip:"60",template:{kind:7376,content:"",tags:[]}},{kind:7516,name:"Geocache Log",description:"Geocaching log entry",nip:null,spec:"geocaching",template:{kind:7516,content:"",tags:[]}},{kind:7517,name:"Geocache Proof of Find",description:"Proof of geocache find",nip:null,spec:"geocaching",template:{kind:7517,content:"",tags:[]}},{kind:8e3,name:"Add User",description:"Add user to group",nip:"43",template:{kind:8e3,content:"",tags:[]}},{kind:8001,name:"Remove User",description:"Remove user from group",nip:"43",template:{kind:8001,content:"",tags:[]}},{kind:9e3,name:"Group Control Events",description:"Group control events (start of range)",nip:"29",template:{kind:9e3,content:"",tags:[]}},{kind:9041,name:"Zap Goal",description:"Fundraising goal for zaps",nip:"75",template:{kind:9041,content:"",tags:[]}},{kind:9321,name:"Nutzap",description:"Cashu nutzap",nip:"61",template:{kind:9321,content:"",tags:[]}},{kind:9467,name:"Tidal Login",description:"Tidal streaming login",nip:null,spec:"Tidal-nostr",template:{kind:9467,content:"",tags:[]}},{kind:9734,name:"Zap Request",description:"Request Lightning payment",nip:"57",template:{kind:9734,content:"",tags:[]}},{kind:9735,name:"Zap",description:"Lightning payment receipt",nip:"57",template:{kind:9735,content:"",tags:[]}},{kind:9802,name:"Highlights",description:"Highlighted text selection",nip:"84",template:{kind:9802,content:"",tags:[]}},{kind:1e4,name:"Mute List",description:"List of muted users/content",nip:"51",isReplaceable:!0,template:{kind:1e4,content:"",tags:[]}},{kind:10001,name:"Pin List",description:"Pinned events",nip:"51",isReplaceable:!0,template:{kind:10001,content:"",tags:[]}},{kind:10002,name:"Relay List Metadata",description:"User's preferred relays for read/write",nip:"65",isReplaceable:!0,template:{kind:10002,content:"",tags:[]}},{kind:10003,name:"Bookmark List",description:"Bookmarked events",nip:"51",isReplaceable:!0,template:{kind:10003,content:"",tags:[]}},{kind:10004,name:"Communities List",description:"Communities user belongs to",nip:"51",isReplaceable:!0,template:{kind:10004,content:"",tags:[]}},{kind:10005,name:"Public Chats List",description:"Public chats user is in",nip:"51",isReplaceable:!0,template:{kind:10005,content:"",tags:[]}},{kind:10006,name:"Blocked Relays List",description:"Relays user has blocked",nip:"51",isReplaceable:!0,template:{kind:10006,content:"",tags:[]}},{kind:10007,name:"Search Relays List",description:"Preferred search relays",nip:"51",isReplaceable:!0,template:{kind:10007,content:"",tags:[]}},{kind:10008,name:"Relay Group Configuration",description:"Relay group configuration",nip:null,isReplaceable:!0,template:{kind:10008,content:"",tags:[]}},{kind:10009,name:"User Groups",description:"Groups user belongs to",nip:"29",isReplaceable:!0,template:{kind:10009,content:"",tags:[]}},{kind:10012,name:"Favorite Relays List",description:"User's favorite relays",nip:"51",isReplaceable:!0,template:{kind:10012,content:"",tags:[]}},{kind:10013,name:"Private Event Relay List",description:"Relays for private events",nip:"37",isReplaceable:!0,template:{kind:10013,content:"",tags:[]}},{kind:10015,name:"Interests List",description:"User interests/topics",nip:"51",isReplaceable:!0,template:{kind:10015,content:"",tags:[]}},{kind:10019,name:"Nutzap Mint Recommendation",description:"Recommended Cashu mints for nutzaps",nip:"61",isReplaceable:!0,template:{kind:10019,content:"",tags:[]}},{kind:10020,name:"Media Follows",description:"Followed media accounts",nip:"51",isReplaceable:!0,template:{kind:10020,content:"",tags:[]}},{kind:10030,name:"User Emoji List",description:"Custom emoji list",nip:"51",isReplaceable:!0,template:{kind:10030,content:"",tags:[]}},{kind:10050,name:"DM Relays List",description:"Relays to receive DMs on",nip:"17",isReplaceable:!0,template:{kind:10050,content:"",tags:[]}},{kind:10051,name:"KeyPackage Relays List",description:"Marmot key package relays",nip:null,isReplaceable:!0,spec:"Marmot",template:{kind:10051,content:"",tags:[]}},{kind:10063,name:"User Server List",description:"Blossom server list",nip:null,isReplaceable:!0,spec:"Blossom",template:{kind:10063,content:"",tags:[]}},{kind:10096,name:"File Storage Server List",description:"File storage servers",nip:"96",isReplaceable:!0,deprecated:!0,template:{kind:10096,content:"",tags:[]}},{kind:10166,name:"Relay Monitor Announcement",description:"Relay monitoring announcement",nip:"66",isReplaceable:!0,template:{kind:10166,content:"",tags:[]}},{kind:10312,name:"Room Presence",description:"Presence in live room",nip:"53",isReplaceable:!0,template:{kind:10312,content:"",tags:[]}},{kind:10377,name:"Proxy Announcement",description:"Nostr proxy announcement",nip:null,isReplaceable:!0,spec:"Nostr Epoxy",template:{kind:10377,content:"",tags:[]}},{kind:11111,name:"Transport Method Announcement",description:"Transport method announcement",nip:null,isReplaceable:!0,spec:"Nostr Epoxy",template:{kind:11111,content:"",tags:[]}},{kind:12345,name:"Relay Policy Configuration",description:"Relay-internal policy configuration (admin only)",nip:null,isReplaceable:!0,spec:"orly",template:{kind:12345,content:"",tags:[]}},{kind:13004,name:"JWT Binding",description:"Link between JWT certificate and pubkey",nip:null,isReplaceable:!0,template:{kind:13004,content:"",tags:[]}},{kind:13194,name:"Wallet Service Info",description:"NWC wallet service information",nip:"47",isReplaceable:!0,template:{kind:13194,content:"",tags:[]}},{kind:13534,name:"Membership Lists",description:"Group membership lists",nip:"43",isReplaceable:!0,template:{kind:13534,content:"",tags:[]}},{kind:14388,name:"User Sound Effect Lists",description:"Sound effect lists",nip:null,isReplaceable:!0,spec:"Corny Chat",template:{kind:14388,content:"",tags:[]}},{kind:17375,name:"Cashu Wallet Event",description:"Cashu wallet event",nip:"60",isReplaceable:!0,template:{kind:17375,content:"",tags:[]}},{kind:21e3,name:"Lightning Pub RPC",description:"Lightning.Pub RPC",nip:null,isEphemeral:!0,spec:"Lightning.Pub",template:{kind:21e3,content:"",tags:[]}},{kind:22242,name:"Client Authentication",description:"Authenticate to relay",nip:"42",isEphemeral:!0,template:{kind:22242,content:"",tags:[]}},{kind:23194,name:"Wallet Request",description:"NWC wallet request",nip:"47",isEphemeral:!0,template:{kind:23194,content:"",tags:[]}},{kind:23195,name:"Wallet Response",description:"NWC wallet response",nip:"47",isEphemeral:!0,template:{kind:23195,content:"",tags:[]}},{kind:23196,name:"Wallet Notification (NIP-04)",description:"NWC wallet notification (NIP-04 encrypted)",nip:"47",isEphemeral:!0,template:{kind:23196,content:"",tags:[]}},{kind:23197,name:"Wallet Notification",description:"NWC wallet notification",nip:"47",isEphemeral:!0,template:{kind:23197,content:"",tags:[]}},{kind:24133,name:"Nostr Connect",description:"Remote signer connection",nip:"46",isEphemeral:!0,template:{kind:24133,content:"",tags:[]}},{kind:24242,name:"Blobs Stored on Mediaservers",description:"Blossom blob storage",nip:null,isEphemeral:!0,spec:"Blossom",template:{kind:24242,content:"",tags:[]}},{kind:27235,name:"HTTP Auth",description:"Authenticate HTTP requests",nip:"98",isEphemeral:!0,template:{kind:27235,content:"",tags:[]}},{kind:28934,name:"Join Request",description:"Request to join group",nip:"43",isEphemeral:!0,template:{kind:28934,content:"",tags:[]}},{kind:28935,name:"Invite Request",description:"Invite to group",nip:"43",isEphemeral:!0,template:{kind:28935,content:"",tags:[]}},{kind:28936,name:"Leave Request",description:"Leave group request",nip:"43",isEphemeral:!0,template:{kind:28936,content:"",tags:[]}},{kind:3e4,name:"Follow Sets",description:"Categorized people lists",nip:"51",isAddressable:!0,template:{kind:3e4,content:"",tags:[["d","identifier"]]}},{kind:30001,name:"Generic Lists",description:"Generic categorized lists",nip:"51",isAddressable:!0,deprecated:!0,template:{kind:30001,content:"",tags:[["d","identifier"]]}},{kind:30002,name:"Relay Sets",description:"Categorized relay lists",nip:"51",isAddressable:!0,template:{kind:30002,content:"",tags:[["d","identifier"]]}},{kind:30003,name:"Bookmark Sets",description:"Categorized bookmark lists",nip:"51",isAddressable:!0,template:{kind:30003,content:"",tags:[["d","identifier"]]}},{kind:30004,name:"Curation Sets",description:"Curated content sets",nip:"51",isAddressable:!0,template:{kind:30004,content:"",tags:[["d","identifier"]]}},{kind:30005,name:"Video Sets",description:"Video playlists",nip:"51",isAddressable:!0,template:{kind:30005,content:"",tags:[["d","identifier"]]}},{kind:30007,name:"Kind Mute Sets",description:"Muted event kinds",nip:"51",isAddressable:!0,template:{kind:30007,content:"",tags:[["d","identifier"]]}},{kind:30008,name:"Profile Badges",description:"Badges displayed on profile",nip:"58",isAddressable:!0,template:{kind:30008,content:"",tags:[["d","identifier"]]}},{kind:30009,name:"Badge Definition",description:"Define a badge/achievement",nip:"58",isAddressable:!0,template:{kind:30009,content:"",tags:[["d","identifier"]]}},{kind:30015,name:"Interest Sets",description:"Interest/topic sets",nip:"51",isAddressable:!0,template:{kind:30015,content:"",tags:[["d","identifier"]]}},{kind:30017,name:"Stall",description:"Marketplace stall definition",nip:"15",isAddressable:!0,template:{kind:30017,content:"",tags:[["d","identifier"]]}},{kind:30018,name:"Product",description:"Marketplace product listing",nip:"15",isAddressable:!0,template:{kind:30018,content:"",tags:[["d","identifier"]]}},{kind:30019,name:"Marketplace UI/UX",description:"Marketplace interface settings",nip:"15",isAddressable:!0,template:{kind:30019,content:"",tags:[["d","identifier"]]}},{kind:30020,name:"Product Sold as Auction",description:"Auction product listing",nip:"15",isAddressable:!0,template:{kind:30020,content:"",tags:[["d","identifier"]]}},{kind:30023,name:"Long-form Content",description:"Blog post, article in markdown",nip:"23",isAddressable:!0,template:{kind:30023,content:"",tags:[["d","identifier"]]}},{kind:30024,name:"Draft Long-form Content",description:"Draft article",nip:"23",isAddressable:!0,template:{kind:30024,content:"",tags:[["d","identifier"]]}},{kind:30030,name:"Emoji Sets",description:"Custom emoji sets",nip:"51",isAddressable:!0,template:{kind:30030,content:"",tags:[["d","identifier"]]}},{kind:30040,name:"Curated Publication Index",description:"Publication index",nip:null,isAddressable:!0,spec:"NKBIP-01",template:{kind:30040,content:"",tags:[["d","identifier"]]}},{kind:30041,name:"Curated Publication Content",description:"Publication content",nip:null,isAddressable:!0,spec:"NKBIP-01",template:{kind:30041,content:"",tags:[["d","identifier"]]}},{kind:30063,name:"Release Artifact Sets",description:"Software release artifacts",nip:"51",isAddressable:!0,template:{kind:30063,content:"",tags:[["d","identifier"]]}},{kind:30078,name:"Application-specific Data",description:"App-specific key-value storage",nip:"78",isAddressable:!0,template:{kind:30078,content:"",tags:[["d","identifier"]]}},{kind:30166,name:"Relay Discovery",description:"Relay discovery/monitoring",nip:"66",isAddressable:!0,template:{kind:30166,content:"",tags:[["d","identifier"]]}},{kind:30267,name:"App Curation Sets",description:"Curated app sets",nip:"51",isAddressable:!0,template:{kind:30267,content:"",tags:[["d","identifier"]]}},{kind:30311,name:"Live Event",description:"Live streaming event",nip:"53",isAddressable:!0,template:{kind:30311,content:"",tags:[["d","identifier"]]}},{kind:30312,name:"Interactive Room",description:"Interactive live room",nip:"53",isAddressable:!0,template:{kind:30312,content:"",tags:[["d","identifier"]]}},{kind:30313,name:"Conference Event",description:"Conference/meetup event",nip:"53",isAddressable:!0,template:{kind:30313,content:"",tags:[["d","identifier"]]}},{kind:30315,name:"User Statuses",description:"User status updates",nip:"38",isAddressable:!0,template:{kind:30315,content:"",tags:[["d","identifier"]]}},{kind:30388,name:"Slide Set",description:"Presentation slides",nip:null,isAddressable:!0,spec:"Corny Chat",template:{kind:30388,content:"",tags:[["d","identifier"]]}},{kind:30402,name:"Classified Listing",description:"Classified ad listing",nip:"99",isAddressable:!0,template:{kind:30402,content:"",tags:[["d","identifier"]]}},{kind:30403,name:"Draft Classified Listing",description:"Draft classified ad",nip:"99",isAddressable:!0,template:{kind:30403,content:"",tags:[["d","identifier"]]}},{kind:30617,name:"Repository Announcements",description:"Git repository announcement",nip:"34",isAddressable:!0,template:{kind:30617,content:"",tags:[["d","identifier"]]}},{kind:30618,name:"Repository State Announcements",description:"Git repository state",nip:"34",isAddressable:!0,template:{kind:30618,content:"",tags:[["d","identifier"]]}},{kind:30818,name:"Wiki Article",description:"Wiki article",nip:"54",isAddressable:!0,template:{kind:30818,content:"",tags:[["d","identifier"]]}},{kind:30819,name:"Redirects",description:"URL redirects",nip:"54",isAddressable:!0,template:{kind:30819,content:"",tags:[["d","identifier"]]}},{kind:31234,name:"Draft Event",description:"Draft of any event",nip:"37",isAddressable:!0,template:{kind:31234,content:"",tags:[["d","identifier"]]}},{kind:31388,name:"Link Set",description:"Link collection",nip:null,isAddressable:!0,spec:"Corny Chat",template:{kind:31388,content:"",tags:[["d","identifier"]]}},{kind:31890,name:"Feed",description:"Custom feed definition",nip:null,isAddressable:!0,spec:"NUD: Custom Feeds",template:{kind:31890,content:"",tags:[["d","identifier"]]}},{kind:31922,name:"Date-Based Calendar Event",description:"All-day calendar event",nip:"52",isAddressable:!0,template:{kind:31922,content:"",tags:[["d","identifier"]]}},{kind:31923,name:"Time-Based Calendar Event",description:"Calendar event with time",nip:"52",isAddressable:!0,template:{kind:31923,content:"",tags:[["d","identifier"]]}},{kind:31924,name:"Calendar",description:"Calendar definition",nip:"52",isAddressable:!0,template:{kind:31924,content:"",tags:[["d","identifier"]]}},{kind:31925,name:"Calendar Event RSVP",description:"RSVP to calendar event",nip:"52",isAddressable:!0,template:{kind:31925,content:"",tags:[["d","identifier"]]}},{kind:31989,name:"Handler Recommendation",description:"Recommended app for event kind",nip:"89",isAddressable:!0,template:{kind:31989,content:"",tags:[["d","identifier"]]}},{kind:31990,name:"Handler Information",description:"App handler declaration",nip:"89",isAddressable:!0,template:{kind:31990,content:"",tags:[["d","identifier"]]}},{kind:32123,name:"WaveLake Track",description:"WaveLake music track",nip:null,isAddressable:!0,spec:"WaveLake",template:{kind:32123,content:"",tags:[["d","identifier"]]}},{kind:32267,name:"Software Application",description:"Software application listing",nip:null,isAddressable:!0,template:{kind:32267,content:"",tags:[["d","identifier"]]}},{kind:32388,name:"User Room Favorites",description:"Favorite rooms",nip:null,isAddressable:!0,spec:"Corny Chat",template:{kind:32388,content:"",tags:[["d","identifier"]]}},{kind:33388,name:"High Scores",description:"Game high scores",nip:null,isAddressable:!0,spec:"Corny Chat",template:{kind:33388,content:"",tags:[["d","identifier"]]}},{kind:34235,name:"Video Event Horizontal",description:"Horizontal video event",nip:"71",isAddressable:!0,template:{kind:34235,content:"",tags:[["d","identifier"]]}},{kind:34236,name:"Video Event Vertical",description:"Vertical video event",nip:"71",isAddressable:!0,template:{kind:34236,content:"",tags:[["d","identifier"]]}},{kind:34388,name:"Sound Effects",description:"Sound effect definitions",nip:null,isAddressable:!0,spec:"Corny Chat",template:{kind:34388,content:"",tags:[["d","identifier"]]}},{kind:34550,name:"Community Definition",description:"Define a community",nip:"72",isAddressable:!0,template:{kind:34550,content:"",tags:[["d","identifier"]]}},{kind:37516,name:"Geocache Listing",description:"Geocache location listing",nip:null,isAddressable:!0,spec:"geocaching",template:{kind:37516,content:"",tags:[["d","identifier"]]}},{kind:38172,name:"Cashu Mint Announcement",description:"Cashu mint announcement",nip:"87",isAddressable:!0,template:{kind:38172,content:"",tags:[["d","identifier"]]}},{kind:38173,name:"Fedimint Announcement",description:"Fedimint announcement",nip:"87",isAddressable:!0,template:{kind:38173,content:"",tags:[["d","identifier"]]}},{kind:38383,name:"Peer-to-peer Order Events",description:"P2P trading orders",nip:"69",isAddressable:!0,template:{kind:38383,content:"",tags:[["d","identifier"]]}},{kind:39e3,name:"Group Metadata Events",description:"Group metadata (start of range)",nip:"29",isAddressable:!0,template:{kind:39e3,content:"",tags:[["d","identifier"]]}},{kind:39089,name:"Starter Packs",description:"Starter pack lists",nip:"51",isAddressable:!0,template:{kind:39089,content:"",tags:[["d","identifier"]]}},{kind:39092,name:"Media Starter Packs",description:"Media starter packs",nip:"51",isAddressable:!0,template:{kind:39092,content:"",tags:[["d","identifier"]]}},{kind:39701,name:"Web Bookmarks",description:"Web URL bookmarks",nip:"B0",isAddressable:!0,template:{kind:39701,content:"",tags:[["d","identifier"]]}},{kind:39998,name:"ACL Event",description:"Access control list event",nip:null,isAddressable:!0,template:{kind:39998,content:"",tags:[["d","identifier"]]}}];function ey(e,t=null){const n=function(e){return Xm.find(t=>t.kind===e)}(e);return n?{...n.template,created_at:Math.floor(Date.now()/1e3),pubkey:t||""}:{kind:e,content:"",tags:[],created_at:Math.floor(Date.now()/1e3),pubkey:t||""}}const ty=[{id:"all",name:"All Kinds",filter:()=>!0},{id:"regular",name:"Regular Events (0-9999)",filter:e=>e.kind<1e4&&!e.isReplaceable},{id:"replaceable",name:"Replaceable (10000-19999)",filter:e=>e.isReplaceable},{id:"ephemeral",name:"Ephemeral (20000-29999)",filter:e=>e.isEphemeral},{id:"addressable",name:"Addressable (30000-39999)",filter:e=>e.isAddressable},{id:"social",name:"Social",filter:e=>[0,1,3,6,7].includes(e.kind)},{id:"messaging",name:"Messaging",filter:e=>[4,9,10,11,12,14,15,40,41,42].includes(e.kind)},{id:"lists",name:"Lists",filter:e=>e.name.toLowerCase().includes("list")||e.name.toLowerCase().includes("set")},{id:"marketplace",name:"Marketplace",filter:e=>[30017,30018,30019,30020,1021,1022,30402,30403].includes(e.kind)},{id:"lightning",name:"Lightning/Zaps",filter:e=>[9734,9735,9041,9321,7374,7375,7376].includes(e.kind)},{id:"media",name:"Media",filter:e=>[20,21,22,1063,1222,1244].includes(e.kind)},{id:"git",name:"Git/Code",filter:e=>[818,1337,1617,1618,1619,1621,1622,30617,30618].includes(e.kind)},{id:"calendar",name:"Calendar",filter:e=>[31922,31923,31924,31925].includes(e.kind)},{id:"groups",name:"Groups",filter:e=>e.kind>=9e3&&e.kind<=9030||e.kind>=39e3&&e.kind<=39009}];function ny(e,t,n){const r=e.slice();return r[13]=t[n],r}function ry(e,t,n){const r=e.slice();return r[16]=t[n],r}function iy(e){let t,n,i,o,s,a,l,h,y,w,b,C,E,x,B,S,Q,F,D,$,U,P,R,T,N,O=e[3].length+"",M=1!==e[3].length?"s":"",L=ty,_=[];for(let t=0;t=2e4&&e.kind<3e4?"badge-ephemeral":"badge-regular"}function fy(e){return e.isAddressable?"Addressable":e.isReplaceable?"Replaceable":e.kind>=2e4&&e.kind<3e4?"Ephemeral":"Regular"}function py(e,t,n){let{isOpen:r=!1}=t,{userPubkey:i=""}=t;const o=$();let s="",a="all",l=Xm;function c(e){const t=ey(e.kind,i);o("select",{kind:e,template:t}),u()}function u(){n(0,r=!1),n(1,s=""),n(2,a="all"),o("close")}return e.$$set=e=>{"isOpen"in e&&n(0,r=e.isOpen),"userPubkey"in e&&n(8,i=e.userPubkey)},e.$$.update=()=>{if(6&e.$$.dirty){let e=Xm;const t=ty.find(e=>e.id===a);if(t&&(e=e.filter(t.filter)),s.trim()){const t=s.toLowerCase();e=e.filter(e=>e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)||e.kind.toString().includes(t)||e.nip&&e.nip.includes(t))}n(3,l=e)}},[r,s,a,l,c,u,function(e){"Escape"===e.key&&u()},function(e){e.target===e.currentTarget&&u()},i,function(){s=this.value,n(1,s)},e=>n(2,a=e.id),e=>c(e)]}class hy extends ie{constructor(e){super(),re(this,e,py,uy,o,{isOpen:0,userPubkey:8})}}function gy(e){let t,n,r,i,o,s,a,l,f,h;return{c(){t=p("div"),n=p("div"),r=p("span"),r.textContent="⚠",i=m(),o=p("span"),s=g(e[1]),a=m(),l=p("button"),l.textContent="×",A(r,"class","error-icon svelte-46pmgb"),A(o,"class","error-message svelte-46pmgb"),A(n,"class","error-content svelte-46pmgb"),A(l,"class","error-dismiss svelte-46pmgb"),A(t,"class","error-banner svelte-46pmgb")},m(d,p){u(d,t,p),c(t,n),c(n,r),c(n,i),c(n,o),c(o,s),c(t,a),c(t,l),f||(h=v(l,"click",e[10]),f=!0)},p(e,t){2&t&&k(s,e[1])},d(e){e&&d(t),f=!1,h()}}}function my(e){let t,n,i,o,s,a,l,f,h,g,y,w,b,k,C,E,x,B,S,Q=e[1]&&gy(e);function F(t){e[14](t)}let D={userPubkey:e[2]};return void 0!==e[3]&&(D.isOpen=e[3]),C=new hy({props:D}),R.push(()=>Z(C,"isOpen",F)),C.$on("select",e[8]),C.$on("close",e[9]),{c(){t=p("div"),n=p("div"),i=p("button"),i.textContent="Generate Template",o=m(),s=p("button"),s.textContent="Reformat",a=m(),l=p("button"),l.textContent="Sign",f=m(),h=p("button"),h.textContent="Publish",g=m(),Q&&Q.c(),y=m(),w=p("div"),b=p("textarea"),k=m(),X(C.$$.fragment),A(i,"class","compose-btn template-btn svelte-46pmgb"),A(s,"class","compose-btn reformat-btn svelte-46pmgb"),A(l,"class","compose-btn sign-btn svelte-46pmgb"),A(h,"class","compose-btn publish-btn svelte-46pmgb"),A(n,"class","compose-header svelte-46pmgb"),A(b,"class","compose-textarea svelte-46pmgb"),A(b,"placeholder","Enter your Nostr event JSON here, or click 'Generate Template' to start with a template..."),A(b,"spellcheck","false"),A(w,"class","compose-editor svelte-46pmgb"),A(t,"class","compose-view svelte-46pmgb")},m(r,d){u(r,t,d),c(t,n),c(n,i),c(n,o),c(n,s),c(n,a),c(n,l),c(n,f),c(n,h),c(t,g),Q&&Q.m(t,null),c(t,y),c(t,w),c(w,b),I(b,e[0]),u(r,k,d),ee(C,r,d),x=!0,B||(S=[v(i,"click",e[7]),v(s,"click",e[4]),v(l,"click",e[5]),v(h,"click",e[6]),v(b,"input",e[13])],B=!0)},p(e,[n]){e[1]?Q?Q.p(e,n):(Q=gy(e),Q.c(),Q.m(t,y)):Q&&(Q.d(1),Q=null),1&n&&I(b,e[0]);const r={};4&n&&(r.userPubkey=e[2]),!E&&8&n&&(E=!0,r.isOpen=e[3],_(()=>E=!1)),C.$set(r)},i(e){x||(Y(C.$$.fragment,e),x=!0)},o(e){W(C.$$.fragment,e),x=!1},d(e){e&&d(t),Q&&Q.d(),e&&d(k),te(C,e),B=!1,r(S)}}}function yy(e,t,n){let{composeEventJson:r=""}=t,{userPubkey:i=""}=t,{userRole:o=""}=t,{policyEnabled:s=!1}=t,{publishError:a=""}=t;const l=$();let c=!1;return e.$$set=e=>{"composeEventJson"in e&&n(0,r=e.composeEventJson),"userPubkey"in e&&n(2,i=e.userPubkey),"userRole"in e&&n(11,o=e.userRole),"policyEnabled"in e&&n(12,s=e.policyEnabled),"publishError"in e&&n(1,a=e.publishError)},[r,a,i,c,function(){l("reformatJson")},function(){l("signEvent")},function(){l("publishEvent")},function(){n(3,c=!0)},function(e){const{kind:t,template:i}=e.detail;n(0,r=JSON.stringify(i,null,2)),l("templateSelected",{kind:t,template:i})},function(){n(3,c=!1)},function(){n(1,a=""),l("clearError")},o,s,function(){r=this.value,n(0,r)},function(e){c=e,n(3,c)}]}class vy extends ie{constructor(e){super(),re(this,e,yy,my,o,{composeEventJson:0,userPubkey:2,userRole:11,policyEnabled:12,publishError:1})}}function wy(e,t,n){const r=e.slice();return r[23]=t[n],r}function Ay(t){let n,r,i,o,s,a;return{c(){n=p("div"),r=p("p"),r.textContent="Please log in to access sprocket management.",i=m(),o=p("button"),o.textContent="Log In",A(r,"class","svelte-fiaj1r"),A(o,"class","login-btn svelte-fiaj1r"),A(n,"class","login-prompt svelte-fiaj1r")},m(e,l){u(e,n,l),c(n,r),c(n,i),c(n,o),s||(a=v(o,"click",t[18]),s=!0)},p:e,d(e){e&&d(n),s=!1,a()}}}function by(e){let t,n,r,i,o,s,a,l,f,h=(e[2]||"none")+"";return{c(){t=p("div"),n=p("p"),n.textContent="❌ Owner permission required for sprocket management.",r=m(),i=p("p"),i.innerHTML='To enable sprocket functionality, set the ORLY_OWNERS environment variable with your npub when starting the relay.',o=m(),s=p("p"),a=g("Current user role: "),l=p("strong"),f=g(h),A(n,"class","svelte-fiaj1r"),A(i,"class","svelte-fiaj1r"),A(s,"class","svelte-fiaj1r"),A(t,"class","permission-denied svelte-fiaj1r")},m(e,d){u(e,t,d),c(t,n),c(t,r),c(t,i),c(t,o),c(t,s),c(s,a),c(s,l),c(l,f)},p(e,t){4&t&&h!==(h=(e[2]||"none")+"")&&k(f,h)},d(e){e&&d(t)}}}function ky(e){let t,n,i,o,s,a,l,h,y,w,b,C,E,B,S,Q,F,D,$,U,P,R,T,N,O,M,L,_,H,j,G,J,K,V,z,q,Y,W,Z,X,ee,te,ne,re,ie,oe,se,ae,le,ce,ue,de,fe,pe,he,ge,me=e[3]?.is_running?"🟢 Running":"🔴 Stopped",ye=e[3]?.script_exists?"✅ Exists":"❌ Not found",ve=e[3]?.pid&&Iy(e),we=e[6]&&Cy(e),Ae=e[8],be=[];for(let t=0;t{"isLoggedIn"in e&&n(1,r=e.isLoggedIn),"userRole"in e&&n(2,i=e.userRole),"sprocketStatus"in e&&n(3,o=e.sprocketStatus),"isLoadingSprocket"in e&&n(4,s=e.isLoadingSprocket),"sprocketUploadFile"in e&&n(5,a=e.sprocketUploadFile),"sprocketScript"in e&&n(0,l=e.sprocketScript),"sprocketMessage"in e&&n(6,c=e.sprocketMessage),"sprocketMessageType"in e&&n(7,u=e.sprocketMessageType),"sprocketVersions"in e&&n(8,d=e.sprocketVersions)},[l,r,i,o,s,a,c,u,d,function(){f("restartSprocket")},function(){f("deleteSprocket")},function(e){f("sprocketFileSelect",e)},function(){f("uploadSprocketScript")},function(){f("saveSprocket")},function(){f("loadSprocket")},function(){f("loadVersions")},p,h,function(){f("openLoginModal")},function(){l=this.value,n(0,l)},e=>p(e),e=>h(e.name)]}class Fy extends ie{constructor(e){super(),re(this,e,Qy,Sy,o,{isLoggedIn:1,userRole:2,sprocketStatus:3,isLoadingSprocket:4,sprocketUploadFile:5,sprocketScript:0,sprocketMessage:6,sprocketMessageType:7,sprocketVersions:8})}}function Dy(e,t,n){const r=e.slice();return r[26]=t[n],r}function $y(e,t,n){const r=e.slice();return r[29]=t[n],r}function Uy(e,t,n){const r=e.slice();return r[32]=t[n],r}function Py(t){let n,r,i,o,s,a;return{c(){n=p("div"),r=p("p"),r.textContent="Please log in to access policy configuration.",i=m(),o=p("button"),o.textContent="Log In",A(r,"class","svelte-gkxvxc"),A(o,"class","login-btn svelte-gkxvxc"),A(n,"class","login-prompt svelte-gkxvxc")},m(e,l){u(e,n,l),c(n,r),c(n,i),c(n,o),s||(a=v(o,"click",t[16]),s=!0)},p:e,d(e){e&&d(n),s=!1,a()}}}function Ry(e){let t,n,r,i,o,s,a,l,f,h=(e[3]||"none")+"";return{c(){t=p("div"),n=p("p"),n.textContent="Policy configuration requires owner or policy admin permissions.",r=m(),i=p("p"),i.innerHTML='To become a policy admin, ask an existing policy admin to add your pubkey\n to the policy_admins list.',o=m(),s=p("p"),a=g("Current user role: "),l=p("strong"),f=g(h),A(n,"class","svelte-gkxvxc"),A(i,"class","svelte-gkxvxc"),A(s,"class","svelte-gkxvxc"),A(t,"class","permission-denied svelte-gkxvxc")},m(e,d){u(e,t,d),c(t,n),c(t,r),c(t,i),c(t,o),c(t,s),c(s,a),c(s,l),c(l,f)},p(e,t){8&t[0]&&h!==(h=(e[3]||"none")+"")&&k(f,h)},d(e){e&&d(t)}}}function Ty(e){let t,n,i,o,s,a,l,f,h,y,w,b,C,E,B,S,Q,F,D,$,U,P,R,T,N,O,M,L,_,H,j,G,J,K,V,z,q,Y,W,Z,X,ee,te,ne,re,ie,oe,se,ae,le,ce,ue,de,fe,pe,he,ge,me,ye,ve,we,Ae,be,ke,Ie,Ce,Ee,xe,Be,Se,Qe,Fe,De,$e,Ue,Pe=e[5]?"Policy Enabled":"Policy Disabled",Re=e[10].length+"",Te=e[4]&&Ny(),Ne=e[9].length>0&&Oy(e),Oe=e[7]&&Ly(e);function Me(e,t){return 0===e[1].length?Hy:_y}let Le=Me(e),_e=Le(e);function He(e,t){return 0===e[10].length?Jy:Gy}let je=He(e),Ge=je(e);return{c(){t=p("div"),n=p("div"),i=p("h3"),i.textContent="Policy Editor",o=m(),s=p("div"),a=p("span"),l=g(Pe),f=m(),Te&&Te.c(),h=m(),y=p("div"),y.innerHTML='

Edit the policy JSON below and click "Save & Publish" to update the relay's policy configuration.\n Changes are applied immediately after validation.

\n

Policy updates are published as kind 12345 events and require policy admin permissions.

',w=m(),b=p("div"),C=p("textarea"),E=m(),Ne&&Ne.c(),B=m(),S=p("div"),Q=p("button"),F=g("Load Current"),D=m(),$=p("button"),U=g("Format JSON"),P=m(),R=p("button"),T=g("Validate"),N=m(),O=p("button"),M=g("Save & Publish"),L=m(),Oe&&Oe.c(),_=m(),H=p("div"),j=p("h3"),j.textContent="Policy Administrators",G=m(),J=p("div"),J.innerHTML='

Policy admins can update the relay's policy configuration via kind 12345 events.\n Their follows get whitelisted if policy_follow_whitelist_enabled is true in the policy.

\n

Note: Policy admins are separate from relay admins (ORLY_ADMINS).\n Changes here update the JSON editor - click "Save & Publish" to apply.

',K=m(),V=p("div"),_e.c(),z=m(),q=p("div"),Y=p("input"),W=m(),Z=p("button"),X=g("+ Add Admin"),te=m(),ne=p("div"),re=p("h3"),re.textContent="Policy Follow Whitelist",ie=m(),oe=p("div"),oe.innerHTML='

Pubkeys followed by policy admins (kind 3 events).\n These get automatic read+write access when rules have write_allow_follows: true.

',se=m(),ae=p("div"),le=p("span"),ce=g(Re),ue=g(" pubkey(s) in whitelist"),de=m(),fe=p("button"),pe=g("🔄 Refresh Follows"),he=m(),ge=p("div"),Ge.c(),me=m(),ye=p("div"),ve=p("h3"),ve.textContent="Policy Reference",we=m(),Ae=p("div"),be=p("h4"),be.textContent="Structure Overview",ke=m(),Ie=p("ul"),Ie.innerHTML='
  • kind.whitelist - Only allow these event kinds (takes precedence)
  • \n
  • kind.blacklist - Deny these event kinds (if no whitelist)
  • \n
  • global - Rules applied to all events
  • \n
  • rules - Per-kind rules (keyed by kind number as string)
  • \n
  • default_policy - "allow" or "deny" when no rules match
  • \n
  • policy_admins - Hex pubkeys that can update policy
  • \n
  • policy_follow_whitelist_enabled - Enable follow-based access
  • ',Ce=m(),Ee=p("h4"),Ee.textContent="Rule Fields",xe=m(),Be=p("ul"),Be.innerHTML='
  • description - Human-readable rule description
  • \n
  • write_allow / write_deny - Pubkey lists for write access
  • \n
  • read_allow / read_deny - Pubkey lists for read access
  • \n
  • write_allow_follows - Grant access to policy admin follows
  • \n
  • size_limit - Max total event size in bytes
  • \n
  • content_limit - Max content field size in bytes
  • \n
  • max_expiry - Max expiry offset in seconds
  • \n
  • max_age_of_event - Max age of created_at in seconds
  • \n
  • max_age_event_in_future - Max future offset in seconds
  • \n
  • must_have_tags - Required tag letters (e.g., ["d", "t"])
  • \n
  • tag_validation - Regex patterns for tag values
  • \n
  • script - Path to external validation script
  • ',Se=m(),Qe=p("h4"),Qe.textContent="Example Policy",Fe=m(),De=p("pre"),De.textContent=`${e[20]}`,A(i,"class","svelte-gkxvxc"),A(a,"class","status-badge svelte-gkxvxc"),x(a,"enabled",e[5]),A(s,"class","policy-status svelte-gkxvxc"),A(n,"class","policy-header svelte-gkxvxc"),A(y,"class","policy-info svelte-gkxvxc"),A(C,"class","policy-editor svelte-gkxvxc"),A(C,"placeholder","Loading policy configuration..."),C.disabled=e[6],A(C,"spellcheck","false"),A(b,"class","editor-container svelte-gkxvxc"),A(Q,"class","policy-btn load-btn svelte-gkxvxc"),Q.disabled=e[6],A($,"class","policy-btn format-btn svelte-gkxvxc"),$.disabled=e[6],A(R,"class","policy-btn validate-btn svelte-gkxvxc"),R.disabled=e[6],A(O,"class","policy-btn save-btn svelte-gkxvxc"),O.disabled=e[6],A(S,"class","policy-actions svelte-gkxvxc"),A(t,"class","policy-section svelte-gkxvxc"),A(J,"class","policy-info svelte-gkxvxc"),A(V,"class","admin-list svelte-gkxvxc"),A(Y,"type","text"),A(Y,"placeholder","npub or hex pubkey"),Y.disabled=e[6],A(Y,"class","svelte-gkxvxc"),A(Z,"class","policy-btn add-btn svelte-gkxvxc"),Z.disabled=ee=e[6]||!e[11].trim(),A(q,"class","add-admin svelte-gkxvxc"),A(H,"class","policy-section svelte-gkxvxc"),A(oe,"class","policy-info svelte-gkxvxc"),A(le,"class","follows-count svelte-gkxvxc"),A(fe,"class","policy-btn refresh-btn svelte-gkxvxc"),fe.disabled=e[6],A(ae,"class","follows-header svelte-gkxvxc"),A(ge,"class","follows-list svelte-gkxvxc"),A(ne,"class","policy-section svelte-gkxvxc"),A(be,"class","svelte-gkxvxc"),A(Ie,"class","field-list svelte-gkxvxc"),A(Ee,"class","svelte-gkxvxc"),A(Be,"class","field-list svelte-gkxvxc"),A(Qe,"class","svelte-gkxvxc"),A(De,"class","example-json svelte-gkxvxc"),A(Ae,"class","reference-content svelte-gkxvxc"),A(ye,"class","policy-section svelte-gkxvxc")},m(r,d){u(r,t,d),c(t,n),c(n,i),c(n,o),c(n,s),c(s,a),c(a,l),c(s,f),Te&&Te.m(s,null),c(t,h),c(t,y),c(t,w),c(t,b),c(b,C),I(C,e[0]),c(t,E),Ne&&Ne.m(t,null),c(t,B),c(t,S),c(S,Q),c(Q,F),c(S,D),c(S,$),c($,U),c(S,P),c(S,R),c(R,T),c(S,N),c(S,O),c(O,M),c(t,L),Oe&&Oe.m(t,null),u(r,_,d),u(r,H,d),c(H,j),c(H,G),c(H,J),c(H,K),c(H,V),_e.m(V,null),c(H,z),c(H,q),c(q,Y),I(Y,e[11]),c(q,W),c(q,Z),c(Z,X),u(r,te,d),u(r,ne,d),c(ne,re),c(ne,ie),c(ne,oe),c(ne,se),c(ne,ae),c(ae,le),c(le,ce),c(le,ue),c(ae,de),c(ae,fe),c(fe,pe),c(ne,he),c(ne,ge),Ge.m(ge,null),u(r,me,d),u(r,ye,d),c(ye,ve),c(ye,we),c(ye,Ae),c(Ae,be),c(Ae,ke),c(Ae,Ie),c(Ae,Ce),c(Ae,Ee),c(Ae,xe),c(Ae,Be),c(Ae,Se),c(Ae,Qe),c(Ae,Fe),c(Ae,De),$e||(Ue=[v(C,"input",e[21]),v(Q,"click",e[12]),v($,"click",e[15]),v(R,"click",e[13]),v(O,"click",e[14]),v(Y,"input",e[23]),v(Y,"keydown",e[24]),v(Z,"click",e[18]),v(fe,"click",e[17])],$e=!0)},p(e,n){32&n[0]&&Pe!==(Pe=e[5]?"Policy Enabled":"Policy Disabled")&&k(l,Pe),32&n[0]&&x(a,"enabled",e[5]),e[4]?Te||(Te=Ny(),Te.c(),Te.m(s,null)):Te&&(Te.d(1),Te=null),64&n[0]&&(C.disabled=e[6]),1&n[0]&&I(C,e[0]),e[9].length>0?Ne?Ne.p(e,n):(Ne=Oy(e),Ne.c(),Ne.m(t,B)):Ne&&(Ne.d(1),Ne=null),64&n[0]&&(Q.disabled=e[6]),64&n[0]&&($.disabled=e[6]),64&n[0]&&(R.disabled=e[6]),64&n[0]&&(O.disabled=e[6]),e[7]?Oe?Oe.p(e,n):(Oe=Ly(e),Oe.c(),Oe.m(t,null)):Oe&&(Oe.d(1),Oe=null),Le===(Le=Me(e))&&_e?_e.p(e,n):(_e.d(1),_e=Le(e),_e&&(_e.c(),_e.m(V,null))),64&n[0]&&(Y.disabled=e[6]),2048&n[0]&&Y.value!==e[11]&&I(Y,e[11]),2112&n[0]&&ee!==(ee=e[6]||!e[11].trim())&&(Z.disabled=ee),1024&n[0]&&Re!==(Re=e[10].length+"")&&k(ce,Re),64&n[0]&&(fe.disabled=e[6]),je===(je=He(e))&&Ge?Ge.p(e,n):(Ge.d(1),Ge=je(e),Ge&&(Ge.c(),Ge.m(ge,null)))},d(e){e&&d(t),Te&&Te.d(),Ne&&Ne.d(),Oe&&Oe.d(),e&&d(_),e&&d(H),_e.d(),e&&d(te),e&&d(ne),Ge.d(),e&&d(me),e&&d(ye),$e=!1,r(Ue)}}}function Ny(e){let t;return{c(){t=p("span"),t.textContent="Policy Admin",A(t,"class","admin-badge svelte-gkxvxc")},m(e,n){u(e,t,n)},d(e){e&&d(t)}}}function Oy(e){let t,n,r,i,o=e[9],s=[];for(let t=0;t{"isLoggedIn"in e&&n(2,r=e.isLoggedIn),"userRole"in e&&n(3,i=e.userRole),"isPolicyAdmin"in e&&n(4,o=e.isPolicyAdmin),"policyEnabled"in e&&n(5,s=e.policyEnabled),"policyJson"in e&&n(0,a=e.policyJson),"isLoadingPolicy"in e&&n(6,l=e.isLoadingPolicy),"policyMessage"in e&&n(7,c=e.policyMessage),"policyMessageType"in e&&n(8,u=e.policyMessageType),"validationErrors"in e&&n(9,d=e.validationErrors),"policyAdmins"in e&&n(1,f=e.policyAdmins),"policyFollows"in e&&n(10,p=e.policyFollows)},e.$$.update=()=>{if(1&e.$$.dirty[0])try{if(a){const e=JSON.parse(a);n(1,f=e.policy_admins||[])}}catch(e){}},[a,f,r,i,o,s,l,c,u,d,p,g,function(){h("loadPolicy")},function(){h("validatePolicy")},function(){h("savePolicy")},function(){h("formatJson")},function(){h("openLoginModal")},function(){h("refreshFollows")},m,y,'{\n "kind": {\n "whitelist": [0, 1, 3, 6, 7, 10002],\n "blacklist": []\n },\n "global": {\n "description": "Global rules applied to all events",\n "size_limit": 65536,\n "max_age_of_event": 86400,\n "max_age_event_in_future": 300\n },\n "rules": {\n "1": {\n "description": "Kind 1 (short text notes)",\n "content_limit": 8192,\n "write_allow_follows": true\n },\n "30023": {\n "description": "Long-form articles",\n "content_limit": 100000,\n "tag_validation": {\n "d": "^[a-z0-9-]{1,64}$",\n "t": "^[a-z0-9-]{1,32}$"\n }\n }\n },\n "default_policy": "allow",\n "policy_admins": [""],\n "policy_follow_whitelist_enabled": true\n}',function(){a=this.value,n(0,a)},e=>y(e),function(){g=this.value,n(11,g)},e=>"Enter"===e.key&&m()]}class qy extends ie{constructor(e){super(),re(this,e,zy,Vy,o,{isLoggedIn:2,userRole:3,isPolicyAdmin:4,policyEnabled:5,policyJson:0,isLoadingPolicy:6,policyMessage:7,policyMessageType:8,validationErrors:9,policyAdmins:1,policyFollows:10},null,[-1,-1])}}const{window:Yy}=l;function Wy(e,t,n){const r=e.slice();return r[57]=t[n],r}function Zy(e,t,n){const r=e.slice();return r[54]=t[n],r}function Xy(t){let n,r,i,o,s,a;return{c(){n=p("div"),r=p("p"),r.textContent="Please log in to view your Blossom storage.",i=m(),o=p("button"),o.textContent="Log In",A(r,"class","svelte-bz95vx"),A(o,"class","login-btn svelte-bz95vx"),A(n,"class","login-prompt svelte-bz95vx")},m(e,l){u(e,n,l),c(n,r),c(n,i),c(n,o),s||(a=v(o,"click",t[21]),s=!0)},p:e,d(e){e&&d(n),s=!1,a()}}}function ev(e){let t,n,r,i,o,s,a,l,f,h,y,w,b,I,E,x,B,S,Q,F=e[1]||e[14]?"Loading...":"Refresh";function D(e,t){return e[15]?rv:e[12]?nv:tv}let $=D(e),U=$(e),P=e[3]&&!e[12]&&!e[15]&&ov(e),R=!e[12]&&!e[15]&&sv(e),T=e[4]&&lv(e);function N(e,t){return e[12]&&!e[15]?uv:cv}let O=N(e),M=O(e);return{c(){t=p("div"),n=p("div"),r=g('DEBUG: role="'),i=g(e[0]),o=g('" isAdmin='),s=g(e[3]),a=m(),l=p("div"),U.c(),f=m(),h=p("div"),P&&P.c(),y=m(),w=p("button"),b=g(F),E=m(),R&&R.c(),x=m(),T&&T.c(),B=m(),M.c(),C(n,"background","red"),C(n,"color","white"),C(n,"padding","4px"),C(n,"font-size","12px"),A(w,"class","refresh-btn svelte-bz95vx"),w.disabled=I=e[1]||e[14],A(h,"class","header-buttons svelte-bz95vx"),A(l,"class","header-section svelte-bz95vx"),A(t,"class","blossom-view svelte-bz95vx")},m(d,p){u(d,t,p),c(t,n),c(n,r),c(n,i),c(n,o),c(n,s),c(t,a),c(t,l),U.m(l,null),c(l,f),c(l,h),P&&P.m(h,null),c(h,y),c(h,w),c(w,b),c(t,E),R&&R.m(t,null),c(t,x),T&&T.m(t,null),c(t,B),M.m(t,null),S||(Q=v(w,"click",e[31]),S=!0)},p(e,n){1&n[0]&&k(i,e[0]),8&n[0]&&k(s,e[3]),$===($=D(e))&&U?U.p(e,n):(U.d(1),U=$(e),U&&(U.c(),U.m(l,f))),!e[3]||e[12]||e[15]?P&&(P.d(1),P=null):P?P.p(e,n):(P=ov(e),P.c(),P.m(h,y)),16386&n[0]&&F!==(F=e[1]||e[14]?"Loading...":"Refresh")&&k(b,F),16386&n[0]&&I!==(I=e[1]||e[14])&&(w.disabled=I),e[12]||e[15]?R&&(R.d(1),R=null):R?R.p(e,n):(R=sv(e),R.c(),R.m(t,x)),e[4]?T?T.p(e,n):(T=lv(e),T.c(),T.m(t,B)):T&&(T.d(1),T=null),O===(O=N(e))&&M?M.p(e,n):(M.d(1),M=O(e),M&&(M.c(),M.m(t,null)))},d(e){e&&d(t),U.d(),P&&P.d(),R&&R.d(),T&&T.d(),M.d(),S=!1,Q()}}}function tv(t){let n;return{c(){n=p("h3"),n.textContent="Blossom Media Storage",A(n,"class","svelte-bz95vx")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function nv(t){let n,r,i,o,s;return{c(){n=p("button"),n.textContent="← Back",r=m(),i=p("h3"),i.textContent="All Users Storage",A(n,"class","back-btn svelte-bz95vx"),A(i,"class","svelte-bz95vx")},m(e,a){u(e,n,a),u(e,r,a),u(e,i,a),o||(s=v(n,"click",t[28]),o=!0)},p:e,d(e){e&&d(n),e&&d(r),e&&d(i),o=!1,s()}}}function rv(e){let t,n,r,i,o,s,a,l=(e[15].profile?.name||Nv(e[26](e[15].pubkey)))+"",f=e[15].profile?.picture&&iv(e);return{c(){t=p("button"),t.textContent="← Back",n=m(),r=p("h3"),f&&f.c(),i=m(),o=g(l),A(t,"class","back-btn svelte-bz95vx"),A(r,"class","user-header svelte-bz95vx")},m(l,d){u(l,t,d),u(l,n,d),u(l,r,d),f&&f.m(r,null),c(r,i),c(r,o),s||(a=v(t,"click",e[30]),s=!0)},p(e,t){e[15].profile?.picture?f?f.p(e,t):(f=iv(e),f.c(),f.m(r,i)):f&&(f.d(1),f=null),32768&t[0]&&l!==(l=(e[15].profile?.name||Nv(e[26](e[15].pubkey)))+"")&&k(o,l)},d(e){e&&d(t),e&&d(n),e&&d(r),f&&f.d(),s=!1,a()}}}function iv(e){let t,n;return{c(){t=p("img"),a(t.src,n=e[15].profile.picture)||A(t,"src",n),A(t,"alt",""),A(t,"class","header-avatar svelte-bz95vx")},m(e,n){u(e,t,n)},p(e,r){32768&r[0]&&!a(t.src,n=e[15].profile.picture)&&A(t,"src",n)},d(e){e&&d(t)}}}function ov(e){let t,n,r,i;return{c(){t=p("button"),n=g("Admin"),A(t,"class","admin-btn svelte-bz95vx"),t.disabled=e[1]},m(o,s){u(o,t,s),c(t,n),r||(i=v(t,"click",e[27]),r=!0)},p(e,n){2&n[0]&&(t.disabled=e[1])},d(e){e&&d(t),r=!1,i()}}}function sv(e){let t,n,i,o,s,a,l,f,h=e[5].length>0&&av(e);return{c(){t=p("div"),n=p("input"),i=m(),o=p("button"),s=g("Select Files"),a=m(),h&&h.c(),A(n,"type","file"),n.multiple=!0,A(n,"class","file-input-hidden svelte-bz95vx"),A(o,"class","select-btn svelte-bz95vx"),o.disabled=e[6],A(t,"class","upload-section svelte-bz95vx")},m(r,d){u(r,t,d),c(t,n),e[39](n),c(t,i),c(t,o),c(o,s),c(t,a),h&&h.m(t,null),l||(f=[v(n,"change",e[23]),v(o,"click",e[24])],l=!0)},p(e,n){64&n[0]&&(o.disabled=e[6]),e[5].length>0?h?h.p(e,n):(h=av(e),h.c(),h.m(t,null)):h&&(h.d(1),h=null)},d(n){n&&d(t),e[39](null),h&&h.d(),l=!1,r(f)}}}function av(e){let t,n,r,i,o,s,a,l,f=e[5].length+"",h=(e[6]?e[7]:"Upload")+"";return{c(){t=p("span"),n=g(f),r=g(" file(s) selected"),i=m(),o=p("button"),s=g(h),A(t,"class","selected-count svelte-bz95vx"),A(o,"class","upload-btn svelte-bz95vx"),o.disabled=e[6]},m(d,f){u(d,t,f),c(t,n),c(t,r),u(d,i,f),u(d,o,f),c(o,s),a||(l=v(o,"click",e[25]),a=!0)},p(e,t){32&t[0]&&f!==(f=e[5].length+"")&&k(n,f),192&t[0]&&h!==(h=(e[6]?e[7]:"Upload")+"")&&k(s,h),64&t[0]&&(o.disabled=e[6])},d(e){e&&d(t),e&&d(i),e&&d(o),a=!1,l()}}}function lv(e){let t,n;return{c(){t=p("div"),n=g(e[4]),A(t,"class","error-message svelte-bz95vx")},m(e,r){u(e,t,r),c(t,n)},p(e,t){16&t[0]&&k(n,e[4])},d(e){e&&d(t)}}}function cv(e){let t,n,r;function i(e,r){return 2&r[0]&&(t=null),null==t&&(t=!(!e[1]||0!==e[32]().length)),t?pv:(null==n&&(n=!(0!==e[32]().length)),n?fv:dv)}let o=i(e,[-1,-1]),s=o(e);return{c(){s.c(),r=y()},m(e,t){s.m(e,t),u(e,r,t)},p(e,t){o===(o=i(e,t))&&s?s.p(e,t):(s.d(1),s=o(e),s&&(s.c(),s.m(r.parentNode,r)))},d(e){s.d(e),e&&d(r)}}}function uv(e){let t;function n(e,t){return e[14]?yv:0===e[13].length?mv:gv}let r=n(e),i=r(e);return{c(){i.c(),t=y()},m(e,n){i.m(e,n),u(e,t,n)},p(e,o){r===(r=n(e))&&i?i.p(e,o):(i.d(1),i=r(e),i&&(i.c(),i.m(t.parentNode,t)))},d(e){i.d(e),e&&d(t)}}}function dv(e){let t,n=e[32](),r=[];for(let t=0;tNo users have uploaded files yet.

    ",A(n,"class","empty-state svelte-bz95vx")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function yv(t){let n;return{c(){n=p("div"),n.textContent="Loading user statistics...",A(n,"class","loading svelte-bz95vx")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function vv(t){let n;return{c(){n=p("div"),A(n,"class","user-avatar-placeholder svelte-bz95vx")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function wv(e){let t,n;return{c(){t=p("img"),a(t.src,n=e[54].profile.picture)||A(t,"src",n),A(t,"alt",""),A(t,"class","user-avatar svelte-bz95vx")},m(e,n){u(e,t,n)},p(e,r){8192&r[0]&&!a(t.src,n=e[54].profile.picture)&&A(t,"src",n)},d(e){e&&d(t)}}}function Av(e){let t,n,i,o,s,a,l,f,h,y,w,b,I,C,E,x,B,S,Q,F,D,$=(e[54].profile?.name||Nv(e[26](e[54].pubkey)))+"",U=Nv(e[26](e[54].pubkey))+"",P=e[54].blob_count+"",R=Dv(e[54].total_size_bytes)+"";function T(e,t){return e[54].profile?.picture?wv:vv}let N=T(e),O=N(e);function M(){return e[40](e[54])}function L(...t){return e[41](e[54],...t)}return{c(){t=p("div"),n=p("div"),O.c(),i=m(),o=p("div"),s=p("div"),a=g($),l=m(),f=p("div"),h=g(U),w=m(),b=p("div"),I=p("span"),C=g(P),E=g(" files"),x=m(),B=p("span"),S=g(R),Q=m(),A(n,"class","user-avatar-container svelte-bz95vx"),A(s,"class","user-name svelte-bz95vx"),A(f,"class","user-npub svelte-bz95vx"),A(f,"title",y=e[54].pubkey),A(o,"class","user-info svelte-bz95vx"),A(I,"class","blob-count svelte-bz95vx"),A(B,"class","total-size svelte-bz95vx"),A(b,"class","user-stats svelte-bz95vx"),A(t,"class","user-stat-item svelte-bz95vx"),A(t,"role","button"),A(t,"tabindex","0")},m(e,r){u(e,t,r),c(t,n),O.m(n,null),c(t,i),c(t,o),c(o,s),c(s,a),c(o,l),c(o,f),c(f,h),c(t,w),c(t,b),c(b,I),c(I,C),c(I,E),c(b,x),c(b,B),c(B,S),c(t,Q),F||(D=[v(t,"click",M),v(t,"keypress",L)],F=!0)},p(t,r){N===(N=T(e=t))&&O?O.p(e,r):(O.d(1),O=N(e),O&&(O.c(),O.m(n,null))),8192&r[0]&&$!==($=(e[54].profile?.name||Nv(e[26](e[54].pubkey)))+"")&&k(a,$),8192&r[0]&&U!==(U=Nv(e[26](e[54].pubkey))+"")&&k(h,U),8192&r[0]&&y!==(y=e[54].pubkey)&&A(f,"title",y),8192&r[0]&&P!==(P=e[54].blob_count+"")&&k(C,P),8192&r[0]&&R!==(R=Dv(e[54].total_size_bytes)+"")&&k(S,R)},d(e){e&&d(t),O.d(),F=!1,r(D)}}}function bv(e){let t,n,i,o,s,a,l,f,h,y,b,I,C,E,x,B,S,Q,F,D,$,U,P,R,T,N,O,M,L,_,H,j,G,J,K,V,z,q,Y,W,Z,X,ee,te=Uv(e[10].sha256)+"",ne=(e[10].type||"unknown")+"",re="image"===Pv(e[10].type),ie=Dv(e[10].size)+"",oe=$v(e[10].uploaded)+"",se=re&&kv(e);function ae(e,t){return 1024&t[0]&&(B=null),1024&t[0]&&(S=null),1024&t[0]&&(Q=null),null==B&&(B=!("image"!==Pv(e[10].type))),B?xv:(null==S&&(S=!("video"!==Pv(e[10].type))),S?Ev:(null==Q&&(Q=!("audio"!==Pv(e[10].type))),Q?Cv:Iv))}let le=ae(e,[-1,-1]),ce=le(e);return{c(){t=p("div"),n=p("div"),i=p("div"),o=p("div"),s=p("span"),a=g(te),l=m(),f=p("span"),h=g(ne),y=m(),b=p("div"),se&&se.c(),I=m(),C=p("button"),C.textContent="X",E=m(),x=p("div"),ce.c(),F=m(),D=p("div"),$=p("div"),U=p("span"),P=g("Size: "),R=g(ie),T=m(),N=p("span"),O=g("Uploaded: "),M=g(oe),L=m(),_=p("div"),H=p("input"),G=m(),J=p("button"),J.textContent="Copy",K=m(),V=p("div"),z=p("a"),q=g("Open in New Tab"),W=m(),Z=p("button"),Z.textContent="Delete",A(s,"class","modal-hash svelte-bz95vx"),A(f,"class","modal-type svelte-bz95vx"),A(o,"class","modal-title svelte-bz95vx"),A(C,"class","close-btn svelte-bz95vx"),A(b,"class","modal-controls svelte-bz95vx"),A(i,"class","modal-header svelte-bz95vx"),A(x,"class","modal-body svelte-bz95vx"),A($,"class","blob-details svelte-bz95vx"),A(H,"type","text"),H.readOnly=!0,H.value=j=Tv(e[10]),A(H,"class","blob-url-input svelte-bz95vx"),A(J,"class","copy-btn svelte-bz95vx"),A(_,"class","blob-url-section svelte-bz95vx"),A(z,"href",Y=Tv(e[10])),A(z,"target","_blank"),A(z,"rel","noopener noreferrer"),A(z,"class","action-btn svelte-bz95vx"),A(Z,"class","action-btn danger svelte-bz95vx"),A(V,"class","modal-actions svelte-bz95vx"),A(D,"class","modal-footer svelte-bz95vx"),A(n,"class","modal-content svelte-bz95vx"),A(n,"role","dialog"),A(t,"class","modal-overlay svelte-bz95vx"),A(t,"role","button"),A(t,"tabindex","0")},m(r,d){u(r,t,d),c(t,n),c(n,i),c(i,o),c(o,s),c(s,a),c(o,l),c(o,f),c(f,h),c(i,y),c(i,b),se&&se.m(b,null),c(b,I),c(b,C),c(n,E),c(n,x),ce.m(x,null),c(n,F),c(n,D),c(D,$),c($,U),c(U,P),c(U,R),c($,T),c($,N),c(N,O),c(N,M),c(D,L),c(D,_),c(_,H),c(_,G),c(_,J),c(D,K),c(D,V),c(V,z),c(z,q),c(V,W),c(V,Z),X||(ee=[v(C,"click",e[17]),v(H,"click",Ov),v(J,"click",e[45]),v(Z,"click",e[46]),v(n,"click",w(e[37])),v(n,"keypress",w(e[38])),v(t,"click",e[17]),v(t,"keypress",e[47])],X=!0)},p(e,t){1024&t[0]&&te!==(te=Uv(e[10].sha256)+"")&&k(a,te),1024&t[0]&&ne!==(ne=(e[10].type||"unknown")+"")&&k(h,ne),1024&t[0]&&(re="image"===Pv(e[10].type)),re?se?se.p(e,t):(se=kv(e),se.c(),se.m(b,I)):se&&(se.d(1),se=null),le===(le=ae(e,t))&&ce?ce.p(e,t):(ce.d(1),ce=le(e),ce&&(ce.c(),ce.m(x,null))),1024&t[0]&&ie!==(ie=Dv(e[10].size)+"")&&k(R,ie),1024&t[0]&&oe!==(oe=$v(e[10].uploaded)+"")&&k(M,oe),1024&t[0]&&j!==(j=Tv(e[10]))&&H.value!==j&&(H.value=j),1024&t[0]&&Y!==(Y=Tv(e[10]))&&A(z,"href",Y)},d(e){e&&d(t),se&&se.d(),ce.d(),X=!1,r(ee)}}}function kv(e){let t,n,i,o,s,a,l,f,h,y,w,b,I,C=Math.round(100*e[11])+"";return{c(){t=p("button"),n=g("-"),o=m(),s=p("span"),a=g(C),l=g("%"),f=m(),h=p("button"),y=g("+"),A(t,"class","zoom-btn svelte-bz95vx"),t.disabled=i=e[11]<=Sv,A(s,"class","zoom-level svelte-bz95vx"),A(h,"class","zoom-btn svelte-bz95vx"),h.disabled=w=e[11]>=Qv},m(r,i){u(r,t,i),c(t,n),u(r,o,i),u(r,s,i),c(s,a),c(s,l),u(r,f,i),u(r,h,i),c(h,y),b||(I=[v(t,"click",e[19]),v(h,"click",e[18])],b=!0)},p(e,n){2048&n[0]&&i!==(i=e[11]<=Sv)&&(t.disabled=i),2048&n[0]&&C!==(C=Math.round(100*e[11])+"")&&k(a,C),2048&n[0]&&w!==(w=e[11]>=Qv)&&(h.disabled=w)},d(e){e&&d(t),e&&d(o),e&&d(s),e&&d(f),e&&d(h),b=!1,r(I)}}}function Iv(e){let t,n,r,i,o,s,a,l,f,h=Rv(e[10].type)+"";return{c(){t=p("div"),n=p("div"),r=g(h),i=m(),o=p("p"),o.textContent="Preview not available for this file type.",s=m(),a=p("a"),l=g("Download File"),A(n,"class","file-icon svelte-bz95vx"),A(a,"href",f=Tv(e[10])),A(a,"target","_blank"),A(a,"rel","noopener noreferrer"),A(a,"class","download-link svelte-bz95vx"),A(t,"class","file-preview svelte-bz95vx")},m(e,d){u(e,t,d),c(t,n),c(n,r),c(t,i),c(t,o),c(t,s),c(t,a),c(a,l)},p(e,t){1024&t[0]&&h!==(h=Rv(e[10].type)+"")&&k(r,h),1024&t[0]&&f!==(f=Tv(e[10]))&&A(a,"href",f)},d(e){e&&d(t)}}}function Cv(e){let t,n,r;return{c(){t=p("div"),n=p("audio"),n.controls=!0,a(n.src,r=Tv(e[10]))||A(n,"src",r),A(n,"class","svelte-bz95vx"),A(t,"class","media-container audio svelte-bz95vx")},m(e,r){u(e,t,r),c(t,n)},p(e,t){1024&t[0]&&!a(n.src,r=Tv(e[10]))&&A(n,"src",r)},d(e){e&&d(t)}}}function Ev(e){let t,n,r,i;return{c(){t=p("div"),n=p("video"),r=p("track"),A(r,"kind","captions"),n.controls=!0,a(n.src,i=Tv(e[10]))||A(n,"src",i),A(n,"class","svelte-bz95vx"),A(t,"class","media-container svelte-bz95vx")},m(e,i){u(e,t,i),c(t,n),c(n,r)},p(e,t){1024&t[0]&&!a(n.src,i=Tv(e[10]))&&A(n,"src",i)},d(e){e&&d(t)}}}function xv(e){let t,n,r;return{c(){t=p("div"),n=p("img"),a(n.src,r=Tv(e[10]))||A(n,"src",r),A(n,"alt","Blob content"),A(n,"class","svelte-bz95vx"),A(t,"class","media-container svelte-bz95vx"),C(t,"transform","scale("+e[11]+")")},m(e,r){u(e,t,r),c(t,n)},p(e,i){1024&i[0]&&!a(n.src,r=Tv(e[10]))&&A(n,"src",r),2048&i[0]&&C(t,"transform","scale("+e[11]+")")},d(e){e&&d(t)}}}function Bv(t){let n,r,i,o;function s(e,t){return e[2]?ev:Xy}let a=s(t),l=a(t),c=t[9]&&t[10]&&bv(t);return{c(){l.c(),n=m(),c&&c.c(),r=y()},m(e,s){l.m(e,s),u(e,n,s),c&&c.m(e,s),u(e,r,s),i||(o=v(Yy,"keydown",t[20]),i=!0)},p(e,t){a===(a=s(e))&&l?l.p(e,t):(l.d(1),l=a(e),l&&(l.c(),l.m(n.parentNode,n))),e[9]&&e[10]?c?c.p(e,t):(c=bv(e),c.c(),c.m(r.parentNode,r)):c&&(c.d(1),c=null)},i:e,o:e,d(e){l.d(e),e&&d(n),c&&c.d(e),e&&d(r),i=!1,o()}}}const Sv=.25,Qv=4;async function Fv(e,t,n=null){if(!e)return console.log("No signer available for Blossom auth"),null;try{const r=Math.floor(Date.now()/1e3),i=[["t",t],["expiration",(r+60).toString()]];n&&i.push(["x",n]);const o={kind:24242,created_at:r,tags:i,content:`Blossom ${t} operation`},s=await e.signEvent(o);return btoa(JSON.stringify(s))}catch(e){return console.error("Error creating Blossom auth:",e),null}}function Dv(e){if(!e)return"0 B";const t=["B","KB","MB","GB"];let n=0,r=e;for(;r>=1024&&ne.target.select();function Mv(e,t,n){let r,i,{isLoggedIn:o=!1}=t,{userPubkey:s=""}=t,{userSigner:a=null}=t,{currentEffectiveRole:l=""}=t;const c=$();let u,d=[],f=!1,p="",h=[],g=!1,m="",y=!1,v=null,w=1,A=!1,b=[],k=!1,I=null,C=[],E=!1;async function x(){if(s){n(1,f=!0),n(4,p="");try{const e=`${window.location.origin}/blossom/list/${s}`,t=await Fv(a,"list"),n=await fetch(e,{headers:t?{Authorization:`Nostr ${t}`}:{}});if(!n.ok)throw new Error(`Failed to load blobs: ${n.statusText}`);const r=await n.json();d=Array.isArray(r)?r:[],d.sort((e,t)=>(t.uploaded||0)-(e.uploaded||0)),console.log("Loaded blobs:",d)}catch(e){console.error("Error loading blobs:",e),n(4,p=e.message||"Failed to load blobs")}finally{n(1,f=!1)}}}function B(e){n(10,v=e),n(11,w=1),n(9,y=!0)}function S(){n(9,y=!1),n(10,v=null),n(11,w=1)}function Q(){wSv&&n(11,w=Math.max(Sv,w-.25))}async function P(e){if(confirm(`Delete blob ${Uv(e.sha256)}?`))try{const t=`${window.location.origin}/blossom/${e.sha256}`,n=await Fv(a,"delete",e.sha256),r=await fetch(t,{method:"DELETE",headers:n?{Authorization:`Nostr ${n}`}:{}});if(!r.ok)throw new Error(`Failed to delete: ${r.statusText}`);d=d.filter(t=>t.sha256!==e.sha256),v?.sha256===e.sha256&&S()}catch(e){console.error("Error deleting blob:",e),alert(`Failed to delete blob: ${e.message}`)}}async function T(){n(14,k=!0),n(4,p="");try{const e=`${window.location.origin}/blossom/admin/users`,t=await Fv(a,"admin"),r=await fetch(e,{headers:t?{Authorization:`Nostr ${t}`}:{}});if(!r.ok)throw new Error(`Failed to load user stats: ${r.statusText}`);n(13,b=await r.json());for(const e of b)Cp(e.pubkey).then(t=>{e.profile=t||{name:"",picture:""},n(13,b)}).catch(()=>{e.profile={name:"",picture:""}})}catch(e){console.error("Error fetching admin user stats:",e),n(4,p=e.message||"Failed to load user stats")}finally{n(14,k=!1)}}async function N(e){n(1,f=!0),n(4,p="");try{const t=`${window.location.origin}/blossom/list/${e}`,n=await Fv(a,"list"),r=await fetch(t,{headers:n?{Authorization:`Nostr ${n}`}:{}});if(!r.ok)throw new Error(`Failed to load user blobs: ${r.statusText}`);C=await r.json(),C.sort((e,t)=>(t.uploaded||0)-(e.uploaded||0))}catch(e){console.error("Error loading user blobs:",e),n(4,p=e.message||"Failed to load user blobs")}finally{n(1,f=!1)}}async function O(e){n(15,I={pubkey:e.pubkey,profile:e.profile}),await N(e.pubkey)}F(()=>{r&&!E&&(n(36,E=!0),x())});return e.$$set=e=>{"isLoggedIn"in e&&n(33,o=e.isLoggedIn),"userPubkey"in e&&n(34,s=e.userPubkey),"userSigner"in e&&n(35,a=e.userSigner),"currentEffectiveRole"in e&&n(0,l=e.currentEffectiveRole)},e.$$.update=()=>{12&e.$$.dirty[1]&&n(2,r=o&&s),1&e.$$.dirty[0]&&n(3,i="admin"===l||"owner"===l),9&e.$$.dirty[0]&&console.log("BlossomView role:",l,"isAdmin:",i),6&e.$$.dirty[0]|32&e.$$.dirty[1]&&(!r||E||f||(n(36,E=!0),x()))},[l,f,r,i,p,h,g,m,u,y,v,w,A,b,k,I,B,S,Q,D,function(e){y&&("Escape"===e.key?S():"+"===e.key||"="===e.key?Q():"-"===e.key&&D())},function(){c("openLoginModal")},P,function(e){n(5,h=Array.from(e.target.files))},function(){u?.click()},async function(){if(0===h.length)return;n(6,g=!0),n(4,p="");const e=[],t=[];for(let r=0;r0&&await x(),t.length>0&&n(4,p=`Failed to upload: ${t.map(e=>e.name).join(", ")}`)},function(e){try{return vu(e)}catch(t){return Uv(e)}},function(){n(12,A=!0),T()},function(){n(12,A=!1),n(13,b=[]),n(15,I=null),C=[]},O,function(){n(15,I=null),C=[]},function(){I?N(I.pubkey):A?T():x()},function(){return I?C:d},o,s,a,E,function(t){U.call(this,e,t)},function(t){U.call(this,e,t)},function(e){R[e?"unshift":"push"](()=>{u=e,n(8,u)})},e=>O(e),(e,t)=>"Enter"===t.key&&O(e),e=>P(e),e=>B(e),(e,t)=>"Enter"===t.key&&B(e),()=>{navigator.clipboard.writeText(Tv(v))},()=>P(v),e=>"Enter"===e.key&&S()]}class Lv extends ie{constructor(e){super(),re(this,e,Mv,Bv,o,{isLoggedIn:33,userPubkey:34,userSigner:35,currentEffectiveRole:0},null,[-1,-1])}}function _v(e){let t,n,r,i,o,s,a,l,f,h,y;return{c(){t=p("div"),n=p("div"),r=p("h3"),r.textContent="Active Filter",i=m(),o=p("button"),o.textContent="🧹 Sweep",s=m(),a=p("div"),l=p("pre"),f=g(e[2]),A(r,"class","svelte-1tyqaa5"),A(o,"class","sweep-btn svelte-1tyqaa5"),A(o,"title","Clear filter"),A(n,"class","filter-display-header svelte-1tyqaa5"),A(l,"class","filter-json svelte-1tyqaa5"),A(a,"class","filter-json-container svelte-1tyqaa5"),A(t,"class","filter-display svelte-1tyqaa5")},m(d,p){u(d,t,p),c(t,n),c(n,r),c(n,i),c(n,o),c(t,s),c(t,a),c(a,l),c(l,f),h||(y=v(o,"click",e[3]),h=!0)},p(e,t){4&t&&k(f,e[2])},d(e){e&&d(t),h=!1,y()}}}function Hv(t){let n,r=t[0]&&t[1]&&_v(t);return{c(){r&&r.c(),n=y()},m(e,t){r&&r.m(e,t),u(e,n,t)},p(e,[t]){e[0]&&e[1]?r?r.p(e,t):(r=_v(e),r.c(),r.m(n.parentNode,n)):r&&(r.d(1),r=null)},i:e,o:e,d(e){r&&r.d(e),e&&d(n)}}}function jv(e,t,n){let r,i;const o=$();let{filter:s={}}=t,{showFilter:a=!0}=t;return e.$$set=e=>{"filter"in e&&n(4,s=e.filter),"showFilter"in e&&n(0,a=e.showFilter)},e.$$.update=()=>{16&e.$$.dirty&&n(2,r=function(e){return JSON.stringify(e,null,2)}(s)),16&e.$$.dirty&&n(1,i=Object.keys(s).length>0)},[a,i,r,function(){o("sweep")},s]}class Gv extends ie{constructor(e){super(),re(this,e,jv,Hv,o,{filter:4,showFilter:0})}}function Jv(e){return fp[e]||`Kind ${e}`}function Kv(e){return e?e.slice(0,8)+"..."+e.slice(-8):"unknown"}function Vv(e,t=100){return e?e.length>t?e.slice(0,t)+"...":e:""}function zv(e){return e?new Date(1e3*e).toLocaleString():""}class qv{constructor(e,t,n){this.relayUrl=e,this.userSigner=t,this.userPubkey=n,this.ws=null,this.challenge=null,this.isAuthenticated=!1,this.authPromise=null}async connect(){return new Promise((e,t)=>{this.ws=new WebSocket(this.relayUrl),this.ws.onopen=()=>{console.log("WebSocket connected to relay:",this.relayUrl),e()},this.ws.onmessage=async e=>{try{const t=JSON.parse(e.data);await this.handleMessage(t)}catch(e){console.error("Error parsing relay message:",e)}},this.ws.onerror=e=>{console.error("WebSocket error:",e),t(new Error("Failed to connect to relay"))},this.ws.onclose=()=>{console.log("WebSocket connection closed"),this.isAuthenticated=!1,this.challenge=null},setTimeout(()=>{this.ws.readyState!==WebSocket.OPEN&&t(new Error("Connection timeout"))},1e4)})}async handleMessage(e){const[t,...n]=e;switch(t){case"AUTH":this.challenge=n[0],console.log("Received AUTH challenge:",this.challenge),await this.authenticate();break;case"OK":const[e,r,i]=n;e&&r?(console.log("Authentication successful for event:",e),this.isAuthenticated=!0,this.authPromise&&(this.authPromise.resolve(),this.authPromise=null)):e&&!r&&(console.error("Authentication failed:",i),this.authPromise&&(this.authPromise.reject(new Error(i||"Authentication failed")),this.authPromise=null));break;case"NOTICE":console.log("Relay notice:",n[0]);break;default:console.log("Unhandled message type:",t,n)}}async authenticate(){if(!this.challenge)throw new Error("No challenge received from relay");if(!this.userSigner)throw new Error("No signer available for authentication");try{const e={kind:22242,created_at:Math.floor(Date.now()/1e3),tags:[["relay",this.relayUrl],["challenge",this.challenge]],content:"",pubkey:this.userPubkey},t=["AUTH",await this.userSigner.signEvent(e)];return this.ws.send(JSON.stringify(t)),console.log("Sent authentication event to relay"),new Promise((e,t)=>{this.authPromise={resolve:e,reject:t},setTimeout(()=>{this.authPromise&&(this.authPromise.reject(new Error("Authentication timeout")),this.authPromise=null)},1e4)})}catch(e){throw console.error("Authentication error:",e),e}}async publishEvent(e){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new Error("WebSocket not connected");return new Promise((t,n)=>{const r=["EVENT",e];this.ws.send(JSON.stringify(r));const i=this.ws.onmessage,o=setTimeout(()=>{this.ws.onmessage=i,n(new Error("Publish timeout"))},15e3);this.ws.onmessage=async r=>{try{const s=JSON.parse(r.data),[a,l,c,u]=s;if("OK"===a&&l===e.id)if(c)clearTimeout(o),this.ws.onmessage=i,console.log("Event published successfully:",l),t({success:!0,eventId:l,reason:u});else{if(console.error("Event publish failed:",u),u&&u.includes("auth-required"))return void console.log("Authentication required, waiting for AUTH challenge...");clearTimeout(o),this.ws.onmessage=i,n(new Error(`Publish failed: ${u}`))}else if("AUTH"===a){this.challenge=s[1],console.log("Received AUTH challenge during publish:",this.challenge);try{await this.authenticate(),console.log("Authentication successful, retrying event publish...");const t=["EVENT",e];this.ws.send(JSON.stringify(t))}catch(e){clearTimeout(o),this.ws.onmessage=i,n(new Error(`Authentication failed: ${e.message}`))}}else await this.handleMessage(s)}catch(e){clearTimeout(o),this.ws.onmessage=i,n(e)}}})}close(){this.ws&&(this.ws.close(),this.ws=null),this.isAuthenticated=!1,this.challenge=null}getAuthenticated(){return this.isAuthenticated}}async function Yv(e,t,n,r){const i=new qv(e,n,r);try{await i.connect();return await i.publishEvent(t)}finally{i.close()}}function Wv(e,t,n){const r=e.slice();return r[169]=t[n],r}function Zv(e,t,n){const r=e.slice();return r[179]=t[n],r}function Xv(e,t,n){const r=e.slice();return r[172]=t[n],r}function ew(e,t,n){const r=e.slice();r[172]=t[n];const i=r[52](r[172]);return r[173]=i,r}function tw(e,t,n){const r=e.slice();return r[176]=t[n],r}function nw(t){let n;function r(e,t){return e[1]?hw:pw}let i=r(t),o=i(t);return{c(){n=p("div"),o.c(),A(n,"class","welcome-message svelte-u3u5mw")},m(e,t){u(e,n,t),o.m(n,null)},p(e,t){i===(i=r(e))&&o?o.p(e,t):(o.d(1),o=i(e),o&&(o.c(),o.m(n,null)))},i:e,o:e,d(e){e&&d(n),o.d()}}}function rw(e){let t,n,r=e[6],i=[];for(let t=0;tW(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e=0||""!==t[36]&&parseInt(t[36])>=0,U=dp,P=[];for(let e=0;eEvent Recovery \n

    Search and recover old versions of replaceable events

    ',o=m(),s=p("div"),a=p("div"),l=p("div"),h=p("label"),h.textContent="Select Event Kind:",g=m(),y=p("select"),w=p("option"),w.textContent="Choose a replaceable kind...";for(let e=0;et[115].call(y)),A(l,"class","kind-selector svelte-u3u5mw"),A(x,"for","custom-kind"),A(x,"class","svelte-u3u5mw"),A(S,"id","custom-kind"),A(S,"type","number"),A(S,"placeholder","e.g., 10001"),A(S,"min","0"),A(S,"class","svelte-u3u5mw"),A(C,"class","custom-kind-input svelte-u3u5mw"),A(a,"class","recovery-controls svelte-u3u5mw"),A(s,"class","recovery-controls-card svelte-u3u5mw"),A(n,"class","recovery-tab svelte-u3u5mw")},m(e,r){u(e,n,r),c(n,i),c(n,o),c(n,s),c(s,a),c(a,l),c(l,h),c(l,g),c(l,y),c(y,w);for(let e=0;e=0||""!==e[36]&&parseInt(e[36])>=0),$?R?R.p(e,t):(R=Ew(e),R.c(),R.m(n,null)):R&&(R.d(1),R=null)},i:e,o:e,d(e){e&&d(n),f(P,e),R&&R.d(),F=!1,r(D)}}}function ow(e){let t,n,r;function i(t){e[114](t)}let o={isLoggedIn:e[1],userRole:e[4],isPolicyAdmin:qw,policyEnabled:e[8],isLoadingPolicy:e[27],policyMessage:e[28],policyMessageType:e[29],validationErrors:e[30],policyFollows:e[31]};return void 0!==e[26]&&(o.policyJson=e[26]),t=new qy({props:o}),R.push(()=>Z(t,"policyJson",i)),t.$on("loadPolicy",e[60]),t.$on("validatePolicy",e[61]),t.$on("savePolicy",e[62]),t.$on("formatJson",e[63]),t.$on("addPolicyAdmin",e[64]),t.$on("removePolicyAdmin",e[65]),t.$on("refreshFollows",e[66]),t.$on("openLoginModal",e[70]),{c(){X(t.$$.fragment)},m(e,n){ee(t,e,n),r=!0},p(e,r){const i={};2&r[0]&&(i.isLoggedIn=e[1]),16&r[0]&&(i.userRole=e[4]),256&r[0]&&(i.policyEnabled=e[8]),134217728&r[0]&&(i.isLoadingPolicy=e[27]),268435456&r[0]&&(i.policyMessage=e[28]),536870912&r[0]&&(i.policyMessageType=e[29]),1073741824&r[0]&&(i.validationErrors=e[30]),1&r[1]&&(i.policyFollows=e[31]),!n&&67108864&r[0]&&(n=!0,i.policyJson=e[26],_(()=>n=!1)),t.$set(i)},i(e){r||(Y(t.$$.fragment,e),r=!0)},o(e){W(t.$$.fragment,e),r=!1},d(e){te(t,e)}}}function sw(e){let t,n,r;function i(t){e[111](t)}let o={isLoggedIn:e[1],userRole:e[4],sprocketStatus:e[20],isLoadingSprocket:e[22],sprocketUploadFile:e[25],sprocketMessage:e[23],sprocketMessageType:e[24],sprocketVersions:e[21]};return void 0!==e[19]&&(o.sprocketScript=e[19]),t=new Fy({props:o}),R.push(()=>Z(t,"sprocketScript",i)),t.$on("restartSprocket",e[55]),t.$on("deleteSprocket",e[56]),t.$on("sprocketFileSelect",e[67]),t.$on("uploadSprocketScript",e[68]),t.$on("saveSprocket",e[54]),t.$on("loadSprocket",e[53]),t.$on("loadVersions",e[57]),t.$on("loadVersion",e[112]),t.$on("deleteVersion",e[113]),t.$on("openLoginModal",e[70]),{c(){X(t.$$.fragment)},m(e,n){ee(t,e,n),r=!0},p(e,r){const i={};2&r[0]&&(i.isLoggedIn=e[1]),16&r[0]&&(i.userRole=e[4]),1048576&r[0]&&(i.sprocketStatus=e[20]),4194304&r[0]&&(i.isLoadingSprocket=e[22]),33554432&r[0]&&(i.sprocketUploadFile=e[25]),8388608&r[0]&&(i.sprocketMessage=e[23]),16777216&r[0]&&(i.sprocketMessageType=e[24]),2097152&r[0]&&(i.sprocketVersions=e[21]),!n&&524288&r[0]&&(n=!0,i.sprocketScript=e[19],_(()=>n=!1)),t.$set(i)},i(e){r||(Y(t.$$.fragment,e),r=!0)},o(e){W(t.$$.fragment,e),r=!1},d(e){te(t,e)}}}function aw(e){let t,n,r,i;const o=[Tw,Rw,Pw],s=[];function a(e,t){return"managed"!==e[9]?0:e[1]&&"owner"===e[4]?1:2}return n=a(e),r=s[n]=o[n](e),{c(){t=p("div"),r.c(),A(t,"class","managed-acl-view svelte-u3u5mw")},m(e,r){u(e,t,r),s[n].m(t,null),i=!0},p(e,i){let l=n;n=a(e),n===l?s[n].p(e,i):(z(),W(s[l],1,1,()=>{s[l]=null}),q(),r=s[n],r?r.p(e,i):(r=s[n]=o[n](e),r.c()),Y(r,1),r.m(t,null))},i(e){i||(Y(r),i=!0)},o(e){W(r),i=!1},d(e){e&&d(t),s[n].d()}}}function lw(e){let t,n,r;function i(t){e[110](t)}let o={userPubkey:e[2],userRole:e[4],policyEnabled:e[8],publishError:e[34]};return void 0!==e[33]&&(o.composeEventJson=e[33]),t=new vy({props:o}),R.push(()=>Z(t,"composeEventJson",i)),t.$on("reformatJson",e[90]),t.$on("signEvent",e[91]),t.$on("publishEvent",e[92]),t.$on("clearError",e[93]),{c(){X(t.$$.fragment)},m(e,n){ee(t,e,n),r=!0},p(e,r){const i={};4&r[0]&&(i.userPubkey=e[2]),16&r[0]&&(i.userRole=e[4]),256&r[0]&&(i.policyEnabled=e[8]),8&r[1]&&(i.publishError=e[34]),!n&&4&r[1]&&(n=!0,i.composeEventJson=e[33],_(()=>n=!1)),t.$set(i)},i(e){r||(Y(t.$$.fragment,e),r=!0)},o(e){W(t.$$.fragment,e),r=!1},d(e){te(t,e)}}}function cw(e){let t,n;return t=new Lv({props:{isLoggedIn:e[1],userPubkey:e[2],userSigner:e[13],currentEffectiveRole:e[10]}}),t.$on("openLoginModal",e[70]),{c(){X(t.$$.fragment)},m(e,r){ee(t,e,r),n=!0},p(e,n){const r={};2&n[0]&&(r.isLoggedIn=e[1]),4&n[0]&&(r.userPubkey=e[2]),8192&n[0]&&(r.userSigner=e[13]),1024&n[0]&&(r.currentEffectiveRole=e[10]),t.$set(r)},i(e){n||(Y(t.$$.fragment,e),n=!0)},o(e){W(t.$$.fragment,e),n=!1},d(e){te(t,e)}}}function uw(e){let t,n;return t=new Zm({props:{isLoggedIn:e[1],userRole:e[4],userPubkey:e[2],filteredEvents:e[41],expandedEvents:e[18],isLoadingEvents:e[7],showOnlyMyEvents:zw,showFilterBuilder:e[15]}}),t.$on("scroll",e[89]),t.$on("toggleEventExpansion",e[106]),t.$on("deleteEvent",e[107]),t.$on("copyEventToClipboard",e[108]),t.$on("toggleChange",e[45]),t.$on("loadAllEvents",e[109]),t.$on("toggleFilterBuilder",e[76]),t.$on("filterApply",e[77]),t.$on("filterClear",e[78]),{c(){X(t.$$.fragment)},m(e,r){ee(t,e,r),n=!0},p(e,n){const r={};2&n[0]&&(r.isLoggedIn=e[1]),16&n[0]&&(r.userRole=e[4]),4&n[0]&&(r.userPubkey=e[2]),1024&n[1]&&(r.filteredEvents=e[41]),262144&n[0]&&(r.expandedEvents=e[18]),128&n[0]&&(r.isLoadingEvents=e[7]),32768&n[0]&&(r.showFilterBuilder=e[15]),t.$set(r)},i(e){n||(Y(t.$$.fragment,e),n=!0)},o(e){W(t.$$.fragment,e),n=!1},d(e){te(t,e)}}}function dw(e){let t,n;return t=new Zg({props:{isLoggedIn:e[1],currentEffectiveRole:e[10],selectedFile:e[16],aclMode:e[9],importMessage:e[17]}}),t.$on("fileSelect",e[86]),t.$on("importEvents",e[87]),t.$on("openLoginModal",e[70]),{c(){X(t.$$.fragment)},m(e,r){ee(t,e,r),n=!0},p(e,n){const r={};2&n[0]&&(r.isLoggedIn=e[1]),1024&n[0]&&(r.currentEffectiveRole=e[10]),65536&n[0]&&(r.selectedFile=e[16]),512&n[0]&&(r.aclMode=e[9]),131072&n[0]&&(r.importMessage=e[17]),t.$set(r)},i(e){n||(Y(t.$$.fragment,e),n=!0)},o(e){W(t.$$.fragment,e),n=!1},d(e){te(t,e)}}}function fw(e){let t,n;return t=new Jg({props:{isLoggedIn:e[1],currentEffectiveRole:e[10],aclMode:e[9]}}),t.$on("exportMyEvents",e[85]),t.$on("exportAllEvents",e[84]),t.$on("openLoginModal",e[70]),{c(){X(t.$$.fragment)},m(e,r){ee(t,e,r),n=!0},p(e,n){const r={};2&n[0]&&(r.isLoggedIn=e[1]),1024&n[0]&&(r.currentEffectiveRole=e[10]),512&n[0]&&(r.aclMode=e[9]),t.$set(r)},i(e){n||(Y(t.$$.fragment,e),n=!0)},o(e){W(t.$$.fragment,e),n=!1},d(e){te(t,e)}}}function pw(t){let n;return{c(){n=p("p"),n.textContent="Log in to access your user dashboard",A(n,"class","svelte-u3u5mw")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function hw(e){let t,n,r,i=(e[3]?.name||e[2].slice(0,8)+"...")+"";return{c(){t=p("p"),n=g("Welcome "),r=g(i),A(t,"class","svelte-u3u5mw")},m(e,i){u(e,t,i),c(t,n),c(t,r)},p(e,t){12&t[0]&&i!==(i=(e[3]?.name||e[2].slice(0,8)+"...")+"")&&k(r,i)},d(e){e&&d(t)}}}function gw(e){let t,n,i,o,s,a,l,f,h,y,w,b,I,C,E,x,B,S,Q,F,D,$=e[179].label+"",U=e[42].get(e[179].id)?.isLoading,P=!e[42].get(e[179].id)?.hasMore&&e[42].get(e[179].id)?.events?.length>0;function R(){return e[120](e[179])}function T(e,t){return 64&t[0]&&(C=null),64&t[0]&&(E=null),null==C&&(C=!!(e[42].get(e[179].id)?.events?.length>0)),C?yw:(null==E&&(E=!e[42].get(e[179].id)?.isLoading),E?mw:void 0)}w=new Gv({props:{filter:e[42].get(e[179].id)?.filter||{}}}),w.$on("sweep",function(){return e[121](e[179])});let N=T(e,[-1,-1,-1,-1,-1,-1]),O=N&&N(e),M=U&&bw(),L=P&&kw();function _(...t){return e[126](e[179],...t)}return{c(){t=p("div"),n=p("div"),i=p("h2"),o=g("🔍 "),s=g($),a=m(),l=p("button"),f=g("🔄 Refresh"),y=m(),X(w.$$.fragment),b=m(),I=p("div"),O&&O.c(),x=m(),M&&M.c(),B=m(),L&&L.c(),S=m(),A(i,"class","svelte-u3u5mw"),A(l,"class","refresh-btn svelte-u3u5mw"),l.disabled=h=e[42].get(e[179].id)?.isLoading,A(n,"class","search-results-header svelte-u3u5mw"),A(I,"class","search-results-content svelte-u3u5mw"),A(t,"class","search-results-view svelte-u3u5mw")},m(e,r){u(e,t,r),c(t,n),c(n,i),c(i,o),c(i,s),c(n,a),c(n,l),c(l,f),c(t,y),ee(w,t,null),c(t,b),c(t,I),O&&O.m(I,null),c(I,x),M&&M.m(I,null),c(I,B),L&&L.m(I,null),c(t,S),Q=!0,F||(D=[v(l,"click",R),v(I,"scroll",_)],F=!0)},p(t,n){e=t,(!Q||64&n[0])&&$!==($=e[179].label+"")&&k(s,$),(!Q||64&n[0]&&h!==(h=e[42].get(e[179].id)?.isLoading))&&(l.disabled=h);const r={};64&n[0]&&(r.filter=e[42].get(e[179].id)?.filter||{}),w.$set(r),N===(N=T(e,n))&&O?O.p(e,n):(O&&O.d(1),O=N&&N(e),O&&(O.c(),O.m(I,x))),64&n[0]&&(U=e[42].get(e[179].id)?.isLoading),U?M||(M=bw(),M.c(),M.m(I,B)):M&&(M.d(1),M=null),64&n[0]&&(P=!e[42].get(e[179].id)?.hasMore&&e[42].get(e[179].id)?.events?.length>0),P?L||(L=kw(),L.c(),L.m(I,null)):L&&(L.d(1),L=null)},i(e){Q||(Y(w.$$.fragment,e),Q=!0)},o(e){W(w.$$.fragment,e),Q=!1},d(e){e&&d(t),te(w),O&&O.d(),M&&M.d(),L&&L.d(),F=!1,r(D)}}}function mw(t){let n;return{c(){n=p("div"),n.innerHTML='

    No search results found.

    ',A(n,"class","no-search-results svelte-u3u5mw")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function yw(e){let t,n=e[42].get(e[179].id).events,r=[];for(let t=0;t👤',o=m(),s=p("div"),a=p("div"),l=g(O),f=m(),h=p("div"),y=p("span"),w=g(M),b=m(),I=p("span"),C=g(L),E=m(),B=p("div"),S=p("div"),Q=g(_),F=m(),D=p("div"),$=g(H),U=m(),G&&G.c(),P=m(),V&&V.c(),R=m(),A(i,"class","search-result-avatar svelte-u3u5mw"),A(a,"class","search-result-author svelte-u3u5mw"),A(y,"class","kind-number svelte-u3u5mw"),A(I,"class","kind-name svelte-u3u5mw"),A(h,"class","search-result-kind svelte-u3u5mw"),A(s,"class","search-result-info svelte-u3u5mw"),A(S,"class","event-timestamp svelte-u3u5mw"),A(D,"class","event-content-single-line svelte-u3u5mw"),A(B,"class","search-result-content svelte-u3u5mw"),A(n,"class","search-result-row svelte-u3u5mw"),A(n,"role","button"),A(n,"tabindex","0"),A(t,"class","search-result-item svelte-u3u5mw"),x(t,"expanded",e[18].has(e[172].id))},m(e,r){u(e,t,r),c(t,n),c(n,i),c(n,o),c(n,s),c(s,a),c(a,l),c(s,f),c(s,h),c(h,y),c(y,w),c(h,b),c(h,I),c(I,C),c(n,E),c(n,B),c(B,S),c(S,Q),c(B,F),c(B,D),c(D,$),c(n,U),G&&G.m(n,null),c(t,P),V&&V.m(t,null),c(t,R),T||(N=[v(n,"click",J),v(n,"keydown",K)],T=!0)},p(r,i){e=r,64&i[0]&&O!==(O=Kv(e[172].pubkey)+"")&&k(l,O),64&i[0]&&M!==(M=e[172].kind+"")&&k(w,M),64&i[0]&&L!==(L=Jv(e[172].kind)+"")&&k(C,L),64&i[0]&&_!==(_=zv(e[172].created_at)+"")&&k(Q,_),64&i[0]&&H!==(H=Vv(e[172].content)+"")&&k($,H),5!==e[172].kind&&("admin"===e[4]||"owner"===e[4]||"write"===e[4]&&e[172].pubkey&&e[172].pubkey===e[2])?G?G.p(e,i):(G=vw(e),G.c(),G.m(n,null)):G&&(G.d(1),G=null),262208&i[0]&&(j=e[18].has(e[172].id)),j?V?V.p(e,i):(V=ww(e),V.c(),V.m(t,R)):V&&(V.d(1),V=null),262208&i[0]|2048&i[1]&&x(t,"expanded",e[18].has(e[172].id))},d(e){e&&d(t),G&&G.d(),V&&V.d(),T=!1,r(N)}}}function bw(e){let t;return{c(){t=p("div"),t.innerHTML='
    \n

    Searching...

    ',A(t,"class","loading-search-results svelte-u3u5mw")},m(e,n){u(e,t,n)},d(e){e&&d(t)}}}function kw(e){let t;return{c(){t=p("div"),t.innerHTML='

    No more search results to load.

    ',A(t,"class","end-of-search-results svelte-u3u5mw")},m(e,n){u(e,t,n)},d(e){e&&d(t)}}}function Iw(e){let t,n,r=e[179].id===e[5]&&gw(e);return{c(){r&&r.c(),t=y()},m(e,i){r&&r.m(e,i),u(e,t,i),n=!0},p(e,n){e[179].id===e[5]?r?(r.p(e,n),96&n[0]&&Y(r,1)):(r=gw(e),r.c(),Y(r,1),r.m(t.parentNode,t)):r&&(z(),W(r,1,1,()=>{r=null}),q())},i(e){n||(Y(r),n=!0)},o(e){W(r),n=!1},d(e){r&&r.d(e),e&&d(t)}}}function Cw(t){let n,r,i=t[176].label+"";return{c(){n=p("option"),r=g(i),n.__value=t[176].value,n.value=n.__value},m(e,t){u(e,n,t),c(n,r)},p:e,d(e){e&&d(n)}}}function Ew(e){let t;function n(e,t){return e[38]?Sw:0===e[37].length?Bw:xw}let r=n(e),i=r(e);return{c(){t=p("div"),i.c(),A(t,"class","recovery-results svelte-u3u5mw")},m(e,n){u(e,t,n),i.m(t,null)},p(e,o){r===(r=n(e))&&i?i.p(e,o):(i.d(1),i=r(e),i&&(i.c(),i.m(t,null)))},d(e){e&&d(t),i.d()}}}function xw(e){let t,n,r,i=e[37],o=[];for(let t=0;tORLY_ACL_MODE=managed in your\n environment variables and restart the relay.',A(r,"class","svelte-u3u5mw"),A(o,"class","svelte-u3u5mw"),A(a,"class","svelte-u3u5mw"),A(v,"class","svelte-u3u5mw"),A(n,"class","acl-mode-warning svelte-u3u5mw")},m(e,t){u(e,n,t),c(n,r),c(n,i),c(n,o),c(n,s),c(n,a),c(a,l),c(a,f),c(f,h),c(n,y),c(n,v)},p(e,t){512&t[0]&&w!==(w=(e[9]||"unknown")+"")&&k(h,w)},i:e,o:e,d(e){e&&d(n)}}}function Nw(e){let t,n,i,o,s,a,l,f,h,g;function y(e,t){return e[3]?Mw:e[1]&&e[2]?Ow:void 0}let b=y(e),k=b&&b(e);return{c(){t=p("div"),n=p("div"),i=p("div"),o=p("h2"),o.textContent="Settings",s=m(),a=p("button"),a.textContent="✕",l=m(),f=p("div"),k&&k.c(),A(o,"class","svelte-u3u5mw"),A(a,"class","close-btn svelte-u3u5mw"),A(i,"class","drawer-header svelte-u3u5mw"),A(f,"class","drawer-content"),A(n,"class","settings-drawer svelte-u3u5mw"),x(n,"dark-theme",e[0]),A(t,"class","drawer-overlay svelte-u3u5mw"),A(t,"role","button"),A(t,"tabindex","0")},m(r,d){u(r,t,d),c(t,n),c(n,i),c(i,o),c(i,s),c(i,a),c(n,l),c(n,f),k&&k.m(f,null),h||(g=[v(a,"click",e[75]),v(n,"click",w(e[101])),v(n,"keydown",w(e[102])),v(t,"click",e[75]),v(t,"keydown",e[128])],h=!0)},p(e,t){b===(b=y(e))&&k?k.p(e,t):(k&&k.d(1),k=b&&b(e),k&&(k.c(),k.m(f,null))),1&t[0]&&x(n,"dark-theme",e[0])},d(e){e&&d(t),k&&k.d(),h=!1,r(g)}}}function Ow(e){let t,n,i,o,s,a,l,f,h,y,w,b,I,C,E,x,B,S=e[2].slice(0,16)+"",Q=e[2].slice(-8)+"";return{c(){t=p("div"),n=p("button"),n.textContent="Log out",i=m(),o=p("h3"),o.textContent="Profile Loading",s=m(),a=p("p"),a.textContent="Your profile metadata is being loaded...",l=m(),f=p("button"),f.textContent="Retry Loading Profile",h=m(),y=p("div"),w=p("strong"),w.textContent="Public Key:",b=m(),I=g(S),C=g("..."),E=g(Q),A(n,"class","logout-btn floating svelte-u3u5mw"),A(o,"class","svelte-u3u5mw"),A(a,"class","svelte-u3u5mw"),A(f,"class","retry-profile-btn svelte-u3u5mw"),A(y,"class","user-pubkey-display svelte-u3u5mw"),A(t,"class","profile-loading-section svelte-u3u5mw")},m(r,d){u(r,t,d),c(t,n),c(t,i),c(t,o),c(t,s),c(t,a),c(t,l),c(t,f),c(t,h),c(t,y),c(y,w),c(y,b),c(y,I),c(y,C),c(y,E),x||(B=[v(n,"click",e[72]),v(f,"click",e[83])],x=!0)},p(e,t){4&t[0]&&S!==(S=e[2].slice(0,16)+"")&&k(I,S),4&t[0]&&Q!==(Q=e[2].slice(-8)+"")&&k(E,Q)},d(e){e&&d(t),x=!1,r(B)}}}function Mw(e){let t,n,r,i,o,s,a,l,f,h,w,b,I,C,E,x=(e[3].name||"Unknown User")+"",B=e[3].banner&&Lw(e);function S(e,t){return e[3].picture?Hw:_w}let Q=S(e),F=Q(e),D=e[3].nip05&&jw(e),$=e[3].about&&Gw(e),U=e[4]&&"read"!==e[4]&&Jw(e);return{c(){t=p("div"),n=p("div"),B&&B.c(),r=m(),i=p("button"),i.textContent="Log out",o=m(),F.c(),s=m(),a=p("div"),l=p("h3"),f=g(x),h=m(),D&&D.c(),w=m(),$&&$.c(),b=m(),U&&U.c(),I=y(),A(i,"class","logout-btn floating svelte-u3u5mw"),A(l,"class","profile-username svelte-u3u5mw"),A(a,"class","name-row svelte-u3u5mw"),A(n,"class","profile-hero svelte-u3u5mw"),A(t,"class","profile-section svelte-u3u5mw")},m(d,p){u(d,t,p),c(t,n),B&&B.m(n,null),c(n,r),c(n,i),c(n,o),F.m(n,null),c(n,s),c(n,a),c(a,l),c(l,f),c(a,h),D&&D.m(a,null),c(t,w),$&&$.m(t,null),u(d,b,p),U&&U.m(d,p),u(d,I,p),C||(E=v(i,"click",e[72]),C=!0)},p(e,i){e[3].banner?B?B.p(e,i):(B=Lw(e),B.c(),B.m(n,r)):B&&(B.d(1),B=null),Q===(Q=S(e))&&F?F.p(e,i):(F.d(1),F=Q(e),F&&(F.c(),F.m(n,s))),8&i[0]&&x!==(x=(e[3].name||"Unknown User")+"")&&k(f,x),e[3].nip05?D?D.p(e,i):(D=jw(e),D.c(),D.m(a,null)):D&&(D.d(1),D=null),e[3].about?$?$.p(e,i):($=Gw(e),$.c(),$.m(t,null)):$&&($.d(1),$=null),e[4]&&"read"!==e[4]?U?U.p(e,i):(U=Jw(e),U.c(),U.m(I.parentNode,I)):U&&(U.d(1),U=null)},d(e){e&&d(t),B&&B.d(),F.d(),D&&D.d(),$&&$.d(),e&&d(b),U&&U.d(e),e&&d(I),C=!1,E()}}}function Lw(e){let t,n;return{c(){t=p("img"),a(t.src,n=e[3].banner)||A(t,"src",n),A(t,"alt","Profile banner"),A(t,"class","profile-banner svelte-u3u5mw")},m(e,n){u(e,t,n)},p(e,r){8&r[0]&&!a(t.src,n=e[3].banner)&&A(t,"src",n)},d(e){e&&d(t)}}}function _w(t){let n;return{c(){n=p("div"),n.textContent="👤",A(n,"class","profile-avatar-placeholder overlap svelte-u3u5mw")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function Hw(e){let t,n;return{c(){t=p("img"),a(t.src,n=e[3].picture)||A(t,"src",n),A(t,"alt","User avatar"),A(t,"class","profile-avatar overlap svelte-u3u5mw")},m(e,n){u(e,t,n)},p(e,r){8&r[0]&&!a(t.src,n=e[3].picture)&&A(t,"src",n)},d(e){e&&d(t)}}}function jw(e){let t,n,r=e[3].nip05+"";return{c(){t=p("span"),n=g(r),A(t,"class","profile-nip05-inline svelte-u3u5mw")},m(e,r){u(e,t,r),c(t,n)},p(e,t){8&t[0]&&r!==(r=e[3].nip05+"")&&k(n,r)},d(e){e&&d(t)}}}function Gw(e){let t,n;return{c(){t=p("div"),n=p("p"),A(n,"class","profile-about svelte-u3u5mw"),A(t,"class","about-card svelte-u3u5mw")},m(r,i){u(r,t,i),c(t,n),n.innerHTML=e[40]},p(e,t){512&t[1]&&(n.innerHTML=e[40])},d(e){e&&d(t)}}}function Jw(e){let t,n,r,i,o,s,a=e[95](),l=[];for(let t=0;tZ(y,"showModal",E)),y.$on("login",e[71]),y.$on("close",e[73]),{c(){X(t.$$.fragment),n=m(),r=p("div"),X(i.$$.fragment),o=m(),s=p("main"),f.c(),h=m(),C&&C.c(),g=m(),X(y.$$.fragment),A(s,"class","main-content svelte-u3u5mw"),A(r,"class","app-container svelte-u3u5mw"),x(r,"dark-theme",e[0])},m(e,a){ee(t,e,a),u(e,n,a),u(e,r,a),ee(i,r,null),c(r,o),c(r,s),k[l].m(s,null),u(e,h,a),C&&C.m(e,a),u(e,g,a),ee(y,e,a),w=!0},p(e,n){const o={};1&n[0]&&(o.isDarkTheme=e[0]),2&n[0]&&(o.isLoggedIn=e[1]),16&n[0]&&(o.userRole=e[4]),1024&n[0]&&(o.currentEffectiveRole=e[10]),8&n[0]&&(o.userProfile=e[3]),4&n[0]&&(o.userPubkey=e[2]),t.$set(o);const a={};1&n[0]&&(a.isDarkTheme=e[0]),2048&n[0]&&(a.tabs=e[11]),32&n[0]&&(a.selectedTab=e[5]),2&n[1]&&(a.version=e[32]),i.$set(a);let c=l;l=I(e,n),l===c?k[l].p(e,n):(z(),W(k[c],1,1,()=>{k[c]=null}),q(),f=k[l],f?f.p(e,n):(f=k[l]=b[l](e),f.c()),Y(f,1),f.m(s,null)),(!w||1&n[0])&&x(r,"dark-theme",e[0]),e[14]?C?C.p(e,n):(C=Nw(e),C.c(),C.m(g.parentNode,g)):C&&(C.d(1),C=null);const u={};1&n[0]&&(u.isDarkTheme=e[0]),!v&&4096&n[0]&&(v=!0,u.showModal=e[12],_(()=>v=!1)),y.$set(u)},i(e){w||(Y(t.$$.fragment,e),Y(i.$$.fragment,e),Y(f),Y(y.$$.fragment,e),w=!0)},o(e){W(t.$$.fragment,e),W(i.$$.fragment,e),W(f),W(y.$$.fragment,e),w=!1},d(e){te(t,e),e&&d(n),e&&d(r),te(i),k[l].d(),e&&d(h),C&&C.d(e),e&&d(g),te(y,e)}}}let zw=!1,qw=!1;function Yw(e,t,n){let r,i,o,s,a;"undefined"!=typeof window&&(window.debugIndexedDB=Dp);let l=!1,c=!1,u=!1,d="",f="",p=null,h="",g=null,m=!1,y=localStorage.getItem("selectedTab")||"export",v=!1,w={},A=[],k=[],I=null,C="",E=new Set,x=!1,B=!0,S=null,Q="",F=new Map,D=[],$=0,P=[],R=!0,T=null,N="",O=null,M=[],L=!1,_="",H="info",j=!1,G=null,J="",K=!1,V=!1,z="",q="info",Y=[],W=[],Z="",X="",ee="",te="",ne=null,re="",ie=[],oe=!1,se=!0,ae=null;function le(e){E.has(e)?E.delete(e):E.add(e),n(18,E)}async function ce(e,t){const n=JSON.stringify(e),r=await async function(e){try{return await navigator.clipboard.writeText(e),!0}catch(t){console.error("Failed to copy to clipboard:",t);try{const t=document.createElement("textarea");return t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),!0}catch(e){return console.error("Fallback copy also failed:",e),!1}}}(n);!function(e,t=!0){if(!e)return;const n=e.textContent,r=e.style.backgroundColor;t?(e.textContent="",e.style.backgroundColor="#4CAF50"):(e.textContent="L",e.style.backgroundColor="#f44336"),setTimeout(()=>{e.textContent=n,e.style.backgroundColor=r},2e3)}(t.target.closest(".copy-json-btn"),r),r||alert("Failed to copy to clipboard. Please copy manually.")}async function ue(e){if(!u)return void alert("Please log in first");const t=k.find(t=>t.id===e);if(!t)return void alert("Event not found");if("admin"===h||"owner"===h||"write"===h&&t.pubkey&&t.pubkey===d){if(confirm("Are you sure you want to delete this event?"))try{if(!g)throw new Error("Signer not available for signing");const r={kind:5,created_at:Math.floor(Date.now()/1e3),tags:[["e",e]],content:""};console.log("Created delete event template:",r),console.log("User pubkey:",d),console.log("Target event:",t),console.log("Target event pubkey:",t.pubkey);const i=await g.signEvent(r);console.log("Signed delete event:",i),console.log("Signed delete event pubkey:",i.pubkey),console.log("Delete event tags:",i.tags);const o=`${window.location.protocol.startsWith("https")?"wss:":"ws:"}//${window.location.host}/`;try{const e=await Yv(o,i,g,d);e.success?console.log("Delete event published successfully to ORLY relay"):console.error("Failed to publish delete event:",e.reason)}catch(e){console.error("Error publishing delete event:",e)}const s=t.pubkey&&t.pubkey===d;if(s){const t=await gp.publish(i);if(console.log("Delete event published:",t),!(t.success&&t.okCount>0))throw new Error("No relays accepted the delete event");{await new Promise(e=>setTimeout(e,2e3));try{const n=await Bp(e,{timeout:5e3});n?(console.warn("Event still exists after deletion attempt:",n),alert(`Warning: Delete event was accepted by ${t.okCount} relay(s), but the event still exists on the relay. This may indicate the relay does not properly handle delete events.`)):console.log("Event successfully deleted and verified")}catch(e){console.log("Could not fetch event after deletion (likely deleted):",e.message)}try{const t=await Sp(e,{timeout:5e3});if(t.length>0){console.log(`Delete event verification: Found ${t.length} delete event(s) targeting ${e}`);const n=t.find(e=>e.pubkey&&e.pubkey===d);n?console.log("Our delete event found in database:",n.id):console.warn("Our delete event not found in database, but other delete events exist")}else console.warn("No delete events found in database for target event:",e)}catch(e){console.log("Could not verify delete event in database:",e.message)}n(96,k=k.filter(t=>t.id!==e)),P=P.filter(t=>t.id!==e),D=D.filter(t=>t.id!==e);for(const[t,n]of F)n.events&&(n.events=n.events.filter(t=>t.id!==e),F.set(t,n));he(),console.log("Reloading events to show delete event...");const r=zw&&u&&d?[d]:null;await Pe(!0,r),alert(`Event deleted successfully (accepted by ${t.okCount} relay(s))`)}}else{const t=`${window.location.protocol.startsWith("https")?"wss:":"ws:"}//${window.location.host}/`,r=new hp;await r.connectToRelay(t);const o=await r.publish(i);if(console.log("Delete event published to local relay only:",o),!(o.success&&o.okCount>0))throw new Error("Local relay did not accept the delete event");{await new Promise(e=>setTimeout(e,2e3));try{const t=await Bp(e,{timeout:5e3});t?(console.warn("Event still exists after deletion attempt:",t),alert(`Warning: Delete event was accepted by ${o.okCount} relay(s), but the event still exists on the relay. This may indicate the relay does not properly handle delete events.`)):console.log("Event successfully deleted and verified")}catch(e){console.log("Could not fetch event after deletion (likely deleted):",e.message)}try{const t=await Sp(e,{timeout:5e3});if(t.length>0){console.log(`Delete event verification: Found ${t.length} delete event(s) targeting ${e}`);const n=t.find(e=>e.pubkey&&e.pubkey===d);n?console.log("Our delete event found in database:",n.id):console.warn("Our delete event not found in database, but other delete events exist")}else console.warn("No delete events found in database for target event:",e)}catch(e){console.log("Could not verify delete event in database:",e.message)}n(96,k=k.filter(t=>t.id!==e)),P=P.filter(t=>t.id!==e),D=D.filter(t=>t.id!==e);for(const[t,n]of F)n.events&&(n.events=n.events.filter(t=>t.id!==e),F.set(t,n));he(),console.log("Reloading events to show delete event...");const t=zw&&u&&d?[d]:null;await Pe(!0,t),alert("Event deleted successfully (local relay only - admin/owner deleting other user's event)")}}}catch(e){console.error("Failed to delete event:",e),alert("Failed to delete event: "+e.message)}}else alert("You do not have permission to delete this event")}async function de(){const e=re?parseInt(re):ne;if(null==e||isNaN(e))console.log("No valid kind to load, kindToUse:",e);else if(u){console.log("Loading recovery events for kind:",e,"user:",d),n(38,oe=!0);try{const t=[{kinds:[e],authors:[d],limit:100}];ae&&(t[0].until=ae),console.log("Recovery filters:",t);const r=await Fp(t,{timeout:3e4,cacheFirst:!0});console.log("Recovery events received:",r.length),console.log("Recovery events kinds:",r.map(e=>e.kind)),n(37,ie=ae?[...ie,...r]:r),r.length>0?(ae=Math.min(...r.map(e=>e.created_at)),n(39,se=100===r.length)):n(39,se=!1)}catch(e){console.error("Failed to load recovery events:",e)}finally{n(38,oe=!1)}}else console.log("Not logged in, cannot load recovery events")}async function fe(e){if(confirm("Are you sure you want to repost this event?"))try{const t=`${window.location.protocol.startsWith("https")?"wss:":"ws:"}//${window.location.host}/`;console.log("Reposting event to local relay:",t,e);const r={...e};if(r.created_at=Math.floor(Date.now()/1e3),r.id="",r.sig="",e.kind>=3e4&&e.kind<=39999){const t=e.tags.find(e=>"d"===e[0]);t&&(r.tags=r.tags.filter(e=>"d"!==e[0]),r.tags.push(t))}if(g){const e=await g.signEvent(r);console.log("Signed event for repost:",e);const i=await gp.publish(e,[t]);console.log("Repost publish result:",i),i.success&&i.okCount>0?(alert("Event reposted successfully!"),n(39,se=!1),await de()):alert("Failed to repost event. Check console for details.")}else alert("No signer available. Please log in.")}catch(e){console.error("Error reposting event:",e),alert("Error reposting event: "+e.message)}}async function pe(e){if(confirm("Are you sure you want to repost this event to all your write relays?"))try{const t=await async function(){if(!d)return[];try{const e=await kp([{kinds:[10002],authors:[d],limit:1}]);if(0===e.length)return console.log("No relay list event found for user"),[];const t=e[0];console.log("Found relay list event:",t);const n=[];for(const e of t.tags)if("r"===e[0]&&e.length>=2){const t=e[1],r=e.length>=3?e[2]:null;r&&"write"!==r||n.push(t)}return console.log("Found write relays:",n),n}catch(e){return console.error("Error fetching user write relays:",e),[]}}(),r=`${window.location.protocol.startsWith("https")?"wss:":"ws:"}//${window.location.host}/`,i=[r,...t.filter(e=>e!==r)];1===i.length&&alert("No write relays found in your relay list. Only posting to local relay."),console.log("Reposting event to all relays:",i,e);const o={...e};if(o.created_at=Math.floor(Date.now()/1e3),o.id="",o.sig="",e.kind>=3e4&&e.kind<=39999){const t=e.tags.find(e=>"d"===e[0]);t&&(o.tags=o.tags.filter(e=>"d"!==e[0]),o.tags.push(t))}if(g){const e=await g.signEvent(o);console.log("Signed event for repost to all:",e);const t=await gp.publish(e,i);console.log("Repost to all publish result:",t),t.success&&t.okCount>0?(alert(`Event reposted successfully to ${i.length} relays!`),n(39,se=!1),await de()):alert("Failed to repost event. Check console for details.")}else alert("No signer available. Please log in.")}catch(e){console.error("Error reposting event to all:",e),alert("Error reposting event to all: "+e.message)}}if("undefined"!=typeof window&&window.matchMedia){const e=window.matchMedia("(prefers-color-scheme: dark)");l=e.matches,e.addEventListener("change",e=>{n(0,l=e.matches)})}if("undefined"!=typeof localStorage){const e=localStorage.getItem("nostr_auth_method"),t=localStorage.getItem("nostr_pubkey");e&&t&&(u=!0,d=t,f=e,"extension"===e&&window.nostr&&(g=window.nostr),De(),$e()),function(){if("undefined"==typeof localStorage)return;try{const t=localStorage.getItem("app_state");if(t){const r=JSON.parse(t);r.selectedTab&&Ie.some(e=>e.id===r.selectedTab)&&n(5,y=r.selectedTab),r.expandedEvents&&n(18,E=new Set(r.expandedEvents)),r.globalEventsCache&&(D=r.globalEventsCache),r.globalCacheTimestamp&&($=r.globalCacheTimestamp),void 0!==r.hasMoreEvents&&(B=r.hasMoreEvents),r.oldestEventTimestamp&&(S=r.oldestEventTimestamp),void 0!==r.hasMoreMyEvents&&(R=r.hasMoreMyEvents),r.oldestMyEventTimestamp&&(T=r.oldestMyEventTimestamp),D.length>0&&((e=$)&&Date.now()-et.created_at-e.created_at),$=Date.now(),he()}async function me(){if(u&&"owner"===h&&j)try{n(22,L=!0);const e=await fetch("/api/sprocket/status",{method:"GET",headers:{Authorization:`Nostr ${await Oe("GET","/api/sprocket/status")}`,"Content-Type":"application/json"}});e.ok?n(20,O=await e.json()):Ae("Failed to load sprocket status","error")}catch(e){Ae(`Error loading sprocket status: ${e.message}`,"error")}finally{n(22,L=!1)}}async function ye(){if(u&&"owner"===h)try{n(22,L=!0);const e=await fetch("/api/sprocket/versions",{method:"GET",headers:{Authorization:`Nostr ${await Oe("GET","/api/sprocket/versions")}`,"Content-Type":"application/json"}});e.ok?n(21,M=await e.json()):Ae("Failed to load versions","error")}catch(e){Ae(`Error loading versions: ${e.message}`,"error")}finally{n(22,L=!1)}}async function ve(e){u&&"owner"===h&&(n(19,N=e.content),Ae(`Loaded version: ${e.name}`,"success"))}async function we(e){if(u&&"owner"===h&&confirm(`Are you sure you want to delete version ${e}?`))try{n(22,L=!0);const t=await fetch("/api/sprocket/delete-version",{method:"POST",headers:{Authorization:`Nostr ${await Oe("POST","/api/sprocket/delete-version")}`,"Content-Type":"application/json"},body:JSON.stringify({filename:e})});if(t.ok)Ae(`Version ${e} deleted successfully`,"success"),await ye();else{Ae(`Failed to delete version: ${await t.text()}`,"error")}}catch(e){Ae(`Error deleting version: ${e.message}`,"error")}finally{n(22,L=!1)}}function Ae(e,t="info"){n(23,_=e),n(24,H=t),setTimeout(()=>{n(23,_="")},5e3)}function be(e,t="info"){n(28,z=e),n(29,q=t),"error"!==t&&setTimeout(()=>{n(28,z="")},5e3)}async function ke(){if(n(30,Y=[]),!J.trim())return n(30,Y=["Policy JSON is empty"]),be("Validation failed","error"),!1;try{const e=JSON.parse(J);if("object"!=typeof e||null===e)return n(30,Y=["Policy must be a JSON object"]),be("Validation failed","error"),!1;if(e.policy_admins)if(Array.isArray(e.policy_admins))for(const t of e.policy_admins)"string"==typeof t&&/^[0-9a-fA-F]{64}$/.test(t)||Y.push(`Invalid policy_admin pubkey: ${t}`);else Y.push("policy_admins must be an array");if(e.rules)if("object"!=typeof e.rules)Y.push("rules must be an object");else for(const[t,n]of Object.entries(e.rules))if(/^\d+$/.test(t)||Y.push(`Invalid kind number: ${t}`),n.tag_validation&&"object"==typeof n.tag_validation)for(const[e,t]of Object.entries(n.tag_validation))try{new RegExp(t)}catch(n){Y.push(`Invalid regex for tag '${e}': ${t}`)}return e.default_policy&&!["allow","deny"].includes(e.default_policy)&&Y.push("default_policy must be 'allow' or 'deny'"),Y.length>0?(be("Validation failed - see errors below","error"),!1):(be("Validation passed","success"),!0)}catch(e){return n(30,Y=[`JSON parse error: ${e.message}`]),be("Invalid JSON syntax","error"),!1}}const Ie=[{id:"export",icon:"📤",label:"Export"},{id:"import",icon:"💾",label:"Import",requiresAdmin:!0},{id:"events",icon:"📡",label:"Events"},{id:"blossom",icon:"🌸",label:"Blossom"},{id:"compose",icon:"✏️",label:"Compose",requiresWrite:!0},{id:"recovery",icon:"🔄",label:"Recovery"},{id:"managed-acl",icon:"🛡️",label:"Managed ACL",requiresOwner:!0},{id:"sprocket",icon:"⚙️",label:"Sprocket",requiresOwner:!0},{id:"policy",icon:"📜",label:"Policy",requiresOwner:!0}];function Ce(e){n(5,y=e),"sprocket"===e&&u&&"owner"===h&&j&&(me(),ye()),he()}function Ee(){n(14,m=!1)}function xe(e){Be(e)}function Be(e){n(6,A=A.filter(t=>t.id!==e)),F.delete(e),y===e&&n(5,y="export")}async function Se(e,t=!0){const n=F.get(e);if(n&&!n.isLoading){n.isLoading=!0,F.set(e,n);try{const r={...n.filter};!t&&n.oldestTimestamp&&(r.until=n.oldestTimestamp),t||(r.limit=200),console.log("Loading search results with filter:",r);const i=await xp([r],{timeout:3e4});if(console.log("Received search results:",i.length,"events"),n.events=t?i.sort((e,t)=>t.created_at-e.created_at):[...n.events,...i].sort((e,t)=>t.created_at-e.created_at),i.length>0){const e=Math.min(...i.map(e=>e.created_at));(!n.oldestTimestamp||e0){const e=o.filter(e=>e.pubkey&&e.pubkey!==d);e.length>0&&console.warn("Server returned non-user events:",e.length,"out of",o.length)}if(e?(n(96,k=o.sort((e,t)=>t.created_at-e.created_at)),ge(o)):(n(96,k=[...k,...o].sort((e,t)=>t.created_at-e.created_at)),ge(k)),o.length>0){const e=Math.min(...o.map(e=>e.created_at));(!S||e{if("events"===y){const e=document.querySelectorAll(".events-view-content")[0];e&&e.scrollHeight<=e.clientHeight&&Re()}},100)}catch(e){console.error("Failed to load events:",e),alert("Failed to load events: "+e.message)}finally{n(7,x=!1)}}}async function Re(){await Pe(!1)}let Te=!1;async function Ne(e,t){if(!u||!d)throw new Error("Not logged in");const n={kind:27235,created_at:Math.floor(Date.now()/1e3),tags:[["u",window.location.origin+e],["method",t.toUpperCase()]],content:"",pubkey:d};let r;if(g&&"extension"===f)try{r=await g.signEvent(n)}catch(e){throw new Error("Failed to sign with extension: "+e.message)}else{if("nsec"!==f)throw new Error("No valid signer available");n.id="mock-id-"+Date.now(),n.sig="mock-signature-"+Date.now(),r=n}const i=JSON.stringify(r);return`Nostr ${btoa(i)}`}async function Oe(e,t){if(!u||!d)throw new Error("Not logged in");const n={kind:27235,created_at:Math.floor(Date.now()/1e3),tags:[["u",window.location.origin+t],["method",e.toUpperCase()]],content:"",pubkey:d};let r;if(g&&"extension"===f)try{r=await g.signEvent(n)}catch(e){throw new Error("Failed to sign with extension: "+e.message)}else{if("nsec"!==f)throw new Error("No valid signer available");n.id="mock-id-"+Date.now(),n.sig="mock-signature-"+Date.now(),r=n}const i=JSON.stringify(r);return btoa(i)}function Me(e,t){const n=e.toLowerCase();if(n.includes("policy")||n.includes("blocked")||n.includes("denied")){let n=`Policy Error: ${e}`;return null!==t&&(n+=`\n\nKind ${t} may be restricted by the relay's policy configuration.`),K&&(n+="\n\nThe relay has policy enforcement enabled. Contact a relay administrator to allow this event kind or adjust your permissions."),n}if(n.includes("auth")||n.includes("permission")||n.includes("unauthorized"))return`Permission Error: ${e}\n\nYour current permissions may not allow publishing this type of event. Current role: ${h||"unknown"}. Contact a relay administrator to upgrade your permissions.`;if(n.includes("kind")||n.includes("not allowed")||n.includes("restricted")){let n=`Event Type Error: ${e}`;return null!==t&&(n+=`\n\nKind ${t} is not currently allowed on this relay.`),n+="\n\nThe relay administrator may need to update the policy configuration to allow this event kind.",n}return n.includes("rate")||n.includes("limit")||n.includes("too many")?`Rate Limit Error: ${e}\n\nPlease wait a moment before trying again.`:n.includes("size")||n.includes("too large")||n.includes("content")?`Size Limit Error: ${e}\n\nThe event may exceed the relay's size limits. Try reducing the content length.`:`Publishing failed: ${e}`}function Le(e){n(97,Q=e),localStorage.setItem("viewAsRole",e),console.log("View as role changed to:",e,"Current effective role:",a)}Q=localStorage.getItem("viewAsRole")||"";return e.$$.update=()=>{var t;if(6&e.$$.dirty[0]|8&e.$$.dirty[3]&&n(41,r=k.sort((e,t)=>t.created_at-e.created_at)),8&e.$$.dirty[0]&&n(40,i=p?.about?(t=p.about,t?t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"):"").replace(/\n{2,}/g,"
    "):""),16&e.$$.dirty[0]|16&e.$$.dirty[3]&&n(10,a=Q&&""!==Q?Q:h),1810&e.$$.dirty[0]|48&e.$$.dirty[3]&&n(100,o=Ie.filter(e=>{const t=a;return!(e.requiresAdmin&&(!u||"admin"!==t&&"owner"!==t))&&(!(e.requiresOwner&&(!u||"owner"!==t))&&(!(e.requiresWrite&&(!u||"read"===t))&&(!("sprocket"===e.id&&!j)&&(!("policy"===e.id&&!K)&&(("managed-acl"!==e.id||"managed"===Z)&&(console.log(`Tab ${e.id} filter check:`,{isLoggedIn:u,userRole:h,viewAsRole:Q,currentRole:t,requiresAdmin:e.requiresAdmin,requiresOwner:e.requiresOwner,requiresWrite:e.requiresWrite,visible:!0}),!0))))))})),64&e.$$.dirty[0]|128&e.$$.dirty[3]&&n(11,s=[...o,...A]),2578&e.$$.dirty[0]|128&e.$$.dirty[3]&&console.log("Tabs debug:",{isLoggedIn:u,userRole:h,aclMode:Z,filteredBaseTabs:o.map(e=>e.id),allTabs:s.map(e=>e.id)}),1&e.$$.dirty[0]&&"undefined"!=typeof document&&(l?document.body.classList.add("dark-theme"):document.body.classList.remove("dark-theme")),14&e.$$.dirty[0]&&u&&d&&!p&&Fe(),182&e.$$.dirty[0]|72&e.$$.dirty[3]&&"events"===y&&u&&("read"===h||"write"===h||"admin"===h||"owner"===h)&&0===k.length&&!Te&&!x){n(99,Te=!0);Pe(!0,null)}32&e.$$.dirty[0]|8&e.$$.dirty[3]&&("events"!==y||"events"===y&&k.length>0)&&n(99,Te=!1),32&e.$$.dirty[0]&&localStorage.setItem("selectedTab",y)},[l,u,d,p,h,y,A,x,K,Z,a,s,c,g,m,v,I,C,E,N,O,M,L,_,H,G,J,V,z,q,Y,W,X,ee,te,ne,re,ie,oe,se,i,r,F,le,ce,async function(){console.log("Toggle changed, showOnlyMyEvents:",zw),n(99,Te=!1),await Pe(!0,null)},ue,de,fe,pe,function(){console.log("selectRecoveryKind called, recoverySelectedKind:",ne),null!=ne?(n(36,re=""),n(37,ie=[]),ae=null,n(39,se=!0),de()):console.log("No kind selected, skipping load")},function(){console.log("handleCustomKindInput called, recoveryCustomKind:",re);const e=parseInt(re);""!==re&&!isNaN(e)&&e>=0&&(n(35,ne=null),n(37,ie=[]),ae=null,n(39,se=!0),de())},function(e){const t=ie.filter(t=>t.kind===e.kind&&t.pubkey===e.pubkey),n=Math.max(...t.map(e=>e.created_at));return e.created_at===n},async function(){if(u&&"owner"===h)try{n(22,L=!0);const e=await fetch("/api/sprocket/status",{method:"GET",headers:{Authorization:`Nostr ${await Oe("GET","/api/sprocket/status")}`,"Content-Type":"application/json"}});if(e.ok){const t=await e.json();n(19,N=t.script_content||""),n(20,O=t),Ae("Script loaded successfully","success")}else Ae("Failed to load script","error")}catch(e){Ae(`Error loading script: ${e.message}`,"error")}finally{n(22,L=!1)}},async function(){if(u&&"owner"===h)try{n(22,L=!0);const e=await fetch("/api/sprocket/update",{method:"POST",headers:{Authorization:`Nostr ${await Oe("POST","/api/sprocket/update")}`,"Content-Type":"text/plain"},body:N});if(e.ok)Ae("Script saved and updated successfully","success"),await me(),await ye();else{Ae(`Failed to save script: ${await e.text()}`,"error")}}catch(e){Ae(`Error saving script: ${e.message}`,"error")}finally{n(22,L=!1)}},async function(){if(u&&"owner"===h)try{n(22,L=!0);const e=await fetch("/api/sprocket/restart",{method:"POST",headers:{Authorization:`Nostr ${await Oe("POST","/api/sprocket/restart")}`,"Content-Type":"application/json"}});if(e.ok)Ae("Sprocket restarted successfully","success"),await me();else{Ae(`Failed to restart sprocket: ${await e.text()}`,"error")}}catch(e){Ae(`Error restarting sprocket: ${e.message}`,"error")}finally{n(22,L=!1)}},async function(){if(u&&"owner"===h&&confirm("Are you sure you want to delete the sprocket script? This will stop the current process."))try{n(22,L=!0);const e=await fetch("/api/sprocket/update",{method:"POST",headers:{Authorization:`Nostr ${await Oe("POST","/api/sprocket/update")}`,"Content-Type":"text/plain"},body:""});if(e.ok)n(19,N=""),Ae("Sprocket script deleted successfully","success"),await me(),await ye();else{Ae(`Failed to delete script: ${await e.text()}`,"error")}}catch(e){Ae(`Error deleting script: ${e.message}`,"error")}finally{n(22,L=!1)}},ye,ve,we,async function(){if(u&&("owner"===h||qw))try{n(27,V=!0),n(30,Y=[]);const e={kinds:[12345],limit:1},t=await Fp(e);if(t&&t.length>0){n(26,J=t[0].content);try{n(26,J=JSON.stringify(JSON.parse(J),null,2))}catch(e){}be("Policy loaded successfully","success")}else{const e=await fetch("/api/policy",{method:"GET",headers:{Authorization:`Nostr ${await Oe("GET","/api/policy")}`,"Content-Type":"application/json"}});if(e.ok){const t=await e.json();n(26,J=JSON.stringify(t,null,2)),be("Policy loaded from file","success")}else be("No policy configuration found","info"),n(26,J="")}}catch(e){be(`Error loading policy: ${e.message}`,"error")}finally{n(27,V=!1)}},ke,async function(){if(!u||"owner"!==h&&!qw)return;if(await ke())try{n(27,V=!0);const e={kind:12345,created_at:Math.floor(Date.now()/1e3),tags:[],content:J},t=await Yv(e,g);t.success?be("Policy updated successfully","success"):be(`Failed to publish policy: ${t.error||"Unknown error"}`,"error")}catch(e){be(`Error saving policy: ${e.message}`,"error")}finally{n(27,V=!1)}},function(){try{const e=JSON.parse(J);n(26,J=JSON.stringify(e,null,2)),be("JSON formatted","success")}catch(e){be(`Cannot format: ${e.message}`,"error")}},function(e){const t=e.detail;if(!t)return void be("Please enter a pubkey","error");const r=function(e){if(!e)return null;if(/^[0-9a-fA-F]{64}$/.test(e))return e.toLowerCase();if(e.startsWith("npub1"))try{const t="qpzry9x8gf2tvdw0s3jn54khce6mua7l",n=e.slice(5);let r=[];for(const e of n){const n=t.indexOf(e.toLowerCase());if(-1===n)throw new Error("Invalid character in npub");r.push(...[...Array(5)].map((e,t)=>n>>4-t&1))}r=r.slice(0,-30);const i=[];for(let e=0;e+8<=r.length;e+=8){let t=0;for(let n=0;n<8;n++)t=t<<1|r[e+n];i.push(t)}return i.map(e=>e.toString(16).padStart(2,"0")).join("")}catch(e){return console.error("Failed to decode npub:",e),null}return null}(t);if(r&&64===r.length)try{const e=JSON.parse(J||"{}");if(e.policy_admins||(e.policy_admins=[]),e.policy_admins.includes(r))return void be("Admin already in list","warning");e.policy_admins.push(r),n(26,J=JSON.stringify(e,null,2)),be("Admin added - click 'Save & Publish' to apply","info")}catch(e){be(`Error adding admin: ${e.message}`,"error")}else be("Invalid pubkey format. Use hex (64 chars) or npub","error")},function(e){const t=e.detail;try{const e=JSON.parse(J||"{}");e.policy_admins&&(e.policy_admins=e.policy_admins.filter(e=>e!==t),n(26,J=JSON.stringify(e,null,2)),be("Admin removed - click 'Save & Publish' to apply","info"))}catch(e){be(`Error removing admin: ${e.message}`,"error")}},async function(){if(u&&("owner"===h||qw))try{n(27,V=!0),n(31,W=[]);let e=[];try{e=JSON.parse(J||"{}").policy_admins||[]}catch(e){return void be("Cannot parse policy JSON to get admins","error")}if(0===e.length)return void be("No policy admins configured","warning");const t={kinds:[3],authors:e,limit:e.length},r=await Fp(t),i=new Set;for(const e of r)if(e.tags)for(const t of e.tags)"p"===t[0]&&t[1]&&64===t[1].length&&i.add(t[1]);n(31,W=Array.from(i)),be(`Loaded ${W.length} follows from ${r.length} admin(s)`,"success")}catch(e){be(`Error loading follows: ${e.message}`,"error")}finally{n(27,V=!1)}},function(e){n(25,G=e.target.files[0])},async function(){if(u&&"owner"===h&&G)try{n(22,L=!0);const e=await G.text(),t=await fetch("/api/sprocket/update",{method:"POST",headers:{Authorization:`Nostr ${await Oe("POST","/api/sprocket/update")}`,"Content-Type":"text/plain"},body:e});if(t.ok)n(19,N=e),Ae("Script uploaded and updated successfully","success"),await me(),await ye();else{Ae(`Failed to upload script: ${await t.text()}`,"error")}}catch(e){Ae(`Error uploading script: ${e.message}`,"error")}finally{n(22,L=!1),n(25,G=null);const e=document.getElementById("sprocket-upload-file");e&&(e.value="")}},Ce,function(){u||n(12,c=!0)},async function(e){const{method:t,pubkey:r,privateKey:i,signer:o}=e.detail;n(1,u=!0),n(2,d=r),f=t,n(13,g=o),n(12,c=!1);try{if(await Qp(),"extension"===t&&o)gp.setSigner(o);else if("nsec"===t&&i){const e=new kf(i);gp.setSigner(e)}n(3,p=await Cp(r)),console.log("Profile loaded:",p)}catch(e){console.error("Failed to load profile:",e)}await De(),await $e()},function(){n(1,u=!1),n(2,d=""),f="",n(3,p=null),n(4,h=""),n(13,g=null),n(14,m=!1),P=[],n(96,k=[]),D=[],$=0,he(),"undefined"!=typeof localStorage&&(localStorage.removeItem("nostr_auth_method"),localStorage.removeItem("nostr_pubkey"),localStorage.removeItem("nostr_privkey"))},function(){n(12,c=!1)},function(){n(14,m=!0)},Ee,function(){n(15,v=!v)},function(e){const{searchText:t,selectedKinds:n,pubkeys:r,eventIds:i,tags:o,sinceTimestamp:s,untilTimestamp:a,limit:l}=e.detail,c=function({searchText:e=null,kinds:t=[],authors:n=[],ids:r=[],tags:i=[],since:o=null,until:s=null,limit:a=null}){const l={};return e&&e.trim()&&(l.search=e.trim()),t&&t.length>0&&(l.kinds=t),n&&n.length>0&&(l.authors=n),r&&r.length>0&&(l.ids=r),i&&i.length>0&&i.forEach(e=>{if(e.name&&e.value){const t=`#${e.name}`;l[t]||(l[t]=[]),l[t].push(e.value)}}),o&&(l.since=o),s&&(l.until=s),a&&a>0&&(l.limit=a),l}({searchText:t,kinds:n,authors:r,ids:i,tags:o,since:s,until:a,limit:l||100});w=c,Pe(!0,null)},function(){w={},Pe(!0,null)},xe,Be,Se,Qe,Fe,async function(){await Ue([])},async function(){await Ue([d])},function(e){n(16,I=e.detail.target.files[0])},async function(){if("none"!==Z&&(!u||"admin"!==h&&"owner"!==h))return n(17,C="Admin or owner permission required"),void setTimeout(()=>{n(17,C="")},5e3);if(!I)return n(17,C="Please select a file"),void setTimeout(()=>{n(17,C="")},5e3);try{n(17,C="Uploading...");const e={};"none"!==Z&&u&&(e.Authorization=await Ne("/api/import","POST"));const t=new FormData;t.append("file",I);const r=await fetch("/api/import",{method:"POST",headers:e,body:t});if(!r.ok)throw new Error(`Import failed: ${r.status} ${r.statusText}`);await r.json();n(17,C="Upload complete"),n(16,I=null),document.getElementById("import-file").value="",setTimeout(()=>{n(17,C="")},5e3)}catch(e){console.error("Import failed:",e),n(17,C="Import failed: "+e.message),setTimeout(()=>{n(17,C="")},5e3)}},Pe,function(e){const{scrollTop:t,scrollHeight:n,clientHeight:r}=e.target;n-t-r<100&&Re()},function(){try{if(!ee.trim())return void alert("Please enter some JSON to reformat");const e=JSON.parse(ee);n(33,ee=JSON.stringify(e,null,2))}catch(e){alert("Invalid JSON: "+e.message)}},async function(){try{if(!ee.trim())return void alert("Please enter an event to sign");if(!u||!d)return void alert("Please log in to sign events");if(!g)return void alert("No signer available. Please log in with a valid authentication method.");const e=JSON.parse(ee);e.pubkey=d,e.created_at=Math.floor(Date.now()/1e3),delete e.id,delete e.sig;const t=await g.signEvent(e);n(33,ee=JSON.stringify(t,null,2)),alert("Event signed successfully!")}catch(e){console.error("Error signing event:",e),alert("Error signing event: "+e.message)}},async function(){n(34,te="");try{if(!ee.trim())return void n(34,te="Please enter an event to publish");if(!u)return void n(34,te="Please log in to publish events");if(!g)return void n(34,te="No signer available. Please log in with a valid authentication method.");let e;try{e=JSON.parse(ee)}catch(e){return void n(34,te=`Invalid JSON: ${e.message}`)}if(!e.id||!e.sig)return void n(34,te='Event must be signed before publishing. Please click "Sign" first.');if("read"===h)return void n(34,te=`Permission denied: Your current role is "${h}" which does not allow publishing events. Contact a relay administrator to upgrade your permissions.`);const t=`${window.location.protocol.startsWith("https")?"wss:":"ws:"}//${window.location.host}/`,r=await Yv(t,e,g,d);if(r.success)n(34,te=""),alert("Event published successfully to ORLY relay!");else{const t=r.reason||"Unknown error";n(34,te=Me(t,e.kind))}}catch(e){console.error("Error publishing event:",e);const t=e.message||"Unknown error";n(34,te=Me(t,null))}},function(){n(34,te="")},Le,function(){const e=["owner","admin","write","read"],t=e.indexOf(h);return-1===t?["read"]:e.slice(t)},k,Q,j,Te,o,function(t){U.call(this,e,t)},function(t){U.call(this,e,t)},e=>e.id===y,e=>Ce(e.detail),e=>Be(e.detail),e=>le(e.detail),e=>ue(e.detail),e=>ce(e.detail.event,e.detail.e),e=>Pe(e.detail.refresh,e.detail.authors),function(e){ee=e,n(33,ee)},function(e){N=e,n(19,N)},e=>ve(e.detail),e=>we(e.detail),function(e){J=e,n(26,J)},function(){ne=function(e){const t=e.querySelector(":checked");return t&&t.__value}(this),n(35,ne)},function(){re=b(this.value),n(36,re)},e=>pe(e),e=>fe(e),(e,t)=>ce(e,t),e=>Se(e.id,!0),e=>xe(e.id),e=>ue(e.id),e=>le(e.id),(e,t)=>"Enter"===t.key&&le(e.id),(e,t)=>ce(e,t),(e,t)=>Qe(t,e.id),e=>Le(e===h?"":e),e=>"Escape"===e.key&&Ee(),function(e){c=e,n(12,c)}]}return new class extends ie{constructor(e){super(),re(this,e,Yw,Vw,o,{},null,[-1,-1,-1,-1,-1,-1])}}({target:document.body,props:{name:"world"}})}(); + */function $p(e,t,n,r){return new(n||(n=Promise))(function(i,o){function s(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}l((r=r.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;class Up{constructor(){this.mutex=Promise.resolve()}lock(){let e=()=>{};return this.mutex=this.mutex.then(()=>new Promise(e)),new Promise(t=>{e=t})}dispatch(e){return $p(this,void 0,void 0,function*(){const t=yield this.lock();try{return yield Promise.resolve(e())}finally{t()}})}}var Pp;const Rp="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Tp=null!==(Pp=Rp.Buffer)&&void 0!==Pp?Pp:null,Np=Rp.TextEncoder?new Rp.TextEncoder:null;function Op(e,t){return(15&e)+(e>>6|e>>3&8)<<4|(15&t)+(t>>6|t>>3&8)}function Mp(e,t){const n=t.length>>1;for(let r=0;r>>4;e[r++]=n>9?n+Lp:n+_p,n=15&t[i],e[r++]=n>9?n+Lp:n+_p}return String.fromCharCode.apply(null,e)}const jp=null!==Tp?e=>{if("string"==typeof e){const t=Tp.from(e,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.length)}if(Tp.isBuffer(e))return new Uint8Array(e.buffer,e.byteOffset,e.length);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")}:e=>{if("string"==typeof e)return Np.encode(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Invalid data type!")},Gp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Jp=new Uint8Array(256);for(let e=0;e<64;e++)Jp[Gp.charCodeAt(e)]=e;function Kp(e,t=!0){const n=e.length,r=n%3,i=[],o=n-r;for(let t=0;t>18&63)+Gp.charAt(n>>12&63)+Gp.charAt(n>>6&63)+Gp.charAt(63&n);i.push(r)}if(1===r){const r=e[n-1],o=Gp.charAt(r>>2),s=Gp.charAt(r<<4&63);i.push(`${o}${s}`),t&&i.push("==")}else if(2===r){const r=(e[n-2]<<8)+e[n-1],o=Gp.charAt(r>>10),s=Gp.charAt(r>>4&63),a=Gp.charAt(r<<2&63);i.push(`${o}${s}${a}`),t&&i.push("=")}return i.join("")}function Vp(e){const t=function(e){let t=Math.floor(.75*e.length);const n=e.length;return"="===e[n-1]&&(t-=1,"="===e[n-2]&&(t-=1)),t}(e),n=e.length,r=new Uint8Array(t);let i=0;for(let t=0;t>4,i+=1,r[i]=(15&o)<<4|s>>2,i+=1,r[i]=(3&s)<<6|63&a,i+=1}return r}const zp=16384,qp=new Up,Yp=new Map;function Wp(e,t){return $p(this,void 0,void 0,function*(){let n=null,r=null,i=!1;if("undefined"==typeof WebAssembly)throw new Error("WebAssembly is not supported in this environment!");const o=()=>new DataView(n.exports.memory.buffer).getUint32(n.exports.STATE_SIZE,!0),s=qp.dispatch(()=>$p(this,void 0,void 0,function*(){if(!Yp.has(e.name)){const t=Vp(e.data),n=WebAssembly.compile(t);Yp.set(e.name,n)}const t=yield Yp.get(e.name);n=yield WebAssembly.instantiate(t,{})})),a=(e=null)=>{i=!0,n.exports.Hash_Init(e)},l=e=>{if(!i)throw new Error("update() called before init()");(e=>{let t=0;for(;t{if(!i)throw new Error("digest() called before init()");return i=!1,n.exports.Hash_Final(o),"binary"===e?r.slice(0,t):Hp(c,r,t)},d=e=>"string"==typeof e?e.length<4096:e.byteLength!0;break;case"blake2b":case"blake2s":f=(e,t)=>t<=512&&d(e);break;case"blake3":f=(e,t)=>0===t&&d(e);break;case"xxhash64":case"xxhash3":case"xxhash128":case"crc64":f=()=>!1}return yield(()=>$p(this,void 0,void 0,function*(){n||(yield s);const e=n.exports.Hash_GetBuffer(),t=n.exports.memory.buffer;r=new Uint8Array(t,e,zp)}))(),{getMemory:()=>r,writeMemory:(e,t=0)=>{r.set(e,t)},getExports:()=>n.exports,setMemorySize:e=>{n.exports.Hash_SetMemorySize(e);const t=n.exports.Hash_GetBuffer(),i=n.exports.memory.buffer;r=new Uint8Array(i,t,e)},init:a,update:l,digest:u,save:()=>{if(!i)throw new Error("save() can only be called after init() and before digest()");const t=n.exports.Hash_GetState(),r=o(),s=n.exports.memory.buffer,a=new Uint8Array(s,t,r),l=new Uint8Array(4+r);return Mp(l,e.hash),l.set(a,4),l},load:t=>{if(!(t instanceof Uint8Array))throw new Error("load() expects an Uint8Array generated by save()");const r=n.exports.Hash_GetState(),s=o(),a=4+s,l=n.exports.memory.buffer;if(t.length!==a)throw new Error(`Bad state length (expected ${a} bytes, got ${t.length})`);if(!function(e,t){if(e.length!==2*t.length)return!1;for(let n=0;n{if(!f(e,i))return a(i),l(e),u("hex",o);const s=jp(e);return r.set(s),n.exports.Hash_Calculate(s.length,i,o),Hp(c,r,t)},hashLength:t}})}new Up;var Zp={name:"argon2",data:"AGFzbQEAAAABKQVgAX8Bf2AAAX9gEH9/f39/f39/f39/f39/f38AYAR/f39/AGACf38AAwYFAAECAwQFBgEBAoCAAgYIAX8BQZCoBAsHQQQGbWVtb3J5AgASSGFzaF9TZXRNZW1vcnlTaXplAAAOSGFzaF9HZXRCdWZmZXIAAQ5IYXNoX0NhbGN1bGF0ZQAECvEyBVgBAn9BACEBAkAgAEEAKAKICCICRg0AAkAgACACayIAQRB2IABBgIB8cSAASWoiAEAAQX9HDQBB/wHADwtBACEBQQBBACkDiAggAEEQdK18NwOICAsgAcALcAECfwJAQQAoAoAIIgANAEEAPwBBEHQiADYCgAhBACgCiAgiAUGAgCBGDQACQEGAgCAgAWsiAEEQdiAAQYCAfHEgAElqIgBAAEF/Rw0AQQAPC0EAQQApA4gIIABBEHStfDcDiAhBACgCgAghAAsgAAvcDgECfiAAIAQpAwAiECAAKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAMIBAgDCkDAIVCIIkiEDcDACAIIBAgCCkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgBCAQIAQpAwCFQiiJIhA3AwAgACAQIAApAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAwgECAMKQMAhUIwiSIQNwMAIAggECAIKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAEIBAgBCkDAIVCAYk3AwAgASAFKQMAIhAgASkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDSAQIA0pAwCFQiCJIhA3AwAgCSAQIAkpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAUgECAFKQMAhUIoiSIQNwMAIAEgECABKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACANIBAgDSkDAIVCMIkiEDcDACAJIBAgCSkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBSAQIAUpAwCFQgGJNwMAIAIgBikDACIQIAIpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIA4gECAOKQMAhUIgiSIQNwMAIAogECAKKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAGIBAgBikDAIVCKIkiEDcDACACIBAgAikDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgDiAQIA4pAwCFQjCJIhA3AwAgCiAQIAopAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAYgECAGKQMAhUIBiTcDACADIAcpAwAiECADKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAPIBAgDykDAIVCIIkiEDcDACALIBAgCykDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgByAQIAcpAwCFQiiJIhA3AwAgAyAQIAMpAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIA8gECAPKQMAhUIwiSIQNwMAIAsgECALKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAHIBAgBykDAIVCAYk3AwAgACAFKQMAIhAgACkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDyAQIA8pAwCFQiCJIhA3AwAgCiAQIAopAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAUgECAFKQMAhUIoiSIQNwMAIAAgECAAKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAPIBAgDykDAIVCMIkiEDcDACAKIBAgCikDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBSAQIAUpAwCFQgGJNwMAIAEgBikDACIQIAEpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAwgECAMKQMAhUIgiSIQNwMAIAsgECALKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACAGIBAgBikDAIVCKIkiEDcDACABIBAgASkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgDCAQIAwpAwCFQjCJIhA3AwAgCyAQIAspAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIAYgECAGKQMAhUIBiTcDACACIAcpAwAiECACKQMAIhF8IBFCAYZC/v///x+DIBBC/////w+DfnwiEDcDACANIBAgDSkDAIVCIIkiEDcDACAIIBAgCCkDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgByAQIAcpAwCFQiiJIhA3AwAgAiAQIAIpAwAiEXwgEEL/////D4MgEUIBhkL+////H4N+fCIQNwMAIA0gECANKQMAhUIwiSIQNwMAIAggECAIKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAHIBAgBykDAIVCAYk3AwAgAyAEKQMAIhAgAykDACIRfCARQgGGQv7///8fgyAQQv////8Pg358IhA3AwAgDiAQIA4pAwCFQiCJIhA3AwAgCSAQIAkpAwAiEXwgEUIBhkL+////H4MgEEL/////D4N+fCIQNwMAIAQgECAEKQMAhUIoiSIQNwMAIAMgECADKQMAIhF8IBBC/////w+DIBFCAYZC/v///x+DfnwiEDcDACAOIBAgDikDAIVCMIkiEDcDACAJIBAgCSkDACIRfCAQQv////8PgyARQgGGQv7///8fg358IhA3AwAgBCAQIAQpAwCFQgGJNwMAC98aAQN/QQAhBEEAIAIpAwAgASkDAIU3A5AIQQAgAikDCCABKQMIhTcDmAhBACACKQMQIAEpAxCFNwOgCEEAIAIpAxggASkDGIU3A6gIQQAgAikDICABKQMghTcDsAhBACACKQMoIAEpAyiFNwO4CEEAIAIpAzAgASkDMIU3A8AIQQAgAikDOCABKQM4hTcDyAhBACACKQNAIAEpA0CFNwPQCEEAIAIpA0ggASkDSIU3A9gIQQAgAikDUCABKQNQhTcD4AhBACACKQNYIAEpA1iFNwPoCEEAIAIpA2AgASkDYIU3A/AIQQAgAikDaCABKQNohTcD+AhBACACKQNwIAEpA3CFNwOACUEAIAIpA3ggASkDeIU3A4gJQQAgAikDgAEgASkDgAGFNwOQCUEAIAIpA4gBIAEpA4gBhTcDmAlBACACKQOQASABKQOQAYU3A6AJQQAgAikDmAEgASkDmAGFNwOoCUEAIAIpA6ABIAEpA6ABhTcDsAlBACACKQOoASABKQOoAYU3A7gJQQAgAikDsAEgASkDsAGFNwPACUEAIAIpA7gBIAEpA7gBhTcDyAlBACACKQPAASABKQPAAYU3A9AJQQAgAikDyAEgASkD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",hash:"e4cdc523"},Xp={name:"blake2b",data:"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",hash:"c6f286e6"};function eh(e){return!Number.isInteger(e)||e<8||e>512||e%8!=0?new Error("Invalid variant! Valid values: 8, 16, ..., 512"):null}function th(e=512,t=null){if(eh(e))return Promise.reject(eh(e));let n=null,r=e;if(null!==t){if(n=jp(t),n.length>64)return Promise.reject(new Error("Max key length is 64 bytes"));i=e,o=n.length,r=i|o<<16}var i,o;const s=e/8;return Wp(Xp,s).then(e=>{r>512&&e.writeMemory(n),e.init(r);const t={init:r>512?()=>(e.writeMemory(n),e.init(r),t):()=>(e.init(r),t),update:n=>(e.update(n),t),digest:t=>e.digest(t),save:()=>e.save(),load:n=>(e.load(n),t),blockSize:128,digestSize:s};return t})}new Up;const nh=new DataView(new ArrayBuffer(4));function rh(e){return nh.setInt32(0,e,!0),new Uint8Array(nh.buffer)}function ih(e,t,n){return $p(this,void 0,void 0,function*(){if(n<=64){const e=yield th(8*n);return e.update(rh(n)),e.update(t),e.digest("binary")}const r=Math.ceil(n/32)-2,i=new Uint8Array(n);e.init(),e.update(rh(n)),e.update(t);let o=e.digest("binary");i.set(o.subarray(0,32),0);for(let t=1;t{var t;if(!e||"object"!=typeof e)throw new Error("Invalid options parameter. It requires an object.");if(!e.password)throw new Error("Password must be specified");if(e.password=jp(e.password),e.password.length<1)throw new Error("Password must be specified");if(!e.salt)throw new Error("Salt must be specified");if(e.salt=jp(e.salt),e.salt.length<8)throw new Error("Salt should be at least 8 bytes long");if(e.secret=jp(null!==(t=e.secret)&&void 0!==t?t:""),!Number.isInteger(e.iterations)||e.iterations<1)throw new Error("Iterations should be a positive number");if(!Number.isInteger(e.parallelism)||e.parallelism<1)throw new Error("Parallelism should be a positive number");if(!Number.isInteger(e.hashLength)||e.hashLength<4)throw new Error("Hash length should be at least 4 bytes.");if(!Number.isInteger(e.memorySize))throw new Error("Memory size should be specified.");if(e.memorySize<8*e.parallelism)throw new Error("Memory size should be at least 8 * parallelism.");if(void 0===e.outputType&&(e.outputType="hex"),!["hex","binary","encoded"].includes(e.outputType))throw new Error(`Insupported output type ${e.outputType}. Valid values: ['hex', 'binary', 'encoded']`)})(e),oh(Object.assign(Object.assign({},e),{hashType:"id"}))})}new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up,new Up;const ah={parallelism:4,iterations:8,memorySize:262144,hashLength:32,outputType:"binary"};let lh=null,ch=0;const uh=new Map;async function dh(e,t){try{const n=function(){if(lh)return lh;const e=new Blob(["\n importScripts('https://cdn.jsdelivr.net/npm/hash-wasm@4.11.0/dist/argon2.umd.min.js');\n\n const ARGON2_CONFIG = {\n parallelism: 4,\n iterations: 8,\n memorySize: 262144,\n hashLength: 32,\n outputType: \"binary\"\n };\n\n self.onmessage = async function(e) {\n const { password, salt, id } = e.data;\n\n try {\n const result = await hashwasm.argon2id({\n password: password,\n salt: new Uint8Array(salt),\n ...ARGON2_CONFIG\n });\n\n self.postMessage({\n id,\n success: true,\n result: Array.from(result)\n });\n } catch (error) {\n self.postMessage({\n id,\n success: false,\n error: error.message\n });\n }\n };\n "],{type:"application/javascript"});return lh=new Worker(URL.createObjectURL(e)),lh.onmessage=function(e){const{id:t,success:n,result:r,error:i}=e.data,o=uh.get(t);o&&(uh.delete(t),n?o.resolve(new Uint8Array(r)):o.reject(new Error(i)))},lh.onerror=function(e){console.error("Argon2 worker error:",e)},lh}(),r=++ch;return new Promise((i,o)=>{uh.set(r,{resolve:i,reject:o}),n.postMessage({id:r,password:e,salt:Array.from(t)})})}catch(n){console.warn("Worker failed, falling back to main thread:",n);return await sh({password:e,salt:t,...ah})}}const{window:fh}=l;function ph(e){let t,n,i,o,s,a,l,f,h,g,y,b,k,I,C,E,B,S;function Q(e,t){return"extension"===e[2]?gh:hh}let F=Q(e),D=F(e),$=e[10]&&Bh(e),U=e[11]&&Sh(e);return{c(){t=p("div"),n=p("div"),i=p("div"),o=p("h2"),o.textContent="Login to Nostr",s=m(),a=p("button"),a.textContent="×",l=m(),f=p("div"),h=p("div"),g=p("button"),g.textContent="Extension",y=m(),b=p("button"),b.textContent="Nsec",k=m(),I=p("div"),D.c(),C=m(),$&&$.c(),E=m(),U&&U.c(),A(o,"class","svelte-4xpfbi"),A(a,"class","close-btn svelte-4xpfbi"),A(i,"class","modal-header svelte-4xpfbi"),A(g,"class","tab-btn svelte-4xpfbi"),x(g,"active","extension"===e[2]),A(b,"class","tab-btn svelte-4xpfbi"),x(b,"active","nsec"===e[2]),A(h,"class","tabs svelte-4xpfbi"),A(I,"class","tab-content svelte-4xpfbi"),A(f,"class","tab-container svelte-4xpfbi"),A(n,"class","modal svelte-4xpfbi"),x(n,"dark-theme",e[1]),A(t,"class","modal-overlay svelte-4xpfbi"),A(t,"role","button"),A(t,"tabindex","0")},m(r,d){u(r,t,d),c(t,n),c(n,i),c(i,o),c(i,s),c(i,a),c(n,l),c(n,f),c(f,h),c(h,g),c(h,y),c(h,b),c(f,k),c(f,I),D.m(I,null),c(I,C),$&&$.m(I,null),c(I,E),U&&U.m(I,null),B||(S=[v(a,"click",e[17]),v(g,"click",e[26]),v(b,"click",e[27]),v(n,"click",w(e[24])),v(n,"keydown",w(e[25])),v(t,"click",e[17]),v(t,"keydown",e[32])],B=!0)},p(e,t){4&t[0]&&x(g,"active","extension"===e[2]),4&t[0]&&x(b,"active","nsec"===e[2]),F===(F=Q(e))&&D?D.p(e,t):(D.d(1),D=F(e),D&&(D.c(),D.m(I,C))),e[10]?$?$.p(e,t):($=Bh(e),$.c(),$.m(I,E)):$&&($.d(1),$=null),e[11]?U?U.p(e,t):(U=Sh(e),U.c(),U.m(I,null)):U&&(U.d(1),U=null),2&t[0]&&x(n,"dark-theme",e[1])},d(e){e&&d(t),D.d(),$&&$.d(),U&&U.d(),B=!1,r(S)}}}function hh(e){let t;function n(e,t){return e[14]?yh:mh}let r=n(e),i=r(e);return{c(){t=p("div"),i.c(),A(t,"class","nsec-login svelte-4xpfbi")},m(e,n){u(e,t,n),i.m(t,null)},p(e,o){r===(r=n(e))&&i?i.p(e,o):(i.d(1),i=r(e),i&&(i.c(),i.m(t,null)))},d(e){e&&d(t),i.d()}}}function gh(e){let t,n,r,i,o,s,a,l=e[7]?"Connecting...":"Log in using extension";return{c(){t=p("div"),n=p("p"),n.textContent="Login using a NIP-07 compatible browser\n extension like nos2x or Alby.",r=m(),i=p("button"),o=g(l),A(n,"class","svelte-4xpfbi"),A(i,"class","login-extension-btn svelte-4xpfbi"),i.disabled=e[7],A(t,"class","extension-login svelte-4xpfbi")},m(l,d){u(l,t,d),c(t,n),c(t,r),c(t,i),c(i,o),s||(a=v(i,"click",e[21]),s=!0)},p(e,t){128&t[0]&&l!==(l=e[7]?"Connecting...":"Log in using extension")&&k(o,l),128&t[0]&&(i.disabled=e[7])},d(e){e&&d(t),s=!1,a()}}}function mh(e){let t,n,i,o,s,a,l,f,h,y,w,b,C,E,x,B,S,Q,F,D,$,U,P,R=e[8]?"Generating...":"Generate New Key",T=e[12]&&vh(e),N=e[4]&&wh(e);function O(e,t){return e[9]?kh:e[7]?bh:Ah}let M=O(e),L=M(e);return{c(){t=p("p"),t.textContent="Enter your nsec or generate a new one. Optionally\n set a password to encrypt it securely.",n=m(),i=p("button"),o=g(R),a=m(),T&&T.c(),l=m(),f=p("input"),y=m(),w=p("div"),b=p("label"),b.textContent="Encryption Password (optional but recommended):",C=m(),E=p("input"),B=m(),N&&N.c(),S=m(),Q=p("small"),Q.textContent="Password uses Argon2id with ~3 second derivation time for security.",F=m(),D=p("button"),L.c(),A(t,"class","svelte-4xpfbi"),A(i,"class","generate-btn svelte-4xpfbi"),i.disabled=s=e[7]||e[8],A(f,"type","password"),A(f,"placeholder","nsec1..."),f.disabled=h=e[7]||e[9],A(f,"class","nsec-input svelte-4xpfbi"),A(b,"class","svelte-4xpfbi"),A(E,"type","password"),A(E,"placeholder","Enter password (min 8 chars)"),E.disabled=x=e[7]||e[9],A(E,"class","password-input svelte-4xpfbi"),A(Q,"class","password-hint svelte-4xpfbi"),A(w,"class","password-section svelte-4xpfbi"),A(D,"class","login-nsec-btn svelte-4xpfbi"),D.disabled=$=e[7]||e[9]||!e[3].trim()},m(r,s){u(r,t,s),u(r,n,s),u(r,i,s),c(i,o),u(r,a,s),T&&T.m(r,s),u(r,l,s),u(r,f,s),I(f,e[3]),u(r,y,s),u(r,w,s),c(w,b),c(w,C),c(w,E),I(E,e[4]),c(w,B),N&&N.m(w,null),c(w,S),c(w,Q),u(r,F,s),u(r,D,s),L.m(D,null),U||(P=[v(i,"click",e[20]),v(f,"input",e[29]),v(E,"input",e[30]),v(D,"click",e[22])],U=!0)},p(e,t){256&t[0]&&R!==(R=e[8]?"Generating...":"Generate New Key")&&k(o,R),384&t[0]&&s!==(s=e[7]||e[8])&&(i.disabled=s),e[12]?T?T.p(e,t):(T=vh(e),T.c(),T.m(l.parentNode,l)):T&&(T.d(1),T=null),640&t[0]&&h!==(h=e[7]||e[9])&&(f.disabled=h),8&t[0]&&f.value!==e[3]&&I(f,e[3]),640&t[0]&&x!==(x=e[7]||e[9])&&(E.disabled=x),16&t[0]&&E.value!==e[4]&&I(E,e[4]),e[4]?N?N.p(e,t):(N=wh(e),N.c(),N.m(w,S)):N&&(N.d(1),N=null),M!==(M=O(e))&&(L.d(1),L=M(e),L&&(L.c(),L.m(D,null))),648&t[0]&&$!==($=e[7]||e[9]||!e[3].trim())&&(D.disabled=$)},d(e){e&&d(t),e&&d(n),e&&d(i),e&&d(a),T&&T.d(e),e&&d(l),e&&d(f),e&&d(y),e&&d(w),N&&N.d(),e&&d(F),e&&d(D),L.d(),U=!1,r(P)}}}function yh(e){let t,n,i,o,s,a,l,f,h,y,w,b,k,C,E=e[15]&&Ih(e);function x(e,t){return e[9]?xh:e[7]?Eh:Ch}let B=x(e),S=B(e);return{c(){t=p("p"),t.textContent="You have a stored encrypted key. Enter your\n password to unlock it.",n=m(),E&&E.c(),i=m(),o=p("input"),a=m(),l=p("button"),S.c(),h=m(),y=p("button"),w=g("Clear stored key & start fresh"),A(t,"class","svelte-4xpfbi"),A(o,"type","password"),A(o,"placeholder","Enter your password"),o.disabled=s=e[7]||e[9],A(o,"class","password-input svelte-4xpfbi"),A(l,"class","login-nsec-btn svelte-4xpfbi"),l.disabled=f=e[7]||e[9]||!e[6],A(y,"class","clear-btn svelte-4xpfbi"),y.disabled=b=e[7]||e[9]},m(r,s){u(r,t,s),u(r,n,s),E&&E.m(r,s),u(r,i,s),u(r,o,s),I(o,e[6]),u(r,a,s),u(r,l,s),S.m(l,null),u(r,h,s),u(r,y,s),c(y,w),k||(C=[v(o,"input",e[28]),v(l,"click",e[18]),v(y,"click",e[16])],k=!0)},p(e,t){e[15]?E?E.p(e,t):(E=Ih(e),E.c(),E.m(i.parentNode,i)):E&&(E.d(1),E=null),640&t[0]&&s!==(s=e[7]||e[9])&&(o.disabled=s),64&t[0]&&o.value!==e[6]&&I(o,e[6]),B!==(B=x(e))&&(S.d(1),S=B(e),S&&(S.c(),S.m(l,null))),704&t[0]&&f!==(f=e[7]||e[9]||!e[6])&&(l.disabled=f),640&t[0]&&b!==(b=e[7]||e[9])&&(y.disabled=b)},d(e){e&&d(t),e&&d(n),E&&E.d(e),e&&d(i),e&&d(o),e&&d(a),e&&d(l),S.d(),e&&d(h),e&&d(y),k=!1,r(C)}}}function vh(e){let t,n,r,i,o;return{c(){t=p("div"),n=p("label"),n.textContent="Your new public key (npub):",r=m(),i=p("code"),o=g(e[12]),A(n,"class","svelte-4xpfbi"),A(i,"class","npub-display svelte-4xpfbi"),A(t,"class","generated-info svelte-4xpfbi")},m(e,s){u(e,t,s),c(t,n),c(t,r),c(t,i),c(i,o)},p(e,t){4096&t[0]&&k(o,e[12])},d(e){e&&d(t)}}}function wh(e){let t,n,r,i;return{c(){t=p("input"),A(t,"type","password"),A(t,"placeholder","Confirm password"),t.disabled=n=e[7]||e[9],A(t,"class","password-input svelte-4xpfbi")},m(n,o){u(n,t,o),I(t,e[5]),r||(i=v(t,"input",e[31]),r=!0)},p(e,r){640&r[0]&&n!==(n=e[7]||e[9])&&(t.disabled=n),32&r[0]&&t.value!==e[5]&&I(t,e[5])},d(e){e&&d(t),r=!1,i()}}}function Ah(e){let t;return{c(){t=g("Log in with nsec")},m(e,n){u(e,t,n)},d(e){e&&d(t)}}}function bh(e){let t;return{c(){t=g("Logging in...")},m(e,n){u(e,t,n)},d(e){e&&d(t)}}}function kh(e){let t;return{c(){t=g("Deriving key...")},m(e,n){u(e,t,n)},d(e){e&&d(t)}}}function Ih(e){let t,n,r,i,o,s,a,l=e[15].slice(0,16)+"",f=e[15].slice(-8)+"";return{c(){t=p("div"),n=p("label"),n.textContent="Stored public key:",r=m(),i=p("code"),o=g(l),s=g("..."),a=g(f),A(n,"class","svelte-4xpfbi"),A(i,"class","npub-display svelte-4xpfbi"),A(t,"class","stored-info svelte-4xpfbi")},m(e,l){u(e,t,l),c(t,n),c(t,r),c(t,i),c(i,o),c(i,s),c(i,a)},p(e,t){32768&t[0]&&l!==(l=e[15].slice(0,16)+"")&&k(o,l),32768&t[0]&&f!==(f=e[15].slice(-8)+"")&&k(a,f)},d(e){e&&d(t)}}}function Ch(e){let t;return{c(){t=g("Unlock")},m(e,n){u(e,t,n)},d(e){e&&d(t)}}}function Eh(e){let t;return{c(){t=g("Unlocking...")},m(e,n){u(e,t,n)},d(e){e&&d(t)}}}function xh(e){let t;return{c(){t=g("Deriving key...")},m(e,n){u(e,t,n)},d(e){e&&d(t)}}}function Bh(e){let t,n;return{c(){t=p("div"),n=g(e[10]),A(t,"class","message error-message svelte-4xpfbi")},m(e,r){u(e,t,r),c(t,n)},p(e,t){1024&t[0]&&k(n,e[10])},d(e){e&&d(t)}}}function Sh(e){let t,n;return{c(){t=p("div"),n=g(e[11]),A(t,"class","message success-message svelte-4xpfbi")},m(e,r){u(e,t,r),c(t,n)},p(e,t){2048&t[0]&&k(n,e[11])},d(e){e&&d(t)}}}function Qh(e){let t,n,r,i,o,s,a,l,f,h,y,v=e[13].toFixed(1)+"";return{c(){t=p("div"),n=p("div"),r=p("div"),i=m(),o=p("h3"),o.textContent="Deriving encryption key",s=m(),a=p("div"),l=g(v),f=g("s"),h=m(),y=p("p"),y.textContent="This may take 3-6 seconds for security",A(r,"class","deriving-spinner svelte-4xpfbi"),A(o,"class","svelte-4xpfbi"),A(a,"class","deriving-timer svelte-4xpfbi"),A(y,"class","deriving-note svelte-4xpfbi"),A(n,"class","deriving-modal svelte-4xpfbi"),x(n,"dark-theme",e[1]),A(t,"class","deriving-overlay svelte-4xpfbi")},m(e,d){u(e,t,d),c(t,n),c(n,r),c(n,i),c(n,o),c(n,s),c(n,a),c(a,l),c(a,f),c(n,h),c(n,y)},p(e,t){8192&t[0]&&v!==(v=e[13].toFixed(1)+"")&&k(l,v),2&t[0]&&x(n,"dark-theme",e[1])},d(e){e&&d(t)}}}function Fh(t){let n,r,i,o,s=t[0]&&ph(t),a=t[9]&&Qh(t);return{c(){s&&s.c(),n=m(),a&&a.c(),r=y()},m(e,l){s&&s.m(e,l),u(e,n,l),a&&a.m(e,l),u(e,r,l),i||(o=v(fh,"keydown",t[23]),i=!0)},p(e,t){e[0]?s?s.p(e,t):(s=ph(e),s.c(),s.m(n.parentNode,n)):s&&(s.d(1),s=null),e[9]?a?a.p(e,t):(a=Qh(e),a.c(),a.m(r.parentNode,r)):a&&(a.d(1),a=null)},i:e,o:e,d(e){s&&s.d(e),e&&d(n),a&&a.d(e),e&&d(r),i=!1,o()}}}function Dh(e,t,n){const r=$();let{showModal:i=!1}=t,{isDarkTheme:o=!1}=t,s="extension",a="",l="",c="",u="",d=!1,f=!1,p=!1,h="",g="",m="",y="",v=0,w=null,A=null;function b(){n(13,v=0),w=performance.now(),k()}function k(){null!==w&&(n(13,v=(performance.now()-w)/1e3),A=requestAnimationFrame(k))}function I(){w=null,A&&(cancelAnimationFrame(A),A=null)}D(()=>{I()});let C=!1,E="";function x(){n(14,C=!!localStorage.getItem("nostr_privkey_encrypted")),n(15,E=localStorage.getItem("nostr_pubkey")||"")}function B(){n(0,i=!1),n(3,a=""),n(4,l=""),n(5,c=""),n(6,u=""),n(10,h=""),n(11,g=""),m="",n(12,y=""),r("close")}function S(e){n(2,s=e),n(10,h=""),n(11,g=""),m="",n(12,y="")}async function Q(){n(7,d=!0),n(10,h=""),n(11,g="");try{if(!a.trim())throw new Error("Please enter your nsec");if(!function(e){if(!e||!e.startsWith("nsec1"))return!1;try{return"nsec"===mu(e).type}catch{return!1}}(a.trim()))throw new Error("Invalid nsec format or checksum");if(l){if(l.length<8)throw new Error("Password must be at least 8 characters");if(l!==c)throw new Error("Passwords do not match")}const e=kf.fromKey(a.trim()),t=await e.getPublicKey();if(localStorage.setItem("nostr_auth_method","nsec"),localStorage.setItem("nostr_pubkey",t),l){n(9,p=!0),b();const e=await async function(e,t){if(!e.startsWith("nsec1"))throw new Error("Invalid nsec format - must start with nsec1");try{if("nsec"!==mu(e).type)throw new Error("Invalid nsec - wrong type")}catch(e){throw new Error("Invalid nsec - bech32 checksum failed")}const n=crypto.getRandomValues(new Uint8Array(32)),r=crypto.getRandomValues(new Uint8Array(12)),i=await dh(t,n),o=await crypto.subtle.importKey("raw",i,{name:"AES-GCM"},!1,["encrypt"]),s=new TextEncoder,a=await crypto.subtle.encrypt({name:"AES-GCM",iv:r},o,s.encode(e)),l=new Uint8Array(n.length+r.length+a.byteLength);return l.set(n,0),l.set(r,n.length),l.set(new Uint8Array(a),n.length+r.length),btoa(String.fromCharCode(...l))}(a.trim(),l);I(),n(9,p=!1),localStorage.setItem("nostr_privkey_encrypted",e),localStorage.removeItem("nostr_privkey")}else localStorage.setItem("nostr_privkey",a.trim()),localStorage.removeItem("nostr_privkey_encrypted"),n(11,g="Successfully logged in with nsec!");r("login",{method:"nsec",pubkey:t,privateKey:a.trim(),signer:e}),setTimeout(()=>{B()},1500)}catch(e){n(10,h=e.message)}finally{n(7,d=!1)}}F(()=>{x()});return e.$$set=e=>{"showModal"in e&&n(0,i=e.showModal),"isDarkTheme"in e&&n(1,o=e.isDarkTheme)},e.$$.update=()=>{1&e.$$.dirty[0]&&i&&x()},[i,o,s,a,l,c,u,d,f,p,h,g,y,v,C,E,function(){localStorage.removeItem("nostr_privkey_encrypted"),localStorage.removeItem("nostr_privkey"),localStorage.removeItem("nostr_pubkey"),localStorage.removeItem("nostr_auth_method"),n(14,C=!1),n(15,E=""),n(6,u=""),n(10,h=""),n(11,g="")},B,async function(){n(7,d=!0),n(9,p=!0),b(),n(10,h=""),n(11,g="");try{if(!u)throw new Error("Please enter your password");const e=localStorage.getItem("nostr_privkey_encrypted");if(!e)throw new Error("No encrypted key found");const t=await async function(e,t){const n=new Uint8Array(atob(e).split("").map(e=>e.charCodeAt(0)));if(n.length<60)throw new Error("Invalid encrypted data - too short");const r=n.slice(0,32),i=n.slice(32,44),o=n.slice(44),s=await dh(t,r),a=await crypto.subtle.importKey("raw",s,{name:"AES-GCM"},!1,["decrypt"]);let l;try{l=await crypto.subtle.decrypt({name:"AES-GCM",iv:i},a,o)}catch(e){throw new Error("Decryption failed - invalid password or corrupted data")}const c=(new TextDecoder).decode(l);if(!c.startsWith("nsec1"))throw new Error("Decryption produced invalid data - not an nsec");try{if("nsec"!==mu(c).type)throw new Error("Decryption produced invalid nsec type")}catch(e){throw new Error("Decryption produced invalid nsec - bech32 checksum failed")}return c}(e,u);I(),n(9,p=!1);const i=kf.fromKey(t),o=await i.getPublicKey();r("login",{method:"nsec",pubkey:o,privateKey:t,signer:i}),B()}catch(e){I(),e.message.includes("decrypt")||e.message.includes("tag")?n(10,h="Invalid password"):n(10,h=e.message)}finally{n(7,d=!1),n(9,p=!1),I()}},S,async function(){n(8,f=!0),n(10,h=""),n(11,g="");try{const e=Wc(),t=wu("nsec",e),r=vu(Zc(e));m=t,n(12,y=r),n(3,a=t),n(11,g="New key generated! Set an encryption password below to secure it.")}catch(e){n(10,h="Failed to generate key: "+e.message)}finally{n(8,f=!1)}},async function(){n(7,d=!0),n(10,h=""),n(11,g="");try{if(!window.nostr)throw new Error("No Nostr extension found. Please install a NIP-07 compatible extension like nos2x or Alby.");const e=await window.nostr.getPublicKey();e&&(localStorage.setItem("nostr_auth_method","extension"),localStorage.setItem("nostr_pubkey",e),n(11,g="Successfully logged in with extension!"),r("login",{method:"extension",pubkey:e,signer:window.nostr}),setTimeout(()=>{B()},1500))}catch(e){n(10,h=e.message)}finally{n(7,d=!1)}},Q,function(e){"Escape"===e.key&&B(),"Enter"===e.key&&"nsec"===s&&Q()},function(t){U.call(this,e,t)},function(t){U.call(this,e,t)},()=>S("extension"),()=>S("nsec"),function(){u=this.value,n(6,u)},function(){a=this.value,n(3,a)},function(){l=this.value,n(4,l)},function(){c=this.value,n(5,c)},e=>"Escape"===e.key&&B()]}class $h extends ie{constructor(e){super(),re(this,e,Dh,Fh,o,{showModal:0,isDarkTheme:1},null,[-1,-1])}}function Uh(e,t,n){const r=e.slice();return r[72]=t[n],r}function Ph(e,t,n){const r=e.slice();return r[75]=t[n],r}function Rh(e,t,n){const r=e.slice();return r[72]=t[n],r}function Th(e,t,n){const r=e.slice();return r[72]=t[n],r}function Nh(e,t,n){const r=e.slice();return r[72]=t[n],r}function Oh(e,t,n){const r=e.slice();return r[72]=t[n],r}function Mh(e,t,n){const r=e.slice();return r[72]=t[n],r}function Lh(e){let t,n,r;return{c(){t=p("div"),n=g(e[3]),A(t,"class",r="message "+e[4]+" svelte-1y8wjwc")},m(e,r){u(e,t,r),c(t,n)},p(e,i){8&i[0]&&k(n,e[3]),16&i[0]&&r!==(r="message "+e[4]+" svelte-1y8wjwc")&&A(t,"class",r)},d(e){e&&d(t)}}}function _h(e){let t,n,i,o,s,a,l,f,h,y,w,b,k,C,E,x,B,S,Q,F,D,$,U,P,R,T,N,O;function M(e,t){return e[5]&&e[5].length>0?jh:Hh}let L=M(e),_=L(e);function H(e,t){return e[8]&&e[8].length>0?Vh:Kh}let j=H(e),G=j(e);return{c(){t=p("div"),n=p("div"),i=p("h3"),i.textContent="Banned Pubkeys",o=m(),s=p("div"),a=p("input"),l=m(),f=p("input"),h=m(),y=p("button"),w=g("Ban Pubkey"),b=m(),k=p("div"),_.c(),C=m(),E=p("div"),x=p("h3"),x.textContent="Allowed Pubkeys",B=m(),S=p("div"),Q=p("input"),F=m(),D=p("input"),$=m(),U=p("button"),P=g("Allow Pubkey"),R=m(),T=p("div"),G.c(),A(i,"class","svelte-1y8wjwc"),A(a,"type","text"),A(a,"placeholder","Pubkey (64 hex chars)"),A(a,"class","svelte-1y8wjwc"),A(f,"type","text"),A(f,"placeholder","Reason (optional)"),A(f,"class","svelte-1y8wjwc"),y.disabled=e[2],A(y,"class","svelte-1y8wjwc"),A(s,"class","add-form svelte-1y8wjwc"),A(k,"class","list svelte-1y8wjwc"),A(n,"class","section svelte-1y8wjwc"),A(x,"class","svelte-1y8wjwc"),A(Q,"type","text"),A(Q,"placeholder","Pubkey (64 hex chars)"),A(Q,"class","svelte-1y8wjwc"),A(D,"type","text"),A(D,"placeholder","Reason (optional)"),A(D,"class","svelte-1y8wjwc"),U.disabled=e[2],A(U,"class","svelte-1y8wjwc"),A(S,"class","add-form svelte-1y8wjwc"),A(T,"class","list svelte-1y8wjwc"),A(E,"class","section svelte-1y8wjwc"),A(t,"class","pubkeys-section")},m(r,d){u(r,t,d),c(t,n),c(n,i),c(n,o),c(n,s),c(s,a),I(a,e[6]),c(s,l),c(s,f),I(f,e[7]),c(s,h),c(s,y),c(y,w),c(n,b),c(n,k),_.m(k,null),c(t,C),c(t,E),c(E,x),c(E,B),c(E,S),c(S,Q),I(Q,e[9]),c(S,F),c(S,D),I(D,e[10]),c(S,$),c(S,U),c(U,P),c(E,R),c(E,T),G.m(T,null),N||(O=[v(a,"input",e[43]),v(f,"input",e[44]),v(y,"click",e[25]),v(Q,"input",e[45]),v(D,"input",e[46]),v(U,"click",e[26])],N=!0)},p(e,t){64&t[0]&&a.value!==e[6]&&I(a,e[6]),128&t[0]&&f.value!==e[7]&&I(f,e[7]),4&t[0]&&(y.disabled=e[2]),L===(L=M(e))&&_?_.p(e,t):(_.d(1),_=L(e),_&&(_.c(),_.m(k,null))),512&t[0]&&Q.value!==e[9]&&I(Q,e[9]),1024&t[0]&&D.value!==e[10]&&I(D,e[10]),4&t[0]&&(U.disabled=e[2]),j===(j=H(e))&&G?G.p(e,t):(G.d(1),G=j(e),G&&(G.c(),G.m(T,null)))},d(e){e&&d(t),_.d(),G.d(),N=!1,r(O)}}}function Hh(t){let n;return{c(){n=p("div"),n.innerHTML="

    No banned pubkeys configured.

    ",A(n,"class","no-items svelte-1y8wjwc")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function jh(e){let t,n=e[5],r=[];for(let t=0;tNo allowed pubkeys configured.

    ",A(n,"class","no-items svelte-1y8wjwc")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function Vh(e){let t,n=e[8],r=[];for(let t=0;t0?Zh:Wh}let L=M(e),_=L(e);let H=function(e){return e[22]&&e[22].length>0?ng:tg}(e),j=H(e);return{c(){t=p("div"),n=p("div"),i=p("h3"),i.textContent="Banned Events",o=m(),s=p("div"),a=p("input"),l=m(),f=p("input"),h=m(),y=p("button"),w=g("Ban Event"),b=m(),k=p("div"),_.c(),C=m(),E=p("div"),x=p("h3"),x.textContent="Allowed Events",B=m(),S=p("div"),Q=p("input"),F=m(),D=p("input"),$=m(),U=p("button"),P=g("Allow Event"),R=m(),T=p("div"),j.c(),A(i,"class","svelte-1y8wjwc"),A(a,"type","text"),A(a,"placeholder","Event ID (64 hex chars)"),A(a,"class","svelte-1y8wjwc"),A(f,"type","text"),A(f,"placeholder","Reason (optional)"),A(f,"class","svelte-1y8wjwc"),y.disabled=e[2],A(y,"class","svelte-1y8wjwc"),A(s,"class","add-form svelte-1y8wjwc"),A(k,"class","list svelte-1y8wjwc"),A(n,"class","section svelte-1y8wjwc"),A(x,"class","svelte-1y8wjwc"),A(Q,"type","text"),A(Q,"placeholder","Event ID (64 hex chars)"),A(Q,"class","svelte-1y8wjwc"),A(D,"type","text"),A(D,"placeholder","Reason (optional)"),A(D,"class","svelte-1y8wjwc"),U.disabled=e[2],A(U,"class","svelte-1y8wjwc"),A(S,"class","add-form svelte-1y8wjwc"),A(T,"class","list svelte-1y8wjwc"),A(E,"class","section svelte-1y8wjwc"),A(t,"class","events-section")},m(r,d){u(r,t,d),c(t,n),c(n,i),c(n,o),c(n,s),c(s,a),I(a,e[12]),c(s,l),c(s,f),I(f,e[13]),c(s,h),c(s,y),c(y,w),c(n,b),c(n,k),_.m(k,null),c(t,C),c(t,E),c(E,x),c(E,B),c(E,S),c(S,Q),I(Q,e[14]),c(S,F),c(S,D),I(D,e[15]),c(S,$),c(S,U),c(U,P),c(E,R),c(E,T),j.m(T,null),N||(O=[v(a,"input",e[47]),v(f,"input",e[48]),v(y,"click",e[27]),v(Q,"input",e[49]),v(D,"input",e[50]),v(U,"click",e[28])],N=!0)},p(e,t){4096&t[0]&&a.value!==e[12]&&I(a,e[12]),8192&t[0]&&f.value!==e[13]&&I(f,e[13]),4&t[0]&&(y.disabled=e[2]),L===(L=M(e))&&_?_.p(e,t):(_.d(1),_=L(e),_&&(_.c(),_.m(k,null))),16384&t[0]&&Q.value!==e[14]&&I(Q,e[14]),32768&t[0]&&D.value!==e[15]&&I(D,e[15]),4&t[0]&&(U.disabled=e[2]),j.p(e,t)},d(e){e&&d(t),_.d(),j.d(),N=!1,r(O)}}}function Wh(t){let n;return{c(){n=p("div"),n.innerHTML="

    No banned events configured.

    ",A(n,"class","no-items svelte-1y8wjwc")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function Zh(e){let t,n=e[11],r=[];for(let t=0;tNo allowed events configured.

    ",A(n,"class","no-items svelte-1y8wjwc")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function ng(e){let t,n=e[22],r=[];for(let t=0;t0?sg:og}let B=x(e),S=B(e);return{c(){t=p("div"),n=p("div"),i=p("h3"),i.textContent="Blocked IPs",o=m(),s=p("div"),a=p("input"),l=m(),f=p("input"),h=m(),y=p("button"),w=g("Block IP"),b=m(),k=p("div"),S.c(),A(i,"class","svelte-1y8wjwc"),A(a,"type","text"),A(a,"placeholder","IP Address"),A(a,"class","svelte-1y8wjwc"),A(f,"type","text"),A(f,"placeholder","Reason (optional)"),A(f,"class","svelte-1y8wjwc"),y.disabled=e[2],A(y,"class","svelte-1y8wjwc"),A(s,"class","add-form svelte-1y8wjwc"),A(k,"class","list svelte-1y8wjwc"),A(n,"class","section svelte-1y8wjwc"),A(t,"class","ips-section")},m(r,d){u(r,t,d),c(t,n),c(n,i),c(n,o),c(n,s),c(s,a),I(a,e[17]),c(s,l),c(s,f),I(f,e[18]),c(s,h),c(s,y),c(y,w),c(n,b),c(n,k),S.m(k,null),C||(E=[v(a,"input",e[51]),v(f,"input",e[52]),v(y,"click",e[29])],C=!0)},p(e,t){131072&t[0]&&a.value!==e[17]&&I(a,e[17]),262144&t[0]&&f.value!==e[18]&&I(f,e[18]),4&t[0]&&(y.disabled=e[2]),B===(B=x(e))&&S?S.p(e,t):(S.d(1),S=B(e),S&&(S.c(),S.m(k,null)))},d(e){e&&d(t),S.d(),C=!1,r(E)}}}function og(t){let n;return{c(){n=p("div"),n.innerHTML="

    No blocked IPs configured.

    ",A(n,"class","no-items svelte-1y8wjwc")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function sg(e){let t,n=e[16],r=[];for(let t=0;t0?dg:ug}let x=E(e),B=x(e);return{c(){t=p("div"),n=p("div"),i=p("h3"),i.textContent="Allowed Event Kinds",o=m(),s=p("div"),a=p("input"),l=m(),f=p("button"),h=g("Allow Kind"),y=m(),w=p("div"),B.c(),A(i,"class","svelte-1y8wjwc"),A(a,"type","number"),A(a,"placeholder","Kind number"),A(a,"class","svelte-1y8wjwc"),f.disabled=e[2],A(f,"class","svelte-1y8wjwc"),A(s,"class","add-form svelte-1y8wjwc"),A(w,"class","list svelte-1y8wjwc"),A(n,"class","section svelte-1y8wjwc"),A(t,"class","kinds-section")},m(r,d){u(r,t,d),c(t,n),c(n,i),c(n,o),c(n,s),c(s,a),I(a,e[20]),c(s,l),c(s,f),c(f,h),c(n,y),c(n,w),B.m(w,null),k||(C=[v(a,"input",e[53]),v(f,"click",e[30])],k=!0)},p(e,t){1048576&t[0]&&b(a.value)!==e[20]&&I(a,e[20]),4&t[0]&&(f.disabled=e[2]),x===(x=E(e))&&B?B.p(e,t):(B.d(1),B=x(e),B&&(B.c(),B.m(w,null)))},d(e){e&&d(t),B.d(),k=!1,r(C)}}}function ug(t){let n;return{c(){n=p("div"),n.innerHTML="

    No allowed kinds configured. All kinds are\n allowed by default.

    ",A(n,"class","no-items svelte-1y8wjwc")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function dg(e){let t,n=e[19],r=[];for(let t=0;t0?gg:hg}let w=y(e),b=w(e);return{c(){t=p("div"),n=p("div"),r=p("h3"),r.textContent="Events Needing Moderation",i=m(),o=p("button"),s=g("Refresh"),a=m(),l=p("div"),b.c(),A(r,"class","svelte-1y8wjwc"),o.disabled=e[2],A(l,"class","list svelte-1y8wjwc"),A(n,"class","section svelte-1y8wjwc"),A(t,"class","moderation-section")},m(d,p){u(d,t,p),c(t,n),c(n,r),c(n,i),c(n,o),c(o,s),c(n,a),c(n,l),b.m(l,null),f||(h=v(o,"click",e[24]),f=!0)},p(e,t){4&t[0]&&(o.disabled=e[2]),w===(w=y(e))&&b?b.p(e,t):(b.d(1),b=w(e),b&&(b.c(),b.m(l,null)))},d(e){e&&d(t),b.d(),f=!1,h()}}}function hg(t){let n;return{c(){n=p("div"),n.innerHTML="

    No events need moderation at this time.

    ",A(n,"class","no-items svelte-1y8wjwc")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function gg(e){let t,n=e[21],r=[];for(let t=0;tManaged ACL Configuration \n

    Configure access control using NIP-86 management API

    \n
    Owner Only: This interface is restricted to relay owners\n only.
    ',o=m(),z&&z.c(),s=m(),a=p("div"),l=p("button"),f=g("Pubkeys"),y=m(),w=p("button"),b=g("Events"),I=m(),C=p("button"),E=g("IPs"),B=m(),S=p("button"),Q=g("Kinds"),D=m(),$=p("button"),U=g("Moderation"),R=m(),T=p("button"),N=g("Relay Config"),M=m(),L=p("div"),q&&q.c(),_=m(),Y&&Y.c(),H=m(),W&&W.c(),j=m(),Z&&Z.c(),G=m(),X&&X.c(),J=m(),ee&&ee.c(),A(i,"class","header svelte-1y8wjwc"),A(l,"class",h="tab "+("pubkeys"===t[1]?"active":"")+" svelte-1y8wjwc"),A(w,"class",k="tab "+("events"===t[1]?"active":"")+" svelte-1y8wjwc"),A(C,"class",x="tab "+("ips"===t[1]?"active":"")+" svelte-1y8wjwc"),A(S,"class",F="tab "+("kinds"===t[1]?"active":"")+" svelte-1y8wjwc"),A($,"class",P="tab "+("moderation"===t[1]?"active":"")+" svelte-1y8wjwc"),A(T,"class",O="tab "+("relay"===t[1]?"active":"")+" svelte-1y8wjwc"),A(a,"class","tabs svelte-1y8wjwc"),A(L,"class","tab-content svelte-1y8wjwc")},m(e,r){u(e,n,r),c(n,i),c(n,o),z&&z.m(n,null),c(n,s),c(n,a),c(a,l),c(l,f),c(a,y),c(a,w),c(w,b),c(a,I),c(a,C),c(C,E),c(a,B),c(a,S),c(S,Q),c(a,D),c(a,$),c($,U),c(a,R),c(a,T),c(T,N),c(n,M),c(n,L),q&&q.m(L,null),c(L,_),Y&&Y.m(L,null),c(L,H),W&&W.m(L,null),c(L,j),Z&&Z.m(L,null),c(L,G),X&&X.m(L,null),c(L,J),ee&&ee.m(L,null),K||(V=[v(l,"click",t[37]),v(w,"click",t[38]),v(C,"click",t[39]),v(S,"click",t[40]),v($,"click",t[41]),v(T,"click",t[42])],K=!0)},p(e,t){e[3]?z?z.p(e,t):(z=Lh(e),z.c(),z.m(n,s)):z&&(z.d(1),z=null),2&t[0]&&h!==(h="tab "+("pubkeys"===e[1]?"active":"")+" svelte-1y8wjwc")&&A(l,"class",h),2&t[0]&&k!==(k="tab "+("events"===e[1]?"active":"")+" svelte-1y8wjwc")&&A(w,"class",k),2&t[0]&&x!==(x="tab "+("ips"===e[1]?"active":"")+" svelte-1y8wjwc")&&A(C,"class",x),2&t[0]&&F!==(F="tab "+("kinds"===e[1]?"active":"")+" svelte-1y8wjwc")&&A(S,"class",F),2&t[0]&&P!==(P="tab "+("moderation"===e[1]?"active":"")+" svelte-1y8wjwc")&&A($,"class",P),2&t[0]&&O!==(O="tab "+("relay"===e[1]?"active":"")+" svelte-1y8wjwc")&&A(T,"class",O),"pubkeys"===e[1]?q?q.p(e,t):(q=_h(e),q.c(),q.m(L,_)):q&&(q.d(1),q=null),"events"===e[1]?Y?Y.p(e,t):(Y=Yh(e),Y.c(),Y.m(L,H)):Y&&(Y.d(1),Y=null),"ips"===e[1]?W?W.p(e,t):(W=ig(e),W.c(),W.m(L,j)):W&&(W.d(1),W=null),"kinds"===e[1]?Z?Z.p(e,t):(Z=cg(e),Z.c(),Z.m(L,G)):Z&&(Z.d(1),Z=null),"moderation"===e[1]?X?X.p(e,t):(X=pg(e),X.c(),X.m(L,J)):X&&(X.d(1),X=null),"relay"===e[1]?ee?ee.p(e,t):(ee=vg(e),ee.c(),ee.m(L,null)):ee&&(ee.d(1),ee=null)},i:e,o:e,d(e){e&&d(n),z&&z.d(),q&&q.d(),Y&&Y.d(),W&&W.d(),Z&&Z.d(),X&&X.d(),ee&&ee.d(),K=!1,r(V)}}}function kg(e,t,n){let{userSigner:r}=t,{userPubkey:i}=t,o="pubkeys",s=!1,a="",l="info",c=[],u="",d="",f=[],p="",h="",g=[],m="",y="",v="",w="",A=[],k="",I="",C=[],E="",x=[],B={relay_name:"",relay_description:"",relay_icon:""};async function S(){try{n(2,s=!0),console.log("Fetching relay info from /");const e=await fetch(window.location.origin+"/",{headers:{Accept:"application/nostr+json"}});if(console.log("Response status:",e.status),console.log("Response headers:",e.headers),e.ok){const t=await e.json();console.log("Raw relay info:",t),n(0,B={relay_name:t.name||"",relay_description:t.description||"",relay_icon:t.icon||""}),console.log("Updated relayConfig:",B),console.log("Loaded relay info:",t),n(3,a="Relay configuration loaded successfully"),n(4,l="success")}else console.error("Failed to fetch relay info, status:",e.status),n(3,a=`Failed to fetch relay info: ${e.status}`),n(4,l="error")}catch(e){console.error("Failed to fetch relay info:",e),n(3,a=`Failed to fetch relay info: ${e.message}`),n(4,l="error")}finally{n(2,s=!1)}}async function Q(e,t=[]){try{n(2,s=!0),n(3,a="");const o={method:e,params:t},l=await async function(e,t){if(!r)throw new Error("No signer available for authentication. Please log in with a Nostr extension.");if(!i)throw new Error("No user pubkey available for authentication.");const n=window.location.origin+t,o={kind:27235,created_at:Math.floor(Date.now()/1e3),tags:[["u",n],["method",e]],content:"",pubkey:i},s=await r.signEvent(o),a=JSON.stringify(s);return`Nostr ${btoa(a)}`}("POST","/api/nip86"),c=await fetch("/api/nip86",{method:"POST",headers:{"Content-Type":"application/nostr+json+rpc",Authorization:l},body:JSON.stringify(o)});if(!c.ok)throw new Error(`HTTP ${c.status}: ${c.statusText}`);const u=await c.json();if(u.error)throw new Error(u.error);return u.result}catch(e){throw console.error("NIP-86 API error:",e),n(3,a=e.message),n(4,l="error"),e}finally{n(2,s=!1)}}async function D(){try{n(5,c=await Q("listbannedpubkeys"))}catch(e){console.error("Failed to load banned pubkeys:",e)}}async function $(){try{n(8,f=await Q("listallowedpubkeys"))}catch(e){console.error("Failed to load allowed pubkeys:",e)}}async function U(){try{n(11,g=await Q("listbannedevents"))}catch(e){console.error("Failed to load banned events:",e)}}async function P(){try{n(16,A=await Q("listblockedips"))}catch(e){console.error("Failed to load blocked IPs:",e)}}async function R(){try{n(19,C=await Q("listallowedkinds"))}catch(e){console.error("Failed to load allowed kinds:",e)}}async function T(){try{n(2,s=!0),n(21,x=await Q("listeventsneedingmoderation")),console.log("Loaded events needing moderation:",x)}catch(e){console.error("Failed to load events needing moderation:",e),n(3,a=`Failed to load moderation events: ${e.message}`),n(4,l="error"),n(21,x=[])}finally{n(2,s=!1)}}async function N(e){try{await Q("disallowkind",[e]),n(3,a="Kind disallowed successfully"),n(4,l="success"),await R()}catch(e){console.error("Failed to disallow kind:",e)}}async function O(e){try{await Q("allowevent",[e,"Approved from moderation queue"]),n(3,a="Event allowed successfully"),n(4,l="success"),await T()}catch(e){console.error("Failed to allow event from moderation:",e)}}async function M(e){try{await Q("banevent",[e,"Banned from moderation queue"]),n(3,a="Event banned successfully"),n(4,l="success"),await T()}catch(e){console.error("Failed to ban event from moderation:",e)}}F(()=>{setTimeout(()=>{S()},100)}),async function(){await Promise.all([D(),$(),U(),P(),R()])}();return e.$$set=e=>{"userSigner"in e&&n(35,r=e.userSigner),"userPubkey"in e&&n(36,i=e.userPubkey)},e.$$.update=()=>{1&e.$$.dirty[0]&&console.log("relayConfig changed:",B)},[B,o,s,a,l,c,u,d,f,p,h,g,m,y,v,w,A,k,I,C,E,x,[],S,T,async function(){if(u)try{await Q("banpubkey",[u,d]),n(3,a="Pubkey banned successfully"),n(4,l="success"),n(6,u=""),n(7,d=""),await D()}catch(e){console.error("Failed to ban pubkey:",e)}},async function(){if(p)try{await Q("allowpubkey",[p,h]),n(3,a="Pubkey allowed successfully"),n(4,l="success"),n(9,p=""),n(10,h=""),await $()}catch(e){console.error("Failed to allow pubkey:",e)}},async function(){if(m)try{await Q("banevent",[m,y]),n(3,a="Event banned successfully"),n(4,l="success"),n(12,m=""),n(13,y=""),await U()}catch(e){console.error("Failed to ban event:",e)}},async function(){if(v)try{await Q("allowevent",[v,w]),n(3,a="Event allowed successfully"),n(4,l="success"),n(14,v=""),n(15,w="")}catch(e){console.error("Failed to allow event:",e)}},async function(){if(k)try{await Q("blockip",[k,I]),n(3,a="IP blocked successfully"),n(4,l="success"),n(17,k=""),n(18,I=""),await P()}catch(e){console.error("Failed to block IP:",e)}},async function(){if(!E)return;const e=parseInt(E);if(isNaN(e))return n(3,a="Invalid kind number"),void n(4,l="error");try{await Q("allowkind",[e]),n(3,a="Kind allowed successfully"),n(4,l="success"),n(20,E=""),await R()}catch(e){console.error("Failed to allow kind:",e)}},N,async function(){try{n(2,s=!0),n(3,a="");const e=[];if(B.relay_name&&e.push(Q("changerelayname",[B.relay_name])),B.relay_description&&e.push(Q("changerelaydescription",[B.relay_description])),B.relay_icon&&e.push(Q("changerelayicon",[B.relay_icon])),0===e.length)return n(3,a="No changes to update"),void n(4,l="info");await Promise.all(e),n(3,a="Relay configuration updated successfully"),n(4,l="success"),await S()}catch(e){console.error("Failed to update relay configuration:",e),n(3,a=`Failed to update relay configuration: ${e.message}`),n(4,l="error")}finally{n(2,s=!1)}},O,M,r,i,()=>n(1,o="pubkeys"),()=>n(1,o="events"),()=>n(1,o="ips"),()=>n(1,o="kinds"),()=>{n(1,o="moderation"),x&&0!==x.length||T()},()=>n(1,o="relay"),function(){u=this.value,n(6,u)},function(){d=this.value,n(7,d)},function(){p=this.value,n(9,p)},function(){h=this.value,n(10,h)},function(){m=this.value,n(12,m)},function(){y=this.value,n(13,y)},function(){v=this.value,n(14,v)},function(){w=this.value,n(15,w)},function(){k=this.value,n(17,k)},function(){I=this.value,n(18,I)},function(){E=b(this.value),n(20,E)},e=>N(e),e=>O(e.id),e=>M(e.id),function(){B.relay_name=this.value,n(0,B)},function(){B.relay_description=this.value,n(0,B)},function(){B.relay_icon=this.value,n(0,B)}]}class Ig extends ie{constructor(e){super(),re(this,e,kg,bg,o,{userSigner:35,userPubkey:36},null,[-1,-1,-1])}}function Cg(e){let t,n;return{c(){t=p("span"),n=g(e[3]),A(t,"class","permission-badge svelte-1qkhxam")},m(e,r){u(e,t,r),c(t,n)},p(e,t){8&t&&k(n,e[3])},d(e){e&&d(t)}}}function Eg(t){let n,r,i;return{c(){n=p("button"),n.textContent="Log in",A(n,"class","login-btn svelte-1qkhxam")},m(e,o){u(e,n,o),r||(i=v(n,"click",t[7]),r=!0)},p:e,d(e){e&&d(n),r=!1,i()}}}function xg(e){let t,n,r,i,o,s,a=(e[4]?.name||e[5])+"";function l(e,t){return e[4]?.picture?Sg:Bg}let f=l(e),h=f(e);return{c(){t=p("button"),h.c(),n=m(),r=p("span"),i=g(a),A(r,"class","user-name svelte-1qkhxam"),A(t,"class","user-profile-btn svelte-1qkhxam")},m(a,l){u(a,t,l),h.m(t,null),c(t,n),c(t,r),c(r,i),o||(s=v(t,"click",e[6]),o=!0)},p(e,r){f===(f=l(e))&&h?h.p(e,r):(h.d(1),h=f(e),h&&(h.c(),h.m(t,n))),48&r&&a!==(a=(e[4]?.name||e[5])+"")&&k(i,a)},d(e){e&&d(t),h.d(),o=!1,s()}}}function Bg(t){let n;return{c(){n=p("div"),n.textContent="👤",A(n,"class","user-avatar-placeholder svelte-1qkhxam")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function Sg(e){let t,n;return{c(){t=p("img"),a(t.src,n=e[4].picture)||A(t,"src",n),A(t,"alt","User avatar"),A(t,"class","user-avatar svelte-1qkhxam")},m(e,n){u(e,t,n)},p(e,r){16&r&&!a(t.src,n=e[4].picture)&&A(t,"src",n)},d(e){e&&d(t)}}}function Qg(t){let n,r,i,o,s,l,f,h,y,v,w=t[1]&&t[2]&&Cg(t);function b(e,t){return e[1]?xg:Eg}let k=b(t),I=k(t);return{c(){n=p("header"),r=p("div"),i=p("img"),s=m(),l=p("div"),f=p("span"),h=g("ORLY? dashboard\n "),w&&w.c(),y=m(),v=p("div"),I.c(),a(i.src,o="/orly.png")||A(i,"src","/orly.png"),A(i,"alt","ORLY Logo"),A(i,"class","logo svelte-1qkhxam"),A(f,"class","app-title svelte-1qkhxam"),A(l,"class","header-title svelte-1qkhxam"),A(v,"class","header-buttons svelte-1qkhxam"),A(r,"class","header-content svelte-1qkhxam"),A(n,"class","main-header svelte-1qkhxam"),x(n,"dark-theme",t[0])},m(e,t){u(e,n,t),c(n,r),c(r,i),c(r,s),c(r,l),c(l,f),c(f,h),w&&w.m(f,null),c(r,y),c(r,v),I.m(v,null)},p(e,[t]){e[1]&&e[2]?w?w.p(e,t):(w=Cg(e),w.c(),w.m(f,null)):w&&(w.d(1),w=null),k===(k=b(e))&&I?I.p(e,t):(I.d(1),I=k(e),I&&(I.c(),I.m(v,null))),1&t&&x(n,"dark-theme",e[0])},i:e,o:e,d(e){e&&d(n),w&&w.d(),I.d()}}}function Fg(e,t,n){let{isDarkTheme:r=!1}=t,{isLoggedIn:i=!1}=t,{userRole:o=""}=t,{currentEffectiveRole:s=""}=t,{userProfile:a=null}=t,{userPubkey:l=""}=t;const c=$();return e.$$set=e=>{"isDarkTheme"in e&&n(0,r=e.isDarkTheme),"isLoggedIn"in e&&n(1,i=e.isLoggedIn),"userRole"in e&&n(2,o=e.userRole),"currentEffectiveRole"in e&&n(3,s=e.currentEffectiveRole),"userProfile"in e&&n(4,a=e.userProfile),"userPubkey"in e&&n(5,l=e.userPubkey)},[r,i,o,s,a,l,function(){c("openSettingsDrawer")},function(){c("openLoginModal")}]}class Dg extends ie{constructor(e){super(),re(this,e,Fg,Qg,o,{isDarkTheme:0,isLoggedIn:1,userRole:2,currentEffectiveRole:3,userProfile:4,userPubkey:5})}}function $g(e,t,n){const r=e.slice();return r[10]=t[n],r}function Ug(e){let t,n,i;function o(){return e[6](e[10])}function s(...t){return e[7](e[10],...t)}return{c(){t=p("span"),t.textContent="✕",A(t,"class","tab-close-icon svelte-wfmuj"),A(t,"role","button"),A(t,"tabindex","0")},m(e,r){u(e,t,r),n||(i=[v(t,"click",w(o)),v(t,"keydown",s)],n=!0)},p(t,n){e=t},d(e){e&&d(t),n=!1,r(i)}}}function Pg(e){let t,n,r,i,o,s,a,l,f,h,y=e[10].icon+"",w=e[10].label+"",b=e[10].isSearchTab&&Ug(e);function I(){return e[8](e[10])}return{c(){t=p("button"),n=p("span"),r=g(y),i=m(),o=p("span"),s=g(w),a=m(),b&&b.c(),l=m(),A(n,"class","tab-icon svelte-wfmuj"),A(o,"class","tab-label svelte-wfmuj"),A(t,"class","tab svelte-wfmuj"),x(t,"active",e[2]===e[10].id)},m(e,d){u(e,t,d),c(t,n),c(n,r),c(t,i),c(t,o),c(o,s),c(t,a),b&&b.m(t,null),c(t,l),f||(h=v(t,"click",I),f=!0)},p(n,i){e=n,2&i&&y!==(y=e[10].icon+"")&&k(r,y),2&i&&w!==(w=e[10].label+"")&&k(s,w),e[10].isSearchTab?b?b.p(e,i):(b=Ug(e),b.c(),b.m(t,l)):b&&(b.d(1),b=null),6&i&&x(t,"active",e[2]===e[10].id)},d(e){e&&d(t),b&&b.d(),f=!1,h()}}}function Rg(e){let t,n,r,i,o,s,a,l;return{c(){t=p("a"),n=h("svg"),r=h("path"),i=h("path"),o=m(),s=p("span"),a=g("v"),l=g(e[3]),A(r,"d","M5 6h12v2h1.5c1.38 0 2.5 1.12 2.5 2.5v1c0 1.38-1.12 2.5-2.5 2.5H17v1c0 1.66-1.34 3-3 3H8c-1.66 0-3-1.34-3-3V6zm12 6h1.5c.28 0 .5-.22.5-.5v-1c0-.28-.22-.5-.5-.5H17v2z"),A(i,"d","M9 9c1.5 0 3 .5 3 2.5S10.5 14 9 14c0-1.5.5-3.5 2-4.5"),A(i,"stroke","currentColor"),A(i,"stroke-width","1"),A(i,"fill","none"),A(n,"class","version-icon svelte-wfmuj"),A(n,"viewBox","0 0 24 24"),A(n,"fill","currentColor"),A(n,"xmlns","http://www.w3.org/2000/svg"),A(s,"class","version-text svelte-wfmuj"),A(t,"href","https://next.orly.dev"),A(t,"target","_blank"),A(t,"rel","noopener noreferrer"),A(t,"class","version-link svelte-wfmuj")},m(e,d){u(e,t,d),c(t,n),c(n,r),c(n,i),c(t,o),c(t,s),c(s,a),c(s,l)},p(e,t){8&t&&k(l,e[3])},d(e){e&&d(t)}}}function Tg(t){let n,r,i,o,s=t[1],a=[];for(let e=0;e{"isDarkTheme"in e&&n(0,r=e.isDarkTheme),"tabs"in e&&n(1,i=e.tabs),"selectedTab"in e&&n(2,o=e.selectedTab),"version"in e&&n(3,s=e.version)},[r,i,o,s,l,c,e=>c(e.id),(e,t)=>"Enter"===t.key&&c(e.id),e=>l(e.id)]}class Og extends ie{constructor(e){super(),re(this,e,Ng,Tg,o,{isDarkTheme:0,tabs:1,selectedTab:2,version:3})}}function Mg(t){let n,r,i,o,s,a;return{c(){n=p("div"),r=p("p"),r.textContent="Please log in to access export functionality.",i=m(),o=p("button"),o.textContent="Log In",A(r,"class","svelte-jzrdtj"),A(o,"class","login-btn svelte-jzrdtj"),A(n,"class","login-prompt svelte-jzrdtj")},m(e,l){u(e,n,l),c(n,r),c(n,i),c(n,o),s||(a=v(o,"click",t[5]),s=!0)},p:e,d(e){e&&d(n),s=!1,a()}}}function Lg(e){let t,n,r=e[0]&&_g(e),i=e[1]&&Hg(e);return{c(){r&&r.c(),t=m(),i&&i.c(),n=y()},m(e,o){r&&r.m(e,o),u(e,t,o),i&&i.m(e,o),u(e,n,o)},p(e,o){e[0]?r?r.p(e,o):(r=_g(e),r.c(),r.m(t.parentNode,t)):r&&(r.d(1),r=null),e[1]?i?i.p(e,o):(i=Hg(e),i.c(),i.m(n.parentNode,n)):i&&(i.d(1),i=null)},d(e){r&&r.d(e),e&&d(t),i&&i.d(e),e&&d(n)}}}function _g(t){let n,r,i,o,s,a,l,f;return{c(){n=p("div"),r=p("h3"),r.textContent="Export My Events",i=m(),o=p("p"),o.textContent="Download your personal events as a JSONL file.",s=m(),a=p("button"),a.textContent="📤 Export My Events",A(r,"class","svelte-jzrdtj"),A(o,"class","svelte-jzrdtj"),A(a,"class","export-btn svelte-jzrdtj"),A(n,"class","export-section svelte-jzrdtj")},m(e,d){u(e,n,d),c(n,r),c(n,i),c(n,o),c(n,s),c(n,a),l||(f=v(a,"click",t[3]),l=!0)},p:e,d(e){e&&d(n),l=!1,f()}}}function Hg(t){let n,r,i,o,s,a,l,f;return{c(){n=p("div"),r=p("h3"),r.textContent="Export All Events",i=m(),o=p("p"),o.textContent="Download the complete database as a JSONL file. This includes\n all events from all users.",s=m(),a=p("button"),a.textContent="📤 Export All Events",A(r,"class","svelte-jzrdtj"),A(o,"class","svelte-jzrdtj"),A(a,"class","export-btn svelte-jzrdtj"),A(n,"class","export-section svelte-jzrdtj")},m(e,d){u(e,n,d),c(n,r),c(n,i),c(n,o),c(n,s),c(n,a),l||(f=v(a,"click",t[4]),l=!0)},p:e,d(e){e&&d(n),l=!1,f()}}}function jg(t){let n;function r(e,t){return e[2]?Lg:Mg}let i=r(t),o=i(t);return{c(){o.c(),n=y()},m(e,t){o.m(e,t),u(e,n,t)},p(e,[t]){i===(i=r(e))&&o?o.p(e,t):(o.d(1),o=i(e),o&&(o.c(),o.m(n.parentNode,n)))},i:e,o:e,d(e){o.d(e),e&&d(n)}}}function Gg(e,t,n){let r,i,{isLoggedIn:o=!1}=t,{currentEffectiveRole:s=""}=t,{aclMode:a=""}=t;const l=$();return e.$$set=e=>{"isLoggedIn"in e&&n(0,o=e.isLoggedIn),"currentEffectiveRole"in e&&n(6,s=e.currentEffectiveRole),"aclMode"in e&&n(7,a=e.aclMode)},e.$$.update=()=>{129&e.$$.dirty&&n(2,r="none"===a||o),192&e.$$.dirty&&n(1,i="none"===a||"admin"===s||"owner"===s)},[o,i,r,function(){l("exportMyEvents")},function(){l("exportAllEvents")},function(){l("openLoginModal")},s,a]}class Jg extends ie{constructor(e){super(),re(this,e,Gg,jg,o,{isLoggedIn:0,currentEffectiveRole:6,aclMode:7})}}function Kg(t){let n,r,i,o,s,a,l,f;return{c(){n=p("div"),r=p("h3"),r.textContent="Import Events",i=m(),o=p("p"),o.textContent="Please log in to access import functionality.",s=m(),a=p("button"),a.textContent="Log In",A(r,"class","recovery-header svelte-nonyqh"),A(o,"class","recovery-description svelte-nonyqh"),A(a,"class","login-btn svelte-nonyqh"),A(n,"class","login-prompt svelte-nonyqh")},m(e,d){u(e,n,d),c(n,r),c(n,i),c(n,o),c(n,s),c(n,a),l||(f=v(a,"click",t[6]),l=!0)},p:e,d(e){e&&d(n),l=!1,f()}}}function Vg(t){let n;return{c(){n=p("div"),n.innerHTML='

    Import Events

    \n

    Admin or owner permission required for import functionality.

    ',A(n,"class","permission-denied svelte-nonyqh")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function zg(e){let t,n,i,o,s,a,l,f,h,y,w,b,k,I,C=e[2]&&qg(e);return{c(){t=p("h3"),t.textContent="Import Events",n=m(),i=p("p"),i.textContent="Upload a JSONL file to import events into the database.",o=m(),s=p("div"),a=p("input"),l=m(),f=p("div"),h=p("button"),y=g("Import Events"),b=m(),C&&C.c(),A(t,"class","svelte-nonyqh"),A(i,"class","svelte-nonyqh"),A(a,"type","file"),A(a,"id","import-file"),A(a,"accept",".jsonl,.txt"),A(a,"class","svelte-nonyqh"),A(h,"class","import-btn svelte-nonyqh"),h.disabled=w=!e[1]||"Uploading..."===e[2],A(f,"class","import-row svelte-nonyqh"),A(s,"class","recovery-controls-card svelte-nonyqh")},m(r,d){u(r,t,d),u(r,n,d),u(r,i,d),u(r,o,d),u(r,s,d),c(s,a),c(s,l),c(s,f),c(f,h),c(h,y),c(f,b),C&&C.m(f,null),k||(I=[v(a,"change",e[4]),v(h,"click",e[5])],k=!0)},p(e,t){6&t&&w!==(w=!e[1]||"Uploading..."===e[2])&&(h.disabled=w),e[2]?C?C.p(e,t):(C=qg(e),C.c(),C.m(f,null)):C&&(C.d(1),C=null)},d(e){e&&d(t),e&&d(n),e&&d(i),e&&d(o),e&&d(s),C&&C.d(),k=!1,r(I)}}}function qg(e){let t,n;return{c(){t=p("span"),n=g(e[2]),A(t,"class","import-message svelte-nonyqh"),x(t,"uploading","Uploading..."===e[2]),x(t,"success","Upload complete"===e[2]),x(t,"error",e[2].startsWith("Import failed")||e[2].startsWith("Admin")||e[2].startsWith("Please"))},m(e,r){u(e,t,r),c(t,n)},p(e,r){4&r&&k(n,e[2]),4&r&&x(t,"uploading","Uploading..."===e[2]),4&r&&x(t,"success","Upload complete"===e[2]),4&r&&x(t,"error",e[2].startsWith("Import failed")||e[2].startsWith("Admin")||e[2].startsWith("Please"))},d(e){e&&d(t)}}}function Yg(t){let n;function r(e,t){return e[3]?zg:e[0]?Vg:Kg}let i=r(t),o=i(t);return{c(){n=p("div"),o.c(),A(n,"class","import-section svelte-nonyqh")},m(e,t){u(e,n,t),o.m(n,null)},p(e,[t]){i===(i=r(e))&&o?o.p(e,t):(o.d(1),o=i(e),o&&(o.c(),o.m(n,null)))},i:e,o:e,d(e){e&&d(n),o.d()}}}function Wg(e,t,n){let r,{isLoggedIn:i=!1}=t,{currentEffectiveRole:o=""}=t,{selectedFile:s=null}=t,{aclMode:a=""}=t,{importMessage:l=""}=t;const c=$();return e.$$set=e=>{"isLoggedIn"in e&&n(0,i=e.isLoggedIn),"currentEffectiveRole"in e&&n(7,o=e.currentEffectiveRole),"selectedFile"in e&&n(1,s=e.selectedFile),"aclMode"in e&&n(8,a=e.aclMode),"importMessage"in e&&n(2,l=e.importMessage)},e.$$.update=()=>{385&e.$$.dirty&&n(3,r="none"===a||i&&("admin"===o||"owner"===o))},[i,s,l,r,function(e){c("fileSelect",e)},function(){c("importEvents")},function(){c("openLoginModal")},o,a]}class Zg extends ie{constructor(e){super(),re(this,e,Wg,Yg,o,{isLoggedIn:0,currentEffectiveRole:7,selectedFile:1,aclMode:8,importMessage:2})}}const Xg={0:"Profile Metadata",1:"Text Note",2:"Recommend Relay",3:"Contacts",4:"Encrypted DM",5:"Delete Request",6:"Repost",7:"Reaction",8:"Badge Award",16:"Generic Repost",40:"Channel Creation",41:"Channel Metadata",42:"Channel Message",43:"Channel Hide Message",44:"Channel Mute User",1063:"File Metadata",1311:"Live Chat Message",1984:"Reporting",1985:"Label",9734:"Zap Request",9735:"Zap Receipt",1e4:"Mute List",10001:"Pin List",10002:"Relay List Metadata",10003:"Bookmark List",10004:"Communities List",10005:"Public Chats List",10006:"Blocked Relays List",10007:"Search Relays List",10009:"User Groups",10015:"Interests List",10030:"User Emoji List",13194:"Wallet Info",22242:"Client Auth",23194:"Wallet Request",23195:"Wallet Response",24133:"Nostr Connect",27235:"HTTP Auth",3e4:"Categorized People List",30001:"Categorized Bookmarks",30002:"Categorized Relay List",30003:"Bookmark Sets",30004:"Curation Sets",30005:"Video Sets",30008:"Profile Badges",30009:"Badge Definition",30015:"Interest Sets",30017:"Create/Update Stall",30018:"Create/Update Product",30019:"Marketplace UI/UX",30020:"Product Sold As Auction",30023:"Long-form Content",30024:"Draft Long-form Content",30030:"Emoji Sets",30063:"Release Artifact Sets",30078:"Application-specific Data",30311:"Live Event",30315:"User Statuses",30388:"Slide Set",30402:"Classified Listing",30403:"Draft Classified Listing",30617:"Repository Announcement",30618:"Repository State Announcement",30818:"Wiki Article",30819:"Redirects",31922:"Date-Based Calendar Event",31923:"Time-Based Calendar Event",31924:"Calendar",31925:"Calendar Event RSVP",31989:"Handler Recommendation",31990:"Handler Information",34550:"Community Definition",34551:"Community Post Approval"};function em(e,t=null){if(!e||"string"!=typeof e)return!1;return!!/^[0-9a-fA-F]+$/.test(e)&&(!t||e.length===t)}function tm(e){const t=new Date(1e3*e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}T${String(t.getHours()).padStart(2,"0")}:${String(t.getMinutes()).padStart(2,"0")}`}function nm(e){return Math.floor(new Date(e).getTime()/1e3)}function rm(e,t,n){const r=e.slice();return r[62]=t[n],r[64]=n,r}function im(e,t,n){const r=e.slice();return r[65]=t[n],r}function om(e,t,n){const r=e.slice();return r[68]=t[n],r}function sm(e,t,n){const r=e.slice();return r[71]=t[n],r}function am(e,t,n){const r=e.slice();return r[71]=t[n].kind,r[74]=t[n].name,r}function lm(e){let t,n,r,i,o,s,a=e[20],l=[];for(let t=0;t0&&um(t),Ge=t[17]&&fm(t),Je=t[2].length>0&&pm(t),Ke=t[18]&&gm(t),Ve=t[3].length>0&&mm(t),ze=t[19]&&vm(t),qe=t[4].length>0&&wm(t),Ye=t[5]&&bm(t),We=t[6]&&km(t),Ze=t[8]&&Im(t);return{c(){n=p("div"),i=p("div"),o=p("div"),s=p("label"),s.textContent="Search Text (NIP-50)",a=m(),l=p("div"),f=p("input"),h=m(),y=p("label"),y.textContent="Event Kinds",w=m(),C=p("div"),E=p("button"),B=g(Le),S=g(" Select Kinds ("),Q=g(_e),F=g(" selected)"),D=m(),He&&He.c(),$=m(),je&&je.c(),U=m(),P=p("label"),P.textContent="Authors (Pubkeys)",R=m(),T=p("div"),N=p("div"),O=p("input"),M=m(),L=p("button"),L.textContent="Add",_=m(),Ge&&Ge.c(),H=m(),Je&&Je.c(),j=m(),G=p("label"),G.textContent="Event IDs",J=m(),K=p("div"),V=p("div"),z=p("input"),q=m(),Y=p("button"),Y.textContent="Add",W=m(),Ke&&Ke.c(),Z=m(),Ve&&Ve.c(),X=m(),ee=p("label"),ee.textContent="Tags (#e, #p, #a)",te=m(),ne=p("div"),re=p("div"),ie=p("span"),ie.textContent="#",oe=m(),se=p("input"),ae=m(),le=p("input"),ce=m(),ue=p("button"),ue.textContent="Add",de=m(),ze&&ze.c(),fe=m(),qe&&qe.c(),pe=m(),he=p("label"),he.textContent="Since",ge=m(),me=p("div"),ye=p("input"),ve=m(),Ye&&Ye.c(),we=m(),Ae=p("label"),Ae.textContent="Until",be=m(),ke=p("div"),Ie=p("input"),Ce=m(),We&&We.c(),Ee=m(),xe=p("label"),xe.textContent="Limit",Be=m(),Se=p("div"),Qe=p("input"),Fe=m(),Ze&&Ze.c(),De=m(),$e=p("div"),Ue=p("button"),Ue.textContent="🧹",Pe=m(),Re=p("div"),Te=m(),Ne=p("button"),Ne.textContent="",A(s,"for","search-text"),A(s,"class","svelte-1a1v6k0"),A(f,"id","search-text"),A(f,"type","text"),A(f,"placeholder","Search events..."),A(f,"class","filter-input svelte-1a1v6k0"),A(l,"class","field-content svelte-1a1v6k0"),A(y,"class","svelte-1a1v6k0"),A(E,"class","picker-toggle-btn svelte-1a1v6k0"),A(C,"class","field-content svelte-1a1v6k0"),A(P,"class","svelte-1a1v6k0"),A(O,"type","text"),A(O,"placeholder","64 character hex pubkey..."),A(O,"class","filter-input svelte-1a1v6k0"),A(O,"maxlength","64"),A(L,"class","add-btn svelte-1a1v6k0"),A(N,"class","input-group svelte-1a1v6k0"),A(T,"class","field-content svelte-1a1v6k0"),A(G,"class","svelte-1a1v6k0"),A(z,"type","text"),A(z,"placeholder","64 character hex event ID..."),A(z,"class","filter-input svelte-1a1v6k0"),A(z,"maxlength","64"),A(Y,"class","add-btn svelte-1a1v6k0"),A(V,"class","input-group svelte-1a1v6k0"),A(K,"class","field-content svelte-1a1v6k0"),A(ee,"class","svelte-1a1v6k0"),A(ie,"class","hash-prefix svelte-1a1v6k0"),A(se,"type","text"),A(se,"placeholder","Tag"),A(se,"class","filter-input tag-name-input svelte-1a1v6k0"),A(se,"maxlength","1"),A(le,"type","text"),A(le,"placeholder","Value..."),A(le,"class","filter-input tag-value-input svelte-1a1v6k0"),A(ue,"class","add-btn svelte-1a1v6k0"),A(re,"class","tag-input-group svelte-1a1v6k0"),A(ne,"class","field-content svelte-1a1v6k0"),A(he,"for","since-timestamp"),A(he,"class","svelte-1a1v6k0"),A(ye,"id","since-timestamp"),A(ye,"type","datetime-local"),ye.value=t[32](),A(ye,"class","filter-input svelte-1a1v6k0"),A(me,"class","field-content timestamp-field svelte-1a1v6k0"),A(Ae,"for","until-timestamp"),A(Ae,"class","svelte-1a1v6k0"),A(Ie,"id","until-timestamp"),A(Ie,"type","datetime-local"),Ie.value=t[33](),A(Ie,"class","filter-input svelte-1a1v6k0"),A(ke,"class","field-content timestamp-field svelte-1a1v6k0"),A(xe,"for","limit"),A(xe,"class","svelte-1a1v6k0"),A(Qe,"id","limit"),A(Qe,"type","number"),A(Qe,"placeholder","Max events to return"),A(Qe,"class","filter-input svelte-1a1v6k0"),A(Qe,"min","1"),A(Se,"class","field-content svelte-1a1v6k0"),A(o,"class","filter-grid svelte-1a1v6k0"),A(i,"class","filter-content svelte-1a1v6k0"),A(Ue,"class","clear-all-btn svelte-1a1v6k0"),A(Ue,"title","Clear all filters"),A(Re,"class","spacer svelte-1a1v6k0"),A(Ne,"class","json-toggle-btn svelte-1a1v6k0"),A(Ne,"title","Edit filter JSON"),x(Ne,"active",t[8]),A($e,"class","clear-column svelte-1a1v6k0"),A(n,"class","filter-builder svelte-1a1v6k0")},m(e,r){u(e,n,r),c(n,i),c(i,o),c(o,s),c(o,a),c(o,l),c(l,f),I(f,t[0]),c(o,h),c(o,y),c(o,w),c(o,C),c(C,E),c(E,B),c(E,S),c(E,Q),c(E,F),c(C,D),He&&He.m(C,null),c(C,$),je&&je.m(C,null),c(o,U),c(o,P),c(o,R),c(o,T),c(T,N),c(N,O),I(O,t[13]),c(N,M),c(N,L),c(T,_),Ge&&Ge.m(T,null),c(T,H),Je&&Je.m(T,null),c(o,j),c(o,G),c(o,J),c(o,K),c(K,V),c(V,z),I(z,t[14]),c(V,q),c(V,Y),c(K,W),Ke&&Ke.m(K,null),c(K,Z),Ve&&Ve.m(K,null),c(o,X),c(o,ee),c(o,te),c(o,ne),c(ne,re),c(re,ie),c(re,oe),c(re,se),I(se,t[15]),c(re,ae),c(re,le),I(le,t[16]),c(re,ce),c(re,ue),c(ne,de),ze&&ze.m(ne,null),c(ne,fe),qe&&qe.m(ne,null),c(o,pe),c(o,he),c(o,ge),c(o,me),c(me,ye),c(me,ve),Ye&&Ye.m(me,null),c(o,we),c(o,Ae),c(o,be),c(o,ke),c(ke,Ie),c(ke,Ce),We&&We.m(ke,null),c(o,Ee),c(o,xe),c(o,Be),c(o,Se),c(Se,Qe),I(Qe,t[7]),c(o,Fe),Ze&&Ze.m(o,null),c(n,De),c(n,$e),c($e,Ue),c($e,Pe),c($e,Re),c($e,Te),c($e,Ne),Oe||(Me=[v(f,"input",t[38]),v(E,"click",t[39]),v(O,"input",t[43]),v(O,"keydown",t[44]),v(L,"click",t[25]),v(z,"input",t[46]),v(z,"keydown",t[47]),v(Y,"click",t[27]),v(se,"input",t[49]),v(le,"input",t[50]),v(le,"keydown",t[51]),v(ue,"click",t[29]),v(ye,"change",t[34]),v(Ie,"change",t[35]),v(Qe,"input",t[55]),v(Ue,"click",t[31]),v(Ne,"click",t[57])],Oe=!0)},p(e,t){1&t[0]&&f.value!==e[0]&&I(f,e[0]),4096&t[0]&&Le!==(Le=e[12]?"▼":"▶")&&k(B,Le),2&t[0]&&_e!==(_e=e[1].length+"")&&k(Q,_e),e[12]?He?He.p(e,t):(He=lm(e),He.c(),He.m(C,$)):He&&(He.d(1),He=null),e[1].length>0?je?je.p(e,t):(je=um(e),je.c(),je.m(C,null)):je&&(je.d(1),je=null),8192&t[0]&&O.value!==e[13]&&I(O,e[13]),e[17]?Ge?Ge.p(e,t):(Ge=fm(e),Ge.c(),Ge.m(T,H)):Ge&&(Ge.d(1),Ge=null),e[2].length>0?Je?Je.p(e,t):(Je=pm(e),Je.c(),Je.m(T,null)):Je&&(Je.d(1),Je=null),16384&t[0]&&z.value!==e[14]&&I(z,e[14]),e[18]?Ke?Ke.p(e,t):(Ke=gm(e),Ke.c(),Ke.m(K,Z)):Ke&&(Ke.d(1),Ke=null),e[3].length>0?Ve?Ve.p(e,t):(Ve=mm(e),Ve.c(),Ve.m(K,null)):Ve&&(Ve.d(1),Ve=null),32768&t[0]&&se.value!==e[15]&&I(se,e[15]),65536&t[0]&&le.value!==e[16]&&I(le,e[16]),e[19]?ze?ze.p(e,t):(ze=vm(e),ze.c(),ze.m(ne,fe)):ze&&(ze.d(1),ze=null),e[4].length>0?qe?qe.p(e,t):(qe=wm(e),qe.c(),qe.m(ne,null)):qe&&(qe.d(1),qe=null),e[5]?Ye?Ye.p(e,t):(Ye=bm(e),Ye.c(),Ye.m(me,null)):Ye&&(Ye.d(1),Ye=null),e[6]?We?We.p(e,t):(We=km(e),We.c(),We.m(ke,null)):We&&(We.d(1),We=null),128&t[0]&&b(Qe.value)!==e[7]&&I(Qe,e[7]),e[8]?Ze?Ze.p(e,t):(Ze=Im(e),Ze.c(),Ze.m(o,null)):Ze&&(Ze.d(1),Ze=null),256&t[0]&&x(Ne,"active",e[8])},i:e,o:e,d(e){e&&d(n),He&&He.d(),je&&je.d(),Ge&&Ge.d(),Je&&Je.d(),Ke&&Ke.d(),Ve&&Ve.d(),ze&&ze.d(),qe&&qe.d(),Ye&&Ye.d(),We&&We.d(),Ze&&Ze.d(),Oe=!1,r(Me)}}}function xm(e,t,n){let r,i;const o=$();let{searchText:s=""}=t,{selectedKinds:a=[]}=t,{pubkeys:l=[]}=t,{eventIds:c=[]}=t,{tags:u=[]}=t,{sinceTimestamp:d=null}=t,{untilTimestamp:f=null}=t,{limit:p=null}=t,{showJsonEditor:h=!1}=t,g="",m="",y=!1,v="",w="",A="",k="",I="",C="",E="",x="",B=null,S=!1;function Q(e){a.includes(e)?n(1,a=a.filter(t=>t!==e)):n(1,a=[...a,e].sort((e,t)=>e-t))}function F(e){n(1,a=a.filter(t=>t!==e))}function U(){const e=w.trim();e&&(em(e,64)?l.includes(e)?n(17,C="Pubkey already added"):(n(2,l=[...l,e]),n(13,w=""),n(17,C="")):n(17,C="Invalid pubkey: must be 64 character hex string"))}function P(e){n(2,l=l.filter(t=>t!==e))}function R(){const e=A.trim();e&&(em(e,64)?c.includes(e)?n(18,E="Event ID already added"):(n(3,c=[...c,e]),n(14,A=""),n(18,E="")):n(18,E="Invalid event ID: must be 64 character hex string"))}function T(e){n(3,c=c.filter(t=>t!==e))}function N(){const e=k.trim(),t=I.trim();e&&t&&(/^[a-zA-Z]$/.test(e)?u.some(n=>n.name===e&&n.value===t)?n(19,x="Tag already added"):(n(4,u=[...u,{name:e,value:t}]),n(15,k=""),n(16,I=""),n(19,x="")):n(19,x="Invalid tag name: must be single letter a-z or A-Z"))}function O(e){n(4,u=u.filter((t,n)=>n!==e))}function M(){o("apply",{searchText:s,selectedKinds:a,pubkeys:l,eventIds:c,tags:u,sinceTimestamp:d,untilTimestamp:f,limit:p})}D(()=>{B&&clearTimeout(B)});return e.$$set=e=>{"searchText"in e&&n(0,s=e.searchText),"selectedKinds"in e&&n(1,a=e.selectedKinds),"pubkeys"in e&&n(2,l=e.pubkeys),"eventIds"in e&&n(3,c=e.eventIds),"tags"in e&&n(4,u=e.tags),"sinceTimestamp"in e&&n(5,d=e.sinceTimestamp),"untilTimestamp"in e&&n(6,f=e.untilTimestamp),"limit"in e&&n(7,p=e.limit),"showJsonEditor"in e&&n(8,h=e.showJsonEditor)},e.$$.update=()=>{if(256&e.$$.dirty[0]&&h){const e=function(){const e={};return a.length>0&&(e.kinds=a),l.length>0&&(e.authors=l),c.length>0&&(e.ids=c),d&&(e.since=d),f&&(e.until=f),p&&(e.limit=p),s&&(e.search=s),u.forEach(t=>{const n=`#${t.name}`;e[n]||(e[n]=[]),e[n].push(t.value)}),e}();n(10,g=JSON.stringify(e,null,2))}255&e.$$.dirty[0]|32&e.$$.dirty[1]&&(S?(B&&clearTimeout(B),B=setTimeout(()=>{M()},1e3)):n(36,S=!0)),512&e.$$.dirty[0]|64&e.$$.dirty[1]&&n(20,i=r.filter(e=>e.kind.toString().includes(v)||e.name.toLowerCase().includes(v.toLowerCase())))},n(37,r=Object.entries(Xg).map(([e,t])=>({kind:parseInt(e),name:t})).sort((e,t)=>e.kind-t.kind)),[s,a,l,c,u,d,f,p,h,v,g,m,y,w,A,k,I,C,E,x,i,o,function(){try{const e=JSON.parse(g);n(11,m=""),n(1,a=e.kinds||[]),n(2,l=e.authors||[]),n(3,c=e.ids||[]),n(5,d=e.since||null),n(6,f=e.until||null),n(7,p=e.limit||null),n(0,s=e.search||""),n(4,u=[]),Object.keys(e).forEach(t=>{if(t.startsWith("#")&&2===t.length){const n=t.slice(1);(Array.isArray(e[t])?e[t]:[e[t]]).forEach(e=>{u.push({name:n,value:String(e)})})}}),n(4,u),B&&clearTimeout(B),M()}catch(e){n(11,m="Invalid JSON: "+e.message)}},Q,F,U,P,R,T,N,O,function(){n(0,s=""),n(1,a=[]),n(2,l=[]),n(3,c=[]),n(4,u=[]),n(5,d=null),n(6,f=null),n(7,p=null),o("clear")},function(){return d?tm(d):""},function(){return f?tm(f):""},function(e){const t=e.target.value;n(5,d=t?nm(t):null)},function(e){const t=e.target.value;n(6,f=t?nm(t):null)},S,r,function(){s=this.value,n(0,s)},()=>n(12,y=!y),function(){v=this.value,n(9,v)},e=>Q(e),e=>F(e),function(){w=this.value,n(13,w)},e=>"Enter"===e.key&&U(),e=>P(e),function(){A=this.value,n(14,A)},e=>"Enter"===e.key&&R(),e=>T(e),function(){k=this.value,n(15,k)},function(){I=this.value,n(16,I)},e=>"Enter"===e.key&&N(),e=>O(e),()=>n(5,d=null),()=>n(6,f=null),function(){p=b(this.value),n(7,p)},function(){g=this.value,n(10,g),n(8,h)},()=>o("toggleJson")]}class Bm extends ie{constructor(e){super(),re(this,e,xm,Em,o,{searchText:0,selectedKinds:1,pubkeys:2,eventIds:3,tags:4,sinceTimestamp:5,untilTimestamp:6,limit:7,showJsonEditor:8},null,[-1,-1,-1])}}function Sm(e,t,n){const r=e.slice();return r[28]=t[n],r}function Qm(e,t,n){const r=e.slice();return r[31]=t[n],r}function Fm(t){let n;return{c(){n=p("div"),n.innerHTML="

    ❌ Read, write, admin, or owner permission required to view all\n events.

    ",A(n,"class","permission-denied svelte-5kb1ec")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function Dm(e){let t,n,r,i;function o(e,t){return e[4].length>0?Um:e[6]?void 0:$m}let s=o(e),a=s&&s(e),l=e[6]&&_m();return{c(){t=p("div"),a&&a.c(),n=m(),l&&l.c(),A(t,"class","events-view-content svelte-5kb1ec")},m(o,s){u(o,t,s),a&&a.m(t,null),c(t,n),l&&l.m(t,null),r||(i=v(t,"scroll",e[9]),r=!0)},p(e,r){s===(s=o(e))&&a?a.p(e,r):(a&&a.d(1),a=s&&s(e),a&&(a.c(),a.m(t,n))),e[6]?l||(l=_m(),l.c(),l.m(t,null)):l&&(l.d(1),l=null)},d(e){e&&d(t),a&&a.d(),l&&l.d(),r=!1,i()}}}function $m(t){let n;return{c(){n=p("div"),n.innerHTML="

    No events found.

    ",A(n,"class","no-events svelte-5kb1ec")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function Um(e){let t,n=e[4],r=[];for(let t=0;t0&&Tm(e);return{c(){t=p("div"),n=p("span"),n.textContent="🗑️ Delete Event",r=m(),i&&i.c(),A(n,"class","delete-event-label svelte-5kb1ec"),A(t,"class","delete-event-info svelte-5kb1ec")},m(e,o){u(e,t,o),c(t,n),c(t,r),i&&i.m(t,null)},p(e,n){e[28].tags&&e[28].tags.length>0?i?i.p(e,n):(i=Tm(e),i.c(),i.m(t,null)):i&&(i.d(1),i=null)},d(e){e&&d(t),i&&i.d()}}}function Tm(e){let t,n=e[28].tags.filter(Ym),r=[];for(let t=0;t👤',o=m(),s=p("div"),a=p("div"),l=g(T),f=m(),h=p("div"),y=p("span"),w=g(N),b=m(),I=p("span"),C=g(O),E=m(),B=p("div"),S=p("div"),Q=g(M),F=m(),j.c(),D=m(),G&&G.c(),$=m(),V&&V.c(),U=m(),A(i,"class","events-view-avatar svelte-5kb1ec"),A(a,"class","events-view-author svelte-5kb1ec"),A(y,"class","kind-number svelte-5kb1ec"),x(y,"delete-event",5===e[28].kind),A(I,"class","kind-name svelte-5kb1ec"),A(h,"class","events-view-kind svelte-5kb1ec"),A(s,"class","events-view-info svelte-5kb1ec"),A(S,"class","event-timestamp svelte-5kb1ec"),A(B,"class","events-view-content svelte-5kb1ec"),A(n,"class","events-view-row svelte-5kb1ec"),A(n,"role","button"),A(n,"tabindex","0"),A(t,"class","events-view-item svelte-5kb1ec"),x(t,"expanded",e[5].has(e[28].id))},m(e,r){u(e,t,r),c(t,n),c(n,i),c(n,o),c(n,s),c(s,a),c(a,l),c(s,f),c(s,h),c(h,y),c(y,w),c(h,b),c(h,I),c(I,C),c(n,E),c(n,B),c(B,S),c(S,Q),c(B,F),j.m(B,null),c(n,D),G&&G.m(n,null),c(t,$),V&&V.m(t,null),c(t,U),P||(R=[v(n,"click",J),v(n,"keydown",K)],P=!0)},p(r,i){e=r,16&i[0]&&T!==(T=Km(e[28].pubkey)+"")&&k(l,T),16&i[0]&&N!==(N=e[28].kind+"")&&k(w,N),16&i[0]&&x(y,"delete-event",5===e[28].kind),16&i[0]&&O!==(O=Vm(e[28].kind)+"")&&k(C,O),16&i[0]&&M!==(M=zm(e[28].created_at)+"")&&k(Q,M),H===(H=_(e))&&j?j.p(e,i):(j.d(1),j=H(e),j&&(j.c(),j.m(B,null))),5!==e[28].kind&&("admin"===e[2]||"owner"===e[2]||"write"===e[2]&&e[28].pubkey&&e[28].pubkey===e[3])?G?G.p(e,i):(G=Om(e),G.c(),G.m(n,null)):G&&(G.d(1),G=null),48&i[0]&&(L=e[5].has(e[28].id)),L?V?V.p(e,i):(V=Mm(e),V.c(),V.m(t,U)):V&&(V.d(1),V=null),48&i[0]&&x(t,"expanded",e[5].has(e[28].id))},d(e){e&&d(t),j.d(),G&&G.d(),V&&V.d(),P=!1,r(R)}}}function _m(e){let t;return{c(){t=p("div"),t.innerHTML='
    \n

    Loading events...

    ',A(t,"class","loading-events svelte-5kb1ec")},m(e,n){u(e,t,n)},d(e){e&&d(t)}}}function Hm(e){let t,n,i,o,s,a,l,f,h,y,w,b,k,I,C,E,B,S,Q,F,D,$,U,P;function R(e,t){return e[6]?Gm:jm}i=new Bm({props:{showJsonEditor:e[8]}}),i.$on("apply",e[17]),i.$on("clear",e[18]),i.$on("toggleJson",e[16]);let T=R(e),N=T(e);return{c(){t=p("div"),n=p("div"),X(i.$$.fragment),o=m(),s=p("div"),a=p("div"),l=p("button"),l.innerHTML='',f=m(),h=p("div"),y=p("label"),w=p("input"),b=m(),k=p("span"),I=m(),C=p("span"),C.textContent="Only show my events",E=m(),B=p("div"),S=p("button"),Q=g("🔄 Load More"),F=m(),D=p("button"),N.c(),A(n,"class","filter-panel svelte-5kb1ec"),x(n,"open",e[7]),A(l,"class","filter-btn svelte-5kb1ec"),A(l,"title","Filter events"),x(l,"active",e[7]),A(w,"type","checkbox"),A(w,"class","svelte-5kb1ec"),A(k,"class","toggle-slider svelte-5kb1ec"),A(C,"class","toggle-label svelte-5kb1ec"),A(y,"class","toggle-container svelte-5kb1ec"),A(h,"class","events-view-toggle svelte-5kb1ec"),A(a,"class","events-view-left svelte-5kb1ec"),A(S,"class","refresh-btn svelte-5kb1ec"),S.disabled=e[6],A(D,"class","reload-btn svelte-5kb1ec"),D.disabled=e[6],A(B,"class","events-view-buttons svelte-5kb1ec"),A(s,"class","events-view-header svelte-5kb1ec"),A(t,"class","events-view-footer svelte-5kb1ec")},m(r,d){u(r,t,d),c(t,n),ee(i,n,null),c(t,o),c(t,s),c(s,a),c(a,l),c(a,f),c(a,h),c(h,y),c(y,w),w.checked=e[0],c(y,b),c(y,k),c(y,I),c(y,C),c(s,E),c(s,B),c(B,S),c(S,Q),c(B,F),c(B,D),N.m(D,null),$=!0,U||(P=[v(l,"click",e[15]),v(w,"change",e[23]),v(w,"change",e[24]),v(S,"click",e[25]),v(D,"click",e[26])],U=!0)},p(e,t){const r={};256&t[0]&&(r.showJsonEditor=e[8]),i.$set(r),(!$||128&t[0])&&x(n,"open",e[7]),(!$||128&t[0])&&x(l,"active",e[7]),1&t[0]&&(w.checked=e[0]),(!$||64&t[0])&&(S.disabled=e[6]),T!==(T=R(e))&&(N.d(1),N=T(e),N&&(N.c(),N.m(D,null))),(!$||64&t[0])&&(D.disabled=e[6])},i(e){$||(Y(i.$$.fragment,e),$=!0)},o(e){W(i.$$.fragment,e),$=!1},d(e){e&&d(t),te(i),N.d(),U=!1,r(P)}}}function jm(e){let t;return{c(){t=g("🔄")},m(e,n){u(e,t,n)},d(e){e&&d(t)}}}function Gm(e){let t;return{c(){t=p("div"),A(t,"class","spinner svelte-5kb1ec")},m(e,n){u(e,t,n)},d(e){e&&d(t)}}}function Jm(e){let t,n,r;function i(e,t){return!e[1]||"read"!==e[2]&&"write"!==e[2]&&"admin"!==e[2]&&"owner"!==e[2]?Fm:Dm}let o=i(e),s=o(e),a=e[1]&&("read"===e[2]||"write"===e[2]||"admin"===e[2]||"owner"===e[2])&&Hm(e);return{c(){t=p("div"),s.c(),n=m(),a&&a.c(),A(t,"class","events-view-container svelte-5kb1ec")},m(e,i){u(e,t,i),s.m(t,null),c(t,n),a&&a.m(t,null),r=!0},p(e,r){o===(o=i(e))&&s?s.p(e,r):(s.d(1),s=o(e),s&&(s.c(),s.m(t,n))),!e[1]||"read"!==e[2]&&"write"!==e[2]&&"admin"!==e[2]&&"owner"!==e[2]?a&&(z(),W(a,1,1,()=>{a=null}),q()):a?(a.p(e,r),6&r[0]&&Y(a,1)):(a=Hm(e),a.c(),Y(a,1),a.m(t,null))},i(e){r||(Y(a),r=!0)},o(e){W(a),r=!1},d(e){e&&d(t),s.d(),a&&a.d()}}}function Km(e){return e?e.slice(0,8)+"..."+e.slice(-8):""}function Vm(e){return{0:"Profile",1:"Text Note",2:"Recommend Relay",3:"Contacts",4:"Encrypted DM",5:"Delete",6:"Repost",7:"Reaction",8:"Badge Award",16:"Generic Repost",40:"Channel Creation",41:"Channel Metadata",42:"Channel Message",43:"Channel Hide Message",44:"Channel Mute User",1984:"Reporting",9734:"Zap Request",9735:"Zap",1e4:"Mute List",10001:"Pin List",10002:"Relay List",22242:"Client Auth",24133:"Nostr Connect",27235:"HTTP Auth",3e4:"Categorized People",30001:"Categorized Bookmarks",30008:"Profile Badges",30009:"Badge Definition",30017:"Create or update a stall",30018:"Create or update a product",30023:"Long-form Content",30024:"Draft Long-form Content",30078:"Application-specific Data",30311:"Live Event",30315:"User Statuses",30402:"Classified Listing",30403:"Draft Classified Listing",31922:"Date-Based Calendar Event",31923:"Time-Based Calendar Event",31924:"Calendar",31925:"Calendar Event RSVP",31989:"Handler recommendation",31990:"Handler information",34550:"Community Definition"}[e]||`Kind ${e}`}function zm(e){return new Date(1e3*e).toLocaleString()}function qm(e){return e?e.length>100?e.slice(0,100)+"...":e:""}const Ym=e=>"e"===e[0];function Wm(e,t,n){let{isLoggedIn:r=!1}=t,{userRole:i=""}=t,{userPubkey:o=""}=t,{filteredEvents:s=[]}=t,{expandedEvents:a=new Set}=t,{isLoadingEvents:l=!1}=t,{showOnlyMyEvents:c=!1}=t,{showFilterBuilder:u=!1}=t;const d=$();let f=!1;function p(e){d("toggleEventExpansion",e)}function h(e){d("deleteEvent",e)}function g(e,t){d("copyEventToClipboard",{event:e,e:t})}function m(){d("toggleChange")}function y(e,t){d("loadAllEvents",{refresh:e,authors:t})}return e.$$set=e=>{"isLoggedIn"in e&&n(1,r=e.isLoggedIn),"userRole"in e&&n(2,i=e.userRole),"userPubkey"in e&&n(3,o=e.userPubkey),"filteredEvents"in e&&n(4,s=e.filteredEvents),"expandedEvents"in e&&n(5,a=e.expandedEvents),"isLoadingEvents"in e&&n(6,l=e.isLoadingEvents),"showOnlyMyEvents"in e&&n(0,c=e.showOnlyMyEvents),"showFilterBuilder"in e&&n(7,u=e.showFilterBuilder)},[c,r,i,o,s,a,l,u,f,function(e){d("scroll",e)},p,h,g,m,y,function(){d("toggleFilterBuilder")},function(){n(8,f=!f)},function(e){d("filterApply",e.detail)},function(){d("filterClear")},e=>h(e.id),e=>p(e.id),(e,t)=>"Enter"===t.key&&p(e.id),(e,t)=>g(e,t),function(){c=this.checked,n(0,c)},()=>m(),()=>{y(!1,c&&o?[o]:null)},()=>{y(!0,c&&o?[o]:null)}]}class Zm extends ie{constructor(e){super(),re(this,e,Wm,Jm,o,{isLoggedIn:1,userRole:2,userPubkey:3,filteredEvents:4,expandedEvents:5,isLoadingEvents:6,showOnlyMyEvents:0,showFilterBuilder:7},null,[-1,-1])}}const Xm=[{kind:0,name:"Metadata",description:"User profile information (name, about, picture, nip05, etc.)",nip:"01",isReplaceable:!0,template:{kind:0,content:"",tags:[]}},{kind:1,name:"Short Text Note",description:"Short-form text post (like a tweet)",nip:"01",template:{kind:1,content:"",tags:[]}},{kind:2,name:"Recommend Relay",description:"Relay recommendation",nip:"01",deprecated:!0,template:{kind:2,content:"",tags:[]}},{kind:3,name:"Follows",description:"Following list with optional relay hints",nip:"02",isReplaceable:!0,template:{kind:3,content:"",tags:[]}},{kind:4,name:"Encrypted Direct Message",description:"Private message using NIP-04 encryption",nip:"04",deprecated:!0,template:{kind:4,content:"",tags:[]}},{kind:5,name:"Event Deletion Request",description:"Request to delete events",nip:"09",template:{kind:5,content:"",tags:[]}},{kind:6,name:"Repost",description:"Share/repost another text note",nip:"18",template:{kind:6,content:"",tags:[]}},{kind:7,name:"Reaction",description:"Like, emoji reaction to an event",nip:"25",template:{kind:7,content:"",tags:[]}},{kind:8,name:"Badge Award",description:"Award a badge to someone",nip:"58",template:{kind:8,content:"",tags:[]}},{kind:9,name:"Chat Message",description:"Chat message",nip:"C7",template:{kind:9,content:"",tags:[]}},{kind:10,name:"Group Chat Threaded Reply",description:"Threaded reply in group chat",nip:"29",deprecated:!0,template:{kind:10,content:"",tags:[]}},{kind:11,name:"Thread",description:"Thread event",nip:"7D",template:{kind:11,content:"",tags:[]}},{kind:12,name:"Group Thread Reply",description:"Reply in group thread",nip:"29",deprecated:!0,template:{kind:12,content:"",tags:[]}},{kind:13,name:"Seal",description:"Sealed/encrypted event wrapper",nip:"59",template:{kind:13,content:"",tags:[]}},{kind:14,name:"Direct Message",description:"Private direct message using NIP-17",nip:"17",template:{kind:14,content:"",tags:[]}},{kind:15,name:"File Message",description:"File message in DMs",nip:"17",template:{kind:15,content:"",tags:[]}},{kind:16,name:"Generic Repost",description:"Repost any event kind",nip:"18",template:{kind:16,content:"",tags:[]}},{kind:17,name:"Reaction to Website",description:"Reaction to a website URL",nip:"25",template:{kind:17,content:"",tags:[]}},{kind:20,name:"Picture",description:"Picture-first feed post",nip:"68",template:{kind:20,content:"",tags:[]}},{kind:21,name:"Video Event",description:"Horizontal video event",nip:"71",template:{kind:21,content:"",tags:[]}},{kind:22,name:"Short-form Video",description:"Short-form portrait video (like TikTok)",nip:"71",template:{kind:22,content:"",tags:[]}},{kind:40,name:"Channel Creation",description:"Create a public chat channel",nip:"28",template:{kind:40,content:"",tags:[]}},{kind:41,name:"Channel Metadata",description:"Set channel name, about, picture",nip:"28",template:{kind:41,content:"",tags:[]}},{kind:42,name:"Channel Message",description:"Post message in channel",nip:"28",template:{kind:42,content:"",tags:[]}},{kind:43,name:"Channel Hide Message",description:"Hide a message in channel",nip:"28",template:{kind:43,content:"",tags:[]}},{kind:44,name:"Channel Mute User",description:"Mute a user in channel",nip:"28",template:{kind:44,content:"",tags:[]}},{kind:62,name:"Request to Vanish",description:"Request permanent deletion of all user data",nip:"62",template:{kind:62,content:"",tags:[]}},{kind:64,name:"Chess (PGN)",description:"Chess game in PGN format",nip:"64",template:{kind:64,content:"",tags:[]}},{kind:443,name:"KeyPackage",description:"Marmot protocol key package",nip:null,spec:"Marmot",template:{kind:443,content:"",tags:[]}},{kind:444,name:"Welcome Message",description:"Marmot protocol welcome message",nip:null,spec:"Marmot",template:{kind:444,content:"",tags:[]}},{kind:445,name:"Group Event",description:"Marmot protocol group event",nip:null,spec:"Marmot",template:{kind:445,content:"",tags:[]}},{kind:818,name:"Merge Requests",description:"Git merge request",nip:"54",template:{kind:818,content:"",tags:[]}},{kind:1018,name:"Poll Response",description:"Response to a poll",nip:"88",template:{kind:1018,content:"",tags:[]}},{kind:1021,name:"Bid",description:"Auction bid",nip:"15",template:{kind:1021,content:"",tags:[]}},{kind:1022,name:"Bid Confirmation",description:"Confirmation of auction bid",nip:"15",template:{kind:1022,content:"",tags:[]}},{kind:1040,name:"OpenTimestamps",description:"OpenTimestamps attestation",nip:"03",template:{kind:1040,content:"",tags:[]}},{kind:1059,name:"Gift Wrap",description:"Encrypted gift-wrapped event",nip:"59",template:{kind:1059,content:"",tags:[]}},{kind:1060,name:"Gift Wrap (Kind 4)",description:"Gift wrap variant for NIP-04 compatibility",nip:"59",template:{kind:1060,content:"",tags:[]}},{kind:1063,name:"File Metadata",description:"Metadata for shared files",nip:"94",template:{kind:1063,content:"",tags:[]}},{kind:1068,name:"Poll",description:"Create a poll",nip:"88",template:{kind:1068,content:"",tags:[]}},{kind:1111,name:"Comment",description:"Comment on events or external content",nip:"22",template:{kind:1111,content:"",tags:[]}},{kind:1222,name:"Voice Message",description:"Voice message",nip:"A0",template:{kind:1222,content:"",tags:[]}},{kind:1244,name:"Voice Message Comment",description:"Comment on voice message",nip:"A0",template:{kind:1244,content:"",tags:[]}},{kind:1311,name:"Live Chat Message",description:"Message in live stream chat",nip:"53",template:{kind:1311,content:"",tags:[]}},{kind:1337,name:"Code Snippet",description:"Code snippet post",nip:"C0",template:{kind:1337,content:"",tags:[]}},{kind:1517,name:"Bitcoin Block",description:"Bitcoin block data",nip:null,spec:"Nostrocket",template:{kind:1517,content:"",tags:[]}},{kind:1617,name:"Patches",description:"Git patches",nip:"34",template:{kind:1617,content:"",tags:[]}},{kind:1618,name:"Pull Requests",description:"Git pull request",nip:"34",template:{kind:1618,content:"",tags:[]}},{kind:1619,name:"Pull Request Updates",description:"Updates to git pull request",nip:"34",template:{kind:1619,content:"",tags:[]}},{kind:1621,name:"Issues",description:"Git issues",nip:"34",template:{kind:1621,content:"",tags:[]}},{kind:1622,name:"Git Replies",description:"Replies on git objects",nip:"34",deprecated:!0,template:{kind:1622,content:"",tags:[]}},{kind:1630,name:"Status",description:"Git status",nip:"34",template:{kind:1630,content:"",tags:[]}},{kind:1631,name:"Status",description:"Git status",nip:"34",template:{kind:1631,content:"",tags:[]}},{kind:1632,name:"Status",description:"Git status",nip:"34",template:{kind:1632,content:"",tags:[]}},{kind:1633,name:"Status",description:"Git status",nip:"34",template:{kind:1633,content:"",tags:[]}},{kind:1808,name:"Live Stream",description:"Live streaming event",nip:null,spec:"zap.stream",template:{kind:1808,content:"",tags:[]}},{kind:1971,name:"Problem Tracker",description:"Problem tracking",nip:null,spec:"Nostrocket",template:{kind:1971,content:"",tags:[]}},{kind:1984,name:"Reporting",description:"Report content or users",nip:"56",template:{kind:1984,content:"",tags:[]}},{kind:1985,name:"Label",description:"Label/tag content with namespace",nip:"32",template:{kind:1985,content:"",tags:[]}},{kind:1986,name:"Relay Reviews",description:"Reviews of relays",nip:null,template:{kind:1986,content:"",tags:[]}},{kind:1987,name:"AI Embeddings",description:"AI embeddings/vector lists",nip:null,spec:"NKBIP-02",template:{kind:1987,content:"",tags:[]}},{kind:2003,name:"Torrent",description:"Torrent magnet link",nip:"35",template:{kind:2003,content:"",tags:[]}},{kind:2004,name:"Torrent Comment",description:"Comment on torrent",nip:"35",template:{kind:2004,content:"",tags:[]}},{kind:2022,name:"Coinjoin Pool",description:"Coinjoin coordination",nip:null,spec:"joinstr",template:{kind:2022,content:"",tags:[]}},{kind:4550,name:"Community Post Approval",description:"Approve post in community",nip:"72",template:{kind:4550,content:"",tags:[]}},{kind:5e3,name:"Job Request",description:"Data vending machine job request (start of range)",nip:"90",template:{kind:5e3,content:"",tags:[]}},{kind:6e3,name:"Job Result",description:"Data vending machine job result (start of range)",nip:"90",template:{kind:6e3,content:"",tags:[]}},{kind:7e3,name:"Job Feedback",description:"Feedback on job request/result",nip:"90",template:{kind:7e3,content:"",tags:[]}},{kind:7374,name:"Reserved Cashu Wallet Tokens",description:"Reserved Cashu wallet tokens",nip:"60",template:{kind:7374,content:"",tags:[]}},{kind:7375,name:"Cashu Wallet Tokens",description:"Cashu wallet tokens",nip:"60",template:{kind:7375,content:"",tags:[]}},{kind:7376,name:"Cashu Wallet History",description:"Cashu wallet transaction history",nip:"60",template:{kind:7376,content:"",tags:[]}},{kind:7516,name:"Geocache Log",description:"Geocaching log entry",nip:null,spec:"geocaching",template:{kind:7516,content:"",tags:[]}},{kind:7517,name:"Geocache Proof of Find",description:"Proof of geocache find",nip:null,spec:"geocaching",template:{kind:7517,content:"",tags:[]}},{kind:8e3,name:"Add User",description:"Add user to group",nip:"43",template:{kind:8e3,content:"",tags:[]}},{kind:8001,name:"Remove User",description:"Remove user from group",nip:"43",template:{kind:8001,content:"",tags:[]}},{kind:9e3,name:"Group Control Events",description:"Group control events (start of range)",nip:"29",template:{kind:9e3,content:"",tags:[]}},{kind:9041,name:"Zap Goal",description:"Fundraising goal for zaps",nip:"75",template:{kind:9041,content:"",tags:[]}},{kind:9321,name:"Nutzap",description:"Cashu nutzap",nip:"61",template:{kind:9321,content:"",tags:[]}},{kind:9467,name:"Tidal Login",description:"Tidal streaming login",nip:null,spec:"Tidal-nostr",template:{kind:9467,content:"",tags:[]}},{kind:9734,name:"Zap Request",description:"Request Lightning payment",nip:"57",template:{kind:9734,content:"",tags:[]}},{kind:9735,name:"Zap",description:"Lightning payment receipt",nip:"57",template:{kind:9735,content:"",tags:[]}},{kind:9802,name:"Highlights",description:"Highlighted text selection",nip:"84",template:{kind:9802,content:"",tags:[]}},{kind:1e4,name:"Mute List",description:"List of muted users/content",nip:"51",isReplaceable:!0,template:{kind:1e4,content:"",tags:[]}},{kind:10001,name:"Pin List",description:"Pinned events",nip:"51",isReplaceable:!0,template:{kind:10001,content:"",tags:[]}},{kind:10002,name:"Relay List Metadata",description:"User's preferred relays for read/write",nip:"65",isReplaceable:!0,template:{kind:10002,content:"",tags:[]}},{kind:10003,name:"Bookmark List",description:"Bookmarked events",nip:"51",isReplaceable:!0,template:{kind:10003,content:"",tags:[]}},{kind:10004,name:"Communities List",description:"Communities user belongs to",nip:"51",isReplaceable:!0,template:{kind:10004,content:"",tags:[]}},{kind:10005,name:"Public Chats List",description:"Public chats user is in",nip:"51",isReplaceable:!0,template:{kind:10005,content:"",tags:[]}},{kind:10006,name:"Blocked Relays List",description:"Relays user has blocked",nip:"51",isReplaceable:!0,template:{kind:10006,content:"",tags:[]}},{kind:10007,name:"Search Relays List",description:"Preferred search relays",nip:"51",isReplaceable:!0,template:{kind:10007,content:"",tags:[]}},{kind:10008,name:"Relay Group Configuration",description:"Relay group configuration",nip:null,isReplaceable:!0,template:{kind:10008,content:"",tags:[]}},{kind:10009,name:"User Groups",description:"Groups user belongs to",nip:"29",isReplaceable:!0,template:{kind:10009,content:"",tags:[]}},{kind:10012,name:"Favorite Relays List",description:"User's favorite relays",nip:"51",isReplaceable:!0,template:{kind:10012,content:"",tags:[]}},{kind:10013,name:"Private Event Relay List",description:"Relays for private events",nip:"37",isReplaceable:!0,template:{kind:10013,content:"",tags:[]}},{kind:10015,name:"Interests List",description:"User interests/topics",nip:"51",isReplaceable:!0,template:{kind:10015,content:"",tags:[]}},{kind:10019,name:"Nutzap Mint Recommendation",description:"Recommended Cashu mints for nutzaps",nip:"61",isReplaceable:!0,template:{kind:10019,content:"",tags:[]}},{kind:10020,name:"Media Follows",description:"Followed media accounts",nip:"51",isReplaceable:!0,template:{kind:10020,content:"",tags:[]}},{kind:10030,name:"User Emoji List",description:"Custom emoji list",nip:"51",isReplaceable:!0,template:{kind:10030,content:"",tags:[]}},{kind:10050,name:"DM Relays List",description:"Relays to receive DMs on",nip:"17",isReplaceable:!0,template:{kind:10050,content:"",tags:[]}},{kind:10051,name:"KeyPackage Relays List",description:"Marmot key package relays",nip:null,isReplaceable:!0,spec:"Marmot",template:{kind:10051,content:"",tags:[]}},{kind:10063,name:"User Server List",description:"Blossom server list",nip:null,isReplaceable:!0,spec:"Blossom",template:{kind:10063,content:"",tags:[]}},{kind:10096,name:"File Storage Server List",description:"File storage servers",nip:"96",isReplaceable:!0,deprecated:!0,template:{kind:10096,content:"",tags:[]}},{kind:10166,name:"Relay Monitor Announcement",description:"Relay monitoring announcement",nip:"66",isReplaceable:!0,template:{kind:10166,content:"",tags:[]}},{kind:10312,name:"Room Presence",description:"Presence in live room",nip:"53",isReplaceable:!0,template:{kind:10312,content:"",tags:[]}},{kind:10377,name:"Proxy Announcement",description:"Nostr proxy announcement",nip:null,isReplaceable:!0,spec:"Nostr Epoxy",template:{kind:10377,content:"",tags:[]}},{kind:11111,name:"Transport Method Announcement",description:"Transport method announcement",nip:null,isReplaceable:!0,spec:"Nostr Epoxy",template:{kind:11111,content:"",tags:[]}},{kind:12345,name:"Relay Policy Configuration",description:"Relay-internal policy configuration (admin only)",nip:null,isReplaceable:!0,spec:"orly",template:{kind:12345,content:"",tags:[]}},{kind:13004,name:"JWT Binding",description:"Link between JWT certificate and pubkey",nip:null,isReplaceable:!0,template:{kind:13004,content:"",tags:[]}},{kind:13194,name:"Wallet Service Info",description:"NWC wallet service information",nip:"47",isReplaceable:!0,template:{kind:13194,content:"",tags:[]}},{kind:13534,name:"Membership Lists",description:"Group membership lists",nip:"43",isReplaceable:!0,template:{kind:13534,content:"",tags:[]}},{kind:14388,name:"User Sound Effect Lists",description:"Sound effect lists",nip:null,isReplaceable:!0,spec:"Corny Chat",template:{kind:14388,content:"",tags:[]}},{kind:17375,name:"Cashu Wallet Event",description:"Cashu wallet event",nip:"60",isReplaceable:!0,template:{kind:17375,content:"",tags:[]}},{kind:21e3,name:"Lightning Pub RPC",description:"Lightning.Pub RPC",nip:null,isEphemeral:!0,spec:"Lightning.Pub",template:{kind:21e3,content:"",tags:[]}},{kind:22242,name:"Client Authentication",description:"Authenticate to relay",nip:"42",isEphemeral:!0,template:{kind:22242,content:"",tags:[]}},{kind:23194,name:"Wallet Request",description:"NWC wallet request",nip:"47",isEphemeral:!0,template:{kind:23194,content:"",tags:[]}},{kind:23195,name:"Wallet Response",description:"NWC wallet response",nip:"47",isEphemeral:!0,template:{kind:23195,content:"",tags:[]}},{kind:23196,name:"Wallet Notification (NIP-04)",description:"NWC wallet notification (NIP-04 encrypted)",nip:"47",isEphemeral:!0,template:{kind:23196,content:"",tags:[]}},{kind:23197,name:"Wallet Notification",description:"NWC wallet notification",nip:"47",isEphemeral:!0,template:{kind:23197,content:"",tags:[]}},{kind:24133,name:"Nostr Connect",description:"Remote signer connection",nip:"46",isEphemeral:!0,template:{kind:24133,content:"",tags:[]}},{kind:24242,name:"Blobs Stored on Mediaservers",description:"Blossom blob storage",nip:null,isEphemeral:!0,spec:"Blossom",template:{kind:24242,content:"",tags:[]}},{kind:27235,name:"HTTP Auth",description:"Authenticate HTTP requests",nip:"98",isEphemeral:!0,template:{kind:27235,content:"",tags:[]}},{kind:28934,name:"Join Request",description:"Request to join group",nip:"43",isEphemeral:!0,template:{kind:28934,content:"",tags:[]}},{kind:28935,name:"Invite Request",description:"Invite to group",nip:"43",isEphemeral:!0,template:{kind:28935,content:"",tags:[]}},{kind:28936,name:"Leave Request",description:"Leave group request",nip:"43",isEphemeral:!0,template:{kind:28936,content:"",tags:[]}},{kind:3e4,name:"Follow Sets",description:"Categorized people lists",nip:"51",isAddressable:!0,template:{kind:3e4,content:"",tags:[["d","identifier"]]}},{kind:30001,name:"Generic Lists",description:"Generic categorized lists",nip:"51",isAddressable:!0,deprecated:!0,template:{kind:30001,content:"",tags:[["d","identifier"]]}},{kind:30002,name:"Relay Sets",description:"Categorized relay lists",nip:"51",isAddressable:!0,template:{kind:30002,content:"",tags:[["d","identifier"]]}},{kind:30003,name:"Bookmark Sets",description:"Categorized bookmark lists",nip:"51",isAddressable:!0,template:{kind:30003,content:"",tags:[["d","identifier"]]}},{kind:30004,name:"Curation Sets",description:"Curated content sets",nip:"51",isAddressable:!0,template:{kind:30004,content:"",tags:[["d","identifier"]]}},{kind:30005,name:"Video Sets",description:"Video playlists",nip:"51",isAddressable:!0,template:{kind:30005,content:"",tags:[["d","identifier"]]}},{kind:30007,name:"Kind Mute Sets",description:"Muted event kinds",nip:"51",isAddressable:!0,template:{kind:30007,content:"",tags:[["d","identifier"]]}},{kind:30008,name:"Profile Badges",description:"Badges displayed on profile",nip:"58",isAddressable:!0,template:{kind:30008,content:"",tags:[["d","identifier"]]}},{kind:30009,name:"Badge Definition",description:"Define a badge/achievement",nip:"58",isAddressable:!0,template:{kind:30009,content:"",tags:[["d","identifier"]]}},{kind:30015,name:"Interest Sets",description:"Interest/topic sets",nip:"51",isAddressable:!0,template:{kind:30015,content:"",tags:[["d","identifier"]]}},{kind:30017,name:"Stall",description:"Marketplace stall definition",nip:"15",isAddressable:!0,template:{kind:30017,content:"",tags:[["d","identifier"]]}},{kind:30018,name:"Product",description:"Marketplace product listing",nip:"15",isAddressable:!0,template:{kind:30018,content:"",tags:[["d","identifier"]]}},{kind:30019,name:"Marketplace UI/UX",description:"Marketplace interface settings",nip:"15",isAddressable:!0,template:{kind:30019,content:"",tags:[["d","identifier"]]}},{kind:30020,name:"Product Sold as Auction",description:"Auction product listing",nip:"15",isAddressable:!0,template:{kind:30020,content:"",tags:[["d","identifier"]]}},{kind:30023,name:"Long-form Content",description:"Blog post, article in markdown",nip:"23",isAddressable:!0,template:{kind:30023,content:"",tags:[["d","identifier"]]}},{kind:30024,name:"Draft Long-form Content",description:"Draft article",nip:"23",isAddressable:!0,template:{kind:30024,content:"",tags:[["d","identifier"]]}},{kind:30030,name:"Emoji Sets",description:"Custom emoji sets",nip:"51",isAddressable:!0,template:{kind:30030,content:"",tags:[["d","identifier"]]}},{kind:30040,name:"Curated Publication Index",description:"Publication index",nip:null,isAddressable:!0,spec:"NKBIP-01",template:{kind:30040,content:"",tags:[["d","identifier"]]}},{kind:30041,name:"Curated Publication Content",description:"Publication content",nip:null,isAddressable:!0,spec:"NKBIP-01",template:{kind:30041,content:"",tags:[["d","identifier"]]}},{kind:30063,name:"Release Artifact Sets",description:"Software release artifacts",nip:"51",isAddressable:!0,template:{kind:30063,content:"",tags:[["d","identifier"]]}},{kind:30078,name:"Application-specific Data",description:"App-specific key-value storage",nip:"78",isAddressable:!0,template:{kind:30078,content:"",tags:[["d","identifier"]]}},{kind:30166,name:"Relay Discovery",description:"Relay discovery/monitoring",nip:"66",isAddressable:!0,template:{kind:30166,content:"",tags:[["d","identifier"]]}},{kind:30267,name:"App Curation Sets",description:"Curated app sets",nip:"51",isAddressable:!0,template:{kind:30267,content:"",tags:[["d","identifier"]]}},{kind:30311,name:"Live Event",description:"Live streaming event",nip:"53",isAddressable:!0,template:{kind:30311,content:"",tags:[["d","identifier"]]}},{kind:30312,name:"Interactive Room",description:"Interactive live room",nip:"53",isAddressable:!0,template:{kind:30312,content:"",tags:[["d","identifier"]]}},{kind:30313,name:"Conference Event",description:"Conference/meetup event",nip:"53",isAddressable:!0,template:{kind:30313,content:"",tags:[["d","identifier"]]}},{kind:30315,name:"User Statuses",description:"User status updates",nip:"38",isAddressable:!0,template:{kind:30315,content:"",tags:[["d","identifier"]]}},{kind:30388,name:"Slide Set",description:"Presentation slides",nip:null,isAddressable:!0,spec:"Corny Chat",template:{kind:30388,content:"",tags:[["d","identifier"]]}},{kind:30402,name:"Classified Listing",description:"Classified ad listing",nip:"99",isAddressable:!0,template:{kind:30402,content:"",tags:[["d","identifier"]]}},{kind:30403,name:"Draft Classified Listing",description:"Draft classified ad",nip:"99",isAddressable:!0,template:{kind:30403,content:"",tags:[["d","identifier"]]}},{kind:30617,name:"Repository Announcements",description:"Git repository announcement",nip:"34",isAddressable:!0,template:{kind:30617,content:"",tags:[["d","identifier"]]}},{kind:30618,name:"Repository State Announcements",description:"Git repository state",nip:"34",isAddressable:!0,template:{kind:30618,content:"",tags:[["d","identifier"]]}},{kind:30818,name:"Wiki Article",description:"Wiki article",nip:"54",isAddressable:!0,template:{kind:30818,content:"",tags:[["d","identifier"]]}},{kind:30819,name:"Redirects",description:"URL redirects",nip:"54",isAddressable:!0,template:{kind:30819,content:"",tags:[["d","identifier"]]}},{kind:31234,name:"Draft Event",description:"Draft of any event",nip:"37",isAddressable:!0,template:{kind:31234,content:"",tags:[["d","identifier"]]}},{kind:31388,name:"Link Set",description:"Link collection",nip:null,isAddressable:!0,spec:"Corny Chat",template:{kind:31388,content:"",tags:[["d","identifier"]]}},{kind:31890,name:"Feed",description:"Custom feed definition",nip:null,isAddressable:!0,spec:"NUD: Custom Feeds",template:{kind:31890,content:"",tags:[["d","identifier"]]}},{kind:31922,name:"Date-Based Calendar Event",description:"All-day calendar event",nip:"52",isAddressable:!0,template:{kind:31922,content:"",tags:[["d","identifier"]]}},{kind:31923,name:"Time-Based Calendar Event",description:"Calendar event with time",nip:"52",isAddressable:!0,template:{kind:31923,content:"",tags:[["d","identifier"]]}},{kind:31924,name:"Calendar",description:"Calendar definition",nip:"52",isAddressable:!0,template:{kind:31924,content:"",tags:[["d","identifier"]]}},{kind:31925,name:"Calendar Event RSVP",description:"RSVP to calendar event",nip:"52",isAddressable:!0,template:{kind:31925,content:"",tags:[["d","identifier"]]}},{kind:31989,name:"Handler Recommendation",description:"Recommended app for event kind",nip:"89",isAddressable:!0,template:{kind:31989,content:"",tags:[["d","identifier"]]}},{kind:31990,name:"Handler Information",description:"App handler declaration",nip:"89",isAddressable:!0,template:{kind:31990,content:"",tags:[["d","identifier"]]}},{kind:32123,name:"WaveLake Track",description:"WaveLake music track",nip:null,isAddressable:!0,spec:"WaveLake",template:{kind:32123,content:"",tags:[["d","identifier"]]}},{kind:32267,name:"Software Application",description:"Software application listing",nip:null,isAddressable:!0,template:{kind:32267,content:"",tags:[["d","identifier"]]}},{kind:32388,name:"User Room Favorites",description:"Favorite rooms",nip:null,isAddressable:!0,spec:"Corny Chat",template:{kind:32388,content:"",tags:[["d","identifier"]]}},{kind:33388,name:"High Scores",description:"Game high scores",nip:null,isAddressable:!0,spec:"Corny Chat",template:{kind:33388,content:"",tags:[["d","identifier"]]}},{kind:34235,name:"Video Event Horizontal",description:"Horizontal video event",nip:"71",isAddressable:!0,template:{kind:34235,content:"",tags:[["d","identifier"]]}},{kind:34236,name:"Video Event Vertical",description:"Vertical video event",nip:"71",isAddressable:!0,template:{kind:34236,content:"",tags:[["d","identifier"]]}},{kind:34388,name:"Sound Effects",description:"Sound effect definitions",nip:null,isAddressable:!0,spec:"Corny Chat",template:{kind:34388,content:"",tags:[["d","identifier"]]}},{kind:34550,name:"Community Definition",description:"Define a community",nip:"72",isAddressable:!0,template:{kind:34550,content:"",tags:[["d","identifier"]]}},{kind:37516,name:"Geocache Listing",description:"Geocache location listing",nip:null,isAddressable:!0,spec:"geocaching",template:{kind:37516,content:"",tags:[["d","identifier"]]}},{kind:38172,name:"Cashu Mint Announcement",description:"Cashu mint announcement",nip:"87",isAddressable:!0,template:{kind:38172,content:"",tags:[["d","identifier"]]}},{kind:38173,name:"Fedimint Announcement",description:"Fedimint announcement",nip:"87",isAddressable:!0,template:{kind:38173,content:"",tags:[["d","identifier"]]}},{kind:38383,name:"Peer-to-peer Order Events",description:"P2P trading orders",nip:"69",isAddressable:!0,template:{kind:38383,content:"",tags:[["d","identifier"]]}},{kind:39e3,name:"Group Metadata Events",description:"Group metadata (start of range)",nip:"29",isAddressable:!0,template:{kind:39e3,content:"",tags:[["d","identifier"]]}},{kind:39089,name:"Starter Packs",description:"Starter pack lists",nip:"51",isAddressable:!0,template:{kind:39089,content:"",tags:[["d","identifier"]]}},{kind:39092,name:"Media Starter Packs",description:"Media starter packs",nip:"51",isAddressable:!0,template:{kind:39092,content:"",tags:[["d","identifier"]]}},{kind:39701,name:"Web Bookmarks",description:"Web URL bookmarks",nip:"B0",isAddressable:!0,template:{kind:39701,content:"",tags:[["d","identifier"]]}},{kind:39998,name:"ACL Event",description:"Access control list event",nip:null,isAddressable:!0,template:{kind:39998,content:"",tags:[["d","identifier"]]}}];function ey(e,t=null){const n=function(e){return Xm.find(t=>t.kind===e)}(e);return n?{...n.template,created_at:Math.floor(Date.now()/1e3),pubkey:t||""}:{kind:e,content:"",tags:[],created_at:Math.floor(Date.now()/1e3),pubkey:t||""}}const ty=[{id:"all",name:"All Kinds",filter:()=>!0},{id:"regular",name:"Regular Events (0-9999)",filter:e=>e.kind<1e4&&!e.isReplaceable},{id:"replaceable",name:"Replaceable (10000-19999)",filter:e=>e.isReplaceable},{id:"ephemeral",name:"Ephemeral (20000-29999)",filter:e=>e.isEphemeral},{id:"addressable",name:"Addressable (30000-39999)",filter:e=>e.isAddressable},{id:"social",name:"Social",filter:e=>[0,1,3,6,7].includes(e.kind)},{id:"messaging",name:"Messaging",filter:e=>[4,9,10,11,12,14,15,40,41,42].includes(e.kind)},{id:"lists",name:"Lists",filter:e=>e.name.toLowerCase().includes("list")||e.name.toLowerCase().includes("set")},{id:"marketplace",name:"Marketplace",filter:e=>[30017,30018,30019,30020,1021,1022,30402,30403].includes(e.kind)},{id:"lightning",name:"Lightning/Zaps",filter:e=>[9734,9735,9041,9321,7374,7375,7376].includes(e.kind)},{id:"media",name:"Media",filter:e=>[20,21,22,1063,1222,1244].includes(e.kind)},{id:"git",name:"Git/Code",filter:e=>[818,1337,1617,1618,1619,1621,1622,30617,30618].includes(e.kind)},{id:"calendar",name:"Calendar",filter:e=>[31922,31923,31924,31925].includes(e.kind)},{id:"groups",name:"Groups",filter:e=>e.kind>=9e3&&e.kind<=9030||e.kind>=39e3&&e.kind<=39009}];function ny(e,t,n){const r=e.slice();return r[13]=t[n],r}function ry(e,t,n){const r=e.slice();return r[16]=t[n],r}function iy(e){let t,n,i,o,s,a,l,h,y,w,b,C,E,x,B,S,Q,F,D,$,U,P,R,T,N,O=e[3].length+"",M=1!==e[3].length?"s":"",L=ty,_=[];for(let t=0;t=2e4&&e.kind<3e4?"badge-ephemeral":"badge-regular"}function fy(e){return e.isAddressable?"Addressable":e.isReplaceable?"Replaceable":e.kind>=2e4&&e.kind<3e4?"Ephemeral":"Regular"}function py(e,t,n){let{isOpen:r=!1}=t,{userPubkey:i=""}=t;const o=$();let s="",a="all",l=Xm;function c(e){const t=ey(e.kind,i);o("select",{kind:e,template:t}),u()}function u(){n(0,r=!1),n(1,s=""),n(2,a="all"),o("close")}return e.$$set=e=>{"isOpen"in e&&n(0,r=e.isOpen),"userPubkey"in e&&n(8,i=e.userPubkey)},e.$$.update=()=>{if(6&e.$$.dirty){let e=Xm;const t=ty.find(e=>e.id===a);if(t&&(e=e.filter(t.filter)),s.trim()){const t=s.toLowerCase();e=e.filter(e=>e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t)||e.kind.toString().includes(t)||e.nip&&e.nip.includes(t))}n(3,l=e)}},[r,s,a,l,c,u,function(e){"Escape"===e.key&&u()},function(e){e.target===e.currentTarget&&u()},i,function(){s=this.value,n(1,s)},e=>n(2,a=e.id),e=>c(e)]}class hy extends ie{constructor(e){super(),re(this,e,py,uy,o,{isOpen:0,userPubkey:8})}}function gy(e){let t,n,r,i,o,s,a,l,f,h;return{c(){t=p("div"),n=p("div"),r=p("span"),r.textContent="⚠",i=m(),o=p("span"),s=g(e[1]),a=m(),l=p("button"),l.textContent="×",A(r,"class","error-icon svelte-46pmgb"),A(o,"class","error-message svelte-46pmgb"),A(n,"class","error-content svelte-46pmgb"),A(l,"class","error-dismiss svelte-46pmgb"),A(t,"class","error-banner svelte-46pmgb")},m(d,p){u(d,t,p),c(t,n),c(n,r),c(n,i),c(n,o),c(o,s),c(t,a),c(t,l),f||(h=v(l,"click",e[10]),f=!0)},p(e,t){2&t&&k(s,e[1])},d(e){e&&d(t),f=!1,h()}}}function my(e){let t,n,i,o,s,a,l,f,h,g,y,w,b,k,C,E,x,B,S,Q=e[1]&&gy(e);function F(t){e[14](t)}let D={userPubkey:e[2]};return void 0!==e[3]&&(D.isOpen=e[3]),C=new hy({props:D}),R.push(()=>Z(C,"isOpen",F)),C.$on("select",e[8]),C.$on("close",e[9]),{c(){t=p("div"),n=p("div"),i=p("button"),i.textContent="Generate Template",o=m(),s=p("button"),s.textContent="Reformat",a=m(),l=p("button"),l.textContent="Sign",f=m(),h=p("button"),h.textContent="Publish",g=m(),Q&&Q.c(),y=m(),w=p("div"),b=p("textarea"),k=m(),X(C.$$.fragment),A(i,"class","compose-btn template-btn svelte-46pmgb"),A(s,"class","compose-btn reformat-btn svelte-46pmgb"),A(l,"class","compose-btn sign-btn svelte-46pmgb"),A(h,"class","compose-btn publish-btn svelte-46pmgb"),A(n,"class","compose-header svelte-46pmgb"),A(b,"class","compose-textarea svelte-46pmgb"),A(b,"placeholder","Enter your Nostr event JSON here, or click 'Generate Template' to start with a template..."),A(b,"spellcheck","false"),A(w,"class","compose-editor svelte-46pmgb"),A(t,"class","compose-view svelte-46pmgb")},m(r,d){u(r,t,d),c(t,n),c(n,i),c(n,o),c(n,s),c(n,a),c(n,l),c(n,f),c(n,h),c(t,g),Q&&Q.m(t,null),c(t,y),c(t,w),c(w,b),I(b,e[0]),u(r,k,d),ee(C,r,d),x=!0,B||(S=[v(i,"click",e[7]),v(s,"click",e[4]),v(l,"click",e[5]),v(h,"click",e[6]),v(b,"input",e[13])],B=!0)},p(e,[n]){e[1]?Q?Q.p(e,n):(Q=gy(e),Q.c(),Q.m(t,y)):Q&&(Q.d(1),Q=null),1&n&&I(b,e[0]);const r={};4&n&&(r.userPubkey=e[2]),!E&&8&n&&(E=!0,r.isOpen=e[3],_(()=>E=!1)),C.$set(r)},i(e){x||(Y(C.$$.fragment,e),x=!0)},o(e){W(C.$$.fragment,e),x=!1},d(e){e&&d(t),Q&&Q.d(),e&&d(k),te(C,e),B=!1,r(S)}}}function yy(e,t,n){let{composeEventJson:r=""}=t,{userPubkey:i=""}=t,{userRole:o=""}=t,{policyEnabled:s=!1}=t,{publishError:a=""}=t;const l=$();let c=!1;return e.$$set=e=>{"composeEventJson"in e&&n(0,r=e.composeEventJson),"userPubkey"in e&&n(2,i=e.userPubkey),"userRole"in e&&n(11,o=e.userRole),"policyEnabled"in e&&n(12,s=e.policyEnabled),"publishError"in e&&n(1,a=e.publishError)},[r,a,i,c,function(){l("reformatJson")},function(){l("signEvent")},function(){l("publishEvent")},function(){n(3,c=!0)},function(e){const{kind:t,template:i}=e.detail;n(0,r=JSON.stringify(i,null,2)),l("templateSelected",{kind:t,template:i})},function(){n(3,c=!1)},function(){n(1,a=""),l("clearError")},o,s,function(){r=this.value,n(0,r)},function(e){c=e,n(3,c)}]}class vy extends ie{constructor(e){super(),re(this,e,yy,my,o,{composeEventJson:0,userPubkey:2,userRole:11,policyEnabled:12,publishError:1})}}function wy(e,t,n){const r=e.slice();return r[23]=t[n],r}function Ay(t){let n,r,i,o,s,a;return{c(){n=p("div"),r=p("p"),r.textContent="Please log in to access sprocket management.",i=m(),o=p("button"),o.textContent="Log In",A(r,"class","svelte-fiaj1r"),A(o,"class","login-btn svelte-fiaj1r"),A(n,"class","login-prompt svelte-fiaj1r")},m(e,l){u(e,n,l),c(n,r),c(n,i),c(n,o),s||(a=v(o,"click",t[18]),s=!0)},p:e,d(e){e&&d(n),s=!1,a()}}}function by(e){let t,n,r,i,o,s,a,l,f,h=(e[2]||"none")+"";return{c(){t=p("div"),n=p("p"),n.textContent="❌ Owner permission required for sprocket management.",r=m(),i=p("p"),i.innerHTML='To enable sprocket functionality, set the ORLY_OWNERS environment variable with your npub when starting the relay.',o=m(),s=p("p"),a=g("Current user role: "),l=p("strong"),f=g(h),A(n,"class","svelte-fiaj1r"),A(i,"class","svelte-fiaj1r"),A(s,"class","svelte-fiaj1r"),A(t,"class","permission-denied svelte-fiaj1r")},m(e,d){u(e,t,d),c(t,n),c(t,r),c(t,i),c(t,o),c(t,s),c(s,a),c(s,l),c(l,f)},p(e,t){4&t&&h!==(h=(e[2]||"none")+"")&&k(f,h)},d(e){e&&d(t)}}}function ky(e){let t,n,i,o,s,a,l,h,y,w,b,C,E,B,S,Q,F,D,$,U,P,R,T,N,O,M,L,_,H,j,G,J,K,V,z,q,Y,W,Z,X,ee,te,ne,re,ie,oe,se,ae,le,ce,ue,de,fe,pe,he,ge,me=e[3]?.is_running?"🟢 Running":"🔴 Stopped",ye=e[3]?.script_exists?"✅ Exists":"❌ Not found",ve=e[3]?.pid&&Iy(e),we=e[6]&&Cy(e),Ae=e[8],be=[];for(let t=0;t{"isLoggedIn"in e&&n(1,r=e.isLoggedIn),"userRole"in e&&n(2,i=e.userRole),"sprocketStatus"in e&&n(3,o=e.sprocketStatus),"isLoadingSprocket"in e&&n(4,s=e.isLoadingSprocket),"sprocketUploadFile"in e&&n(5,a=e.sprocketUploadFile),"sprocketScript"in e&&n(0,l=e.sprocketScript),"sprocketMessage"in e&&n(6,c=e.sprocketMessage),"sprocketMessageType"in e&&n(7,u=e.sprocketMessageType),"sprocketVersions"in e&&n(8,d=e.sprocketVersions)},[l,r,i,o,s,a,c,u,d,function(){f("restartSprocket")},function(){f("deleteSprocket")},function(e){f("sprocketFileSelect",e)},function(){f("uploadSprocketScript")},function(){f("saveSprocket")},function(){f("loadSprocket")},function(){f("loadVersions")},p,h,function(){f("openLoginModal")},function(){l=this.value,n(0,l)},e=>p(e),e=>h(e.name)]}class Fy extends ie{constructor(e){super(),re(this,e,Qy,Sy,o,{isLoggedIn:1,userRole:2,sprocketStatus:3,isLoadingSprocket:4,sprocketUploadFile:5,sprocketScript:0,sprocketMessage:6,sprocketMessageType:7,sprocketVersions:8})}}function Dy(e,t,n){const r=e.slice();return r[26]=t[n],r}function $y(e,t,n){const r=e.slice();return r[29]=t[n],r}function Uy(e,t,n){const r=e.slice();return r[32]=t[n],r}function Py(t){let n,r,i,o,s,a;return{c(){n=p("div"),r=p("p"),r.textContent="Please log in to access policy configuration.",i=m(),o=p("button"),o.textContent="Log In",A(r,"class","svelte-gkxvxc"),A(o,"class","login-btn svelte-gkxvxc"),A(n,"class","login-prompt svelte-gkxvxc")},m(e,l){u(e,n,l),c(n,r),c(n,i),c(n,o),s||(a=v(o,"click",t[16]),s=!0)},p:e,d(e){e&&d(n),s=!1,a()}}}function Ry(e){let t,n,r,i,o,s,a,l,f,h=(e[3]||"none")+"";return{c(){t=p("div"),n=p("p"),n.textContent="Policy configuration requires owner or policy admin permissions.",r=m(),i=p("p"),i.innerHTML='To become a policy admin, ask an existing policy admin to add your pubkey\n to the policy_admins list.',o=m(),s=p("p"),a=g("Current user role: "),l=p("strong"),f=g(h),A(n,"class","svelte-gkxvxc"),A(i,"class","svelte-gkxvxc"),A(s,"class","svelte-gkxvxc"),A(t,"class","permission-denied svelte-gkxvxc")},m(e,d){u(e,t,d),c(t,n),c(t,r),c(t,i),c(t,o),c(t,s),c(s,a),c(s,l),c(l,f)},p(e,t){8&t[0]&&h!==(h=(e[3]||"none")+"")&&k(f,h)},d(e){e&&d(t)}}}function Ty(e){let t,n,i,o,s,a,l,f,h,y,w,b,C,E,B,S,Q,F,D,$,U,P,R,T,N,O,M,L,_,H,j,G,J,K,V,z,q,Y,W,Z,X,ee,te,ne,re,ie,oe,se,ae,le,ce,ue,de,fe,pe,he,ge,me,ye,ve,we,Ae,be,ke,Ie,Ce,Ee,xe,Be,Se,Qe,Fe,De,$e,Ue,Pe=e[5]?"Policy Enabled":"Policy Disabled",Re=e[10].length+"",Te=e[4]&&Ny(),Ne=e[9].length>0&&Oy(e),Oe=e[7]&&Ly(e);function Me(e,t){return 0===e[1].length?Hy:_y}let Le=Me(e),_e=Le(e);function He(e,t){return 0===e[10].length?Jy:Gy}let je=He(e),Ge=je(e);return{c(){t=p("div"),n=p("div"),i=p("h3"),i.textContent="Policy Editor",o=m(),s=p("div"),a=p("span"),l=g(Pe),f=m(),Te&&Te.c(),h=m(),y=p("div"),y.innerHTML='

    Edit the policy JSON below and click "Save & Publish" to update the relay's policy configuration.\n Changes are applied immediately after validation.

    \n

    Policy updates are published as kind 12345 events and require policy admin permissions.

    ',w=m(),b=p("div"),C=p("textarea"),E=m(),Ne&&Ne.c(),B=m(),S=p("div"),Q=p("button"),F=g("Load Current"),D=m(),$=p("button"),U=g("Format JSON"),P=m(),R=p("button"),T=g("Validate"),N=m(),O=p("button"),M=g("Save & Publish"),L=m(),Oe&&Oe.c(),_=m(),H=p("div"),j=p("h3"),j.textContent="Policy Administrators",G=m(),J=p("div"),J.innerHTML='

    Policy admins can update the relay's policy configuration via kind 12345 events.\n Their follows get whitelisted if policy_follow_whitelist_enabled is true in the policy.

    \n

    Note: Policy admins are separate from relay admins (ORLY_ADMINS).\n Changes here update the JSON editor - click "Save & Publish" to apply.

    ',K=m(),V=p("div"),_e.c(),z=m(),q=p("div"),Y=p("input"),W=m(),Z=p("button"),X=g("+ Add Admin"),te=m(),ne=p("div"),re=p("h3"),re.textContent="Policy Follow Whitelist",ie=m(),oe=p("div"),oe.innerHTML='

    Pubkeys followed by policy admins (kind 3 events).\n These get automatic read+write access when rules have write_allow_follows: true.

    ',se=m(),ae=p("div"),le=p("span"),ce=g(Re),ue=g(" pubkey(s) in whitelist"),de=m(),fe=p("button"),pe=g("🔄 Refresh Follows"),he=m(),ge=p("div"),Ge.c(),me=m(),ye=p("div"),ve=p("h3"),ve.textContent="Policy Reference",we=m(),Ae=p("div"),be=p("h4"),be.textContent="Structure Overview",ke=m(),Ie=p("ul"),Ie.innerHTML='
  • kind.whitelist - Only allow these event kinds (takes precedence)
  • \n
  • kind.blacklist - Deny these event kinds (if no whitelist)
  • \n
  • global - Rules applied to all events
  • \n
  • rules - Per-kind rules (keyed by kind number as string)
  • \n
  • default_policy - "allow" or "deny" when no rules match
  • \n
  • policy_admins - Hex pubkeys that can update policy
  • \n
  • policy_follow_whitelist_enabled - Enable follow-based access
  • ',Ce=m(),Ee=p("h4"),Ee.textContent="Rule Fields",xe=m(),Be=p("ul"),Be.innerHTML='
  • description - Human-readable rule description
  • \n
  • write_allow / write_deny - Pubkey lists for write access
  • \n
  • read_allow / read_deny - Pubkey lists for read access
  • \n
  • write_allow_follows - Grant access to policy admin follows
  • \n
  • size_limit - Max total event size in bytes
  • \n
  • content_limit - Max content field size in bytes
  • \n
  • max_expiry - Max expiry offset in seconds
  • \n
  • max_age_of_event - Max age of created_at in seconds
  • \n
  • max_age_event_in_future - Max future offset in seconds
  • \n
  • must_have_tags - Required tag letters (e.g., ["d", "t"])
  • \n
  • tag_validation - Regex patterns for tag values
  • \n
  • script - Path to external validation script
  • ',Se=m(),Qe=p("h4"),Qe.textContent="Example Policy",Fe=m(),De=p("pre"),De.textContent=`${e[20]}`,A(i,"class","svelte-gkxvxc"),A(a,"class","status-badge svelte-gkxvxc"),x(a,"enabled",e[5]),A(s,"class","policy-status svelte-gkxvxc"),A(n,"class","policy-header svelte-gkxvxc"),A(y,"class","policy-info svelte-gkxvxc"),A(C,"class","policy-editor svelte-gkxvxc"),A(C,"placeholder","Loading policy configuration..."),C.disabled=e[6],A(C,"spellcheck","false"),A(b,"class","editor-container svelte-gkxvxc"),A(Q,"class","policy-btn load-btn svelte-gkxvxc"),Q.disabled=e[6],A($,"class","policy-btn format-btn svelte-gkxvxc"),$.disabled=e[6],A(R,"class","policy-btn validate-btn svelte-gkxvxc"),R.disabled=e[6],A(O,"class","policy-btn save-btn svelte-gkxvxc"),O.disabled=e[6],A(S,"class","policy-actions svelte-gkxvxc"),A(t,"class","policy-section svelte-gkxvxc"),A(J,"class","policy-info svelte-gkxvxc"),A(V,"class","admin-list svelte-gkxvxc"),A(Y,"type","text"),A(Y,"placeholder","npub or hex pubkey"),Y.disabled=e[6],A(Y,"class","svelte-gkxvxc"),A(Z,"class","policy-btn add-btn svelte-gkxvxc"),Z.disabled=ee=e[6]||!e[11].trim(),A(q,"class","add-admin svelte-gkxvxc"),A(H,"class","policy-section svelte-gkxvxc"),A(oe,"class","policy-info svelte-gkxvxc"),A(le,"class","follows-count svelte-gkxvxc"),A(fe,"class","policy-btn refresh-btn svelte-gkxvxc"),fe.disabled=e[6],A(ae,"class","follows-header svelte-gkxvxc"),A(ge,"class","follows-list svelte-gkxvxc"),A(ne,"class","policy-section svelte-gkxvxc"),A(be,"class","svelte-gkxvxc"),A(Ie,"class","field-list svelte-gkxvxc"),A(Ee,"class","svelte-gkxvxc"),A(Be,"class","field-list svelte-gkxvxc"),A(Qe,"class","svelte-gkxvxc"),A(De,"class","example-json svelte-gkxvxc"),A(Ae,"class","reference-content svelte-gkxvxc"),A(ye,"class","policy-section svelte-gkxvxc")},m(r,d){u(r,t,d),c(t,n),c(n,i),c(n,o),c(n,s),c(s,a),c(a,l),c(s,f),Te&&Te.m(s,null),c(t,h),c(t,y),c(t,w),c(t,b),c(b,C),I(C,e[0]),c(t,E),Ne&&Ne.m(t,null),c(t,B),c(t,S),c(S,Q),c(Q,F),c(S,D),c(S,$),c($,U),c(S,P),c(S,R),c(R,T),c(S,N),c(S,O),c(O,M),c(t,L),Oe&&Oe.m(t,null),u(r,_,d),u(r,H,d),c(H,j),c(H,G),c(H,J),c(H,K),c(H,V),_e.m(V,null),c(H,z),c(H,q),c(q,Y),I(Y,e[11]),c(q,W),c(q,Z),c(Z,X),u(r,te,d),u(r,ne,d),c(ne,re),c(ne,ie),c(ne,oe),c(ne,se),c(ne,ae),c(ae,le),c(le,ce),c(le,ue),c(ae,de),c(ae,fe),c(fe,pe),c(ne,he),c(ne,ge),Ge.m(ge,null),u(r,me,d),u(r,ye,d),c(ye,ve),c(ye,we),c(ye,Ae),c(Ae,be),c(Ae,ke),c(Ae,Ie),c(Ae,Ce),c(Ae,Ee),c(Ae,xe),c(Ae,Be),c(Ae,Se),c(Ae,Qe),c(Ae,Fe),c(Ae,De),$e||(Ue=[v(C,"input",e[21]),v(Q,"click",e[12]),v($,"click",e[15]),v(R,"click",e[13]),v(O,"click",e[14]),v(Y,"input",e[23]),v(Y,"keydown",e[24]),v(Z,"click",e[18]),v(fe,"click",e[17])],$e=!0)},p(e,n){32&n[0]&&Pe!==(Pe=e[5]?"Policy Enabled":"Policy Disabled")&&k(l,Pe),32&n[0]&&x(a,"enabled",e[5]),e[4]?Te||(Te=Ny(),Te.c(),Te.m(s,null)):Te&&(Te.d(1),Te=null),64&n[0]&&(C.disabled=e[6]),1&n[0]&&I(C,e[0]),e[9].length>0?Ne?Ne.p(e,n):(Ne=Oy(e),Ne.c(),Ne.m(t,B)):Ne&&(Ne.d(1),Ne=null),64&n[0]&&(Q.disabled=e[6]),64&n[0]&&($.disabled=e[6]),64&n[0]&&(R.disabled=e[6]),64&n[0]&&(O.disabled=e[6]),e[7]?Oe?Oe.p(e,n):(Oe=Ly(e),Oe.c(),Oe.m(t,null)):Oe&&(Oe.d(1),Oe=null),Le===(Le=Me(e))&&_e?_e.p(e,n):(_e.d(1),_e=Le(e),_e&&(_e.c(),_e.m(V,null))),64&n[0]&&(Y.disabled=e[6]),2048&n[0]&&Y.value!==e[11]&&I(Y,e[11]),2112&n[0]&&ee!==(ee=e[6]||!e[11].trim())&&(Z.disabled=ee),1024&n[0]&&Re!==(Re=e[10].length+"")&&k(ce,Re),64&n[0]&&(fe.disabled=e[6]),je===(je=He(e))&&Ge?Ge.p(e,n):(Ge.d(1),Ge=je(e),Ge&&(Ge.c(),Ge.m(ge,null)))},d(e){e&&d(t),Te&&Te.d(),Ne&&Ne.d(),Oe&&Oe.d(),e&&d(_),e&&d(H),_e.d(),e&&d(te),e&&d(ne),Ge.d(),e&&d(me),e&&d(ye),$e=!1,r(Ue)}}}function Ny(e){let t;return{c(){t=p("span"),t.textContent="Policy Admin",A(t,"class","admin-badge svelte-gkxvxc")},m(e,n){u(e,t,n)},d(e){e&&d(t)}}}function Oy(e){let t,n,r,i,o=e[9],s=[];for(let t=0;t{"isLoggedIn"in e&&n(2,r=e.isLoggedIn),"userRole"in e&&n(3,i=e.userRole),"isPolicyAdmin"in e&&n(4,o=e.isPolicyAdmin),"policyEnabled"in e&&n(5,s=e.policyEnabled),"policyJson"in e&&n(0,a=e.policyJson),"isLoadingPolicy"in e&&n(6,l=e.isLoadingPolicy),"policyMessage"in e&&n(7,c=e.policyMessage),"policyMessageType"in e&&n(8,u=e.policyMessageType),"validationErrors"in e&&n(9,d=e.validationErrors),"policyAdmins"in e&&n(1,f=e.policyAdmins),"policyFollows"in e&&n(10,p=e.policyFollows)},e.$$.update=()=>{if(1&e.$$.dirty[0])try{if(a){const e=JSON.parse(a);n(1,f=e.policy_admins||[])}}catch(e){}},[a,f,r,i,o,s,l,c,u,d,p,g,function(){h("loadPolicy")},function(){h("validatePolicy")},function(){h("savePolicy")},function(){h("formatJson")},function(){h("openLoginModal")},function(){h("refreshFollows")},m,y,'{\n "kind": {\n "whitelist": [0, 1, 3, 6, 7, 10002],\n "blacklist": []\n },\n "global": {\n "description": "Global rules applied to all events",\n "size_limit": 65536,\n "max_age_of_event": 86400,\n "max_age_event_in_future": 300\n },\n "rules": {\n "1": {\n "description": "Kind 1 (short text notes)",\n "content_limit": 8192,\n "write_allow_follows": true\n },\n "30023": {\n "description": "Long-form articles",\n "content_limit": 100000,\n "tag_validation": {\n "d": "^[a-z0-9-]{1,64}$",\n "t": "^[a-z0-9-]{1,32}$"\n }\n }\n },\n "default_policy": "allow",\n "policy_admins": [""],\n "policy_follow_whitelist_enabled": true\n}',function(){a=this.value,n(0,a)},e=>y(e),function(){g=this.value,n(11,g)},e=>"Enter"===e.key&&m()]}class qy extends ie{constructor(e){super(),re(this,e,zy,Vy,o,{isLoggedIn:2,userRole:3,isPolicyAdmin:4,policyEnabled:5,policyJson:0,isLoadingPolicy:6,policyMessage:7,policyMessageType:8,validationErrors:9,policyAdmins:1,policyFollows:10},null,[-1,-1])}}const{window:Yy}=l;function Wy(e,t,n){const r=e.slice();return r[57]=t[n],r}function Zy(e,t,n){const r=e.slice();return r[54]=t[n],r}function Xy(t){let n,r,i,o,s,a;return{c(){n=p("div"),r=p("p"),r.textContent="Please log in to view your Blossom storage.",i=m(),o=p("button"),o.textContent="Log In",A(r,"class","svelte-bz95vx"),A(o,"class","login-btn svelte-bz95vx"),A(n,"class","login-prompt svelte-bz95vx")},m(e,l){u(e,n,l),c(n,r),c(n,i),c(n,o),s||(a=v(o,"click",t[20]),s=!0)},p:e,d(e){e&&d(n),s=!1,a()}}}function ev(e){let t,n,r,i,o,s,a,l,f,h,y,w,b,I=e[0]||e[12]?"Loading...":"Refresh";function C(e,t){return e[13]?rv:e[10]?nv:tv}let E=C(e),x=E(e),B=e[14]&&!e[10]&&!e[13]&&ov(e),S=!e[10]&&!e[13]&&sv(e),Q=e[2]&&lv(e);function F(e,t){return e[10]&&!e[13]?uv:cv}let D=F(e),$=D(e);return{c(){t=p("div"),n=p("div"),x.c(),r=m(),i=p("div"),B&&B.c(),o=m(),s=p("button"),a=g(I),f=m(),S&&S.c(),h=m(),Q&&Q.c(),y=m(),$.c(),A(s,"class","refresh-btn svelte-bz95vx"),s.disabled=l=e[0]||e[12],A(i,"class","header-buttons svelte-bz95vx"),A(n,"class","header-section svelte-bz95vx"),A(t,"class","blossom-view svelte-bz95vx")},m(l,d){u(l,t,d),c(t,n),x.m(n,null),c(n,r),c(n,i),B&&B.m(i,null),c(i,o),c(i,s),c(s,a),c(t,f),S&&S.m(t,null),c(t,h),Q&&Q.m(t,null),c(t,y),$.m(t,null),w||(b=v(s,"click",e[30]),w=!0)},p(e,c){E===(E=C(e))&&x?x.p(e,c):(x.d(1),x=E(e),x&&(x.c(),x.m(n,r))),!e[14]||e[10]||e[13]?B&&(B.d(1),B=null):B?B.p(e,c):(B=ov(e),B.c(),B.m(i,o)),4097&c[0]&&I!==(I=e[0]||e[12]?"Loading...":"Refresh")&&k(a,I),4097&c[0]&&l!==(l=e[0]||e[12])&&(s.disabled=l),e[10]||e[13]?S&&(S.d(1),S=null):S?S.p(e,c):(S=sv(e),S.c(),S.m(t,h)),e[2]?Q?Q.p(e,c):(Q=lv(e),Q.c(),Q.m(t,y)):Q&&(Q.d(1),Q=null),D===(D=F(e))&&$?$.p(e,c):($.d(1),$=D(e),$&&($.c(),$.m(t,null)))},d(e){e&&d(t),x.d(),B&&B.d(),S&&S.d(),Q&&Q.d(),$.d(),w=!1,b()}}}function tv(t){let n;return{c(){n=p("h3"),n.textContent="Blossom Media Storage",A(n,"class","svelte-bz95vx")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function nv(t){let n,r,i,o,s;return{c(){n=p("button"),n.textContent="← Back",r=m(),i=p("h3"),i.textContent="All Users Storage",A(n,"class","back-btn svelte-bz95vx"),A(i,"class","svelte-bz95vx")},m(e,a){u(e,n,a),u(e,r,a),u(e,i,a),o||(s=v(n,"click",t[27]),o=!0)},p:e,d(e){e&&d(n),e&&d(r),e&&d(i),o=!1,s()}}}function rv(e){let t,n,r,i,o,s,a,l=(e[13].profile?.name||Nv(e[25](e[13].pubkey)))+"",f=e[13].profile?.picture&&iv(e);return{c(){t=p("button"),t.textContent="← Back",n=m(),r=p("h3"),f&&f.c(),i=m(),o=g(l),A(t,"class","back-btn svelte-bz95vx"),A(r,"class","user-header svelte-bz95vx")},m(l,d){u(l,t,d),u(l,n,d),u(l,r,d),f&&f.m(r,null),c(r,i),c(r,o),s||(a=v(t,"click",e[29]),s=!0)},p(e,t){e[13].profile?.picture?f?f.p(e,t):(f=iv(e),f.c(),f.m(r,i)):f&&(f.d(1),f=null),8192&t[0]&&l!==(l=(e[13].profile?.name||Nv(e[25](e[13].pubkey)))+"")&&k(o,l)},d(e){e&&d(t),e&&d(n),e&&d(r),f&&f.d(),s=!1,a()}}}function iv(e){let t,n;return{c(){t=p("img"),a(t.src,n=e[13].profile.picture)||A(t,"src",n),A(t,"alt",""),A(t,"class","header-avatar svelte-bz95vx")},m(e,n){u(e,t,n)},p(e,r){8192&r[0]&&!a(t.src,n=e[13].profile.picture)&&A(t,"src",n)},d(e){e&&d(t)}}}function ov(e){let t,n,r,i;return{c(){t=p("button"),n=g("Admin"),A(t,"class","admin-btn svelte-bz95vx"),t.disabled=e[0]},m(o,s){u(o,t,s),c(t,n),r||(i=v(t,"click",e[26]),r=!0)},p(e,n){1&n[0]&&(t.disabled=e[0])},d(e){e&&d(t),r=!1,i()}}}function sv(e){let t,n,i,o,s,a,l,f,h=e[3].length>0&&av(e);return{c(){t=p("div"),n=p("input"),i=m(),o=p("button"),s=g("Select Files"),a=m(),h&&h.c(),A(n,"type","file"),n.multiple=!0,A(n,"class","file-input-hidden svelte-bz95vx"),A(o,"class","select-btn svelte-bz95vx"),o.disabled=e[4],A(t,"class","upload-section svelte-bz95vx")},m(r,d){u(r,t,d),c(t,n),e[39](n),c(t,i),c(t,o),c(o,s),c(t,a),h&&h.m(t,null),l||(f=[v(n,"change",e[22]),v(o,"click",e[23])],l=!0)},p(e,n){16&n[0]&&(o.disabled=e[4]),e[3].length>0?h?h.p(e,n):(h=av(e),h.c(),h.m(t,null)):h&&(h.d(1),h=null)},d(n){n&&d(t),e[39](null),h&&h.d(),l=!1,r(f)}}}function av(e){let t,n,r,i,o,s,a,l,f=e[3].length+"",h=(e[4]?e[5]:"Upload")+"";return{c(){t=p("span"),n=g(f),r=g(" file(s) selected"),i=m(),o=p("button"),s=g(h),A(t,"class","selected-count svelte-bz95vx"),A(o,"class","upload-btn svelte-bz95vx"),o.disabled=e[4]},m(d,f){u(d,t,f),c(t,n),c(t,r),u(d,i,f),u(d,o,f),c(o,s),a||(l=v(o,"click",e[24]),a=!0)},p(e,t){8&t[0]&&f!==(f=e[3].length+"")&&k(n,f),48&t[0]&&h!==(h=(e[4]?e[5]:"Upload")+"")&&k(s,h),16&t[0]&&(o.disabled=e[4])},d(e){e&&d(t),e&&d(i),e&&d(o),a=!1,l()}}}function lv(e){let t,n;return{c(){t=p("div"),n=g(e[2]),A(t,"class","error-message svelte-bz95vx")},m(e,r){u(e,t,r),c(t,n)},p(e,t){4&t[0]&&k(n,e[2])},d(e){e&&d(t)}}}function cv(e){let t,n,r;function i(e,r){return 1&r[0]&&(t=null),null==t&&(t=!(!e[0]||0!==e[31]().length)),t?pv:(null==n&&(n=!(0!==e[31]().length)),n?fv:dv)}let o=i(e,[-1,-1]),s=o(e);return{c(){s.c(),r=y()},m(e,t){s.m(e,t),u(e,r,t)},p(e,t){o===(o=i(e,t))&&s?s.p(e,t):(s.d(1),s=o(e),s&&(s.c(),s.m(r.parentNode,r)))},d(e){s.d(e),e&&d(r)}}}function uv(e){let t;function n(e,t){return e[12]?yv:0===e[11].length?mv:gv}let r=n(e),i=r(e);return{c(){i.c(),t=y()},m(e,n){i.m(e,n),u(e,t,n)},p(e,o){r===(r=n(e))&&i?i.p(e,o):(i.d(1),i=r(e),i&&(i.c(),i.m(t.parentNode,t)))},d(e){i.d(e),e&&d(t)}}}function dv(e){let t,n=e[31](),r=[];for(let t=0;tNo users have uploaded files yet.

    ",A(n,"class","empty-state svelte-bz95vx")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function yv(t){let n;return{c(){n=p("div"),n.textContent="Loading user statistics...",A(n,"class","loading svelte-bz95vx")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function vv(t){let n;return{c(){n=p("div"),A(n,"class","user-avatar-placeholder svelte-bz95vx")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function wv(e){let t,n;return{c(){t=p("img"),a(t.src,n=e[54].profile.picture)||A(t,"src",n),A(t,"alt",""),A(t,"class","user-avatar svelte-bz95vx")},m(e,n){u(e,t,n)},p(e,r){2048&r[0]&&!a(t.src,n=e[54].profile.picture)&&A(t,"src",n)},d(e){e&&d(t)}}}function Av(e){let t,n,i,o,s,a,l,f,h,y,w,b,I,C,E,x,B,S,Q,F,D,$=(e[54].profile?.name||Nv(e[25](e[54].pubkey)))+"",U=Nv(e[25](e[54].pubkey))+"",P=e[54].blob_count+"",R=Dv(e[54].total_size_bytes)+"";function T(e,t){return e[54].profile?.picture?wv:vv}let N=T(e),O=N(e);function M(){return e[40](e[54])}function L(...t){return e[41](e[54],...t)}return{c(){t=p("div"),n=p("div"),O.c(),i=m(),o=p("div"),s=p("div"),a=g($),l=m(),f=p("div"),h=g(U),w=m(),b=p("div"),I=p("span"),C=g(P),E=g(" files"),x=m(),B=p("span"),S=g(R),Q=m(),A(n,"class","user-avatar-container svelte-bz95vx"),A(s,"class","user-name svelte-bz95vx"),A(f,"class","user-npub svelte-bz95vx"),A(f,"title",y=e[54].pubkey),A(o,"class","user-info svelte-bz95vx"),A(I,"class","blob-count svelte-bz95vx"),A(B,"class","total-size svelte-bz95vx"),A(b,"class","user-stats svelte-bz95vx"),A(t,"class","user-stat-item svelte-bz95vx"),A(t,"role","button"),A(t,"tabindex","0")},m(e,r){u(e,t,r),c(t,n),O.m(n,null),c(t,i),c(t,o),c(o,s),c(s,a),c(o,l),c(o,f),c(f,h),c(t,w),c(t,b),c(b,I),c(I,C),c(I,E),c(b,x),c(b,B),c(B,S),c(t,Q),F||(D=[v(t,"click",M),v(t,"keypress",L)],F=!0)},p(t,r){N===(N=T(e=t))&&O?O.p(e,r):(O.d(1),O=N(e),O&&(O.c(),O.m(n,null))),2048&r[0]&&$!==($=(e[54].profile?.name||Nv(e[25](e[54].pubkey)))+"")&&k(a,$),2048&r[0]&&U!==(U=Nv(e[25](e[54].pubkey))+"")&&k(h,U),2048&r[0]&&y!==(y=e[54].pubkey)&&A(f,"title",y),2048&r[0]&&P!==(P=e[54].blob_count+"")&&k(C,P),2048&r[0]&&R!==(R=Dv(e[54].total_size_bytes)+"")&&k(S,R)},d(e){e&&d(t),O.d(),F=!1,r(D)}}}function bv(e){let t,n,i,o,s,a,l,f,h,y,b,I,C,E,x,B,S,Q,F,D,$,U,P,R,T,N,O,M,L,_,H,j,G,J,K,V,z,q,Y,W,Z,X,ee,te=Uv(e[8].sha256)+"",ne=(e[8].type||"unknown")+"",re="image"===Pv(e[8].type),ie=Dv(e[8].size)+"",oe=$v(e[8].uploaded)+"",se=re&&kv(e);function ae(e,t){return 256&t[0]&&(B=null),256&t[0]&&(S=null),256&t[0]&&(Q=null),null==B&&(B=!("image"!==Pv(e[8].type))),B?xv:(null==S&&(S=!("video"!==Pv(e[8].type))),S?Ev:(null==Q&&(Q=!("audio"!==Pv(e[8].type))),Q?Cv:Iv))}let le=ae(e,[-1,-1]),ce=le(e);return{c(){t=p("div"),n=p("div"),i=p("div"),o=p("div"),s=p("span"),a=g(te),l=m(),f=p("span"),h=g(ne),y=m(),b=p("div"),se&&se.c(),I=m(),C=p("button"),C.textContent="X",E=m(),x=p("div"),ce.c(),F=m(),D=p("div"),$=p("div"),U=p("span"),P=g("Size: "),R=g(ie),T=m(),N=p("span"),O=g("Uploaded: "),M=g(oe),L=m(),_=p("div"),H=p("input"),G=m(),J=p("button"),J.textContent="Copy",K=m(),V=p("div"),z=p("a"),q=g("Open in New Tab"),W=m(),Z=p("button"),Z.textContent="Delete",A(s,"class","modal-hash svelte-bz95vx"),A(f,"class","modal-type svelte-bz95vx"),A(o,"class","modal-title svelte-bz95vx"),A(C,"class","close-btn svelte-bz95vx"),A(b,"class","modal-controls svelte-bz95vx"),A(i,"class","modal-header svelte-bz95vx"),A(x,"class","modal-body svelte-bz95vx"),A($,"class","blob-details svelte-bz95vx"),A(H,"type","text"),H.readOnly=!0,H.value=j=Tv(e[8]),A(H,"class","blob-url-input svelte-bz95vx"),A(J,"class","copy-btn svelte-bz95vx"),A(_,"class","blob-url-section svelte-bz95vx"),A(z,"href",Y=Tv(e[8])),A(z,"target","_blank"),A(z,"rel","noopener noreferrer"),A(z,"class","action-btn svelte-bz95vx"),A(Z,"class","action-btn danger svelte-bz95vx"),A(V,"class","modal-actions svelte-bz95vx"),A(D,"class","modal-footer svelte-bz95vx"),A(n,"class","modal-content svelte-bz95vx"),A(n,"role","dialog"),A(t,"class","modal-overlay svelte-bz95vx"),A(t,"role","button"),A(t,"tabindex","0")},m(r,d){u(r,t,d),c(t,n),c(n,i),c(i,o),c(o,s),c(s,a),c(o,l),c(o,f),c(f,h),c(i,y),c(i,b),se&&se.m(b,null),c(b,I),c(b,C),c(n,E),c(n,x),ce.m(x,null),c(n,F),c(n,D),c(D,$),c($,U),c(U,P),c(U,R),c($,T),c($,N),c(N,O),c(N,M),c(D,L),c(D,_),c(_,H),c(_,G),c(_,J),c(D,K),c(D,V),c(V,z),c(z,q),c(V,W),c(V,Z),X||(ee=[v(C,"click",e[16]),v(H,"click",Ov),v(J,"click",e[45]),v(Z,"click",e[46]),v(n,"click",w(e[37])),v(n,"keypress",w(e[38])),v(t,"click",e[16]),v(t,"keypress",e[47])],X=!0)},p(e,t){256&t[0]&&te!==(te=Uv(e[8].sha256)+"")&&k(a,te),256&t[0]&&ne!==(ne=(e[8].type||"unknown")+"")&&k(h,ne),256&t[0]&&(re="image"===Pv(e[8].type)),re?se?se.p(e,t):(se=kv(e),se.c(),se.m(b,I)):se&&(se.d(1),se=null),le===(le=ae(e,t))&&ce?ce.p(e,t):(ce.d(1),ce=le(e),ce&&(ce.c(),ce.m(x,null))),256&t[0]&&ie!==(ie=Dv(e[8].size)+"")&&k(R,ie),256&t[0]&&oe!==(oe=$v(e[8].uploaded)+"")&&k(M,oe),256&t[0]&&j!==(j=Tv(e[8]))&&H.value!==j&&(H.value=j),256&t[0]&&Y!==(Y=Tv(e[8]))&&A(z,"href",Y)},d(e){e&&d(t),se&&se.d(),ce.d(),X=!1,r(ee)}}}function kv(e){let t,n,i,o,s,a,l,f,h,y,w,b,I,C=Math.round(100*e[9])+"";return{c(){t=p("button"),n=g("-"),o=m(),s=p("span"),a=g(C),l=g("%"),f=m(),h=p("button"),y=g("+"),A(t,"class","zoom-btn svelte-bz95vx"),t.disabled=i=e[9]<=Sv,A(s,"class","zoom-level svelte-bz95vx"),A(h,"class","zoom-btn svelte-bz95vx"),h.disabled=w=e[9]>=Qv},m(r,i){u(r,t,i),c(t,n),u(r,o,i),u(r,s,i),c(s,a),c(s,l),u(r,f,i),u(r,h,i),c(h,y),b||(I=[v(t,"click",e[18]),v(h,"click",e[17])],b=!0)},p(e,n){512&n[0]&&i!==(i=e[9]<=Sv)&&(t.disabled=i),512&n[0]&&C!==(C=Math.round(100*e[9])+"")&&k(a,C),512&n[0]&&w!==(w=e[9]>=Qv)&&(h.disabled=w)},d(e){e&&d(t),e&&d(o),e&&d(s),e&&d(f),e&&d(h),b=!1,r(I)}}}function Iv(e){let t,n,r,i,o,s,a,l,f,h=Rv(e[8].type)+"";return{c(){t=p("div"),n=p("div"),r=g(h),i=m(),o=p("p"),o.textContent="Preview not available for this file type.",s=m(),a=p("a"),l=g("Download File"),A(n,"class","file-icon svelte-bz95vx"),A(a,"href",f=Tv(e[8])),A(a,"target","_blank"),A(a,"rel","noopener noreferrer"),A(a,"class","download-link svelte-bz95vx"),A(t,"class","file-preview svelte-bz95vx")},m(e,d){u(e,t,d),c(t,n),c(n,r),c(t,i),c(t,o),c(t,s),c(t,a),c(a,l)},p(e,t){256&t[0]&&h!==(h=Rv(e[8].type)+"")&&k(r,h),256&t[0]&&f!==(f=Tv(e[8]))&&A(a,"href",f)},d(e){e&&d(t)}}}function Cv(e){let t,n,r;return{c(){t=p("div"),n=p("audio"),n.controls=!0,a(n.src,r=Tv(e[8]))||A(n,"src",r),A(n,"class","svelte-bz95vx"),A(t,"class","media-container audio svelte-bz95vx")},m(e,r){u(e,t,r),c(t,n)},p(e,t){256&t[0]&&!a(n.src,r=Tv(e[8]))&&A(n,"src",r)},d(e){e&&d(t)}}}function Ev(e){let t,n,r,i;return{c(){t=p("div"),n=p("video"),r=p("track"),A(r,"kind","captions"),n.controls=!0,a(n.src,i=Tv(e[8]))||A(n,"src",i),A(n,"class","svelte-bz95vx"),A(t,"class","media-container svelte-bz95vx")},m(e,i){u(e,t,i),c(t,n),c(n,r)},p(e,t){256&t[0]&&!a(n.src,i=Tv(e[8]))&&A(n,"src",i)},d(e){e&&d(t)}}}function xv(e){let t,n,r;return{c(){t=p("div"),n=p("img"),a(n.src,r=Tv(e[8]))||A(n,"src",r),A(n,"alt","Blob content"),A(n,"class","svelte-bz95vx"),A(t,"class","media-container svelte-bz95vx"),C(t,"transform","scale("+e[9]+")")},m(e,r){u(e,t,r),c(t,n)},p(e,i){256&i[0]&&!a(n.src,r=Tv(e[8]))&&A(n,"src",r),512&i[0]&&C(t,"transform","scale("+e[9]+")")},d(e){e&&d(t)}}}function Bv(t){let n,r,i,o;function s(e,t){return e[1]?ev:Xy}let a=s(t),l=a(t),c=t[7]&&t[8]&&bv(t);return{c(){l.c(),n=m(),c&&c.c(),r=y()},m(e,s){l.m(e,s),u(e,n,s),c&&c.m(e,s),u(e,r,s),i||(o=v(Yy,"keydown",t[19]),i=!0)},p(e,t){a===(a=s(e))&&l?l.p(e,t):(l.d(1),l=a(e),l&&(l.c(),l.m(n.parentNode,n))),e[7]&&e[8]?c?c.p(e,t):(c=bv(e),c.c(),c.m(r.parentNode,r)):c&&(c.d(1),c=null)},i:e,o:e,d(e){l.d(e),e&&d(n),c&&c.d(e),e&&d(r),i=!1,o()}}}const Sv=.25,Qv=4;async function Fv(e,t,n=null){if(!e)return console.log("No signer available for Blossom auth"),null;try{const r=Math.floor(Date.now()/1e3),i=[["t",t],["expiration",(r+60).toString()]];n&&i.push(["x",n]);const o={kind:24242,created_at:r,tags:i,content:`Blossom ${t} operation`},s=await e.signEvent(o);return btoa(JSON.stringify(s))}catch(e){return console.error("Error creating Blossom auth:",e),null}}function Dv(e){if(!e)return"0 B";const t=["B","KB","MB","GB"];let n=0,r=e;for(;r>=1024&&ne.target.select();function Mv(e,t,n){let r,i,{isLoggedIn:o=!1}=t,{userPubkey:s=""}=t,{userSigner:a=null}=t,{currentEffectiveRole:l=""}=t;const c=$();let u,d=[],f=!1,p="",h=[],g=!1,m="",y=!1,v=null,w=1,A=!1,b=[],k=!1,I=null,C=[],E=!1;async function x(){if(s){n(0,f=!0),n(2,p="");try{const e=`${window.location.origin}/blossom/list/${s}`,t=await Fv(a,"list"),n=await fetch(e,{headers:t?{Authorization:`Nostr ${t}`}:{}});if(!n.ok)throw new Error(`Failed to load blobs: ${n.statusText}`);const r=await n.json();d=Array.isArray(r)?r:[],d.sort((e,t)=>(t.uploaded||0)-(e.uploaded||0)),console.log("Loaded blobs:",d)}catch(e){console.error("Error loading blobs:",e),n(2,p=e.message||"Failed to load blobs")}finally{n(0,f=!1)}}}function B(e){n(8,v=e),n(9,w=1),n(7,y=!0)}function S(){n(7,y=!1),n(8,v=null),n(9,w=1)}function Q(){wSv&&n(9,w=Math.max(Sv,w-.25))}async function P(e){if(confirm(`Delete blob ${Uv(e.sha256)}?`))try{const t=`${window.location.origin}/blossom/${e.sha256}`,n=await Fv(a,"delete",e.sha256),r=await fetch(t,{method:"DELETE",headers:n?{Authorization:`Nostr ${n}`}:{}});if(!r.ok)throw new Error(`Failed to delete: ${r.statusText}`);d=d.filter(t=>t.sha256!==e.sha256),v?.sha256===e.sha256&&S()}catch(e){console.error("Error deleting blob:",e),alert(`Failed to delete blob: ${e.message}`)}}async function T(){n(12,k=!0),n(2,p="");try{const e=`${window.location.origin}/blossom/admin/users`,t=await Fv(a,"admin"),r=await fetch(e,{headers:t?{Authorization:`Nostr ${t}`}:{}});if(!r.ok)throw new Error(`Failed to load user stats: ${r.statusText}`);n(11,b=await r.json());for(const e of b)Cp(e.pubkey).then(t=>{e.profile=t||{name:"",picture:""},n(11,b)}).catch(()=>{e.profile={name:"",picture:""}})}catch(e){console.error("Error fetching admin user stats:",e),n(2,p=e.message||"Failed to load user stats")}finally{n(12,k=!1)}}async function N(e){n(0,f=!0),n(2,p="");try{const t=`${window.location.origin}/blossom/list/${e}`,n=await Fv(a,"list"),r=await fetch(t,{headers:n?{Authorization:`Nostr ${n}`}:{}});if(!r.ok)throw new Error(`Failed to load user blobs: ${r.statusText}`);C=await r.json(),C.sort((e,t)=>(t.uploaded||0)-(e.uploaded||0))}catch(e){console.error("Error loading user blobs:",e),n(2,p=e.message||"Failed to load user blobs")}finally{n(0,f=!1)}}async function O(e){n(13,I={pubkey:e.pubkey,profile:e.profile}),await N(e.pubkey)}F(()=>{r&&!E&&(n(36,E=!0),x())});return e.$$set=e=>{"isLoggedIn"in e&&n(32,o=e.isLoggedIn),"userPubkey"in e&&n(33,s=e.userPubkey),"userSigner"in e&&n(34,a=e.userSigner),"currentEffectiveRole"in e&&n(35,l=e.currentEffectiveRole)},e.$$.update=()=>{6&e.$$.dirty[1]&&n(1,r=o&&s),16&e.$$.dirty[1]&&n(14,i="admin"===l||"owner"===l),3&e.$$.dirty[0]|32&e.$$.dirty[1]&&(!r||E||f||(n(36,E=!0),x()))},[f,r,p,h,g,m,u,y,v,w,A,b,k,I,i,B,S,Q,D,function(e){y&&("Escape"===e.key?S():"+"===e.key||"="===e.key?Q():"-"===e.key&&D())},function(){c("openLoginModal")},P,function(e){n(3,h=Array.from(e.target.files))},function(){u?.click()},async function(){if(0===h.length)return;n(4,g=!0),n(2,p="");const e=[],t=[];for(let r=0;r0&&await x(),t.length>0&&n(2,p=`Failed to upload: ${t.map(e=>e.name).join(", ")}`)},function(e){try{return vu(e)}catch(t){return Uv(e)}},function(){n(10,A=!0),T()},function(){n(10,A=!1),n(11,b=[]),n(13,I=null),C=[]},O,function(){n(13,I=null),C=[]},function(){I?N(I.pubkey):A?T():x()},function(){return I?C:d},o,s,a,l,E,function(t){U.call(this,e,t)},function(t){U.call(this,e,t)},function(e){R[e?"unshift":"push"](()=>{u=e,n(6,u)})},e=>O(e),(e,t)=>"Enter"===t.key&&O(e),e=>P(e),e=>B(e),(e,t)=>"Enter"===t.key&&B(e),()=>{navigator.clipboard.writeText(Tv(v))},()=>P(v),e=>"Enter"===e.key&&S()]}class Lv extends ie{constructor(e){super(),re(this,e,Mv,Bv,o,{isLoggedIn:32,userPubkey:33,userSigner:34,currentEffectiveRole:35},null,[-1,-1])}}function _v(e){let t,n,r,i,o,s,a,l,f,h,y;return{c(){t=p("div"),n=p("div"),r=p("h3"),r.textContent="Active Filter",i=m(),o=p("button"),o.textContent="🧹 Sweep",s=m(),a=p("div"),l=p("pre"),f=g(e[2]),A(r,"class","svelte-1tyqaa5"),A(o,"class","sweep-btn svelte-1tyqaa5"),A(o,"title","Clear filter"),A(n,"class","filter-display-header svelte-1tyqaa5"),A(l,"class","filter-json svelte-1tyqaa5"),A(a,"class","filter-json-container svelte-1tyqaa5"),A(t,"class","filter-display svelte-1tyqaa5")},m(d,p){u(d,t,p),c(t,n),c(n,r),c(n,i),c(n,o),c(t,s),c(t,a),c(a,l),c(l,f),h||(y=v(o,"click",e[3]),h=!0)},p(e,t){4&t&&k(f,e[2])},d(e){e&&d(t),h=!1,y()}}}function Hv(t){let n,r=t[0]&&t[1]&&_v(t);return{c(){r&&r.c(),n=y()},m(e,t){r&&r.m(e,t),u(e,n,t)},p(e,[t]){e[0]&&e[1]?r?r.p(e,t):(r=_v(e),r.c(),r.m(n.parentNode,n)):r&&(r.d(1),r=null)},i:e,o:e,d(e){r&&r.d(e),e&&d(n)}}}function jv(e,t,n){let r,i;const o=$();let{filter:s={}}=t,{showFilter:a=!0}=t;return e.$$set=e=>{"filter"in e&&n(4,s=e.filter),"showFilter"in e&&n(0,a=e.showFilter)},e.$$.update=()=>{16&e.$$.dirty&&n(2,r=function(e){return JSON.stringify(e,null,2)}(s)),16&e.$$.dirty&&n(1,i=Object.keys(s).length>0)},[a,i,r,function(){o("sweep")},s]}class Gv extends ie{constructor(e){super(),re(this,e,jv,Hv,o,{filter:4,showFilter:0})}}function Jv(e){return fp[e]||`Kind ${e}`}function Kv(e){return e?e.slice(0,8)+"..."+e.slice(-8):"unknown"}function Vv(e,t=100){return e?e.length>t?e.slice(0,t)+"...":e:""}function zv(e){return e?new Date(1e3*e).toLocaleString():""}class qv{constructor(e,t,n){this.relayUrl=e,this.userSigner=t,this.userPubkey=n,this.ws=null,this.challenge=null,this.isAuthenticated=!1,this.authPromise=null}async connect(){return new Promise((e,t)=>{this.ws=new WebSocket(this.relayUrl),this.ws.onopen=()=>{console.log("WebSocket connected to relay:",this.relayUrl),e()},this.ws.onmessage=async e=>{try{const t=JSON.parse(e.data);await this.handleMessage(t)}catch(e){console.error("Error parsing relay message:",e)}},this.ws.onerror=e=>{console.error("WebSocket error:",e),t(new Error("Failed to connect to relay"))},this.ws.onclose=()=>{console.log("WebSocket connection closed"),this.isAuthenticated=!1,this.challenge=null},setTimeout(()=>{this.ws.readyState!==WebSocket.OPEN&&t(new Error("Connection timeout"))},1e4)})}async handleMessage(e){const[t,...n]=e;switch(t){case"AUTH":this.challenge=n[0],console.log("Received AUTH challenge:",this.challenge),await this.authenticate();break;case"OK":const[e,r,i]=n;e&&r?(console.log("Authentication successful for event:",e),this.isAuthenticated=!0,this.authPromise&&(this.authPromise.resolve(),this.authPromise=null)):e&&!r&&(console.error("Authentication failed:",i),this.authPromise&&(this.authPromise.reject(new Error(i||"Authentication failed")),this.authPromise=null));break;case"NOTICE":console.log("Relay notice:",n[0]);break;default:console.log("Unhandled message type:",t,n)}}async authenticate(){if(!this.challenge)throw new Error("No challenge received from relay");if(!this.userSigner)throw new Error("No signer available for authentication");try{const e={kind:22242,created_at:Math.floor(Date.now()/1e3),tags:[["relay",this.relayUrl],["challenge",this.challenge]],content:"",pubkey:this.userPubkey},t=["AUTH",await this.userSigner.signEvent(e)];return this.ws.send(JSON.stringify(t)),console.log("Sent authentication event to relay"),new Promise((e,t)=>{this.authPromise={resolve:e,reject:t},setTimeout(()=>{this.authPromise&&(this.authPromise.reject(new Error("Authentication timeout")),this.authPromise=null)},1e4)})}catch(e){throw console.error("Authentication error:",e),e}}async publishEvent(e){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)throw new Error("WebSocket not connected");return new Promise((t,n)=>{const r=["EVENT",e];this.ws.send(JSON.stringify(r));const i=this.ws.onmessage,o=setTimeout(()=>{this.ws.onmessage=i,n(new Error("Publish timeout"))},15e3);this.ws.onmessage=async r=>{try{const s=JSON.parse(r.data),[a,l,c,u]=s;if("OK"===a&&l===e.id)if(c)clearTimeout(o),this.ws.onmessage=i,console.log("Event published successfully:",l),t({success:!0,eventId:l,reason:u});else{if(console.error("Event publish failed:",u),u&&u.includes("auth-required"))return void console.log("Authentication required, waiting for AUTH challenge...");clearTimeout(o),this.ws.onmessage=i,n(new Error(`Publish failed: ${u}`))}else if("AUTH"===a){this.challenge=s[1],console.log("Received AUTH challenge during publish:",this.challenge);try{await this.authenticate(),console.log("Authentication successful, retrying event publish...");const t=["EVENT",e];this.ws.send(JSON.stringify(t))}catch(e){clearTimeout(o),this.ws.onmessage=i,n(new Error(`Authentication failed: ${e.message}`))}}else await this.handleMessage(s)}catch(e){clearTimeout(o),this.ws.onmessage=i,n(e)}}})}close(){this.ws&&(this.ws.close(),this.ws=null),this.isAuthenticated=!1,this.challenge=null}getAuthenticated(){return this.isAuthenticated}}async function Yv(e,t,n,r){const i=new qv(e,n,r);try{await i.connect();return await i.publishEvent(t)}finally{i.close()}}function Wv(e,t,n){const r=e.slice();return r[169]=t[n],r}function Zv(e,t,n){const r=e.slice();return r[179]=t[n],r}function Xv(e,t,n){const r=e.slice();return r[172]=t[n],r}function ew(e,t,n){const r=e.slice();r[172]=t[n];const i=r[52](r[172]);return r[173]=i,r}function tw(e,t,n){const r=e.slice();return r[176]=t[n],r}function nw(t){let n;function r(e,t){return e[1]?hw:pw}let i=r(t),o=i(t);return{c(){n=p("div"),o.c(),A(n,"class","welcome-message svelte-u3u5mw")},m(e,t){u(e,n,t),o.m(n,null)},p(e,t){i===(i=r(e))&&o?o.p(e,t):(o.d(1),o=i(e),o&&(o.c(),o.m(n,null)))},i:e,o:e,d(e){e&&d(n),o.d()}}}function rw(e){let t,n,r=e[6],i=[];for(let t=0;tW(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e=0||""!==t[36]&&parseInt(t[36])>=0,U=dp,P=[];for(let e=0;eEvent Recovery \n

    Search and recover old versions of replaceable events

    ',o=m(),s=p("div"),a=p("div"),l=p("div"),h=p("label"),h.textContent="Select Event Kind:",g=m(),y=p("select"),w=p("option"),w.textContent="Choose a replaceable kind...";for(let e=0;et[115].call(y)),A(l,"class","kind-selector svelte-u3u5mw"),A(x,"for","custom-kind"),A(x,"class","svelte-u3u5mw"),A(S,"id","custom-kind"),A(S,"type","number"),A(S,"placeholder","e.g., 10001"),A(S,"min","0"),A(S,"class","svelte-u3u5mw"),A(C,"class","custom-kind-input svelte-u3u5mw"),A(a,"class","recovery-controls svelte-u3u5mw"),A(s,"class","recovery-controls-card svelte-u3u5mw"),A(n,"class","recovery-tab svelte-u3u5mw")},m(e,r){u(e,n,r),c(n,i),c(n,o),c(n,s),c(s,a),c(a,l),c(l,h),c(l,g),c(l,y),c(y,w);for(let e=0;e=0||""!==e[36]&&parseInt(e[36])>=0),$?R?R.p(e,t):(R=Ew(e),R.c(),R.m(n,null)):R&&(R.d(1),R=null)},i:e,o:e,d(e){e&&d(n),f(P,e),R&&R.d(),F=!1,r(D)}}}function ow(e){let t,n,r;function i(t){e[114](t)}let o={isLoggedIn:e[1],userRole:e[4],isPolicyAdmin:qw,policyEnabled:e[8],isLoadingPolicy:e[27],policyMessage:e[28],policyMessageType:e[29],validationErrors:e[30],policyFollows:e[31]};return void 0!==e[26]&&(o.policyJson=e[26]),t=new qy({props:o}),R.push(()=>Z(t,"policyJson",i)),t.$on("loadPolicy",e[60]),t.$on("validatePolicy",e[61]),t.$on("savePolicy",e[62]),t.$on("formatJson",e[63]),t.$on("addPolicyAdmin",e[64]),t.$on("removePolicyAdmin",e[65]),t.$on("refreshFollows",e[66]),t.$on("openLoginModal",e[70]),{c(){X(t.$$.fragment)},m(e,n){ee(t,e,n),r=!0},p(e,r){const i={};2&r[0]&&(i.isLoggedIn=e[1]),16&r[0]&&(i.userRole=e[4]),256&r[0]&&(i.policyEnabled=e[8]),134217728&r[0]&&(i.isLoadingPolicy=e[27]),268435456&r[0]&&(i.policyMessage=e[28]),536870912&r[0]&&(i.policyMessageType=e[29]),1073741824&r[0]&&(i.validationErrors=e[30]),1&r[1]&&(i.policyFollows=e[31]),!n&&67108864&r[0]&&(n=!0,i.policyJson=e[26],_(()=>n=!1)),t.$set(i)},i(e){r||(Y(t.$$.fragment,e),r=!0)},o(e){W(t.$$.fragment,e),r=!1},d(e){te(t,e)}}}function sw(e){let t,n,r;function i(t){e[111](t)}let o={isLoggedIn:e[1],userRole:e[4],sprocketStatus:e[20],isLoadingSprocket:e[22],sprocketUploadFile:e[25],sprocketMessage:e[23],sprocketMessageType:e[24],sprocketVersions:e[21]};return void 0!==e[19]&&(o.sprocketScript=e[19]),t=new Fy({props:o}),R.push(()=>Z(t,"sprocketScript",i)),t.$on("restartSprocket",e[55]),t.$on("deleteSprocket",e[56]),t.$on("sprocketFileSelect",e[67]),t.$on("uploadSprocketScript",e[68]),t.$on("saveSprocket",e[54]),t.$on("loadSprocket",e[53]),t.$on("loadVersions",e[57]),t.$on("loadVersion",e[112]),t.$on("deleteVersion",e[113]),t.$on("openLoginModal",e[70]),{c(){X(t.$$.fragment)},m(e,n){ee(t,e,n),r=!0},p(e,r){const i={};2&r[0]&&(i.isLoggedIn=e[1]),16&r[0]&&(i.userRole=e[4]),1048576&r[0]&&(i.sprocketStatus=e[20]),4194304&r[0]&&(i.isLoadingSprocket=e[22]),33554432&r[0]&&(i.sprocketUploadFile=e[25]),8388608&r[0]&&(i.sprocketMessage=e[23]),16777216&r[0]&&(i.sprocketMessageType=e[24]),2097152&r[0]&&(i.sprocketVersions=e[21]),!n&&524288&r[0]&&(n=!0,i.sprocketScript=e[19],_(()=>n=!1)),t.$set(i)},i(e){r||(Y(t.$$.fragment,e),r=!0)},o(e){W(t.$$.fragment,e),r=!1},d(e){te(t,e)}}}function aw(e){let t,n,r,i;const o=[Tw,Rw,Pw],s=[];function a(e,t){return"managed"!==e[9]?0:e[1]&&"owner"===e[4]?1:2}return n=a(e),r=s[n]=o[n](e),{c(){t=p("div"),r.c(),A(t,"class","managed-acl-view svelte-u3u5mw")},m(e,r){u(e,t,r),s[n].m(t,null),i=!0},p(e,i){let l=n;n=a(e),n===l?s[n].p(e,i):(z(),W(s[l],1,1,()=>{s[l]=null}),q(),r=s[n],r?r.p(e,i):(r=s[n]=o[n](e),r.c()),Y(r,1),r.m(t,null))},i(e){i||(Y(r),i=!0)},o(e){W(r),i=!1},d(e){e&&d(t),s[n].d()}}}function lw(e){let t,n,r;function i(t){e[110](t)}let o={userPubkey:e[2],userRole:e[4],policyEnabled:e[8],publishError:e[34]};return void 0!==e[33]&&(o.composeEventJson=e[33]),t=new vy({props:o}),R.push(()=>Z(t,"composeEventJson",i)),t.$on("reformatJson",e[90]),t.$on("signEvent",e[91]),t.$on("publishEvent",e[92]),t.$on("clearError",e[93]),{c(){X(t.$$.fragment)},m(e,n){ee(t,e,n),r=!0},p(e,r){const i={};4&r[0]&&(i.userPubkey=e[2]),16&r[0]&&(i.userRole=e[4]),256&r[0]&&(i.policyEnabled=e[8]),8&r[1]&&(i.publishError=e[34]),!n&&4&r[1]&&(n=!0,i.composeEventJson=e[33],_(()=>n=!1)),t.$set(i)},i(e){r||(Y(t.$$.fragment,e),r=!0)},o(e){W(t.$$.fragment,e),r=!1},d(e){te(t,e)}}}function cw(e){let t,n;return t=new Lv({props:{isLoggedIn:e[1],userPubkey:e[2],userSigner:e[13],currentEffectiveRole:e[10]}}),t.$on("openLoginModal",e[70]),{c(){X(t.$$.fragment)},m(e,r){ee(t,e,r),n=!0},p(e,n){const r={};2&n[0]&&(r.isLoggedIn=e[1]),4&n[0]&&(r.userPubkey=e[2]),8192&n[0]&&(r.userSigner=e[13]),1024&n[0]&&(r.currentEffectiveRole=e[10]),t.$set(r)},i(e){n||(Y(t.$$.fragment,e),n=!0)},o(e){W(t.$$.fragment,e),n=!1},d(e){te(t,e)}}}function uw(e){let t,n;return t=new Zm({props:{isLoggedIn:e[1],userRole:e[4],userPubkey:e[2],filteredEvents:e[41],expandedEvents:e[18],isLoadingEvents:e[7],showOnlyMyEvents:zw,showFilterBuilder:e[15]}}),t.$on("scroll",e[89]),t.$on("toggleEventExpansion",e[106]),t.$on("deleteEvent",e[107]),t.$on("copyEventToClipboard",e[108]),t.$on("toggleChange",e[45]),t.$on("loadAllEvents",e[109]),t.$on("toggleFilterBuilder",e[76]),t.$on("filterApply",e[77]),t.$on("filterClear",e[78]),{c(){X(t.$$.fragment)},m(e,r){ee(t,e,r),n=!0},p(e,n){const r={};2&n[0]&&(r.isLoggedIn=e[1]),16&n[0]&&(r.userRole=e[4]),4&n[0]&&(r.userPubkey=e[2]),1024&n[1]&&(r.filteredEvents=e[41]),262144&n[0]&&(r.expandedEvents=e[18]),128&n[0]&&(r.isLoadingEvents=e[7]),32768&n[0]&&(r.showFilterBuilder=e[15]),t.$set(r)},i(e){n||(Y(t.$$.fragment,e),n=!0)},o(e){W(t.$$.fragment,e),n=!1},d(e){te(t,e)}}}function dw(e){let t,n;return t=new Zg({props:{isLoggedIn:e[1],currentEffectiveRole:e[10],selectedFile:e[16],aclMode:e[9],importMessage:e[17]}}),t.$on("fileSelect",e[86]),t.$on("importEvents",e[87]),t.$on("openLoginModal",e[70]),{c(){X(t.$$.fragment)},m(e,r){ee(t,e,r),n=!0},p(e,n){const r={};2&n[0]&&(r.isLoggedIn=e[1]),1024&n[0]&&(r.currentEffectiveRole=e[10]),65536&n[0]&&(r.selectedFile=e[16]),512&n[0]&&(r.aclMode=e[9]),131072&n[0]&&(r.importMessage=e[17]),t.$set(r)},i(e){n||(Y(t.$$.fragment,e),n=!0)},o(e){W(t.$$.fragment,e),n=!1},d(e){te(t,e)}}}function fw(e){let t,n;return t=new Jg({props:{isLoggedIn:e[1],currentEffectiveRole:e[10],aclMode:e[9]}}),t.$on("exportMyEvents",e[85]),t.$on("exportAllEvents",e[84]),t.$on("openLoginModal",e[70]),{c(){X(t.$$.fragment)},m(e,r){ee(t,e,r),n=!0},p(e,n){const r={};2&n[0]&&(r.isLoggedIn=e[1]),1024&n[0]&&(r.currentEffectiveRole=e[10]),512&n[0]&&(r.aclMode=e[9]),t.$set(r)},i(e){n||(Y(t.$$.fragment,e),n=!0)},o(e){W(t.$$.fragment,e),n=!1},d(e){te(t,e)}}}function pw(t){let n;return{c(){n=p("p"),n.textContent="Log in to access your user dashboard",A(n,"class","svelte-u3u5mw")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function hw(e){let t,n,r,i=(e[3]?.name||e[2].slice(0,8)+"...")+"";return{c(){t=p("p"),n=g("Welcome "),r=g(i),A(t,"class","svelte-u3u5mw")},m(e,i){u(e,t,i),c(t,n),c(t,r)},p(e,t){12&t[0]&&i!==(i=(e[3]?.name||e[2].slice(0,8)+"...")+"")&&k(r,i)},d(e){e&&d(t)}}}function gw(e){let t,n,i,o,s,a,l,f,h,y,w,b,I,C,E,x,B,S,Q,F,D,$=e[179].label+"",U=e[42].get(e[179].id)?.isLoading,P=!e[42].get(e[179].id)?.hasMore&&e[42].get(e[179].id)?.events?.length>0;function R(){return e[120](e[179])}function T(e,t){return 64&t[0]&&(C=null),64&t[0]&&(E=null),null==C&&(C=!!(e[42].get(e[179].id)?.events?.length>0)),C?yw:(null==E&&(E=!e[42].get(e[179].id)?.isLoading),E?mw:void 0)}w=new Gv({props:{filter:e[42].get(e[179].id)?.filter||{}}}),w.$on("sweep",function(){return e[121](e[179])});let N=T(e,[-1,-1,-1,-1,-1,-1]),O=N&&N(e),M=U&&bw(),L=P&&kw();function _(...t){return e[126](e[179],...t)}return{c(){t=p("div"),n=p("div"),i=p("h2"),o=g("🔍 "),s=g($),a=m(),l=p("button"),f=g("🔄 Refresh"),y=m(),X(w.$$.fragment),b=m(),I=p("div"),O&&O.c(),x=m(),M&&M.c(),B=m(),L&&L.c(),S=m(),A(i,"class","svelte-u3u5mw"),A(l,"class","refresh-btn svelte-u3u5mw"),l.disabled=h=e[42].get(e[179].id)?.isLoading,A(n,"class","search-results-header svelte-u3u5mw"),A(I,"class","search-results-content svelte-u3u5mw"),A(t,"class","search-results-view svelte-u3u5mw")},m(e,r){u(e,t,r),c(t,n),c(n,i),c(i,o),c(i,s),c(n,a),c(n,l),c(l,f),c(t,y),ee(w,t,null),c(t,b),c(t,I),O&&O.m(I,null),c(I,x),M&&M.m(I,null),c(I,B),L&&L.m(I,null),c(t,S),Q=!0,F||(D=[v(l,"click",R),v(I,"scroll",_)],F=!0)},p(t,n){e=t,(!Q||64&n[0])&&$!==($=e[179].label+"")&&k(s,$),(!Q||64&n[0]&&h!==(h=e[42].get(e[179].id)?.isLoading))&&(l.disabled=h);const r={};64&n[0]&&(r.filter=e[42].get(e[179].id)?.filter||{}),w.$set(r),N===(N=T(e,n))&&O?O.p(e,n):(O&&O.d(1),O=N&&N(e),O&&(O.c(),O.m(I,x))),64&n[0]&&(U=e[42].get(e[179].id)?.isLoading),U?M||(M=bw(),M.c(),M.m(I,B)):M&&(M.d(1),M=null),64&n[0]&&(P=!e[42].get(e[179].id)?.hasMore&&e[42].get(e[179].id)?.events?.length>0),P?L||(L=kw(),L.c(),L.m(I,null)):L&&(L.d(1),L=null)},i(e){Q||(Y(w.$$.fragment,e),Q=!0)},o(e){W(w.$$.fragment,e),Q=!1},d(e){e&&d(t),te(w),O&&O.d(),M&&M.d(),L&&L.d(),F=!1,r(D)}}}function mw(t){let n;return{c(){n=p("div"),n.innerHTML='

    No search results found.

    ',A(n,"class","no-search-results svelte-u3u5mw")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function yw(e){let t,n=e[42].get(e[179].id).events,r=[];for(let t=0;t👤',o=m(),s=p("div"),a=p("div"),l=g(O),f=m(),h=p("div"),y=p("span"),w=g(M),b=m(),I=p("span"),C=g(L),E=m(),B=p("div"),S=p("div"),Q=g(_),F=m(),D=p("div"),$=g(H),U=m(),G&&G.c(),P=m(),V&&V.c(),R=m(),A(i,"class","search-result-avatar svelte-u3u5mw"),A(a,"class","search-result-author svelte-u3u5mw"),A(y,"class","kind-number svelte-u3u5mw"),A(I,"class","kind-name svelte-u3u5mw"),A(h,"class","search-result-kind svelte-u3u5mw"),A(s,"class","search-result-info svelte-u3u5mw"),A(S,"class","event-timestamp svelte-u3u5mw"),A(D,"class","event-content-single-line svelte-u3u5mw"),A(B,"class","search-result-content svelte-u3u5mw"),A(n,"class","search-result-row svelte-u3u5mw"),A(n,"role","button"),A(n,"tabindex","0"),A(t,"class","search-result-item svelte-u3u5mw"),x(t,"expanded",e[18].has(e[172].id))},m(e,r){u(e,t,r),c(t,n),c(n,i),c(n,o),c(n,s),c(s,a),c(a,l),c(s,f),c(s,h),c(h,y),c(y,w),c(h,b),c(h,I),c(I,C),c(n,E),c(n,B),c(B,S),c(S,Q),c(B,F),c(B,D),c(D,$),c(n,U),G&&G.m(n,null),c(t,P),V&&V.m(t,null),c(t,R),T||(N=[v(n,"click",J),v(n,"keydown",K)],T=!0)},p(r,i){e=r,64&i[0]&&O!==(O=Kv(e[172].pubkey)+"")&&k(l,O),64&i[0]&&M!==(M=e[172].kind+"")&&k(w,M),64&i[0]&&L!==(L=Jv(e[172].kind)+"")&&k(C,L),64&i[0]&&_!==(_=zv(e[172].created_at)+"")&&k(Q,_),64&i[0]&&H!==(H=Vv(e[172].content)+"")&&k($,H),5!==e[172].kind&&("admin"===e[4]||"owner"===e[4]||"write"===e[4]&&e[172].pubkey&&e[172].pubkey===e[2])?G?G.p(e,i):(G=vw(e),G.c(),G.m(n,null)):G&&(G.d(1),G=null),262208&i[0]&&(j=e[18].has(e[172].id)),j?V?V.p(e,i):(V=ww(e),V.c(),V.m(t,R)):V&&(V.d(1),V=null),262208&i[0]|2048&i[1]&&x(t,"expanded",e[18].has(e[172].id))},d(e){e&&d(t),G&&G.d(),V&&V.d(),T=!1,r(N)}}}function bw(e){let t;return{c(){t=p("div"),t.innerHTML='
    \n

    Searching...

    ',A(t,"class","loading-search-results svelte-u3u5mw")},m(e,n){u(e,t,n)},d(e){e&&d(t)}}}function kw(e){let t;return{c(){t=p("div"),t.innerHTML='

    No more search results to load.

    ',A(t,"class","end-of-search-results svelte-u3u5mw")},m(e,n){u(e,t,n)},d(e){e&&d(t)}}}function Iw(e){let t,n,r=e[179].id===e[5]&&gw(e);return{c(){r&&r.c(),t=y()},m(e,i){r&&r.m(e,i),u(e,t,i),n=!0},p(e,n){e[179].id===e[5]?r?(r.p(e,n),96&n[0]&&Y(r,1)):(r=gw(e),r.c(),Y(r,1),r.m(t.parentNode,t)):r&&(z(),W(r,1,1,()=>{r=null}),q())},i(e){n||(Y(r),n=!0)},o(e){W(r),n=!1},d(e){r&&r.d(e),e&&d(t)}}}function Cw(t){let n,r,i=t[176].label+"";return{c(){n=p("option"),r=g(i),n.__value=t[176].value,n.value=n.__value},m(e,t){u(e,n,t),c(n,r)},p:e,d(e){e&&d(n)}}}function Ew(e){let t;function n(e,t){return e[38]?Sw:0===e[37].length?Bw:xw}let r=n(e),i=r(e);return{c(){t=p("div"),i.c(),A(t,"class","recovery-results svelte-u3u5mw")},m(e,n){u(e,t,n),i.m(t,null)},p(e,o){r===(r=n(e))&&i?i.p(e,o):(i.d(1),i=r(e),i&&(i.c(),i.m(t,null)))},d(e){e&&d(t),i.d()}}}function xw(e){let t,n,r,i=e[37],o=[];for(let t=0;tORLY_ACL_MODE=managed in your\n environment variables and restart the relay.',A(r,"class","svelte-u3u5mw"),A(o,"class","svelte-u3u5mw"),A(a,"class","svelte-u3u5mw"),A(v,"class","svelte-u3u5mw"),A(n,"class","acl-mode-warning svelte-u3u5mw")},m(e,t){u(e,n,t),c(n,r),c(n,i),c(n,o),c(n,s),c(n,a),c(a,l),c(a,f),c(f,h),c(n,y),c(n,v)},p(e,t){512&t[0]&&w!==(w=(e[9]||"unknown")+"")&&k(h,w)},i:e,o:e,d(e){e&&d(n)}}}function Nw(e){let t,n,i,o,s,a,l,f,h,g;function y(e,t){return e[3]?Mw:e[1]&&e[2]?Ow:void 0}let b=y(e),k=b&&b(e);return{c(){t=p("div"),n=p("div"),i=p("div"),o=p("h2"),o.textContent="Settings",s=m(),a=p("button"),a.textContent="✕",l=m(),f=p("div"),k&&k.c(),A(o,"class","svelte-u3u5mw"),A(a,"class","close-btn svelte-u3u5mw"),A(i,"class","drawer-header svelte-u3u5mw"),A(f,"class","drawer-content"),A(n,"class","settings-drawer svelte-u3u5mw"),x(n,"dark-theme",e[0]),A(t,"class","drawer-overlay svelte-u3u5mw"),A(t,"role","button"),A(t,"tabindex","0")},m(r,d){u(r,t,d),c(t,n),c(n,i),c(i,o),c(i,s),c(i,a),c(n,l),c(n,f),k&&k.m(f,null),h||(g=[v(a,"click",e[75]),v(n,"click",w(e[101])),v(n,"keydown",w(e[102])),v(t,"click",e[75]),v(t,"keydown",e[128])],h=!0)},p(e,t){b===(b=y(e))&&k?k.p(e,t):(k&&k.d(1),k=b&&b(e),k&&(k.c(),k.m(f,null))),1&t[0]&&x(n,"dark-theme",e[0])},d(e){e&&d(t),k&&k.d(),h=!1,r(g)}}}function Ow(e){let t,n,i,o,s,a,l,f,h,y,w,b,I,C,E,x,B,S=e[2].slice(0,16)+"",Q=e[2].slice(-8)+"";return{c(){t=p("div"),n=p("button"),n.textContent="Log out",i=m(),o=p("h3"),o.textContent="Profile Loading",s=m(),a=p("p"),a.textContent="Your profile metadata is being loaded...",l=m(),f=p("button"),f.textContent="Retry Loading Profile",h=m(),y=p("div"),w=p("strong"),w.textContent="Public Key:",b=m(),I=g(S),C=g("..."),E=g(Q),A(n,"class","logout-btn floating svelte-u3u5mw"),A(o,"class","svelte-u3u5mw"),A(a,"class","svelte-u3u5mw"),A(f,"class","retry-profile-btn svelte-u3u5mw"),A(y,"class","user-pubkey-display svelte-u3u5mw"),A(t,"class","profile-loading-section svelte-u3u5mw")},m(r,d){u(r,t,d),c(t,n),c(t,i),c(t,o),c(t,s),c(t,a),c(t,l),c(t,f),c(t,h),c(t,y),c(y,w),c(y,b),c(y,I),c(y,C),c(y,E),x||(B=[v(n,"click",e[72]),v(f,"click",e[83])],x=!0)},p(e,t){4&t[0]&&S!==(S=e[2].slice(0,16)+"")&&k(I,S),4&t[0]&&Q!==(Q=e[2].slice(-8)+"")&&k(E,Q)},d(e){e&&d(t),x=!1,r(B)}}}function Mw(e){let t,n,r,i,o,s,a,l,f,h,w,b,I,C,E,x=(e[3].name||"Unknown User")+"",B=e[3].banner&&Lw(e);function S(e,t){return e[3].picture?Hw:_w}let Q=S(e),F=Q(e),D=e[3].nip05&&jw(e),$=e[3].about&&Gw(e),U=e[4]&&"read"!==e[4]&&Jw(e);return{c(){t=p("div"),n=p("div"),B&&B.c(),r=m(),i=p("button"),i.textContent="Log out",o=m(),F.c(),s=m(),a=p("div"),l=p("h3"),f=g(x),h=m(),D&&D.c(),w=m(),$&&$.c(),b=m(),U&&U.c(),I=y(),A(i,"class","logout-btn floating svelte-u3u5mw"),A(l,"class","profile-username svelte-u3u5mw"),A(a,"class","name-row svelte-u3u5mw"),A(n,"class","profile-hero svelte-u3u5mw"),A(t,"class","profile-section svelte-u3u5mw")},m(d,p){u(d,t,p),c(t,n),B&&B.m(n,null),c(n,r),c(n,i),c(n,o),F.m(n,null),c(n,s),c(n,a),c(a,l),c(l,f),c(a,h),D&&D.m(a,null),c(t,w),$&&$.m(t,null),u(d,b,p),U&&U.m(d,p),u(d,I,p),C||(E=v(i,"click",e[72]),C=!0)},p(e,i){e[3].banner?B?B.p(e,i):(B=Lw(e),B.c(),B.m(n,r)):B&&(B.d(1),B=null),Q===(Q=S(e))&&F?F.p(e,i):(F.d(1),F=Q(e),F&&(F.c(),F.m(n,s))),8&i[0]&&x!==(x=(e[3].name||"Unknown User")+"")&&k(f,x),e[3].nip05?D?D.p(e,i):(D=jw(e),D.c(),D.m(a,null)):D&&(D.d(1),D=null),e[3].about?$?$.p(e,i):($=Gw(e),$.c(),$.m(t,null)):$&&($.d(1),$=null),e[4]&&"read"!==e[4]?U?U.p(e,i):(U=Jw(e),U.c(),U.m(I.parentNode,I)):U&&(U.d(1),U=null)},d(e){e&&d(t),B&&B.d(),F.d(),D&&D.d(),$&&$.d(),e&&d(b),U&&U.d(e),e&&d(I),C=!1,E()}}}function Lw(e){let t,n;return{c(){t=p("img"),a(t.src,n=e[3].banner)||A(t,"src",n),A(t,"alt","Profile banner"),A(t,"class","profile-banner svelte-u3u5mw")},m(e,n){u(e,t,n)},p(e,r){8&r[0]&&!a(t.src,n=e[3].banner)&&A(t,"src",n)},d(e){e&&d(t)}}}function _w(t){let n;return{c(){n=p("div"),n.textContent="👤",A(n,"class","profile-avatar-placeholder overlap svelte-u3u5mw")},m(e,t){u(e,n,t)},p:e,d(e){e&&d(n)}}}function Hw(e){let t,n;return{c(){t=p("img"),a(t.src,n=e[3].picture)||A(t,"src",n),A(t,"alt","User avatar"),A(t,"class","profile-avatar overlap svelte-u3u5mw")},m(e,n){u(e,t,n)},p(e,r){8&r[0]&&!a(t.src,n=e[3].picture)&&A(t,"src",n)},d(e){e&&d(t)}}}function jw(e){let t,n,r=e[3].nip05+"";return{c(){t=p("span"),n=g(r),A(t,"class","profile-nip05-inline svelte-u3u5mw")},m(e,r){u(e,t,r),c(t,n)},p(e,t){8&t[0]&&r!==(r=e[3].nip05+"")&&k(n,r)},d(e){e&&d(t)}}}function Gw(e){let t,n;return{c(){t=p("div"),n=p("p"),A(n,"class","profile-about svelte-u3u5mw"),A(t,"class","about-card svelte-u3u5mw")},m(r,i){u(r,t,i),c(t,n),n.innerHTML=e[40]},p(e,t){512&t[1]&&(n.innerHTML=e[40])},d(e){e&&d(t)}}}function Jw(e){let t,n,r,i,o,s,a=e[95](),l=[];for(let t=0;tZ(y,"showModal",E)),y.$on("login",e[71]),y.$on("close",e[73]),{c(){X(t.$$.fragment),n=m(),r=p("div"),X(i.$$.fragment),o=m(),s=p("main"),f.c(),h=m(),C&&C.c(),g=m(),X(y.$$.fragment),A(s,"class","main-content svelte-u3u5mw"),A(r,"class","app-container svelte-u3u5mw"),x(r,"dark-theme",e[0])},m(e,a){ee(t,e,a),u(e,n,a),u(e,r,a),ee(i,r,null),c(r,o),c(r,s),k[l].m(s,null),u(e,h,a),C&&C.m(e,a),u(e,g,a),ee(y,e,a),w=!0},p(e,n){const o={};1&n[0]&&(o.isDarkTheme=e[0]),2&n[0]&&(o.isLoggedIn=e[1]),16&n[0]&&(o.userRole=e[4]),1024&n[0]&&(o.currentEffectiveRole=e[10]),8&n[0]&&(o.userProfile=e[3]),4&n[0]&&(o.userPubkey=e[2]),t.$set(o);const a={};1&n[0]&&(a.isDarkTheme=e[0]),2048&n[0]&&(a.tabs=e[11]),32&n[0]&&(a.selectedTab=e[5]),2&n[1]&&(a.version=e[32]),i.$set(a);let c=l;l=I(e,n),l===c?k[l].p(e,n):(z(),W(k[c],1,1,()=>{k[c]=null}),q(),f=k[l],f?f.p(e,n):(f=k[l]=b[l](e),f.c()),Y(f,1),f.m(s,null)),(!w||1&n[0])&&x(r,"dark-theme",e[0]),e[14]?C?C.p(e,n):(C=Nw(e),C.c(),C.m(g.parentNode,g)):C&&(C.d(1),C=null);const u={};1&n[0]&&(u.isDarkTheme=e[0]),!v&&4096&n[0]&&(v=!0,u.showModal=e[12],_(()=>v=!1)),y.$set(u)},i(e){w||(Y(t.$$.fragment,e),Y(i.$$.fragment,e),Y(f),Y(y.$$.fragment,e),w=!0)},o(e){W(t.$$.fragment,e),W(i.$$.fragment,e),W(f),W(y.$$.fragment,e),w=!1},d(e){te(t,e),e&&d(n),e&&d(r),te(i),k[l].d(),e&&d(h),C&&C.d(e),e&&d(g),te(y,e)}}}let zw=!1,qw=!1;function Yw(e,t,n){let r,i,o,s,a;"undefined"!=typeof window&&(window.debugIndexedDB=Dp);let l=!1,c=!1,u=!1,d="",f="",p=null,h="",g=null,m=!1,y=localStorage.getItem("selectedTab")||"export",v=!1,w={},A=[],k=[],I=null,C="",E=new Set,x=!1,B=!0,S=null,Q="",F=new Map,D=[],$=0,P=[],R=!0,T=null,N="",O=null,M=[],L=!1,_="",H="info",j=!1,G=null,J="",K=!1,V=!1,z="",q="info",Y=[],W=[],Z="",X="",ee="",te="",ne=null,re="",ie=[],oe=!1,se=!0,ae=null;function le(e){E.has(e)?E.delete(e):E.add(e),n(18,E)}async function ce(e,t){const n=JSON.stringify(e),r=await async function(e){try{return await navigator.clipboard.writeText(e),!0}catch(t){console.error("Failed to copy to clipboard:",t);try{const t=document.createElement("textarea");return t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),!0}catch(e){return console.error("Fallback copy also failed:",e),!1}}}(n);!function(e,t=!0){if(!e)return;const n=e.textContent,r=e.style.backgroundColor;t?(e.textContent="",e.style.backgroundColor="#4CAF50"):(e.textContent="L",e.style.backgroundColor="#f44336"),setTimeout(()=>{e.textContent=n,e.style.backgroundColor=r},2e3)}(t.target.closest(".copy-json-btn"),r),r||alert("Failed to copy to clipboard. Please copy manually.")}async function ue(e){if(!u)return void alert("Please log in first");const t=k.find(t=>t.id===e);if(!t)return void alert("Event not found");if("admin"===h||"owner"===h||"write"===h&&t.pubkey&&t.pubkey===d){if(confirm("Are you sure you want to delete this event?"))try{if(!g)throw new Error("Signer not available for signing");const r={kind:5,created_at:Math.floor(Date.now()/1e3),tags:[["e",e]],content:""};console.log("Created delete event template:",r),console.log("User pubkey:",d),console.log("Target event:",t),console.log("Target event pubkey:",t.pubkey);const i=await g.signEvent(r);console.log("Signed delete event:",i),console.log("Signed delete event pubkey:",i.pubkey),console.log("Delete event tags:",i.tags);const o=`${window.location.protocol.startsWith("https")?"wss:":"ws:"}//${window.location.host}/`;try{const e=await Yv(o,i,g,d);e.success?console.log("Delete event published successfully to ORLY relay"):console.error("Failed to publish delete event:",e.reason)}catch(e){console.error("Error publishing delete event:",e)}const s=t.pubkey&&t.pubkey===d;if(s){const t=await gp.publish(i);if(console.log("Delete event published:",t),!(t.success&&t.okCount>0))throw new Error("No relays accepted the delete event");{await new Promise(e=>setTimeout(e,2e3));try{const n=await Bp(e,{timeout:5e3});n?(console.warn("Event still exists after deletion attempt:",n),alert(`Warning: Delete event was accepted by ${t.okCount} relay(s), but the event still exists on the relay. This may indicate the relay does not properly handle delete events.`)):console.log("Event successfully deleted and verified")}catch(e){console.log("Could not fetch event after deletion (likely deleted):",e.message)}try{const t=await Sp(e,{timeout:5e3});if(t.length>0){console.log(`Delete event verification: Found ${t.length} delete event(s) targeting ${e}`);const n=t.find(e=>e.pubkey&&e.pubkey===d);n?console.log("Our delete event found in database:",n.id):console.warn("Our delete event not found in database, but other delete events exist")}else console.warn("No delete events found in database for target event:",e)}catch(e){console.log("Could not verify delete event in database:",e.message)}n(96,k=k.filter(t=>t.id!==e)),P=P.filter(t=>t.id!==e),D=D.filter(t=>t.id!==e);for(const[t,n]of F)n.events&&(n.events=n.events.filter(t=>t.id!==e),F.set(t,n));he(),console.log("Reloading events to show delete event...");const r=zw&&u&&d?[d]:null;await Pe(!0,r),alert(`Event deleted successfully (accepted by ${t.okCount} relay(s))`)}}else{const t=`${window.location.protocol.startsWith("https")?"wss:":"ws:"}//${window.location.host}/`,r=new hp;await r.connectToRelay(t);const o=await r.publish(i);if(console.log("Delete event published to local relay only:",o),!(o.success&&o.okCount>0))throw new Error("Local relay did not accept the delete event");{await new Promise(e=>setTimeout(e,2e3));try{const t=await Bp(e,{timeout:5e3});t?(console.warn("Event still exists after deletion attempt:",t),alert(`Warning: Delete event was accepted by ${o.okCount} relay(s), but the event still exists on the relay. This may indicate the relay does not properly handle delete events.`)):console.log("Event successfully deleted and verified")}catch(e){console.log("Could not fetch event after deletion (likely deleted):",e.message)}try{const t=await Sp(e,{timeout:5e3});if(t.length>0){console.log(`Delete event verification: Found ${t.length} delete event(s) targeting ${e}`);const n=t.find(e=>e.pubkey&&e.pubkey===d);n?console.log("Our delete event found in database:",n.id):console.warn("Our delete event not found in database, but other delete events exist")}else console.warn("No delete events found in database for target event:",e)}catch(e){console.log("Could not verify delete event in database:",e.message)}n(96,k=k.filter(t=>t.id!==e)),P=P.filter(t=>t.id!==e),D=D.filter(t=>t.id!==e);for(const[t,n]of F)n.events&&(n.events=n.events.filter(t=>t.id!==e),F.set(t,n));he(),console.log("Reloading events to show delete event...");const t=zw&&u&&d?[d]:null;await Pe(!0,t),alert("Event deleted successfully (local relay only - admin/owner deleting other user's event)")}}}catch(e){console.error("Failed to delete event:",e),alert("Failed to delete event: "+e.message)}}else alert("You do not have permission to delete this event")}async function de(){const e=re?parseInt(re):ne;if(null==e||isNaN(e))console.log("No valid kind to load, kindToUse:",e);else if(u){console.log("Loading recovery events for kind:",e,"user:",d),n(38,oe=!0);try{const t=[{kinds:[e],authors:[d],limit:100}];ae&&(t[0].until=ae),console.log("Recovery filters:",t);const r=await Fp(t,{timeout:3e4,cacheFirst:!0});console.log("Recovery events received:",r.length),console.log("Recovery events kinds:",r.map(e=>e.kind)),n(37,ie=ae?[...ie,...r]:r),r.length>0?(ae=Math.min(...r.map(e=>e.created_at)),n(39,se=100===r.length)):n(39,se=!1)}catch(e){console.error("Failed to load recovery events:",e)}finally{n(38,oe=!1)}}else console.log("Not logged in, cannot load recovery events")}async function fe(e){if(confirm("Are you sure you want to repost this event?"))try{const t=`${window.location.protocol.startsWith("https")?"wss:":"ws:"}//${window.location.host}/`;console.log("Reposting event to local relay:",t,e);const r={...e};if(r.created_at=Math.floor(Date.now()/1e3),r.id="",r.sig="",e.kind>=3e4&&e.kind<=39999){const t=e.tags.find(e=>"d"===e[0]);t&&(r.tags=r.tags.filter(e=>"d"!==e[0]),r.tags.push(t))}if(g){const e=await g.signEvent(r);console.log("Signed event for repost:",e);const i=await gp.publish(e,[t]);console.log("Repost publish result:",i),i.success&&i.okCount>0?(alert("Event reposted successfully!"),n(39,se=!1),await de()):alert("Failed to repost event. Check console for details.")}else alert("No signer available. Please log in.")}catch(e){console.error("Error reposting event:",e),alert("Error reposting event: "+e.message)}}async function pe(e){if(confirm("Are you sure you want to repost this event to all your write relays?"))try{const t=await async function(){if(!d)return[];try{const e=await kp([{kinds:[10002],authors:[d],limit:1}]);if(0===e.length)return console.log("No relay list event found for user"),[];const t=e[0];console.log("Found relay list event:",t);const n=[];for(const e of t.tags)if("r"===e[0]&&e.length>=2){const t=e[1],r=e.length>=3?e[2]:null;r&&"write"!==r||n.push(t)}return console.log("Found write relays:",n),n}catch(e){return console.error("Error fetching user write relays:",e),[]}}(),r=`${window.location.protocol.startsWith("https")?"wss:":"ws:"}//${window.location.host}/`,i=[r,...t.filter(e=>e!==r)];1===i.length&&alert("No write relays found in your relay list. Only posting to local relay."),console.log("Reposting event to all relays:",i,e);const o={...e};if(o.created_at=Math.floor(Date.now()/1e3),o.id="",o.sig="",e.kind>=3e4&&e.kind<=39999){const t=e.tags.find(e=>"d"===e[0]);t&&(o.tags=o.tags.filter(e=>"d"!==e[0]),o.tags.push(t))}if(g){const e=await g.signEvent(o);console.log("Signed event for repost to all:",e);const t=await gp.publish(e,i);console.log("Repost to all publish result:",t),t.success&&t.okCount>0?(alert(`Event reposted successfully to ${i.length} relays!`),n(39,se=!1),await de()):alert("Failed to repost event. Check console for details.")}else alert("No signer available. Please log in.")}catch(e){console.error("Error reposting event to all:",e),alert("Error reposting event to all: "+e.message)}}if("undefined"!=typeof window&&window.matchMedia){const e=window.matchMedia("(prefers-color-scheme: dark)");l=e.matches,e.addEventListener("change",e=>{n(0,l=e.matches)})}if("undefined"!=typeof localStorage){const e=localStorage.getItem("nostr_auth_method"),t=localStorage.getItem("nostr_pubkey");e&&t&&(u=!0,d=t,f=e,"extension"===e&&window.nostr&&(g=window.nostr),De(),$e()),function(){if("undefined"==typeof localStorage)return;try{const t=localStorage.getItem("app_state");if(t){const r=JSON.parse(t);r.selectedTab&&Ie.some(e=>e.id===r.selectedTab)&&n(5,y=r.selectedTab),r.expandedEvents&&n(18,E=new Set(r.expandedEvents)),r.globalEventsCache&&(D=r.globalEventsCache),r.globalCacheTimestamp&&($=r.globalCacheTimestamp),void 0!==r.hasMoreEvents&&(B=r.hasMoreEvents),r.oldestEventTimestamp&&(S=r.oldestEventTimestamp),void 0!==r.hasMoreMyEvents&&(R=r.hasMoreMyEvents),r.oldestMyEventTimestamp&&(T=r.oldestMyEventTimestamp),D.length>0&&((e=$)&&Date.now()-et.created_at-e.created_at),$=Date.now(),he()}async function me(){if(u&&"owner"===h&&j)try{n(22,L=!0);const e=await fetch("/api/sprocket/status",{method:"GET",headers:{Authorization:`Nostr ${await Oe("GET","/api/sprocket/status")}`,"Content-Type":"application/json"}});e.ok?n(20,O=await e.json()):Ae("Failed to load sprocket status","error")}catch(e){Ae(`Error loading sprocket status: ${e.message}`,"error")}finally{n(22,L=!1)}}async function ye(){if(u&&"owner"===h)try{n(22,L=!0);const e=await fetch("/api/sprocket/versions",{method:"GET",headers:{Authorization:`Nostr ${await Oe("GET","/api/sprocket/versions")}`,"Content-Type":"application/json"}});e.ok?n(21,M=await e.json()):Ae("Failed to load versions","error")}catch(e){Ae(`Error loading versions: ${e.message}`,"error")}finally{n(22,L=!1)}}async function ve(e){u&&"owner"===h&&(n(19,N=e.content),Ae(`Loaded version: ${e.name}`,"success"))}async function we(e){if(u&&"owner"===h&&confirm(`Are you sure you want to delete version ${e}?`))try{n(22,L=!0);const t=await fetch("/api/sprocket/delete-version",{method:"POST",headers:{Authorization:`Nostr ${await Oe("POST","/api/sprocket/delete-version")}`,"Content-Type":"application/json"},body:JSON.stringify({filename:e})});if(t.ok)Ae(`Version ${e} deleted successfully`,"success"),await ye();else{Ae(`Failed to delete version: ${await t.text()}`,"error")}}catch(e){Ae(`Error deleting version: ${e.message}`,"error")}finally{n(22,L=!1)}}function Ae(e,t="info"){n(23,_=e),n(24,H=t),setTimeout(()=>{n(23,_="")},5e3)}function be(e,t="info"){n(28,z=e),n(29,q=t),"error"!==t&&setTimeout(()=>{n(28,z="")},5e3)}async function ke(){if(n(30,Y=[]),!J.trim())return n(30,Y=["Policy JSON is empty"]),be("Validation failed","error"),!1;try{const e=JSON.parse(J);if("object"!=typeof e||null===e)return n(30,Y=["Policy must be a JSON object"]),be("Validation failed","error"),!1;if(e.policy_admins)if(Array.isArray(e.policy_admins))for(const t of e.policy_admins)"string"==typeof t&&/^[0-9a-fA-F]{64}$/.test(t)||Y.push(`Invalid policy_admin pubkey: ${t}`);else Y.push("policy_admins must be an array");if(e.rules)if("object"!=typeof e.rules)Y.push("rules must be an object");else for(const[t,n]of Object.entries(e.rules))if(/^\d+$/.test(t)||Y.push(`Invalid kind number: ${t}`),n.tag_validation&&"object"==typeof n.tag_validation)for(const[e,t]of Object.entries(n.tag_validation))try{new RegExp(t)}catch(n){Y.push(`Invalid regex for tag '${e}': ${t}`)}return e.default_policy&&!["allow","deny"].includes(e.default_policy)&&Y.push("default_policy must be 'allow' or 'deny'"),Y.length>0?(be("Validation failed - see errors below","error"),!1):(be("Validation passed","success"),!0)}catch(e){return n(30,Y=[`JSON parse error: ${e.message}`]),be("Invalid JSON syntax","error"),!1}}const Ie=[{id:"export",icon:"📤",label:"Export"},{id:"import",icon:"💾",label:"Import",requiresAdmin:!0},{id:"events",icon:"📡",label:"Events"},{id:"blossom",icon:"🌸",label:"Blossom"},{id:"compose",icon:"✏️",label:"Compose",requiresWrite:!0},{id:"recovery",icon:"🔄",label:"Recovery"},{id:"managed-acl",icon:"🛡️",label:"Managed ACL",requiresOwner:!0},{id:"sprocket",icon:"⚙️",label:"Sprocket",requiresOwner:!0},{id:"policy",icon:"📜",label:"Policy",requiresOwner:!0}];function Ce(e){n(5,y=e),"sprocket"===e&&u&&"owner"===h&&j&&(me(),ye()),he()}function Ee(){n(14,m=!1)}function xe(e){Be(e)}function Be(e){n(6,A=A.filter(t=>t.id!==e)),F.delete(e),y===e&&n(5,y="export")}async function Se(e,t=!0){const n=F.get(e);if(n&&!n.isLoading){n.isLoading=!0,F.set(e,n);try{const r={...n.filter};!t&&n.oldestTimestamp&&(r.until=n.oldestTimestamp),t||(r.limit=200),console.log("Loading search results with filter:",r);const i=await xp([r],{timeout:3e4});if(console.log("Received search results:",i.length,"events"),n.events=t?i.sort((e,t)=>t.created_at-e.created_at):[...n.events,...i].sort((e,t)=>t.created_at-e.created_at),i.length>0){const e=Math.min(...i.map(e=>e.created_at));(!n.oldestTimestamp||e0){const e=o.filter(e=>e.pubkey&&e.pubkey!==d);e.length>0&&console.warn("Server returned non-user events:",e.length,"out of",o.length)}if(e?(n(96,k=o.sort((e,t)=>t.created_at-e.created_at)),ge(o)):(n(96,k=[...k,...o].sort((e,t)=>t.created_at-e.created_at)),ge(k)),o.length>0){const e=Math.min(...o.map(e=>e.created_at));(!S||e{if("events"===y){const e=document.querySelectorAll(".events-view-content")[0];e&&e.scrollHeight<=e.clientHeight&&Re()}},100)}catch(e){console.error("Failed to load events:",e),alert("Failed to load events: "+e.message)}finally{n(7,x=!1)}}}async function Re(){await Pe(!1)}let Te=!1;async function Ne(e,t){if(!u||!d)throw new Error("Not logged in");const n={kind:27235,created_at:Math.floor(Date.now()/1e3),tags:[["u",window.location.origin+e],["method",t.toUpperCase()]],content:"",pubkey:d};let r;if(g&&"extension"===f)try{r=await g.signEvent(n)}catch(e){throw new Error("Failed to sign with extension: "+e.message)}else{if("nsec"!==f)throw new Error("No valid signer available");n.id="mock-id-"+Date.now(),n.sig="mock-signature-"+Date.now(),r=n}const i=JSON.stringify(r);return`Nostr ${btoa(i)}`}async function Oe(e,t){if(!u||!d)throw new Error("Not logged in");const n={kind:27235,created_at:Math.floor(Date.now()/1e3),tags:[["u",window.location.origin+t],["method",e.toUpperCase()]],content:"",pubkey:d};let r;if(g&&"extension"===f)try{r=await g.signEvent(n)}catch(e){throw new Error("Failed to sign with extension: "+e.message)}else{if("nsec"!==f)throw new Error("No valid signer available");n.id="mock-id-"+Date.now(),n.sig="mock-signature-"+Date.now(),r=n}const i=JSON.stringify(r);return btoa(i)}function Me(e,t){const n=e.toLowerCase();if(n.includes("policy")||n.includes("blocked")||n.includes("denied")){let n=`Policy Error: ${e}`;return null!==t&&(n+=`\n\nKind ${t} may be restricted by the relay's policy configuration.`),K&&(n+="\n\nThe relay has policy enforcement enabled. Contact a relay administrator to allow this event kind or adjust your permissions."),n}if(n.includes("auth")||n.includes("permission")||n.includes("unauthorized"))return`Permission Error: ${e}\n\nYour current permissions may not allow publishing this type of event. Current role: ${h||"unknown"}. Contact a relay administrator to upgrade your permissions.`;if(n.includes("kind")||n.includes("not allowed")||n.includes("restricted")){let n=`Event Type Error: ${e}`;return null!==t&&(n+=`\n\nKind ${t} is not currently allowed on this relay.`),n+="\n\nThe relay administrator may need to update the policy configuration to allow this event kind.",n}return n.includes("rate")||n.includes("limit")||n.includes("too many")?`Rate Limit Error: ${e}\n\nPlease wait a moment before trying again.`:n.includes("size")||n.includes("too large")||n.includes("content")?`Size Limit Error: ${e}\n\nThe event may exceed the relay's size limits. Try reducing the content length.`:`Publishing failed: ${e}`}function Le(e){n(97,Q=e),localStorage.setItem("viewAsRole",e),console.log("View as role changed to:",e,"Current effective role:",a)}Q=localStorage.getItem("viewAsRole")||"";return e.$$.update=()=>{var t;if(6&e.$$.dirty[0]|8&e.$$.dirty[3]&&n(41,r=k.sort((e,t)=>t.created_at-e.created_at)),8&e.$$.dirty[0]&&n(40,i=p?.about?(t=p.about,t?t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"):"").replace(/\n{2,}/g,"
    "):""),16&e.$$.dirty[0]|16&e.$$.dirty[3]&&n(10,a=Q&&""!==Q?Q:h),1810&e.$$.dirty[0]|48&e.$$.dirty[3]&&n(100,o=Ie.filter(e=>{const t=a;return!(e.requiresAdmin&&(!u||"admin"!==t&&"owner"!==t))&&(!(e.requiresOwner&&(!u||"owner"!==t))&&(!(e.requiresWrite&&(!u||"read"===t))&&(!("sprocket"===e.id&&!j)&&(!("policy"===e.id&&!K)&&(("managed-acl"!==e.id||"managed"===Z)&&(console.log(`Tab ${e.id} filter check:`,{isLoggedIn:u,userRole:h,viewAsRole:Q,currentRole:t,requiresAdmin:e.requiresAdmin,requiresOwner:e.requiresOwner,requiresWrite:e.requiresWrite,visible:!0}),!0))))))})),64&e.$$.dirty[0]|128&e.$$.dirty[3]&&n(11,s=[...o,...A]),2578&e.$$.dirty[0]|128&e.$$.dirty[3]&&console.log("Tabs debug:",{isLoggedIn:u,userRole:h,aclMode:Z,filteredBaseTabs:o.map(e=>e.id),allTabs:s.map(e=>e.id)}),1&e.$$.dirty[0]&&"undefined"!=typeof document&&(l?document.body.classList.add("dark-theme"):document.body.classList.remove("dark-theme")),14&e.$$.dirty[0]&&u&&d&&!p&&Fe(),182&e.$$.dirty[0]|72&e.$$.dirty[3]&&"events"===y&&u&&("read"===h||"write"===h||"admin"===h||"owner"===h)&&0===k.length&&!Te&&!x){n(99,Te=!0);Pe(!0,null)}32&e.$$.dirty[0]|8&e.$$.dirty[3]&&("events"!==y||"events"===y&&k.length>0)&&n(99,Te=!1),32&e.$$.dirty[0]&&localStorage.setItem("selectedTab",y)},[l,u,d,p,h,y,A,x,K,Z,a,s,c,g,m,v,I,C,E,N,O,M,L,_,H,G,J,V,z,q,Y,W,X,ee,te,ne,re,ie,oe,se,i,r,F,le,ce,async function(){console.log("Toggle changed, showOnlyMyEvents:",zw),n(99,Te=!1),await Pe(!0,null)},ue,de,fe,pe,function(){console.log("selectRecoveryKind called, recoverySelectedKind:",ne),null!=ne?(n(36,re=""),n(37,ie=[]),ae=null,n(39,se=!0),de()):console.log("No kind selected, skipping load")},function(){console.log("handleCustomKindInput called, recoveryCustomKind:",re);const e=parseInt(re);""!==re&&!isNaN(e)&&e>=0&&(n(35,ne=null),n(37,ie=[]),ae=null,n(39,se=!0),de())},function(e){const t=ie.filter(t=>t.kind===e.kind&&t.pubkey===e.pubkey),n=Math.max(...t.map(e=>e.created_at));return e.created_at===n},async function(){if(u&&"owner"===h)try{n(22,L=!0);const e=await fetch("/api/sprocket/status",{method:"GET",headers:{Authorization:`Nostr ${await Oe("GET","/api/sprocket/status")}`,"Content-Type":"application/json"}});if(e.ok){const t=await e.json();n(19,N=t.script_content||""),n(20,O=t),Ae("Script loaded successfully","success")}else Ae("Failed to load script","error")}catch(e){Ae(`Error loading script: ${e.message}`,"error")}finally{n(22,L=!1)}},async function(){if(u&&"owner"===h)try{n(22,L=!0);const e=await fetch("/api/sprocket/update",{method:"POST",headers:{Authorization:`Nostr ${await Oe("POST","/api/sprocket/update")}`,"Content-Type":"text/plain"},body:N});if(e.ok)Ae("Script saved and updated successfully","success"),await me(),await ye();else{Ae(`Failed to save script: ${await e.text()}`,"error")}}catch(e){Ae(`Error saving script: ${e.message}`,"error")}finally{n(22,L=!1)}},async function(){if(u&&"owner"===h)try{n(22,L=!0);const e=await fetch("/api/sprocket/restart",{method:"POST",headers:{Authorization:`Nostr ${await Oe("POST","/api/sprocket/restart")}`,"Content-Type":"application/json"}});if(e.ok)Ae("Sprocket restarted successfully","success"),await me();else{Ae(`Failed to restart sprocket: ${await e.text()}`,"error")}}catch(e){Ae(`Error restarting sprocket: ${e.message}`,"error")}finally{n(22,L=!1)}},async function(){if(u&&"owner"===h&&confirm("Are you sure you want to delete the sprocket script? This will stop the current process."))try{n(22,L=!0);const e=await fetch("/api/sprocket/update",{method:"POST",headers:{Authorization:`Nostr ${await Oe("POST","/api/sprocket/update")}`,"Content-Type":"text/plain"},body:""});if(e.ok)n(19,N=""),Ae("Sprocket script deleted successfully","success"),await me(),await ye();else{Ae(`Failed to delete script: ${await e.text()}`,"error")}}catch(e){Ae(`Error deleting script: ${e.message}`,"error")}finally{n(22,L=!1)}},ye,ve,we,async function(){if(u&&("owner"===h||qw))try{n(27,V=!0),n(30,Y=[]);const e={kinds:[12345],limit:1},t=await Fp(e);if(t&&t.length>0){n(26,J=t[0].content);try{n(26,J=JSON.stringify(JSON.parse(J),null,2))}catch(e){}be("Policy loaded successfully","success")}else{const e=await fetch("/api/policy",{method:"GET",headers:{Authorization:`Nostr ${await Oe("GET","/api/policy")}`,"Content-Type":"application/json"}});if(e.ok){const t=await e.json();n(26,J=JSON.stringify(t,null,2)),be("Policy loaded from file","success")}else be("No policy configuration found","info"),n(26,J="")}}catch(e){be(`Error loading policy: ${e.message}`,"error")}finally{n(27,V=!1)}},ke,async function(){if(!u||"owner"!==h&&!qw)return;if(await ke())try{n(27,V=!0);const e={kind:12345,created_at:Math.floor(Date.now()/1e3),tags:[],content:J},t=await Yv(e,g);t.success?be("Policy updated successfully","success"):be(`Failed to publish policy: ${t.error||"Unknown error"}`,"error")}catch(e){be(`Error saving policy: ${e.message}`,"error")}finally{n(27,V=!1)}},function(){try{const e=JSON.parse(J);n(26,J=JSON.stringify(e,null,2)),be("JSON formatted","success")}catch(e){be(`Cannot format: ${e.message}`,"error")}},function(e){const t=e.detail;if(!t)return void be("Please enter a pubkey","error");const r=function(e){if(!e)return null;if(/^[0-9a-fA-F]{64}$/.test(e))return e.toLowerCase();if(e.startsWith("npub1"))try{const t="qpzry9x8gf2tvdw0s3jn54khce6mua7l",n=e.slice(5);let r=[];for(const e of n){const n=t.indexOf(e.toLowerCase());if(-1===n)throw new Error("Invalid character in npub");r.push(...[...Array(5)].map((e,t)=>n>>4-t&1))}r=r.slice(0,-30);const i=[];for(let e=0;e+8<=r.length;e+=8){let t=0;for(let n=0;n<8;n++)t=t<<1|r[e+n];i.push(t)}return i.map(e=>e.toString(16).padStart(2,"0")).join("")}catch(e){return console.error("Failed to decode npub:",e),null}return null}(t);if(r&&64===r.length)try{const e=JSON.parse(J||"{}");if(e.policy_admins||(e.policy_admins=[]),e.policy_admins.includes(r))return void be("Admin already in list","warning");e.policy_admins.push(r),n(26,J=JSON.stringify(e,null,2)),be("Admin added - click 'Save & Publish' to apply","info")}catch(e){be(`Error adding admin: ${e.message}`,"error")}else be("Invalid pubkey format. Use hex (64 chars) or npub","error")},function(e){const t=e.detail;try{const e=JSON.parse(J||"{}");e.policy_admins&&(e.policy_admins=e.policy_admins.filter(e=>e!==t),n(26,J=JSON.stringify(e,null,2)),be("Admin removed - click 'Save & Publish' to apply","info"))}catch(e){be(`Error removing admin: ${e.message}`,"error")}},async function(){if(u&&("owner"===h||qw))try{n(27,V=!0),n(31,W=[]);let e=[];try{e=JSON.parse(J||"{}").policy_admins||[]}catch(e){return void be("Cannot parse policy JSON to get admins","error")}if(0===e.length)return void be("No policy admins configured","warning");const t={kinds:[3],authors:e,limit:e.length},r=await Fp(t),i=new Set;for(const e of r)if(e.tags)for(const t of e.tags)"p"===t[0]&&t[1]&&64===t[1].length&&i.add(t[1]);n(31,W=Array.from(i)),be(`Loaded ${W.length} follows from ${r.length} admin(s)`,"success")}catch(e){be(`Error loading follows: ${e.message}`,"error")}finally{n(27,V=!1)}},function(e){n(25,G=e.target.files[0])},async function(){if(u&&"owner"===h&&G)try{n(22,L=!0);const e=await G.text(),t=await fetch("/api/sprocket/update",{method:"POST",headers:{Authorization:`Nostr ${await Oe("POST","/api/sprocket/update")}`,"Content-Type":"text/plain"},body:e});if(t.ok)n(19,N=e),Ae("Script uploaded and updated successfully","success"),await me(),await ye();else{Ae(`Failed to upload script: ${await t.text()}`,"error")}}catch(e){Ae(`Error uploading script: ${e.message}`,"error")}finally{n(22,L=!1),n(25,G=null);const e=document.getElementById("sprocket-upload-file");e&&(e.value="")}},Ce,function(){u||n(12,c=!0)},async function(e){const{method:t,pubkey:r,privateKey:i,signer:o}=e.detail;n(1,u=!0),n(2,d=r),f=t,n(13,g=o),n(12,c=!1);try{if(await Qp(),"extension"===t&&o)gp.setSigner(o);else if("nsec"===t&&i){const e=new kf(i);gp.setSigner(e)}n(3,p=await Cp(r)),console.log("Profile loaded:",p)}catch(e){console.error("Failed to load profile:",e)}await De(),await $e()},function(){n(1,u=!1),n(2,d=""),f="",n(3,p=null),n(4,h=""),n(13,g=null),n(14,m=!1),P=[],n(96,k=[]),D=[],$=0,he(),"undefined"!=typeof localStorage&&(localStorage.removeItem("nostr_auth_method"),localStorage.removeItem("nostr_pubkey"),localStorage.removeItem("nostr_privkey"))},function(){n(12,c=!1)},function(){n(14,m=!0)},Ee,function(){n(15,v=!v)},function(e){const{searchText:t,selectedKinds:n,pubkeys:r,eventIds:i,tags:o,sinceTimestamp:s,untilTimestamp:a,limit:l}=e.detail,c=function({searchText:e=null,kinds:t=[],authors:n=[],ids:r=[],tags:i=[],since:o=null,until:s=null,limit:a=null}){const l={};return e&&e.trim()&&(l.search=e.trim()),t&&t.length>0&&(l.kinds=t),n&&n.length>0&&(l.authors=n),r&&r.length>0&&(l.ids=r),i&&i.length>0&&i.forEach(e=>{if(e.name&&e.value){const t=`#${e.name}`;l[t]||(l[t]=[]),l[t].push(e.value)}}),o&&(l.since=o),s&&(l.until=s),a&&a>0&&(l.limit=a),l}({searchText:t,kinds:n,authors:r,ids:i,tags:o,since:s,until:a,limit:l||100});w=c,Pe(!0,null)},function(){w={},Pe(!0,null)},xe,Be,Se,Qe,Fe,async function(){await Ue([])},async function(){await Ue([d])},function(e){n(16,I=e.detail.target.files[0])},async function(){if("none"!==Z&&(!u||"admin"!==h&&"owner"!==h))return n(17,C="Admin or owner permission required"),void setTimeout(()=>{n(17,C="")},5e3);if(!I)return n(17,C="Please select a file"),void setTimeout(()=>{n(17,C="")},5e3);try{n(17,C="Uploading...");const e={};"none"!==Z&&u&&(e.Authorization=await Ne("/api/import","POST"));const t=new FormData;t.append("file",I);const r=await fetch("/api/import",{method:"POST",headers:e,body:t});if(!r.ok)throw new Error(`Import failed: ${r.status} ${r.statusText}`);await r.json();n(17,C="Upload complete"),n(16,I=null),document.getElementById("import-file").value="",setTimeout(()=>{n(17,C="")},5e3)}catch(e){console.error("Import failed:",e),n(17,C="Import failed: "+e.message),setTimeout(()=>{n(17,C="")},5e3)}},Pe,function(e){const{scrollTop:t,scrollHeight:n,clientHeight:r}=e.target;n-t-r<100&&Re()},function(){try{if(!ee.trim())return void alert("Please enter some JSON to reformat");const e=JSON.parse(ee);n(33,ee=JSON.stringify(e,null,2))}catch(e){alert("Invalid JSON: "+e.message)}},async function(){try{if(!ee.trim())return void alert("Please enter an event to sign");if(!u||!d)return void alert("Please log in to sign events");if(!g)return void alert("No signer available. Please log in with a valid authentication method.");const e=JSON.parse(ee);e.pubkey=d,e.created_at=Math.floor(Date.now()/1e3),delete e.id,delete e.sig;const t=await g.signEvent(e);n(33,ee=JSON.stringify(t,null,2)),alert("Event signed successfully!")}catch(e){console.error("Error signing event:",e),alert("Error signing event: "+e.message)}},async function(){n(34,te="");try{if(!ee.trim())return void n(34,te="Please enter an event to publish");if(!u)return void n(34,te="Please log in to publish events");if(!g)return void n(34,te="No signer available. Please log in with a valid authentication method.");let e;try{e=JSON.parse(ee)}catch(e){return void n(34,te=`Invalid JSON: ${e.message}`)}if(!e.id||!e.sig)return void n(34,te='Event must be signed before publishing. Please click "Sign" first.');if("read"===h)return void n(34,te=`Permission denied: Your current role is "${h}" which does not allow publishing events. Contact a relay administrator to upgrade your permissions.`);const t=`${window.location.protocol.startsWith("https")?"wss:":"ws:"}//${window.location.host}/`,r=await Yv(t,e,g,d);if(r.success)n(34,te=""),alert("Event published successfully to ORLY relay!");else{const t=r.reason||"Unknown error";n(34,te=Me(t,e.kind))}}catch(e){console.error("Error publishing event:",e);const t=e.message||"Unknown error";n(34,te=Me(t,null))}},function(){n(34,te="")},Le,function(){const e=["owner","admin","write","read"],t=e.indexOf(h);return-1===t?["read"]:e.slice(t)},k,Q,j,Te,o,function(t){U.call(this,e,t)},function(t){U.call(this,e,t)},e=>e.id===y,e=>Ce(e.detail),e=>Be(e.detail),e=>le(e.detail),e=>ue(e.detail),e=>ce(e.detail.event,e.detail.e),e=>Pe(e.detail.refresh,e.detail.authors),function(e){ee=e,n(33,ee)},function(e){N=e,n(19,N)},e=>ve(e.detail),e=>we(e.detail),function(e){J=e,n(26,J)},function(){ne=function(e){const t=e.querySelector(":checked");return t&&t.__value}(this),n(35,ne)},function(){re=b(this.value),n(36,re)},e=>pe(e),e=>fe(e),(e,t)=>ce(e,t),e=>Se(e.id,!0),e=>xe(e.id),e=>ue(e.id),e=>le(e.id),(e,t)=>"Enter"===t.key&&le(e.id),(e,t)=>ce(e,t),(e,t)=>Qe(t,e.id),e=>Le(e===h?"":e),e=>"Escape"===e.key&&Ee(),function(e){c=e,n(12,c)}]}return new class extends ie{constructor(e){super(),re(this,e,Yw,Vw,o,{},null,[-1,-1,-1,-1,-1,-1])}}({target:document.body,props:{name:"world"}})}(); //# sourceMappingURL=bundle.js.map diff --git a/app/web/dist/bundle.js.map b/app/web/dist/bundle.js.map new file mode 100644 index 0000000..4114ae6 --- /dev/null +++ b/app/web/dist/bundle.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bundle.js","sources":["../node_modules/svelte/internal/index.mjs","../node_modules/@noble/curves/node_modules/@noble/hashes/esm/_assert.js","../node_modules/@noble/curves/node_modules/@noble/hashes/esm/crypto.js","../node_modules/@noble/curves/node_modules/@noble/hashes/esm/utils.js","../node_modules/@noble/curves/node_modules/@noble/hashes/esm/_sha2.js","../node_modules/@noble/curves/node_modules/@noble/hashes/esm/sha256.js","../node_modules/@noble/curves/esm/abstract/utils.js","../node_modules/@noble/curves/esm/abstract/modular.js","../node_modules/@noble/curves/esm/abstract/curve.js","../node_modules/@noble/curves/esm/abstract/weierstrass.js","../node_modules/@noble/curves/node_modules/@noble/hashes/esm/hmac.js","../node_modules/@noble/curves/esm/_shortw_utils.js","../node_modules/@noble/curves/esm/secp256k1.js","../node_modules/nostr-tools/node_modules/@noble/hashes/esm/crypto.js","../node_modules/nostr-tools/node_modules/@noble/hashes/esm/utils.js","../node_modules/nostr-tools/node_modules/@noble/hashes/esm/_assert.js","../node_modules/nostr-tools/node_modules/@noble/hashes/esm/_sha2.js","../node_modules/nostr-tools/node_modules/@noble/hashes/esm/sha256.js","../node_modules/nostr-tools/lib/esm/pool.js","../node_modules/nostr-tools/node_modules/@scure/base/lib/esm/index.js","../node_modules/@noble/ciphers/esm/_assert.js","../node_modules/@noble/ciphers/esm/utils.js","../node_modules/@noble/ciphers/esm/aes.js","../node_modules/@noble/ciphers/esm/_arx.js","../node_modules/@noble/ciphers/esm/chacha.js","../node_modules/nostr-tools/node_modules/@noble/hashes/esm/hmac.js","../node_modules/nostr-tools/node_modules/@noble/hashes/esm/hkdf.js","../node_modules/nostr-tools/lib/esm/index.js","../node_modules/nostr-tools/lib/esm/kinds.js","../node_modules/tslib/tslib.es6.mjs","../node_modules/rxjs/dist/esm5/internal/util/isFunction.js","../node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js","../node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js","../node_modules/rxjs/dist/esm5/internal/util/arrRemove.js","../node_modules/rxjs/dist/esm5/internal/Subscription.js","../node_modules/rxjs/dist/esm5/internal/config.js","../node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js","../node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js","../node_modules/rxjs/dist/esm5/internal/util/noop.js","../node_modules/rxjs/dist/esm5/internal/util/errorContext.js","../node_modules/rxjs/dist/esm5/internal/Subscriber.js","../node_modules/rxjs/dist/esm5/internal/symbol/observable.js","../node_modules/rxjs/dist/esm5/internal/util/identity.js","../node_modules/rxjs/dist/esm5/internal/Observable.js","../node_modules/rxjs/dist/esm5/internal/util/pipe.js","../node_modules/rxjs/dist/esm5/internal/util/lift.js","../node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js","../node_modules/rxjs/dist/esm5/internal/util/ObjectUnsubscribedError.js","../node_modules/rxjs/dist/esm5/internal/Subject.js","../node_modules/rxjs/dist/esm5/internal/scheduler/dateTimestampProvider.js","../node_modules/rxjs/dist/esm5/internal/ReplaySubject.js","../node_modules/rxjs/dist/esm5/internal/scheduler/Action.js","../node_modules/rxjs/dist/esm5/internal/scheduler/intervalProvider.js","../node_modules/rxjs/dist/esm5/internal/scheduler/AsyncAction.js","../node_modules/rxjs/dist/esm5/internal/Scheduler.js","../node_modules/rxjs/dist/esm5/internal/scheduler/AsyncScheduler.js","../node_modules/rxjs/dist/esm5/internal/scheduler/async.js","../node_modules/rxjs/dist/esm5/internal/observable/empty.js","../node_modules/rxjs/dist/esm5/internal/util/isScheduler.js","../node_modules/rxjs/dist/esm5/internal/util/args.js","../node_modules/rxjs/dist/esm5/internal/util/isArrayLike.js","../node_modules/rxjs/dist/esm5/internal/util/isPromise.js","../node_modules/rxjs/dist/esm5/internal/util/isInteropObservable.js","../node_modules/rxjs/dist/esm5/internal/util/isAsyncIterable.js","../node_modules/rxjs/dist/esm5/internal/util/throwUnobservableError.js","../node_modules/rxjs/dist/esm5/internal/symbol/iterator.js","../node_modules/rxjs/dist/esm5/internal/util/isIterable.js","../node_modules/rxjs/dist/esm5/internal/util/isReadableStreamLike.js","../node_modules/rxjs/dist/esm5/internal/observable/innerFrom.js","../node_modules/rxjs/dist/esm5/internal/util/executeSchedule.js","../node_modules/rxjs/dist/esm5/internal/operators/observeOn.js","../node_modules/rxjs/dist/esm5/internal/operators/subscribeOn.js","../node_modules/rxjs/dist/esm5/internal/scheduled/scheduleAsyncIterable.js","../node_modules/rxjs/dist/esm5/internal/scheduled/scheduled.js","../node_modules/rxjs/dist/esm5/internal/scheduled/scheduleObservable.js","../node_modules/rxjs/dist/esm5/internal/scheduled/scheduleArray.js","../node_modules/rxjs/dist/esm5/internal/scheduled/schedulePromise.js","../node_modules/rxjs/dist/esm5/internal/scheduled/scheduleIterable.js","../node_modules/rxjs/dist/esm5/internal/scheduled/scheduleReadableStreamLike.js","../node_modules/rxjs/dist/esm5/internal/observable/from.js","../node_modules/rxjs/dist/esm5/internal/observable/of.js","../node_modules/rxjs/dist/esm5/internal/operators/map.js","../node_modules/rxjs/dist/esm5/internal/util/mapOneOrManyArgs.js","../node_modules/rxjs/dist/esm5/internal/util/argsArgArrayOrObject.js","../node_modules/rxjs/dist/esm5/internal/observable/combineLatest.js","../node_modules/rxjs/dist/esm5/internal/util/createObject.js","../node_modules/rxjs/dist/esm5/internal/operators/mergeMap.js","../node_modules/rxjs/dist/esm5/internal/operators/mergeInternals.js","../node_modules/rxjs/dist/esm5/internal/operators/mergeAll.js","../node_modules/rxjs/dist/esm5/internal/observable/concat.js","../node_modules/rxjs/dist/esm5/internal/operators/concatAll.js","../node_modules/rxjs/dist/esm5/internal/observable/defer.js","../node_modules/rxjs/dist/esm5/internal/observable/timer.js","../node_modules/rxjs/dist/esm5/internal/util/isDate.js","../node_modules/rxjs/dist/esm5/internal/observable/merge.js","../node_modules/rxjs/dist/esm5/internal/operators/filter.js","../node_modules/rxjs/dist/esm5/internal/operators/take.js","../node_modules/rxjs/dist/esm5/internal/operators/distinctUntilChanged.js","../node_modules/rxjs/dist/esm5/internal/operators/endWith.js","../node_modules/rxjs/dist/esm5/internal/operators/finalize.js","../node_modules/rxjs/dist/esm5/internal/operators/merge.js","../node_modules/rxjs/dist/esm5/internal/operators/mergeWith.js","../node_modules/rxjs/dist/esm5/internal/operators/scan.js","../node_modules/rxjs/dist/esm5/internal/operators/scanInternals.js","../node_modules/rxjs/dist/esm5/internal/operators/share.js","../node_modules/rxjs/dist/esm5/internal/operators/switchMap.js","../node_modules/rxjs/dist/esm5/internal/operators/tap.js","../node_modules/applesauce-core/dist/helpers/tags.js","../node_modules/nostr-tools/lib/esm/pure.js","../node_modules/applesauce-core/dist/helpers/cache.js","../node_modules/nostr-tools/lib/esm/utils.js","../node_modules/applesauce-core/dist/helpers/event.js","../node_modules/applesauce-core/dist/helpers/time.js","../node_modules/applesauce-core/dist/helpers/expiration.js","../node_modules/nostr-tools/lib/esm/nip19.js","../node_modules/applesauce-core/dist/helpers/url.js","../node_modules/applesauce-core/dist/helpers/relays.js","../node_modules/applesauce-core/dist/helpers/string.js","../node_modules/@noble/hashes/esm/crypto.js","../node_modules/@noble/hashes/esm/utils.js","../node_modules/applesauce-core/dist/helpers/pointers.js","../node_modules/applesauce-core/dist/helpers/groups.js","../node_modules/applesauce-core/dist/helpers/encrypted-content.js","../node_modules/applesauce-core/dist/helpers/hidden-content.js","../node_modules/applesauce-core/dist/helpers/hidden-tags.js","../node_modules/applesauce-core/dist/helpers/event-tags.js","../node_modules/applesauce-core/dist/helpers/lru.js","../node_modules/ms/index.js","../node_modules/debug/src/common.js","../node_modules/debug/src/browser.js","../node_modules/applesauce-core/dist/logger.js","../node_modules/applesauce-core/dist/event-store/event-memory.js","../node_modules/hash-sum/hash-sum.js","../node_modules/applesauce-core/dist/helpers/filter.js","../node_modules/applesauce-core/dist/models/blossom.js","../node_modules/applesauce-core/dist/helpers/blossom.js","../node_modules/applesauce-core/dist/helpers/profile.js","../node_modules/applesauce-core/dist/helpers/json.js","../node_modules/light-bolt11-decoder/node_modules/@scure/base/lib/index.js","../node_modules/light-bolt11-decoder/bolt11.js","../node_modules/applesauce-core/dist/helpers/comment.js","../node_modules/applesauce-core/dist/helpers/contacts.js","../node_modules/@scure/base/lib/esm/index.js","../node_modules/applesauce-core/dist/helpers/encrypted-content-cache.js","../node_modules/applesauce-core/dist/helpers/event-cache.js","../node_modules/applesauce-core/dist/helpers/lnurl.js","../node_modules/applesauce-core/dist/helpers/mailboxes.js","../node_modules/applesauce-core/dist/helpers/mutes.js","../node_modules/applesauce-core/dist/helpers/reports.js","../node_modules/applesauce-core/dist/helpers/threading.js","../node_modules/applesauce-core/dist/observable/claim-events.js","../node_modules/applesauce-core/dist/observable/claim-latest.js","../node_modules/applesauce-core/dist/observable/defined.js","../node_modules/applesauce-core/dist/observable/with-immediate-value.js","../node_modules/applesauce-core/dist/models/common.js","../node_modules/rxjs/dist/esm5/internal/operators/ignoreElements.js","../node_modules/rxjs/dist/esm5/internal/operators/takeUntil.js","../node_modules/rxjs/dist/esm5/internal/operators/repeat.js","../node_modules/applesauce-core/dist/observable/watch-event-updates.js","../node_modules/applesauce-core/dist/models/contacts.js","../node_modules/applesauce-core/dist/models/comments.js","../node_modules/applesauce-core/dist/models/mailboxes.js","../node_modules/applesauce-core/dist/models/mutes.js","../node_modules/applesauce-core/dist/models/profile.js","../node_modules/applesauce-core/dist/models/reactions.js","../node_modules/applesauce-core/dist/models/thread.js","../node_modules/applesauce-core/dist/event-store/model-mixin.js","../node_modules/applesauce-core/dist/event-store/event-store.js","../node_modules/applesauce-core/dist/helpers/delete.js","../node_modules/applesauce-core/dist/promise/deferred.js","../node_modules/applesauce-signers/dist/signers/amber-clipboard-signer.js","../node_modules/applesauce-signers/dist/helpers/nostr-connect.js","../node_modules/applesauce-signers/dist/signers/private-key-signer.js","../node_modules/@noble/secp256k1/lib/esm/index.js","../node_modules/applesauce-signers/dist/signers/serial-port-signer.js","../src/constants.js","../src/nostr.js","../node_modules/hash-wasm/dist/index.esm.js","../src/nsec-crypto.js","../src/LoginModal.svelte","../src/ManagedACL.svelte","../src/Header.svelte","../src/Sidebar.svelte","../src/ExportView.svelte","../src/ImportView.svelte","../src/helpers.tsx","../src/FilterBuilder.svelte","../src/EventsView.svelte","../src/eventKinds.js","../src/EventTemplateSelector.svelte","../src/ComposeView.svelte","../src/SprocketView.svelte","../src/PolicyView.svelte","../src/BlossomView.svelte","../src/FilterDisplay.svelte","../src/utils.js","../src/websocket-auth.js","../src/App.svelte","../src/api.js","../src/main.js"],"sourcesContent":["function noop() { }\nconst identity = x => x;\nfunction assign(tar, src) {\n // @ts-ignore\n for (const k in src)\n tar[k] = src[k];\n return tar;\n}\n// Adapted from https://github.com/then/is-promise/blob/master/index.js\n// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE\nfunction is_promise(value) {\n return !!value && (typeof value === 'object' || typeof value === 'function') && typeof value.then === 'function';\n}\nfunction add_location(element, file, line, column, char) {\n element.__svelte_meta = {\n loc: { file, line, column, char }\n };\n}\nfunction run(fn) {\n return fn();\n}\nfunction blank_object() {\n return Object.create(null);\n}\nfunction run_all(fns) {\n fns.forEach(run);\n}\nfunction is_function(thing) {\n return typeof thing === 'function';\n}\nfunction safe_not_equal(a, b) {\n return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');\n}\nlet src_url_equal_anchor;\nfunction src_url_equal(element_src, url) {\n if (!src_url_equal_anchor) {\n src_url_equal_anchor = document.createElement('a');\n }\n src_url_equal_anchor.href = url;\n return element_src === src_url_equal_anchor.href;\n}\nfunction not_equal(a, b) {\n return a != a ? b == b : a !== b;\n}\nfunction is_empty(obj) {\n return Object.keys(obj).length === 0;\n}\nfunction validate_store(store, name) {\n if (store != null && typeof store.subscribe !== 'function') {\n throw new Error(`'${name}' is not a store with a 'subscribe' method`);\n }\n}\nfunction subscribe(store, ...callbacks) {\n if (store == null) {\n return noop;\n }\n const unsub = store.subscribe(...callbacks);\n return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\nfunction get_store_value(store) {\n let value;\n subscribe(store, _ => value = _)();\n return value;\n}\nfunction component_subscribe(component, store, callback) {\n component.$$.on_destroy.push(subscribe(store, callback));\n}\nfunction create_slot(definition, ctx, $$scope, fn) {\n if (definition) {\n const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);\n return definition[0](slot_ctx);\n }\n}\nfunction get_slot_context(definition, ctx, $$scope, fn) {\n return definition[1] && fn\n ? assign($$scope.ctx.slice(), definition[1](fn(ctx)))\n : $$scope.ctx;\n}\nfunction get_slot_changes(definition, $$scope, dirty, fn) {\n if (definition[2] && fn) {\n const lets = definition[2](fn(dirty));\n if ($$scope.dirty === undefined) {\n return lets;\n }\n if (typeof lets === 'object') {\n const merged = [];\n const len = Math.max($$scope.dirty.length, lets.length);\n for (let i = 0; i < len; i += 1) {\n merged[i] = $$scope.dirty[i] | lets[i];\n }\n return merged;\n }\n return $$scope.dirty | lets;\n }\n return $$scope.dirty;\n}\nfunction update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) {\n if (slot_changes) {\n const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);\n slot.p(slot_context, slot_changes);\n }\n}\nfunction update_slot(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_context_fn) {\n const slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);\n update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn);\n}\nfunction get_all_dirty_from_scope($$scope) {\n if ($$scope.ctx.length > 32) {\n const dirty = [];\n const length = $$scope.ctx.length / 32;\n for (let i = 0; i < length; i++) {\n dirty[i] = -1;\n }\n return dirty;\n }\n return -1;\n}\nfunction exclude_internal_props(props) {\n const result = {};\n for (const k in props)\n if (k[0] !== '$')\n result[k] = props[k];\n return result;\n}\nfunction compute_rest_props(props, keys) {\n const rest = {};\n keys = new Set(keys);\n for (const k in props)\n if (!keys.has(k) && k[0] !== '$')\n rest[k] = props[k];\n return rest;\n}\nfunction compute_slots(slots) {\n const result = {};\n for (const key in slots) {\n result[key] = true;\n }\n return result;\n}\nfunction once(fn) {\n let ran = false;\n return function (...args) {\n if (ran)\n return;\n ran = true;\n fn.call(this, ...args);\n };\n}\nfunction null_to_empty(value) {\n return value == null ? '' : value;\n}\nfunction set_store_value(store, ret, value) {\n store.set(value);\n return ret;\n}\nconst has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);\nfunction action_destroyer(action_result) {\n return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;\n}\nfunction split_css_unit(value) {\n const split = typeof value === 'string' && value.match(/^\\s*(-?[\\d.]+)([^\\s]*)\\s*$/);\n return split ? [parseFloat(split[1]), split[2] || 'px'] : [value, 'px'];\n}\nconst contenteditable_truthy_values = ['', true, 1, 'true', 'contenteditable'];\n\nconst is_client = typeof window !== 'undefined';\nlet now = is_client\n ? () => window.performance.now()\n : () => Date.now();\nlet raf = is_client ? cb => requestAnimationFrame(cb) : noop;\n// used internally for testing\nfunction set_now(fn) {\n now = fn;\n}\nfunction set_raf(fn) {\n raf = fn;\n}\n\nconst tasks = new Set();\nfunction run_tasks(now) {\n tasks.forEach(task => {\n if (!task.c(now)) {\n tasks.delete(task);\n task.f();\n }\n });\n if (tasks.size !== 0)\n raf(run_tasks);\n}\n/**\n * For testing purposes only!\n */\nfunction clear_loops() {\n tasks.clear();\n}\n/**\n * Creates a new task that runs on each raf frame\n * until it returns a falsy value or is aborted\n */\nfunction loop(callback) {\n let task;\n if (tasks.size === 0)\n raf(run_tasks);\n return {\n promise: new Promise(fulfill => {\n tasks.add(task = { c: callback, f: fulfill });\n }),\n abort() {\n tasks.delete(task);\n }\n };\n}\n\nconst globals = (typeof window !== 'undefined'\n ? window\n : typeof globalThis !== 'undefined'\n ? globalThis\n : global);\n\n/**\n * Resize observer singleton.\n * One listener per element only!\n * https://groups.google.com/a/chromium.org/g/blink-dev/c/z6ienONUb5A/m/F5-VcUZtBAAJ\n */\nclass ResizeObserverSingleton {\n constructor(options) {\n this.options = options;\n this._listeners = 'WeakMap' in globals ? new WeakMap() : undefined;\n }\n observe(element, listener) {\n this._listeners.set(element, listener);\n this._getObserver().observe(element, this.options);\n return () => {\n this._listeners.delete(element);\n this._observer.unobserve(element); // this line can probably be removed\n };\n }\n _getObserver() {\n var _a;\n return (_a = this._observer) !== null && _a !== void 0 ? _a : (this._observer = new ResizeObserver((entries) => {\n var _a;\n for (const entry of entries) {\n ResizeObserverSingleton.entries.set(entry.target, entry);\n (_a = this._listeners.get(entry.target)) === null || _a === void 0 ? void 0 : _a(entry);\n }\n }));\n }\n}\n// Needs to be written like this to pass the tree-shake-test\nResizeObserverSingleton.entries = 'WeakMap' in globals ? new WeakMap() : undefined;\n\n// Track which nodes are claimed during hydration. Unclaimed nodes can then be removed from the DOM\n// at the end of hydration without touching the remaining nodes.\nlet is_hydrating = false;\nfunction start_hydrating() {\n is_hydrating = true;\n}\nfunction end_hydrating() {\n is_hydrating = false;\n}\nfunction upper_bound(low, high, key, value) {\n // Return first index of value larger than input value in the range [low, high)\n while (low < high) {\n const mid = low + ((high - low) >> 1);\n if (key(mid) <= value) {\n low = mid + 1;\n }\n else {\n high = mid;\n }\n }\n return low;\n}\nfunction init_hydrate(target) {\n if (target.hydrate_init)\n return;\n target.hydrate_init = true;\n // We know that all children have claim_order values since the unclaimed have been detached if target is not \n let children = target.childNodes;\n // If target is , there may be children without claim_order\n if (target.nodeName === 'HEAD') {\n const myChildren = [];\n for (let i = 0; i < children.length; i++) {\n const node = children[i];\n if (node.claim_order !== undefined) {\n myChildren.push(node);\n }\n }\n children = myChildren;\n }\n /*\n * Reorder claimed children optimally.\n * We can reorder claimed children optimally by finding the longest subsequence of\n * nodes that are already claimed in order and only moving the rest. The longest\n * subsequence of nodes that are claimed in order can be found by\n * computing the longest increasing subsequence of .claim_order values.\n *\n * This algorithm is optimal in generating the least amount of reorder operations\n * possible.\n *\n * Proof:\n * We know that, given a set of reordering operations, the nodes that do not move\n * always form an increasing subsequence, since they do not move among each other\n * meaning that they must be already ordered among each other. Thus, the maximal\n * set of nodes that do not move form a longest increasing subsequence.\n */\n // Compute longest increasing subsequence\n // m: subsequence length j => index k of smallest value that ends an increasing subsequence of length j\n const m = new Int32Array(children.length + 1);\n // Predecessor indices + 1\n const p = new Int32Array(children.length);\n m[0] = -1;\n let longest = 0;\n for (let i = 0; i < children.length; i++) {\n const current = children[i].claim_order;\n // Find the largest subsequence length such that it ends in a value less than our current value\n // upper_bound returns first greater value, so we subtract one\n // with fast path for when we are on the current longest subsequence\n const seqLen = ((longest > 0 && children[m[longest]].claim_order <= current) ? longest + 1 : upper_bound(1, longest, idx => children[m[idx]].claim_order, current)) - 1;\n p[i] = m[seqLen] + 1;\n const newLen = seqLen + 1;\n // We can guarantee that current is the smallest value. Otherwise, we would have generated a longer sequence.\n m[newLen] = i;\n longest = Math.max(newLen, longest);\n }\n // The longest increasing subsequence of nodes (initially reversed)\n const lis = [];\n // The rest of the nodes, nodes that will be moved\n const toMove = [];\n let last = children.length - 1;\n for (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) {\n lis.push(children[cur - 1]);\n for (; last >= cur; last--) {\n toMove.push(children[last]);\n }\n last--;\n }\n for (; last >= 0; last--) {\n toMove.push(children[last]);\n }\n lis.reverse();\n // We sort the nodes being moved to guarantee that their insertion order matches the claim order\n toMove.sort((a, b) => a.claim_order - b.claim_order);\n // Finally, we move the nodes\n for (let i = 0, j = 0; i < toMove.length; i++) {\n while (j < lis.length && toMove[i].claim_order >= lis[j].claim_order) {\n j++;\n }\n const anchor = j < lis.length ? lis[j] : null;\n target.insertBefore(toMove[i], anchor);\n }\n}\nfunction append(target, node) {\n target.appendChild(node);\n}\nfunction append_styles(target, style_sheet_id, styles) {\n const append_styles_to = get_root_for_style(target);\n if (!append_styles_to.getElementById(style_sheet_id)) {\n const style = element('style');\n style.id = style_sheet_id;\n style.textContent = styles;\n append_stylesheet(append_styles_to, style);\n }\n}\nfunction get_root_for_style(node) {\n if (!node)\n return document;\n const root = node.getRootNode ? node.getRootNode() : node.ownerDocument;\n if (root && root.host) {\n return root;\n }\n return node.ownerDocument;\n}\nfunction append_empty_stylesheet(node) {\n const style_element = element('style');\n append_stylesheet(get_root_for_style(node), style_element);\n return style_element.sheet;\n}\nfunction append_stylesheet(node, style) {\n append(node.head || node, style);\n return style.sheet;\n}\nfunction append_hydration(target, node) {\n if (is_hydrating) {\n init_hydrate(target);\n if ((target.actual_end_child === undefined) || ((target.actual_end_child !== null) && (target.actual_end_child.parentNode !== target))) {\n target.actual_end_child = target.firstChild;\n }\n // Skip nodes of undefined ordering\n while ((target.actual_end_child !== null) && (target.actual_end_child.claim_order === undefined)) {\n target.actual_end_child = target.actual_end_child.nextSibling;\n }\n if (node !== target.actual_end_child) {\n // We only insert if the ordering of this node should be modified or the parent node is not target\n if (node.claim_order !== undefined || node.parentNode !== target) {\n target.insertBefore(node, target.actual_end_child);\n }\n }\n else {\n target.actual_end_child = node.nextSibling;\n }\n }\n else if (node.parentNode !== target || node.nextSibling !== null) {\n target.appendChild(node);\n }\n}\nfunction insert(target, node, anchor) {\n target.insertBefore(node, anchor || null);\n}\nfunction insert_hydration(target, node, anchor) {\n if (is_hydrating && !anchor) {\n append_hydration(target, node);\n }\n else if (node.parentNode !== target || node.nextSibling != anchor) {\n target.insertBefore(node, anchor || null);\n }\n}\nfunction detach(node) {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n}\nfunction destroy_each(iterations, detaching) {\n for (let i = 0; i < iterations.length; i += 1) {\n if (iterations[i])\n iterations[i].d(detaching);\n }\n}\nfunction element(name) {\n return document.createElement(name);\n}\nfunction element_is(name, is) {\n return document.createElement(name, { is });\n}\nfunction object_without_properties(obj, exclude) {\n const target = {};\n for (const k in obj) {\n if (has_prop(obj, k)\n // @ts-ignore\n && exclude.indexOf(k) === -1) {\n // @ts-ignore\n target[k] = obj[k];\n }\n }\n return target;\n}\nfunction svg_element(name) {\n return document.createElementNS('http://www.w3.org/2000/svg', name);\n}\nfunction text(data) {\n return document.createTextNode(data);\n}\nfunction space() {\n return text(' ');\n}\nfunction empty() {\n return text('');\n}\nfunction comment(content) {\n return document.createComment(content);\n}\nfunction listen(node, event, handler, options) {\n node.addEventListener(event, handler, options);\n return () => node.removeEventListener(event, handler, options);\n}\nfunction prevent_default(fn) {\n return function (event) {\n event.preventDefault();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction stop_propagation(fn) {\n return function (event) {\n event.stopPropagation();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction stop_immediate_propagation(fn) {\n return function (event) {\n event.stopImmediatePropagation();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction self(fn) {\n return function (event) {\n // @ts-ignore\n if (event.target === this)\n fn.call(this, event);\n };\n}\nfunction trusted(fn) {\n return function (event) {\n // @ts-ignore\n if (event.isTrusted)\n fn.call(this, event);\n };\n}\nfunction attr(node, attribute, value) {\n if (value == null)\n node.removeAttribute(attribute);\n else if (node.getAttribute(attribute) !== value)\n node.setAttribute(attribute, value);\n}\n/**\n * List of attributes that should always be set through the attr method,\n * because updating them through the property setter doesn't work reliably.\n * In the example of `width`/`height`, the problem is that the setter only\n * accepts numeric values, but the attribute can also be set to a string like `50%`.\n * If this list becomes too big, rethink this approach.\n */\nconst always_set_through_set_attribute = ['width', 'height'];\nfunction set_attributes(node, attributes) {\n // @ts-ignore\n const descriptors = Object.getOwnPropertyDescriptors(node.__proto__);\n for (const key in attributes) {\n if (attributes[key] == null) {\n node.removeAttribute(key);\n }\n else if (key === 'style') {\n node.style.cssText = attributes[key];\n }\n else if (key === '__value') {\n node.value = node[key] = attributes[key];\n }\n else if (descriptors[key] && descriptors[key].set && always_set_through_set_attribute.indexOf(key) === -1) {\n node[key] = attributes[key];\n }\n else {\n attr(node, key, attributes[key]);\n }\n }\n}\nfunction set_svg_attributes(node, attributes) {\n for (const key in attributes) {\n attr(node, key, attributes[key]);\n }\n}\nfunction set_custom_element_data_map(node, data_map) {\n Object.keys(data_map).forEach((key) => {\n set_custom_element_data(node, key, data_map[key]);\n });\n}\nfunction set_custom_element_data(node, prop, value) {\n if (prop in node) {\n node[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value;\n }\n else {\n attr(node, prop, value);\n }\n}\nfunction set_dynamic_element_data(tag) {\n return (/-/.test(tag)) ? set_custom_element_data_map : set_attributes;\n}\nfunction xlink_attr(node, attribute, value) {\n node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\nfunction get_binding_group_value(group, __value, checked) {\n const value = new Set();\n for (let i = 0; i < group.length; i += 1) {\n if (group[i].checked)\n value.add(group[i].__value);\n }\n if (!checked) {\n value.delete(__value);\n }\n return Array.from(value);\n}\nfunction init_binding_group(group) {\n let _inputs;\n return {\n /* push */ p(...inputs) {\n _inputs = inputs;\n _inputs.forEach(input => group.push(input));\n },\n /* remove */ r() {\n _inputs.forEach(input => group.splice(group.indexOf(input), 1));\n }\n };\n}\nfunction init_binding_group_dynamic(group, indexes) {\n let _group = get_binding_group(group);\n let _inputs;\n function get_binding_group(group) {\n for (let i = 0; i < indexes.length; i++) {\n group = group[indexes[i]] = group[indexes[i]] || [];\n }\n return group;\n }\n function push() {\n _inputs.forEach(input => _group.push(input));\n }\n function remove() {\n _inputs.forEach(input => _group.splice(_group.indexOf(input), 1));\n }\n return {\n /* update */ u(new_indexes) {\n indexes = new_indexes;\n const new_group = get_binding_group(group);\n if (new_group !== _group) {\n remove();\n _group = new_group;\n push();\n }\n },\n /* push */ p(...inputs) {\n _inputs = inputs;\n push();\n },\n /* remove */ r: remove\n };\n}\nfunction to_number(value) {\n return value === '' ? null : +value;\n}\nfunction time_ranges_to_array(ranges) {\n const array = [];\n for (let i = 0; i < ranges.length; i += 1) {\n array.push({ start: ranges.start(i), end: ranges.end(i) });\n }\n return array;\n}\nfunction children(element) {\n return Array.from(element.childNodes);\n}\nfunction init_claim_info(nodes) {\n if (nodes.claim_info === undefined) {\n nodes.claim_info = { last_index: 0, total_claimed: 0 };\n }\n}\nfunction claim_node(nodes, predicate, processNode, createNode, dontUpdateLastIndex = false) {\n // Try to find nodes in an order such that we lengthen the longest increasing subsequence\n init_claim_info(nodes);\n const resultNode = (() => {\n // We first try to find an element after the previous one\n for (let i = nodes.claim_info.last_index; i < nodes.length; i++) {\n const node = nodes[i];\n if (predicate(node)) {\n const replacement = processNode(node);\n if (replacement === undefined) {\n nodes.splice(i, 1);\n }\n else {\n nodes[i] = replacement;\n }\n if (!dontUpdateLastIndex) {\n nodes.claim_info.last_index = i;\n }\n return node;\n }\n }\n // Otherwise, we try to find one before\n // We iterate in reverse so that we don't go too far back\n for (let i = nodes.claim_info.last_index - 1; i >= 0; i--) {\n const node = nodes[i];\n if (predicate(node)) {\n const replacement = processNode(node);\n if (replacement === undefined) {\n nodes.splice(i, 1);\n }\n else {\n nodes[i] = replacement;\n }\n if (!dontUpdateLastIndex) {\n nodes.claim_info.last_index = i;\n }\n else if (replacement === undefined) {\n // Since we spliced before the last_index, we decrease it\n nodes.claim_info.last_index--;\n }\n return node;\n }\n }\n // If we can't find any matching node, we create a new one\n return createNode();\n })();\n resultNode.claim_order = nodes.claim_info.total_claimed;\n nodes.claim_info.total_claimed += 1;\n return resultNode;\n}\nfunction claim_element_base(nodes, name, attributes, create_element) {\n return claim_node(nodes, (node) => node.nodeName === name, (node) => {\n const remove = [];\n for (let j = 0; j < node.attributes.length; j++) {\n const attribute = node.attributes[j];\n if (!attributes[attribute.name]) {\n remove.push(attribute.name);\n }\n }\n remove.forEach(v => node.removeAttribute(v));\n return undefined;\n }, () => create_element(name));\n}\nfunction claim_element(nodes, name, attributes) {\n return claim_element_base(nodes, name, attributes, element);\n}\nfunction claim_svg_element(nodes, name, attributes) {\n return claim_element_base(nodes, name, attributes, svg_element);\n}\nfunction claim_text(nodes, data) {\n return claim_node(nodes, (node) => node.nodeType === 3, (node) => {\n const dataStr = '' + data;\n if (node.data.startsWith(dataStr)) {\n if (node.data.length !== dataStr.length) {\n return node.splitText(dataStr.length);\n }\n }\n else {\n node.data = dataStr;\n }\n }, () => text(data), true // Text nodes should not update last index since it is likely not worth it to eliminate an increasing subsequence of actual elements\n );\n}\nfunction claim_space(nodes) {\n return claim_text(nodes, ' ');\n}\nfunction claim_comment(nodes, data) {\n return claim_node(nodes, (node) => node.nodeType === 8, (node) => {\n node.data = '' + data;\n return undefined;\n }, () => comment(data), true);\n}\nfunction find_comment(nodes, text, start) {\n for (let i = start; i < nodes.length; i += 1) {\n const node = nodes[i];\n if (node.nodeType === 8 /* comment node */ && node.textContent.trim() === text) {\n return i;\n }\n }\n return nodes.length;\n}\nfunction claim_html_tag(nodes, is_svg) {\n // find html opening tag\n const start_index = find_comment(nodes, 'HTML_TAG_START', 0);\n const end_index = find_comment(nodes, 'HTML_TAG_END', start_index);\n if (start_index === end_index) {\n return new HtmlTagHydration(undefined, is_svg);\n }\n init_claim_info(nodes);\n const html_tag_nodes = nodes.splice(start_index, end_index - start_index + 1);\n detach(html_tag_nodes[0]);\n detach(html_tag_nodes[html_tag_nodes.length - 1]);\n const claimed_nodes = html_tag_nodes.slice(1, html_tag_nodes.length - 1);\n for (const n of claimed_nodes) {\n n.claim_order = nodes.claim_info.total_claimed;\n nodes.claim_info.total_claimed += 1;\n }\n return new HtmlTagHydration(claimed_nodes, is_svg);\n}\nfunction set_data(text, data) {\n data = '' + data;\n if (text.data === data)\n return;\n text.data = data;\n}\nfunction set_data_contenteditable(text, data) {\n data = '' + data;\n if (text.wholeText === data)\n return;\n text.data = data;\n}\nfunction set_data_maybe_contenteditable(text, data, attr_value) {\n if (~contenteditable_truthy_values.indexOf(attr_value)) {\n set_data_contenteditable(text, data);\n }\n else {\n set_data(text, data);\n }\n}\nfunction set_input_value(input, value) {\n input.value = value == null ? '' : value;\n}\nfunction set_input_type(input, type) {\n try {\n input.type = type;\n }\n catch (e) {\n // do nothing\n }\n}\nfunction set_style(node, key, value, important) {\n if (value == null) {\n node.style.removeProperty(key);\n }\n else {\n node.style.setProperty(key, value, important ? 'important' : '');\n }\n}\nfunction select_option(select, value, mounting) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n if (option.__value === value) {\n option.selected = true;\n return;\n }\n }\n if (!mounting || value !== undefined) {\n select.selectedIndex = -1; // no option should be selected\n }\n}\nfunction select_options(select, value) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n option.selected = ~value.indexOf(option.__value);\n }\n}\nfunction select_value(select) {\n const selected_option = select.querySelector(':checked');\n return selected_option && selected_option.__value;\n}\nfunction select_multiple_value(select) {\n return [].map.call(select.querySelectorAll(':checked'), option => option.__value);\n}\n// unfortunately this can't be a constant as that wouldn't be tree-shakeable\n// so we cache the result instead\nlet crossorigin;\nfunction is_crossorigin() {\n if (crossorigin === undefined) {\n crossorigin = false;\n try {\n if (typeof window !== 'undefined' && window.parent) {\n void window.parent.document;\n }\n }\n catch (error) {\n crossorigin = true;\n }\n }\n return crossorigin;\n}\nfunction add_iframe_resize_listener(node, fn) {\n const computed_style = getComputedStyle(node);\n if (computed_style.position === 'static') {\n node.style.position = 'relative';\n }\n const iframe = element('iframe');\n iframe.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' +\n 'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;');\n iframe.setAttribute('aria-hidden', 'true');\n iframe.tabIndex = -1;\n const crossorigin = is_crossorigin();\n let unsubscribe;\n if (crossorigin) {\n iframe.src = \"data:text/html,\";\n unsubscribe = listen(window, 'message', (event) => {\n if (event.source === iframe.contentWindow)\n fn();\n });\n }\n else {\n iframe.src = 'about:blank';\n iframe.onload = () => {\n unsubscribe = listen(iframe.contentWindow, 'resize', fn);\n // make sure an initial resize event is fired _after_ the iframe is loaded (which is asynchronous)\n // see https://github.com/sveltejs/svelte/issues/4233\n fn();\n };\n }\n append(node, iframe);\n return () => {\n if (crossorigin) {\n unsubscribe();\n }\n else if (unsubscribe && iframe.contentWindow) {\n unsubscribe();\n }\n detach(iframe);\n };\n}\nconst resize_observer_content_box = /* @__PURE__ */ new ResizeObserverSingleton({ box: 'content-box' });\nconst resize_observer_border_box = /* @__PURE__ */ new ResizeObserverSingleton({ box: 'border-box' });\nconst resize_observer_device_pixel_content_box = /* @__PURE__ */ new ResizeObserverSingleton({ box: 'device-pixel-content-box' });\nfunction toggle_class(element, name, toggle) {\n element.classList[toggle ? 'add' : 'remove'](name);\n}\nfunction custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {\n const e = document.createEvent('CustomEvent');\n e.initCustomEvent(type, bubbles, cancelable, detail);\n return e;\n}\nfunction query_selector_all(selector, parent = document.body) {\n return Array.from(parent.querySelectorAll(selector));\n}\nfunction head_selector(nodeId, head) {\n const result = [];\n let started = 0;\n for (const node of head.childNodes) {\n if (node.nodeType === 8 /* comment node */) {\n const comment = node.textContent.trim();\n if (comment === `HEAD_${nodeId}_END`) {\n started -= 1;\n result.push(node);\n }\n else if (comment === `HEAD_${nodeId}_START`) {\n started += 1;\n result.push(node);\n }\n }\n else if (started > 0) {\n result.push(node);\n }\n }\n return result;\n}\nclass HtmlTag {\n constructor(is_svg = false) {\n this.is_svg = false;\n this.is_svg = is_svg;\n this.e = this.n = null;\n }\n c(html) {\n this.h(html);\n }\n m(html, target, anchor = null) {\n if (!this.e) {\n if (this.is_svg)\n this.e = svg_element(target.nodeName);\n /** #7364 target for