@nightkatana/kronosys-app 1.0.0-beta.37 → 1.0.0-beta.39

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 (58) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/BUILD_ID +1 -1
  3. package/.next/standalone/.next/build-manifest.json +2 -2
  4. package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  5. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  12. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  14. package/.next/standalone/.next/server/app/api/action/route.js +1 -1
  15. package/.next/standalone/.next/server/app/changelog/page_client-reference-manifest.js +1 -1
  16. package/.next/standalone/.next/server/app/guide/page_client-reference-manifest.js +1 -1
  17. package/.next/standalone/.next/server/app/implementation/page_client-reference-manifest.js +1 -1
  18. package/.next/standalone/.next/server/app/licenses/page_client-reference-manifest.js +1 -1
  19. package/.next/standalone/.next/server/app/logs/page_client-reference-manifest.js +1 -1
  20. package/.next/standalone/.next/server/app/page.js +3 -3
  21. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  22. package/.next/standalone/.next/server/app/reporting/page.js +1 -1
  23. package/.next/standalone/.next/server/app/reporting/page_client-reference-manifest.js +1 -1
  24. package/.next/standalone/.next/server/app/settings/page.js +1 -1
  25. package/.next/standalone/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  26. package/.next/standalone/.next/server/chunks/23.js +1 -1
  27. package/.next/standalone/.next/server/chunks/277.js +1 -1
  28. package/.next/standalone/.next/server/chunks/642.js +1 -1
  29. package/.next/standalone/.next/server/chunks/740.js +1 -1
  30. package/.next/standalone/.next/server/chunks/752.js +3 -3
  31. package/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
  32. package/.next/standalone/.next/server/pages/500.html +1 -1
  33. package/.next/standalone/.next/static/chunks/{227-36e1856ef492dee1.js → 227-ac9bbcd07955fca9.js} +1 -1
  34. package/.next/standalone/.next/static/chunks/400-cbb295eb4a4632f3.js +1 -0
  35. package/.next/standalone/.next/static/chunks/569-aafda3bfeb1cb4e5.js +1 -0
  36. package/.next/standalone/.next/static/chunks/702-033cf3571bb1add5.js +3 -0
  37. package/.next/standalone/.next/static/chunks/840-83aa65cc3eee5ac5.js +1 -0
  38. package/.next/standalone/.next/static/chunks/918-30897bc0b3f88e97.js +1 -0
  39. package/.next/standalone/.next/static/chunks/952-4037952633818146.js +1 -0
  40. package/.next/standalone/.next/static/chunks/app/page-74a25ca62ff92f6d.js +25 -0
  41. package/.next/standalone/.next/static/chunks/app/reporting/page-8e6695901d8adc26.js +1 -0
  42. package/.next/standalone/.next/static/chunks/app/settings/page-2881390ef5c8c138.js +1 -0
  43. package/.next/standalone/.next/static/css/2cef87557f7a0efb.css +1 -0
  44. package/.next/standalone/kronosys-package-meta.json +1 -1
  45. package/.next/standalone/package.json +1 -1
  46. package/package.json +1 -1
  47. package/.next/standalone/.next/static/chunks/400-61f952b1ee828fea.js +0 -1
  48. package/.next/standalone/.next/static/chunks/569-87eaac9eac7c21d8.js +0 -1
  49. package/.next/standalone/.next/static/chunks/702-8aac482ad91ed5d5.js +0 -3
  50. package/.next/standalone/.next/static/chunks/840-81defb97b2783f89.js +0 -1
  51. package/.next/standalone/.next/static/chunks/918-6b01bbc7d03b08e7.js +0 -1
  52. package/.next/standalone/.next/static/chunks/952-150a5b20c9255b4a.js +0 -1
  53. package/.next/standalone/.next/static/chunks/app/page-f90f10d17428272f.js +0 -25
  54. package/.next/standalone/.next/static/chunks/app/reporting/page-eb784ca2579dab1f.js +0 -1
  55. package/.next/standalone/.next/static/chunks/app/settings/page-e32584d89b43e548.js +0 -1
  56. package/.next/standalone/.next/static/css/bda87aa373a08430.css +0 -1
  57. /package/.next/standalone/.next/static/{U4YV5CT2J48wEvakHC8wa → 6ttfOnXHYUIE_dlJ927gI}/_buildManifest.js +0 -0
  58. /package/.next/standalone/.next/static/{U4YV5CT2J48wEvakHC8wa → 6ttfOnXHYUIE_dlJ927gI}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[662],{434:(e,t,a)=>{Promise.resolve().then(a.bind(a,3700))},2194:(e,t,a)=>{"use strict";a.d(t,{F7:()=>d,I2:()=>o,dM:()=>l});var s=a(5112);let r="dashboardCalendarWeekStartsOn",n={sunday:0,monday:1,saturday:6};function i(e){return"monday"===e||"sunday"===e||"saturday"===e}function l(e){let t=e?.[r];return i(t)?t:"sunday"}function o(e){let t=e?.[r];return i(t)?t:(0,s.EU)()}function d(e){return n[e]}},2725:(e,t,a)=>{"use strict";a.d(t,{p:()=>p});var s=a(5155),r=a(2115),n=a(3321),i=a(8428),l=a(3098),o=a(8646),d=a(6383),c=a(3666),m=a(9137),x=a(3996),u=a(2635);function h(e,t){let a=e?.current,s=e?.historyArchived||[],r=e?(0,x.t)(e.history||[],a):[],n=e?.inspectingSessionId,i=(0,u.k)(t,e,a,r,s),l="ok"===i.mode,o="string"==typeof a?.sessionId?a.sessionId.trim():"",d="ok"===i.mode?i.id.trim():"",c=l&&d!==o?d:"string"==typeof n&&""!==n.trim()?n.trim():null,m=(c?r.find(e=>e.sessionId===c)||s.find(e=>e.sessionId===c):void 0)??a;return{live:a,history:r,historyArchived:s,sessionCurrent:m}}var b=a(3228),g=a(4695);function p({dt:e,lang:t,dashboardSessionNavId:a,onManualRefresh:x,toolbarDomId:u}){let v=(0,n.useRouter)(),{payload:f,refresh:k}=(0,i.y)(),y="string"==typeof a?a.trim():"",j=(0,r.useCallback)(e=>{v.push((0,m.c)("/","string"==typeof e&&""!==e.trim()?e.trim():void 0))},[v]),N=(0,r.useCallback)(async e=>{await (0,l.$)(e),await k({routerInvalidate:!0})},[k]),z=(0,r.useCallback)(async e=>{let{live:t}=h(f,y),a=e===("string"==typeof t?.sessionId?t.sessionId.trim():"");a?(await (0,l.$)({type:"inspectSession",sessionId:null}),await (0,l.$)({type:"setPaused",paused:!1})):await (0,l.$)({type:"inspectSession",sessionId:e}),await k({routerInvalidate:!0}),j(a?null:e)},[y,f,j,k]),w=(0,r.useMemo)(()=>({newSession:()=>{(0,b.IX)(),j(""!==y?y:null)},refresh:()=>void x(),openReporting:()=>void v.push((0,m.c)("/reporting",y||void 0)),openSettings:()=>void v.push((0,m.c)("/settings",y||void 0)),openUserGuide:()=>void v.push((0,m.c)("/guide",y||void 0)),focusSessions:()=>{(0,b.Bj)("sessions"),j(""!==y?y:null)},focusTasks:()=>{(0,b.Bj)("tasks"),j(""!==y?y:null)},focusTags:()=>{(0,b.Bj)("tags"),j(""!==y?y:null)},toggleLang:()=>void N({type:"setLanguage",lang:"fr"===t?"en":"fr"}),toggleFocusMode:()=>{g.Z.getState().toggleFocusMode(),j(""!==y?y:null)}}),[t,y,x,N,j,v]),{history:S,historyArchived:T,sessionCurrent:C,live:D}=(0,r.useMemo)(()=>h(f,y),[y,f]),E=D&&"string"==typeof D.sessionId&&""!==D.sessionId.trim()?{sessionId:D.sessionId.trim(),sessionPaused:!0===D.isPaused}:null,P=(0,r.useMemo)(()=>(0,c.EW)(f?.taskTemplates),[f]),L=(0,r.useMemo)(()=>(0,d.g)({history:S,historyArchived:T,sessionCurrent:C,dt:e,liveSearchContext:E,taskTemplates:P,onSelectTaskTemplate:e=>{(0,b.Ef)(e),(0,b.Bj)("tasks");let t="string"==typeof C?.sessionId?C.sessionId.trim():"string"==typeof D?.sessionId?D.sessionId.trim():""!==y?y:"";j(""!==t?t:null)},onSelectSession:e=>{z(e)},scrollToSession:e=>{(0,b.YG)(e),z(e)},focusTasksColumn:()=>{(0,b.Bj)("tasks"),j(""!==y?y:null)},scrollToTask:e=>{(0,b.Tr)(e),(0,b.Bj)("tasks");let t="string"==typeof C?.sessionId?C.sessionId.trim():"string"==typeof D?.sessionId?D.sessionId.trim():""!==y?y:"";j(""!==t?t:null)}}),[e,S,T,D,E,y,j,z,C,P]);return(0,s.jsx)(o.L,{dt:e,handlers:w,searchItems:L,toolbarDomId:u})}},3030:(e,t,a)=>{"use strict";a.d(t,{n:()=>i});var s=a(5155),r=a(9921),n=a(2115);function i({ariaLabel:e}){let[t,a]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=()=>{a(globalThis.scrollY>320)};return e(),globalThis.addEventListener("scroll",e,{passive:!0}),()=>globalThis.removeEventListener("scroll",e)},[]);let l=(0,n.useCallback)(()=>{globalThis.scrollTo({top:0,behavior:"function"==typeof globalThis.matchMedia&&globalThis.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"})},[]);return t?(0,s.jsx)("button",{type:"button",onClick:l,"aria-label":e,className:"fixed bottom-6 right-4 z-40 flex h-11 w-11 items-center justify-center rounded-full border border-zinc-300 bg-white/95 text-zinc-700 shadow-lg shadow-zinc-900/10 backdrop-blur-sm transition-colors hover:border-violet-500/60 hover:bg-violet-50 hover:text-violet-800 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-violet-500 dark:border-zinc-600 dark:bg-zinc-900/95 dark:text-zinc-200 dark:shadow-black/40 dark:hover:border-violet-500/70 dark:hover:bg-zinc-800 dark:hover:text-violet-100 sm:right-6",children:(0,s.jsx)(r.A,{className:"h-6 w-6",strokeWidth:2.25,"aria-hidden":!0})}):null}},3700:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>eu});var s=a(5155),r=a(2115),n=a(8500),i=a.n(n),l=a(3321),o=a(3098),d=a(8428),c=a(8090),m=a(4562),x=a(21),u=a(7856);function h({t:e,sync:t,mongoEnabled:a}){if(!a||!t||"disabled"===t.status)return null;let r=null===t.mongoDocumentCount?"—":String(t.mongoDocumentCount),n="aligned"===t.status?e.mongoSyncStatusAligned:"unknown"===t.status?e.mongoSyncStatusUnknown:"localAhead"===t.status?e.mongoSyncStatusLocalAhead:e.mongoSyncStatusMongoAhead,i="aligned"===t.status?"text-emerald-400/90":"text-amber-400/90";return(0,s.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] text-zinc-400",role:"status","aria-live":"polite",children:[(0,s.jsxs)("span",{children:[(0,s.jsxs)("span",{className:"text-zinc-500",children:[e.mongoSyncLocalLabel,":"]})," ",t.localPersistedCount,(0,s.jsx)("span",{className:"mx-1.5 text-zinc-600","aria-hidden":!0,children:"\xb7"}),(0,s.jsxs)("span",{className:"text-zinc-500",children:[e.mongoSyncMongoLabel,":"]})," ",r]}),(0,s.jsx)("span",{className:`font-medium ${i}`,children:n}),(0,s.jsx)(u.p,{ariaLabel:e.mongoSyncHelpAriaLabel,body:e.mongoSyncHelpBody})]})}var b=a(8783),g=a(8578),p=a(9840),v=a(8778),f=a(7634),k=a(2725),y=a(6664),j=a(2094),N=a(6830),z=a(7792),w=a(6032),S=a(1996),T=a(1773),C=a(2194),D=a(1555);let E=["node_modules",".git","dist","out","build",".next","coverage","target","__pycache__",".venv","venv","vendor",".turbo",".cache",".idea"];var P=a(9281),L=a(3030),A=a(1913),I=a(6523),B=a(7262),H=a(3478),M=a(7650),R=a(4747);let F=["#settings-tour-anchor-intro","#settings-usage-profile","#settings-history","#settings-git","#settings-workspace-loc","#settings-schedule"];function U({open:e,onOpenChange:t,dt:a}){var n;let[i,l]=(0,r.useState)(0),[d,c]=(0,r.useState)(null),[m,x]=(0,r.useState)({}),u=(0,r.useRef)(null),h=(0,r.useRef)(null),b=(0,r.useMemo)(()=>[{title:a.settingsTourStep1Title,body:a.settingsTourStep1Body},{title:a.settingsTourStep2Title,body:a.settingsTourStep2Body},{title:a.settingsTourStep3Title,body:a.settingsTourStep3Body},{title:a.settingsTourStep4Title,body:a.settingsTourStep4Body},{title:a.settingsTourStep5Title,body:a.settingsTourStep5Body},{title:a.settingsTourStep6Title,body:a.settingsTourStep6Body}],[a]),g=b.length,p=i>=g-1,v=b[i]??b[0],f=F[Math.min(i,F.length-1)];(0,r.useEffect)(()=>{e&&l(0)},[e]);let k=(0,r.useCallback)(e=>{(0,o.$)({type:"tourInteraction",tour:"settings_spotlight",action:e,stepIndex:i,stepTotal:g}).catch(()=>void 0),R.r.getState().markSettingsCompleted(),t(!1)},[t,i,g]);n=()=>k("escape"),(0,r.useEffect)(()=>{if(!e)return;let t=e=>{"Escape"===e.key&&(e.preventDefault(),n())};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[e,n]);let y=(0,r.useCallback)(()=>{var t;if(!e)return void c(null);let a=document.querySelector(f);a&&a instanceof HTMLElement?c({top:(t=a.getBoundingClientRect()).top-10,left:t.left-10,width:t.width+20,height:t.height+20}):c(null)},[e,f]);if((0,r.useLayoutEffect)(()=>{if(!e)return void c(null);let t=document.querySelector(f);t instanceof HTMLElement&&t.scrollIntoView({block:"center",inline:"nearest",behavior:"auto"}),y();let a=requestAnimationFrame(y);window.addEventListener("scroll",y,!0),window.addEventListener("resize",y);let s=t instanceof HTMLElement?t:null,r=s&&"u">typeof ResizeObserver?new ResizeObserver(()=>y()):null;return s&&r&&r.observe(s),()=>{cancelAnimationFrame(a),window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",y),r?.disconnect()}},[e,f,i,y]),(0,r.useLayoutEffect)(()=>{if(!e)return;let t=window.innerWidth,a=window.innerHeight,s=Math.min(360,t-24);if(!d)return void x({position:"fixed",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:s,maxWidth:"calc(100vw - 2rem)",zIndex:212});let r=u.current,n=r?.getBoundingClientRect().height??220,i=d.top+d.height+12;i+n>a-12&&d.top-12-n>=12&&(i=d.top-12-n),i=Math.max(12,Math.min(i,a-n-12));let l=d.left+d.width/2-s/2;x({position:"fixed",top:i,left:l=Math.max(12,Math.min(l,t-s-12)),transform:void 0,width:s,maxWidth:void 0,zIndex:212})},[e,d,i,v.title,v.body]),(0,r.useEffect)(()=>{if(!e)return;let t=window.setTimeout(()=>h.current?.focus(),80);return()=>window.clearTimeout(t)},[e,i]),!e)return null;let j=a.settingsTourProgressLabel.replace("{n}",String(i+1)).replace("{total}",String(g)),N="rounded-lg bg-violet-600 px-4 py-2 text-sm font-medium text-white transition hover:bg-violet-700 focus:outline-none focus:ring-2 focus:ring-violet-500 focus:ring-offset-2 dark:bg-violet-500 dark:hover:bg-violet-600 dark:focus:ring-offset-zinc-900",z=window.innerWidth,w=window.innerHeight,S=d?null:(0,s.jsx)("div",{className:"fixed inset-0 z-[210] bg-black/55","aria-hidden":!0}),T=d&&z>0&&w>0?(()=>{let{top:e,left:t,width:a,height:r}=d,n=Math.max(0,e),i=e+r,l=Math.max(0,w-i),o=Math.max(0,t),c=t+a,m=Math.max(0,z-c);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"fixed bg-black/55",style:{top:0,left:0,width:z,height:n,zIndex:210},"aria-hidden":!0}),(0,s.jsx)("div",{className:"fixed bg-black/55",style:{top:i,left:0,width:z,height:l,zIndex:210},"aria-hidden":!0}),(0,s.jsx)("div",{className:"fixed bg-black/55",style:{top:e,left:0,width:o,height:r,zIndex:210},"aria-hidden":!0}),(0,s.jsx)("div",{className:"fixed bg-black/55",style:{top:e,left:c,width:m,height:r,zIndex:210},"aria-hidden":!0}),(0,s.jsx)("div",{className:"pointer-events-none fixed rounded-xl border-2 border-violet-500 shadow-[0_0_0_1px_rgba(139,92,246,0.35)] dark:border-violet-400 dark:shadow-[0_0_0_1px_rgba(167,139,250,0.35)]",style:{top:e,left:t,width:a,height:r,zIndex:211},"aria-hidden":!0})]})})():null;return(0,M.createPortal)((0,s.jsxs)(s.Fragment,{children:[S,T,(0,s.jsxs)("div",{ref:u,role:"dialog","aria-modal":"true","aria-labelledby":"settings-tour-title","aria-describedby":"settings-tour-body",className:"rounded-xl border border-zinc-300 bg-white shadow-2xl dark:border-zinc-600 dark:bg-zinc-900",style:m,onMouseDown:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"border-b border-zinc-200 px-4 py-3 dark:border-zinc-700",children:[(0,s.jsx)("p",{className:"text-xs font-medium uppercase tracking-wide text-violet-600 dark:text-violet-300",children:j}),(0,s.jsx)("h2",{id:"settings-tour-title",className:"mt-1 text-base font-semibold text-zinc-900 dark:text-zinc-100",children:v.title})]}),(0,s.jsx)("div",{id:"settings-tour-body",className:"max-h-[min(42vh,18rem)] overflow-y-auto px-4 py-3",children:(0,s.jsx)("p",{className:"whitespace-pre-wrap text-sm leading-relaxed text-zinc-700 dark:text-zinc-300",children:v.body})}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 border-t border-zinc-200 px-4 py-3 dark:border-zinc-700",children:[(0,s.jsx)("div",{className:"flex gap-1.5",role:"presentation","aria-hidden":!0,children:b.map((e,t)=>(0,s.jsx)("span",{className:`h-2 w-2 rounded-full ${t===i?"bg-violet-500 dark:bg-violet-400":"bg-zinc-300 dark:bg-zinc-600"}`},t))}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[(0,s.jsx)("button",{type:"button",className:"text-sm text-zinc-500 underline-offset-2 hover:text-zinc-800 hover:underline dark:text-zinc-400 dark:hover:text-zinc-200",onClick:()=>k("skip"),children:a.settingsTourSkipBtn}),i>0?(0,s.jsx)("button",{type:"button",className:"rounded-lg border border-zinc-300 bg-white px-4 py-2 text-sm font-medium text-zinc-800 transition hover:bg-zinc-50 dark:border-zinc-600 dark:bg-zinc-800 dark:text-zinc-200 dark:hover:bg-zinc-700",onClick:()=>l(e=>Math.max(0,e-1)),children:a.settingsTourBackBtn}):null,p?(0,s.jsx)("button",{ref:h,type:"button",className:N,onClick:()=>k("done"),children:a.settingsTourDoneBtn}):(0,s.jsx)("button",{ref:h,type:"button",className:N,onClick:()=>l(e=>Math.min(g-1,e+1)),children:a.settingsTourNextBtn})]})]})]})]}),document.body)}var $=a(7134),W=a(1909),O=a(6813),q=a(4548),G=a(3173),V=a(4514),_=a(4980);let K=/^([01]?\d|2[0-3]):([0-5]\d)$/;function Z(e){return String(e).padStart(2,"0")}function J(e){let t=e.trim(),a=K.exec(t);return a?{h:Number(a[1]),m:Number(a[2])}:{h:9,m:0}}function Y(e,t){return`${Z((e%24+24)%24)}:${Z((t%60+60)%60)}`}function Q({value:e,onChange:t,disabled:a,className:n="","aria-label":i,lang:l,use24HourClock:o=!0,t:d}){let c,[m,x]=(0,r.useState)(!1),[u,h]=(0,r.useState)({top:0,left:0,maxW:280}),b=(0,r.useRef)(null),g=(0,r.useRef)(null),p=J(e),[v,f]=(0,r.useState)(p.h),[k,y]=(0,r.useState)(p.m);(0,r.useEffect)(()=>{let{h:t,m:a}=J(e);f(t),y(a)},[e]);let j=(0,r.useCallback)((e,a)=>{t(Y(e,a))},[t]),N=Y(v,k),z=((c=new Date).setHours(v,k,0,0),new Intl.DateTimeFormat("fr"===l?"fr-CA":"en-CA",{timeStyle:"short",hour12:!o}).format(c)),w=(0,r.useCallback)(()=>{let e=b.current;if(!e)return;let t=e.getBoundingClientRect(),a=window.innerWidth,s=window.innerHeight,r=Math.min(280,a-16),n=t.bottom+8,i=t.left+t.width/2-r/2;i=Math.max(8,Math.min(i,a-r-8)),n+200>s-8&&(n=Math.max(8,t.top-8-200)),h({top:n,left:i,maxW:r})},[]);(0,r.useLayoutEffect)(()=>{if(!m||a)return;w();let e=()=>w();return window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[m,a,w]),(0,r.useEffect)(()=>{if(!m||a)return;let e=e=>{let t=e.target;g.current?.contains(t)||b.current?.contains(t)||x(!1)},t=e=>{"Escape"===e.key&&x(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[m,a]);let S=Array.from({length:24},(e,t)=>t),T=Array.from({length:60},(e,t)=>t),C=m&&!a&&"u">typeof document?(0,M.createPortal)((0,s.jsxs)("div",{ref:g,role:"dialog","aria-modal":"true","aria-label":i,className:"kronosys-time-popover fixed z-[200] rounded-xl border border-violet-500/45 bg-zinc-50 p-3 shadow-2xl dark:border-violet-400/45 dark:bg-zinc-900",style:{top:u.top,left:u.left,width:u.maxW,maxHeight:200},children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs font-medium text-zinc-600 dark:text-zinc-400",children:d.timePickerPopoverTimeLabel}),(0,s.jsxs)("div",{className:"inline-flex items-center gap-1.5",children:[(0,s.jsx)("select",{className:"h-9 rounded-lg border border-violet-500/45 bg-white px-2.5 text-sm font-mono text-zinc-900 outline-none dark:border-violet-400/50 dark:bg-zinc-800 dark:text-zinc-100",value:v,onChange:e=>{let t=Number(e.target.value);f(t),j(t,k)},"aria-label":d.timePickerPopoverHourAria,children:S.map(e=>(0,s.jsx)("option",{value:e,children:Z(e)},e))}),(0,s.jsx)("span",{className:"font-mono text-zinc-500",children:":"}),(0,s.jsx)("select",{className:"h-9 rounded-lg border border-violet-500/45 bg-white px-2.5 text-sm font-mono text-zinc-900 outline-none dark:border-violet-400/50 dark:bg-zinc-800 dark:text-zinc-100",value:k,onChange:e=>{let t=Number(e.target.value);y(t),j(v,t)},"aria-label":d.timePickerPopoverMinuteAria,children:T.map(e=>(0,s.jsx)("option",{value:e,children:Z(e)},e))})]}),(0,s.jsx)("button",{type:"button",className:"inline-flex h-9 w-9 items-center justify-center rounded-lg border border-emerald-500/50 bg-emerald-50 text-emerald-700 hover:bg-emerald-100 dark:border-emerald-400/60 dark:bg-emerald-950/35 dark:text-emerald-200 dark:hover:bg-emerald-900/40","aria-label":"fr"===l?"Accepter l'heure":"Accept time",onClick:()=>{j(v,k),x(!1)},children:(0,s.jsx)(V.A,{className:"h-4 w-4",strokeWidth:2.5,"aria-hidden":!0})})]}),(0,s.jsxs)("p",{className:"mt-2 text-center text-xs text-zinc-500 dark:text-zinc-400","aria-hidden":!0,children:[N," \xb7 ",z]})]}),document.body):null;return(0,s.jsxs)("div",{className:`inline-flex min-w-0 max-w-full ${n}`,children:[(0,s.jsxs)("button",{ref:b,type:"button",disabled:a,className:"inline-flex w-full max-w-md items-center justify-between gap-2 rounded-lg border border-zinc-300 bg-white px-3 py-2 text-left text-sm outline-none ring-violet-500/30 focus:ring-2 dark:border-zinc-700 dark:bg-zinc-950 "+(a?"cursor-not-allowed opacity-50":"cursor-pointer hover:border-zinc-400 dark:hover:border-zinc-600"),"aria-label":i,"aria-expanded":m,"aria-haspopup":"dialog",onClick:()=>{a||x(e=>!e)},children:[(0,s.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-sm tabular-nums text-zinc-900 dark:text-zinc-100",children:N}),(0,s.jsx)(_.A,{className:"h-4 w-4 shrink-0 opacity-70",strokeWidth:2,"aria-hidden":!0})]}),C]})}var X=a(1878),ee=a(8368),et=a(9137);function ea(e,t){return"qa"===e?t.dataEnvActiveQa:t.dataEnvActiveProduction}function es(e,t){return e.replace(/\{(\w+)\}/g,(e,a)=>t[a]??`{${a}}`)}function er(e){let t,a,s=(e,t)=>"number"==typeof e&&Number.isFinite(e)?e:t,r=(e,t)=>"boolean"==typeof e?e:t,n=(e,t)=>"string"==typeof e?e:t,i=n(e?.historyPartition,"daily"),l=["daily","weekly","monthly"].includes(i)?i:"daily",o=n(e?.sessionExportFormat,"json"),d=["json","csv","jiraTable","sap"].includes(o)?o:"json",c=n(e?.sessionStartMode,"continue"),m=["continue","new"].includes(c)?c:"continue",x=n(e?.usageProfile,"manager"),u=Array.isArray(t=e?.workspaceLocExcludedDirectoryNames)?t.map(e=>String(e).trim()).filter(Boolean).join("\n"):[...E].join("\n"),h=Array.isArray(a=e?.workspaceLocExcludedPathPatterns)?a.map(e=>String(e).trim()).filter(Boolean).join("\n"):"",b=e?.scheduleDays,g=Array.isArray(b)?b.filter(e=>"number"==typeof e):[1,2,3,4,5],p=(Array.isArray(e?.plannedSessions)?e.plannedSessions:[]).map(e=>{let t="object"==typeof e&&null!==e?e:{};return{id:n(t.id,Math.random().toString(36).slice(2,11)),name:n(t.name,""),days:Array.isArray(t.days)?t.days.filter(e=>"number"==typeof e):[],startTime:n(t.startTime,"10:00"),endTime:n(t.endTime,"11:00"),createSession:r(t.createSession,!0),transferTasks:r(t.transferTasks,!0),pauseTasks:r(t.pauseTasks,!0),tagsText:Array.isArray(t.tags)?t.tags.join(", "):"",project:n(t.project,"")}});return{usageProfile:"developer"===x?"developer":"manager",enabled:r(e?.enabled,!0),autoStart:r(e?.autoStart,!0),showWelcomeOnStartup:r(e?.showWelcomeOnStartup,!0),anonymizePaths:r(e?.anonymizePaths,!1),flushIntervalSeconds:s(e?.flushIntervalSeconds,15),heartbeatIntervalSeconds:s(e?.heartbeatIntervalSeconds,120),maxBufferedEvents:s(e?.maxBufferedEvents,500),historyStoragePath:n(e?.historyStoragePath,""),localPersistenceDriver:"json"===n(e?.localPersistenceDriver,"sqlite")?"json":"sqlite",historyPartition:l,sessionExportFormat:d,csvDelimiter:n(e?.csvDelimiter,","),sessionStartMode:m,autoGitSync:r(e?.autoGitSync,!1),gitRemoteUrl:n(e?.gitRemoteUrl,""),gitlabApiBaseUrl:n(e?.gitlabApiBaseUrl,""),mongodbEnabled:r(e?.mongodbEnabled,!1),mongodbDatabaseName:n(e?.mongodbDatabaseName,"kronosys"),mongodbCollectionName:n(e?.mongodbCollectionName,"sessions"),mongodbHost:n(e?.mongodbHost,"127.0.0.1"),mongodbPort:s(e?.mongodbPort,27017),mongodbUsername:n(e?.mongodbUsername,""),mongodbAuthSource:n(e?.mongodbAuthSource,"admin"),localApiPort:s(e?.localApiPort,5566),dashboardWebUrl:n(e?.dashboardWebUrl,"http://kronosys:5555"),dashboardDisplayTimeZone:(0,D.g8)(e),dashboardUse24HourClock:(0,T.m)(e),dashboardCalendarWeekStartsOn:(0,C.dM)(e),dashboardLightThemeVariant:(0,$.bb)(e)??$.dO,dashboardDefaultSessionNameTemplate:n(e?.dashboardDefaultSessionNameTemplate,"").slice(0,400),dashboardBaseDailyHours:s(e?.dashboardBaseDailyHours,7.5),dashboardBaseDailyToleranceMinutes:s(e?.dashboardBaseDailyToleranceMinutes,10),dashboardSessionDurationAlertHours:Math.min(Math.max(s(e?.dashboardSessionDurationAlertHours,24),1),8760),dashboardShowKronoFocusInHeader:r(e?.dashboardShowKronoFocusInHeader,!0),dashboardShowKronoFocusInTaskOps:r(e?.dashboardShowKronoFocusInTaskOps,!0),taskDefaultTagBucketEnabled:r(e?.taskDefaultTagBucketEnabled,!0),dashboardAllowTaskStartTimeEdit:r(e?.dashboardAllowTaskStartTimeEdit,!0),dashboardAllowSessionStartTimeEdit:r(e?.dashboardAllowSessionStartTimeEdit,!0),dashboardAllowTaskEndTimeEdit:r(e?.dashboardAllowTaskEndTimeEdit,!0),dashboardAllowSessionEndTimeEdit:r(e?.dashboardAllowSessionEndTimeEdit,!0),developmentUseProductionData:r(e?.developmentUseProductionData,!1),dualDataEnvironmentEnabled:r(e?.dualDataEnvironmentEnabled,!1),activeDataEnvironment:e?.activeDataEnvironment==="qa"?"qa":"production",workspaceLocExcludedDirsText:u,workspaceLocExcludedPathPatternsText:h,scheduleEnabled:r(e?.scheduleEnabled,!1),scheduleDays:g,scheduleStartTime:n(e?.scheduleStartTime,"09:00"),scheduleEndTime:n(e?.scheduleEndTime,"17:00"),scheduleCreateDailySession:r(e?.scheduleCreateDailySession,!0),scheduleTransferTasks:r(e?.scheduleTransferTasks,!0),schedulePauseTasks:r(e?.schedulePauseTasks,!0),plannedSessions:p}}function en(e){return`w-full max-w-md rounded-lg border border-zinc-300 bg-white px-3 py-2 text-sm text-zinc-900 outline-none ring-violet-500/30 focus:ring-2 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-100 ${e?"opacity-50":""}`}function ei(e){return`w-full max-w-xl min-h-[9rem] rounded-lg border border-zinc-300 bg-white px-3 py-2 font-mono text-xs leading-relaxed text-zinc-900 outline-none ring-violet-500/30 focus:ring-2 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-100 ${e?"opacity-50":""}`}function el({label:e,description:t,children:a}){let n=(0,r.useId)(),i=`${n}-label`,l=`${n}-desc`;return(0,s.jsxs)("div",{role:"group","aria-labelledby":i,"aria-describedby":l,className:"flex flex-col gap-1.5 sm:flex-row sm:items-start sm:gap-6",children:[(0,s.jsxs)("div",{className:"min-w-0 shrink-0 sm:w-52",children:[(0,s.jsx)("div",{id:i,className:"text-sm font-medium text-zinc-800 dark:text-zinc-200",children:e}),(0,s.jsx)("p",{id:l,className:"mt-0.5 text-xs leading-snug text-zinc-600 dark:text-zinc-500",children:t})]}),(0,s.jsx)("div",{className:"min-w-0 flex-1",children:a})]})}function eo({checked:e,onChange:t,disabled:a,ariaLabel:r}){return(0,s.jsx)("button",{type:"button",role:"switch","aria-checked":e?"true":"false","aria-label":r,disabled:a,className:`relative h-7 w-12 shrink-0 rounded-full transition ${e?"bg-violet-600":"bg-zinc-700"} ${a?"opacity-50":""}`,onClick:()=>t(!e),children:(0,s.jsx)("span",{className:`absolute top-0.5 left-0.5 h-6 w-6 rounded-full bg-white transition ${e?"translate-x-5":"translate-x-0"}`})})}function ed({checked:e,onChange:t,disabled:a,ariaLabel:r}){return(0,s.jsx)("input",{type:"checkbox",checked:e,disabled:a,onChange:e=>t(e.target.checked),"aria-label":r,className:`h-4 w-4 shrink-0 rounded border border-zinc-400 bg-white text-violet-600 accent-violet-600 focus:outline-none focus-visible:ring-2 focus-visible:ring-violet-500/70 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:border-zinc-600 dark:bg-zinc-950 dark:focus-visible:ring-offset-zinc-950 ${a?"cursor-not-allowed opacity-50":"cursor-pointer"}`})}let ec="scroll-mt-24 space-y-6 border-b border-zinc-200 pb-10 last:border-b-0 last:pb-4 dark:border-zinc-800";function em({s:e,filter:t,showDevDataInGeneral:a}){let r="rounded text-zinc-700 underline-offset-2 hover:text-violet-700 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-violet-500/80 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:text-zinc-300 dark:hover:text-violet-300 dark:focus-visible:ring-offset-zinc-950",n=(...e)=>(function(e,...t){let a=e.trim().toLowerCase();return!a||t.join(" ").toLowerCase().includes(a)})(t,...e),l=n(e.sectionUsageProfile,"settings-usage-profile"),o=n(e.sectionGeneral,"settings-general","g\xe9n\xe9ral","general","v4","v4-dev","next","dev","sqlite","donn\xe9es","data","d\xe9veloppement","development"),d=n(e.sectionSchedule,"settings-schedule","schedule","horaire","travail","weekday","automatique"),c=n(e.sectionPlannedSessions,"settings-planned-sessions","planned","planifi","r\xe9current","recurring"),m=n(e.sectionPrivacy,"settings-privacy"),x=n(e.sectionKronoFocus,"settings-kronoFocus","kronoFocus"),u=n(e.sectionTaskTags,"settings-task-tags","task","tag","\xe9tiquette","default","d\xe9faut","bucket"),h=n(e.sectionCollection,"settings-collection","buffer"),b=n(e.sectionHistory,"settings-history"),g=n(e.sectionTagsProjects,"settings-tags-projects")||n(e.tocSubTagsGlobal,"settings-tags-global"),p=n(e.sectionTagsProjects,"settings-tags-projects")||n(e.tocSubTagsProjects,"settings-tags-saved-projects"),v=n(e.sectionTagsProjects,"settings-tags-projects")||n(e.tocSubTagsByProject,"settings-tags-by-project"),f=g||p||v,k=n(e.sectionTaskTemplates,"settings-task-templates","template","mod\xe8le","task template","gabarit"),y=n(e.sectionDangerZone,"settings-danger-zone"),j=n(e.sectionArchivedSessions,"settings-archived-sessions","archived"),N=n(e.sectionExport,"settings-export"),z=n(e.sectionGit,"settings-git","gitlab")||n(e.tocSubGitIdentity,"settings-git-identity","author","identity","forge"),w=n(e.sectionMongo,"settings-mongo","mongodb")||n(e.sectionMongoConnection,"settings-mongo-connection"),S=n(e.sectionWorkspaceLoc,"settings-workspace-loc","snapshot","reporting"),T=n(e.sectionWeb,"settings-web","dashboard","api")||n(e.tocSubDashboardTour,"settings-dashboard-tour")||n(e.tocSubReportingTour,"settings-reporting-tour")||n(e.tocSubDashboardColumnHints,"settings-dashboard-column-hints","column","colonnes","three","trois")||n(e.dashboardDisplayTimeZone,"fuseau","timezone","time zone","iana","horaire")||n(e.dashboardClockFormat,"12h","12 h","24h","24 h","am/pm","horloge","clock format","heure"),C=n(e.sectionWeb,"settings-web","dashboard","api")||n(e.tocSubSessionDurationAlert,"settings-session-duration-alert","duration"),D=n(e.sectionWeb,"settings-web","dashboard","api")||n(e.tocSubDefaultSessionNameTemplate,"settings-default-session-name","default session","session name","%UUID","strftime","gabarit","nom de session")||n(e.dashboardDefaultSessionNameTemplate,"template","uuid"),E=T||C||D,P=n(e.licensesPageLink,"/licenses","license","licence","third-party","notices","logiciels"),L=l||o||d||c||m||x||u||h||b||f||k||y||j||N||z||w||S||E||P,A="mt-1.5 ml-2 space-y-1 border-l border-zinc-700 pl-3 dark:border-zinc-600";return(0,s.jsxs)("nav",{"aria-label":e.tocNavAriaLabel,className:"rounded-xl border border-zinc-200 bg-zinc-50/90 p-4 lg:max-h-[calc(100dvh-14rem)] lg:overflow-y-scroll lg:overscroll-contain dark:border-zinc-800 dark:bg-zinc-900/40",children:[(0,s.jsx)("p",{className:"mb-3 text-xs font-semibold uppercase tracking-wide text-zinc-500 dark:text-zinc-500",children:e.tocHeading}),t.trim()&&!L?(0,s.jsx)("p",{className:"text-sm text-zinc-600 dark:text-zinc-400",role:"status",children:e.tocSearchNoResults}):(0,s.jsxs)("ul",{className:"space-y-2 text-sm",children:[l?(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:"#settings-usage-profile",className:r,children:e.sectionUsageProfile})}):null,o?(0,s.jsxs)("li",{children:[(0,s.jsx)("a",{href:"#settings-general",className:r,children:e.sectionGeneral}),a?(0,s.jsx)("ul",{className:A,children:(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:"#settings-dev-data",className:r,children:e.devDataBlockTitle})})}):null]}):null,d?(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:"#settings-schedule",className:r,children:e.sectionSchedule})}):null,c?(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:"#settings-planned-sessions",className:r,children:e.sectionPlannedSessions})}):null,m?(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:"#settings-privacy",className:r,children:e.sectionPrivacy})}):null,x?(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:"#settings-kronoFocus",className:r,children:e.sectionKronoFocus})}):null,u?(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:"#settings-task-tags",className:r,children:e.sectionTaskTags})}):null,h?(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:"#settings-collection",className:r,children:e.sectionCollection})}):null,b?(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:"#settings-history",className:r,children:e.sectionHistory})}):null,N?(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:"#settings-export",className:r,children:e.sectionExport})}):null,f?(0,s.jsxs)("li",{children:[(0,s.jsx)("a",{href:"#settings-tags-projects",className:r,children:e.sectionTagsProjects}),g||p||v?(0,s.jsxs)("ul",{className:A,children:[g?(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:"#settings-tags-global",className:r,children:e.tocSubTagsGlobal})}):null,p?(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:"#settings-tags-saved-projects",className:r,children:e.tocSubTagsProjects})}):null,v?(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:"#settings-tags-by-project",className:r,children:e.tocSubTagsByProject})}):null]}):null]}):null,k?(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:"#settings-task-templates",className:r,children:e.sectionTaskTemplates})}):null,z?(0,s.jsxs)("li",{children:[(0,s.jsx)("a",{href:"#settings-git",className:r,children:e.sectionGit}),(0,s.jsx)("ul",{className:"mt-1.5 ml-2 space-y-1 border-l border-zinc-700 pl-3",children:(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:"#settings-git-identity",className:r,children:e.tocSubGitIdentity})})})]}):null,w?(0,s.jsxs)("li",{children:[(0,s.jsx)("a",{href:"#settings-mongo",className:r,children:e.sectionMongo}),w?(0,s.jsx)("ul",{className:"mt-1.5 ml-2 space-y-1 border-l border-zinc-700 pl-3",children:(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:"#settings-mongo-connection",className:r,children:e.sectionMongoConnection})})}):null]}):null,S?(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:"#settings-workspace-loc",className:r,children:e.sectionWorkspaceLoc})}):null,E?(0,s.jsxs)("li",{children:[(0,s.jsx)("a",{href:"#settings-web",className:r,children:e.sectionWeb}),T||C||D?(0,s.jsxs)("ul",{className:A,children:[T?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:"#settings-dashboard-tour",className:r,children:e.tocSubDashboardTour})}),(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:"#settings-dashboard-column-hints",className:r,children:e.tocSubDashboardColumnHints})}),(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:"#settings-reporting-tour",className:r,children:e.tocSubReportingTour})})]}):null,D?(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:"#settings-default-session-name",className:r,children:e.tocSubDefaultSessionNameTemplate})}):null,C?(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:"#settings-session-duration-alert",className:r,children:e.tocSubSessionDurationAlert})}):null]}):null]}):null,j?(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:"#settings-archived-sessions",className:r,children:e.sectionArchivedSessions})}):null,y?(0,s.jsx)("li",{children:(0,s.jsx)("a",{href:"#settings-danger-zone",className:r,children:e.sectionDangerZone})}):null,P?(0,s.jsx)("li",{children:(0,s.jsx)(i(),{href:"/licenses",className:r,children:e.licensesPageLink})}):null]})]})}function ex(){let e=(0,r.useId)(),t=(0,r.useId)(),{payload:a,error:n,refresh:u,getLatestPayload:T,connectionPhase:C}=(0,d.y)(),[E,M]=(0,r.useState)(!1),[F,V]=(0,r.useState)(null),[_,K]=(0,r.useState)(!1),[Z,J]=(0,r.useState)(null),[Y,ex]=(0,r.useState)(!1),[eu,eh]=(0,r.useState)(!1),[eb,eg]=(0,r.useState)(""),[ep,ev]=(0,r.useState)(!1),[ef,ek]=(0,r.useState)(""),[ey,ej]=(0,r.useState)(!1),[eN,ez]=(0,r.useState)(!1),[ew,eS]=(0,r.useState)(!1),[eT,eC]=(0,r.useState)(""),[eD,eE]=(0,r.useState)(!1),[eP,eL]=(0,r.useState)(!1),[eA,eI]=(0,r.useState)(null),[eB,eH]=(0,r.useState)(""),[eM,eR]=(0,r.useState)(""),[eF,eU]=(0,r.useState)(""),[e$,eW]=(0,r.useState)(!1),[eO,eq]=(0,r.useState)(!1),[eG,eV]=(0,r.useState)(!1),[e_,eK]=(0,r.useState)(null),[eZ,eJ]=(0,r.useState)(!1),[eY,eQ]=(0,r.useState)(null),[eX,e0]=(0,r.useState)(!1),[e5,e2]=(0,r.useState)(0),[e1,e4]=(0,r.useState)(null),[e3,e6]=(0,r.useState)(!1),[e9,e8]=(0,r.useState)(!1),[e7,te]=(0,r.useState)(!1),[tt,ta]=(0,r.useState)(!1),[ts,tr]=(0,r.useState)(null),tn=(0,r.useRef)(null),[ti,tl]=(0,r.useState)(""),[to,td]=(0,r.useState)(!1);(0,r.useEffect)(()=>{a&&!R.r.getState().settings&&td(!0)},[a]);let tc=(0,l.useRouter)(),tm=(0,l.useSearchParams)().get("session"),tx=(0,r.useCallback)(async e=>{let t=await u({routerInvalidate:e?.routerInvalidate===!0,resetBootstrapFailures:e?.resetBootstrapFailures===!0});if(t&&e?.preserveForm!==!0){let e=T();e&&V(er(e.cfg))}return t},[T,u]),tu=(0,r.useRef)(!1);(0,r.useEffect)(()=>{a&&!tu.current&&(tu.current=!0,V(er(a.cfg)))},[a]),(0,r.useEffect)(()=>{if(e$)return;let e=a?.gitIdentity;eH("string"==typeof e?.gitUserName?e.gitUserName:""),eR("string"==typeof e?.gitUserEmail?e.gitUserEmail:""),eU("string"==typeof e?.gitAccountLogin?e.gitAccountLogin:"")},[a?.gitIdentity,e$]);let th=(0,r.useCallback)(async()=>{eW(!0);try{await (0,o.$)({type:"setGitIdentity",gitUserName:eB,gitUserEmail:eM,gitAccountLogin:eF}),await tx({preserveForm:!0}),eq(!0),window.setTimeout(()=>eq(!1),3500)}catch(e){eQ(e instanceof Error?e.message:String(e))}finally{eW(!1)}},[eM,eF,eB,tx]),tb=a?.current,tg=tb?.language==="fr"?"fr":"en",tp=(0,g.C)(tg),tv=(0,p.J)(tg),tf=a?.devDataRuntime,tk=a?.dataEnvironmentRuntime,ty=tf?.isNextDevelopment===!0,tj=_||eu,tN=(0,x.z)(tg),tz=(0,r.useCallback)(async()=>await tx({routerInvalidate:!0,preserveForm:!0}),[tx]),tw=(0,r.useCallback)(async e=>{await (0,o.$)(e),await tx({routerInvalidate:!0,preserveForm:!0})},[tx]),tS=(0,r.useCallback)(()=>{O.P.getState().reset(),eV(!0),window.setTimeout(()=>eV(!1),3500)},[]),tT=(0,r.useMemo)(()=>(function(e,t,a,s){let r=a?.traceDataDirOverride===!0?a.activeDataDirectory:s?.traceDataDirOverride===!0?s.activeDataDirectory:null;if(r)return{title:t.dangerClearHistoryVaultTargetTitle,environmentLabel:"TRACE_DATA_DIR",body:es(t.dangerClearHistoryVaultTargetTrace,{path:r}),dataDirectory:r,mismatchWarning:null,accent:"neutral"};let n=a?.dualDataEnvironmentEnabled===!0,i=a?.activeDataDirectory?.trim()||s?.activeDataDirectory?.trim()||"",l=a?.effectiveActiveDataEnvironment==="qa"?"qa":"production";if(n&&a){let e=ea(l,t),s="qa"===l?ea("production",t):ea("qa",t),r="qa"===l?a.productionDataDirectory:a.qaDataDirectory,n=!0===a.dataDirectoryResolutionMismatch?es(t.dangerClearHistoryVaultMismatch,{preferredEnv:ea(a.preferredActiveDataEnvironment,t),preferredPath:a.preferredDataDirectory,activePath:a.activeDataDirectory}):null;return{title:t.dangerClearHistoryVaultTargetTitle,environmentLabel:e,body:es(t.dangerClearHistoryVaultTargetDual,{env:e,path:a.activeDataDirectory,otherEnv:s,otherPath:r}),dataDirectory:i,mismatchWarning:n,accent:"qa"===l?"qa":"production"}}if(s?.isNextDevelopment===!0&&!n){let a=!0===s.dataDirectoryResolutionMismatch?es(t.dangerClearHistoryVaultMismatch,{preferredEnv:"fr"===e?"pr\xe9f\xe9rence enregistr\xe9e":"saved preference",preferredPath:s.preferredDataDirectory,activePath:s.activeDataDirectory}):null;return{title:t.dangerClearHistoryVaultTargetTitle,environmentLabel:"fr"===e?"D\xe9veloppement (next dev)":"Development (next dev)",body:es(t.dangerClearHistoryVaultTargetDev,{path:s.activeDataDirectory}),dataDirectory:s.activeDataDirectory,mismatchWarning:a,accent:"neutral"}}let o=a?.dataDirectoryResolutionMismatch===!0?es(t.dangerClearHistoryVaultMismatch,{preferredEnv:ea(a.preferredActiveDataEnvironment,t),preferredPath:a.preferredDataDirectory,activePath:a.activeDataDirectory}):null;return{title:t.dangerClearHistoryVaultTargetTitle,environmentLabel:ea(l,t),body:es(t.dangerClearHistoryVaultTargetSingle,{path:i||(a?.activeDataDirectory??"")}),dataDirectory:i||(a?.activeDataDirectory??""),mismatchWarning:o,accent:"qa"===l?"qa":"production"}})(tg,tv,tk,tf),[tg,tv,tk,tf]),tC=(0,r.useMemo)(()=>{let e="qa"===tT.accent?"border-violet-400/70 bg-violet-50/95 text-violet-950 dark:border-violet-600/50 dark:bg-violet-950/40 dark:text-violet-100":"production"===tT.accent?"border-zinc-300 bg-zinc-50/95 text-zinc-900 dark:border-zinc-600 dark:bg-zinc-900/55 dark:text-zinc-100":"border-zinc-200 bg-zinc-50/90 text-zinc-800 dark:border-zinc-600 dark:bg-zinc-900/50 dark:text-zinc-200";return(0,s.jsxs)("div",{className:`space-y-3 ${e9?"pointer-events-none opacity-50":""}`,children:[(0,s.jsxs)("div",{className:`rounded-lg border p-3 ${e}`,role:"note",children:[(0,s.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide",children:tT.title}),(0,s.jsx)("p",{className:"mt-1.5 text-sm font-medium leading-snug",children:tT.environmentLabel}),(0,s.jsx)("p",{className:"mt-1 text-xs leading-relaxed",children:tT.body}),tT.mismatchWarning?(0,s.jsx)("p",{className:"mt-2 text-xs leading-relaxed text-amber-900 dark:text-amber-200",children:tT.mismatchWarning}):null]}),(0,s.jsxs)("div",{className:"rounded-lg border border-zinc-200 bg-zinc-50/90 p-3 text-zinc-800 dark:border-zinc-600 dark:bg-zinc-900/50 dark:text-zinc-200",children:[(0,s.jsx)("p",{className:"text-xs font-medium leading-snug",children:tv.dangerClearHistoryBackupIntro}),(0,s.jsxs)("ul",{className:"mt-2 space-y-2.5 text-sm",children:[(0,s.jsxs)("li",{children:[(0,s.jsx)("a",{href:"/api/backup?format=json",download:!0,className:"font-medium text-violet-700 underline decoration-violet-400 underline-offset-2 hover:text-violet-600 dark:text-violet-300 dark:hover:text-violet-200",children:tv.dangerClearHistoryBackupJson}),(0,s.jsx)("p",{className:"mt-0.5 text-[11px] leading-relaxed text-zinc-500 dark:text-zinc-400",children:tv.dangerClearHistoryBackupJsonHint})]}),(0,s.jsxs)("li",{children:[(0,s.jsx)("a",{href:"/api/backup?format=csv",download:!0,className:"font-medium text-violet-700 underline decoration-violet-400 underline-offset-2 hover:text-violet-600 dark:text-violet-300 dark:hover:text-violet-200",children:tv.dangerClearHistoryBackupCsvZip}),(0,s.jsx)("p",{className:"mt-0.5 text-[11px] leading-relaxed text-zinc-500 dark:text-zinc-400",children:tv.dangerClearHistoryBackupCsvZipHint})]}),(0,s.jsxs)("li",{children:[(0,s.jsx)("a",{href:"/api/backup?format=sqlite",download:!0,className:"font-medium text-violet-700 underline decoration-violet-400 underline-offset-2 hover:text-violet-600 dark:text-violet-300 dark:hover:text-violet-200",children:tv.dangerClearHistoryBackupSqlite}),(0,s.jsx)("p",{className:"mt-0.5 text-[11px] leading-relaxed text-zinc-500 dark:text-zinc-400",children:tv.dangerClearHistoryBackupSqliteHint})]})]})]})]})},[tT,tv,e9]),tD=(0,r.useMemo)(()=>[...a?.historyArchived||[]].sort((e,t)=>{let a=Date.parse(e.savedAt||e.startAt||"")||0;return(Date.parse(t.savedAt||t.startAt||"")||0)-a}),[a?.historyArchived]),tE=tD.length,tP=Math.max(0,Math.ceil(tE/10)-1),tL=Math.min(e5,tP),tA=10*tL,tI=tD.slice(tA,tA+10),tB=0===tE?0:Math.min(tA+tI.length,tE);(0,r.useEffect)(()=>{e2(e=>Math.min(e,tP))},[tP]),(0,r.useEffect)(()=>{if(!F||!a||"#settings-archived-sessions"!==window.location.hash)return;let e=document.getElementById("settings-archived-sessions");if(!e)return;let t=window.setTimeout(()=>{e.scrollIntoView({behavior:"smooth",block:"start"})},80);return()=>window.clearTimeout(t)},[F,a]);let tH=a?.cfg,tM=tH?.mongodbUriConfigured===!0,tR=tH?.mongodbManualUriConfigured===!0,tF=tH?.mongodbPasswordConfigured===!0,tU=a?.remoteStatus,t$=tH?.mongodbEnabled===!0,tW=(0,r.useMemo)(()=>{let e=(0,w.Vc)(a);if(e.length>0)return e;let t=a?.cfg,s=(0,w.Vc)(t);if(s.length>0)return s;let r=a?.workspaceCodeSnapshot;if(r?.ok===!0){let e=r.workspaceFolder?.trim();if(e)return[e]}return[]},[a]),tO=(0,S.Me)(a,tW.length),tq=tH?.suggestGlabRemoteRepo===!0,tG=tH?.gitlabTokenStored===!0,tV=tH?.gitlabTokenFromEnv===!0,t_=tH?.gitlabApiVerified===!0,tK=eT.trim().length>0||tV,tZ=tG?tv.gitlabTokenStoredYes:tV?tv.gitlabTokenFromEnvYes:tv.gitlabTokenNone,tJ=async e=>{await (0,o.$)({type:"setLanguage",lang:e}),await tx()},tY=async()=>{if(F){K(!0),J(null);try{let e=eb.trim();if(e.length>0){let t=await (0,o.$)({type:"setMongoDbConnectionUri",uri:e}),a=t.result?.settingsError;if(a)return void eQ("string"==typeof a?a:String(a))}let t=ef.trim();if(t.length>0){let e=await (0,o.$)({type:"setMongoDbPassword",password:t}),a=e.result?.settingsError;if(a)return void eQ("string"==typeof a?a:String(a))}let a=eT.trim();if(a.length>0){let e=await (0,o.$)({type:"setGitlabToken",token:a}),t=e.result?.settingsError;if(t)return void eQ("string"==typeof t?t:String(t))}let{workspaceLocExcludedDirsText:s,workspaceLocExcludedPathPatternsText:r,plannedSessions:n,...i}=F,l=await (0,o.$)({type:"updateKronosysSettings",settings:{...i,dashboardShowKronoFocusInHeader:!0,workspaceLocExcludedDirectoryNames:[...new Set(s.split("\n").map(e=>e.trim()).filter(e=>e.length>0&&e.length<=256&&!e.includes("/")&&!e.includes("\\")))].slice(0,500),workspaceLocExcludedPathPatterns:[...new Set(r.split("\n").map(e=>e.trim().replace(/\\/g,"/")).filter(e=>e.length>0&&e.length<=512))].slice(0,200),plannedSessions:n.map(e=>{let{tagsText:t,...a}=e;return{...a,tags:t.split(",").map(e=>e.trim()).filter(Boolean)}})}}),d=l.result?.settingsError;if(d)return void eQ("string"==typeof d?d:String(d));eg(""),ek(""),eC(""),J("save"),await tx(),setTimeout(()=>J(null),4e3)}finally{K(!1)}}},tQ=async()=>{await (0,o.$)({type:"pickStoragePath"}),await tx()},tX=async e=>{let t=e.trim();if(0!==t.length){eE(!0);try{let e=await (0,o.$)({type:"setGitlabToken",token:t}),a=e.result?.settingsError;if(a)return void eQ("string"==typeof a?a:String(a));eC(""),eI(null),await tx({preserveForm:!0})}finally{eE(!1)}}},t0=async()=>{eE(!0);try{let e=await (0,o.$)({type:"setGitlabToken",token:""}),t=e.result?.settingsError;if(t)return void eQ("string"==typeof t?t:String(t));eC(""),eI(null),await tx({preserveForm:!0})}finally{eE(!1)}},t5=async e=>{eL(!0),eI(null);try{let t=await (0,o.$)({type:"testGitlabConnection",token:eT.trim(),lang:tg,gitlabApiBaseUrl:F?.gitlabApiBaseUrl?.trim()??""}),a=t.result?.gitlabConnectionTest;if(await tx({preserveForm:!0}),a?.outcome==="connected")eI({tone:"ok",text:e.gitlabTestOk});else if(a?.outcome==="failed")if("no_token"===a.reason)eI({tone:"bad",text:e.gitlabTestNoToken});else{let t="string"==typeof a.message&&a.message.trim()?` (${a.message.trim()})`:"";eI({tone:"bad",text:`${e.gitlabTestFail}${t}`})}else eI({tone:"bad",text:e.gitlabTestErrorGeneric})}catch{eI({tone:"bad",text:e.gitlabTestErrorGeneric})}finally{eL(!1)}},t2=async()=>{eS(!0);try{let e=await (0,o.$)({type:"createGlabRemoteRepo"}),t=e.result?.glabRepoCreate;if(t&&!1===t.ok&&t.error)return void eQ(t.error);await tx()}finally{eS(!1)}},t1=async e=>{ev(!0);try{let t=await (0,o.$)({type:"setMongoDbConnectionUri",uri:e}),a=t.result?.settingsError;if(a)return void eQ("string"==typeof a?a:String(a));eg(""),await tx({preserveForm:!0})}finally{ev(!1)}},t4=async e=>{ej(!0);try{let t=await (0,o.$)({type:"setMongoDbPassword",password:e}),a=t.result?.settingsError;if(a)return void eQ("string"==typeof a?a:String(a));ek(""),await tx({preserveForm:!0})}finally{ej(!1)}},t3=async(e,t)=>{ez(!0),eK(null);try{let a=await (0,o.$)({type:"testMongoDbConnection",settings:{mongodbEnabled:t.mongodbEnabled,mongodbDatabaseName:t.mongodbDatabaseName,mongodbCollectionName:t.mongodbCollectionName,mongodbHost:t.mongodbHost,mongodbPort:t.mongodbPort,mongodbUsername:t.mongodbUsername,mongodbAuthSource:t.mongodbAuthSource}}),s=a.result?.mongoConnectionTest?.outcome;await tx({preserveForm:!0}),"connected"===s?eK({tone:"ok",text:e.mongoTestOk}):"failed"===s?eK({tone:"bad",text:e.mongoTestFail}):"disabled"===s&&eK({tone:"warn",text:e.mongoTestDisabled})}catch{eK({tone:"bad",text:e.mongoTestErrorGeneric})}finally{ez(!1)}},t6=(0,r.useCallback)(()=>{e0(!0)},[]),t9=(0,r.useCallback)(async()=>{e0(!1);let e=(0,p.J)(tg);eJ(!0);try{let t=await (0,o.$)({type:"resyncMongoMirror"}),a=t.result?.mongoResync;await tx({preserveForm:!0}),a&&!0===a.ok?eQ(e.mongoResyncDone.replace("{upserted}",String(a.upserted)).replace("{failed}",String(a.failed))):a&&!1===a.ok?"disabled"===a.reason?eQ(e.mongoResyncDisabled):"unsupported"===a.reason?eQ(e.mongoResyncUnsupported):"failed"===a.reason?eQ(e.mongoResyncErrorDetail.replace("{detail}",String(a.message))):eQ(e.mongoResyncErrorGeneric):eQ(e.mongoResyncErrorGeneric)}catch(a){let t=a instanceof Error?a.message:String(a);eQ(e.mongoResyncErrorDetail.replace("{detail}",t))}finally{eJ(!1)}},[tg,tx]),t8=(e,t)=>{V(a=>a?{...a,[e]:t}:a)},t7=async e=>{e4(e);try{let t=await (0,o.$)({type:"archiveSession",sessionId:e,archived:!1}),a=t.result?.sessionOp;a&&!a.ok&&a.message&&eQ("string"==typeof a.message?a.message:String(a.message)),await tx({preserveForm:!0})}finally{e4(null)}},ae=(0,r.useCallback)(async()=>{e8(!0);try{await (0,o.$)({type:"clearHistory"}),R.r.getState().resetDashboard(),G.h.getState().reset(),W.e.getState().resetLightThemeVariant(),q.B.getState().resetGitIdentityBannerDismissed(),await tx({preserveForm:!0}),e6(!1),tc.push("/?tour=replay")}catch(e){eQ(e instanceof Error?e.message:String(e))}finally{e8(!1)}},[tx,tc]),at=(0,r.useCallback)(async()=>{if(!ts)return void eQ(tv.dangerRestoreNoFile);ta(!0);try{let e=new FormData;e.set("file",ts);let t=ts.name.toLowerCase().endsWith(".json")?"json":"sqlite";e.set("format",t);let a=await fetch("/api/restore",{method:"POST",body:e}),s=await a.text(),r={};try{r=s?JSON.parse(s):{}}catch{r={}}if(!a.ok||!0!==r.ok){let e="string"==typeof r.detail?r.detail:"string"==typeof r.error?r.error:s||`HTTP ${a.status}`;eQ(`${tv.dangerRestoreFailed.replace("{detail}",e)}`);return}te(!1),tr(null),tn.current&&(tn.current.value=""),await tx({preserveForm:!1,routerInvalidate:!0}),eQ("json"===t?tv.dangerRestoreDoneJson:tv.dangerRestoreDoneSqlite)}finally{ta(!1)}},[tx,ts,tv]),aa=(0,r.useCallback)(async()=>{eh(!0),J(null);try{await (0,o.$)({type:"resetKronosysSettings"}),q.B.getState().resetGitIdentityBannerDismissed(),eg(""),ek(""),eC(""),J("reset"),await tx(),setTimeout(()=>J(null),4e3)}catch(e){eQ(e instanceof Error?e.message:String(e))}finally{eh(!1)}},[tx]);return(0,s.jsxs)("div",{className:"min-h-screen bg-zinc-100 text-zinc-900 dark:bg-zinc-900 dark:text-zinc-100",children:[(0,s.jsxs)("header",{className:v.cI,children:[(0,s.jsxs)("div",{className:v.hu,children:[(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-1",children:[(0,s.jsx)(i(),{href:(0,et.c)("/",tm),className:"w-fit text-xl font-semibold tracking-tight text-zinc-900 hover:text-violet-700 dark:text-zinc-100 dark:hover:text-violet-300",children:"Kronosys"}),(0,s.jsxs)("p",{className:"flex flex-wrap items-center gap-x-2 text-xs font-medium leading-snug text-zinc-500 dark:text-zinc-400",children:[(0,s.jsx)("span",{children:tN.brandTagline}),(0,s.jsx)("span",{className:"text-zinc-400/70 dark:text-zinc-600","aria-hidden":!0,children:"\xb7"}),(0,s.jsx)(m.h,{ariaLabelTemplate:tN.appVersionAriaLabel})]})]}),(0,s.jsx)(y._,{payload:a,dt:tN})]}),(0,s.jsx)(f.u,{leading:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(j.x,{lang:tg,dt:tN}),(0,s.jsx)(N.a,{payload:a,dt:tN,post:tw}),(0,s.jsx)(k.p,{dt:tN,lang:tg,dashboardSessionNavId:tm,onManualRefresh:tz})]}),nav:(0,s.jsx)(B.b,{current:"settings",labels:tp,navAriaLabel:tN.appShellRouteNavAria,dashboardSessionId:tm,lang:tg,dt:tN}),trailing:(0,s.jsxs)(z.b,{ariaLabel:tN.appShellUtilityToolbarGroupAria,children:[(0,s.jsx)(A.U,{lang:tg}),(0,s.jsx)(I.r,{title:tN.pageRefreshTitle,ariaLabel:tN.pageRefreshAriaLabel,inlineMessages:{loading:tN.pageRefreshProgressLabel,success:tN.pageRefreshDoneToast,error:tN.pageRefreshFailedToast},onRefresh:tz}),(0,s.jsx)(P.o,{lang:tg,menuHeading:"fr"===tg?"Langue":"Language",triggerAriaLabel:"fr"===tg?"Langue de l’interface":"Interface language",onSelect:e=>void tJ(e)})]})})]}),(0,s.jsxs)("main",{className:"mx-auto w-full max-w-[1920px] px-5 py-8 sm:px-8 lg:px-10 xl:px-12 2xl:px-14",children:[(0,s.jsxs)("div",{id:"settings-tour-anchor-intro",className:"scroll-mt-32",children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold text-zinc-900 dark:text-zinc-50",children:tv.title}),(0,s.jsx)("p",{className:"mt-2 text-sm text-zinc-600 dark:text-zinc-400",children:tv.subtitle})]}),(0,s.jsx)("p",{className:"mt-2 text-xs text-zinc-500 dark:text-zinc-500",children:tv.openIdeSettings}),n&&"ready"===C?(0,s.jsx)("div",{className:"mt-6 rounded-lg border border-amber-300/80 bg-amber-50/90 px-4 py-3 text-sm text-amber-950 dark:border-amber-800/50 dark:bg-amber-950/35 dark:text-amber-100",role:"status",children:tN.dashboardSyncErrorBanner}):null,"ready"!==C?(0,s.jsx)(c.v,{phase:"unavailable"===C?"unavailable":"loading",dt:tN,lang:tg,technicalDetail:n,retryBusy:E,onRetry:"unavailable"===C?()=>{M(!0),tx({resetBootstrapFailures:!0}).finally(()=>{M(!1)})}:void 0}):null,F?(0,s.jsxs)("div",{className:"mt-8 lg:grid lg:grid-cols-[minmax(0,13rem)_minmax(0,1fr)] lg:items-start lg:gap-10",children:[(0,s.jsxs)("aside",{className:"mb-8 lg:sticky lg:top-6 lg:mb-0 lg:self-start",children:[(0,s.jsxs)("div",{className:"mb-4",children:[(0,s.jsx)("label",{htmlFor:t,className:"sr-only",children:tv.tocSearchAriaLabel}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(X.A,{className:"pointer-events-none absolute left-2.5 top-1/2 size-4 -translate-y-1/2 text-zinc-400 dark:text-zinc-500","aria-hidden":!0}),(0,s.jsx)("input",{id:t,type:"search",value:ti,onChange:e=>tl(e.target.value),placeholder:tv.tocSearchPlaceholder,className:"w-full rounded-lg border border-zinc-300 bg-white py-2 pl-9 pr-3 text-sm text-zinc-900 outline-none ring-violet-500/30 placeholder:text-zinc-400 focus:ring-2 dark:border-zinc-600 dark:bg-zinc-950 dark:text-zinc-100 dark:placeholder:text-zinc-500"})]})]}),(0,s.jsx)(em,{s:tv,filter:ti,showDevDataInGeneral:ty})]}),(0,s.jsxs)("div",{className:"min-w-0 space-y-10",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsx)("button",{type:"button",disabled:tj,className:"rounded-lg bg-violet-600 px-4 py-2 text-sm font-medium text-white hover:bg-violet-500 disabled:opacity-50",onClick:()=>void tY(),children:_?tv.saving:tv.save}),(0,s.jsx)("button",{type:"button",disabled:tj,className:"rounded-lg border border-zinc-600 px-4 py-2 text-sm text-zinc-300 hover:bg-zinc-800 disabled:opacity-50",onClick:()=>void tx(),children:tv.reload}),(0,s.jsx)("button",{type:"button",disabled:tj,className:"rounded-lg border border-zinc-500 px-4 py-2 text-sm text-zinc-700 hover:bg-zinc-200 disabled:opacity-50 dark:border-zinc-600 dark:text-zinc-200 dark:hover:bg-zinc-800",onClick:()=>ex(!0),children:eu?tv.resettingDefaults:tv.resetToDefaults}),"save"===Z?(0,s.jsx)("span",{className:"text-sm text-emerald-400",children:tv.savedOk}):"reset"===Z?(0,s.jsx)("span",{className:"text-sm text-emerald-400",children:tv.resetDefaultsDone}):null]}),(0,s.jsxs)("section",{id:"settings-usage-profile",className:ec,children:[(0,s.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wide text-zinc-500",children:tv.sectionUsageProfile}),(0,s.jsx)(el,{label:tv.usageProfile,description:tv.usageProfileDesc,children:(0,s.jsxs)("select",{className:en(tj),value:F.usageProfile,onChange:e=>t8("usageProfile",e.target.value),disabled:tj,"aria-label":tv.usageProfile,children:[(0,s.jsxs)("option",{value:"developer",disabled:!0,children:[tv.profileDeveloper," ","fr"===tg?"(D\xe9sactiv\xe9)":"(Disabled)"]}),(0,s.jsx)("option",{value:"manager",children:tv.profileManager})]})})]}),(0,s.jsxs)("section",{id:"settings-general",className:ec,children:[(0,s.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wide text-zinc-500",children:tv.sectionGeneral}),(0,s.jsx)(el,{label:tv.enabled,description:tv.enabledDesc,children:(0,s.jsx)(eo,{checked:F.enabled,onChange:e=>t8("enabled",e),disabled:tj,ariaLabel:tv.enabled})}),(0,s.jsx)(el,{label:tv.autoStart,description:tv.autoStartDesc,children:(0,s.jsx)(eo,{checked:F.autoStart,onChange:e=>t8("autoStart",e),disabled:tj,ariaLabel:tv.autoStart})}),(0,s.jsx)(el,{label:tv.showWelcome,description:tv.showWelcomeDesc,children:(0,s.jsx)(eo,{checked:F.showWelcomeOnStartup,onChange:e=>t8("showWelcomeOnStartup",e),disabled:tj,ariaLabel:tv.showWelcome})}),tk?(0,s.jsxs)("div",{id:"settings-data-environment",className:"scroll-mt-24 space-y-4 border-t border-zinc-200 pt-6 dark:border-zinc-800",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-zinc-800 dark:text-zinc-200",children:tv.dataEnvBlockTitle}),(0,s.jsx)("p",{className:"text-sm leading-relaxed text-zinc-600 dark:text-zinc-400",children:tv.dataEnvIntro}),tk.traceDataDirOverride?(0,s.jsx)("p",{className:"text-sm text-amber-700 dark:text-amber-300/90",role:"status",children:tv.dataEnvTraceOverride}):null,tk.dataDirectoryResolutionMismatch?(0,s.jsx)("p",{className:"text-sm text-amber-700 dark:text-amber-300/90",role:"status",children:tv.dataEnvRestartHint}):null,(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-6",children:[(0,s.jsxs)("div",{className:"min-w-0 sm:max-w-md",children:[(0,s.jsx)("div",{className:"text-sm font-medium text-zinc-800 dark:text-zinc-200",children:tv.dataEnvDualLabel}),(0,s.jsx)("p",{className:"mt-0.5 text-xs leading-snug text-zinc-600 dark:text-zinc-500",children:tv.dataEnvDualDesc})]}),(0,s.jsx)(eo,{checked:F.dualDataEnvironmentEnabled,onChange:e=>{t8("dualDataEnvironmentEnabled",e),e||t8("activeDataEnvironment","production")},disabled:tj||tk.traceDataDirOverride,ariaLabel:tv.dataEnvDualLabel})]}),F.dualDataEnvironmentEnabled?(0,s.jsx)(el,{label:tv.dataEnvActiveLabel,description:tv.dataEnvActiveDesc,children:(0,s.jsxs)("select",{className:en(tj||tk.traceDataDirOverride),value:F.activeDataEnvironment,disabled:tj||tk.traceDataDirOverride,onChange:e=>t8("activeDataEnvironment","qa"===e.target.value?"qa":"production"),"aria-label":tv.dataEnvActiveLabel,children:[(0,s.jsx)("option",{value:"production",children:tv.dataEnvActiveProduction}),(0,s.jsx)("option",{value:"qa",children:tv.dataEnvActiveQa})]})}):null,(0,s.jsxs)("div",{className:"space-y-2 rounded-lg border border-zinc-200 bg-zinc-50/80 p-3 text-xs text-zinc-700 dark:border-zinc-700 dark:bg-zinc-900/50 dark:text-zinc-300",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-0.5 font-medium text-zinc-500 dark:text-zinc-500",children:tv.dataEnvActivePath}),(0,s.jsx)("div",{className:"break-all font-mono text-[0.7rem] leading-relaxed",children:tk.activeDataDirectory})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-0.5 font-medium text-zinc-500 dark:text-zinc-500",children:tv.dataEnvPreferredPath}),(0,s.jsx)("div",{className:"break-all font-mono text-[0.7rem] leading-relaxed",children:tk.preferredDataDirectory})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-0.5 font-medium text-zinc-500 dark:text-zinc-500",children:tv.dataEnvProdPath}),(0,s.jsx)("div",{className:"break-all font-mono text-[0.7rem] leading-relaxed",children:tk.productionDataDirectory})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-0.5 font-medium text-zinc-500 dark:text-zinc-500",children:tv.dataEnvQaPath}),(0,s.jsx)("div",{className:"break-all font-mono text-[0.7rem] leading-relaxed",children:tk.qaDataDirectory})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-0.5 font-medium text-zinc-500 dark:text-zinc-500",children:tv.dataEnvPrefsFile}),(0,s.jsx)("div",{className:"break-all font-mono text-[0.7rem] leading-relaxed",children:tk.preferencesFilePath})]})]})]}):null,ty&&tf?(0,s.jsxs)("div",{id:"settings-dev-data",className:"scroll-mt-24 space-y-4 border-t border-zinc-200 pt-6 dark:border-zinc-800",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-zinc-800 dark:text-zinc-200",children:tv.devDataBlockTitle}),(0,s.jsx)("p",{className:"text-sm leading-relaxed text-zinc-600 dark:text-zinc-400",children:tv.devDataIntro}),tf.traceDataDirOverride?(0,s.jsx)("p",{className:"text-sm text-amber-700 dark:text-amber-300/90",role:"status",children:tv.devDataTraceOverride}):null,tf.envForcesProductionData&&!tf.traceDataDirOverride?(0,s.jsx)("p",{className:"text-sm text-amber-700 dark:text-amber-300/90",role:"status",children:tv.devDataEnvOverride}):null,tf.dataDirectoryResolutionMismatch?(0,s.jsx)("p",{className:"text-sm text-amber-700 dark:text-amber-300/90",role:"status",children:tv.devDataRestartHint}):null,(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between sm:gap-6",children:[(0,s.jsxs)("div",{className:"min-w-0 sm:max-w-md",children:[(0,s.jsx)("div",{className:"text-sm font-medium text-zinc-800 dark:text-zinc-200",children:tv.devDataUseProdLabel}),(0,s.jsx)("p",{className:"mt-0.5 text-xs leading-snug text-zinc-600 dark:text-zinc-500",children:tv.devDataUseProdDesc})]}),(0,s.jsx)(eo,{checked:tf.envForcesProductionData||F.developmentUseProductionData,onChange:e=>t8("developmentUseProductionData",e),disabled:tj||tf.traceDataDirOverride||tf.envForcesProductionData,ariaLabel:tv.devDataUseProdLabel})]}),(0,s.jsxs)("div",{className:"space-y-2 rounded-lg border border-zinc-200 bg-zinc-50/80 p-3 text-xs text-zinc-700 dark:border-zinc-700 dark:bg-zinc-900/50 dark:text-zinc-300",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-0.5 font-medium text-zinc-500 dark:text-zinc-500",children:tv.devDataActivePath}),(0,s.jsx)("div",{className:"break-all font-mono text-[0.7rem] leading-relaxed",children:tf.activeDataDirectory})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-0.5 font-medium text-zinc-500 dark:text-zinc-500",children:tv.devDataPreferredPath}),(0,s.jsx)("div",{className:"break-all font-mono text-[0.7rem] leading-relaxed",children:tf.preferredDataDirectory})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-0.5 font-medium text-zinc-500 dark:text-zinc-500",children:tv.devDataProdPath}),(0,s.jsx)("div",{className:"break-all font-mono text-[0.7rem] leading-relaxed",children:tf.productionDataDirectory})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"mb-0.5 font-medium text-zinc-500 dark:text-zinc-500",children:tv.devDataPrefsFile}),(0,s.jsx)("div",{className:"break-all font-mono text-[0.7rem] leading-relaxed",children:tf.preferencesFilePath})]})]})]}):null]}),(0,s.jsxs)("section",{id:"settings-schedule",className:ec,children:[(0,s.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wide text-zinc-500",children:tv.sectionSchedule}),(0,s.jsx)(el,{label:tv.scheduleEnabled,description:tv.scheduleEnabledDesc,children:(0,s.jsx)(eo,{checked:F.scheduleEnabled,onChange:e=>t8("scheduleEnabled",e),disabled:tj,ariaLabel:tv.scheduleEnabled})}),F.scheduleEnabled&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(el,{label:tv.scheduleDays,description:tv.scheduleDaysDesc,children:(0,s.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:[1,2,3,4,5,6,7].map(e=>{let t=F.scheduleDays.includes(e),a="fr"===tg?["L","M","M","J","V","S","D"][e-1]:["M","T","W","T","F","S","S"][e-1];return(0,s.jsx)("button",{type:"button",disabled:tj,onClick:()=>{t8("scheduleDays",t?F.scheduleDays.filter(t=>t!==e):[...F.scheduleDays,e].sort((e,t)=>e-t))},className:`flex h-8 w-8 items-center justify-center rounded-md border text-sm font-medium transition-colors ${t?"border-violet-600 bg-violet-600 text-white hover:bg-violet-500":"border-zinc-300 bg-white text-zinc-700 hover:bg-zinc-50 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-300 dark:hover:bg-zinc-800"}`,children:a},e)})})}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:[(0,s.jsx)(el,{label:tv.scheduleStartTime,description:"",children:(0,s.jsx)(Q,{value:F.scheduleStartTime,onChange:e=>t8("scheduleStartTime",e),disabled:tj,"aria-label":tv.scheduleStartTime,lang:tg,use24HourClock:F.dashboardUse24HourClock,t:tv})}),(0,s.jsx)(el,{label:tv.scheduleEndTime,description:"",children:(0,s.jsx)(Q,{value:F.scheduleEndTime,onChange:e=>t8("scheduleEndTime",e),disabled:tj,"aria-label":tv.scheduleEndTime,lang:tg,use24HourClock:F.dashboardUse24HourClock,t:tv})})]}),(0,s.jsx)(el,{label:tv.scheduleCreateDailySession,description:tv.scheduleCreateDailySessionDesc,children:(0,s.jsx)(eo,{checked:F.scheduleCreateDailySession,onChange:e=>t8("scheduleCreateDailySession",e),disabled:tj,ariaLabel:tv.scheduleCreateDailySession})}),(0,s.jsx)(el,{label:tv.scheduleTransferTasks,description:tv.scheduleTransferTasksDesc,children:(0,s.jsx)(eo,{checked:F.scheduleTransferTasks,onChange:e=>t8("scheduleTransferTasks",e),disabled:tj,ariaLabel:tv.scheduleTransferTasks})}),(0,s.jsx)(el,{label:tv.schedulePauseTasks,description:tv.schedulePauseTasksDesc,children:(0,s.jsx)(eo,{checked:F.schedulePauseTasks,onChange:e=>t8("schedulePauseTasks",e),disabled:tj,ariaLabel:tv.schedulePauseTasks})})]})]}),(0,s.jsxs)("section",{id:"settings-planned-sessions",className:ec,children:[(0,s.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wide text-zinc-500",children:tv.sectionPlannedSessions}),(0,s.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-zinc-500",children:tv.plannedSessionsIntro}),(0,s.jsxs)("div",{className:"mt-6 flex flex-col gap-4",children:[F.plannedSessions.map((e,t)=>(0,s.jsxs)("div",{className:"rounded-lg border border-zinc-200 bg-white p-4 shadow-sm dark:border-zinc-800 dark:bg-zinc-900",children:[(0,s.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,s.jsxs)("h3",{className:"text-sm font-medium text-zinc-900 dark:text-zinc-100",children:[tv.plannedSessionName," ",t+1]}),(0,s.jsx)("button",{type:"button",disabled:tj,onClick:()=>{t8("plannedSessions",F.plannedSessions.filter((e,a)=>a!==t))},className:"text-xs text-red-600 hover:text-red-500 disabled:opacity-50 dark:text-red-400",children:tv.plannedSessionRemove})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-6 sm:grid-cols-2",children:[(0,s.jsx)(el,{label:tv.plannedSessionName,description:"",children:(0,s.jsx)("input",{type:"text",className:en(tj),value:e.name,onChange:e=>{let a=[...F.plannedSessions];a[t]={...a[t],name:e.target.value},t8("plannedSessions",a)},disabled:tj})}),(0,s.jsx)(el,{label:tv.scheduleDays,description:"",children:(0,s.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:[1,2,3,4,5,6,7].map(a=>{let r=e.days.includes(a),n="fr"===tg?["L","M","M","J","V","S","D"][a-1]:["M","T","W","T","F","S","S"][a-1];return(0,s.jsx)("button",{type:"button",disabled:tj,onClick:()=>{let s=r?e.days.filter(e=>e!==a):[...e.days,a].sort((e,t)=>e-t),n=[...F.plannedSessions];n[t]={...n[t],days:s},t8("plannedSessions",n)},className:`flex h-7 w-7 items-center justify-center rounded border text-xs font-medium transition-colors ${r?"border-violet-600 bg-violet-600 text-white hover:bg-violet-500":"border-zinc-300 bg-white text-zinc-700 hover:bg-zinc-50 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-300 dark:hover:bg-zinc-800"}`,children:n},a)})})}),(0,s.jsx)(el,{label:tv.scheduleStartTime,description:"",children:(0,s.jsx)(Q,{value:e.startTime,onChange:e=>{let a=[...F.plannedSessions];a[t]={...a[t],startTime:e},t8("plannedSessions",a)},disabled:tj,"aria-label":tv.scheduleStartTime,lang:tg,use24HourClock:F.dashboardUse24HourClock,t:tv})}),(0,s.jsx)(el,{label:tv.scheduleEndTime,description:"",children:(0,s.jsx)(Q,{value:e.endTime,onChange:e=>{let a=[...F.plannedSessions];a[t]={...a[t],endTime:e},t8("plannedSessions",a)},disabled:tj,"aria-label":tv.scheduleEndTime,lang:tg,use24HourClock:F.dashboardUse24HourClock,t:tv})}),(0,s.jsx)(el,{label:tv.plannedSessionProject,description:"",children:(0,s.jsx)("input",{type:"text",className:en(tj),value:e.project,onChange:e=>{let a=[...F.plannedSessions];a[t]={...a[t],project:e.target.value},t8("plannedSessions",a)},disabled:tj,placeholder:"e.g. Deep work"})}),(0,s.jsx)(el,{label:tv.plannedSessionTags,description:"",children:(0,s.jsx)("input",{type:"text",className:en(tj),value:e.tagsText,onChange:e=>{let a=[...F.plannedSessions];a[t]={...a[t],tagsText:e.target.value},t8("plannedSessions",a)},disabled:tj,placeholder:"e.g. meeting, frontend"})})]}),(0,s.jsxs)("div",{className:"mt-6 flex flex-col gap-4 border-t border-zinc-100 pt-4 dark:border-zinc-800",children:[(0,s.jsx)(el,{label:tv.scheduleCreateDailySession,description:"",children:(0,s.jsx)(eo,{checked:e.createSession,onChange:e=>{let a=[...F.plannedSessions];a[t]={...a[t],createSession:e},t8("plannedSessions",a)},disabled:tj,ariaLabel:tv.scheduleCreateDailySession})}),(0,s.jsx)(el,{label:tv.scheduleTransferTasks,description:"",children:(0,s.jsx)(eo,{checked:e.transferTasks,onChange:e=>{let a=[...F.plannedSessions];a[t]={...a[t],transferTasks:e},t8("plannedSessions",a)},disabled:tj,ariaLabel:tv.scheduleTransferTasks})}),(0,s.jsx)(el,{label:tv.schedulePauseTasks,description:"",children:(0,s.jsx)(eo,{checked:e.pauseTasks,onChange:e=>{let a=[...F.plannedSessions];a[t]={...a[t],pauseTasks:e},t8("plannedSessions",a)},disabled:tj,ariaLabel:tv.schedulePauseTasks})})]})]},e.id)),(0,s.jsxs)("button",{type:"button",onClick:()=>{t8("plannedSessions",[...F.plannedSessions,{id:Math.random().toString(36).slice(2,11),name:"",days:[1,2,3,4,5],startTime:"10:00",endTime:"11:00",createSession:!0,transferTasks:!0,pauseTasks:!0,tagsText:"",project:""}])},disabled:tj,className:"w-fit rounded-lg border border-dashed border-zinc-300 px-4 py-2 text-sm font-medium text-zinc-600 hover:border-violet-500 hover:text-violet-600 disabled:opacity-50 dark:border-zinc-700 dark:text-zinc-400 dark:hover:border-violet-500 dark:hover:text-violet-400",children:["+ ",tv.plannedSessionAdd]})]})]}),(0,s.jsxs)("section",{id:"settings-privacy",className:ec,children:[(0,s.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wide text-zinc-500",children:tv.sectionPrivacy}),(0,s.jsx)(el,{label:tv.anonymizePaths,description:tv.anonymizePathsDesc,children:(0,s.jsx)(eo,{checked:F.anonymizePaths,onChange:e=>t8("anonymizePaths",e),disabled:tj,ariaLabel:tv.anonymizePaths})})]}),(0,s.jsxs)("section",{id:"settings-kronoFocus",className:ec,children:[(0,s.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wide text-zinc-500",children:tv.sectionKronoFocus}),(0,s.jsx)("p",{className:"mb-4 text-sm leading-relaxed text-zinc-600 dark:text-zinc-400",children:tv.kronoFocusHeaderPinnedNote}),(0,s.jsx)(el,{label:tv.kronoFocusShowInTaskOps,description:tv.kronoFocusShowInTaskOpsDesc,children:(0,s.jsx)(ed,{checked:F.dashboardShowKronoFocusInTaskOps,onChange:e=>t8("dashboardShowKronoFocusInTaskOps",e),disabled:tj,ariaLabel:tv.kronoFocusShowInTaskOps})})]}),(0,s.jsxs)("section",{id:"settings-task-tags",className:ec,children:[(0,s.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wide text-zinc-500",children:tv.sectionTaskTags}),(0,s.jsx)(el,{label:tv.taskDefaultTagBucketEnabled,description:tv.taskDefaultTagBucketEnabledDesc,children:(0,s.jsx)(ed,{checked:F.taskDefaultTagBucketEnabled,onChange:e=>t8("taskDefaultTagBucketEnabled",e),disabled:tj,ariaLabel:tv.taskDefaultTagBucketEnabled})}),(0,s.jsx)(el,{label:tv.dashboardAllowTaskStartTimeEdit,description:tv.dashboardAllowTaskStartTimeEditDesc,children:(0,s.jsx)(ed,{checked:F.dashboardAllowTaskStartTimeEdit,onChange:e=>t8("dashboardAllowTaskStartTimeEdit",e),disabled:tj,ariaLabel:tv.dashboardAllowTaskStartTimeEdit})}),(0,s.jsx)(el,{label:tv.dashboardAllowSessionStartTimeEdit,description:tv.dashboardAllowSessionStartTimeEditDesc,children:(0,s.jsx)(ed,{checked:F.dashboardAllowSessionStartTimeEdit,onChange:e=>t8("dashboardAllowSessionStartTimeEdit",e),disabled:tj,ariaLabel:tv.dashboardAllowSessionStartTimeEdit})}),(0,s.jsx)(el,{label:tv.dashboardAllowTaskEndTimeEdit,description:tv.dashboardAllowTaskEndTimeEditDesc,children:(0,s.jsx)(ed,{checked:F.dashboardAllowTaskEndTimeEdit,onChange:e=>t8("dashboardAllowTaskEndTimeEdit",e),disabled:tj,ariaLabel:tv.dashboardAllowTaskEndTimeEdit})}),(0,s.jsx)(el,{label:tv.dashboardAllowSessionEndTimeEdit,description:tv.dashboardAllowSessionEndTimeEditDesc,children:(0,s.jsx)(ed,{checked:F.dashboardAllowSessionEndTimeEdit,onChange:e=>t8("dashboardAllowSessionEndTimeEdit",e),disabled:tj,ariaLabel:tv.dashboardAllowSessionEndTimeEdit})})]}),(0,s.jsxs)("section",{id:"settings-collection",className:ec,children:[(0,s.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wide text-zinc-500",children:tv.sectionCollection}),(0,s.jsx)(el,{label:tv.flushInterval,description:tv.flushIntervalDesc,children:(0,s.jsx)("input",{type:"number",min:5,max:3600,className:en(tj),value:F.flushIntervalSeconds,onChange:e=>t8("flushIntervalSeconds",Number(e.target.value)),disabled:tj})}),(0,s.jsx)(el,{label:tv.heartbeatInterval,description:tv.heartbeatIntervalDesc,children:(0,s.jsx)("input",{type:"number",min:30,max:86400,className:en(tj),value:F.heartbeatIntervalSeconds,onChange:e=>t8("heartbeatIntervalSeconds",Number(e.target.value)),disabled:tj})}),(0,s.jsx)(el,{label:tv.maxBuffered,description:tv.maxBufferedDesc,children:(0,s.jsx)("input",{type:"number",min:100,max:1e5,className:en(tj),value:F.maxBufferedEvents,onChange:e=>t8("maxBufferedEvents",Number(e.target.value)),disabled:tj})})]}),(0,s.jsxs)("section",{id:"settings-history",className:ec,children:[(0,s.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wide text-zinc-500",children:tv.sectionHistory}),(0,s.jsx)("p",{className:"text-xs leading-relaxed text-zinc-500",children:tv.historyLocalFirstHint}),(0,s.jsx)(el,{label:tv.historyPath,description:tv.historyPathDesc,children:(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("input",{type:"text",className:`${en(tj)} max-w-xl flex-1`,value:F.historyStoragePath,onChange:e=>t8("historyStoragePath",e.target.value),disabled:tj,autoComplete:"off"}),(0,s.jsx)("button",{type:"button",className:"shrink-0 rounded-lg border border-zinc-600 px-3 py-2 text-sm text-zinc-300 hover:bg-zinc-800 disabled:opacity-50",disabled:tj,onClick:()=>void tQ(),children:tv.pickStorageFolder})]})}),(0,s.jsxs)(el,{label:tv.localPersistenceDriver,description:tv.localPersistenceDriverDesc,children:[(0,s.jsxs)("select",{className:en(tj),value:F.localPersistenceDriver,onChange:e=>t8("localPersistenceDriver",e.target.value),disabled:tj,"aria-label":tv.localPersistenceDriver,children:[(0,s.jsx)("option",{value:"json",children:tv.persistenceDriverJson}),(0,s.jsx)("option",{value:"sqlite",children:tv.persistenceDriverSqlite})]}),(0,s.jsx)("p",{className:"mt-2 max-w-xl text-xs text-zinc-500 dark:text-zinc-400",children:tv.localPersistenceReloadHint})]}),(0,s.jsx)(el,{label:tv.historyPartition,description:tv.historyPartitionDesc,children:(0,s.jsxs)("select",{className:en(tj),value:F.historyPartition,onChange:e=>t8("historyPartition",e.target.value),disabled:tj,children:[(0,s.jsx)("option",{value:"daily",children:tv.partitionDaily}),(0,s.jsx)("option",{value:"weekly",children:tv.partitionWeekly}),(0,s.jsx)("option",{value:"monthly",children:tv.partitionMonthly})]})}),(0,s.jsx)(el,{label:tv.sessionStartMode,description:tv.sessionStartModeDesc,children:(0,s.jsxs)("select",{className:en(tj),value:F.sessionStartMode,onChange:e=>t8("sessionStartMode",e.target.value),disabled:tj,children:[(0,s.jsx)("option",{value:"continue",children:tv.modeContinue}),(0,s.jsx)("option",{value:"new",children:tv.modeNew})]})})]}),(0,s.jsxs)("section",{id:"settings-export",className:ec,children:[(0,s.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wide text-zinc-500",children:tv.sectionExport}),(0,s.jsx)(el,{label:tv.exportFormat,description:tv.exportFormatDesc,children:(0,s.jsxs)("select",{className:en(tj),value:F.sessionExportFormat,onChange:e=>t8("sessionExportFormat",e.target.value),disabled:tj,children:[(0,s.jsx)("option",{value:"json",children:tv.fmtJson}),(0,s.jsx)("option",{value:"csv",children:tv.fmtCsv}),(0,s.jsx)("option",{value:"jiraTable",children:tv.fmtJira}),(0,s.jsx)("option",{value:"sap",children:tv.fmtSap})]})}),(0,s.jsx)(el,{label:tv.csvDelimiter,description:tv.csvDelimiterDesc,children:(0,s.jsx)("input",{type:"text",maxLength:4,className:en(tj),value:F.csvDelimiter,onChange:e=>t8("csvDelimiter",e.target.value),disabled:tj})})]}),a?(0,s.jsx)(H.u,{s:tv,lang:tg,payload:a,saving:tj,refresh:tx}):null,(0,s.jsxs)("section",{id:"settings-git",className:ec,children:[(0,s.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wide text-zinc-500",children:tv.sectionGit}),(0,s.jsxs)("div",{id:"settings-git-identity",className:"scroll-mt-24 space-y-4 rounded-lg border border-zinc-200 bg-zinc-50/80 p-4 dark:border-zinc-700/80 dark:bg-zinc-950/40",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-sm font-medium text-zinc-900 dark:text-zinc-100",children:tv.gitIdentitySubheading}),(0,s.jsx)("p",{className:"mt-1 text-xs text-zinc-600 dark:text-zinc-400",children:tv.gitIdentityIntro})]}),(0,s.jsx)(el,{label:tv.gitIdentityNameLabel,description:tv.gitIdentityNameDesc,children:(0,s.jsx)("input",{type:"text",className:en(tj||e$),value:eB,onChange:e=>eH(e.target.value),disabled:tj||e$,autoComplete:"name",spellCheck:!1})}),(0,s.jsx)(el,{label:tv.gitIdentityEmailLabel,description:tv.gitIdentityEmailDesc,children:(0,s.jsx)("input",{type:"email",className:en(tj||e$),value:eM,onChange:e=>eR(e.target.value),disabled:tj||e$,autoComplete:"email",spellCheck:!1})}),(0,s.jsx)(el,{label:tv.gitIdentityLoginLabel,description:tv.gitIdentityLoginDesc,children:(0,s.jsx)("input",{type:"text",className:en(tj||e$),value:eF,onChange:e=>eU(e.target.value),disabled:tj||e$,autoComplete:"username",spellCheck:!1})}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,s.jsx)("button",{type:"button",className:"rounded-lg bg-violet-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-violet-500 disabled:opacity-50",disabled:tj||e$,onClick:()=>void th(),children:e$?tv.gitIdentitySaving:tv.gitIdentitySave}),eO?(0,s.jsx)("span",{className:"text-sm text-emerald-600 dark:text-emerald-400",children:tv.gitIdentitySavedFlash}):null]})]}),(0,s.jsx)(el,{label:tv.autoGitSync,description:tv.autoGitSyncDesc,children:(0,s.jsx)(eo,{checked:F.autoGitSync,onChange:e=>t8("autoGitSync",e),disabled:tj,ariaLabel:tv.autoGitSync})}),(0,s.jsxs)(el,{label:tv.gitlabInstanceUrl,description:tv.gitlabInstanceUrlDesc,children:[(0,s.jsx)("input",{type:"url",className:en(tj),value:F.gitlabApiBaseUrl,onChange:e=>t8("gitlabApiBaseUrl",e.target.value),disabled:tj,autoComplete:"off",spellCheck:!1,placeholder:"https://gitlab.com","aria-label":tv.gitlabInstanceUrl}),(0,s.jsx)("p",{className:"mt-1.5 text-xs leading-relaxed text-zinc-500 dark:text-zinc-400",children:tv.gitlabTest401Help})]}),(0,s.jsxs)(el,{label:tv.gitlabToken,description:tv.gitlabTokenDesc,children:[(0,s.jsx)("p",{className:"mb-2 text-xs text-zinc-400",children:tZ}),(0,s.jsx)("input",{type:"password",className:en(tj||eD||ew),value:eT,onChange:e=>eC(e.target.value),disabled:tj||eD||ew,autoComplete:"off",spellCheck:!1,placeholder:tG?"••••••••":"","aria-label":tv.gitlabToken}),(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2",children:[(0,s.jsx)("button",{type:"button",className:"rounded-lg bg-violet-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-violet-500 disabled:opacity-50",disabled:tj||eD||ew||0===eT.trim().length,title:0===eT.trim().length?tv.gitlabTokenSaveNeedValue:void 0,onClick:()=>void tX(eT),children:eD?tv.saving:tv.gitlabTokenSave}),(0,s.jsx)("button",{type:"button",className:"rounded-lg border border-zinc-600 px-3 py-1.5 text-sm text-zinc-300 hover:bg-zinc-800 disabled:opacity-50",disabled:tj||eD||ew||!tG,onClick:()=>void t0(),children:tv.gitlabTokenClear})]}),tG&&""===eT.trim()&&!tV?(0,s.jsx)("p",{className:"mt-2 text-xs leading-relaxed text-zinc-500 dark:text-zinc-400",children:tv.gitlabTestPasteStoredHint}):null,(0,s.jsx)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:(0,s.jsx)("button",{type:"button",className:"rounded-lg border border-zinc-600 px-3 py-1.5 text-sm text-zinc-300 hover:bg-zinc-800 disabled:opacity-50",disabled:tj||eD||ew||eP||!tK,"aria-label":tv.gitlabTestConnectionAria,onClick:()=>void t5(tv),children:eP?tv.gitlabTestRunning:tv.gitlabTestConnection})}),eA?(0,s.jsx)("p",{className:"ok"===eA.tone?"mt-2 text-sm text-emerald-600 dark:text-emerald-400":"warn"===eA.tone?"mt-2 text-sm text-amber-600 dark:text-amber-400":"mt-2 text-sm text-red-600 dark:text-red-400",children:eA.text}):null,tG||tV?(0,s.jsx)("p",{className:t_?"mt-2 text-xs text-emerald-600 dark:text-emerald-400":"mt-2 text-xs text-zinc-500 dark:text-zinc-400",children:t_?tv.gitlabApiVerifiedYes:tv.gitlabApiVerifiedNo}):null]}),tq?(0,s.jsxs)("div",{className:"max-w-md rounded-lg border border-violet-500/35 bg-violet-950/25 px-3 py-3 text-sm text-zinc-200",children:[(0,s.jsx)("p",{id:e,className:"leading-snug text-zinc-300",children:tv.glabRemoteSuggest}),(0,s.jsx)("button",{type:"button",className:"mt-3 w-fit rounded-lg border border-violet-500/60 bg-violet-600/20 px-3 py-1.5 text-sm text-violet-100 hover:bg-violet-600/35 disabled:opacity-50",disabled:tj||ew||eD,"aria-label":tv.glabRemoteCreate,"aria-describedby":e,onClick:()=>void t2(),children:ew?tv.glabRemoteCreating:tv.glabRemoteCreate})]}):null,(0,s.jsx)(el,{label:tv.gitRemoteUrl,description:tv.gitRemoteUrlDesc,children:(0,s.jsx)("input",{type:"text",className:en(tj),value:F.gitRemoteUrl,onChange:e=>t8("gitRemoteUrl",e.target.value),disabled:tj,autoComplete:"off"})})]}),(0,s.jsxs)("section",{id:"settings-mongo",className:ec,children:[(0,s.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wide text-zinc-500",children:tv.sectionMongo}),(0,s.jsx)(el,{label:tv.mongoEnabled,description:tv.mongoEnabledDesc,children:(0,s.jsx)(eo,{checked:F.mongodbEnabled,onChange:e=>t8("mongodbEnabled",e),disabled:tj,ariaLabel:tv.mongoEnabled})}),(0,s.jsx)(el,{label:tv.mongoDatabase,description:tv.mongoDatabaseDesc,children:(0,s.jsx)("input",{type:"text",className:en(tj||!F.mongodbEnabled),value:F.mongodbDatabaseName,onChange:e=>t8("mongodbDatabaseName",e.target.value),disabled:tj||!F.mongodbEnabled,autoComplete:"off",spellCheck:!1,"aria-label":tv.mongoDatabase})}),(0,s.jsx)(el,{label:tv.mongoCollection,description:tv.mongoCollectionDesc,children:(0,s.jsx)("input",{type:"text",className:en(tj||!F.mongodbEnabled),value:F.mongodbCollectionName,onChange:e=>t8("mongodbCollectionName",e.target.value),disabled:tj||!F.mongodbEnabled,autoComplete:"off",spellCheck:!1,"aria-label":tv.mongoCollection})}),(0,s.jsxs)("div",{id:"settings-mongo-connection",className:"scroll-mt-24 border-t border-zinc-800 pt-6",children:[(0,s.jsx)("h3",{className:"text-sm font-medium text-zinc-200",children:tv.sectionMongoConnection}),(0,s.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-zinc-500",children:tv.mongoConnectionIntro}),F.mongodbEnabled?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"mt-3 text-xs text-zinc-500",children:[tv.mongoRemoteStatus,":"," ","connected"===tU?tv.mongoStatusConnected:"failed"===tU?tv.mongoStatusFailed:tv.mongoStatusPending," \xb7 ",tM?(0,s.jsx)("span",{className:"text-emerald-400/90",children:tv.mongoConnectionResolvableYes}):(0,s.jsx)("span",{className:"text-amber-400/90",children:tv.mongoConnectionResolvableNo})]}),(0,s.jsxs)("div",{className:"mt-3 flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center",children:[(0,s.jsx)("button",{type:"button",className:"w-fit rounded-lg border border-zinc-600 px-3 py-1.5 text-sm text-zinc-200 hover:bg-zinc-800 disabled:opacity-50",disabled:tj||eN||ep||ey,"aria-label":tv.mongoTestConnectionAria,onClick:()=>void t3(tv,F),children:eN?tv.mongoTestRunning:tv.mongoTestConnection}),e_?(0,s.jsx)("p",{role:"status",className:`text-sm ${"ok"===e_.tone?"text-emerald-400":"warn"===e_.tone?"text-amber-400":"text-red-300"}`,children:e_.text}):null]}),(0,s.jsx)("p",{className:"mt-2 max-w-xl text-xs text-zinc-500",children:tv.mongoTestUsesSavedConfigHint}),(0,s.jsxs)("div",{className:"mt-4 border-t border-zinc-800 pt-4",children:[(0,s.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-zinc-500",children:tv.mongoSyncSectionTitle}),(0,s.jsx)(h,{t:tN,sync:a?.mongoMirrorSync,mongoEnabled:t$}),(0,s.jsxs)("section",{className:"mt-2 space-y-1 border-t border-zinc-800/80 pt-2","aria-labelledby":"settings-kronosys-workspace-paths",children:[(0,s.jsx)("p",{id:"settings-kronosys-workspace-paths",className:"text-[11px] font-medium text-zinc-500",children:tv.workspaceFoldersLabel}),tO?(0,s.jsx)("p",{className:"text-[11px] text-zinc-500",children:tv.workspaceFoldersEmpty}):tW.length>0?(0,s.jsx)("ul",{className:"list-none space-y-1 font-mono text-[11px] leading-snug text-zinc-400",children:tW.map(e=>(0,s.jsx)("li",{className:"break-all",children:e},e))}):null]}),(0,s.jsx)("button",{type:"button",className:"mt-3 rounded-lg border border-zinc-600 px-3 py-1.5 text-sm text-zinc-200 hover:bg-zinc-800 disabled:opacity-50",disabled:tj||eZ||eN||ep||ey||!t$,"aria-label":tv.mongoResyncAriaLabel,onClick:()=>t6(),children:eZ?tv.mongoResyncRunning:tv.mongoResyncButton}),(0,s.jsx)("p",{className:"mt-2 max-w-xl text-xs text-zinc-500",children:tv.mongoResyncHint})]})]}):null]}),(0,s.jsx)(el,{label:tv.mongoHost,description:tv.mongoHostDesc,children:(0,s.jsx)("input",{type:"text",className:en(tj||!F.mongodbEnabled),value:F.mongodbHost,onChange:e=>t8("mongodbHost",e.target.value),disabled:tj||!F.mongodbEnabled,autoComplete:"off",spellCheck:!1,"aria-label":tv.mongoHost})}),(0,s.jsx)(el,{label:tv.mongoPort,description:tv.mongoPortDesc,children:(0,s.jsx)("input",{type:"number",min:1,max:65535,className:en(tj||!F.mongodbEnabled),value:F.mongodbPort,onChange:e=>t8("mongodbPort",Number(e.target.value)),disabled:tj||!F.mongodbEnabled,"aria-label":tv.mongoPort})}),(0,s.jsx)(el,{label:tv.mongoUser,description:tv.mongoUserDesc,children:(0,s.jsx)("input",{type:"text",className:en(tj||!F.mongodbEnabled),value:F.mongodbUsername,onChange:e=>t8("mongodbUsername",e.target.value),disabled:tj||!F.mongodbEnabled,autoComplete:"off",spellCheck:!1,"aria-label":tv.mongoUser})}),(0,s.jsx)(el,{label:tv.mongoAuthSource,description:tv.mongoAuthSourceDesc,children:(0,s.jsx)("input",{type:"text",className:en(tj||!F.mongodbEnabled),value:F.mongodbAuthSource,onChange:e=>t8("mongodbAuthSource",e.target.value),disabled:tj||!F.mongodbEnabled,autoComplete:"off",spellCheck:!1,"aria-label":tv.mongoAuthSource})}),(0,s.jsxs)(el,{label:tv.mongoPassword,description:tv.mongoPasswordDesc,children:[(0,s.jsx)("p",{className:"mb-2 text-xs text-zinc-400",children:tF?tv.mongoPasswordConfiguredYes:tv.mongoPasswordConfiguredNo}),(0,s.jsx)("input",{type:"password",className:en(tj||ey||ep||!F.mongodbEnabled),value:ef,onChange:e=>ek(e.target.value),disabled:tj||ey||ep||!F.mongodbEnabled,autoComplete:"new-password",placeholder:tF?"••••••••":"","aria-label":tv.mongoPassword}),(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2",children:[(0,s.jsx)("button",{type:"button",className:"rounded-lg bg-violet-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-violet-500 disabled:opacity-50",disabled:tj||ey||ep||!F.mongodbEnabled,onClick:()=>void t4(ef),children:ey?tv.saving:tv.mongoPasswordSave}),(0,s.jsx)("button",{type:"button",className:"rounded-lg border border-zinc-600 px-3 py-1.5 text-sm text-zinc-300 hover:bg-zinc-800 disabled:opacity-50",disabled:tj||ey||ep||!F.mongodbEnabled,onClick:()=>void t4(""),children:tv.mongoPasswordClear})]})]}),(0,s.jsxs)(el,{label:tv.mongoManualUri,description:tv.mongoManualUriDesc,children:[(0,s.jsx)("p",{className:"mb-2 text-xs text-zinc-400",children:tR?tv.mongoUriConfiguredYes:tv.mongoUriConfiguredNo}),(0,s.jsx)("input",{type:"password",className:en(tj||ep||ey||!F.mongodbEnabled),value:eb,onChange:e=>eg(e.target.value),disabled:tj||ep||ey||!F.mongodbEnabled,autoComplete:"off",placeholder:tR?"••••••••":"","aria-label":tv.mongoUri}),(0,s.jsx)("p",{className:"mt-1 text-xs text-zinc-500",children:tv.mongoUriDesc}),(0,s.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2",children:[(0,s.jsx)("button",{type:"button",className:"rounded-lg bg-violet-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-violet-500 disabled:opacity-50",disabled:tj||ep||ey||!F.mongodbEnabled,onClick:()=>void t1(eb),children:ep?tv.saving:tv.mongoUriSave}),(0,s.jsx)("button",{type:"button",className:"rounded-lg border border-zinc-600 px-3 py-1.5 text-sm text-zinc-300 hover:bg-zinc-800 disabled:opacity-50",disabled:tj||ep||ey||!F.mongodbEnabled,onClick:()=>void t1(""),children:tv.mongoUriClear})]})]})]}),(0,s.jsxs)("section",{id:"settings-workspace-loc",className:ec,children:[(0,s.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wide text-zinc-500",children:tv.sectionWorkspaceLoc}),"manager"===F.usageProfile?(0,s.jsx)("p",{className:"mt-2 text-sm text-zinc-500",children:tv.workspaceLocSectionHiddenManager}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(el,{label:tv.workspaceLocExcludedDirs,description:tv.workspaceLocExcludedDirsDesc,children:(0,s.jsx)("textarea",{className:ei(tj),value:F.workspaceLocExcludedDirsText,onChange:e=>t8("workspaceLocExcludedDirsText",e.target.value),disabled:tj,spellCheck:!1,"aria-label":tv.workspaceLocExcludedDirs})}),(0,s.jsx)(el,{label:tv.workspaceLocExcludedPatterns,description:tv.workspaceLocExcludedPatternsDesc,children:(0,s.jsx)("textarea",{className:ei(tj),value:F.workspaceLocExcludedPathPatternsText,onChange:e=>t8("workspaceLocExcludedPathPatternsText",e.target.value),disabled:tj,spellCheck:!1,"aria-label":tv.workspaceLocExcludedPatterns})})]})]}),(0,s.jsxs)("section",{id:"settings-web",className:ec,children:[(0,s.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wide text-zinc-500",children:tv.sectionWeb}),(0,s.jsxs)("div",{className:"flex flex-col gap-8 mb-10",children:[(0,s.jsx)(el,{label:tv.dashboardDisplayTimeZone,description:tv.dashboardDisplayTimeZoneDesc,children:(0,s.jsx)("select",{className:en(tj),value:F.dashboardDisplayTimeZone,onChange:e=>t8("dashboardDisplayTimeZone",e.target.value),disabled:tj,children:D.U$.map(e=>(0,s.jsx)("option",{value:e.id,children:"fr"===tg?e.labelFr:e.labelEn},e.id))})}),(0,s.jsx)(el,{label:tv.dashboardClockFormat,description:tv.dashboardClockFormatDesc,children:(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,s.jsxs)("label",{className:"flex items-center gap-2 text-sm text-zinc-700 dark:text-zinc-300",children:[(0,s.jsx)("input",{type:"radio",name:"dashboardUse24HourClock",checked:!1===F.dashboardUse24HourClock,onChange:()=>t8("dashboardUse24HourClock",!1),disabled:tj,className:"h-4 w-4 accent-violet-600"}),tv.dashboardClock12hOption]}),(0,s.jsxs)("label",{className:"flex items-center gap-2 text-sm text-zinc-700 dark:text-zinc-300",children:[(0,s.jsx)("input",{type:"radio",name:"dashboardUse24HourClock",checked:!0===F.dashboardUse24HourClock,onChange:()=>t8("dashboardUse24HourClock",!0),disabled:tj,className:"h-4 w-4 accent-violet-600"}),tv.dashboardClock24hOption]})]})}),(0,s.jsx)(el,{label:tv.dashboardLightThemeVariant,description:tv.dashboardLightThemeVariantDesc,children:(0,s.jsx)("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":tv.dashboardLightThemeVariant,children:[["warm",tv.dashboardLightThemeWarm],["soft",tv.dashboardLightThemeSoft],["contrast",tv.dashboardLightThemeContrast]].map(([e,t])=>(0,s.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded-lg border border-zinc-300 px-3 py-2 text-sm text-zinc-700 has-[:checked]:border-violet-500/60 has-[:checked]:bg-violet-50 dark:border-zinc-600 dark:text-zinc-300 dark:has-[:checked]:border-violet-500/60 dark:has-[:checked]:bg-violet-950/35",children:[(0,s.jsx)("input",{type:"radio",name:"dashboardLightThemeVariant",value:e,checked:F.dashboardLightThemeVariant===e,onChange:()=>{t8("dashboardLightThemeVariant",e),W.e.getState().setLightThemeVariant(e),(0,$.jW)(e)},disabled:tj,className:"h-4 w-4 accent-violet-600"}),t]},e))})}),(0,s.jsx)(el,{label:tv.dashboardCalendarWeekStartsOn,description:tv.dashboardCalendarWeekStartsOnDesc,children:(0,s.jsx)("div",{className:"flex flex-wrap gap-2",role:"radiogroup","aria-label":tv.dashboardCalendarWeekStartsOn,children:[["sunday",tv.calendarWeekStartsSunday],["monday",tv.calendarWeekStartsMonday],["saturday",tv.calendarWeekStartsSaturday]].map(([e,t])=>(0,s.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded-lg border border-zinc-300 px-3 py-2 text-sm text-zinc-700 has-[:checked]:border-violet-500/60 has-[:checked]:bg-violet-50 dark:border-zinc-600 dark:text-zinc-300 dark:has-[:checked]:border-violet-500/60 dark:has-[:checked]:bg-violet-950/35",children:[(0,s.jsx)("input",{type:"radio",name:"dashboardCalendarWeekStartsOn",value:e,checked:F.dashboardCalendarWeekStartsOn===e,onChange:()=>t8("dashboardCalendarWeekStartsOn",e),disabled:tj,className:"h-4 w-4 accent-violet-600"}),t]},e))})}),(0,s.jsx)("div",{id:"settings-default-session-name",className:"scroll-mt-24",children:(0,s.jsx)(el,{label:tv.dashboardDefaultSessionNameTemplate,description:tv.dashboardDefaultSessionNameTemplateDesc,children:(0,s.jsx)("input",{type:"text",className:en(tj),value:F.dashboardDefaultSessionNameTemplate,onChange:e=>t8("dashboardDefaultSessionNameTemplate",e.target.value.slice(0,400)),disabled:tj,spellCheck:!1,autoComplete:"off",placeholder:"Session %F %UUID","aria-label":tv.dashboardDefaultSessionNameTemplate})})})]}),(0,s.jsxs)("div",{id:"settings-dashboard-tour",className:"scroll-mt-24 mb-8 rounded-xl border border-zinc-200 bg-zinc-50/80 p-4 dark:border-zinc-700 dark:bg-zinc-900/50",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:tv.dashboardTourBlockTitle}),(0,s.jsx)("p",{className:"mt-2 text-sm leading-relaxed text-zinc-600 dark:text-zinc-400",children:tv.dashboardTourBlockIntro}),(0,s.jsx)(i(),{href:"/?tour=replay",className:"mt-4 inline-flex items-center justify-center rounded-lg border border-violet-500/50 bg-violet-500/10 px-4 py-2 text-sm font-medium text-violet-800 transition hover:border-violet-500/75 hover:bg-violet-500/18 dark:border-violet-400/45 dark:bg-violet-600/20 dark:text-violet-100 dark:hover:border-violet-400/60 dark:hover:bg-violet-600/30",children:tv.dashboardTourReplayLinkLabel}),(0,s.jsx)("button",{type:"button",className:"mt-4 ml-3 inline-flex items-center justify-center rounded-lg border border-zinc-500/50 bg-zinc-500/10 px-4 py-2 text-sm font-medium text-zinc-800 transition hover:border-zinc-500/75 hover:bg-zinc-500/18 dark:border-zinc-400/45 dark:bg-zinc-600/20 dark:text-zinc-100 dark:hover:border-zinc-400/60 dark:hover:bg-zinc-600/30",onClick:()=>{R.r.getState().resetDashboard(),R.r.getState().resetSettings(),td(!0)},children:tN.tourUndismissBtn})]}),(0,s.jsxs)("div",{id:"settings-dashboard-column-hints",className:"scroll-mt-24 mb-8 rounded-xl border border-zinc-200 bg-zinc-50/80 p-4 dark:border-zinc-700 dark:bg-zinc-900/50",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:tv.dashboardColumnHintsBlockTitle}),(0,s.jsx)("p",{className:"mt-2 text-sm leading-relaxed text-zinc-600 dark:text-zinc-400",children:tv.dashboardColumnHintsBlockIntro}),(0,s.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-x-3 gap-y-2",children:[(0,s.jsx)("button",{type:"button",className:"inline-flex items-center justify-center rounded-lg border border-zinc-500/50 bg-zinc-500/10 px-4 py-2 text-sm font-medium text-zinc-800 transition hover:border-zinc-500/75 hover:bg-zinc-500/18 dark:border-zinc-400/45 dark:bg-zinc-600/20 dark:text-zinc-100 dark:hover:border-zinc-400/60 dark:hover:bg-zinc-600/30",onClick:tS,children:tv.dashboardColumnHintsRestoreBtn}),eG?(0,s.jsx)("span",{className:"text-sm text-emerald-600 dark:text-emerald-400",role:"status",children:tv.dashboardColumnHintsRestoreDone}):null]})]}),(0,s.jsxs)("div",{id:"settings-reporting-tour",className:"scroll-mt-24 mb-8 rounded-xl border border-zinc-200 bg-zinc-50/80 p-4 dark:border-zinc-700 dark:bg-zinc-900/50",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-zinc-900 dark:text-zinc-100",children:tv.reportingTourBlockTitle}),(0,s.jsx)("p",{className:"mt-2 text-sm leading-relaxed text-zinc-600 dark:text-zinc-400",children:tv.reportingTourBlockIntro}),(0,s.jsx)(i(),{href:"/reporting?tour=replay",className:"mt-4 inline-flex items-center justify-center rounded-lg border border-violet-500/50 bg-violet-500/10 px-4 py-2 text-sm font-medium text-violet-800 transition hover:border-violet-500/75 hover:bg-violet-500/18 dark:border-violet-400/45 dark:bg-violet-600/20 dark:text-violet-100 dark:hover:border-violet-400/60 dark:hover:bg-violet-600/30",children:tv.reportingTourReplayLinkLabel})]}),(0,s.jsxs)(el,{label:tv.localApiPort,description:tv.localApiPortDesc,children:[(0,s.jsx)("input",{type:"number",min:1024,max:65535,className:en(tj),value:F.localApiPort,onChange:e=>t8("localApiPort",Number(e.target.value)),disabled:tj}),(0,s.jsx)("p",{className:"mt-2 text-xs text-amber-200/80",children:tv.hintPortRestart})]}),(0,s.jsxs)(el,{label:tv.dashboardWebUrl,description:tv.dashboardWebUrlDesc,children:[(0,s.jsx)("input",{type:"url",className:en(tj),value:F.dashboardWebUrl,onChange:e=>t8("dashboardWebUrl",e.target.value),disabled:tj}),(0,s.jsx)("p",{className:"mt-2 text-xs text-zinc-500",children:tv.hintDashboardUrl})]}),(0,s.jsx)("div",{id:"settings-session-duration-alert",className:"scroll-mt-24",children:(0,s.jsx)(el,{label:tv.dashboardSessionDurationAlertHours,description:tv.dashboardSessionDurationAlertHoursDesc,children:(0,s.jsx)("input",{type:"number",min:1,max:8760,className:en(tj),value:F.dashboardSessionDurationAlertHours,onChange:e=>t8("dashboardSessionDurationAlertHours",Number(e.target.value)),disabled:tj,"aria-label":tv.dashboardSessionDurationAlertHours})})}),(0,s.jsx)("div",{id:"settings-base-daily-hours",className:"scroll-mt-24",children:(0,s.jsx)(el,{label:tv.dashboardBaseDailyHours,description:tv.dashboardBaseDailyHoursDesc,children:(0,s.jsx)("input",{type:"number",min:0,max:24,step:.25,className:en(tj),value:F.dashboardBaseDailyHours,onChange:e=>t8("dashboardBaseDailyHours",Math.min(24,Math.max(0,Number(e.target.value)))),disabled:tj,"aria-label":tv.dashboardBaseDailyHours})})}),(0,s.jsx)("div",{id:"settings-base-daily-tolerance",className:"scroll-mt-24",children:(0,s.jsx)(el,{label:tv.dashboardBaseDailyToleranceMinutes,description:tv.dashboardBaseDailyToleranceMinutesDesc,children:(0,s.jsx)("input",{type:"number",min:0,max:120,step:1,className:en(tj),value:F.dashboardBaseDailyToleranceMinutes,onChange:e=>t8("dashboardBaseDailyToleranceMinutes",Math.min(120,Math.max(0,Math.round(Number(e.target.value))))),disabled:tj,"aria-label":tv.dashboardBaseDailyToleranceMinutes})})})]}),(0,s.jsxs)("section",{id:"settings-archived-sessions",className:ec,children:[(0,s.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wide text-zinc-500",children:tv.sectionArchivedSessions}),(0,s.jsx)("p",{className:"text-xs leading-relaxed text-zinc-500",children:tv.archivedSessionsIntro}),(0,s.jsx)("ul",{className:"mt-4 divide-y divide-zinc-800 rounded-lg border border-zinc-800",children:0===tE?(0,s.jsx)("li",{className:"px-3 py-8 text-center text-sm text-zinc-500",children:tN.archivesEmpty}):tI.map(e=>{let t=e.sessionName?.trim()||e.sessionId.slice(0,8),a=("string"==typeof e.sessionNote?e.sessionNote.trim():"").replaceAll(/\s+/g," "),r=a.length>0,n=(e.tasks?.length??0)+(Array.isArray(e.activeTasks)&&e.activeTasks.length>0?e.activeTasks.length:+!!e.activeTask),i=e1===e.sessionId;return(0,s.jsxs)("li",{className:"flex items-center justify-between gap-2 px-3 py-2.5 hover:bg-zinc-800/40",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"truncate font-medium text-zinc-200",children:t}),(0,s.jsxs)("div",{className:"text-[0.7rem] text-zinc-500",children:[n," ",(0,x.r)(n,tN,tg)]}),r?(0,s.jsxs)("div",{className:"mt-1 inline-flex min-w-0 max-w-full items-center gap-1 text-[0.7rem] text-zinc-500",title:a,children:[(0,s.jsx)(ee.A,{size:12,className:"shrink-0","aria-hidden":!0}),(0,s.jsx)("span",{className:"truncate",children:a})]}):null]}),(0,s.jsx)("button",{type:"button",disabled:i||tj,className:"shrink-0 rounded-lg border border-violet-600/50 px-3 py-1.5 text-sm text-violet-200 hover:bg-violet-950/40 disabled:cursor-not-allowed disabled:opacity-50",onClick:()=>void t7(e.sessionId),children:tN.sessionRestoreBtn})]},e.sessionId)})}),tE>10?(0,s.jsxs)("nav",{className:"mt-3 flex flex-wrap items-center justify-between gap-2","aria-label":tv.archivesPaginationNavAria,children:[(0,s.jsx)("button",{type:"button",disabled:tL<=0||tj,className:"rounded-lg border border-zinc-600 px-3 py-1.5 text-sm text-zinc-300 hover:bg-zinc-800 disabled:cursor-not-allowed disabled:opacity-40",onClick:()=>e2(e=>Math.max(0,e-1)),children:tv.archivesPaginationPrev}),(0,s.jsx)("span",{className:"text-xs tabular-nums text-zinc-500",children:tv.archivesPaginationRange.replace("{from}",String(0===tE?0:tA+1)).replace("{to}",String(tB)).replace("{total}",String(tE))}),(0,s.jsx)("button",{type:"button",disabled:tL>=tP||tj,className:"rounded-lg border border-zinc-600 px-3 py-1.5 text-sm text-zinc-300 hover:bg-zinc-800 disabled:cursor-not-allowed disabled:opacity-40",onClick:()=>e2(e=>Math.min(tP,e+1)),children:tv.archivesPaginationNext})]}):tE>0?(0,s.jsx)("p",{className:"mt-2 text-xs tabular-nums text-zinc-500",children:tv.archivesPaginationRange.replace("{from}",String(tA+1)).replace("{to}",String(tB)).replace("{total}",String(tE))}):null]}),(0,s.jsxs)("section",{id:"settings-danger-zone",className:ec,children:[(0,s.jsx)("h2",{className:"text-xs font-semibold uppercase tracking-wide text-red-700 dark:text-red-400/95",children:tv.sectionDangerZone}),(0,s.jsxs)("div",{className:"max-w-xl rounded-xl border border-red-300/90 bg-red-50/80 p-4 dark:border-red-900/55 dark:bg-red-950/30",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-red-900 dark:text-red-200",children:tv.dangerBackupRestoreTitle}),(0,s.jsx)("p",{className:"mt-2 text-xs leading-relaxed text-red-900/85 dark:text-red-200/85",children:tv.dangerBackupRestoreIntro}),(0,s.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[(0,s.jsx)("a",{href:"/api/backup?format=json",download:!0,className:"rounded-lg border border-red-500/70 px-3 py-1.5 text-xs font-medium text-red-900 hover:bg-red-100 dark:text-red-200 dark:hover:bg-red-900/40",children:tv.dangerClearHistoryBackupJson}),(0,s.jsx)("a",{href:"/api/backup?format=csv-zip",download:!0,className:"rounded-lg border border-red-500/70 px-3 py-1.5 text-xs font-medium text-red-900 hover:bg-red-100 dark:text-red-200 dark:hover:bg-red-900/40",children:tv.dangerClearHistoryBackupCsvZip}),(0,s.jsx)("a",{href:"/api/backup?format=sqlite",download:!0,className:"rounded-lg border border-red-500/70 px-3 py-1.5 text-xs font-medium text-red-900 hover:bg-red-100 dark:text-red-200 dark:hover:bg-red-900/40",children:tv.dangerClearHistoryBackupSqlite})]}),(0,s.jsxs)("div",{className:"mt-4 space-y-2",children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-red-900/90 dark:text-red-200/90",children:tv.dangerRestorePickFile}),(0,s.jsx)("input",{ref:tn,type:"file",accept:".json,.sqlite,.db,application/json,application/vnd.sqlite3",disabled:tt||e9,className:"block w-full rounded-lg border border-red-300 bg-white px-3 py-2 text-xs text-zinc-800 file:mr-3 file:rounded file:border-0 file:bg-red-100 file:px-2.5 file:py-1 file:text-xs file:font-medium file:text-red-900 dark:border-red-900/60 dark:bg-zinc-950 dark:text-zinc-200 dark:file:bg-red-900/35 dark:file:text-red-200",onChange:e=>{tr(e.target.files?.[0]??null)}}),(0,s.jsx)("p",{className:"text-[11px] leading-relaxed text-red-900/80 dark:text-red-300/80",children:tv.dangerRestoreHint}),(0,s.jsx)("button",{type:"button",disabled:!ts||tt||e9,className:"rounded-lg border border-red-600/80 bg-red-700 px-3 py-1.5 text-xs font-medium text-white hover:bg-red-600 disabled:cursor-not-allowed disabled:opacity-50 dark:border-red-500 dark:bg-red-800/90 dark:hover:bg-red-700",onClick:()=>te(!0),children:tt?tv.dangerRestoreBusy:tv.dangerRestoreButton})]}),(0,s.jsx)("h3",{className:"text-sm font-semibold text-red-900 dark:text-red-200",children:tv.dangerClearHistoryTitle}),(0,s.jsx)("p",{className:"mt-2 text-xs leading-relaxed text-red-900/85 dark:text-red-200/85",children:tv.dangerClearHistoryBodyIntro}),(0,s.jsx)("ul",{className:"mt-2 list-disc space-y-1.5 pl-5 text-xs leading-relaxed text-red-900/85 dark:text-red-200/85",children:tv.dangerClearHistoryBodyBullets.map(e=>(0,s.jsx)("li",{children:e},e))}),(0,s.jsx)("p",{className:"mt-2 text-xs leading-relaxed text-red-900/85 dark:text-red-200/85",children:tv.dangerClearHistoryBodyAfterList1}),(0,s.jsx)("p",{className:"mt-2 text-xs leading-relaxed text-red-900/85 dark:text-red-200/85",children:tv.dangerClearHistoryBodyAfterList2}),(0,s.jsx)("button",{type:"button",className:"mt-4 rounded-lg border border-red-600/80 bg-red-600 px-4 py-2 text-sm font-medium text-white hover:bg-red-500 dark:border-red-500 dark:bg-red-800/90 dark:hover:bg-red-700",onClick:()=>e6(!0),children:tv.dangerClearHistoryButton})]})]})]})]}):null]}),(0,s.jsx)(b.qS,{open:null!==eY,message:eY??"",okLabel:tv.dialogOkBtn,onClose:()=>eQ(null)}),(0,s.jsx)(b.qR,{open:eX,message:tv.mongoResyncConfirm,cancelLabel:tv.dialogCancelBtn,confirmLabel:tv.dialogConfirmBtn,onCancel:()=>e0(!1),onConfirm:()=>void t9()}),(0,s.jsx)(b.qR,{open:e7,title:tv.dangerRestoreButton,message:tv.dangerRestoreConfirm,cancelLabel:tv.dialogCancelBtn,confirmLabel:tv.dialogConfirmBtn,confirmVariant:"danger",pending:tt,onCancel:()=>{tt||te(!1)},onConfirm:()=>{at()}}),(0,s.jsx)(b.qR,{open:e3,title:tv.dangerClearHistoryTitle,message:tv.dangerClearHistoryConfirm,cancelLabel:tv.dialogCancelBtn,confirmLabel:tv.dialogConfirmBtn,confirmVariant:"danger",extra:tC,pending:e9,typeToConfirm:{expected:tv.dangerClearHistoryConfirmPhrase,instruction:tv.dangerClearHistoryTypeInstruction.replace("{phrase}",tv.dangerClearHistoryConfirmPhrase),label:tv.dangerClearHistoryTypeFieldLabel,inputAriaLabel:tv.dangerClearHistoryTypeInputAria},onCancel:()=>{e9||e6(!1)},onConfirm:()=>{ae()}}),(0,s.jsx)(b.qR,{open:Y,title:tv.resetToDefaults,message:tv.resetToDefaultsConfirm,cancelLabel:tv.dialogCancelBtn,confirmLabel:tv.dialogConfirmBtn,onCancel:()=>{eu||ex(!1)},onConfirm:()=>{ex(!1),aa()}}),(0,s.jsx)(L.n,{ariaLabel:tv.scrollToTopAria}),(0,s.jsx)(U,{open:to,onOpenChange:td,dt:tN})]})}function eu(){return(0,s.jsx)(r.Suspense,{fallback:(0,s.jsx)("div",{className:"min-h-screen bg-zinc-100 px-6 py-10 text-sm text-zinc-500 dark:bg-zinc-900",children:"Kronosys…"}),children:(0,s.jsx)(ex,{})})}},4747:(e,t,a)=>{"use strict";a.d(t,{r:()=>l});var s=a(1934),r=a(9311);let n={dashboard:"kronosys.dashboard.tour.completed.v1",settings:"kronosys.settings.tour.completed.v1",reporting:"kronosys.reporting.tour.completed.v1"},i="kronosys.dashboard.tours.v2";!function(){if(window.localStorage.getItem(i))return;let e={},t=!1;for(let[a,s]of Object.entries(n))if("1"===window.localStorage.getItem(s)){e[a]=!0,t=!0;try{window.localStorage.removeItem(s)}catch{}}if(t)try{window.localStorage.setItem(i,JSON.stringify({state:e,version:0}))}catch{}}();let l=(0,s.v)()((0,r.Zr)(e=>({dashboard:!1,settings:!1,reporting:!1,markDashboardCompleted:()=>e({dashboard:!0}),markSettingsCompleted:()=>e({settings:!0}),markReportingCompleted:()=>e({reporting:!0}),resetDashboard:()=>e({dashboard:!1}),resetSettings:()=>e({settings:!1}),resetReporting:()=>e({reporting:!1})}),{name:i,partialize:e=>({dashboard:e.dashboard,settings:e.settings,reporting:e.reporting})}))},7856:(e,t,a)=>{"use strict";a.d(t,{p:()=>d});var s=a(5155),r=a(2115),n=a(7650),i=a(4961),l=a(1908);let o={position:"fixed",top:0,left:0,width:288,zIndex:80,visibility:"hidden",pointerEvents:"none"};function d({ariaLabel:e,body:t,align:a="start",preserveLineBreaks:c=!1,panelClassName:m}){let[x,u]=(0,r.useState)(!1),h=(0,r.useRef)(null),b=(0,r.useRef)(null),g=(0,r.useId)(),p=(0,l.l)(x,h,b,{align:a,maxWidthRem:m?24:18});(0,r.useEffect)(()=>{if(!x)return;let e=e=>{let t=e.target;h.current?.contains(t)||b.current?.contains(t)||u(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[x]);let v=p??(x?o:void 0),f=x&&"u">typeof document&&v?(0,n.createPortal)((0,s.jsx)("div",{ref:b,id:`${g}-metric-help`,style:v,className:`rounded-lg border border-zinc-200 bg-white p-2.5 text-left shadow-lg normal-case dark:border-zinc-600 dark:bg-zinc-900${m?` ${m}`:""}`,role:"region","aria-label":e,children:(0,s.jsx)("p",{className:`text-[0.7rem] leading-snug text-zinc-700 dark:text-zinc-300${c?" whitespace-pre-line":""} ${!m?"max-w-full":""}`,children:t})}),document.body):null;return(0,s.jsxs)("div",{className:"relative inline-flex shrink-0",ref:h,children:[(0,s.jsx)("button",{type:"button",className:"rounded p-0.5 text-zinc-500 hover:bg-zinc-200/90 hover:text-zinc-800 dark:hover:bg-zinc-800 dark:hover:text-zinc-300","aria-label":e,"aria-expanded":x?"true":"false","aria-controls":`${g}-metric-help`,onClick:()=>u(e=>!e),children:(0,s.jsx)(i.A,{size:13,strokeWidth:1.75,"aria-hidden":!0})}),f]})}},8090:(e,t,a)=>{"use strict";a.d(t,{v:()=>o});var s=a(5155),r=a(6296),n=a(4755),i=a(1958),l=a(4897);function o({phase:e,dt:t,lang:a,technicalDetail:d,onRetry:c,retryBusy:m}){let x="loading"===e,u=(0,l.iM)(d,a),h="string"==typeof d?d.trim():"",b=h.length>0&&"string"==typeof u&&h!==u;return(0,s.jsx)("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-zinc-200/55 backdrop-blur-sm dark:bg-black/45",role:"status","aria-live":"polite","aria-busy":x?"true":"false","aria-label":x?t.dashboardLoadingAriaLabel:t.dashboardConnectionErrorAriaLabel,children:(0,s.jsxs)("div",{className:"flex min-h-[10.5rem] max-w-sm flex-col items-center justify-center gap-4 rounded-2xl border border-zinc-200/90 bg-white/95 px-10 py-9 shadow-2xl dark:border-zinc-600/60 dark:bg-zinc-900/95",children:[x?(0,s.jsx)(r.A,{className:"size-12 shrink-0 animate-spin text-violet-600 dark:text-violet-400",strokeWidth:2,"aria-hidden":!0}):(0,s.jsx)(n.A,{className:"size-12 shrink-0 text-amber-600 dark:text-amber-400",strokeWidth:2,"aria-hidden":!0}),(0,s.jsxs)("div",{className:"flex min-h-[2.75rem] flex-col items-center justify-center gap-2 text-center",children:[(0,s.jsx)("p",{className:"text-sm font-medium leading-snug text-zinc-800 dark:text-zinc-100",children:x?t.dashboardLoadingMessage:t.dashboardConnectionErrorTitle}),x?null:(0,s.jsx)("p",{className:"max-w-[22rem] text-sm leading-snug text-zinc-600 dark:text-zinc-300",children:t.dashboardConnectionErrorBody}),!x&&u?(0,s.jsx)("p",{className:"max-w-[22rem] text-xs leading-snug text-zinc-500 dark:text-zinc-400",children:u}):null]}),!x&&c?(0,s.jsxs)("button",{type:"button",className:"mt-1 inline-flex items-center justify-center gap-2 rounded-lg bg-violet-600 px-4 py-2 text-sm font-medium text-white hover:bg-violet-500 focus:outline-none focus-visible:ring-2 focus-visible:ring-violet-400 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-wait disabled:opacity-70 dark:focus-visible:ring-offset-zinc-900",onClick:c,disabled:!0===m,children:[(0,s.jsx)(i.A,{className:`size-4 shrink-0 ${m?"animate-spin":""}`,"aria-hidden":!0}),t.dashboardConnectionRetryLabel]}):null,!x&&b?(0,s.jsxs)("details",{className:"mt-2 max-w-sm text-left",children:[(0,s.jsx)("summary",{className:"cursor-pointer text-xs text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200",children:t.dashboardConnectionTechnicalDetailsLabel}),(0,s.jsx)("pre",{className:"mt-2 max-h-32 overflow-auto rounded-md border border-zinc-200/80 bg-zinc-50/90 px-3 py-2 text-[0.65rem] leading-relaxed text-zinc-700 dark:border-zinc-600/50 dark:bg-zinc-950/80 dark:text-zinc-300",children:d})]}):null]})})}}},e=>{e.O(0,[555,558,227,569,840,702,441,794,358],()=>e(e.s=434)),_N_E=e.O()}]);