1import{j as e,c as ze,h as Be,r as l,L as ve}from"./vendor-react-2mXWPygV.js";import{q as Ie,x as He,w as we,y as je,E as Ye}from"./vendor-app-BYWHQm7D.js";import{l as ee,c as _,u as Qe,P as $e,O as Ge,Q as Ke,U as Ve,V as We,X as Xe,Y as Ze,A as Je,B as c,S as et,b as tt,q as C,Z as st,$ as nt,a0 as at}from"./index-Bc0LLRT4.js";import{A as it}from"./archive-masthead.component-Bn-wSQ5z.js";import{u as rt,q as ot,p as lt,o as ct}from"./vendor-ui-CZXIQ_Np.js";const dt="TRACE_APNS_TOKEN",ut="TRACE_PUSH_RESULT";function mt(){if(!ee())return!1;try{const t=window.webkit?.messageHandlers?.tracePush;return t?(t.postMessage({op:"requestPermissionAndRegister"}),!0):!1}catch{return!1}}function pt(t){const n=i=>{if(i.source!==window)return;const a=i.data;if(!a||a.type!==dt||typeof a.token!="string")return;const d=a.environment==="production"?"production":"sandbox";t({token:a.token,environment:d})};return window.addEventListener("message",n),()=>window.removeEventListener("message",n)}function ht(t){if(!t||typeof t!="object")return null;const n=t;return n.type!==ut||n.status!=="granted"&&n.status!=="denied"&&n.status!=="error"?null:{status:n.status,message:typeof n.message=="string"?n.message:void 0,code:typeof n.code=="string"?n.code:void 0}}function gt(t){const n=i=>{if(i.source!==window)return;const a=ht(i.data);a&&t(a)};return window.addEventListener("message",n),()=>window.removeEventListener("message",n)}const xt="exportAccount";function ft(){return window.webkit?.messageHandlers?.traceDownload}function bt(t){const n=ft();return window.__TRACE_NATIVE_SHELL__!==!0||typeof n?.postMessage!="function"?!1:(n.postMessage({op:xt,filename:t}),!0)}function yt(t){return _("rounded-sm border bg-surface-1 p-4 shadow-[0_1px_0_color-mix(in_oklab,var(--border)_45%,transparent)]",t==="danger"?"border-[color-mix(in_oklab,var(--danger-600)_35%,var(--border))] bg-[var(--danger-container)]":"border-border-subtle")}function vt(t){return _("text-sm font-semibold",t==="danger"?"text-[var(--on-danger-container)]":"text-content-primary")}function m({title:t,description:n,right:i,tone:a="default",children:d,className:p}){return e.jsx("section",{className:_(yt(a),p),children:e.jsxs("div",{className:"flex flex-wrap items-start gap-3",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:vt(a),children:t}),n?e.jsx("div",{className:"mt-1 text-sm text-content-muted",children:n}):null,d?e.jsx("div",{className:"mt-3",children:d}):null]}),i?e.jsx("div",{className:"w-full shrink-0 sm:w-auto",children:i}):null]})})}const O={default_mode:"anonymous",display_name:null,handle:null,url:null};function J(t){return t instanceof Error?t.message:String(t)}function wt(t){if(!t)return"Forward AO3 subscription announcements to a private Trace address.";if(t.address_state==="rotation_required")return"Your legacy private address must be rotated before forwarding setup can continue.";switch(t.setup_state){case"verification_required":return"Your private address is ready. Capture Gmail verification, then create an AO3-only forwarding rule.";case"waiting_for_first_ao3":return"Forwarding setup is complete. Trace is waiting for the first real AO3 subscription announcement.";case"active":return t.last_successful_delivery_at?`Private forwarding active. Last AO3 delivery ${new Date(t.last_successful_delivery_at).toLocaleString()}.`:"Private forwarding is active.";case"needs_attention":return"Forwarding needs attention. Open setup to review the latest verification or AO3 message.";default:return"Forward AO3 subscription announcements to a private Trace address."}}function jt(t){return t??O}function w(t){const n=t?.trim();return n||null}function Nt(t,n){return t.default_mode===n.default_mode&&w(t.display_name)===n.display_name&&w(t.handle)===n.handle&&w(t.url)===n.url}function St(t){return typeof t!="number"?null:`${t.toLocaleString()} ${t===1?"story":"stories"}`}function _t(t){const n=new URL(t);return n.searchParams.set("action","write-review"),n.toString()}function Dt({preview:t}={}){const{user:n,logout:i}=Ie(),a=Qe(),d=He(),p=ze(),[H]=Be(),r=!!t,k=t?.storyUpdates!=null,[L,A]=l.useState(!1),[f,b]=l.useState(!1),[U,h]=l.useState(""),[j,Y]=l.useState(!1),[te,D]=l.useState(null),[se,ne]=l.useState(!1),[ae,ie]=l.useState(null),[Q,re]=l.useState(!1),[oe,$]=l.useState(null),[R,y]=l.useState("idle"),[E,M]=l.useState("idle"),{preference:Ne,setPreference:Se}=$e(),{open:_e}=Ge(),G=t?.postDelete??H.get("post")==="delete",o=t?.nativeShell??ee(),ke=t?.user??n,le=l.useCallback(async(s=!1)=>{const x=ee();ie(null),ne(!0);try{await Ke(i,Ve(),{revokeDeviceSession:a.revokeExtensionDeviceSession,deviceSessionsAlreadyRemoved:s}),x&&p("/",{replace:!0})}finally{ne(!1)}},[a,i,p]);l.useEffect(()=>{G&&b(!0)},[G]);const Ae=l.useCallback(()=>{b(!1),A(!1),h(""),D(null)},[]),N=we({queryKey:C.me,queryFn:()=>a.me(),enabled:!r&&a.isReady,staleTime:6e4}),F=we({queryKey:C.accountPublicAttribution,queryFn:()=>a.getAccountPublicAttribution(),enabled:!r&&a.isReady,staleTime:6e4}),K=We(k&&!r),v=Xe(k&&!r),V=r?t.publicAttributionError?void 0:{public_attribution:t.publicAttribution??O}:F.data,[T,ce]=l.useState(O);l.useEffect(()=>{ce(jt(V?.public_attribution))},[V?.public_attribution]);const W=je({mutationFn:async s=>r?{public_attribution:{...O,...s}}:a.patchAccountPublicAttribution(s),onSuccess:s=>{d.setQueryData(C.accountPublicAttribution,s)}}),de=je({mutationFn:async s=>r?{ok:!0,push_suggestions_enabled:s}:a.patchNotificationPrefs(s),onSuccess:()=>{d.invalidateQueries({queryKey:C.me})}});l.useEffect(()=>pt(({token:s,environment:x})=>{(async()=>{try{await a.registerApnsToken({device_token:s,environment:x}),y("granted")}catch{y("error")}})()}
1),[a]),l.useEffect(()=>{if(o)return gt(s=>{y(s.status)})},[o]),l.useEffect(()=>{if(o)return Ze(s=>{s.op==="manageSubscriptions"&&M(s.status==="error"?"error":"idle")})},[o]),l.useEffect(()=>{if(!o||E!=="opening")return;const s=()=>{M("idle"),d.invalidateQueries({queryKey:C.me})},x=()=>{document.visibilityState==="visible"&&s()};window.addEventListener("focus",s),document.addEventListener("visibilitychange",x);const I=window.setTimeout(s,15e3);return()=>{window.removeEventListener("focus",s),document.removeEventListener("visibilitychange",x),window.clearTimeout(I)}},[E,o,d]);const u=t?.me??N.data,Ee=r?!1:N.isPending,Te=r?!1:N.isFetching,ue=r?!1:N.isError,Pe=r?!1:F.isPending,Ce=r?!!t.publicAttributionError:F.isError;l.useEffect(()=>{u?.push_suggestions_enabled===!1&&y("idle")},[u?.push_suggestions_enabled]);const Oe=s=>{de.mutate(s,{onSuccess:()=>{if(!s){y("idle");return}o&&(y("requesting"),mt()||y("error"))}})};async function Le(){if(Y(!0),D(null),r){D("Preview only. Account deletion is disabled here."),Y(!1);return}try{await a.deleteAccount(),await le(!0)}catch(s){D(J(s)||"Failed to delete account."),Y(!1)}}async function Ue(){if(!r)try{re(!0),$(null);const s=`trace-export-${new Date().toISOString().slice(0,10)}.zip`;if(bt(s))return;if(o){$("Update Trace or open Trace in Safari to export your account data.");return}const x=await a.exportAccount(),I=URL.createObjectURL(x),P=document.createElement("a");P.href=I,P.download=s,document.body.appendChild(P),P.click(),P.remove(),URL.revokeObjectURL(I)}catch(s){$(J(s)||"Failed to export account data.")}finally{re(!1)}}async function me(){if(!r)try{const{url:s}=await a.openPortal();window.location.assign(s)}catch{try{const{url:s}=await a.createCheckout("month");window.location.assign(s)}catch{}}}function De(){r||(M("opening"),st()||M("error"))}const pe=U.trim().toUpperCase()==="DELETE",g=!!u?.pro,S=u?.billing,Re=S?.apple.present===!0,X=S?.apple.active===!0,Me=S?.stripe.present===!0,Z=g&&S?.stripe.present===!0&&S.stripe.active===!1&&S.apple.active===!1,Fe=o&&X,he=Ee||Te&&!u,ge=o&&u?.push_suggestions_enabled?R==="requesting"?"Waiting for iOS notification permission...":R==="granted"?"Notifications are allowed on this device.":R==="denied"?"Notifications are blocked for Trace. Turn them on in iOS Settings to receive the weekly digest.":R==="error"?"Trace couldn't finish notification setup. Try turning the weekly digest off and on again.":null:null,xe=u?.pro_expires_at?new Date(u.pro_expires_at):null,q=xe?xe.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):null,fe=St(u?.library_count),z=t?.storyUpdates?{notifications_enabled:t.storyUpdates.notificationsEnabled??!1,title_previews_enabled:t.storyUpdates.titlePreviewsEnabled??!1}:v.data?.preferences??K.data?.preferences,B=K.data?.methods.forwarding,be=t?.storyUpdates?.lastSuccessfulDeliveryAt??B?.last_successful_delivery_at??null,ye=t?.storyUpdates?.addressCreated??(B?.address_state!==void 0&&B.address_state!=="not_created"),qe=t?.storyUpdates?be?`Private forwarding active. Last AO3 delivery ${new Date(be).toLocaleString()}.`:ye?"Your private address is ready. Resume Gmail verification and the AO3-only forwarding rule.":"Forward AO3 subscription announcements to a private Trace address.":wt(B);return e.jsxs(Je,{className:"archive-editorial-shell",archivePreview:t?.archivePreview,advocacyPromptPreview:t?.advocacyPrompt,children:[e.jsx(Ye,{children:e.jsx("title",{children:"trace â Account"})}),e.jsx("div",{className:"library-main-canvas",children:e.jsxs("main",{className:"relative z-[1] min-h-[calc(100dvh-4rem)] w-full min-w-0 pb-24 sm:pb-10",children:[e.jsx(it,{eyebrow:"Trace account",title:e.jsxs(e.Fragment,{children:["Account",e.jsx("span",{"aria-hidden":"true",className:"font-normal italic text-[var(--rust)]",children:"."})]}),description:G?"Please confirm account deletion below.":void 0,meta:e.jsxs("span",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 font-mono text-2xs leading-5 tracking-normal text-[var(--ink-3)]",children:[e.jsx("span",{className:"text-[var(--rust)]",children:"/settings"}),e.jsx("span",{children:g?"Trace Unlimited":"Free plan"}),fe?e.jsx("span",{children:fe}):null]}),density:"slim",spacing:"ledger",layout:"stacked",width:"content",titleId:"settings-hero-heading"}),e.jsxs("div",{className:"mx-auto grid w-full max-w-4xl gap-3 px-[18px] pb-14 sm:px-12 sm:pb-16",children:[e.jsx(m,{title:"Account",description:e.jsx("span",{className:"break-words",children:ke?.email||"â"}),right:o?e.jsx(c,{variant:"outline",size:"lg",className:"w-full sm:w-auto",disabled:se,onClick:()=>{le().catch(s=>{console.error("Failed to sign out",s),ie("Sign out couldn't finish. Check your connection and try again.")})},children:se?"Signing outâ¦":"Sign out"}):void 0}),ae?e.jsx("p",{className:"px-1 text-sm leading-5 text-danger-700",role:"alert",children:ae}):null,e.jsx(At,{draft:T,saved:V?.public_attribution??O,loading:Pe,saving:W.isPending,error:Ce?"Could not load public identity settings.":W.isError?"Could not save public identity settings.":null,onDraftChange:ce,onRetry:()=>{r||F.refetch()},onSave:()=>{W.mutate({default_mode:T.default_mode,display_name:w(T.display_name),handle:w(T.handle),url:w(T.url)})}}),e.jsxs(m,{title:"Trace Unlimited",description:he?"Checking subscription statusâ¦":ue?"Couldnât load subscription status.":Z?"Your Trace Unlimited access stays active while Stripe retries the payment.":g?o&&X?e.jsxs(e.Fragment,{children:["Active via Apple subscription.",q?` Current period ends ${q}.`:""]}):e.jsxs(e.Fragment,{children:["Active subscription.",q?` Current period ends ${q}.`:""]}):"Unlock unlimited library size and full stats access.",right:he?void 0:ue?e.jsx(c,{variant:"outline",size:"lg",className:"w-full sm:w-auto",onClick:()=>{N.refetch()},children:"Retry"}):Z&&!o?e.jsx(c,{variant:"outline",size:"lg",className:"w-full sm:w-auto",onClick:()=>{me()},children:"Update payment"}):g?Fe?e.jsx(c,{variant:"outline",size:"lg",className:"w-full sm:w-auto",onClick:De,disabled:E==="opening",loading:E==="opening",children:"Manage in Apple"}):o?void 0:e.jsx(c,{variant:"outline",size:"lg",className:"w-full sm:w-auto",onClick:()=>{me()},children:"Manage billing"}):e.jsx(c,{variant:"solid",size:"lg",className:"w-full sm:w-auto",onClick:()=>_e("settings"),children:"Get Trace Unlimited"}),children:[Z?e.jsxs("div",{role:"status",className:"border-l-2 border-[var(--rust)] pl-3 text-sm leading-6 text-content-muted",children:[e.jsx("p",{children:"Your latest payment didnât go through. Update your payment method to avoid an interruption."}),o?e.jsx("p",{className:"mt-1",children:"Open tracefiction.com/settings in Safari to update it."}):null]}):g&&o&&X?e.jsx("p",{className:"text-sm text-content-muted",children:"Opens Apple subscription settings for upgrades, cancellations, and renewal changes."}):g&&o&&Me?e.jsx("p",{className:"text-sm text-content-muted",children:"This subscription is managed from the Trace web app outside the iOS shell."}):g&&o&&Re?e.jsx("p",{className:"text-sm text-content-muted",children:"Trace found an Apple subscription history, but the current Pro access is not active through Apple."}):g&&o?e.jsx("p",{className:"text-sm text-content-muted",children:"Manage your subscription in iOS Settings under Apple ID subscriptions."}):null,E==="error"?e.jsx("p",{className:"mt-2 text-sm text-red-600",children:"Trace couldn't open Apple subscription settings. Open iOS Settings and check your Ap
1ple ID subscriptions."}):null]}),e.jsx(m,{title:"Extension setup",description:"Get Trace working in the browser or Safari app where you read.",right:e.jsx(et,{className:_(tt({variant:"outline",size:"lg"}),"w-full sm:w-auto"),to:"/setup",children:"Open setup"})}),k?e.jsx("div",{id:"story-updates-settings",className:"scroll-mt-20",children:e.jsx(m,{title:"Story updates",description:K.isError&&!r?"Story updates status could not be loaded. Open setup to try again.":qe,right:e.jsx(c,{nativeButton:!1,render:e.jsx(ve,{to:"/watches"}),variant:"outline",size:"lg",className:"w-full sm:w-auto",children:ye?"Manage":"Set up"}),children:z?e.jsxs("div",{className:"grid gap-3 text-sm",children:[e.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[e.jsx("input",{type:"checkbox",className:"mt-1 h-4 w-4 rounded border-border text-[var(--accent)] focus:ring-[var(--accent)]",checked:z.notifications_enabled,disabled:v.update.isPending,onChange:s=>{r||v.update.mutate({notifications_enabled:s.target.checked})}}),e.jsxs("span",{children:[e.jsx("span",{className:"font-medium text-content-primary",children:"iPhone notifications"}),e.jsx("span",{className:"mt-0.5 block text-content-muted",children:"Off by default. Web browsers are not alerted."})]})]}),e.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[e.jsx("input",{type:"checkbox",className:"mt-1 h-4 w-4 rounded border-border text-[var(--accent)] focus:ring-[var(--accent)]",checked:z.title_previews_enabled,disabled:!z.notifications_enabled||v.update.isPending,onChange:s=>{r||v.update.mutate({title_previews_enabled:s.target.checked})}}),e.jsxs("span",{children:[e.jsx("span",{className:"font-medium text-content-primary",children:"Show story titles"}),e.jsx("span",{className:"mt-0.5 block text-content-muted",children:"Generic notification previews are used unless you opt in."})]})]}),v.update.error&&!r?e.jsxs("p",{className:"text-sm text-danger",role:"alert",children:["Notification settings could not be saved. ",J(v.update.error)]}):null]}):null})}):null,e.jsx(m,{title:"Feedback",description:"Report a bug, confusing moment, or improvement idea without leaving Trace.",right:e.jsx(kt,{})}),o?e.jsx(m,{title:"Rate Trace",description:"Leave an honest App Store rating or review whenever youâre ready.",right:e.jsx(c,{nativeButton:!1,render:e.jsx("a",{href:_t(nt.iosAppStoreUrl),target:"_blank",rel:"noopener noreferrer"}),variant:"outline",size:"lg",className:"w-full sm:w-auto",children:"Rate Trace"})}):null,e.jsx(m,{title:"Data export",description:"Download your library, notes, and tags.",right:e.jsx(c,{variant:"outline",size:"lg",className:"w-full sm:w-auto",onClick:Ue,disabled:Q,loading:Q,children:Q?"Preparingâ¦":"Export data"}),children:oe?e.jsx("p",{className:"text-sm text-danger-700",children:oe}):null}),e.jsx(m,{title:"Theme",description:"Choose how Trace looks.",children:e.jsx(Tt,{value:Ne,onChange:Se})}),e.jsx(m,{title:"Library check-in",description:e.jsxs("span",{children:["Suggestions when your library might need a quick tidyâunfinished statuses, stalled reads, and similar. Review them anytime on the"," ",e.jsx(ve,{to:"/suggestions",className:"font-medium text-[var(--accent)] underline",children:"check-in page"})," ","(works in any browser).",o?" The option below adds a weekly push summary on this deviceâallow notifications when prompted.":" The weekly option below sends iOS push notifications only; desktop and mobile web are not alerted."]}),children:e.jsxs("label",{className:"flex cursor-pointer items-start gap-3",children:[e.jsx("input",{type:"checkbox",className:"mt-1 h-4 w-4 rounded border-border text-[var(--accent)] focus:ring-[var(--accent)]",checked:!!u?.push_suggestions_enabled,disabled:de.isPending||!r&&N.isLoading||!u,onChange:s=>Oe(s.target.checked)}),e.jsxs("span",{className:"text-sm text-content-primary",children:[e.jsx("span",{className:"font-medium",children:"Weekly digest (iOS push)"}),e.jsx("span",{className:"mt-0.5 block text-content-muted",children:"At most once a week when you have active suggestions. No email or website alerts."}),ge?e.jsx("span",{className:"mt-2 block text-xs text-content-muted",children:ge}):null]})]})}),e.jsx(m,{tone:"danger",title:"Danger zone",description:f?"Permanently delete your account, library, tags, and notes. This cannot be undone.":"Account deleti
1on and all associated data. Expand to continue.",right:f?e.jsx(c,{variant:"danger",size:"lg",className:"w-full sm:w-auto",onClick:()=>A(s=>!s),disabled:j,children:L?"Close":"Delete my account"}):void 0,children:f?L?e.jsxs("div",{className:"rounded-sm border border-border bg-surface-2 p-4",children:[e.jsxs("ol",{className:"list-decimal pl-5 text-sm text-content-muted space-y-1",children:[e.jsx("li",{children:"All your library entries, notes, and tags will be removed."}),e.jsx("li",{children:"Youâll be signed out immediately."}),e.jsx("li",{children:"Your local account data is removed now. Subscription and login-provider cleanup may finish shortly afterward."}),e.jsx("li",{children:"We recommend exporting your data first."})]}),e.jsxs("div",{className:"mt-4",children:[e.jsxs("label",{htmlFor:"delete-confirm",className:"text-sm text-content-primary",children:["Type ",e.jsx("span",{className:"font-semibold",children:"DELETE"})," to confirm"]}),e.jsx("input",{id:"delete-confirm",className:["mt-2 h-10 w-full max-w-[320px] rounded-sm","border border-border bg-surface-1 px-3","text-sm text-content-primary placeholder:text-content-muted/70","focus:outline-none focus-visible:shadow-ring","disabled:opacity-60 disabled:cursor-not-allowed"].join(" "),value:U,onChange:s=>h(s.target.value),placeholder:"DELETE",disabled:j,inputMode:"text",autoComplete:"off"})]}),e.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[e.jsx(c,{variant:"ghost",size:"lg",className:"min-h-11",onClick:()=>A(!1),disabled:j,children:"Cancel"}),e.jsx("div",{className:"flex-1"}),e.jsx(c,{variant:"danger",size:"lg",className:"min-h-11",onClick:Le,disabled:j||!pe,loading:j,title:pe?"Delete account":"Type DELETE to enable",children:j?"Deletingâ¦":"Delete account"})]}),te?e.jsx("div",{className:"mt-3 text-sm text-danger-700",children:te}):null]}):e.jsx("div",{className:"mt-1",children:e.jsx(c,{variant:"ghost",size:"lg",className:"min-h-11 -ml-2 text-content-muted",onClick:Ae,children:"Hide delete options"})}):e.jsxs("button",{type:"button",className:_("flex w-full items-center justify-between gap-3 rounded-sm border border-border","bg-surface-2 px-4 py-3 text-left text-sm font-medium text-content-primary","transition-colors hover:bg-[color-mix(in_oklab,var(--bg-raised)_65%,transparent)]","focus:outline-none focus-visible:shadow-ring"),"aria-expanded":!1,onClick:()=>b(!0),children:[e.jsx("span",{children:"Delete accountâ¦"}),e.jsx(rt,{className:"h-5 w-5 shrink-0 text-content-muted","aria-hidden":!0})]})})]})]})})]})}function kt(){const{openFeedback:t}=at();return e.jsx(c,{variant:"outline",size:"lg",className:"w-full sm:w-auto",onClick:()=>t(),children:"Send feedback"})}function At({draft:t,saved:n,loading:i,saving:a,error:d,onDraftChange:p,onRetry:H,onSave:r}){const k=t.display_name??"",L=t.handle??"",A=t.url??"",f=!Nt(t,n),b=t.default_mode==="profile"&&!w(t.display_name),U=f&&!b;return e.jsx(m,{title:"Public identity",description:"Default name shown on collection links you choose to publish.",right:i?void 0:d&&!f?e.jsx(c,{variant:"outline",size:"lg",className:"w-full sm:w-auto",onClick:H,children:"Retry"}):e.jsx(c,{variant:U?"solid":"outline",size:"lg",className:"w-full sm:w-auto",onClick:r,disabled:!f||b||a,loading:a,children:"Save defaults"}),children:e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("fieldset",{className:"grid gap-2",children:[e.jsx("legend",{className:"sr-only",children:"Default public identity mode"}),e.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-sm border border-border-subtle bg-surface-2 p-3",children:[e.jsx("input",{type:"radio",className:"mt-1 h-4 w-4 border-border text-[var(--accent)] focus:ring-[var(--accent)]",checked:t.default_mode==="anonymous",disabled:i||a,onChange:()=>p({...t,default_mode:"anonymous"})}),e.jsxs("span",{className:"text-sm text-content-primary",children:[e.jsx("span",{className:"font-medium",children:"Share anonymously by default"}),e.jsx("span",{className:"mt-0.5 block text-content-muted",children:"New public collection links start without a name or handle."})]})]}),e.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-sm border border-border-subtle bg-surface-2 p-3",children:[e.jsx("input",{type:"radio",className:"mt-1 h-4 w-4 border-border text-[var(--accent)] focu
1s:ring-[var(--accent)]",checked:t.default_mode==="profile",disabled:i||a,onChange:()=>p({...t,default_mode:"profile"})}),e.jsxs("span",{className:"text-sm text-content-primary",children:[e.jsx("span",{className:"font-medium",children:"Use my public name by default"}),e.jsx("span",{className:"mt-0.5 block text-content-muted",children:"New public collection links start with the name below."})]})]})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("label",{className:"grid gap-1.5",children:[e.jsx("span",{className:"text-sm font-medium text-content-primary",children:"Public name"}),e.jsx("input",{className:"h-10 rounded-sm border border-border bg-surface-1 px-3 text-sm text-content-primary placeholder:text-content-muted/70 focus:outline-none focus-visible:shadow-ring",value:k,maxLength:80,disabled:i||a,onChange:h=>p({...t,display_name:h.target.value})})]}),e.jsxs("label",{className:"grid gap-1.5",children:[e.jsx("span",{className:"text-sm font-medium text-content-primary",children:"Handle"}),e.jsx("input",{className:"h-10 rounded-sm border border-border bg-surface-1 px-3 text-sm text-content-primary placeholder:text-content-muted/70 focus:outline-none focus-visible:shadow-ring",value:L,maxLength:60,placeholder:"@reader",disabled:i||a,onChange:h=>p({...t,handle:h.target.value})})]}),e.jsxs("label",{className:"grid gap-1.5 sm:col-span-2",children:[e.jsx("span",{className:"text-sm font-medium text-content-primary",children:"Profile link"}),e.jsx("input",{className:"h-10 rounded-sm border border-border bg-surface-1 px-3 text-sm text-content-primary placeholder:text-content-muted/70 focus:outline-none focus-visible:shadow-ring",value:A,maxLength:500,placeholder:"https://...",disabled:i||a,onChange:h=>p({...t,url:h.target.value})})]})]}),b?e.jsx("p",{className:"text-sm text-danger-700",children:"Add a public name before using it by default."}):d?e.jsx("p",{className:"text-sm text-danger-700",children:d}):null]})})}const Et=[{value:"light",label:"Light",icon:ot},{value:"dark",label:"Dark",icon:lt},{value:"system",label:"System",icon:ct}];function Tt({value:t,onChange:n}){return e.jsxs("fieldset",{className:"mt-2",children:[e.jsx("legend",{className:"sr-only",children:"Theme preference"}),e.jsx("div",{className:"inline-flex gap-1 rounded-sm border border-border-subtle bg-surface-2 p-1",children:Et.map(i=>{const a=t===i.value,d=i.icon;return e.jsxs("label",{className:_("inline-flex cursor-pointer items-center gap-1.5 rounded-sm px-3 py-1.5 text-sm font-medium transition-colors",a?"bg-[var(--bg-raised)] text-content-primary shadow-sm":"text-content-muted hover:text-content-primary"),children:[e.jsx("input",{type:"radio",name:"theme",value:i.value,checked:a,onChange:()=>n(i.value),className:"sr-only"}),e.jsx(d,{className:"h-4 w-4","aria-hidden":!0}),i.label]},i.value)})})]})}export{_t as appStoreReviewUrl,Dt as default};
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.