jinn-cli 0.7.1 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/engines/claude.d.ts.map +1 -1
- package/dist/src/engines/claude.js +9 -0
- package/dist/src/engines/claude.js.map +1 -1
- package/dist/src/gateway/__tests__/api-last-n.test.d.ts +2 -0
- package/dist/src/gateway/__tests__/api-last-n.test.d.ts.map +1 -0
- package/dist/src/gateway/__tests__/api-last-n.test.js +32 -0
- package/dist/src/gateway/__tests__/api-last-n.test.js.map +1 -0
- package/dist/src/gateway/api.d.ts.map +1 -1
- package/dist/src/gateway/api.js +30 -0
- package/dist/src/gateway/api.js.map +1 -1
- package/dist/src/gateway/lifecycle.d.ts.map +1 -1
- package/dist/src/gateway/lifecycle.js +1 -0
- package/dist/src/gateway/lifecycle.js.map +1 -1
- package/dist/src/sessions/__tests__/callbacks.test.d.ts +2 -0
- package/dist/src/sessions/__tests__/callbacks.test.d.ts.map +1 -0
- package/dist/src/sessions/__tests__/callbacks.test.js +118 -0
- package/dist/src/sessions/__tests__/callbacks.test.js.map +1 -0
- package/dist/src/sessions/callbacks.d.ts +1 -1
- package/dist/src/sessions/callbacks.js +4 -4
- package/dist/src/sessions/callbacks.js.map +1 -1
- package/dist/src/sessions/manager.d.ts.map +1 -1
- package/dist/src/sessions/manager.js +21 -3
- package/dist/src/sessions/manager.js.map +1 -1
- package/dist/src/shared/__tests__/rateLimit.test.d.ts +2 -0
- package/dist/src/shared/__tests__/rateLimit.test.d.ts.map +1 -0
- package/dist/src/shared/__tests__/rateLimit.test.js +108 -0
- package/dist/src/shared/__tests__/rateLimit.test.js.map +1 -0
- package/dist/src/shared/__tests__/usageAwareness.test.d.ts +2 -0
- package/dist/src/shared/__tests__/usageAwareness.test.d.ts.map +1 -0
- package/dist/src/shared/__tests__/usageAwareness.test.js +58 -0
- package/dist/src/shared/__tests__/usageAwareness.test.js.map +1 -0
- package/dist/src/shared/rateLimit.d.ts +7 -0
- package/dist/src/shared/rateLimit.d.ts.map +1 -1
- package/dist/src/shared/rateLimit.js +31 -0
- package/dist/src/shared/rateLimit.js.map +1 -1
- package/dist/src/shared/usageAwareness.d.ts.map +1 -1
- package/dist/src/shared/usageAwareness.js +7 -0
- package/dist/src/shared/usageAwareness.js.map +1 -1
- package/dist/web/404.html +1 -1
- package/dist/web/_next/static/chunks/{155-592ad81a5c00a38a.js → 155-277bf3022d16e74f.js} +1 -1
- package/dist/web/_next/static/chunks/{192-bd69b67fd03b9f3d.js → 192-3064c98adfeef88c.js} +1 -1
- package/dist/web/_next/static/chunks/{51-ea7256657692ba90.js → 51-43ce350b707e6b06.js} +1 -1
- package/dist/web/_next/static/chunks/app/_not-found/page-1a2952195ec2c3fa.js +1 -0
- package/dist/web/_next/static/chunks/app/chat/page-d9b12d7effe66c59.js +1 -0
- package/dist/web/_next/static/chunks/app/cron/page-03f6c20a2336f185.js +1 -0
- package/dist/web/_next/static/chunks/app/kanban/{page-0e1b2a66378b8a6b.js → page-0aa74ece5109e58f.js} +1 -1
- package/dist/web/_next/static/chunks/app/{layout-ab9ba2b24a88513d.js → layout-45d8b9cc84f9443f.js} +1 -1
- package/dist/web/_next/static/chunks/app/logs/{page-b2ea0e6b92c54706.js → page-0f2b58794d9a97ce.js} +1 -1
- package/dist/web/_next/static/chunks/app/org/{page-05c8d33b3bf07d3d.js → page-e51ef93389a23de8.js} +1 -1
- package/dist/web/_next/static/chunks/app/{page-57dcf41f8ef011a7.js → page-16b78d2823b60898.js} +1 -1
- package/dist/web/_next/static/chunks/app/settings/{page-2903a5e9b8b0fc4a.js → page-8d1048b944663524.js} +1 -1
- package/dist/web/_next/static/chunks/app/skills/page-6d9c1d5b03aa86bb.js +1 -0
- package/dist/web/_next/static/chunks/{main-app-72a2d12a170701ef.js → main-app-637478e5d2259005.js} +1 -1
- package/dist/web/_next/static/chunks/{webpack-440561fa60ef8a8f.js → webpack-e7350efbcf65db9c.js} +1 -1
- package/dist/web/_next/static/css/92635e77ae2cd8fd.css +1 -0
- package/dist/web/chat.html +1 -1
- package/dist/web/chat.txt +4 -4
- package/dist/web/cron.html +1 -1
- package/dist/web/cron.txt +4 -4
- package/dist/web/index.html +1 -1
- package/dist/web/index.txt +4 -4
- package/dist/web/kanban.html +1 -1
- package/dist/web/kanban.txt +4 -4
- package/dist/web/logs.html +2 -2
- package/dist/web/logs.txt +4 -4
- package/dist/web/org.html +1 -1
- package/dist/web/org.txt +4 -4
- package/dist/web/sessions.html +1 -1
- package/dist/web/sessions.txt +3 -3
- package/dist/web/settings.html +1 -1
- package/dist/web/settings.txt +4 -4
- package/dist/web/skills.html +1 -1
- package/dist/web/skills.txt +4 -4
- package/package.json +1 -1
- package/template/AGENTS.md +21 -0
- package/template/CLAUDE.md +21 -0
- package/dist/web/_next/static/chunks/app/_not-found/page-22b69e9fb96ef3fc.js +0 -1
- package/dist/web/_next/static/chunks/app/chat/page-767bdc1d75890637.js +0 -1
- package/dist/web/_next/static/chunks/app/cron/page-4ede68bcdb3e76ca.js +0 -1
- package/dist/web/_next/static/chunks/app/skills/page-971feac69b3a1383.js +0 -1
- package/dist/web/_next/static/css/e79d77e53f783583.css +0 -1
- /package/dist/web/_next/static/{znh0MxrZokpk1kOs8cTmh → astVwZfaNwQEC0C3qtVHe}/_buildManifest.js +0 -0
- /package/dist/web/_next/static/{znh0MxrZokpk1kOs8cTmh → astVwZfaNwQEC0C3qtVHe}/_ssgManifest.js +0 -0
package/dist/web/_next/static/chunks/app/logs/{page-b2ea0e6b92c54706.js → page-0f2b58794d9a97ce.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[524],{
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[524],{6372:(e,a,t)=>{Promise.resolve().then(t.bind(t,6879))},6879:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>x});var r=t(4130),s=t(7946),l=t(3250);let n=(0,l.A)("radio",[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]),i=(0,l.A)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);var c=t(6654),o=t(7192),d=t(8064);function v(e){let{label:a,value:t,color:s,pulse:l}=e;return(0,r.jsxs)("div",{className:"bg-[var(--material-regular)] border border-[var(--separator)] rounded-[var(--radius-md)] p-[var(--space-4)]",children:[(0,r.jsx)("div",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)] font-[var(--weight-medium)] mb-[var(--space-1)]",children:a}),(0,r.jsxs)("div",{className:"flex items-center gap-[var(--space-2)]",children:[l&&t>0&&(0,r.jsx)("span",{className:"animate-error-pulse w-2 h-2 rounded-full bg-[var(--system-red)] shrink-0"}),(0,r.jsx)("span",{className:"text-[length:var(--text-title2)] font-[var(--weight-bold)]",style:{color:null!=s?s:"var(--text-primary)"},children:t})]})]})}function x(){let[e,a]=(0,s.useState)([]),[t,l]=(0,s.useState)(!0),[x,p]=(0,s.useState)(!1),[h,m]=(0,s.useState)(null),[u,g]=(0,s.useState)(new Date),[f,b]=(0,s.useState)("just now"),y=(0,s.useCallback)(()=>{p(!0),m(null),c.F.getLogs(500).then(e=>{var t;a(null!=(t=e.lines)?t:[]),g(new Date)}).catch(e=>{m(e instanceof Error?e.message:"Failed to load logs")}).finally(()=>{l(!1),p(!1)})},[]);(0,s.useEffect)(()=>{y();let e=setInterval(y,3e4);return()=>clearInterval(e)},[y]),(0,s.useEffect)(()=>{function e(){let e=Math.floor((Date.now()-u.getTime())/1e3);e<10?b("just now"):e<60?b("".concat(e,"s ago")):b("".concat(Math.floor(e/60),"m ago"))}e();let a=setInterval(e,1e4);return()=>clearInterval(a)},[u]);let j=e.map(d.w),w=j.length,k=j.filter(e=>"error"===e.level).length,N=j.filter(e=>"info"===e.level).length,M=j.filter(e=>"warn"===e.level).length;return(0,r.jsx)(o.M,{children:(0,r.jsxs)("div",{className:"h-full flex flex-col overflow-hidden animate-fade-in bg-[var(--bg)]",children:[(0,r.jsx)("header",{className:"sticky top-0 z-10 flex-shrink-0 bg-[var(--material-regular)] border-b border-[var(--separator)]",style:{backdropFilter:"blur(40px) saturate(180%)",WebkitBackdropFilter:"blur(40px) saturate(180%)"},children:(0,r.jsxs)("div",{className:"flex items-center justify-between px-[var(--space-6)] py-[var(--space-4)]",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-[length:var(--text-title1)] font-[var(--weight-bold)] text-[var(--text-primary)] tracking-[-0.5px] leading-[var(--leading-tight)]",children:"Activity Console"}),!t&&(0,r.jsxs)("p",{className:"text-[length:var(--text-footnote)] text-[var(--text-secondary)] mt-[var(--space-1)]",children:[w," event",1!==w?"s":"",k>0&&(0,r.jsxs)("span",{className:"text-[var(--system-red)]",children:[" \xb7 ",k," error",1!==k?"s":""]})]})]}),(0,r.jsx)(o.v,{children:(0,r.jsxs)("div",{className:"flex items-center gap-[var(--space-3)]",children:[(0,r.jsxs)("button",{onClick:()=>window.dispatchEvent(new CustomEvent("open-live-stream")),className:"focus-ring flex items-center py-[6px] px-[14px] rounded-[var(--radius-sm)] border-none cursor-pointer text-[length:var(--text-footnote)] font-[var(--weight-semibold)] gap-1.5 bg-[var(--accent-fill)] text-[var(--accent)] transition-all duration-200 ease-[var(--ease-smooth)]",children:[(0,r.jsx)(n,{size:14}),"Open Live Stream"]}),(0,r.jsxs)("span",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)]",children:["Updated ",f]}),(0,r.jsx)("button",{onClick:y,className:"focus-ring w-8 h-8 flex items-center justify-center rounded-[var(--radius-sm)] border-none bg-transparent text-[var(--text-tertiary)] cursor-pointer transition-colors duration-150 ease-[var(--ease-smooth)]","aria-label":"Refresh logs",children:(0,r.jsx)(i,{size:16,className:x?"animate-spin":""})})]})})]})}),(0,r.jsxs)("div",{className:"flex-1 overflow-y-auto flex flex-col px-[var(--space-6)] pt-[var(--space-4)] pb-[var(--space-6)] min-h-0",children:[h&&(0,r.jsxs)("div",{className:"mb-[var(--space-3)] px-[var(--space-4)] py-[var(--space-3)] rounded-[var(--radius-md)] bg-[rgba(255,69,58,0.06)] border border-[rgba(255,69,58,0.15)] text-[length:var(--text-footnote)] text-[var(--system-red)]",children:["Failed to load logs: ",h]}),t?(0,r.jsx)("div",{className:"flex items-center justify-center h-[200px] text-[var(--text-tertiary)]",children:"Loading..."}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"summary-cards-grid grid grid-cols-4 gap-[var(--space-3)] mb-[var(--space-4)]",children:[(0,r.jsx)(v,{label:"Total Events",value:w}),(0,r.jsx)(v,{label:"Errors",value:k,color:k>0?"var(--system-red)":"var(--system-green)",pulse:!0}),(0,r.jsx)(v,{label:"Info",value:N,color:"var(--system-green)"}),(0,r.jsx)(v,{label:"Warnings",value:M,color:"var(--system-orange)"})]}),(0,r.jsx)(d.b,{lines:e})]})]}),(0,r.jsx)("style",{children:"\n @media (max-width: 640px) {\n .summary-cards-grid {\n grid-template-columns: 1fr 1fr !important;\n }\n }\n "})]})})}}},e=>{e.O(0,[625,51,155,192,344,144,358],()=>e(e.s=6372)),_N_E=e.O()}]);
|
package/dist/web/_next/static/chunks/app/org/{page-05c8d33b3bf07d3d.js → page-e51ef93389a23de8.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[423],{1260:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return r.workAsyncStorageInstance}});let r=a(4085)},3049:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let r=a(4130),n=a(7946),s=a(9398);function l(e){return{default:e&&"default"in e?e.default:e}}a(8587);let i={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},o=function(e){let t={...i,...e},a=(0,n.lazy)(()=>t.loader().then(l)),o=t.loading;function c(e){let l=o?(0,r.jsx)(o,{isLoading:!0,pastDelay:!0,error:null}):null,i=!t.ssr||!!t.loading,c=i?n.Suspense:n.Fragment,d=t.ssr?(0,r.jsxs)(r.Fragment,{children:[null,(0,r.jsx)(a,{...e})]}):(0,r.jsx)(s.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(a,{...e})});return(0,r.jsx)(c,{...i?{fallback:l}:{},children:d})}return c.displayName="LoadableComponent",c}},3225:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n}});let r=a(5305)._(a(3049));function n(e,t){var a;let n={};"function"==typeof e&&(n.loader=e);let s={...n,...t};return(0,r.default)({...s,modules:null==(a=s.loadableGenerated)?void 0:a.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3637:(e,t,a)=>{"use strict";a.d(t,{Wu:()=>l,Zp:()=>s});var r=a(4130);a(7946);var n=a(6063);function s(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card",className:(0,n.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...a})}function l(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-content",className:(0,n.cn)("px-6",t),...a})}},4085:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return r}});let r=(0,a(7299).createAsyncLocalStorage)()},4580:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>C});var r=a(4130),n=a(7946),s=a(3225),l=a.n(s),i=a(6654);let o={executive:"\uD83C\uDFAF",manager:"\uD83D\uDCCB",senior:"⭐",employee:"\uD83D\uDC64"};function c(e){let{rank:t}=e,a={executive:{bg:"color-mix(in srgb, var(--system-purple) 15%, transparent)",text:"var(--system-purple)"},manager:{bg:"color-mix(in srgb, var(--system-blue) 15%, transparent)",text:"var(--system-blue)"},senior:{bg:"color-mix(in srgb, var(--system-green) 15%, transparent)",text:"var(--system-green)"},employee:{bg:"var(--fill-tertiary)",text:"var(--text-tertiary)"}},n=a[t]||a.employee;return(0,r.jsx)("span",{className:"text-[length:var(--text-caption2)] font-[var(--weight-semibold)] px-[10px] py-[2px] rounded-[10px] uppercase tracking-[0.02em]",style:{color:n.text,background:n.bg},children:t})}function d(e){let{name:t}=e,[a,s]=(0,n.useState)(null),[l,d]=(0,n.useState)([]),[x,u]=(0,n.useState)(!0),[p,v]=(0,n.useState)(null),[m,g]=(0,n.useState)(!1);if((0,n.useEffect)(()=>{u(!0),v(null),g(!1),Promise.all([i.F.getEmployee(t),i.F.getSessions()]).then(e=>{let[a,r]=e;s(a),d(r.filter(e=>e.employee===t).slice(0,10))}).catch(e=>v(e.message)).finally(()=>u(!1))},[t]),x)return(0,r.jsx)("div",{className:"flex items-center justify-center h-64 text-[var(--text-tertiary)] text-[length:var(--text-caption1)]",children:"Loading..."});if(p)return(0,r.jsxs)("div",{className:"rounded-[var(--radius-md,12px)] px-[var(--space-4)] py-[var(--space-3)] text-[length:var(--text-caption1)] text-[var(--system-red)]",style:{background:"color-mix(in srgb, var(--system-red) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--system-red) 30%, transparent)"},children:["Failed to load employee: ",p]});if(!a)return null;let f=a.rank||"employee",h=o[f]||o.employee,b=a.persona||"",y=b.length>200&&!m?b.slice(0,200)+"...":b;return(0,r.jsxs)("div",{className:"flex flex-col gap-[var(--space-6)]",children:[(0,r.jsxs)("div",{className:"rounded-[var(--radius-lg,16px)] border border-[var(--separator)] bg-[var(--material-regular)] p-[var(--space-6)]",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between mb-[var(--space-4)]",children:[(0,r.jsxs)("div",{className:"flex items-center gap-[var(--space-3)]",children:[(0,r.jsx)("span",{className:"text-[28px] leading-none",children:h}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-[length:var(--text-title2)] font-[var(--weight-bold)] tracking-[var(--tracking-tight)] text-[var(--text-primary)] m-0",children:a.displayName||a.name}),(0,r.jsx)("p",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)] mt-[2px] mb-0 ml-0 mr-0 font-[family-name:var(--font-mono)]",children:a.name})]})]}),(0,r.jsx)(c,{rank:f})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-[var(--space-4)]",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[length:var(--text-caption2)] font-[var(--weight-semibold)] uppercase tracking-[var(--tracking-wide)] text-[var(--text-tertiary)] mb-[var(--space-1)]",children:"Department"}),(0,r.jsx)("p",{className:"text-[length:var(--text-body)] text-[var(--text-primary)] m-0",children:a.department||"None"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[length:var(--text-caption2)] font-[var(--weight-semibold)] uppercase tracking-[var(--tracking-wide)] text-[var(--text-tertiary)] mb-[var(--space-1)]",children:"Engine"}),(0,r.jsxs)("p",{className:"text-[length:var(--text-body)] text-[var(--text-primary)] m-0",children:[a.engine||"claude"," ",(0,r.jsxs)("span",{className:"text-[var(--text-tertiary)]",children:["/ ",a.model||"default"]})]})]})]}),b&&(0,r.jsxs)("div",{className:"mt-[var(--space-4)] pt-[var(--space-4)] border-t border-[var(--separator)]",children:[(0,r.jsx)("p",{className:"text-[length:var(--text-caption2)] font-[var(--weight-semibold)] uppercase tracking-[var(--tracking-wide)] text-[var(--text-tertiary)] mb-[var(--space-2)]",children:"Persona"}),(0,r.jsx)("p",{className:"text-[length:var(--text-body)] text-[var(--text-secondary)] leading-[var(--leading-relaxed)] whitespace-pre-wrap m-0",children:y}),b.length>200&&(0,r.jsx)("button",{onClick:()=>g(!m),className:"text-[length:var(--text-caption1)] text-[var(--accent)] bg-none border-none cursor-pointer p-0 mt-[var(--space-1)]",children:m?"Show less":"Show more"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] tracking-[var(--tracking-wide)] uppercase text-[var(--text-tertiary)] mb-[var(--space-3)]",children:"Recent Sessions"}),0===l.length?(0,r.jsx)("p",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)] text-center py-[var(--space-6)] px-0",children:"No sessions found for this employee."}):(0,r.jsx)("div",{className:"rounded-[var(--radius-lg,16px)] border border-[var(--separator)] bg-[var(--material-regular)] overflow-hidden",children:l.map((e,t)=>(0,r.jsxs)("div",{className:"px-[var(--space-5)] py-[var(--space-3)] flex items-center justify-between".concat(t>0?" border-t border-[var(--separator)]":""),children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[length:var(--text-body)] font-[family-name:var(--font-mono)] text-[var(--text-primary)] m-0",children:e.id.slice(0,8)}),(0,r.jsxs)("p",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)] mt-[2px]",children:[e.source||"unknown"," ",e.createdAt?new Date(e.createdAt).toLocaleDateString():""]})]}),(0,r.jsx)("span",{className:"text-[length:var(--text-caption2)] font-[var(--weight-semibold)] py-[2px] px-[8px] rounded-[10px]",style:"running"===e.status?{background:"color-mix(in srgb, var(--system-green) 15%, transparent)",color:"var(--system-green)"}:"error"===e.status?{background:"color-mix(in srgb, var(--system-red) 15%, transparent)",color:"var(--system-red)"}:{background:"var(--fill-tertiary)",color:"var(--text-tertiary)"},children:e.status||"idle"})]},e.id))})]})]})}var x=a(3637);let u={executive:"\uD83C\uDFAF",manager:"\uD83D\uDCCB",senior:"⭐",employee:"\uD83D\uDC64"};function p(e){let{employee:t,selected:a,onSelect:n}=e,s=u[t.rank]||u.employee;return(0,r.jsxs)("button",{onClick:n,className:"flex items-center gap-[var(--space-3)] px-[var(--space-4)] py-[var(--space-3)] rounded-[var(--radius-md,12px)] bg-[var(--material-regular)] cursor-pointer w-full text-left transition-all duration-150 ease-in-out ".concat(a?"border-[1.5px] border-[var(--accent)]":"border border-[var(--separator)]"),style:{boxShadow:a?"0 0 0 1px var(--accent), var(--shadow-subtle)":"var(--shadow-subtle)"},children:[(0,r.jsx)("span",{className:"text-2xl leading-none shrink-0",children:s}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("div",{className:"text-[length:var(--text-body)] font-[var(--weight-semibold)] text-[var(--text-primary)] whitespace-nowrap overflow-hidden text-ellipsis leading-[var(--leading-tight)]",children:t.displayName||t.name}),(0,r.jsx)("div",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)] whitespace-nowrap overflow-hidden text-ellipsis mt-px",children:t.department})]}),(0,r.jsxs)("div",{className:"flex flex-col items-end gap-1 shrink-0",children:[(0,r.jsx)("span",{className:"text-[length:var(--text-caption2)] font-[var(--weight-semibold)] text-[var(--accent)] bg-[var(--accent-fill)] px-[7px] py-px rounded-[10px]",children:t.engine}),(0,r.jsx)("span",{className:"text-[length:var(--text-caption2)] font-[var(--weight-medium)] text-[var(--text-quaternary)] bg-[var(--fill-quaternary)] px-[7px] py-px rounded-[10px]",children:t.model})]})]})}function v(e){let{label:t,count:a,children:n}=e;return(0,r.jsx)(x.Zp,{className:"p-0 shadow-none bg-[var(--bg-secondary)] rounded-[var(--radius-lg,16px)] border border-[var(--separator)]",children:(0,r.jsxs)(x.Wu,{className:"p-4 flex flex-col gap-[var(--space-2)]",children:[(0,r.jsxs)("div",{className:"flex items-center gap-[var(--space-2)] mb-[var(--space-1)]",children:[(0,r.jsx)("span",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] tracking-[var(--tracking-wide)] uppercase text-[var(--text-tertiary)]",children:t}),(0,r.jsxs)("span",{className:"text-[length:var(--text-caption2)] text-[var(--text-quaternary)] ml-auto",children:[a," employee",1!==a?"s":""]})]}),n]})})}function m(e){let{employees:t,selectedName:a,onSelect:n}=e,s=new Map,l=[];for(let e of t)if(e.department){let t=s.get(e.department)||[];t.push(e),s.set(e.department,t)}else l.push(e);let i=t.find(e=>"executive"===e.rank);return(0,r.jsxs)("div",{className:"overflow-y-auto p-[var(--space-6)] h-full",children:[i&&(0,r.jsxs)("button",{onClick:()=>n(i),className:"flex items-center gap-[var(--space-5)] w-full px-[var(--space-6)] py-[var(--space-5)] rounded-[var(--radius-xl,20px)] bg-[var(--material-regular)] cursor-pointer text-left mb-[var(--space-6)] transition-all duration-150 ease-in-out ".concat(a===i.name?"border-[1.5px] border-[var(--accent)]":"border border-[var(--separator)]"),style:{boxShadow:a===i.name?"0 0 0 1px var(--accent), var(--shadow-card)":"var(--shadow-card)"},children:[(0,r.jsx)("span",{className:"text-[40px] leading-none",children:u.executive}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("div",{className:"text-[length:var(--text-title2)] font-[var(--weight-bold)] text-[var(--text-primary)] tracking-[var(--tracking-tight)] leading-[var(--leading-tight)]",children:i.displayName||i.name}),(0,r.jsx)("div",{className:"text-[length:var(--text-subheadline)] text-[var(--text-secondary)] mt-0.5",children:i.department})]}),(0,r.jsxs)("div",{className:"flex gap-[var(--space-4)] shrink-0",children:[(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"text-[length:var(--text-title3)] font-[var(--weight-bold)] text-[var(--text-primary)] leading-none",children:t.length}),(0,r.jsx)("div",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)] mt-0.5",children:"employees"})]}),(0,r.jsx)("div",{className:"w-px self-stretch bg-[var(--separator)]"}),(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"text-[length:var(--text-title3)] font-[var(--weight-bold)] text-[var(--text-primary)] leading-none",children:s.size}),(0,r.jsx)("div",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)] mt-0.5",children:"depts"})]})]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(300px,1fr))] gap-[var(--space-5)] items-start",children:[Array.from(s.entries()).map(e=>{let[t,s]=e,l=s.filter(e=>e.name!==(null==i?void 0:i.name));return 0===l.length?null:(0,r.jsx)(v,{label:t,count:l.length,children:l.map(e=>(0,r.jsx)(p,{employee:e,selected:a===e.name,onSelect:()=>n(e)},e.name))},t)}),l.length>0&&(0,r.jsx)(v,{label:"Unassigned",count:l.filter(e=>e.name!==(null==i?void 0:i.name)).length,children:l.filter(e=>e.name!==(null==i?void 0:i.name)).map(e=>(0,r.jsx)(p,{employee:e,selected:a===e.name,onSelect:()=>n(e)},e.name))})]})]})}var g=a(6063);let f={executive:"\uD83C\uDFAF",manager:"\uD83D\uDCCB",senior:"⭐",employee:"\uD83D\uDC64"};function h(e){let{rank:t}=e,a={executive:{bg:"color-mix(in srgb, var(--system-purple) 15%, transparent)",text:"var(--system-purple)"},manager:{bg:"color-mix(in srgb, var(--system-blue) 15%, transparent)",text:"var(--system-blue)"},senior:{bg:"color-mix(in srgb, var(--system-green) 15%, transparent)",text:"var(--system-green)"},employee:{bg:"var(--fill-tertiary)",text:"var(--text-tertiary)"}},n=a[t]||a.employee;return(0,r.jsx)("span",{className:"rounded-[10px] px-2 py-0.5 text-[length:var(--text-caption2)] font-[var(--weight-semibold)] uppercase tracking-[0.02em]",style:{color:n.text,background:n.bg},children:t})}function b(e){let{employees:t,selectedName:a,onSelect:n}=e,s={executive:0,manager:1,senior:2,employee:3},l=[...t].sort((e,t)=>{var a,r;return(null!=(a=s[e.rank])?a:3)-(null!=(r=s[t.rank])?r:3)});return(0,r.jsxs)("div",{className:"h-full overflow-y-auto p-[var(--space-6)]",children:[(0,r.jsx)("div",{className:"mb-[var(--space-5)] flex gap-[var(--space-3)]",children:["executive","manager","senior","employee"].map(e=>{let a=t.filter(t=>t.rank===e).length;return(0,r.jsxs)("div",{className:"flex flex-1 items-center gap-[var(--space-3)] rounded-[var(--radius-md,12px)] border border-[var(--separator)] bg-[var(--material-regular)] px-[var(--space-4)] py-[var(--space-3)]",children:[(0,r.jsx)("span",{className:"text-[20px]",children:f[e]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-[length:var(--text-title3)] font-[var(--weight-bold)] leading-none text-[var(--text-primary)]",children:a}),(0,r.jsxs)("div",{className:"mt-0.5 text-[length:var(--text-caption2)] capitalize text-[var(--text-tertiary)]",children:[e,"s"]})]})]},e)})}),0===l.length?(0,r.jsx)("div",{className:"px-[var(--space-4)] py-[var(--space-16)] text-center text-[var(--text-tertiary)]",children:(0,r.jsx)("div",{className:"text-[length:var(--text-body)] font-[var(--weight-medium)]",children:"No employees found"})}):(0,r.jsx)("div",{className:"overflow-hidden rounded-[var(--radius-lg,16px)] border border-[var(--separator)] bg-[var(--bg-secondary)]",children:l.map((e,t)=>{let s=a===e.name,l=f[e.rank]||f.employee;return(0,r.jsxs)("button",{onClick:()=>n(e),className:(0,g.cn)("flex w-full items-center gap-[var(--space-3)] px-[var(--space-4)] py-[var(--space-3)] text-left transition-colors",s?"bg-[var(--fill-secondary)]":"bg-transparent hover:bg-accent"),style:t>0?{borderTop:"1px solid var(--separator)"}:void 0,children:[(0,r.jsx)("span",{className:"shrink-0 text-[20px] leading-none",children:l}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-[var(--space-2)]",children:[(0,r.jsx)("span",{className:"text-[length:var(--text-body)] font-[var(--weight-semibold)] text-[var(--text-primary)]",children:e.displayName||e.name}),(0,r.jsx)("span",{className:"font-[family-name:var(--font-mono)] text-[length:var(--text-caption1)] text-[var(--text-quaternary)]",children:e.name})]}),(0,r.jsx)("div",{className:"mt-0.5 flex items-center gap-[var(--space-2)]",children:(0,r.jsx)("span",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)]",children:e.department||"No department"})})]}),(0,r.jsx)(h,{rank:e.rank})]},e.name)})})]})}var y=a(7192),j=a(9664),N=a(4722),w=a(8565);let k=l()(()=>Promise.all([a.e(763),a.e(743),a.e(943)]).then(a.bind(a,7943)).then(e=>({default:e.OrgMap})),{loadableGenerated:{webpack:()=>[7943]},ssr:!1,loading:()=>(0,r.jsx)("div",{className:"flex flex-col items-center justify-center h-full gap-[var(--space-3)] text-[var(--text-tertiary)] text-[length:var(--text-caption1)]",children:"Loading map..."})});function C(){var e,t,a;(0,w.i)([{label:"Organization"}]);let[s,l]=(0,n.useState)([]),[o,c]=(0,n.useState)(!0),[x,u]=(0,n.useState)(null),[p,v]=(0,n.useState)(null),[g,f]=(0,n.useState)("map"),h=(0,n.useRef)(null),{settings:C}=(0,N.t0)(),D=(0,n.useCallback)(()=>{c(!0),u(null),i.F.getOrg().then(async e=>{var t,a;let r=await Promise.all(e.employees.map(async e=>{try{return await i.F.getEmployee(e)}catch(t){return{name:e,displayName:e,department:"",rank:"employee",engine:"unknown",model:"unknown",persona:""}}}));l([{name:(null!=(t=C.portalName)?t:"Jinn").toLowerCase(),displayName:null!=(a=C.portalName)?a:"Jinn",department:"",rank:"executive",engine:"claude",model:"opus",persona:"COO and AI gateway daemon"},...r])}).catch(e=>u(e.message)).finally(()=>c(!1))},[C.portalName]);(0,n.useEffect)(()=>{D()},[D]),(0,n.useEffect)(()=>{p&&h.current&&h.current.focus()},[p]),(0,n.useEffect)(()=>{function e(e){"Escape"===e.key&&p&&v(null)}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[p]);let S=(0,n.useCallback)(e=>{v(e)},[]);return x?(0,r.jsx)(y.M,{children:(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center h-full gap-[var(--space-4)] text-[var(--text-tertiary)]",children:[(0,r.jsxs)("div",{className:"rounded-[var(--radius-md,12px)] px-[var(--space-4)] py-[var(--space-3)] text-[length:var(--text-body)] text-[var(--system-red)]",style:{background:"color-mix(in srgb, var(--system-red) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--system-red) 30%, transparent)"},children:["Failed to load organization: ",x]}),(0,r.jsx)("button",{onClick:D,className:"px-[var(--space-4)] py-[var(--space-2)] rounded-[var(--radius-md,12px)] bg-[var(--accent)] text-[var(--accent-contrast)] border-none cursor-pointer text-[length:var(--text-body)] font-[var(--weight-semibold)]",children:"Retry"})]})}):(0,r.jsx)(y.M,{children:(0,r.jsxs)("div",{className:"flex h-full relative bg-[var(--bg)]",children:[(0,r.jsx)("div",{className:"flex-1 h-full relative",children:(0,r.jsxs)(j.tU,{value:g,onValueChange:f,className:"h-full flex flex-col",children:[(0,r.jsx)("div",{className:"absolute top-[var(--space-4)] left-[var(--space-4)] z-10",children:(0,r.jsxs)(j.j7,{children:[(0,r.jsx)(j.Xi,{value:"map",children:"Map"}),(0,r.jsx)(j.Xi,{value:"grid",children:"Grid"}),(0,r.jsx)(j.Xi,{value:"list",children:"List"})]})}),(0,r.jsx)(j.av,{value:"map",className:"flex-1",children:o?(0,r.jsx)("div",{className:"flex items-center justify-center h-full text-[var(--text-tertiary)] text-[length:var(--text-caption1)]",children:"Loading..."}):(0,r.jsx)(k,{employees:s,selectedName:null!=(e=null==p?void 0:p.name)?e:null,onNodeClick:S})}),(0,r.jsx)(j.av,{value:"grid",className:"flex-1 overflow-hidden",children:o?(0,r.jsx)("div",{className:"flex items-center justify-center h-full text-[var(--text-tertiary)] text-[length:var(--text-caption1)]",children:"Loading..."}):(0,r.jsx)(m,{employees:s,selectedName:null!=(t=null==p?void 0:p.name)?t:null,onSelect:S})}),(0,r.jsx)(j.av,{value:"list",className:"flex-1 overflow-hidden",children:o?(0,r.jsx)("div",{className:"flex items-center justify-center h-full text-[var(--text-tertiary)] text-[length:var(--text-caption1)]",children:"Loading..."}):(0,r.jsx)(b,{employees:s,selectedName:null!=(a=null==p?void 0:p.name)?a:null,onSelect:S})})]})}),p&&(0,r.jsx)("div",{className:"fixed inset-0 z-30 lg:hidden bg-black/50",onClick:()=>v(null)}),p&&(0,r.jsx)("div",{className:"absolute top-0 right-0 bottom-0 z-30",children:(0,r.jsxs)("div",{className:"w-[380px] max-w-[100vw] h-full overflow-y-auto bg-[var(--bg)] flex flex-col shadow-[var(--shadow-overlay)]",children:[(0,r.jsx)("div",{className:"sticky top-0 z-10 flex items-center justify-end px-[var(--space-4)] py-[var(--space-3)] bg-[var(--bg)]",children:(0,r.jsx)("button",{ref:h,onClick:()=>v(null),"aria-label":"Close detail panel",className:"w-[30px] h-[30px] rounded-full flex items-center justify-center bg-[var(--fill-tertiary)] text-[var(--text-secondary)] border-none cursor-pointer text-sm",children:"✕"})}),(0,r.jsx)("div",{className:"px-[var(--space-4)] pb-[var(--space-6)]",children:(0,r.jsx)(d,{name:p.name})})]})})]})})}},5580:(e,t,a)=>{Promise.resolve().then(a.bind(a,4580))},7299:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var a in t)Object.defineProperty(e,a,{enumerable:!0,get:t[a]})}(t,{bindSnapshot:function(){return l},createAsyncLocalStorage:function(){return s},createSnapshot:function(){return i}});let a=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class r{disable(){throw a}getStore(){}run(){throw a}exit(){throw a}enterWith(){throw a}static bind(e){return e}}let n="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function s(){return n?new n:new r}function l(e){return n?n.bind(e):r.bind(e)}function i(){return n?n.snapshot():function(e,...t){return e(...t)}}},8587:(e,t,a)=>{"use strict";function r(e){let{moduleIds:t}=e;return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return r}}),a(4130),a(1383),a(1260),a(9833)},9398:(e,t,a)=>{"use strict";function r(e){let{reason:t,children:a}=e;return a}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return r}}),a(3074)},9664:(e,t,a)=>{"use strict";a.d(t,{tU:()=>P,av:()=>L,j7:()=>F,Xi:()=>z});var r=a(4130),n=a(7946),s=a(4322),l=a(3397),i=a(5773),o=a(9458),c=a(4127),d=a(5822),x=a(7058),u=a(4068),p=a(5380),v="Tabs",[m,g]=(0,i.A)(v,[o.RG]),f=(0,o.RG)(),[h,b]=m(v),y=n.forwardRef((e,t)=>{let{__scopeTabs:a,value:n,onValueChange:s,defaultValue:l,orientation:i="horizontal",dir:o,activationMode:c="automatic",...m}=e,g=(0,x.jH)(o),[f,b]=(0,u.i)({prop:n,onChange:s,defaultProp:null!=l?l:"",caller:v});return(0,r.jsx)(h,{scope:a,baseId:(0,p.B)(),value:f,onValueChange:b,orientation:i,dir:g,activationMode:c,children:(0,r.jsx)(d.sG.div,{dir:g,"data-orientation":i,...m,ref:t})})});y.displayName=v;var j="TabsList",N=n.forwardRef((e,t)=>{let{__scopeTabs:a,loop:n=!0,...s}=e,l=b(j,a),i=f(a);return(0,r.jsx)(o.bL,{asChild:!0,...i,orientation:l.orientation,dir:l.dir,loop:n,children:(0,r.jsx)(d.sG.div,{role:"tablist","aria-orientation":l.orientation,...s,ref:t})})});N.displayName=j;var w="TabsTrigger",k=n.forwardRef((e,t)=>{let{__scopeTabs:a,value:n,disabled:s=!1,...i}=e,c=b(w,a),x=f(a),u=S(c.baseId,n),p=_(c.baseId,n),v=n===c.value;return(0,r.jsx)(o.q7,{asChild:!0,...x,focusable:!s,active:v,children:(0,r.jsx)(d.sG.button,{type:"button",role:"tab","aria-selected":v,"aria-controls":p,"data-state":v?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:u,...i,ref:t,onMouseDown:(0,l.mK)(e.onMouseDown,e=>{s||0!==e.button||!1!==e.ctrlKey?e.preventDefault():c.onValueChange(n)}),onKeyDown:(0,l.mK)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&c.onValueChange(n)}),onFocus:(0,l.mK)(e.onFocus,()=>{let e="manual"!==c.activationMode;v||s||!e||c.onValueChange(n)})})})});k.displayName=w;var C="TabsContent",D=n.forwardRef((e,t)=>{let{__scopeTabs:a,value:s,forceMount:l,children:i,...o}=e,x=b(C,a),u=S(x.baseId,s),p=_(x.baseId,s),v=s===x.value,m=n.useRef(v);return n.useEffect(()=>{let e=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,r.jsx)(c.C,{present:l||v,children:a=>{let{present:n}=a;return(0,r.jsx)(d.sG.div,{"data-state":v?"active":"inactive","data-orientation":x.orientation,role:"tabpanel","aria-labelledby":u,hidden:!n,id:p,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:n&&i})}})});function S(e,t){return"".concat(e,"-trigger-").concat(t)}function _(e,t){return"".concat(e,"-content-").concat(t)}D.displayName=C;var O=a(6063);function P(e){let{className:t,orientation:a="horizontal",...n}=e;return(0,r.jsx)(y,{"data-slot":"tabs","data-orientation":a,orientation:a,className:(0,O.cn)("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",t),...n})}let E=(0,s.F)("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function F(e){let{className:t,variant:a="default",...n}=e;return(0,r.jsx)(N,{"data-slot":"tabs-list","data-variant":a,className:(0,O.cn)(E({variant:a}),t),...n})}function z(e){let{className:t,...a}=e;return(0,r.jsx)(k,{"data-slot":"tabs-trigger",className:(0,O.cn)("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",t),...a})}function L(e){let{className:t,...a}=e;return(0,r.jsx)(D,{"data-slot":"tabs-content",className:(0,O.cn)("flex-1 outline-none",t),...a})}}},e=>{e.O(0,[625,51,458,155,192,344,144,358],()=>e(e.s=5580)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[423],{1260:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return r.workAsyncStorageInstance}});let r=a(4085)},3049:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let r=a(4130),n=a(7946),s=a(9398);function l(e){return{default:e&&"default"in e?e.default:e}}a(8587);let i={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},o=function(e){let t={...i,...e},a=(0,n.lazy)(()=>t.loader().then(l)),o=t.loading;function c(e){let l=o?(0,r.jsx)(o,{isLoading:!0,pastDelay:!0,error:null}):null,i=!t.ssr||!!t.loading,c=i?n.Suspense:n.Fragment,d=t.ssr?(0,r.jsxs)(r.Fragment,{children:[null,(0,r.jsx)(a,{...e})]}):(0,r.jsx)(s.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(a,{...e})});return(0,r.jsx)(c,{...i?{fallback:l}:{},children:d})}return c.displayName="LoadableComponent",c}},3225:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n}});let r=a(5305)._(a(3049));function n(e,t){var a;let n={};"function"==typeof e&&(n.loader=e);let s={...n,...t};return(0,r.default)({...s,modules:null==(a=s.loadableGenerated)?void 0:a.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},3637:(e,t,a)=>{"use strict";a.d(t,{Wu:()=>l,Zp:()=>s});var r=a(4130);a(7946);var n=a(6063);function s(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card",className:(0,n.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...a})}function l(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-content",className:(0,n.cn)("px-6",t),...a})}},4085:(e,t,a)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return r}});let r=(0,a(7299).createAsyncLocalStorage)()},4580:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>C});var r=a(4130),n=a(7946),s=a(3225),l=a.n(s),i=a(6654);let o={executive:"\uD83C\uDFAF",manager:"\uD83D\uDCCB",senior:"⭐",employee:"\uD83D\uDC64"};function c(e){let{rank:t}=e,a={executive:{bg:"color-mix(in srgb, var(--system-purple) 15%, transparent)",text:"var(--system-purple)"},manager:{bg:"color-mix(in srgb, var(--system-blue) 15%, transparent)",text:"var(--system-blue)"},senior:{bg:"color-mix(in srgb, var(--system-green) 15%, transparent)",text:"var(--system-green)"},employee:{bg:"var(--fill-tertiary)",text:"var(--text-tertiary)"}},n=a[t]||a.employee;return(0,r.jsx)("span",{className:"text-[length:var(--text-caption2)] font-[var(--weight-semibold)] px-[10px] py-[2px] rounded-[10px] uppercase tracking-[0.02em]",style:{color:n.text,background:n.bg},children:t})}function d(e){let{name:t}=e,[a,s]=(0,n.useState)(null),[l,d]=(0,n.useState)([]),[x,u]=(0,n.useState)(!0),[p,v]=(0,n.useState)(null),[m,g]=(0,n.useState)(!1);if((0,n.useEffect)(()=>{u(!0),v(null),g(!1),Promise.all([i.F.getEmployee(t),i.F.getSessions()]).then(e=>{let[a,r]=e;s(a),d(r.filter(e=>e.employee===t).slice(0,10))}).catch(e=>v(e.message)).finally(()=>u(!1))},[t]),x)return(0,r.jsx)("div",{className:"flex items-center justify-center h-64 text-[var(--text-tertiary)] text-[length:var(--text-caption1)]",children:"Loading..."});if(p)return(0,r.jsxs)("div",{className:"rounded-[var(--radius-md,12px)] px-[var(--space-4)] py-[var(--space-3)] text-[length:var(--text-caption1)] text-[var(--system-red)]",style:{background:"color-mix(in srgb, var(--system-red) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--system-red) 30%, transparent)"},children:["Failed to load employee: ",p]});if(!a)return null;let f=a.rank||"employee",h=o[f]||o.employee,b=a.persona||"",y=b.length>200&&!m?b.slice(0,200)+"...":b;return(0,r.jsxs)("div",{className:"flex flex-col gap-[var(--space-6)]",children:[(0,r.jsxs)("div",{className:"rounded-[var(--radius-lg,16px)] border border-[var(--separator)] bg-[var(--material-regular)] p-[var(--space-6)]",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between mb-[var(--space-4)]",children:[(0,r.jsxs)("div",{className:"flex items-center gap-[var(--space-3)]",children:[(0,r.jsx)("span",{className:"text-[28px] leading-none",children:h}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-[length:var(--text-title2)] font-[var(--weight-bold)] tracking-[var(--tracking-tight)] text-[var(--text-primary)] m-0",children:a.displayName||a.name}),(0,r.jsx)("p",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)] mt-[2px] mb-0 ml-0 mr-0 font-[family-name:var(--font-mono)]",children:a.name})]})]}),(0,r.jsx)(c,{rank:f})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-[var(--space-4)]",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[length:var(--text-caption2)] font-[var(--weight-semibold)] uppercase tracking-[var(--tracking-wide)] text-[var(--text-tertiary)] mb-[var(--space-1)]",children:"Department"}),(0,r.jsx)("p",{className:"text-[length:var(--text-body)] text-[var(--text-primary)] m-0",children:a.department||"None"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[length:var(--text-caption2)] font-[var(--weight-semibold)] uppercase tracking-[var(--tracking-wide)] text-[var(--text-tertiary)] mb-[var(--space-1)]",children:"Engine"}),(0,r.jsxs)("p",{className:"text-[length:var(--text-body)] text-[var(--text-primary)] m-0",children:[a.engine||"claude"," ",(0,r.jsxs)("span",{className:"text-[var(--text-tertiary)]",children:["/ ",a.model||"default"]})]})]})]}),b&&(0,r.jsxs)("div",{className:"mt-[var(--space-4)] pt-[var(--space-4)] border-t border-[var(--separator)]",children:[(0,r.jsx)("p",{className:"text-[length:var(--text-caption2)] font-[var(--weight-semibold)] uppercase tracking-[var(--tracking-wide)] text-[var(--text-tertiary)] mb-[var(--space-2)]",children:"Persona"}),(0,r.jsx)("p",{className:"text-[length:var(--text-body)] text-[var(--text-secondary)] leading-[var(--leading-relaxed)] whitespace-pre-wrap m-0",children:y}),b.length>200&&(0,r.jsx)("button",{onClick:()=>g(!m),className:"text-[length:var(--text-caption1)] text-[var(--accent)] bg-none border-none cursor-pointer p-0 mt-[var(--space-1)]",children:m?"Show less":"Show more"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] tracking-[var(--tracking-wide)] uppercase text-[var(--text-tertiary)] mb-[var(--space-3)]",children:"Recent Sessions"}),0===l.length?(0,r.jsx)("p",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)] text-center py-[var(--space-6)] px-0",children:"No sessions found for this employee."}):(0,r.jsx)("div",{className:"rounded-[var(--radius-lg,16px)] border border-[var(--separator)] bg-[var(--material-regular)] overflow-hidden",children:l.map((e,t)=>(0,r.jsxs)("div",{className:"px-[var(--space-5)] py-[var(--space-3)] flex items-center justify-between".concat(t>0?" border-t border-[var(--separator)]":""),children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[length:var(--text-body)] font-[family-name:var(--font-mono)] text-[var(--text-primary)] m-0",children:e.id.slice(0,8)}),(0,r.jsxs)("p",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)] mt-[2px]",children:[e.source||"unknown"," ",e.createdAt?new Date(e.createdAt).toLocaleDateString():""]})]}),(0,r.jsx)("span",{className:"text-[length:var(--text-caption2)] font-[var(--weight-semibold)] py-[2px] px-[8px] rounded-[10px]",style:"running"===e.status?{background:"color-mix(in srgb, var(--system-green) 15%, transparent)",color:"var(--system-green)"}:"error"===e.status?{background:"color-mix(in srgb, var(--system-red) 15%, transparent)",color:"var(--system-red)"}:{background:"var(--fill-tertiary)",color:"var(--text-tertiary)"},children:e.status||"idle"})]},e.id))})]})]})}var x=a(3637);let u={executive:"\uD83C\uDFAF",manager:"\uD83D\uDCCB",senior:"⭐",employee:"\uD83D\uDC64"};function p(e){let{employee:t,selected:a,onSelect:n}=e,s=u[t.rank]||u.employee;return(0,r.jsxs)("button",{onClick:n,className:"flex items-center gap-[var(--space-3)] px-[var(--space-4)] py-[var(--space-3)] rounded-[var(--radius-md,12px)] bg-[var(--material-regular)] cursor-pointer w-full text-left transition-all duration-150 ease-in-out ".concat(a?"border-[1.5px] border-[var(--accent)]":"border border-[var(--separator)]"),style:{boxShadow:a?"0 0 0 1px var(--accent), var(--shadow-subtle)":"var(--shadow-subtle)"},children:[(0,r.jsx)("span",{className:"text-2xl leading-none shrink-0",children:s}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("div",{className:"text-[length:var(--text-body)] font-[var(--weight-semibold)] text-[var(--text-primary)] whitespace-nowrap overflow-hidden text-ellipsis leading-[var(--leading-tight)]",children:t.displayName||t.name}),(0,r.jsx)("div",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)] whitespace-nowrap overflow-hidden text-ellipsis mt-px",children:t.department})]}),(0,r.jsxs)("div",{className:"flex flex-col items-end gap-1 shrink-0",children:[(0,r.jsx)("span",{className:"text-[length:var(--text-caption2)] font-[var(--weight-semibold)] text-[var(--accent)] bg-[var(--accent-fill)] px-[7px] py-px rounded-[10px]",children:t.engine}),(0,r.jsx)("span",{className:"text-[length:var(--text-caption2)] font-[var(--weight-medium)] text-[var(--text-quaternary)] bg-[var(--fill-quaternary)] px-[7px] py-px rounded-[10px]",children:t.model})]})]})}function v(e){let{label:t,count:a,children:n}=e;return(0,r.jsx)(x.Zp,{className:"p-0 shadow-none bg-[var(--bg-secondary)] rounded-[var(--radius-lg,16px)] border border-[var(--separator)]",children:(0,r.jsxs)(x.Wu,{className:"p-4 flex flex-col gap-[var(--space-2)]",children:[(0,r.jsxs)("div",{className:"flex items-center gap-[var(--space-2)] mb-[var(--space-1)]",children:[(0,r.jsx)("span",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] tracking-[var(--tracking-wide)] uppercase text-[var(--text-tertiary)]",children:t}),(0,r.jsxs)("span",{className:"text-[length:var(--text-caption2)] text-[var(--text-quaternary)] ml-auto",children:[a," employee",1!==a?"s":""]})]}),n]})})}function m(e){let{employees:t,selectedName:a,onSelect:n}=e,s=new Map,l=[];for(let e of t)if(e.department){let t=s.get(e.department)||[];t.push(e),s.set(e.department,t)}else l.push(e);let i=t.find(e=>"executive"===e.rank);return(0,r.jsxs)("div",{className:"overflow-y-auto p-[var(--space-6)] h-full",children:[i&&(0,r.jsxs)("button",{onClick:()=>n(i),className:"flex items-center gap-[var(--space-5)] w-full px-[var(--space-6)] py-[var(--space-5)] rounded-[var(--radius-xl,20px)] bg-[var(--material-regular)] cursor-pointer text-left mb-[var(--space-6)] transition-all duration-150 ease-in-out ".concat(a===i.name?"border-[1.5px] border-[var(--accent)]":"border border-[var(--separator)]"),style:{boxShadow:a===i.name?"0 0 0 1px var(--accent), var(--shadow-card)":"var(--shadow-card)"},children:[(0,r.jsx)("span",{className:"text-[40px] leading-none",children:u.executive}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("div",{className:"text-[length:var(--text-title2)] font-[var(--weight-bold)] text-[var(--text-primary)] tracking-[var(--tracking-tight)] leading-[var(--leading-tight)]",children:i.displayName||i.name}),(0,r.jsx)("div",{className:"text-[length:var(--text-subheadline)] text-[var(--text-secondary)] mt-0.5",children:i.department})]}),(0,r.jsxs)("div",{className:"flex gap-[var(--space-4)] shrink-0",children:[(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"text-[length:var(--text-title3)] font-[var(--weight-bold)] text-[var(--text-primary)] leading-none",children:t.length}),(0,r.jsx)("div",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)] mt-0.5",children:"employees"})]}),(0,r.jsx)("div",{className:"w-px self-stretch bg-[var(--separator)]"}),(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"text-[length:var(--text-title3)] font-[var(--weight-bold)] text-[var(--text-primary)] leading-none",children:s.size}),(0,r.jsx)("div",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)] mt-0.5",children:"depts"})]})]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(300px,1fr))] gap-[var(--space-5)] items-start",children:[Array.from(s.entries()).map(e=>{let[t,s]=e,l=s.filter(e=>e.name!==(null==i?void 0:i.name));return 0===l.length?null:(0,r.jsx)(v,{label:t,count:l.length,children:l.map(e=>(0,r.jsx)(p,{employee:e,selected:a===e.name,onSelect:()=>n(e)},e.name))},t)}),l.length>0&&(0,r.jsx)(v,{label:"Unassigned",count:l.filter(e=>e.name!==(null==i?void 0:i.name)).length,children:l.filter(e=>e.name!==(null==i?void 0:i.name)).map(e=>(0,r.jsx)(p,{employee:e,selected:a===e.name,onSelect:()=>n(e)},e.name))})]})]})}var g=a(6063);let f={executive:"\uD83C\uDFAF",manager:"\uD83D\uDCCB",senior:"⭐",employee:"\uD83D\uDC64"};function h(e){let{rank:t}=e,a={executive:{bg:"color-mix(in srgb, var(--system-purple) 15%, transparent)",text:"var(--system-purple)"},manager:{bg:"color-mix(in srgb, var(--system-blue) 15%, transparent)",text:"var(--system-blue)"},senior:{bg:"color-mix(in srgb, var(--system-green) 15%, transparent)",text:"var(--system-green)"},employee:{bg:"var(--fill-tertiary)",text:"var(--text-tertiary)"}},n=a[t]||a.employee;return(0,r.jsx)("span",{className:"rounded-[10px] px-2 py-0.5 text-[length:var(--text-caption2)] font-[var(--weight-semibold)] uppercase tracking-[0.02em]",style:{color:n.text,background:n.bg},children:t})}function b(e){let{employees:t,selectedName:a,onSelect:n}=e,s={executive:0,manager:1,senior:2,employee:3},l=[...t].sort((e,t)=>{var a,r;return(null!=(a=s[e.rank])?a:3)-(null!=(r=s[t.rank])?r:3)});return(0,r.jsxs)("div",{className:"h-full overflow-y-auto p-[var(--space-6)]",children:[(0,r.jsx)("div",{className:"mb-[var(--space-5)] flex gap-[var(--space-3)]",children:["executive","manager","senior","employee"].map(e=>{let a=t.filter(t=>t.rank===e).length;return(0,r.jsxs)("div",{className:"flex flex-1 items-center gap-[var(--space-3)] rounded-[var(--radius-md,12px)] border border-[var(--separator)] bg-[var(--material-regular)] px-[var(--space-4)] py-[var(--space-3)]",children:[(0,r.jsx)("span",{className:"text-[20px]",children:f[e]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-[length:var(--text-title3)] font-[var(--weight-bold)] leading-none text-[var(--text-primary)]",children:a}),(0,r.jsxs)("div",{className:"mt-0.5 text-[length:var(--text-caption2)] capitalize text-[var(--text-tertiary)]",children:[e,"s"]})]})]},e)})}),0===l.length?(0,r.jsx)("div",{className:"px-[var(--space-4)] py-[var(--space-16)] text-center text-[var(--text-tertiary)]",children:(0,r.jsx)("div",{className:"text-[length:var(--text-body)] font-[var(--weight-medium)]",children:"No employees found"})}):(0,r.jsx)("div",{className:"overflow-hidden rounded-[var(--radius-lg,16px)] border border-[var(--separator)] bg-[var(--bg-secondary)]",children:l.map((e,t)=>{let s=a===e.name,l=f[e.rank]||f.employee;return(0,r.jsxs)("button",{onClick:()=>n(e),className:(0,g.cn)("flex w-full items-center gap-[var(--space-3)] px-[var(--space-4)] py-[var(--space-3)] text-left transition-colors",s?"bg-[var(--fill-secondary)]":"bg-transparent hover:bg-accent"),style:t>0?{borderTop:"1px solid var(--separator)"}:void 0,children:[(0,r.jsx)("span",{className:"shrink-0 text-[20px] leading-none",children:l}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-[var(--space-2)]",children:[(0,r.jsx)("span",{className:"text-[length:var(--text-body)] font-[var(--weight-semibold)] text-[var(--text-primary)]",children:e.displayName||e.name}),(0,r.jsx)("span",{className:"font-[family-name:var(--font-mono)] text-[length:var(--text-caption1)] text-[var(--text-quaternary)]",children:e.name})]}),(0,r.jsx)("div",{className:"mt-0.5 flex items-center gap-[var(--space-2)]",children:(0,r.jsx)("span",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)]",children:e.department||"No department"})})]}),(0,r.jsx)(h,{rank:e.rank})]},e.name)})})]})}var y=a(7192),j=a(9664),N=a(4722),w=a(8565);let k=l()(()=>Promise.all([a.e(763),a.e(743),a.e(943)]).then(a.bind(a,7943)).then(e=>({default:e.OrgMap})),{loadableGenerated:{webpack:()=>[7943]},ssr:!1,loading:()=>(0,r.jsx)("div",{className:"flex flex-col items-center justify-center h-full gap-[var(--space-3)] text-[var(--text-tertiary)] text-[length:var(--text-caption1)]",children:"Loading map..."})});function C(){var e,t,a;(0,w.i)([{label:"Organization"}]);let[s,l]=(0,n.useState)([]),[o,c]=(0,n.useState)(!0),[x,u]=(0,n.useState)(null),[p,v]=(0,n.useState)(null),[g,f]=(0,n.useState)("map"),h=(0,n.useRef)(null),{settings:C}=(0,N.t0)(),D=(0,n.useCallback)(()=>{c(!0),u(null),i.F.getOrg().then(async e=>{var t,a;let r=await Promise.all(e.employees.map(async e=>{try{return await i.F.getEmployee(e)}catch(t){return{name:e,displayName:e,department:"",rank:"employee",engine:"unknown",model:"unknown",persona:""}}}));l([{name:(null!=(t=C.portalName)?t:"Jinn").toLowerCase(),displayName:null!=(a=C.portalName)?a:"Jinn",department:"",rank:"executive",engine:"claude",model:"opus",persona:"COO and AI gateway daemon"},...r])}).catch(e=>u(e.message)).finally(()=>c(!1))},[C.portalName]);(0,n.useEffect)(()=>{D()},[D]),(0,n.useEffect)(()=>{p&&h.current&&h.current.focus()},[p]),(0,n.useEffect)(()=>{function e(e){"Escape"===e.key&&p&&v(null)}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[p]);let S=(0,n.useCallback)(e=>{v(e)},[]);return x?(0,r.jsx)(y.M,{children:(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center h-full gap-[var(--space-4)] text-[var(--text-tertiary)]",children:[(0,r.jsxs)("div",{className:"rounded-[var(--radius-md,12px)] px-[var(--space-4)] py-[var(--space-3)] text-[length:var(--text-body)] text-[var(--system-red)]",style:{background:"color-mix(in srgb, var(--system-red) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--system-red) 30%, transparent)"},children:["Failed to load organization: ",x]}),(0,r.jsx)("button",{onClick:D,className:"px-[var(--space-4)] py-[var(--space-2)] rounded-[var(--radius-md,12px)] bg-[var(--accent)] text-[var(--accent-contrast)] border-none cursor-pointer text-[length:var(--text-body)] font-[var(--weight-semibold)]",children:"Retry"})]})}):(0,r.jsx)(y.M,{children:(0,r.jsxs)("div",{className:"flex h-full relative bg-[var(--bg)]",children:[(0,r.jsx)("div",{className:"flex-1 h-full relative",children:(0,r.jsxs)(j.tU,{value:g,onValueChange:f,className:"h-full flex flex-col",children:[(0,r.jsx)("div",{className:"absolute top-[var(--space-4)] left-[var(--space-4)] z-10",children:(0,r.jsxs)(j.j7,{children:[(0,r.jsx)(j.Xi,{value:"map",children:"Map"}),(0,r.jsx)(j.Xi,{value:"grid",children:"Grid"}),(0,r.jsx)(j.Xi,{value:"list",children:"List"})]})}),(0,r.jsx)(j.av,{value:"map",className:"flex-1",children:o?(0,r.jsx)("div",{className:"flex items-center justify-center h-full text-[var(--text-tertiary)] text-[length:var(--text-caption1)]",children:"Loading..."}):(0,r.jsx)(k,{employees:s,selectedName:null!=(e=null==p?void 0:p.name)?e:null,onNodeClick:S})}),(0,r.jsx)(j.av,{value:"grid",className:"flex-1 overflow-hidden",children:o?(0,r.jsx)("div",{className:"flex items-center justify-center h-full text-[var(--text-tertiary)] text-[length:var(--text-caption1)]",children:"Loading..."}):(0,r.jsx)(m,{employees:s,selectedName:null!=(t=null==p?void 0:p.name)?t:null,onSelect:S})}),(0,r.jsx)(j.av,{value:"list",className:"flex-1 overflow-hidden",children:o?(0,r.jsx)("div",{className:"flex items-center justify-center h-full text-[var(--text-tertiary)] text-[length:var(--text-caption1)]",children:"Loading..."}):(0,r.jsx)(b,{employees:s,selectedName:null!=(a=null==p?void 0:p.name)?a:null,onSelect:S})})]})}),p&&(0,r.jsx)("div",{className:"fixed inset-0 z-30 lg:hidden bg-black/50",onClick:()=>v(null)}),p&&(0,r.jsx)("div",{className:"absolute top-0 right-0 bottom-0 z-30",children:(0,r.jsxs)("div",{className:"w-[380px] max-w-[100vw] h-full overflow-y-auto bg-[var(--bg)] flex flex-col shadow-[var(--shadow-overlay)]",children:[(0,r.jsx)("div",{className:"sticky top-0 z-10 flex items-center justify-end px-[var(--space-4)] py-[var(--space-3)] bg-[var(--bg)]",children:(0,r.jsx)("button",{ref:h,onClick:()=>v(null),"aria-label":"Close detail panel",className:"w-[30px] h-[30px] rounded-full flex items-center justify-center bg-[var(--fill-tertiary)] text-[var(--text-secondary)] border-none cursor-pointer text-sm",children:"✕"})}),(0,r.jsx)("div",{className:"px-[var(--space-4)] pb-[var(--space-6)]",children:(0,r.jsx)(d,{name:p.name})})]})})]})})}},6005:(e,t,a)=>{Promise.resolve().then(a.bind(a,4580))},7299:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var a in t)Object.defineProperty(e,a,{enumerable:!0,get:t[a]})}(t,{bindSnapshot:function(){return l},createAsyncLocalStorage:function(){return s},createSnapshot:function(){return i}});let a=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class r{disable(){throw a}getStore(){}run(){throw a}exit(){throw a}enterWith(){throw a}static bind(e){return e}}let n="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function s(){return n?new n:new r}function l(e){return n?n.bind(e):r.bind(e)}function i(){return n?n.snapshot():function(e,...t){return e(...t)}}},8587:(e,t,a)=>{"use strict";function r(e){let{moduleIds:t}=e;return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return r}}),a(4130),a(1383),a(1260),a(9833)},9398:(e,t,a)=>{"use strict";function r(e){let{reason:t,children:a}=e;return a}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return r}}),a(3074)},9664:(e,t,a)=>{"use strict";a.d(t,{tU:()=>P,av:()=>L,j7:()=>F,Xi:()=>z});var r=a(4130),n=a(7946),s=a(4322),l=a(3397),i=a(5773),o=a(9458),c=a(4127),d=a(5822),x=a(7058),u=a(4068),p=a(5380),v="Tabs",[m,g]=(0,i.A)(v,[o.RG]),f=(0,o.RG)(),[h,b]=m(v),y=n.forwardRef((e,t)=>{let{__scopeTabs:a,value:n,onValueChange:s,defaultValue:l,orientation:i="horizontal",dir:o,activationMode:c="automatic",...m}=e,g=(0,x.jH)(o),[f,b]=(0,u.i)({prop:n,onChange:s,defaultProp:null!=l?l:"",caller:v});return(0,r.jsx)(h,{scope:a,baseId:(0,p.B)(),value:f,onValueChange:b,orientation:i,dir:g,activationMode:c,children:(0,r.jsx)(d.sG.div,{dir:g,"data-orientation":i,...m,ref:t})})});y.displayName=v;var j="TabsList",N=n.forwardRef((e,t)=>{let{__scopeTabs:a,loop:n=!0,...s}=e,l=b(j,a),i=f(a);return(0,r.jsx)(o.bL,{asChild:!0,...i,orientation:l.orientation,dir:l.dir,loop:n,children:(0,r.jsx)(d.sG.div,{role:"tablist","aria-orientation":l.orientation,...s,ref:t})})});N.displayName=j;var w="TabsTrigger",k=n.forwardRef((e,t)=>{let{__scopeTabs:a,value:n,disabled:s=!1,...i}=e,c=b(w,a),x=f(a),u=S(c.baseId,n),p=_(c.baseId,n),v=n===c.value;return(0,r.jsx)(o.q7,{asChild:!0,...x,focusable:!s,active:v,children:(0,r.jsx)(d.sG.button,{type:"button",role:"tab","aria-selected":v,"aria-controls":p,"data-state":v?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:u,...i,ref:t,onMouseDown:(0,l.mK)(e.onMouseDown,e=>{s||0!==e.button||!1!==e.ctrlKey?e.preventDefault():c.onValueChange(n)}),onKeyDown:(0,l.mK)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&c.onValueChange(n)}),onFocus:(0,l.mK)(e.onFocus,()=>{let e="manual"!==c.activationMode;v||s||!e||c.onValueChange(n)})})})});k.displayName=w;var C="TabsContent",D=n.forwardRef((e,t)=>{let{__scopeTabs:a,value:s,forceMount:l,children:i,...o}=e,x=b(C,a),u=S(x.baseId,s),p=_(x.baseId,s),v=s===x.value,m=n.useRef(v);return n.useEffect(()=>{let e=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,r.jsx)(c.C,{present:l||v,children:a=>{let{present:n}=a;return(0,r.jsx)(d.sG.div,{"data-state":v?"active":"inactive","data-orientation":x.orientation,role:"tabpanel","aria-labelledby":u,hidden:!n,id:p,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:m.current?"0s":void 0},children:n&&i})}})});function S(e,t){return"".concat(e,"-trigger-").concat(t)}function _(e,t){return"".concat(e,"-content-").concat(t)}D.displayName=C;var O=a(6063);function P(e){let{className:t,orientation:a="horizontal",...n}=e;return(0,r.jsx)(y,{"data-slot":"tabs","data-orientation":a,orientation:a,className:(0,O.cn)("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",t),...n})}let E=(0,s.F)("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function F(e){let{className:t,variant:a="default",...n}=e;return(0,r.jsx)(N,{"data-slot":"tabs-list","data-variant":a,className:(0,O.cn)(E({variant:a}),t),...n})}function z(e){let{className:t,...a}=e;return(0,r.jsx)(k,{"data-slot":"tabs-trigger",className:(0,O.cn)("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",t),...a})}function L(e){let{className:t,...a}=e;return(0,r.jsx)(D,{"data-slot":"tabs-content",className:(0,O.cn)("flex-1 outline-none",t),...a})}}},e=>{e.O(0,[625,51,458,155,192,344,144,358],()=>e(e.s=6005)),_N_E=e.O()}]);
|
package/dist/web/_next/static/chunks/app/{page-57dcf41f8ef011a7.js → page-16b78d2823b60898.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{2503:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>w});var r=a(4130),s=a(7946),n=a(5233),i=a.n(n),c=a(6654),l=a(2845),d=a(4722),x=a(7192),o=a(8565),h=a(3637),p=a(1004),v=a(3250);let m=(0,v.A)("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]),y=(0,v.A)("square-kanban",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 7v7",key:"1x2jlm"}],["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M16 7v9",key:"1hp2iy"}]]),g=(0,v.A)("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);var u=a(7103),f=a(216),j=a(4481),b=a(8831);let k=(0,v.A)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]),N=(0,v.A)("calendar-clock",[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]);function w(){var e,t,a,n;(0,o.i)([{label:"Dashboard"}]);let{settings:v}=(0,d.t0)(),w=null!=(t=v.portalName)?t:"Jinn",[M,A]=(0,s.useState)(null),[z,S]=(0,s.useState)(null),[q,C]=(0,s.useState)(null),[W,Z]=(0,s.useState)([]),{events:O,connected:_}=(0,l.G)();(0,s.useEffect)(()=>{c.F.getOnboarding().then(e=>{e.needed&&(window.location.href="/chat?onboarding=1")}).catch(()=>{}),c.F.getStatus().then(e=>A(e)).catch(e=>C(e.message)),c.F.getCronJobs().then(e=>S(e.length)).catch(()=>{}),c.F.getActivity().then(e=>{Z(e.map(e=>({event:e.event,payload:e.payload})))}).catch(()=>{})},[]);let E=(null==M?void 0:M.engines)&&null!=(a=Object.keys(M.engines)[0])?a:"--",F=[...O.length>0?O:W].reverse().slice(0,20);return(0,r.jsx)(x.M,{children:(0,r.jsxs)("div",{className:"h-full overflow-y-auto p-[var(--space-6)]",children:[(0,r.jsxs)("div",{className:"mb-[var(--space-6)]",children:[(0,r.jsx)("h2",{className:"text-[length:var(--text-title2)] font-[var(--weight-bold)] text-[var(--text-primary)] mb-[var(--space-1)]",children:"Dashboard"}),(0,r.jsx)("p",{className:"text-[length:var(--text-body)] text-[var(--text-tertiary)]",children:"Gateway overview and live activity"})]}),q&&(0,r.jsxs)("div",{className:"mb-[var(--space-4)] rounded-[var(--radius-md,12px)] border px-[var(--space-4)] py-[var(--space-3)] text-[length:var(--text-body)] text-[var(--system-red)]",style:{background:"color-mix(in srgb, var(--system-red) 10%, transparent)",borderColor:"color-mix(in srgb, var(--system-red) 30%, transparent)"},children:["Failed to connect: ",q]}),(0,r.jsxs)("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(200px,1fr))] gap-[var(--space-4)] mb-[var(--space-6)]",children:[(0,r.jsx)(h.Zp,{className:"py-4",children:(0,r.jsxs)(h.Wu,{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-10 h-10 rounded-[var(--radius-md,12px)] flex items-center justify-center text-[var(--system-blue)]",style:{background:"color-mix(in srgb, var(--system-blue) 12%, transparent)"},children:(0,r.jsx)(j.A,{size:20})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)] font-[var(--weight-medium)] uppercase tracking-[0.05em]",children:"Uptime"}),(0,r.jsx)("p",{className:"text-[length:var(--text-title3)] font-[var(--weight-semibold)] text-[var(--text-primary)]",children:(null==M?void 0:M.uptime)!=null?function(e){let t=Math.floor(e/86400),a=Math.floor(e%86400/3600),r=Math.floor(e%3600/60);return t>0?"".concat(t,"d ").concat(a,"h ").concat(r,"m"):a>0?"".concat(a,"h ").concat(r,"m"):"".concat(r,"m")}(M.uptime):"--"})]})]})}),(0,r.jsx)(h.Zp,{className:"py-4",children:(0,r.jsxs)(h.Wu,{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-10 h-10 rounded-[var(--radius-md,12px)] flex items-center justify-center text-[var(--system-green)]",style:{background:"color-mix(in srgb, var(--system-green) 12%, transparent)"},children:(0,r.jsx)(b.A,{size:20})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)] font-[var(--weight-medium)] uppercase tracking-[0.05em]",children:"Active Sessions"}),(0,r.jsx)("p",{className:"text-[length:var(--text-title3)] font-[var(--weight-semibold)] text-[var(--text-primary)]",children:null!=(n=null==M||null==(e=M.sessions)?void 0:e.active)?n:"--"})]})]})}),(0,r.jsx)(h.Zp,{className:"py-4",children:(0,r.jsxs)(h.Wu,{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-10 h-10 rounded-[var(--radius-md,12px)] flex items-center justify-center text-[var(--accent)]",style:{background:"color-mix(in srgb, var(--accent) 12%, transparent)"},children:(0,r.jsx)(k,{size:20})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)] font-[var(--weight-medium)] uppercase tracking-[0.05em]",children:"Engines"}),(0,r.jsx)("p",{className:"text-[length:var(--text-title3)] font-[var(--weight-semibold)] text-[var(--text-primary)] capitalize",children:E})]})]})}),(0,r.jsx)(h.Zp,{className:"py-4",children:(0,r.jsxs)(h.Wu,{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-10 h-10 rounded-[var(--radius-md,12px)] flex items-center justify-center text-[var(--system-orange)]",style:{background:"color-mix(in srgb, var(--system-orange) 12%, transparent)"},children:(0,r.jsx)(N,{size:20})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)] font-[var(--weight-medium)] uppercase tracking-[0.05em]",children:"Cron Jobs"}),(0,r.jsx)("p",{className:"text-[length:var(--text-title3)] font-[var(--weight-semibold)] text-[var(--text-primary)]",children:null!=z?z:"--"})]})]})})]}),(0,r.jsxs)("div",{className:"mb-[var(--space-6)]",children:[(0,r.jsx)("h3",{className:"text-[length:var(--text-body)] font-[var(--weight-semibold)] text-[var(--text-primary)] mb-[var(--space-3)]",children:"Quick Links"}),(0,r.jsx)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-[var(--space-3)]",children:[{href:"/chat",icon:p.A,name:"Chat",description:"Talk to ".concat(w," directly")},{href:"/org",icon:m,name:"Organization",description:"View employees and departments"},{href:"/kanban",icon:y,name:"Kanban",description:"Manage tasks and boards"},{href:"/cron",icon:g,name:"Cron",description:"Scheduled jobs and automations"},{href:"/costs",icon:u.A,name:"Costs",description:"API usage and spending"},{href:"/logs",icon:f.A,name:"Activity",description:"Logs and event stream"}].map(e=>{let t=e.icon;return(0,r.jsx)(i(),{href:e.href,className:"no-underline",children:(0,r.jsx)(h.Zp,{className:"py-4 h-full cursor-pointer transition-colors hover:border-[var(--accent)]",children:(0,r.jsxs)(h.Wu,{className:"flex flex-col gap-2",children:[(0,r.jsx)("div",{className:"w-9 h-9 rounded-[var(--radius-sm,8px)] bg-[var(--fill-secondary)] flex items-center justify-center text-[var(--accent)]",children:(0,r.jsx)(t,{size:18})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[length:var(--text-body)] font-[var(--weight-semibold)] text-[var(--text-primary)]",children:e.name}),(0,r.jsx)("p",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)] mt-0.5",children:e.description})]})]})})},e.href)})})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-[var(--space-2)] mb-[var(--space-3)]",children:[(0,r.jsx)("h3",{className:"text-[length:var(--text-body)] font-[var(--weight-semibold)] text-[var(--text-primary)]",children:"Recent Activity"}),(0,r.jsx)("span",{className:"w-2 h-2 rounded-full inline-block ".concat(_?"bg-[var(--system-green)]":"bg-[var(--text-quaternary)]")})]}),(0,r.jsx)(h.Zp,{className:"py-0 overflow-hidden",children:0===F.length?(0,r.jsx)("div",{className:"p-[var(--space-6)] text-center text-[length:var(--text-body)] text-[var(--text-tertiary)]",children:"Waiting for events..."}):(0,r.jsx)("div",{className:"max-h-80 overflow-y-auto",children:F.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-start gap-[var(--space-3)] px-[var(--space-4)] py-[var(--space-3)]",style:t<F.length-1?{borderBottom:"1px solid var(--separator)"}:void 0,children:[(0,r.jsx)("span",{className:"text-[length:var(--text-caption2)] font-[family-name:var(--font-mono)] text-[var(--accent)] rounded-[var(--radius-sm,8px)] whitespace-nowrap mt-px px-2 py-0.5",style:{background:"color-mix(in srgb, var(--accent) 10%, transparent)"},children:e.event}),(0,r.jsx)("span",{className:"text-[length:var(--text-caption2)] font-[family-name:var(--font-mono)] text-[var(--text-tertiary)] flex-1 overflow-hidden text-ellipsis whitespace-nowrap",children:JSON.stringify(e.payload)}),(0,r.jsx)("span",{className:"text-[length:var(--text-caption2)] text-[var(--text-quaternary)] whitespace-nowrap",children:new Date(Date.now()-(F.length-1-t)*1e3).toLocaleTimeString()})]},t))})})]})]})})}},3637:(e,t,a)=>{"use strict";a.d(t,{Wu:()=>i,Zp:()=>n});var r=a(4130);a(7946);var s=a(6063);function n(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card",className:(0,s.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...a})}function i(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-content",className:(0,s.cn)("px-6",t),...a})}},9537:(e,t,a)=>{Promise.resolve().then(a.bind(a,2503))}},e=>{e.O(0,[625,51,155,192,344,144,358],()=>e(e.s=9537)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[974],{2503:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>w});var r=a(4130),s=a(7946),n=a(7614),i=a.n(n),c=a(6654),l=a(2845),d=a(4722),x=a(7192),o=a(8565),h=a(3637),p=a(1004),v=a(3250);let m=(0,v.A)("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]),y=(0,v.A)("square-kanban",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M8 7v7",key:"1x2jlm"}],["path",{d:"M12 7v4",key:"xawao1"}],["path",{d:"M16 7v9",key:"1hp2iy"}]]),g=(0,v.A)("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);var u=a(7103),f=a(216),j=a(4481),b=a(8831);let k=(0,v.A)("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]),N=(0,v.A)("calendar-clock",[["path",{d:"M16 14v2.2l1.6 1",key:"fo4ql5"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]);function w(){var e,t,a,n;(0,o.i)([{label:"Dashboard"}]);let{settings:v}=(0,d.t0)(),w=null!=(t=v.portalName)?t:"Jinn",[M,A]=(0,s.useState)(null),[z,S]=(0,s.useState)(null),[q,C]=(0,s.useState)(null),[W,Z]=(0,s.useState)([]),{events:O,connected:_}=(0,l.G)();(0,s.useEffect)(()=>{c.F.getOnboarding().then(e=>{e.needed&&(window.location.href="/chat?onboarding=1")}).catch(()=>{}),c.F.getStatus().then(e=>A(e)).catch(e=>C(e.message)),c.F.getCronJobs().then(e=>S(e.length)).catch(()=>{}),c.F.getActivity().then(e=>{Z(e.map(e=>({event:e.event,payload:e.payload})))}).catch(()=>{})},[]);let E=(null==M?void 0:M.engines)&&null!=(a=Object.keys(M.engines)[0])?a:"--",F=[...O.length>0?O:W].reverse().slice(0,20);return(0,r.jsx)(x.M,{children:(0,r.jsxs)("div",{className:"h-full overflow-y-auto p-[var(--space-6)]",children:[(0,r.jsxs)("div",{className:"mb-[var(--space-6)]",children:[(0,r.jsx)("h2",{className:"text-[length:var(--text-title2)] font-[var(--weight-bold)] text-[var(--text-primary)] mb-[var(--space-1)]",children:"Dashboard"}),(0,r.jsx)("p",{className:"text-[length:var(--text-body)] text-[var(--text-tertiary)]",children:"Gateway overview and live activity"})]}),q&&(0,r.jsxs)("div",{className:"mb-[var(--space-4)] rounded-[var(--radius-md,12px)] border px-[var(--space-4)] py-[var(--space-3)] text-[length:var(--text-body)] text-[var(--system-red)]",style:{background:"color-mix(in srgb, var(--system-red) 10%, transparent)",borderColor:"color-mix(in srgb, var(--system-red) 30%, transparent)"},children:["Failed to connect: ",q]}),(0,r.jsxs)("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(200px,1fr))] gap-[var(--space-4)] mb-[var(--space-6)]",children:[(0,r.jsx)(h.Zp,{className:"py-4",children:(0,r.jsxs)(h.Wu,{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-10 h-10 rounded-[var(--radius-md,12px)] flex items-center justify-center text-[var(--system-blue)]",style:{background:"color-mix(in srgb, var(--system-blue) 12%, transparent)"},children:(0,r.jsx)(j.A,{size:20})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)] font-[var(--weight-medium)] uppercase tracking-[0.05em]",children:"Uptime"}),(0,r.jsx)("p",{className:"text-[length:var(--text-title3)] font-[var(--weight-semibold)] text-[var(--text-primary)]",children:(null==M?void 0:M.uptime)!=null?function(e){let t=Math.floor(e/86400),a=Math.floor(e%86400/3600),r=Math.floor(e%3600/60);return t>0?"".concat(t,"d ").concat(a,"h ").concat(r,"m"):a>0?"".concat(a,"h ").concat(r,"m"):"".concat(r,"m")}(M.uptime):"--"})]})]})}),(0,r.jsx)(h.Zp,{className:"py-4",children:(0,r.jsxs)(h.Wu,{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-10 h-10 rounded-[var(--radius-md,12px)] flex items-center justify-center text-[var(--system-green)]",style:{background:"color-mix(in srgb, var(--system-green) 12%, transparent)"},children:(0,r.jsx)(b.A,{size:20})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)] font-[var(--weight-medium)] uppercase tracking-[0.05em]",children:"Active Sessions"}),(0,r.jsx)("p",{className:"text-[length:var(--text-title3)] font-[var(--weight-semibold)] text-[var(--text-primary)]",children:null!=(n=null==M||null==(e=M.sessions)?void 0:e.active)?n:"--"})]})]})}),(0,r.jsx)(h.Zp,{className:"py-4",children:(0,r.jsxs)(h.Wu,{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-10 h-10 rounded-[var(--radius-md,12px)] flex items-center justify-center text-[var(--accent)]",style:{background:"color-mix(in srgb, var(--accent) 12%, transparent)"},children:(0,r.jsx)(k,{size:20})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)] font-[var(--weight-medium)] uppercase tracking-[0.05em]",children:"Engines"}),(0,r.jsx)("p",{className:"text-[length:var(--text-title3)] font-[var(--weight-semibold)] text-[var(--text-primary)] capitalize",children:E})]})]})}),(0,r.jsx)(h.Zp,{className:"py-4",children:(0,r.jsxs)(h.Wu,{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-10 h-10 rounded-[var(--radius-md,12px)] flex items-center justify-center text-[var(--system-orange)]",style:{background:"color-mix(in srgb, var(--system-orange) 12%, transparent)"},children:(0,r.jsx)(N,{size:20})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)] font-[var(--weight-medium)] uppercase tracking-[0.05em]",children:"Cron Jobs"}),(0,r.jsx)("p",{className:"text-[length:var(--text-title3)] font-[var(--weight-semibold)] text-[var(--text-primary)]",children:null!=z?z:"--"})]})]})})]}),(0,r.jsxs)("div",{className:"mb-[var(--space-6)]",children:[(0,r.jsx)("h3",{className:"text-[length:var(--text-body)] font-[var(--weight-semibold)] text-[var(--text-primary)] mb-[var(--space-3)]",children:"Quick Links"}),(0,r.jsx)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-[var(--space-3)]",children:[{href:"/chat",icon:p.A,name:"Chat",description:"Talk to ".concat(w," directly")},{href:"/org",icon:m,name:"Organization",description:"View employees and departments"},{href:"/kanban",icon:y,name:"Kanban",description:"Manage tasks and boards"},{href:"/cron",icon:g,name:"Cron",description:"Scheduled jobs and automations"},{href:"/costs",icon:u.A,name:"Costs",description:"API usage and spending"},{href:"/logs",icon:f.A,name:"Activity",description:"Logs and event stream"}].map(e=>{let t=e.icon;return(0,r.jsx)(i(),{href:e.href,className:"no-underline",children:(0,r.jsx)(h.Zp,{className:"py-4 h-full cursor-pointer transition-colors hover:border-[var(--accent)]",children:(0,r.jsxs)(h.Wu,{className:"flex flex-col gap-2",children:[(0,r.jsx)("div",{className:"w-9 h-9 rounded-[var(--radius-sm,8px)] bg-[var(--fill-secondary)] flex items-center justify-center text-[var(--accent)]",children:(0,r.jsx)(t,{size:18})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[length:var(--text-body)] font-[var(--weight-semibold)] text-[var(--text-primary)]",children:e.name}),(0,r.jsx)("p",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)] mt-0.5",children:e.description})]})]})})},e.href)})})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-[var(--space-2)] mb-[var(--space-3)]",children:[(0,r.jsx)("h3",{className:"text-[length:var(--text-body)] font-[var(--weight-semibold)] text-[var(--text-primary)]",children:"Recent Activity"}),(0,r.jsx)("span",{className:"w-2 h-2 rounded-full inline-block ".concat(_?"bg-[var(--system-green)]":"bg-[var(--text-quaternary)]")})]}),(0,r.jsx)(h.Zp,{className:"py-0 overflow-hidden",children:0===F.length?(0,r.jsx)("div",{className:"p-[var(--space-6)] text-center text-[length:var(--text-body)] text-[var(--text-tertiary)]",children:"Waiting for events..."}):(0,r.jsx)("div",{className:"max-h-80 overflow-y-auto",children:F.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-start gap-[var(--space-3)] px-[var(--space-4)] py-[var(--space-3)]",style:t<F.length-1?{borderBottom:"1px solid var(--separator)"}:void 0,children:[(0,r.jsx)("span",{className:"text-[length:var(--text-caption2)] font-[family-name:var(--font-mono)] text-[var(--accent)] rounded-[var(--radius-sm,8px)] whitespace-nowrap mt-px px-2 py-0.5",style:{background:"color-mix(in srgb, var(--accent) 10%, transparent)"},children:e.event}),(0,r.jsx)("span",{className:"text-[length:var(--text-caption2)] font-[family-name:var(--font-mono)] text-[var(--text-tertiary)] flex-1 overflow-hidden text-ellipsis whitespace-nowrap",children:JSON.stringify(e.payload)}),(0,r.jsx)("span",{className:"text-[length:var(--text-caption2)] text-[var(--text-quaternary)] whitespace-nowrap",children:new Date(Date.now()-(F.length-1-t)*1e3).toLocaleTimeString()})]},t))})})]})]})})}},3637:(e,t,a)=>{"use strict";a.d(t,{Wu:()=>i,Zp:()=>n});var r=a(4130);a(7946);var s=a(6063);function n(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card",className:(0,s.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...a})}function i(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-content",className:(0,s.cn)("px-6",t),...a})}},8196:(e,t,a)=>{Promise.resolve().then(a.bind(a,2503))}},e=>{e.O(0,[625,51,155,192,344,144,358],()=>e(e.s=8196)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[662],{1694:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>k});var l=t(4130),n=t(7946),r=t(4139),s=t(3250);let o=(0,s.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"}]]),i=(0,s.A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),c=(0,s.A)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var d=t(8574),u=t(7192),v=t(4722),p=t(8565),x=t(8838),h=t(280),g=t(6654);let m=[{label:"Red",value:"#EF4444"},{label:"Orange",value:"#F97316"},{label:"Amber",value:"#F59E0B"},{label:"Yellow",value:"#EAB308"},{label:"Lime",value:"#84CC16"},{label:"Green",value:"#22C55E"},{label:"Emerald",value:"#10B981"},{label:"Cyan",value:"#06B6D4"},{label:"Blue",value:"#3B82F6"},{label:"Indigo",value:"#6366F1"},{label:"Violet",value:"#8B5CF6"},{label:"Pink",value:"#EC4899"}];function b(e){let{title:a,children:t}=e;return(0,l.jsxs)("section",{className:"mb-[var(--space-6)]",children:[(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] tracking-[var(--tracking-wide)] uppercase text-[var(--text-tertiary)] px-[var(--space-2)] pb-[var(--space-2)]",children:a}),(0,l.jsx)("div",{className:"bg-[var(--material-regular)] rounded-[var(--radius-md)] border border-[var(--separator)] p-[var(--space-4)]",children:t})]})}function f(e){let{label:a,children:t}=e;return(0,l.jsxs)("div",{className:"flex items-center justify-between py-[var(--space-2)] gap-[var(--space-4)]",children:[(0,l.jsx)("label",{className:"text-[length:var(--text-subheadline)] text-[var(--text-secondary)] shrink-0",children:a}),(0,l.jsx)("div",{className:"w-[240px] shrink-0",children:t})]})}function j(e){let{value:a,onChange:t,type:n="text",placeholder:r}=e;return(0,l.jsx)("input",{type:n,value:a,onChange:e=>t(e.target.value),placeholder:r,className:"apple-input w-full bg-[var(--bg-secondary)] border border-[var(--separator)] rounded-[var(--radius-sm)] px-[10px] py-[6px] text-[length:var(--text-footnote)] text-[var(--text-primary)]"})}function y(e){let{value:a,onChange:t,options:n}=e;return(0,l.jsx)("select",{value:a,onChange:e=>t(e.target.value),className:"w-full bg-[var(--bg-secondary)] border border-[var(--separator)] rounded-[var(--radius-sm)] px-[10px] py-[6px] text-[length:var(--text-footnote)] text-[var(--text-primary)] cursor-pointer",children:n.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value))})}function w(e){let{checked:a,onChange:t}=e;return(0,l.jsx)("button",{role:"switch","aria-checked":a,onClick:()=>t(!a),className:"w-[44px] h-[24px] rounded-[12px] border-none cursor-pointer relative shrink-0 transition-[background] duration-200 ease-[var(--ease-smooth)]",style:{background:a?"var(--system-green)":"var(--fill-primary)"},children:(0,l.jsx)("span",{className:"absolute top-[2px] w-[20px] h-[20px] rounded-full bg-white shadow-[0_1px_3px_rgba(0,0,0,0.2)] transition-[left] duration-200 ease-[var(--ease-spring)]",style:{left:a?22:2}})})}let N={en:"English",bg:"Bulgarian",de:"German",fr:"French",es:"Spanish",it:"Italian",pt:"Portuguese",ru:"Russian",zh:"Chinese",ja:"Japanese",ko:"Korean",ar:"Arabic",hi:"Hindi",tr:"Turkish",pl:"Polish",nl:"Dutch",sv:"Swedish",cs:"Czech",el:"Greek",ro:"Romanian",uk:"Ukrainian",he:"Hebrew",da:"Danish",fi:"Finnish",hu:"Hungarian",no:"Norwegian",sk:"Slovak",hr:"Croatian",ca:"Catalan",th:"Thai",vi:"Vietnamese",id:"Indonesian",ms:"Malay",tl:"Filipino",sr:"Serbian",lt:"Lithuanian",lv:"Latvian",sl:"Slovenian",et:"Estonian"};function C(){let[e,a]=(0,n.useState)(null),[t,r]=(0,n.useState)(!1),[s,o]=(0,n.useState)("");if((0,n.useEffect)(()=>{g.F.sttStatus().then(a).catch(()=>{})},[]),(0,n.useEffect)(()=>{if(!(null==e?void 0:e.downloading))return;let t=setInterval(()=>{g.F.sttStatus().then(a).catch(()=>{})},1500);return()=>clearInterval(t)},[null==e?void 0:e.downloading]),!e)return null;let i=Object.entries(N).filter(a=>{let[t]=a;return!e.languages.includes(t)}).sort((e,a)=>e[1].localeCompare(a[1]));return(0,l.jsxs)(b,{title:"Voice Input",children:[(0,l.jsxs)("div",{className:"flex items-center gap-[var(--space-3)] mb-[var(--space-4)]",children:[(0,l.jsx)("div",{className:"w-[8px] h-[8px] rounded-full shrink-0",style:{background:e.available?"var(--system-green)":"var(--system-red)"}}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("div",{className:"text-[length:var(--text-subheadline)] font-[var(--weight-medium)] text-[var(--text-primary)]",children:e.available?"Whisper ".concat((e.model||"small").charAt(0).toUpperCase()+(e.model||"small").slice(1)):"No model installed"}),(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)]",children:e.available?"Offline speech recognition ready":"Download a model to enable voice input"})]})]}),!e.available&&!e.downloading&&(0,l.jsx)("button",{onClick:function(){g.F.sttDownload().then(()=>a(e=>e?{...e,downloading:!0,progress:0}:e)).catch(()=>{})},className:"w-full p-[var(--space-3)] rounded-[var(--radius-md)] bg-[var(--accent)] text-[var(--accent-contrast)] border-none cursor-pointer text-[length:var(--text-footnote)] font-[var(--weight-semibold)] mb-[var(--space-4)]",children:"Download Whisper Small (~500MB)"}),e.downloading&&(0,l.jsxs)("div",{className:"mb-[var(--space-4)]",children:[(0,l.jsxs)("div",{className:"flex justify-between mb-[var(--space-2)] text-[length:var(--text-caption1)] text-[var(--text-tertiary)]",children:[(0,l.jsx)("span",{children:"Downloading model…"}),(0,l.jsxs)("span",{children:[e.progress,"%"]})]}),(0,l.jsx)("div",{className:"h-[6px] rounded-[3px] bg-[var(--fill-tertiary)] overflow-hidden",children:(0,l.jsx)("div",{className:"h-full rounded-[3px] bg-[var(--accent)] transition-[width] duration-300 ease-out",style:{width:"".concat(e.progress,"%")}})})]}),e.available&&(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{className:"border-t border-[var(--separator)] mt-[var(--space-2)] pt-[var(--space-3)]",children:[(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mb-[var(--space-2)]",children:"Transcription Languages"}),(0,l.jsx)("div",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)] mb-[var(--space-3)]",children:"First language is the default. Add multiple to show a language picker in chat."}),(0,l.jsx)("div",{className:"flex flex-wrap gap-[var(--space-2)] mb-[var(--space-3)]",children:e.languages.map(n=>(0,l.jsxs)("div",{className:"inline-flex items-center gap-[var(--space-1)] px-[8px] py-[3px] rounded-[var(--radius-sm)] bg-[var(--fill-secondary)] text-[length:var(--text-caption1)] font-[var(--weight-medium)] text-[var(--text-primary)]",children:[(0,l.jsx)("span",{className:"font-[family-name:var(--font-mono)] uppercase text-[length:var(--text-caption2)] font-[var(--weight-semibold)] text-[var(--accent)] mr-[2px]",children:n}),N[n]||n,e.languages.length>1&&(0,l.jsx)("button",{onClick:()=>(function(t){if(!e||e.languages.length<=1)return;let l=e.languages.filter(e=>e!==t);r(!0),g.F.sttUpdateConfig(l).then(()=>a(e=>e?{...e,languages:l}:e)).catch(()=>{}).finally(()=>r(!1))})(n),disabled:t,"aria-label":"Remove ".concat(N[n]||n),className:"bg-none border-none cursor-pointer p-0 ml-[2px] text-[var(--text-quaternary)] text-[14px] leading-none flex items-center",children:"\xd7"})]},n))}),(0,l.jsxs)("div",{className:"flex gap-[var(--space-2)]",children:[(0,l.jsxs)("select",{value:s,onChange:e=>o(e.target.value),className:"flex-1 bg-[var(--bg-secondary)] border border-[var(--separator)] rounded-[var(--radius-sm)] px-[10px] py-[6px] text-[length:var(--text-footnote)] cursor-pointer",style:{color:s?"var(--text-primary)":"var(--text-tertiary)"},children:[(0,l.jsx)("option",{value:"",children:"Add a language…"}),i.map(e=>{let[a,t]=e;return(0,l.jsxs)("option",{value:a,children:[a.toUpperCase()," — ",t]},a)})]}),(0,l.jsx)("button",{onClick:function(){if(!s||!e||e.languages.includes(s))return;let t=[...e.languages,s];r(!0),o(""),g.F.sttUpdateConfig(t).then(()=>a(e=>e?{...e,languages:t}:e)).catch(()=>{}).finally(()=>r(!1))},disabled:!s||t,className:"px-[14px] py-[6px] rounded-[var(--radius-sm)] border-none text-[length:var(--text-footnote)] font-[var(--weight-semibold)] shrink-0",style:{background:s?"var(--accent)":"var(--fill-tertiary)",color:s?"var(--accent-contrast)":"var(--text-quaternary)",cursor:s?"pointer":"default"},children:"Add"})]})]})})]})}function k(){var e,a,t,s,N,k,S,F,A,D,E,B,I,L,M,O,T,P,W,G,R,z,H,U,q,_,V,J,K,Q,Y,$,X,Z,ee,ea,et,el,en,er,es,eo,ei,ec,ed,eu,ev,ep,ex,eh,eg,em,eb,ef,ej,ey,ew,eN,eC,ek,eS,eF,eA,eD,eE,eB,eI,eL,eM,eO,eT,eP,eW,eG,eR,ez,eH,eU,eq,e_,eV,eJ,eK,eQ,eY,e$,eX,eZ,e0,e1,e2,e4,e3,e6,e5,e8;(0,p.i)([{label:"Settings"}]);let{settings:e9,setAccentColor:e7,setPortalName:ae,setPortalSubtitle:aa,setOperatorName:at,setPortalEmoji:al,setLanguage:an,resetAll:ar}=(0,v.t0)(),{theme:as,setTheme:ao}=(0,x.D)(),[ai,ac]=(0,n.useState)(null!=(eD=e9.portalName)?eD:""),[ad,au]=(0,n.useState)(null!=(eE=e9.portalSubtitle)?eE:""),[av,ap]=(0,n.useState)(null!=(eB=e9.operatorName)?eB:""),[ax,ah]=(0,n.useState)(null!=(eI=e9.portalEmoji)?eI:""),[ag,am]=(0,n.useState)(null!=(eL=e9.language)?eL:"English"),[ab,af]=(0,n.useState)(null!=(eM=e9.accentColor)?eM:""),[aj,ay]=(0,n.useState)({}),[aw,aN]=(0,n.useState)(!0),[aC,ak]=(0,n.useState)(null),[aS,aF]=(0,n.useState)(!1),[aA,aD]=(0,n.useState)(null),[aE,aB]=(0,n.useState)(null),[aI,aL]=(0,n.useState)("unknown");function aM(){aN(!0),g.F.getConfig().then(e=>{ay(e),ak(null)}).catch(e=>ak(e.message)).finally(()=>aN(!1))}function aO(e,a){ay(t=>{let l=structuredClone(t),n=l;for(let a=0;a<e.length-1;a++)n[e[a]]&&"object"==typeof n[e[a]]||(n[e[a]]={}),n=n[e[a]];return n[e[e.length-1]]=a,l})}return(0,n.useEffect)(()=>{var e,a,t,l,n,r;ac(null!=(e=e9.portalName)?e:""),au(null!=(a=e9.portalSubtitle)?a:""),ap(null!=(t=e9.operatorName)?t:""),ah(null!=(l=e9.portalEmoji)?l:""),am(null!=(n=e9.language)?n:"English"),af(null!=(r=e9.accentColor)?r:"")},[e9.portalName,e9.portalSubtitle,e9.operatorName,e9.portalEmoji,e9.language,e9.accentColor]),(0,n.useEffect)(()=>{aM()},[]),(0,n.useEffect)(()=>{var e;if(!(null==(e=aj.connectors)?void 0:e.whatsapp))return;let a=!1;async function t(){try{var e,t;let l=await fetch("/api/status"),n=await l.json(),r=null==n||null==(t=n.connectors)||null==(e=t.whatsapp)?void 0:e.status;if(a||aL(null!=r?r:"unknown"),"qr_pending"===r){let e=await fetch("/api/connectors/whatsapp/qr"),t=await e.json();a||aB(t.qr)}else a||aB(null)}catch(e){}}t();let l=setInterval(()=>{t()},1e4);return()=>{a=!0,clearInterval(l)}},[null==(e=aj.connectors)?void 0:e.whatsapp]),(0,l.jsx)(u.M,{children:(0,l.jsx)("div",{className:"h-full overflow-y-auto bg-[var(--bg)]",children:(0,l.jsxs)("div",{className:"max-w-[640px] mx-auto px-[var(--space-4)] py-[var(--space-6)] pb-[var(--space-12)]",children:[(0,l.jsx)("h1",{className:"text-[length:var(--text-title1)] font-[var(--weight-bold)] tracking-[var(--tracking-tight)] text-[var(--text-primary)] mb-[var(--space-6)]",children:"Settings"}),(0,l.jsxs)(b,{title:"Appearance",children:[(0,l.jsx)("div",{className:"text-[length:var(--text-footnote)] font-[var(--weight-medium)] text-[var(--text-secondary)] mb-[var(--space-2)]",children:"Theme"}),(0,l.jsx)("div",{className:"grid grid-cols-5 gap-[var(--space-2)] mb-[var(--space-4)]",children:h.z.map(e=>{let a=as===e.id;return(0,l.jsxs)("button",{onClick:()=>ao(e.id),className:"flex flex-col items-center gap-[var(--space-1)] px-[var(--space-2)] py-[var(--space-3)] rounded-[var(--radius-md)] bg-[var(--fill-quaternary)] cursor-pointer transition-all duration-150 ease-[var(--ease-smooth)]",style:{border:a?"2px solid var(--accent)":"2px solid var(--separator)"},children:[(0,l.jsx)("span",{className:"text-[24px]",children:e.emoji}),(0,l.jsx)("span",{className:"text-[length:var(--text-caption2)]",style:{fontWeight:a?"var(--weight-semibold)":"var(--weight-medium)",color:a?"var(--accent)":"var(--text-secondary)"},children:e.label})]},e.id)})}),(0,l.jsx)("div",{className:"text-[length:var(--text-footnote)] font-[var(--weight-medium)] text-[var(--text-secondary)] mb-[var(--space-2)]",children:"Accent Color"}),(0,l.jsx)("div",{className:"flex flex-wrap gap-[var(--space-2)] mb-[var(--space-3)]",children:m.map(e=>{let a=e9.accentColor===e.value;return(0,l.jsx)("button",{onClick:()=>e7(e.value),"aria-label":e.label,title:e.label,className:"w-[32px] h-[32px] rounded-full cursor-pointer transition-all duration-100 ease-[var(--ease-smooth)] flex items-center justify-center",style:{background:e.value,border:a?"2px solid var(--text-primary)":"2px solid transparent",outline:a?"2px solid ".concat(e.value):"none",outlineOffset:2},children:a&&(0,l.jsx)(r.A,{size:14,color:"#fff",strokeWidth:3})},e.value)})}),(0,l.jsxs)("div",{className:"flex items-center gap-[var(--space-3)]",children:[(0,l.jsxs)("label",{className:"flex items-center gap-[var(--space-2)] text-[length:var(--text-footnote)] text-[var(--text-secondary)] cursor-pointer",children:["Custom:",(0,l.jsx)("input",{type:"color",value:null!=(eO=e9.accentColor)?eO:"#3B82F6",onChange:e=>e7(e.target.value),className:"w-[28px] h-[28px] border-none rounded-full cursor-pointer bg-transparent p-0"})]}),(0,l.jsx)("input",{type:"text",placeholder:"#3B82F6",value:ab,onChange:e=>{af(e.target.value),/^#[0-9a-fA-F]{6}$/.test(e.target.value)&&e7(e.target.value)},className:"apple-input w-[90px] px-[8px] py-[4px] text-[length:var(--text-caption1)] bg-[var(--bg-secondary)] border border-[var(--separator)] rounded-[var(--radius-sm)] text-[var(--text-primary)] font-mono"}),e9.accentColor&&(0,l.jsxs)("button",{onClick:()=>e7(null),className:"text-[length:var(--text-footnote)] text-[var(--system-blue)] bg-none border-none cursor-pointer p-0 inline-flex items-center gap-[4px]",children:[(0,l.jsx)(o,{size:12}),"Reset"]})]})]}),(0,l.jsx)(b,{title:"Branding",children:(0,l.jsxs)("div",{className:"flex flex-col gap-[var(--space-3)]",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-[length:var(--text-caption1)] text-[var(--text-tertiary)] mb-[var(--space-1)]",children:"Portal Name"}),(0,l.jsx)("input",{type:"text",className:"apple-input w-full bg-[var(--bg-secondary)] border border-[var(--separator)] rounded-[var(--radius-sm)] px-[10px] py-[6px] text-[length:var(--text-footnote)] text-[var(--text-primary)]",placeholder:"Jinn",value:ai,onChange:e=>ac(e.target.value),onBlur:()=>{ae(ai||null),g.F.completeOnboarding({portalName:ai||void 0}).catch(()=>{})}})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-[length:var(--text-caption1)] text-[var(--text-tertiary)] mb-[var(--space-1)]",children:"Portal Subtitle"}),(0,l.jsx)("input",{type:"text",className:"apple-input w-full bg-[var(--bg-secondary)] border border-[var(--separator)] rounded-[var(--radius-sm)] px-[10px] py-[6px] text-[length:var(--text-footnote)] text-[var(--text-primary)]",placeholder:"Command Centre",value:ad,onChange:e=>au(e.target.value),onBlur:()=>aa(ad||null)})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-[length:var(--text-caption1)] text-[var(--text-tertiary)] mb-[var(--space-1)]",children:"Operator Name"}),(0,l.jsx)("input",{type:"text",className:"apple-input w-full bg-[var(--bg-secondary)] border border-[var(--separator)] rounded-[var(--radius-sm)] px-[10px] py-[6px] text-[length:var(--text-footnote)] text-[var(--text-primary)]",placeholder:"Your Name",value:av,onChange:e=>ap(e.target.value),onBlur:()=>{at(av||null),g.F.completeOnboarding({operatorName:av||void 0}).catch(()=>{})}})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-[length:var(--text-caption1)] text-[var(--text-tertiary)] mb-[var(--space-1)]",children:"Portal Emoji"}),(0,l.jsx)("input",{type:"text",className:"apple-input w-[80px] text-center text-[length:var(--text-title2)] px-[8px] py-[6px] bg-[var(--bg-secondary)] border border-[var(--separator)] rounded-[var(--radius-sm)]",placeholder:"\ud83e\udd16",value:ax,onChange:e=>ah(e.target.value),onBlur:()=>al(ax||null)})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-[length:var(--text-caption1)] text-[var(--text-tertiary)] mb-[var(--space-1)]",children:"Language"}),(0,l.jsxs)("select",{value:ag,onChange:e=>am(e.target.value),onBlur:()=>{an(ag||"English"),g.F.completeOnboarding({language:ag||void 0}).catch(()=>{})},className:"w-full bg-[var(--bg-secondary)] border border-[var(--separator)] rounded-[var(--radius-sm)] px-[10px] py-[6px] text-[length:var(--text-footnote)] text-[var(--text-primary)] cursor-pointer",children:[(0,l.jsx)("option",{value:"English",children:"English"}),(0,l.jsx)("option",{value:"Spanish",children:"Spanish"}),(0,l.jsx)("option",{value:"French",children:"French"}),(0,l.jsx)("option",{value:"German",children:"German"}),(0,l.jsx)("option",{value:"Portuguese",children:"Portuguese"}),(0,l.jsx)("option",{value:"Italian",children:"Italian"}),(0,l.jsx)("option",{value:"Dutch",children:"Dutch"}),(0,l.jsx)("option",{value:"Russian",children:"Russian"}),(0,l.jsx)("option",{value:"Chinese",children:"Chinese"}),(0,l.jsx)("option",{value:"Japanese",children:"Japanese"}),(0,l.jsx)("option",{value:"Korean",children:"Korean"}),(0,l.jsx)("option",{value:"Arabic",children:"Arabic"}),(0,l.jsx)("option",{value:"Hindi",children:"Hindi"}),(0,l.jsx)("option",{value:"Bulgarian",children:"Bulgarian"})]})]})]})}),aA&&(0,l.jsx)("div",{className:"mb-[var(--space-4)] px-[var(--space-4)] py-[var(--space-3)] rounded-[var(--radius-md)] text-[length:var(--text-footnote)]",style:{background:"success"===aA.type?"rgba(34,197,94,0.1)":"rgba(239,68,68,0.1)",border:"1px solid ".concat("success"===aA.type?"rgba(34,197,94,0.3)":"rgba(239,68,68,0.3)"),color:"success"===aA.type?"var(--system-green)":"var(--system-red)"},children:aA.message}),aw?(0,l.jsxs)("div",{className:"text-center p-[var(--space-8)] text-[var(--text-tertiary)] text-[length:var(--text-footnote)]",children:[(0,l.jsx)(i,{size:20,className:"mx-auto mb-[var(--space-2)] animate-spin"}),"Loading gateway config..."]}):aC?(0,l.jsxs)("div",{className:"mb-[var(--space-6)] px-[var(--space-4)] py-[var(--space-3)] rounded-[var(--radius-md)] text-[length:var(--text-footnote)] text-[var(--system-red)]",style:{background:"rgba(239,68,68,0.1)",border:"1px solid rgba(239,68,68,0.3)"},children:["Failed to load config: ",aC]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(b,{title:"Gateway Configuration",children:[(0,l.jsx)(f,{label:"Port",children:(0,l.jsx)(j,{type:"number",value:String(null!=(eT=null==(a=aj.gateway)?void 0:a.port)?eT:""),onChange:e=>aO(["gateway","port"],Number(e)||0),placeholder:"7777"})}),(0,l.jsx)(f,{label:"Host",children:(0,l.jsx)(j,{value:null!=(eP=null==(t=aj.gateway)?void 0:t.host)?eP:"",onChange:e=>aO(["gateway","host"],e),placeholder:"127.0.0.1"})}),(0,l.jsx)(f,{label:"Default Engine",children:(0,l.jsx)(y,{value:null!=(eW=null==(s=aj.engines)?void 0:s.default)?eW:"claude",onChange:e=>aO(["engines","default"],e),options:[{value:"claude",label:"Claude"},{value:"codex",label:"Codex"}]})})]}),(0,l.jsxs)(b,{title:"Engine Configuration",children:[(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mb-[var(--space-2)]",children:"Claude"}),(0,l.jsx)(f,{label:"Binary Path",children:(0,l.jsx)(j,{value:null!=(eG=null==(k=aj.engines)||null==(N=k.claude)?void 0:N.bin)?eG:"",onChange:e=>aO(["engines","claude","bin"],e),placeholder:"claude"})}),(0,l.jsx)(f,{label:"Model",children:(0,l.jsx)(y,{value:null!=(eR=null==(F=aj.engines)||null==(S=F.claude)?void 0:S.model)?eR:"opus",onChange:e=>aO(["engines","claude","model"],e),options:[{value:"opus",label:"Opus (claude-opus-4-6)"},{value:"sonnet",label:"Sonnet (claude-sonnet-4-6)"},{value:"haiku",label:"Haiku (claude-haiku-4-5)"}]})}),(0,l.jsx)(f,{label:"Effort Level",children:(0,l.jsx)(y,{value:null!=(ez=null==(D=aj.engines)||null==(A=D.claude)?void 0:A.effortLevel)?ez:"default",onChange:e=>aO(["engines","claude","effortLevel"],e),options:[{value:"default",label:"Default"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}]})}),(0,l.jsx)("div",{className:"border-t border-[var(--separator)] mt-[var(--space-3)] pt-[var(--space-3)]"}),(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mb-[var(--space-2)]",children:"Codex"}),(0,l.jsx)(f,{label:"Binary Path",children:(0,l.jsx)(j,{value:null!=(eH=null==(B=aj.engines)||null==(E=B.codex)?void 0:E.bin)?eH:"",onChange:e=>aO(["engines","codex","bin"],e),placeholder:"codex"})}),(0,l.jsx)(f,{label:"Model",children:(0,l.jsx)(y,{value:null!=(eU=null==(L=aj.engines)||null==(I=L.codex)?void 0:I.model)?eU:"gpt-5.4",onChange:e=>aO(["engines","codex","model"],e),options:[{value:"gpt-5.4",label:"GPT-5.4"},{value:"gpt-5.3-codex",label:"GPT-5.3 Codex"},{value:"gpt-5.2-codex",label:"GPT-5.2 Codex"},{value:"gpt-5.2",label:"GPT-5.2"},{value:"gpt-5.1-codex-max",label:"GPT-5.1 Codex Max"},{value:"gpt-5.1-codex-mini",label:"GPT-5.1 Codex Mini"}]})}),(0,l.jsx)(f,{label:"Effort Level",children:(0,l.jsx)(y,{value:null!=(eq=null==(O=aj.engines)||null==(M=O.codex)?void 0:M.effortLevel)?eq:"default",onChange:e=>aO(["engines","codex","effortLevel"],e),options:[{value:"default",label:"Default"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra High"}]})})]}),(0,l.jsxs)(b,{title:"Sessions",children:[(0,l.jsx)(f,{label:"Interrupt on New Message",children:(0,l.jsx)(w,{checked:null==(e_=null==(T=aj.sessions)?void 0:T.interruptOnNewMessage)||e_,onChange:e=>aO(["sessions","interruptOnNewMessage"],e)})}),(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] text-[var(--label-secondary)] mt-[4px]",children:"When enabled, sending a new message to a running session will stop the current agent and start processing your new message immediately. When disabled, messages are queued."}),(0,l.jsx)("div",{className:"border-t border-[var(--separator)] mt-[var(--space-3)] pt-[var(--space-3)]"}),(0,l.jsx)(f,{label:"When Claude Hits Usage Limit",children:(0,l.jsx)(y,{value:null!=(eV=null==(P=aj.sessions)?void 0:P.rateLimitStrategy)?eV:"fallback",onChange:e=>aO(["sessions","rateLimitStrategy"],e),options:[{value:"wait",label:"Wait & Auto-Resume"},{value:"fallback",label:"Switch to GPT (Codex)"}]})}),(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] text-[var(--label-secondary)] mt-[4px]",children:'"Wait" pauses the session and continues automatically when Claude resets. "Switch" answers immediately using GPT, then returns to Claude once the reset window passes.'})]}),(0,l.jsxs)(b,{title:"Connectors",children:[(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mb-[var(--space-2)]",children:"Slack"}),(0,l.jsx)(f,{label:"App Token",children:(0,l.jsx)(j,{type:"password",value:null!=(eJ=null==(G=aj.connectors)||null==(W=G.slack)?void 0:W.appToken)?eJ:"",onChange:e=>aO(["connectors","slack","appToken"],e),placeholder:"xapp-..."})}),(0,l.jsx)(f,{label:"Bot Token",children:(0,l.jsx)(j,{type:"password",value:null!=(eK=null==(z=aj.connectors)||null==(R=z.slack)?void 0:R.botToken)?eK:"",onChange:e=>aO(["connectors","slack","botToken"],e),placeholder:"xoxb-..."})}),(0,l.jsx)(f,{label:"Share Session in Channel",children:(0,l.jsx)(w,{checked:null!=(eQ=null==(U=aj.connectors)||null==(H=U.slack)?void 0:H.shareSessionInChannel)&&eQ,onChange:e=>aO(["connectors","slack","shareSessionInChannel"],e)})}),(0,l.jsx)(f,{label:"Allowed Users",children:(0,l.jsx)(j,{value:Array.isArray(null==(_=aj.connectors)||null==(q=_.slack)?void 0:q.allowFrom)?null==(K=aj.connectors)||null==(J=K.slack)||null==(V=J.allowFrom)?void 0:V.join(", "):null!=(eY=null==(Y=aj.connectors)||null==(Q=Y.slack)?void 0:Q.allowFrom)?eY:"",onChange:e=>aO(["connectors","slack","allowFrom"],e.trim()?e.split(",").map(e=>e.trim()).filter(Boolean):void 0),placeholder:"U123, U456"})}),(0,l.jsx)(f,{label:"Ignore Old Messages on Boot",children:(0,l.jsx)(w,{checked:null==(e$=null==(X=aj.connectors)||null==($=X.slack)?void 0:$.ignoreOldMessagesOnBoot)||e$,onChange:e=>aO(["connectors","slack","ignoreOldMessagesOnBoot"],e)})}),(0,l.jsx)("div",{className:"border-t border-[var(--separator)] mt-[var(--space-3)] pt-[var(--space-3)]"}),(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mb-[var(--space-2)]",children:"Discord"}),(0,l.jsx)(f,{label:"Bot Token",children:(0,l.jsx)(j,{type:"password",value:null!=(eX=null==(ee=aj.connectors)||null==(Z=ee.discord)?void 0:Z.botToken)?eX:"",onChange:e=>aO(["connectors","discord","botToken"],e),placeholder:"Bot token..."})}),(0,l.jsx)(f,{label:"Allow From",children:(0,l.jsx)(j,{value:Array.isArray(null==(et=aj.connectors)||null==(ea=et.discord)?void 0:ea.allowFrom)?null==(er=aj.connectors)||null==(en=er.discord)||null==(el=en.allowFrom)?void 0:el.join(", "):null!=(eZ=null==(eo=aj.connectors)||null==(es=eo.discord)?void 0:es.allowFrom)?eZ:"",onChange:e=>aO(["connectors","discord","allowFrom"],e.trim()?e.split(",").map(e=>e.trim()).filter(Boolean):void 0),placeholder:"User IDs, comma-separated (optional)"})}),(0,l.jsx)(f,{label:"Guild ID",children:(0,l.jsx)(j,{value:null!=(e0=null==(ec=aj.connectors)||null==(ei=ec.discord)?void 0:ei.guildId)?e0:"",onChange:e=>aO(["connectors","discord","guildId"],e.trim()||void 0),placeholder:"Server/Guild ID (optional)"})}),(0,l.jsx)(f,{label:"Channel ID",children:(0,l.jsx)(j,{value:null!=(e1=null==(eu=aj.connectors)||null==(ed=eu.discord)?void 0:ed.channelId)?e1:"",onChange:e=>aO(["connectors","discord","channelId"],e.trim()||void 0),placeholder:"Restrict to this channel (right-click → Copy Channel ID)"})}),(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mt-[var(--space-4)] mb-[var(--space-2)]",children:"WhatsApp"}),(0,l.jsx)("div",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)] mb-[var(--space-3)]",children:"On first start, scan the QR code below with your WhatsApp app to connect. Credentials are cached for subsequent runs."}),(0,l.jsx)(f,{label:"Auth Directory",children:(0,l.jsx)(j,{value:null!=(e2=null==(ep=aj.connectors)||null==(ev=ep.whatsapp)?void 0:ev.authDir)?e2:"",onChange:e=>aO(["connectors","whatsapp","authDir"],e.trim()||void 0),placeholder:"Default: ~/.jinn/.whatsapp-auth"})}),(0,l.jsx)(f,{label:"Allow From",children:(0,l.jsx)(j,{value:Array.isArray(null==(eh=aj.connectors)||null==(ex=eh.whatsapp)?void 0:ex.allowFrom)?null==(eb=aj.connectors)||null==(em=eb.whatsapp)||null==(eg=em.allowFrom)?void 0:eg.join(", "):"",onChange:e=>aO(["connectors","whatsapp","allowFrom"],e.trim()?e.split(",").map(e=>e.trim()).filter(Boolean):void 0),placeholder:"447700900000@s.whatsapp.net, ... (optional)"})}),aE&&(0,l.jsxs)("div",{className:"mt-[var(--space-3)] flex flex-col items-center gap-[var(--space-2)]",children:[(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] font-semibold text-[var(--text-secondary)]",children:"Scan with WhatsApp to connect"}),(0,l.jsx)("img",{src:aE,alt:"WhatsApp QR Code",className:"w-[200px] h-[200px] rounded-[var(--radius-md)] border border-[var(--separator)] bg-white p-[8px]"}),(0,l.jsx)("div",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)]",children:"Open WhatsApp → Linked Devices → Link a Device"})]}),(null==(ef=aj.connectors)?void 0:ef.whatsapp)&&"ok"===aI&&(0,l.jsx)("div",{className:"mt-[var(--space-2)] text-[length:var(--text-caption1)] text-[var(--system-green)] font-semibold",children:"✓ Connected"}),(0,l.jsx)("div",{className:"border-t border-[var(--separator)] mt-[var(--space-3)] pt-[var(--space-3)]"}),(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mb-[var(--space-2)]",children:"Web UI"}),(0,l.jsx)("div",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)]",children:"Web conversations use queued one-shot resume flow for both engines."})]}),(0,l.jsxs)(b,{title:"Cron",children:[(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mb-[var(--space-2)]",children:"Default Delivery"}),(0,l.jsx)("div",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)] mb-[var(--space-3)]",children:"When a cron job has no delivery configured, results will be sent here."}),(0,l.jsx)(f,{label:"Connector",children:(0,l.jsx)(y,{value:null!=(e4=null==(ey=aj.cron)||null==(ej=ey.defaultDelivery)?void 0:ej.connector)?e4:"",onChange:e=>aO(["cron","defaultDelivery","connector"],e||void 0),options:[{value:"",label:"None (fire & forget)"},{value:"web",label:"Web"},{value:"slack",label:"Slack"}]})}),(null==(eN=aj.cron)||null==(ew=eN.defaultDelivery)?void 0:ew.connector)&&(0,l.jsx)(f,{label:"Channel",children:(0,l.jsx)(j,{value:null!=(e3=null==(ek=aj.cron)||null==(eC=ek.defaultDelivery)?void 0:eC.channel)?e3:"",onChange:e=>aO(["cron","defaultDelivery","channel"],e),placeholder:"#general"})})]}),(0,l.jsxs)(b,{title:"Logging",children:[(0,l.jsx)(f,{label:"Level",children:(0,l.jsx)(y,{value:null!=(e6=null==(eS=aj.logging)?void 0:eS.level)?e6:"info",onChange:e=>aO(["logging","level"],e),options:[{value:"debug",label:"Debug"},{value:"info",label:"Info"},{value:"warn",label:"Warn"},{value:"error",label:"Error"}]})}),(0,l.jsx)(f,{label:"Stdout",children:(0,l.jsx)(w,{checked:null==(e5=null==(eF=aj.logging)?void 0:eF.stdout)||e5,onChange:e=>aO(["logging","stdout"],e)})}),(0,l.jsx)(f,{label:"File Logging",children:(0,l.jsx)(w,{checked:null!=(e8=null==(eA=aj.logging)?void 0:eA.file)&&e8,onChange:e=>aO(["logging","file"],e)})})]}),(0,l.jsx)(C,{}),(0,l.jsxs)("div",{className:"flex justify-end gap-[var(--space-3)] mb-[var(--space-6)]",children:[(0,l.jsxs)("button",{onClick:()=>aM(),className:"px-[var(--space-4)] py-[var(--space-2)] rounded-[var(--radius-md)] bg-[var(--fill-tertiary)] text-[var(--text-secondary)] border-none cursor-pointer text-[length:var(--text-footnote)] font-[var(--weight-medium)] inline-flex items-center gap-[6px]",children:[(0,l.jsx)(o,{size:14}),"Reload"]}),(0,l.jsxs)("button",{onClick:function(){aF(!0),aD(null),g.F.updateConfig(aj).then(()=>aD({type:"success",message:"Settings saved successfully"})).catch(e=>aD({type:"error",message:"Failed to save: ".concat(e.message)})).finally(()=>aF(!1))},disabled:aS,className:"px-[var(--space-5)] py-[var(--space-2)] rounded-[var(--radius-md)] bg-[var(--accent)] text-[var(--accent-contrast)] border-none text-[length:var(--text-footnote)] font-[var(--weight-semibold)] inline-flex items-center gap-[6px] transition-all duration-150 ease-[var(--ease-smooth)]",style:{cursor:aS?"wait":"pointer",opacity:aS?.7:1},children:[(0,l.jsx)(c,{size:14}),aS?"Saving...":"Save Config"]})]})]}),(0,l.jsx)(b,{title:"Reset",children:(0,l.jsxs)("div",{className:"flex items-center justify-center gap-[var(--space-3)] flex-wrap",children:[(0,l.jsxs)("button",{onClick:()=>{localStorage.removeItem("jinn-onboarded"),window.location.reload()},className:"px-[var(--space-5)] py-[var(--space-2)] rounded-[var(--radius-md)] bg-[var(--accent)] text-[var(--accent-contrast)] border-none cursor-pointer text-[length:var(--text-footnote)] font-[var(--weight-semibold)] transition-all duration-150 ease-[var(--ease-spring)] inline-flex items-center gap-[var(--space-2)]",children:[(0,l.jsx)(o,{size:14}),"Re-run Onboarding Wizard"]}),(0,l.jsxs)("button",{onClick:()=>{window.confirm("Reset all settings to defaults?")&&(localStorage.removeItem("jinn-settings"),localStorage.removeItem("jinn-theme"),ar(),window.location.reload())},className:"px-[var(--space-5)] py-[var(--space-2)] rounded-[var(--radius-md)] bg-[var(--system-red)] text-white border-none cursor-pointer text-[length:var(--text-footnote)] font-[var(--weight-semibold)] transition-all duration-150 ease-[var(--ease-spring)] inline-flex items-center gap-[var(--space-2)]",children:[(0,l.jsx)(d.A,{size:14}),"Reset All Settings"]})]})})]})})})}},9421:(e,a,t)=>{Promise.resolve().then(t.bind(t,1694))}},e=>{e.O(0,[625,51,155,192,344,144,358],()=>e(e.s=9421)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[662],{1694:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>k});var l=t(4130),n=t(7946),r=t(4139),s=t(3250);let o=(0,s.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"}]]),i=(0,s.A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),c=(0,s.A)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);var d=t(8574),u=t(7192),v=t(4722),p=t(8565),x=t(8838),h=t(280),g=t(6654);let m=[{label:"Red",value:"#EF4444"},{label:"Orange",value:"#F97316"},{label:"Amber",value:"#F59E0B"},{label:"Yellow",value:"#EAB308"},{label:"Lime",value:"#84CC16"},{label:"Green",value:"#22C55E"},{label:"Emerald",value:"#10B981"},{label:"Cyan",value:"#06B6D4"},{label:"Blue",value:"#3B82F6"},{label:"Indigo",value:"#6366F1"},{label:"Violet",value:"#8B5CF6"},{label:"Pink",value:"#EC4899"}];function b(e){let{title:a,children:t}=e;return(0,l.jsxs)("section",{className:"mb-[var(--space-6)]",children:[(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] tracking-[var(--tracking-wide)] uppercase text-[var(--text-tertiary)] px-[var(--space-2)] pb-[var(--space-2)]",children:a}),(0,l.jsx)("div",{className:"bg-[var(--material-regular)] rounded-[var(--radius-md)] border border-[var(--separator)] p-[var(--space-4)]",children:t})]})}function f(e){let{label:a,children:t}=e;return(0,l.jsxs)("div",{className:"flex items-center justify-between py-[var(--space-2)] gap-[var(--space-4)]",children:[(0,l.jsx)("label",{className:"text-[length:var(--text-subheadline)] text-[var(--text-secondary)] shrink-0",children:a}),(0,l.jsx)("div",{className:"w-[240px] shrink-0",children:t})]})}function j(e){let{value:a,onChange:t,type:n="text",placeholder:r}=e;return(0,l.jsx)("input",{type:n,value:a,onChange:e=>t(e.target.value),placeholder:r,className:"apple-input w-full bg-[var(--bg-secondary)] border border-[var(--separator)] rounded-[var(--radius-sm)] px-[10px] py-[6px] text-[length:var(--text-footnote)] text-[var(--text-primary)]"})}function y(e){let{value:a,onChange:t,options:n}=e;return(0,l.jsx)("select",{value:a,onChange:e=>t(e.target.value),className:"w-full bg-[var(--bg-secondary)] border border-[var(--separator)] rounded-[var(--radius-sm)] px-[10px] py-[6px] text-[length:var(--text-footnote)] text-[var(--text-primary)] cursor-pointer",children:n.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value))})}function w(e){let{checked:a,onChange:t}=e;return(0,l.jsx)("button",{role:"switch","aria-checked":a,onClick:()=>t(!a),className:"w-[44px] h-[24px] rounded-[12px] border-none cursor-pointer relative shrink-0 transition-[background] duration-200 ease-[var(--ease-smooth)]",style:{background:a?"var(--system-green)":"var(--fill-primary)"},children:(0,l.jsx)("span",{className:"absolute top-[2px] w-[20px] h-[20px] rounded-full bg-white shadow-[0_1px_3px_rgba(0,0,0,0.2)] transition-[left] duration-200 ease-[var(--ease-spring)]",style:{left:a?22:2}})})}let N={en:"English",bg:"Bulgarian",de:"German",fr:"French",es:"Spanish",it:"Italian",pt:"Portuguese",ru:"Russian",zh:"Chinese",ja:"Japanese",ko:"Korean",ar:"Arabic",hi:"Hindi",tr:"Turkish",pl:"Polish",nl:"Dutch",sv:"Swedish",cs:"Czech",el:"Greek",ro:"Romanian",uk:"Ukrainian",he:"Hebrew",da:"Danish",fi:"Finnish",hu:"Hungarian",no:"Norwegian",sk:"Slovak",hr:"Croatian",ca:"Catalan",th:"Thai",vi:"Vietnamese",id:"Indonesian",ms:"Malay",tl:"Filipino",sr:"Serbian",lt:"Lithuanian",lv:"Latvian",sl:"Slovenian",et:"Estonian"};function C(){let[e,a]=(0,n.useState)(null),[t,r]=(0,n.useState)(!1),[s,o]=(0,n.useState)("");if((0,n.useEffect)(()=>{g.F.sttStatus().then(a).catch(()=>{})},[]),(0,n.useEffect)(()=>{if(!(null==e?void 0:e.downloading))return;let t=setInterval(()=>{g.F.sttStatus().then(a).catch(()=>{})},1500);return()=>clearInterval(t)},[null==e?void 0:e.downloading]),!e)return null;let i=Object.entries(N).filter(a=>{let[t]=a;return!e.languages.includes(t)}).sort((e,a)=>e[1].localeCompare(a[1]));return(0,l.jsxs)(b,{title:"Voice Input",children:[(0,l.jsxs)("div",{className:"flex items-center gap-[var(--space-3)] mb-[var(--space-4)]",children:[(0,l.jsx)("div",{className:"w-[8px] h-[8px] rounded-full shrink-0",style:{background:e.available?"var(--system-green)":"var(--system-red)"}}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("div",{className:"text-[length:var(--text-subheadline)] font-[var(--weight-medium)] text-[var(--text-primary)]",children:e.available?"Whisper ".concat((e.model||"small").charAt(0).toUpperCase()+(e.model||"small").slice(1)):"No model installed"}),(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)]",children:e.available?"Offline speech recognition ready":"Download a model to enable voice input"})]})]}),!e.available&&!e.downloading&&(0,l.jsx)("button",{onClick:function(){g.F.sttDownload().then(()=>a(e=>e?{...e,downloading:!0,progress:0}:e)).catch(()=>{})},className:"w-full p-[var(--space-3)] rounded-[var(--radius-md)] bg-[var(--accent)] text-[var(--accent-contrast)] border-none cursor-pointer text-[length:var(--text-footnote)] font-[var(--weight-semibold)] mb-[var(--space-4)]",children:"Download Whisper Small (~500MB)"}),e.downloading&&(0,l.jsxs)("div",{className:"mb-[var(--space-4)]",children:[(0,l.jsxs)("div",{className:"flex justify-between mb-[var(--space-2)] text-[length:var(--text-caption1)] text-[var(--text-tertiary)]",children:[(0,l.jsx)("span",{children:"Downloading model…"}),(0,l.jsxs)("span",{children:[e.progress,"%"]})]}),(0,l.jsx)("div",{className:"h-[6px] rounded-[3px] bg-[var(--fill-tertiary)] overflow-hidden",children:(0,l.jsx)("div",{className:"h-full rounded-[3px] bg-[var(--accent)] transition-[width] duration-300 ease-out",style:{width:"".concat(e.progress,"%")}})})]}),e.available&&(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)("div",{className:"border-t border-[var(--separator)] mt-[var(--space-2)] pt-[var(--space-3)]",children:[(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mb-[var(--space-2)]",children:"Transcription Languages"}),(0,l.jsx)("div",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)] mb-[var(--space-3)]",children:"First language is the default. Add multiple to show a language picker in chat."}),(0,l.jsx)("div",{className:"flex flex-wrap gap-[var(--space-2)] mb-[var(--space-3)]",children:e.languages.map(n=>(0,l.jsxs)("div",{className:"inline-flex items-center gap-[var(--space-1)] px-[8px] py-[3px] rounded-[var(--radius-sm)] bg-[var(--fill-secondary)] text-[length:var(--text-caption1)] font-[var(--weight-medium)] text-[var(--text-primary)]",children:[(0,l.jsx)("span",{className:"font-[family-name:var(--font-mono)] uppercase text-[length:var(--text-caption2)] font-[var(--weight-semibold)] text-[var(--accent)] mr-[2px]",children:n}),N[n]||n,e.languages.length>1&&(0,l.jsx)("button",{onClick:()=>(function(t){if(!e||e.languages.length<=1)return;let l=e.languages.filter(e=>e!==t);r(!0),g.F.sttUpdateConfig(l).then(()=>a(e=>e?{...e,languages:l}:e)).catch(()=>{}).finally(()=>r(!1))})(n),disabled:t,"aria-label":"Remove ".concat(N[n]||n),className:"bg-none border-none cursor-pointer p-0 ml-[2px] text-[var(--text-quaternary)] text-[14px] leading-none flex items-center",children:"\xd7"})]},n))}),(0,l.jsxs)("div",{className:"flex gap-[var(--space-2)]",children:[(0,l.jsxs)("select",{value:s,onChange:e=>o(e.target.value),className:"flex-1 bg-[var(--bg-secondary)] border border-[var(--separator)] rounded-[var(--radius-sm)] px-[10px] py-[6px] text-[length:var(--text-footnote)] cursor-pointer",style:{color:s?"var(--text-primary)":"var(--text-tertiary)"},children:[(0,l.jsx)("option",{value:"",children:"Add a language…"}),i.map(e=>{let[a,t]=e;return(0,l.jsxs)("option",{value:a,children:[a.toUpperCase()," — ",t]},a)})]}),(0,l.jsx)("button",{onClick:function(){if(!s||!e||e.languages.includes(s))return;let t=[...e.languages,s];r(!0),o(""),g.F.sttUpdateConfig(t).then(()=>a(e=>e?{...e,languages:t}:e)).catch(()=>{}).finally(()=>r(!1))},disabled:!s||t,className:"px-[14px] py-[6px] rounded-[var(--radius-sm)] border-none text-[length:var(--text-footnote)] font-[var(--weight-semibold)] shrink-0",style:{background:s?"var(--accent)":"var(--fill-tertiary)",color:s?"var(--accent-contrast)":"var(--text-quaternary)",cursor:s?"pointer":"default"},children:"Add"})]})]})})]})}function k(){var e,a,t,s,N,k,S,F,A,D,E,B,I,L,M,O,T,P,W,G,R,z,H,U,q,_,V,J,K,Q,Y,$,X,Z,ee,ea,et,el,en,er,es,eo,ei,ec,ed,eu,ev,ep,ex,eh,eg,em,eb,ef,ej,ey,ew,eN,eC,ek,eS,eF,eA,eD,eE,eB,eI,eL,eM,eO,eT,eP,eW,eG,eR,ez,eH,eU,eq,e_,eV,eJ,eK,eQ,eY,e$,eX,eZ,e0,e1,e2,e4,e3,e6,e5,e8;(0,p.i)([{label:"Settings"}]);let{settings:e9,setAccentColor:e7,setPortalName:ae,setPortalSubtitle:aa,setOperatorName:at,setPortalEmoji:al,setLanguage:an,resetAll:ar}=(0,v.t0)(),{theme:as,setTheme:ao}=(0,x.D)(),[ai,ac]=(0,n.useState)(null!=(eD=e9.portalName)?eD:""),[ad,au]=(0,n.useState)(null!=(eE=e9.portalSubtitle)?eE:""),[av,ap]=(0,n.useState)(null!=(eB=e9.operatorName)?eB:""),[ax,ah]=(0,n.useState)(null!=(eI=e9.portalEmoji)?eI:""),[ag,am]=(0,n.useState)(null!=(eL=e9.language)?eL:"English"),[ab,af]=(0,n.useState)(null!=(eM=e9.accentColor)?eM:""),[aj,ay]=(0,n.useState)({}),[aw,aN]=(0,n.useState)(!0),[aC,ak]=(0,n.useState)(null),[aS,aF]=(0,n.useState)(!1),[aA,aD]=(0,n.useState)(null),[aE,aB]=(0,n.useState)(null),[aI,aL]=(0,n.useState)("unknown");function aM(){aN(!0),g.F.getConfig().then(e=>{ay(e),ak(null)}).catch(e=>ak(e.message)).finally(()=>aN(!1))}function aO(e,a){ay(t=>{let l=structuredClone(t),n=l;for(let a=0;a<e.length-1;a++)n[e[a]]&&"object"==typeof n[e[a]]||(n[e[a]]={}),n=n[e[a]];return n[e[e.length-1]]=a,l})}return(0,n.useEffect)(()=>{var e,a,t,l,n,r;ac(null!=(e=e9.portalName)?e:""),au(null!=(a=e9.portalSubtitle)?a:""),ap(null!=(t=e9.operatorName)?t:""),ah(null!=(l=e9.portalEmoji)?l:""),am(null!=(n=e9.language)?n:"English"),af(null!=(r=e9.accentColor)?r:"")},[e9.portalName,e9.portalSubtitle,e9.operatorName,e9.portalEmoji,e9.language,e9.accentColor]),(0,n.useEffect)(()=>{aM()},[]),(0,n.useEffect)(()=>{var e;if(!(null==(e=aj.connectors)?void 0:e.whatsapp))return;let a=!1;async function t(){try{var e,t;let l=await fetch("/api/status"),n=await l.json(),r=null==n||null==(t=n.connectors)||null==(e=t.whatsapp)?void 0:e.status;if(a||aL(null!=r?r:"unknown"),"qr_pending"===r){let e=await fetch("/api/connectors/whatsapp/qr"),t=await e.json();a||aB(t.qr)}else a||aB(null)}catch(e){}}t();let l=setInterval(()=>{t()},1e4);return()=>{a=!0,clearInterval(l)}},[null==(e=aj.connectors)?void 0:e.whatsapp]),(0,l.jsx)(u.M,{children:(0,l.jsx)("div",{className:"h-full overflow-y-auto bg-[var(--bg)]",children:(0,l.jsxs)("div",{className:"max-w-[640px] mx-auto px-[var(--space-4)] py-[var(--space-6)] pb-[var(--space-12)]",children:[(0,l.jsx)("h1",{className:"text-[length:var(--text-title1)] font-[var(--weight-bold)] tracking-[var(--tracking-tight)] text-[var(--text-primary)] mb-[var(--space-6)]",children:"Settings"}),(0,l.jsxs)(b,{title:"Appearance",children:[(0,l.jsx)("div",{className:"text-[length:var(--text-footnote)] font-[var(--weight-medium)] text-[var(--text-secondary)] mb-[var(--space-2)]",children:"Theme"}),(0,l.jsx)("div",{className:"grid grid-cols-5 gap-[var(--space-2)] mb-[var(--space-4)]",children:h.z.map(e=>{let a=as===e.id;return(0,l.jsxs)("button",{onClick:()=>ao(e.id),className:"flex flex-col items-center gap-[var(--space-1)] px-[var(--space-2)] py-[var(--space-3)] rounded-[var(--radius-md)] bg-[var(--fill-quaternary)] cursor-pointer transition-all duration-150 ease-[var(--ease-smooth)]",style:{border:a?"2px solid var(--accent)":"2px solid var(--separator)"},children:[(0,l.jsx)("span",{className:"text-[24px]",children:e.emoji}),(0,l.jsx)("span",{className:"text-[length:var(--text-caption2)]",style:{fontWeight:a?"var(--weight-semibold)":"var(--weight-medium)",color:a?"var(--accent)":"var(--text-secondary)"},children:e.label})]},e.id)})}),(0,l.jsx)("div",{className:"text-[length:var(--text-footnote)] font-[var(--weight-medium)] text-[var(--text-secondary)] mb-[var(--space-2)]",children:"Accent Color"}),(0,l.jsx)("div",{className:"flex flex-wrap gap-[var(--space-2)] mb-[var(--space-3)]",children:m.map(e=>{let a=e9.accentColor===e.value;return(0,l.jsx)("button",{onClick:()=>e7(e.value),"aria-label":e.label,title:e.label,className:"w-[32px] h-[32px] rounded-full cursor-pointer transition-all duration-100 ease-[var(--ease-smooth)] flex items-center justify-center",style:{background:e.value,border:a?"2px solid var(--text-primary)":"2px solid transparent",outline:a?"2px solid ".concat(e.value):"none",outlineOffset:2},children:a&&(0,l.jsx)(r.A,{size:14,color:"#fff",strokeWidth:3})},e.value)})}),(0,l.jsxs)("div",{className:"flex items-center gap-[var(--space-3)]",children:[(0,l.jsxs)("label",{className:"flex items-center gap-[var(--space-2)] text-[length:var(--text-footnote)] text-[var(--text-secondary)] cursor-pointer",children:["Custom:",(0,l.jsx)("input",{type:"color",value:null!=(eO=e9.accentColor)?eO:"#3B82F6",onChange:e=>e7(e.target.value),className:"w-[28px] h-[28px] border-none rounded-full cursor-pointer bg-transparent p-0"})]}),(0,l.jsx)("input",{type:"text",placeholder:"#3B82F6",value:ab,onChange:e=>{af(e.target.value),/^#[0-9a-fA-F]{6}$/.test(e.target.value)&&e7(e.target.value)},className:"apple-input w-[90px] px-[8px] py-[4px] text-[length:var(--text-caption1)] bg-[var(--bg-secondary)] border border-[var(--separator)] rounded-[var(--radius-sm)] text-[var(--text-primary)] font-mono"}),e9.accentColor&&(0,l.jsxs)("button",{onClick:()=>e7(null),className:"text-[length:var(--text-footnote)] text-[var(--system-blue)] bg-none border-none cursor-pointer p-0 inline-flex items-center gap-[4px]",children:[(0,l.jsx)(o,{size:12}),"Reset"]})]})]}),(0,l.jsx)(b,{title:"Branding",children:(0,l.jsxs)("div",{className:"flex flex-col gap-[var(--space-3)]",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-[length:var(--text-caption1)] text-[var(--text-tertiary)] mb-[var(--space-1)]",children:"Portal Name"}),(0,l.jsx)("input",{type:"text",className:"apple-input w-full bg-[var(--bg-secondary)] border border-[var(--separator)] rounded-[var(--radius-sm)] px-[10px] py-[6px] text-[length:var(--text-footnote)] text-[var(--text-primary)]",placeholder:"Jinn",value:ai,onChange:e=>ac(e.target.value),onBlur:()=>{ae(ai||null),g.F.completeOnboarding({portalName:ai||void 0}).catch(()=>{})}})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-[length:var(--text-caption1)] text-[var(--text-tertiary)] mb-[var(--space-1)]",children:"Portal Subtitle"}),(0,l.jsx)("input",{type:"text",className:"apple-input w-full bg-[var(--bg-secondary)] border border-[var(--separator)] rounded-[var(--radius-sm)] px-[10px] py-[6px] text-[length:var(--text-footnote)] text-[var(--text-primary)]",placeholder:"Command Centre",value:ad,onChange:e=>au(e.target.value),onBlur:()=>aa(ad||null)})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-[length:var(--text-caption1)] text-[var(--text-tertiary)] mb-[var(--space-1)]",children:"Operator Name"}),(0,l.jsx)("input",{type:"text",className:"apple-input w-full bg-[var(--bg-secondary)] border border-[var(--separator)] rounded-[var(--radius-sm)] px-[10px] py-[6px] text-[length:var(--text-footnote)] text-[var(--text-primary)]",placeholder:"Your Name",value:av,onChange:e=>ap(e.target.value),onBlur:()=>{at(av||null),g.F.completeOnboarding({operatorName:av||void 0}).catch(()=>{})}})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-[length:var(--text-caption1)] text-[var(--text-tertiary)] mb-[var(--space-1)]",children:"Portal Emoji"}),(0,l.jsx)("input",{type:"text",className:"apple-input w-[80px] text-center text-[length:var(--text-title2)] px-[8px] py-[6px] bg-[var(--bg-secondary)] border border-[var(--separator)] rounded-[var(--radius-sm)]",placeholder:"\ud83e\udd16",value:ax,onChange:e=>ah(e.target.value),onBlur:()=>al(ax||null)})]}),(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-[length:var(--text-caption1)] text-[var(--text-tertiary)] mb-[var(--space-1)]",children:"Language"}),(0,l.jsxs)("select",{value:ag,onChange:e=>am(e.target.value),onBlur:()=>{an(ag||"English"),g.F.completeOnboarding({language:ag||void 0}).catch(()=>{})},className:"w-full bg-[var(--bg-secondary)] border border-[var(--separator)] rounded-[var(--radius-sm)] px-[10px] py-[6px] text-[length:var(--text-footnote)] text-[var(--text-primary)] cursor-pointer",children:[(0,l.jsx)("option",{value:"English",children:"English"}),(0,l.jsx)("option",{value:"Spanish",children:"Spanish"}),(0,l.jsx)("option",{value:"French",children:"French"}),(0,l.jsx)("option",{value:"German",children:"German"}),(0,l.jsx)("option",{value:"Portuguese",children:"Portuguese"}),(0,l.jsx)("option",{value:"Italian",children:"Italian"}),(0,l.jsx)("option",{value:"Dutch",children:"Dutch"}),(0,l.jsx)("option",{value:"Russian",children:"Russian"}),(0,l.jsx)("option",{value:"Chinese",children:"Chinese"}),(0,l.jsx)("option",{value:"Japanese",children:"Japanese"}),(0,l.jsx)("option",{value:"Korean",children:"Korean"}),(0,l.jsx)("option",{value:"Arabic",children:"Arabic"}),(0,l.jsx)("option",{value:"Hindi",children:"Hindi"}),(0,l.jsx)("option",{value:"Bulgarian",children:"Bulgarian"})]})]})]})}),aA&&(0,l.jsx)("div",{className:"mb-[var(--space-4)] px-[var(--space-4)] py-[var(--space-3)] rounded-[var(--radius-md)] text-[length:var(--text-footnote)]",style:{background:"success"===aA.type?"rgba(34,197,94,0.1)":"rgba(239,68,68,0.1)",border:"1px solid ".concat("success"===aA.type?"rgba(34,197,94,0.3)":"rgba(239,68,68,0.3)"),color:"success"===aA.type?"var(--system-green)":"var(--system-red)"},children:aA.message}),aw?(0,l.jsxs)("div",{className:"text-center p-[var(--space-8)] text-[var(--text-tertiary)] text-[length:var(--text-footnote)]",children:[(0,l.jsx)(i,{size:20,className:"mx-auto mb-[var(--space-2)] animate-spin"}),"Loading gateway config..."]}):aC?(0,l.jsxs)("div",{className:"mb-[var(--space-6)] px-[var(--space-4)] py-[var(--space-3)] rounded-[var(--radius-md)] text-[length:var(--text-footnote)] text-[var(--system-red)]",style:{background:"rgba(239,68,68,0.1)",border:"1px solid rgba(239,68,68,0.3)"},children:["Failed to load config: ",aC]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(b,{title:"Gateway Configuration",children:[(0,l.jsx)(f,{label:"Port",children:(0,l.jsx)(j,{type:"number",value:String(null!=(eT=null==(a=aj.gateway)?void 0:a.port)?eT:""),onChange:e=>aO(["gateway","port"],Number(e)||0),placeholder:"7777"})}),(0,l.jsx)(f,{label:"Host",children:(0,l.jsx)(j,{value:null!=(eP=null==(t=aj.gateway)?void 0:t.host)?eP:"",onChange:e=>aO(["gateway","host"],e),placeholder:"127.0.0.1"})}),(0,l.jsx)(f,{label:"Default Engine",children:(0,l.jsx)(y,{value:null!=(eW=null==(s=aj.engines)?void 0:s.default)?eW:"claude",onChange:e=>aO(["engines","default"],e),options:[{value:"claude",label:"Claude"},{value:"codex",label:"Codex"}]})})]}),(0,l.jsxs)(b,{title:"Engine Configuration",children:[(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mb-[var(--space-2)]",children:"Claude"}),(0,l.jsx)(f,{label:"Binary Path",children:(0,l.jsx)(j,{value:null!=(eG=null==(k=aj.engines)||null==(N=k.claude)?void 0:N.bin)?eG:"",onChange:e=>aO(["engines","claude","bin"],e),placeholder:"claude"})}),(0,l.jsx)(f,{label:"Model",children:(0,l.jsx)(y,{value:null!=(eR=null==(F=aj.engines)||null==(S=F.claude)?void 0:S.model)?eR:"opus",onChange:e=>aO(["engines","claude","model"],e),options:[{value:"opus",label:"Opus (claude-opus-4-6)"},{value:"sonnet",label:"Sonnet (claude-sonnet-4-6)"},{value:"haiku",label:"Haiku (claude-haiku-4-5)"}]})}),(0,l.jsx)(f,{label:"Effort Level",children:(0,l.jsx)(y,{value:null!=(ez=null==(D=aj.engines)||null==(A=D.claude)?void 0:A.effortLevel)?ez:"default",onChange:e=>aO(["engines","claude","effortLevel"],e),options:[{value:"default",label:"Default"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"}]})}),(0,l.jsx)("div",{className:"border-t border-[var(--separator)] mt-[var(--space-3)] pt-[var(--space-3)]"}),(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mb-[var(--space-2)]",children:"Codex"}),(0,l.jsx)(f,{label:"Binary Path",children:(0,l.jsx)(j,{value:null!=(eH=null==(B=aj.engines)||null==(E=B.codex)?void 0:E.bin)?eH:"",onChange:e=>aO(["engines","codex","bin"],e),placeholder:"codex"})}),(0,l.jsx)(f,{label:"Model",children:(0,l.jsx)(y,{value:null!=(eU=null==(L=aj.engines)||null==(I=L.codex)?void 0:I.model)?eU:"gpt-5.4",onChange:e=>aO(["engines","codex","model"],e),options:[{value:"gpt-5.4",label:"GPT-5.4"},{value:"gpt-5.3-codex",label:"GPT-5.3 Codex"},{value:"gpt-5.2-codex",label:"GPT-5.2 Codex"},{value:"gpt-5.2",label:"GPT-5.2"},{value:"gpt-5.1-codex-max",label:"GPT-5.1 Codex Max"},{value:"gpt-5.1-codex-mini",label:"GPT-5.1 Codex Mini"}]})}),(0,l.jsx)(f,{label:"Effort Level",children:(0,l.jsx)(y,{value:null!=(eq=null==(O=aj.engines)||null==(M=O.codex)?void 0:M.effortLevel)?eq:"default",onChange:e=>aO(["engines","codex","effortLevel"],e),options:[{value:"default",label:"Default"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra High"}]})})]}),(0,l.jsxs)(b,{title:"Sessions",children:[(0,l.jsx)(f,{label:"Interrupt on New Message",children:(0,l.jsx)(w,{checked:null==(e_=null==(T=aj.sessions)?void 0:T.interruptOnNewMessage)||e_,onChange:e=>aO(["sessions","interruptOnNewMessage"],e)})}),(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] text-[var(--label-secondary)] mt-[4px]",children:"When enabled, sending a new message to a running session will stop the current agent and start processing your new message immediately. When disabled, messages are queued."}),(0,l.jsx)("div",{className:"border-t border-[var(--separator)] mt-[var(--space-3)] pt-[var(--space-3)]"}),(0,l.jsx)(f,{label:"When Claude Hits Usage Limit",children:(0,l.jsx)(y,{value:null!=(eV=null==(P=aj.sessions)?void 0:P.rateLimitStrategy)?eV:"fallback",onChange:e=>aO(["sessions","rateLimitStrategy"],e),options:[{value:"wait",label:"Wait & Auto-Resume"},{value:"fallback",label:"Switch to GPT (Codex)"}]})}),(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] text-[var(--label-secondary)] mt-[4px]",children:'"Wait" pauses the session and continues automatically when Claude resets. "Switch" answers immediately using GPT, then returns to Claude once the reset window passes.'})]}),(0,l.jsxs)(b,{title:"Connectors",children:[(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mb-[var(--space-2)]",children:"Slack"}),(0,l.jsx)(f,{label:"App Token",children:(0,l.jsx)(j,{type:"password",value:null!=(eJ=null==(G=aj.connectors)||null==(W=G.slack)?void 0:W.appToken)?eJ:"",onChange:e=>aO(["connectors","slack","appToken"],e),placeholder:"xapp-..."})}),(0,l.jsx)(f,{label:"Bot Token",children:(0,l.jsx)(j,{type:"password",value:null!=(eK=null==(z=aj.connectors)||null==(R=z.slack)?void 0:R.botToken)?eK:"",onChange:e=>aO(["connectors","slack","botToken"],e),placeholder:"xoxb-..."})}),(0,l.jsx)(f,{label:"Share Session in Channel",children:(0,l.jsx)(w,{checked:null!=(eQ=null==(U=aj.connectors)||null==(H=U.slack)?void 0:H.shareSessionInChannel)&&eQ,onChange:e=>aO(["connectors","slack","shareSessionInChannel"],e)})}),(0,l.jsx)(f,{label:"Allowed Users",children:(0,l.jsx)(j,{value:Array.isArray(null==(_=aj.connectors)||null==(q=_.slack)?void 0:q.allowFrom)?null==(K=aj.connectors)||null==(J=K.slack)||null==(V=J.allowFrom)?void 0:V.join(", "):null!=(eY=null==(Y=aj.connectors)||null==(Q=Y.slack)?void 0:Q.allowFrom)?eY:"",onChange:e=>aO(["connectors","slack","allowFrom"],e.trim()?e.split(",").map(e=>e.trim()).filter(Boolean):void 0),placeholder:"U123, U456"})}),(0,l.jsx)(f,{label:"Ignore Old Messages on Boot",children:(0,l.jsx)(w,{checked:null==(e$=null==(X=aj.connectors)||null==($=X.slack)?void 0:$.ignoreOldMessagesOnBoot)||e$,onChange:e=>aO(["connectors","slack","ignoreOldMessagesOnBoot"],e)})}),(0,l.jsx)("div",{className:"border-t border-[var(--separator)] mt-[var(--space-3)] pt-[var(--space-3)]"}),(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mb-[var(--space-2)]",children:"Discord"}),(0,l.jsx)(f,{label:"Bot Token",children:(0,l.jsx)(j,{type:"password",value:null!=(eX=null==(ee=aj.connectors)||null==(Z=ee.discord)?void 0:Z.botToken)?eX:"",onChange:e=>aO(["connectors","discord","botToken"],e),placeholder:"Bot token..."})}),(0,l.jsx)(f,{label:"Allow From",children:(0,l.jsx)(j,{value:Array.isArray(null==(et=aj.connectors)||null==(ea=et.discord)?void 0:ea.allowFrom)?null==(er=aj.connectors)||null==(en=er.discord)||null==(el=en.allowFrom)?void 0:el.join(", "):null!=(eZ=null==(eo=aj.connectors)||null==(es=eo.discord)?void 0:es.allowFrom)?eZ:"",onChange:e=>aO(["connectors","discord","allowFrom"],e.trim()?e.split(",").map(e=>e.trim()).filter(Boolean):void 0),placeholder:"User IDs, comma-separated (optional)"})}),(0,l.jsx)(f,{label:"Guild ID",children:(0,l.jsx)(j,{value:null!=(e0=null==(ec=aj.connectors)||null==(ei=ec.discord)?void 0:ei.guildId)?e0:"",onChange:e=>aO(["connectors","discord","guildId"],e.trim()||void 0),placeholder:"Server/Guild ID (optional)"})}),(0,l.jsx)(f,{label:"Channel ID",children:(0,l.jsx)(j,{value:null!=(e1=null==(eu=aj.connectors)||null==(ed=eu.discord)?void 0:ed.channelId)?e1:"",onChange:e=>aO(["connectors","discord","channelId"],e.trim()||void 0),placeholder:"Restrict to this channel (right-click → Copy Channel ID)"})}),(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mt-[var(--space-4)] mb-[var(--space-2)]",children:"WhatsApp"}),(0,l.jsx)("div",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)] mb-[var(--space-3)]",children:"On first start, scan the QR code below with your WhatsApp app to connect. Credentials are cached for subsequent runs."}),(0,l.jsx)(f,{label:"Auth Directory",children:(0,l.jsx)(j,{value:null!=(e2=null==(ep=aj.connectors)||null==(ev=ep.whatsapp)?void 0:ev.authDir)?e2:"",onChange:e=>aO(["connectors","whatsapp","authDir"],e.trim()||void 0),placeholder:"Default: ~/.jinn/.whatsapp-auth"})}),(0,l.jsx)(f,{label:"Allow From",children:(0,l.jsx)(j,{value:Array.isArray(null==(eh=aj.connectors)||null==(ex=eh.whatsapp)?void 0:ex.allowFrom)?null==(eb=aj.connectors)||null==(em=eb.whatsapp)||null==(eg=em.allowFrom)?void 0:eg.join(", "):"",onChange:e=>aO(["connectors","whatsapp","allowFrom"],e.trim()?e.split(",").map(e=>e.trim()).filter(Boolean):void 0),placeholder:"447700900000@s.whatsapp.net, ... (optional)"})}),aE&&(0,l.jsxs)("div",{className:"mt-[var(--space-3)] flex flex-col items-center gap-[var(--space-2)]",children:[(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] font-semibold text-[var(--text-secondary)]",children:"Scan with WhatsApp to connect"}),(0,l.jsx)("img",{src:aE,alt:"WhatsApp QR Code",className:"w-[200px] h-[200px] rounded-[var(--radius-md)] border border-[var(--separator)] bg-white p-[8px]"}),(0,l.jsx)("div",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)]",children:"Open WhatsApp → Linked Devices → Link a Device"})]}),(null==(ef=aj.connectors)?void 0:ef.whatsapp)&&"ok"===aI&&(0,l.jsx)("div",{className:"mt-[var(--space-2)] text-[length:var(--text-caption1)] text-[var(--system-green)] font-semibold",children:"✓ Connected"}),(0,l.jsx)("div",{className:"border-t border-[var(--separator)] mt-[var(--space-3)] pt-[var(--space-3)]"}),(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mb-[var(--space-2)]",children:"Web UI"}),(0,l.jsx)("div",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)]",children:"Web conversations use queued one-shot resume flow for both engines."})]}),(0,l.jsxs)(b,{title:"Cron",children:[(0,l.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mb-[var(--space-2)]",children:"Default Delivery"}),(0,l.jsx)("div",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)] mb-[var(--space-3)]",children:"When a cron job has no delivery configured, results will be sent here."}),(0,l.jsx)(f,{label:"Connector",children:(0,l.jsx)(y,{value:null!=(e4=null==(ey=aj.cron)||null==(ej=ey.defaultDelivery)?void 0:ej.connector)?e4:"",onChange:e=>aO(["cron","defaultDelivery","connector"],e||void 0),options:[{value:"",label:"None (fire & forget)"},{value:"web",label:"Web"},{value:"slack",label:"Slack"}]})}),(null==(eN=aj.cron)||null==(ew=eN.defaultDelivery)?void 0:ew.connector)&&(0,l.jsx)(f,{label:"Channel",children:(0,l.jsx)(j,{value:null!=(e3=null==(ek=aj.cron)||null==(eC=ek.defaultDelivery)?void 0:eC.channel)?e3:"",onChange:e=>aO(["cron","defaultDelivery","channel"],e),placeholder:"#general"})})]}),(0,l.jsxs)(b,{title:"Logging",children:[(0,l.jsx)(f,{label:"Level",children:(0,l.jsx)(y,{value:null!=(e6=null==(eS=aj.logging)?void 0:eS.level)?e6:"info",onChange:e=>aO(["logging","level"],e),options:[{value:"debug",label:"Debug"},{value:"info",label:"Info"},{value:"warn",label:"Warn"},{value:"error",label:"Error"}]})}),(0,l.jsx)(f,{label:"Stdout",children:(0,l.jsx)(w,{checked:null==(e5=null==(eF=aj.logging)?void 0:eF.stdout)||e5,onChange:e=>aO(["logging","stdout"],e)})}),(0,l.jsx)(f,{label:"File Logging",children:(0,l.jsx)(w,{checked:null!=(e8=null==(eA=aj.logging)?void 0:eA.file)&&e8,onChange:e=>aO(["logging","file"],e)})})]}),(0,l.jsx)(C,{}),(0,l.jsxs)("div",{className:"flex justify-end gap-[var(--space-3)] mb-[var(--space-6)]",children:[(0,l.jsxs)("button",{onClick:()=>aM(),className:"px-[var(--space-4)] py-[var(--space-2)] rounded-[var(--radius-md)] bg-[var(--fill-tertiary)] text-[var(--text-secondary)] border-none cursor-pointer text-[length:var(--text-footnote)] font-[var(--weight-medium)] inline-flex items-center gap-[6px]",children:[(0,l.jsx)(o,{size:14}),"Reload"]}),(0,l.jsxs)("button",{onClick:function(){aF(!0),aD(null),g.F.updateConfig(aj).then(()=>aD({type:"success",message:"Settings saved successfully"})).catch(e=>aD({type:"error",message:"Failed to save: ".concat(e.message)})).finally(()=>aF(!1))},disabled:aS,className:"px-[var(--space-5)] py-[var(--space-2)] rounded-[var(--radius-md)] bg-[var(--accent)] text-[var(--accent-contrast)] border-none text-[length:var(--text-footnote)] font-[var(--weight-semibold)] inline-flex items-center gap-[6px] transition-all duration-150 ease-[var(--ease-smooth)]",style:{cursor:aS?"wait":"pointer",opacity:aS?.7:1},children:[(0,l.jsx)(c,{size:14}),aS?"Saving...":"Save Config"]})]})]}),(0,l.jsx)(b,{title:"Reset",children:(0,l.jsxs)("div",{className:"flex items-center justify-center gap-[var(--space-3)] flex-wrap",children:[(0,l.jsxs)("button",{onClick:()=>{localStorage.removeItem("jinn-onboarded"),window.location.reload()},className:"px-[var(--space-5)] py-[var(--space-2)] rounded-[var(--radius-md)] bg-[var(--accent)] text-[var(--accent-contrast)] border-none cursor-pointer text-[length:var(--text-footnote)] font-[var(--weight-semibold)] transition-all duration-150 ease-[var(--ease-spring)] inline-flex items-center gap-[var(--space-2)]",children:[(0,l.jsx)(o,{size:14}),"Re-run Onboarding Wizard"]}),(0,l.jsxs)("button",{onClick:()=>{window.confirm("Reset all settings to defaults?")&&(localStorage.removeItem("jinn-settings"),localStorage.removeItem("jinn-theme"),ar(),window.location.reload())},className:"px-[var(--space-5)] py-[var(--space-2)] rounded-[var(--radius-md)] bg-[var(--system-red)] text-white border-none cursor-pointer text-[length:var(--text-footnote)] font-[var(--weight-semibold)] transition-all duration-150 ease-[var(--ease-spring)] inline-flex items-center gap-[var(--space-2)]",children:[(0,l.jsx)(d.A,{size:14}),"Reset All Settings"]})]})})]})})})}},2854:(e,a,t)=>{Promise.resolve().then(t.bind(t,1694))}},e=>{e.O(0,[625,51,155,192,344,144,358],()=>e(e.s=2854)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[501],{2864:(e,t,a)=>{Promise.resolve().then(a.bind(a,2886))},2886:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>h});var r=a(4130),l=a(7946),s=a(6654);let n={"&":"&","<":"<",">":">",'"':""","'":"'"},i=/[&<>"']/g,o=[{name:"h4",pattern:/^#### (.+)$/gm,replacement:'<h4 class="text-[15px] font-semibold" style="color:var(--text-primary);margin-top:1rem;margin-bottom:0.25rem">$1</h4>'},{name:"h3",pattern:/^### (.+)$/gm,replacement:'<h3 class="text-[17px] font-semibold" style="color:var(--text-primary);margin-top:1.25rem;margin-bottom:0.375rem">$1</h3>'},{name:"h2",pattern:/^## (.+)$/gm,replacement:'<h2 class="text-[22px] font-semibold" style="color:var(--text-primary);margin-top:1.5rem;margin-bottom:0.5rem;padding-bottom:0.25rem;border-bottom:1px solid var(--separator)">$1</h2>'},{name:"h1",pattern:/^# (.+)$/gm,replacement:'<h1 class="text-[28px] font-bold" style="color:var(--text-primary);margin-top:1rem;margin-bottom:0.75rem">$1</h1>'},{name:"bold",pattern:/\*\*(.+?)\*\*/g,replacement:'<strong class="font-semibold" style="color:var(--text-primary)">$1</strong>'},{name:"inline-code",pattern:/`([^`]+)`/g,replacement:'<code style="background:var(--fill-secondary);color:var(--accent);padding:2px 6px;border-radius:6px;font-size:13px;font-family:var(--font-mono)">$1</code>'},{name:"unordered-list",pattern:/^- (.+)$/gm,replacement:'<li class="ml-4 text-[15px] leading-[1.7] list-disc" style="color:var(--text-secondary)">$1</li>'},{name:"ordered-list",pattern:/^(\d+)\. (.+)$/gm,replacement:'<li class="ml-4 text-[15px] leading-[1.7] list-decimal" style="color:var(--text-secondary)">$2</li>'},{name:"paragraph-break",pattern:/\n{2,}/g,replacement:'</p><p class="mb-3" style="color:var(--text-secondary)">'},{name:"line-break",pattern:/\n/g,replacement:"<br/>"}];var c=a(7192),d=a(8565),x=a(3637),m=a(7632),p=a(6088),v=a(4722);function h(){var e,t;(0,d.i)([{label:"Skills"}]);let{settings:a}=(0,v.t0)(),h=null!=(e=a.portalName)?e:"Jinn",[g,u]=(0,l.useState)([]),[y,b]=(0,l.useState)(!0),[f,j]=(0,l.useState)(null),[N,k]=(0,l.useState)(null),[w,S]=(0,l.useState)(null),[$,C]=(0,l.useState)(!1),[_,E]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{s.F.getSkills().then(e=>u(e)).catch(e=>j(e.message)).finally(()=>b(!1))},[]),(0,r.jsx)(c.M,{children:(0,r.jsxs)("div",{className:"h-full overflow-y-auto p-[var(--space-6)]",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-[var(--space-6)]",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-[length:var(--text-title2)] font-[var(--weight-bold)] text-[var(--text-primary)] mb-[var(--space-1)]",children:"Skills"}),(0,r.jsx)("p",{className:"text-[length:var(--text-body)] text-[var(--text-tertiary)]",children:"Capabilities and learned behaviors"})]}),(0,r.jsx)("button",{onClick:()=>alert("To create a new skill, chat with ".concat(h," and ask to learn something new.")),className:"py-[var(--space-2)] px-[var(--space-4)] rounded-[var(--radius-md,12px)] text-[var(--accent)] border-none cursor-pointer text-[length:var(--text-body)] font-[var(--weight-medium)]",style:{background:"color-mix(in srgb, var(--accent) 12%, transparent)"},children:"+ Create Skill"})]}),f&&(0,r.jsxs)("div",{className:"mb-[var(--space-4)] rounded-[var(--radius-md,12px)] py-[var(--space-3)] px-[var(--space-4)] text-[length:var(--text-body)] text-[var(--system-red)]",style:{background:"color-mix(in srgb, var(--system-red) 10%, transparent)",border:"1px solid color-mix(in srgb, var(--system-red) 30%, transparent)"},children:["Failed to load skills: ",f]}),y?(0,r.jsx)("div",{className:"text-center p-[var(--space-8)] text-[var(--text-tertiary)] text-[length:var(--text-body)]",children:"Loading..."}):0!==g.length||f?(0,r.jsx)("div",{className:"grid grid-cols-[repeat(auto-fill,minmax(220px,1fr))] gap-[var(--space-4)]",children:g.map(e=>(0,r.jsx)(x.Zp,{className:"py-4 cursor-pointer transition-colors hover:border-[var(--accent)]",onClick:()=>{k(e),E(!0),C(!0),s.F.getSkill(e.name).then(e=>{S(e.content||e.skillMd||JSON.stringify(e,null,2))}).catch(()=>S("Failed to load skill content")).finally(()=>C(!1))},children:(0,r.jsxs)(x.Wu,{className:"flex flex-col gap-3",children:[(0,r.jsx)("div",{className:"w-10 h-10 rounded-[var(--radius-md,12px)] flex items-center justify-center text-[var(--system-yellow)]",style:{background:"color-mix(in srgb, var(--system-yellow) 12%, transparent)"},children:(0,r.jsx)(p.A,{size:20})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[length:var(--text-body)] font-[var(--weight-semibold)] text-[var(--text-primary)] mb-0.5",children:e.name}),(0,r.jsx)("p",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)] line-clamp-2",children:e.description||"No description"})]})]})},e.name))}):(0,r.jsx)(x.Zp,{children:(0,r.jsx)(x.Wu,{children:(0,r.jsxs)("div",{className:"text-center p-[var(--space-6)]",children:[(0,r.jsx)("p",{className:"text-[length:var(--text-body)] text-[var(--text-tertiary)]",children:"No skills yet"}),(0,r.jsxs)("p",{className:"text-[length:var(--text-caption1)] text-[var(--text-quaternary)] mt-[var(--space-1)]",children:["Chat with ",h," to teach new skills"]})]})})}),(0,r.jsx)(m.lG,{open:_,onOpenChange:e=>!e&&void(E(!1),k(null),S(null)),children:(0,r.jsxs)(m.Cf,{className:"sm:max-w-2xl max-h-[80vh] flex flex-col",children:[(0,r.jsxs)(m.c7,{children:[(0,r.jsx)(m.L3,{children:null!=(t=null==N?void 0:N.name)?t:"Skill"}),(0,r.jsx)(m.rr,{children:(null==N?void 0:N.description)||"Skill details"})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto py-[var(--space-2)]",children:$?(0,r.jsx)("p",{className:"text-[length:var(--text-body)] text-[var(--text-tertiary)]",children:"Loading..."}):w?(0,r.jsx)("div",{className:"text-[length:var(--text-body)] leading-[1.7] text-[var(--text-secondary)]",dangerouslySetInnerHTML:{__html:function(e,t){let a=e.replace(i,e=>n[e]);for(let e of o)a=a.replace(e.pattern,e.replacement);return a}(w)}}):null})]})})]})})}},3637:(e,t,a)=>{"use strict";a.d(t,{Wu:()=>n,Zp:()=>s});var r=a(4130);a(7946);var l=a(6063);function s(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card",className:(0,l.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...a})}function n(e){let{className:t,...a}=e;return(0,r.jsx)("div",{"data-slot":"card-content",className:(0,l.cn)("px-6",t),...a})}}},e=>{e.O(0,[625,51,155,192,344,144,358],()=>e(e.s=2864)),_N_E=e.O()}]);
|
package/dist/web/_next/static/chunks/{main-app-72a2d12a170701ef.js → main-app-637478e5d2259005.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[358],{556:()=>{},
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[358],{556:()=>{},2477:(e,s,n)=>{Promise.resolve().then(n.t.bind(n,1389,23)),Promise.resolve().then(n.t.bind(n,3538,23)),Promise.resolve().then(n.t.bind(n,6774,23)),Promise.resolve().then(n.t.bind(n,7115,23)),Promise.resolve().then(n.t.bind(n,1015,23)),Promise.resolve().then(n.t.bind(n,1475,23)),Promise.resolve().then(n.t.bind(n,3912,23)),Promise.resolve().then(n.t.bind(n,6862,23)),Promise.resolve().then(n.bind(n,1579))}},e=>{var s=s=>e(e.s=s);e.O(0,[344,144],()=>(s(2435),s(2477))),_N_E=e.O()}]);
|
package/dist/web/_next/static/chunks/{webpack-440561fa60ef8a8f.js → webpack-e7350efbcf65db9c.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={exports:{}},i=!0;try{e[o](a,a.exports,r),i=!1}finally{i&&delete t[o]}return a.exports}r.m=e,(()=>{var e=[];r.O=(t,o,n,a)=>{if(o){a=a||0;for(var i=e.length;i>0&&e[i-1][2]>a;i--)e[i]=e[i-1];e[i]=[o,n,a];return}for(var u=1/0,i=0;i<e.length;i++){for(var[o,n,a]=e[i],l=!0,c=0;c<o.length;c++)(!1&a||u>=a)&&Object.keys(r.O).every(e=>r.O[e](o[c]))?o.splice(c--,1):(l=!1,a<u&&(u=a));if(l){e.splice(i--,1);var d=n();void 0!==d&&(t=d)}}return t}})(),r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;r.t=function(o,n){if(1&n&&(o=this(o)),8&n||"object"==typeof o&&o&&(4&n&&o.__esModule||16&n&&"function"==typeof o.then))return o;var a=Object.create(null);r.r(a);var i={};e=e||[null,t({}),t([]),t(t)];for(var u=2&n&&o;"object"==typeof u&&!~e.indexOf(u);u=t(u))Object.getOwnPropertyNames(u).forEach(e=>i[e]=()=>o[e]);return i.default=()=>o,r.d(a,i),a}})(),r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((t,o)=>(r.f[o](e,t),t),[])),r.u=e=>"static/chunks/"+(763===e?"7273c211":e)+"."+({743:"588b42b673795913",763:"7ff69b7844551452",943:"1c6d37432bcad8e8"})[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="_N_E:";r.l=(o,n,a,i)=>{if(e[o])return void e[o].push(n);if(void 0!==a)for(var u,l,c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var
|
|
1
|
+
(()=>{"use strict";var e={},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={exports:{}},i=!0;try{e[o](a,a.exports,r),i=!1}finally{i&&delete t[o]}return a.exports}r.m=e,(()=>{var e=[];r.O=(t,o,n,a)=>{if(o){a=a||0;for(var i=e.length;i>0&&e[i-1][2]>a;i--)e[i]=e[i-1];e[i]=[o,n,a];return}for(var u=1/0,i=0;i<e.length;i++){for(var[o,n,a]=e[i],l=!0,c=0;c<o.length;c++)(!1&a||u>=a)&&Object.keys(r.O).every(e=>r.O[e](o[c]))?o.splice(c--,1):(l=!1,a<u&&(u=a));if(l){e.splice(i--,1);var d=n();void 0!==d&&(t=d)}}return t}})(),r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;r.t=function(o,n){if(1&n&&(o=this(o)),8&n||"object"==typeof o&&o&&(4&n&&o.__esModule||16&n&&"function"==typeof o.then))return o;var a=Object.create(null);r.r(a);var i={};e=e||[null,t({}),t([]),t(t)];for(var u=2&n&&o;"object"==typeof u&&!~e.indexOf(u);u=t(u))Object.getOwnPropertyNames(u).forEach(e=>i[e]=()=>o[e]);return i.default=()=>o,r.d(a,i),a}})(),r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((t,o)=>(r.f[o](e,t),t),[])),r.u=e=>"static/chunks/"+(763===e?"7273c211":e)+"."+({743:"588b42b673795913",763:"7ff69b7844551452",943:"1c6d37432bcad8e8"})[e]+".js",r.miniCssF=e=>{},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={},t="_N_E:";r.l=(o,n,a,i)=>{if(e[o])return void e[o].push(n);if(void 0!==a)for(var u,l,c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var f=c[d];if(f.getAttribute("src")==o||f.getAttribute("data-webpack")==t+a){u=f;break}}u||(l=!0,(u=document.createElement("script")).charset="utf-8",u.timeout=120,r.nc&&u.setAttribute("nonce",r.nc),u.setAttribute("data-webpack",t+a),u.src=r.tu(o)),e[o]=[n];var s=(t,r)=>{u.onerror=u.onload=null,clearTimeout(p);var n=e[o];if(delete e[o],u.parentNode&&u.parentNode.removeChild(u),n&&n.forEach(e=>e(r)),t)return t(r)},p=setTimeout(s.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=s.bind(null,u.onerror),u.onload=s.bind(null,u.onload),l&&document.head.appendChild(u)}})(),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:e=>e},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("nextjs#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="/_next/",(()=>{var e={68:0,930:0};r.f.j=(t,o)=>{var n=r.o(e,t)?e[t]:void 0;if(0!==n)if(n)o.push(n[2]);else if(/^(68|930)$/.test(t))e[t]=0;else{var a=new Promise((r,o)=>n=e[t]=[r,o]);o.push(n[2]=a);var i=r.p+r.u(t),u=Error();r.l(i,o=>{if(r.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var a=o&&("load"===o.type?"missing":o.type),i=o&&o.target&&o.target.src;u.message="Loading chunk "+t+" failed.\n("+a+": "+i+")",u.name="ChunkLoadError",u.type=a,u.request=i,n[1](u)}},"chunk-"+t,t)}},r.O.j=t=>0===e[t];var t=(t,o)=>{var n,a,[i,u,l]=o,c=0;if(i.some(t=>0!==e[t])){for(n in u)r.o(u,n)&&(r.m[n]=u[n]);if(l)var d=l(r)}for(t&&t(o);c<i.length;c++)a=i[c],r.o(e,a)&&e[a]&&e[a][0](),e[a]=0;return r.O(d)},o=self.webpackChunk_N_E=self.webpackChunk_N_E||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})(),r.nc=void 0})();
|