openryoko 2026.8.19 → 2026.8.21

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.
Files changed (106) hide show
  1. package/dist/bin/jimmy.js +9 -0
  2. package/dist/bin/jimmy.js.map +1 -1
  3. package/dist/package.json +1 -1
  4. package/dist/src/cli/api.d.ts +24 -0
  5. package/dist/src/cli/api.d.ts.map +1 -0
  6. package/dist/src/cli/api.js +66 -0
  7. package/dist/src/cli/api.js.map +1 -0
  8. package/dist/src/cli/gateway-audit.d.ts +14 -0
  9. package/dist/src/cli/gateway-audit.d.ts.map +1 -0
  10. package/dist/src/cli/gateway-audit.js +120 -0
  11. package/dist/src/cli/gateway-audit.js.map +1 -0
  12. package/dist/src/cli/migrate.d.ts +1 -0
  13. package/dist/src/cli/migrate.d.ts.map +1 -1
  14. package/dist/src/cli/migrate.js +22 -0
  15. package/dist/src/cli/migrate.js.map +1 -1
  16. package/dist/src/cli/pair.d.ts.map +1 -1
  17. package/dist/src/cli/pair.js +1 -8
  18. package/dist/src/cli/pair.js.map +1 -1
  19. package/dist/src/cli/status.d.ts.map +1 -1
  20. package/dist/src/cli/status.js +16 -4
  21. package/dist/src/cli/status.js.map +1 -1
  22. package/dist/src/gateway/host-guard.d.ts.map +1 -1
  23. package/dist/src/gateway/host-guard.js +1 -1
  24. package/dist/src/gateway/host-guard.js.map +1 -1
  25. package/dist/src/gateway/server.d.ts.map +1 -1
  26. package/dist/src/gateway/server.js +45 -6
  27. package/dist/src/gateway/server.js.map +1 -1
  28. package/dist/src/jobs/notify.d.ts +2 -0
  29. package/dist/src/jobs/notify.d.ts.map +1 -1
  30. package/dist/src/jobs/notify.js +8 -1
  31. package/dist/src/jobs/notify.js.map +1 -1
  32. package/dist/src/sessions/context.d.ts.map +1 -1
  33. package/dist/src/sessions/context.js +27 -20
  34. package/dist/src/sessions/context.js.map +1 -1
  35. package/dist/src/shared/gateway-url.d.ts +26 -0
  36. package/dist/src/shared/gateway-url.d.ts.map +1 -0
  37. package/dist/src/shared/gateway-url.js +41 -0
  38. package/dist/src/shared/gateway-url.js.map +1 -0
  39. package/dist/web/__next._head.txt +6 -0
  40. package/dist/web/__next._index.txt +6 -0
  41. package/dist/web/_next/static/UDwWEfKiZ-eIOpfOIPKQr/_buildManifest.js +11 -0
  42. package/dist/web/_next/static/UDwWEfKiZ-eIOpfOIPKQr/_clientMiddlewareManifest.js +1 -0
  43. package/dist/web/_next/static/UDwWEfKiZ-eIOpfOIPKQr/_ssgManifest.js +1 -0
  44. package/dist/web/_next/static/chunks/012aakl34ff5a.js +5 -0
  45. package/dist/web/_next/static/chunks/03~yq9q893hmn.js +1 -0
  46. package/dist/web/_next/static/chunks/0a2uy1kw.~j~c.js +1 -0
  47. package/dist/web/_next/static/chunks/0agxgztb0b~.7.js +5 -0
  48. package/dist/web/_next/static/chunks/0dtbl8648b3u9.js +7 -0
  49. package/dist/web/_next/static/chunks/0e3pdjkorr5zl.js +2 -0
  50. package/dist/web/_next/static/chunks/0ewpxy-mzj3j3.js +1 -0
  51. package/dist/web/_next/static/chunks/0g6xt.91k~0bc.js +5 -0
  52. package/dist/web/_next/static/chunks/0jm3e~uc~qd~p.js +79 -0
  53. package/dist/web/_next/static/chunks/0jzw1gpuag8bc.js +5 -0
  54. package/dist/web/_next/static/chunks/0lkp92-ovteta.js +5 -0
  55. package/dist/web/_next/static/chunks/0lt7kv1k1jla0.js +1 -0
  56. package/dist/web/_next/static/chunks/0msmlzd_~uk0y.js +5 -0
  57. package/dist/web/_next/static/chunks/0ru56x83x4rkk.js +1 -0
  58. package/dist/web/_next/static/chunks/0tcvgwr3rcw29.js +1 -0
  59. package/dist/web/_next/static/chunks/0tf9kpygstdls.js +1 -0
  60. package/dist/web/_next/static/chunks/0y3dnnq~kxyz_.js +1 -0
  61. package/dist/web/_next/static/chunks/0~6m1p5hnsx2f.js +1 -0
  62. package/dist/web/_next/static/chunks/10-liamt-ipcu.js +1 -0
  63. package/dist/web/_next/static/chunks/103zsy0q9psfj.css +1 -0
  64. package/dist/web/_next/static/chunks/10l08hq.acixl.js +5 -0
  65. package/dist/web/_next/static/chunks/11rbefjn.e-3-.js +1 -0
  66. package/dist/web/_next/static/chunks/11rodb4s1x4of.js +1 -0
  67. package/dist/web/_next/static/chunks/12_uxtnrqhoo1.js +1 -0
  68. package/dist/web/_next/static/chunks/12m97bwrg1tuu.js +5 -0
  69. package/dist/web/_next/static/chunks/13juizw904g.e.js +1 -0
  70. package/dist/web/_next/static/chunks/14ge_q22f0n.f.js +1 -0
  71. package/dist/web/_next/static/chunks/17-u9c_weg12-.js +31 -0
  72. package/dist/web/_next/static/chunks/17oc2l.ekcs8b.css +1 -0
  73. package/dist/web/_next/static/chunks/turbopack-0dt987bw_1nyf.js +1 -0
  74. package/dist/web/_next/static/media/apple-icon.0.wpl4.d-5bkf.jpg +0 -0
  75. package/dist/web/_next/static/media/icon.0.wpl4.d-5bkf.jpg +0 -0
  76. package/dist/web/_not-found/__next._head.txt +6 -0
  77. package/dist/web/_not-found/__next._index.txt +6 -0
  78. package/dist/web/_not-found/__next._not-found.txt +5 -0
  79. package/dist/web/chat/__next._head.txt +6 -0
  80. package/dist/web/chat/__next._index.txt +6 -0
  81. package/dist/web/chat/__next.chat.txt +5 -0
  82. package/dist/web/cron/__next._head.txt +6 -0
  83. package/dist/web/cron/__next._index.txt +6 -0
  84. package/dist/web/cron/__next.cron.txt +5 -0
  85. package/dist/web/kanban/__next._head.txt +6 -0
  86. package/dist/web/kanban/__next._index.txt +6 -0
  87. package/dist/web/kanban/__next.kanban.txt +5 -0
  88. package/dist/web/logs/__next._head.txt +6 -0
  89. package/dist/web/logs/__next._index.txt +6 -0
  90. package/dist/web/logs/__next.logs.txt +5 -0
  91. package/dist/web/org/__next._head.txt +6 -0
  92. package/dist/web/org/__next._index.txt +6 -0
  93. package/dist/web/org/__next.org.txt +5 -0
  94. package/dist/web/sessions/__next._head.txt +6 -0
  95. package/dist/web/sessions/__next._index.txt +6 -0
  96. package/dist/web/sessions/__next.sessions.txt +5 -0
  97. package/dist/web/settings/__next._head.txt +6 -0
  98. package/dist/web/settings/__next._index.txt +6 -0
  99. package/dist/web/settings/__next.settings.txt +5 -0
  100. package/dist/web/skills/__next._head.txt +6 -0
  101. package/dist/web/skills/__next._index.txt +6 -0
  102. package/dist/web/skills/__next.skills.txt +5 -0
  103. package/package.json +1 -1
  104. package/template/config.default.yaml +4 -1
  105. package/template/migrations/2026.8.20/MIGRATION.md +46 -0
  106. package/template/skills/sync/SKILL.md +5 -5
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,15857,e=>{"use strict";var a=e.i(98181),t=e.i(25007),r=e.i(90922);let n=(0,r.default)("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"}]]);var s=e.i(38524),l=e.i(40765);let o=(0,r.default)("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"}]]),c=(0,r.default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);var i=e.i(58843),d=e.i(36668),p=e.i(11322),x=e.i(13765),v=e.i(65390),h=e.i(93716),u=e.i(52053);let m=[{value:"claude-opus-5",label:"Opus 5 — 上(最上位 / 既定 / claude-opus-5)"},{value:"claude-opus-4-8",label:"Opus 4.8 — 旧世代(ピン留め用 / claude-opus-4-8)"},{value:"opus",label:"Opus — CLI が解決する最新 Opus に自動追従"},{value:"sonnet",label:"Sonnet 5 — 中(バランス / claude-sonnet-5)"},{value:"haiku",label:"Haiku 4.5 — 小(軽量・高速 / claude-haiku-4-5)"}],g=[{value:"gpt-5.6-sol",label:"GPT-5.6 Sol — 上(フラッグシップ / 既定)"},{value:"gpt-5.6-terra",label:"GPT-5.6 Terra — 中(バランス・低コスト)"},{value:"gpt-5.6-luna",label:"GPT-5.6 Luna — 小(最速・最安 / トリアージ向け)"},{value:"gpt-5.5",label:"GPT-5.5"},{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"},{value:"gpt-5-nano",label:"GPT-5 nano — 軽量(トリアージ向け)"}];function b(e){return"claude"===e?m:g}function j(e,a){return!a||e.some(e=>e.value===a)?e:[...e,{value:a,label:`${a}(現在の設定)`}]}let y=[{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 f({title:e,children:t}){return(0,a.jsxs)("section",{className:"mb-[var(--space-6)]",children:[(0,a.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:e}),(0,a.jsx)("div",{className:"bg-[var(--material-regular)] rounded-[var(--radius-md)] border border-[var(--separator)] p-[var(--space-4)]",children:t})]})}function k({label:e,children:t}){return(0,a.jsxs)("div",{className:"flex items-center justify-between py-[var(--space-2)] gap-[var(--space-4)]",children:[(0,a.jsx)("label",{className:"text-[length:var(--text-subheadline)] text-[var(--text-secondary)] shrink-0",children:e}),(0,a.jsx)("div",{className:"w-[240px] shrink-0",children:t})]})}function w({value:e,onChange:t,type:r="text",placeholder:n}){return(0,a.jsx)("input",{type:r,value:e,onChange:e=>t(e.target.value),placeholder:n,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 C({value:e,onChange:t,options:r}){return(0,a.jsx)("select",{value:e,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:r.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))})}function N({checked:e,onChange:t}){return(0,a.jsx)("button",{role:"switch","aria-checked":e,onClick:()=>t(!e),className:"w-[44px] h-[24px] rounded-[12px] border-none cursor-pointer relative shrink-0 transition-[background] duration-200 ease-[var(--ease-smooth)]",style:{background:e?"var(--system-green)":"var(--fill-primary)"},children:(0,a.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:e?22:2}})})}let S={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 T(){let[e,r]=(0,t.useState)(null),[n,s]=(0,t.useState)(!1),[l,o]=(0,t.useState)("");if((0,t.useEffect)(()=>{h.api.sttStatus().then(r).catch(()=>{})},[]),(0,t.useEffect)(()=>{if(!e?.downloading)return;let a=setInterval(()=>{h.api.sttStatus().then(r).catch(()=>{})},1500);return()=>clearInterval(a)},[e?.downloading]),!e)return null;let c=Object.entries(S).filter(([a])=>!e.languages.includes(a)).sort((e,a)=>e[1].localeCompare(a[1]));return(0,a.jsxs)(f,{title:"音声入力",children:[(0,a.jsxs)("div",{className:"flex items-center gap-[var(--space-3)] mb-[var(--space-4)]",children:[(0,a.jsx)("div",{className:"w-[8px] h-[8px] rounded-full shrink-0",style:{background:e.available?"var(--system-green)":"var(--system-red)"}}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("div",{className:"text-[length:var(--text-subheadline)] font-[var(--weight-medium)] text-[var(--text-primary)]",children:e.available?`Whisper ${(e.model||"small").charAt(0).toUpperCase()+(e.model||"small").slice(1)}`:"No model installed"}),(0,a.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,a.jsx)("button",{onClick:function(){h.api.sttDownload().then(()=>r(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,a.jsxs)("div",{className:"mb-[var(--space-4)]",children:[(0,a.jsxs)("div",{className:"flex justify-between mb-[var(--space-2)] text-[length:var(--text-caption1)] text-[var(--text-tertiary)]",children:[(0,a.jsx)("span",{children:"モデルをダウンロード中…"}),(0,a.jsxs)("span",{children:[e.progress,"%"]})]}),(0,a.jsx)("div",{className:"h-[6px] rounded-[3px] bg-[var(--fill-tertiary)] overflow-hidden",children:(0,a.jsx)("div",{className:"h-full rounded-[3px] bg-[var(--accent)] transition-[width] duration-300 ease-out",style:{width:`${e.progress}%`}})})]}),e.available&&(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"border-t border-[var(--separator)] mt-[var(--space-2)] pt-[var(--space-3)]",children:[(0,a.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mb-[var(--space-2)]",children:"文字起こし言語"}),(0,a.jsx)("div",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)] mb-[var(--space-3)]",children:"最初の言語がデフォルトになります。複数追加するとチャットで言語ピッカーが表示されます。"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-[var(--space-2)] mb-[var(--space-3)]",children:e.languages.map(t=>(0,a.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,a.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:t}),S[t]||t,e.languages.length>1&&(0,a.jsx)("button",{onClick:()=>(function(a){if(!e||e.languages.length<=1)return;let t=e.languages.filter(e=>e!==a);s(!0),h.api.sttUpdateConfig(t).then(()=>r(e=>e?{...e,languages:t}:e)).catch(()=>{}).finally(()=>s(!1))})(t),disabled:n,"aria-label":`Remove ${S[t]||t}`,className:"bg-none border-none cursor-pointer p-0 ml-[2px] text-[var(--text-quaternary)] text-[14px] leading-none flex items-center",children:"×"})]},t))}),(0,a.jsxs)("div",{className:"flex gap-[var(--space-2)]",children:[(0,a.jsxs)("select",{value:l,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:l?"var(--text-primary)":"var(--text-tertiary)"},children:[(0,a.jsx)("option",{value:"",children:"言語を追加…"}),c.map(([e,t])=>(0,a.jsxs)("option",{value:e,children:[e.toUpperCase()," — ",t]},e))]}),(0,a.jsx)("button",{onClick:function(){if(!l||!e||e.languages.includes(l))return;let a=[...e.languages,l];s(!0),o(""),h.api.sttUpdateConfig(a).then(()=>r(e=>e?{...e,languages:a}:e)).catch(()=>{}).finally(()=>s(!1))},disabled:!l||n,className:"px-[14px] py-[6px] rounded-[var(--radius-sm)] border-none text-[length:var(--text-footnote)] font-[var(--weight-semibold)] shrink-0",style:{background:l?"var(--accent)":"var(--fill-tertiary)",color:l?"var(--accent-contrast)":"var(--text-quaternary)",cursor:l?"pointer":"default"},children:"Add"})]})]})})]})}function E(){let e,{settings:r}=(0,d.useSettings)(),[n,s]=(0,t.useState)(!1),[l,o]=(0,t.useState)(!0),c=JSON.stringify({display_information:{name:e=(r.portalName??"").trim()||"Ryoko"},features:{app_home:{messages_tab_enabled:!0,messages_tab_read_only_enabled:!1},bot_user:{display_name:e,always_online:!0},assistant_view:{assistant_description:`${e} — your AI assistant`,suggested_prompts:[{title:"What can you do?",message:"What can you help me with?"}]}},oauth_config:{scopes:{bot:["app_mentions:read","assistant:write","canvases:read","canvases:write","channels:history","channels:read","chat:write","chat:write.customize","files:read","files:write","groups:history","groups:read","im:history","im:read","im:write","mpim:history","mpim:read","mpim:write","reactions:read","reactions:write","users:read","users:read.email"],user:["channels:history","channels:read","files:read","groups:history","groups:read","im:history","im:read","mpim:history","mpim:read","search:read","users:read","bookmarks:read"]}},settings:{event_subscriptions:{bot_events:["app_mention","assistant_thread_context_changed","assistant_thread_started","message.channels","message.groups","message.im","message.mpim","reaction_added"]},socket_mode_enabled:!0}},null,2);return(0,a.jsxs)("div",{className:"border border-[var(--separator)] rounded-[var(--radius-md)] bg-[var(--fill-quaternary)] p-[var(--space-3)] mb-[var(--space-3)]",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>o(e=>!e),className:"flex items-center justify-between w-full text-left cursor-pointer",children:[(0,a.jsx)("span",{className:"text-[length:var(--text-body)] font-[var(--weight-semibold)] text-[var(--text-primary)]",children:"Slack App セットアップガイド"}),(0,a.jsx)("span",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)]",children:l?"閉じる":"開く"})]}),l&&(0,a.jsxs)("div",{className:"mt-[var(--space-3)]",children:[(0,a.jsxs)("ol",{className:"list-decimal pl-[20px] text-[length:var(--text-caption1)] text-[var(--label-secondary)] leading-relaxed mb-[var(--space-3)] space-y-[2px]",children:[(0,a.jsxs)("li",{children:[(0,a.jsx)("a",{href:"https://api.slack.com/apps",target:"_blank",rel:"noopener noreferrer",className:"text-[var(--accent)] underline",children:"Slack API の Your Apps ページ"}),"を開き、「Create New App」を選択。"]}),(0,a.jsx)("li",{children:"「From a manifest」を選び、対象ワークスペースを指定。"}),(0,a.jsx)("li",{children:"下のJSONをコピーして貼り付け、「Create」で作成。"}),(0,a.jsxs)("li",{children:["「Install to Workspace」を実行し、OAuth & Permissions の「Bot User OAuth Token」(",(0,a.jsx)("code",{children:"xoxb-…"}),")を下の Bot Token に貼り付け。"]}),(0,a.jsxs)("li",{children:["「Basic Information」→「App-Level Tokens」で ",(0,a.jsx)("code",{children:"connections:write"})," ","スコープ付きトークンを発行し(",(0,a.jsx)("code",{children:"xapp-…"}),")、下の App Token に貼り付け。"]})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("button",{type:"button",onClick:function(){navigator.clipboard.writeText(c).then(()=>{s(!0),setTimeout(()=>s(!1),1500)})},"aria-label":"Copy manifest JSON",className:"absolute top-2 right-2 py-0.5 px-2 text-[11px] rounded-[var(--radius-sm)] bg-[var(--fill-secondary)] text-[var(--text-secondary)] border border-[var(--separator)] cursor-pointer",children:n?"コピー済み":"コピー"}),(0,a.jsx)("pre",{className:"bg-[var(--fill-tertiary)] border border-[var(--separator)] rounded-[var(--radius-md)] py-[var(--space-3)] px-[var(--space-4)] overflow-x-auto text-[12px] leading-normal font-['SF_Mono',Menlo,monospace] text-[var(--text-primary)] max-h-[280px]",children:(0,a.jsx)("code",{children:c})})]})]})]})}e.s(["default",0,function(){(0,p.useBreadcrumbs)([{label:"Settings"}]);let{settings:e,setAccentColor:r,setPortalName:S,setPortalSubtitle:A,setOperatorName:I,setPortalEmoji:F,setLanguage:B,resetAll:D}=(0,d.useSettings)(),{theme:M,setTheme:P}=(0,x.useTheme)(),[O,_]=(0,t.useState)(e.portalName??""),[L,G]=(0,t.useState)(e.portalSubtitle??""),[R,$]=(0,t.useState)(e.operatorName??""),[W,H]=(0,t.useState)(e.portalEmoji??""),[U,z]=(0,t.useState)(e.language??"English"),[q,J]=(0,t.useState)(e.accentColor??""),[V,K]=(0,t.useState)(!1),[Y,Q]=(0,t.useState)({}),[X,Z]=(0,t.useState)(!0),[ee,ea]=(0,t.useState)(null),[et,er]=(0,t.useState)(!1),[en,es]=(0,t.useState)(null),[el,eo]=(0,t.useState)(null),[ec,ei]=(0,t.useState)("unknown"),[ed,ep]=(0,t.useState)([]),[ex,ev]=(0,t.useState)(null),[eh,eu]=(0,t.useState)(!1),[em,eg]=(0,t.useState)(null);(0,t.useEffect)(()=>{h.api.getOrg().then(e=>{e?.employees&&ep(e.employees.map(e=>"string"==typeof e?{name:e,displayName:e}:{name:e.name,displayName:e.displayName||e.name}))}).catch(()=>{})},[]);let eb=async()=>{eu(!0),eg(null);try{let e=await fetch("/api/connectors/slack/channels"),a=await e.json();if(a?.ok)ev(a.channels??[]);else{let t=a?.error||`HTTP ${e.status}`;"missing_scope"===t?eg("Bot に canvases / channels scope が足りません。上のSlack App Manifestを貼り直して再インストールしてください。"):"slack_not_configured"===t?eg("Slack コネクタが未起動です。先に Bot Token / App Token を保存して再起動してください。"):eg(`チャンネル取得失敗: ${t}`),ev(null)}}catch(e){eg(e instanceof Error?e.message:String(e)),ev(null)}finally{eu(!1)}};function ej(){Z(!0),h.api.getConfig().then(e=>{Q(e),ea(null)}).catch(e=>ea(e.message)).finally(()=>Z(!1))}function ey(e,a){Q(t=>{let r=structuredClone(t),n=r;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,r})}return(0,t.useEffect)(()=>{_(e.portalName??""),G(e.portalSubtitle??""),$(e.operatorName??""),H(e.portalEmoji??""),z(e.language??"English"),J(e.accentColor??"")},[e.portalName,e.portalSubtitle,e.operatorName,e.portalEmoji,e.language,e.accentColor]),(0,t.useEffect)(()=>{ej()},[]),(0,t.useEffect)(()=>{if(!Y.connectors?.whatsapp)return;let e=!1;async function a(){try{let a=await fetch("/api/status"),t=await a.json(),r=t?.connectors?.whatsapp?.status;if(e||ei(r??"unknown"),"qr_pending"===r){let a=await fetch("/api/connectors/whatsapp/qr"),t=await a.json();e||eo(t.qr)}else e||eo(null)}catch{}}a();let t=setInterval(()=>{a()},1e4);return()=>{e=!0,clearInterval(t)}},[Y.connectors?.whatsapp]),(0,a.jsx)(i.PageLayout,{children:(0,a.jsx)("div",{className:"h-full overflow-y-auto bg-[var(--bg)]",children:(0,a.jsxs)("div",{className:"max-w-[640px] mx-auto px-[var(--space-4)] py-[var(--space-6)] pb-[var(--space-12)]",children:[(0,a.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,a.jsxs)(f,{title:"外観",children:[(0,a.jsx)("div",{className:"text-[length:var(--text-footnote)] font-[var(--weight-medium)] text-[var(--text-secondary)] mb-[var(--space-2)]",children:"Theme"}),(0,a.jsx)("div",{className:"grid grid-cols-5 gap-[var(--space-2)] mb-[var(--space-4)]",children:v.THEMES.map(e=>{let t=M===e.id;return(0,a.jsxs)("button",{onClick:()=>P(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:t?"2px solid var(--accent)":"2px solid var(--separator)"},children:[(0,a.jsx)("span",{className:"text-[24px]",children:e.emoji}),(0,a.jsx)("span",{className:"text-[length:var(--text-caption2)]",style:{fontWeight:t?"var(--weight-semibold)":"var(--weight-medium)",color:t?"var(--accent)":"var(--text-secondary)"},children:e.label})]},e.id)})}),(0,a.jsx)("div",{className:"text-[length:var(--text-footnote)] font-[var(--weight-medium)] text-[var(--text-secondary)] mb-[var(--space-2)]",children:"Accent Color"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-[var(--space-2)] mb-[var(--space-3)]",children:y.map(t=>{let n=e.accentColor===t.value;return(0,a.jsx)("button",{onClick:()=>r(t.value),"aria-label":t.label,title:t.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:t.value,border:n?"2px solid var(--text-primary)":"2px solid transparent",outline:n?`2px solid ${t.value}`:"none",outlineOffset:2},children:n&&(0,a.jsx)(l.Check,{size:14,color:"#fff",strokeWidth:3})},t.value)})}),(0,a.jsxs)("div",{className:"flex items-center gap-[var(--space-3)]",children:[(0,a.jsxs)("label",{className:"flex items-center gap-[var(--space-2)] text-[length:var(--text-footnote)] text-[var(--text-secondary)] cursor-pointer",children:["Custom:",(0,a.jsx)("input",{type:"color",value:e.accentColor??"#3B82F6",onChange:e=>r(e.target.value),className:"w-[28px] h-[28px] border-none rounded-full cursor-pointer bg-transparent p-0"})]}),(0,a.jsx)("input",{type:"text",placeholder:"#3B82F6",value:q,onChange:e=>{J(e.target.value),/^#[0-9a-fA-F]{6}$/.test(e.target.value)&&r(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"}),e.accentColor&&(0,a.jsxs)("button",{onClick:()=>r(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,a.jsx)(n,{size:12}),"リセット"]})]})]}),(0,a.jsx)(f,{title:"COO絵文字",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)] mb-[var(--space-3)]",children:"サイドバーに表示される COO の絵文字を選択してください。"}),(0,a.jsxs)("div",{className:"relative flex items-center gap-[var(--space-4)]",children:[(0,a.jsx)("button",{onClick:()=>K(!V),className:"text-4xl cursor-pointer bg-transparent border-none p-0",children:e.portalEmoji??"🧞"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-[length:var(--text-body)] font-[var(--weight-semibold)] text-[var(--text-primary)]",children:e.operatorName||"Jimbo"}),(0,a.jsx)("div",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)]",children:"絵文字をクリックして変更"})]}),V&&(0,a.jsx)(u.EmojiPicker,{current:e.portalEmoji??"🧞",onSelect:e=>{F(e),K(!1)},onClose:()=>K(!1)})]})]})}),(0,a.jsx)(f,{title:"ブランディング",children:(0,a.jsxs)("div",{className:"flex flex-col gap-[var(--space-3)]",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-[length:var(--text-caption1)] text-[var(--text-tertiary)] mb-[var(--space-1)]",children:"Portal Name"}),(0,a.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:O,onChange:e=>_(e.target.value),onBlur:()=>{S(O||null),h.api.completeOnboarding({portalName:O||void 0}).catch(()=>{})}})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-[length:var(--text-caption1)] text-[var(--text-tertiary)] mb-[var(--space-1)]",children:"Portal Subtitle"}),(0,a.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:L,onChange:e=>G(e.target.value),onBlur:()=>A(L||null)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-[length:var(--text-caption1)] text-[var(--text-tertiary)] mb-[var(--space-1)]",children:"Operator Name"}),(0,a.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:R,onChange:e=>$(e.target.value),onBlur:()=>{I(R||null),h.api.completeOnboarding({operatorName:R||void 0}).catch(()=>{})}})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-[length:var(--text-caption1)] text-[var(--text-tertiary)] mb-[var(--space-1)]",children:"Portal Emoji"}),(0,a.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\\uddde",value:W,onChange:e=>H(e.target.value),onBlur:()=>F(W||null)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-[length:var(--text-caption1)] text-[var(--text-tertiary)] mb-[var(--space-1)]",children:"Language"}),(0,a.jsxs)("select",{value:U,onChange:e=>z(e.target.value),onBlur:()=>{B(U||"English"),h.api.completeOnboarding({language:U||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,a.jsx)("option",{value:"English",children:"English"}),(0,a.jsx)("option",{value:"Spanish",children:"Spanish"}),(0,a.jsx)("option",{value:"French",children:"French"}),(0,a.jsx)("option",{value:"German",children:"German"}),(0,a.jsx)("option",{value:"Portuguese",children:"Portuguese"}),(0,a.jsx)("option",{value:"Italian",children:"Italian"}),(0,a.jsx)("option",{value:"Dutch",children:"Dutch"}),(0,a.jsx)("option",{value:"Russian",children:"Russian"}),(0,a.jsx)("option",{value:"Chinese",children:"Chinese"}),(0,a.jsx)("option",{value:"Japanese",children:"Japanese"}),(0,a.jsx)("option",{value:"Korean",children:"Korean"}),(0,a.jsx)("option",{value:"Arabic",children:"Arabic"}),(0,a.jsx)("option",{value:"Hindi",children:"Hindi"}),(0,a.jsx)("option",{value:"Bulgarian",children:"Bulgarian"})]})]})]})}),en&&(0,a.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"===en.type?"rgba(34,197,94,0.1)":"rgba(239,68,68,0.1)",border:`1px solid ${"success"===en.type?"rgba(34,197,94,0.3)":"rgba(239,68,68,0.3)"}`,color:"success"===en.type?"var(--system-green)":"var(--system-red)"},children:en.message}),X?(0,a.jsxs)("div",{className:"text-center p-[var(--space-8)] text-[var(--text-tertiary)] text-[length:var(--text-footnote)]",children:[(0,a.jsx)(c,{size:20,className:"mx-auto mb-[var(--space-2)] animate-spin"}),"Loading gateway config..."]}):ee?(0,a.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: ",ee]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(f,{title:"ゲートウェイ設定",children:[(0,a.jsx)(k,{label:"Port",children:(0,a.jsx)(w,{type:"number",value:String(Y.gateway?.port??""),onChange:e=>ey(["gateway","port"],Number(e)||0),placeholder:"7777"})}),(0,a.jsx)(k,{label:"Host",children:(0,a.jsx)(w,{value:Y.gateway?.host??"",onChange:e=>ey(["gateway","host"],e),placeholder:"127.0.0.1"})}),(0,a.jsx)(k,{label:"Default Engine",children:(0,a.jsx)(C,{value:Y.engines?.default??"claude",onChange:e=>ey(["engines","default"],e),options:[{value:"claude",label:"Claude"},{value:"codex",label:"Codex"}]})})]}),(0,a.jsxs)(f,{title:"エンジン設定",children:[(0,a.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mb-[var(--space-2)]",children:"Claude"}),(0,a.jsx)(k,{label:"Binary Path",children:(0,a.jsx)(w,{value:Y.engines?.claude?.bin??"",onChange:e=>ey(["engines","claude","bin"],e),placeholder:"claude"})}),(0,a.jsx)(k,{label:"Model",children:(0,a.jsx)(C,{value:Y.engines?.claude?.model??"claude-opus-5",onChange:e=>ey(["engines","claude","model"],e),options:j(m,Y.engines?.claude?.model)})}),(0,a.jsx)(k,{label:"Effort Level",children:(0,a.jsx)(C,{value:Y.engines?.claude?.effortLevel??"default",onChange:e=>ey(["engines","claude","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,a.jsx)(k,{label:"インタラクティブPTY(Max定額)",children:(0,a.jsx)(N,{checked:Y.engines?.claude?.interactive??!1,onChange:e=>ey(["engines","claude","interactive"],e)})}),(0,a.jsxs)("div",{className:"text-[length:var(--text-caption1)] text-[var(--label-secondary)] mt-[4px]",children:["有効にすると Claude の作業ターンを PTY(cc_entrypoint=cli)で実行します。 Claude CLI が Max サブスクリプションでログイン済みなら、API 従量課金ではなく Max 側の利用枠で実行されます。 SSH リモート実行の従業員は headless ",(0,a.jsx)("code",{children:"claude -p"})," にフォールバックします。",(0,a.jsx)("strong",{children:"変更の反映にはゲートウェイの再起動が必要です"}),"(保存後に ",(0,a.jsx)("code",{children:"ryoko stop && ryoko start"})," など)。"]}),(0,a.jsx)("div",{className:"border-t border-[var(--separator)] mt-[var(--space-3)] pt-[var(--space-3)]"}),(0,a.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mb-[var(--space-2)]",children:"Codex"}),(0,a.jsx)(k,{label:"Binary Path",children:(0,a.jsx)(w,{value:Y.engines?.codex?.bin??"",onChange:e=>ey(["engines","codex","bin"],e),placeholder:"codex"})}),(0,a.jsx)(k,{label:"Model",children:(0,a.jsx)(C,{value:Y.engines?.codex?.model??"gpt-5.6-sol",onChange:e=>ey(["engines","codex","model"],e),options:j(g,Y.engines?.codex?.model)})}),(0,a.jsx)(k,{label:"Effort Level",children:(0,a.jsx)(C,{value:Y.engines?.codex?.effortLevel??"default",onChange:e=>ey(["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,a.jsxs)(f,{title:"セッション",children:[(0,a.jsx)(k,{label:"新規メッセージで中断",children:(0,a.jsx)(N,{checked:Y.sessions?.interruptOnNewMessage??!0,onChange:e=>ey(["sessions","interruptOnNewMessage"],e)})}),(0,a.jsx)("div",{className:"text-[length:var(--text-caption1)] text-[var(--label-secondary)] mt-[4px]",children:"有効にすると、実行中のセッションに新しいメッセージを送ると現在のエージェントを停止し、 すぐに新しいメッセージの処理を開始します。無効時はメッセージはキューに入ります。"}),(0,a.jsx)("div",{className:"border-t border-[var(--separator)] mt-[var(--space-3)] pt-[var(--space-3)]"}),(0,a.jsx)(k,{label:"Claude が利用上限に達した時",children:(0,a.jsx)(C,{value:Y.sessions?.rateLimitStrategy??"fallback",onChange:e=>ey(["sessions","rateLimitStrategy"],e),options:[{value:"wait",label:"待機して自動再開"},{value:"fallback",label:"GPT (Codex) に切り替え"}]})}),(0,a.jsx)("div",{className:"text-[length:var(--text-caption1)] text-[var(--label-secondary)] mt-[4px]",children:"「待機」は Claude のリセットを待ってからセッションを自動再開します。 「切り替え」は即座に GPT で応答し、リセット後に Claude へ戻します。"})]}),(0,a.jsxs)(f,{title:"コネクタ",children:[(0,a.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mb-[var(--space-2)]",children:"Slack"}),(0,a.jsx)(E,{}),(0,a.jsx)(k,{label:"App Token",children:(0,a.jsx)(w,{type:"password",value:Y.connectors?.slack?.appToken??"",onChange:e=>ey(["connectors","slack","appToken"],e),placeholder:"xapp-..."})}),(0,a.jsxs)("div",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)] mt-[-4px] mb-[var(--space-2)] pl-[var(--space-1)]",children:["Basic Information → App-Level Tokens で発行したトークン(",(0,a.jsx)("code",{children:"xapp-…"}),")。"]}),(0,a.jsx)(k,{label:"Bot Token",children:(0,a.jsx)(w,{type:"password",value:Y.connectors?.slack?.botToken??"",onChange:e=>ey(["connectors","slack","botToken"],e),placeholder:"xoxb-..."})}),(0,a.jsxs)("div",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)] mt-[-4px] mb-[var(--space-2)] pl-[var(--space-1)]",children:["ワークスペースにインストール後の OAuth & Permissions → Bot User OAuth Token(",(0,a.jsx)("code",{children:"xoxb-…"}),")。"]}),(0,a.jsx)(k,{label:"チャンネルでセッションを共有",children:(0,a.jsx)(N,{checked:Y.connectors?.slack?.shareSessionInChannel??!1,onChange:e=>ey(["connectors","slack","shareSessionInChannel"],e)})}),(0,a.jsx)(k,{label:"許可ユーザー",children:(0,a.jsx)(w,{value:Array.isArray(Y.connectors?.slack?.allowFrom)?Y.connectors?.slack?.allowFrom?.join(", "):Y.connectors?.slack?.allowFrom??"",onChange:e=>ey(["connectors","slack","allowFrom"],e.trim()?e.split(",").map(e=>e.trim()).filter(Boolean):void 0),placeholder:"U123, U456"})}),(0,a.jsx)(k,{label:"起動時に古いメッセージを無視",children:(0,a.jsx)(N,{checked:Y.connectors?.slack?.ignoreOldMessagesOnBoot??!0,onChange:e=>ey(["connectors","slack","ignoreOldMessagesOnBoot"],e)})}),(0,a.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mt-[var(--space-3)] mb-[var(--space-2)]",children:"応答ゲート(respondTo)"}),["im","mpim","channel"].map(e=>(0,a.jsx)(k,{label:"im"===e?"DM(1対1)":"mpim"===e?"グループDM":"チャンネル",children:(0,a.jsx)(C,{value:Y.connectors?.slack?.respondTo?.[e]??"always",onChange:a=>ey(["connectors","slack","respondTo",e],a),options:[{value:"always",label:"常に応答"},{value:"mention",label:"@メンション時のみ"},{value:"never",label:"応答しない"}]})},e)),(0,a.jsx)(k,{label:"参加済みスレッドは再メンション不要",children:(0,a.jsx)(N,{checked:Y.connectors?.slack?.respondTo?.engagedThreads??!0,onChange:e=>ey(["connectors","slack","respondTo","engagedThreads"],e)})}),(0,a.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mt-[var(--space-3)] mb-[var(--space-2)]",children:"空気読みトリアージ"}),(0,a.jsx)(k,{label:"有効化",children:(0,a.jsx)(N,{checked:Y.connectors?.slack?.triage?.enabled??!1,onChange:e=>{ey(["connectors","slack","triage","enabled"],e),e&&!Y.connectors?.slack?.triage?.engine&&ey(["connectors","slack","triage","engine"],"codex"),e&&!Y.connectors?.slack?.triage?.model&&ey(["connectors","slack","triage","model"],"gpt-5-nano")}})}),(0,a.jsx)(k,{label:"Engine",children:(0,a.jsx)(C,{value:Y.connectors?.slack?.triage?.engine??"codex",onChange:e=>ey(["connectors","slack","triage","engine"],e),options:[{value:"codex",label:"Codex (lightweight)"},{value:"claude",label:"Claude"}]})}),(0,a.jsx)(k,{label:"Model",children:(0,a.jsx)(C,{value:Y.connectors?.slack?.triage?.model??"",onChange:e=>ey(["connectors","slack","triage","model"],e||void 0),options:[{value:"",label:"自動(エンジン既定)"},...j(b(Y.connectors?.slack?.triage?.engine??"codex"),Y.connectors?.slack?.triage?.model)]})}),(0,a.jsx)(k,{label:"タイムアウト (ms)",children:(0,a.jsx)(w,{type:"number",value:Y.connectors?.slack?.triage?.timeoutMs!==void 0?String(Y.connectors.slack.triage.timeoutMs):"",onChange:e=>ey(["connectors","slack","triage","timeoutMs"],e.trim()?Number(e):void 0),placeholder:"20000"})}),(0,a.jsx)(k,{label:"スレッド文脈の取得件数",children:(0,a.jsx)(w,{type:"number",value:Y.connectors?.slack?.triage?.threadContextLimit!==void 0?String(Y.connectors.slack.triage.threadContextLimit):"",onChange:e=>ey(["connectors","slack","triage","threadContextLimit"],e.trim()?Number(e):void 0),placeholder:"10"})}),(0,a.jsx)(k,{label:"ペルソナ(任意)",children:(0,a.jsx)(w,{value:Y.connectors?.slack?.triage?.persona??"",onChange:e=>ey(["connectors","slack","triage","persona"],e.trim()||void 0),placeholder:"Short description of what this bot is good at"})}),(0,a.jsx)(k,{label:"バイナリパス上書き(任意)",children:(0,a.jsx)(w,{value:Y.connectors?.slack?.triage?.bin??"",onChange:e=>ey(["connectors","slack","triage","bin"],e.trim()||void 0),placeholder:"codex"})}),(0,a.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mt-[var(--space-3)] mb-[var(--space-2)]",children:"Goal 判定"}),(0,a.jsx)(k,{label:"有効化",children:(0,a.jsx)(N,{checked:Y.connectors?.slack?.goalExtraction?.enabled??!1,onChange:e=>{ey(["connectors","slack","goalExtraction","enabled"],e),e&&!Y.connectors?.slack?.goalExtraction?.engine&&ey(["connectors","slack","goalExtraction","engine"],"codex"),e&&!Y.connectors?.slack?.goalExtraction?.model&&ey(["connectors","slack","goalExtraction","model"],"gpt-5-nano")}})}),(0,a.jsx)(k,{label:"Engine",children:(0,a.jsx)(C,{value:Y.connectors?.slack?.goalExtraction?.engine??"codex",onChange:e=>ey(["connectors","slack","goalExtraction","engine"],e),options:[{value:"codex",label:"Codex (lightweight)"},{value:"claude",label:"Claude"}]})}),(0,a.jsx)(k,{label:"Model",children:(0,a.jsx)(C,{value:Y.connectors?.slack?.goalExtraction?.model??"",onChange:e=>ey(["connectors","slack","goalExtraction","model"],e||void 0),options:[{value:"",label:"自動(エンジン既定)"},...j(b(Y.connectors?.slack?.goalExtraction?.engine??"codex"),Y.connectors?.slack?.goalExtraction?.model)]})}),(0,a.jsx)(k,{label:"タイムアウト (ms)",children:(0,a.jsx)(w,{type:"number",value:Y.connectors?.slack?.goalExtraction?.timeoutMs!==void 0?String(Y.connectors.slack.goalExtraction.timeoutMs):"",onChange:e=>ey(["connectors","slack","goalExtraction","timeoutMs"],e.trim()?Number(e):void 0),placeholder:"30000"})}),(0,a.jsx)(k,{label:"バイナリパス上書き(任意)",children:(0,a.jsx)(w,{value:Y.connectors?.slack?.goalExtraction?.bin??"",onChange:e=>ey(["connectors","slack","goalExtraction","bin"],e.trim()||void 0),placeholder:"codex"})}),(0,a.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mt-[var(--space-3)] mb-[var(--space-2)]",children:"Agents View Canvas"}),Y.connectors?.slack?.appToken&&Y.connectors?.slack?.botToken&&!Y.connectors?.slack?.agentsCanvas?.enabled&&(0,a.jsxs)("div",{className:"mx-[var(--space-2)] mb-[var(--space-3)] p-[var(--space-3)] rounded-[var(--radius-md)] border border-[var(--accent-fill)] bg-[color-mix(in_srgb,var(--accent-fill)_30%,transparent)]",children:[(0,a.jsx)("div",{className:"text-[length:var(--text-subheadline)] font-[var(--weight-semibold)] text-[var(--text-primary)] mb-[var(--space-1)]",children:"💡 Slack 連携済みです — Canvas も有効化してみませんか?"}),(0,a.jsxs)("div",{className:"text-[length:var(--text-caption1)] text-[var(--text-secondary)]",children:["いま動いている全 Ryoko セッションが Slack の Canvas タブにライブ表示されます。 下の「有効化」を ON にしてチャンネルを選ぶだけで30秒以内に作成されます。 必要 scope は ",(0,a.jsx)("code",{className:"text-[var(--accent)]",children:"canvases:write"})," と",(0,a.jsx)("code",{className:"text-[var(--accent)] ml-1",children:"canvases:read"}),"(manifest を貼り直して reinstall すれば自動)。"]})]}),(0,a.jsxs)("p",{className:"text-[length:var(--text-caption1)] text-[var(--text-secondary)] mb-[var(--space-2)] px-[var(--space-2)]",children:["今動いている Ryoko のセッション一覧(running / waiting / errored / idle) を Slack の Canvas に自動同期します。指定したチャンネル直下のタブとして 常に最新状態が見えるようになります。Bot に",(0,a.jsx)("code",{className:"mx-1 text-[var(--accent)]",children:"canvases:write"}),"と",(0,a.jsx)("code",{className:"mx-1 text-[var(--accent)]",children:"canvases:read"}),"scope が必要です(上の Slack App Manifest を貼り直して reinstall すれば 自動で揃います)。"]}),(0,a.jsx)(k,{label:"有効化",children:(0,a.jsx)(N,{checked:Y.connectors?.slack?.agentsCanvas?.enabled??!1,onChange:e=>ey(["connectors","slack","agentsCanvas","enabled"],e)})}),(0,a.jsx)(k,{label:"表示先チャンネル",children:(0,a.jsxs)("div",{className:"flex w-full gap-[var(--space-2)] items-center",children:[ex&&ex.length>0?(0,a.jsxs)("select",{className:"flex-1 bg-[var(--surface-secondary)] border border-[var(--separator)] rounded-[var(--radius-control)] px-[var(--space-3)] py-[var(--space-2)] text-[length:var(--text-body)]",value:Y.connectors?.slack?.agentsCanvas?.channelId??"",onChange:e=>ey(["connectors","slack","agentsCanvas","channelId"],e.target.value||void 0),children:[(0,a.jsx)("option",{value:"",children:"— 選択してください —"}),ex.map(e=>(0,a.jsxs)("option",{value:e.id,children:[e.isPrivate?"🔒 ":"#",e.name]},e.id))]}):(0,a.jsx)(w,{value:Y.connectors?.slack?.agentsCanvas?.channelId??"",onChange:e=>ey(["connectors","slack","agentsCanvas","channelId"],e.trim()||void 0),placeholder:"C01234ABCDE — bot が member のチャンネル"}),(0,a.jsx)("button",{type:"button",onClick:eb,disabled:eh,className:"px-[var(--space-3)] py-[var(--space-2)] text-[length:var(--text-caption1)] bg-[var(--surface-secondary)] border border-[var(--separator)] rounded-[var(--radius-control)] hover:bg-[var(--surface-tertiary)] disabled:opacity-50",children:eh?(0,a.jsx)(c,{className:"h-4 w-4 animate-spin"}):ex?"更新":"読み込み"})]})}),em?(0,a.jsx)("p",{className:"text-[length:var(--text-caption1)] text-[var(--accent-red,#ef4444)] px-[var(--space-2)] -mt-[var(--space-1)] mb-[var(--space-2)]",children:em}):null,(0,a.jsx)(k,{label:"Canvas タイトル",children:(0,a.jsx)(w,{value:Y.connectors?.slack?.agentsCanvas?.title??"",onChange:e=>ey(["connectors","slack","agentsCanvas","title"],e.trim()||void 0),placeholder:"Ryoko Agents View"})}),(0,a.jsx)(k,{label:"更新間隔 (ms)",children:(0,a.jsx)(w,{type:"number",value:Y.connectors?.slack?.agentsCanvas?.pollIntervalMs!==void 0?String(Y.connectors.slack.agentsCanvas.pollIntervalMs):"",onChange:e=>ey(["connectors","slack","agentsCanvas","pollIntervalMs"],e.trim()?Number(e):void 0),placeholder:"30000(30秒, 最小 5000)"})}),(0,a.jsx)(k,{label:"グループ毎の最大表示件数",children:(0,a.jsx)(w,{type:"number",value:Y.connectors?.slack?.agentsCanvas?.maxPerGroup!==void 0?String(Y.connectors.slack.agentsCanvas.maxPerGroup):"",onChange:e=>ey(["connectors","slack","agentsCanvas","maxPerGroup"],e.trim()?Number(e):void 0),placeholder:"10"})}),(0,a.jsx)("div",{className:"border-t border-[var(--separator)] mt-[var(--space-3)] pt-[var(--space-3)]"}),(0,a.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mb-[var(--space-2)]",children:"Discord"}),(0,a.jsx)(k,{label:"Bot Token",children:(0,a.jsx)(w,{type:"password",value:Y.connectors?.discord?.botToken??"",onChange:e=>ey(["connectors","discord","botToken"],e),placeholder:"Bot token..."})}),(0,a.jsx)(k,{label:"Allow From",children:(0,a.jsx)(w,{value:Array.isArray(Y.connectors?.discord?.allowFrom)?Y.connectors?.discord?.allowFrom?.join(", "):Y.connectors?.discord?.allowFrom??"",onChange:e=>ey(["connectors","discord","allowFrom"],e.trim()?e.split(",").map(e=>e.trim()).filter(Boolean):void 0),placeholder:"User IDs, comma-separated (optional)"})}),(0,a.jsx)(k,{label:"Guild ID",children:(0,a.jsx)(w,{value:Y.connectors?.discord?.guildId??"",onChange:e=>ey(["connectors","discord","guildId"],e.trim()||void 0),placeholder:"サーバー/Guild ID(任意)"})}),(0,a.jsx)(k,{label:"Channel ID",children:(0,a.jsx)(w,{value:Y.connectors?.discord?.channelId??"",onChange:e=>ey(["connectors","discord","channelId"],e.trim()||void 0),placeholder:"このチャンネルに限定(右クリック → Copy Channel ID)"})}),(0,a.jsx)("div",{className:"border-t border-[var(--separator)] mt-[var(--space-3)] pt-[var(--space-3)]"}),(0,a.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mb-[var(--space-2)]",children:"Telegram"}),(0,a.jsx)(k,{label:"Bot Token",children:(0,a.jsx)(w,{type:"password",value:Y.connectors?.telegram?.botToken??"",onChange:e=>ey(["connectors","telegram","botToken"],e),placeholder:"123456:ABC-DEF..."})}),(0,a.jsx)(k,{label:"許可ユーザー (User ID)",children:(0,a.jsx)(w,{value:Array.isArray(Y.connectors?.telegram?.allowFrom)?Y.connectors?.telegram?.allowFrom?.join(", "):"",onChange:e=>ey(["connectors","telegram","allowFrom"],e.trim()?e.split(",").map(e=>Number(e.trim())).filter(e=>!isNaN(e)):void 0),placeholder:"Telegram の User ID をカンマ区切り(任意)"})}),(0,a.jsx)(k,{label:"起動時に古いメッセージを無視",children:(0,a.jsx)(N,{checked:Y.connectors?.telegram?.ignoreOldMessagesOnBoot??!0,onChange:e=>ey(["connectors","telegram","ignoreOldMessagesOnBoot"],e)})}),(0,a.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,a.jsx)("div",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)] mb-[var(--space-3)]",children:"初回起動時、下のQRコードを WhatsApp アプリでスキャンして接続してください。認証情報は次回以降キャッシュされます。"}),(0,a.jsx)(k,{label:"認証ディレクトリ",children:(0,a.jsx)(w,{value:Y.connectors?.whatsapp?.authDir??"",onChange:e=>ey(["connectors","whatsapp","authDir"],e.trim()||void 0),placeholder:"デフォルト: ~/.ryoko/.whatsapp-auth"})}),(0,a.jsx)(k,{label:"許可送信元",children:(0,a.jsx)(w,{value:Array.isArray(Y.connectors?.whatsapp?.allowFrom)?Y.connectors?.whatsapp?.allowFrom?.join(", "):"",onChange:e=>ey(["connectors","whatsapp","allowFrom"],e.trim()?e.split(",").map(e=>e.trim()).filter(Boolean):void 0),placeholder:"447700900000@s.whatsapp.net, ...(任意)"})}),el&&(0,a.jsxs)("div",{className:"mt-[var(--space-3)] flex flex-col items-center gap-[var(--space-2)]",children:[(0,a.jsx)("div",{className:"text-[length:var(--text-caption1)] font-semibold text-[var(--text-secondary)]",children:"WhatsApp でスキャンして接続"}),(0,a.jsx)("img",{src:el,alt:"WhatsApp QRコード",className:"w-[200px] h-[200px] rounded-[var(--radius-md)] border border-[var(--separator)] bg-white p-[8px]"}),(0,a.jsx)("div",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)]",children:"WhatsApp → リンク済み端末 → 端末をリンク"})]}),Y.connectors?.whatsapp&&"ok"===ec&&(0,a.jsx)("div",{className:"mt-[var(--space-2)] text-[length:var(--text-caption1)] text-[var(--system-green)] font-semibold",children:"✓ 接続済み"}),(0,a.jsx)("div",{className:"border-t border-[var(--separator)] mt-[var(--space-3)] pt-[var(--space-3)]"}),(0,a.jsxs)("div",{className:"flex items-center justify-between mb-[var(--space-2)]",children:[(0,a.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)]",children:"コネクタインスタンス"}),(0,a.jsxs)("div",{className:"flex items-center gap-[var(--space-2)]",children:[(0,a.jsxs)("button",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-secondary)] hover:text-[var(--accent)] transition-colors flex items-center gap-1",onClick:async()=>{try{let e=await h.api.reloadConnectors(),a=[];e.stopped.length&&a.push(`Stopped: ${e.stopped.join(", ")}`),e.started.length&&a.push(`Started: ${e.started.join(", ")}`),e.errors.length&&a.push(`Errors: ${e.errors.join(", ")}`),alert(a.length?a.join("\n"):"No connector instances to reload")}catch{alert("Failed to reload connectors")}},children:[(0,a.jsx)(n,{size:12}),"Reload"]}),(0,a.jsx)("button",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--accent)] hover:opacity-80 transition-opacity",onClick:()=>{let e=[...Y.connectors?.instances||[]],a=`discord-${e.length+1}`;e.push({id:a,type:"discord"}),ey(["connectors","instances"],e)},children:"+ Add Instance"})]})]}),(0,a.jsx)("div",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)] mb-[var(--space-3)]",children:"Add multiple connector instances of the same type, each bound to a specific employee."}),(Y.connectors?.instances||[]).map((e,t)=>(0,a.jsxs)("div",{className:"mb-[var(--space-4)] p-[var(--space-3)] rounded-[var(--radius-md)] border border-[var(--separator)] bg-[var(--bg-secondary)]",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-[var(--space-2)]",children:[(0,a.jsx)("div",{className:"text-[length:var(--text-subheadline)] font-[var(--weight-semibold)] text-[var(--text-primary)]",children:e.id||`Instance ${t+1}`}),(0,a.jsx)("button",{className:"text-[var(--system-red)] hover:opacity-80 transition-opacity p-[var(--space-1)]",onClick:()=>{let e=[...Y.connectors?.instances||[]];e.splice(t,1),ey(["connectors","instances"],e.length>0?e:void 0)},children:(0,a.jsx)(s.Trash2,{size:14})})]}),(0,a.jsx)(k,{label:"Instance ID",children:(0,a.jsx)(w,{value:e.id??"",onChange:e=>{let a=[...Y.connectors?.instances||[]];a[t]={...a[t],id:e},ey(["connectors","instances"],a)},placeholder:"e.g. discord-vox"})}),(0,a.jsx)(k,{label:"Type",children:(0,a.jsx)(C,{value:e.type??"discord",onChange:e=>{let a=[...Y.connectors?.instances||[]];a[t]={...a[t],type:e},ey(["connectors","instances"],a)},options:[{value:"discord",label:"Discord"},{value:"slack",label:"Slack"},{value:"whatsapp",label:"WhatsApp"}]})}),(0,a.jsx)(k,{label:"Employee",children:(0,a.jsx)(C,{value:e.employee??"",onChange:e=>{let a=[...Y.connectors?.instances||[]];a[t]={...a[t],employee:e||void 0},ey(["connectors","instances"],a)},options:[{value:"",label:"Default (COO)"},...ed.map(e=>({value:e.name,label:e.displayName}))]})}),("discord"===e.type||!e.type)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(k,{label:"Bot Token",children:(0,a.jsx)(w,{type:"password",value:e.botToken??"",onChange:e=>{let a=[...Y.connectors?.instances||[]];a[t]={...a[t],botToken:e},ey(["connectors","instances"],a)},placeholder:"Bot token..."})}),(0,a.jsx)(k,{label:"Guild ID",children:(0,a.jsx)(w,{value:e.guildId??"",onChange:e=>{let a=[...Y.connectors?.instances||[]];a[t]={...a[t],guildId:e.trim()||void 0},ey(["connectors","instances"],a)},placeholder:"Server/Guild ID"})}),(0,a.jsx)(k,{label:"Channel ID",children:(0,a.jsx)(w,{value:e.channelId??"",onChange:e=>{let a=[...Y.connectors?.instances||[]];a[t]={...a[t],channelId:e.trim()||void 0},ey(["connectors","instances"],a)},placeholder:"Restrict to channel (optional)"})}),(0,a.jsx)(k,{label:"Allow From",children:(0,a.jsx)(w,{value:Array.isArray(e.allowFrom)?e.allowFrom.join(", "):e.allowFrom??"",onChange:e=>{let a=[...Y.connectors?.instances||[]];a[t]={...a[t],allowFrom:e.trim()?e.split(",").map(e=>e.trim()).filter(Boolean):void 0},ey(["connectors","instances"],a)},placeholder:"User IDs, comma-separated (optional)"})})]}),"slack"===e.type&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(k,{label:"App Token",children:(0,a.jsx)(w,{type:"password",value:e.appToken??"",onChange:e=>{let a=[...Y.connectors?.instances||[]];a[t]={...a[t],appToken:e},ey(["connectors","instances"],a)},placeholder:"xapp-..."})}),(0,a.jsx)(k,{label:"Bot Token",children:(0,a.jsx)(w,{type:"password",value:e.botToken??"",onChange:e=>{let a=[...Y.connectors?.instances||[]];a[t]={...a[t],botToken:e},ey(["connectors","instances"],a)},placeholder:"xoxb-..."})})]}),"whatsapp"===e.type&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(k,{label:"Auth Directory",children:(0,a.jsx)(w,{value:e.authDir??"",onChange:e=>{let a=[...Y.connectors?.instances||[]];a[t]={...a[t],authDir:e.trim()||void 0},ey(["connectors","instances"],a)},placeholder:"Default: ~/.jinn/.whatsapp-auth"})}),(0,a.jsx)(k,{label:"Allow From",children:(0,a.jsx)(w,{value:Array.isArray(e.allowFrom)?e.allowFrom.join(", "):"",onChange:e=>{let a=[...Y.connectors?.instances||[]];a[t]={...a[t],allowFrom:e.trim()?e.split(",").map(e=>e.trim()).filter(Boolean):void 0},ey(["connectors","instances"],a)},placeholder:"Phone JIDs, comma-separated"})})]})]},e.id||t)),(0,a.jsx)("div",{className:"border-t border-[var(--separator)] mt-[var(--space-3)] pt-[var(--space-3)]"}),(0,a.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mb-[var(--space-2)]",children:"Web UI"}),(0,a.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,a.jsxs)(f,{title:"Cron",children:[(0,a.jsx)("div",{className:"text-[length:var(--text-caption1)] font-[var(--weight-semibold)] text-[var(--text-tertiary)] mb-[var(--space-2)]",children:"Default Delivery"}),(0,a.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,a.jsx)(k,{label:"Connector",children:(0,a.jsx)(C,{value:Y.cron?.defaultDelivery?.connector??"",onChange:e=>ey(["cron","defaultDelivery","connector"],e||void 0),options:[{value:"",label:"None (fire & forget)"},{value:"web",label:"Web"},{value:"slack",label:"Slack"}]})}),Y.cron?.defaultDelivery?.connector&&(0,a.jsx)(k,{label:"Channel",children:(0,a.jsx)(w,{value:Y.cron?.defaultDelivery?.channel??"",onChange:e=>ey(["cron","defaultDelivery","channel"],e),placeholder:"#general"})})]}),(0,a.jsxs)(f,{title:"Logging",children:[(0,a.jsx)(k,{label:"Level",children:(0,a.jsx)(C,{value:Y.logging?.level??"info",onChange:e=>ey(["logging","level"],e),options:[{value:"debug",label:"Debug"},{value:"info",label:"Info"},{value:"warn",label:"Warn"},{value:"error",label:"Error"}]})}),(0,a.jsx)(k,{label:"Stdout",children:(0,a.jsx)(N,{checked:Y.logging?.stdout??!0,onChange:e=>ey(["logging","stdout"],e)})}),(0,a.jsx)(k,{label:"File Logging",children:(0,a.jsx)(N,{checked:Y.logging?.file??!1,onChange:e=>ey(["logging","file"],e)})})]}),(0,a.jsx)(T,{}),(0,a.jsxs)("div",{className:"flex justify-end gap-[var(--space-3)] mb-[var(--space-6)]",children:[(0,a.jsxs)("button",{onClick:()=>ej(),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,a.jsx)(n,{size:14}),"再読み込み"]}),(0,a.jsxs)("button",{onClick:function(){er(!0),es(null),h.api.updateConfig(Y).then(e=>{if(e?.connectorsReloadError)return void es({type:"error",message:`Settings saved but connector reload failed: ${e.connectorsReloadError}`});let a=e?.connectorsReload?.errors??[];e?.status==="partial"||a.length>0?es({type:"error",message:`Settings saved but ${a.length} connector(s) failed: ${a.join("; ")}`}):es({type:"success",message:"Settings saved successfully"})}).catch(e=>es({type:"error",message:`Failed to save: ${e.message}`})).finally(()=>er(!1))},disabled:et,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:et?"wait":"pointer",opacity:et?.7:1},children:[(0,a.jsx)(o,{size:14}),et?"保存中…":"設定を保存"]})]})]}),(0,a.jsx)(f,{title:"リセット",children:(0,a.jsxs)("div",{className:"flex items-center justify-center gap-[var(--space-3)] flex-wrap",children:[(0,a.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,a.jsx)(n,{size:14}),"オンボーディングを再実行"]}),(0,a.jsxs)("button",{onClick:()=>{window.confirm("すべての設定を初期値に戻しますか?")&&(localStorage.removeItem("jinn-settings"),localStorage.removeItem("jinn-theme"),D(),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,a.jsx)(s.Trash2,{size:14}),"すべての設定をリセット"]})]})})]})})})}],15857)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,51090,e=>{"use strict";var t=e.i(98181),a=e.i(25007),r=e.i(9156),s=e.i(93716);function n(e,t,a){let r=e[t];return r?{...e,[t]:{...r,...a,updatedAt:Date.now()}}:e}var i=e.i(58843),l=e.i(53104);let o=[{id:"backlog",title:"Backlog"},{id:"todo",title:"To Do"},{id:"in-progress",title:"In Progress"},{id:"review",title:"Review"},{id:"done",title:"Done"}],d={low:"var(--system-green)",medium:"var(--system-orange)",high:"var(--system-red)"};function c({column:e,tickets:s,onDrop:n,onCreateTicket:i,renderTicket:l}){let[o,d]=(0,a.useState)(!1);return(0,t.jsxs)("div",{onDragOver:function(e){e.preventDefault(),e.dataTransfer.dropEffect="move",d(!0)},onDragLeave:function(e){e.currentTarget.contains(e.relatedTarget)||d(!1)},onDrop:function(t){t.preventDefault(),d(!1);let a=t.dataTransfer.getData("text/plain");a&&n(a,e.id)},className:"flex flex-col min-w-[280px] max-w-[320px] flex-[1_0_280px] h-full rounded-[var(--radius-lg)] transition-[background,border-color] duration-200 ease-[var(--ease-smooth)]",style:{background:o?"var(--fill-secondary)":"var(--fill-tertiary)",border:o?"2px dashed var(--accent)":"2px dashed transparent"},children:[(0,t.jsxs)("div",{className:"flex items-center justify-between p-[var(--space-3)_var(--space-4)] shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-[var(--space-2)]",children:[(0,t.jsx)("span",{className:"text-[length:var(--text-footnote)] font-[var(--weight-semibold)] text-[var(--text-primary)] tracking-[-0.01em]",children:e.title}),(0,t.jsx)("span",{className:"text-[length:var(--text-caption2)] font-[var(--weight-medium)] text-[var(--text-tertiary)] bg-[var(--fill-secondary)] rounded-[var(--radius-sm)] py-px px-1.5 min-w-[20px] text-center",children:s.length})]}),"backlog"===e.id&&i&&(0,t.jsx)("button",{onClick:i,"aria-label":"Create new ticket",className:"flex items-center justify-center w-6 h-6 rounded-[var(--radius-sm)] border-none bg-transparent text-[var(--text-secondary)] cursor-pointer p-0 transition-colors duration-150 ease-[var(--ease-smooth)]",children:(0,t.jsx)(r.Plus,{size:16})})]}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto px-[var(--space-2)] pb-[var(--space-2)] flex flex-col gap-[var(--space-2)]",children:[s.map(e=>(0,t.jsx)("div",{children:l(e)},e.id)),0===s.length&&(0,t.jsx)("div",{className:"py-[var(--space-8)] px-[var(--space-4)] text-center text-[length:var(--text-caption1)] text-[var(--text-tertiary)]",children:"No tickets"})]})]})}var p=e.i(38524);let x={low:"Low",medium:"Med",high:"High"};function v({ticket:e,assigneeName:r,onClick:s,onDelete:n}){let[i,l]=(0,a.useState)(!1),[o,c]=(0,a.useState)(!1);return(0,t.jsxs)("div",{draggable:!0,onDragStart:function(t){t.dataTransfer.setData("text/plain",e.id),t.dataTransfer.effectAllowed="move",l(!0)},onDragEnd:function(){l(!1)},onClick:s,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),role:"button",tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),s())},className:"relative bg-[var(--material-regular)] rounded-[var(--radius-md)] p-[var(--space-3)] border border-[var(--separator)] flex flex-col gap-[var(--space-2)] select-none transition-opacity duration-150 ease-[var(--ease-smooth)]",style:{cursor:i?"grabbing":"grab",opacity:i?.6:1,borderLeft:`3px solid ${d[e.priority]}`},children:[o&&n&&(0,t.jsx)("button",{onClick:e=>{e.stopPropagation(),n()},"aria-label":"Delete ticket",title:"Delete ticket",className:"absolute top-1.5 right-1.5 w-6 h-6 rounded-[var(--radius-sm)] flex items-center justify-center text-[var(--system-red)] border-none cursor-pointer p-0 z-[1]",style:{background:"color-mix(in srgb, var(--system-red) 12%, transparent)"},children:(0,t.jsx)(p.Trash2,{size:13})}),(0,t.jsxs)("div",{className:"flex items-start gap-[var(--space-2)]",children:[(0,t.jsxs)("span",{className:"inline-flex items-center gap-[3px] text-[length:var(--text-caption2)] font-semibold shrink-0 mt-0.5",style:{color:d[e.priority]},children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full",style:{background:d[e.priority]}}),x[e.priority]]}),(0,t.jsx)("span",{className:"text-[length:var(--text-footnote)] font-[var(--weight-semibold)] text-[var(--text-primary)] leading-[1.3] line-clamp-2 overflow-hidden break-words",children:e.title})]}),e.description&&(0,t.jsx)("div",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)] leading-[1.4] line-clamp-2 overflow-hidden break-words",children:e.description}),(0,t.jsxs)("div",{className:"flex items-center gap-[var(--space-2)] flex-wrap",children:[r&&(0,t.jsx)("span",{className:"text-[length:var(--text-caption2)] font-[var(--weight-medium)] text-[var(--text-secondary)] bg-[var(--fill-tertiary)] rounded-[var(--radius-sm)] py-px px-[var(--space-2)] leading-[1.5]",children:r}),(0,t.jsx)("span",{className:"text-[length:var(--text-caption2)] text-[var(--text-quaternary)] ml-auto",title:new Date(e.createdAt).toLocaleString(),children:function(e){let t=Math.floor((Date.now()-e)/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let a=Math.floor(t/60);if(a<24)return`${a}h ago`;let r=Math.floor(a/24);return r<30?`${r}d ago`:`${Math.floor(r/30)}mo ago`}(e.createdAt)})]})]})}function u({tickets:e,employees:a,onTicketClick:r,onMoveTicket:s,onCreateTicket:n,onDeleteTicket:i,filterEmployeeId:l}){return(0,t.jsx)("div",{style:{display:"flex",gap:"var(--space-3)",height:"100%",overflowX:"auto",overflowY:"hidden",padding:"var(--space-2) 0",WebkitOverflowScrolling:"touch"},children:o.map(o=>{var d;let p=(d=o.id,Object.values(e).filter(e=>e.status===d).sort((e,t)=>t.updatedAt-e.updatedAt)),x=l?p.filter(e=>e.assigneeId===l):p;return(0,t.jsx)(c,{column:o,tickets:x,onDrop:s,onCreateTicket:"backlog"===o.id?n:void 0,renderTicket:e=>{let s=a.find(t=>t.name===e.assigneeId);return(0,t.jsx)(v,{ticket:e,assigneeName:s?.displayName??null,onClick:()=>r(e),onDelete:i?()=>i(e):void 0})}},o.id)})})}let m={executive:"Exec",manager:"Mgr",senior:"Sr",employee:""};function h({employees:e,value:r,onChange:s}){let[n,i]=(0,a.useState)(!1),[l,o]=(0,a.useState)(""),[d,c]=(0,a.useState)(0),p=(0,a.useRef)(null),x=(0,a.useRef)(null),v=(0,a.useRef)(null),u=e.find(e=>e.name===r)??null,g=l.trim()?e.filter(e=>{let t=l.toLowerCase();return e.name.toLowerCase().includes(t)||e.displayName.toLowerCase().includes(t)||e.department.toLowerCase().includes(t)}):e,f=!l.trim()||"unassigned".includes(l.toLowerCase());(0,a.useEffect)(()=>{c(0)},[l]),(0,a.useEffect)(()=>{n?setTimeout(()=>x.current?.focus(),0):o("")},[n]),(0,a.useEffect)(()=>{if(n)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){p.current&&!p.current.contains(e.target)&&i(!1)}},[n]),(0,a.useEffect)(()=>{if(!n||!v.current)return;let e=v.current.querySelectorAll("[data-employee-option]")[d];e&&e.scrollIntoView({block:"nearest"})},[d,n]);let y=+!!f+g.length,b=(0,a.useCallback)(e=>{if(!n){("Enter"===e.key||" "===e.key||"ArrowDown"===e.key)&&(e.preventDefault(),i(!0));return}if("Escape"===e.key){e.preventDefault(),i(!1);return}if("ArrowDown"===e.key)e.preventDefault(),c(e=>Math.min(e+1,y-1));else if("ArrowUp"===e.key)e.preventDefault(),c(e=>Math.max(e-1,0));else if("Enter"===e.key){if(e.preventDefault(),f&&0===d)s("");else{let e=f?d-1:d;g[e]&&s(g[e].name)}i(!1)}},[n,d,y,f,g,s]);return(0,t.jsxs)("div",{ref:p,className:"relative",onKeyDown:b,children:[(0,t.jsx)("button",{type:"button",onClick:()=>i(!n),"aria-haspopup":"listbox","aria-expanded":n,className:`w-full flex items-center gap-[var(--space-2)] py-2 pl-3 pr-9 text-[length:var(--text-body)] cursor-pointer text-left border border-[var(--separator)] rounded-[var(--radius-md)] bg-[var(--fill-tertiary)] bg-[url("data:image/svg+xml,%3Csvg_xmlns='http://www.w3.org/2000/svg'_width='12'_height='12'_viewBox='0_0_24_24'_fill='none'_stroke='%23888'_stroke-width='2'_stroke-linecap='round'_stroke-linejoin='round'%3E%3Cpath_d='m6_9_6_6_6-6'/%3E%3C/svg%3E")] bg-no-repeat bg-[position:right_12px_center] min-h-[40px] font-[inherit] ${u?"text-[var(--text-primary)]":"text-[var(--text-tertiary)]"}`,children:u?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"font-[var(--weight-medium)]",children:u.displayName}),m[u.rank]&&(0,t.jsx)("span",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)] bg-[var(--fill-secondary)] rounded-[var(--radius-sm)] px-1.5 py-px",children:m[u.rank]})]}):(0,t.jsx)("span",{children:"Unassigned"})}),n&&(0,t.jsxs)("div",{className:"absolute top-full left-0 right-0 mt-1 z-50 bg-[var(--material-regular)] border border-[var(--separator)] rounded-[var(--radius-md)] shadow-[0_8px_32px_rgba(0,0,0,0.3)] overflow-hidden",children:[(0,t.jsx)("div",{className:"pt-2 px-2 pb-1",children:(0,t.jsx)("input",{ref:x,type:"text",placeholder:"Search employees...",value:l,onChange:e=>o(e.target.value),className:"w-full py-1.5 px-2.5 text-[length:var(--text-footnote)] border border-[var(--separator)] rounded-[var(--radius-sm)] bg-[var(--fill-tertiary)] text-[var(--text-primary)] outline-none font-[inherit]"})}),(0,t.jsxs)("div",{ref:v,role:"listbox",className:"max-h-[280px] overflow-y-auto p-1",children:[f&&(0,t.jsxs)("div",{"data-employee-option":!0,role:"option","aria-selected":""===r,onClick:()=>void(s(""),i(!1)),className:`flex items-center gap-[var(--space-2)] py-2 px-2.5 rounded-[var(--radius-sm)] cursor-pointer transition-[background] duration-100 ${0===d?"bg-[var(--fill-secondary)]":"bg-transparent"}`,onMouseEnter:()=>c(0),children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-lg bg-[var(--fill-tertiary)] flex items-center justify-center text-sm text-[var(--text-tertiary)] shrink-0",children:"—"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-[length:var(--text-footnote)] font-[var(--weight-medium)] text-[var(--text-secondary)]",children:"Unassigned"}),(0,t.jsx)("div",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)]",children:"No employee assigned"})]}),""===r&&(0,t.jsx)("span",{className:"ml-auto text-[var(--accent)] text-[13px] shrink-0",children:"✓"})]}),g.map((e,a)=>{let n=f?a+1:a,l=d===n,o=r===e.name;return(0,t.jsxs)("div",{"data-employee-option":!0,role:"option","aria-selected":o,onClick:()=>{s(e.name),i(!1)},onMouseEnter:()=>c(n),className:`flex items-center gap-[var(--space-2)] py-2 px-2.5 rounded-[var(--radius-sm)] cursor-pointer transition-[background] duration-100 ${l?"bg-[var(--fill-secondary)]":"bg-transparent"}`,children:[(0,t.jsx)("div",{className:"w-8 h-8 rounded-lg bg-[var(--accent)] flex items-center justify-center text-sm text-white font-semibold shrink-0",children:e.displayName.charAt(0).toUpperCase()}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-[var(--space-1)]",children:[(0,t.jsx)("span",{className:"text-[length:var(--text-footnote)] font-[var(--weight-semibold)] text-[var(--text-primary)] overflow-hidden text-ellipsis whitespace-nowrap",children:e.displayName}),m[e.rank]&&(0,t.jsx)("span",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)] bg-[var(--fill-secondary)] rounded-[var(--radius-sm)] px-1 shrink-0",children:m[e.rank]})]}),(0,t.jsx)("div",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)] overflow-hidden text-ellipsis whitespace-nowrap",children:e.department||e.name})]}),o&&(0,t.jsx)("span",{className:"text-[var(--accent)] text-[13px] shrink-0",children:"✓"})]},e.name)}),0===g.length&&!f&&(0,t.jsxs)("div",{className:"p-[var(--space-4)] text-center text-[length:var(--text-footnote)] text-[var(--text-tertiary)]",children:["No employees match “",l,"”"]})]})]})]})}let g=["low","medium","high"],f={low:"Low",medium:"Medium",high:"High"},y={title:"",description:"",priority:"medium",assigneeId:""};function b({open:e,onOpenChange:s,employees:n,onSubmit:i}){let[o,c]=(0,a.useState)(y),p=(0,a.useCallback)(()=>{c(y)},[]);return(0,t.jsx)(l.Dialog,{open:e,onOpenChange:function(e){e||p(),s(e)},children:(0,t.jsxs)(l.DialogContent,{showCloseButton:!0,className:"bg-[var(--bg)] border border-[var(--separator)] rounded-[var(--radius-lg)] shadow-[var(--shadow-card)] max-w-[480px]",children:[(0,t.jsxs)(l.DialogHeader,{children:[(0,t.jsx)(l.DialogTitle,{className:"text-[length:var(--text-title3)] font-[var(--weight-bold)] text-[var(--text-primary)]",children:"Create Ticket"}),(0,t.jsx)(l.DialogDescription,{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)]",children:"Add a new ticket to the backlog."})]}),(0,t.jsxs)("form",{onSubmit:function(e){e.preventDefault(),o.title.trim()&&(i({title:o.title.trim(),description:o.description.trim(),priority:o.priority,assigneeId:o.assigneeId||null}),p(),s(!1))},className:"flex flex-col gap-[var(--space-4)]",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-[var(--space-1)]",children:[(0,t.jsx)("label",{htmlFor:"ticket-title",className:"text-[length:var(--text-caption1)] font-[var(--weight-medium)] text-[var(--text-secondary)]",children:"Title"}),(0,t.jsx)("input",{id:"ticket-title",type:"text",placeholder:"What needs to be done?",value:o.title,onChange:e=>c(t=>({...t,title:e.target.value})),required:!0,autoFocus:!0,className:"text-[length:var(--text-body)] text-[var(--text-primary)] py-2 px-3 border border-[var(--separator)] rounded-[var(--radius-md)] bg-[var(--fill-tertiary)] outline-none font-[inherit]"})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-[var(--space-1)]",children:[(0,t.jsx)("label",{htmlFor:"ticket-description",className:"text-[length:var(--text-caption1)] font-[var(--weight-medium)] text-[var(--text-secondary)]",children:"Description"}),(0,t.jsx)("textarea",{id:"ticket-description",placeholder:"Add details...",rows:3,value:o.description,onChange:e=>c(t=>({...t,description:e.target.value})),className:"text-[length:var(--text-body)] text-[var(--text-primary)] resize-y min-h-[72px] py-2 px-3 border border-[var(--separator)] rounded-[var(--radius-md)] bg-[var(--fill-tertiary)] outline-none font-[inherit]"})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-[var(--space-2)]",children:[(0,t.jsx)("span",{className:"text-[length:var(--text-caption1)] font-[var(--weight-medium)] text-[var(--text-secondary)]",children:"Priority"}),(0,t.jsx)("div",{className:"flex gap-[var(--space-2)]",children:g.map(e=>{let a=o.priority===e;return(0,t.jsxs)("button",{type:"button",onClick:()=>c(t=>({...t,priority:e})),className:"flex-1 flex items-center justify-center gap-[var(--space-1)] py-[var(--space-2)] px-[var(--space-3)] rounded-[var(--radius-md)] cursor-pointer text-[length:var(--text-caption1)] font-[var(--weight-medium)] transition-all duration-150 ease-[var(--ease-smooth)]",style:{border:a?`2px solid ${d[e]}`:"2px solid var(--separator)",background:a?"var(--fill-tertiary)":"transparent",color:a?"var(--text-primary)":"var(--text-tertiary)"},children:[(0,t.jsx)("span",{className:"w-2 h-2 rounded-full shrink-0",style:{background:d[e]}}),f[e]]},e)})})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-[var(--space-1)]",children:[(0,t.jsx)("label",{className:"text-[length:var(--text-caption1)] font-[var(--weight-medium)] text-[var(--text-secondary)]",children:"Assignee"}),(0,t.jsx)(h,{employees:n,value:o.assigneeId,onChange:e=>c(t=>({...t,assigneeId:e}))})]}),(0,t.jsxs)("button",{type:"submit",disabled:!o.title.trim(),className:"rounded-[var(--radius-md)] py-3 px-5 w-full text-[length:var(--text-body)] font-[var(--weight-semibold)] border-none flex items-center justify-center gap-[var(--space-2)] mt-[var(--space-2)] bg-[var(--accent)] text-white transition-opacity duration-150 ease-linear",style:{cursor:o.title.trim()?"pointer":"default",opacity:o.title.trim()?1:.5},children:[(0,t.jsx)(r.Plus,{size:16}),"Create Ticket"]})]})]})})}function j({priority:e}){return(0,t.jsxs)("span",{className:"inline-flex items-center gap-[var(--space-1)] text-[length:var(--text-caption2)] font-semibold uppercase tracking-[0.5px]",style:{color:d[e]},children:[(0,t.jsx)("span",{className:"w-1.5 h-1.5 rounded-full",style:{background:d[e]}}),e]})}function w({status:e}){let a=o.find(t=>t.id===e)?.title??e;return(0,t.jsx)("span",{className:"text-[length:var(--text-caption2)] font-semibold text-[var(--text-secondary)] bg-[var(--fill-tertiary)] px-[var(--space-2)] py-[2px] rounded-[var(--radius-sm)] uppercase tracking-[0.3px]",children:a})}function k({ticket:e,employees:r,onClose:s,onStatusChange:n,onAssigneeChange:i,onDelete:l}){let d=(0,a.useRef)(null);(0,a.useEffect)(()=>{function e(e){"Escape"===e.key&&s()}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[s]),(0,a.useEffect)(()=>{d.current?.focus()},[]);let c=r.find(t=>t.name===e.assigneeId)??null;return(0,t.jsx)("div",{className:"absolute top-0 right-0 bottom-0 z-30",children:(0,t.jsxs)("div",{className:"w-[420px] max-w-[100vw] h-full bg-[var(--material-regular)] shadow-[-4px_0_24px_rgba(0,0,0,0.25)] flex flex-col",children:[(0,t.jsx)("div",{className:"h-[3px] bg-[var(--accent)] shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[(0,t.jsx)("div",{className:"pt-[var(--space-4)] px-[var(--space-5)] pb-0 flex justify-end gap-[var(--space-2)]",children:(0,t.jsx)("button",{ref:d,onClick:s,"aria-label":"Close detail panel",className:"w-7 h-7 rounded-full flex items-center justify-center bg-[var(--fill-secondary)] text-[var(--text-secondary)] border-none cursor-pointer text-[length:var(--text-footnote)] transition-all duration-150 ease-[var(--ease-spring)]",children:"✕"})}),(0,t.jsxs)("div",{className:"pt-[var(--space-2)] px-[var(--space-5)] pb-[var(--space-4)]",children:[(0,t.jsx)("h2",{className:"text-[length:var(--text-title3)] font-bold tracking-[-0.3px] text-[var(--text-primary)] m-0 leading-[1.25]",children:e.title}),(0,t.jsxs)("div",{className:"flex items-center gap-[var(--space-3)] mt-[var(--space-2)]",children:[(0,t.jsx)(w,{status:e.status}),(0,t.jsx)(j,{priority:e.priority})]}),c?(0,t.jsxs)("div",{className:"flex items-center gap-[var(--space-2)] mt-[var(--space-3)] text-[length:var(--text-footnote)] text-[var(--text-secondary)]",children:[(0,t.jsx)("span",{children:c.displayName}),(0,t.jsx)("span",{className:"text-[length:var(--text-caption2)] text-[var(--text-tertiary)] bg-[var(--fill-secondary)] rounded-[var(--radius-sm)] px-1",children:c.rank})]}):(0,t.jsx)("div",{className:"mt-[var(--space-3)] text-[length:var(--text-footnote)] text-[var(--text-tertiary)] italic",children:"Unassigned"})]}),(0,t.jsxs)("div",{className:"px-[var(--space-5)] pb-[var(--space-4)]",children:[(0,t.jsx)("div",{className:"text-[length:var(--text-caption1)] font-semibold text-[var(--text-tertiary)] uppercase tracking-[0.5px] mb-[var(--space-2)]",children:"Move to"}),(0,t.jsx)("div",{className:"flex gap-[var(--space-1)] flex-wrap",children:o.map(a=>{let r=a.id===e.status;return(0,t.jsx)("button",{onClick:()=>{r||n(a.id)},disabled:r,className:"text-[length:var(--text-caption2)] font-semibold py-[3px] px-[var(--space-2)] rounded-[var(--radius-sm)] border-none transition-all duration-[120ms] ease-linear",style:{cursor:r?"default":"pointer",background:r?"var(--accent)":"var(--fill-tertiary)",color:r?"#fff":"var(--text-secondary)",opacity:r?1:.8},children:a.title},a.id)})})]}),(0,t.jsxs)("div",{className:"px-[var(--space-5)] pb-[var(--space-4)]",children:[(0,t.jsx)("div",{className:"text-[length:var(--text-caption1)] font-semibold text-[var(--text-tertiary)] uppercase tracking-[0.5px] mb-[var(--space-2)]",children:"Assignee"}),(0,t.jsx)(h,{employees:r,value:e.assigneeId??"",onChange:e=>i(e||null)})]}),e.description&&(0,t.jsxs)("div",{className:"px-[var(--space-5)] pb-[var(--space-4)]",children:[(0,t.jsx)("div",{className:"h-px bg-[var(--separator)] mb-[var(--space-3)]"}),(0,t.jsx)("div",{className:"text-[length:var(--text-caption1)] font-semibold text-[var(--text-tertiary)] uppercase tracking-[0.5px] mb-[var(--space-2)]",children:"Description"}),(0,t.jsx)("div",{className:"text-[length:var(--text-footnote)] text-[var(--text-secondary)] leading-[1.5] whitespace-pre-wrap",children:e.description})]})]}),(0,t.jsx)("div",{className:"shrink-0 py-[var(--space-2)] px-[var(--space-5)] pb-[var(--space-4)] border-t border-[var(--separator)]",children:(0,t.jsx)("button",{onClick:function(){l()},className:"w-full py-[var(--space-2)] px-[var(--space-3)] rounded-[var(--radius-md)] border border-[var(--system-red)] bg-transparent text-[var(--system-red)] text-[length:var(--text-footnote)] font-semibold cursor-pointer transition-all duration-[120ms] ease-linear",children:"Delete Ticket"})})]})})}function N({ticket:e,onConfirm:a,onCancel:r}){return(0,t.jsx)(l.Dialog,{open:!0,onOpenChange:e=>{e||r()},children:(0,t.jsxs)(l.DialogContent,{showCloseButton:!1,className:"bg-[var(--bg)] border border-[var(--separator)] rounded-[var(--radius-lg)] shadow-[var(--shadow-card)] max-w-[400px]",children:[(0,t.jsxs)(l.DialogHeader,{children:[(0,t.jsx)(l.DialogTitle,{className:"text-[length:var(--text-title3)] font-[var(--weight-bold)] text-[var(--text-primary)]",children:"Delete Ticket"}),(0,t.jsxs)(l.DialogDescription,{className:"text-[length:var(--text-footnote)] text-[var(--text-secondary)] leading-[1.5]",children:["Are you sure you want to delete “",e.title,"”? This cannot be undone."]})]}),(0,t.jsxs)(l.DialogFooter,{children:[(0,t.jsx)("button",{onClick:r,className:"px-[var(--space-4)] py-[var(--space-2)] rounded-[var(--radius-md)] border border-[var(--separator)] bg-transparent text-[var(--text-secondary)] text-[length:var(--text-footnote)] font-semibold cursor-pointer",children:"Cancel"}),(0,t.jsx)("button",{onClick:a,autoFocus:!0,className:"px-[var(--space-4)] py-[var(--space-2)] rounded-[var(--radius-md)] border-none bg-[var(--system-red)] text-white text-[length:var(--text-footnote)] font-semibold cursor-pointer",children:"Delete"})]})]})})}e.s(["default",0,function(){let[e,l]=(0,a.useState)({}),[o,d]=(0,a.useState)([]),[c,p]=(0,a.useState)([]),[x,v]=(0,a.useState)(!0),[m,h]=(0,a.useState)(null),[g,f]=(0,a.useState)(!1),[y,j]=(0,a.useState)(null),[w,D]=(0,a.useState)(null),[C,A]=(0,a.useState)(null);(0,a.useCallback)(async e=>{let t={};for(let a of Object.values(e)){let e=a.department;e&&(t[e]||(t[e]=[]),t[e].push({id:a.id,title:a.title,description:a.description||void 0,status:a.status,priority:a.priority,assignee:a.assigneeId||void 0,createdAt:new Date(a.createdAt).toISOString(),updatedAt:new Date(a.updatedAt).toISOString()}))}let a=Array.from(new Set([...Object.keys(t),...c])).map(async e=>{try{await s.api.updateDepartmentBoard(e,t[e]||[])}catch{}});await Promise.all(a)},[c]);let S=(0,a.useCallback)(()=>{v(!0),h(null),s.api.getOrg().then(async e=>{d(e.employees),p(e.departments);let t={};for(let a of e.departments)try{let e=await s.api.getDepartmentBoard(a);if(Array.isArray(e))for(let r of e){let e={todo:"todo",in_progress:"in-progress","in-progress":"in-progress",done:"done",backlog:"backlog",review:"review"}[r.status]||"todo",s={low:"low",medium:"medium",high:"high"}[r.priority||"medium"]||"medium";t[r.id]={id:r.id,title:r.title,description:r.description||"",status:e,priority:s,assigneeId:r.assignee||null,department:a,workState:"idle",createdAt:r.createdAt?new Date(r.createdAt).getTime():Date.now(),updatedAt:r.updatedAt?new Date(r.updatedAt).getTime():Date.now(),departmentId:a}}}catch{}l(t)}).catch(e=>h(e.message)).finally(()=>v(!1))},[]);(0,a.useEffect)(()=>{S()},[S]),(0,a.useEffect)(()=>{x||function(e){try{localStorage.setItem("jinn-kanban",JSON.stringify(e))}catch{}}(e)},[e,x]);let I=(0,a.useCallback)(async e=>{let t={};for(let a of Object.values(e))a.departmentId&&(t[a.departmentId]||(t[a.departmentId]=[]),t[a.departmentId].push(a));for(let e of c)t[e]||(t[e]=[]);await Promise.all(Object.entries(t).map(([e,t])=>{let a=t.map(e=>({id:e.id,title:e.title,description:e.description,status:e.status,priority:e.priority,assignee:e.assigneeId??void 0,createdAt:new Date(e.createdAt).toISOString(),updatedAt:new Date(e.updatedAt).toISOString()}));return s.api.updateDepartmentBoard(e,a).catch(()=>{})}))},[c]);function _(e,t){l(a=>{let r=n(a,e,{status:t});return I(r),r})}if((0,a.useEffect)(()=>{if(y&&e[y.id]){let t=e[y.id];t.updatedAt!==y.updatedAt&&j(t)}},[e,y]),m)return(0,t.jsx)(i.PageLayout,{children:(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center h-full gap-[var(--space-4)] text-[var(--text-tertiary)]",children:[(0,t.jsxs)("div",{className:"rounded-[var(--radius-md)] bg-[color-mix(in_srgb,var(--system-red)_10%,transparent)] border border-[color-mix(in_srgb,var(--system-red)_30%,transparent)] px-[var(--space-4)] py-[var(--space-3)] text-[length:var(--text-body)] text-[var(--system-red)]",children:["Failed to load employees: ",m]}),(0,t.jsx)("button",{onClick:S,className:"px-[var(--space-4)] py-[var(--space-2)] rounded-[var(--radius-md)] bg-[var(--accent)] text-[var(--accent-contrast)] border-none cursor-pointer text-[length:var(--text-body)] font-[var(--weight-semibold)]",children:"Retry"})]})});let T=Object.keys(e).length,E=new Set(Object.values(e).map(e=>e.assigneeId).filter(Boolean)),O=o.filter(e=>E.has(e.name));return(0,t.jsx)(i.PageLayout,{children:(0,t.jsxs)("div",{className:"flex h-full relative bg-[var(--bg)]",children:[(0,t.jsxs)("div",{className:"flex-1 h-full flex flex-col min-w-0",children:[(0,t.jsxs)("div",{className:"px-[var(--space-5)] py-[var(--space-4)] flex items-center justify-between shrink-0 border-b border-[var(--separator)]",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-[length:var(--text-title2)] font-[var(--weight-bold)] text-[var(--text-primary)] m-0 tracking-[-0.3px]",children:"Kanban Board"}),(0,t.jsxs)("p",{className:"text-[length:var(--text-caption1)] text-[var(--text-tertiary)] mt-[2px] mb-0",children:[T," ticket",1!==T?"s":""]})]}),(0,t.jsx)(i.ToolbarActions,{children:(0,t.jsxs)("button",{onClick:()=>f(!0),className:"rounded-[var(--radius-md)] px-4 py-2 text-[length:var(--text-footnote)] font-[var(--weight-semibold)] border-none flex items-center gap-[var(--space-2)] bg-[var(--accent)] text-white cursor-pointer",children:[(0,t.jsx)(r.Plus,{size:16}),"New Ticket"]})})]}),O.length>0&&(0,t.jsxs)("div",{className:"flex items-center gap-[var(--space-2)] px-[var(--space-5)] py-[var(--space-2)] overflow-x-auto shrink-0",children:[(0,t.jsx)("button",{onClick:()=>D(null),className:`flex items-center gap-[var(--space-1)] px-3 py-1 rounded-full border-none text-[length:var(--text-caption1)] font-semibold cursor-pointer shrink-0 ${null===w?"bg-[var(--accent)] text-white":"bg-[var(--fill-tertiary)] text-[var(--text-secondary)]"}`,children:"All"}),O.map(e=>(0,t.jsx)("button",{onClick:()=>D(w===e.name?null:e.name),className:`flex items-center gap-[var(--space-1)] px-3 py-1 rounded-full border-none text-[length:var(--text-caption1)] font-semibold cursor-pointer shrink-0 ${w===e.name?"bg-[var(--accent)] text-white":"bg-[var(--fill-tertiary)] text-[var(--text-secondary)]"}`,children:e.displayName},e.name))]}),(0,t.jsx)("div",{className:"flex-1 px-[var(--space-3)] min-h-0",children:x?(0,t.jsx)("div",{className:"flex items-center justify-center h-full text-[var(--text-tertiary)] text-[length:var(--text-caption1)]",children:"Loading..."}):(0,t.jsx)(u,{tickets:e,employees:o,onTicketClick:function(e){j(e)},onMoveTicket:_,onCreateTicket:()=>f(!0),onDeleteTicket:e=>A(e),filterEmployeeId:w})})]}),y&&(0,t.jsx)("div",{className:"fixed inset-0 z-30 lg:hidden bg-black/50",onClick:()=>j(null)}),y&&(0,t.jsx)(k,{ticket:y,employees:o,onClose:()=>j(null),onStatusChange:e=>_(y.id,e),onAssigneeChange:e=>{var t;let a,r;return t=y.id,a=e?o.find(t=>t.name===e):null,r={assigneeId:e},void(a?.department&&(r.department=a.department),l(e=>{let a=n(e,t,r);return I(a),a}))},onDelete:()=>A(y)}),C&&(0,t.jsx)(N,{ticket:C,onConfirm:()=>{var e;return e=C.id,void(l(t=>{let a,r=(a={...t},delete a[e],a);return I(r),r}),j(null),A(null))},onCancel:()=>A(null)}),(0,t.jsx)(b,{open:g,onOpenChange:f,employees:o,onSubmit:function(e){let t=e.assigneeId?o.find(t=>t.name===e.assigneeId):null,a=t?.department||c[0]||null;l(t=>{var r;let s,n,i=(r={...e,status:"backlog",department:a,departmentId:a},s=crypto.randomUUID(),n=Date.now(),{...t,[s]:{...r,id:s,workState:"idle",createdAt:n,updatedAt:n,departmentId:r.departmentId??null}});return I(i),i})}})]})})}],51090)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,41385,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"warnOnce",{enumerable:!0,get:function(){return s}});let s=e=>{}},84397,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={DecodeError:function(){return g},MiddlewareNotFoundError:function(){return O},MissingStaticPage:function(){return q},NormalizeError:function(){return b},PageNotFoundError:function(){return v},SP:function(){return p},ST:function(){return m},WEB_VITALS:function(){return i},execOnce:function(){return a},getDisplayName:function(){return h},getLocationOrigin:function(){return l},getURL:function(){return c},isAbsoluteUrl:function(){return o},isResSent:function(){return f},loadGetInitialProps:function(){return y},normalizeRepeatedSlashes:function(){return d},stringifyError:function(){return C}};for(var n in s)Object.defineProperty(r,n,{enumerable:!0,get:s[n]});let i=["CLS","FCP","FID","INP","LCP","TTFB"];function a(e){let t,r=!1;return(...s)=>(r||(r=!0,t=e(...s)),t)}let u=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,o=e=>u.test(e);function l(){let{protocol:e,hostname:t,port:r}=window.location;return`${e}//${t}${r?":"+r:""}`}function c(){let{href:e}=window.location,t=l();return e.substring(t.length)}function h(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function f(e){return e.finished||e.headersSent}function d(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?`?${t.slice(1).join("?")}`:"")}async function y(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await y(t.Component,t.ctx)}:{};let s=await e.getInitialProps(t);if(r&&f(r))return s;if(!s)throw Object.defineProperty(Error(`"${h(e)}.getInitialProps()" should resolve to an object. But found "${s}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return s}let p="u">typeof performance,m=p&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class g extends Error{}class b extends Error{}class v extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class q extends Error{constructor(e,t){super(),this.message=`Failed to load static file for page: ${e} ${t}`}}class O extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function C(e){return JSON.stringify({message:e.message,stack:e.stack})}},33290,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var s={assign:function(){return o},searchParamsToUrlQuery:function(){return i},urlQueryToSearchParams:function(){return u}};for(var n in s)Object.defineProperty(r,n,{enumerable:!0,get:s[n]});function i(e){let t={};for(let[r,s]of e.entries()){let e=t[r];void 0===e?t[r]=s:Array.isArray(e)?e.push(s):t[r]=[e,s]}return t}function a(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function u(e){let t=new URLSearchParams;for(let[r,s]of Object.entries(e))if(Array.isArray(s))for(let e of s)t.append(r,a(e));else t.set(r,a(s));return t}function o(e,...t){for(let r of t){for(let t of r.keys())e.delete(t);for(let[t,s]of r.entries())e.append(t,s)}return e}},3971,e=>{"use strict";var t=e.i(98181),r=e.i(78821),s=e.i(82751),n=e.i(74403),i=e.i(50079),a=e.i(29679),u=class extends a.Subscribable{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,r){let i=t.queryKey,a=t.queryHash??(0,s.hashQueryKeyByOptions)(i,t),u=this.get(a);return u||(u=new n.Query({client:e,queryKey:i,queryHash:a,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(u)),u}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){i.notifyManager.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,s.matchQuery)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,s.matchQuery)(e,t)):t}notify(e){i.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){i.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){i.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},o=e.i(76590),l=a,c=class extends l.Subscribable{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#r=new Map,this.#s=0}#t;#r;#s;build(e,t,r){let s=new o.Mutation({client:e,mutationCache:this,mutationId:++this.#s,options:e.defaultMutationOptions(t),state:r});return this.add(s),s}add(e){this.#t.add(e);let t=h(e);if("string"==typeof t){let r=this.#r.get(t);r?r.push(e):this.#r.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){let t=h(e);if("string"==typeof t){let r=this.#r.get(t);if(r)if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#r.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=h(e);if("string"!=typeof t)return!0;{let r=this.#r.get(t),s=r?.find(e=>"pending"===e.state.status);return!s||s===e}}runNext(e){let t=h(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#r.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){i.notifyManager.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#r.clear()})}getAll(){return Array.from(this.#t)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,s.matchMutation)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,s.matchMutation)(e,t))}notify(e){i.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return i.notifyManager.batch(()=>Promise.all(e.map(e=>e.continue().catch(s.noop))))}};function h(e){return e.options.scope?.id}var f=e.i(72940),d=e.i(48327);function y(e){return{onFetch:(t,r)=>{let n=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],u=t.state.data?.pageParams||[],o={pages:[],pageParams:[]},l=0,c=async()=>{let r=!1,c=(0,s.ensureQueryFn)(t.options,t.fetchOptions),h=async(e,n,i)=>{let a;if(r)return Promise.reject();if(null==n&&e.pages.length)return Promise.resolve(e);let u=(a={client:t.client,queryKey:t.queryKey,pageParam:n,direction:i?"backward":"forward",meta:t.options.meta},(0,s.addConsumeAwareSignal)(a,()=>t.signal,()=>r=!0),a),o=await c(u),{maxPages:l}=t.options,h=i?s.addToStart:s.addToEnd;return{pages:h(e.pages,o,l),pageParams:h(e.pageParams,n,l)}};if(i&&a.length){let e="backward"===i,t={pages:a,pageParams:u},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:p)(n,t);o=await h(t,r,e)}else{let t=e??a.length;do{let e=0===l?u[0]??n.initialPageParam:p(n,o);if(l>0&&null==e)break;o=await h(o,e),l++}while(l<t)}return o};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=c}}}function p(e,{pages:t,pageParams:r}){let s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,r[s],r):void 0}let m=new class{#n;#i;#a;#u;#o;#l;#c;#h;constructor(e={}){this.#n=e.queryCache||new u,this.#i=e.mutationCache||new c,this.#a=e.defaultOptions||{},this.#u=new Map,this.#o=new Map,this.#l=0}mount(){this.#l++,1===this.#l&&(this.#c=f.focusManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#n.onFocus())}),this.#h=d.onlineManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#n.onOnline())}))}unmount(){this.#l--,0===this.#l&&(this.#c?.(),this.#c=void 0,this.#h?.(),this.#h=void 0)}isFetching(e){return this.#n.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#i.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#n.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),r=this.#n.build(this,t),n=r.state.data;return void 0===n?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime((0,s.resolveStaleTime)(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return this.#n.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,r){let n=this.defaultQueryOptions({queryKey:e}),i=this.#n.get(n.queryHash),a=i?.state.data,u=(0,s.functionalUpdate)(t,a);if(void 0!==u)return this.#n.build(this,n).setData(u,{...r,manual:!0})}setQueriesData(e,t,r){return i.notifyManager.batch(()=>this.#n.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#n.get(t.queryHash)?.state}removeQueries(e){let t=this.#n;i.notifyManager.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#n;return i.notifyManager.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let r={revert:!0,...t};return Promise.all(i.notifyManager.batch(()=>this.#n.findAll(e).map(e=>e.cancel(r)))).then(s.noop).catch(s.noop)}invalidateQueries(e,t={}){return i.notifyManager.batch(()=>(this.#n.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let r={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(i.notifyManager.batch(()=>this.#n.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(s.noop)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(s.noop)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let r=this.#n.build(this,t);return r.isStaleByTime((0,s.resolveStaleTime)(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(s.noop).catch(s.noop)}fetchInfiniteQuery(e){return e.behavior=y(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(s.noop).catch(s.noop)}ensureInfiniteQueryData(e){return e.behavior=y(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return d.onlineManager.isOnline()?this.#i.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#n}getMutationCache(){return this.#i}getDefaultOptions(){return this.#a}setDefaultOptions(e){this.#a=e}setQueryDefaults(e,t){this.#u.set((0,s.hashKey)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#u.values()],r={};return t.forEach(t=>{(0,s.partialMatchKey)(e,t.queryKey)&&Object.assign(r,t.defaultOptions)}),r}setMutationDefaults(e,t){this.#o.set((0,s.hashKey)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#o.values()],r={};return t.forEach(t=>{(0,s.partialMatchKey)(e,t.mutationKey)&&Object.assign(r,t.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#a.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,s.hashQueryKeyByOptions)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===s.skipToken&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#a.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#n.clear(),this.#i.clear()}}({defaultOptions:{queries:{staleTime:6e4,gcTime:3e5,retry:1,refetchOnWindowFocus:!1}}});var g=e.i(13765),b=e.i(36668),v=e.i(25007),q=e.i(63490);let O="jinn-notifications";function C(e){try{localStorage.setItem(O,JSON.stringify(e.slice(0,50)))}catch{}}let P=0;var Q=e.i(92105);function w({children:e}){let[r,s]=(0,v.useState)([]),[n,i]=(0,v.useState)([]),a=(0,v.useRef)(new Map),u=(0,v.useRef)(!1);(0,v.useEffect)(()=>{s(function(){try{let e=localStorage.getItem(O);if(!e)return[];return JSON.parse(e).slice(0,50)}catch{return[]}}())},[]),(0,v.useEffect)(()=>{u.current?C(r):r.length>0&&(u.current=!0)},[r]);let o=(0,v.useCallback)(e=>{i(t=>t.filter(t=>t.id!==e));let t=a.current.get(e);t&&(clearTimeout(t),a.current.delete(e))},[]),l=(0,v.useCallback)((e,t)=>{let r=function(e,t){switch(e){case"session:completed":{let e=t.employee||"Session",r=t.error;if(r)return{type:"error",title:`${e} — Error`,message:r.slice(0,120)};return{type:"success",title:`${e} — Done`,message:"Session completed successfully"}}case"cron:triggered":return{type:"info",title:"Cron Triggered",message:t.name||t.jobId||"Job"};case"cron:reloaded":return{type:"info",title:"Cron Reloaded",message:"Scheduled jobs reloaded"};case"cron:completed":{let e=t.name||t.job||"Job",r=t.error;if(r)return{type:"error",title:`Cron Failed: ${e}`,message:r.slice(0,120)};return{type:"success",title:`Cron Done: ${e}`,message:"Scheduled job completed successfully"}}case"slack:message":{let e=t.channel||"",r=t.user||t.userName||"Someone",s=t.text||"";return{type:"info",title:`Slack${e?`: ${e}`:""}`,message:`${r}: ${s}`.slice(0,120)}}case"session:started":{let e=t.sessionId||"",r=t.employee||"";return{type:"info",title:"Session Started",message:r?`${r} (${e.slice(0,8)})`:e.slice(0,8)}}default:return null}}(e,t);if(!r)return;let n={...r,id:`n_${Date.now()}_${++P}`,timestamp:Date.now(),read:!1};s(e=>[n,...e].slice(0,50)),u.current=!0},[]),c=(0,v.useRef)(l);c.current=l,(0,v.useEffect)(()=>{let e=(0,q.createGatewaySocket)((e,t)=>{c.current(e,t)});return()=>e.close()},[]);let h=(0,v.useCallback)(()=>{s(e=>{let t=e.map(e=>e.read?e:{...e,read:!0});return C(t),t})},[]),f=(0,v.useCallback)(e=>{s(t=>{let r=t.map(t=>t.id===e?{...t,read:!0}:t);return C(r),r})},[]),d=(0,v.useCallback)(()=>{s([]),C([])},[]),y=r.filter(e=>!e.read).length;return(0,t.jsx)(Q.NotificationContext.Provider,{value:{notifications:r,unreadCount:y,toasts:n,pushFromEvent:l,dismissToast:o,markAllRead:h,markRead:f,clearAll:d},children:e})}var E=e.i(32984),M=e.i(97478),S=e.i(11322);function D(){let{settings:e}=(0,b.useSettings)(),t=e.portalEmoji??"🧞";return(0,v.useEffect)(()=>{let e=document.createElement("canvas");e.width=64,e.height=64;let r=e.getContext("2d");if(!r)return;r.font="52px serif",r.textAlign="center",r.textBaseline="middle",r.fillText(t,32,36);let s=e.toDataURL("image/png"),n=document.querySelector("link[rel='icon']");n||((n=document.createElement("link")).rel="icon",document.head.appendChild(n)),n.type="image/png",n.href=s},[t]),null}function k(){return!function(){let e=(0,r.useQueryClient)(),{subscribe:t}=(0,E.useGateway)(),s=(0,v.useRef)(null),n=(0,v.useRef)(new Set);(0,v.useEffect)(()=>{let r=t((t,r)=>{switch(t){case"session:started":n.current.add("sessions");break;case"session:updated":n.current.add("sessions"),r?.sessionId&&e.invalidateQueries({queryKey:M.queryKeys.sessions.detail(r.sessionId)});break;case"session:completed":case"session:error":case"session:deleted":n.current.add("sessions"),n.current.add("costs"),r?.sessionId&&e.invalidateQueries({queryKey:M.queryKeys.sessions.detail(r.sessionId)});break;case"cron:completed":case"cron:error":n.current.add("cron");break;case"skills:changed":n.current.add("skills");break;default:return}s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{for(let t of n.current)switch(t){case"sessions":e.invalidateQueries({queryKey:M.queryKeys.sessions.all});break;case"costs":e.invalidateQueries({queryKey:["costs"]});break;case"cron":e.invalidateQueries({queryKey:M.queryKeys.cron.all});break;case"skills":e.invalidateQueries({queryKey:M.queryKeys.skills.all})}n.current.clear()},500)});return()=>{r(),s.current&&clearTimeout(s.current)}},[t,e])}(),null}e.s(["ClientProviders",0,function({children:e}){return(0,t.jsx)(r.QueryClientProvider,{client:m,children:(0,t.jsx)(g.ThemeProvider,{children:(0,t.jsx)(S.BreadcrumbProvider,{children:(0,t.jsx)(b.SettingsProvider,{children:(0,t.jsxs)(w,{children:[e,(0,t.jsx)(b.DocumentTitle,{}),(0,t.jsx)(D,{}),(0,t.jsx)(k,{})]})})})})})}],3971)}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,55087,e=>{"use strict";let t={accentColor:null,portalName:null,portalSubtitle:null,portalEmoji:null,portalIcon:null,iconBgHidden:!1,emojiOnly:!1,operatorName:null,language:"English",employeeOverrides:{}},s="jinn-settings";e.s(["DEFAULTS",0,t,"hexToAccentFill",0,function(e){let t=parseInt(e.slice(1,3),16),s=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return`rgba(${t},${s},${i},0.15)`},"hexToContrastText",0,function(e){let t=parseInt(e.slice(1,3),16)/255,s=parseInt(e.slice(3,5),16)/255,i=parseInt(e.slice(5,7),16)/255,r=e=>e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4);return .2126*r(t)+.7152*r(s)+.0722*r(i)>.4?"#000":"#fff"},"loadSettings",0,function(){try{let e=localStorage.getItem(s);if(!e)return{...t};let i=JSON.parse(e);return{...t,...i}}catch{return{...t}}},"saveSettings",0,function(e){localStorage.setItem(s,JSON.stringify(e))}])},93716,e=>{"use strict";let t=window.location.origin;async function s(e){try{let t=await e.json();if(t.error)return String(t.error);if(t.message)return String(t.message)}catch{}return`API error: ${e.status}`}async function i(e){let i=await fetch(`${t}${e}`);if(!i.ok)throw Error(await s(i));return i.json()}async function r(e,i){let r=await fetch(`${t}${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:i?JSON.stringify(i):void 0});if(!r.ok)throw Error(await s(r));return r.json()}async function n(e){let i=await fetch(`${t}${e}`,{method:"DELETE"});if(!i.ok)throw Error(await s(i));return i.json()}async function o(e,i){let r=await fetch(`${t}${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!r.ok)throw Error(await s(r));return r.json()}async function a(e,i){let r=await fetch(`${t}${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!r.ok)throw Error(await s(r));return r.json()}e.s(["api",0,{getStatus:()=>i("/api/status"),getSessions:()=>i("/api/sessions"),getSession:e=>i(`/api/sessions/${e}`),getSessionChildren:e=>i(`/api/sessions/${e}/children`),updateSession:(e,t)=>o(`/api/sessions/${e}`,t),deleteSession:e=>n(`/api/sessions/${e}`),duplicateSession:e=>r(`/api/sessions/${e}/duplicate`,{}),bulkDeleteSessions:e=>r("/api/sessions/bulk-delete",{ids:e}),createSession:e=>r("/api/sessions",e),createStubSession:e=>r("/api/sessions/stub",e),sendMessage:(e,t)=>r(`/api/sessions/${e}/message`,t),stopSession:e=>r(`/api/sessions/${e}/stop`,{}),resetSession:e=>r(`/api/sessions/${e}/reset`,{}),getCronJobs:()=>i("/api/cron"),getCronRuns:e=>i(`/api/cron/${e}/runs`),updateCronJob:(e,t)=>o(`/api/cron/${e}`,t),triggerCronJob:e=>r(`/api/cron/${e}/trigger`,{}),getOrg:()=>i("/api/org"),getEmployee:e=>i(`/api/org/employees/${e}`),updateEmployee:(e,t)=>a(`/api/org/employees/${e}`,t),getDepartmentBoard:e=>i(`/api/org/departments/${e}/board`),getSkills:()=>i("/api/skills"),getSkill:e=>i(`/api/skills/${e}`),getConfig:()=>i("/api/config"),reloadConnectors:()=>r("/api/connectors/reload",{}),updateConfig:e=>o("/api/config",e),getLogs:e=>i(`/api/logs${e?`?n=${e}`:""}`),getOnboarding:()=>i("/api/onboarding"),completeOnboarding:e=>r("/api/onboarding",e),getActivity:()=>i("/api/activity"),updateDepartmentBoard:(e,t)=>o(`/api/org/departments/${e}/board`,t),sttStatus:()=>i("/api/stt/status"),sttDownload:()=>r("/api/stt/download",{}),sttTranscribe:async(e,s)=>{let i=s?`?language=${encodeURIComponent(s)}`:"",r=new AbortController,n=setTimeout(()=>r.abort(),3e5);try{let s=await fetch(`${t}/api/stt/transcribe${i}`,{method:"POST",headers:{"Content-Type":e.type||"audio/webm"},body:e,signal:r.signal});if(!s.ok)throw Error(`API error: ${s.status}`);return s.json()}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)throw Error("Transcription timed out (5 min)");throw e}finally{clearTimeout(n)}},sttUpdateConfig:e=>o("/api/stt/config",{languages:e}),getSessionQueue:e=>i(`/api/sessions/${e}/queue`),cancelQueueItem:(e,t)=>n(`/api/sessions/${e}/queue/${t}`),clearSessionQueue:e=>n(`/api/sessions/${e}/queue`),pauseSessionQueue:e=>r(`/api/sessions/${e}/queue/pause`,{}),resumeSessionQueue:e=>r(`/api/sessions/${e}/queue/resume`,{}),getSessionTranscript:e=>i(`/api/sessions/${e}/transcript`),uploadFile:async e=>{let i=new FormData;i.append("file",e);let r=await fetch(`${t}/api/files`,{method:"POST",body:i});if(!r.ok)throw Error(await s(r));return r.json()}}])},36668,e=>{"use strict";var t=e.i(98181),s=e.i(25007),i=e.i(55087),r=e.i(93716);let n=(0,s.createContext)({settings:{accentColor:null,portalName:null,portalSubtitle:null,portalEmoji:null,portalIcon:null,iconBgHidden:!1,emojiOnly:!1,operatorName:null,language:"English",employeeOverrides:{}},setAccentColor:()=>{},setPortalName:()=>{},setPortalSubtitle:()=>{},setPortalEmoji:()=>{},setPortalIcon:()=>{},setIconBgHidden:()=>{},setEmojiOnly:()=>{},setOperatorName:()=>{},setLanguage:()=>{},setEmployeeOverride:()=>{},clearEmployeeOverride:()=>{},getEmployeeDisplay:e=>({emoji:e.emoji}),resetAll:()=>{}}),o=()=>(0,s.useContext)(n);e.s(["DocumentTitle",0,function(){let{settings:e}=o(),t=(0,s.useRef)(e.portalName);return t.current=e.portalName,(0,s.useEffect)(()=>{function e(){let e=t.current||"Jinn",s=`${e} - AI Gateway`;document.title!==s&&(document.title=s)}e();let s=document.querySelector("title");if(!s)return;let i=new MutationObserver(()=>e());return i.observe(s,{childList:!0,characterData:!0,subtree:!0}),()=>i.disconnect()},[e.portalName]),null},"SettingsProvider",0,function({children:e}){let[o,a]=(0,s.useState)({...i.DEFAULTS});(0,s.useEffect)(()=>{let e=(0,i.loadSettings)();a(e),r.api.getOnboarding().then(t=>{if(t.portalName||t.operatorName){let s={...e,...t.portalName&&{portalName:t.portalName},...t.operatorName&&{operatorName:t.operatorName}};a(s),(0,i.saveSettings)(s)}}).catch(()=>{})},[]),(0,s.useEffect)(()=>{let e=document.documentElement.style;o.accentColor?(e.setProperty("--accent",o.accentColor),e.setProperty("--accent-fill",(0,i.hexToAccentFill)(o.accentColor)),e.setProperty("--accent-contrast",(0,i.hexToContrastText)(o.accentColor))):(e.removeProperty("--accent"),e.removeProperty("--accent-fill"),e.removeProperty("--accent-contrast"))},[o.accentColor]);let u=(0,s.useCallback)(e=>{a(t=>{let s=e(t);return(0,i.saveSettings)(s),s})},[]),l=(0,s.useCallback)(e=>{u(t=>({...t,accentColor:e}))},[u]),c=(0,s.useCallback)(e=>{u(t=>({...t,portalName:e||null}))},[u]),h=(0,s.useCallback)(e=>{u(t=>({...t,portalSubtitle:e||null}))},[u]),d=(0,s.useCallback)(e=>{u(t=>({...t,portalEmoji:e||null}))},[u]),p=(0,s.useCallback)(e=>{u(t=>({...t,portalIcon:e}))},[u]),f=(0,s.useCallback)(e=>{u(t=>({...t,iconBgHidden:e}))},[u]),m=(0,s.useCallback)(e=>{u(t=>({...t,emojiOnly:e}))},[u]),y=(0,s.useCallback)(e=>{u(t=>({...t,operatorName:e||null}))},[u]),v=(0,s.useCallback)(e=>{u(t=>({...t,language:e||"English"}))},[u]),g=(0,s.useCallback)((e,t)=>{u(s=>{let i=s.employeeOverrides[e]||{};return{...s,employeeOverrides:{...s.employeeOverrides,[e]:{...i,...t}}}})},[u]),b=(0,s.useCallback)(e=>{u(t=>{let{[e]:s,...i}=t.employeeOverrides;return{...t,employeeOverrides:i}})},[u]),S=(0,s.useCallback)(e=>{let t=o.employeeOverrides[e.id];return{emoji:t?.emoji||e.emoji,profileImage:t?.profileImage,emojiOnly:o.emojiOnly}},[o.employeeOverrides,o.emojiOnly]),C=(0,s.useCallback)(()=>{u(()=>({accentColor:null,portalName:null,portalSubtitle:null,portalEmoji:null,portalIcon:null,iconBgHidden:!1,emojiOnly:!1,operatorName:null,language:"English",employeeOverrides:{}}))},[u]);return(0,t.jsx)(n.Provider,{value:{settings:o,setAccentColor:l,setPortalName:c,setPortalSubtitle:h,setPortalEmoji:d,setPortalIcon:p,setIconBgHidden:f,setEmojiOnly:m,setOperatorName:y,setLanguage:v,setEmployeeOverride:g,clearEmployeeOverride:b,getEmployeeDisplay:S,resetAll:C},children:e})},"useSettings",0,o])},78821,e=>{"use strict";var t=e.i(25007),s=e.i(98181),i=t.createContext(void 0);e.s(["QueryClientProvider",0,({client:e,children:r})=>(t.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,s.jsx)(i.Provider,{value:e,children:r})),"useQueryClient",0,e=>{let s=t.useContext(i);if(e)return e;if(!s)throw Error("No QueryClient set, use QueryClientProvider to set one");return s}])},82751,27904,e=>{"use strict";e.i(10661);var t={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},s=new class{#e=t;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};e.s(["systemSetTimeoutZero",0,function(e){setTimeout(e,0)},"timeoutManager",0,s],27904);var i="u"<typeof window||"Deno"in globalThis;function r(e,t){return(t?.queryKeyHashFn||n)(e)}function n(e){return JSON.stringify(e,(e,t)=>l(t)?Object.keys(t).sort().reduce((e,s)=>(e[s]=t[s],e),{}):t)}function o(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(s=>o(e[s],t[s]))}var a=Object.prototype.hasOwnProperty;function u(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function l(e){if(!c(e))return!1;let t=e.constructor;if(void 0===t)return!0;let s=t.prototype;return!!c(s)&&!!s.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function c(e){return"[object Object]"===Object.prototype.toString.call(e)}var h=Symbol();e.s(["addConsumeAwareSignal",0,function(e,t,s){let i,r=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?s():i.addEventListener("abort",s,{once:!0})),i)}),e},"addToEnd",0,function(e,t,s=0){let i=[...e,t];return s&&i.length>s?i.slice(1):i},"addToStart",0,function(e,t,s=0){let i=[t,...e];return s&&i.length>s?i.slice(0,-1):i},"ensureQueryFn",0,function(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==h?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))},"functionalUpdate",0,function(e,t){return"function"==typeof e?e(t):e},"hashKey",0,n,"hashQueryKeyByOptions",0,r,"isServer",0,i,"isValidTimeout",0,function(e){return"number"==typeof e&&e>=0&&e!==1/0},"matchMutation",0,function(e,t){let{exact:s,status:i,predicate:r,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(s){if(n(t.options.mutationKey)!==n(a))return!1}else if(!o(t.options.mutationKey,a))return!1}return(!i||t.state.status===i)&&(!r||!!r(t))},"matchQuery",0,function(e,t){let{type:s="all",exact:i,fetchStatus:n,predicate:a,queryKey:u,stale:l}=e;if(u){if(i){if(t.queryHash!==r(u,t.options))return!1}else if(!o(t.queryKey,u))return!1}if("all"!==s){let e=t.isActive();if("active"===s&&!e||"inactive"===s&&e)return!1}return("boolean"!=typeof l||t.isStale()===l)&&(!n||n===t.state.fetchStatus)&&(!a||!!a(t))},"noop",0,function(){},"partialMatchKey",0,o,"replaceData",0,function(e,t,s){return"function"==typeof s.structuralSharing?s.structuralSharing(e,t):!1!==s.structuralSharing?function e(t,s,i=0){if(t===s)return t;if(i>500)return s;let r=u(t)&&u(s);if(!r&&!(l(t)&&l(s)))return s;let n=(r?t:Object.keys(t)).length,o=r?s:Object.keys(s),c=o.length,h=r?Array(c):{},d=0;for(let u=0;u<c;u++){let l=r?u:o[u],c=t[l],p=s[l];if(c===p){h[l]=c,(r?u<n:a.call(t,l))&&d++;continue}if(null===c||null===p||"object"!=typeof c||"object"!=typeof p){h[l]=p;continue}let f=e(c,p,i+1);h[l]=f,f===c&&d++}return n===c&&d===n?t:h}(e,t):t},"resolveEnabled",0,function(e,t){return"function"==typeof e?e(t):e},"resolveStaleTime",0,function(e,t){return"function"==typeof e?e(t):e},"shallowEqualObjects",0,function(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let s in e)if(e[s]!==t[s])return!1;return!0},"shouldThrowError",0,function(e,t){return"function"==typeof e?e(...t):!!e},"skipToken",0,h,"sleep",0,function(e){return new Promise(t=>{s.setTimeout(t,e)})},"timeUntilStale",0,function(e,t){return Math.max(e+(t||0)-Date.now(),0)}],82751)},50079,e=>{"use strict";let t,s,i,r,n,o;var a=e.i(27904).systemSetTimeoutZero,u=(t=[],s=0,i=e=>{e()},r=e=>{e()},n=a,{batch:e=>{let o;s++;try{o=e()}finally{let e;--s||(e=t,t=[],e.length&&n(()=>{r(()=>{e.forEach(e=>{i(e)})})}))}return o},batchCalls:e=>(...t)=>{o(()=>{e(...t)})},schedule:o=e=>{s?t.push(e):n(()=>{i(e)})},setNotifyFunction:e=>{i=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{n=e}});e.s(["notifyManager",0,u])},29679,e=>{"use strict";e.s(["Subscribable",0,class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}])},72940,e=>{"use strict";var t=e.i(29679),s=e.i(82751),i=new class extends t.Subscribable{#s;#i;#r;constructor(){super(),this.#r=e=>{if(!s.isServer&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#i||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#i?.(),this.#i=void 0)}setEventListener(e){this.#r=e,this.#i?.(),this.#i=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#s!==e&&(this.#s=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#s?this.#s:globalThis.document?.visibilityState!=="hidden"}};e.s(["focusManager",0,i])},74403,48327,82900,7363,9283,e=>{"use strict";e.i(10661);var t=e.i(82751),s=e.i(50079),i=e.i(72940),r=e.i(29679),n=new class extends r.Subscribable{#n=!0;#i;#r;constructor(){super(),this.#r=e=>{if(!t.isServer&&window.addEventListener){let t=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#i||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#i?.(),this.#i=void 0)}setEventListener(e){this.#r=e,this.#i?.(),this.#i=e(this.setOnline.bind(this))}setOnline(e){this.#n!==e&&(this.#n=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#n}};function o(){let e,t,s=new Promise((s,i)=>{e=s,t=i});function i(e){Object.assign(s,e),delete s.resolve,delete s.reject}return s.status="pending",s.catch(()=>{}),s.resolve=t=>{i({status:"fulfilled",value:t}),e(t)},s.reject=e=>{i({status:"rejected",reason:e}),t(e)},s}function a(e){return Math.min(1e3*2**e,3e4)}function u(e){return(e??"online")!=="online"||n.isOnline()}e.s(["onlineManager",0,n],48327),e.s(["pendingThenable",0,o],82900);var l=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function c(e){let s,r=!1,c=0,h=o(),d=()=>i.focusManager.isFocused()&&("always"===e.networkMode||n.isOnline())&&e.canRun(),p=()=>u(e.networkMode)&&e.canRun(),f=e=>{"pending"===h.status&&(s?.(),h.resolve(e))},m=e=>{"pending"===h.status&&(s?.(),h.reject(e))},y=()=>new Promise(t=>{s=e=>{("pending"!==h.status||d())&&t(e)},e.onPause?.()}).then(()=>{s=void 0,"pending"===h.status&&e.onContinue?.()}),v=()=>{let s;if("pending"!==h.status)return;let i=0===c?e.initialPromise:void 0;try{s=i??e.fn()}catch(e){s=Promise.reject(e)}Promise.resolve(s).then(f).catch(s=>{if("pending"!==h.status)return;let i=e.retry??3*!t.isServer,n=e.retryDelay??a,o="function"==typeof n?n(c,s):n,u=!0===i||"number"==typeof i&&c<i||"function"==typeof i&&i(c,s);r||!u?m(s):(c++,e.onFail?.(c,s),(0,t.sleep)(o).then(()=>d()?void 0:y()).then(()=>{r?m(s):v()}))})};return{promise:h,status:()=>h.status,cancel:t=>{if("pending"===h.status){let s=new l(t);m(s),e.onCancel?.(s)}},continue:()=>(s?.(),h),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:p,start:()=>(p()?v():y().then(v),h)}}e.s(["CancelledError",0,l,"canFetch",0,u,"createRetryer",0,c],7363);var h=e.i(27904),d=class{#o;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,t.isValidTimeout)(this.gcTime)&&(this.#o=h.timeoutManager.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(t.isServer?1/0:3e5))}clearGcTimeout(){this.#o&&(h.timeoutManager.clearTimeout(this.#o),this.#o=void 0)}};e.s(["Removable",0,d],9283);var p=class extends d{#a;#u;#l;#c;#h;#d;#p;constructor(e){super(),this.#p=!1,this.#d=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#c=e.client,this.#l=this.#c.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#a=y(this.options),this.state=e.state??this.#a,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#h?.promise}setOptions(e){if(this.options={...this.#d,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=y(this.options);void 0!==e.data&&(this.setState(m(e.data,e.dataUpdatedAt)),this.#a=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#l.remove(this)}setData(e,s){let i=(0,t.replaceData)(this.state.data,e,this.options);return this.#f({data:i,type:"success",dataUpdatedAt:s?.updatedAt,manual:s?.manual}),i}setState(e,t){this.#f({type:"setState",state:e,setStateOptions:t})}cancel(e){let s=this.#h?.promise;return this.#h?.cancel(e),s?s.then(t.noop).catch(t.noop):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#a)}isActive(){return this.observers.some(e=>!1!==(0,t.resolveEnabled)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===t.skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,t.resolveStaleTime)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,t.timeUntilStale)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#l.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#h&&(this.#p?this.#h.cancel({revert:!0}):this.#h.cancelRetry()),this.scheduleGc()),this.#l.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#f({type:"invalidate"})}async fetch(e,s){let i;if("idle"!==this.state.fetchStatus&&this.#h?.status()!=="rejected"){if(void 0!==this.state.data&&s?.cancelRefetch)this.cancel({silent:!0});else if(this.#h)return this.#h.continueRetry(),this.#h.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let r=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#p=!0,r.signal)})},o=()=>{let e,i=(0,t.ensureQueryFn)(this.options,s),r=(n(e={client:this.#c,queryKey:this.queryKey,meta:this.meta}),e);return(this.#p=!1,this.options.persister)?this.options.persister(i,r,this):i(r)},a=(n(i={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:this.#c,state:this.state,fetchFn:o}),i);this.options.behavior?.onFetch(a,this),this.#u=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#f({type:"fetch",meta:a.fetchOptions?.meta}),this.#h=c({initialPromise:s?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof l&&e.revert&&this.setState({...this.#u,fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:()=>{this.#f({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#h.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#l.config.onSuccess?.(e,this),this.#l.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof l){if(e.silent)return this.#h.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#f({type:"error",error:e}),this.#l.config.onError?.(e,this),this.#l.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#f(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...f(t.data,this.options),fetchMeta:e.meta??null};case"success":let s={...t,...m(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#u=e.manual?s:void 0,s;case"error":let i=e.error;return{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),s.notifyManager.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#l.notify({query:this,type:"updated",action:e})})}};function f(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:u(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function m(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function y(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,s=void 0!==t,i=s?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}e.s(["Query",0,p,"fetchState",0,f],74403)},76590,e=>{"use strict";var t=e.i(50079),s=e.i(9283),i=e.i(7363),r=class extends s.Removable{#c;#m;#y;#h;constructor(e){super(),this.#c=e.client,this.mutationId=e.mutationId,this.#y=e.mutationCache,this.#m=[],this.state=e.state||n(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#m.includes(e)||(this.#m.push(e),this.clearGcTimeout(),this.#y.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#m=this.#m.filter(t=>t!==e),this.scheduleGc(),this.#y.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#m.length||("pending"===this.state.status?this.scheduleGc():this.#y.remove(this))}continue(){return this.#h?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#f({type:"continue"})},s={client:this.#c,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#h=(0,i.createRetryer)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#f({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#f({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#y.canRun(this)});let r="pending"===this.state.status,n=!this.#h.canStart();try{if(r)t();else{this.#f({type:"pending",variables:e,isPaused:n}),this.#y.config.onMutate&&await this.#y.config.onMutate(e,this,s);let t=await this.options.onMutate?.(e,s);t!==this.state.context&&this.#f({type:"pending",context:t,variables:e,isPaused:n})}let i=await this.#h.start();return await this.#y.config.onSuccess?.(i,e,this.state.context,this,s),await this.options.onSuccess?.(i,e,this.state.context,s),await this.#y.config.onSettled?.(i,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(i,null,e,this.state.context,s),this.#f({type:"success",data:i}),i}catch(t){try{await this.#y.config.onError?.(t,e,this.state.context,this,s)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,s)}catch(e){Promise.reject(e)}try{await this.#y.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,s)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,s)}catch(e){Promise.reject(e)}throw this.#f({type:"error",error:t}),t}finally{this.#y.runNext(this)}}#f(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),t.notifyManager.batch(()=>{this.#m.forEach(t=>{t.onMutationUpdate(e)}),this.#y.notify({mutation:this,type:"updated",action:e})})}};function n(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}e.s(["Mutation",0,r,"getDefaultState",0,n])},13765,e=>{"use strict";var t=e.i(98181),s=e.i(25007);let i=(0,s.createContext)({theme:"ryoko",setTheme:()=>{}}),r="openryoko-theme";e.s(["ThemeProvider",0,function({children:e}){let[n,o]=(0,s.useState)("ryoko"),a=(0,s.useCallback)(e=>{o(e),localStorage.setItem(r,e);let t=document.documentElement;if(t.removeAttribute("data-theme"),"system"===e){let e=window.matchMedia("(prefers-color-scheme: dark)").matches;t.setAttribute("data-theme",e?"dark":"ryoko")}else t.setAttribute("data-theme",e)},[]);return(0,s.useEffect)(()=>{let e=function(){let e=localStorage.getItem(r);if(e)return e;let t=localStorage.getItem("jinn-theme");return t?(localStorage.setItem(r,t),t):null}();e&&a(e)},[a]),(0,s.useEffect)(()=>{let e=window.matchMedia("(prefers-color-scheme: dark)");function t(){"system"===localStorage.getItem(r)&&document.documentElement.setAttribute("data-theme",e.matches?"dark":"ryoko")}return e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]),(0,t.jsx)(i.Provider,{value:{theme:n,setTheme:a},children:e})},"useTheme",0,function(){return(0,s.useContext)(i)}])},63490,e=>{"use strict";var t=e.i(10661);e.s(["createGatewaySocket",0,function(e,s){let i=t.default.env.NEXT_PUBLIC_GATEWAY_URL,r=i?`${i.replace(/^http/,"ws")}/ws`:`${"https:"===window.location.protocol?"wss:":"ws:"}//${window.location.host}/ws`,n=null,o=null,a=!1;return!function t(){a||((n=new WebSocket(r)).onopen=()=>{s?.onOpen?.()},n.onmessage=t=>{try{let s=JSON.parse(t.data);e(s.event,s.payload)}catch{}},n.onclose=()=>{s?.onClose?.(),a||(o=setTimeout(t,3e3))},n.onerror=()=>n?.close())}(),{close:()=>{a=!0,o&&clearTimeout(o),n?.close()}}}])},92105,e=>{"use strict";var t=e.i(25007);let s=(0,t.createContext)({notifications:[],unreadCount:0,toasts:[],pushFromEvent:()=>{},dismissToast:()=>{},markAllRead:()=>{},markRead:()=>{},clearAll:()=>{}});e.s(["NotificationContext",0,s,"useNotifications",0,function(){return(0,t.useContext)(s)}])},32984,e=>{"use strict";var t=e.i(25007),s=e.i(63490);e.s(["useGateway",0,function(){let[e,i]=(0,t.useState)([]),[r,n]=(0,t.useState)(!1),[o,a]=(0,t.useState)(0),[u,l]=(0,t.useState)(0),c=(0,t.useRef)(new Set);return(0,t.useEffect)(()=>{let e=(0,s.createGatewaySocket)((e,t)=>{for(let s of(i(s=>[...s.slice(-99),{event:e,payload:t}]),"skills:changed"===e&&l(e=>e+1),c.current))s(e,t)},{onOpen:()=>{n(!0),a(e=>e+1)},onClose:()=>{n(!1)}});return()=>e.close()},[]),{events:e,connected:r,connectionSeq:o,skillsVersion:u,subscribe:(0,t.useCallback)(e=>(c.current.add(e),()=>{c.current.delete(e)}),[])}}])},97478,e=>{"use strict";e.s(["queryKeys",0,{sessions:{all:["sessions"],detail:e=>["sessions",e],children:e=>["sessions",e,"children"],transcript:e=>["sessions",e,"transcript"],queue:e=>["sessions",e,"queue"]},org:{all:["org"],employee:e=>["org","employees",e],board:e=>["org","departments",e,"board"]},cron:{all:["cron"],runs:e=>["cron",e,"runs"]},skills:{all:["skills"],detail:e=>["skills",e]},config:["config"],status:["status"],onboarding:["onboarding"]}])},11322,e=>{"use strict";var t=e.i(98181),s=e.i(25007);let i=(0,s.createContext)({items:[],setItems:()=>{}});e.s(["BreadcrumbProvider",0,function({children:e}){let[r,n]=(0,s.useState)([]);return(0,s.useEffect)(()=>{if(r.length>0){let e=r.map(e=>e.label).join(" > ");document.title=`${e} - Jinn`}},[r]),(0,t.jsx)(i.Provider,{value:{items:r,setItems:n},children:e})},"useBreadcrumbs",0,function(e){let t=(0,s.useContext)(i),r=e?JSON.stringify(e):"";return(0,s.useEffect)(()=>{e&&t.setItems(e)},[r]),t}])}]);
@@ -0,0 +1 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,41385,(e,r,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},84397,(e,r,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={DecodeError:function(){return P},MiddlewareNotFoundError:function(){return O},MissingStaticPage:function(){return h},NormalizeError:function(){return E},PageNotFoundError:function(){return b},SP:function(){return m},ST:function(){return y},WEB_VITALS:function(){return i},execOnce:function(){return u},getDisplayName:function(){return l},getLocationOrigin:function(){return c},getURL:function(){return f},isAbsoluteUrl:function(){return a},isResSent:function(){return d},loadGetInitialProps:function(){return g},normalizeRepeatedSlashes:function(){return p},stringifyError:function(){return N}};for(var o in n)Object.defineProperty(t,o,{enumerable:!0,get:n[o]});let i=["CLS","FCP","FID","INP","LCP","TTFB"];function u(e){let r,t=!1;return(...n)=>(t||(t=!0,r=e(...n)),r)}let s=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,a=e=>s.test(e);function c(){let{protocol:e,hostname:r,port:t}=window.location;return`${e}//${r}${t?":"+t:""}`}function f(){let{href:e}=window.location,r=c();return e.substring(r.length)}function l(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function d(e){return e.finished||e.headersSent}function p(e){let r=e.split("?");return r[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(r[1]?`?${r.slice(1).join("?")}`:"")}async function g(e,r){let t=r.res||r.ctx&&r.ctx.res;if(!e.getInitialProps)return r.ctx&&r.Component?{pageProps:await g(r.Component,r.ctx)}:{};let n=await e.getInitialProps(r);if(t&&d(t))return n;if(!n)throw Object.defineProperty(Error(`"${l(e)}.getInitialProps()" should resolve to an object. But found "${n}" instead.`),"__NEXT_ERROR_CODE",{value:"E1025",enumerable:!1,configurable:!0});return n}let m="u">typeof performance,y=m&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class P extends Error{}class E extends Error{}class b extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message=`Cannot find module for page: ${e}`}}class h extends Error{constructor(e,r){super(),this.message=`Failed to load static file for page: ${e} ${r}`}}class O extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function N(e){return JSON.stringify({message:e.message,stack:e.stack})}},33290,(e,r,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={assign:function(){return a},searchParamsToUrlQuery:function(){return i},urlQueryToSearchParams:function(){return s}};for(var o in n)Object.defineProperty(t,o,{enumerable:!0,get:n[o]});function i(e){let r={};for(let[t,n]of e.entries()){let e=r[t];void 0===e?r[t]=n:Array.isArray(e)?e.push(n):r[t]=[e,n]}return r}function u(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function s(e){let r=new URLSearchParams;for(let[t,n]of Object.entries(e))if(Array.isArray(n))for(let e of n)r.append(t,u(e));else r.set(t,u(n));return r}function a(e,...r){for(let t of r){for(let r of t.keys())e.delete(r);for(let[r,n]of t.entries())e.append(r,n)}return e}}]);