1import{a as Oe}from"./chunk-UHNGGXFZ.js";import{a as we}from"./chunk-7T3W6YPO.js";import{a as Ie}from"./chunk-F3KGKPOH.js";import{a as Me}from"./chunk-ZL3IDT3L.js";import{a as Re}from"./chunk-MFYMFMFG.js";import"./chunk-5XE73LVU.js";import{a as ke}from"./chunk-GG6RD3CE.js";import{a as Se}from"./chunk-M4VQYYKN.js";import{l as h}from"./chunk-QH7OMDPV.js";import"./chunk-G2FVDWRW.js";import{d as Te}from"./chunk-W7RHJN6H.js";import{b as be,c as fe,k as ve,m as he,o as Pe,p as Ee}from"./chunk-M7KC4AQY.js";import{Ab as q,Cb as w,Db as Z,Eb as r,Fb as u,Gb as f,Hb as D,Ib as ie,Ja as l,Jb as xe,K as L,Kb as H,Lb as B,Mb as A,P as C,Q as y,R as X,S as te,Sb as k,U as _e,Ua as ge,Ub as R,V as pe,Vb as ae,Zb as O,_a as U,aa as x,cb as I,db as m,eb as _,fb as ne,gb as $,gc as V,hb as P,ib as E,jb as b,kb as a,lb as o,mb as T,qb as z,rb as v,vb as p,xb as d,ya as ue,yb as Ce,za as N,zb as ye}from"./chunk-FDRV257G.js";import{a as W,b as Y}from"./chunk-Q7L6LLAK.js";var Fe=["editDialog"],$e=["oauthDialog"],Ae=["stripeDialog"],Ke=["confirmDialog"],Be=["databaseDialog"],Ue=["supabaseTokenDialog"],je=["userDialog"],ze=["paymentDialog"],qe=["productDialog"],He=["lookupKeyDialog"],Ge=["inboxDialog"],We=["emailDialog"],Ye=["senderDialog"],Ze=["secretDialog"],Ve=(t,n)=>n.machineName,G=(t,n)=>n.id,Qe=(t,n)=>n.kind+n.name,Je=(t,n)=>n.testVersion,Le=(t,n)=>n.name,Ne=(t,n)=>n.key,Xe=(t,n)=>n.currency,et=(t,n)=>n.projectRef,tt=(t,n)=>n.url,nt=(t,n)=>n.label;function it(t,n){t&1&&z(0)}function at(t,n){if(t&1&&U(0,it,1,0,"ng-container",85),t&2){d(2);let e=q(19);b("ngTemplateOutlet",e)}}function ot(t,n){if(t&1&&(a(0,"div",81),m(1,at,1,1,"ng-container"),a(2,"p",82),r(3,"Backend"),o()(),a(4,"p",83),T(5,"span",84),r(6," Loading backend\u2026 "),o()),t&2){let e=d();l(),_(e.showBackButton?1:-1)}}function lt(t,n){t&1&&z(0)}function rt(t,n){if(t&1&&U(0,lt,1,0,"ng-container",85),t&2){d(2);let e=q(19);b("ngTemplateOutlet",e)}}function st(t,n){if(t&1){let e=v();a(0,"div",81),m(1,rt,1,1,"ng-container"),a(2,"p",82),r(3,"Backend"),o()(),a(4,"p",41),r(5),o(),a(6,"button",86),p("click",function(){C(e);let s=d();return y(s.loadRealm())}),r(7," Try again "),o()}if(t&2){let e=d();l(),_(e.showBackButton?1:-1),l(4),u(n)}}function dt(t,n){t&1&&z(0)}function ct(t,n){if(t&1&&U(0,dt,1,0,"ng-container",85),t&2){d(2);let e=q(19);b("ngTemplateOutlet",e)}}function mt(t,n){if(t&1&&(a(0,"p",59),r(1),o()),t&2){let e=d(3);l(),u(e.copy().backends.listEmpty)}}function _t(t,n){t&1&&(a(0,"p",122),r(1),o()),t&2&&(l(),u(n))}function pt(t,n){if(t&1&&(a(0,"p",118),r(1),o()),t&2){let e=d().$implicit;l(),u(e.liveHostnames.join(", "))}}function ut(t,n){t&1&&(a(0,"p",120),r(1),o()),t&2&&(l(),u(n))}function gt(t,n){if(t&1){let e=v();a(0,"li",121)(1,"div",116)(2,"h3",117),r(3),o(),m(4,_t,2,1,"p",122),m(5,pt,2,1,"p",118),o(),a(6,"div",60)(7,"button",119),p("click",function(){let s=C(e).$implicit,c=d(4);return y(c.requestConfirm({kind:"detach",machineName:s.machineName,displayName:s.displayName}))}),r(8),o()(),m(9,ut,2,1,"p",120),o()}if(t&2){let e,i,s=n.$implicit,c=d(4);l(3),u(s.displayName),l(),_((e=s.previewOrigin)?4:-1,e),l(),_(s.liveHostnames.length>0?5:-1),l(2),b("disabled",c.busyKey()==="app-"+s.machineName),l(),f(" ",c.busyKey()==="app-"+s.machineName?"Detaching\u2026":"Detach"," "),l(),_((i=c.errorFor("app-"+s.machineName))?9:-1,i)}}function Ct(t,n){if(t&1&&(a(0,"ul",105),P(1,gt,10,6,"li",121,Ve),o()),t&2){let e=d(2);l(),E(e.machines)}}function yt(t,n){if(t&1&&(a(0,"option",111),r(1),o()),t&2){let e=n.$implicit,i=d(3);b("value",e.machineName),l(),D(" ",e.displayName,"",e.realmId?" "+i.copy().backends.attachedElsewhere:""," ")}}function xt(t,n){t&1&&(a(0,"p",41),r(1),o()),t&2&&(l(),u(n))}function bt(t,n){t&1&&(a(0,"p",41),r(1),o()),t&2&&(l(),u(n))}function ft(t,n){if(t&1&&r(0),t&2){let e=d(3);f(" ",e.copy().backends.detachAllFirst," ")}}function vt(t,n){t&1&&r(0," Deletes the backend and all of its users and data. ")}function ht(t,n){t&1&&(a(0,"p",120),r(1),o()),t&2&&(l(),u(n))}function Pt(t,n){if(t&1){let e=v();a(0,"div",97)(1,"section",103)(2,"h2",104),r(3),o(),m(4,mt,2,1,"p",59)(5,Ct,3,0,"ul",105),a(6,"form",106),p("submit",function(s){C(e);let c=d(2);return s.preventDefault(),y(c.attach())}),a(7,"label",107),r(8),o(),a(9,"div",108)(10,"select",109),p("change",function(s){C(e);let c=d(2);return y(c.onAttachSelect(s))}),a(11,"option",110),r(12),o(),P(13,yt,2,3,"option",111,Ve),o(),a(15,"button",112),r(16),o()(),a(17,"p",59),r(18),o(),m(19,xt,2,1,"p",41),m(20,bt,2,1,"p",41),o()(),a(21,"section",113)(22,"h2",114),r(23,"Danger zone"),o(),a(24,"div",115)(25,"div",116)(26,"h3",117),r(27,"Delete backend"),o(),a(28,"p",118),m(29,ft,1,1)(30,vt,1,0),o()(),a(31,"div",60)(32,"button",119),p("click",function(){C(e);let s=d(2);return y(s.requestConfirm({kind:"delete"}))}),r(33),o()(),m(34,ht,2,1,"p",120),o()()()}if(t&2){let e,i,s,c=d(),g=d();
1l(3),u(g.copy().backends.listTitle),l(),_(c.machines.length===0?4:5),l(4),f(" ",g.copy().backends.attachLabel," "),l(2),b("value",g.attachSelection())("disabled",!g.vms()||g.attachableVms().length===0),l(2),u(g.attachPlaceholder()),l(),E(g.attachableVms()),l(2),b("disabled",g.attaching()||!g.attachSelection()),l(),f(" ",g.attaching()?"Attaching\u2026":"Attach"," "),l(2),u(g.copy().backends.attachHint),l(),_((e=g.vmsError())?19:-1,e),l(),_((i=g.attachError())?20:-1,i),l(9),_(c.machines.length>0?29:30),l(3),b("disabled",c.machines.length>0||g.busyKey()==="delete"),l(),f(" ",g.busyKey()==="delete"?"Deleting\u2026":"Delete backend"," "),l(),_((s=g.errorFor("delete"))?34:-1,s)}}function Et(t,n){t&1&&(a(0,"span",125),T(1,"span",84),r(2," On "),o())}function St(t,n){t&1&&(a(0,"span",126),r(1,"Off"),o())}function wt(t,n){if(t&1&&(a(0,"p",118),r(1),o()),t&2){let e=d().$implicit,i=A(0),s=d(3);l(),D(" Using your own ",s.providerLabels[e]," app \xB7 client id ending in \u2026",s.lastChars(i.clientId)," ")}}function Tt(t,n){if(t&1&&(a(0,"p",118),r(1),o()),t&2){let e=d().$implicit,i=d(3);l(),f(" Using ezeki.ai's ",i.providerLabels[e],' app. Users see "ezeki.ai" on the consent screen; set up your own app to show your brand. ')}}function kt(t,n){if(t&1&&(a(0,"p",118),r(1),o()),t&2){let e=d().$implicit,i=d(3);l(),f(" Turn on to let users sign in with their ",i.providerLabels[e]," account. ")}}function Rt(t,n){if(t&1&&(a(0,"p",118),r(1),o()),t&2){let e=d().$implicit,i=d(3);l(),f(" Let users sign in with their ",i.providerLabels[e]," account. ")}}function Mt(t,n){if(t&1){let e=v();a(0,"button",119),p("click",function(){C(e);let s=d().$implicit,c=d(3);return y(c.requestConfirm({kind:"oauth",provider:s}))}),r(1),o()}if(t&2){let e=d().$implicit,i=d(3);b("disabled",i.busyKey()===e),l(),f(" ",i.busyKey()===e?"Removing\u2026":"Remove"," ")}}function It(t,n){if(t&1){let e=v();a(0,"button",127),p("click",function(){C(e);let s=d(2).$implicit,c=A(1),g=d(3);return y(g.setProviderEnabled(s,c!=="default"))}),r(1),o()}if(t&2){let e=d(2).$implicit,i=A(1),s=d(3);b("disabled",s.busyKey()===e),l(),f(" ",s.busyKey()===e?"Saving\u2026":i==="default"?"Turn off":"Turn on"," ")}}function Ot(t,n){if(t&1){let e=v();a(0,"button",132),p("click",function(){C(e);let s=d(2).$implicit,c=d(3);return y(c.openOauth(s))}),r(1),o()}if(t&2){let e=d(2).$implicit,i=A(2),s=d(3);w("btn-primary",!i)("btn-ghost",i),l(),f(" ",i?"Use your own app":"Set up "+s.providerLabels[e]," ")}}function Dt(t,n){if(t&1&&(m(0,It,2,2,"button",130),m(1,Ot,2,5,"button",131)),t&2){d();let e=A(1),i=A(2);_(i?0:-1),l(),_(!i||e!=="off"?1:-1)}}function Vt(t,n){t&1&&(a(0,"p",120),r(1),o()),t&2&&(l(),u(n))}function Lt(t,n){if(t&1&&(H(0)(1)(2),a(3,"li",121)(4,"div",116)(5,"h3",117),r(6),m(7,Et,3,0,"span",125)(8,St,2,0,"span",126),o(),m(9,wt,2,2,"p",118)(10,Tt,2,1,"p",118)(11,kt,2,1,"p",118)(12,Rt,2,1,"p",118),o(),a(13,"div",60),m(14,Mt,2,2,"button",129)(15,Dt,2,2),o(),m(16,Vt,2,1,"p",120),o()),t&2){let e,i=n.$implicit,s=d(2),c=d(),g=B(i==="google"?s.google:s.github);l();let M=B(s.providerSource[i]);l();let S=B(s.defaultProviders[i]);l(4),f(" ",c.providerLabels[i]," "),l(),_(M!=="off"?7:S?8:-1),l(2),_(g?9:M==="default"?10:S?11:12),l(5),_(g?14:15),l(2),_((e=c.errorFor(i))?16:-1,e)}}function Nt(t,n){t&1&&(a(0,"span",125),T(1,"span",84),r(2," On "),o())}function Ft(t,n){t&1&&(a(0,"span",126),r(1,"Off"),o())}function $t(t,n){t&1&&r(0," Using your custom email template. ")}function At(t,n){if(t&1&&r(0),t&2){let e=d();f(" Sent from ",e.address,". ")}}function Kt(t,n){if(t&1&&r(0),t&2){let e=d();f(" Confirm ",e.address," to send from it. ")}}function Bt(t,n){if(t&1&&m(0,At,1,1)(1,Kt,1,1),t&2){let e=n;_(e.enabled?0:e.verified?-1:1)}}function Ut(t,n){t&1&&r(0," Live-mode email sending is not set up on the server yet. ")}function jt(t,n){if(t&1&&(a(0,"p",118),r(1," Users get a sign-in link and a 6-digit code by email. In test mode they land in the Test inbox instead of being emailed. "),m(2,$t,1,0),m(3,Bt,2,1),m(4,Ut,1,0),o()),t&2){let e,i=d(2);l(2),_(i.magicLink.customTemplate?2:-1),l(),_((e=i.magicLink.sender)?3:-1,e),l(),_(i.magicLink.emailConfigured?-1:4)}}function zt(t,n){t&1&&(a(0,"p",118),r(1," Turn on to let users sign in with an email link or one-time code. "),o())}function qt(t,n){if(t&1){let e=v();a(0,"button",43),p("click",function(){C(e);let s=d(3);return y(s.openEmailTemplate())}),r(1," Email template "),o(),a(2,"button",43),p("click",function(){C(e);let s=d(3);return y(s.openSender())}),r(3," Sender address "),o(),a(4,"button",43),p("click",function(){C(e);let s=d(3);return y(s.openInbox())}),r(5),o()}if(t&2){let e=d(3);l(5),f(" Test inbox",e.inbox().length>0?" ("+e.inbox().length+")":""," ")}}function Ht(t,n){t&1&&(a(0,"p",120),r(1),o()),t&2&&(l(),u(n))}function Gt(t,n){if(t&1){let e=v();a(0,"div",98)(1,"section",123)(2,"h2",124),r(3,"Sign-in providers"),o(),a(4,"ul",105),P(5,Lt,17,8,"li",121,$),a(7,"li",121)(8,"div",116)(9,"h3",117),r(10," Email "),m(11,Nt,3,0,"span",125)(12,Ft,2,0,"span",126),o(),m(13,jt,5,3,"p",118)(14,zt,2,0,"p",118),o(),a(15,"div",60),m(16,qt,6,1),a(17,"button",127),p("click",function(){C(e);let s=d(),c=d();return y(c.setProviderEnabled("magicLink",!s.magicLink.enabled))}),r(18),o()(),m(19,Ht,2,1,"p",120),o(),a(20,"li",128)(21,"div",116)(22,"h3",117),r(23,"Passkeys"),o(),a(24,"p",118),r(25," Always available. Users add a passkey after their first sign-in; it works only on the domain where it was created. "),o()()()()()()}if(t&2){let e,i=d(),s=d();l(5),E(s.providers),l(6),_(i.magicLink.enabled?11:12),l(2),_(i.magicLink.enabled?13:14),l(3),_(i.magicLink.enabled?16:-1),l(),b("disabled",s.busyKey()==="magicLink"),l(),f(" ",s.busyKey()==="magicLink"?"Saving\u2026":i.magicLink.enabled?"Turn off":"Turn on"," "),l(),_((e=s.errorFor("magicLink"))?19:-1,e)}}function Wt(t,n){t&1&&z(0)}function Yt(t,n){if(t&1){let e=v();a(0,"button",127),p("click",function(){C(e);let s=d(3);return y(s.exportUsers())}),r(1),o()}if(t&2){let e=d(3);b("disabled",e.exportingUsers()),l(),f(" ",e.exportingUsers()?"Preparing\u2026":"Export CSV"," ")}}function Zt(t,n){t&1&&(a(0,"p",41),r(1),o()),t&2&&(l(),u(n))}function Qt(t,n){t&1&&(a(0,"p",41),r(1),o()),t&2&&(l(),u(n))}function Jt(t,n){t&1&&(a(0,"p",134),r(1,"Loading users\u2026"),o())}function Xt(t,n){if(t&1&&(a(0,"p",63),r(1),o()),t&2){let e=d(3);l(),f("No users yet in ",e.env()," mode.")}}function en(t,n){t&1&&T(0,"col",144)(1,"col",145)}function tn(t,n){t&1&&(a(0,"th",141),r(1,"Last seen"),o(),a(2,"th",141),r(3,"Passkey"),o())}function nn(t,n){t&1&&T(0,"img",149),t&2&&b("src",n,N)}function an(t,n){if(t&1&&(a(0,"span",152),r(1),o()),t&2){let e=d().$implicit;l(),u(e.email)}}function on(t,n){if(t&1&&(a(0,"td"),r(1),k(2,"date"),o(),a(3,"td"),r(4),o()),t&2){let e=d().$implicit,i=d(4);l(),f(" ",e.lastSeenAt?R(2,2,e.lastSeenAt,i.dateFormat(e.lastSeenAt)):"\u2014"," "),l(3),u(e.hasPasskey?"Yes":"\u2014")}}function ln(t,n){if(t&1){let e=v();a(0,"tr",146),p("click",function(){let s=C(e).$implicit,c=d(4);return y(c.openUser(s.id))}),a(1,"td",147)(2,"span",148),m(3,nn,1,1,"img",149),a(4,"span",150)(5,"span",151),r(6),o(),m(7,an,2,1,"span",152),o()()(),a(8,"td"),r(9),k(10,"date"),o(),m(11,on,5,5),a(12,"td",153)(13,"button",43),p("click",function(s){let c=C(e).$implicit,g=d(4);return s.stopPropagation(),y(g.openUser(c.id))}),r(14," View "),o()()()}if(t&2){let e,i=n.$implicit,s=d(4);l(3),_((e=i.avatarUrl)?3:-1,e),l(3),u(i.name||i.email||i.id),l(),_(i.name&&i.email?7:-1),l(2),u(R(10,6,i.createdAt,s.dateFormat(i.createdAt))),l(2),_(s.narrow()?-1:11),l(2),I("aria-label","View "+(i.name||i.email||i.id))}}function rn(t,n){if(t&1&&(a(0,"div",136)(1,"table",137)(2,"colgroup"),T(3,"col",138)(4,"col",139),m(5,en,2,0),T(6,"col",140),o(),a(7,"thead")(8,"tr")(9,"th",141),r(10,"User"),o(),a(11,"th",141),r(12,"Signed up"),o(),m(13,tn,4,0),a(14,"th",141)(15,"span",142),r(16,"Actions"),o()()()(),a(17,"tbody"),P(18,ln,15,9,"tr",143,G),o()()()),t&2){let e=d(3);w("is-loading",e.usersLoading()),l(5),_(e.narrow()?-1:5),l(8),_(e.narrow()?-1:13),l(5),E(e.users())}}function sn(t,n){if(t&1&&(a(0,"div",99)(1,"div",133),U(2,Wt,1,0,"ng-container",85),a(3,"div",60),m(4,Yt,2,2,"button",130),o()(),m(5,Zt,2,1,"p",41),m(6,Qt,2,1,"p",41),m(7,Jt,2,0,"p",134)(8,Xt,2,1,"p",63)(9,rn,20,4,"div",135),o()),t&2){let e,i,s=d(2),c=q(21);l(2),b("ngTemplateOutlet",c),l(2),_(s.users().length>0?4:-1),l(),_((e=s.exportError())?5:-1,e),l(),_((i=s.usersError())?6:-1,i),l(),_(s.usersLoading()&&s.users().length===0?7:s.users().length===0?8:9)}}function dn(t,n){t&1&&(a(0,"span",125),T(1,"span",84),r(2," Connected "),o())}function cn(t,n){t&1&&r(0," \xB7 access token ")}function mn(t,n){if(t&1&&(a(0,"p",118)(1,"a",161)(2,"strong"),r(3),o()(),r(4),k(5,"date"),m(6,cn,1,0),o()),t&2){d();let e=A(7);l(),b("href",e.dashboardUrl,N),l(2),u(e.organizationName),l(),f(" \xB7 ",R(5,4,e.connectedAt,"mediumDate")," "),l(2),_(e.expires?-1:6)}}function _n(t,n){t&1&&(a(0,"p",118),r(1," Connect the Supabase organization that holds this backend's test and live projects. Your agent gets short-lived access through ezeki; nothing long-lived is stored on your machines. "),o())}function pn(t,n){if(t&1){let e=v();a(0,"button",62),p("click",function(){C(e);let s=d(3);return y(s.connectSupabase())}),r(1),o(),a(2,"button",119),p("click",function(){C(e);let s=d(3);return y(s.requestConfirm({kind:"supabase-disconnect"}))}),r(3," Disconnect "),o()}if(t&2){let e=d(3);b("disabled",e.busyKey()==="supabase"),l(),f(" ",e.busyKey()==="supabase"?"Redirecting to Supabase\u2026":"Reconnect"," "),l(),b("disabled",e.busyKey()==="supabase")}}function un(t,n){if(t&1){let e=v();a(0,"button",162),p("click",function(){C(e);let s=d(3);return y(s.connectSupabase())}),r(1),o(),a(2,"button",62),p("click",function(){C(e);let s=d(3);return y(s.openSupabaseToken())}),r(3," Use an access token instead "),o()}if(t&2){let e=d(3);b("disabled",e.busyKey()==="supabase"),l(),f(" ",e.busyKey()==="supabase"?"Redirecting to Supabase\u2026":"Connect Supabase"," "),l(),b("disabled",e.busyKey()==="supabase")}}function gn(t,n){t&1&&(a(0,"p",120),r(1),o()),t&2&&(l(),u(n))}function Cn(t,n){t&1&&(a(0,"span",125),T(1,"span",84),r(2," Connected "),o())}function yn(t,n){if(t&1&&(a(0,"p",118),r(1," Project "),a(2,"a",161)(3,"code"),r(4),o()(),r(5),k(6,"date"),o()),t&2){d();let e=A(0);l(2),b("href",e.dashboardUrl,N),l(2),u(e.projectRef),l(),f(" \xB7 ",R(6,3,e.connectedAt,"mediumDate")," ")}}function xn(t,n){if(t&1&&(a(0,"p",118),r(1),o()),t&2){let e=d().$implicit,i=d(3);l(),f(" ",e==="test"?i.copy().backends.databaseTestDesc:i.copy().backends.databaseLiveDesc," ")}}function bn(t,n){if(t&1){let e=v();a(0,"button",119),p("click",function(){C(e);let s=d().$implicit,c=d(3);return y(c.requestConfirm({kind:"database-disconnect",env:s}))}),r(1),o()}if(t&2){let e=d().$implicit,i=d(3);b("disabled",i.busyKey()==="database-"+e),l(),f(" ",i.busyKey()==="database-"+e?"Disconnecting\u2026":"Disconnect"," ")}}function fn(t,n){if(t&1){let e=v();a(0,"button",162),p("click",function(){C(e);let s=d().$implicit,c=d(3);
1return y(c.openDatabase(s))}),r(1),o()}if(t&2){let e=d(4);b("disabled",!e.database()||e.busyKey()==="supabase"),l(),f(" ",e.database()?.supabase===null?"Connect Supabase first":"Connect database"," ")}}function vn(t,n){t&1&&(a(0,"p",120),r(1),o()),t&2&&(l(),u(n))}function hn(t,n){if(t&1&&(H(0),a(1,"li",121)(2,"div",116)(3,"h3",117),r(4),m(5,Cn,3,0,"span",125),o(),m(6,yn,7,6,"p",118)(7,xn,2,1,"p",118),o(),a(8,"div",60),m(9,bn,2,2,"button",129)(10,fn,2,2,"button",163),o(),m(11,vn,2,1,"p",120),o()),t&2){let e,i=n.$implicit,s=d(2),c=d(),g=B(i==="test"?s.database.test:s.database.live);l(4),f(" ",i==="test"?"Test database":"Live database"," "),l(),_(g?5:-1),l(),_(g?6:7),l(3),_(g?9:10),l(2),_((e=c.errorFor("database-"+i))?11:-1,e)}}function Pn(t,n){t&1&&(a(0,"p",41),r(1),o()),t&2&&(l(),u(n))}function En(t,n){t&1&&(a(0,"p",63),r(1," Connect a test database to see the changes the agent makes. "),o())}function Sn(t,n){if(t&1&&r(0),t&2){let e=d(2);f(" \xB7 ",e.liveOnly.length," applied directly to live ")}}function wn(t,n){t&1&&(a(0,"p",59),r(1," Changes stay in test until a live database is connected above. "),o())}function Tn(t,n){if(t&1&&(a(0,"p",41),r(1),o()),t&2){let e=d(2);l(),u(e.error)}}function kn(t,n){if(t&1){let e=v();a(0,"div",165)(1,"button",167),p("click",function(){C(e);let s=d(5);return y(s.requestConfirm({kind:"database-promote"}))}),r(2),o()()}if(t&2){let e=d(5);l(),b("disabled",e.promoting()),l(),f(" ",e.promoting()?"Publishing\u2026":"Publish "+e.pendingMigrations().length+(e.pendingMigrations().length===1?" change":" changes")+" to live"," ")}}function Rn(t,n){if(t&1&&(a(0,"p",169),r(1),o()),t&2){let e=d(2);l(),D(" ",e.promoted.length," earlier ",e.promoted.length===1?"change was":"changes were"," published before it. ")}}function Mn(t,n){if(t&1&&(a(0,"div",166)(1,"p",41),r(2),o(),m(3,Rn,2,2,"p",169),a(4,"p",169),r(5," Ask the agent to fix the change in test, or fix the live table in Supabase, then publish again. "),o()()),t&2){let e=n,i=d();l(2),D(" \u201C",e.name?.replaceAll("_"," ")||e.testVersion,"\u201D could not be applied to live: ",e.error," "),l(),_(i.promoted.length>0?3:-1)}}function In(t,n){if(t&1&&(a(0,"p",168),r(1),o()),t&2){let e=d();l(),D(" Published ",e.promoted.length," ",e.promoted.length===1?"change":"changes"," to live. ")}}function On(t,n){if(t&1&&m(0,Mn,6,3,"div",166)(1,In,2,2,"p",168),t&2){let e,i=n;_((e=i.failed)?0:i.promoted.length>0?1:-1,e)}}function Dn(t,n){if(t&1&&(a(0,"li")(1,"code"),r(2),o(),r(3),o()),t&2){let e=n.$implicit,i=d(6);l(2),D("",e.kind," ",e.name),l(),f(" \xB7 ",i.driftLabel(e)," ")}}function Vn(t,n){if(t&1&&(a(0,"div",166)(1,"p",170),r(2," Live differs from test outside the recorded changes. Publishing only replays recorded changes, so these will not be fixed by it: "),o(),a(3,"ul",171),P(4,Dn,4,3,"li",null,Qe),o()()),t&2){let e=d(2);l(4),E(e.drift)}}function Ln(t,n){t&1&&(a(0,"p",63),r(1,' No changes yet. Try asking the agent: "add a notes table where each user sees only their own notes". '),o())}function Nn(t,n){if(t&1&&(a(0,"div",175)(1,"span"),r(2),k(3,"date"),o(),a(4,"span",169),r(5),k(6,"date"),o()()),t&2){let e=n;l(2),u(R(3,2,e,"MMM d, y")),l(3),u(R(6,5,e,"h:mm a"))}}function Fn(t,n){if(t&1&&(a(0,"code"),r(1),o()),t&2){let e=d().$implicit;l(),u(e.testVersion)}}function $n(t,n){if(t&1&&(a(0,"div",175)(1,"span"),r(2),k(3,"date"),o(),a(4,"span",169),r(5),k(6,"date"),o()()),t&2){let e=n;l(2),u(R(3,2,e,"MMM d, y")),l(3),u(R(6,5,e,"h:mm a"))}}function An(t,n){t&1&&(a(0,"span",169),r(1,"\u2014"),o())}function Kn(t,n){if(t&1&&(a(0,"tr")(1,"td")(2,"div",173)(3,"span",174),r(4),o(),a(5,"span"),r(6),o()()(),a(7,"td"),m(8,Nn,7,8,"div",175)(9,Fn,2,1,"code"),o(),a(10,"td"),m(11,$n,7,8,"div",175)(12,An,2,0,"span",169),o()()),t&2){let e,i,s=n.$implicit,c=d(6);l(4),u(c.migrationLabel(s)),l(),Z("sync-pill is-"+s.status),l(),f(" ",s.status==="live"?"Live":"Waiting"," "),l(2),_((e=c.migrationDate(s.testVersion))?8:9,e),l(3),_((i=s.promotedAt)?11:12,i)}}function Bn(t,n){if(t&1&&(a(0,"div",136)(1,"table",172)(2,"thead")(3,"tr")(4,"th",141),r(5,"Change"),o(),a(6,"th",141),r(7,"Test"),o(),a(8,"th",141),r(9,"Live"),o()()(),a(10,"tbody"),P(11,Kn,13,6,"tr",null,Je),o()()()),t&2){let e=d(2),i=d(3);w("is-loading",i.databaseLoading()),l(11),E(e.migrations)}}function Un(t,n){if(t&1&&(a(0,"p",164)(1,"span"),r(2),o(),r(3),m(4,Sn,1,1),o(),m(5,wn,2,0,"p",59),m(6,Tn,2,1,"p",41),m(7,kn,3,2,"div",165),m(8,On,2,1),m(9,Vn,6,0,"div",166),m(10,Ln,2,0,"p",63)(11,Bn,13,2,"div",135)),t&2){let e,i=d(),s=d(3);l(),Z("sync-pill is-"+i.status),l(),u(s.databaseStatusLabel(i.status)),l(),D(" \xB7 ",i.migrations.length," ",i.migrations.length===1?"change":"changes"," in test "),l(),_(i.liveOnly.length>0?4:-1),l(),_(i.status==="no_live"?5:-1),l(),_(i.status==="unavailable"&&i.error?6:-1),l(),_(i.live&&s.pendingMigrations().length>0?7:-1),l(),_((e=s.promoteResult())?8:-1,e),l(),_(i.drift.length>0?9:-1),l(),_(i.migrations.length===0?10:11)}}function jn(t,n){t&1&&m(0,En,2,0,"p",63)(1,Un,12,12),t&2&&_(n.status==="no_test"?0:1)}function zn(t,n){t&1&&(a(0,"p",83),T(1,"span",84),r(2," Loading database\u2026 "),o())}function qn(t,n){if(t&1){let e=v();a(0,"div",100)(1,"p",59),r(2," Two Supabase projects: the agent builds tables and access rules in test while you work; you publish those changes to live from here. Sign-in stays with this backend; the database only stores your app's data. "),o(),a(3,"section",154)(4,"h2",155),r(5,"Supabase"),o(),a(6,"ul",105),H(7),a(8,"li",121)(9,"div",116)(10,"h3",117),r(11," Organization "),m(12,dn,3,0,"span",125),o(),m(13,mn,7,7,"p",118)(14,_n,2,0,"p",118),o(),a(15,"div",60),m(16,pn,4,3)(17,un,4,3),o(),m(18,gn,2,1,"p",120),o()()(),a(19,"section",156)(20,"h2",157),r(21,"Projects"),o(),a(22,"ul",105),P(23,hn,12,6,"li",121,$),o()(),a(25,"section",158)(26,"div",159)(27,"h2",160),r(28,"Changes"),o(),a(29,"button",62),p("click",function(){C(e);let s=d(2);return y(s.loadDatabase(!0))}),r(30),o()(),m(31,Pn,2,1,"p",41),m(32,jn,2,1)(33,zn,3,0,"p",83),o()()}if(t&2){let e,i,s,c=d(2);l(7);let g=B(c.database()?.supabase??null);l(),w("card-inline",!!g),l(4),_(g?12:-1),l(),_(g?13:14),l(3),_(g?16:c.database()?17:-1),l(2),_((e=c.errorFor("supabase"))?18:-1,e),l(5),E(c.envs),l(6),b("disabled",c.databaseLoading()),l(),f(" ",c.databaseLoading()?"Refreshing\u2026":"Refresh"," "),l(),_((i=c.databaseError())?31:-1,i),l(),_((s=c.database())?32:c.databaseLoading()?33:-1,s)}}function Hn(t,n){if(t&1){let e=v();a(0,"button",62),p("click",function(){C(e);let s=d(3);return y(s.syncSecrets())}),r(1),o()}if(t&2){let e=d(3);b("disabled",e.syncingSecrets()),l(),f(" ",e.syncingSecrets()?"Pushing\u2026":"Push to Supabase again"," ")}}function Gn(t,n){t&1&&(a(0,"p",41),r(1),o()),t&2&&(l(),u(n))}function Wn(t,n){t&1&&(a(0,"p",41),r(1),o()),t&2&&(l(),u(n))}function Yn(t,n){t&1&&(a(0,"p",59),r(1," No database is connected yet. Values are kept in ezeki and pushed to each Supabase project as soon as it is connected from the Database tab. "),o())}function Zn(t,n){t&1&&(a(0,"p",63),r(1," No secrets yet. The agent asks for one when the app needs it; you can also add one here. "),o())}function Qn(t,n){t&1&&(a(0,"span",181),r(1," Not used anymore "),o())}function Jn(t,n){if(t&1&&(a(0,"span",182),r(1),o()),t&2){let e=d().$implicit;
1b("title",e.description),l(),u(e.description)}}function Xn(t,n){t&1&&(a(0,"span",169),r(1,"Requested by the agent"),o())}function ei(t,n){t&1&&(a(0,"span",170),r(1),o()),t&2&&(l(),u(n))}function ti(t,n){if(t&1&&(a(0,"td")(1,"div",175)(2,"span"),r(3),o(),m(4,ei,2,1,"span",170),o()()),t&2){let e,i=n.$implicit,s=d().$implicit,c=d(5).secretStatus(s,i);l(2),Z("sync-pill "+c.cls),I("title",c.title),l(),f(" ",c.label," "),l(),_((e=s[i]?.syncError)?4:-1,e)}}function ni(t,n){t&1&&(a(0,"tr")(1,"td",189)(2,"p",41),r(3),o()()()),t&2&&(l(3),u(n))}function ii(t,n){if(t&1){let e=v();a(0,"tr")(1,"td",180)(2,"div",173)(3,"code",174),r(4),o(),m(5,Qn,2,0,"span",181)(6,Jn,2,2,"span",182)(7,Xn,2,0,"span",169),o()(),P(8,ti,5,5,"td",null,$),a(10,"td",183)(11,"details",184)(12,"summary",185),r(13," \u22EF "),o(),a(14,"ul",186)(15,"li")(16,"button",187),p("click",function(s){let c=C(e).$implicit,g=d(5);return g.openSecret(c),y(g.closeMenu(s))}),r(17," Set values\u2026 "),o()(),a(18,"li")(19,"button",188),p("click",function(s){let c=C(e).$implicit,g=d(5);return g.requestConfirm({kind:"secret-remove",name:c.name}),y(g.closeMenu(s))}),r(20," Remove "),o()()()()()(),m(21,ni,4,1,"tr")}if(t&2){let e,i=n.$implicit,s=d(5);l(4),u(i.name),l(),_(i.unusedAt?5:i.description?6:i.requestedAt?7:-1),l(3),E(s.envs),l(4),I("aria-label","Actions for "+i.name),l(7),b("disabled",s.busyKey()==="secret-"+i.name),l(2),_((e=s.errorFor("secret-"+i.name))?21:-1,e)}}function ai(t,n){if(t&1&&(a(0,"div",136)(1,"table",178)(2,"thead")(3,"tr")(4,"th",179),r(5,"Secret"),o(),a(6,"th",141),r(7,"Test"),o(),a(8,"th",141),r(9,"Live"),o(),a(10,"th",141)(11,"span",142),r(12,"Actions"),o()()()(),a(13,"tbody"),P(14,ii,22,5,null,null,Le),o()()()),t&2){let e=d(),i=d(3);w("is-loading",i.secretsLoading()),l(14),E(e.items)}}function oi(t,n){if(t&1&&(m(0,Yn,2,0,"p",59),m(1,Zn,2,0,"p",63)(2,ai,16,2,"div",135)),t&2){let e=n;_(!e.projects.test&&!e.projects.live?0:-1),l(),_(e.items.length===0?1:2)}}function li(t,n){t&1&&(a(0,"p",83),T(1,"span",84),r(2," Loading secrets\u2026 "),o())}function ri(t,n){if(t&1){let e=v();a(0,"div",101)(1,"section",176)(2,"div",159)(3,"h2",177),r(4,"Secrets"),o(),a(5,"div",60),m(6,Hn,2,2,"button",61),a(7,"button",162),p("click",function(){C(e);let s=d(2);return y(s.openSecret(null))}),r(8," Add secret "),o()()(),a(9,"p",59),r(10," API keys and other private values your app's backend code needs, such as an Anthropic or Resend key. Each one has a test value and a live value. ezeki keeps them encrypted and pushes each into the matching Supabase project, where Edge Functions and scheduled jobs read them. Change them only here; edits made in Supabase are overwritten. "),o(),m(11,Gn,2,1,"p",41),m(12,Wn,2,1,"p",41),m(13,oi,3,2)(14,li,3,0,"p",83),o()()}if(t&2){let e,i,s,c=d(2);l(6),_(c.secretsNeedPush()?6:-1),l(),b("disabled",!c.secrets()),l(4),_((e=c.secretsError())?11:-1,e),l(),_((i=c.errorFor("secrets"))?12:-1,i),l(),_((s=c.secrets())?13:c.secretsLoading()?14:-1,s)}}function si(t,n){t&1&&r(0," Already have Stripe? Connect it and you stay in full control of the account. New to Stripe? The connect flow creates an account for you. ")}function di(t,n){t&1&&r(0," Prefer not to authorize ezeki? Paste an API key instead. ")}function ci(t,n){t&1&&r(0," Paste a secret key from your Stripe dashboard. ")}function mi(t,n){if(t&1&&(a(0,"p",59),m(1,si,1,0),m(2,di,1,0)(3,ci,1,0),o()),t&2){let e=d(4);l(),_(e.flags().stripeConnect?1:-1),l(),_(e.flags().stripeApiKey&&e.flags().stripeConnect?2:e.flags().stripeApiKey?3:-1)}}function _i(t,n){t&1&&(a(0,"span",125),T(1,"span",84),r(2," Connected "),o())}function pi(t,n){t&1&&r(0," (sandbox) ")}function ui(t,n){t&1&&(r(0),k(1,"date")),t&2&&f(" \xB7 ",R(1,1,n,"mediumDate")," ")}function gi(t,n){if(t&1&&(r(0," Account "),a(1,"code"),r(2),o(),m(3,pi,1,0),r(4),m(5,ui,2,4)),t&2){let e;d();let i=A(0);l(2),u(i.stripeAccountId),l(),_(i.stripeSandbox?3:-1),l(),f(" \xB7 ",i.stripeVia==="connect"?"Stripe Connect":"API key"," "),l(),_((e=i.stripeConnectedAt)?5:-1,e)}}function Ci(t,n){t&1&&r(0," Live mode is connected, but Stripe could not link its test mode automatically. Accounts that test in a sandbox need their own connection. ")}function yi(t,n){if(t&1&&r(0),t&2){let e=d().$implicit,i=d(4);f(" ",e==="test"?i.copy().backends.stripeTestDesc:i.copy().backends.stripeLiveDesc," ")}}function xi(t,n){if(t&1){let e=v();a(0,"button",119),p("click",function(){C(e);let s=d().$implicit,c=d(4);return y(c.requestConfirm({kind:"stripe",env:s}))}),r(1),o()}if(t&2){let e=d().$implicit,i=d(4);
1b("disabled",i.busyKey()==="stripe-"+e),l(),f(" ",i.busyKey()==="stripe-"+e?"Disconnecting\u2026":"Disconnect"," ")}}function bi(t,n){if(t&1){let e=v();a(0,"button",162),p("click",function(){C(e);let s=d(2).$implicit,c=d(4);return y(c.connectStripe(s))}),r(1),o()}if(t&2){let e=d(2).$implicit,i=d(4);b("disabled",i.busyKey()==="stripe-"+e),l(),f(" ",i.busyKey()==="stripe-"+e?"Opening Stripe\u2026":"Connect with Stripe"," ")}}function fi(t,n){if(t&1){let e=v();a(0,"button",201),p("click",function(){C(e);let s=d(2).$implicit,c=d(4);return y(c.openStripe(s))}),r(1," Use an API key "),o()}if(t&2){let e=d(2).$implicit,i=d(4);w("btn-primary",!i.flags().stripeConnect)("btn-ghost",i.flags().stripeConnect),b("disabled",i.busyKey()==="stripe-"+e)}}function vi(t,n){if(t&1&&(m(0,bi,2,2,"button",163),m(1,fi,2,5,"button",200)),t&2){let e=d(5);_(e.flags().stripeConnect?0:-1),l(),_(e.flags().stripeApiKey?1:-1)}}function hi(t,n){t&1&&(a(0,"p",120),r(1),o()),t&2&&(l(),u(n))}function Pi(t,n){if(t&1&&(H(0),a(1,"li",121)(2,"div",116)(3,"h3",117),r(4),m(5,_i,3,0,"span",125),o(),a(6,"p",118),m(7,gi,6,4)(8,Ci,1,0)(9,yi,1,1),o()(),a(10,"div",60),m(11,xi,2,2,"button",129)(12,vi,2,2),o(),m(13,hi,2,1,"p",120),o()),t&2){let e,i=n.$implicit,s=d(3),c=d(),g=B(i==="test"?s.test:s.live);l(4),f(" ",i==="test"?"Test mode":"Live mode"," "),l(),_(g.stripeConnected?5:-1),l(2),_(g.stripeConnected?7:i==="test"&&c.stripeTestNeedsOwnConnection(s)?8:9),l(4),_(g.stripeConnected?11:12),l(2),_((e=c.errorFor("stripe-"+i))?13:-1,e)}}function Ei(t,n){if(t&1&&(a(0,"section",190)(1,"h2",199),r(2,"Stripe"),o(),m(3,mi,4,2,"p",59),a(4,"ul",105),P(5,Pi,14,6,"li",121,$),o()()),t&2){let e=d(3);l(3),_(e.flags().stripeConnect||e.flags().stripeApiKey?3:-1),l(2),E(e.envs)}}function Si(t,n){t&1&&(a(0,"span",193),r(1),o()),t&2&&(l(),u(n))}function wi(t,n){t&1&&(a(0,"p",41),r(1),o()),t&2&&(l(),u(n))}function Ti(t,n){t&1&&(a(0,"p",63),r(1,"Connect Stripe above to see your products."),o())}function ki(t,n){if(t&1){let e=v();a(0,"div",203),p("keydown",function(s){C(e);let c=d(5);return y(c.onCatalogViewKeydown(s))}),a(1,"button",204),p("click",function(){C(e);let s=d(5);return y(s.catalogView.set("test"))}),r(2," Managed "),o(),a(3,"button",205),p("click",function(){C(e);let s=d(5);return y(s.catalogView.set("all"))}),r(4," All "),o()()}if(t&2){let e=d(5);l(),w("is-active",e.catalogView()==="test"),b("tabindex",e.catalogView()==="test"?0:-1),I("aria-checked",e.catalogView()==="test"),l(2),w("is-active",e.catalogView()==="all"),b("tabindex",e.catalogView()==="all"?0:-1),I("aria-checked",e.catalogView()==="all")}}function Ri(t,n){if(t&1&&(r(0," \xB7 "),a(1,"span",206),r(2),o()),t&2){let e=d();l(2),f("",e.issues," out of sync")}}function Mi(t,n){t&1&&r(0," \xB7 In sync ")}function Ii(t,n){if(t&1&&r(0),t&2){let e=d(7);f(" \xB7 ",e.hiddenLiveOnly()," live-only hidden ")}}function Oi(t,n){if(t&1&&(a(0,"p",164),r(1),m(2,Ri,3,1)(3,Mi,1,0),m(4,Ii,1,1),o()),t&2){let e=n,i=d(3),s=d(3);l(),D(" Test: ",e.test," \xB7 Live: ",e.live," "),l(),_(e.issues>0?2:i.connected.test&&i.connected.live?3:-1),l(2),_(s.hiddenLiveOnly()>0?4:-1)}}function Di(t,n){if(t&1&&m(0,Oi,5,4,"p",164),t&2){let e,i=d(5);_((e=i.catalogSummary())?0:-1,e)}}function Vi(t,n){t&1&&(a(0,"p",63),r(1,' No products yet. Try asking the agent: "add a Pro plan for $9 a month". '),o())}function Li(t,n){t&1&&(a(0,"p",63),r(1,' Nothing in test mode yet. Switch to "All" to see live-only products. '),o())}function Ni(t,n){t&1&&(a(0,"code"),r(1),o()),t&2&&(l(),u(n))}function Fi(t,n){t&1&&(a(0,"span",169),r(1,"\u2014"),o())}function $i(t,n){if(t&1&&(a(0,"a",213)(1,"strong"),r(2),o(),a(3,"span",215),r(4),o()()),t&2){let e=n,i=d().$implicit,s=d(8);b("href",s.stripeProductUrl(i,e.productId),N),l(2),u(s.formatPrice(e)),l(2),f("",e.sold," sold")}}function Ai(t,n){t&1&&(a(0,"span",214),r(1,"\u2014"),o())}function Ki(t,n){t&1&&(a(0,"span",169),r(1,"Missing"),o())}function Bi(t,n){if(t&1&&(a(0,"td"),m(1,$i,5,3,"a",213)(2,Ai,2,0,"span",214)(3,Ki,2,0,"span",169),o()),t&2){let e,i=n.$implicit,s=d().$implicit,c=d(4);l(),_((e=s[i])?1:c.connected[i]?3:2,e)}}function Ui(t,n){t&1&&(a(0,"span",69),r(1,"Working\u2026"),o())}function ji(t,n){if(t&1){let e=v();a(0,"li")(1,"button",187),p("click",function(s){C(e);let c=d(2).$implicit,g=d(7);return g.openLookupKey(c),y(g.closeMenu(s))}),r(2," Set lookup key\u2026 "),o()()}}function zi(t,n){if(t&1){let e=v();a(0,"li")(1,"button",187),p("click",function(s){C(e);let c=d(3).$implicit,g=d(7);return g.requestCatalogSync(c,"test"),y(g.closeMenu(s))}),r(2," Promote to live "),o()()}}
1function qi(t,n){if(t&1){let e=v();a(0,"li")(1,"button",187),p("click",function(s){C(e);let c=d(3).$implicit,g=d(7);return g.requestCatalogSync(c,"test"),y(g.closeMenu(s))}),r(2," Update live to match test "),o()()}}function Hi(t,n){if(t&1&&m(0,zi,3,0,"li")(1,qi,3,0,"li"),t&2){let e=d(2).$implicit;_(e.live?e.status==="drifted"?1:-1:0)}}function Gi(t,n){if(t&1){let e=v();a(0,"li")(1,"button",187),p("click",function(s){C(e);let c=d(3).$implicit,g=d(7);return g.requestCatalogArchive(c,"live"),y(g.closeMenu(s))}),r(2," Archive in live "),o()(),a(3,"li")(4,"button",187),p("click",function(s){C(e);let c=d(3).$implicit,g=d(7);return g.requestCatalogSync(c,"live"),y(g.closeMenu(s))}),r(5," Copy to test "),o()()}}function Wi(t,n){if(t&1){let e=v();a(0,"li")(1,"button",187),p("click",function(s){C(e);let c=d(3).$implicit,g=d(7);return g.requestCatalogSync(c,"live"),y(g.closeMenu(s))}),r(2," Apply live price to test "),o()()}}function Yi(t,n){if(t&1&&m(0,Gi,6,0)(1,Wi,3,0,"li"),t&2){let e=d(2).$implicit;_(e.test?e.status==="drifted"?1:-1:0)}}function Zi(t,n){if(t&1){let e=v();a(0,"li")(1,"a",216),p("click",function(s){C(e);let c=d(10);return y(c.closeMenu(s))}),r(2),o()()}if(t&2){let e=d().$implicit,i=d(9);l(),b("href",i.stripeProductUrl(e,n.productId),N),l(),f(" Open in Stripe (",e,") ")}}function Qi(t,n){if(t&1&&m(0,Zi,3,2,"li"),t&2){let e,i=n.$implicit,s=d(2).$implicit;_((e=s[i])?0:-1,e)}}function Ji(t,n){if(t&1){let e=v();a(0,"details",184)(1,"summary",185),r(2," \u22EF "),o(),a(3,"ul",186)(4,"li")(5,"button",187),p("click",function(s){C(e);let c=d().$implicit,g=d(7);return g.openProduct(c),y(g.closeMenu(s))}),r(6," Details "),o()(),m(7,ji,3,0,"li"),m(8,Hi,2,1),m(9,Yi,2,1),P(10,Qi,1,1,null,null,$),o()()}if(t&2){let e=d().$implicit,i=d(4),s=d(3);l(),I("aria-label","Actions for "+e.name),l(6),_(e.lookupKey?-1:7),l(),_(e.lookupKey&&e.test&&i.connected.live?8:-1),l(),_(e.lookupKey&&e.live&&i.connected.test?9:-1),l(),E(s.envs)}}function Xi(t,n){if(t&1&&(a(0,"tr")(1,"td")(2,"div",173)(3,"span",174),r(4),o(),a(5,"span"),r(6),o()()(),a(7,"td",212),m(8,Ni,2,1,"code")(9,Fi,2,0,"span",169),o(),P(10,Bi,4,1,"td",null,$),a(12,"td",183),m(13,Ui,2,0,"span",69)(14,Ji,12,4,"details",184),o()()),t&2){let e,i=n.$implicit,s=d(7);l(4),u(i.name),l(),Z("sync-pill is-"+i.status),l(),f(" ",s.syncLabel(i)," "),l(2),_((e=i.lookupKey)?8:9,e),l(2),E(s.envs),l(3),_(s.catalogBusyKey()===i.key?13:14)}}function ea(t,n){if(t&1&&(a(0,"div",136)(1,"table",207)(2,"colgroup"),T(3,"col",208)(4,"col",209)(5,"col",210)(6,"col",210)(7,"col",140),o(),a(8,"thead")(9,"tr")(10,"th",141),r(11,"Product"),o(),a(12,"th",211),r(13,"Lookup key"),o(),a(14,"th",141),r(15,"Test"),o(),a(16,"th",141),r(17,"Live"),o(),a(18,"th",141)(19,"span",142),r(20,"Actions"),o()()()(),a(21,"tbody"),P(22,Xi,15,6,"tr",null,Ne),o()()()),t&2){let e=d(6);w("is-loading",e.catalogLoading()),l(22),E(e.catalogItems())}}function ta(t,n){if(t&1&&m(0,Li,2,0,"p",63)(1,ea,24,2,"div",135),t&2){let e=d(5);_(e.catalogItems().length===0?0:1)}}function na(t,n){if(t&1){let e=v();a(0,"div",159)(1,"div",60),m(2,ki,5,8,"div",202),m(3,Di,1,1),o(),a(4,"button",62),p("click",function(){C(e);let s=d(4);return y(s.loadCatalog(!0))}),r(5),o()(),m(6,Vi,2,0,"p",63)(7,ta,2,1)}if(t&2){let e=d(),i=d(3);l(2),_(i.catalog()?.connected?.live?2:-1),l(),_(e.items.length>0?3:-1),l(),b("disabled",i.catalogLoading()),l(),f(" ",i.catalogLoading()?"Refreshing\u2026":"Refresh"," "),l(),_(e.items.length===0?6:7)}}function ia(t,n){if(t&1&&m(0,Ti,2,0,"p",63)(1,na,8,5),t&2){let e=n;_(!e.connected.test&&!e.connected.live?0:1)}}function aa(t,n){t&1&&(a(0,"p",134),r(1,"Loading products\u2026"),o())}function oa(t,n){t&1&&z(0)}function la(t,n){t&1&&(r(0),k(1,"date")),t&2&&f(" \xB7 ",R(1,1,n,"mediumDate")," ")}function ra(t,n){if(t&1){let e=v();a(0,"button",188),p("click",function(s){C(e);let c=d().$implicit,g=d(4);return g.requestConfirm({kind:"stripe",env:c}),y(g.closeMenu(s))}),r(1),a(2,"span",222),r(3),m(4,la,2,4),o()()}if(t&2){let e,i=d().$implicit,s=A(0),c=d(4);b("disabled",c.busyKey()==="stripe-"+i),l(),f(" ",c.busyKey()==="stripe-"+i?"Disconnecting\u2026":"Disconnect "+i+" mode"," "),l(2),D(" ",s.stripeAccountId," \xB7 ",s.stripeVia==="connect"?"Stripe Connect":"API key"," "),l(),_((e=s.stripeConnectedAt)?4:-1,e)}}function sa(t,n){if(t&1){let e=v();a(0,"button",188),p("click",function(s){C(e);let c=d(2).$implicit,g=d(4);return g.connectStripe(c),y(g.closeMenu(s))}),r(1),o()}if(t&2){let e=d(2).$implicit,i=d(4);
1b("disabled",i.busyKey()==="stripe-"+e),l(),f(" Connect ",e," mode with Stripe ")}}function da(t,n){if(t&1){let e=v();a(0,"button",187),p("click",function(s){C(e);let c=d(2).$implicit,g=d(4);return g.openStripe(c),y(g.closeMenu(s))}),r(1),o()}if(t&2){let e=d(2).$implicit;l(),f(" Use an API key for ",e," mode ")}}function ca(t,n){if(t&1&&(m(0,sa,2,2,"button",221),m(1,da,2,1,"button",223)),t&2){let e=d(5);_(e.flags().stripeConnect?0:-1),l(),_(e.flags().stripeApiKey?1:-1)}}function ma(t,n){if(t&1&&(H(0),a(1,"li"),m(2,ra,5,5,"button",221)(3,ca,2,2),o()),t&2){let e=n.$implicit,i=d(3),s=B(e==="test"?i.test:i.live);l(2),_(s.stripeConnected?2:3)}}function _a(t,n){if(t&1&&(a(0,"details",197)(1,"summary",217),X(),a(2,"svg",218),T(3,"path",219)(4,"path",220),o()(),te(),a(5,"ul",186),P(6,ma,4,2,"li",null,$),o()()),t&2){let e=d(3);l(6),E(e.envs)}}function pa(t,n){if(t&1&&r(0),t&2){let e=d().$implicit,i=d(4);f(" \xB7 ",i.formatTotal(e.refunded,e.currency)," refunded ")}}function ua(t,n){if(t&1&&(a(0,"div",224)(1,"span",225),r(2),o(),a(3,"span",226),r(4),m(5,pa,1,1),o()()),t&2){let e=n.$implicit,i=d(4);l(2),f(" ",i.formatTotal(e.net,e.currency)," "),l(2),D(" ",e.count," ",e.count===1?"payment":"payments"," "),l(),_(e.refunded>0?5:-1)}}function ga(t,n){if(t&1&&(a(0,"div",198),P(1,ua,6,4,"div",224,Xe),o()),t&2){let e=d(3);l(),E(e.paymentTotals())}}function Ca(t,n){t&1&&(a(0,"p",41),r(1),o()),t&2&&(l(),u(n))}function ya(t,n){if(t&1&&m(0,Ca,2,1,"p",41),t&2){let e,i=n.$implicit,s=d(4);_((e=s.errorFor("stripe-"+i))?0:-1,e)}}function xa(t,n){if(t&1&&P(0,ya,1,1,null,null,$),t&2){let e=d(3);E(e.envs)}}function ba(t,n){t&1&&(a(0,"p",41),r(1),o()),t&2&&(l(),u(n))}function fa(t,n){t&1&&(a(0,"p",134),r(1,"Loading payments\u2026"),o())}function va(t,n){if(t&1&&(a(0,"p",63),r(1),o()),t&2){let e=d(3);l(),f("No payments yet in ",e.env()," mode.")}}function ha(t,n){t&1&&T(0,"col",229)}function Pa(t,n){t&1&&T(0,"col",231)}function Ea(t,n){t&1&&(a(0,"th",141),r(1,"Type"),o())}function Sa(t,n){t&1&&(a(0,"th",141),r(1,"Customer"),o())}function wa(t,n){if(t&1&&(a(0,"td"),r(1),o()),t&2){let e=d().$implicit;l(),u(e.kind==="refund"?"Refund":"Payment")}}function Ta(t,n){if(t&1&&(a(0,"td"),r(1),o()),t&2){let e=d().$implicit;l(),u(e.email||"\u2014")}}function ka(t,n){if(t&1&&(a(0,"span",235),r(1),o()),t&2){let e=n.$implicit,i=d(5);b("title",e.priceId),l(),D(" ",i.lineItemLabel(e)," \xD7 ",e.quantity," ")}}function Ra(t,n){t&1&&r(0," \u2014 ")}function Ma(t,n){if(t&1){let e=v();a(0,"li")(1,"button",187),p("click",function(s){let c=C(e),g=d(5);return g.openUser(c),y(g.closeMenu(s))}),r(2," View user "),o()()}}function Ia(t,n){if(t&1){let e=v();a(0,"li")(1,"a",216),p("click",function(s){C(e);let c=d(5);return y(c.closeMenu(s))}),r(2," Open in Stripe "),o()()}t&2&&(l(),b("href",n,N))}function Oa(t,n){if(t&1){let e=v();a(0,"tr")(1,"td")(2,"div",175)(3,"span"),r(4),k(5,"date"),o(),a(6,"span",169),r(7),k(8,"date"),o()()(),m(9,wa,2,1,"td"),a(10,"td",234),r(11),o(),m(12,Ta,2,1,"td"),a(13,"td"),P(14,ka,2,3,"span",235,ne,!1,Ra,1,0),o(),a(17,"td",183)(18,"details",184)(19,"summary",185),r(20," \u22EF "),o(),a(21,"ul",186)(22,"li")(23,"button",187),p("click",function(s){let c=C(e).$implicit,g=d(4);return g.openPayment(c),y(g.closeMenu(s))}),r(24," View "),o()(),m(25,Ma,3,0,"li"),m(26,Ia,3,1,"li"),o()()()()}if(t&2){let e,i,s=n.$implicit,c=d(4);l(4),u(R(5,11,s.occurredAt,c.dateFormat(s.occurredAt))),l(3),u(R(8,14,s.occurredAt,"h:mm a")),l(2),_(c.narrow()?-1:9),l(),w("is-negative",s.kind==="refund"),l(),f(" ",c.formatAmount(s)," "),l(),_(c.narrow()?-1:12),l(2),E(s.lineItems),l(5),I("aria-label","Actions for payment "+s.id),l(6),_((e=s.realmUserId)?25:-1,e),l(),_((i=c.stripePaymentUrl(s))?26:-1,i)}}function Da(t,n){if(t&1&&(a(0,"div",136)(1,"table",227)(2,"colgroup"),T(3,"col",228),m(4,ha,1,0,"col",229),T(5,"col",230),m(6,Pa,1,0,"col",231),T(7,"col",232)(8,"col",140),o(),a(9,"thead")(10,"tr")(11,"th",141),r(12,"Date"),o(),m(13,Ea,2,0,"th",141),a(14,"th",233),r(15,"Amount"),o(),m(16,Sa,2,0,"th",141),a(17,"th",141),r(18,"Items"),o(),a(19,"th",141)(20,"span",142),r(21,"Actions"),o()()()(),a(22,"tbody"),P(23,Oa,27,17,"tr",null,G),o()()()),t&2){let e=d(3);w("is-loading",e.paymentsLoading()),l(4),_(e.narrow()?-1:4),l(2),_(e.narrow()?-1:6),l(7),_(e.narrow()?-1:13),l(3),_(e.narrow()?-1:16),l(7),E(e.payments())}}function Va(t,n){if(t&1){let e=v();a(0,"div",102),m(1,Ei,7,1,"section",190),a(2,"details",191),p("toggle",function(s){C(e);let c=d(2);return y(c.setProductsOpen(s.target.open))}),a(3,"summary",192),r(4," Products "),m(5,Si,2,1,"span",193),o(),a(6,"p",59),r(7," Read from your Str
1ipe account. The agent in your app's chat creates and changes products in test mode; you promote each one to live from its row menu when it is ready. "),o(),m(8,wi,2,1,"p",41),m(9,ia,2,1)(10,aa,2,0,"p",134),o(),a(11,"section",194)(12,"h2",195),r(13,"Payments"),o(),a(14,"div",133)(15,"div",196),U(16,oa,1,0,"ng-container",85),m(17,_a,8,0,"details",197),o(),m(18,ga,3,0,"div",198),o(),m(19,xa,2,0),m(20,ba,2,1,"p",41),m(21,fa,2,0,"p",134)(22,va,2,1,"p",63)(23,Da,25,6,"div",135),o()()}if(t&2){let e,i,s,c,g=d(),M=d(),S=q(21),F=g.test.stripeConnected&&g.live.stripeConnected;l(),_(F?-1:1),l(),b("open",M.productsOpen()),l(3),_((e=M.productsSummary())?5:-1,e),l(3),_((i=M.catalogError())?8:-1,i),l(),_((s=M.catalog())?9:M.catalogLoading()?10:-1,s),l(7),b("ngTemplateOutlet",S),l(),_(F?17:-1),l(),_(M.payments().length>0?18:-1),l(),_(F?19:-1),l(),_((c=M.paymentsError())?20:-1,c),l(),_(M.paymentsLoading()&&M.payments().length===0?21:M.payments().length===0?22:23)}}function La(t,n){if(t&1){let e=v();a(0,"div",87)(1,"div",81),m(2,ct,1,1,"ng-container"),a(3,"div")(4,"p",82),r(5,"Backend"),o(),a(6,"h1",88),r(7),o()()(),a(8,"button",89),p("click",function(){C(e);let s=d();return y(s.openEdit())}),r(9,"Edit"),o()(),a(10,"div",90),p("keydown",function(s){C(e);let c=d();return y(c.onTabKeydown(s))}),a(11,"button",91),p("click",function(){C(e);let s=d();return y(s.switchTab("settings"))}),r(12," Settings "),o(),a(13,"button",92),p("click",function(){C(e);let s=d();return y(s.switchTab("sign-in"))}),r(14," Sign-in "),o(),a(15,"button",93),p("click",function(){C(e);let s=d();return y(s.switchTab("users"))}),r(16," Users "),o(),a(17,"button",94),p("click",function(){C(e);let s=d();return y(s.switchTab("payments"))}),r(18," Payments "),o(),a(19,"button",95),p("click",function(){C(e);let s=d();return y(s.switchTab("secrets"))}),r(20," Secrets "),o(),a(21,"button",96),p("click",function(){C(e);let s=d();return y(s.switchTab("database"))}),r(22," Database "),o()(),m(23,Pt,35,15,"div",97)(24,Gt,26,6,"div",98)(25,sn,10,5,"div",99)(26,qn,34,11,"div",100)(27,ri,15,5,"div",101)(28,Va,24,11,"div",102)}if(t&2){let e,i=d();l(2),_(i.showBackButton?2:-1),l(5),u(n.name),l(4),w("is-active",i.activeTab()==="settings"),b("tabindex",i.activeTab()==="settings"?0:-1),I("aria-selected",i.activeTab()==="settings"),l(2),w("is-active",i.activeTab()==="sign-in"),b("tabindex",i.activeTab()==="sign-in"?0:-1),I("aria-selected",i.activeTab()==="sign-in"),l(2),w("is-active",i.activeTab()==="users"),b("tabindex",i.activeTab()==="users"?0:-1),I("aria-selected",i.activeTab()==="users"),l(2),w("is-active",i.activeTab()==="payments"),b("tabindex",i.activeTab()==="payments"?0:-1),I("aria-selected",i.activeTab()==="payments"),l(2),w("is-active",i.activeTab()==="secrets"),b("tabindex",i.activeTab()==="secrets"?0:-1),I("aria-selected",i.activeTab()==="secrets"),l(2),w("is-active",i.activeTab()==="database"),b("tabindex",i.activeTab()==="database"?0:-1),I("aria-selected",i.activeTab()==="database"),l(2),_((e=i.activeTab())==="settings"?23:e==="sign-in"?24:e==="users"?25:e==="database"?26:e==="secrets"?27:e==="payments"?28:-1)}}function Na(t,n){t&1&&(a(0,"a",236),X(),a(1,"svg",237),T(2,"path",238),o()())}function Fa(t,n){if(t&1){let e=v();a(0,"div",239),p("keydown",function(s){C(e);let c=d();return y(c.onEnvKeydown(s))}),a(1,"button",240),p("click",function(){C(e);let s=d();return y(s.setEnv("test"))}),r(2," Test "),o(),a(3,"button",241),p("click",function(){C(e);let s=d();return y(s.setEnv("live"))}),r(4," Live "),o()()}if(t&2){let e=d();l(),w("is-active",e.env()==="test"),b("tabindex",e.env()==="test"?0:-1),I("aria-checked",e.env()==="test"),l(2),w("is-active",e.env()==="live"),b("tabindex",e.env()==="live"?0:-1),I("aria-checked",e.env()==="live")}}function $a(t,n){t&1&&(a(0,"p",41),r(1),o()),t&2&&(l(),u(n))}function Aa(t,n){if(t&1){let e=v();a(0,"li"),r(1," In Google Cloud Console create an OAuth client of type "),a(2,"strong"),r(3,"Web application"),o(),r(4,". "),o(),a(5,"li"),r(6," Add this redirect URI: "),a(7,"span",248)(8,"code"),r(9),o(),a(10,"button",43),p("click",function(){C(e);let s=d(),c=d(2);return y(c.copyText("google-redirect",s.oauthRedirectUri.google))}),r(11),o()()(),a(12,"li"),r(13,"Publish the OAuth consent screen so anyone can sign in, not only test users."),o(),a(14,"li"),r(15,"Paste the client id and client secret below."),o()}if(t&2){let e=d(),i=d(2);l(9),u(e.oauthRedirectUri.google),l(2),f(" ",i.copiedKey()==="google-redirect"?"Copied":"Copy"," ")}}function Ka(t,n){if(t&1){let e=v();a(0,"li"),r(1," GitHub \u2192 Settings \u2192 Developer settings \u2192 OAuth Apps \u2192 "),a(2,"strong"),r(3,"New OAuth App"),o(),r(4,". "),o(),a(5,"li"),r(6," Set the Authorization callback URL to "),a(7,"span",248)(8,"code"),r(9),o(),a(10,"button",43),p("click",function(){C(e);let s=d(),c=d(2);return y(c.copyText("github-redirect",s.oauthRedirectUri.github))}),r(11),o()()(),a(12,"li"),r(13,"Paste the client id and generate a client secret."),o()}if(t&2){let e=d(),i=d(2);l(9),u(e.oauthRedirectUri.github),l(2),f(" ",i.copiedKey()==="github-redirect"?"Copied":"Copy"," ")}}function Ba(t,n){t&1&&(a(0,"p",41),r(1),o()),t&2&&(l(),u(n))}function Ua(t,n){if(t&1){let e=v();a(0,"h2",242),r(1),o(),a(2,"ol",243),m(3,Aa,16,2)(4,Ka,14,2),o(),a(5,"form",29),p("submit",function(s){C(e);let c=d(2);return s.preventDefault(),y(c.saveOauth())}),a(6,"label",244),r(7,"Client id"),o(),a(8,"input",245),p("input",function(s){C(e);let c=d(2);return y(c.oauthClientId.set(c.inputValue(s)))}),o(),a(9,"label",246),r(10,"Client secret"),o(),a(11,"input",247),p("input",function(s){C(e);let c=d(2);return y(c.oauthClientSecret.set(c.inputValue(s)))}),o(),m(12,Ba,2,1,"p",41),a(13,"div",42)(14,"button",43),p("click",function(){C(e);let s=d(2);return y(s.closeOauth())}),r(15,"Cancel"),o(),a(16,"button",44),r(17),o()()()}if(t&2){let e,i=d(),s=d();l(),f(" Set up ",s.providerLabels[i]," sign-in "),l(2),_(i==="google"?3:4),l(5),b("value",s.oauthClientId()),l(3),b("value",s.oauthClientSecret()),l(),_((e=s.oauthError())?12:-1,e),l(4),b("disabled",s.savingOauth()||!s.oauthClientId().trim()||!s.oauthClientSecret().trim()),l(),f(" ",s.savingOauth()?"Verifying\u2026":"Save"," ")}}function ja(t,n){if(t&1&&m(0,Ua,18,7),t&2){let e,i=d();_((e=i.realm())?0:-1,e)}}function za(t,n){if(t&1&&(a(0,"option",259),r(1),o()),t&2){let e=n.$implicit;b("value",e.projectRef)("disabled",e.status!=="ACTIVE_HEALTHY"),l(),ie(" ",e.name," (",e.region,")",e.status!=="ACTIVE_HEALTHY"?" \xB7 "+e.status.toLowerCase():""," ")}}function qa(t,n){t&1&&(a(0,"p",41),r(1),o()),t&2&&(l(),u(n))}function Ha(t,n){if(t&1){let e=v();a(0,"label",257),r(1,"Project"),o(),a(2,"select",258),p("change",function(s){C(e);let c=d(2);return y(c.onProjectSelect(s))}),a(3,"option",110),r(4),o(),P(5,za,2,5,"option",259,et),o(),m(7,qa,2,1,"p",41)}if(t&2){let e,i=d(2);l(2),b("value",i.databaseProjectRef())("disabled",!i.databaseProjects()),l(2),f(" ",i.databaseProjects()?i.selectableProjects().length===0?"N
1o projects available":"Choose a project":"Loading projects\u2026"," "),l(),E(i.selectableProjects()),l(2),_((e=i.databaseProjectsError())?7:-1,e)}}function Ga(t,n){t&1&&(a(0,"p",59),r(1," Attached apps get the connection details and the agent gets database tools right away. "),o())}function Wa(t,n){t&1&&(a(0,"p",59),r(1," Published apps use this project. Changes made in test are published to it from the Database tab. "),o())}function Ya(t,n){t&1&&(a(0,"p",41),r(1),o()),t&2&&(l(),u(n))}function Za(t,n){if(t&1){let e=v();a(0,"h2",249),r(1),o(),a(2,"form",29),p("submit",function(s){C(e);let c=d();return s.preventDefault(),y(c.connectDatabase())}),a(3,"fieldset",250)(4,"legend",251),r(5,"Supabase project"),o(),a(6,"label",252)(7,"input",253),p("change",function(){C(e);let s=d();return y(s.databaseMode.set("create"))}),o(),a(8,"span")(9,"span",254),r(10,"Create a new project"),o(),a(11,"span",255),r(12," Named after this backend, in your Supabase organization. Takes a minute or two. "),o()()(),a(13,"label",252)(14,"input",256),p("change",function(){C(e);let s=d();return y(s.databaseMode.set("existing"))}),o(),a(15,"span")(16,"span",254),r(17,"Use an existing project"),o(),a(18,"span",255),r(19," ezeki registers this backend as a trusted sign-in issuer on it. Tables and data are left as they are. "),o()()()(),m(20,Ha,8,4),m(21,Ga,2,0,"p",59)(22,Wa,2,0,"p",59),m(23,Ya,2,1,"p",41),a(24,"div",42)(25,"button",43),p("click",function(){C(e);let s=d();return y(s.closeDatabase())}),r(26,"Cancel"),o(),a(27,"button",44),r(28),o()()()}if(t&2){let e,i=n,s=d();l(),f("Connect the ",i," database"),l(6),b("checked",s.databaseMode()==="create"),l(7),b("checked",s.databaseMode()==="existing"),l(6),_(s.databaseMode()==="existing"?20:-1),l(),_(i==="test"?21:22),l(2),_((e=s.connectDatabaseError())?23:-1,e),l(4),b("disabled",s.connectingDatabase()||s.databaseMode()==="existing"&&!s.databaseProjectRef()),l(),f(" ",s.connectingDatabase()?s.databaseMode()==="create"?"Creating project\u2026":"Connecting\u2026":"Connect"," ")}}function Qa(t,n){t&1&&(a(0,"p",41),r(1),o()),t&2&&(l(),u(n))}function Ja(t,n){t&1&&(a(0,"details",261)(1,"summary",169),r(2,"Prefer a restricted key? Permissions it needs"),o(),a(3,"ul")(4,"li"),r(5,"Core \u203A Products: Write"),o(),a(6,"li"),r(7,"Checkout \u203A Checkout Sessions: Write"),o(),a(8,"li"),r(9,"Billing \u203A Prices: Write"),o(),a(10,"li"),r(11,"Billing \u203A Customer portal: Write"),o(),a(12,"li"),r(13,"Billing \u203A Subscriptions: Read"),o(),a(14,"li"),r(15,"Webhook \u203A Webhook Endpoints: Write"),o(),a(16,"li"),r(17,"Connect \u203A Accounts: Read"),o()()())}function Xa(t,n){t&1&&(a(0,"p",41),r(1),o()),t&2&&(l(),u(n))}function eo(t,n){if(t&1){let e=v();a(0,"h2",260),r(1),o(),a(2,"ol",243)(3,"li")(4,"a",50),r(5,"Open your API keys in Stripe"),o(),r(6),a(7,"strong"),r(8,"Reveal"),o(),r(9," on the "),a(10,"strong"),r(11,"Secret key"),o(),r(12," and copy it. "),o(),a(13,"li"),r(14,"Paste the key below. ezeki registers the webhook on your account automatically."),o()(),m(15,Ja,18,0,"details",261),a(16,"form",29),p("submit",function(s){C(e);let c=d();return s.preventDefault(),y(c.saveStripe())}),a(17,"label",262),r(18,"Secret key"),o(),a(19,"input",263),p("input",function(s){C(e);let c=d();return y(c.stripeKey.set(c.inputValue(s)))}),o(),m(20,Xa,2,1,"p",41),a(21,"div",42)(22,"button",43),p("click",function(){C(e);let s=d();return y(s.closeStripe())}),r(23,"Cancel"),o(),a(24,"button",44),r(25),o()()()}if(t&2){let e,i=n,s=d();l(),f(" Connect Stripe with an API key (",i==="test"?"test mode":"live mode",") "),l(3),b("href",s.stripeApiKeysUrl(i),N),l(2),f(" (",i==="test"?"test":"live"," mode), click "),l(9),_(i==="live"?15:-1),l(4),b("placeholder",i==="test"?"sk_test_\u2026":"sk_live_\u2026")("value",s.stripeKey()),l(),_((e=s.stripeError())?20:-1,e),l(4),b("disabled",s.savingStripe()||!s.stripeKey().trim()),l(),f(" ",s.savingStripe()?"Connecting\u2026":"Save"," ")}}function to(t,n){t&1&&r(0," Leave a value empty to keep the current one. ")}function no(t,n){if(t&1){let e=v();a(0,"label",271),r(1,"Name"),o(),a(2,"input",272),p("input",function(s){C(e);let c=d(2);return y(c.secretName.set(c.normalizeSecretName(c.inputValue(s))))}),o(),a(3,"p",40),r(4," Upper-case letters, digits and underscores. Code reads it by this name in Edge Functions and in Vault. "),o()}if(t&2){let e=d(2);l(2),b("value",e.secretName())}}function io(t,n){t&1&&(a(0,"p",40),r(1," The live value waits in ezeki until a live database is connected, then it is pushed. "),o())}function ao(t,n){t&1&&(a(0,"p",41),r(1),o()),t&2&&(l(),u(n))}function oo(t,n){if(t&1){let e=v();a(0,"h2",264),r(1),o(),a(2,"p",49),r(3," Values are stored encrypted by ezeki and pushed to the matching Supabase project. "),m(4,to,1,0),o(),a(5,"form",29),p("submit",function(s){C(e);let c=d();return s.preventDefault(),y(c.saveSecret())}),m(6,no,5,1),a(7,"label",265),r(8,"What it is for (optional)"),o(),a(9,"input",266),p("input",function(s){C(e);let c=d();return y(c.secretDescription.set(c.inputValue(s)))}),o(),a(10,"label",267),r(11,"Test value"),o(),a(12,"input",268),p("input",function(s){C(e);let c=d();return y(c.secretTest.set(c.inputValue(s)))}),o(),a(13,"label",269),r(14,"Live value"),o(),a(15,"input",270),p("input",function(s){C(e);let c=d();return y(c.secretLive.set(c.inputValue(s)))}),o(),m(16,io,2,0,"p",40),m(17,ao,2,1,"p",41),a(18,"div",42)(19,"button",43),p("click",function(){C(e);let s=d();return y(s.closeSecret())}),r(20,"Cancel"),o(),a(21,"button",44),r(22),o()()()}if(t&2){let e,i=d();
1l(),f(" ",i.secretExisting()?i.secretExisting()?.name:"Add a secret"," "),l(3),_(i.secretExisting()?4:-1),l(2),_(i.secretExisting()?-1:6),l(3),b("value",i.secretDescription()),l(3),b("placeholder",i.secretExisting()?.test?"Unchanged":"")("value",i.secretTest()),l(3),b("placeholder",i.secretExisting()?.live?"Unchanged":"")("value",i.secretLive()),l(),_(i.liveProjectConnected()?-1:16),l(),_((e=i.secretError())?17:-1,e),l(4),b("disabled",i.savingSecret()||!i.canSaveSecret()),l(),f(" ",i.savingSecret()?"Saving\u2026":"Save"," ")}}function lo(t,n){if(t&1){let e=v();a(0,"span",248)(1,"code"),r(2),o(),a(3,"button",43),p("click",function(){let s=C(e),c=d(2);return y(c.copyText("lk-"+s,s))}),r(4),o()()}if(t&2){let e=n,i=d(2);l(2),u(e),l(2),f(" ",i.copiedKey()==="lk-"+e?"Copied":"Copy"," ")}}function ro(t,n){t&1&&r(0," \u2014 ")}function so(t,n){t&1&&(a(0,"dt"),r(1,"Description"),o(),a(2,"dd"),r(3),o()),t&2&&(l(3),u(n))}function co(t,n){if(t&1){let e=v();a(0,"dl",274)(1,"dt"),r(2,"Price"),o(),a(3,"dd"),r(4),o(),a(5,"dt"),r(6,"Sold"),o(),a(7,"dd"),r(8),o(),a(9,"dt"),r(10,"Price id"),o(),a(11,"dd")(12,"span",248)(13,"code"),r(14),o(),a(15,"button",43),p("click",function(){let s=C(e),c=d(3);return y(c.copyText(s.priceId,s.priceId))}),r(16),o()()(),a(17,"dt"),r(18,"Product id"),o(),a(19,"dd")(20,"code"),r(21),o()(),a(22,"dt"),r(23,"Created"),o(),a(24,"dd"),r(25),k(26,"date"),o(),a(27,"dt"),r(28,"Stripe"),o(),a(29,"dd")(30,"a",50),r(31," Open product in Stripe "),o()()()}if(t&2){let e=n,i=d().$implicit,s=d(2);l(4),u(s.formatPrice(e)),l(4),u(e.sold),l(6),u(e.priceId),l(2),f(" ",s.copiedKey()===e.priceId?"Copied":"Copy"," "),l(5),u(e.productId),l(4),u(R(26,7,e.createdAt,"medium")),l(5),b("href",s.stripeProductUrl(i,e.productId),N)}}function mo(t,n){if(t&1&&(a(0,"p",276),r(1),o()),t&2){let e=d().$implicit;l(),f("Stripe is not connected for ",e," mode.")}}function _o(t,n){if(t&1&&(a(0,"p",276),r(1),o()),t&2){let e=d().$implicit;l(),f("Not in ",e," mode yet.")}}function po(t,n){if(t&1&&(a(0,"h3",275),r(1),o(),m(2,co,32,10,"dl",274)(3,mo,2,1,"p",276)(4,_o,2,1,"p",276)),t&2){let e,i=n.$implicit,s=d(),c=d();l(),u(i==="test"?"Test mode":"Live mode"),l(),_((e=s[i])?2:c.catalog()?.connected?.[i]?4:3,e)}}function uo(t,n){if(t&1&&(a(0,"h2",273),r(1),o(),a(2,"dl",274)(3,"dt"),r(4,"Lookup key"),o(),a(5,"dd"),m(6,lo,5,2,"span",248)(7,ro,1,0),o(),a(8,"dt"),r(9,"Sync"),o(),a(10,"dd"),r(11),o(),m(12,so,4,1),o(),P(13,po,5,2,null,null,$)),t&2){let e,i,s=n,c=d();l(),u(s.name),l(5),_((e=s.lookupKey)?6:7,e),l(5),u(c.syncLabel(s)),l(),_((i=(s.test??s.live)?.description)?12:-1,i),l(),E(c.envs)}}function go(t,n){if(t&1){let e=v();a(0,"button",62),p("click",function(){C(e);let s=d();return y(s.clearInbox())}),r(1),o()}if(t&2){let e=d();b("disabled",e.inboxLoading()||e.clearingInbox()),l(),f(" ",e.clearingInbox()?"Clearing\u2026":"Clear"," ")}}function Co(t,n){t&1&&(a(0,"p",41),r(1),o()),t&2&&(l(),u(n))}function yo(t,n){t&1&&r(0," Loading\u2026 ")}function xo(t,n){t&1&&r(0," No magic links yet. ")}function bo(t,n){if(t&1&&(a(0,"p",63),m(1,yo,1,0)(2,xo,1,0),o()),t&2){let e=d();l(),_(e.inboxLoading()?1:2)}}function fo(t,n){t&1&&(a(0,"p",118),r(1," Code "),a(2,"code",281),r(3),o()()),t&2&&(l(3),u(n))}function vo(t,n){if(t&1){let e=v();a(0,"button",43),p("click",function(){let s=C(e),c=d().$implicit,g=d(2);return y(g.copyText(s,c.url+"#code"))}),r(1),o()}if(t&2){let e=d().$implicit,i=d(2);l(),f(" ",i.copiedKey()===e.url+"#code"?"Copied":"Copy code"," ")}}function ho(t,n){if(t&1){let e=v();a(0,"li",277)(1,"div",116)(2,"p",117),r(3),a(4,"span",278),r(5),k(6,"date"),o()(),m(7,fo,4,1,"p",118),o(),a(8,"div",60)(9,"a",279),r(10," Open sign-in link "),o(),m(11,vo,2,1,"button",280),a(12,"button",43),p("click",function(){let s=C(e).$implicit,c=d(2);return y(c.copyText(s.url,s.url))}),r(13),o()()()}if(t&2){let e,i,s=n.$implicit,c=d(2);l(3),f(" ",s.email," "),l(2),u(R(6,6,s.createdAt,"medium")),l(2),_((e=s.code)?7:-1,e),l(2),b("href",s.url,N),l(2),_((i=s.code)?11:-1,i),l(2),f(" ",c.copiedKey()===s.url?"Copied":"Copy link"," ")}}function Po(t,n){if(t&1&&(a(0,"ul",64),P(1,ho,14,9,"li",277,tt),o()),t&2){let e=d();l(),E(e.inbox())}}function Eo(t,n){if(t&1){let e=v();a(0,"dt"),r(1,"User"),o(),a(2,"dd")(3,"span",248)(4,"code"),r(5),o(),a(6,"button",43),p("click",function(){let s=C(e),c=d(2);return c.closePayment(),y(c.openUser(s))}),r(7," View user "),o()()()}t&2&&(l(5),u(n))}function So(t,n){t&1&&(a(0,"p",276),r(1,"No line items."),o())}function wo(t,n){t&1&&(r(0," \xB7 "),a(1,"code"),r(2),o()),t&2&&(l(2),u(n))}function To(t,n){if(t&1&&(a(0,"li")(1,"strong"),r(2),o(),a(3,"span",169),r(4),m(5,wo,3,1),o()()),t&2){let e,i=n.$implicit,s=d(2),c=d();l(2),u(c.lineItemLabel(i)),l(2),D(" \xB7 \xD7 ",i.quantity," \xB7 ",c.formatTotal(i.amount,s.currency)," "),l(),_((e=i.lookupKey)?5:-1,e)}}function ko(t,n){if(t&1&&(a(0,"ul",283),P(1,To,6,4,"li",null,ne),o()),t&2){let e=d();l(),E(e.lineItems)}}
1function Ro(t,n){if(t&1&&(a(0,"dt"),r(1),o(),a(2,"dd"),r(3),o()),t&2){let e=n.$implicit;l(),u(e.key),l(2),u(e.value)}}function Mo(t,n){if(t&1&&(a(0,"h3",275),r(1,"Metadata"),o(),a(2,"dl",274),P(3,Ro,4,2,null,null,Ne),o()),t&2){let e=d(),i=d();l(3),E(i.metadataEntries(e))}}function Io(t,n){if(t&1){let e=v();a(0,"li")(1,"span",285),r(2),o(),a(3,"span",248)(4,"code"),r(5),o(),a(6,"button",43),p("click",function(){let s=C(e).$implicit,c=d(2);return y(c.copyText(s.id,s.id))}),r(7),o()()()}if(t&2){let e=n.$implicit,i=d(2);l(2),u(e.label),l(3),u(e.id),l(2),f(" ",i.copiedKey()===e.id?"Copied":"Copy"," ")}}function Oo(t,n){t&1&&(a(0,"li")(1,"a",50),r(2,"Open in Stripe"),o()()),t&2&&(l(),b("href",n,N))}function Do(t,n){if(t&1&&(a(0,"h2",282)(1,"span"),r(2),o(),a(3,"span",169),r(4),o()(),a(5,"dl",274)(6,"dt"),r(7,"Date"),o(),a(8,"dd"),r(9),k(10,"date"),o(),a(11,"dt"),r(12,"Environment"),o(),a(13,"dd"),r(14),o(),a(15,"dt"),r(16,"Customer"),o(),a(17,"dd"),r(18),o(),m(19,Eo,8,1),a(20,"dt"),r(21,"Id"),o(),a(22,"dd")(23,"code"),r(24),o()()(),a(25,"h3",275),r(26,"Items"),o(),m(27,So,2,0,"p",276)(28,ko,3,0,"ul",283),m(29,Mo,5,0),a(30,"h3",275),r(31,"Stripe"),o(),a(32,"ul",284),P(33,Io,8,3,"li",null,nt),m(35,Oo,3,1,"li"),o()),t&2){let e,i,s=n,c=d();
1l(),w("is-negative",s.kind==="refund"),l(),u(c.formatAmount(s)),l(2),f(" \xB7 ",s.kind==="refund"?"Refund":"Payment"),l(5),u(R(10,12,s.occurredAt,"medium")),l(5),u(c.env()),l(4),u(s.email||"\u2014"),l(),_((e=s.realmUserId)?19:-1,e),l(5),u(s.id),l(3),_(s.lineItems.length===0?27:28),l(2),_(c.metadataEntries(s).length>0?29:-1),l(4),E(c.stripeRefs(s)),l(2),_((i=c.stripePaymentUrl(s))?35:-1,i)}}function Vo(t,n){t&1&&(a(0,"p",41),r(1),o()),t&2&&(l(),u(n))}function Lo(t,n){if(t&1){let e=v();a(0,"h2",286),r(1),o(),a(2,"p",49),r(3," The lookup key is how the app refers to this price, and it is the same in test and live mode. Once set, you can promote the price to live from the row menu. "),o(),a(4,"form",29),p("submit",function(s){C(e);let c=d();return s.preventDefault(),y(c.saveLookupKey())}),a(5,"label",287),r(6,"Lookup key"),o(),a(7,"input",288),p("input",function(s){C(e);let c=d();return y(c.lookupKeyValue.set(c.inputValue(s)))}),o(),a(8,"p",59),r(9,'Letters, digits, "_", "-" and "." only, e.g. pro_monthly.'),o(),m(10,Vo,2,1,"p",41),a(11,"div",42)(12,"button",43),p("click",function(){C(e);let s=d();return y(s.closeLookupKey())}),r(13," Cancel "),o(),a(14,"button",44),r(15),o()()()}if(t&2){let e,i=d();l(),f(" Set a lookup key for \u201C",n.name,"\u201D "),l(6),b("value",i.lookupKeyValue()),l(3),_((e=i.lookupKeyError())?10:-1,e),l(4),b("disabled",i.savingLookupKey()||!i.lookupKeyValue().trim()),l(),f(" ",i.savingLookupKey()?"Saving\u2026":"Save"," ")}}function No(t,n){if(t&1&&r(0),t&2){let e=n;f(" ",e.user.name||e.user.email||e.user.id," ")}}function Fo(t,n){t&1&&r(0," User ")}function $o(t,n){t&1&&(a(0,"p",69),r(1,"Loading user\u2026"),o())}function Ao(t,n){t&1&&(a(0,"p",41),r(1),o()),t&2&&(l(),u(n))}function Ko(t,n){t&1&&(a(0,"code"),r(1),o()),t&2&&(l(),u(n))}function Bo(t,n){t&1&&r(0," \u2014 ")}function Uo(t,n){t&1&&(a(0,"dt"),r(1,"Deleted"),o(),a(2,"dd"),r(3),k(4,"date"),o()),t&2&&(l(3),u(R(4,1,n,"medium")))}function jo(t,n){t&1&&(a(0,"p",276),r(1,"No passkeys."),o())}function zo(t,n){if(t&1&&(a(0,"li")(1,"strong"),r(2),o(),a(3,"span",169),r(4),k(5,"date"),o()()),t&2){let e=n.$implicit;l(2),u(e.name),l(2),D(" \xB7 ",e.rpId," \xB7 ",R(5,3,e.createdAt,"mediumDate"))}}function qo(t,n){if(t&1&&(a(0,"ul",283),P(1,zo,6,6,"li",null,G),o()),t&2){let e=d();l(),E(e.user.passkeys)}}function Ho(t,n){t&1&&(a(0,"p",276),r(1,"No subscriptions or purchases."),o())}function Go(t,n){if(t&1&&(a(0,"li")(1,"code",290),r(2),o(),a(3,"span",169),r(4),k(5,"date"),o()()),t&2){let e=n.$implicit;l(),b("title",e.priceId),l(),u(e.lookupKey??e.priceId),l(2),xe(" \xB7 ",e.status,"",e.isActive?" (active)":""," \xB7 until ",R(5,6,e.currentPeriodEnd,"mediumDate")," ",e.cancelAtPeriodEnd?"\xB7 cancels at period end":""," ")}}function Wo(t,n){if(t&1&&(a(0,"li")(1,"code",290),r(2),o(),a(3,"span",169),r(4),o()()),t&2){let e=n.$implicit;l(),b("title",e.priceId),l(),u(e.lookupKey??e.priceId),l(2),ie(" \xB7 ",e.status," \xB7 ",e.consumedQuantity," / ",e.quantity," used ")}}function Yo(t,n){if(t&1&&(a(0,"ul",283),P(1,Go,6,9,"li",null,G),P(3,Wo,5,5,"li",null,G),o()),t&2){let e=d();l(),E(e.entitlements.subscriptions),l(2),E(e.entitlements.purchases)}}function Zo(t,n){t&1&&(a(0,"p",276),r(1,"No payments."),o())}function Qo(t,n){if(t&1&&(a(0,"li")(1,"strong"),r(2),o(),a(3,"span",169),r(4),k(5,"date"),o()()),t&2){let e=n.$implicit,i=d(3);
1l(),w("is-negative",e.kind==="refund"),l(),u(i.formatAmount(e)),l(2),D(" \xB7 ",e.kind==="refund"?"Refund":"Payment"," \xB7 ",R(5,5,e.occurredAt,"medium")," ")}}function Jo(t,n){if(t&1&&(a(0,"ul",283),P(1,Qo,6,8,"li",null,G),o()),t&2){let e=d();l(),E(e.payments)}}function Xo(t,n){if(t&1&&(a(0,"dl",274)(1,"dt"),r(2,"Id"),o(),a(3,"dd")(4,"code"),r(5),o()(),a(6,"dt"),r(7,"Email"),o(),a(8,"dd"),r(9),o(),a(10,"dt"),r(11,"Name"),o(),a(12,"dd"),r(13),o(),a(14,"dt"),r(15,"Environment"),o(),a(16,"dd"),r(17),o(),a(18,"dt"),r(19,"Signed up"),o(),a(20,"dd"),r(21),k(22,"date"),o(),a(23,"dt"),r(24,"Last seen"),o(),a(25,"dd"),r(26),k(27,"date"),o(),a(28,"dt"),r(29,"Stripe customer"),o(),a(30,"dd"),m(31,Ko,2,1,"code")(32,Bo,1,0),o(),m(33,Uo,5,4),o(),a(34,"h3",275),r(35,"Passkeys"),o(),m(36,jo,2,0,"p",276)(37,qo,3,0,"ul",283),a(38,"h3",275),r(39,"Entitlements"),o(),m(40,Ho,2,0,"p",276)(41,Yo,5,0,"ul",283),a(42,"h3",275),r(43,"Payments"),o(),m(44,Zo,2,0,"p",276)(45,Jo,3,0,"ul",283),a(46,"h3",275),r(47," Data "),a(48,"span",278),r(49),o()(),a(50,"pre",289)(51,"code"),r(52),o()()),t&2){let e,i,s=n,c=d();l(5),u(s.user.id),l(4),u(s.user.email||"\u2014"),l(4),u(s.user.name||"\u2014"),l(4),u(s.user.env),l(4),u(R(22,13,s.user.createdAt,"medium")),l(5),u(s.user.lastSeenAt?R(27,16,s.user.lastSeenAt,"medium"):"\u2014"),l(5),_((e=s.user.stripeCustomerId)?31:32,e),l(2),_((i=s.user.deletedAt)?33:-1,i),l(3),_(s.user.passkeys.length===0?36:37),l(4),_(s.entitlements.subscriptions.length===0&&s.entitlements.purchases.length===0?40:41),l(4),_(s.payments.length===0?44:45),l(5),u(c.formatBytes(s.user.dataBytes)),l(3),u(c.userDataJson())}}function el(t,n){if(t&1&&(a(0,"li"),r(1),o()),t&2){let e=n.$implicit;l(),u(e)}}function tl(t,n){t&1&&(a(0,"ul",243),P(1,el,2,1,"li",null,$),o()),t&2&&(l(),E(n))}function nl(t,n){t&1&&(a(0,"p",49)(1,"strong"),r(2),o()()),t&2&&(l(2),u(n))}function il(t,n){if(t&1){let e=v();a(0,"label",292)(1,"input",293),p("change",function(s){C(e);let c=d(2);return y(c.confirmOption.set(s.target.checked))}),o(),a(2,"span"),r(3),o()(),a(4,"p",294),r(5),o()}if(t&2){let e=n,i=d(2);l(),b("checked",i.confirmOption()),l(2),u(e.label),l(2),u(e.hint)}}function al(t,n){if(t&1){let e=v();a(0,"label",292)(1,"input",293),p("change",function(s){C(e);let c=d(2);return y(c.confirmAcknowledged.set(s.target.checked))}),o(),a(2,"span"),r(3,"I understand this cannot be undone"),o()()}if(t&2){let e=d(2);l(),b("checked",e.confirmAcknowledged())}}function ol(t,n){if(t&1){let e=v();a(0,"h2",291),r(1),o(),a(2,"p",49),r(3),o(),m(4,tl,3,0,"ul",243),m(5,nl,3,1,"p",49),m(6,il,6,3),m(7,al,4,1,"label",292),a(8,"div",42)(9,"button",43),p("click",function(){C(e);let s=d();return y(s.closeConfirm())}),r(10,"Cancel"),o(),a(11,"button",201),p("click",function(){C(e);let s=d();return y(s.confirmProceed())}),r(12),o()()}if(t&2){let e,i,s,c=n,g=d();l(),u(c.title),l(2),u(c.message),l(),_((e=c.items)?4:-1,e),l(),_((i=c.warning)?5:-1,i),l(),_((s=c.option)?6:-1,s),l(),_(c.requireAck?7:-1),l(4),w("btn-danger",c.tone==="danger")("btn-primary",c.tone==="primary"),b("disabled",c.requireAck&&!g.confirmAcknowledged()),l(),f(" ",c.confirmLabel," ")}}function ll(t,n){t&1&&r(0," You are using a custom template. ")}function rl(t,n){t&1&&r(0," This is the default template; edit it to make it yours. ")}function sl(t,n){if(t&1){let e=v();a(0,"button",62),p("click",function(){C(e);let s=d();return y(s.resetEmailTemplate())}),r(1),o()}if(t&2){let e=d();b("disabled",e.emailBusy()),l(),f(" ",e.resettingEmail()?"Resetting\u2026":"Reset to default"," ")}}function dl(t,n){t&1&&(a(0,"p",63),r(1,"Loading\u2026"),o())}function cl(t,n){if(t&1&&(a(0,"li")(1,"code"),r(2),o(),a(3,"span"),r(4),o()()),t&2){let e=n.$implicit,i=d(3);l(2),u(i.placeholder(e.name)),l(2),u(e.description)}}function ml(t,n){t&1&&(a(0,"ul",301),P(1,cl,5,2,"li",null,Le),o()),t&2&&(l(),E(n.placeholders))}function _l(t,n){t&1&&(a(0,"p",41),r(1),o()),t&2&&(l(),u(n))}function pl(t,n){if(t&1){let e=v();a(0,"form",29),p("submit",function(s){C(e);let c=d();return s.preventDefault(),y(c.saveEmailTemplate())}
1),a(1,"label",295),r(2,"Subject"),o(),a(3,"input",296),p("input",function(s){C(e);let c=d();return y(c.emailSubject.set(c.inputValue(s)))}),o(),a(4,"label",297),r(5,"HTML body"),o(),a(6,"textarea",298),p("input",function(s){C(e);let c=d();return y(c.emailHtml.set(c.inputValue(s)))}),o(),a(7,"label",299),r(8,"Plain-text body (optional)"),o(),a(9,"textarea",300),p("input",function(s){C(e);let c=d();return y(c.emailText.set(c.inputValue(s)))}),o(),a(10,"p",40),r(11," Placeholders are filled in when the email is sent. The body needs at least "),a(12,"code"),r(13),o(),r(14," or "),a(15,"code"),r(16),o(),r(17,". "),o(),m(18,ml,3,0,"ul",301),m(19,_l,2,1,"p",41),a(20,"div",42)(21,"button",43),p("click",function(){C(e);let s=d();return y(s.closeEmailTemplate())}),r(22," Cancel "),o(),a(23,"button",44),r(24),o()()()}if(t&2){let e,i,s=d();l(3),b("value",s.emailSubject()),l(3),b("value",s.emailHtml()),l(3),b("value",s.emailText()),l(4),u(s.placeholder("link")),l(3),u(s.placeholder("code")),l(2),_((e=s.emailTemplate())?18:-1,e),l(),_((i=s.emailError())?19:-1,i),l(4),b("disabled",s.emailBusy()||!s.emailDirty()||!s.emailSubject().trim()||!s.emailHtml().trim()),l(),f(" ",s.savingEmail()?"Saving\u2026":"Save"," ")}}function ul(t,n){t&1&&(a(0,"p",41),r(1),o()),t&2&&(l(),u(n))}function gl(t,n){if(t&1){let e=v();a(0,"p",302)(1,"span",169),r(2,"Subject:"),o(),r(3),o(),T(4,"iframe",303),a(5,"details",304)(6,"summary",169),r(7,"Plain-text version"),o(),a(8,"pre"),r(9),o()(),m(10,ul,2,1,"p",41),a(11,"div",42)(12,"button",43),p("click",function(){C(e);let s=d();return y(s.closeEmailTemplate())}),r(13," Close "),o()()}if(t&2){let e,i=n,s=d();l(3),f(" ",i.subject," "),l(),b("srcdoc",s.emailPreviewDoc(),ue),l(5),u(i.text),l(),_((e=s.emailError())?10:-1,e)}}function Cl(t,n){t&1&&(a(0,"p",307),r(1),o()),t&2&&(l(),f("Sent to ",n," with sample values."))}function yl(t,n){t&1&&(a(0,"p",40),r(1,"Email sending is not set up on the server yet."),o())}function xl(t,n){t&1&&(a(0,"p",40),r(1,"The test uses your unsaved draft."),o())}function bl(t,n){if(t&1){let e=v();a(0,"div",78)(1,"label",305),r(2,"Send a test to"),o(),a(3,"input",306),p("input",function(s){C(e);let c=d();return y(c.emailTestTo.set(c.inputValue(s)))}),o(),a(4,"button",127),p("click",function(){C(e);let s=d();return y(s.sendTestEmail())}),r(5),o(),m(6,Cl,2,1,"p",307)(7,yl,2,0,"p",40)(8,xl,2,0,"p",40),o()}if(t&2){let e,i=d();l(3),b("value",i.emailTestTo()),l(),b("disabled",i.emailBusy()||!i.emailTestTo().trim()||!i.realm()?.magicLink?.emailConfigured),l(),f(" ",i.sendingTestEmail()?"Sending\u2026":"Send test email"," "),l(),_((e=i.testEmailSentTo())?6:i.realm()?.magicLink?.emailConfigured?i.emailDirty()?8:-1:7,e)}}function fl(t,n){if(t&1&&r(0),t&2){let e=d(3);f(' Sign-in emails are sent from it, with "',e.name,'" as the sender name. ')}}function vl(t,n){if(t&1&&r(0),t&2){let e=d(3);f(" Sign-in emails still come from ",e.magicLink.defaultSender,"; switch to your address below. ")}}function hl(t,n){if(t&1&&(a(0,"p",59)(1,"strong"),r(2),o(),r(3," is confirmed. "),m(4,fl,1,1)(5,vl,1,1),o()),t&2){let e=d();l(2),u(e.address),l(2),_(e.enabled?4:5)}}function Pl(t,n){t&1&&(a(0,"p",307),r(1," Not confirmed yet. Give the email a minute and check the spam folder, or resend it. "),o())}function El(t,n){if(t&1&&(a(0,"p",59),r(1," We sent a confirmation email to "),a(2,"strong"),r(3),o(),r(4,". Open it, click the link, then come back and press Check. The link works for 24 hours. "),o(),m(5,Pl,2,0,"p",307)),t&2){let e=d(),i=d(2);l(3),u(e.address),l(2),_(i.senderChecked()?5:-1)}}function Sl(t,n){t&1&&(a(0,"p",308),r(1," This domain tells inboxes to reject mail that does not come from its own servers, so sign-in emails from this address may land in spam. Use an address on another domain, or keep the default sender. "),o())}function wl(t,n){t&1&&(a(0,"p",41),r(1),o()),t&2&&(l(),u(n))}function Tl(t,n){if(t&1){let e=v();a(0,"button",162),p("click",function(){C(e);let s=d(),c=d(2);return y(c.setSenderEnabled(!s.enabled))}),r(1),o()}if(t&2){let e=d(),i=d(2);b("disabled",i.senderBusy()!==null),l(),f(" ",i.senderBusy()==="use"?"Saving\u2026":e.enabled?"Use default sender":"Use this address"," ")}}function kl(t,n){if(t&1){let e=v();a(0,"button",62),p("click",function(){C(e);let s=d(),c=d(2);return y(c.requestSender(s.address))}),r(1),o(),a(2,"button",162),p("click",function(){C(e);let s=d(3);return y(s.checkSender())}),r(3),o()}if(t&2){let e=d(3);b("disabled",e.senderBusy()!==null),l(),f(" ",e.senderBusy()==="request"?"Sending\u2026":"Resend"," "),l(),b("disabled",e.senderBusy()!==null),l(),f(" ",e.senderBusy()==="check"?"Checking\u2026":"Check"," ")}}function Rl(t,n){if(t&1){let e=v();
1m(0,hl,6,2,"p",59)(1,El,6,2),m(2,Sl,2,0,"p",308),m(3,wl,2,1,"p",41),a(4,"div",42)(5,"button",62),p("click",function(){C(e);let s=d(2);return y(s.removeSender())}),r(6),o(),m(7,Tl,2,2,"button",163)(8,kl,4,4),a(9,"button",43),p("click",function(){C(e);let s=d(2);return y(s.closeSender())}),r(10,"Close"),o()()}if(t&2){let e,i=n,s=d(2);_(i.verified?0:1),l(2),_(i.strictDmarc?2:-1),l(),_((e=s.senderError())?3:-1,e),l(2),b("disabled",s.senderBusy()!==null),l(),f(" ",s.senderBusy()==="remove"?"Removing\u2026":"Remove"," "),l(),_(i.verified?7:8)}}function Ml(t,n){t&1&&(a(0,"p",40),r(1,"Email sending is not set up on the server yet."),o())}function Il(t,n){t&1&&(a(0,"p",41),r(1),o()),t&2&&(l(),u(n))}function Ol(t,n){if(t&1){let e=v();a(0,"form",29),p("submit",function(s){C(e);let c=d(2);return s.preventDefault(),y(c.requestSender())}),a(1,"p",59),r(2),o(),a(3,"label",309),r(4,"Email address"),o(),a(5,"input",310),p("input",function(s){C(e);let c=d(2);return y(c.senderAddress.set(c.inputValue(s)))}),o(),m(6,Ml,2,0,"p",40),m(7,Il,2,1,"p",41),a(8,"div",42)(9,"button",43),p("click",function(){C(e);let s=d(2);return y(s.closeSender())}),r(10,"Cancel"),o(),a(11,"button",44),r(12),o()()()}if(t&2){let e,i=d(),s=d();l(2),D(" Sign-in emails come from ",i.magicLink.defaultSender,' with "',i.name,'" as the sender name. To send them from your own address instead, enter it below. We will email it a confirmation link, so it has to be a real inbox you can open. '),l(3),b("value",s.senderAddress()),l(),_(i.magicLink.emailConfigured?-1:6),l(),_((e=s.senderError())?7:-1,e),l(4),b("disabled",s.senderBusy()!==null||!s.senderAddress().trim()||!i.magicLink.emailConfigured),l(),f(" ",s.senderBusy()==="request"?"Sending\u2026":"Send confirmation"," ")}}function Dl(t,n){if(t&1&&m(0,Rl,11,6)(1,Ol,13,7,"form",77),t&2){let e;_((e=n.magicLink.sender)?0:1,e)}}var K=["settings","sign-in","users","payments","secrets","database"],Vl="ezeki.backend.env.",Ll="ezeki.backend.products-open.";function Nl(t,n,e){let i=URL.createObjectURL(new Blob([n],{type:e})),s=document.createElement("a");s.href=i,s.download=t,s.click(),URL.revokeObjectURL(i)}var Q={google:"Google",github:"GitHub"};function Fl(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").slice(0,60)}function oe(t,n){let e=t/100;try{return new Intl.NumberFormat(void 0,{style:"currency",currency:n.toUpperCase()}).format(e)}catch{return`${e.toFixed(2)} ${n.toUpperCase()}`}}function $l(t){let n=/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/.exec(t);if(!n)return null;let[,e,i,s,c,g,M]=n;return new Date(Date.UTC(+e,+i-1,+s,+c,+g,+M))}var De=class t{document=L(_e);localization=L(Te);auth=L(Se);sanitizer=L(ve);supabaseConnect=L(Ie);tier=L(Re);copy=this.localization.copy;destroyRef=L(pe);narrow=x(!1);route=L(he);router=L(Pe);realmId=x("");realm=x(null);loading=x(!0);loadError=x(null);showBackButton=!1;activeTab=x("settings");providerLabels=Q;providers=["google","github"];envs=["test","live"];busyKey=x(null);cardError=x(null);env=x("test");envChosen=!1;constructor(){let n=this.document.defaultView?.matchMedia?.("(max-width: 640px)");if(n){this.narrow.set(n.matches);let e=i=>this.narrow.set(i.matches);n.addEventListener("change",e),this.destroyRef.onDestroy(()=>n.removeEventListener("change",e))}this.route.paramMap.pipe(we()).subscribe(e=>{let i=e.get("realmId")??"",s=e.get("tab");if(s==="inbox"||s==="products"){let g=s==="inbox"?"sign-in":"payments";this.router.navigate(["/backends",i,g],{replaceUrl:!0});return}let c=K.find(g=>g===s)??"settings";this.activeTab.set(c),i!==this.realmId()?(this.realmId.set(i),this.envChosen=!1,this.restoreProductsOpen(),this.loadRealm()):this.loadTab(c)})}async loadRealm(){this.loading.set(!0),this.loadError.set(null),this.featureFlags.load();try{if(await this.tier.load(),!this.tier.can().backend){await this.router.navigate(["/backends"],{replaceUrl:!0});return}let n=await h.GET("/realms/:realmId",{params:{realmId:this.realmId()}});if(this.realm.set(n),!this.envChosen){let e=this.storedEnv(),i=n.live.stripeConnected||n.machines.some(s=>s.liveHostnames.length>0);this.env.set(e??(i?"live":"test"))}this.loadTab(this.activeTab())}catch(n){this.loadError.set(this.messageOf(n))}finally{this.loading.set(!1)}}async loadTab(n){if(this.realm())switch(n){case"settings":this.vms()||await this.loadVms();break;case"sign-in":await this.loadInbox();break;case"database":await Promise.all([this.loadDatabase(),this.loadSecrets()]);break;case"users":await this.loadUsers();break;case"secrets":await this.loadSecrets();break;case"payments":await Promise.all([this.loadCatalog(),this.loadPayments()]);break}}switchTab(n){this.activeTab()!==n&&this.router.navigate(["/backends",this.realmId(),n])}onTabKeydown(n){let e=K.indexOf(this.activeTab()),i;switch(n.key){case"ArrowRight":i=K[(e+1)%K.length];break;case"ArrowLeft":i=K[(e+K.length-1)%K.length];break;case"Home":i=K[0];break;case"End":i=K[K.length-1];break}i&&(n.preventDefault(),this.switchTab(i),this.document.getElementById(`realm-tab-${i}`)?.focus())}errorFor(n){let e=this.cardError();return e?.key===n?e.message:null}lastChars(n,e=6){return n.slice(-e)}truncate(n,e=18){return n.length>e?`${n.slice(0,e-1)}\u2026`:n}formatBytes(n){return`${(n/1024).toFixed(1)} KB`}
1formatAmount(n){let e=n.kind==="refund"?-1:1;return oe(e*n.amount,n.currency)}dateFormat(n){return new Date(n).getFullYear()===new Date().getFullYear()?"MMM d":"MMM d, y"}formatTotal(n,e){return oe(n,e)}formatPrice(n){if(n.unitAmount===null)return"Custom";let e=oe(n.unitAmount,n.currency);if(!n.interval)return e;let i=n.intervalCount===1?n.interval:`${n.intervalCount} ${n.interval}s`;return`${e} / ${i}`}lineItemLabel(n){return this.catalog()?.items.find(i=>i.test?.priceId===n.priceId||i.live?.priceId===n.priceId)?.name??n.lookupKey??n.priceId}copiedKey=x(null);copyResetTimer=null;async copyText(n,e){try{await navigator.clipboard.writeText(e)}catch{return}this.copiedKey.set(n),this.copyResetTimer!==null&&clearTimeout(this.copyResetTimer),this.copyResetTimer=setTimeout(()=>this.copiedKey.set(null),1800)}editDialog=V("editDialog");editName=x("");editLogoUrl=x("");editTermsUrl=x("");editPrivacyUrl=x("");editStatementSuffix=x("");savingEdit=x(!1);editError=x(null);openEdit(){let n=this.realm();n&&(this.editName.set(n.name),this.editLogoUrl.set(n.logoUrl??""),this.editTermsUrl.set(n.termsUrl??""),this.editPrivacyUrl.set(n.privacyUrl??""),this.editStatementSuffix.set(n.statementDescriptorSuffix??""),this.editError.set(null),this.editDialog()?.nativeElement.showModal())}closeEdit(){this.editDialog()?.nativeElement.close()}inputValue(n){return n.target.value}onStatementSuffixInput(n){let e=n.target;if(n.isComposing){this.editStatementSuffix.set(e.value);return}let i=Array.from(e.value.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").normalize("NFKC").replace(/[^A-Za-z0-9 .\-\u3005\u3040-\u30ff\u4e00-\u9fff]/g,"")).slice(0,17).join("");i!==e.value&&(e.value=i),this.editStatementSuffix.set(i)}async saveEdit(){let n=this.editName().trim();if(!(!n||this.savingEdit())){this.savingEdit.set(!0),this.editError.set(null);try{let e=await h.POST("/realms/:realmId",{name:n,logoUrl:this.editLogoUrl().trim()||null,termsUrl:this.editTermsUrl().trim()||null,privacyUrl:this.editPrivacyUrl().trim()||null,statementDescriptorSuffix:this.editStatementSuffix().trim()||null},{params:{realmId:this.realmId()}});this.realm.set(e),this.closeEdit()}catch(e){this.editError.set(this.messageOf(e))}finally{this.savingEdit.set(!1)}}}oauthDialog=V("oauthDialog");oauthProvider=x(null);oauthClientId=x("");oauthClientSecret=x("");savingOauth=x(!1);oauthError=x(null);
1openOauth(n){this.oauthProvider.set(n),this.oauthClientId.set(""),this.oauthClientSecret.set(""),this.oauthError.set(null),this.oauthDialog()?.nativeElement.showModal()}closeOauth(){this.oauthDialog()?.nativeElement.close()}async saveOauth(){let n=this.oauthProvider(),e=this.oauthClientId().trim(),i=this.oauthClientSecret().trim();if(!(!n||!e||!i||this.savingOauth())){this.savingOauth.set(!0),this.oauthError.set(null);try{let s=await h.POST("/realms/:realmId/oauth/:provider",{clientId:e,clientSecret:i},{params:{realmId:this.realmId(),provider:n}});this.realm.set(s),this.closeOauth()}catch(s){this.oauthError.set(this.messageOf(s))}finally{this.savingOauth.set(!1)}}}exportingUsers=x(!1);exportError=x(null);async exportUsers(){if(!this.exportingUsers()){this.exportingUsers.set(!0),this.exportError.set(null);try{let n=await h.GET("/realms/:realmId/users-export",{params:{realmId:this.realmId()},queryParams:{env:this.env()}});Nl(n.filename,n.csv,"text/csv;charset=utf-8")}catch(n){this.exportError.set(this.messageOf(n))}finally{this.exportingUsers.set(!1)}}}async setProviderEnabled(n,e){await this.runCardAction(n,async()=>{let i=await h.POST("/realms/:realmId/sign-in/:method/enabled",{enabled:e},{params:{realmId:this.realmId(),method:n}});this.realm.set(i)})}async removeOauth(n){await this.runCardAction(n,async()=>{let e=await h.DELETE("/realms/:realmId/oauth/:provider",void 0,{params:{realmId:this.realmId(),provider:n}});this.realm.set(e)})}stripeConnect=L(Oe);featureFlags=L(ke);flags=this.featureFlags.flags;async connectStripe(n){await this.runCardAction(`stripe-${n}`,()=>this.stripeConnect.start(this.realmId(),n,`/backends/${this.realmId()}/payments`))}stripeTestNeedsOwnConnection(n){return n.live.stripeVia==="connect"&&!n.test.stripeConnected}stripeDialog=V("stripeDialog");stripeEnv=x(null);stripeKey=x("");savingStripe=x(!1);stripeError=x(null);
1openStripe(n){this.stripeEnv.set(n),this.stripeKey.set(""),this.stripeError.set(null),this.stripeDialog()?.nativeElement.showModal()}closeStripe(){this.stripeDialog()?.nativeElement.close()}async saveStripe(){let n=this.stripeEnv(),e=this.stripeKey().trim();if(!(!n||!e||this.savingStripe())){this.savingStripe.set(!0),this.stripeError.set(null);try{let i=await h.POST("/realms/:realmId/stripe/:env",{secretKey:e},{params:{realmId:this.realmId(),env:n}});this.realm.set(i),this.closeStripe(),this.activeTab()==="payments"&&this.loadCatalog(!0)}catch(i){this.stripeError.set(this.messageOf(i))}finally{this.savingStripe.set(!1)}}}async disconnectStripe(n){await this.runCardAction(`stripe-${n}`,async()=>{let e=await h.DELETE("/realms/:realmId/stripe/:env",void 0,{params:{realmId:this.realmId(),env:n}});this.realm.set(e)})}vms=x(null);vmsError=x(null);attachSelection=x("");attaching=x(!1);attachError=x(null);attachableVms=O(()=>{let n=this.realm(),e=new Set(n?.machines.map(i=>i.machineName)??[]);return(this.vms()??[]).filter(i=>!e.has(i.machineName))});attachPlaceholder=O(()=>{let n=this.copy().backends;return this.vms()?this.attachableVms().length===0?n.attachNone:n.attachPlaceholder:n.attachLoading});async loadVms(){this.vmsError.set(null);try{let n=await h.GET("/vm/list");this.vms.set(n.items.map(e=>({machineName:e.machineName,displayName:e.displayName,realmId:e.realmId??null})))}catch(n){this.vmsError.set(this.messageOf(n))}}onAttachSelect(n){this.attachSelection.set(n.target.value)}async attach(){let n=this.attachSelection();if(!(!n||this.attaching())){this.attaching.set(!0),this.attachError.set(null);try{let e=await h.POST("/realms/:realmId/attach",{machineName:n},{params:{realmId:this.realmId()}});this.realm.set(e),this.vms.update(i=>(i??[]).map(s=>s.machineName===n?Y(W({},s),{realmId:e.id}):s)),this.attachSelection.set("")}catch(e){this.attachError.set(this.messageOf(e))}finally{this.attaching.set(!1)}}}async detach(n){await this.runCardAction(`app-${n}`,async()=>{await h.POST("/realms/:realmId/detach",{machineName:n},{params:{realmId:this.realmId()}}),this.vms.update(i=>(i??[]).map(s=>s.machineName===n?Y(W({},s),{realmId:null}):s));let e=await h.GET("/realms/:realmId",{params:{realmId:this.realmId()}});this.realm.set(e)})}async deleteRealm(){await this.runCardAction("delete",async()=>{await h.DELETE("/realms/:realmId",void 0,{params:{realmId:this.realmId()}}),await this.router.navigate(["/backends"])})}async runCardAction(n,e){if(!this.busyKey()){this.busyKey.set(n),this.cardError.set(null);try{await e()}catch(i){this.cardError.set({key:n,message:this.messageOf(i)})}finally{this.busyKey.set(null)}}}confirmDialog=V("confirmDialog");confirmAction=x(null);confirmAcknowledged=x(!1);deletionSummary=x(null);confirmContent=O(()=>{let n=this.confirmAction(),e=this.realm();if(!n||!e)return null;switch(n.kind){case"oauth":return{title:`Remove your ${Q[n.provider]} app?`,message:e.defaultProviders[n.provider]?`${e.name} goes back to ezeki.ai's ${Q[n.provider]} app, so users will see "ezeki.ai" on the consent screen.`:`Users will no longer be able to sign in to ${e.name} with ${Q[n.provider]} until you set it up again.`,confirmLabel:"Remove",tone:"danger"};case"stripe":return{title:`Disconnect Stripe ${n.env} mode?`,message:`Checkout and subscriptions in ${n.env} mode stop working until you connect a key again.`,confirmLabel:"Disconnect",tone:"danger"};case"detach":return{title:`Detach \u201C${n.displayName}\u201D?`,message:this.copy().backends.detachConfirmMessage,confirmLabel:"Detach",tone:"danger"};case"delete":return{title:`Delete \u201C${e.name}\u201D?`,message:"Deleting this backend permanently removes:",items:this.deletionItems(e,this.deletionSummary()),warning:"This cannot be undone. You can always start a new backend from scratch.",requireAck:!0,confirmLabel:"Delete backend",tone:"danger"};case"catalog-sync":{let i=n.source==="test"?"live":"test",s=n.item[n.source],c=!!n.item[i];return{title:`${c?"Update":"Create"} \u201C${n.item.name}\u201D in ${i} mode?`,message:c?`The ${i} price becomes ${s?this.formatPrice(s):"the same as "+n.source}. The current ${i} price is archived; existing subscribers keep what they pay now. New checkouts use the new price r
1ight away.`:`A new product and price (${s?this.formatPrice(s):""}) are created in your ${i} Stripe account. ${i==="live"?"Real customers can buy it as soon as your published app offers it.":""}`,confirmLabel:c?`Update ${i}`:`Create in ${i}`,tone:"primary"}}case"catalog-archive":return{title:`Archive \u201C${n.item.name}\u201D in ${n.env} mode?`,message:"Customers can no longer buy it. Existing subscribers are not affected and past purchases stay valid.",confirmLabel:"Archive",tone:"danger"};case"supabase-disconnect":return{title:"Disconnect Supabase from this backend?",message:"Both the test and live databases are disconnected and the publish history is cleared. Attached apps lose their database connection. The Supabase projects, their tables and data are kept, and you can connect the same or a different organization afterwards.",confirmLabel:"Disconnect",tone:"danger",option:this.wipeSecretsOption(this.envs)};case"database-disconnect":return{title:`Disconnect the ${n.env} database?`,message:n.env==="test"?"Attached apps lose their database connection and the agent can no longer create tables. The Supabase project, its tables and data are kept.":"Published apps lose their database connection and the publish history is cleared. The Supabase project, its tables and data are kept.",confirmLabel:"Disconnect",tone:"danger",option:this.wipeSecretsOption([n.env])};case"secret-remove":return{title:`Remove ${n.name}?`,message:"The value is deleted from ezeki and from both Supabase projects. Anything in the app that reads it stops working until you add it again.",confirmLabel:"Remove",tone:"danger"};case"database-promote":{let i=this.pendingMigrations().length;return{title:`Publish ${i} ${i===1?"change":"changes"} to live?`,message:"Each change is applied to the live database in order, exactly as it was applied to test. Existing live data is kept. If one fails, the rest wait until you fix it.",confirmLabel:"Publish",tone:"primary"}}}});confirmOption=x(!1);wipeSecretsOption(n){let e=this.secrets(),i=n.filter(c=>e?.projects[c]&&e.items.some(g=>!!g[c]));if(!i.length)return;let s=i.length===2?"both projects":`the ${i[0]} project`;return{label:"Also remove secrets",hint:`Deletes the Edge Function and Vault copies ezeki pushed to ${s}. The values stay in ezeki and are pushed again when a project is connected. Left unchecked, the keys remain usable in ${s}.`}}requestConfirm(n){this.confirmAcknowledged.set(!1),this.confirmOption.set(!1),this.confirmAction.set(n),n.kind==="delete"&&this.loadDeletionSummary(),this.confirmDialog()?.nativeElement.showModal()}async loadDeletionSummary(){this.deletionSummary.set(null);try{let n=await h.GET("/realms/:realmId/deletion-summary",{params:{realmId:this.realmId()}});this.confirmAction()?.kind==="delete"&&this.deletionSummary.set(n)}catch{}}deletionItems(n,e){let i=(S,F)=>`${S} ${F}${S===1?"":"s"}`,s=[];if(e){let S=e.users.test+e.users.live,F=e.payments.test+e.payments.live;s.push(`${i(S,"user")} (${e.users.test} test, ${e.users.live} live) with their sign-ins, entitlements and ${i(F,"payment record")}`)}else s.push("All users with their sign-ins, entitlements and payment records (counting\u2026)");let c=["test","live"].filter(S=>n[S].stripeConnected);if(c.length){let S=c.some(j=>n[j].stripeVia==="key"),J=[c.some(j=>n[j].stripeVia==="connect")?"ezeki's access to your Stripe account is revoked":"",S?"the webhook on your Stripe account is removed":""].filter(Boolean).join(" and ");s.push(`Stripe ${c.join(" and ")} connection; ${J}. The account, products and customers stay in Stripe.`)}let g=["test","live"].map(S=>({env:S,info:n.database[S]})).filter(S=>S.info);g.length&&s.push(`Database connection for ${g.map(S=>`${S.env} (${S.info?.name??S.info?.projectRef})`).join(" and ")}. The Supabase projects and their tables are kept.`);let M=["google","github"].filter(S=>n[S]);return M.length&&s.push(`Your own ${M.map(S=>Q[S]).join(" and ")} OAuth app credentials`),n.magicLink.sender&&s.push(`The custom sender address ${n.magicLink.sender.address}`),n.magicLink.customTemplate&&s.push("The custom magic-link email template"),s.push("Sign-in keys, so every issued session token stops working"),s}closeConfirm(){this.confirmDialog()?.nativeElement.close()}confirmProceed(){let n=this.confirmAction();if(this.closeConfirm(),!!n)switch(n.kind){case"oauth":this.removeOauth(n.provider);break;case"stripe":this.disconnectStripe(n.env);break;case"detach":this.detach(n.machineName);break;case"delete":this.deleteRealm();break;case"catalog-sync":this.syncCatalogItem(n.item,n.source);break;case"catalog-archive":this.archiveCatalogItem(n.item,n.env);break;case"supabase-disconnect":this.disconnectSupabase(this.confirmOption());break;case"database-disconnect":this.disconnectDatabase(n.env,this.confirmOption());break;case"database-promote":this.promoteDatabase();break;case"secret-remove":this.removeSecret(n.name);break}}database=x(null);databaseLoading=x(!1);databaseError=x(null);databaseLoadSeq=0;pendingMigrations=O(()=>this.database()?.migrations.filter(n=>n.status==="pending")??[]);async loadDatabase(n=!1){if(!n&&this.database())return;let e=++this.databaseLoadSeq;this.databaseLoading.set(!0),this.databaseError.set(null);try{let i=await h.GET("/realms/:realmId/database",{params:{realmId:this.realmId()}});if(e!==this.databaseLoadSeq)return;this.database.set(i)}catch(i){e===this.databaseLoadSeq&&this.databaseError.set(this.messageOf(i))}finally{e===this.databaseLoadSeq&&this.databaseLoading.set(!1)}}migrationLabel(n){return n.name?.replaceAll("_"," ")||`Change ${n.testVersion}`}
1migrationDate(n){return $l(n)}databaseStatusLabel(n){switch(n){case"no_test":return"No test database";case"no_live":return"No live database";case"pending":return`${this.pendingMigrations().length} waiting to publish`;case"in_sync":return"Live matches test";case"drifted":return"Live differs from test";case"unavailable":return"Unavailable"}}driftLabel(n){switch(n.where){case"test":return"only in test";case"live":return"only in live";case"both":return"differs between test and live"}}databaseDialog=V("databaseDialog");databaseEnv=x(null);databaseMode=x("create");databaseProjects=x(null);databaseProjectsError=x(null);databaseProjectRef=x("");connectingDatabase=x(!1);connectDatabaseError=x(null);selectableProjects=O(()=>{let n=this.realm(),e=this.databaseEnv(),i=e?n?.database[e==="test"?"live":"test"]?.projectRef:null;return(this.databaseProjects()??[]).filter(s=>s.projectRef!==i)});async connectSupabase(){await this.runCardAction("supabase",()=>this.supabaseConnect.start(this.realmId(),`/backends/${this.realmId()}/database`))}async disconnectSupabase(n){await this.runCardAction("supabase",async()=>{let e=await h.DELETE("/realms/:realmId/supabase",{wipeSecrets:n},{params:{realmId:this.realmId()}});this.realm.set(e),this.promoteResult.set(null),this.databaseProjects.set(null),await Promise.all([this.loadDatabase(!0),this.loadSecrets(!0)])})}supabaseTokenDialog=V("supabaseTokenDialog");supabaseToken=x("");savingSupabaseToken=x(!1);supabaseTokenError=x(null);supabaseTokensUrl="https://supabase.com/dashboard/account/tokens";openSupabaseToken(){this.supabaseToken.set(""),this.supabaseTokenError.set(null),this.supabaseTokenDialog()?.nativeElement.showModal()}closeSupabaseToken(){this.supabaseTokenDialog()?.nativeElement.close()}async saveSupabaseToken(){let n=this.supabaseToken().trim();if(!(!n||this.savingSupabaseToken())){this.savingSupabaseToken.set(!0),this.supabaseTokenError.set(null);try{await h.POST("/realms/:realmId/supabase/token",{token:n},{params:{realmId:this.realmId()}}),this.closeSupabaseToken(),this.databaseProjects.set(null),await this.loadDatabase(!0)}catch(e){this.supabaseTokenError.set(this.messageOf(e))}finally{this.savingSupabaseToken.set(!1)}}}async openDatabase(n){if(this.database()?.supabase===null){await this.connectSupabase();return}this.databaseEnv.set(n),this.databaseMode.set("create"),this.databaseProjectRef.set(""),this.connectDatabaseError.set(null),this.databaseDialog()?.nativeElement.showModal(),this.databaseProjects()||this.loadProjects()}closeDatabase(){this.databaseDialog()?.nativeElement.close()}async loadProjects(){this.databaseProjectsError.set(null);try{let n=await h.GET("/realms/:realmId/supabase/projects",{params:{realmId:this.realmId()}});this.databaseProjects.set(n.items)}catch(n){this.databaseProjectsError.set(this.messageOf(n))}}onProjectSelect(n){this.databaseProjectRef.set(n.target.value)}async connectDatabase(){let n=this.databaseEnv(),e=this.databaseMode()==="existing"?this.databaseProjectRef():void 0;if(!(!n||this.connectingDatabase()||this.databaseMode()==="existing"&&!e)){this.connectingDatabase.set(!0),this.connectDatabaseError.set(null);try{let i=await h.POST("/realms/:realmId/database",{env:n,projectRef:e},{params:{realmId:this.realmId()}});this.realm.set(i),this.closeDatabase(),await this.loadDatabase(!0)}catch(i){this.connectDatabaseError.set(this.messageOf(i))}finally{this.connectingDatabase.set(!1)}}}async disconnectDatabase(n,e){await this.runCardAction(`database-${n}`,async()=>{let i=await h.DELETE("/realms/:realmId/database/:env",{wipeSecrets:e},{params:{realmId:this.realmId(),env:n}});this.realm.set(i),this.promoteResult.set(null),await Promise.all([this.loadDatabase(!0),this.loadSecrets(!0)])})}promoting=x(!1);promoteResult=x(null);async promoteDatabase(){if(!this.promoting()){this.promoting.set(!0),this.databaseError.set(null),this.promoteResult.set(null);try{let n=await h.POST("/realms/:realmId/database/promote",void 0,{params:{realmId:this.realmId()}});this.promoteResult.set(n),this.database.set(n.status)}catch(n){this.databaseError.set(this.messageOf(n))}finally{this.promoting.set(!1)}}}setEnv(n){if(this.env()!==n){this.envChosen=!0,this.env.set(n);try{localStorage.setItem(this.envStorageKey(),n)}catch{}this.loadTab(this.activeTab())}}envStorageKey(){return`${Vl}${this.realmId()}`}storedEnv(){try{let n=localStorage.getItem(this.envStorageKey());return n==="test"||n==="live"?n:null}catch{return null}}onEnvKeydown(n){if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(n.key))return;n.preventDefault();let e=this.env()==="test"?"live":"test";this.setEnv(e),this.document.getElementById(`realm-env-${e}`)?.focus()}users=x([]);usersLoading=x(!1);usersError=x(null);usersLoadSeq=0;async loadUsers(){let n=++this.usersLoadSeq;this.usersLoading.set(!0),this.usersError.set(null);try{let e=await h.GET("/realms/:realmId/users",{params:{realmId:this.realmId()},queryParams:{env:this.env()}});if(n!==this.usersLoadSeq)return;this.users.set(e.items)}catch(e){n===this.usersLoadSeq&&this.usersError.set(this.messageOf(e))}finally{n===this.usersLoadSeq&&this.usersLoading.set(!1)}}userDialog=V("userDialog");userDetail=x(null);
1userDetailLoading=x(!1);userDetailError=x(null);userDataJson=O(()=>{let n=this.userDetail();return n?JSON.stringify(n.user.data,null,2):""});async openUser(n){this.userDetail.set(null),this.userDetailError.set(null),this.userDetailLoading.set(!0),this.userDialog()?.nativeElement.showModal();try{let e=await h.GET("/realms/:realmId/users/:realmUserId",{params:{realmId:this.realmId(),realmUserId:n}});this.userDetail.set(e)}catch(e){this.userDetailError.set(this.messageOf(e))}finally{this.userDetailLoading.set(!1)}}closeUser(){this.userDialog()?.nativeElement.close()}catalog=x(null);catalogLoading=x(!1);catalogError=x(null);catalogLoadSeq=0;catalogView=x("test");productsOpen=x(!1);productsOpenKey(){return`${Ll}${this.realmId()}`}restoreProductsOpen(){try{this.productsOpen.set(localStorage.getItem(this.productsOpenKey())==="1")}catch{this.productsOpen.set(!1)}}setProductsOpen(n){this.productsOpen.set(n);try{localStorage.setItem(this.productsOpenKey(),n?"1":"0")}catch{}}productsSummary=O(()=>{let n=this.catalog(),e=this.catalogSummary();if(!n||!e)return"";if(!n.connected.test&&!n.connected.live)return"Stripe not connected";let i=n.items.length,s=`${i} ${i===1?"product":"products"}`;return e.issues?`${s} \xB7 ${e.issues} waiting for live`:s});catalogItems=O(()=>{let n=this.catalog()?.items??[];return this.catalogView()==="all"?n:n.filter(e=>e.test)});hiddenLiveOnly=O(()=>this.catalogView()==="all"?0:(this.catalog()?.items??[]).filter(n=>!n.test).length);onCatalogViewKeydown(n){if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(n.key))return;n.preventDefault();let e=this.catalogView()==="test"?"all":"test";this.catalogView.set(e),this.document.getElementById(`realm-catalog-view-${e}`)?.focus()}catalogSummary=O(()=>{let n=this.catalog();if(!n)return null;let e=s=>n.items.filter(c=>c[s]).length,i=n.items.filter(s=>s.status==="drifted"||s.status==="missing_live").length;return{test:e("test"),live:e("live"),issues:i}});async loadCatalog(n=!1){if(!n&&this.catalog())return;let e=++this.catalogLoadSeq;this.catalogLoading.set(!0),this.catalogError.set(null);try{let i=await h.GET("/realms/:realmId/catalog",{params:{realmId:this.realmId()}});if(e!==this.catalogLoadSeq)return;this.catalog.set(i)}catch(i){e===this.catalogLoadSeq&&this.catalogError.set(this.messageOf(i))}finally{e===this.catalogLoadSeq&&this.catalogLoading.set(!1)}}stripeDashboardUrl(n,e){let s=(n==="test"?this.realm()?.test:this.realm()?.live)?.stripeAccountId;return`https://dashboard.stripe.com${s&&s!=="unknown"?`/${s}`:""}${n==="test"?"/test":""}${e}`}stripeApiKeysUrl(n){return this.stripeDashboardUrl(n,"/apikeys")}stripeProductUrl(n,e){return this.stripeDashboardUrl(n,`/products/${e}`)}stripePaymentUrl(n){let{paymentIntentId:e,invoiceId:i,subscriptionId:s}=n.stripe;return e?this.stripeDashboardUrl(this.env(),`/payments/${e}`):i?this.stripeDashboardUrl(this.env(),`/invoices/${i}`):s?this.stripeDashboardUrl(this.env(),`/subscriptions/${s}`):null}stripeRefs(n){let e=n.stripe;return[{label:"Payment intent",id:e.paymentIntentId},{label:"Charge",id:e.chargeId},{label:"Invoice",id:e.invoiceId},{label:"Subscription",id:e.subscriptionId},{label:"Checkout session",id:e.checkoutSessionId},{label:"Customer",id:e.customerId}].filter(i=>!!i.id)}metadataEntries(n){return Object.entries(n.metadata).map(([e,i])=>({key:e,value:i}))}paymentDialog=V("paymentDialog");paymentDetail=x(null);openPayment(n){this.paymentDetail.set(n),this.paymentDialog()?.nativeElement.showModal()}closePayment(){this.paymentDialog()?.nativeElement.close()}catalogBusyKey=x(null);closeMenu(n){n.target.closest("details")?.removeAttribute("open")}requestCatalogSync(n,e){e==="test"?this.requestConfirm({kind:"catalog-sync",item:n,source:e}):this.syncCatalogItem(n,e)}async syncCatalogItem(n,e){if(!(!n.lookupKey||this.catalogBusyKey())){this.catalogBusyKey.set(n.key),this.catalogError.set(null);try{await h.POST("/realms/:realmId/catalog/sync-item",{lookupKey:n.lookupKey,source:e},{params:{realmId:this.realmId()}}),await this.loadCatalog(!0)}catch(i){this.catalogError.set(this.messageOf(i))}finally{this.catalogBusyKey.set(null)}}}requestCatalogArchive(n,e){e==="live"?this.requestConfirm({kind:"catalog-archive",item:n,env:e}):this.archiveCatalogItem(n,e)}async archiveCatalogItem(n,e){if(!(!n.lookupKey||this.catalogBusyKey())){this.catalogBusyKey.set(n.key),this.catalogError.set(null);try{await h.POST("/realms/:realmId/catalog/archive",{env:e,lookupKey:n.lookupKey},{params:{realmId:this.realmId()}}),await this.loadCatalog(!0)}catch(i){this.catalogError.set(this.messageOf(i))}finally{this.catalogBusyKey.set(null)}}}productDialog=V("productDialog");productDetail=x(null);
1openProduct(n){this.productDetail.set(n),this.productDialog()?.nativeElement.showModal()}closeProduct(){this.productDialog()?.nativeElement.close()}lookupKeyDialog=V("lookupKeyDialog");lookupKeyItem=x(null);lookupKeyValue=x("");savingLookupKey=x(!1);lookupKeyError=x(null);openLookupKey(n){this.lookupKeyItem.set(n),this.lookupKeyValue.set(Fl(n.name)),this.lookupKeyError.set(null),this.lookupKeyDialog()?.nativeElement.showModal()}closeLookupKey(){this.lookupKeyDialog()?.nativeElement.close()}async saveLookupKey(){let n=this.lookupKeyItem(),e=this.lookupKeyValue().trim(),i=n?.test?"test":n?.live?"live":null,s=i&&n?.[i];if(!(!n||!i||!s||!e||this.savingLookupKey())){if(!/^[A-Za-z0-9][A-Za-z0-9_.-]*$/.test(e)){this.lookupKeyError.set('Use letters, digits, "_", "-" or "." only.');return}this.savingLookupKey.set(!0),this.lookupKeyError.set(null);try{await h.POST("/realms/:realmId/catalog/lookup-key",{env:i,priceId:s.priceId,lookupKey:e},{params:{realmId:this.realmId()}}),this.closeLookupKey(),await this.loadCatalog(!0)}catch(c){this.lookupKeyError.set(this.messageOf(c))}finally{this.savingLookupKey.set(!1)}}}syncLabel(n){let e=this.catalog()?.connected;switch(n.status){case"in_sync":return"In sync";case"drifted":return"Test and live differ";case"missing_live":return e?.live?"Missing in live":"Test only";case"missing_test":return e?.test?"Missing in test":"Live only";case"no_lookup_key":return"No lookup key"}}payments=x([]);paymentTotals=x([]);paymentsLoading=x(!1);paymentsError=x(null);paymentsLoadSeq=0;async loadPayments(){let n=++this.paymentsLoadSeq;this.paymentsLoading.set(!0),this.paymentsError.set(null);try{let e=await h.GET("/realms/:realmId/payments",{params:{realmId:this.realmId()},queryParams:{env:this.env()}});if(n!==this.paymentsLoadSeq)return;this.payments.set(e.items),this.paymentTotals.set(e.totals)}catch(e){n===this.paymentsLoadSeq&&this.paymentsError.set(this.messageOf(e))}finally{n===this.paymentsLoadSeq&&this.paymentsLoading.set(!1)}}inboxDialog=V("inboxDialog");inbox=x([]);inboxLoading=x(!1);inboxError=x(null);
1openInbox(){this.inboxDialog()?.nativeElement.showModal(),this.loadInbox()}closeInbox(){this.inboxDialog()?.nativeElement.close()}clearingInbox=x(!1);async clearInbox(){if(!this.clearingInbox()){this.clearingInbox.set(!0),this.inboxError.set(null);try{await h.DELETE("/realms/:realmId/test-inbox",void 0,{params:{realmId:this.realmId()}}),this.inbox.set([])}catch(n){this.inboxError.set(this.messageOf(n))}finally{this.clearingInbox.set(!1)}}}async loadInbox(){if(!this.inboxLoading()){this.inboxLoading.set(!0),this.inboxError.set(null);try{let n=await h.GET("/realms/:realmId/test-inbox",{params:{realmId:this.realmId()}});this.inbox.set(n.items)}catch(n){this.inboxError.set(this.messageOf(n))}finally{this.inboxLoading.set(!1)}}}emailDialog=V("emailDialog");emailTemplate=x(null);emailLoading=x(!1);emailError=x(null);emailSubject=x("");emailHtml=x("");emailText=x("");emailView=x("edit");emailPreview=x(null);emailPreviewing=x(!1);emailPreviewDoc=O(()=>{let n=this.emailPreview();return n?this.sanitizer.bypassSecurityTrustHtml(n.html):null});emailTestTo=x("");sendingTestEmail=x(!1);testEmailSentTo=x(null);savingEmail=x(!1);resettingEmail=x(!1);emailBusy=O(()=>this.emailLoading()||this.savingEmail()||this.resettingEmail()||this.emailPreviewing()||this.sendingTestEmail());emailDirty=O(()=>{let n=this.emailTemplate();return n?this.emailSubject()!==n.subject||this.emailHtml()!==n.html||this.emailText()!==(n.text??""):!1});placeholder(n){return"{{"+n+"}}"}openEmailTemplate(){this.emailError.set(null),this.testEmailSentTo.set(null),this.emailView.set("edit"),this.emailPreview.set(null),this.emailTestTo()||this.emailTestTo.set(this.auth.user()?.email??""),this.emailDialog()?.nativeElement.showModal(),this.loadEmailTemplate()}closeEmailTemplate(){this.emailDialog()?.nativeElement.close()}applyEmailTemplate(n){this.emailTemplate.set(n),this.emailSubject.set(n.subject),this.emailHtml.set(n.html),this.emailText.set(n.text??""),this.realm.update(e=>e&&Y(W({},e),{magicLink:Y(W({},e.magicLink),{customTemplate:n.isCustom})}))}emailDraft(){return{subject:this.emailSubject(),html:this.emailHtml(),text:this.emailText().trim()||null}}async loadEmailTemplate(){if(!this.emailLoading()){this.emailLoading.set(!0),this.emailError.set(null);try{let n=await h.GET("/realms/:realmId/email-template",{params:{realmId:this.realmId()}});this.applyEmailTemplate(n)}catch(n){this.emailError.set(this.messageOf(n))}finally{this.emailLoading.set(!1)}}}async showEmailView(n){if(n==="edit"){this.emailView.set("edit");return}if(!this.emailPreviewing()){this.emailPreviewing.set(!0),this.emailError.set(null);try{let e=await h.POST("/realms/:realmId/email-template/preview",this.emailDraft(),{params:{realmId:this.realmId()}});this.emailPreview.set(e),this.emailView.set("preview")}catch(e){this.emailError.set(this.messageOf(e))}finally{this.emailPreviewing.set(!1)}}}async saveEmailTemplate(){if(!this.emailBusy()){this.savingEmail.set(!0),this.emailError.set(null);try{let n=await h.POST("/realms/:realmId/email-template",this.emailDraft(),{params:{realmId:this.realmId()}});this.applyEmailTemplate(n),this.closeEmailTemplate()}catch(n){this.emailError.set(this.messageOf(n))}finally{this.savingEmail.set(!1)}}}async resetEmailTemplate(){if(!this.emailBusy()){this.resettingEmail.set(!0),this.emailError.set(null);try{let n=await h.DELETE("/realms/:realmId/email-template",void 0,{params:{realmId:this.realmId()}});this.applyEmailTemplate(n),this.emailPreview.set(null),this.emailView.set("edit")}catch(n){this.emailError.set(this.messageOf(n))}finally{this.resettingEmail.set(!1)}}}async sendTestEmail(){let n=this.emailTestTo().trim();if(!(!n||this.emailBusy())){this.sendingTestEmail.set(!0),this.emailError.set(null),this.testEmailSentTo.set(null);try{let e=await h.POST("/realms/:realmId/email-template/test",{to:n,template:this.emailDraft()},{params:{realmId:this.realmId()}});this.testEmailSentTo.set(e.to)}catch(e){this.emailError.set(this.messageOf(e))}finally{this.sendingTestEmail.set(!1)}}}senderDialog=V("senderDialog");senderAddress=x("");senderBusy=x(null);senderError=x(null);senderChecked=x(!1);openSender(){this.senderError.set(null),this.senderChecked.set(!1),this.senderAddress.set(this.realm()?.magicLink.sender?.address??""),this.senderDialog()?.nativeElement.showModal()}closeSender(){this.senderDialog()?.nativeElement.close()}async runSender(n,e){if(this.senderBusy())return null;this.senderBusy.set(n),this.senderError.set(null);try{let i=await e();return this.realm.set(i),i}catch(i){return this.senderError.set(this.messageOf(i)),null}finally{this.senderBusy.set(null)}}async requestSender(n=this.senderAddress()){let e=n.trim();e&&(this.senderChecked.set(!1),await this.runSender("request",()=>h.POST("/realms/:realmId/sender-email",{address:e},{params:{realmId:this.realmId()}})))}async checkSender(){this.senderChecked.set(!1),await this.runSender("check",()=>h.POST("/realms/:realmId/sender-email/check",void 0,{params:{realmId:this.realmId()}}))&&this.senderChecked.set(!0)}async setSenderEnabled(n){await this.runSender("use",()=>h.POST("/realms/:realmId/sender-email/use",{enabled:n},{params:{realmId:this.realmId()}}))}async removeSender(){await this.runSender("remove",()=>h.DELETE("/realms/:realmId/sender-email",void 0,{params:{realmId:this.realmId()}}))&&this.senderAddress.set("")}secrets=x(null);secretsLoading=x(!1);secretsError=x(null);syncingSecrets=x(!1);secretsLoadSeq=0;liveProjectConnected=O(()=>!!this.secrets()?.projects.live);secretsNeedPush=O(()=>{let n=this.secrets();return n?n.items.some(e=>this.envs.some(i=>{let s=e[i];return!!s&&n.projects[i]&&(!s.syncedAt||!!s.syncError)})):!1});async loadSecrets(n=!1){if(!n&&this.secrets())return;let e=++this.secretsLoadSeq;this.secretsLoading.set(!0),this.secretsError.set(null);try{let i=await h.GET("/realms/:realmId/secrets",{params:{realmId:this.realmId()}});if(e!==this.secretsLoadSeq)return;this.secrets.set(i)}catch(i){e===this.secretsLoadSeq&&this.secretsError.set(this.messageOf(i))}finally{e===this.secretsLoadSeq&&this.secretsLoading.set(!1)}}secretStatus(n,e){let i=n[e];return i?this.secrets()?.projects[e]?i.syncError?{label:"Not pushed",cls:"is-drifted",title:i.syncError}:i.syncedAt?{label:"Set",cls:"is-live",title:null}:{label:"Not pushed",cls:"is-pending",title:null}:{label:"Pending",cls:"is-pending",title:`Pushed to Supabase once the ${e} database is connected`}:{label:"Missing",cls:e==="test"?"is-missing_test":"is-missing_live",title:null}}async syncSecrets(){if(!this.syncingSecrets()){this.syncingSecrets.set(!0),this.secretsError.set(null);try{let n=await h.POST("/realms/:realmId/secrets/sync",void 0,{params:{realmId:this.realmId()}});this.secrets.set(n)}catch(n){this.secretsError.set(this.messageOf(n))}finally{this.syncingSecrets.set(!1)}}}secretDialog=V("secretDialog");secretOpen=x(!1);secretExisting=x(null);secretName=x("");secretDescription=x("");secretTest=x("");secretLive=x("");savingSecret=x(!1);secretError=x(null);canSaveSecret=O(()=>/^[A-Z][A-Z0-9_]{0,63}
1$/.test(this.secretName())?!!this.secretExisting()||!!this.secretTest()||!!this.secretLive():!1);openSecret(n){this.secretExisting.set(n),this.secretName.set(n?.name??""),this.secretDescription.set(n?.description??""),this.secretTest.set(""),this.secretLive.set(""),this.secretError.set(null),this.secretOpen.set(!0),this.secretDialog()?.nativeElement.showModal()}closeSecret(){this.secretDialog()?.nativeElement.close()}normalizeSecretName(n){return n.toUpperCase().replace(/[^A-Z0-9_]+/g,"_")}async saveSecret(){if(!this.canSaveSecret()||this.savingSecret())return;let n=this.secretExisting(),e=this.secretDescription().trim();this.savingSecret.set(!0),this.secretError.set(null);try{let i=await h.POST("/realms/:realmId/secrets",{name:this.secretName(),description:e!==(n?.description??"")?e||null:void 0,test:this.secretTest()||void 0,live:this.secretLive()||void 0},{params:{realmId:this.realmId()}});this.secrets.set(i),this.closeSecret()}catch(i){this.secretError.set(this.messageOf(i))}finally{this.savingSecret.set(!1)}}async removeSecret(n){await this.runCardAction(`secret-${n}`,async()=>{let e=await h.DELETE("/realms/:realmId/secrets/:name",void 0,{params:{realmId:this.realmId(),name:n}});this.secrets.set(e)})}messageOf(n){return n instanceof Error?n.message:"Something went wrong. Please try again."}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=ge({type:t,selectors:[["app-realm"]],viewQuery:function(e,i){e&1&&Ce(i.editDialog,Fe,5)(i.oauthDialog,$e,5)(i.stripeDialog,Ae,5)(i.confirmDialog,Ke,5)(i.databaseDialog,Be,5)(i.supabaseTokenDialog,Ue,5)(i.userDialog,je,5)(i.paymentDialog,ze,5)(i.productDialog,qe,5)(i.lookupKeyDialog,He,5)(i.inboxDialog,Ge,5)(i.emailDialog,We,5)(i.senderDialog,Ye,5)(i.secretDialog,Ze,5),e&2&&ye(14)},decls:151,vars:43,consts:[["backButton",""],["envToggle",""],["editDialog",""],["oauthDialog",""],["databaseDialog",""],["supabaseTokenDialog",""],["stripeDialog",""],["secretDialog",""],["productDialog",""],["inboxDialog",""],["paymentDialog",""],["lookupKeyDialog",""],["userDialog",""],["confirmDialog",""],["emailDialog",""],["senderDialog",""],["href","#main",1,"skip-link"],[1,"site-header"],[1,"container","header-inner"],["routerLink","/",1,"brand"],["viewBox","0 0 24 24","aria-hidden","true","focusable","false",1,"brand-mark"],["d","M12 3v18M4.2 7.5l15.6 9M4.2 16.5l15.6-9","stroke","currentColor","stroke-width","2.4","stroke-linecap","round","fill","none"],["aria-label","Main"],["routerLink","/dashboard",1,"btn","btn-quiet","btn-sm"],["linkLabel","Settings","linkRoute","/settings"],["id","main","tabindex","-1"],[1,"container-narrow","page-body"],["aria-labelledby","realm-edit-title",1,"confirm-dialog","form-dialog",3,"close"],["id","realm-edit-title",1,"confirm-title"],[1,"dialog-form",3,"submit"],["for","realm-edit-name",1,"field-label"],["id","realm-edit-name","type","text","autocomplete","off","maxlength","80",1,"input",3,"input","value"],["for","realm-edit-logo",1,"field-label"],["id","realm-edit-logo","type","url","autocomplete","off","placeholder","https://",1,"input",3,"input","value"],["for","realm-edit-terms",1,"field-label"],["id","realm-edit-terms","type","url","autocomplete","off","placeholder","https://",1,"input",3,"input","value"],["for","realm-edit-privacy",1,"field-label"],["id","realm-edit-privacy","type","url","autocomplete","off","placeholder","https://",1,"input",3,"input","value"],["for","realm-edit-statement-suffix",1,"field-label"],["id","realm-edit-statement-suffix","type","text","autocomplete","off","maxlength","17","placeholder","e.g. PRO PACK",1,"input",3,"input","compositionend","value"],[1,"field-hint","muted"],["role","alert",1,"error"],[1,"confirm-actions"],["type","button",1,"btn","btn-ghost","btn-sm",3,"click"],["type","submit",1,"btn","btn-primary","btn-sm",3,"disabled"],["aria-labelledby","realm-oauth-title",1,"confirm-dialog","form-dialog",3,"close"],["aria-labelledby","realm-database-title",1,"confirm-dialog","form-dialog",3,"close"],["aria-labelledby","realm-supabase-token-title",1,"confirm-dialog","form-dialog"],["id","realm-supabase-token-title",1,"confirm-title"],[1,"confirm-desc"],["target","_blank","rel","noopener",3,"href"],["for","realm-supabase-token",1,"field-label"],["id","realm-supabase-token","type","password","autocomplete","off","data-1p-ignore","","data-lpignore","true","placeholder","sbp_\u2026",1,"input",3,"input","value"],["aria-labelledby","realm-stripe-title",1,"confirm-dialog","form-dialog",3,"close"],["aria-labelledby","realm-secret-title",1,"confirm-dialog","form-dialog",3,"close"],["aria-labelledby","realm-product-title",1,"confirm-dialog","user-dialog",3,"close"],["aria-labelledby","realm-inbox-title",1,"confirm-dialog","user-dialog"],["id","realm-inbox-title",1,"confirm-title"],[1,"inbox-tools"],[1,"muted","section-note"],[1,"card-actions"],["type","button",1,"btn","btn-ghost","btn-sm",3,"disabled"],["type","button",1,"btn","btn-ghost","btn-sm",3,"click","disabled"],[1,"empty-note","muted"],[1,"cards","inbox-list"],["aria-labelledby","realm-payment-title",1,"confirm-dialog","user-dialog",3,"close"],["aria-labelledby","realm-lookup-key-title",1,"confirm-dialog",3,"close"],["aria-labelledby","realm-user-title",1,"confirm-dialog","user-dialog",3,"close"],["id","realm-user-title",1,"confirm-title"],["aria-busy","true",1,"muted"],["aria-labelledby","realm-confirm-title",1,"confirm-dialog",3,"close"],["aria-labelledby","realm-email-title",1,"confirm-dialog","user-dialog","email-dialog",3,"close"],["id","realm-email-title",1,"confirm-title"],[1,"email-tools"],["role","radiogroup","aria-label","Edit or preview",1,"env-toggle"],["type","button","role","radio",1,"env-option",3,"click"],["type","button","role","radio",1,"env-option",3,"click","disabled"],[1,"dialog-form"],[1,"email-test"],["aria-labelledby","realm-sender-title",1,"confirm-dialog","form-dialog",3,"close"],["id","realm-sender-title",1,"confirm-title"],[1,"page-head-main"],[1,"eyebrow"],["aria-busy","true",1,"boot-line"],["aria-hidden","true",1,"status-dot"],[4,"ngTemplateOutlet"],["type","button",1,"btn","btn-secondary","btn-sm","retry-btn",3,"click"],[1,"page-head"],[1,"page-title"],["type","button",1,"btn","btn-secondary","btn-sm",3,"click"],["role","tablist","aria-label","Backend sections",1,"tabs",3,"keydown"],["type","button","role","tab","id","realm-tab-settings","aria-controls","realm-panel-settings",1,"tab",3,"click","tabindex"],["type","button","role","tab","id","realm-tab-sign-in","aria-controls","realm-panel-sign-in",1,"tab",3,"click","tabindex"],["type","button","role","tab","id","realm-tab-users","aria-controls","realm-panel-users",1,"tab",3,"click","tabindex"],["type","button","role","tab","id","realm-tab-payments","aria-controls","realm-panel-payments",1,"tab",3,"click","tabindex"],["type","button","role","tab","id","realm-tab-secrets","aria-controls","realm-panel-secrets",1,"tab",3,"click","tabindex"],["type","button","role","tab","id","realm-tab-d
1atabase","aria-controls","realm-panel-database",1,"tab",3,"click","tabindex"],["role","tabpanel","id","realm-panel-settings","aria-labelledby","realm-tab-settings"],["role","tabpanel","id","realm-panel-sign-in","aria-labelledby","realm-tab-sign-in"],["role","tabpanel","id","realm-panel-users","aria-labelledby","realm-tab-users"],["role","tabpanel","id","realm-panel-database","aria-labelledby","realm-tab-database"],["role","tabpanel","id","realm-panel-secrets","aria-labelledby","realm-tab-secrets"],["role","tabpanel","id","realm-panel-payments","aria-labelledby","realm-tab-payments"],["aria-labelledby","apps-title",1,"section"],["id","apps-title",1,"section-title"],[1,"cards"],[1,"attach-form",3,"submit"],["for","realm-attach-select",1,"field-label"],[1,"field-row"],["id","realm-attach-select",1,"input",3,"change","value","disabled"],["value",""],[3,"value"],["type","submit",1,"btn","btn-primary",3,"disabled"],["aria-labelledby","danger-title",1,"section"],["id","danger-title",1,"section-title"],[1,"card","card-danger"],[1,"card-info"],[1,"card-title"],[1,"card-desc"],["type","button",1,"btn","btn-danger","btn-sm",3,"click","disabled"],["role","alert",1,"error","card-error"],[1,"card"],[1,"card-desc","muted"],["aria-labelledby","providers-title",1,"section"],["id","providers-title",1,"section-title"],[1,"card-status","is-on"],[1,"card-status"],["type","button",1,"btn","btn-secondary","btn-sm",3,"click","disabled"],[1,"card","card-info-only"],["type","button",1,"btn","btn-danger","btn-sm",3,"disabled"],["type","button",1,"btn","btn-secondary","btn-sm",3,"disabled"],["type","button",1,"btn","btn-sm",3,"btn-primary","btn-ghost"],["type","button",1,"btn","btn-sm",3,"click"],[1,"panel-tools"],["aria-busy","true",1,"muted","section-note"],[1,"table-wrap","fit-wrap",3,"is-loading"],[1,"table-wrap","fit-wrap"],[1,"data-table","fit-table","users-table"],[1,"col-user"],[1,"col-signed-up"],[1,"col-actions"],["scope","col"],[1,"visually-hidden"],[1,"row-clickable"],[1,"col-last-seen"],[1,"col-passkey"],[1,"row-clickable",3,"click"],[1,"user-col"],[1,"user-cell"],["alt","","width","28","height","28",1,"avatar",3,"src"],[1,"user-text"],[1,"user-name"],[1,"user-email","muted"],[1,"actions-col"],["aria-labelledby","database-supabase-title",1,"section"],["id","database-supabase-title",1,"section-title"],["aria-labelledby","database-projects-title",1,"section"],["id","database-projects-title",1,"section-title"],["aria-labelledby","database-changes-title",1,"section"],[1,"catalog-actions"],["id","database-changes-title",1,"section-title"],["target","_blank","rel","noopener","title","Open in Supabase",3,"href"],["type","button",1,"btn","btn-primary","btn-sm",3,"click","disabled"],["type","button",1,"btn","btn-primary","btn-sm",3,"disabled"],[1,"catalog-summary","muted"],[1,"card-actions","publish-actions"],[1,"drift-note"],["type","button",1,"btn","btn-primary",3,"click","disabled"],["role","status",1,"done-note"],[1,"muted"],[1,"error"],[1,"drift-list"],[1,"data-table","fit-table"],[1,"product-cell"],[1,"product-name"],[1,"date-cell"],["aria-labelledby","secrets-title",1,"section"],["id","secrets-title",1,"section-title"],[1,"data-table","fit-table","secrets-table"],["scope","col",1,"col-secret"],[1,"cell-secret"],["title","The agent reported that the app no longer reads this secret. Remove it once you are sure nothing else needs it.",1,"sync-pill","is-missing_live"],[1,"muted","secret-desc",3,"title"],[1,"cell-actions"],[1,"row-menu"],[1,"btn","btn-ghost","btn-sm","row-menu-toggle"],["role","menu",1,"row-menu-list"],["type","button","role","menuitem",1,"row-menu-item",3,"click"],["type","button","role","menuitem",1,"row-menu-item",3,"click","disabled"],["colspan","4"],["aria-labelledby","stripe-title",1,"section"],[1,"section","section-collapsible",3,"toggle","open"],["id","products-title",1,"section-title"],[1,"section-count","muted"],["aria-labelledby","payments-title",1,"section"],["id","payments-title",1,"section-title"],[1,"panel-tools-start"],[1,"row-menu","stripe-menu"],[1,"payment-totals"],["id","stripe-title",1,"section-title"],["type","button",1,"btn","btn-sm",3,"btn-primary","btn-ghost","disabled"],["type","button",1,"btn","btn-sm",3,"click","disabled"],["role","radiogroup","aria-label","Which products to show",1,"env-toggle"],["role","radiogroup","aria-label","Which products to show",1,"env-toggle",3,"keydown"],["type","button","role","radio","id","realm-catalog-view-test","title","Products that exist in test mode, with their live counterparts",1,"env-option",3,"click","tabindex"],["type","button","role","radio","id","realm-catalog-view-all","title","Every product in test and live, including live-only ones",1,"env-option",3,"click","tabindex"],[1,"is-negative"],[1,"data-table","fit-table","catalog-table"],[1,"col-product"],[1,"col-lookup"],[1,"col-env"],["scope","col",1,"cell-lookup"],[1,"cell-lookup"],["target","_blank","rel","noopener","title","Open in Stripe",1,"price-cell",3,"href"],["title","Stripe is not connected for this mode",1,"muted"],[1,"muted","price-meta"],["role","menuitem","target","_blank","rel","noopener",1,"row-menu-item",3,"click","href"],["aria-label","Stripe settings",1,"row-menu-toggle","stripe-menu-toggle"],["viewBox","0 0 24 24","width","16","height","16","aria-hidden","true","focusable","false"],["d","M12 15.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z","fill","none","stroke","currentColor","stroke-width","1.8"],["d","M19.4 15a1.7 1.7 0 0 0 .34 1.87l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.7 1.7 0 0 0-1.87-.34 1.7 1.7 0 0 0-1.03 1.56V21a2 2 0 1 1-4 0v-.09a1.7 1.7 0 0 0-1.11-1.56 1.7 1.7 0 0 0-1.87.34l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.7 1.7 0 0 0 4.6 15a1.7 1.7 0 0 0-1.56-1.03H3a2 2 0 1 1 0-4h.09A1.7 1.7 0 0 0 4.65 8.9a1.7 1.7 0 0 0-.34-1.87l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.7 1.7 0 0 0 1.87.34H9a1.7 1.7 0 0 0 1.03-1.56V3a2 2 0 1 1 4 0v.09a1.7 1.7 0 0 0 1.03 1.56 1.7 1.7 0 0 0 1.87-.34l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.7 1.7 0 0 0-.34 1.87V9a1.7 1.7 0 0 0 1.56 1.03H21a2 2 0 1 1 0 4h-.09A1.7 1.7 0 0 0 19.4 15Z","fill","none","stroke","currentColor","stroke-width","1.8","stroke-linejoin","round"],["type","button","role","menuitem",1,"row-menu-item",3,"disabled"],[1,"row-menu-meta","muted"],["type","button","role","menuitem",1,"row-menu-item"],[1,"payment-total"],[1,"payment-total-amount"],[1,"muted","payment-total-meta"],[1,"data-table","fit-table","payments-table"],[1,"col-date"],[1,"col-type"],[1,"col-amount"],[1,"col-customer"],[1,"col-items"],["scope","col",1,"num"],[1,"num"],[1,"line-item",3,"title"],["routerLink","/backends","aria-label","Back to backends","title","Backends",1,"back-btn"],["viewBox","0 0 24 24","width","18","height","18","aria-hidden","true","focusable","false"],["d","M14.5 6 8.5 12l6 6","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["role","radiogroup","aria-label","Environment",1,"env-toggle",3,"keydown"],["type","button","role","radio","id","realm-env-test",1,"env-option",3,"click","tabindex"],["type","button","role","radio","id","realm-env-live",1,"env-option",3,"click","tabindex"],["
1id","realm-oauth-title",1,"confirm-title"],[1,"steps"],["for","realm-oauth-client-id",1,"field-label"],["id","realm-oauth-client-id","type","text","autocomplete","off","spellcheck","false",1,"input",3,"input","value"],["for","realm-oauth-client-secret",1,"field-label"],["id","realm-oauth-client-secret","type","password","autocomplete","off","data-1p-ignore","","data-lpignore","true",1,"input",3,"input","value"],[1,"copy-line"],["id","realm-database-title",1,"confirm-title"],[1,"choice-group"],[1,"field-label"],[1,"choice"],["type","radio","name","realm-database-mode","value","create",3,"change","checked"],[1,"choice-title"],[1,"choice-desc","muted"],["type","radio","name","realm-database-mode","value","existing",3,"change","checked"],["for","realm-database-project",1,"field-label"],["id","realm-database-project",1,"input",3,"change","value","disabled"],[3,"value","disabled"],["id","realm-stripe-title",1,"confirm-title"],[1,"stripe-permissions"],["for","realm-stripe-key",1,"field-label"],["id","realm-stripe-key","type","password","autocomplete","off","data-1p-ignore","","data-lpignore","true",1,"input",3,"input","placeholder","value"],["id","realm-secret-title",1,"confirm-title"],["for","realm-secret-description",1,"field-label"],["id","realm-secret-description","type","text","autocomplete","off",1,"input",3,"input","value"],["for","realm-secret-test",1,"field-label"],["id","realm-secret-test","type","password","autocomplete","off","data-1p-ignore","","data-lpignore","true",1,"input",3,"input","placeholder","value"],["for","realm-secret-live",1,"field-label"],["id","realm-secret-live","type","password","autocomplete","off","data-1p-ignore","","data-lpignore","true",1,"input",3,"input","placeholder","value"],["for","realm-secret-name",1,"field-label"],["id","realm-secret-name","type","text","autocomplete","off","spellcheck","false","placeholder","ANTHROPIC_API_KEY",1,"input",3,"input","value"],["id","realm-product-title",1,"confirm-title"],[1,"detail-grid"],[1,"detail-heading"],[1,"muted","detail-empty"],[1,"card","inbox-item"],[1,"muted","detail-meta"],["target","_blank","rel","noopener",1,"btn","btn-primary","btn-sm",3,"href"],["type","button",1,"btn","btn-ghost","btn-sm"],[1,"inbox-code"],["id","realm-payment-title",1,"confirm-title"],[1,"detail-list"],[1,"ref-list"],[1,"ref-label","muted"],["id","realm-lookup-key-title",1,"confirm-title"],["for","realm-lookup-key",1,"field-label"],["id","realm-lookup-key","type","text","autocomplete","off","spellcheck","false",1,"input",3,"input","value"],[1,"data-json"],[3,"title"],["id","realm-confirm-title",1,"confirm-title"],[1,"confirm-check"],["type","checkbox",3,"change","checked"],[1,"confirm-desc","muted"],["for","realm-email-subject",1,"field-label"],["id","realm-email-subject","type","text","autocomplete","off","maxlength","200",1,"input",3,"input","value"],["for","realm-email-html",1,"field-label"],["id","realm-email-html","spellcheck","false",1,"input","email-html",3,"input","value"],["for","realm-email-text",1,"field-label"],["id","realm-email-text","spellcheck","false","placeholder","Left empty, a text version is made from the HTML.",1,"input",3,"input","value"],["aria-label","Placeholders",1,"placeholder-list"],[1,"email-preview-subject"],["title","Email preview","sandbox","",1,"email-preview-frame",3,"srcdoc"],[1,"email-preview-text"],["for","realm-email-test-to",1,"field-label"],["id","realm-email-test-to","type","email","autocomplete","email","maxlength","254",1,"input",3,"input","value"],["role","status",1,"field-hint","muted"],["role","alert",1,"field-hint","muted"],["for","realm-sender-address",1,"field-label"],["id","realm-sender-address","type","email","autocomplete","email","maxlength","254","placeholder","[email protected]",1,"input",3,"input","value"]],template:function(e,i){if(e&1){let s=v();a(0,"a",16),r(1,"Skip to content"),o(),a(2,"header",17)(3,"div",18)(4,"a",19),X(),a(5,"svg",20),T(6,"path",21),o(),te(),a(7,"span"),r(8,"ezeki.ai"),o()(),a(9,"nav",22)(10,"a",23),r(11,"Dashboard"),o(),T(12,"app-header-menu",24),o()()(),a(13,"main",25)(14,"div",26),m(15,ot,7,1)(16,st,8,2)(17,La,29,27),o()(),U(18,Na,3,0,"ng-template",null,0,ae)(20,Fa,5,8,"
1ng-template",null,1,ae),a(22,"dialog",27,2),p("close",function(){return i.editError.set(null)}),a(24,"h2",28),r(25,"Edit realm"),o(),a(26,"form",29),p("submit",function(g){return C(s),g.preventDefault(),y(i.saveEdit())}),a(27,"label",30),r(28,"Name"),o(),a(29,"input",31),p("input",function(g){return i.editName.set(i.inputValue(g))}),o(),a(30,"label",32),r(31,"Logo URL"),o(),a(32,"input",33),p("input",function(g){return i.editLogoUrl.set(i.inputValue(g))}),o(),a(33,"label",34),r(34,"Terms URL"),o(),a(35,"input",35),p("input",function(g){return i.editTermsUrl.set(i.inputValue(g))}),o(),a(36,"label",36),r(37,"Privacy policy URL"),o(),a(38,"input",37),p("input",function(g){return i.editPrivacyUrl.set(i.inputValue(g))}),o(),a(39,"label",38),r(40,"Card statement suffix"),o(),a(41,"input",39),p("input",function(g){return i.onStatementSuffixInput(g)})("compositionend",function(g){return i.onStatementSuffixInput(g)}),o(),a(42,"p",40),r(43," Shown after your Stripe statement descriptor on one-time payments. Latin, kanji or kana letters, digits, space
1s, - and . only, up to 17 characters. Subscriptions use the product's descriptor in Stripe. "),o(),m(44,$a,2,1,"p",41),a(45,"div",42)(46,"button",43),p("click",function(){return i.closeEdit()}),r(47,"Cancel"),o(),a(48,"button",44),r(49),o()()()(),a(50,"dialog",45,3),p("close",function(){return i.oauthProvider.set(null)}),m(52,ja,1,1),o(),a(53,"dialog",46,4),p("close",function(){return i.databaseEnv.set(null)}),m(55,Za,29,8),o(),a(56,"dialog",47,5)(58,"h2",48),r(59,"Connect Supabase with a token"),o(),a(60,"p",49),r(61," If your organization does not allow OAuth apps, create a personal access token at "),a(62,"a",50),r(63,"supabase.com/dashboard/account/tokens"),o(),r(64," and paste it here. It never expires, so revoke it there when you stop using ezeki. "),o(),a(65,"form",29),p("submit",function(g){return C(s),g.preventDefault(),y(i.saveSupabaseToken())}),a(66,"label",51),r(67,"Personal access token"),o(),a(68,"input",52),p("input",function(g){return i.supabaseToken.set(i.inputValue(g))}),o(),m(69,Qa,2,1,"p",41),a(70,"div",42)(71,"button",43),p("click",function(){return i.closeSupabaseToken()}),r(72," Cancel "),o(),a(73,"button",44),r(74),o()()()(),a(75,"dialog",53,6),p("close",function(){return i.stripeEnv.set(null)}),m(77,eo,26,9),o(),a(78,"dialog",54,7),p("close",function(){return i.secretOpen.set(!1)}),m(80,oo,23,12),o(),a(81,"dialog",55,8),p("close",function(){return i.productDetail.set(null)}),m(83,uo,15,4),a(84,"div",42)(85,"button",43),p("click",function(){return i.closeProduct()}),r(86,"Close"),o()()(),a(87,"dialog",56,9)(89,"h2",57),r(90,"Test inbox"),o(),a(91,"div",58)(92,"p",59),r(93),o(),a(94,"div",60),m(95,go,2,2,"button",61),a(96,"button",62),p("click",function(){return i.loadInbox()}),r(97),o()()(),m(98,Co,2,1,"p",41),m(99,bo,3,1,"p",63)(100,Po,3,0,"ul",64),a(101,"div",42)(102,"button",43),p("click",function(){return i.closeInbox()}),r(103,"Close"),o()()(),a(104,"dialog",65,10),p("close",function(){return i.paymentDetail.set(null)}),m(106,Do,36,15),a(107,"div",42)(108,"button",43),p("click",function(){return i.closePayment()}),r(109,"Close"),o()()(),a(110,"dialog",66,11),p("close",function(){return i.lookupKeyItem.set(null)}),m(112,Lo,16,5),o(),a(113,"dialog",67,12),p("close",function(){return i.userDetail.set(null)}),a(115,"h2",68),m(116,No,1,1)(117,Fo,1,0),o(),m(118,$o,2,0,"p",69)(119,Ao,2,1,"p",41)(120,Xo,53,19),a(121,"div",42)(122,"button",43),p("click",function(){return i.closeUser()}),r(123,"Close"),o()()(),a(124,"dialog",70,13),p("close",function(){return i.confirmAction.set(null)}),m(126,ol,13,12),o(),a(127,"dialog",71,14),p("close",function(){return i.emailError.set(null)}),a(129,"h2",72),r(130,"Sign-in email"),o(),a(131,"p",59),r(132," The email users get when they sign in with their address. It carries a one-click link and a 6-digit code. "),m(133,ll,1,0)(134,rl,1,0),o(),a(135,"div",73)(136,"div",74)(137,"button",75),p("click",function(){return i.showEmailView("edit")}),r(138," Edit "),o(),a(139,"button",76),p("click",function(){return i.showEmailView("preview")}),r(140),o()(),m(141,sl,2,2,"button",61),o(),m(142,dl,2,0,"p",63)(143,pl,25,9,"form",77)(144,gl,14,4),m(145,bl,9,4,"div",78),o(),a(146,"dialog",79,15),p("close",function(){return i.senderError.set(null)}),a(148,"h2",80),r(149,"Sender address"),o(),m(150,Dl,2,1),o()}if(e&2){let s,c,g,M,S,F,J,j,le,re,se,ee,de,ce,me;l(15),_(i.loading()?15:(s=i.loadError())?16:(s=i.realm())?17:-1,s),l(14),b("value",i.editName()),l(3),b("value",i.editLogoUrl()),l(3),b("value",i.editTermsUrl()),l(3),b("value",i.editPrivacyUrl()),l(3),b("value",i.editStatementSuffix()),l(3),_((c=i.editError())?44:-1,c),l(4),b("disabled",i.savingEdit()||!i.editName().trim()),l(),f(" ",i.savingEdit()?"Saving\u2026":"Save"," "),l(3),_((g=i.oauthProvider())?52:-1,g),l(3),_((M=i.databaseEnv())?55:-1,M),l(7),b("href",i.supabaseTokensUrl,N),l(6),b("value",i.supabaseToken()),l(),_((S=i.supabaseTokenError())?69:-1,S),l(4),b("disabled",i.savingSupabaseToken()||!i.supabaseToken().trim()),l(),f(" ",i.savingSupabaseToken()?"Checking\u2026":"Connect"," "),l(3),_((F=i.stripeEnv())?77:-1,F),l(3),_(i.secretOpen()?80:-1),l(3),_((J=i.productDetail())?83:-1,J),l(10),u(i.copy().backends.inboxNote),l(2),_(i.inbox().length>0?95:-1),l(),b("disabled",i.inboxLoading()||i.clearingInbox()),l(),f(" ",i.inboxLoading()?"Refreshing\u2026":"Refresh"," "),l(),_((j=i.inboxError())?98:-1,j),l(),_(i.inbox().length===0?99:100),l(7),_((le=i.paymentDetail())?106:-1,le),l(6),_((re=i.lookupKeyItem())?112:-1,re),l(4),_((se=i.userDetail())?116:117,se),l(2),_(i.userDetailLoa
1ding()?118:(ee=i.userDetailError())?119:(ee=i.userDetail())?120:-1,ee),l(8),_((de=i.confirmContent())?126:-1,de),l(7),_(i.emailTemplate()?.isCustom?133:134),l(4),w("is-active",i.emailView()==="edit"),I("aria-checked",i.emailView()==="edit"),l(2),w("is-active",i.emailView()==="preview"),b("disabled",i.emailPreviewing()||!i.emailTemplate()),I("aria-checked",i.emailView()==="preview"),l(),f(" ",i.emailPreviewing()?"Rendering\u2026":"Preview"," "),l(),_(i.emailTemplate()?.isCustom?141:-1),l(),_(i.emailLoading()&&!i.emailTemplate()?142:i.emailView()==="edit"?143:(ce=i.emailPreview())?144:-1,ce),l(3),_(i.emailTemplate()?145:-1),l(5),_((me=i.realm())?150:-1,me)}},dependencies:[Ee,be,Me,fe],styles:['[_nghost-%COMP%]{display:block;min-height:100dvh}.page-body[_ngcontent-%COMP%]{padding-block:clamp(2.75rem,7vw,4.5rem) clamp(4rem,8vw,6.5rem)}.page-head[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.75rem 1.25rem;margin-bottom:1rem}.page-head[_ngcontent-%COMP%] .page-title[_ngcontent-%COMP%]{margin-bottom:0}.page-head[_ngcontent-%COMP%] .page-title[_ngcontent-%COMP%]{overflow-wrap:anywhere}.page-head-main[_ngcontent-%COMP%]{position:relative;min-width:0}.back-btn[_ngcontent-%COMP%]{--back-btn-size: calc(38px + .4rem) ;display:inline-flex;align-items:center;justify-content:center;width:var(--back-btn-size);height:var(--back-btn-size);margin-bottom:1rem;border:1px solid var(--hairline);border-radius:999px;background:var(--card);color:var(--muted);text-decoration:none;transition:color .15s ease,border-color .15s ease}.back-btn[_ngcontent-%COMP%]:hover, .back-btn[_ngcontent-%COMP%]:focus-visible{color:var(--ink);border-color:color-mix(in srgb,var(--ink) 25%,var(--hairline))}.back-btn[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--indigo);outline-offset:2px}@media(min-width:880px){.back-btn[_ngcontent-%COMP%]{position:absolute;top:.5rem;left:calc(-1 * var(--back-btn-size) - 1rem);margin-bottom:0;transform:translateY(-50%)}}.boot-line[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.6rem;margin:clamp(2.5rem,6vw,3.5rem) 0 0;padding-top:1.5rem;border-top:1px solid var(--hairline);color:var(--muted)}.retry-btn[_ngcontent-%COMP%]{margin-top:.75rem}.tabs[_ngcontent-%COMP%]{margin-top:clamp(1.5rem,4vw,2.25rem);display:flex;gap:.25rem;overflow-x:auto;overflow-y:hidden;border-bottom:1px solid var(--hairline)}.tab[_ngcontent-%COMP%]{flex:none;padding:.6rem 1rem;border:none;border-bottom:2px solid transparent;margin-bottom:-1px;background:transparent;color:var(--muted);font:inherit;font-weight:600;cursor:pointer}.tab[_ngcontent-%COMP%]:hover, .tab[_ngcontent-%COMP%]:focus-visible{color:inherit}.tab.is-active[_ngcontent-%COMP%]{color:var(--indigo);border-bottom-color:var(--indigo)}.section[_ngcontent-%COMP%]{margin-top:clamp(1.75rem,4vw,2.5rem)}.section-title[_ngcontent-%COMP%]{margin:0 0 .85rem;font-size:1.15rem;font-weight:700;letter-spacing:-.01em}.section-collapsible[_ngcontent-%COMP%] > summary[_ngcontent-%COMP%]{cursor:pointer;list-style:none;display:flex;align-items:baseline;gap:.6rem;margin:0;padding:.5rem 0;border-bottom:1px solid color-mix(in srgb,var(--hairline) 40%,transparent);transition:border-color .15s ease}.section-collapsible[_ngcontent-%COMP%] > summary[_ngcontent-%COMP%]:hover{border-bottom-color:color-mix(in srgb,var(--hairline) 70%,transparent)}.section-collapsible[open][_ngcontent-%COMP%] > summary[_ngcontent-%COMP%]{margin-bottom:.65rem;padding:.2rem 0;border-bottom-color:transparent}.section-collapsible[_ngcontent-%COMP%] > summary[_ngcontent-%COMP%]::-webkit-details-marker{display:none}.section-collapsible[_ngcontent-%COMP%] > summary[_ngcontent-%COMP%]:after{content:"";margin-left:auto;width:.5rem;height:.5rem;align-self:center;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:rotate(135deg);transition:transform .15s ease,border-color .15s ease}.section-collapsible[_ngcontent-%COMP%] > summary[_ngcontent-%COMP%]:hover:after, .section-collapsible[_ngcontent-%COMP%] > summary[_ngcontent-%COMP%]:focus-visible:after{border-color:var(--ink)}.section-collapsible[open][_ngcontent-%COMP%] > summary[_ngcontent-%COMP%]:after{transform:rotate(45deg)}.section-count[_ngcontent-%COMP%]{font-size:.85rem;font-weight:500}.catalog-summary[_ngcontent-%COMP%]{margin:1rem 0 0;font-size:.92rem}.catalog-actions[_ngcontent-%COMP%] .catalog-summary[_ngcontent-%COMP%]{margin:0}.payment-totals[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.75rem 2rem;margin-left:auto}.payment-total[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-end;text-align:right;line-height:1.3}
1.payment-total-amount[_ngcontent-%COMP%]{font-size:1.35rem;font-weight:700;letter-spacing:-.01em;font-variant-numeric:tabular-nums}.payment-total-meta[_ngcontent-%COMP%]{font-size:.85rem}.catalog-actions[_ngcontent-%COMP%]{margin-top:1rem;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.6rem}.table-wrap.fit-wrap[_ngcontent-%COMP%]{overflow:visible}.data-table.fit-table[_ngcontent-%COMP%]{table-layout:fixed}.data-table.fit-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .data-table.fit-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{white-space:normal;overflow-wrap:break-word;vertical-align:top;padding:.55rem 1.1rem .55rem .9rem}.data-table.fit-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{white-space:nowrap}.data-table.fit-table[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{overflow-wrap:anywhere}.date-cell[_ngcontent-%COMP%]{display:flex;flex-direction:column;line-height:1.35}.date-cell[_ngcontent-%COMP%] .muted[_ngcontent-%COMP%]{font-size:.85em}.payments-table[_ngcontent-%COMP%] .col-date[_ngcontent-%COMP%]{width:7.5rem}.payments-table[_ngcontent-%COMP%] .col-type[_ngcontent-%COMP%]{width:6rem}.payments-table[_ngcontent-%COMP%] .col-amount[_ngcontent-%COMP%]{width:6.5rem}.payments-table[_ngcontent-%COMP%] .col-actions[_ngcontent-%COMP%]{width:3.25rem}.payments-table[_ngcontent-%COMP%] .num[_ngcontent-%COMP%]{padding-right:1.25rem}.users-table[_ngcontent-%COMP%] .col-signed-up[_ngcontent-%COMP%], .users-table[_ngcontent-%COMP%] .col-last-seen[_ngcontent-%COMP%]{width:8rem}.users-table[_ngcontent-%COMP%] .col-passkey[_ngcontent-%COMP%]{width:5rem}.users-table[_ngcontent-%COMP%] .col-actions[_ngcontent-%COMP%]{width:6rem}.data-table.fit-table[_ngcontent-%COMP%] .actions-col[_ngcontent-%COMP%]{padding-right:.9rem}.catalog-table[_ngcontent-%COMP%] .col-product[_ngcontent-%COMP%]{width:30%}.catalog-table[_ngcontent-%COMP%] .col-lookup[_ngcontent-%COMP%]{width:20%}.catalog-table[_ngcontent-%COMP%] .col-env[_ngcontent-%COMP%]{width:22%}.catalog-table[_ngcontent-%COMP%] .col-actions[_ngcontent-%COMP%]{width:3.25rem}.data-table.secrets-table[_ngcontent-%COMP%]{table-layout:auto}.data-table.secrets-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{white-space:nowrap}.data-table.secrets-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{vertical-align:middle}.secrets-table[_ngcontent-%COMP%] .col-secret[_ngcontent-%COMP%]{width:100%}.secrets-table[_ngcontent-%COMP%] .cell-secret[_ngcontent-%COMP%]{max-width:0}.data-table.fit-table[_ngcontent-%COMP%] .cell-actions[_ngcontent-%COMP%]{padding-left:0;padding-right:.4rem;text-align:right;overflow:visible}.product-cell[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;gap:.3rem}.product-name[_ngcontent-%COMP%]{font-weight:600}.secret-desc[_ngcontent-%COMP%]{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.row-menu[_ngcontent-%COMP%]{position:relative;display:inline-block}.row-menu-toggle[_ngcontent-%COMP%]{list-style:none;cursor:pointer;font-size:1.1rem;line-height:1}.row-menu-toggle[_ngcontent-%COMP%]::-webkit-details-marker{display:none}.row-menu-toggle[_ngcontent-%COMP%]:hover:not(:disabled){text-decoration:none;background:color-mix(in srgb,var(--indigo) 8%,transparent)}.row-menu-list[_ngcontent-%COMP%]{position:absolute;right:0;top:100%;z-index:5;min-width:13rem;margin:.25rem 0 0;padding:.3rem;list-style:none;text-align:left;background:var(--card);border:1px solid var(--hairline);border-radius:10px;box-shadow:0 8px 24px #0000001f}.row-menu-item[_ngcontent-%COMP%]{display:block;width:100%;padding:.45rem .6rem;border:0;border-radius:6px;background:transparent;color:var(--ink);font:inherit;text-align:left;text-decoration:none;white-space:nowrap;cursor:pointer}.row-menu-item[_ngcontent-%COMP%]:hover, .row-menu-item[_ngcontent-%COMP%]:focus-visible{background:color-mix(in srgb,var(--indigo) 8%,transparent);outline:none}.row-menu-item[_ngcontent-%COMP%]:disabled{cursor:default;opacity:.6}.row-menu-meta[_ngcontent-%COMP%]{display:block;margin-top:.1rem;font-size:.8rem}.panel-tools-start[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.stripe-menu-toggle[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;width:calc(38px + .4rem);height:calc(38px + .4rem);padding:0;border:1px solid var(--hairline);border-radius:999px;background:var(--card);color:var(--muted)}.stripe-menu-toggle[_ngcontent-%COMP%]:hover, .stripe-menu[open][_ngcontent-%COMP%] > .stripe-menu-toggle[_ngcontent-%COMP%]{color:var(--ink);background:var(--card)}.stripe-menu-toggle[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--indigo);outline-offset:2px}.stripe-menu[_ngcontent-%COMP%] .row-menu-list[_ngcontent-%COMP%]{right:auto;left:0}@media(max-width:640px){.data-table.fit-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .data-table.fit-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding-left:.5rem;padding-right:.5rem}.data-table.fit-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:first-child, .data-table.fit-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:first-child{padding-left:.9rem}.data-table.fit-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%]:last-child, .data-table.fit-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:last-child:not(.cell-actions){padding-right:.9rem}.data-table.fit-table[_ngcontent-%COMP%] .cell-actions[_ngcontent-%COMP%]{padding-left:0}.catalog-table[_ngcontent-%COMP%] .col-lookup[_ngcontent-%COMP%], .catalog-table[_ngcontent-%COMP%] .cell-lookup[_ngcontent-%COMP%]{display:none}.users-table[_ngcontent-%COMP%] .col-signed-up[_ngcontent-%COMP%]{width:6.5rem}.catalog-table[_ngcontent-%COMP%] .col-product[_ngcontent-%COMP%]{width:40%}.catalog-table[_ngcontent-%COMP%] .col-env[_ngcontent-%COMP%]{width:24%}}.price-cell[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;line-height:1.35;color:inherit;text-decoration:none;border-radius:6px}.price-cell[_ngcontent-%COMP%]:hover strong[_ngcontent-%COMP%], .price-cell[_ngcontent-%COMP%]:focus-visible strong[_ngcontent-%COMP%]{text-decoration:underline}.price-cell[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--indigo);outline-offset:2px}.price-meta[_ngcontent-%COMP%]{font-size:.85em}.sync-pill[_ngcontent-%COMP%]{--pill-tone: var(--muted);display:inline-flex;align-items:center;align-self:flex-start;padding:.2rem .65rem;border-radius:999px;border:1px solid color-mix(in srgb,var(--pill-tone) 22%,transparent);background:color-mix(in srgb,var(--pill-tone) 8%,transparent);font-size:.78rem;font-weight:600;line-height:1.4;color:var(--ink);white-space:nowrap;vertical-align:middle}.sync-pill.is-in_sync[_ngcontent-%COMP%], .sync-pill.is-live[_ng
1content-%COMP%]{--pill-tone: var(--mint)}.sync-pill.is-drifted[_ngcontent-%COMP%], .sync-pill.is-unavailable[_ngcontent-%COMP%]{--pill-tone: var(--error);color:var(--error)}.sync-pill.is-missing_live[_ngcontent-%COMP%]{--pill-tone: var(--amber);color:var(--amber)}.sync-pill.is-missing_test[_ngcontent-%COMP%]{--pill-tone: var(--sky);color:var(--sky)}.section-note[_ngcontent-%COMP%]{margin:.75rem 0 0;font-size:.92rem;line-height:1.5}.empty-note[_ngcontent-%COMP%]{margin:1.25rem 0 0}.cards[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:grid;gap:1rem}.card[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.85rem 1.25rem;padding:1.15rem 1.35rem;border:1px solid var(--hairline);border-radius:var(--radius-card);background:var(--card)}.card-danger[_ngcontent-%COMP%]{border-color:color-mix(in srgb,var(--error) 35%,var(--hairline))}.card-info[_ngcontent-%COMP%]{min-width:min(20rem,100%);flex:1}.card-inline[_ngcontent-%COMP%] .card-info[_ngcontent-%COMP%]{min-width:min(14rem,100%)}.card-title[_ngcontent-%COMP%]{margin:0 0 .35rem;font-size:1.05rem;font-weight:700;letter-spacing:-.01em;overflow-wrap:anywhere}.card-desc[_ngcontent-%COMP%]{margin:.25rem 0 0;color:var(--muted);font-size:.92rem;line-height:1.5;overflow-wrap:anywhere}.card-desc[_ngcontent-%COMP%] a[_ngcontent-%COMP%], .steps[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:var(--indigo);font-weight:600;text-decoration:none}.card-desc[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover, .card-desc[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:focus-visible, .steps[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover, .steps[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:focus-visible{text-decoration:underline}.card-status[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.35rem;margin-left:.5rem;vertical-align:middle;font-size:.78rem;font-weight:600;letter-spacing:.02em;color:var(--muted)}.card-status.is-on[_ngcontent-%COMP%]{color:var(--ink)}.card-status[_ngcontent-%COMP%] .status-dot[_ngcontent-%COMP%]{animation:none}.card-actions[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.6rem}.card[_ngcontent-%COMP%] > .card-actions[_ngcontent-%COMP%]{justify-content:flex-end;margin-left:auto}@media(max-width:640px){.card[_ngcontent-%COMP%] > .card-actions[_ngcontent-%COMP%]{flex-basis:100%;justify-content:center}.card[_ngcontent-%COMP%] > .card-actions[_ngcontent-%COMP%] .btn-danger[_ngcontent-%COMP%]{margin-left:auto}}.card-error[_ngcontent-%COMP%]{flex-basis:100%;margin:0}.attach-form[_ngcontent-%COMP%]{margin-top:1.25rem}.attach-form[_ngcontent-%COMP%] .field-row[_ngcontent-%COMP%]{align-items:stretch}.panel-tools[_ngcontent-%COMP%]{margin-top:1.5rem;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.75rem}.panel-tools[_ngcontent-%COMP%] .env-toggle[_ngcontent-%COMP%], .catalog-actions[_ngcontent-%COMP%] .env-toggle[_ngcontent-%COMP%]{margin-top:0}.env-toggle[_ngcontent-%COMP%]{margin-top:1.5rem;display:inline-flex;padding:.2rem;border:1px solid var(--hairline);border-radius:999px;background:var(--card)}.env-option[_ngcontent-%COMP%]{min-height:36px;padding:0 1rem;border:none;border-radius:999px;background:transparent;color:var(--muted);font:inherit;font-weight:600;cursor:pointer}.env-option.is-active[_ngcontent-%COMP%]{background:var(--indigo);color:var(--card)}.env-option[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--indigo);outline-offset:2px}.table-wrap[_ngcontent-%COMP%]{margin-top:1rem;overflow-x:auto;border:1px solid var(--hairline);border-radius:var(--radius-card);background:var(--card)}.table-wrap.is-loading[_ngcontent-%COMP%]{opacity:.6}.data-table[_ngcontent-%COMP%]{width:100%;border-collapse:collapse;font-size:.92rem}.data-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .data-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:.7rem .9rem;text-align:left;white-space:nowrap;border-top:1px solid var(--hairline);vertical-align:middle}.data-table[_ngcontent-%COMP%] thead[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{border-top:0;color:var(--muted);font-size:.8rem;font-weight:600}.data-table[_ngcontent-%COMP%] .num[_ngcontent-%COMP%]{text-align:right;font-variant-numeric:tabular-nums}.data-table[_ngcontent-%COMP%] code[_ngcontent-%COMP%], .detail-grid[_ngcontent-%COMP%] code[_ngcontent-%COMP%], .detail-list[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{font-size:.85em}.is-negative[_ngcontent-%COMP%]{color:var(--error)}.row-clickable[_ngcontent-%COMP%]{cursor:pointer}.row-clickable[_ngcontent-%COMP%]:hover{background:color-mix(in srgb,var(--indigo) 5%,transparent)}.data-table[_ngcontent-%COMP%] .actions-col[_ngcontent-%COMP%]{text-align:right}.user-cell[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.65rem;min-width:0}.user-text[_ngcontent-%COMP%]{display:flex;flex-direction:column;min-width:0;line-height:1.3}.user-email[_ngcontent-%COMP%]{font-size:.85em}
1.user-name[_ngcontent-%COMP%], .user-email[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.avatar[_ngcontent-%COMP%]{width:28px;height:28px;border-radius:999px;object-fit:cover}.user-name[_ngcontent-%COMP%]{font-weight:600}.line-item[_ngcontent-%COMP%]{display:block}.inbox-tools[_ngcontent-%COMP%]{margin-top:.5rem;display:flex;flex-direction:column;align-items:flex-end;gap:.6rem}.inbox-tools[_ngcontent-%COMP%] .section-note[_ngcontent-%COMP%]{margin:0;align-self:stretch}.inbox-list[_ngcontent-%COMP%]{margin-top:1rem;gap:.5rem}.inbox-item[_ngcontent-%COMP%]{flex-wrap:nowrap;padding:.6rem .75rem .6rem 1.1rem}.inbox-item[_ngcontent-%COMP%] .card-info[_ngcontent-%COMP%]{min-width:0}.inbox-item[_ngcontent-%COMP%] .card-title[_ngcontent-%COMP%]{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inbox-item[_ngcontent-%COMP%] .card-actions[_ngcontent-%COMP%]{flex:none;flex-wrap:nowrap}.form-dialog[_ngcontent-%COMP%]{width:min(32rem,100vw - 2rem);max-width:none}.user-dialog[_ngcontent-%COMP%]{width:min(40rem,100vw - 2rem);max-width:none;max-height:calc(100dvh - 2rem);overflow:auto}.dialog-form[_ngcontent-%COMP%] .field-label[_ngcontent-%COMP%]{margin-top:.85rem}.dialog-form[_ngcontent-%COMP%] .field-label[_ngcontent-%COMP%]:first-child{margin-top:0}.dialog-form[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{width:100%}.dialog-form[_ngcontent-%COMP%] .field-hint[_ngcontent-%COMP%]{margin:.45rem 0 0;font-size:.85rem;line-height:1.5}.dialog-form[_ngcontent-%COMP%] .error[_ngcontent-%COMP%]{margin:.75rem 0 0}.dialog-form[_ngcontent-%COMP%] .confirm-actions[_ngcontent-%COMP%], .form-dialog[_ngcontent-%COMP%] .confirm-actions[_ngcontent-%COMP%], .user-dialog[_ngcontent-%COMP%] .confirm-actions[_ngcontent-%COMP%]{margin-top:1.25rem}.steps[_ngcontent-%COMP%]{margin:0 0 1.15rem;padding-left:1.25rem;color:var(--muted);font-size:.92rem;line-height:1.55}.steps[_ngcontent-%COMP%] li[_ngcontent-%COMP%] + li[_ngcontent-%COMP%]{margin-top:.4rem}.copy-line[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem .6rem;margin-top:.25rem}.copy-line[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{overflow-wrap:anywhere;font-size:.85em;color:var(--ink)}.detail-grid[_ngcontent-%COMP%]{display:grid;grid-template-columns:max-content 1fr;gap:.35rem 1rem;margin:0;font-size:.92rem}.detail-grid[_ngcontent-%COMP%] dt[_ngcontent-%COMP%], .detail-grid[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{display:flex;align-items:center;min-height:1.6rem}.detail-grid[_ngcontent-%COMP%] dt[_ngcontent-%COMP%]{color:var(--muted)}.detail-grid[_ngcontent-%COMP%] dd[_ngcontent-%COMP%]{margin:0;overflow-wrap:anywhere}.detail-grid[_ngcontent-%COMP%] .copy-line[_ngcontent-%COMP%]{margin-top:0}.ref-list[_ngcontent-%COMP%]{margin:0;padding:0;list-style:none;font-size:.92rem}.ref-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%] + li[_ngcontent-%COMP%]{margin-top:.5rem}.ref-label[_ngcontent-%COMP%]{display:block;font-size:.8rem}.ref-list[_ngcontent-%COMP%] .copy-line[_ngcontent-%COMP%]{flex-wrap:nowrap;align-items:center;margin-top:.1rem}.ref-list[_ngcontent-%COMP%] .copy-line[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0}.ref-list[_ngcontent-%COMP%] .copy-line[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{flex:none}.detail-heading[_ngcontent-%COMP%]{margin:1.25rem 0 .4rem;font-size:.78rem;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}.detail-empty[_ngcontent-%COMP%]{margin:0;font-size:.92rem}.detail-list[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:grid;gap:.35rem;font-size:.92rem}.detail-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{overflow-wrap:anywhere}.data-json[_ngcontent-%COMP%]{margin:0;padding:.85rem 1rem;max-height:20rem;overflow:auto;border:1px solid var(--hairline);border-radius:calc(var(--radius-card) - 4px);background:color-mix(in srgb,var(--ink) 4%,var(--card));font-size:.82rem;line-height:1.5}.detail-meta[_ngcontent-%COMP%]{margin-left:.4rem;font-size:.8rem;font-weight:500}.publish-actions[_ngcontent-%COMP%]{margin-top:1rem}.drift-note[_ngcontent-%COMP%]{margin-top:1rem;padding:.85rem 1rem;border:1px solid color-mix(in srgb,var(--error) 40%,var(--hairline));border-radius:.75rem;background:color-mix(in srgb,var(--error) 6%,transparent)}.drift-note[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}.drift-note[_ngcontent-%COMP%] p[_ngcontent-%COMP%] + p[_ngcontent-%COMP%], .drift-list[_ngcontent-%COMP%]{margin-top:.5rem}.drift-list[_ngcontent-%COMP%]{padding-left:1.2rem;font-size:.92rem}.choice-group[_ngcontent-%COMP%]{display:grid;gap:.6rem;margin:0;padding:0;border:0}.choice[_ngcontent-%COMP%]{display:flex;gap:.7rem;align-items:flex-start;padding:.7rem .85rem;border:1px solid var(--hairline);border-radius:.75rem;cursor:pointer}.choice[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{margin-top:.2rem}.choice-title[_ngcontent-%COMP%]{display:block;font-weight:600}.choice-desc[_ngcontent-%COMP%]{display:block;font-size:.88rem;margin-top:.15rem}.email-dialog[_ngcontent-%COMP%]{width:min(56rem,100vw - 2rem)}.email-tools[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.6rem;margin:.75rem 0 .25rem}.dialog-form[_ngcontent-%COMP%] textarea.input[_ngcontent-%COMP%]{min-height:9rem;padding:.75rem 1.1rem;border-radius:14px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.85rem;line-height:1.5;resize:vertical}.dialog-form[_ngcontent-%COMP%] textarea.input.email-html[_ngcontent-%COMP%]{min-height:18rem}.placeholder-list[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:.35rem .5rem;margin:.45rem 0 0;padding:0;list-style:none}.placeholder-list[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:inline-flex;align-items:baseline;gap:.3rem;font-size:.82rem;color:var(--muted)}.placeholder-list[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{color:var(--ink);font-size:.85em}.email-preview-subject[_ngcontent-%COMP%]{margin:0 0 .6rem;font-size:.95rem}.email-preview-frame[_ngcontent-%COMP%]{display:block;width:100%;height:32rem;border:1px solid var(--hairline);border-radius:14px;background:#fff}.email-preview-text[_ngcontent-%COMP%]{margin:.6rem 0 0}.stripe-permissions[_ngcontent-%COMP%]{margin:-.5rem 0 1rem;font-size:.9rem}.stripe-permissions[_ngcontent-%COMP%] summary[_ngcontent-%COMP%]{cursor:pointer;width:fit-content}.stripe-permissions[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin:.4rem 0 0;padding-left:1.25rem;line-height:1.6}.email-preview-text[_ngcontent-%COMP%] pre[_ngcontent-%COMP%]{margin:.5rem 0 0;padding:.75rem 1rem;border:1px solid var(--hairline);border-radius:14px;font-size:.82rem;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere}.email-test[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;margin-top:1rem}.email-test[_ngcontent-%COMP%] .input[_ngcontent-%COMP%]{flex:1 1 14rem}.email-test[_ngcontent-%COMP%] .field-hint[_ngcontent-%COMP%]{flex-basis:100%;margin:0}.inbox-code[_ngcontent-%COMP%]{margin-left:.5rem;padding:.05rem .4rem;border-radius:6px;background:#221d310f;font-size:.9em;letter-spacing:.12em;color:var(--ink)}']})};export{De as RealmPage};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.