PageSourceSearch

https://www.innera.ai/_next/static/chunks/7883.4064a55566173cbc.js

js innera.ai collected 2026-10-05 13:59:40 UTC 50,305 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1603,7883],{30860:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(17963).A)("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},32257:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(17963).A)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},41603:(e,t,a)=>{a.r(t),a.d(t,{deregisterPush:()=>u,getPushPermissionState:()=>l,hasRegisteredPushToken:()=>d,listenForegroundMessages:()=>x,requestPushPermission:()=>c});var s=a(9641);let r=null,n=null;async function i(){return r||n||(n=(async()=>{let e=function(){let e="AIzaSyDVunfQTxR8_bwAVswezsk64z7vv-jhtp0",t="innera-e308b.firebaseapp.com",a="innera-e308b",s="841035005249",r="1:841035005249:android:ceff8ef3c6d7b138f5b5c0";return e&&t&&a&&s&&r?{apiKey:e,authDomain:t,projectId:a,messagingSenderId:s,appId:r}:null}();if(!e||!("serviceWorker"in navigator)||!("Notification"in window))return null;try{let{initializeApp:t,getApps:s}=await Promise.all([a.e(3085),a.e(6042)]).then(a.bind(a,16042)),{getMessaging:n,isSupported:i}=await Promise.all([a.e(3085),a.e(4266)]).then(a.bind(a,14266));if(!await i().catch(()=>!1))return null;let l=s().length?s()[0]:t(e),o="/firebase-messaging-sw.js?"+new URLSearchParams({apiKey:e.apiKey,authDomain:e.authDomain,projectId:e.projectId,messagingSenderId:e.messagingSenderId,appId:e.appId}).toString();return await navigator.serviceWorker.register(o),r=n(l)}catch(e){return null}})())}function l(){return"Notification"in window?Notification.permission:"unsupported"}function o(e){return e?"innera.push.token.".concat(e):"innera.push.token"}function d(e){try{return!!localStorage.getItem(o(e))}catch(e){return!1}}async function c(e){if(!("Notification"in window))return{ok:!1,state:"unsupported"};let t=await Notification.requestPermission();if("granted"!==t)return{ok:!1,state:t};let r=await i();if(!r)return{ok:!1,state:"unsupported",error:"Push isn't configured for this environment yet."};let n="BLy76Kp6ux-GhWSoKzarRI6r73JcMHfqfoW6LG5iTAM_2mp0Totc0LIu5Mai5fGydi0aWUiGVzPn0iBFM9982-Y";if(!n)return{ok:!1,state:"granted",error:"Missing VAPID key."};try{let{getToken:t}=await Promise.all([a.e(3085),a.e(4266)]).then(a.bind(a,14266)),i=await navigator.serviceWorker.ready,l=await t(r,{vapidKey:n,serviceWorkerRegistration:i});if(!l)return{ok:!1,state:"granted",error:"Could not get a push token."};await (0,s.FHQ)("/initiations/device-token?".concat(new URLSearchParams({token:l,platform:"fcm"}).toString()),{method:"POST"});try{localStorage.setItem(o(e),l)}catch(e){}return{ok:!0,state:"granted"}}catch(e){return{ok:!1,state:"granted",error:(null==e?void 0:e.message)||"Failed to register for push."}}}async function u(e){let t=o(e),a=null;try{a=localStorage.getItem(t)}catch(e){}if(a)try{await (0,s.FHQ)("/initiations/device-token?".concat(new URLSearchParams({token:a}).toString()),{method:"DELETE"}),localStorage.removeItem(t)}catch(e){}}async function x(e){let t=await i();if(!t)return()=>{};let{onMessage:s}=await Promise.all([a.e(3085),a.e(4266)]).then(a.bind(a,14266));return s(t,t=>{var a,s;e((null==(a=t.notification)?void 0:a.title)||"Innera",(null==(s=t.notification)?void 0:s.body)||"",t.data)})}},47883:(e,t,a)=>{a.r(t),a.d(t,{default:()=>V});var s=a(37876),r=a(14232),n=a(98477),i=a(63906),l=a(28249),o=a(92551),d=a(73884),c=a(17963);let u=(0,c.A)("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),x=(0,c.A)("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);var h=a(30860),m=a(50276);let p=(0,c.A)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);
1var b=a(470),f=a(7496),g=a(82963),y=a(86306),v=a(9641),k=a(71493),w=a(45634),j=a(41603),N=a(21379),C=a(1868);let P={enabled:"ai_memory_enabled",fromChat:"ai_memory_from_chat",fromJournal:"ai_memory_from_journal",fromMood:"ai_memory_from_mood"};function A(e){let{on:t,disabled:a,onClick:r}=e;return(0,s.jsx)("button",{type:"button",role:"switch","aria-checked":t,onClick:r,disabled:a,className:["relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500",a?"cursor-not-allowed opacity-50":"",t?"bg-indigo-500":"bg-slate-200 dark:bg-slate-700"].join(" "),children:(0,s.jsx)("span",{className:["pointer-events-none block h-5 w-5 rounded-full bg-white shadow-sm transition-transform",t?"translate-x-5":"translate-x-0"].join(" ")})})}function _(e){let{label:t,description:a,on:r,disabled:n,onToggle:i}=e;return(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4 py-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-slate-900 dark:text-slate-100",children:t}),(0,s.jsx)("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-0.5 leading-relaxed",children:a})]}),(0,s.jsx)(A,{on:r,disabled:n,onClick:i})]})}function S(e){var t,a;let{onSavingChange:n}=e,{user:i,isLoading:l,refetch:o}=(0,k.A)(),[d,c]=(0,r.useState)(!1);if(l||!i)return null;let u=null!=(t=null==i?void 0:i.privacy_prefs)?t:{},x=null!=(a=null==i?void 0:i.phase2_flags)?a:{},h=!!u[P.enabled],m=void 0!==u[P.fromChat]&&!!u[P.fromChat],p=void 0!==u[P.fromJournal]&&!!u[P.fromJournal],b=void 0!==u[P.fromMood]&&!!u[P.fromMood];x.memory_v2_enabled;let f=async e=>{c(!0),null==n||n(!0);try{await (0,v.iNL)(e),await o(),y.Ay.success("Saved")}catch(e){var t;y.Ay.error(null!=(t=null==e?void 0:e.message)?t:"Failed to save")}finally{c(!1),null==n||n(!1)}};return(0,s.jsxs)("div",{children:[!h&&(0,s.jsxs)("div",{className:"mb-3 flex items-start gap-2 rounded-xl bg-slate-50 dark:bg-white/5 border border-slate-200/60 dark:border-white/10 px-3 py-2.5",children:[(0,s.jsx)(C.A,{className:"h-3.5 w-3.5 text-slate-400 mt-0.5 shrink-0"}),(0,s.jsx)("p",{className:"text-xs text-slate-500 dark:text-slate-400 leading-relaxed",children:"Memory is off. Nothing from your journals, chats, or mood logs is being stored as memory. Enabling it stores patterns (not raw text) on our servers and can be revoked here at any time under India's DPDP Act 2023."})]}),(0,s.jsx)(_,{label:"Enable AI Memory",description:h?"Innera is building a personal understanding of you. Turn off to stop new memories from forming.":"Off — Innera treats every conversation fresh, with no memory of past patterns.",on:h,disabled:d,onToggle:()=>f({[P.enabled]:!h})}),h&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"border-t border-slate-200/40 dark:border-white/5"}),(0,s.jsx)(_,{label:"Remember from journaling",description:"Themes, triggers, and coping patterns extracted from journal entries.",on:p,disabled:d,onToggle:()=>f({[P.fromJournal]:!p})}),(0,s.jsx)("div",{className:"border-t border-slate-200/40 dark:border-white/5"}),(0,s.jsx)(_,{label:"Remember from chat",description:"Patterns noticed during conversations with Innera.",on:m,disabled:d,onToggle:()=>f({[P.fromChat]:!m})}),(0,s.jsx)("div",{className:"border-t border-slate-200/40 dark:border-white/5"}),(0,s.jsx)(_,{label:"Remember from mood logs",description:"Patterns noticed in notes added to mood check-ins.",on:b,disabled:d,onToggle:()=>f({[P.fromMood]:!b})})]})]})}var E=a(32257),I=a(53038),M=a(93536);async function D(e,t){let a={...e,...t};return(0,v.Me9)({profile:a})}function R(e){let{label:t,value:a,editable:n=!1,onRemove:i,onSave:o}=e,[d,c]=(0,r.useState)(!1),[u,x]=(0,r.useState)("");function h(){c(!1)}function m(){null==o||o(u),c(!1)}return(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3 py-2.5 border-b border-white/20 dark:border-white/10 last:border-0",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-[11px] uppercase tracking-wide text-slate-400 dark:text-slate-500 mb-0.5",children:t}),d?(0,s.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,s.jsx)("input",{autoFocus:!0,value:u,onChange:e=>x(e.target.value),onKeyDown:e=>{"Enter"===e.key&&m(),"Escape"===e.key&&h()},className:"flex-1 rounded-md border border-slate-200 dark:border-white/20 bg-white/80 dark:bg-white/10 px-2 py-1 text-sm text-slate-900 dark:text-slate-100 outline-none focus:ring-1 focus:ring-indigo-400"}),(0,s.jsx)("button",{onClick:m,className:"p-1 rounded text-emerald-600 hover:bg-emerald-50 dark:hover:bg-emerald-500/10","aria-label":"Save",children:(0,s.jsx)(E.A,{className:"h-4 w-4"})}),(0,s.jsx)("button",{onClick:h,className:"p-1 rounded text-slate-500 hover:bg-slate-100 dar
1k:hover:bg-white/10","aria-label":"Cancel",children:(0,s.jsx)(l.A,{className:"h-4 w-4"})})]}):(0,s.jsx)("p",{className:"text-sm text-slate-700 dark:text-slate-200 break-words",children:a||(0,s.jsx)("span",{className:"text-slate-400 italic",children:"Not set"})})]}),!d&&(0,s.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0 mt-4",children:[n&&o&&(0,s.jsx)("button",{onClick:function(){x("string"==typeof a?a:""),c(!0)},className:"p-1.5 rounded-md text-slate-400 hover:text-slate-700 dark:hover:text-slate-200 hover:bg-white/60 dark:hover:bg-white/10 transition","aria-label":"Edit ".concat(t),children:(0,s.jsx)(I.A,{className:"h-3.5 w-3.5"})}),i&&(0,s.jsx)("button",{onClick:i,className:"p-1.5 rounded-md text-slate-400 hover:text-rose-600 dark:hover:text-rose-400 hover:bg-rose-50 dark:hover:bg-rose-500/10 transition","aria-label":"Remove ".concat(t),children:(0,s.jsx)(M.A,{className:"h-3.5 w-3.5"})})]})]})}function T(e){let{label:t,value:a,onToggle:r,onRemove:n}=e;return(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3 py-2.5 border-b border-white/20 dark:border-white/10 last:border-0",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-[11px] uppercase tracking-wide text-slate-400 dark:text-slate-500 mb-0.5",children:t}),null==a?(0,s.jsx)("p",{className:"text-sm text-slate-400 italic",children:"Not set"}):(0,s.jsx)("button",{onClick:()=>r(!a),className:"text-sm font-medium px-2 py-0.5 rounded-full transition ".concat(a?"bg-indigo-100 dark:bg-indigo-500/20 text-indigo-700 dark:text-indigo-300":"bg-slate-100 dark:bg-white/10 text-slate-600 dark:text-slate-300"),children:a?"Yes":"No"})]}),(0,s.jsx)("button",{onClick:n,className:"p-1.5 rounded-md text-slate-400 hover:text-rose-600 dar
1k:hover:text-rose-400 hover:bg-rose-50 dark:hover:bg-rose-500/10 transition flex-shrink-0","aria-label":"Remove ".concat(t),children:(0,s.jsx)(M.A,{className:"h-3.5 w-3.5"})})]})}function Y(){var e,t,a,n;let{user:i,mutate:l}=(0,k.A)(),o=null!=(t=null==i||null==(e=i.settings)?void 0:e.profile)?t:{},d=null!=(a=null==i?void 0:i.date_of_birth)?a:null,[c,u]=(0,r.useState)(!1),[x,h]=(0,r.useState)(!1);async function m(e){try{await D(o,{[e]:null}),await l(),y.Ay.success("Field removed")}catch(e){y.Ay.error("Could not remove field")}}async function p(e,t){try{await D(o,{[e]:t.trim()||null}),await l(),y.Ay.success("Saved")}catch(e){y.Ay.error("Could not save")}}async function b(e,t){try{await D(o,{[e]:t}),await l()}catch(e){y.Ay.error("Could not update")}}async function f(){h(!0);try{await (0,v.FHQ)("/users/me/erase-profile",{method:"POST"}),await l(),u(!1),y.Ay.success("All your information has been removed")}catch(e){y.Ay.error("Could not erase information")}finally{h(!1)}}let g=null!=d||Object.values(o).some(e=>null!=e&&""!==e&&!(Array.isArray(e)&&0===e.length));return(0,s.jsxs)("div",{className:"space-y-4",children:[g?(0,s.jsxs)("div",{className:"rounded-xl bg-white/60 dark:bg-white/5 border border-white/30 dark:border-white/10 px-4 py-1",children:[null!=d&&(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3 py-2.5 border-b border-white/20 dark:border-white/10",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-[11px] uppercase tracking-wide text-slate-400 dark:text-slate-500 mb-0.5",children:"Date of birth"}),(0,s.jsx)("p",{className:"text-sm text-slate-700 dark:text-slate-200",children:function(e){if(!e)return null;try{return new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"})}catch(t){return e}}(d)})]}),(0,s.jsx)("p",{className:"text-[11px] text-slate-400 mt-4 flex-shrink-0",children:'Remove via\xa0"Remove all"'})]}),null!=o.gender&&(0,s.jsx)(R,{label:"Gender",value:o.gender,editable:!0,onSave:e=>p("gender",e),onRemove:()=>m("gender")}),null!=o.first_mh_checkin&&(0,s.jsx)(T,{label:"First mental health check-in",value:o.first_mh_checkin,onToggle:e=>b("first_mh_checkin",e),onRemove:()=>m("first_mh_checkin")}),null!=o.mh_history&&(0,s.jsx)(R,{label:"Mental health history",value:(n=o.mh_history)&&"object"==typeof n?Object.entries({diagnosed:"Previous diagnosis",therapy:"Prior therapy",meds:"Medication"}).filter(e=>{let[t]=e;return!0===n[t]}).map(e=>{let[,t]=e;return t}).join(", ")||"None disclosed":"",onRemove:()=>m("mh_history")}),null!=o.currently_in_support&&(0,s.jsx)(T,{label:"Currently receiving support",value:o.currently_in_support,onToggle:e=>b("currently_in_support",e),onRemove:()=>m("currently_in_support")}),null!=o.why_here&&(0,s.jsx)(R,{label:"Why you're here",value:function(e){if(!e)return"";let t=(Array.isArray(e.chips)?e.chips:[]).map(e=>e.replace(/_/g," "));return e.free_text&&t.push('"'.concat(e.free_text,'"')),t.join(", ")||""}(o.why_here),onRemove:()=>m("why_here")}),null!=o.mindful_of&&(0,s.jsx)(R,{label:"What to be mindful of",value:o.mindful_of,editable:!0,onSave:e=>p("mindful_of",e),onRemove:()=>m("mindful_of")}),null!=o.trusted_contact&&(0,s.jsx)(R,{label:"Trusted contact",value:function(e){if(!e)return"";let t=[];return e.name&&t.push(e.name),e.contact_info&&t.push(e.contact_info),t.join(" \xb7 ")}(o.trusted_contact),onRemove:()=>m("trusted_contact")}),null!=o.strengths&&(0,s.jsx)(R,{label:"Your strengths",value:o.strengths,editable:!0,onSave:e=>p("strengths",e),onRemove:()=>m("strengths")})]}):(0,s.jsx)("p",{className:"text-sm text-slate-500 dark:text-slate-400 py-1",children:"No personal information is stored yet."}),g&&!c&&(0,s.jsx)("button",{onClick:()=>u(!0),className:"text-xs text-rose-500 dark:text-rose-400 hover:underline",children:"Remove all my information"}),c&&(0,s.jsxs)("div",{className:"rounded-xl border border-rose-200 dark:border-rose-400/20 bg-rose-50/80 dark:bg-rose-500/10 p-4 space-y-3",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-rose-700 dark:text-rose-300",children:"Remove all your information?"}
1),(0,s.jsx)("p",{className:"text-xs text-slate-600 dark:text-slate-300",children:"This clears everything you shared in the setup — date of birth, background, trusted contact, and all other profile fields. It can't be undone, though you can fill things in again any time."}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{onClick:f,disabled:x,className:"rounded-md bg-rose-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-rose-700 disabled:opacity-60",children:x?"Removing…":"Yes, remove all"}),(0,s.jsx)("button",{onClick:()=>u(!1),className:"rounded-md bg-white dark:bg-white/10 border border-slate-200 dark:border-white/10 px-3 py-1.5 text-xs text-slate-700 dark:text-slate-200 hover:bg-slate-50 dark:hover:bg-white/15",children:"Keep it"})]})]})]})}var L=a(91013);function z(){let[e,t]=(0,r.useState)(!0),[a,n]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{function e(e){var a;t(!!(null==(a=e.detail)?void 0:a.disabled)),n(!0)}return t((0,L.AI)()),window.addEventListener("innera:ai-global-toggle",e),()=>window.removeEventListener("innera:ai-global-toggle",e)},[]),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,s.jsx)("div",{className:"text-xs text-slate-500 dark:text-slate-400",children:"Off by default. When on, Nera can generate summaries, sentiment, and reflections from your journal entries. This is the one place that controls it — it applies everywhere, on every device. Doesn't affect AI Chat, which has its own separate memory setting below."}),(0,s.jsx)("button",{onClick:function(){let a=!e;t(a),(0,L.Wp)(a)},className:["px-3 py-1.5 rounded-full text-xs shrink-0",!e?"bg-slate-900 text-white dark:bg-white/20 dark:text-slate-100":"bg-white border border-white/60 text-slate-700 dark:bg-white/10 dark:border-white/10 dark:text-slate-200"].join(" "),"aria-pressed":!e,children:a?e?"Off":"On":"…"})]})}let F=[{id:"appearance",label:"Appearance"},{id:"privacy",label:"Privacy & AI"},{id:"notifications",label:"Notifications"},{id:"account",label:"Account & Data"}],O={appearance:{icon:"bg-blue-500/10 dark:bg-blue-400/10",border:"border-t-blue-400/40 dark:border-t-blue-400/25"},privacy:{icon:"bg-teal-500/10 dark:bg-teal-400/10",border:"border-t-teal-400/40 dark:border-t-teal-400/25"},notifications:{icon:"bg-rose-500/10 dark:bg-rose-400/10",border:"border-t-rose-400/40 dark:border-t-rose-400/25"},account:{icon:"bg-violet-500/10 dark:bg-violet-400/10",border:"border-t-violet-400/40 dark:border-t-violet-400/25"}};function q(e){let{open:t,title:a,description:r,onSave:i,onDiscard:l,onCancel:o}=e;return t?(0,n.createPortal)((0,s.jsxs)("div",{className:"fixed inset-0 z-[260000] flex items-center justify-center p-4",role:"dialog","aria-modal":"true",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm"}),(0,s.jsxs)("div",{className:"glass-dense z-10 w-full max-w-md rounded-2xl p-5 shadow-xl",onClick:e=>e.stopPropagation(),role:"document",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-slate-900 dark:text-slate-100",children:a}),r&&(0,s.jsx)("p",{className:"mt-2 text-sm text-slate-600 dark:text-slate-300",children:r}),(0,s.jsxs)("div",{className:"mt-4 flex justify-end gap-2",children:[(0,s.jsx)("button",{className:"rounded-md px-3 py-1 text-sm text-slate-700 dark:text-slate-200 hover:bg-white/70 dark:hover:bg-white/10",onClick:o,children:"Cancel"}),(0,s.jsx)("button",{className:"rounded-md px-3 py-1 text-sm text-slate-700 dark:text-slate-200 hover:bg-white/70 dark:hover:bg-white/10",onClick:l,children:"Discard"}),(0,s.jsx)("button",{className:"rounded-md bg-gradient-to-r from-indigo-500 via-violet-500 to-fuchsia-500 px-3 py-1 text-sm font-medium text-white shadow-sm hover:brightness-105",onClick:i,children:"Save"})]})]})]}),document.body):null}function W(e){let{open:t,title:a,description:r,okLabel:i="OK",cancelLabel:l="Cancel",onCancel:o,onOk:d}=e;return t?(0,n.createPortal)((0,s.jsxs)("div",{className:"fixed inset-0 z-[260000] flex items-center justify-center p-4",role:"dialog","aria-modal":"true",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm"}),(0,s.jsxs)("div",{className:"glass-dense z-10 w-full max-w-lg rounded-2xl p-5 shadow-xl",role:"document",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"mb-3",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-slate-900",children:a}),r&&(0,s.jsx)("p",{className:"mt-1 text-sm text-slate-600",children:r})]}),(0,s.jsxs)("div",{className:"mt-4 flex justify-end gap-3",children:[(0,s.jsx)("button",{className:"rounded-md px-3 py-1 text-sm text-slate-700 hover:bg-slate-100/60",onClick:o,"aria-label":"Cancel",children:l}),(0,s.jsx)("button",{onClick:d,className:"rounded-md bg-gradient-to-r from-indigo-500 via-violet-500 to-fuchsia-500 px-3 py-1 text-sm font-medium text-white shadow-sm hover:brightness-105","aria-label":"Confirm",children:i})]})]})]}),document.body):null}function H(e){(0,v.Me9)({settings:e}).catch(()=>{(0,y.Ay)("Settings saved on this device, but couldn't sync to your account — try again when you're back online.","error")})}function V(e){var t,a,c,C,P;let{open:A,onClose:_,onExport:E}=e,I=(0,r.useRef)(null),{settings:M,pinIsSet:D,setSettingsBulk:R,setPin:T,verifyPin:L,unlockWithPin:V}=(0,b.t0)(),[J,K]=(0,r.useState)("appearance"),[G,B]=(0,r.useState)(!1),[Q,Z]=(0,r.useState)(""),[X,$]=(0,r.useState)(""),[ee,et]=(0,r.useState)(!1),[ea,es]=(0,r.useState)(""),[er,en]=(0,r.useState)(!1),[ei,el]=(0,r.useState)(!1),[eo,ed]=(0,r.useState)(!1),[ec,eu]=(0,r.useState)(()=>({...f.a})),[ex,eh]=(0,r.useState)(!1),[em,ep]=(0,r.useState)(!1),[eb,ef]=(0,r.useState)(!1),{pauseForDays:eg,pauseIndefinitely:ey,resume:ev,isPau
1sed:ek}=(0,w.i)(),{setTheme:ew}=(0,N.D)(),{user:ej,mutate:eN}=(0,k.A)(),[eC,eP]=(0,r.useState)(!1),[eA,e_]=(0,r.useState)("default"),[eS,eE]=(0,r.useState)(!1),[eI,eM]=(0,r.useState)(!1);(0,r.useEffect)(()=>{e_((0,j.getPushPermissionState)()),eE((0,j.hasRegisteredPushToken)(null==ej?void 0:ej.user_id))},[null==ej?void 0:ej.user_id]);let[eD,eR]=(0,r.useState)(null),[eT,eY]=(0,r.useState)(!1);async function eL(e){if(!eD)return;let t={...eD,...e};eR(t),eY(!0);try{await (0,v.VrM)({enabled:t.enabled,max_per_day:t.maxPerDay,push_notifications_enabled:t.pushNotificationsEnabled,ghost_messages_enabled:t.ghostMessagesEnabled,quiet_hours_start:t.quietHoursStart,quiet_hours_end:t.quietHoursEnd})}catch(e){eR(eD)}finally{eY(!1)}}function ez(e){var t;let a=document.documentElement,s=null!=(t=U[e.accent])?t:U.blue;a.style.setProperty("--innera-accent",s),"dark"===e.theme?(a.style.setProperty("--innera-surface","#071025"),a.style.setProperty("--innera-text","#E6EEF8")):"light"===e.theme?(a.style.setProperty("--innera-surface","rgba(255,255,255,0.96)"),a.style.setProperty("--innera-text","#0f172a")):(a.style.removeProperty("--innera-surface"),a.style.removeProperty("--innera-text"))}(0,r.useEffect)(()=>{"notifications"!==J||eD||(0,v.FHQ)("/initiations/settings").then(e=>{var t,a,s;return eR({enabled:e.enabled,maxPerDay:null!=(t=e.max_per_day)?t:1,quietHoursStart:null!=(a=e.quiet_hours_start)?a:null,quietHoursEnd:null!=(s=e.quiet_hours_end)?s:null,pushNotificationsEnabled:e.push_notifications_enabled,ghostMessagesEnabled:e.ghost_messages_enabled})}).catch(()=>{})},[J,eD]),(0,r.useEffect)(()=>{A&&(eu({...f.a,...M}),K("appearance"))},[A]),(0,r.useEffect)(()=>{if(!A)return;let e=document.documentElement,t=e.style.getPropertyValue("--innera-accent")||"",a=e.style.getPropertyValue("--innera-font-size")||"";return ez(ec.appearance),()=>{t?e.style.setProperty("--innera-accent",t):e.style.removeProperty("--innera-accent"),a?e.style.setProperty("--innera-font-size",a):e.style.removeProperty("--innera-font-size")}},[A]),(0,r.useEffect)(()=>{A&&ez(ec.appearance)},[ec.appearance,A]);let eF=e=>eu(t=>({...t,appearance:{...t.appearance||{},...e}})),eO=e=>eu(t=>({...t,language:{...t.language||{},...e}})),eq=e=>eu(t=>({...t,security:{...t.security||{},...e}})),eW=new Date().toISOString(),eH={locale:null!=(t=ec.language.locale)?t:"en",dateFormat:null!=(a=ec.language.dateFormat)?a:"DD/MM/YYYY",time24:!!ec.language.timeFormat24h,timeZone:g.GI,showTime:!0},eV=(0,g.wB)(eW,eH);function eU(){JSON.stringify({...f.a,...ec})!==JSON.stringify({...f.a,...M})?ef(!0):_()}function eJ(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"innera-export.zip",a=URL.createObjectURL(e),s=document.createElement("a");s.href=a,s.download=t,s.rel="noreferrer",document.body.appendChild(s),s.click(),s.remove(),URL.revokeObjectURL(a)}async function eK(e){if(y.Ay.loading("Preparing export…",{id:"export"}),"function"==typeof v.i4x)try{var t,a;let s=await (0,v.i4x)(e),r=null!=(t=null==s?void 0:s.blob)?t:s instanceof Blob?s:null,n=null!=(a=null==s?void 0:s.filename)?a:"innera-export.".concat("json"===e?"json":e);if(r){eJ(r,n),y.Ay.dismiss("export"),y.Ay.success("Export ready — downloading (".concat(e,")"));return}}catch(e){}try{let t,a="".concat("https://api.innera.ai".replace(/\/$/,""),"/users/export?format=").concat(encodeURIComponent(e)),s=await fetch(a,{method:"GET",credentials:"include"});if(!s.ok){await s.text().catch(()=>""),y.Ay.dismiss("export"),404===s.status&&"json"!==e&&"zip"!==e&&ep(!0),y.Ay.error("Export failed. Please try again.");return}if((s.headers.get("content-type")||"").includes("application/json")){let e=await s.json();t=new Blob([JSON.stringify(e,null,2)],{type:"application/json"})}else t=await s.blob();let r="json"===e?"json":"zip"===e?"zip":e;eJ(t,"innera-export.".concat(r)),y.Ay.dismiss("export"),y.Ay.success("Export ready — downloading (".concat(e,")"));return}catch(e){y.Ay.dismiss("export"),y.Ay.error("Export failed (check console & network tab)");return}}(0,r.useEffect)(()=>{function e(e){"Escape"===e.key&&eU()}return A&&document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[A,ec]);let eG=e=>{let{title:t,subtitle:a,icon:r,iconTint:n}=e;return(0,s.jsxs)("div",{className:"mb-4 flex items-center gap-3",children:[(0,s.jsx)("div",{className:"glass-soft flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-xl shadow-sm ".concat(null!=n?n:"bg-white/70 dark:bg-white/10"),children:r}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-semibold text-slate-900 dark:text-slate-100",children:t}
1),a&&(0,s.jsx)("div",{className:"text-xs text-slate-600 dark:text-slate-300",children:a})]})]})};if(!A)return null;let eB=O[J],eQ="glass-soft rounded-2xl bg-white/80 dark:bg-white/6 p-4 sm:p-5 shadow-sm border-t-2 ".concat(eB.border);return(0,n.createPortal)((0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(q,{open:eb,title:"You have unsaved changes",description:"Save your changes before closing, discard them, or stay here to keep tweaking.",onSave:function(){R(ec),H(ec),ef(!1),_()},onDiscard:function(){ez(M.appearance),ew(M.appearance.theme),(0,y.Ay)("Changes discarded","success"),ef(!1),_()},onCancel:function(){ef(!1)}}),(0,s.jsx)(W,{open:ex,title:"Reset all settings?",description:"This will restore all preferences to Innera defaults. Your journal entries will not be deleted.",okLabel:"Reset",cancelLabel:"Cancel",onCancel:()=>{eh(!1),(0,y.Ay)("Reset cancelled","success")},onOk:()=>{eh(!1),eu({...f.a}),(0,y.Ay)("Defaults loaded — press Save to persist","success")}}),(0,s.jsx)(W,{open:em,title:"Zip export not configured",description:"A Zip export backend endpoint isn't configured yet. Hook your export endpoint to enable this feature.",okLabel:"OK",cancelLabel:"Cancel",onCancel:()=>ep(!1),onOk:()=>ep(!1)}),G&&(0,s.jsxs)("div",{className:"fixed inset-0 z-[230000] flex items-center justify-center p-4",role:"dialog","aria-modal":"true",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:()=>B(!1)}),(0,s.jsxs)("div",{className:"glass-dense z-10 w-full max-w-sm rounded-2xl p-5 shadow-xl",onClick:e=>e.stopPropagation(),children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-slate-900",children:"Set Entry-Lock PIN"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-slate-600",children:"Enter a new PIN and confirm it. This lets you lock individual journal entries — it doesn't lock the whole app."}),(0,s.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,s.jsx)("input",{type:"password",value:Q,onChange:e=>Z(e.target.value),placeholder:"New PIN (4-8 digits)",className:"w-full rounded-lg px-3 py-2 border"}),(0,s.jsx)("input",{type:"password",value:X,onChange:e=>$(e.target.value),placeholder:"Confirm PIN",className:"w-full rounded-lg px-3 py-2 border"}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 mt-2",children:[(0,s.jsx)("button",{className:"rounded-md px-3 py-1 text-sm",onClick:()=>{B(!1)},children:"Cancel"}),(0,s.jsx)("button",{className:"rounded-md bg-gradient-to-r from-indigo-500 via-violet-500 to-fuchsia-500 px-3 py-1 text-sm font-medium text-white",onClick:async()=>{if(!Q||Q.length<4)return void y.Ay.error("PIN must be at least 4 characters");if(Q!==X)return void y.Ay.error("PINs do not match");try{await T(Q),await V(Q),eu(e=>({...e,security:{...e.security||{},appLockEnabled:!0}})),ed(!1),B(!1),y.Ay.success("PIN saved"),Z(""),$("")}catch(e){y.Ay.error("Failed to save PIN")}},children:"Save PIN"})]})]})]})]}),ee&&(0,s.jsxs)("div",{className:"fixed inset-0 z-[230000] flex items-center justify-center p-4",role:"dialog","aria-modal":"true",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm",onClick:()=>et(!1)}),(0,s.jsxs)("div",{className:"glass-dense z-10 w-full max-w-sm rounded-2xl p-5 shadow-xl",onClick:e=>e.stopPropagation(),children:[(0,s.jsx)("h3",{className:"text-lg font-semibold text-slate-900",children:"Confirm Current PIN"}),(0,s.jsx)("p",{className:"mt-2 text-sm text-slate-600",children:"Enter your current PIN to clear it."}),(0,s.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,s.jsx)("input",{type:"password",value:ea,onChange:e=>es(e.target.value),placeholder:"Current PIN",className:"w-full rounded-lg px-3 py-2 border"}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 mt-2",children:[(0,s.jsx)("button",{className:"rounded-md px-3 py-1 text-sm",onClick:()=>et(!1),children:"Cancel"}),(0,s.jsx)("button",{className:"rounded-md bg-gradient-to-r from-indigo-500 via-violet-500 to-fuchsia-500 px-3 py-1 text-sm font-medium text-white",onClick:async()=>{try{if(!await L(ea))return void y.Ay.error("Incorrect PIN");if(ei){et(!1),el(!1),Z(""),$(""),B(!0);return}if(er){et(!1),en(!1),eq({appLockEnabled:!1}),(0,y.Ay)("Entry-lock PIN turned off","success");return}await T(null),et(!1),eq({appLockEnabled:!1,pin:void 0}),eu(e=>({...e,security:{...e.security||{},pin:void 0,appLockEnabled:!1}})),(0,y.Ay)("PIN cleared","success")}catch(e){y.Ay.error("Operation failed")}},children:"Confirm"})]})]})]})]}),(0,s.jsxs)("div",{"aria-modal":!0,role:"dialog",style:{position:"fixed",inset:0,zIndex:21e4,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.75rem",pointerEvents:"auto"},children:[(0,s.jsx)("div",{onClick:eU,"aria-hidden":!0,style:{position:"absolute",inset:0,background:"radial-gradient(circle at top, rgba(92,123,255,0.32), transparent 55%), rgba(15,23,42,0.55)",backdropFilter:"blur(10px)",zIndex:21e4,pointerEvents:"auto"}}),(0,s.jsxs)("div",{ref:I,role:"document",onClick:e=>e.stopPropagation(),style:{position:"relative",zIndex:22e4,width:"100%",maxWidth:"960px",borderRadius:window.innerWidth<640?"16px":"22px",overflow:"hidden",pointerEvents:"auto"},className:"glass-dense border border-white/25 dark:border-white/10 shadow-2xl shadow-black/10 dark:shadow-black/40",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between border-b border-white/40 dark:border-white/10 px-6 py-4 bg-white/20 dark:bg-white/5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"rounded-xl bg-gradient-to-br from-indigo-500 via-violet-500 to-pink-500 p-2 shadow-md shadow-violet-400/30",children:(0,s.jsx)(i.A,{className:"h-5 w-5 text-white"})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"flex items-center gap-2"}),(0,s.jsx)("div",{className:"text-lg font-semibold text-slate-900 dark:text-slate-100",children:"Settings"}
1),(0,s.jsx)("div",{className:"text-xs text-slate-600 dark:text-slate-300",children:"Tune how Innera looks, feels, and keeps your data safe."})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("button",{onClick:function(){R(ec),H(ec),y.Ay.success("Settings saved"),_()},className:"rounded-full bg-gradient-to-r from-indigo-500 via-violet-500 to-fuchsia-500 px-4 py-2 text-sm font-medium text-white shadow-md shadow-violet-500/30 transition hover:translate-y-[0.5px] hover:brightness-105",children:"Save & close"}),(0,s.jsx)("button",{onClick:eU,className:"flex h-8 w-8 items-center justify-center rounded-full bg-white/60 dark:bg-white/10 text-slate-700 dark:text-slate-200 shadow-sm ring-1 ring-white/40 dark:ring-white/10 transition hover:bg-white/80 dark:hover:bg-white/15","aria-label":"Close",children:(0,s.jsx)(l.A,{className:"h-4 w-4"})})]})]}),(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row max-h-[85vh] sm:max-h-[76vh]",children:[(0,s.jsx)("div",{className:"flex sm:flex-col gap-1.5 overflow-x-auto sm:overflow-x-visible shrink-0 border-b sm:border-b-0 sm:border-r border-white/30 dark:border-white/10 p-3 sm:p-4 sm:w-44",children:F.map(e=>(0,s.jsx)("button",{onClick:()=>K(e.id),className:"shrink-0 whitespace-nowrap rounded-xl px-3 py-2.5 text-left text-sm font-medium transition ".concat(J===e.id?"bg-slate-900 text-white dark:bg-white/20 dark:text-slate-100 shadow-sm":"text-slate-700 dark:text-slate-200 hover:bg-white/60 dark:hover:bg-white/10"),children:e.label},e.id))}),(0,s.jsxs)("div",{className:"flex-1 min-w-0 overflow-y-auto p-5 sm:p-6 space-y-4",children:["appearance"===J&&(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("section",{className:eQ,children:[(0,s.jsx)(eG,{title:"Appearance",subtitle:"Theme, accent & density",iconTint:eB.icon,icon:(0,s.jsx)(o.A,{className:"h-5 w-5 text-slate-700 dark:text-slate-200"})}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-2 text-xs font-medium text-slate-600",children:"Theme"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2",children:["light","dark","system"].map(e=>(0,s.jsx)("button",{onClick:()=>{eF({theme:e}),ew(e)},className:"rounded-full px-3 py-1.5 text-xs font-medium transition ".concat(ec.appearance.theme===e?"bg-slate-900 text-white dark:bg-white/20 dark:text-slate-100 shadow-sm":"bg-white/70 dark:bg-white/10 text-slate-700 dark:text-slate-200 hover:bg-white/90 dark:hover:bg-white/15"),children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-2 text-xs font-medium text-slate-600",children:"Accent (chat color)"}),(0,s.jsx)("div",{className:"flex items-center gap-3",children:["blue","lavender","mint","rose","neutral"].map(e=>(0,s.jsx)("button",{onClick:()=>eF({accent:e}),"aria-label":"Accent ".concat(e),className:"h-9 w-9 rounded-xl border border-white/60 bg-gradient-to-br transition ".concat(ec.appearance.accent===e?"ring-2 ring-offset-2 ring-slate-900 shadow-md":"ring-0 opacity-90 hover:opacity-100"),style:{background:"blue"===e?"linear-gradient(135deg,#93c5fd,#6366f1)":"lavender"===e?"linear-gradient(135deg,#a855f7,#6366f1)":"mint"===e?"linear-gradient(135deg,#6ee7b7,#14b8a6)":"rose"===e?"linear-gradient(135deg,#fb7185,#ec4899)":"linear-gradient(135deg,#e5e7eb,#9ca3af)"}},e))})]})]})]})}),"privacy"===J&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("section",{className:eQ,children:[(0,s.jsx)(eG,{title:"AI Assistance",subtitle:"Summaries, sentiment, and Nera's reflections on your journal entries",iconTint:eB.icon,icon:(0,s.jsx)(d.A,{className:"h-5 w-5 text-slate-700 dark:text-slate-200"})}),(0,s.jsx)(z,{})]}),(0,s.jsxs)("section",{className:eQ,children:[(0,s.jsx)(eG,{title:"AI Memory",subtitle:"Control what Innera can remember from chat and journaling",iconTint:eB.icon,icon:(0,s.jsx)(u,{className:"h-5 w-5 text-slate-700 dark:text-slate-200"})}),(0,s.jsx)(S,{})]}),(0,s.jsxs)("section",{className:eQ,children:[(0,s.jsx)(eG,{title:"Security",subtitle:"Lock individual entries & blur previews",iconTint:eB.icon,icon:(0,s.jsx)(x,{className:"h-5 w-5 text-slate-700 dark:text-slate-200"})}),(0,s.jsx)("p",{className:"mb-2 text-xs text-slate-500 dark:text-slate-400",children:"Whole-app lock isn't available yet — a PIN here only lets you lock individual journal entries (see the lock icon on any entry). It doesn't require a PIN to open Innera itself."}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("label",{className:"flex items-center gap-3 rounded-xl bg-white/60 dark:bg-white/10 px-4 py-3",children:[(0,s.jsx)("input",{type:"checkbox",checked:ec.security.appLockEnabled,onChange:e=>{if(e.target.checked){if(!D){en(!1),el(!1),ed(!0);return}eu(e=>({...e,security:{...e.security||{},appLockEnabled:!0}}));return}en(!0),es(""),et(!0)}
1,className:"h-4 w-4 rounded accent-indigo-500"}),(0,s.jsx)("span",{className:"text-sm text-slate-800 dark:text-slate-100",children:"Set up a PIN for locked entries"})]}),(0,s.jsxs)("label",{className:"flex items-center gap-3 rounded-xl bg-white/60 dark:bg-white/10 px-4 py-3",children:[(0,s.jsx)("input",{type:"checkbox",checked:ec.security.blurPreviews,onChange:e=>eq({blurPreviews:e.target.checked}),className:"h-4 w-4 rounded accent-indigo-500"}),(0,s.jsx)("span",{className:"text-sm text-slate-800 dark:text-slate-100",children:"Blur sensitive content in lists / previews"})]}),eo&&(0,s.jsxs)("div",{className:"mt-3 rounded-lg border border-white/30 dark:border-white/10 bg-white/70 dark:bg-white/10 p-3 text-sm shadow-sm flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-medium text-slate-900 dark:text-slate-100",children:"You'll need a PIN first"}),(0,s.jsx)("div",{className:"text-xs text-slate-600 dark:text-slate-300",children:"Create a PIN to lock individual journal entries."})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{className:"rounded-md bg-slate-900 text-white px-3 py-1 text-sm",onClick:()=>{Z(""),$(""),B(!0),ed(!1)},children:"Set PIN"}),(0,s.jsx)("button",{className:"rounded-md px-3 py-1 text-sm border",onClick:()=>ed(!1),children:"Dismiss"})]})]}),ec.security.appLockEnabled&&(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsx)("div",{className:"mb-1 text-xs text-slate-600 dark:text-slate-300",children:"Entry-lock PIN"}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"rounded-full px-2 py-1 text-xs font-semibold",style:{background:D?"rgba(99,102,241,0.12)":"rgba(107,114,128,0.06)",color:D?"#4f46e5":"#6b7280"},children:D?"PIN set":"No PIN"}),D?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{className:"rounded-md bg-slate-900 text-white px-3 py-1 text-sm",onClick:()=>{el(!0),en(!1),es(""),et(!0)},children:"Change PIN"}),(0,s.jsx)("button",{className:"rounded-md border px-3 py-1 text-sm",onClick:()=>{el(!1),en(!1),et(!0),es("")},children:"Clear"})]}):(0,s.jsx)("button",{className:"rounded-md bg-slate-900 text-white px-3 py-1 text-sm",onClick:()=>{Z(""),$(""),B(!0),ed(!1)},children:"Set PIN"})]}),(0,s.jsx)("div",{className:"text-xs text-slate-500 mt-1",children:"PIN is stored hashed locally."})]})]})]})]}),"notifications"===J&&(0,s.jsxs)("section",{className:eQ,children:[(0,s.jsx)(eG,{title:"Notifications",subtitle:"Control when Innera checks in",iconTint:eB.icon,icon:(0,s.jsx)(h.A,{className:"h-5 w-5 text-slate-700 dark:text-slate-200"})}),(0,s.jsx)("div",{className:"rounded-xl bg-white/60 dark:bg-white/10 px-4 py-3 space-y-2",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-medium text-slate-800 dark:text-slate-100",children:"Push notifications"}),(0,s.jsxs)("div",{className:"text-xs text-slate-500 dark:text-slate-400",children:["denied"===eA&&"Blocked in your browser's settings. Enable notifications for this site to turn it back on.","unsupported"===eA&&"Not supported in this browser.","de
1nied"!==eA&&"unsupported"!==eA&&(eS?"Enabled on this device — you'll get real notifications even when this tab is closed.":"Off — turn on to get notified outside the app.")]})]}),"denied"===eA||"unsupported"===eA?null:eS?(0,s.jsx)("button",{disabled:eI,onClick:async()=>{eM(!0),await (0,j.deregisterPush)(null==ej?void 0:ej.user_id),eE((0,j.hasRegisteredPushToken)(null==ej?void 0:ej.user_id)),eM(!1),(0,y.Ay)("Push notifications turned off on this device","success")},className:"rounded-full border px-3 py-1.5 text-xs font-medium disabled:opacity-50",children:"Turn off"}):(0,s.jsx)("button",{disabled:eI,onClick:async()=>{eM(!0);let e=await (0,j.requestPushPermission)(null==ej?void 0:ej.user_id);eM(!1),e_(e.state),eE((0,j.hasRegisteredPushToken)(null==ej?void 0:ej.user_id)),e.ok?(0,y.Ay)("Push notifications enabled","success"):e.error&&(0,y.Ay)(e.error,"error")},className:"rounded-full bg-gradient-to-r from-indigo-500 via-violet-500 to-fuchsia-500 px-4 py-1.5 text-xs font-medium text-white disabled:opacity-50",children:"Turn on"})]})}),eD&&(0,s.jsxs)("div",{className:"rounded-xl bg-white/60 dark:bg-white/10 px-4 py-3 space-y-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"text-sm font-medium text-slate-800 dark:text-slate-100",children:"Ghost check-ins"}),(0,s.jsx)("div",{className:"text-xs text-slate-500 dark:text-slate-400",children:"When your persona reaches out on its own, in chat."})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"time",value:null!=(c=eD.quietHoursStart)?c:"",disabled:eT,onChange:e=>eL({quietHoursStart:e.target.value||null}),className:"min-w-0 flex-1 rounded-lg border border-transparent bg-white/80 dark:bg-white/10 px-2 py-1.5 text-xs text-slate-900 dark:text-slate-100"}),(0,s.jsx)("span",{className:"text-xs text-slate-400",children:"to"}),(0,s.jsx)("input",{type:"time",value:null!=(C=eD.quietHoursEnd)?C:"",disabled:eT,onChange:e=>eL({quietHoursEnd:e.target.value||null}),className:"min-w-0 flex-1 rounded-lg border border-transparent bg-white/80 dark:bg-white/10 px-2 py-1.5 text-xs text-slate-900 dark:text-slate-100"}),(0,s.jsx)("span",{className:"flex-shrink-0 text-[11px] text-slate-400",children:"quiet hours"})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-xs text-slate-600 dark:text-slate-300",children:"Max per day"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("button",{type:"button",disabled:eT||eD.maxPerDay<=1,onClick:()=>eL({maxPerDay:Math.max(1,eD.maxPerDay-1)}),className:"h-6 w-6 rounded-full border border-slate-300 dark:border-white/20 text-sm font-bold text-slate-500 disabled:opacity-40",children:"−"}),(0,s.jsx)("span",{className:"w-4 text-center text-sm font-semibold text-slate-800 dark:text-slate-100",children:eD.maxPerDay}),(0,s.jsx)("button",{type:"button",disabled:eT||eD.maxPerDay>=5,onClick:()=>eL({maxPerDay:Math.min(5,eD.maxPerDay+1)}),className:"h-6 w-6 rounded-full border border-slate-300 dark:border-white/20 text-sm font-bold text-slate-500 disabled:opacity-40",children:"+"})]})]})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[ek()?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"text-sm text-slate-700 dark:text-slate-200",children:"Notifications are currently paused."}),(0,s.jsx)("button",{onClick:()=>{ev(),(0,y.Ay)("Notifications resumed","success")},className:"rounded-full bg-gradient-to-r from-indigo-500 via-violet-500 to-fuchsia-500 px-4 py-1.5 text-xs font-medium text-white",children:"Resume notifications"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"text-sm text-slate-700 dark:text-slate-200",children:"Pause all in-app notifications for a while."}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsx)("button",{onClick:()=>{eg(3),(0,y.Ay)("Notifications paused for 3 days","success")},className:"rounded-full bg-slate-900 px-3 py-1.5 text-xs font-medium text-white",children:"Pause 3 days"}),(0,s.jsx)("button",{onClick:()=>{eg(7),(0,y.Ay)("Notifications paused for 7 days","success")},className:"rounded-full bg-slate-900 px-3 py-1.5 text-xs font-medium text-white",children:"Pause 7 days"}),(0,s.jsx)("button",{onClick:()=>{ey(),(0,y.Ay)("Notifications paused indefinitely","success")},className:"rounded-full border px-3 py-1.5 text-xs font-medium",children:"Pause indef
1initely"})]})]}),(0,s.jsx)("div",{className:"text-xs text-slate-500 dark:text-slate-400",children:"This only affects in-app check-ins. You can resume anytime."})]})]}),"account"===J&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("section",{className:eQ,children:[(0,s.jsx)(eG,{title:"Language & Region",subtitle:"Locale, date & time",iconTint:eB.icon,icon:(0,s.jsx)(m.A,{className:"h-5 w-5 text-slate-700 dark:text-slate-200"})}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("label",{className:"w-28 text-xs text-slate-600 dark:text-slate-300",children:"Language"}),(0,s.jsxs)("select",{value:ec.language.locale,onChange:e=>eO({locale:e.target.value}),className:" glass-soft flex-1 rounded-lg bg-white/80 dark:bg-white/10 px-3 py-1.5 text-sm text-slate-900 dark:text-slate-100 shadow-sm ",children:[(0,s.jsx)("option",{value:"en",children:"English"}),(0,s.jsx)("option",{value:"hi",children:"हिन्दी"})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("label",{className:"w-28 text-xs text-slate-600 dark:text-slate-300",children:"Date format"}),(0,s.jsxs)("select",{value:ec.language.dateFormat,onChange:e=>eO({dateFormat:e.target.value}),className:" glass-soft flex-1 rounded-lg bg-white/80 dark:bg-white/10 px-3 py-1.5 text-sm text-slate-900 dark:text-slate-100 shadow-sm ",children:[(0,s.jsx)("option",{value:"DD/MM/YYYY",children:"DD/MM/YYYY"}),(0,s.jsx)("option",{value:"MM/DD/YYYY",children:"MM/DD/YYYY"}),(0,s.jsx)("option",{value:"YYYY-MM-DD",children:"YYYY-MM-DD"})]}),(0,s.jsxs)("div",{className:"mt-1 text-xs text-slate-500",children:["Example: ",eV]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("label",{className:"w-28 text-xs text-slate-600 dark:text-slate-300",children:"Time format"}),(0,s.jsxs)("select",{value:ec.language.timeFormat24h?"24":"12",onChange:e=>eO({timeFormat24h:"24"===e.target.value}),className:" glass-soft flex-1 rounded-lg bg-white/80 dark:bg-white/10 px-3 py-1.5 text-sm text-slate-900 dark:text-slate-100 shadow-sm ",children:[(0,s.jsx)("option",{value:"24",children:"24-hour"}),(0,s.jsx)("option",{value:"12",children:"12-hour"})]})]})]})]}),(0,s.jsxs)("section",{className:eQ,children:[(0,s.jsx)(eG,{title:"Your information",subtitle:"View, edit, or remove what you shared during setup",iconTint:eB.icon,icon:(0,s.jsx)(x,{className:"h-5 w-5 text-slate-700 dark:text-slate-200"})}),(0,s.jsx)(Y,{})]}),(0,s.jsxs)("section",{className:eQ,children:[(0,s.jsx)(eG,{title:"Privacy & Data",subtitle:"Storage and exports",iconTint:eB.icon,icon:(0,s.jsx)(u,{className:"h-5 w-5 text-slate-700 dark:text-slate-200"})}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsx)("button",{onClick:()=>eK("json"),className:"glass-soft rounded-lg bg-white/70 dark:bg-white/10 px-3 py-1.5 text-sm font-medium text-slate-900 dark:text-slate-100 shadow-sm hover:bg-white/90 dark:hover:bg-white/15",children:"Export (JSON)"}),(0,s.jsx)("button",{onClick:()=>eK("zip"),className:"glass-soft rounded-lg bg-white/70 dark:bg-white/10 px-3 py-1.5 text-sm font-medium text-slate-900 dark:text-slate-100 shadow-sm hover:bg-white/90 dark:hover:bg-white/15",children:"Zip export"}),(0,s.jsx)("button",{onClick:()=>eK("md"),className:"glass-soft rounded-lg bg-white/70 dark:bg-white/10 px-3 py-1.5 text-sm font-medium text-slate-900 dark:text-slate-100 shadow-sm hover:bg-white/90 dark:hover:bg-white/15",title:"Export as Markdown",children:"Export (MD)"}),(0,s.jsx)("button",{onClick:()=>eK("txt"),className:"glass-soft rounded-lg bg-white/70 dark:bg-white/10 px-3 py-1.5 text-sm font-medium text-slate-900 dark:text-slate-100 shadow-sm hover:bg-white/90 dark:hover:bg-white/15",title:"Export as plain text",children:"Export (TXT)"}),(0,s.jsx)("button",{onClick:()=>eK("pdf"),className:"glass-soft rounded-lg bg-white/70 dark:bg-white/10 px-3 py-1.5 text-sm font-medium text-slate-900 dark:text-slate-100 shadow-sm hover:bg-white/90 dark:hover:bg-white/15",title:"Export as PDF (server must support)",children:"Export (PDF)"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"mb-2 block text-xs text-slate-600 dar
1k:text-slate-300",children:"Data retention"}),(0,s.jsxs)("select",{value:String(null!=(P=ec.data.retentionDays)?P:"forever"),onChange:e=>{let t;return t={retentionDays:"forever"===e.target.value?null:Number(e.target.value)},eu(e=>({...e,data:{...e.data||{},...t}}))},className:"glass-soft w-full rounded-lg bg-white/80 dark:bg-white/10 px-3 py-1.5 text-sm text-slate-900 dark:text-slate-100 shadow-sm",children:[(0,s.jsx)("option",{value:"forever",children:"Keep forever"}),(0,s.jsx)("option",{value:"365",children:"Delete older than 1 year"}),(0,s.jsx)("option",{value:"90",children:"Delete older than 90 days"}),(0,s.jsx)("option",{value:"30",children:"Delete older than 30 days"})]})]})]})]}),(0,s.jsx)("div",{children:(0,s.jsxs)("button",{onClick:()=>eh(!0),className:"glass-soft flex w-full items-center justify-center gap-2 rounded-2xl bg-white/70 dark:bg-white/10 px-3 py-2 text-sm font-medium text-slate-800 dark:text-slate-100 shadow-sm hover:bg-white/90 dark:hover:bg-white/15",children:[(0,s.jsx)(p,{className:"h-4 w-4 text-slate-700 dark:text-slate-200"}),"Reset to defaults"]})})]})]})]})]})]})]}),document.body)}let U={blue:"#3b82f6",lavender:"#7c5cff",mint:"#2dd4bf",rose:"#fb7185",neutral:"#9ca3af"}},50276:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(17963).A)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])},53038:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(17963).A)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},91013:(e,t,a)=>{a.d(t,{AI:()=>o,Ow:()=>r,Wp:()=>d});var s=a(9641);function r(){try{window.dispatchEvent(new CustomEvent("innera:open-settings"))}catch(e){}}let n=!0,i=!1;function l(e){try{window.dispatchEvent(new CustomEvent("innera:ai-global-toggle",{detail:{disabled:e}}))}catch(e){}}function o(){return i||(i=!0,(0,s.XO8)().then(e=>{let t=!e.ai_summary_consent||!!e.ai_global_disabled;n=t,l(t)}).catch(()=>{l(n)})),n}function d(e){let t=n;n=e,l(e),(0,s.RDl)(!e).catch(()=>{n=t,l(t)})}},92551:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(17963).A)("type",[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]])},93536:(e,t,a)=>{a.d(t,{A:()=>s});let s=(0,a(17963).A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])}}]);

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.