@crvouga/mockingbird-notifications 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/mime.ts", "../src/discovery.ts", "../src/generated/browser.ts", "../src/sources.ts", "../src/ui/page.ts", "../src/harness.ts"],
4
+ "sourcesContent": ["/**\n * A small MIME reader for the raw messages SES `SendRawEmail` receives. It covers what mail\n * libraries produce (nodemailer, the AWS samples): folded headers, RFC 2047 encoded words,\n * nested multiparts, base64 and quoted-printable bodies. Everything is decoded as UTF-8.\n */\nimport type { EmailAttachment } from \"./model.js\"\n\nexport type ParsedMime = {\n headers: Record<string, string>\n subject: string\n from: string | null\n to: string[]\n cc: string[]\n html: string | null\n text: string | null\n attachments: EmailAttachment[]\n}\n\ntype Part = { headers: Record<string, string>; body: string }\n\nconst utf8 = new TextDecoder()\n\nconst base64Bytes = (value: string): Uint8Array => {\n const binary = atob(value.replace(/[^A-Za-z0-9+/=]/g, \"\"))\n const bytes = new Uint8Array(binary.length)\n for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i)\n return bytes\n}\n\nconst quotedPrintableBytes = (value: string, underscoreSpace = false): Uint8Array => {\n const source = value.replace(/=\\r?\\n/g, \"\")\n const out: number[] = []\n for (let i = 0; i < source.length; i++) {\n const ch = source[i] ?? \"\"\n const hex = source.slice(i + 1, i + 3)\n if (ch === \"=\" && /^[0-9A-Fa-f]{2}$/.test(hex)) {\n out.push(Number.parseInt(hex, 16))\n i += 2\n } else if (underscoreSpace && ch === \"_\") out.push(32)\n else for (const byte of new TextEncoder().encode(ch)) out.push(byte)\n }\n return new Uint8Array(out)\n}\n\n/** `=?utf-8?B?\u2026?=` and `=?utf-8?Q?\u2026?=` words in a header value. */\nexport const decodeWords = (value: string): string =>\n value\n .replace(/\\?=\\s+=\\?/g, \"?==?\")\n .replace(\n /=\\?([^?]+)\\?([BbQq])\\?([^?]*)\\?=/g,\n (_, _charset: string, kind: string, text: string) =>\n utf8.decode(\n kind.toUpperCase() === \"B\" ? base64Bytes(text) : quotedPrintableBytes(text, true),\n ),\n )\n\nconst splitHead = (raw: string): Part => {\n const normalized = raw.replace(/\\r\\n/g, \"\\n\")\n const end = normalized.indexOf(\"\\n\\n\")\n const head = end < 0 ? normalized : normalized.slice(0, end)\n const body = end < 0 ? \"\" : normalized.slice(end + 2)\n const headers: Record<string, string> = {}\n for (const line of head.replace(/\\n[ \\t]+/g, \" \").split(\"\\n\")) {\n const colon = line.indexOf(\":\")\n if (colon <= 0) continue\n const name = line.slice(0, colon).trim().toLowerCase()\n const value = decodeWords(line.slice(colon + 1).trim())\n headers[name] = headers[name] ? `${headers[name]}, ${value}` : value\n }\n return { headers, body }\n}\n\nconst param = (header: string | undefined, name: string): string | null => {\n if (!header) return null\n const match = new RegExp(`${name}\\\\*?=(?:\"([^\"]*)\"|([^;\\\\s]+))`, \"i\").exec(header)\n return match ? (match[1] ?? match[2] ?? null) : null\n}\n\nconst decodeBody = (part: Part): Uint8Array => {\n const encoding = (part.headers[\"content-transfer-encoding\"] ?? \"\").toLowerCase()\n if (encoding === \"base64\") return base64Bytes(part.body)\n if (encoding === \"quoted-printable\") return quotedPrintableBytes(part.body)\n return new TextEncoder().encode(part.body)\n}\n\nconst walk = (part: Part, out: ParsedMime): void => {\n const type = (part.headers[\"content-type\"] ?? \"text/plain\").toLowerCase()\n const boundary = param(part.headers[\"content-type\"], \"boundary\")\n if (type.startsWith(\"multipart/\") && boundary) {\n const sections = part.body.split(`--${boundary}`)\n for (const section of sections.slice(1)) {\n if (section.startsWith(\"--\")) break\n walk(splitHead(section.replace(/^\\n/, \"\")), out)\n }\n return\n }\n const disposition = part.headers[\"content-disposition\"] ?? \"\"\n const filename = param(disposition, \"filename\") ?? param(part.headers[\"content-type\"], \"name\")\n if (/^attachment/i.test(disposition) || (filename && !type.startsWith(\"text/\"))) {\n out.attachments.push({\n filename: filename ?? \"attachment\",\n contentType: type.split(\";\")[0]?.trim() ?? null,\n size: decodeBody(part).byteLength,\n })\n return\n }\n const text = utf8.decode(decodeBody(part)).replace(/\\n$/, \"\")\n if (type.startsWith(\"text/html\") && out.html === null) out.html = text\n else if (type.startsWith(\"text/plain\") && out.text === null) out.text = text\n}\n\n/** Split an address list header (`\"A, B\" <a@x>, b@y`) into its addresses. */\nexport const addressList = (value: string | undefined): string[] =>\n (value ?? \"\")\n .split(/,(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/)\n .map((item) => item.trim())\n .filter(Boolean)\n\nexport const parseMime = (raw: string): ParsedMime => {\n const root = splitHead(raw)\n const out: ParsedMime = {\n headers: root.headers,\n subject: root.headers.subject ?? \"\",\n from: root.headers.from ?? null,\n to: addressList(root.headers.to),\n cc: addressList(root.headers.cc),\n html: null,\n text: null,\n attachments: [],\n }\n walk(root, out)\n return out\n}\n\n/** Raw message bytes arrive base64 encoded in `RawMessage.Data`; fall back to plain text. */\nexport const decodeRawMessage = (data: string): string => {\n const compact = data.replace(/\\s+/g, \"\")\n if (/^[A-Za-z0-9+/]+=*$/.test(compact) && compact.length % 4 === 0) {\n const decoded = utf8.decode(base64Bytes(compact))\n if (/^[\\x20-\\x7e]+:/m.test(decoded)) return decoded\n }\n return data\n}\n", "/**\n * Where the emulators are. The harness reads the same fleet the application uses: the live fleet\n * controller (`adminBase`), the fleet's ready manifest, or explicit URLs and in-process runtimes.\n */\nimport { SERVICE_KINDS, type ServiceKind } from \"./model.js\"\n\nexport type FetchLike = (request: Request) => Response | Promise<Response>\n\n/** A service emulator: its base URL, an `{ url, adminUrl?, service? }` entry, or an in-process runtime. */\nexport type ServiceInput =\n | string\n | { url: string; adminUrl?: string; service?: ServiceKind }\n | { fetch: FetchLike; service?: ServiceKind; adminPrefix?: string }\n\n/** The subset of a fleet ready manifest (`--ready-file`) the harness reads. */\nexport type FleetManifest = {\n adminBase?: string\n services: Record<\n string,\n { protocol?: string; url?: string; adminUrl?: string; target?: string } | undefined\n >\n}\n\nexport type Endpoint = {\n /** The fleet entry name, e.g. `twilio`, or an alias such as `push`. */\n name: string\n /** Null until the emulator's health route has told us what it is. */\n service: ServiceKind | null\n /** Absolute admin prefix, e.g. `http://127.0.0.1:8798/__admin`. */\n adminUrl: string\n fetch: FetchLike\n}\n\nexport const asServiceKind = (value: unknown): ServiceKind | null =>\n typeof value === \"string\" && (SERVICE_KINDS as readonly string[]).includes(value)\n ? (value as ServiceKind)\n : null\n\nconst trimSlash = (url: string) => url.replace(/\\/+$/, \"\")\n\nexport const endpointsFromServices = (\n services: Record<string, ServiceInput>,\n fetchImpl: FetchLike,\n): Endpoint[] =>\n Object.entries(services).map(([name, input]) => {\n if (typeof input === \"string\")\n return {\n name,\n service: asServiceKind(name),\n adminUrl: `${trimSlash(input)}/__admin`,\n fetch: fetchImpl,\n }\n if (\"fetch\" in input)\n return {\n name,\n service: input.service ?? asServiceKind(name),\n adminUrl: `http://${name}.mockingbird.local${input.adminPrefix ?? \"/__admin\"}`,\n fetch: input.fetch,\n }\n return {\n name,\n service: input.service ?? asServiceKind(name),\n adminUrl: input.adminUrl ? trimSlash(input.adminUrl) : `${trimSlash(input.url)}/__admin`,\n fetch: fetchImpl,\n }\n })\n\nexport const endpointsFromManifest = (\n manifest: FleetManifest,\n fetchImpl: FetchLike,\n targets: Record<string, string | undefined> = {},\n): Endpoint[] =>\n Object.entries(manifest.services ?? {}).flatMap(([name, entry]): Endpoint[] => {\n if (!entry || (entry.protocol && entry.protocol !== \"http\") || !entry.url) return []\n const service = asServiceKind(targets[name] ?? entry.target ?? name)\n // A target the fleet named that the harness cannot read (stripe, postgres, \u2026) is skipped.\n if (!service && (targets[name] ?? entry.target)) return []\n return [\n {\n name,\n service,\n adminUrl: entry.adminUrl ? trimSlash(entry.adminUrl) : `${trimSlash(entry.url)}/__admin`,\n fetch: fetchImpl,\n },\n ]\n })\n\n/**\n * An emulator whose admin API the dashboard fronts. Unlike {@link Endpoint} this is every HTTP\n * emulator, messaging or not (stripe, cognito, \u2026).\n */\nexport type AdminTarget = {\n /** The fleet entry name, e.g. `stripe`, or an alias such as `push`. */\n name: string\n /** The emulator it runs, e.g. `fcm` for the alias `push`. The name when nobody said. */\n target: string\n /** Absolute admin prefix, e.g. `http://127.0.0.1:8798/__admin`. */\n adminUrl: string\n fetch: FetchLike\n}\n\nexport const adminTargetsFromServices = (\n services: Record<string, ServiceInput>,\n fetchImpl: FetchLike,\n): AdminTarget[] =>\n endpointsFromServices(services, fetchImpl).map((endpoint) => ({\n name: endpoint.name,\n target: endpoint.service ?? endpoint.name,\n adminUrl: endpoint.adminUrl,\n fetch: endpoint.fetch,\n }))\n\n/** Every HTTP entry of a manifest. Protocol entries (postgres, redis) have no admin API of their own. */\nexport const adminTargetsFromManifest = (\n manifest: FleetManifest,\n fetchImpl: FetchLike,\n targets: Record<string, string | undefined> = {},\n): AdminTarget[] =>\n Object.entries(manifest.services ?? {}).flatMap(([name, entry]): AdminTarget[] => {\n if (!entry || (entry.protocol && entry.protocol !== \"http\") || !entry.url) return []\n return [\n {\n name,\n target: targets[name] ?? entry.target ?? name,\n adminUrl: entry.adminUrl ? trimSlash(entry.adminUrl) : `${trimSlash(entry.url)}/__admin`,\n fetch: fetchImpl,\n },\n ]\n })\n\nexport type FleetDiscovery = {\n endpoints: Endpoint[]\n admins: AdminTarget[]\n namespaces: string[]\n}\n\n/** Ask a running fleet controller for its manifest, each entry's target, and its namespaces. */\nexport const discoverFleet = async (\n adminBase: string,\n fetchImpl: FetchLike,\n headers: Record<string, string>,\n): Promise<FleetDiscovery> => {\n const base = trimSlash(adminBase)\n const get = async (path: string) => {\n const response = await fetchImpl(new Request(`${base}${path}`, { headers }))\n if (!response.ok) throw new Error(`fleet ${base}${path}: HTTP ${response.status}`)\n return (await response.json()) as Record<string, unknown>\n }\n const [root, namespaces] = await Promise.all([\n get(\"\"),\n get(\"/namespaces\").catch((): Record<string, unknown> => ({})),\n ])\n const manifest = root.manifest as FleetManifest | undefined\n if (!manifest?.services) throw new Error(`fleet ${base}: discovery has no manifest`)\n const described = (root.services ?? {}) as Record<string, { target?: string } | undefined>\n const targets = Object.fromEntries(\n Object.entries(described).map(([name, entry]) => [name, entry?.target]),\n )\n const names = Array.isArray(namespaces.namespaces)\n ? (namespaces.namespaces as { namespace?: unknown }[])\n .map((n) => n.namespace)\n .filter((n): n is string => typeof n === \"string\")\n : []\n return {\n endpoints: endpointsFromManifest(manifest, fetchImpl, targets),\n admins: adminTargetsFromManifest(manifest, fetchImpl, targets),\n namespaces: names,\n }\n}\n", "// Generated by scripts/build-ui.ts from src/ui/browser.ts. Do not edit.\nexport const BROWSER_JS: string = \"var le=[\\\"sms\\\",\\\"push\\\",\\\"email\\\",\\\"chat\\\"];var l={app:\\\"notifications-app\\\",topbar:\\\"topbar\\\",namespace:\\\"namespace\\\",search:\\\"search\\\",viewDevices:\\\"view-devices\\\",viewTimeline:\\\"view-timeline\\\",follow:\\\"follow\\\",sound:\\\"sound-toggle\\\",connection:\\\"connection\\\",source:\\\"source\\\",notice:\\\"notice\\\",toast:\\\"toast\\\",toastUndo:\\\"toast-undo\\\",channelTabs:\\\"channel-tabs\\\",channelTab:\\\"channel-tab\\\",channelTabUnread:\\\"channel-tab-unread\\\",smsDevice:\\\"sms-device\\\",smsRecipient:\\\"sms-recipient\\\",smsUnreadCount:\\\"sms-unread-count\\\",smsThread:\\\"sms-thread\\\",smsThreadName:\\\"sms-thread-name\\\",smsThreadPreview:\\\"sms-thread-preview\\\",smsThreadTime:\\\"sms-thread-time\\\",smsThreadUnread:\\\"sms-thread-unread\\\",smsThreadVia:\\\"sms-thread-via\\\",smsThreadDelete:\\\"sms-thread-delete\\\",smsThreadMute:\\\"sms-thread-mute\\\",smsThreadPin:\\\"sms-thread-pin\\\",smsThreadToggleUnread:\\\"sms-thread-toggle-unread\\\",smsEmpty:\\\"sms-empty\\\",smsConversation:\\\"sms-conversation\\\",smsConversationTitle:\\\"sms-conversation-title\\\",smsBack:\\\"sms-back\\\",smsBubble:\\\"sms-bubble\\\",smsBubbleMedia:\\\"sms-bubble-media\\\",smsBubbleTime:\\\"sms-bubble-time\\\",smsTapback:\\\"sms-tapback\\\",smsTimestamp:\\\"sms-timestamp\\\",smsCode:\\\"sms-code\\\",smsMenu:\\\"sms-menu\\\",smsMenuCopy:\\\"sms-menu-copy\\\",smsMenuTapback:\\\"sms-menu-tapback\\\",pushDevice:\\\"push-device\\\",pushRecipient:\\\"push-recipient\\\",pushSkin:\\\"push-skin\\\",pushUnreadCount:\\\"push-unread-count\\\",pushNotification:\\\"push-notification\\\",pushNotificationApp:\\\"push-notification-app\\\",pushNotificationTitle:\\\"push-notification-title\\\",pushNotificationBody:\\\"push-notification-body\\\",pushNotificationTime:\\\"push-notification-time\\\",pushNotificationImage:\\\"push-notification-image\\\",pushNotificationData:\\\"push-notification-data\\\",pushNotificationMeta:\\\"push-notification-meta\\\",pushGroup:\\\"push-group\\\",pushGroupMore:\\\"push-group-more\\\",pushGroupCollapse:\\\"push-group-collapse\\\",pushClear:\\\"push-clear\\\",pushOptions:\\\"push-options\\\",pushPreview:\\\"push-preview\\\",pushSettings:\\\"push-settings\\\",pushClearAll:\\\"push-clear-all\\\",pushEmpty:\\\"push-empty\\\",emailDevice:\\\"email-device\\\",emailRecipient:\\\"email-recipient\\\",emailUnreadCount:\\\"email-unread-count\\\",emailRow:\\\"email-row\\\",emailRowFrom:\\\"email-row-from\\\",emailRowSubject:\\\"email-row-subject\\\",emailRowSnippet:\\\"email-row-snippet\\\",emailRowDate:\\\"email-row-date\\\",emailRowService:\\\"email-row-service\\\",emailRowAttachment:\\\"email-row-attachment\\\",emailRowStar:\\\"email-row-star\\\",emailRowArchive:\\\"email-row-archive\\\",emailRowDelete:\\\"email-row-delete\\\",emailRowToggleRead:\\\"email-row-toggle-read\\\",emailRefresh:\\\"email-refresh\\\",emailEmpty:\\\"email-empty\\\",emailOpen:\\\"email-open\\\",emailBack:\\\"email-back\\\",emailArchive:\\\"email-archive\\\",emailDelete:\\\"email-delete\\\",emailMarkUnread:\\\"email-mark-unread\\\",emailSubject:\\\"email-subject\\\",emailFromName:\\\"email-from-name\\\",emailFromAddress:\\\"email-from-address\\\",emailTo:\\\"email-to\\\",emailDate:\\\"email-date\\\",emailDetails:\\\"email-details\\\",emailDetail:\\\"email-detail\\\",emailBody:\\\"email-body\\\",emailText:\\\"email-text\\\",emailAttachments:\\\"email-attachments\\\",emailAttachment:\\\"email-attachment\\\",chatDevice:\\\"chat-device\\\",chatRecipient:\\\"chat-recipient\\\",chatUnreadCount:\\\"chat-unread-count\\\",chatWorkspace:\\\"chat-workspace\\\",chatChannel:\\\"chat-channel\\\",chatTitle:\\\"chat-title\\\",chatMessage:\\\"chat-message\\\",chatMessageAuthor:\\\"chat-message-author\\\",chatMessageTime:\\\"chat-message-time\\\",chatMessageText:\\\"chat-message-text\\\",chatMessageBlocks:\\\"chat-message-blocks\\\",chatMessageAttachments:\\\"chat-message-attachments\\\",chatMessageReaction:\\\"chat-message-reaction\\\",chatEmpty:\\\"chat-empty\\\",timeline:\\\"timeline\\\",timelineRow:\\\"timeline-row\\\",timelineEmpty:\\\"timeline-empty\\\",inspector:\\\"inspector\\\",inspectorTitle:\\\"inspector-title\\\",inspectorClose:\\\"inspector-close\\\",inspectorShowOnDevice:\\\"inspector-show-on-device\\\",inspectorField:\\\"inspector-field\\\",inspectorJson:\\\"inspector-json\\\",dashboard:\\\"dashboard\\\",dashboardTab:\\\"dashboard-tab\\\",dashboardPanel:\\\"dashboard-panel\\\",dashboardBadge:\\\"dashboard-badge\\\"};var Mt=a=>typeof a==\\\"object\\\"&&a!==null&&!Array.isArray(a),va=a=>Mt(a)?a:{},de=a=>Array.isArray(a)?a.filter(Mt):[],R=a=>typeof a==\\\"string\\\"?a:\\\"\\\",P=a=>String(a??\\\"\\\").replace(/[&<>\\\"']/g,o=>`&#${o.charCodeAt(0)};`),tt=a=>/^(https?:\\\\/\\\\/|mailto:)/i.test(a.trim())?a.trim():null,dn={\\\"+1\\\":\\\"\\\\u{1F44D}\\\",thumbsup:\\\"\\\\u{1F44D}\\\",\\\"-1\\\":\\\"\\\\u{1F44E}\\\",thumbsdown:\\\"\\\\u{1F44E}\\\",tada:\\\"\\\\u{1F389}\\\",rocket:\\\"\\\\u{1F680}\\\",white_check_mark:\\\"\\\\u2705\\\",heavy_check_mark:\\\"\\\\u2714\\\\uFE0F\\\",x:\\\"\\\\u274C\\\",warning:\\\"\\\\u26A0\\\\uFE0F\\\",rotating_light:\\\"\\\\u{1F6A8}\\\",fire:\\\"\\\\u{1F525}\\\",eyes:\\\"\\\\u{1F440}\\\",heart:\\\"\\\\u2764\\\\uFE0F\\\",wave:\\\"\\\\u{1F44B}\\\",bell:\\\"\\\\u{1F514}\\\",calendar:\\\"\\\\u{1F4C5}\\\",package:\\\"\\\\u{1F4E6}\\\",bug:\\\"\\\\u{1F41B}\\\",hourglass:\\\"\\\\u231B\\\",moneybag:\\\"\\\\u{1F4B0}\\\",email:\\\"\\\\u2709\\\\uFE0F\\\",red_circle:\\\"\\\\u{1F534}\\\",large_green_circle:\\\"\\\\u{1F7E2}\\\",large_yellow_circle:\\\"\\\\u{1F7E1}\\\",sparkles:\\\"\\\\u2728\\\",memo:\\\"\\\\u{1F4DD}\\\",lock:\\\"\\\\u{1F512}\\\",information_source:\\\"\\\\u2139\\\\uFE0F\\\",pray:\\\"\\\\u{1F64F}\\\"},Ie=a=>dn[a.toLowerCase()]??`:${a}:`,ke=(a,o={})=>{let d=[],h=y=>`\\\\0${d.push(y)-1}\\\\0`,g=y=>y.replace(/&#38;lt;/g,\\\"&#60;\\\").replace(/&#38;gt;/g,\\\"&#62;\\\").replace(/&#38;amp;/g,\\\"&#38;\\\"),v=y=>y.replace(/&#(\\\\d+);/g,(E,D)=>String.fromCharCode(Number(D))),$=P(a).replace(/```\\\\n?([\\\\s\\\\S]*?)```/g,(y,E)=>h(`<pre class=\\\"chat-pre\\\">${g(E)}</pre>`)).replace(/`([^`\\\\n]+)`/g,(y,E)=>h(`<code class=\\\"chat-code\\\">${g(E)}</code>`)).replace(/&#60;(.+?)&#62;/g,(y,E)=>{let[D=\\\"\\\",W]=E.split(\\\"|\\\");if(D.startsWith(\\\"@\\\")||D.startsWith(\\\"#\\\")){let O=D.slice(1),V=W||o.name?.(v(O))||O;return h(`<span class=\\\"chat-mention\\\">${D[0]}${P(v(V))}</span>`)}if(D.startsWith(\\\"!\\\")){let O=D.slice(1).split(\\\"^\\\")[0]??\\\"\\\";return h(`<span class=\\\"chat-mention\\\">${W||`@${O}`}</span>`)}let F=tt(v(D));return F?h(`<a href=\\\"${P(F)}\\\" target=\\\"_blank\\\" rel=\\\"noreferrer\\\">${W||D}</a>`):y});$=g($).replace(/(^|[\\\\s(])\\\\*([^*\\\\n]+)\\\\*(?=$|[\\\\s.,;:!?)])/gm,\\\"$1<b>$2</b>\\\").replace(/(^|[\\\\s(])_([^_\\\\n]+)_(?=$|[\\\\s.,;:!?)])/gm,\\\"$1<i>$2</i>\\\").replace(/(^|[\\\\s(])~([^~\\\\n]+)~(?=$|[\\\\s.,;:!?)])/gm,\\\"$1<s>$2</s>\\\").replace(/:([a-z0-9_+-]+):/gi,(y,E)=>Ie(E)).replace(/(?:^&#62; ?.*(?:\\\\n|$))+/gm,y=>`<blockquote class=\\\"chat-quote\\\">${y.replace(/\\\\n$/,\\\"\\\").replace(/^&#62; ?/gm,\\\"\\\")}</blockquote>`);let H=/\\\\u0000(\\\\d+)\\\\u0000/g;for(let y=0;y<3&&$.includes(\\\"\\\\0\\\");y++)$=$.replace(H,(E,D)=>d[Number(D)]??\\\"\\\");return $},ze=(a,o)=>{if(typeof a==\\\"string\\\")return ke(a,o);let d=va(a),h=R(d.text);return h?d.type===\\\"plain_text\\\"?P(h).replace(/:([a-z0-9_+-]+):/gi,(g,v)=>Ie(v)):ke(h,o):\\\"\\\"},At=(a,o,d)=>{let h=tt(a);return h?`<img class=\\\"${d}\\\" src=\\\"${P(h)}\\\" alt=\\\"${P(o)}\\\" loading=\\\"lazy\\\">`:\\\"\\\"},wa=(a,o)=>`<span class=\\\"chat-btn ${a.style===\\\"primary\\\"||a.style===\\\"danger\\\"?a.style:\\\"\\\"}\\\" data-block-element=\\\"${P(R(a.type))}\\\">${ze(a.text??a.placeholder,o)||P(R(a.type))}</span>`,ga=(a,o)=>a.type===\\\"image\\\"?At(R(a.image_url),R(a.alt_text),\\\"chat-thumb\\\"):a.type===\\\"mrkdwn\\\"||a.type===\\\"plain_text\\\"?`<span>${ze(a,o)}</span>`:wa(a,o),xa=(a,o)=>{let d=va(a.style),h;if(a.type===\\\"link\\\"){let g=tt(R(a.url)),v=P(R(a.text)||R(a.url));h=g?`<a href=\\\"${P(g)}\\\" target=\\\"_blank\\\" rel=\\\"noreferrer\\\">${v}</a>`:v}else a.type===\\\"emoji\\\"?h=P(Ie(R(a.name))):a.type===\\\"user\\\"||a.type===\\\"usergroup\\\"?h=`<span class=\\\"chat-mention\\\">@${P(o.name?.(R(a.user_id))??R(a.user_id??a.usergroup_id))}</span>`:a.type===\\\"channel\\\"?h=`<span class=\\\"chat-mention\\\">#${P(o.name?.(R(a.channel_id))??R(a.channel_id))}</span>`:a.type===\\\"broadcast\\\"?h=`<span class=\\\"chat-mention\\\">@${P(R(a.range))}</span>`:h=P(R(a.text));return d.code&&(h=`<code class=\\\"chat-code\\\">${h}</code>`),d.bold&&(h=`<b>${h}</b>`),d.italic&&(h=`<i>${h}</i>`),d.strike&&(h=`<s>${h}</s>`),h},cn=(a,o)=>de(a.elements).map(d=>{let h=de(d.elements);if(d.type===\\\"rich_text_list\\\")return`<${d.style===\\\"ordered\\\"?\\\"ol\\\":\\\"ul\\\"} class=\\\"chat-list-block\\\">${h.map(v=>`<li>${de(v.elements).map($=>xa($,o)).join(\\\"\\\")}</li>`).join(\\\"\\\")}</${d.style===\\\"ordered\\\"?\\\"ol\\\":\\\"ul\\\"}>`;let g=h.map(v=>xa(v,o)).join(\\\"\\\");return d.type===\\\"rich_text_preformatted\\\"?`<pre class=\\\"chat-pre\\\">${g}</pre>`:d.type===\\\"rich_text_quote\\\"?`<blockquote class=\\\"chat-quote\\\">${g}</blockquote>`:`<div class=\\\"chat-text\\\">${g}</div>`}).join(\\\"\\\"),pn=(a,o)=>{let d=R(a.type),h=(g,v=\\\"\\\")=>`<div class=\\\"chat-block chat-block-${P(d)} ${v}\\\" data-block=\\\"${P(d)}\\\">${g}</div>`;switch(d){case\\\"section\\\":{let g=de(a.fields),v=Mt(a.accessory)?ga(a.accessory,o):\\\"\\\";return h(`<div class=\\\"chat-section-body\\\">${a.text?`<div class=\\\"chat-text\\\">${ze(a.text,o)}</div>`:\\\"\\\"}${g.length?`<div class=\\\"chat-fields\\\">${g.map($=>`<div class=\\\"chat-text\\\">${ze($,o)}</div>`).join(\\\"\\\")}</div>`:\\\"\\\"}</div>${v?`<div class=\\\"chat-accessory\\\">${v}</div>`:\\\"\\\"}`,v?\\\"with-accessory\\\":\\\"\\\")}case\\\"header\\\":return h(ze(a.text,o));case\\\"divider\\\":return h(\\\"<hr>\\\");case\\\"context\\\":return h(de(a.elements).map(g=>ga(g,o)).join(\\\"\\\"));case\\\"actions\\\":return h(de(a.elements).map(g=>wa(g,o)).join(\\\"\\\"));case\\\"image\\\":return h(`${a.title?`<div class=\\\"chat-caption\\\">${ze(a.title,o)}</div>`:\\\"\\\"}${At(R(a.image_url),R(a.alt_text),\\\"chat-image\\\")}`);case\\\"rich_text\\\":return h(cn(a,o));default:return h(`<span class=\\\"chat-unknown\\\">${P(d||\\\"block\\\")}</span>`,\\\"unknown\\\")}},Lt=(a,o={})=>de(a).map(d=>pn(d,o)).join(\\\"\\\"),mn={good:\\\"#2eb67d\\\",warning:\\\"#ecb22e\\\",danger:\\\"#e01e5a\\\"},$a=(a,o={})=>de(a).map(d=>{let h=R(d.color),g=mn[h]??(/^#?[0-9a-f]{3,8}$/i.test(h)?`#${h.replace(/^#/,\\\"\\\")}`:\\\"#dddddd\\\"),v=tt(R(d.title_link)),$=P(R(d.title)),H=de(d.fields);return`<div class=\\\"chat-attachment\\\" data-color=\\\"${P(g)}\\\" style=\\\"border-left-color:${P(g)}\\\">${d.pretext?`<div class=\\\"chat-text\\\">${ke(R(d.pretext),o)}</div>`:\\\"\\\"}${d.author_name?`<div class=\\\"chat-att-author\\\">${P(R(d.author_name))}</div>`:\\\"\\\"}${$?`<div class=\\\"chat-att-title\\\">${v?`<a href=\\\"${P(v)}\\\" target=\\\"_blank\\\" rel=\\\"noreferrer\\\">${$}</a>`:$}</div>`:\\\"\\\"}${d.text?`<div class=\\\"chat-text\\\">${ke(R(d.text),o)}</div>`:\\\"\\\"}${H.length?`<div class=\\\"chat-fields\\\">${H.map(y=>`<div class=\\\"chat-field ${y.short?\\\"short\\\":\\\"\\\"}\\\"><b>${P(R(y.title))}</b><div class=\\\"chat-text\\\">${ke(R(y.value),o)}</div></div>`).join(\\\"\\\")}</div>`:\\\"\\\"}${Lt(d.blocks,o)}${At(R(d.image_url),R(d.fallback),\\\"chat-image\\\")}${d.footer?`<div class=\\\"chat-att-footer\\\">${P(R(d.footer))}</div>`:\\\"\\\"}</div>`}).join(\\\"\\\");var X=(a,o,d,h=\\\"\\\")=>`<svg width=\\\"${a}\\\" height=\\\"${o}\\\" viewBox=\\\"0 0 ${a} ${o}\\\" fill=\\\"none\\\" aria-hidden=\\\"true\\\" ${h}>${d}</svg>`,A=(a,o=20)=>`<svg width=\\\"${o}\\\" height=\\\"${o}\\\" viewBox=\\\"0 0 24 24\\\" fill=\\\"currentColor\\\" aria-hidden=\\\"true\\\"><path d=\\\"${a}\\\"/></svg>`,u={signal:(a=\\\"currentColor\\\")=>X(18,12,`<rect x=\\\"0\\\" y=\\\"8\\\" width=\\\"3\\\" height=\\\"4\\\" rx=\\\"1\\\" fill=\\\"${a}\\\"/><rect x=\\\"5\\\" y=\\\"5.5\\\" width=\\\"3\\\" height=\\\"6.5\\\" rx=\\\"1\\\" fill=\\\"${a}\\\"/><rect x=\\\"10\\\" y=\\\"3\\\" width=\\\"3\\\" height=\\\"9\\\" rx=\\\"1\\\" fill=\\\"${a}\\\"/><rect x=\\\"15\\\" y=\\\"0\\\" width=\\\"3\\\" height=\\\"12\\\" rx=\\\"1\\\" fill=\\\"${a}\\\"/>`),wifi:(a=\\\"currentColor\\\")=>X(16,12,`<path d=\\\"M8 2.6c2.3 0 4.4.9 6 2.4l1.1-1.1A10 10 0 0 0 8 1 10 10 0 0 0 .9 3.9L2 5c1.6-1.5 3.7-2.4 6-2.4Z\\\" fill=\\\"${a}\\\"/><path d=\\\"M8 5.9c1.4 0 2.6.5 3.6 1.4l1.1-1.1A6.7 6.7 0 0 0 8 4.3c-1.8 0-3.5.7-4.7 1.9l1.1 1.1c1-.9 2.2-1.4 3.6-1.4Z\\\" fill=\\\"${a}\\\"/><path d=\\\"M10.3 8.6 8 11 5.7 8.6A3.3 3.3 0 0 1 8 7.6c.9 0 1.7.4 2.3 1Z\\\" fill=\\\"${a}\\\"/>`),battery:(a=\\\"currentColor\\\")=>X(27,13,`<rect x=\\\".5\\\" y=\\\".5\\\" width=\\\"23\\\" height=\\\"12\\\" rx=\\\"3.8\\\" stroke=\\\"${a}\\\" stroke-opacity=\\\".4\\\"/><rect x=\\\"2\\\" y=\\\"2\\\" width=\\\"20\\\" height=\\\"9\\\" rx=\\\"2.5\\\" fill=\\\"${a}\\\"/><path d=\\\"M25 4.5v4c.8-.3 1.3-1.1 1.3-2s-.5-1.7-1.3-2Z\\\" fill=\\\"${a}\\\" fill-opacity=\\\".45\\\"/>`),compose:()=>X(24,24,'<path d=\\\"M19 13v6.5a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 3 19.5v-13A1.5 1.5 0 0 1 4.5 5H11\\\" stroke=\\\"#007aff\\\" stroke-width=\\\"1.8\\\" stroke-linecap=\\\"round\\\"/><path d=\\\"m9.5 14.5.6-3.1 8.8-8.8a1.5 1.5 0 0 1 2.1 0l.9.9a1.5 1.5 0 0 1 0 2.1l-8.8 8.8-3.6.1Z\\\" stroke=\\\"#007aff\\\" stroke-width=\\\"1.8\\\" stroke-linejoin=\\\"round\\\"/>'),search:(a=\\\"currentColor\\\",o=16)=>X(o,o,`<circle cx=\\\"${o*.43}\\\" cy=\\\"${o*.43}\\\" r=\\\"${o*.3}\\\" stroke=\\\"${a}\\\" stroke-width=\\\"${o/9}\\\"/><path d=\\\"m${o*.65} ${o*.65} ${o*.27} ${o*.27}\\\" stroke=\\\"${a}\\\" stroke-width=\\\"${o/9}\\\" stroke-linecap=\\\"round\\\"/>`),mic:(a=\\\"#8e8e93\\\")=>X(14,20,`<rect x=\\\"4\\\" y=\\\"1\\\" width=\\\"6\\\" height=\\\"11\\\" rx=\\\"3\\\" fill=\\\"${a}\\\"/><path d=\\\"M1.5 9a5.5 5.5 0 0 0 11 0M7 14.5V18\\\" stroke=\\\"${a}\\\" stroke-width=\\\"1.6\\\" stroke-linecap=\\\"round\\\"/>`),chevronRight:(a=\\\"#c4c4c6\\\")=>X(8,13,`<path d=\\\"m1.5 1.5 5 5-5 5\\\" stroke=\\\"${a}\\\" stroke-width=\\\"2\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"/>`),chevronBack:()=>X(13,21,'<path d=\\\"M11 2 2.5 10.5 11 19\\\" stroke=\\\"#007aff\\\" stroke-width=\\\"3\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"/>'),plus:()=>X(16,16,'<path d=\\\"M8 2v12M2 8h12\\\" stroke=\\\"#8e8e93\\\" stroke-width=\\\"2.2\\\" stroke-linecap=\\\"round\\\"/>'),person:()=>X(26,26,'<circle cx=\\\"13\\\" cy=\\\"9\\\" r=\\\"5\\\" fill=\\\"#fff\\\"/><path d=\\\"M3 24c0-5.5 4.5-9 10-9s10 3.5 10 9\\\" fill=\\\"#fff\\\"/>'),padlock:()=>X(16,21,'<rect x=\\\"1\\\" y=\\\"9\\\" width=\\\"14\\\" height=\\\"11\\\" rx=\\\"2.5\\\" fill=\\\"#fff\\\"/><path d=\\\"M4 9V6a4 4 0 0 1 8 0v3\\\" stroke=\\\"#fff\\\" stroke-width=\\\"2\\\"/>'),flashlight:()=>X(14,22,'<path d=\\\"M2 1h10v4L9.5 9v11a1 1 0 0 1-1 1h-3a1 1 0 0 1-1-1V9L2 5V1Z\\\" fill=\\\"#fff\\\"/>'),camera:()=>X(22,18,'<path d=\\\"M2 5.5A1.5 1.5 0 0 1 3.5 4h3l1.6-2.2h5.8L15.5 4h3A1.5 1.5 0 0 1 20 5.5v10a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 2 15.5v-10Z\\\" fill=\\\"#fff\\\"/><circle cx=\\\"11\\\" cy=\\\"10.3\\\" r=\\\"3.6\\\" fill=\\\"#555\\\"/>'),bell:()=>A(\\\"M12 22a2 2 0 0 0 2-2h-4a2 2 0 0 0 2 2Zm6-6V11a6 6 0 0 0-5-5.9V4a1 1 0 0 0-2 0v1.1A6 6 0 0 0 6 11v5l-2 2v1h16v-1l-2-2Z\\\",18),expand:()=>A(\\\"M7.4 8.6 12 13.2l4.6-4.6L18 10l-6 6-6-6z\\\",16),collapse:()=>A(\\\"M7.4 15.4 12 10.8l4.6 4.6L18 14l-6-6-6 6z\\\",16),androidWifi:()=>A(\\\"M12 21 23.6 6.5A17.6 17.6 0 0 0 12 2.5 17.6 17.6 0 0 0 .4 6.5Z\\\",15),androidSignal:()=>A(\\\"M2 22h20V2Z\\\",14),androidBattery:()=>A(\\\"M16 4h-2V2h-4v2H8a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1Z\\\",15),menu:()=>A(\\\"M3 18h18v-2H3v2zm0-5h18v-2H3v2zm0-7v2h18V6H3z\\\",24),tune:()=>A(\\\"M3 17v2h6v-2H3zM3 5v2h10V5H3zm10 16v-2h8v-2h-8v-2h-2v6h2zM7 9v2H3v2h4v2h2V9H7zm14 4v-2H11v2h10zm-6-4h2V7h4V5h-4V3h-2v6z\\\",24),help:()=>A(\\\"M11 18h2v-2h-2v2zm1-16a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16zm0-14a4 4 0 0 0-4 4h2a2 2 0 1 1 4 0c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5a4 4 0 0 0-4-4z\\\",24),gear:()=>A(\\\"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 0 0 .12-.61l-1.92-3.32a.49.49 0 0 0-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.48.48 0 0 0-.48-.41h-3.84a.48.48 0 0 0-.48.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96a.48.48 0 0 0-.59.22L2.74 8.87a.47.47 0 0 0 .12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 0 0-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32a.47.47 0 0 0-.12-.61l-2.01-1.58zM12 15.6A3.6 3.6 0 1 1 12 8.4a3.6 3.6 0 0 1 0 7.2z\\\",24),apps:()=>A(\\\"M6 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm6 12a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm-6 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0-6a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm6 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm4-8a2 2 0 1 0 4 0 2 2 0 0 0-4 0zm-4 2a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm6 6a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 6a2 2 0 1 0 0-4 2 2 0 0 0 0 4z\\\",24),pencil:()=>A(\\\"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04a1 1 0 0 0 0-1.41l-2.34-2.34a1 1 0 0 0-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z\\\",24),inbox:()=>A(\\\"M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zm0 12h-4a3 3 0 0 1-6 0H5V5h14v10z\\\",20),star:()=>A(\\\"M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z\\\",20),clock:()=>A(\\\"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 18a8 8 0 1 1 0-16 8 8 0 0 1 0 16zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67V7z\\\",20),send:()=>A(\\\"M3.4 20.4l17.45-7.48a1 1 0 0 0 0-1.84L3.4 3.6a.99.99 0 0 0-1.39.91L2 9.12c0 .5.37.93.87.99L17 12 2.87 13.88c-.5.07-.87.5-.87 1l.01 4.61c0 .71.73 1.2 1.39.91z\\\",20),draft:()=>A(\\\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zM6 20V4h7v5h5v11H6z\\\",20),more:()=>A(\\\"M12 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm0 2a2 2 0 1 0 0 4 2 2 0 0 0 0-4zm0 6a2 2 0 1 0 0 4 2 2 0 0 0 0-4z\\\",20),refresh:()=>A(\\\"M17.65 6.35A7.96 7.96 0 0 0 12 4a8 8 0 1 0 7.73 10h-2.08A6 6 0 1 1 12 6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z\\\",20),checkbox:()=>A(\\\"M19 5v14H5V5h14m0-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2z\\\",18),back:()=>A(\\\"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z\\\",20),archive:()=>A(\\\"M20.54 5.23l-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.5c0-.48-.17-.93-.46-1.27zM12 17.5 6.5 12H10v-2h4v2h3.5L12 17.5zM5.12 5l.81-1h12l.94 1H5.12z\\\",20),report:()=>A(\\\"M15.73 3H8.27L3 8.27v7.46L8.27 21h7.46L21 15.73V8.27L15.73 3zM19 14.9 14.9 19H9.1L5 14.9V9.1L9.1 5h5.8L19 9.1v5.8zM11 7h2v6h-2zm0 8h2v2h-2z\\\",20),trash:()=>A(\\\"M15 4V3H9v1H4v2h1v13a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6h1V4h-5zm2 15H7V6h10v13zM9 8h2v9H9zm4 0h2v9h-2z\\\",20),reply:()=>A(\\\"M10 9V5l-7 7 7 7v-4.1c5 0 8.5 1.6 11 5.1-1-5-4-10-11-11z\\\",20),forward:()=>A(\\\"M14 9V5l7 7-7 7v-4.1c-5 0-8.5 1.6-11 5.1 1-5 4-10 11-11z\\\",20),clip:()=>A(\\\"M16.5 6v11.5a4 4 0 0 1-8 0V5a2.5 2.5 0 0 1 5 0v10.5a1 1 0 0 1-2 0V6H10v9.5a2.5 2.5 0 0 0 5 0V5a4 4 0 0 0-8 0v12.5a5.5 5.5 0 0 0 11 0V6h-1.5z\\\",16),file:()=>A(\\\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6zm4 18H6V4h7v5h5v11z\\\",28),dropdown:()=>A(\\\"M7 10l5 5 5-5z\\\",18),lock:()=>A(\\\"M18 8h-1V6A5 5 0 0 0 7 6v2H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V10a2 2 0 0 0-2-2zM9 6a3 3 0 0 1 6 0v2H9V6z\\\",14),envelope:()=>X(30,24,'<path d=\\\"M3 4h24v16a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V4Z\\\" fill=\\\"#e8eaed\\\"/><path d=\\\"M3 4l12 9 12-9\\\" stroke=\\\"#5f6368\\\" stroke-width=\\\"2.2\\\" stroke-linejoin=\\\"round\\\"/><path d=\\\"M3 4h24\\\" stroke=\\\"#5f6368\\\" stroke-width=\\\"2.2\\\"/>'),pin:(a=16)=>A(\\\"M16 9V4h1c.55 0 1-.45 1-1s-.45-1-1-1H7c-.55 0-1 .45-1 1s.45 1 1 1h1v5c0 1.66-1.34 3-3 3v2h5.97v7l1 1 1-1v-7H19v-2c-1.66 0-3-1.34-3-3z\\\",a),bellSlash:(a=16)=>A(\\\"M20 18.69 7.84 6.14 5.27 3.49 4 4.76l2.8 2.8v.01c-.52.99-.8 2.16-.8 3.42v5l-2 2v1h13.73l2 2L21 19.72l-1-1.03zM12 22c1.11 0 2-.89 2-2h-4c0 1.11.89 2 2 2zm6-7.32V11c0-3.08-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68c-.15.03-.29.08-.42.12-.1.03-.2.07-.3.11-.23.09-.46.2-.68.31L18 14.68z\\\",a),volumeOn:(a=16)=>A(\\\"M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z\\\",a),volumeOff:(a=16)=>A(\\\"M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3 3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4 9.91 6.09 12 8.18V4z\\\",a),markUnread:(a=20)=>A(\\\"M22 8.98V18c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2h10.1c-.06.32-.1.66-.1 1 0 1.48.65 2.79 1.67 3.71L12 11 4 6v2l8 5 5.3-3.32c.54.2 1.1.32 1.7.32 1.13 0 2.16-.39 3-1.02zM16 5c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3z\\\",a),markRead:(a=20)=>A(\\\"M21.99 8c0-.72-.37-1.35-.94-1.7L12 1 2.95 6.3C2.38 6.65 2 7.28 2 8v10c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2l-.01-10zM12 13 3.74 7.84 12 3l8.26 4.84L12 13z\\\",a),close:(a=16)=>A(\\\"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\\\",a),starFilled:(a=20)=>A(\\\"M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z\\\",a)};var Te=(a,o,d,h,g,v=1)=>{for(let[$,H]of[[1,1],[2.76,.18],[5.4,.06]]){let y=a.createOscillator(),E=a.createGain();y.type=\\\"sine\\\",y.frequency.value=h*$,E.gain.setValueAtTime(0,d),E.gain.linearRampToValueAtTime(.32*H*v,d+.006),E.gain.exponentialRampToValueAtTime(1e-4,d+g/$**.35),y.connect(E).connect(o),y.start(d),y.stop(d+g+.05)}},_e=(a,o,d,h,g)=>{let v=a.createOscillator(),$=a.createBiquadFilter(),H=a.createGain();v.type=\\\"triangle\\\",v.frequency.value=h,$.type=\\\"lowpass\\\",$.frequency.setValueAtTime(h*6,d),$.frequency.exponentialRampToValueAtTime(h*1.5,d+g),H.gain.setValueAtTime(0,d),H.gain.linearRampToValueAtTime(.42,d+.004),H.gain.exponentialRampToValueAtTime(1e-4,d+g),v.connect($).connect(H).connect(o),v.start(d),v.stop(d+g+.05)},hn={sms:(a,o,d)=>{Te(a,o,d,1318.5,.5),Te(a,o,d+.12,1661.2,.5),Te(a,o,d+.24,1975.5,.8)},\\\"push-ios\\\":(a,o,d)=>{Te(a,o,d,1760,.35,.8),Te(a,o,d+.09,2349.3,.9,.9)},\\\"push-android\\\":(a,o,d)=>{_e(a,o,d,1046.5,.22),_e(a,o,d+.1,1568,.22),_e(a,o,d+.2,2093,.45)},email:(a,o,d)=>{Te(a,o,d,987.8,.45,.7),Te(a,o,d+.16,1318.5,.9,.7)},chat:(a,o,d)=>{_e(a,o,d,587.3,.12),_e(a,o,d+.11,880,.2)}},un={sms:[180,90,180],\\\"push-ios\\\":[120],\\\"push-android\\\":[60,80,60]},ya=(a=!1)=>{let o=null,d=null,h=new Map,g=()=>{if(o)return o;let $=globalThis.AudioContext??globalThis.webkitAudioContext;if(!$)return null;try{o=new $,d=o.createGain(),d.gain.value=.6,d.connect(o.destination)}catch{o=null}return o},v={enabled:a,unlock(){if(!v.enabled)return;let $=g();$?.state===\\\"suspended\\\"&&$.resume().catch(()=>{})},play($){if(!v.enabled)return;let H=Date.now();if(H-(h.get($)??0)<600)return;h.set($,H);let y=un[$];if(y)try{navigator.vibrate?.(y)}catch{}let E=g();!E||!d||(E.state===\\\"suspended\\\"&&E.resume().catch(()=>{}),hn[$](E,d,E.currentTime+.02))},close(){o?.close().catch(()=>{}),o=null}};return v};var Ue=(a,o)=>{let d=a.replace(/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//g,\\\"\\\"),h=\\\"\\\",g=0;for(;g<d.length;){let v=d.indexOf(\\\"{\\\",g);if(v<0)break;let $=d.slice(g,v).trim(),H=1,y=v+1;for(;y<d.length&&H>0;)d[y]===\\\"{\\\"?H++:d[y]===\\\"}\\\"&&H--,y++;let E=d.slice(v+1,y-1);/^@(media|container|supports|layer)\\\\b/.test($)?h+=`${$} {\\n${Ue(E,o)}}\\n`:$.startsWith(\\\"@\\\")?h+=`${$} {${E}}\\n`:h+=`${fn($,o)} {${E}}\\n`,g=y}return h},fn=(a,o)=>bn(a).map(d=>{let h=d.trim();return h===\\\":root\\\"||h===\\\"html\\\"||h===\\\"body\\\"?o:h.startsWith(\\\":root\\\")?`${o}${h.slice(5)}`:h.startsWith(\\\"&\\\")?`${o}${h.slice(1)}`:`${o} ${h}`}).join(\\\", \\\"),bn=a=>{let o=[],d=0,h=0;for(let g=0;g<a.length;g++){let v=a[g];v===\\\"(\\\"?d++:v===\\\")\\\"?d--:v===\\\",\\\"&&d===0&&(o.push(a.slice(h,g)),h=g+1)}return o.push(a.slice(h)),o};var at=\\\"mb-notifications\\\",gn=`\\n:root {\\n --bg: #0e1015; --panel: #161920; --panel-2: #1d212a; --line: #2a2f3a; --text: #e8eaf0;\\n --muted: #9aa1b1; --accent: #0a84ff; --ok: #30d158; --bad: #ff453a; --warn: #ffd60a;\\n --ios: -apple-system, BlinkMacSystemFont, \\\"SF Pro Text\\\", \\\"SF Pro Display\\\", \\\"Helvetica Neue\\\", Helvetica, Arial, sans-serif;\\n --android: \\\"Google Sans Text\\\", \\\"Google Sans\\\", Roboto, \\\"Segoe UI\\\", system-ui, sans-serif;\\n --mail: \\\"Google Sans\\\", Roboto, RobotoDraft, Helvetica, Arial, sans-serif;\\n --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\\n}\\n:root { display: block; position: relative; box-sizing: border-box; min-height: 100%; background: var(--bg); color: var(--text);\\n font: 14px/1.4 system-ui, -apple-system, \\\"Segoe UI\\\", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }\\n*, *::before, *::after { box-sizing: border-box; }\\nbutton, input, select { font: inherit; color: inherit; }\\nbutton { cursor: pointer; }\\n[hidden] { display: none !important; }\\n&[data-motion=\\\"reduce\\\"] *, &[data-motion=\\\"reduce\\\"] *::before, &[data-motion=\\\"reduce\\\"] *::after { animation: none !important; transition: none !important; }\\n&.embedded { height: 100%; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }\\n&.embedded .mbn-scroll { flex: 1; min-height: 0; overflow: auto; }\\n&.embedded .inspector { position: absolute; }\\n[data-gesture]:focus-visible, [role=\\\"button\\\"]:focus-visible, .icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }\\n.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\\n\\n/* \\\\u2500\\\\u2500 Harness chrome \\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500 */\\n.topbar { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;\\n padding: 10px 18px; background: rgba(14,16,21,.86); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }\\n.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.01em; margin-right: 6px; }\\n.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg,#0a84ff,#5e5ce6); display: grid; place-items: center; }\\n.brand small { color: var(--muted); font-weight: 500; }\\n.field { display: flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; height: 32px; }\\n.field label { color: var(--muted); font-size: 12px; }\\n.field select, .field input { background: transparent; border: 0; outline: 0; height: 30px; min-width: 0; }\\n.field select option { background: var(--panel-2); }\\n.field.search { flex: 1 1 220px; max-width: 360px; }\\n.field.search input { width: 100%; }\\n.tabs { display: flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }\\n.tabs button { background: none; border: 0; padding: 5px 12px; border-radius: 6px; color: var(--muted); font-weight: 550; }\\n.tabs button[aria-pressed=\\\"true\\\"] { background: #2c3240; color: var(--text); }\\n.toggle { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; user-select: none; }\\n.toggle input { accent-color: var(--accent); }\\n.sources { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }\\n.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 12px; color: var(--muted); white-space: nowrap; }\\n.pill b { color: var(--text); font-weight: 600; }\\n.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }\\n.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(48,209,88,.15); }\\n.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(255,69,58,.15); }\\n.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }\\n.notice { margin: 14px 18px 0; padding: 10px 14px; border: 1px solid #5a2b2b; background: #2a1517; color: #ffb4ab; border-radius: 10px; font-size: 13px; }\\n\\n.devices { display: flex; flex-wrap: wrap; gap: 28px; padding: 22px 18px 40px; align-items: flex-start; justify-content: center; zoom: var(--mbn-scale, 1); }\\n.devices.solo .device-col.wide { max-width: 1280px; }\\n.device-col { display: flex; flex-direction: column; gap: 12px; align-items: center; width: 362px; flex: none; }\\n.device-col.wide { flex: 3 1 480px; width: auto; min-width: 0; max-width: 1180px; align-items: stretch; }\\n.device-col.wide.chat-col { flex: 2 1 340px; max-width: 760px; }\\n.devices.solo .device-col.wide.chat-col { max-width: 980px; }\\n/* Two fixed rows on every device, so the frames underneath all start at the same height. */\\n.device-head { display: grid; grid-template-rows: 28px 30px; row-gap: 6px; height: 64px; flex: none; width: 100%; justify-items: start; }\\n.device-head .head-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-width: 0; height: 28px; overflow: hidden; }\\n.device-head h2 { white-space: nowrap; }\\n.device-head h2 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 650; display: flex; align-items: center; gap: 8px; }\\n.device-head h2 .count { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 11px; letter-spacing: 0; line-height: 18px; }\\n.device-head .field { height: 30px; max-width: 100%; min-width: 0; }\\n.device-head .field select { max-width: 190px; text-overflow: ellipsis; }\\n.channel-tabs { display: flex; gap: 2px; padding: 0 18px; border-bottom: 1px solid var(--line); background: var(--panel); overflow-x: auto; flex: none; scrollbar-width: none; }\\n.channel-tabs [role=\\\"tab\\\"] { position: relative; display: inline-flex; align-items: center; gap: 6px; flex: none; background: none; border: 0; padding: 10px 14px 9px; color: var(--muted); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }\\n.channel-tabs [role=\\\"tab\\\"]:hover { color: var(--text); }\\n.channel-tabs [role=\\\"tab\\\"][aria-selected=\\\"true\\\"] { color: var(--text); border-bottom-color: var(--accent); }\\n.channel-tabs [role=\\\"tab\\\"]:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; border-radius: 6px; }\\n.channel-tabs .tab-unread { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 6px; min-width: 18px; font-size: 11px; line-height: 18px; text-align: center; }\\n.channel-tabs[data-layout=\\\"tabs\\\"] { padding: 0 6px; }\\n.channel-tabs[data-layout=\\\"tabs\\\"] [role=\\\"tab\\\"] { flex: 1 1 0; justify-content: center; padding-left: 8px; padding-right: 8px; }\\n/* One device at a time: the host is too narrow for two. Phones shrink to fit rather than clip. */\\n&[data-layout=\\\"tabs\\\"] .devices { padding: 14px 8px 32px; gap: 0; }\\n&[data-layout=\\\"tabs\\\"] .device-col.wide { flex-basis: 100%; }\\n&[data-layout=\\\"tabs\\\"] .iphone, &[data-layout=\\\"tabs\\\"] .pixel { zoom: var(--mbn-fit, 1); }\\n&[data-layout=\\\"tabs\\\"] .device-col:not(.wide) { width: auto; max-width: 100%; }\\n&[data-layout=\\\"tabs\\\"] .device-col:not(.wide) .device-head { width: calc(362px * var(--mbn-fit, 1)); }\\n.seg { display: flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; padding: 2px; }\\n.seg button { border: 0; background: none; color: var(--muted); padding: 2px 9px; border-radius: 5px; font-size: 12px; }\\n.seg button[aria-pressed=\\\"true\\\"] { background: #2c3240; color: var(--text); }\\n\\n/* \\\\u2500\\\\u2500 Phone hardware \\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500 */\\n.iphone { position: relative; width: 362px; height: 760px; border-radius: 58px; padding: 12px; background: #0b0b0c;\\n box-shadow: 0 0 0 2px #3a3a3c, 0 0 0 6px #1c1c1e, 0 0 0 7px #4a4a4e, 0 40px 80px rgba(0,0,0,.55); }\\n.iphone::before, .iphone::after { content: \\\"\\\"; position: absolute; left: -9px; width: 4px; border-radius: 2px; background: #2c2c2e; }\\n.iphone::before { top: 150px; height: 60px; }\\n.iphone::after { top: 225px; height: 60px; }\\n/* clip-path as well as overflow: under zoom, Chromium lets a blurred bar (backdrop-filter) square off the rounded corners. */\\n.iphone .screen { position: relative; width: 100%; height: 100%; border-radius: 47px; overflow: hidden; clip-path: inset(0 round 47px); background: #fff; font-family: var(--ios); color: #000; -webkit-font-smoothing: antialiased; }\\n.island { position: absolute; z-index: 30; top: 11px; left: 50%; transform: translateX(-50%); width: 112px; height: 33px; border-radius: 20px; background: #000; }\\n.statusbar { position: absolute; z-index: 25; top: 0; left: 0; right: 0; height: 54px; display: flex; align-items: center; justify-content: space-between; padding: 6px 32px 0 40px; font: 600 16px/1 var(--ios); letter-spacing: -.01em; }\\n.statusbar .icons { display: flex; gap: 6px; align-items: center; }\\n.statusbar.light { color: #fff; }\\n.home-indicator { position: absolute; z-index: 30; bottom: 8px; left: 50%; transform: translateX(-50%); width: 134px; height: 5px; border-radius: 3px; background: #000; }\\n.home-indicator.light { background: rgba(255,255,255,.9); }\\n\\n.pixel { position: relative; width: 352px; height: 760px; border-radius: 44px; padding: 10px; background: #111;\\n box-shadow: 0 0 0 2px #2b2b2f, 0 0 0 5px #3c3c41, 0 40px 80px rgba(0,0,0,.55); }\\n.pixel::after { content: \\\"\\\"; position: absolute; right: -7px; top: 170px; width: 4px; height: 90px; border-radius: 2px; background: #2c2c2e; }\\n.pixel .screen { position: relative; width: 100%; height: 100%; border-radius: 35px; overflow: hidden; clip-path: inset(0 round 35px); font-family: var(--android); }\\n.punch { position: absolute; z-index: 30; top: 12px; left: 50%; width: 13px; height: 13px; margin-left: -6px; border-radius: 50%; background: #050505; box-shadow: inset 0 0 0 2px #1a1a1a; }\\n\\n/* \\\\u2500\\\\u2500 Messages (iOS) \\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500 */\\n.msgs { position: absolute; inset: 0; display: flex; flex-direction: column; background: #fff; }\\n.msgs-nav { padding: 54px 16px 0; }\\n.msgs-nav .row { display: flex; justify-content: space-between; align-items: center; height: 44px; color: #007aff; font-size: 17px; }\\n.msgs-nav h1 { margin: 2px 0 8px; font: 700 34px/41px var(--ios); letter-spacing: .01em; }\\n.ios-search { display: flex; align-items: center; gap: 6px; height: 36px; border-radius: 10px; background: rgba(118,118,128,.12); color: rgba(60,60,67,.6); padding: 0 8px; font-size: 17px; margin-bottom: 8px; }\\n.ios-search span { flex: 1; }\\n.threads { flex: 1; overflow-y: auto; }\\n.thread { position: relative; display: flex; gap: 12px; padding: 10px 16px 0 26px; cursor: pointer; }\\n.thread:active { background: #e5e5ea; }\\n.thread .unread { position: absolute; left: 8px; top: 30px; width: 10px; height: 10px; border-radius: 50%; background: #007aff; }\\n.avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 600 18px var(--ios); background: linear-gradient(180deg,#a5abb8,#858994); }\\n.thread .text { flex: 1; min-width: 0; border-bottom: .5px solid #c6c6c8; padding-bottom: 10px; }\\n.thread .top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }\\n.thread .name { font: 600 17px/22px var(--ios); letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\\n.thread .when { flex: none; color: rgba(60,60,67,.6); font-size: 15px; display: flex; align-items: center; gap: 6px; }\\n.thread .preview { color: rgba(60,60,67,.6); font-size: 15px; line-height: 20px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; letter-spacing: -.01em; }\\n.empty-ios { flex: 1; display: grid; place-items: center; color: rgba(60,60,67,.6); font-size: 17px; text-align: center; padding: 40px; }\\n\\n.convo { position: absolute; inset: 0; display: flex; flex-direction: column; background: #fff; }\\n.convo-nav { position: relative; z-index: 5; padding-top: 50px; background: rgba(249,249,249,.94); backdrop-filter: blur(20px); border-bottom: .5px solid rgba(0,0,0,.18); }\\n.convo-nav .bar { position: relative; height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }\\n.convo-nav .back { position: absolute; left: 8px; top: 8px; display: flex; align-items: center; color: #007aff; font-size: 17px; background: none; border: 0; padding: 4px; }\\n.convo-nav .back .badge { background: #007aff; color: #fff; border-radius: 10px; font-size: 13px; min-width: 20px; padding: 0 6px; line-height: 20px; margin-left: 2px; }\\n.convo-nav .avatar { width: 54px; height: 54px; font-size: 22px; }\\n.convo-nav .who { font-size: 12px; display: flex; align-items: center; gap: 2px; }\\n.convo-body { flex: 1; overflow-y: auto; padding: 8px 0 12px; }\\n.stamp { text-align: center; color: rgba(60,60,67,.6); font-size: 12px; margin: 14px 0 6px; }\\n.stamp b { font-weight: 600; }\\n.bubble-row { display: flex; padding: 0 14px; margin-top: 2px; }\\n.bubble-row.gap { margin-top: 10px; }\\n.bubble { position: relative; max-width: 74%; padding: 7px 12px 8px; border-radius: 18px; background: #e9e9eb; color: #000; font-size: 17px; line-height: 22px; letter-spacing: -.02em; white-space: pre-wrap; overflow-wrap: anywhere; }\\n.bubble.tail::before { content: \\\"\\\"; position: absolute; bottom: 0; left: -7px; width: 20px; height: 20px; background: #e9e9eb; border-bottom-right-radius: 15px; }\\n.bubble.tail::after { content: \\\"\\\"; position: absolute; bottom: 0; left: -10px; width: 10px; height: 20px; background: #fff; border-bottom-right-radius: 10px; }\\n.bubble a, .bubble .code { color: inherit; text-decoration: underline; text-underline-offset: 2px; }\\n.bubble .media { display: block; max-width: 100%; border-radius: 12px; margin: 2px 0 4px; }\\n.bubble.arrive { animation: mbn-pop .35s cubic-bezier(.2,.9,.3,1.3); }\\n.delivered-note { padding: 2px 16px 0 26px; color: rgba(60,60,67,.6); font-size: 11px; }\\n.convo-input { display: flex; align-items: flex-end; gap: 8px; padding: 6px 10px 32px; background: #fff; }\\n.convo-input .plus { width: 34px; height: 34px; border-radius: 50%; background: #e9e9eb; display: grid; place-items: center; flex: none; }\\n.convo-input .field-ios { flex: 1; height: 36px; border: 1px solid #c6c6c8; border-radius: 18px; display: flex; align-items: center; justify-content: space-between; padding: 0 6px 0 14px; color: #c4c4c6; font-size: 17px; }\\n.qt { margin: 0 10px 6px; padding: 8px 12px; border-radius: 10px; background: #d1d3d9; text-align: center; font-size: 15px; color: #000; }\\n.qt small { display: block; font-size: 12px; color: #3c3c43; }\\n\\n/* \\\\u2500\\\\u2500 Lock screen (iOS) \\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500 */\\n.lock { position: absolute; inset: 0; color: #fff; overflow: hidden;\\n background: radial-gradient(120% 70% at 20% 10%, #6f86ff 0%, transparent 55%), radial-gradient(90% 60% at 90% 30%, #ff7eb3 0%, transparent 60%), radial-gradient(120% 80% at 50% 100%, #1d1b4a 0%, transparent 70%), linear-gradient(180deg,#3a3f9f,#141433); }\\n.lock .padlock { position: absolute; top: 56px; left: 50%; transform: translateX(-50%); opacity: .95; }\\n.lock .date { position: absolute; top: 84px; width: 100%; text-align: center; font: 600 19px var(--ios); letter-spacing: .01em; opacity: .92; }\\n.lock .clock { position: absolute; top: 102px; width: 100%; text-align: center; font: 700 92px/1 \\\"SF Pro Rounded\\\", var(--ios); letter-spacing: -.02em; color: rgba(255,255,255,.93); }\\n.lock-stack { position: absolute; left: 10px; right: 10px; top: 236px; bottom: 112px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; scrollbar-width: none; }\\n.lock-stack::-webkit-scrollbar { display: none; }\\n.lock-stack .center-label { text-align: center; font: 600 15px var(--ios); opacity: .85; padding: 4px 0; }\\n.ios-note { position: relative; display: flex; gap: 10px; padding: 11px 12px 12px 11px; border-radius: 22px; color: #000; background: rgba(246,246,246,.66); backdrop-filter: blur(28px) saturate(180%); -webkit-backdrop-filter: blur(28px) saturate(180%); cursor: pointer; box-shadow: 0 1px 0 rgba(255,255,255,.25) inset; }\\n.ios-note.arrive { animation: mbn-drop .45s cubic-bezier(.2,.9,.3,1.15); }\\n.ios-note .app-icon { flex: none; width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; color: #fff; font: 700 18px var(--ios); box-shadow: 0 0 0 .5px rgba(0,0,0,.08); }\\n.ios-note .content { flex: 1; min-width: 0; }\\n.ios-note .line1 { display: flex; justify-content: space-between; gap: 8px; }\\n.ios-note .title { font: 600 15px/20px var(--ios); letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\\n.ios-note .time { flex: none; font-size: 13px; color: rgba(60,60,67,.62); }\\n.ios-note .body { font: 400 15px/20px var(--ios); letter-spacing: -.02em; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }\\n.ios-note .thumb { flex: none; width: 38px; height: 38px; border-radius: 7px; object-fit: cover; align-self: center; }\\n.ios-note.expanded .body { -webkit-line-clamp: unset; }\\n.ios-note .hero { width: 100%; border-radius: 12px; margin-top: 8px; display: block; }\\n.note-data { margin-top: 8px; font: 12px/1.45 var(--mono); background: rgba(255,255,255,.55); border-radius: 10px; padding: 8px 10px; white-space: pre-wrap; overflow-wrap: anywhere; color: #1c1c1e; }\\n.note-meta { margin-top: 6px; font-size: 12px; color: rgba(60,60,67,.7); }\\n.ios-stack-more { position: relative; height: 18px; margin: -14px 14px 0; border-radius: 0 0 18px 18px; background: rgba(246,246,246,.42); backdrop-filter: blur(20px); }\\n.ios-stack-more + .ios-stack-more { margin: -10px 26px 0; background: rgba(246,246,246,.28); }\\n.lock-buttons { position: absolute; bottom: 46px; left: 46px; right: 46px; display: flex; justify-content: space-between; }\\n.lock-buttons span { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.28); backdrop-filter: blur(20px); }\\n.lock-empty { text-align: center; font: 500 15px var(--ios); opacity: .7; margin-top: 30px; }\\n\\n/* \\\\u2500\\\\u2500 Notification shade (Android) \\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500 */\\n.shade { position: absolute; inset: 0; color: #e6e1e5; background: linear-gradient(180deg, rgba(20,18,24,.94), rgba(20,18,24,.98)), radial-gradient(100% 60% at 30% 0%, #4b3f72, #141218); overflow: hidden; }\\n.shade .sb { position: absolute; top: 0; left: 0; right: 0; height: 40px; display: flex; align-items: center; justify-content: space-between; padding: 6px 24px 0; font: 500 14px var(--android); color: #e6e1e5; }\\n.shade .sb .icons { display: flex; gap: 5px; align-items: center; }\\n.shade .qs-head { position: absolute; top: 46px; left: 22px; right: 22px; display: flex; justify-content: space-between; align-items: center; font: 400 15px var(--android); color: #cac4d0; }\\n.qs { position: absolute; top: 80px; left: 14px; right: 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }\\n.qs .tile { height: 60px; border-radius: 20px; background: #36343b; display: flex; align-items: center; gap: 10px; padding: 0 14px; font: 500 14px var(--android); color: #e6e1e5; min-width: 0; }\\n.qs .tile > div { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\\n.qs .tile svg { flex: none; }\\n.qs .tile.on { background: #d0bcff; color: #381e72; }\\n.qs .tile small { display: block; font-weight: 400; font-size: 12px; opacity: .8; }\\n.qs-bright { position: absolute; top: 216px; left: 14px; right: 14px; height: 44px; border-radius: 22px; background: #36343b; overflow: hidden; }\\n.qs-bright::before { content: \\\"\\\"; position: absolute; inset: 0 44% 0 0; background: #d0bcff; border-radius: 22px; }\\n.shade-list { position: absolute; top: 276px; left: 10px; right: 10px; bottom: 92px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; scrollbar-width: none; }\\n.shade-list::-webkit-scrollbar { display: none; }\\n.a-note { background: #2b2930; border-radius: 6px; padding: 14px 16px 14px 14px; cursor: pointer; display: flex; gap: 12px; }\\n.a-note:first-child { border-top-left-radius: 26px; border-top-right-radius: 26px; }\\n.a-note:last-child { border-bottom-left-radius: 26px; border-bottom-right-radius: 26px; }\\n.a-note.arrive { animation: mbn-headsup .5s cubic-bezier(.2,.9,.3,1.12); }\\n.a-note .a-icon { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 600 15px var(--android); }\\n.a-note .a-main { flex: 1; min-width: 0; }\\n.a-note .a-head { display: flex; align-items: center; gap: 6px; font: 400 12px var(--android); color: #cac4d0; }\\n.a-note .a-head .chev { margin-left: auto; width: 26px; height: 20px; border-radius: 10px; background: #49454f; display: grid; place-items: center; }\\n.a-note .a-title { font: 500 15px/20px var(--android); color: #e6e1e5; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\\n.a-note .a-body { font: 400 14px/20px var(--android); color: #cac4d0; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }\\n.a-note.expanded .a-body { -webkit-line-clamp: unset; }\\n.a-note .large-icon { flex: none; width: 40px; height: 40px; border-radius: 8px; object-fit: cover; align-self: center; }\\n.a-note .big-picture { display: block; width: 100%; border-radius: 14px; margin-top: 10px; }\\n.a-note .note-data { background: #1d1b20; color: #e6e1e5; }\\n.a-note .note-meta { color: #938f99; }\\n.shade-actions { position: absolute; bottom: 44px; left: 14px; right: 14px; display: flex; justify-content: space-between; }\\n.shade-actions span { padding: 8px 16px; border-radius: 18px; background: #36343b; font: 500 14px var(--android); color: #e6e1e5; }\\n.shade-empty { text-align: center; color: #938f99; font: 400 14px var(--android); margin-top: 26px; }\\n.gesture { position: absolute; bottom: 12px; left: 50%; width: 110px; height: 4px; margin-left: -55px; border-radius: 2px; background: rgba(255,255,255,.75); }\\n\\n/* \\\\u2500\\\\u2500 Mail (web client) \\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500 */\\n.window { position: relative; container-type: inline-size; border-radius: 12px; overflow: hidden; background: #f8fafd; box-shadow: 0 0 0 1px #2c313c, 0 30px 70px rgba(0,0,0,.5); height: 760px; display: flex; flex-direction: column; font-family: var(--mail); color: #1f1f1f; }\\n.chrome { flex: none; height: 38px; background: #dfe3e9; display: flex; align-items: center; gap: 12px; padding: 0 12px; }\\n.lights { display: flex; gap: 7px; }\\n.lights i { width: 12px; height: 12px; border-radius: 50%; display: block; }\\n.lights i:nth-child(1) { background: #ff5f57; } .lights i:nth-child(2) { background: #febc2e; } .lights i:nth-child(3) { background: #28c840; }\\n.omnibox { flex: 1; max-width: 560px; margin: 0 auto; height: 26px; border-radius: 13px; background: #fff; display: flex; align-items: center; gap: 8px; padding: 0 12px; color: #5f6368; font: 13px system-ui; }\\n.mail-top { flex: none; height: 64px; display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 12px; }\\n.icon-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #444746; border: 0; background: none; flex: none; }\\n.icon-btn:hover { background: rgba(68,71,70,.08); }\\n.mail-logo { display: flex; align-items: center; gap: 6px; width: 194px; font: 400 22px var(--mail); color: #444746; letter-spacing: -.01em; }\\n.mail-search { flex: 1; min-width: 0; max-width: 720px; height: 48px; border-radius: 24px; background: #e9eef6; display: flex; align-items: center; gap: 4px; padding: 0 4px; color: #444746; font-size: 16px; }\\n.mail-search .placeholder { flex: 1; padding-left: 4px; }\\n.mail-top .right { margin-left: auto; display: flex; align-items: center; gap: 2px; }\\n.mail-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 500 15px var(--mail); margin-left: 8px; }\\n.mail-body { flex: 1; min-height: 0; display: flex; }\\n.mail-nav { flex: none; width: 236px; padding: 8px 8px 0 0; overflow: hidden; }\\n.compose { display: inline-flex; align-items: center; gap: 12px; height: 56px; padding: 0 22px 0 16px; margin: 0 0 16px 8px; border-radius: 16px; background: #c2e7ff; color: #001d35; font: 500 14px var(--mail); border: 0; box-shadow: none; }\\n.nav-item { display: flex; align-items: center; gap: 18px; height: 32px; padding: 0 12px 0 26px; border-radius: 0 16px 16px 0; color: #202124; font: 400 14px var(--mail); }\\n.nav-item.active { background: #d3e3fd; font-weight: 700; color: #001d35; }\\n.nav-item .n { margin-left: auto; font-size: 12px; }\\n.mail-main { flex: 1; min-width: 0; margin: 0 16px 16px 0; background: #fff; border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; }\\n.mail-toolbar { flex: none; height: 48px; display: flex; align-items: center; gap: 4px; padding: 0 12px 0 14px; color: #444746; }\\n.mail-toolbar .range { margin-left: auto; font-size: 12px; color: #444746; }\\n.cat-tabs { flex: none; display: flex; border-bottom: 1px solid #f1f3f4; }\\n.cat-tabs div { flex: 0 1 250px; min-width: 0; height: 54px; display: flex; align-items: center; gap: 16px; padding: 0 16px; color: #444746; font: 500 14px var(--mail); position: relative; }\\n.cat-tabs div.on { color: #0b57d0; }\\n.cat-tabs div.on::after { content: \\\"\\\"; position: absolute; left: 8px; right: 8px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: #0b57d0; }\\n.mail-list { flex: 1; overflow-y: auto; }\\n.mrow { display: flex; align-items: center; height: 40px; padding: 0 16px 0 12px; border-bottom: 1px solid #f1f3f4; cursor: pointer; font-size: 14px; color: #202124; background: #f2f6fc; }\\n.mrow.unread { background: #fff; font-weight: 700; }\\n.mrow:hover { box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15); position: relative; z-index: 1; }\\n.mrow.arrive { animation: mbn-rowflash 1.6s ease-out; }\\n.mrow .chk, .mrow .star { flex: none; width: 20px; height: 20px; margin-right: 10px; color: #c4c7c5; display: grid; place-items: center; }\\n.mrow .from { flex: none; width: 168px; padding-right: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\\n.mrow .subj { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\\n.mrow .snippet { color: #5f6368; font-weight: 400; }\\n.mrow .clip { color: #5f6368; margin-left: 8px; flex: none; }\\n.mrow .date { flex: none; width: 78px; text-align: right; font-size: 12px; }\\n.mrow .svc { flex: none; font: 500 10px var(--mail); color: #5f6368; border: 1px solid #dadce0; border-radius: 4px; padding: 0 4px; margin-left: 8px; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }\\n.mail-empty { padding: 60px 20px; text-align: center; color: #5f6368; font: 400 14px var(--mail); }\\n.mail-empty b { display: block; font: 400 22px var(--mail); color: #1f1f1f; margin: 12px 0 4px; }\\n.reader { flex: 1; overflow-y: auto; padding: 0 0 24px; }\\n.reader .subject-row { display: flex; align-items: center; gap: 10px; padding: 18px 16px 8px 72px; }\\n.reader h1 { margin: 0; font: 400 22px/28px var(--mail); color: #1f1f1f; }\\n.label-chip { font: 400 12px var(--mail); background: #ddd; border-radius: 4px; padding: 0 6px; color: #444746; display: inline-flex; gap: 4px; align-items: center; }\\n.sender-row { display: flex; gap: 14px; padding: 12px 16px 0 16px; }\\n.sender-row .mail-avatar { width: 40px; height: 40px; font-size: 18px; margin: 0; }\\n.sender-row .who { flex: 1; min-width: 0; }\\n.sender-row .who b { font: 700 14px var(--mail); color: #1f1f1f; }\\n.sender-row .who .addr { font: 400 12px var(--mail); color: #5e5e5e; }\\n.sender-row .who .to { font: 400 12px var(--mail); color: #5e5e5e; display: flex; align-items: center; gap: 2px; margin-top: 2px; }\\n.sender-row .meta { display: flex; align-items: center; gap: 4px; color: #5e5e5e; font: 400 12px var(--mail); white-space: nowrap; }\\n.details { margin: 8px 16px 0 70px; padding: 10px 14px; border: 1px solid #dadce0; border-radius: 8px; font: 12px/1.6 var(--mail); color: #5e5e5e; display: grid; grid-template-columns: max-content 1fr; gap: 0 12px; }\\n.details span:nth-child(odd) { text-align: right; }\\n.details span:nth-child(even) { color: #1f1f1f; overflow-wrap: anywhere; }\\n.mail-frame { display: block; width: calc(100% - 86px); margin: 16px 16px 0 70px; border: 0; min-height: 120px; background: #fff; }\\n.mail-text { margin: 16px 16px 0 70px; white-space: pre-wrap; font: 400 14px/1.55 Arial, sans-serif; color: #222; overflow-wrap: anywhere; }\\n.mail-text a { color: #1155cc; }\\n.attachments { margin: 18px 16px 0 70px; border-top: 1px solid #e0e0e0; padding-top: 14px; }\\n.attachments h3 { margin: 0 0 10px; font: 500 14px var(--mail); color: #1f1f1f; }\\n.att-grid { display: flex; flex-wrap: wrap; gap: 12px; }\\n.att { width: 180px; height: 104px; border: 1px solid #dadce0; border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }\\n.att .att-top { flex: 1; background: #f1f3f4; display: grid; place-items: center; color: #d93025; }\\n.att .att-name { height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 10px; font: 500 12px var(--mail); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\\n.reply-row { display: flex; gap: 10px; margin: 24px 16px 0 70px; }\\n.reply-row span { display: inline-flex; align-items: center; gap: 8px; padding: 0 22px 0 16px; height: 36px; border: 1px solid #747775; border-radius: 18px; font: 500 14px var(--mail); color: #444746; }\\n\\n/* \\\\u2500\\\\u2500 Timeline + inspector \\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500 */\\n.timeline { padding: 18px; overflow-x: auto; }\\n.tl td.mono:first-child { white-space: nowrap; }\\n.tl { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }\\n.tl th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 10px 12px; background: var(--panel-2); border-bottom: 1px solid var(--line); }\\n.tl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }\\n.tl tr:last-child td { border-bottom: 0; }\\n.tl tbody tr { cursor: pointer; }\\n.tl tbody tr:hover { background: #1b1f28; }\\n.tl .content { max-width: 520px; color: var(--muted); }\\n.tl .content b { color: var(--text); font-weight: 600; }\\n.tl .mono { font-family: var(--mono); font-size: 12px; }\\n.chan { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; }\\n.chan.sms { background: rgba(48,209,88,.14); color: #6ee38a; }\\n.chan.email { background: rgba(10,132,255,.16); color: #69b0ff; }\\n.chan.push { background: rgba(255,159,10,.15); color: #ffc15e; }\\n.chan.chat { background: rgba(191,90,242,.16); color: #d79bff; }\\n.chan.sms.wa { background: rgba(37,211,102,.2); color: #4be08a; }\\n.svc-tag { font-size: 12px; color: var(--muted); }\\n.empty-tl { padding: 60px; text-align: center; color: var(--muted); }\\n.inspector { position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--panel); border-left: 1px solid var(--line); box-shadow: -20px 0 50px rgba(0,0,0,.4); display: flex; flex-direction: column; }\\n.inspector header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }\\n.inspector header h3 { margin: 0; font-size: 15px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\\n.inspector .btn { background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; padding: 4px 10px; font-size: 13px; }\\n.inspector pre { margin: 0; flex: 1; overflow: auto; padding: 14px 16px; font: 12px/1.55 var(--mono); color: #cdd3df; white-space: pre-wrap; overflow-wrap: anywhere; }\\n.inspector .kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }\\n.inspector .kv span:nth-child(odd) { color: var(--muted); }\\n.inspector .kv span:nth-child(even) { overflow-wrap: anywhere; font-family: var(--mono); font-size: 12px; }\\n\\n\\n/* \\\\u2500\\\\u2500 Sound toggle \\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500 */\\n.icon-toggle { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--muted); font-size: 13px; }\\n.icon-toggle[aria-pressed=\\\"true\\\"] { color: var(--text); border-color: #3d4a66; }\\n\\n/* \\\\u2500\\\\u2500 Swipe gestures \\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500 */\\n.swipe { position: relative; touch-action: pan-y; }\\n.swipe > .swipe-card { position: relative; z-index: 1; will-change: transform; }\\n.swipe.settling > .swipe-card, .settling.a-note { transition: transform .32s cubic-bezier(.2,.9,.25,1), opacity .32s ease; }\\n.swipe-actions { position: absolute; inset: 0; display: flex; justify-content: flex-end; align-items: stretch; visibility: hidden; }\\n.swipe.swiping > .swipe-actions, .swipe.open > .swipe-actions { visibility: visible; }\\n.collapsing { overflow: hidden; transition: height .26s ease, margin .26s ease, padding .26s ease, opacity .2s ease !important; }\\n\\n/* iOS lock screen: Options / Clear behind a card */\\n.ios-swipe .swipe-actions { gap: 8px; }\\n.ios-swipe .swipe-actions button { width: 72px; border: 0; border-radius: 20px; background: rgba(246,246,246,.6); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); color: #000; font: 500 14px var(--ios); }\\n.push-group { display: flex; flex-direction: column; gap: 8px; }\\n.group-head { display: flex; align-items: center; gap: 8px; padding: 0 2px; animation: mbn-fadein .25s ease; }\\n.group-head h3 { flex: 1; margin: 0; font: 700 20px/1.2 var(--ios); color: #fff; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\\n.group-head button { border: 0; border-radius: 15px; background: rgba(246,246,246,.6); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); color: #000; font: 500 13px var(--ios); padding: 6px 12px; }\\n.group-head button.x { width: 30px; height: 30px; padding: 0; display: grid; place-items: center; border-radius: 50%; }\\n.push-group[data-open=\\\"true\\\"] .ios-swipe { animation: mbn-unstack .38s cubic-bezier(.2,.9,.3,1.1) backwards; }\\n.push-group[data-open=\\\"true\\\"] .ios-swipe:nth-child(3) { animation-delay: .03s; } .push-group[data-open=\\\"true\\\"] .ios-swipe:nth-child(4) { animation-delay: .06s; }\\n.stack-layers { cursor: pointer; border: 0; padding: 0; background: none; display: block; width: 100%; }\\n.stack-layers .ios-stack-more:first-child { margin-top: -14px; }\\n.lock.wake { animation: mbn-wake 1.1s ease-out; }\\n.ios-overlay { position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 0 14px; background: rgba(255,255,255,.28); backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); animation: mbn-fadein .2s ease; }\\n.ios-overlay.dark { background: rgba(0,0,0,.28); }\\n.ios-overlay .ios-note { animation: mbn-lift .3s cubic-bezier(.2,.9,.3,1.2); box-shadow: 0 20px 40px rgba(0,0,0,.25); }\\n.ios-menu { align-self: flex-start; width: 250px; border-radius: 14px; overflow: hidden; background: rgba(237,237,237,.86); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); box-shadow: 0 10px 40px rgba(0,0,0,.2); animation: mbn-lift .28s cubic-bezier(.2,.9,.3,1.2); }\\n.ios-menu button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 11px 16px; border: 0; border-bottom: .5px solid rgba(60,60,67,.29); background: none; color: #000; font: 400 17px var(--ios); letter-spacing: -.02em; text-align: left; }\\n.ios-menu button:last-child { border-bottom: 0; }\\n.ios-menu button:active { background: rgba(0,0,0,.08); }\\n.ios-overlay.dark .ios-menu { align-self: stretch; width: auto; }\\n\\n/* Android shade */\\n.a-note { touch-action: pan-y; position: relative; }\\n.a-settings { margin-top: 8px; display: grid; gap: 8px; animation: mbn-fadein .2s ease; }\\n.a-settings .opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; border: 1px solid #49454f; font: 500 14px var(--android); color: #e6e1e5; background: none; text-align: left; }\\n.a-settings .opt[aria-pressed=\\\"true\\\"] { background: #4a4458; border-color: #d0bcff; }\\n.a-settings .opt small { display: block; font-weight: 400; color: #cac4d0; font-size: 12px; }\\n.a-settings .row { display: flex; justify-content: space-between; }\\n.a-settings .row button { border: 0; background: none; color: #d0bcff; font: 500 14px var(--android); padding: 6px 4px; }\\n.shade-actions button { padding: 8px 16px; border: 0; border-radius: 18px; background: #36343b; font: 500 14px var(--android); color: #e6e1e5; }\\n\\n/* Messages: thread swipe actions, page transitions, bubble times, tapbacks */\\n.thread-swipe .swipe-actions { justify-content: space-between; }\\n.thread-swipe .swipe-actions .side { display: flex; }\\n.thread-swipe .swipe-actions button { width: 74px; border: 0; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: 400 13px var(--ios); }\\n.act-unread { background: #007aff; } .act-pin { background: #ffcc00; } .act-mute { background: #5856d6; } .act-delete { background: #ff3b30; }\\n.thread-swipe .thread { background: #fff; }\\n.thread .name-line { display: flex; align-items: center; gap: 4px; min-width: 0; }\\n.thread .flag { flex: none; color: rgba(60,60,67,.6); display: inline-flex; }\\n.msgs.enter { animation: mbn-back .38s cubic-bezier(.2,.9,.25,1); }\\n.convo.enter { animation: mbn-push .4s cubic-bezier(.2,.9,.25,1); box-shadow: -10px 0 30px rgba(0,0,0,.12); }\\n.convo-body { --reveal: 0px; overflow-x: hidden; touch-action: pan-y; }\\n.convo-body .bubble-row, .convo-body .stamp { transform: translateX(calc(-1 * var(--reveal))); }\\n.convo-body.settling .bubble-row, .convo-body.settling .stamp { transition: transform .3s cubic-bezier(.2,.9,.25,1); }\\n.bubble-row { position: relative; }\\n.bubble-time { position: absolute; right: -66px; top: 50%; transform: translateY(-50%); width: 58px; color: rgba(60,60,67,.6); font-size: 12px; white-space: nowrap; }\\n.bubble { touch-action: pan-y; -webkit-user-select: text; user-select: text; }\\n.tapback { position: absolute; z-index: 2; top: -16px; right: -12px; min-width: 30px; height: 30px; padding: 0 4px; border-radius: 15px; background: #007aff; color: #fff; display: grid; place-items: center; font: 700 13px/1 var(--ios); box-shadow: 0 0 0 2.5px #fff; animation: mbn-pop .35s cubic-bezier(.2,.9,.3,1.4); }\\n.tapback-bar { align-self: flex-start; display: flex; gap: 4px; padding: 6px 8px; border-radius: 26px; background: rgba(233,233,235,.96); box-shadow: 0 8px 30px rgba(0,0,0,.18); animation: mbn-lift .28s cubic-bezier(.2,.9,.3,1.3); }\\n.tapback-bar button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: none; color: #8e8e93; font: 700 16px/1 var(--ios); display: grid; place-items: center; }\\n.tapback-bar button[aria-pressed=\\\"true\\\"] { background: #007aff; color: #fff; }\\n.ios-overlay .bubble { align-self: flex-start; max-width: 80%; animation: mbn-lift .28s cubic-bezier(.2,.9,.3,1.2); }\\n\\n/* Mail: hover actions, row swipe, toast */\\n.mrow .hover-actions { display: none; flex: none; align-items: center; gap: 2px; margin-left: 8px; }\\n.mrow .hover-actions .icon-btn { width: 32px; height: 32px; }\\n.mrow:hover .hover-actions, .mrow:focus-within .hover-actions { display: flex; }\\n.mrow:hover .date, .mrow:focus-within .date { display: none; }\\n.mrow .star { cursor: pointer; }\\n.mrow .star[aria-pressed=\\\"true\\\"] { color: #f4b400; }\\n.mrow-swipe { background: #188038; }\\n.mrow-swipe .swipe-actions { justify-content: space-between; align-items: center; padding: 0 22px; color: #fff; }\\n.toast { position: absolute; z-index: 20; left: 24px; bottom: 24px; display: flex; align-items: center; gap: 24px; min-width: 288px; max-width: calc(100% - 48px); padding: 14px 16px 14px 24px; border-radius: 4px; background: #303030; color: #f2f2f2; font: 400 14px var(--mail); box-shadow: 0 3px 5px -1px rgba(0,0,0,.2), 0 6px 10px rgba(0,0,0,.14); animation: mbn-toast .25s cubic-bezier(0,0,.2,1); }\\n.toast button { margin-left: auto; border: 0; background: none; color: #a8c7fa; font: 500 14px var(--mail); padding: 4px 8px; }\\n.reader.enter, .mail-list.enter { animation: mbn-fadein .18s ease; }\\n\\n@keyframes mbn-fadein { from { opacity: 0; } to { opacity: 1; } }\\n@keyframes mbn-headsup { from { opacity: 0; transform: translateY(-70px) scale(.98); } to { opacity: 1; transform: none; } }\\n@keyframes mbn-unstack { from { opacity: 0; transform: translateY(-40px) scale(.94); } to { opacity: 1; transform: none; } }\\n@keyframes mbn-wake { from { filter: brightness(.25); } to { filter: none; } }\\n@keyframes mbn-lift { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }\\n@keyframes mbn-push { from { transform: translateX(100%); } to { transform: none; } }\\n@keyframes mbn-back { from { transform: translateX(-28%); filter: brightness(.92); } to { transform: none; filter: none; } }\\n@keyframes mbn-toast { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }\\n@keyframes mbn-pop { from { transform: scale(.6) translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }\\n@keyframes mbn-drop { from { transform: translateY(-30px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }\\n@keyframes mbn-fade { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }\\n@keyframes mbn-rowflash { from { background: #fef7e0; } to { background: #fff; } }\\n@container (max-width: 980px) { .mail-nav { width: 72px; } .mail-nav .lbl, .mail-nav .n, .compose .lbl { display: none; } .mail-logo { width: auto; } .compose { padding: 0 16px; } .mrow .svc { display: none; } }\\n@container (max-width: 640px) { .mail-nav, .mail-search, .cat-tabs, .mail-logo .lbl, .mail-toolbar .range { display: none; } .mail-main { margin-left: 8px; } .mrow .from { width: 110px; } .reader .subject-row, .sender-row { padding-left: 16px; } .mail-frame, .mail-text, .attachments, .reply-row, .details { margin-left: 16px; } .mail-frame { width: calc(100% - 32px); } .sender-row { flex-wrap: wrap; } .sender-row .who { flex-basis: calc(100% - 54px); } .sender-row .meta { flex-basis: 100%; padding-left: 54px; white-space: normal; } .reader h1 { font-size: 19px; line-height: 24px; } }\\n\\n/* \\\\u2500\\\\u2500 WhatsApp: the same phone, a different app \\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500 */\\n.avatar.wa { background: linear-gradient(180deg,#5fe08b,#1daa61); }\\n.thread .via-wa { flex: none; font: 600 10px/16px var(--ios); letter-spacing: .02em; color: #0a7a43; background: #d9fdd3; border-radius: 4px; padding: 0 5px; }\\n.convo.wa { background: #efeae2; }\\n.convo.wa .convo-nav { background: rgba(246,246,246,.96); }\\n.convo.wa .convo-nav .back { color: #1daa61; }\\n.convo.wa .convo-nav .back svg [stroke] { stroke: #1daa61; }\\n.convo.wa .convo-nav .back svg [fill]:not([fill=\\\"none\\\"]) { fill: #1daa61; }\\n.convo.wa .convo-nav .avatar { background: linear-gradient(180deg,#5fe08b,#1daa61); }\\n.convo.wa .convo-nav .back .badge { background: #1daa61; }\\n.convo.wa .convo-nav .who { flex-direction: column; gap: 0; }\\n.convo.wa .wa-sub { font: 400 11px/14px var(--ios); color: #1daa61; }\\n.convo.wa .convo-body { background: #efeae2; }\\n.convo.wa .stamp { width: max-content; max-width: 90%; margin: 12px auto 8px; padding: 3px 10px; border-radius: 8px; background: rgba(255,255,255,.92); color: #54656f; box-shadow: 0 1px .5px rgba(11,20,26,.13); }\\n.convo.wa .bubble { background: #fff; border-radius: 8px; border-top-left-radius: 8px; font-size: 16px; line-height: 21px; padding: 6px 9px 7px; box-shadow: 0 1px .5px rgba(11,20,26,.13); }\\n.convo.wa .bubble.tail { border-bottom-left-radius: 0; }\\n.convo.wa .bubble.tail::before { left: -7px; width: 8px; height: 12px; background: #fff; border-radius: 0; clip-path: polygon(100% 0, 100% 100%, 0 100%); }\\n.convo.wa .bubble.tail::after { display: none; }\\n.convo.wa .wa-time { float: right; margin: 9px 0 -3px 10px; font: 400 11px/14px var(--ios); letter-spacing: 0; color: #667781; }\\n.convo.wa .convo-input { background: #f6f6f6; }\\n.convo.wa .convo-input .plus { background: none; }\\n.convo.wa .convo-input .field-ios { background: #fff; border-color: #e2e2e2; }\\n.convo.wa .otp-bar small { color: #1daa61; }\\n\\n/* \\\\u2500\\\\u2500 Chat: a team chat window \\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500\\\\u2500 */\\n.window.chat { background: #fff; color: #1d1c1d; font-family: \\\"Lato\\\", \\\"Helvetica Neue\\\", Helvetica, \\\"Segoe UI\\\", Arial, sans-serif; }\\n.window.chat .chrome { flex: none; }\\n.chat-body { flex: 1; min-height: 0; display: flex; }\\n.chat-side { flex: none; width: 200px; background: #2f1d3a; color: #cfc3d4; padding: 0 8px 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }\\n.chat-team { display: flex; align-items: center; gap: 4px; padding: 14px 8px 12px; margin: 0 -8px 8px; border-bottom: 1px solid rgba(255,255,255,.1); color: #fff; font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\\n.chat-side-label { padding: 6px 8px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }\\n.chat-chan { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; color: inherit; text-align: left; padding: 4px 8px; border-radius: 6px; font-size: 14px; min-width: 0; }\\n.chat-chan:hover { background: rgba(255,255,255,.08); }\\n.chat-chan .hash { opacity: .7; width: 12px; text-align: center; flex: none; }\\n.chat-chan .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\\n.chat-chan .n { flex: none; background: #e01e5a; color: #fff; border-radius: 999px; font-size: 11px; line-height: 16px; padding: 0 6px; font-weight: 700; }\\n.chat-chan.unread { color: #fff; font-weight: 700; }\\n.chat-chan.on { background: #5b3a70; color: #fff; }\\n.chat-chan:focus-visible { outline: 2px solid #9ec5ff; outline-offset: -2px; }\\n.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #fff; }\\n.chat-head { flex: none; display: flex; align-items: baseline; gap: 10px; padding: 12px 18px; border-bottom: 1px solid #e3e3e3; }\\n.chat-head b { font-size: 17px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\\n.chat-head span { color: #616061; font-size: 12px; white-space: nowrap; }\\n.chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 0 12px; display: flex; flex-direction: column; }\\n.chat-list > :first-child { margin-top: auto; }\\n.chat-day { display: flex; align-items: center; gap: 10px; padding: 8px 18px; color: #616061; font-size: 12px; font-weight: 700; }\\n.chat-day::before, .chat-day::after { content: \\\"\\\"; flex: 1; height: 1px; background: #e3e3e3; }\\n.chat-day span { border: 1px solid #e3e3e3; border-radius: 999px; padding: 2px 12px; }\\n.chat-msg { display: flex; gap: 10px; padding: 7px 18px; outline: 0; }\\n.chat-msg:hover, .chat-msg:focus-visible { background: #f8f8f8; }\\n.chat-msg[data-unread=\\\"true\\\"] { background: #fffbea; }\\n.chat-msg[data-ephemeral=\\\"true\\\"] { background: #f6f6f6; }\\n.chat-msg.arrive { animation: mbn-chat-in .3s ease-out; }\\n@keyframes mbn-chat-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }\\n.chat-avatar { flex: none; width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; }\\n.chat-msg-main { flex: 1; min-width: 0; font-size: 15px; line-height: 22px; }\\n.chat-meta { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }\\n.chat-meta b { font-weight: 800; }\\n.chat-app { background: #e8e8e8; color: #555; font-size: 10px; font-weight: 700; border-radius: 3px; padding: 0 4px; line-height: 14px; align-self: center; }\\n.chat-time, .chat-edited { color: #616061; font-size: 12px; }\\n.chat-note { color: #616061; font-size: 12px; line-height: 16px; }\\n.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; }\\n.chat-text a, .chat-att-title a { color: #1264a3; text-decoration: none; }\\n.chat-text a:hover { text-decoration: underline; }\\n.chat-code { font: 12px/18px var(--mono); background: #f4f4f4; border: 1px solid #dcdcdc; border-radius: 3px; padding: 1px 3px; color: #c0143c; }\\n.chat-pre { font: 12px/18px var(--mono); background: #f7f7f7; border: 1px solid #dcdcdc; border-radius: 4px; padding: 8px; margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }\\n.chat-mention { background: #e8f1fa; color: #1264a3; border-radius: 3px; padding: 0 2px; }\\n.chat-quote { display: block; border-left: 4px solid #ddd; padding-left: 10px; margin: 2px 0; }\\n.chat-blocks, .chat-attachments { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }\\n.chat-block-header { font-size: 18px; font-weight: 800; line-height: 24px; }\\n.chat-block-divider hr { border: 0; border-top: 1px solid #e3e3e3; margin: 4px 0; }\\n.chat-block-context { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: #616061; font-size: 13px; }\\n.chat-block-actions { display: flex; flex-wrap: wrap; gap: 8px; }\\n.chat-block.with-accessory { display: flex; gap: 12px; align-items: flex-start; }\\n.chat-section-body { flex: 1; min-width: 0; }\\n.chat-accessory { flex: none; }\\n.chat-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin-top: 4px; }\\n.chat-btn { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border: 1px solid #bbb; border-radius: 4px; background: #fff; font-size: 13px; font-weight: 700; color: #1d1c1d; }\\n.chat-btn.primary { background: #007a5a; border-color: #007a5a; color: #fff; }\\n.chat-btn.danger { color: #e01e5a; }\\n.chat-thumb { width: 72px; height: 72px; border-radius: 6px; object-fit: cover; display: block; }\\n.chat-block-context .chat-thumb { width: 20px; height: 20px; border-radius: 3px; }\\n.chat-image { max-width: min(360px, 100%); max-height: 260px; border-radius: 6px; display: block; }\\n.chat-caption { color: #616061; font-size: 13px; }\\n.chat-list-block { margin: 2px 0; padding-left: 22px; }\\n.chat-unknown { color: #616061; font: 12px var(--mono); border: 1px dashed #ccc; border-radius: 4px; padding: 2px 6px; }\\n.chat-attachment { border-left: 4px solid #ddd; padding-left: 12px; display: flex; flex-direction: column; gap: 2px; }\\n.chat-att-author { font-size: 13px; font-weight: 700; }\\n.chat-att-title { font-weight: 700; }\\n.chat-field { margin-top: 4px; }\\n.chat-field:not(.short) { grid-column: 1 / -1; }\\n.chat-att-footer { color: #616061; font-size: 12px; }\\n.chat-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }\\n.chat-reaction { background: #f0f0f0; border: 1px solid #e0e0e0; border-radius: 999px; padding: 0 8px; font-size: 12px; line-height: 22px; }\\n.chat-compose { flex: none; display: flex; align-items: center; justify-content: space-between; margin: 0 18px 16px; padding: 0 12px; height: 42px; border: 1px solid #bbb; border-radius: 8px; color: #8a8a8a; font-size: 14px; }\\n.chat-compose span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\\n.chat-compose .send { display: grid; place-items: center; opacity: .5; }\\n.chat-empty { margin: auto; padding: 40px 28px; text-align: center; color: #616061; display: flex; flex-direction: column; gap: 6px; max-width: 380px; }\\n.chat-empty b { color: #1d1c1d; font-size: 16px; }\\n@container (max-width: 560px) { .chat-side { display: none; } .chat-msg, .chat-head, .chat-day { padding-left: 12px; padding-right: 12px; } .chat-compose { margin: 0 12px 12px; } .chat-fields { grid-template-columns: 1fr; } }\\n@media (max-width: 760px) { .devices { padding: 16px 8px; } .device-col.wide { flex-basis: 100%; } }\\n`,ka=Ue(gn,`.${at}`);var Ta={all:\\\"All\\\",sms:\\\"Text\\\",push:\\\"Push\\\",email:\\\"Email\\\",chat:\\\"Chat\\\"},xn=.5,nt=a=>typeof a==\\\"number\\\"&&Number.isFinite(a)?Math.max(xn,Math.min(1,a)):1,Sa=(a,o,d=1)=>a===\\\"tabs\\\"||a===\\\"auto\\\"&&o>0&&o/d<800,Ma=(a,o=1)=>Math.max(.5,Math.min(1,(a/o-16)/362)),Ct=(a,o)=>a.length<2?[]:o?[...a]:[\\\"all\\\",...a],Aa=(a,o,d,h)=>d&&a.includes(d)?d:a.length===1&&a[0]?a[0]:o?(h&&a.includes(h)?h:a[0])??\\\"all\\\":\\\"all\\\",La=(a,o,d)=>{if(!a.length)return null;let h=Math.max(0,a.indexOf(o)),g=d===\\\"ArrowRight\\\"||d===\\\"ArrowDown\\\"?(h+1)%a.length:d===\\\"ArrowLeft\\\"||d===\\\"ArrowUp\\\"?(h-1+a.length)%a.length:d===\\\"Home\\\"?0:d===\\\"End\\\"?a.length-1:-1;return g<0?null:a[g]??null};var Ca=[{id:\\\"heart\\\",glyph:\\\"\\\\u2665\\\",label:\\\"Heart\\\"},{id:\\\"like\\\",glyph:\\\"\\\\u{1F44D}\\\",label:\\\"Like\\\"},{id:\\\"dislike\\\",glyph:\\\"\\\\u{1F44E}\\\",label:\\\"Dislike\\\"},{id:\\\"laugh\\\",glyph:\\\"HA<br>HA\\\",label:\\\"Laugh\\\"},{id:\\\"emphasize\\\",glyph:\\\"\\\\u203C\\\",label:\\\"Emphasize\\\"},{id:\\\"question\\\",glyph:\\\"?\\\",label:\\\"Question\\\"}];function it(a,o={}){let d=o.live??!0,h=o.syncUrl??(d&&!o.fetch&&!o.baseUrl),g=o.storage??d,v=o.now,$=()=>v??Date.now(),H=o.baseUrl??(o.fetch||typeof location>\\\"u\\\"?\\\"http://harness.local/\\\":location.href),y=(e,t)=>{let s=new Request(new URL(e,H),t);return o.fetch?o.fetch(s):fetch(s)},E=new AbortController,D=(e,t,s=!1)=>a.addEventListener(e,t,{signal:E.signal,capture:s}),W=new Set,F=(e,t)=>{let s=setTimeout(()=>{W.delete(s),t()},e);W.add(s)},O=!1,V=new URLSearchParams(o.search??(h&&typeof location<\\\"u\\\"?location.search:\\\"\\\")),ne=V.get(\\\"view\\\"),_=o.initial??{},i={namespace:V.get(\\\"namespace\\\")??o.namespace??\\\"default\\\",namespaces:[],items:[],sources:[],discoveryError:null,version:0,view:ne===\\\"timeline\\\"?\\\"timeline\\\":\\\"devices\\\",only:le.includes(ne??\\\"\\\")?ne:null,search:\\\"\\\",follow:V.get(\\\"follow\\\")!==\\\"0\\\",connected:!1,sms:{to:null,thread:null,menu:null,transition:null},push:{to:null,skin:\\\"auto\\\",expanded:null,preview:null,settings:null,wake:!1},email:{to:null,open:null,transition:!1},chat:{to:null},inspect:null,toast:null,arrived:new Set(o.arrived??[])};Object.assign(i,{..._,sms:{...i.sms,..._.sms},push:{...i.push,..._.push},email:{...i.email,..._.email},chat:{...i.chat,..._.chat},toast:_.toast?{text:_.toast}:null}),ne===\\\"timeline\\\"&&(i.view=\\\"timeline\\\"),delete i.local,delete i.push.openGroups;let M={dismissed:new Set(_.local?.dismissed??[]),pinned:new Set(_.local?.pinned??[]),muted:new Set(_.local?.muted??[]),starred:new Set(_.local?.starred??[]),silent:new Set(_.local?.silent??[]),checked:new Set,tapbacks:new Map(Object.entries(_.local?.tapbacks??{})),openGroups:new Set(_.push?.openGroups??[])},he=_.mailDetailsOpen??!1,Be=V.get(\\\"to\\\"),rt=V.get(\\\"from\\\"),ue=V.get(\\\"id\\\"),q=Be&&i.only?{channel:i.only,to:Be}:null;V.get(\\\"follow\\\")===null&&q&&(i.follow=!1);let fe=le.filter(e=>o.channels===void 0||o.channels.includes(e)),Ee=o.layout??\\\"auto\\\",b=nt(o.scale),z=Ee===\\\"tabs\\\",C=i.only,L=()=>Aa(fe,z,i.only,C),U=()=>{let e=a.clientWidth;a.style.setProperty(\\\"--mbn-scale\\\",String(b)),e>0&&a.style.setProperty(\\\"--mbn-fit\\\",String(Ma(e,b)));let t=Sa(o.tabs===!1&&Ee===\\\"auto\\\"?\\\"grid\\\":Ee,e,b);return t===z?!1:(z=t,!0)},De=()=>typeof matchMedia==\\\"function\\\"&&matchMedia(\\\"(prefers-reduced-motion: reduce)\\\").matches,Et=()=>(o.motion??\\\"auto\\\")===\\\"auto\\\"?De()?\\\"reduce\\\":\\\"full\\\":o.motion,ce=()=>Et()===\\\"full\\\",Dt=\\\"mockingbird-notifications:sound\\\",Na=()=>{if(!g)return null;try{let e=localStorage.getItem(Dt);return e===null?null:e===\\\"1\\\"}catch{return null}},ie=ya(V.get(\\\"sound\\\")!==null?V.get(\\\"sound\\\")===\\\"1\\\":Na()??o.sound??!1),Nt=()=>`mockingbird-notifications:seen:${i.namespace}`,B=new Set(o.seen??[]),Ht=()=>{if(g)try{B=new Set(JSON.parse(localStorage.getItem(Nt())??\\\"[]\\\"))}catch{B=new Set}},Rt=()=>{if(g)try{localStorage.setItem(Nt(),JSON.stringify([...B].slice(-5e3)))}catch{}},Se=e=>{let t=!1;for(let s of e)B.has(s)||(B.add(s),t=!0);t&&Rt()},lt=e=>{for(let t of e)B.delete(t);Rt()},r=e=>String(e??\\\"\\\").replace(/[&<>\\\"']/g,t=>`&#${t.charCodeAt(0)};`),p=e=>`data-testid=\\\"${e}\\\"`,be=e=>`data-notification-id=\\\"${r(e.id)}\\\" data-channel=\\\"${e.channel}\\\" data-service=\\\"${r(e.service)}\\\" data-source=\\\"${r(e.source)}\\\" data-to=\\\"${r(e.to)}\\\" data-from=\\\"${r(e.from.address)}\\\" data-status=\\\"${r(e.status??\\\"\\\")}\\\" data-created-at=\\\"${r(e.createdAt)}\\\" data-unread=\\\"${!B.has(e.id)}\\\"${ge(e)?' data-via=\\\"whatsapp\\\"':\\\"\\\"}`,ge=e=>e?.sms?.via===\\\"whatsapp\\\",jt=e=>e.replace(/\\\\bhttps?:\\\\/\\\\/[^\\\\s<]+[^\\\\s<.,;:!?)'\\\"]/g,t=>`<a href=\\\"${t}\\\" target=\\\"_blank\\\" rel=\\\"noreferrer\\\">${t}</a>`),dt=e=>{let t=/^\\\\+1(\\\\d{3})(\\\\d{3})(\\\\d{4})$/.exec(e);return t?`+1 (${t[1]}) ${t[2]}-${t[3]}`:e},Ot=e=>/^\\\\+?\\\\d[\\\\d\\\\s()-]{5,}$/.test(e),Pt=e=>e.replace(/^whatsapp:/i,\\\"\\\"),Fe=e=>{let t=Pt(e.from.address);return e.from.name??(Ot(t)?dt(t):t)},Ne=e=>{let t=e.replace(/[^\\\\p{L}\\\\p{N}\\\\s]/gu,\\\" \\\").trim().split(/\\\\s+/).filter(Boolean);return t.length?((t[0]?.[0]??\\\"\\\")+(t[1]?.[0]??\\\"\\\")).toUpperCase():\\\"?\\\"},Ha=[\\\"#1a73e8\\\",\\\"#e8710a\\\",\\\"#188038\\\",\\\"#d93025\\\",\\\"#9334e6\\\",\\\"#12b5cb\\\",\\\"#e52592\\\",\\\"#f9ab00\\\",\\\"#5f6368\\\",\\\"#a142f4\\\"],ct=[\\\"#ff9500\\\",\\\"#34c759\\\",\\\"#5856d6\\\",\\\"#ff2d55\\\",\\\"#007aff\\\",\\\"#af52de\\\",\\\"#ff3b30\\\",\\\"#30b0c7\\\"],Ra=e=>[...e].reduce((t,s)=>t*31+s.charCodeAt(0)>>>0,7),He=(e,t=Ha)=>t[Ra(e)%t.length]??\\\"#5f6368\\\",xe=(e,t)=>e.toDateString()===t.toDateString(),se=e=>e.toLocaleTimeString([],{hour:\\\"numeric\\\",minute:\\\"2-digit\\\"}),ja=e=>{let t=new Date(e),s=new Date($());if(xe(t,s))return se(t);let c=new Date(s);return c.setDate(s.getDate()-1),xe(t,c)?\\\"Yesterday\\\":s.getTime()-t.getTime()<6*864e5?t.toLocaleDateString([],{weekday:\\\"long\\\"}):t.toLocaleDateString([],{year:\\\"2-digit\\\",month:\\\"numeric\\\",day:\\\"numeric\\\"})},Oa=e=>{let t=new Date(e),s=new Date($());return xe(t,s)?`<b>Today</b> ${se(t)}`:`<b>${r(t.toLocaleDateString([],{weekday:\\\"short\\\",month:\\\"short\\\",day:\\\"numeric\\\"}))}</b> at ${se(t)}`},pt=e=>{let t=Math.max(0,($()-Date.parse(e))/1e3);return t<60?\\\"now\\\":t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/3600)}h ago`:`${Math.floor(t/86400)}d ago`},Pa=e=>{let t=Math.max(0,($()-Date.parse(e))/1e3);return t<60?\\\"now\\\":t<3600?`${Math.floor(t/60)}m`:t<86400?`${Math.floor(t/3600)}h`:`${Math.floor(t/86400)}d`},Ia=e=>{let t=new Date(e);return xe(t,new Date($()))?t.toLocaleTimeString():t.toLocaleString([],{month:\\\"short\\\",day:\\\"numeric\\\",hour:\\\"numeric\\\",minute:\\\"2-digit\\\",...t.getFullYear()===new Date($()).getFullYear()?{}:{year:\\\"numeric\\\"}})},_a=e=>{let t=new Date(e),s=new Date($());return xe(t,s)?se(t):t.getFullYear()===s.getFullYear()?t.toLocaleDateString([],{month:\\\"short\\\",day:\\\"numeric\\\"}):t.toLocaleDateString([],{year:\\\"2-digit\\\",month:\\\"numeric\\\",day:\\\"numeric\\\"})},Ua=e=>`${new Date(e).toLocaleString([],{weekday:\\\"short\\\",month:\\\"short\\\",day:\\\"numeric\\\",year:\\\"numeric\\\",hour:\\\"numeric\\\",minute:\\\"2-digit\\\"})} (${pt(e)===\\\"now\\\"?\\\"0 minutes ago\\\":pt(e)})`,Me={twilio:\\\"Twilio\\\",resend:\\\"Resend\\\",fcm:\\\"FCM\\\",ses:\\\"SES\\\",sns:\\\"SNS\\\",customerio:\\\"Customer.io\\\",mailosaur:\\\"Mailosaur\\\",slack:\\\"Slack\\\"},Ba={sms:\\\"SMS\\\",push:\\\"Push\\\",email:\\\"Email\\\",chat:\\\"Chat\\\"},Fa=e=>{let t=i.search.trim().toLowerCase();return t?[e.to,e.from.address,e.from.name??\\\"\\\",e.preview,e.email?.subject??\\\"\\\",e.push?.title??\\\"\\\",e.source,e.service].join(`\\n`).toLowerCase().includes(t):!0},It=()=>i.items.filter(Fa),ee=e=>It().filter(t=>t.channel===e&&!M.dismissed.has(t.id)),Ve=e=>{let t=new Map;for(let s of ee(e)){let c=t.get(s.to)??{to:s.to,count:0,unread:0,latest:s.createdAt};c.count++,B.has(s.id)||c.unread++,s.createdAt>c.latest&&(c.latest=s.createdAt),s.push&&(c.platform=s.push.platform),t.set(s.to,c)}return[...t.values()].sort((s,c)=>s.latest<c.latest?1:-1)},mt=()=>{for(let e of le){let t=Ve(e),s=i[e];if(q?.channel===e){s.to=q.to;continue}(!s.to||!t.some(c=>c.to===s.to))&&(s.to=t[0]?.to??null)}},ht=async e=>{let t=await y(e);if(!t.ok)throw new Error(`${e}: HTTP ${t.status}`);return await t.json()},qe=async()=>{let e=new URLSearchParams({namespace:i.namespace,order:\\\"newest\\\"}),t=await ht(`./api/notifications?${e}`);O||(i.items=t.notifications,i.version=t.version??i.version,mt(),J())},_t=async()=>{try{let e=await ht(\\\"./api/sources\\\");i.sources=e.sources,i.discoveryError=e.discoveryError;let t=await ht(\\\"./api/namespaces\\\");i.namespaces=t.namespaces,O||ve()}catch{}},Ae=(e,t)=>`${e}|${t}`,We=null,ut=(e,t)=>`${e}|${t}`,Va=e=>{if(e.channel===\\\"sms\\\")return M.muted.has(Ae(e.to,e.from.address))?null:\\\"sms\\\";if(e.channel===\\\"email\\\")return\\\"email\\\";if(e.channel===\\\"chat\\\")return\\\"chat\\\";let t=i.push.skin===\\\"auto\\\"?e.push?.platform===\\\"android\\\"?\\\"android\\\":\\\"ios\\\":i.push.skin;return t===\\\"android\\\"&&M.silent.has(e.push?.app??\\\"App\\\")?null:t===\\\"android\\\"?\\\"push-android\\\":\\\"push-ios\\\"},qa=e=>{for(let n of e)i.arrived.add(n.id);let t=[...e].sort((n,f)=>n.createdAt<f.createdAt?1:-1);for(let n of le){let f=t.filter(x=>x.channel===n),w=q?.channel===n?f.find(x=>x.to===q.to):f[0];w&&(q?.channel===n?n===\\\"sms\\\"&&!i.sms.thread&&(i.sms.thread=w.from.address):i.follow&&(i[n].to=w.to,n===\\\"sms\\\"&&i.sms.thread!==null&&(i.sms.thread=w.from.address)),n===\\\"push\\\"&&i.push.to===w.to&&(i.push.wake=!0))}let s=We&&t.find(n=>n.channel===\\\"sms\\\"&&n.to===We);s&&(i.sms.to=s.to,i.sms.thread=s.from.address,We=null);let c=new Set(e.map(Va).filter(n=>n!==null));for(let n of c)ie.play(n);o.onArrive?.(e),F(1800,()=>{for(let n of e)i.arrived.delete(n.id)})},ft=null,Ut=()=>{ft?.abort();let e=new AbortController;ft=e;let t=i.namespace,s=(n,f)=>{if(!e.signal.aborted){if(n===\\\"sources\\\")i.sources=JSON.parse(f),ve();else if(n===\\\"change\\\"){let{added:w,version:x}=JSON.parse(f);i.version=x,qa(w),qe().catch(()=>{})}}};(async()=>{for(;!e.signal.aborted;){try{let n=await y(`./api/events?namespace=${encodeURIComponent(t)}`,{signal:e.signal,headers:{accept:\\\"text/event-stream\\\"}});if(!n.ok||!n.body)throw new Error(`events: HTTP ${n.status}`);i.connected=!0,ve();let f=n.body.pipeThrough(new TextDecoderStream).getReader(),w=\\\"\\\";for(;;){let{value:x,done:S}=await f.read();if(S)break;w+=x.replace(/\\\\r\\\\n/g,`\\n`);let k=w.indexOf(`\\n\\n`);for(;k>=0;){let m=w.slice(0,k);w=w.slice(k+2);let T=\\\"message\\\",I=[];for(let j of m.split(`\\n`))j.startsWith(\\\"event:\\\")?T=j.slice(6).trim():j.startsWith(\\\"data:\\\")&&I.push(j.slice(5).trimStart());I.length&&s(T,I.join(`\\n`)),k=w.indexOf(`\\n\\n`)}}}catch{}if(e.signal.aborted)return;i.connected=!1,ve(),await new Promise(n=>F(1e3,()=>n(null)))}})()},pe=`mbn-${Math.random().toString(36).slice(2,8)}`;a.classList.add(at),o.embedded&&a.classList.add(\\\"embedded\\\"),a.dataset.testid=l.app,a.dataset.ready=\\\"false\\\",a.innerHTML=`\\n<header class=\\\"topbar\\\" data-region=\\\"topbar\\\" ${p(l.topbar)}></header>\\n<div data-region=\\\"notice\\\"></div>\\n<div class=\\\"channel-tabs\\\" data-region=\\\"tabs\\\" role=\\\"tablist\\\" aria-label=\\\"Notification channels\\\" ${p(l.channelTabs)} hidden></div>\\n<div class=\\\"mbn-scroll\\\" data-region=\\\"scroll\\\">\\n<section class=\\\"devices\\\" data-region=\\\"devices\\\">\\n <div class=\\\"device-col\\\" data-region=\\\"col-sms\\\" id=\\\"${pe}-panel-sms\\\"></div>\\n <div class=\\\"device-col\\\" data-region=\\\"col-push\\\" id=\\\"${pe}-panel-push\\\"></div>\\n <div class=\\\"device-col wide\\\" data-region=\\\"col-email\\\" id=\\\"${pe}-panel-email\\\"></div>\\n <div class=\\\"device-col wide chat-col\\\" data-region=\\\"col-chat\\\" id=\\\"${pe}-panel-chat\\\"></div>\\n</section>\\n<section class=\\\"timeline\\\" data-region=\\\"timeline\\\" hidden></section>\\n</div>\\n<aside class=\\\"inspector\\\" data-region=\\\"inspector\\\" ${p(l.inspector)} hidden></aside>`;let Z=e=>a.querySelector(`[data-region=\\\"${e}\\\"]`),Bt=e=>a.querySelector(`[data-testid=\\\"${e}\\\"]`),Ft=()=>o.title??a.dataset.title??\\\"Notifications\\\",Wa=()=>{Object.assign(a.dataset,{view:i.view,namespace:i.namespace,count:String(i.items.length),version:String(i.version),connected:String(i.connected),sound:String(ie.enabled),motion:Et(),layout:z?\\\"tabs\\\":\\\"grid\\\",tab:L()})},ve=()=>{Wa();let e=Z(\\\"topbar\\\");if(e.hidden=o.chrome===!1,o.chrome===!1)return;let t=[...new Set([...i.namespaces,i.namespace])].sort(),s=document.activeElement===Bt(l.search);if(e.innerHTML=`\\n <div class=\\\"brand\\\"><span class=\\\"brand-mark\\\">${u.bell()}</span><span>${r(Ft())} <small>Mockingbird</small></span></div>\\n <label class=\\\"field\\\">Namespace <select data-action=\\\"namespace\\\" ${p(l.namespace)} aria-label=\\\"Namespace\\\">${t.map(n=>`<option ${n===i.namespace?\\\"selected\\\":\\\"\\\"}>${r(n)}</option>`).join(\\\"\\\")}</select></label>\\n <div class=\\\"field search\\\">${u.search(\\\"#9aa1b1\\\",14)}<input type=\\\"search\\\" data-action=\\\"search\\\" ${p(l.search)} aria-label=\\\"Filter notifications\\\" placeholder=\\\"Filter by recipient, sender, text\\\\u2026\\\" value=\\\"${r(i.search)}\\\"></div>\\n <div class=\\\"tabs\\\" role=\\\"group\\\" aria-label=\\\"View\\\">\\n <button data-action=\\\"view\\\" data-value=\\\"devices\\\" ${p(l.viewDevices)} aria-pressed=\\\"${i.view===\\\"devices\\\"}\\\">Devices</button>\\n <button data-action=\\\"view\\\" data-value=\\\"timeline\\\" ${p(l.viewTimeline)} aria-pressed=\\\"${i.view===\\\"timeline\\\"}\\\">Timeline <span style=\\\"opacity:.6\\\">${i.items.length}</span></button>\\n </div>\\n <label class=\\\"toggle\\\" title=\\\"Jump each device to the newest arrival\\\"><input type=\\\"checkbox\\\" data-action=\\\"follow\\\" ${p(l.follow)} ${i.follow?\\\"checked\\\":\\\"\\\"}> Follow new</label>\\n <button class=\\\"icon-toggle\\\" data-action=\\\"sound\\\" ${p(l.sound)} aria-pressed=\\\"${ie.enabled}\\\" title=\\\"Play alert sounds on arrivals\\\">${ie.enabled?u.volumeOn():u.volumeOff()}<span>Sound</span></button>\\n <span class=\\\"live\\\" ${p(l.connection)} data-state=\\\"${i.connected?\\\"live\\\":\\\"reconnecting\\\"}\\\" role=\\\"status\\\"><span class=\\\"dot ${i.connected?\\\"ok\\\":\\\"bad\\\"}\\\"></span>${i.connected?\\\"Live\\\":\\\"Reconnecting\\\"}</span>\\n <div class=\\\"sources\\\">${i.sources.map(n=>`<span class=\\\"pill\\\" title=\\\"${r(n.error??n.url)}\\\" ${p(l.source)} data-name=\\\"${r(n.name)}\\\" data-service=\\\"${r(n.service??\\\"\\\")}\\\" data-ok=\\\"${n.ok}\\\" data-count=\\\"${n.count}\\\"><span class=\\\"dot ${n.ok?\\\"ok\\\":n.error?\\\"bad\\\":\\\"\\\"}\\\"></span>${r(n.service&&n.name!==n.service?`${n.name} \\\\xB7 ${Me[n.service]??n.service}`:Me[n.name]??n.name)} <b>${n.count}</b></span>`).join(\\\"\\\")}</div>`,s){let n=Bt(l.search);n?.focus(),n?.setSelectionRange(n.value.length,n.value.length)}let c=i.sources.filter(n=>n.error);Z(\\\"notice\\\").innerHTML=i.discoveryError||c.length?`<div class=\\\"notice\\\" ${p(l.notice)} data-kind=\\\"error\\\" role=\\\"alert\\\">${i.discoveryError?`Fleet discovery failed: ${r(i.discoveryError)}. `:\\\"\\\"}${c.map(n=>`<b>${r(n.name)}</b>: ${r(n.error)}`).join(\\\" \\\\xB7 \\\")}</div>`:i.sources.length?\\\"\\\":`<div class=\\\"notice\\\" ${p(l.notice)} data-kind=\\\"empty\\\" style=\\\"border-color:#3a3f4b;background:#171a21;color:#9aa1b1\\\">No messaging emulators found yet. Start the fleet with twilio, resend, fcm, ses, sns, customerio, mailosaur or slack.</div>`},Ge=(e,t,s,c)=>{let n=Ve(e),f=i[e].to;return`<label class=\\\"field\\\">${t}<select data-action=\\\"recipient\\\" data-channel=\\\"${e}\\\" ${p(s)} aria-label=\\\"${t}\\\" ${n.length?\\\"\\\":\\\"disabled\\\"}>${n.length?n.map(w=>`<option value=\\\"${r(w.to)}\\\" ${w.to===f?\\\"selected\\\":\\\"\\\"}>${w.unread?\\\"\\\\u25CF \\\":\\\"\\\"}${r(c(w.to))} \\\\xB7 ${w.count}</option>`).join(\\\"\\\"):\\\"<option>No recipients yet</option>\\\"}</select></label>`},Ke=(e,t)=>e?`<span class=\\\"count\\\" ${p(t)} data-count=\\\"${e}\\\">${e}</span>`:\\\"\\\",Ye=(e,t,s,c=\\\"\\\")=>`<div class=\\\"device-head\\\"><div class=\\\"head-row\\\"><h2>${e} ${t}</h2>${c}</div>${s}</div>`,Vt=(e=!1)=>`\\n <div class=\\\"statusbar ${e?\\\"light\\\":\\\"\\\"}\\\"><span>${se(new Date($())).replace(/\\\\s?[AP]M$/i,\\\"\\\")}</span>\\n <span class=\\\"icons\\\">${u.signal()}${u.wifi()}${u.battery()}</span></div>`,qt=e=>e.currentCSSZoom||1,bt=(e,t)=>{if(!ce()||typeof e.animate!=\\\"function\\\")return t();let s=new Map;for(let c of e.querySelectorAll(\\\"[data-flip]\\\"))s.set(c.dataset.flip??\\\"\\\",c.getBoundingClientRect().top);t();for(let c of e.querySelectorAll(\\\"[data-flip]\\\")){let n=s.get(c.dataset.flip??\\\"\\\");if(n===void 0)continue;let f=(n-c.getBoundingClientRect().top)/qt(c);Math.abs(f)<1||c.animate([{transform:`translateY(${f}px)`},{transform:\\\"none\\\"}],{duration:380,easing:\\\"cubic-bezier(.2,.9,.25,1)\\\"})}},gt=e=>{let t=new Map;for(let s of ee(\\\"sms\\\").filter(c=>c.to===e)){let c=s.from.address;t.set(c,[...t.get(c)??[],s])}return[...t.entries()].map(([s,c])=>({from:s,items:c.sort((n,f)=>n.createdAt<f.createdAt?-1:1),pinned:M.pinned.has(Ae(e,s))})).sort((s,c)=>s.pinned!==c.pinned?s.pinned?-1:1:(s.items.at(-1)?.createdAt??\\\"\\\")<(c.items.at(-1)?.createdAt??\\\"\\\")?1:-1)},Wt=e=>{let t=e?Fe(e):\\\"\\\";return Ot(Pt(e?.from.address??\\\"\\\"))&&!e?.from.name?u.person():r(Ne(t))},xt=e=>e.sms?.code??(/\\\\b(code|otp|passcode|pin|verif)/i.test(e.sms?.body??\\\"\\\")?/\\\\b(\\\\d{4,8})\\\\b/.exec(e.sms?.body??\\\"\\\")?.[1]??null:null),Ga=(e,t)=>t?e.replace(new RegExp(`\\\\\\\\b${t}\\\\\\\\b`),`<span class=\\\"code\\\">${t}</span>`):e,Ka=e=>{let t=M.tapbacks.get(e),s=Ca.find(c=>c.id===t);return s?`<span class=\\\"tapback\\\" ${p(l.smsTapback)} data-tapback=\\\"${s.id}\\\" aria-label=\\\"${s.label}\\\">${s.glyph}</span>`:\\\"\\\"},Gt=e=>{let t=Ga(jt(r(e.sms?.body??\\\"\\\")),xt(e));return(e.sms?.media??[]).map(c=>`<img class=\\\"media\\\" src=\\\"${r(c)}\\\" alt=\\\"\\\" ${p(l.smsBubbleMedia)}>`).join(\\\"\\\")+t},ae=()=>{let e=i.sms.to,t=e?gt(e):[],s=ee(\\\"sms\\\").filter(k=>!B.has(k.id)).length,c,n=t.find(k=>k.from===i.sms.thread),f=i.sms.transition;if(i.sms.transition=null,n&&e){Se(n.items.map(Y=>Y.id));let k=n.items[0],m=ge(k),T=t.filter(Y=>Y!==n).reduce((Y,Ce)=>Y+Ce.items.filter(ye=>!B.has(ye.id)).length,0),I=0,j=!0,K=n.items.map((Y,Ce)=>{let ye=Date.parse(Y.createdAt),ha=Ce===0||ye-I>15*6e4?`<div class=\\\"stamp\\\" ${p(l.smsTimestamp)}>${Ce===0?m?\\\"WhatsApp<br>\\\":\\\"Text Message<br>\\\":\\\"\\\"}${Oa(Y.createdAt)}</div>`:\\\"\\\",ua=n.items[Ce+1],fa=!ua||Date.parse(ua.createdAt)-ye>6e4,ln=!ha&&j&&Ce>0;I=ye,j=fa;let ba=xt(Y);return`${ha}<div class=\\\"bubble-row ${ln?\\\"gap\\\":\\\"\\\"}\\\"><div class=\\\"bubble ${fa?\\\"tail\\\":\\\"\\\"} ${i.arrived.has(Y.id)?\\\"arrive\\\":\\\"\\\"}\\\" ${be(Y)} ${p(l.smsBubble)} ${ba?`data-code=\\\"${r(ba)}\\\"`:\\\"\\\"} data-longpress=\\\"sms-bubble\\\" tabindex=\\\"0\\\" aria-haspopup=\\\"menu\\\">${Gt(Y)}${m?`<span class=\\\"wa-time\\\">${r(se(new Date(ye)))}</span>`:\\\"\\\"}${Ka(Y.id)}</div><span class=\\\"bubble-time\\\" ${p(l.smsBubbleTime)} aria-hidden=\\\"true\\\">${r(se(new Date(ye)))}</span></div>`}).join(\\\"\\\"),oe=n.items.at(-1),$e=oe?xt(oe):null,ma=i.sms.menu?n.items.find(Y=>Y.id===i.sms.menu):null,rn=M.muted.has(Ae(e,n.from));c=`<div class=\\\"convo ${m?\\\"wa\\\":\\\"\\\"} ${f===\\\"push\\\"&&ce()?\\\"enter\\\":\\\"\\\"}\\\" ${p(l.smsConversation)} data-from=\\\"${r(n.from)}\\\" data-via=\\\"${m?\\\"whatsapp\\\":\\\"sms\\\"}\\\">\\n <div class=\\\"convo-nav\\\"><div class=\\\"bar\\\">\\n <button class=\\\"back\\\" data-action=\\\"sms-back\\\" ${p(l.smsBack)} aria-label=\\\"Back to Messages\\\">${u.chevronBack()}${T?`<span class=\\\"badge\\\">${T}</span>`:\\\"\\\"}</button>\\n <div class=\\\"avatar\\\">${Wt(k)}</div>\\n <div class=\\\"who\\\"><span ${p(l.smsConversationTitle)}>${r(k?Fe(k):n.from)}</span>${rn?` <span class=\\\"flag\\\">${u.bellSlash(12)}</span>`:\\\"\\\"} ${m?'<small class=\\\"wa-sub\\\">WhatsApp</small>':u.chevronRight(\\\"#8e8e93\\\")}</div>\\n </div></div>\\n <div class=\\\"convo-body\\\" data-swipe=\\\"sms-convo\\\">${K}</div>\\n ${$e&&oe&&$()-Date.parse(oe.createdAt)<10*6e4?`<button class=\\\"qt\\\" data-action=\\\"sms-copy-code\\\" data-code=\\\"${r($e)}\\\" ${p(l.smsCode)}><small>From ${m?\\\"WhatsApp\\\":\\\"Messages\\\"}</small>${r($e)}</button>`:\\\"\\\"}\\n <div class=\\\"convo-input\\\"><span class=\\\"plus\\\">${u.plus()}</span><span class=\\\"field-ios\\\">${m?\\\"Message\\\":\\\"Text Message\\\"}<span>${u.mic()}</span></span></div>\\n ${ma?Ya(ma):\\\"\\\"}\\n </div>`}else i.sms.thread=null,i.sms.menu=null,c=`<div class=\\\"msgs ${f===\\\"back\\\"&&ce()?\\\"enter\\\":\\\"\\\"}\\\">\\n <div class=\\\"msgs-nav\\\"><div class=\\\"row\\\"><span>Edit</span>${u.compose()}</div><h1>Messages</h1>\\n <div class=\\\"ios-search\\\">${u.search(\\\"rgba(60,60,67,.6)\\\",15)}<span>Search</span>${u.mic(\\\"rgba(60,60,67,.6)\\\")}</div></div>\\n ${t.length&&e?`<div class=\\\"threads\\\" role=\\\"list\\\">${t.map(k=>{let m=k.items.at(-1),T=k.items.some($e=>!B.has($e.id)),I=Ae(e,k.from),j=M.muted.has(I),K=m?Fe(m):k.from,oe=ge(m);return`<div class=\\\"swipe thread-swipe\\\" data-swipe=\\\"sms-thread\\\" data-from=\\\"${r(k.from)}\\\" data-flip=\\\"thread:${r(k.from)}\\\" role=\\\"listitem\\\">\\n <div class=\\\"swipe-actions\\\">\\n <div class=\\\"side\\\"><button class=\\\"act-unread\\\" data-action=\\\"thread-unread\\\" data-from=\\\"${r(k.from)}\\\" ${p(l.smsThreadToggleUnread)}>${T?u.markRead(22):u.markUnread(22)}${T?\\\"Read\\\":\\\"Unread\\\"}</button><button class=\\\"act-pin\\\" data-action=\\\"thread-pin\\\" data-from=\\\"${r(k.from)}\\\" ${p(l.smsThreadPin)}>${u.pin(22)}${k.pinned?\\\"Unpin\\\":\\\"Pin\\\"}</button></div>\\n <div class=\\\"side\\\"><button class=\\\"act-mute\\\" data-action=\\\"thread-mute\\\" data-from=\\\"${r(k.from)}\\\" ${p(l.smsThreadMute)}>${u.bellSlash(22)}${j?\\\"Show Alerts\\\":\\\"Hide Alerts\\\"}</button><button class=\\\"act-delete\\\" data-action=\\\"thread-delete\\\" data-from=\\\"${r(k.from)}\\\" ${p(l.smsThreadDelete)}>${u.trash()}Delete</button></div>\\n </div>\\n <div class=\\\"thread swipe-card\\\" data-action=\\\"sms-open\\\" data-from=\\\"${r(k.from)}\\\" ${p(l.smsThread)} ${m?be(m):\\\"\\\"} data-unread=\\\"${T}\\\" data-pinned=\\\"${k.pinned}\\\" data-muted=\\\"${j}\\\" role=\\\"button\\\" tabindex=\\\"0\\\" aria-label=\\\"${r(K)}${oe?\\\", WhatsApp\\\":\\\"\\\"}${T?\\\", unread\\\":\\\"\\\"}\\\">\\n ${T?`<span class=\\\"unread\\\" ${p(l.smsThreadUnread)}></span>`:\\\"\\\"}<div class=\\\"avatar ${oe?\\\"wa\\\":\\\"\\\"}\\\">${Wt(m)}</div>\\n <div class=\\\"text\\\"><div class=\\\"top\\\"><span class=\\\"name-line\\\"><span class=\\\"name\\\" ${p(l.smsThreadName)}>${r(K)}</span>${oe?`<span class=\\\"via-wa\\\" ${p(l.smsThreadVia)}>WhatsApp</span>`:\\\"\\\"}${k.pinned?`<span class=\\\"flag\\\">${u.pin(13)}</span>`:\\\"\\\"}${j?`<span class=\\\"flag\\\">${u.bellSlash(13)}</span>`:\\\"\\\"}</span><span class=\\\"when\\\" ${p(l.smsThreadTime)}>${r(ja(m?.createdAt??\\\"\\\"))} ${u.chevronRight()}</span></div>\\n <div class=\\\"preview\\\" ${p(l.smsThreadPreview)}>${r(m?.sms?.body??\\\"\\\")}</div></div></div></div>`}).join(\\\"\\\")}</div>`:`<div class=\\\"empty-ios\\\" ${p(l.smsEmpty)}>${e?\\\"No Messages\\\":\\\"No text messages yet.<br><br>SMS sent through Twilio, SNS, Customer.io or Mailosaur, and WhatsApp sent through Twilio, show up here.\\\"}</div>`}\\n </div>`;let w=Z(\\\"col-sms\\\");bt(w,()=>{w.innerHTML=`\\n ${Ye(\\\"Text messages\\\",Ke(s,l.smsUnreadCount),Ge(\\\"sms\\\",\\\"Phone\\\",l.smsRecipient,dt))}\\n <div class=\\\"iphone\\\" ${p(l.smsDevice)} data-screen=\\\"${n?\\\"conversation\\\":\\\"threads\\\"}\\\" data-recipient=\\\"${r(e??\\\"\\\")}\\\" data-thread=\\\"${r(n?.from??\\\"\\\")}\\\"${n&&ge(n.items[0])?' data-via=\\\"whatsapp\\\"':\\\"\\\"}><div class=\\\"screen\\\"><div class=\\\"island\\\"></div>${Vt()}${c}<div class=\\\"home-indicator\\\"></div></div></div>`});let x=w.querySelector(\\\".convo-body\\\"),S=()=>{x&&(x.scrollTop=x.scrollHeight)};S(),requestAnimationFrame(S),je()},Ya=e=>{let t=M.tapbacks.get(e.id);return`<div class=\\\"ios-overlay\\\" data-action=\\\"close-overlay\\\" ${p(l.smsMenu)} data-notification-id=\\\"${r(e.id)}\\\" role=\\\"dialog\\\" aria-label=\\\"Message actions\\\">\\n <div class=\\\"tapback-bar\\\" role=\\\"toolbar\\\" aria-label=\\\"Tapback\\\">${Ca.map(s=>`<button data-action=\\\"tapback\\\" data-id=\\\"${r(e.id)}\\\" data-value=\\\"${s.id}\\\" ${p(l.smsMenuTapback)} data-tapback=\\\"${s.id}\\\" aria-label=\\\"${s.label}\\\" aria-pressed=\\\"${t===s.id}\\\">${s.glyph}</button>`).join(\\\"\\\")}</div>\\n <div class=\\\"bubble tail\\\">${Gt(e)}</div>\\n <div class=\\\"ios-menu\\\" role=\\\"menu\\\">\\n <button role=\\\"menuitem\\\" data-action=\\\"close-overlay\\\">Reply</button>\\n <button role=\\\"menuitem\\\" data-action=\\\"sms-copy\\\" data-id=\\\"${r(e.id)}\\\" ${p(l.smsMenuCopy)}>Copy</button>\\n <button role=\\\"menuitem\\\" data-action=\\\"close-overlay\\\">Translate</button>\\n <button role=\\\"menuitem\\\" data-action=\\\"close-overlay\\\">More\\\\u2026</button>\\n </div></div>`},Kt=e=>{let t=e.push?.data??{};return Object.keys(t).length?`<div class=\\\"note-data\\\" ${p(l.pushNotificationData)}>${r(JSON.stringify(t,null,2))}</div>`:\\\"\\\"},Yt=e=>`<div class=\\\"note-meta\\\" ${p(l.pushNotificationMeta)}>${r(Me[e.service]??e.service)} \\\\xB7 ${r(e.status??\\\"accepted\\\")}${e.push?.badge!==null&&e.push?.badge!==void 0?` \\\\xB7 badge ${e.push.badge}`:\\\"\\\"}${e.push?.sound?` \\\\xB7 sound ${r(e.push.sound)}`:\\\"\\\"}</div>`,Zt=(e,t={})=>`${be(e)} ${p(l.pushNotification)} data-platform=\\\"${r(e.push?.platform??\\\"unknown\\\")}\\\" data-app=\\\"${r(e.push?.app??\\\"App\\\")}\\\" ${Object.entries(t).map(([s,c])=>`data-${s}=\\\"${r(c)}\\\"`).join(\\\" \\\")}`,Jt=(e,t)=>{let s=e.push,c=s?.app??\\\"App\\\",n=t.expanded;return`<div class=\\\"ios-note swipe-card ${n?\\\"expanded\\\":\\\"\\\"} ${i.arrived.has(e.id)?\\\"arrive\\\":\\\"\\\"}\\\" data-action=\\\"push-toggle\\\" data-id=\\\"${r(e.id)}\\\" ${Zt(e,{expanded:n,stacked:t.stacked??!1})} ${t.extra??\\\"\\\"} role=\\\"button\\\" tabindex=\\\"0\\\" aria-expanded=\\\"${n}\\\" data-longpress=\\\"ios-note\\\">\\n <span class=\\\"app-icon\\\" style=\\\"background:${He(c,ct)}\\\" ${p(l.pushNotificationApp)} aria-label=\\\"${r(c)}\\\">${r(Ne(c).slice(0,1))}</span>\\n <div class=\\\"content\\\">\\n <div class=\\\"line1\\\"><span class=\\\"title\\\" ${p(l.pushNotificationTitle)}>${r(s?.title??c)}</span><span class=\\\"time\\\" ${p(l.pushNotificationTime)}>${r(pt(e.createdAt))}</span></div>\\n <div class=\\\"body\\\" ${p(l.pushNotificationBody)}>${r(s?.body??\\\"\\\")}</div>\\n ${n&&s?.imageUrl?`<img class=\\\"hero\\\" src=\\\"${r(s.imageUrl)}\\\" alt=\\\"\\\" ${p(l.pushNotificationImage)}>`:\\\"\\\"}\\n ${n?Kt(e)+Yt(e):\\\"\\\"}\\n </div>\\n ${!n&&s?.imageUrl?`<img class=\\\"thumb\\\" src=\\\"${r(s.imageUrl)}\\\" alt=\\\"\\\" ${p(l.pushNotificationImage)}>`:\\\"\\\"}\\n </div>`},Ze=(e,t={})=>`<div class=\\\"swipe ios-swipe\\\" data-swipe=\\\"ios-note\\\" data-id=\\\"${r(e.id)}\\\" data-flip=\\\"note:${r(e.id)}\\\" ${t.hidden?\\\"hidden\\\":\\\"\\\"}>\\n <div class=\\\"swipe-actions\\\"><button data-action=\\\"push-options\\\" data-id=\\\"${r(e.id)}\\\" ${p(l.pushOptions)}>Options</button><button data-action=\\\"push-clear\\\" data-id=\\\"${r(e.id)}\\\" ${p(l.pushClear)}>Clear</button></div>\\n ${Jt(e,{expanded:i.push.expanded===e.id,stacked:t.stacked??!1,extra:t.top?'data-group-top=\\\"true\\\"':\\\"\\\"})}\\n </div>`,Za=e=>{let t=e.push,s=i.push.expanded===e.id,c=t?.app??\\\"App\\\",n=i.push.settings===e.id,f=M.silent.has(c);return`<div class=\\\"a-note ${s?\\\"expanded\\\":\\\"\\\"} ${i.arrived.has(e.id)?\\\"arrive\\\":\\\"\\\"}\\\" data-action=\\\"push-toggle\\\" data-id=\\\"${r(e.id)}\\\" ${Zt(e,{expanded:s})} data-swipe=\\\"a-note\\\" data-longpress=\\\"a-note\\\" data-flip=\\\"note:${r(e.id)}\\\" role=\\\"button\\\" tabindex=\\\"0\\\" aria-expanded=\\\"${s}\\\">\\n <span class=\\\"a-icon\\\" style=\\\"background:${He(c,ct)}\\\" aria-hidden=\\\"true\\\">${r(Ne(c).slice(0,1))}</span>\\n <div class=\\\"a-main\\\">\\n <div class=\\\"a-head\\\"><span ${p(l.pushNotificationApp)}>${r(c)}</span><span>\\\\u2022</span><span ${p(l.pushNotificationTime)}>${r(Pa(e.createdAt))}</span>${f?`<span>${u.bellSlash(12)}</span>`:\\\"\\\"}<span class=\\\"chev\\\">${s?u.collapse():u.expand()}</span></div>\\n ${t?.title?`<div class=\\\"a-title\\\" ${p(l.pushNotificationTitle)}>${r(t.title)}</div>`:\\\"\\\"}\\n <div class=\\\"a-body\\\" ${p(l.pushNotificationBody)}>${r(t?.body??\\\"\\\")}</div>\\n ${s&&t?.imageUrl?`<img class=\\\"big-picture\\\" src=\\\"${r(t.imageUrl)}\\\" alt=\\\"\\\" ${p(l.pushNotificationImage)}>`:\\\"\\\"}\\n ${s?Kt(e)+Yt(e):\\\"\\\"}\\n ${n?`<div class=\\\"a-settings\\\" ${p(l.pushSettings)} data-app=\\\"${r(c)}\\\">\\n <button class=\\\"opt\\\" data-action=\\\"push-alerting\\\" data-app=\\\"${r(c)}\\\" data-value=\\\"alerting\\\" aria-pressed=\\\"${!f}\\\">${u.bell()}<span>Default<small>May ring or vibrate based on device settings</small></span></button>\\n <button class=\\\"opt\\\" data-action=\\\"push-alerting\\\" data-app=\\\"${r(c)}\\\" data-value=\\\"silent\\\" aria-pressed=\\\"${f}\\\">${u.bellSlash(18)}<span>Silent<small>No sound or vibration</small></span></button>\\n <div class=\\\"row\\\"><button data-action=\\\"close-overlay\\\">Turn off notifications</button><button data-action=\\\"close-overlay\\\">Done</button></div></div>`:\\\"\\\"}\\n </div>\\n ${!s&&t?.imageUrl?`<img class=\\\"large-icon\\\" src=\\\"${r(t.imageUrl)}\\\" alt=\\\"\\\" ${p(l.pushNotificationImage)}>`:\\\"\\\"}\\n </div>`},Ja=(e,t)=>{let s=[],c=new Map;for(let n of t){let f=n.push?.app??\\\"App\\\";c.has(f)||s.push(f),c.set(f,[...c.get(f)??[],n])}return s.map(n=>{let f=c.get(n)??[],w=f[0];if(!w)return\\\"\\\";if(f.length===1)return Ze(w);let x=ut(e,n),S=M.openGroups.has(x),k=f.length-1;return S?`<div class=\\\"push-group\\\" ${p(l.pushGroup)} data-app=\\\"${r(n)}\\\" data-count=\\\"${f.length}\\\" data-open=\\\"true\\\" data-flip=\\\"group:${r(n)}\\\">\\n <div class=\\\"group-head\\\"><h3>${r(n)}</h3><button data-action=\\\"group-collapse\\\" data-key=\\\"${r(x)}\\\" ${p(l.pushGroupCollapse)}>Show less</button><button class=\\\"x\\\" data-action=\\\"group-clear\\\" data-key=\\\"${r(x)}\\\" data-app=\\\"${r(n)}\\\" aria-label=\\\"Clear ${r(n)} notifications\\\">${u.close(14)}</button></div>\\n ${f.map(m=>Ze(m)).join(\\\"\\\")}</div>`:`<div class=\\\"push-group\\\" ${p(l.pushGroup)} data-app=\\\"${r(n)}\\\" data-count=\\\"${f.length}\\\" data-open=\\\"false\\\" data-flip=\\\"group:${r(n)}\\\">\\n ${Ze(w,{top:!0})}\\n <button class=\\\"stack-layers\\\" data-action=\\\"group-open\\\" data-key=\\\"${r(x)}\\\" ${p(l.pushGroupMore)} data-count=\\\"${k}\\\" aria-label=\\\"Show ${k} more notification${k===1?\\\"\\\":\\\"s\\\"}\\\"><div class=\\\"ios-stack-more\\\"></div>${k>1?'<div class=\\\"ios-stack-more\\\"></div>':\\\"\\\"}<div class=\\\"center-label\\\" style=\\\"font-size:13px;margin-top:6px\\\">${k} more notification${k===1?\\\"\\\":\\\"s\\\"}</div></button>\\n ${f.slice(1).map(m=>Ze(m,{stacked:!0,hidden:!0})).join(\\\"\\\")}</div>`}).join(\\\"\\\")},G=()=>{let e=i.push.to,t=e?ee(\\\"push\\\").filter(T=>T.to===e):[];Se(t.map(T=>T.id));let s=t[0]?.push?.platform??\\\"unknown\\\",c=i.push.skin===\\\"auto\\\"?s===\\\"android\\\"?\\\"android\\\":\\\"ios\\\":i.push.skin,n=new Date($()),f=ee(\\\"push\\\").filter(T=>!B.has(T.id)).length,w=i.push.wake&&ce();i.push.wake=!1;let x,S=`${p(l.pushDevice)} data-skin=\\\"${c}\\\" data-recipient=\\\"${r(e??\\\"\\\")}\\\" data-platform=\\\"${r(s)}\\\"`;if(c===\\\"android\\\")x=`<div class=\\\"pixel\\\" ${S}><div class=\\\"screen\\\"><div class=\\\"punch\\\"></div><div class=\\\"shade\\\">\\n <div class=\\\"sb\\\"><span>${se(n).replace(/\\\\s?[AP]M$/i,\\\"\\\")}</span><span class=\\\"icons\\\">${u.androidWifi()}${u.androidSignal()}${u.androidBattery()}</span></div>\\n <div class=\\\"qs-head\\\"><span>${r(n.toLocaleDateString([],{weekday:\\\"short\\\",month:\\\"short\\\",day:\\\"numeric\\\"}))}</span>${u.gear()}</div>\\n <div class=\\\"qs\\\"><div class=\\\"tile on\\\">${u.androidWifi()}<div>Internet<small>Mockingbird</small></div></div><div class=\\\"tile\\\">${u.bell()}<div>Do Not Disturb<small>Off</small></div></div>\\n <div class=\\\"tile\\\">${u.androidBattery()}<div>Battery Saver<small>Off</small></div></div><div class=\\\"tile\\\">${u.lock()}<div>Screen lock<small>On</small></div></div></div>\\n <div class=\\\"qs-bright\\\"></div>\\n <div class=\\\"shade-list\\\" role=\\\"list\\\">${t.length?t.map(Za).join(\\\"\\\"):`<div class=\\\"shade-empty\\\" ${p(l.pushEmpty)}>No notifications</div>`}</div>\\n ${t.length?`<div class=\\\"shade-actions\\\"><button data-action=\\\"close-overlay\\\">Manage</button><button data-action=\\\"push-clear-all\\\" ${p(l.pushClearAll)}>Clear all</button></div>`:\\\"\\\"}\\n <div class=\\\"gesture\\\"></div></div></div></div>`;else{let T=i.push.preview?t.find(I=>I.id===i.push.preview):null;x=`<div class=\\\"iphone\\\" ${S}><div class=\\\"screen\\\"><div class=\\\"island\\\"></div>${Vt(!0)}<div class=\\\"lock ${w?\\\"wake\\\":\\\"\\\"}\\\">\\n <div class=\\\"padlock\\\">${u.padlock()}</div>\\n <div class=\\\"date\\\">${r(n.toLocaleDateString([],{weekday:\\\"long\\\",month:\\\"long\\\",day:\\\"numeric\\\"}))}</div>\\n <div class=\\\"clock\\\">${r(se(n).replace(/\\\\s?[AP]M$/i,\\\"\\\"))}</div>\\n <div class=\\\"lock-stack\\\" role=\\\"list\\\">${t.length&&e?`<div class=\\\"center-label\\\">Notification Center</div>${Ja(e,t)}`:`<div class=\\\"lock-empty\\\" ${p(l.pushEmpty)}>${e?\\\"No Older Notifications\\\":\\\"No push notifications yet\\\"}</div>`}</div>\\n <div class=\\\"lock-buttons\\\"><span>${u.flashlight()}</span><span>${u.camera()}</span></div>\\n ${T?`<div class=\\\"ios-overlay dark\\\" data-action=\\\"close-overlay\\\" ${p(l.pushPreview)} data-notification-id=\\\"${r(T.id)}\\\" role=\\\"dialog\\\" aria-label=\\\"Notification preview\\\">${Jt(T,{expanded:!0})}\\n <div class=\\\"ios-menu\\\" role=\\\"menu\\\"><button role=\\\"menuitem\\\" data-action=\\\"push-clear\\\" data-id=\\\"${r(T.id)}\\\">Clear</button><button role=\\\"menuitem\\\" data-action=\\\"close-overlay\\\">Options</button></div></div>`:\\\"\\\"}\\n </div><div class=\\\"home-indicator light\\\"></div></div></div>`}let k=T=>{let I=Ve(\\\"push\\\").find(K=>K.to===T);return`${T.length>22?`${T.slice(0,10)}\\\\u2026${T.slice(-8)}`:T}${I?.platform&&I.platform!==\\\"unknown\\\"?` \\\\xB7 ${I.platform}`:\\\"\\\"}`},m=Z(\\\"col-push\\\");bt(m,()=>{m.innerHTML=`\\n ${Ye(\\\"Push\\\",Ke(f,l.pushUnreadCount),Ge(\\\"push\\\",\\\"Device\\\",l.pushRecipient,k),`<div class=\\\"seg\\\" role=\\\"group\\\" aria-label=\\\"Phone\\\">${[\\\"auto\\\",\\\"ios\\\",\\\"android\\\"].map(T=>`<button data-action=\\\"skin\\\" data-value=\\\"${T}\\\" ${p(l.pushSkin)} aria-pressed=\\\"${i.push.skin===T}\\\">${T===\\\"auto\\\"?\\\"Auto\\\":T===\\\"ios\\\"?\\\"iOS\\\":\\\"Android\\\"}</button>`).join(\\\"\\\")}</div>`)}${x}`}),je()},Xa=e=>`<!doctype html><html><head><meta charset=\\\"utf-8\\\"><base target=\\\"_blank\\\"><style>body{margin:0;font:14px/1.5 Arial,Helvetica,sans-serif;color:#222;overflow-wrap:anywhere}img{max-width:100%;height:auto}</style></head><body>${e.email?.html??\\\"\\\"}</body></html>`,Qa=(e,t)=>{i.toast=t?{text:e,undo:t}:{text:e},te();let s=i.toast;F(6e3,()=>{i.toast===s&&(i.toast=null,te())})},Xt=(e,t)=>{M.dismissed.add(e),i.email.open===e&&(i.email.open=null,i.email.transition=!0),Qa(t===\\\"archived\\\"?\\\"Conversation archived.\\\":\\\"Conversation moved to Trash.\\\",()=>{M.dismissed.delete(e),i.toast=null,te()})},te=()=>{let e=i.email.to,t=e?ee(\\\"email\\\").filter(m=>m.to===e):[],s=t.filter(m=>!B.has(m.id)).length,c=ee(\\\"email\\\").filter(m=>!B.has(m.id)).length,n=t.find(m=>m.id===i.email.open);n||(i.email.open=null);let f=i.email.transition&&ce();i.email.transition=!1;let w=e??\\\"you@example.test\\\",x;if(n){Se([n.id]);let m=n.email,T=n.from.name??n.from.address,I=n.to.toLowerCase()===w.toLowerCase()?\\\"me\\\":n.to,j=(K,oe,$e)=>`<span>${oe}:</span><span ${p(l.emailDetail)} data-field=\\\"${K}\\\">${r($e)}</span>`;x=`<div class=\\\"mail-toolbar\\\">\\n <button class=\\\"icon-btn\\\" data-action=\\\"mail-back\\\" ${p(l.emailBack)} title=\\\"Back to Inbox\\\" aria-label=\\\"Back to Inbox\\\">${u.back()}</button>\\n <button class=\\\"icon-btn\\\" data-action=\\\"mail-archive\\\" data-id=\\\"${r(n.id)}\\\" ${p(l.emailArchive)} title=\\\"Archive\\\" aria-label=\\\"Archive\\\">${u.archive()}</button><span class=\\\"icon-btn\\\">${u.report()}</span><button class=\\\"icon-btn\\\" data-action=\\\"mail-delete\\\" data-id=\\\"${r(n.id)}\\\" ${p(l.emailDelete)} title=\\\"Delete\\\" aria-label=\\\"Delete\\\">${u.trash()}</button>\\n <button class=\\\"icon-btn\\\" data-action=\\\"mail-unread\\\" data-id=\\\"${r(n.id)}\\\" ${p(l.emailMarkUnread)} title=\\\"Mark as unread\\\" aria-label=\\\"Mark as unread\\\">${u.markUnread()}</button><span class=\\\"icon-btn\\\">${u.clock()}</span><span class=\\\"icon-btn\\\">${u.more()}</span>\\n <span class=\\\"range\\\">${t.indexOf(n)+1} of ${t.length}</span></div>\\n <div class=\\\"reader ${f?\\\"enter\\\":\\\"\\\"}\\\" ${be(n)} ${p(l.emailOpen)}>\\n <div class=\\\"subject-row\\\"><h1 ${p(l.emailSubject)}>${r(m?.subject||\\\"(no subject)\\\")}</h1><span class=\\\"label-chip\\\">Inbox</span></div>\\n <div class=\\\"sender-row\\\">\\n <span class=\\\"mail-avatar\\\" style=\\\"background:${He(n.from.address)}\\\">${r(Ne(T).slice(0,1))}</span>\\n <div class=\\\"who\\\"><b ${p(l.emailFromName)}>${r(T)}</b> <span class=\\\"addr\\\">&lt;<span ${p(l.emailFromAddress)}>${r(n.from.address)}</span>&gt;</span>\\n <div class=\\\"to\\\" data-action=\\\"mail-details\\\" ${p(l.emailTo)} role=\\\"button\\\" tabindex=\\\"0\\\" aria-expanded=\\\"${he}\\\">to ${r(I)}${m?.cc.length?`, ${r(m.cc.join(\\\", \\\"))}`:\\\"\\\"} ${u.dropdown()}</div></div>\\n <div class=\\\"meta\\\"><span ${p(l.emailDate)}>${r(Ua(n.createdAt))}</span> <span class=\\\"icon-btn\\\">${u.star()}</span><span class=\\\"icon-btn\\\">${u.reply()}</span><span class=\\\"icon-btn\\\">${u.more()}</span></div>\\n </div>\\n ${he?`<div class=\\\"details\\\" ${p(l.emailDetails)}>\\n ${j(\\\"from\\\",\\\"from\\\",n.from.name?`${n.from.name} <${n.from.address}>`:n.from.address)}\\n ${j(\\\"to\\\",\\\"to\\\",n.to)}\\n ${m?.cc.length?j(\\\"cc\\\",\\\"cc\\\",m.cc.join(\\\", \\\")):\\\"\\\"}\\n ${m?.bcc.length?j(\\\"bcc\\\",\\\"bcc\\\",m.bcc.join(\\\", \\\")):\\\"\\\"}\\n ${m?.replyTo.length?j(\\\"reply-to\\\",\\\"reply-to\\\",m.replyTo.join(\\\", \\\")):\\\"\\\"}\\n ${j(\\\"date\\\",\\\"date\\\",new Date(n.createdAt).toLocaleString())}\\n ${j(\\\"subject\\\",\\\"subject\\\",m?.subject??\\\"\\\")}\\n ${j(\\\"mailed-by\\\",\\\"mailed-by\\\",`${Me[n.service]??n.service} (${n.source})`)}\\n ${j(\\\"message-id\\\",\\\"message id\\\",n.providerId)}\\n </div>`:\\\"\\\"}\\n ${m?.html?`<iframe class=\\\"mail-frame\\\" name=\\\"email-body\\\" ${p(l.emailBody)} data-format=\\\"html\\\" sandbox=\\\"allow-same-origin allow-popups allow-popups-to-escape-sandbox\\\" title=\\\"Email body\\\"></iframe>`:`<div class=\\\"mail-text\\\" ${p(l.emailText)} data-format=\\\"text\\\">${jt(r(m?.text??\\\"\\\"))}</div>`}\\n ${m?.attachments.length?`<div class=\\\"attachments\\\" ${p(l.emailAttachments)} data-count=\\\"${m.attachments.length}\\\"><h3>${m.attachments.length} attachment${m.attachments.length===1?\\\"\\\":\\\"s\\\"}</h3><div class=\\\"att-grid\\\">${m.attachments.map(K=>`<div class=\\\"att\\\" ${p(l.emailAttachment)} data-filename=\\\"${r(K.filename)}\\\" data-content-type=\\\"${r(K.contentType??\\\"\\\")}\\\" data-size=\\\"${K.size??\\\"\\\"}\\\"><div class=\\\"att-top\\\">${u.file()}</div><div class=\\\"att-name\\\">${u.clip()} ${r(K.filename)}${K.size?` <span style=\\\"color:#5f6368;font-weight:400\\\">${Math.max(1,Math.round(K.size/1024))} KB</span>`:\\\"\\\"}</div></div>`).join(\\\"\\\")}</div></div>`:\\\"\\\"}\\n <div class=\\\"reply-row\\\"><span>${u.reply()} Reply</span><span>${u.forward()} Forward</span></div>\\n </div>`}else x=`<div class=\\\"mail-toolbar\\\"><span class=\\\"icon-btn\\\">${u.checkbox()}</span><button class=\\\"icon-btn\\\" data-action=\\\"refresh\\\" ${p(l.emailRefresh)} title=\\\"Refresh\\\" aria-label=\\\"Refresh\\\">${u.refresh()}</button><span class=\\\"icon-btn\\\">${u.more()}</span>\\n <span class=\\\"range\\\">${t.length?`1\\\\u2013${t.length} of ${t.length}`:\\\"\\\"}</span></div>\\n <div class=\\\"cat-tabs\\\"><div class=\\\"on\\\">${u.inbox()} Primary</div><div>${u.star()} Promotions</div><div>${u.send()} Updates</div></div>\\n <div class=\\\"mail-list ${f?\\\"enter\\\":\\\"\\\"}\\\" role=\\\"list\\\">${t.length?t.map(m=>{let T=!B.has(m.id),I=m.from.name??m.from.address,j=M.starred.has(m.id);return`<div class=\\\"swipe mrow-swipe\\\" data-swipe=\\\"mrow\\\" data-id=\\\"${r(m.id)}\\\" data-flip=\\\"row:${r(m.id)}\\\" role=\\\"listitem\\\">\\n <div class=\\\"swipe-actions\\\">${u.archive()}${u.archive()}</div>\\n <div class=\\\"mrow swipe-card ${T?\\\"unread\\\":\\\"\\\"} ${i.arrived.has(m.id)?\\\"arrive\\\":\\\"\\\"}\\\" data-action=\\\"mail-open\\\" data-id=\\\"${r(m.id)}\\\" ${be(m)} ${p(l.emailRow)} data-starred=\\\"${j}\\\" role=\\\"button\\\" tabindex=\\\"0\\\">\\n <span class=\\\"chk\\\" data-action=\\\"mail-check\\\" data-id=\\\"${r(m.id)}\\\" role=\\\"checkbox\\\" aria-checked=\\\"${M.checked.has(m.id)}\\\" aria-label=\\\"Select\\\">${u.checkbox()}</span><span class=\\\"star\\\" data-action=\\\"mail-star\\\" data-id=\\\"${r(m.id)}\\\" ${p(l.emailRowStar)} role=\\\"button\\\" aria-pressed=\\\"${j}\\\" aria-label=\\\"${j?\\\"Starred\\\":\\\"Not starred\\\"}\\\">${j?u.starFilled():u.star()}</span>\\n <span class=\\\"from\\\" ${p(l.emailRowFrom)}>${r(I)}</span>\\n <span class=\\\"subj\\\"><span ${p(l.emailRowSubject)}>${r(m.email?.subject||\\\"(no subject)\\\")}</span> <span class=\\\"snippet\\\">- <span ${p(l.emailRowSnippet)}>${r(m.preview)}</span></span></span>\\n ${m.email?.attachments.length?`<span class=\\\"clip\\\" ${p(l.emailRowAttachment)}>${u.clip()}</span>`:\\\"\\\"}<span class=\\\"svc\\\" ${p(l.emailRowService)}>${r(Me[m.service]??m.service)}</span>\\n <span class=\\\"date\\\" ${p(l.emailRowDate)}>${r(_a(m.createdAt))}</span>\\n <span class=\\\"hover-actions\\\"><button class=\\\"icon-btn\\\" data-action=\\\"mail-archive\\\" data-id=\\\"${r(m.id)}\\\" ${p(l.emailRowArchive)} title=\\\"Archive\\\" aria-label=\\\"Archive\\\">${u.archive()}</button><button class=\\\"icon-btn\\\" data-action=\\\"mail-delete\\\" data-id=\\\"${r(m.id)}\\\" ${p(l.emailRowDelete)} title=\\\"Delete\\\" aria-label=\\\"Delete\\\">${u.trash()}</button><button class=\\\"icon-btn\\\" data-action=\\\"mail-toggle-read\\\" data-id=\\\"${r(m.id)}\\\" ${p(l.emailRowToggleRead)} title=\\\"${T?\\\"Mark as read\\\":\\\"Mark as unread\\\"}\\\" aria-label=\\\"${T?\\\"Mark as read\\\":\\\"Mark as unread\\\"}\\\">${T?u.markRead():u.markUnread()}</button><span class=\\\"icon-btn\\\">${u.clock()}</span></span></div></div>`}).join(\\\"\\\"):`<div class=\\\"mail-empty\\\" ${p(l.emailEmpty)}>${u.envelope()}<b>${e?\\\"Your Primary tab is empty.\\\":\\\"No email yet\\\"}</b>${e?\\\"\\\":\\\"Email sent through Resend, SES, SNS, Customer.io or Mailosaur lands here.\\\"}</div>`}</div>`;let S=Z(\\\"col-email\\\");bt(S,()=>{S.innerHTML=`\\n ${Ye(\\\"Email\\\",Ke(c,l.emailUnreadCount),Ge(\\\"email\\\",\\\"Mailbox\\\",l.emailRecipient,m=>m))}\\n <div class=\\\"window\\\" ${p(l.emailDevice)} data-screen=\\\"${n?\\\"message\\\":\\\"inbox\\\"}\\\" data-recipient=\\\"${r(e??\\\"\\\")}\\\">\\n <div class=\\\"chrome\\\"><span class=\\\"lights\\\"><i></i><i></i><i></i></span><span class=\\\"omnibox\\\">${u.lock()} mail.example.test/#inbox${n?`/${r(n.providerId)}`:\\\"\\\"}</span></div>\\n <div class=\\\"mail-top\\\"><span class=\\\"icon-btn\\\">${u.menu()}</span><span class=\\\"mail-logo\\\">${u.envelope()}<span class=\\\"lbl\\\">Mail</span></span>\\n <div class=\\\"mail-search\\\"><span class=\\\"icon-btn\\\">${u.search(\\\"#444746\\\",20)}</span><span class=\\\"placeholder\\\">Search mail</span><span class=\\\"icon-btn\\\">${u.tune()}</span></div>\\n <div class=\\\"right\\\"><span class=\\\"icon-btn\\\">${u.help()}</span><span class=\\\"icon-btn\\\">${u.gear()}</span><span class=\\\"icon-btn\\\">${u.apps()}</span>\\n <span class=\\\"mail-avatar\\\" title=\\\"${r(w)}\\\" style=\\\"background:${He(w)}\\\">${r(w.slice(0,1).toUpperCase())}</span></div></div>\\n <div class=\\\"mail-body\\\">\\n <nav class=\\\"mail-nav\\\"><button class=\\\"compose\\\">${u.pencil()}<span class=\\\"lbl\\\">Compose</span></button>\\n <div class=\\\"nav-item active\\\">${u.inbox()}<span class=\\\"lbl\\\">Inbox</span><span class=\\\"n\\\">${s||\\\"\\\"}</span></div>\\n <div class=\\\"nav-item\\\">${u.star()}<span class=\\\"lbl\\\">Starred</span></div>\\n <div class=\\\"nav-item\\\">${u.clock()}<span class=\\\"lbl\\\">Snoozed</span></div>\\n <div class=\\\"nav-item\\\">${u.send()}<span class=\\\"lbl\\\">Sent</span></div>\\n <div class=\\\"nav-item\\\">${u.draft()}<span class=\\\"lbl\\\">Drafts</span></div>\\n <div class=\\\"nav-item\\\">${u.expand()}<span class=\\\"lbl\\\">More</span></div></nav>\\n <main class=\\\"mail-main\\\">${x}</main>\\n </div>\\n ${i.toast?`<div class=\\\"toast\\\" ${p(l.toast)} role=\\\"status\\\"><span>${r(i.toast.text)}</span>${i.toast.undo?`<button data-action=\\\"toast-undo\\\" ${p(l.toastUndo)}>Undo</button>`:\\\"\\\"}<button data-action=\\\"toast-close\\\" aria-label=\\\"Dismiss\\\">${u.close(16)}</button></div>`:\\\"\\\"}\\n </div>`});let k=S.querySelector(\\\".mail-frame\\\");k&&n&&(k.addEventListener(\\\"load\\\",()=>{let m=k.contentDocument;m&&(k.style.height=`${Math.max(120,m.documentElement.scrollHeight+8)}px`)}),k.srcdoc=Xa(n)),Qt(),je()},vt=e=>ee(e).filter(t=>!B.has(t.id)).length,Qt=()=>{if(!h||!d)return;let e=le.reduce((t,s)=>t+vt(s),0);document.title=`${e?`(${e}) `:\\\"\\\"}${Ft()} \\\\xB7 Mockingbird`},Le=e=>e.startsWith(\\\"/services/\\\")?`Webhook \\\\u2026${e.slice(-6)}`:e,en=e=>{let t=new Date(e),s=new Date($());if(xe(t,s))return\\\"Today\\\";let c=new Date(s);return c.setDate(s.getDate()-1),xe(t,c)?\\\"Yesterday\\\":t.toLocaleDateString([],{weekday:\\\"long\\\",month:\\\"long\\\",day:\\\"numeric\\\"})},tn=e=>{let t=e.chat,s=e.from.name??e.from.address,c={name:S=>t?.names?.[S]},n=t?.text&&!t.blocks.length?`<div class=\\\"chat-text\\\" ${p(l.chatMessageText)}>${ke(t.text,c)}</div>`:\\\"\\\",f=t?.blocks.length?`<div class=\\\"chat-blocks\\\" ${p(l.chatMessageBlocks)}>${Lt(t.blocks,c)}</div>`:\\\"\\\",w=t?.attachments.length?`<div class=\\\"chat-attachments\\\" ${p(l.chatMessageAttachments)}>${$a(t.attachments,c)}</div>`:\\\"\\\",x=t?.reactions.length?`<div class=\\\"chat-reactions\\\">${t.reactions.map(S=>`<span class=\\\"chat-reaction\\\" ${p(l.chatMessageReaction)} data-name=\\\"${r(S.name)}\\\" data-count=\\\"${S.count}\\\">${r(Ie(S.name))} ${S.count}</span>`).join(\\\"\\\")}</div>`:\\\"\\\";return`<div class=\\\"chat-msg ${i.arrived.has(e.id)?\\\"arrive\\\":\\\"\\\"}\\\" ${be(e)} ${p(l.chatMessage)} data-method=\\\"${r(t?.method??\\\"\\\")}\\\" data-ephemeral=\\\"${t?.ephemeral??!1}\\\" data-thread=\\\"${r(t?.threadTs??\\\"\\\")}\\\" role=\\\"listitem\\\" tabindex=\\\"0\\\">\\n <span class=\\\"chat-avatar\\\" style=\\\"background:${He(e.from.address,ct)}\\\" aria-hidden=\\\"true\\\">${r(Ne(s))}</span>\\n <div class=\\\"chat-msg-main\\\">\\n <div class=\\\"chat-meta\\\"><b ${p(l.chatMessageAuthor)}>${r(s)}</b><span class=\\\"chat-app\\\">APP</span><span class=\\\"chat-time\\\" ${p(l.chatMessageTime)}>${r(se(new Date(e.createdAt)))}</span>${t?.edited?'<span class=\\\"chat-edited\\\">(edited)</span>':\\\"\\\"}</div>\\n ${t?.ephemeral?'<div class=\\\"chat-note\\\">Only visible to you</div>':\\\"\\\"}${t?.threadTs?'<div class=\\\"chat-note\\\">replied to a thread</div>':\\\"\\\"}\\n ${n}${f}${w}${x}\\n </div></div>`},ea=()=>{let e=i.chat.to,t=ee(\\\"chat\\\"),s=e?t.filter(m=>m.to===e).sort((m,T)=>m.createdAt<T.createdAt?-1:1):[];Se(s.map(m=>m.id));let c=Ve(\\\"chat\\\"),n=t[0]?.chat?.workspace??\\\"Workspace\\\",f=\\\"\\\",w=s.map(m=>{let T=en(m.createdAt),I=T===f?\\\"\\\":`<div class=\\\"chat-day\\\"><span>${r(T)}</span></div>`;return f=T,I+tn(m)}).join(\\\"\\\"),x=Z(\\\"col-chat\\\");x.innerHTML=`\\n ${Ye(\\\"Chat\\\",Ke(vt(\\\"chat\\\"),l.chatUnreadCount),Ge(\\\"chat\\\",\\\"Channel\\\",l.chatRecipient,Le))}\\n <div class=\\\"window chat\\\" ${p(l.chatDevice)} data-recipient=\\\"${r(e??\\\"\\\")}\\\" data-workspace=\\\"${r(n)}\\\">\\n <div class=\\\"chrome\\\"><span class=\\\"lights\\\"><i></i><i></i><i></i></span><span class=\\\"omnibox\\\">${u.lock()} chat.example.test/${r(e?Le(e).replace(/^#/,\\\"\\\"):\\\"\\\")}</span></div>\\n <div class=\\\"chat-body\\\">\\n <nav class=\\\"chat-side\\\" aria-label=\\\"Channels\\\">\\n <div class=\\\"chat-team\\\" ${p(l.chatWorkspace)}>${r(n)} ${u.dropdown()}</div>\\n <div class=\\\"chat-side-label\\\">Channels</div>\\n ${c.map(m=>`<button class=\\\"chat-chan ${m.to===e?\\\"on\\\":\\\"\\\"} ${m.unread?\\\"unread\\\":\\\"\\\"}\\\" data-action=\\\"chat-channel\\\" data-value=\\\"${r(m.to)}\\\" ${p(l.chatChannel)} data-to=\\\"${r(m.to)}\\\" data-unread=\\\"${m.unread}\\\" aria-current=\\\"${m.to===e}\\\"><span class=\\\"hash\\\">${m.to.startsWith(\\\"#\\\")?\\\"#\\\":\\\"~\\\"}</span><span class=\\\"lbl\\\">${r(Le(m.to).replace(/^#/,\\\"\\\"))}</span>${m.unread?`<span class=\\\"n\\\">${m.unread}</span>`:\\\"\\\"}</button>`).join(\\\"\\\")}\\n </nav>\\n <main class=\\\"chat-main\\\">\\n <header class=\\\"chat-head\\\"><b ${p(l.chatTitle)}>${r(e?Le(e):\\\"Chat\\\")}</b><span>${s.length?`${s.length} message${s.length===1?\\\"\\\":\\\"s\\\"}`:\\\"\\\"}</span></header>\\n <div class=\\\"chat-list\\\" role=\\\"list\\\">${w||`<div class=\\\"chat-empty\\\" ${p(l.chatEmpty)}><b>${e?\\\"No messages in this channel\\\":\\\"No chat messages yet\\\"}</b>${e?\\\"\\\":\\\"Messages posted to the Slack emulator, with chat.postMessage or an incoming webhook, land here.\\\"}</div>`}</div>\\n <div class=\\\"chat-compose\\\"><span>Message ${r(e?Le(e):\\\"channel\\\")}</span><span class=\\\"send\\\">${u.send()}</span></div>\\n </main>\\n </div>\\n </div>`;let S=x.querySelector(\\\".chat-list\\\"),k=()=>{S&&(S.scrollTop=S.scrollHeight)};k(),requestAnimationFrame(k),je()},an=()=>{let e=It();Z(\\\"timeline\\\").innerHTML=e.length?`<table class=\\\"tl\\\" ${p(l.timeline)}><thead><tr><th>Time</th><th>Channel</th><th>Source</th><th>To</th><th>From</th><th>Content</th><th>Status</th></tr></thead><tbody>${e.map(t=>`<tr data-action=\\\"inspect\\\" data-id=\\\"${r(t.id)}\\\" ${be(t)} ${p(l.timelineRow)} tabindex=\\\"0\\\">\\n <td class=\\\"mono\\\" data-col=\\\"time\\\">${r(Ia(t.createdAt))}</td>\\n <td data-col=\\\"channel\\\"><span class=\\\"chan ${t.channel} ${ge(t)?\\\"wa\\\":\\\"\\\"}\\\">${ge(t)?\\\"WhatsApp\\\":Ba[t.channel]}</span></td>\\n <td data-col=\\\"source\\\"><span class=\\\"svc-tag\\\">${r(Me[t.service]??t.service)}${t.source!==t.service?` \\\\xB7 ${r(t.source)}`:\\\"\\\"}</span></td>\\n <td class=\\\"mono\\\" data-col=\\\"to\\\">${r(t.channel===\\\"sms\\\"?dt(t.to):t.channel===\\\"chat\\\"?Le(t.to):t.to.length>28?`${t.to.slice(0,26)}\\\\u2026`:t.to)}</td>\\n <td data-col=\\\"from\\\">${r(Fe(t))}</td>\\n <td class=\\\"content\\\" data-col=\\\"content\\\">${t.email?`<b>${r(t.email.subject)}</b> \\\\u2014 `:t.push?.title?`<b>${r(t.push.title)}</b> \\\\u2014 `:\\\"\\\"}${r(t.channel===\\\"email\\\"||t.channel===\\\"chat\\\"?t.preview.slice(0,120):t.sms?.body??t.push?.body??t.preview)}</td>\\n <td class=\\\"svc-tag\\\" data-col=\\\"status\\\">${r(t.status??\\\"\\\")}</td></tr>`).join(\\\"\\\")}</tbody></table>`:`<div class=\\\"empty-tl\\\" ${p(l.timelineEmpty)}>Nothing sent in namespace <b>${r(i.namespace)}</b> yet.</div>`},Re=()=>{let e=i.items.find(f=>f.id===i.inspect),t=Z(\\\"inspector\\\");if(!e){t.hidden=!0,t.innerHTML=\\\"\\\";for(let f of Object.keys(t.dataset))f!==\\\"region\\\"&&f!==\\\"testid\\\"&&delete t.dataset[f];return}t.hidden=!1,Object.assign(t.dataset,{notificationId:e.id,channel:e.channel,service:e.service,source:e.source,to:e.to,from:e.from.address,status:e.status??\\\"\\\",createdAt:e.createdAt});let{raw:s,...c}=e,n=(f,w,x)=>`<span>${w}</span><span ${p(l.inspectorField)} data-field=\\\"${f}\\\">${r(x)}</span>`;t.innerHTML=`<header><h3 ${p(l.inspectorTitle)}>${r(ge(e)?\\\"WHATSAPP\\\":e.channel.toUpperCase())} \\\\xB7 ${r(e.email?.subject??e.push?.title??e.preview.slice(0,60))}</h3>\\n <button class=\\\"btn\\\" data-action=\\\"show-on-device\\\" data-id=\\\"${r(e.id)}\\\" ${p(l.inspectorShowOnDevice)}>Show on device</button><button class=\\\"btn\\\" data-action=\\\"close-inspector\\\" ${p(l.inspectorClose)}>Close</button></header>\\n <div class=\\\"kv\\\">${n(\\\"id\\\",\\\"Id\\\",e.id)}${n(\\\"providerId\\\",\\\"Provider id\\\",e.providerId)}${n(\\\"service\\\",\\\"Service\\\",`${e.service} (${e.source})`)}\\n ${n(\\\"namespace\\\",\\\"Namespace\\\",e.namespace)}${n(\\\"to\\\",\\\"To\\\",e.to)}${n(\\\"from\\\",\\\"From\\\",e.from.name?`${e.from.name} <${e.from.address}>`:e.from.address)}\\n ${n(\\\"createdAt\\\",\\\"Created\\\",e.createdAt)}${n(\\\"status\\\",\\\"Status\\\",e.status??\\\"\\\\u2014\\\")}</div>\\n <pre ${p(l.inspectorJson)}>${r(JSON.stringify({...c,raw:s},null,2))}</pre>`},we=e=>{let t=L();return fe.includes(e)&&(t===\\\"all\\\"||t===e)},ta=e=>{if(i.only=e===\\\"all\\\"?null:e,e!==\\\"all\\\"&&(C=e),h){let t=new URL(location.href);e===\\\"all\\\"?t.searchParams.delete(\\\"view\\\"):t.searchParams.set(\\\"view\\\",e);for(let s of[\\\"to\\\",\\\"from\\\",\\\"id\\\"])t.searchParams.delete(s);q?.channel===e&&t.searchParams.set(\\\"to\\\",q.to),history.replaceState(null,\\\"\\\",t)}J()},aa=e=>a.querySelector(`[data-action=\\\"tab\\\"][data-value=\\\"${e}\\\"]`),je=()=>{let e=Z(\\\"tabs\\\"),t=o.tabs===!1?[]:Ct(fe,z);e.hidden=!t.length||i.view!==\\\"devices\\\";for(let n of le){let f=Z(`col-${n}`);t.length?(f.setAttribute(\\\"role\\\",\\\"tabpanel\\\"),f.setAttribute(\\\"aria-labelledby\\\",`${pe}-tab-${n}`)):(f.removeAttribute(\\\"role\\\"),f.removeAttribute(\\\"aria-labelledby\\\"))}if(e.hidden){e.innerHTML=\\\"\\\";return}let s=L(),c=e.contains(document.activeElement)?document.activeElement.dataset.value:void 0;e.dataset.layout=z?\\\"tabs\\\":\\\"grid\\\",e.innerHTML=t.map(n=>{let f=n===s,w=n===\\\"all\\\"?0:vt(n),x=n===\\\"all\\\"?fe.map(S=>`${pe}-panel-${S}`).join(\\\" \\\"):`${pe}-panel-${n}`;return`<button role=\\\"tab\\\" id=\\\"${pe}-tab-${n}\\\" aria-selected=\\\"${f}\\\" aria-controls=\\\"${x}\\\" tabindex=\\\"${f?0:-1}\\\" data-action=\\\"tab\\\" data-value=\\\"${n}\\\" ${p(l.channelTab)} data-unread=\\\"${w}\\\">${Ta[n]}${w&&!f?`<span class=\\\"tab-unread\\\" ${p(l.channelTabUnread)} aria-label=\\\"${w} unread\\\">${w}</span>`:\\\"\\\"}</button>`}).join(\\\"\\\"),c&&aa(c)?.focus()},J=()=>{if(!O){ve(),Z(\\\"devices\\\").hidden=i.view!==\\\"devices\\\",Z(\\\"timeline\\\").hidden=i.view!==\\\"timeline\\\";for(let e of le)Z(`col-${e}`).hidden=!we(e);Z(\\\"devices\\\").classList.toggle(\\\"solo\\\",le.filter(we).length===1),i.view===\\\"devices\\\"?(we(\\\"sms\\\")&&ae(),we(\\\"push\\\")&&G(),we(\\\"email\\\")&&te(),we(\\\"chat\\\")&&ea()):an(),je(),Re(),Qt()}},na=e=>{fe.includes(e)&&(C=e,!we(e)&&(i.only=e))},wt=e=>{i.view=\\\"devices\\\",na(e.channel),i[e.channel].to=e.to,e.channel===\\\"sms\\\"&&(i.sms.thread=e.from.address),e.channel===\\\"email\\\"&&(i.email.open=e.id),e.channel===\\\"push\\\"&&(i.push.expanded=e.id,M.openGroups.add(ut(e.to,e.push?.app??\\\"App\\\"))),M.dismissed.delete(e.id),i.inspect=null,J(),a.querySelector(`.devices [data-notification-id=\\\"${CSS.escape(e.id)}\\\"]`)?.scrollIntoView({block:\\\"nearest\\\"})},nn=(e,t)=>{if(!ce())return t();e.style.height=`${e.offsetHeight}px`,e.classList.add(\\\"collapsing\\\"),e.offsetHeight,Object.assign(e.style,{height:\\\"0px\\\",marginTop:\\\"0px\\\",marginBottom:\\\"0px\\\",paddingTop:\\\"0px\\\",paddingBottom:\\\"0px\\\",opacity:\\\"0\\\"}),F(270,t)},$t=(e,t,s,c)=>{if(!ce())return c();e.classList.add(\\\"settling\\\"),t.classList.add(\\\"settling\\\"),t.style.transform=`translateX(${s*(e.offsetWidth+40)}px)`,t.style.opacity=\\\"0\\\",F(230,()=>nn(e,c))},Je=e=>a.querySelector(e),Oe=e=>e.querySelector(\\\".swipe-card\\\")??e,Xe=(e,t=-1)=>{let s=Je(`.ios-swipe[data-id=\\\"${CSS.escape(e)}\\\"]`)??Je(`.a-note[data-id=\\\"${CSS.escape(e)}\\\"]`),c=()=>{M.dismissed.add(e),i.push.preview===e&&(i.push.preview=null),G()};if(!s)return c();$t(s,Oe(s),t,c)},yt=e=>{let t=i.sms.to;if(!t)return;let s=ee(\\\"sms\\\").filter(f=>f.to===t&&f.from.address===e).map(f=>f.id),c=Je(`.thread-swipe[data-from=\\\"${CSS.escape(e)}\\\"]`),n=()=>{for(let f of s)M.dismissed.add(f);ae()};if(!c)return n();$t(c,Oe(c),-1,n)},Qe=(e,t,s=-1)=>{let c=Je(`.mrow-swipe[data-id=\\\"${CSS.escape(e)}\\\"]`);if(!c)return Xt(e,t);$t(c,Oe(c),s,()=>Xt(e,t))},N=null,Pe=!1,sn=160,ia=148,sa=(e,t)=>{let s=Oe(e);s.style.transform=t?`translateX(${t}px)`:\\\"\\\",e.dataset.swipe===\\\"a-note\\\"&&(s.style.opacity=String(1-Math.min(.9,Math.abs(t)/e.offsetWidth)))},re=(e,t,s)=>{e.classList.add(\\\"settling\\\"),e.classList.toggle(\\\"open\\\",s),e.dataset.swipe===\\\"a-note\\\"&&e.classList.add(\\\"settling\\\"),sa(e,t),F(340,()=>{e.classList.remove(\\\"settling\\\",\\\"swiping\\\"),e.dataset.offset=String(t)})},kt=e=>{let t=e.dataset.longpress,s=e.dataset.notificationId??e.dataset.id??\\\"\\\";if(t===\\\"sms-bubble\\\"){i.sms.menu=s,ae();try{navigator.vibrate?.(10)}catch{}}else t===\\\"ios-note\\\"?(i.push.preview=s,G()):t===\\\"a-note\\\"&&(i.push.settings=i.push.settings===s?null:s,G())};D(\\\"pointerdown\\\",e=>{if(ie.unlock(),Pe=!1,e.button!==0||!e.isPrimary)return;let t=e.target;if(t.closest(\\\"select, input, .swipe-actions button, .ios-overlay\\\"))return;let s=t.closest(\\\"[data-swipe]\\\"),c=t.closest(\\\"[data-longpress]\\\");if(!(!s&&!c)&&(N={pointerId:e.pointerId,x0:e.clientX,y0:e.clientY,t0:performance.now(),dx:0,axis:null,swipe:s,press:c,base:Number(s?.dataset.offset??0),timer:null},c)){let n=N;n.timer=setTimeout(()=>{N!==n||n.axis||(Pe=!0,N=null,kt(c))},480)}}),D(\\\"pointermove\\\",e=>{if(!N||e.pointerId!==N.pointerId)return;let t=qt(N.swipe??a),s=(e.clientX-N.x0)/t,c=(e.clientY-N.y0)/t;if(!N.axis){if(Math.hypot(s,c)<8)return;if(N.axis=Math.abs(s)>Math.abs(c)?\\\"x\\\":\\\"y\\\",N.timer&&clearTimeout(N.timer),N.axis===\\\"x\\\"&&N.swipe){N.swipe.classList.add(\\\"swiping\\\"),N.swipe.classList.remove(\\\"settling\\\"),Oe(N.swipe).classList.remove(\\\"settling\\\");try{N.swipe.setPointerCapture(e.pointerId)}catch{}}}if(N.axis!==\\\"x\\\"||!N.swipe)return;e.preventDefault(),N.dx=s;let n=N.swipe.dataset.swipe,f=N.base+s;if(n===\\\"sms-convo\\\"){let w=Math.max(0,Math.min(72,-s));N.swipe.style.setProperty(\\\"--reveal\\\",`${w}px`);return}n===\\\"ios-note\\\"&&f>0&&(f=f*.35),(n===\\\"mrow\\\"||n===\\\"a-note\\\")&&(f=s),sa(N.swipe,f)});let oa=e=>{if(!N||e.pointerId!==N.pointerId)return;let t=N;if(N=null,t.timer&&clearTimeout(t.timer),t.axis!==\\\"x\\\"||!t.swipe)return;Pe=!0;let s=t.swipe,c=s.dataset.swipe,n=s.offsetWidth||1,f=t.dx/Math.max(1,performance.now()-t.t0),w=t.base+t.dx;if(c===\\\"sms-convo\\\")s.classList.add(\\\"settling\\\"),s.style.setProperty(\\\"--reveal\\\",\\\"0px\\\"),F(320,()=>s.classList.remove(\\\"settling\\\"));else if(c===\\\"ios-note\\\"){let x=s.dataset.id??\\\"\\\";w<-n*.7||f<-1.1&&w<-60?Xe(x):w<-60?re(s,-sn,!0):w>70?(re(s,0,!1),i.push.expanded=x,G()):re(s,0,!1)}else if(c===\\\"a-note\\\")Math.abs(w)>n*.4||Math.abs(f)>.7?Xe(s.dataset.id??\\\"\\\",Math.sign(w)||1):re(s,0,!1);else if(c===\\\"sms-thread\\\"){let x=s.dataset.from??\\\"\\\";w<-n*.6?yt(x):w<-50?re(s,-ia,!0):w>50?re(s,ia,!0):re(s,0,!1)}else c===\\\"mrow\\\"&&(Math.abs(w)>n*.35||Math.abs(f)>.8?Qe(s.dataset.id??\\\"\\\",\\\"archived\\\",Math.sign(w)||1):re(s,0,!1))};D(\\\"pointerup\\\",oa),D(\\\"pointercancel\\\",oa),D(\\\"contextmenu\\\",e=>{let t=e.target.closest(\\\"[data-longpress]\\\");t&&(e.preventDefault(),kt(t))}),D(\\\"click\\\",e=>{Pe&&(Pe=!1,e.stopPropagation(),e.preventDefault())},!0);let ra=()=>{let e=i.sms.menu||i.push.preview||i.push.settings;return i.sms.menu=null,i.push.preview=null,i.push.settings=null,e&&(ae(),G()),!!e},la=e=>{try{navigator.clipboard?.writeText(e).catch(()=>{})}catch{}};D(\\\"click\\\",e=>{let t=e.target.closest(\\\"[data-action]\\\");if(!t)return;let s=t.closest(\\\".swipe.open\\\");if(s&&t.classList.contains(\\\"swipe-card\\\")){re(s,0,!1);return}let c=t.dataset.action,n=t.dataset.id??\\\"\\\",f=t.dataset.from??\\\"\\\",w=i.sms.to??\\\"\\\";switch(c){case\\\"view\\\":i.view=t.dataset.value===\\\"timeline\\\"?\\\"timeline\\\":\\\"devices\\\",J();break;case\\\"tab\\\":ta(t.dataset.value??\\\"all\\\");break;case\\\"chat-channel\\\":i.chat.to=t.dataset.value??null,ea();break;case\\\"sound\\\":et.setSound(!ie.enabled);break;case\\\"sms-open\\\":i.sms.thread=f||null,i.sms.transition=\\\"push\\\",ae();break;case\\\"sms-back\\\":i.sms.thread=null,i.sms.transition=\\\"back\\\",ae();break;case\\\"thread-delete\\\":yt(f);break;case\\\"thread-pin\\\":{let x=Ae(w,f);M.pinned.delete(x)||M.pinned.add(x),ae();break}case\\\"thread-mute\\\":{let x=Ae(w,f);M.muted.delete(x)||M.muted.add(x),ae();break}case\\\"thread-unread\\\":{let x=ee(\\\"sms\\\").filter(S=>S.to===w&&S.from.address===f);if(x.some(S=>!B.has(S.id)))Se(x.map(S=>S.id));else{let S=x.at(-1);S&&lt([S.id])}ae();break}case\\\"tapback\\\":{let x=t.dataset.value;M.tapbacks.get(n)===x?M.tapbacks.delete(n):M.tapbacks.set(n,x),i.sms.menu=null,ae();break}case\\\"sms-copy\\\":{let x=i.items.find(S=>S.id===n);x&&la(x.sms?.body??\\\"\\\"),i.sms.menu=null,ae();break}case\\\"sms-copy-code\\\":la(t.dataset.code??\\\"\\\");break;case\\\"close-overlay\\\":ra();break;case\\\"push-toggle\\\":{if(t.dataset.groupTop===\\\"true\\\"){let x=i.items.find(S=>S.id===n);x&&(M.openGroups.add(ut(x.to,x.push?.app??\\\"App\\\")),G());break}i.push.expanded=i.push.expanded===n?null:n,G();break}case\\\"push-clear\\\":i.push.preview=null,Xe(n);break;case\\\"push-options\\\":i.push.preview=n,G();break;case\\\"push-alerting\\\":{let x=t.dataset.app??\\\"App\\\";t.dataset.value===\\\"silent\\\"?M.silent.add(x):M.silent.delete(x),G();break}case\\\"push-clear-all\\\":{let x=[...a.querySelectorAll(\\\".shade-list .a-note\\\")],S=x.map(m=>m.dataset.id??\\\"\\\"),k=()=>{for(let m of S)M.dismissed.add(m);G()};if(!ce())return k();x.forEach((m,T)=>{F(T*60,()=>{m.classList.add(\\\"settling\\\"),m.style.transform=`translateX(${m.offsetWidth+40}px)`,m.style.opacity=\\\"0\\\"})}),F(x.length*60+300,k);break}case\\\"group-open\\\":M.openGroups.add(t.dataset.key??\\\"\\\"),G();break;case\\\"group-collapse\\\":M.openGroups.delete(t.dataset.key??\\\"\\\"),G();break;case\\\"group-clear\\\":{let x=t.dataset.app??\\\"App\\\";for(let S of ee(\\\"push\\\"))S.to===i.push.to&&(S.push?.app??\\\"App\\\")===x&&M.dismissed.add(S.id);M.openGroups.delete(t.dataset.key??\\\"\\\"),G();break}case\\\"skin\\\":i.push.skin=t.dataset.value??\\\"auto\\\",G();break;case\\\"mail-open\\\":i.email.open=n,i.email.transition=!0,he=!1,te();break;case\\\"mail-back\\\":i.email.open=null,i.email.transition=!0,te();break;case\\\"mail-details\\\":he=!he,te();break;case\\\"mail-archive\\\":Qe(n,\\\"archived\\\");break;case\\\"mail-delete\\\":Qe(n,\\\"deleted\\\");break;case\\\"mail-unread\\\":lt([n]),i.email.open=null,i.email.transition=!0,te();break;case\\\"mail-toggle-read\\\":B.has(n)?lt([n]):Se([n]),te();break;case\\\"mail-star\\\":M.starred.delete(n)||M.starred.add(n),te();break;case\\\"mail-check\\\":M.checked.delete(n)||M.checked.add(n),te();break;case\\\"toast-undo\\\":i.toast?.undo?.();break;case\\\"toast-close\\\":i.toast=null,te();break;case\\\"refresh\\\":qe().catch(()=>{});break;case\\\"inspect\\\":i.inspect=n,Re();break;case\\\"close-inspector\\\":i.inspect=null,Re();break;case\\\"show-on-device\\\":{let x=i.items.find(S=>S.id===n);x&&wt(x);break}}}),D(\\\"dblclick\\\",e=>{let t=e.target.closest(\\\"[data-notification-id]\\\");!t||t.closest(\\\"[data-region=inspector]\\\")||(i.inspect=t.dataset.notificationId??null,Re())}),D(\\\"change\\\",e=>{let t=e.target,s=t.dataset.action;if(s===\\\"namespace\\\")et.setNamespace(t.value);else if(s===\\\"follow\\\")i.follow=t.checked;else if(s===\\\"recipient\\\"){let c=t.dataset.channel;i[c].to=t.value,c===\\\"sms\\\"&&(i.sms.thread=null),c===\\\"email\\\"&&(i.email.open=null),J()}}),D(\\\"input\\\",e=>{let t=e.target;t.dataset.action===\\\"search\\\"&&(i.search=t.value,mt(),J())}),D(\\\"keydown\\\",e=>{ie.unlock();let t=e.target;if(e.key===\\\"Escape\\\"){if(ra())return;i.inspect&&(i.inspect=null,Re());return}if(!t.matches(\\\"input, select, textarea\\\")){if(t.matches('[role=\\\"tab\\\"]')){let s=La(Ct(fe,z),L(),e.key);s&&(e.preventDefault(),ta(s),aa(s)?.focus());return}if(e.key===\\\"ContextMenu\\\"||e.shiftKey&&e.key===\\\"F10\\\"){let s=t.closest(\\\"[data-longpress]\\\");s&&(e.preventDefault(),kt(s));return}if(e.key===\\\"Delete\\\"||e.key===\\\"Backspace\\\"||e.key===\\\"#\\\"||e.key===\\\"e\\\"){let s=t.dataset.id??\\\"\\\";t.matches(\\\"[data-testid=push-notification]\\\")&&e.key!==\\\"e\\\"?(e.preventDefault(),Xe(s)):t.matches(\\\"[data-testid=sms-thread]\\\")&&e.key!==\\\"e\\\"?(e.preventDefault(),yt(t.dataset.from??\\\"\\\")):t.matches(\\\"[data-testid=email-row]\\\")&&(e.preventDefault(),Qe(s,e.key===\\\"e\\\"?\\\"archived\\\":\\\"deleted\\\"));return}(e.key===\\\"Enter\\\"||e.key===\\\" \\\")&&t.matches(\\\"[role=button]:not(button)\\\")&&(e.preventDefault(),t.click())}});let da=()=>{if(q&&(i[q.channel].to=q.to,q.channel===\\\"sms\\\"&&(i.sms.thread=rt??gt(q.to)[0]?.from??null)),ue){let e=i.items.find(t=>t.id===ue);if(e)return wt(e)}J()},Tt=()=>{},on=new Promise(e=>{Tt=()=>{a.dataset.ready=\\\"true\\\",e()}}),et={render:J,state:i,ready:on,show(e){let t=e.id?i.items.find(s=>s.id===e.id):void 0;if(t)return wt(t);e.channel&&(i.view=\\\"devices\\\",na(e.channel),e.to&&(i[e.channel].to=e.to),e.channel===\\\"sms\\\"&&e.to&&(i.sms.thread=gt(e.to)[0]?.from??null,We=i.sms.thread===null?e.to:null),e.channel===\\\"email\\\"&&(i.email.open=null),J())},setNamespace(e){if(e!==i.namespace){if(i.namespace=e,i.items=[],i.sms={...i.sms,to:null,thread:null,menu:null},i.email={...i.email,to:null,open:null},i.push.to=null,i.chat.to=null,Ht(),h){let t=new URL(location.href);t.searchParams.set(\\\"namespace\\\",e),history.replaceState(null,\\\"\\\",t)}d?(Ut(),qe().catch(()=>{})):J()}},setSound(e){if(ie.enabled=e,e&&ie.unlock(),g)try{localStorage.setItem(Dt,e?\\\"1\\\":\\\"0\\\")}catch{}ve()},setScale(e){nt(e)!==b&&(b=nt(e),U(),J())},destroy(){O=!0,E.abort(),ft?.abort();for(let e of W)clearTimeout(e);W.clear();for(let e of ca)clearInterval(e);St?.disconnect(),ie.close(),a.innerHTML=\\\"\\\",a.classList.remove(at,\\\"embedded\\\"),a.style.removeProperty(\\\"--mbn-fit\\\"),a.style.removeProperty(\\\"--mbn-scale\\\")}},ca=[];U();let pa=()=>{U()&&J()},St=typeof ResizeObserver==\\\"function\\\"?new ResizeObserver(pa):null;return St?St.observe(a):typeof window<\\\"u\\\"&&window.addEventListener(\\\"resize\\\",pa,{signal:E.signal}),d?(ca.push(setInterval(()=>{N||i.sms.menu||i.push.preview||i.push.settings||(i.view===\\\"devices\\\"&&!a.querySelector(\\\".mail-frame\\\")?J():ve())},3e4),setInterval(()=>{_t()},5e3)),Ht(),J(),Ut(),_t(),(async()=>{for(let e=0;!O;e++)try{await qe(),da(),Tt();return}catch{await new Promise(t=>F(Math.min(5e3,500*2**e),()=>t(null)))}})(),et):(i.items=[...o.items??[]].sort((e,t)=>e.createdAt<t.createdAt?1:-1),i.sources=o.sources??[],i.namespaces=o.namespaces??[],i.discoveryError=o.discoveryError??null,i.connected=o.connected??!0,mt(),da(),Tt(),et)}var st=\\\"mb-dashboard\\\",vn=`\\n:root {\\n --mbd-bar: #12151b; --mbd-line: #2a2f3a; --mbd-text: #e8eaf0; --mbd-muted: #9aa1b1;\\n --mbd-accent: #0a84ff; --mbd-hover: rgba(255,255,255,.07); --mbd-panel: #0e1015; --mbd-ok: #30d158;\\n}\\n&[data-theme=\\\"light\\\"] {\\n --mbd-bar: #ffffff; --mbd-line: #e4e8ee; --mbd-text: #172033; --mbd-muted: #667085;\\n --mbd-accent: #2563d8; --mbd-hover: rgba(16,24,40,.06); --mbd-panel: #f5f7fa; --mbd-ok: #1f9d55;\\n}\\n@media (prefers-color-scheme: light) {\\n &[data-theme=\\\"auto\\\"] {\\n --mbd-bar: #ffffff; --mbd-line: #e4e8ee; --mbd-text: #172033; --mbd-muted: #667085;\\n --mbd-accent: #2563d8; --mbd-hover: rgba(16,24,40,.06); --mbd-panel: #f5f7fa; --mbd-ok: #1f9d55;\\n }\\n}\\n:root { display: flex; flex-direction: column; box-sizing: border-box; height: 100%; min-height: 0; overflow: hidden;\\n background: var(--mbd-panel); color: var(--mbd-text);\\n font: 14px/1.4 system-ui, -apple-system, \\\"Segoe UI\\\", Roboto, sans-serif; -webkit-tap-highlight-color: transparent; }\\n.mbd-bar, .mbd-bar *, .mbd-panels, .mbd-panel { box-sizing: border-box; }\\n.mbd-bar { flex: none; display: flex; align-items: stretch; gap: 18px; height: 46px; padding: 0 16px;\\n background: var(--mbd-bar); border-bottom: 1px solid var(--mbd-line); }\\n.mbd-brand { display: flex; align-items: center; gap: 9px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; }\\n.mbd-mark { width: 24px; height: 24px; border-radius: 7px; background: linear-gradient(135deg,#0a84ff,#5e5ce6); flex: none;\\n display: grid; place-items: center; color: #fff; font-size: 13px; line-height: 1; }\\n.mbd-tabs { display: flex; align-items: stretch; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }\\n.mbd-tabs::-webkit-scrollbar { display: none; }\\n.mbd-tab { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 0 13px; margin: 0; border: 0;\\n background: none; color: var(--mbd-muted); font: inherit; font-weight: 560; white-space: nowrap; cursor: pointer; border-radius: 0; }\\n.mbd-tab::after { content: \\\"\\\"; position: absolute; left: 9px; right: 9px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: transparent; }\\n.mbd-tab:hover { color: var(--mbd-text); background: var(--mbd-hover); }\\n.mbd-tab[aria-selected=\\\"true\\\"] { color: var(--mbd-text); }\\n.mbd-tab[aria-selected=\\\"true\\\"]::after { background: var(--mbd-accent); }\\n.mbd-tab:focus-visible { outline: 2px solid var(--mbd-accent); outline-offset: -3px; border-radius: 7px; }\\n.mbd-badge { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--mbd-accent); color: #fff;\\n font-size: 11px; font-weight: 650; line-height: 18px; text-align: center; }\\n.mbd-badge[hidden] { display: none; }\\n.mbd-aside { display: flex; align-items: center; gap: 12px; margin-left: auto; min-width: 0; color: var(--mbd-muted); font-size: 12.5px; white-space: nowrap; }\\n.mbd-aside:empty { display: none; }\\n.mbd-aside a { color: var(--mbd-accent); text-decoration: none; font-weight: 560; }\\n.mbd-aside a:hover { text-decoration: underline; }\\n.mbd-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid var(--mbd-line); border-radius: 999px; }\\n.mbd-pill b { color: var(--mbd-text); font-weight: 600; }\\n.mbd-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mbd-ok); }\\n.mbd-panels { flex: 1; min-height: 0; position: relative; }\\n.mbd-panel { height: 100%; overflow: auto; }\\n.mbd-panel[hidden] { display: none; }\\n.mbd-fill { height: 100%; }\\n.mbd-status { padding: 48px; color: var(--mbd-muted); }\\n.mbd-status[data-kind=\\\"error\\\"] { color: #ff6b61; }\\n@media (max-width: 640px) {\\n .mbd-bar { gap: 8px; height: 42px; padding: 0 8px; }\\n .mbd-brand span { display: none; }\\n .mbd-tabs { flex: 1; }\\n .mbd-tab { flex: 1 0 auto; justify-content: center; padding: 0 10px; font-size: 13px; }\\n .mbd-aside .mbd-pill { display: none; }\\n}\\n`,za=Ue(vn,`.${st}`);var zt=(a,o,d)=>{let h=a.getRootNode(),g=h instanceof ShadowRoot?h:document.head;if(g.querySelector(`#${o}`))return;let v=document.createElement(\\\"style\\\");v.id=o,v.textContent=d,g.append(v)},Ea=(a,o={})=>{let{harness:d,injectStyles:h=!0,...g}=o;return h&&zt(a,\\\"mockingbird-notifications-styles\\\",ka),d&&(g.fetch=v=>d.fetch(v)),it(a,{embedded:!0,syncUrl:!1,...g})};var wn=\\\"emulators\\\",me=\\\"notifications\\\",Q=(a,o,d={})=>{let h=document.createElement(a);h.className=o;for(let[g,v]of Object.entries(d))h.setAttribute(g,v);return h},$n=0,yn=(a,o,d)=>{let h=`mbd-${++$n}`,g=[...o.tabs??[],...o.emulators?[{id:wn,label:o.emulators.label??\\\"Emulators\\\",mount:o.emulators.mount}]:[],...o.notifications?[{id:me,label:o.notifications.label??\\\"Notifications\\\",mount:null}]:[]];if(g.length===0)throw new Error(\\\"mountDashboard: pass tabs, emulators or notifications\\\");let v=new Set;for(let b of g){if(v.has(b.id))throw new Error(`mountDashboard: duplicate tab id ${b.id}`);v.add(b.id)}(o.injectStyles??!0)&&zt(a,\\\"mockingbird-dashboard-styles\\\",za),a.classList.add(st),a.setAttribute(\\\"data-testid\\\",l.dashboard),a.setAttribute(\\\"data-theme\\\",o.theme??\\\"dark\\\"),a.replaceChildren();let $=Q(\\\"header\\\",\\\"mbd-bar\\\");if(o.title){let b=Q(\\\"div\\\",\\\"mbd-brand\\\"),z=Q(\\\"i\\\",\\\"mbd-mark\\\",{\\\"aria-hidden\\\":\\\"true\\\"});z.textContent=\\\"\\\\u25C6\\\";let C=Q(\\\"span\\\",\\\"\\\");C.textContent=o.title,b.append(z,C),$.append(b)}let H=Q(\\\"div\\\",\\\"mbd-tabs\\\",{role:\\\"tablist\\\",\\\"aria-label\\\":o.title??\\\"Dashboard\\\"}),y=Q(\\\"div\\\",\\\"mbd-aside\\\"),E=Q(\\\"div\\\",\\\"mbd-panels\\\");$.append(H,y),a.append($,E);let D=Q(\\\"span\\\",\\\"mbd-badge\\\",{\\\"data-testid\\\":l.dashboardBadge});D.hidden=!0;let W=0,F=()=>{D.hidden=W===0,D.textContent=W>99?\\\"99+\\\":String(W),D.setAttribute(\\\"data-count\\\",String(W)),D.setAttribute(\\\"aria-label\\\",`${W} new`)};F();let O=g.map(b=>{let z=Q(\\\"button\\\",\\\"mbd-tab\\\",{type:\\\"button\\\",role:\\\"tab\\\",id:`${h}-tab-${b.id}`,\\\"aria-controls\\\":`${h}-panel-${b.id}`,\\\"aria-selected\\\":\\\"false\\\",tabindex:\\\"-1\\\",\\\"data-testid\\\":l.dashboardTab,\\\"data-tab\\\":b.id}),C=Q(\\\"span\\\",\\\"\\\");C.textContent=b.label,z.append(C),b.id===me&&z.append(D);let L=Q(\\\"section\\\",\\\"mbd-panel\\\",{role:\\\"tabpanel\\\",id:`${h}-panel-${b.id}`,\\\"aria-labelledby\\\":`${h}-tab-${b.id}`,\\\"data-testid\\\":l.dashboardPanel,\\\"data-tab\\\":b.id});return L.hidden=!0,H.append(z),E.append(L),{id:b.id,button:z,panel:L,mount:b.mount,mounted:!1,dispose:null}}),V=!1,ne=\\\"\\\",_=(b,z,C)=>{let L=Q(\\\"div\\\",\\\"mbd-status\\\",{\\\"data-kind\\\":z});return L.textContent=C,b.panel.append(L),L},i=b=>{if(b.mounted||!b.mount)return;b.mounted=!0;let z=C=>{if(typeof C!=\\\"function\\\")return;let L=C;V?L():b.dispose=L};try{let C=b.mount(b.panel);if(!(C instanceof Promise))return z(C);b.panel.setAttribute(\\\"aria-busy\\\",\\\"true\\\");let L=_(b,\\\"loading\\\",\\\"Loading\\\\u2026\\\");C.then(U=>{L.remove(),b.panel.removeAttribute(\\\"aria-busy\\\"),z(U)},U=>{L.remove(),b.panel.removeAttribute(\\\"aria-busy\\\"),V||_(b,\\\"error\\\",U instanceof Error?U.message:String(U))})}catch(C){_(b,\\\"error\\\",C instanceof Error?C.message:String(C))}},M=b=>{let z=O.find(L=>L.id===b);if(!z||V||b===ne)return;let C=ne===\\\"\\\";ne=b,a.setAttribute(\\\"data-tab\\\",b);for(let L of O){let U=L===z;L.button.setAttribute(\\\"aria-selected\\\",String(U)),L.button.setAttribute(\\\"tabindex\\\",U?\\\"0\\\":\\\"-1\\\"),L.panel.hidden=!U}if(b===me&&(W=0,F()),i(z),o.syncUrl&&typeof location<\\\"u\\\"&&typeof history<\\\"u\\\"){let L=new URL(location.href);L.searchParams.get(\\\"tab\\\")!==b&&!(C&&!L.searchParams.has(\\\"tab\\\"))&&(L.searchParams.set(\\\"tab\\\",b),history.replaceState(history.state,\\\"\\\",L))}C||o.onTabChange?.(b)},he=b=>()=>M(b.id),Be=b=>z=>{let C=z.key,L=O.indexOf(b),U=C===\\\"ArrowRight\\\"?(L+1)%O.length:C===\\\"ArrowLeft\\\"?(L-1+O.length)%O.length:C===\\\"Home\\\"?0:C===\\\"End\\\"?O.length-1:-1,De=O[U];De&&(z.preventDefault(),M(De.id),De.button.focus())},rt=O.map(b=>{let z=he(b),C=Be(b);return b.button.addEventListener(\\\"click\\\",z),b.button.addEventListener(\\\"keydown\\\",C),()=>{b.button.removeEventListener(\\\"click\\\",z),b.button.removeEventListener(\\\"keydown\\\",C)}}),ue,q=O.find(b=>b.id===me);if(o.notifications&&q){let{label:b,onArrive:z,...C}=o.notifications;q.mounted=!0;let L=Q(\\\"div\\\",\\\"mbd-fill\\\");q.panel.append(L),ue=d(L,{...C,onArrive(U){ne!==me&&(W+=U.length,F()),z?.(U)}})}let Ee=[o.syncUrl&&typeof location<\\\"u\\\"?new URL(location.href).searchParams.get(\\\"tab\\\"):null,o.initialTab].find(b=>b!=null&&O.some(z=>z.id===b));return M(Ee??O[0].id),{show:M,active:()=>ne,tabs:()=>O.map(b=>b.id),aside:y,...ue?{notifications:ue}:{},destroy(){if(!V){V=!0;for(let b of rt)b();ue?.destroy();for(let b of O){try{b.dispose?.()}catch{}b.dispose=null}a.replaceChildren(),a.classList.remove(st);for(let b of[\\\"data-testid\\\",\\\"data-theme\\\",\\\"data-tab\\\"])a.removeAttribute(b)}}}},Da=(a,o)=>yn(a,o,Ea);var ot=document.getElementById(\\\"app\\\"),kn=async()=>{try{let a=await fetch(new URL(\\\"api/admin\\\",location.href));return a.ok?await a.json():null}catch{return null}},Tn=(a,o)=>new Promise((d,h)=>{let g=document.createElement(\\\"div\\\");g.style.cssText=\\\"height:100%;color-scheme:light dark\\\";let v=document.createElement(\\\"main\\\");v.id=\\\"admin-root\\\",v.setAttribute(\\\"data-mockingbird-admin\\\",\\\"\\\"),v.style.cssText=\\\"display:block;height:100%;overflow:auto\\\",g.attachShadow({mode:\\\"open\\\"}).append(v),a.append(g);let $=document.createElement(\\\"script\\\");$.src=new URL(\\\"admin/ui.js\\\",location.href).href,$.onload=()=>{let H=globalThis.MockingbirdAdmin;if(!H)return h(new Error(\\\"The admin UI did not load.\\\"));let y=H.mount(v,o);d(()=>{typeof y==\\\"function\\\"?y():document.dispatchEvent(new Event(\\\"mockingbird:unmount\\\")),g.remove()})},$.onerror=()=>h(new Error(\\\"The admin UI could not be loaded.\\\")),document.head.append($)}),Sn=async()=>{let a=await kn();if(!a?.admin){it(ot,{live:!0});return}let o=new URLSearchParams(location.search),d=[\\\"view\\\",\\\"to\\\",\\\"from\\\",\\\"id\\\"].some(y=>o.has(y));document.documentElement.classList.add(\\\"mbd-page\\\");let h=a.admin,g=Da(ot,{title:ot.dataset.title??\\\"Mockingbird\\\",syncUrl:!0,injectStyles:!1,initialTab:d?me:ot.dataset.defaultTab??me,emulators:{mount:y=>Tn(y,h)},notifications:{syncUrl:!0,baseUrl:location.href,injectStyles:!1}}),v=document.createElement(\\\"span\\\");v.className=\\\"mbd-pill\\\";let $=document.createElement(\\\"i\\\");$.className=\\\"mbd-dot\\\";let H=document.createElement(\\\"b\\\");if(H.textContent=String(a.emulators.length),v.append($,H,` emulator${a.emulators.length===1?\\\"\\\":\\\"s\\\"}`),g.aside.append(v),a.fleet){let y=document.createElement(\\\"a\\\");y.href=a.fleet.consoleUrl,y.target=\\\"_blank\\\",y.rel=\\\"noopener noreferrer\\\",y.textContent=\\\"Fleet console \\\\u2197\\\",g.aside.append(y)}};Sn();\\n\"\n", "/**\n * One reader per emulator. Each turns that emulator's admin outbox (or stored state) into\n * notifications as the recipient would see them. Readers only GET admin routes, so they never\n * change emulator state.\n */\nimport { addressList, decodeRawMessage, parseMime } from \"./mime.js\"\nimport type {\n Address,\n Channel,\n ChatContent,\n EmailContent,\n Notification,\n PushContent,\n PushPlatform,\n ServiceKind,\n SmsContent,\n} from \"./model.js\"\n\n/** GET an admin path (relative to the emulator's admin prefix) in the reader's namespace. */\nexport type AdminRead = (path: string) => Promise<unknown>\n\nexport type ReadContext = { source: string; namespace: string; read: AdminRead }\n\nexport type Reader = (context: ReadContext) => Promise<Notification[]>\n\ntype Row = Record<string, unknown>\n\nconst isRow = (value: unknown): value is Row =>\n typeof value === \"object\" && value !== null && !Array.isArray(value)\nconst row = (value: unknown): Row => (isRow(value) ? value : {})\nconst str = (value: unknown): string | null =>\n typeof value === \"string\" ? value : typeof value === \"number\" ? String(value) : null\nconst strings = (value: unknown): string[] =>\n Array.isArray(value)\n ? value.map(str).filter((v): v is string => v !== null && v !== \"\")\n : typeof value === \"string\" && value !== \"\"\n ? [value]\n : []\nconst list = (value: unknown, key: string): Row[] => {\n const items = isRow(value) ? value[key] : value\n return Array.isArray(items) ? items.filter(isRow) : []\n}\nconst iso = (value: unknown): string => {\n if (typeof value === \"number\") return new Date(value < 1e11 ? value * 1000 : value).toISOString()\n if (typeof value === \"string\" && !Number.isNaN(Date.parse(value)))\n return new Date(value).toISOString()\n return new Date(0).toISOString()\n}\n\n/** `\"Acme\" <a@acme.test>` \u2192 `{ name: \"Acme\", address: \"a@acme.test\" }`. */\nexport const parseAddress = (value: string): Address => {\n const match = /^\\s*\"?([^\"<]*?)\"?\\s*<([^>]+)>\\s*$/.exec(value)\n if (match) return { name: match[1]?.trim() || null, address: (match[2] ?? \"\").trim() }\n return { name: null, address: value.trim() }\n}\n\nconst bare = (value: string): string => parseAddress(value).address.toLowerCase()\n\nconst stripHtml = (html: string): string =>\n html\n .replace(/<(style|script|head)[^>]*>[\\s\\S]*?<\\/\\1>/gi, \" \")\n .replace(/<br\\s*\\/?>/gi, \"\\n\")\n .replace(/<[^>]+>/g, \" \")\n .replace(/&nbsp;/g, \" \")\n .replace(/&amp;/g, \"&\")\n .replace(/&lt;/g, \"<\")\n .replace(/&gt;/g, \">\")\n .replace(/&quot;/g, '\"')\n .replace(/&#39;/g, \"'\")\n .replace(/[ \\t]+/g, \" \")\n .replace(/\\s*\\n\\s*/g, \"\\n\")\n .trim()\n\nconst preview = (text: string): string => text.replace(/\\s+/g, \" \").trim().slice(0, 240)\n\ntype Base = {\n context: ReadContext\n service: ServiceKind\n providerId: string\n to: string\n from: Address\n createdAt: string\n status?: string | null\n raw: unknown\n}\n\nconst base = (input: Base, channel: Channel) => ({\n id: `${input.context.source}:${input.context.namespace}:${input.providerId}${\n channel === \"email\" ? `#${input.to.toLowerCase()}` : \"\"\n }`,\n providerId: input.providerId,\n channel,\n source: input.context.source,\n service: input.service,\n namespace: input.context.namespace,\n to: input.to,\n from: input.from,\n createdAt: input.createdAt,\n status: input.status ?? null,\n raw: input.raw,\n})\n\nconst smsNotification = (\n input: Base,\n sms: Partial<SmsContent> & { body: string },\n): Notification => ({\n ...base(input, \"sms\"),\n preview: preview(sms.body),\n sms: {\n body: sms.body,\n code: sms.code ?? null,\n media: sms.media ?? [],\n ...(sms.via === \"whatsapp\" ? { via: sms.via } : {}),\n },\n email: null,\n push: null,\n chat: null,\n})\n\n/** One notification per mailbox: every `to`, `cc` and `bcc` recipient gets its own copy. */\nconst emailNotifications = (\n input: Omit<Base, \"to\">,\n recipients: string[],\n email: Partial<EmailContent> & { subject: string },\n): Notification[] => {\n const content: EmailContent = {\n subject: email.subject,\n html: email.html ?? null,\n text: email.text ?? null,\n cc: email.cc ?? [],\n bcc: email.bcc ?? [],\n replyTo: email.replyTo ?? [],\n attachments: email.attachments ?? [],\n headers: email.headers ?? {},\n }\n const body = content.text ?? (content.html ? stripHtml(content.html) : \"\")\n const seen = new Set<string>()\n return recipients.flatMap((recipient) => {\n const to = bare(recipient)\n if (!to || seen.has(to)) return []\n seen.add(to)\n return [\n {\n ...base({ ...input, to }, \"email\"),\n preview: preview(body),\n sms: null,\n email: content,\n push: null,\n chat: null,\n },\n ]\n })\n}\n\nconst pushNotification = (input: Base, push: PushContent): Notification => ({\n ...base(input, \"push\"),\n preview: preview([push.title, push.body].filter(Boolean).join(\" \u2014 \")),\n sms: null,\n email: null,\n push,\n chat: null,\n})\n\nconst chatNotification = (input: Base, chat: ChatContent, summary: string): Notification => ({\n ...base(input, \"chat\"),\n preview: preview(summary),\n sms: null,\n email: null,\n push: null,\n chat,\n})\n\nconst WHATSAPP = /^whatsapp:/i\n\nconst twilio: Reader = async (context) => {\n const messages = list(await context.read(\"/outbox\"), \"messages\")\n return messages.flatMap((m): Notification[] => {\n const providerId = str(m.id) ?? str(m.sid) ?? \"\"\n const body = str(m.body) ?? \"\"\n const recipient = str(m.to) ?? \"\"\n const verify = m.kind === \"verify\"\n // WhatsApp rides Twilio's messaging API with `whatsapp:` channel addresses (and Verify's\n // `whatsapp` channel). The recipient is still a phone, so `to` drops the prefix; the sender\n // keeps it, which is what separates the WhatsApp chat from the same number's text thread.\n const whatsapp =\n m.channel === \"whatsapp\" || WHATSAPP.test(recipient) || WHATSAPP.test(str(m.from) ?? \"\")\n const to = recipient.replace(WHATSAPP, \"\")\n const origin = str(m.from) ?? str(m.messagingServiceSid) ?? (verify ? \"Verify\" : \"Twilio\")\n const sender = whatsapp ? `whatsapp:${origin.replace(WHATSAPP, \"\")}` : origin\n const common = {\n context,\n service: \"twilio\" as const,\n providerId,\n from: { name: verify && !m.from ? \"Verify\" : null, address: sender },\n createdAt: iso(m.createdAt),\n status: str(m.status),\n raw: m,\n }\n if (m.channel === \"email\")\n return emailNotifications(common, [to], {\n subject: \"Your verification code\",\n text: body,\n })\n return [\n smsNotification(\n { ...common, to },\n {\n body,\n code: str(m.code),\n media: strings(m.mediaUrls),\n ...(whatsapp ? { via: \"whatsapp\" as const } : {}),\n },\n ),\n ]\n })\n}\n\nconst resend: Reader = async (context) =>\n list(await context.read(\"/outbox\"), \"messages\").flatMap((m) => {\n const cc = strings(m.cc)\n const bcc = strings(m.bcc)\n return emailNotifications(\n {\n context,\n service: \"resend\",\n providerId: str(m.id) ?? \"\",\n from: parseAddress(str(m.from) ?? \"\"),\n createdAt: iso(m.createdAt),\n status: m.scheduledAt ? \"scheduled\" : \"delivered\",\n raw: m,\n },\n [...strings(m.to), ...cc, ...bcc],\n {\n subject: str(m.subject) ?? \"\",\n html: str(m.html),\n text: str(m.text),\n cc,\n bcc,\n replyTo: strings(m.replyTo),\n headers: Object.fromEntries(Object.entries(row(m.headers)).map(([k, v]) => [k, String(v)])),\n attachments: list(m.attachments, \"\").map((a) => ({\n filename: str(a.filename) ?? \"attachment\",\n contentType: str(a.contentType),\n size: typeof a.size === \"number\" ? a.size : null,\n })),\n },\n )\n })\n\nconst platformOf = (value: unknown): PushPlatform =>\n value === \"android\" || value === \"ios\" || value === \"web\" ? value : \"unknown\"\n\nconst fcm: Reader = async (context) =>\n list(await context.read(\"/outbox\"), \"messages\").map((m) => {\n const wire = row(m.wire)\n const notification = row(m.notification ?? wire.notification)\n const android = row(row(m.android ?? wire.android).notification)\n const aps = row(row(row(m.apns ?? wire.apns).payload).aps)\n const alert = isRow(aps.alert) ? aps.alert : { body: aps.alert }\n const webpush = row(row(wire.webpush).notification)\n const platform = platformOf(m.platform)\n const pick = (key: \"title\" | \"body\") =>\n (platform === \"android\" ? str(android[key]) : null) ??\n (platform === \"ios\" ? str(alert[key]) : null) ??\n (platform === \"web\" ? str(webpush[key]) : null) ??\n str(notification[key])\n const image =\n (platform === \"android\" ? str(android.image) : null) ??\n str(row(row(m.apns ?? wire.apns).fcm_options).image) ??\n str(notification.image)\n const project = str(m.project) ?? \"app\"\n return pushNotification(\n {\n context,\n service: \"fcm\",\n providerId: str(m.id) ?? str(m.name) ?? \"\",\n to: str(m.token) ?? \"\",\n from: { name: project, address: str(m.name) ?? project },\n createdAt: iso(m.acceptedAt),\n status: str(m.state),\n raw: m,\n },\n {\n title: pick(\"title\"),\n body: pick(\"body\"),\n imageUrl: image,\n app: project,\n platform,\n data: Object.fromEntries(\n Object.entries(row(m.data ?? wire.data)).map(([k, v]) => [k, String(v)]),\n ),\n badge: typeof aps.badge === \"number\" ? aps.badge : null,\n sound: str(aps.sound) ?? str(android.sound),\n },\n )\n })\n\n/** Every record of a shared-runtime state collection, following `next` cursors. */\nconst stateRecords = async (read: AdminRead, collection: string): Promise<Row[]> => {\n const out: Row[] = []\n let after: unknown = null\n for (let page = 0; page < 100; page++) {\n const query = after === null ? \"\" : `&after=${encodeURIComponent(String(after))}`\n const result = row(await read(`/state/${collection}?limit=200&order=oldest${query}`))\n for (const record of list(result, \"records\")) out.push(record)\n if (result.next === null || result.next === undefined) break\n after = result.next\n }\n return out\n}\n\nconst ses: Reader = async (context) =>\n (await stateRecords(context.read, \"ses_messages\")).flatMap((record) => {\n const v = row(record.value)\n const destination = row(v.Destination)\n const common = {\n context,\n service: \"ses\" as const,\n providerId: str(v.MessageId) ?? str(record.id) ?? \"\",\n createdAt: iso(v.Timestamp),\n status: \"delivered\",\n raw: v,\n }\n const raw = row(v.RawMessage)\n if (raw.Data !== undefined) {\n const mime = parseMime(decodeRawMessage(str(raw.Data) ?? \"\"))\n const recipients = strings(v.Destinations)\n return emailNotifications(\n { ...common, from: parseAddress(str(v.Source) ?? mime.from ?? \"\") },\n recipients.length ? recipients : [...mime.to, ...mime.cc],\n {\n subject: mime.subject,\n html: mime.html,\n text: mime.text,\n cc: mime.cc,\n attachments: mime.attachments,\n headers: mime.headers,\n replyTo: addressList(mime.headers[\"reply-to\"]),\n },\n )\n }\n const message = row(v.Message)\n const body = row(message.Body)\n const cc = strings(destination.CcAddresses)\n const bcc = strings(destination.BccAddresses)\n return emailNotifications(\n { ...common, from: parseAddress(str(v.Source) ?? \"\") },\n [...strings(destination.ToAddresses), ...cc, ...bcc],\n {\n subject: str(row(message.Subject).Data) ?? \"\",\n html: str(row(body.Html).Data),\n text: str(row(body.Text).Data),\n cc,\n bcc,\n replyTo: strings(v.ReplyToAddresses),\n },\n )\n })\n\n/** SNS `MessageStructure: \"json\"` carries one body per protocol, with `default` as fallback. */\nconst snsBody = (v: Row, protocol: string): string => {\n const message = str(v.Message) ?? \"\"\n if (v.MessageStructure !== \"json\") return message\n try {\n const parsed = row(JSON.parse(message))\n return str(parsed[protocol]) ?? str(parsed.default) ?? message\n } catch {\n return message\n }\n}\n\nconst sns: Reader = async (context) => {\n const [messages, subscriptions] = await Promise.all([\n stateRecords(context.read, \"sns_messages\"),\n stateRecords(context.read, \"sns_subscriptions\"),\n ])\n return messages.flatMap((record): Notification[] => {\n const v = row(record.value)\n const providerId = str(v.MessageId) ?? str(record.id) ?? \"\"\n const common = { context, service: \"sns\" as const, createdAt: iso(v.Timestamp), raw: v }\n const phone = str(v.PhoneNumber)\n if (phone)\n return [\n smsNotification(\n {\n ...common,\n providerId,\n to: phone,\n from: { name: null, address: \"SNS\" },\n status: \"delivered\",\n },\n { body: snsBody(v, \"sms\") },\n ),\n ]\n const topicArn = str(v.TopicArn) ?? \"\"\n const topicName = topicArn.split(\":\").at(-1) ?? \"SNS\"\n return subscriptions.flatMap((sub): Notification[] => {\n const s = row(sub.value)\n if (s.TopicArn !== topicArn) return []\n const endpoint = str(s.Endpoint) ?? \"\"\n const subId = `${providerId}@${str(s.SubscriptionArn) ?? endpoint}`\n if (s.Protocol === \"sms\")\n return [\n smsNotification(\n {\n ...common,\n providerId: subId,\n to: endpoint,\n from: { name: topicName, address: topicName },\n status: \"delivered\",\n },\n { body: snsBody(v, \"sms\") },\n ),\n ]\n if (s.Protocol === \"email\" || s.Protocol === \"email-json\") {\n const text =\n s.Protocol === \"email-json\"\n ? JSON.stringify(\n {\n Type: \"Notification\",\n MessageId: providerId,\n TopicArn: topicArn,\n Subject: v.Subject ?? null,\n Message: snsBody(v, \"email-json\"),\n },\n null,\n 2,\n )\n : `${snsBody(v, \"email\")}\\n\\n--\\nIf you wish to stop receiving notifications from this topic, please unsubscribe.\\n\\nPlease do not reply directly to this email. If you have any questions or comments regarding this email, please contact us at https://aws.amazon.com/support`\n return emailNotifications(\n {\n ...common,\n providerId: subId,\n from: { name: \"AWS Notifications\", address: \"no-reply@sns.amazonaws.com\" },\n status: \"delivered\",\n },\n [endpoint],\n { subject: str(v.Subject) ?? \"AWS Notification Message\", text },\n )\n }\n return []\n })\n })\n}\n\nconst escapeHtml = (value: string): string =>\n value.replace(/[&<>\"']/g, (c) => `&#${c.charCodeAt(0)};`)\n\n/** Customer.io renders the template server side; the emulator keeps its id and data. */\nconst templatePreview = (m: Row): string => {\n const data = Object.entries(row(m.messageData))\n const rows = data\n .map(\n ([k, v]) =>\n `<tr><td style=\"padding:6px 12px;color:#6b7280;font:13px system-ui\">${escapeHtml(k)}</td><td style=\"padding:6px 12px;font:13px ui-monospace,monospace\">${escapeHtml(typeof v === \"string\" ? v : JSON.stringify(v))}</td></tr>`,\n )\n .join(\"\")\n const links = strings(m.links)\n .map(\n (href) =>\n `<p style=\"font:13px system-ui\"><a href=\"${escapeHtml(href)}\">${escapeHtml(href)}</a></p>`,\n )\n .join(\"\")\n return `<div style=\"font:14px system-ui;color:#111827;padding:8px\"><p style=\"margin:0 0 4px;color:#6b7280;font-size:12px\">Customer.io transactional message <b>${escapeHtml(str(m.transactionalMessageId) ?? \"\")}</b></p><p style=\"margin:0 0 12px;color:#6b7280;font-size:12px\">The template body is rendered by Customer.io; these are the <code>message_data</code> values it was sent with.</p>${rows ? `<table style=\"border-collapse:collapse;border:1px solid #e5e7eb;border-radius:8px\">${rows}</table>` : \"<p><i>No message_data.</i></p>\"}${links}</div>`\n}\n\nconst customerio: Reader = async (context) =>\n list(await context.read(\"/outbox\"), \"messages\").flatMap((m): Notification[] => {\n const identifiers = row(m.identifiers)\n const to = str(m.to) ?? str(identifiers.email) ?? str(identifiers.id) ?? \"\"\n const state = str(m.state)\n const common = {\n context,\n service: \"customerio\" as const,\n providerId: str(m.id) ?? \"\",\n createdAt: iso(m.createdAt),\n status: state,\n raw: m,\n }\n const templateId = str(m.transactionalMessageId) ?? \"message\"\n if (m.channel === \"sms\") {\n const data = row(m.messageData)\n const body =\n str(data.body) ??\n str(data.message) ??\n str(data.text) ??\n `[${templateId}] ${Object.entries(data)\n .map(([k, v]) => `${k}: ${typeof v === \"string\" ? v : JSON.stringify(v)}`)\n .join(\", \")}`.trim()\n return [\n smsNotification(\n { ...common, to, from: { name: null, address: str(m.from) ?? \"Customer.io\" } },\n { body },\n ),\n ]\n }\n if (m.channel === \"email\")\n return emailNotifications(\n { ...common, from: parseAddress(str(m.from) ?? \"Customer.io <no-reply@customer.io>\") },\n [to],\n {\n subject: str(m.subject) ?? `Transactional message ${templateId}`,\n html: templatePreview(m),\n attachments: strings(m.attachments).map((filename) => ({\n filename,\n contentType: null,\n size: null,\n })),\n },\n )\n return []\n })\n\nconst mailosaurAddress = (value: unknown): string => {\n const a = row(value)\n return str(a.email) ?? str(a.phone) ?? str(a.phoneNumber) ?? \"\"\n}\n\nconst mailosaur: Reader = async (context) =>\n list(await context.read(\"/outbox\"), \"messages\").flatMap((entry): Notification[] => {\n const m = row(entry.message)\n const from = row(list(m.from, \"\")[0])\n const recipients = list(m.to, \"\").map(mailosaurAddress).filter(Boolean)\n const common = {\n context,\n service: \"mailosaur\" as const,\n providerId: str(entry.id) ?? str(m.id) ?? \"\",\n createdAt: iso(m.received ?? entry.createdAt),\n status: \"received\",\n raw: entry,\n }\n const html = str(row(m.html).body)\n const text = str(row(m.text).body)\n if (m.type === \"SMS\")\n return recipients.map((to) =>\n smsNotification(\n {\n ...common,\n to,\n from: { name: str(from.name) || null, address: mailosaurAddress(from) },\n },\n { body: text ?? (html ? stripHtml(html) : \"\") },\n ),\n )\n return emailNotifications(\n { ...common, from: { name: str(from.name) || null, address: mailosaurAddress(from) } },\n [...recipients, ...list(m.cc, \"\").map(mailosaurAddress)],\n {\n subject: str(m.subject) ?? \"\",\n html,\n text,\n cc: list(m.cc, \"\").map(mailosaurAddress),\n attachments: list(m.attachments, \"\").map((a) => ({\n filename: str(a.fileName) ?? str(a.filename) ?? \"attachment\",\n contentType: str(a.contentType),\n size: typeof a.length === \"number\" ? a.length : null,\n })),\n },\n )\n })\n\n/** Slack mrkdwn as the plain text a notification preview shows. */\nconst mrkdwnText = (text: string, names: Map<string, string>): string =>\n text\n .replace(/<@([A-Z0-9]+)(?:\\|([^>]*))?>/g, (_, id: string, label?: string) => {\n return `@${label || names.get(id) || id}`\n })\n .replace(/<#([A-Z0-9]+)(?:\\|([^>]*))?>/g, (_, id: string, label?: string) => {\n return `#${label || names.get(id) || id}`\n })\n .replace(/<!(here|channel|everyone)(?:\\|[^>]*)?>/g, \"@$1\")\n .replace(/<([^|>]+)\\|([^>]*)>/g, \"$2\")\n .replace(/<([^>]+)>/g, \"$1\")\n .replace(/&lt;/g, \"<\")\n .replace(/&gt;/g, \">\")\n .replace(/&amp;/g, \"&\")\n\n/** The readable text inside Block Kit blocks or attachments, in document order. */\nconst blockText = (value: unknown, out: string[] = []): string[] => {\n if (Array.isArray(value)) for (const item of value) blockText(item, out)\n if (!isRow(value)) return out\n for (const key of [\"pretext\", \"title\", \"text\", \"alt_text\", \"footer\"]) {\n const text = value[key]\n if (typeof text === \"string\" && text.trim() !== \"\") out.push(text)\n else blockText(text, out)\n }\n for (const field of list(value.fields, \"\")) {\n const pair = [str(field.title), str(field.value)].filter(Boolean).join(\": \")\n if (pair) out.push(pair)\n else blockText(field, out)\n }\n blockText(value.elements, out)\n blockText(value.blocks, out)\n return out\n}\n\n/** A read that may fail (an older emulator without the route) without failing the outbox. */\nconst optional = (read: AdminRead, path: string): Promise<unknown> => read(path).catch(() => null)\n\nconst slack: Reader = async (context) => {\n const [outbox, channelList, userList, settings] = await Promise.all([\n context.read(\"/outbox\"),\n optional(context.read, \"/channels\"),\n optional(context.read, \"/users\"),\n optional(context.read, \"/settings\"),\n ])\n const team = row(settings)\n const names = new Map<string, string>()\n const people = new Map<string, Row>()\n for (const channel of list(channelList, \"channels\"))\n if (str(channel.id) && str(channel.name))\n names.set(str(channel.id) ?? \"\", str(channel.name) ?? \"\")\n for (const user of list(userList, \"users\")) {\n const id = str(user.id) ?? \"\"\n people.set(id, user)\n names.set(id, str(user.name) ?? id)\n }\n const bot = str(team.botUserId)\n return list(outbox, \"messages\").map((m): Notification => {\n const webhook = str(m.webhook)\n const channel = str(m.channel) ?? webhook ?? \"\"\n const name = strings(m.to).find((entry) => entry.startsWith(\"#\")) ?? names.get(channel)\n const ephemeral = m.ephemeral === true\n // An ephemeral message records the member it was shown to as `user`; the bot still wrote it.\n const author = webhook ? null : ephemeral ? bot : (str(m.user) ?? bot)\n const person = row(author ? people.get(author) : null)\n const text = str(m.text) ?? \"\"\n const blocks = Array.isArray(m.blocks) ? m.blocks : []\n const attachments = Array.isArray(m.attachments) ? m.attachments : []\n const summary = text || [...blockText(blocks), ...blockText(attachments)].join(\" \")\n // Only the ids this message mentions, so a client can draw `<@U\u2026>` as a name.\n const body = JSON.stringify([text, blocks, attachments])\n const mentioned = Object.fromEntries([...names].filter(([id]) => id && body.includes(id)))\n return chatNotification(\n {\n context,\n service: \"slack\",\n providerId: str(m.id) ?? `${channel}:${str(m.ts) ?? \"\"}`,\n to: webhook ?? (name ? `#${name.replace(/^#/, \"\")}` : channel),\n from: webhook\n ? { name: \"Incoming Webhook\", address: \"incoming-webhook\" }\n : {\n name: str(person.real_name) ?? str(person.name) ?? null,\n address: author ?? \"bot\",\n },\n createdAt: iso(m.createdAt),\n status: ephemeral ? \"ephemeral\" : null,\n raw: m,\n },\n {\n text,\n workspace: str(team.teamName) ?? str(m.workspace),\n method: str(m.method) ?? (webhook ? \"incoming-webhook\" : \"chat.postMessage\"),\n blocks,\n attachments,\n threadTs: str(m.thread_ts),\n ephemeral,\n edited: isRow(m.edited),\n reactions: list(m.reactions, \"\").map((reaction) => ({\n name: str(reaction.name) ?? \"\",\n count: typeof reaction.count === \"number\" ? reaction.count : 1,\n })),\n names: mentioned,\n },\n mrkdwnText(summary, names),\n )\n })\n}\n\nexport const READERS: Record<ServiceKind, Reader> = {\n twilio,\n resend,\n fcm,\n ses,\n sns,\n customerio,\n mailosaur,\n slack,\n}\n", "import { DASHBOARD_PAGE_STYLES, DASHBOARD_STYLES } from \"./dashboard-styles.js\"\nimport { PAGE_STYLES, STYLES } from \"./styles.js\"\n\nconst escapeHtml = (value: string) => value.replace(/[&<>\"']/g, (c) => `&#${c.charCodeAt(0)};`)\n\n/**\n * The harness shell. Everything inside `#app` is drawn by `/ui.js`: the dashboard (Emulators and\n * Notifications tabs) when the harness fronts emulator admin APIs, else the notifications UI alone.\n */\nexport const renderPage = ({\n title,\n defaultTab = \"notifications\",\n}: {\n title: string\n defaultTab?: \"emulators\" | \"notifications\"\n}): string => `<!doctype html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<meta name=\"color-scheme\" content=\"dark\">\n<title>${escapeHtml(title)} \u00B7 Mockingbird</title>\n<link rel=\"icon\" href=\"data:image/svg+xml,${encodeURIComponent(\n '<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 32 32\"><rect width=\"32\" height=\"32\" rx=\"8\" fill=\"#0a84ff\"/><path d=\"M9 13a7 7 0 0 1 14 0v5l2 3H7l2-3z\" fill=\"#fff\"/><circle cx=\"16\" cy=\"24.5\" r=\"2.5\" fill=\"#fff\"/></svg>',\n)}\">\n<style>${PAGE_STYLES}${DASHBOARD_PAGE_STYLES}${STYLES}${DASHBOARD_STYLES}</style>\n</head>\n<body>\n<div id=\"app\" data-title=\"${escapeHtml(title)}\" data-default-tab=\"${defaultTab}\"><div class=\"boot\">Loading notifications\u2026</div></div>\n<script type=\"module\" src=\"./ui.js\"></script>\n</body>\n</html>`\n", "import {\n type AdminTarget,\n adminTargetsFromManifest,\n adminTargetsFromServices,\n asServiceKind,\n discoverFleet,\n type Endpoint,\n endpointsFromManifest,\n endpointsFromServices,\n type FetchLike,\n type FleetManifest,\n type ServiceInput,\n} from \"./discovery.js\"\nimport { BROWSER_JS } from \"./generated/browser.js\"\nimport {\n filterFromSearch,\n matches,\n type Notification,\n type NotificationFilter,\n SERVICE_KINDS,\n type SourceStatus,\n} from \"./model.js\"\nimport { READERS } from \"./sources.js\"\nimport { renderPage } from \"./ui/page.js\"\n\nexport type HarnessOptions = {\n /** A running fleet controller's `adminBase` (`http://127.0.0.1:9000/__admin/fleet`). */\n fleet?: string\n /** A fleet ready manifest, or a function that reads the current one (re-read on every sync). */\n manifest?: FleetManifest | (() => FleetManifest | Promise<FleetManifest>)\n /** Explicit emulators by name: base URLs, `{ url, adminUrl }`, or in-process runtimes. */\n services?: Record<string, ServiceInput>\n /**\n * Namespaces to watch in the background. `\"all\"` follows the fleet's namespace list.\n * Any namespace an API call or the UI asks for is watched from then on. Default `[\"default\"]`,\n * or `\"all\"` with `fleet`.\n */\n namespaces?: \"all\" | string[]\n /** Background polling interval. `0` turns it off; reads still sync on demand. Default 750 ms. */\n pollIntervalMs?: number\n /** Sent as `x-mockingbird-admin-key` to the fleet and every emulator. */\n adminKey?: string\n /** Admin keys by emulator name, for emulators whose key is not `adminKey`. */\n adminKeys?: Record<string, string>\n /**\n * Front every emulator's admin API on this origin, so the page shows an Emulators tab next to\n * Notifications. `createServer` (the `./server` entry) turns it on; pass `adminGateway()` from\n * that entry to turn it on for a harness you serve yourself.\n */\n admin?: AdminGatewayFactory | false\n /** The tab the page opens on when it has both. Default `notifications`. */\n defaultTab?: \"emulators\" | \"notifications\"\n /** Transport for URL endpoints. Default: global `fetch`. */\n fetch?: FetchLike\n /** Page title. */\n title?: string\n}\n\nexport type AdminGatewayContext = {\n /** Every HTTP emulator the harness knows, messaging or not, after a fresh discovery. */\n targets(): Promise<AdminTarget[]>\n /** The admin key header for one emulator: empty when the harness has no key for it. */\n headers(name: string): Record<string, string>\n title: string\n}\n\nexport type AdminGateway = {\n /** The admin UI's mount config for the current emulators; null when there are none. */\n config(): Promise<Record<string, unknown> | null>\n /** Everything under `/admin/`: the admin UI script and each emulator's admin API. */\n fetch(request: Request): Promise<Response>\n}\n\nexport type AdminGatewayFactory = (context: AdminGatewayContext) => AdminGateway\n\nexport type WaitOptions = { timeoutMs?: number; count?: number }\n\nexport type NotificationHarness = {\n /** The harness UI and JSON API as a Fetch handler. */\n fetch(request: Request): Promise<Response>\n /** Read every emulator now. Resolves after a read that started after this call. */\n sync(namespace?: string): Promise<void>\n /** Notifications matching `filter`, oldest first, after a fresh sync. */\n list(filter?: NotificationFilter): Promise<Notification[]>\n /** Resolve once at least `count` (default 1) notifications match; reject after `timeoutMs`. */\n waitFor(filter: NotificationFilter, options?: WaitOptions): Promise<Notification[]>\n sources(): SourceStatus[]\n close(): void\n}\n\ntype Bucket = {\n notifications: Map<string, Notification>\n inFlight: Promise<void> | null\n queued: Promise<void> | null\n version: number\n}\n\nconst json = (status: number, body: unknown, headers: Record<string, string> = {}) =>\n new Response(JSON.stringify(body, null, 2), {\n status,\n headers: { \"content-type\": \"application/json; charset=utf-8\", ...headers },\n })\n\nconst errorBody = (status: number, message: string) =>\n json(status, { error: { type: \"mockingbird_notifications\", message } })\n\nconst REDISCOVER_MS = 2_000\nconst DUPLICATE_WINDOW_MS = 10_000\n\n/** Mailosaur stores copies forwarded from Resend; show one message, not two. */\nconst fingerprint = (n: Notification) =>\n [\n n.channel,\n n.namespace,\n n.to.toLowerCase(),\n n.from.address.toLowerCase(),\n n.email?.subject ?? \"\",\n n.preview,\n ].join(\"\\u0000\")\n\nconst dedupe = (items: Notification[]): Notification[] => {\n const senders = new Map<string, number[]>()\n for (const n of items)\n if (n.service !== \"mailosaur\") {\n const key = fingerprint(n)\n senders.set(key, [...(senders.get(key) ?? []), Date.parse(n.createdAt)])\n }\n return items.filter((n) => {\n if (n.service !== \"mailosaur\") return true\n const at = Date.parse(n.createdAt)\n return !(senders.get(fingerprint(n)) ?? []).some((t) => Math.abs(t - at) <= DUPLICATE_WINDOW_MS)\n })\n}\n\nconst byTime = (a: Notification, b: Notification) =>\n a.createdAt === b.createdAt ? a.id.localeCompare(b.id) : a.createdAt < b.createdAt ? -1 : 1\n\nexport const createNotificationHarness = (options: HarnessOptions = {}): NotificationHarness => {\n if (!options.fleet && !options.manifest && !options.services)\n throw new Error(\"createNotificationHarness: pass fleet, manifest or services\")\n const fetchImpl: FetchLike = options.fetch ?? ((request) => fetch(request))\n const authHeaders: Record<string, string> = options.adminKey\n ? { \"x-mockingbird-admin-key\": options.adminKey }\n : {}\n const headersFor = (name: string): Record<string, string> => {\n const key = options.adminKeys?.[name]\n return key ? { \"x-mockingbird-admin-key\": key } : authHeaders\n }\n const followAll = (options.namespaces ?? (options.fleet ? \"all\" : undefined)) === \"all\"\n const watched = new Set<string>(\n Array.isArray(options.namespaces) ? options.namespaces : [\"default\"],\n )\n const buckets = new Map<string, Bucket>()\n const statuses = new Map<string, SourceStatus>()\n const listeners = new Set<\n (event: { namespace: string; added: Notification[]; version: number }) => void\n >()\n const explicit = options.services ? endpointsFromServices(options.services, fetchImpl) : []\n let endpoints: Endpoint[] = explicit\n const explicitAdmins = options.services\n ? adminTargetsFromServices(options.services, fetchImpl)\n : []\n let admins: AdminTarget[] = explicitAdmins\n let discoveredAt = 0\n let discoveryError: string | null = null\n let discovering: Promise<void> | null = null\n /** Entries whose health route named a service the harness does not read (stripe, \u2026). */\n const rejected = new Set<string>()\n\n const rediscover = async (force = false) => {\n if (!options.fleet && !options.manifest) return\n if (!force && Date.now() - discoveredAt < REDISCOVER_MS) return\n discovering ??= (async () => {\n try {\n let found: Endpoint[] = []\n let foundAdmins: AdminTarget[] = []\n if (options.fleet) {\n const fleet = await discoverFleet(options.fleet, fetchImpl, authHeaders)\n found = fleet.endpoints\n foundAdmins = fleet.admins\n if (followAll) for (const ns of fleet.namespaces) watched.add(ns)\n } else if (options.manifest) {\n const manifest =\n typeof options.manifest === \"function\" ? await options.manifest() : options.manifest\n found = endpointsFromManifest(manifest, fetchImpl)\n foundAdmins = adminTargetsFromManifest(manifest, fetchImpl)\n }\n admins = [\n ...explicitAdmins,\n ...foundAdmins.filter((a) => !explicitAdmins.some((x) => x.name === a.name)),\n ]\n // Keep what we learned from health probes across rediscovery.\n const known = new Map(endpoints.map((e) => [`${e.name}|${e.adminUrl}`, e.service]))\n endpoints = [\n ...explicit,\n ...found\n .filter(\n (e) =>\n !explicit.some((x) => x.name === e.name) &&\n !rejected.has(`${e.name}|${e.adminUrl}`),\n )\n .map((e) => ({\n ...e,\n service: e.service ?? known.get(`${e.name}|${e.adminUrl}`) ?? null,\n })),\n ]\n discoveryError = null\n } catch (error) {\n discoveryError = error instanceof Error ? error.message : String(error)\n } finally {\n discoveredAt = Date.now()\n discovering = null\n }\n })()\n await discovering\n }\n\n const adminGet = (endpoint: Endpoint, namespace: string) => async (path: string) => {\n const response = await endpoint.fetch(\n new Request(`${endpoint.adminUrl}${path}`, {\n headers: {\n ...headersFor(endpoint.name),\n \"x-mockingbird-namespace\": namespace,\n accept: \"application/json\",\n },\n }),\n )\n if (!response.ok) {\n const text = await response.text().catch(() => \"\")\n throw new Error(`GET ${path}: HTTP ${response.status} ${text.slice(0, 200)}`)\n }\n return response.json() as Promise<unknown>\n }\n\n /** Learn what an unnamed emulator is from its health route (`{ service: \"fcm\" }`). */\n const identify = async (endpoint: Endpoint): Promise<void> => {\n if (endpoint.service) return\n const health = (await adminGet(endpoint, \"default\")(\"/health\")) as { service?: unknown }\n endpoint.service = asServiceKind(health.service)\n if (!endpoint.service) throw new Error(`not a messaging emulator (${String(health.service)})`)\n }\n\n const bucket = (namespace: string): Bucket => {\n let b = buckets.get(namespace)\n if (!b) {\n b = { notifications: new Map(), inFlight: null, queued: null, version: 0 }\n buckets.set(namespace, b)\n }\n return b\n }\n\n const readAll = async (namespace: string) => {\n await rediscover()\n const results = await Promise.all(\n endpoints.map(async (endpoint) => {\n const key = endpoint.name\n const status: SourceStatus = statuses.get(key) ?? {\n name: endpoint.name,\n service: endpoint.service,\n url: endpoint.adminUrl,\n ok: false,\n error: null,\n count: 0,\n lastSyncAt: null,\n }\n statuses.set(key, status)\n try {\n await identify(endpoint)\n const service = endpoint.service\n if (!service) return { ok: false as const }\n const items = await READERS[service]({\n source: endpoint.name,\n namespace,\n read: adminGet(endpoint, namespace),\n })\n Object.assign(status, {\n service,\n url: endpoint.adminUrl,\n ok: true,\n error: null,\n lastSyncAt: new Date().toISOString(),\n })\n return { ok: true as const, items }\n } catch (error) {\n const message = error instanceof Error ? error.message : String(error)\n // An emulator that answers but is not a messaging one is simply not shown.\n if (message.startsWith(\"not a messaging emulator\")) {\n statuses.delete(key)\n rejected.add(`${endpoint.name}|${endpoint.adminUrl}`)\n endpoints = endpoints.filter((e) => e !== endpoint)\n return { ok: false as const }\n }\n Object.assign(status, { url: endpoint.adminUrl, ok: false, error: message })\n discoveredAt = 0\n return { ok: false as const, source: endpoint.name }\n }\n }),\n )\n const b = bucket(namespace)\n const failed = new Set(results.flatMap((r) => (\"source\" in r && r.source ? [r.source] : [])))\n const fresh = dedupe(results.flatMap((r) => (r.ok ? r.items : [])))\n const next = new Map<string, Notification>()\n // A source that failed this round keeps what it last showed rather than blinking out.\n for (const n of b.notifications.values()) if (failed.has(n.source)) next.set(n.id, n)\n for (const n of fresh) next.set(n.id, n)\n const added = [...next.values()].filter((n) => !b.notifications.has(n.id)).sort(byTime)\n const removed = [...b.notifications.keys()].some((id) => !next.has(id))\n const changed =\n added.length > 0 ||\n removed ||\n [...next.values()].some((n) => b.notifications.get(n.id)?.status !== n.status)\n b.notifications = next\n for (const status of statuses.values())\n status.count = [...buckets.values()].reduce(\n (sum, bk) =>\n sum + [...bk.notifications.values()].filter((n) => n.source === status.name).length,\n 0,\n )\n if (changed) {\n b.version++\n for (const listener of listeners) listener({ namespace, added, version: b.version })\n }\n }\n\n const sync = (namespace = \"default\"): Promise<void> => {\n watched.add(namespace)\n const b = bucket(namespace)\n if (!b.inFlight) {\n b.inFlight = readAll(namespace).finally(() => {\n b.inFlight = null\n })\n return b.inFlight\n }\n // A read is running but may have started before the caller's send; queue one more.\n b.queued ??= b.inFlight.then(() => {\n b.queued = null\n return sync(namespace)\n })\n return b.queued\n }\n\n const list = async (filter: NotificationFilter = {}) => {\n const namespace = filter.namespace ?? \"default\"\n await sync(namespace)\n return [...bucket(namespace).notifications.values()]\n .filter((n) => matches(n, { ...filter, namespace }))\n .sort(byTime)\n }\n\n const waitFor = async (filter: NotificationFilter, wait: WaitOptions = {}) => {\n const timeoutMs = wait.timeoutMs ?? 10_000\n const count = wait.count ?? 1\n const deadline = Date.now() + timeoutMs\n for (;;) {\n const found = await list(filter)\n if (found.length >= count) return found\n if (Date.now() >= deadline) {\n const error = new Error(\n `timed out after ${timeoutMs}ms waiting for ${count} notification(s) matching ${JSON.stringify(filter)}; found ${found.length}`,\n )\n Object.assign(error, { found })\n throw error\n }\n await new Promise((resolve) =>\n setTimeout(resolve, Math.min(100, Math.max(0, deadline - Date.now()))),\n )\n }\n }\n\n const interval = options.pollIntervalMs ?? 750\n const timer =\n interval > 0\n ? setInterval(() => {\n for (const namespace of watched) void sync(namespace).catch(() => {})\n }, interval)\n : null\n ;(timer as { unref?: () => void } | null)?.unref?.()\n\n const events = (namespace: string, signal: AbortSignal) => {\n watched.add(namespace)\n const encoder = new TextEncoder()\n let cleanup = () => {}\n return new ReadableStream<Uint8Array>({\n start(controller) {\n const send = (event: string, data: unknown) => {\n try {\n controller.enqueue(encoder.encode(`event: ${event}\\ndata: ${JSON.stringify(data)}\\n\\n`))\n } catch {\n cleanup()\n }\n }\n const listener = (event: { namespace: string; added: Notification[]; version: number }) => {\n if (event.namespace === namespace) send(\"change\", event)\n }\n listeners.add(listener)\n const heartbeat = setInterval(() => send(\"sources\", [...statuses.values()]), 2_000)\n cleanup = () => {\n listeners.delete(listener)\n clearInterval(heartbeat)\n }\n signal.addEventListener(\"abort\", () => {\n cleanup()\n try {\n controller.close()\n } catch {}\n })\n send(\"hello\", { namespace, version: bucket(namespace).version })\n void sync(namespace).catch(() => {})\n },\n cancel() {\n cleanup()\n },\n })\n }\n\n const namespacesList = () => [...new Set([...watched, ...buckets.keys()])].sort()\n\n const title = options.title ?? \"Notifications\"\n const gateway = options.admin\n ? options.admin({\n targets: async () => {\n await rediscover()\n return admins\n },\n headers: headersFor,\n title,\n })\n : null\n\n const handle = async (request: Request): Promise<Response> => {\n const url = new URL(request.url)\n const path = url.pathname.replace(/\\/+$/, \"\") || \"/\"\n // The admin gateway forwards writes too; everything else the harness serves is read-only.\n if (path === \"/admin\" || path.startsWith(\"/admin/\"))\n return gateway ? gateway.fetch(request) : errorBody(404, `no route ${path}`)\n if (request.method !== \"GET\" && request.method !== \"HEAD\")\n return errorBody(405, \"the notification harness is read-only\")\n if (path === \"/\" || path === \"/index.html\")\n return new Response(\n renderPage({ title, defaultTab: options.defaultTab ?? \"notifications\" }),\n {\n headers: { \"content-type\": \"text/html; charset=utf-8\", \"cache-control\": \"no-store\" },\n },\n )\n if (path === \"/api/admin\") {\n await rediscover()\n const fleet = options.fleet?.replace(/\\/+$/, \"\")\n return json(200, {\n admin: gateway ? await gateway.config() : null,\n emulators: admins.map((a) => ({ name: a.name, target: a.target, adminUrl: a.adminUrl })),\n fleet: fleet\n ? {\n adminBase: fleet,\n consoleUrl: fleet.replace(/\\/fleet$/, \"/ui\"),\n error: discoveryError,\n }\n : null,\n })\n }\n if (path === \"/ui.js\")\n return new Response(BROWSER_JS, {\n headers: { \"content-type\": \"text/javascript; charset=utf-8\", \"cache-control\": \"no-store\" },\n })\n if (path === \"/api/health\") return json(200, { status: \"ok\", sources: [...statuses.values()] })\n if (path === \"/api/sources\") {\n await rediscover()\n return json(200, {\n discoveryError,\n sources: endpoints.map(\n (e) =>\n statuses.get(e.name) ?? {\n name: e.name,\n service: e.service,\n url: e.adminUrl,\n ok: false,\n error: null,\n count: 0,\n lastSyncAt: null,\n },\n ),\n services: SERVICE_KINDS,\n })\n }\n if (path === \"/api/namespaces\") {\n await rediscover()\n return json(200, { namespaces: namespacesList() })\n }\n let filter: NotificationFilter\n try {\n filter = filterFromSearch(url.searchParams)\n } catch (error) {\n return errorBody(400, error instanceof Error ? error.message : String(error))\n }\n const namespace = filter.namespace ?? \"default\"\n if (path === \"/api/events\")\n return new Response(events(namespace, request.signal), {\n headers: {\n \"content-type\": \"text/event-stream\",\n \"cache-control\": \"no-store\",\n connection: \"keep-alive\",\n },\n })\n if (path === \"/api/notifications\") {\n const found = await list(filter)\n if (url.searchParams.get(\"order\") === \"newest\") found.reverse()\n return json(200, { namespace, version: bucket(namespace).version, notifications: found })\n }\n if (path === \"/api/notifications/latest\") {\n const found = await list(filter)\n const latest = found.at(-1)\n return latest ? json(200, latest) : errorBody(404, \"no notification matches\")\n }\n if (path === \"/api/wait\") {\n const timeoutMs = Number(url.searchParams.get(\"timeoutMs\") ?? 10_000)\n const count = Number(url.searchParams.get(\"count\") ?? 1)\n if (!Number.isFinite(timeoutMs) || timeoutMs < 0 || timeoutMs > 120_000)\n return errorBody(400, \"timeoutMs: expected 0\u2013120000\")\n if (!Number.isInteger(count) || count < 1)\n return errorBody(400, \"count: expected a positive integer\")\n try {\n return json(200, { namespace, notifications: await waitFor(filter, { timeoutMs, count }) })\n } catch (error) {\n return json(408, {\n error: {\n type: \"mockingbird_notifications\",\n message: error instanceof Error ? error.message : String(error),\n },\n notifications: (error as { found?: unknown }).found ?? [],\n })\n }\n }\n const one = /^\\/api\\/notifications\\/(.+)$/.exec(path)\n if (one) {\n const id = decodeURIComponent(one[1] ?? \"\")\n const ns = id.split(\":\")[1] ?? namespace\n await sync(ns)\n const found = bucket(ns).notifications.get(id)\n return found ? json(200, found) : errorBody(404, `no notification ${id}`)\n }\n return errorBody(404, `no route ${path}`)\n }\n\n return {\n fetch: async (request) => {\n try {\n return await handle(request)\n } catch (error) {\n return errorBody(500, error instanceof Error ? error.message : String(error))\n }\n },\n sync,\n list,\n waitFor,\n sources: () => [...statuses.values()],\n close: () => {\n if (timer) clearInterval(timer)\n listeners.clear()\n },\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;AAoBA,IAAM,OAAO,IAAI,YAAY;AAE7B,IAAM,cAAc,CAAC,UAA8B;AACjD,QAAM,SAAS,KAAK,MAAM,QAAQ,oBAAoB,EAAE,CAAC;AACzD,QAAM,QAAQ,IAAI,WAAW,OAAO,MAAM;AAC1C,WAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,IAAK,OAAM,CAAC,IAAI,OAAO,WAAW,CAAC;AACtE,SAAO;AACT;AAEA,IAAM,uBAAuB,CAAC,OAAe,kBAAkB,UAAsB;AACnF,QAAM,SAAS,MAAM,QAAQ,WAAW,EAAE;AAC1C,QAAM,MAAgB,CAAC;AACvB,WAAS,IAAI,GAAG,IAAI,OAAO,QAAQ,KAAK;AACtC,UAAM,KAAK,OAAO,CAAC,KAAK;AACxB,UAAM,MAAM,OAAO,MAAM,IAAI,GAAG,IAAI,CAAC;AACrC,QAAI,OAAO,OAAO,mBAAmB,KAAK,GAAG,GAAG;AAC9C,UAAI,KAAK,OAAO,SAAS,KAAK,EAAE,CAAC;AACjC,WAAK;AAAA,IACP,WAAW,mBAAmB,OAAO,IAAK,KAAI,KAAK,EAAE;AAAA,QAChD,YAAW,QAAQ,IAAI,YAAY,EAAE,OAAO,EAAE,EAAG,KAAI,KAAK,IAAI;AAAA,EACrE;AACA,SAAO,IAAI,WAAW,GAAG;AAC3B;AAGO,IAAM,cAAc,CAAC,UAC1B,MACG,QAAQ,cAAc,MAAM,EAC5B;AAAA,EACC;AAAA,EACA,CAAC,GAAG,UAAkB,MAAc,SAClC,KAAK;AAAA,IACH,KAAK,YAAY,MAAM,MAAM,YAAY,IAAI,IAAI,qBAAqB,MAAM,IAAI;AAAA,EAClF;AACJ;AAEJ,IAAM,YAAY,CA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