ltcai 11.0.1 β†’ 11.2.0

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 (140) hide show
  1. package/README.md +55 -43
  2. package/docs/CHANGELOG.md +61 -0
  3. package/docs/COMMUNITY_AND_PLUGINS.md +1 -1
  4. package/docs/DEVELOPMENT.md +1 -1
  5. package/docs/FEATURE_AUDIT_v11.2.0.md +393 -0
  6. package/docs/LAYOUT_REBUILD_SPEC.md +9 -1
  7. package/docs/ONBOARDING.md +1 -1
  8. package/docs/OPERATIONS.md +1 -1
  9. package/docs/PERFORMANCE.md +71 -18
  10. package/docs/TRUST_MODEL.md +1 -1
  11. package/docs/WHY_LATTICE.md +1 -1
  12. package/docs/architecture.md +6 -2
  13. package/docs/kg-schema.md +1 -1
  14. package/lattice_brain/__init__.py +1 -1
  15. package/lattice_brain/embeddings.py +12 -37
  16. package/lattice_brain/gates.py +125 -0
  17. package/lattice_brain/graph/discovery_index.py +30 -32
  18. package/lattice_brain/graph/fusion.py +35 -4
  19. package/lattice_brain/graph/image_vectors.py +230 -0
  20. package/lattice_brain/graph/ingest.py +11 -5
  21. package/lattice_brain/graph/projection.py +66 -8
  22. package/lattice_brain/graph/provenance.py +27 -2
  23. package/lattice_brain/graph/retrieval.py +113 -2
  24. package/lattice_brain/graph/retrieval_docgen.py +6 -6
  25. package/lattice_brain/graph/schema.py +18 -0
  26. package/lattice_brain/graph/store.py +9 -0
  27. package/lattice_brain/graph/vector_index/selector.py +32 -2
  28. package/lattice_brain/ingestion.py +363 -10
  29. package/lattice_brain/multimodal.py +1258 -0
  30. package/lattice_brain/portability.py +169 -32
  31. package/lattice_brain/runtime/multi_agent.py +1 -1
  32. package/lattice_brain/sealed_box.py +244 -0
  33. package/lattice_brain/self_model.py +77 -22
  34. package/lattice_brain/synthesis.py +24 -1
  35. package/latticeai/__init__.py +1 -1
  36. package/latticeai/api/brain_intelligence.py +4 -0
  37. package/latticeai/api/chat.py +11 -0
  38. package/latticeai/api/chat_helpers.py +16 -3
  39. package/latticeai/api/chat_hybrid.py +32 -1
  40. package/latticeai/api/features.py +70 -0
  41. package/latticeai/api/local_files.py +102 -0
  42. package/latticeai/api/memory.py +128 -1
  43. package/latticeai/api/portability.py +39 -4
  44. package/latticeai/api/review_queue.py +126 -0
  45. package/latticeai/api/search.py +16 -2
  46. package/latticeai/core/agent.py +59 -2
  47. package/latticeai/core/agent_prompts.py +66 -0
  48. package/latticeai/core/config.py +4 -1
  49. package/latticeai/core/context_builder.py +98 -11
  50. package/latticeai/core/embedding_providers.py +528 -0
  51. package/latticeai/core/legacy_compatibility.py +1 -1
  52. package/latticeai/core/marketplace.py +1 -1
  53. package/latticeai/core/messages.py +180 -0
  54. package/latticeai/core/model_compat.py +73 -2
  55. package/latticeai/core/workspace_os.py +43 -0
  56. package/latticeai/core/workspace_os_constants.py +1 -1
  57. package/latticeai/core/workspace_reorganization.py +335 -0
  58. package/latticeai/models/model_providers.py +12 -4
  59. package/latticeai/runtime/build_phases.py +33 -2
  60. package/latticeai/runtime/chat_wiring.py +4 -0
  61. package/latticeai/runtime/feature_toggle_wiring.py +163 -0
  62. package/latticeai/runtime/persistence_runtime.py +41 -4
  63. package/latticeai/runtime/router_registration.py +11 -0
  64. package/latticeai/runtime/runtime_context.py +1 -0
  65. package/latticeai/services/app_context.py +8 -0
  66. package/latticeai/services/architecture_readiness.py +1 -1
  67. package/latticeai/services/automation_intelligence.py +22 -2
  68. package/latticeai/services/brain_intelligence.py +123 -7
  69. package/latticeai/services/change_proposals.py +50 -10
  70. package/latticeai/services/command_center.py +10 -4
  71. package/latticeai/services/feature_toggles.py +502 -0
  72. package/latticeai/services/folder_watch.py +122 -1
  73. package/latticeai/services/hybrid_chat.py +56 -5
  74. package/latticeai/services/interop_bridges.py +978 -0
  75. package/latticeai/services/memory_service.py +34 -0
  76. package/latticeai/services/model_capability_registry.py +434 -261
  77. package/latticeai/services/model_catalog.py +95 -61
  78. package/latticeai/services/model_recommendation.py +18 -11
  79. package/latticeai/services/model_runtime.py +1 -1
  80. package/latticeai/services/multimodal_ports.py +112 -0
  81. package/latticeai/services/obsidian_bridge.py +16 -25
  82. package/latticeai/services/product_readiness.py +1 -1
  83. package/latticeai/services/search_service.py +149 -2
  84. package/latticeai/services/self_model_service.py +171 -0
  85. package/latticeai/services/tool_dispatch.py +4 -0
  86. package/latticeai/services/voice_capture.py +27 -1
  87. package/latticeai/setup/auto_setup.py +27 -30
  88. package/latticeai/setup/wizard.py +77 -44
  89. package/package.json +1 -1
  90. package/scripts/check_current_release_docs.mjs +1 -1
  91. package/scripts/check_server_i18n.mjs +1 -0
  92. package/scripts/release_screen_claims.json +22 -0
  93. package/scripts/verify_hf_model_registry.py +253 -218
  94. package/src-tauri/Cargo.lock +1 -1
  95. package/src-tauri/Cargo.toml +1 -1
  96. package/src-tauri/tauri.conf.json +1 -1
  97. package/static/app/asset-manifest.json +37 -37
  98. package/static/app/assets/{Act-D4zSxFR-.js β†’ Act-AWf0SAKp.js} +1 -1
  99. package/static/app/assets/{AdminConsole-w5jBfPt2.js β†’ AdminConsole-D0u8Tiyj.js} +1 -1
  100. package/static/app/assets/{Brain-C2EqQg74.js β†’ Brain-tuhI4sOC.js} +1 -1
  101. package/static/app/assets/BrainHome-Ts7G_Ila.js +2 -0
  102. package/static/app/assets/BrainSignals-jMYgQ2Ar.js +1 -0
  103. package/static/app/assets/{Capture-DPqpGK8d.js β†’ Capture-CqOSzyPr.js} +1 -1
  104. package/static/app/assets/{CommandPalette-CNf7h5fp.js β†’ CommandPalette-DC0Bzh-I.js} +1 -1
  105. package/static/app/assets/{Library-BN0HYOfc.js β†’ Library-CX-bbhmK.js} +1 -1
  106. package/static/app/assets/{LivingBrain-Dfq_wEDI.js β†’ LivingBrain-DBwhto14.js} +1 -1
  107. package/static/app/assets/{ProductFlow-B-3O0rNV.js β†’ ProductFlow-BHA2cfKI.js} +1 -1
  108. package/static/app/assets/{ReviewCard-gZ-tdqFM.js β†’ ReviewCard-BUhCKRNM.js} +1 -1
  109. package/static/app/assets/{System-BElUcSSw.js β†’ System-Bu2t5hn1.js} +1 -1
  110. package/static/app/assets/arrow-left-Dzwa5zRb.js +1 -0
  111. package/static/app/assets/{bot--qYHMtkP.js β†’ bot-Cia42c2h.js} +1 -1
  112. package/static/app/assets/brain-DJMoqrwx.js +1 -0
  113. package/static/app/assets/{button-51Z3rsuv.js β†’ button-2j2Ijzgq.js} +1 -1
  114. package/static/app/assets/{circle-pause-CMIiMaQl.js β†’ circle-pause-BEFeWpVW.js} +1 -1
  115. package/static/app/assets/{circle-play-DZoO_cfG.js β†’ circle-play-ujXMcHxl.js} +1 -1
  116. package/static/app/assets/{cpu-Bs6uc9W9.js β†’ cpu-k4awryFq.js} +1 -1
  117. package/static/app/assets/{download-G-2olkWz.js β†’ download-DFbLJ_ig.js} +1 -1
  118. package/static/app/assets/{folder-open-CTOspnmb.js β†’ folder-open-7y_b6xkM.js} +1 -1
  119. package/static/app/assets/{hard-drive-CewHWJhn.js β†’ hard-drive-Bidh02Kr.js} +1 -1
  120. package/static/app/assets/{index-D7Rr-J2Y.js β†’ index-BpYkzcVm.js} +3 -3
  121. package/static/app/assets/index-DwDl9-8Y.css +2 -0
  122. package/static/app/assets/{input-D4w_BZWl.js β†’ input-DSlJJxRs.js} +1 -1
  123. package/static/app/assets/{permissionCopy-CosBEXAZ.js β†’ permissionCopy-Bpb83Hx9.js} +1 -1
  124. package/static/app/assets/{primitives-d0g9pvzS.js β†’ primitives-BCx6TvfG.js} +1 -1
  125. package/static/app/assets/search-Cgy8cCFJ.js +1 -0
  126. package/static/app/assets/{share-2-NmD7e_oV.js β†’ share-2-BH1M-WNi.js} +1 -1
  127. package/static/app/assets/{shield-alert-CcQeMuju.js β†’ shield-alert-BlKdBXcG.js} +1 -1
  128. package/static/app/assets/{textarea-BPAJDc-0.js β†’ textarea-CCWbUfFB.js} +1 -1
  129. package/static/app/assets/{useFocusTrap-C7YLdTBC.js β†’ useFocusTrap-YdHQ7pJ1.js} +1 -1
  130. package/static/app/assets/{useQuery-DRyD9opW.js β†’ useQuery-CXQiwbVT.js} +1 -1
  131. package/static/app/assets/{utils-DG1_ExrP.js β†’ utils-zqPZJxdx.js} +2 -2
  132. package/static/app/assets/{workspace-CWVf3gsI.js β†’ workspace-DXTihhfU.js} +1 -1
  133. package/static/app/index.html +4 -4
  134. package/static/sw.js +1 -1
  135. package/static/app/assets/BrainHome-CvXS6XiQ.js +0 -2
  136. package/static/app/assets/BrainSignals-DOE_KhOU.js +0 -1
  137. package/static/app/assets/arrow-left-CFNIMjhv.js +0 -1
  138. package/static/app/assets/brain-DDCLjRqO.js +0 -1
  139. package/static/app/assets/index-CkzokZAj.css +0 -2
  140. package/static/app/assets/search-BLCYt75v.js +0 -1
@@ -1 +1 @@
1
- import{C as e,_ as t,a as n,b as r,d as i,m as a,t as o,v as s,x as c}from"./utils-DG1_ExrP.js";import{r as l,t as u}from"./useQuery-DRyD9opW.js";import{t as d}from"./workspace-CWVf3gsI.js";import{_ as f,b as p,c as m,d as h,f as g,g as _,h as v,i as y,l as b,m as x,n as S,p as C,r as w,t as T,u as E,v as D}from"./primitives-d0g9pvzS.js";import{n as O,t as k}from"./input-D4w_BZWl.js";import{t as A}from"./circle-play-DZoO_cfG.js";import{t as j}from"./cpu-Bs6uc9W9.js";import{t as M}from"./download-G-2olkWz.js";import{t as N}from"./shield-alert-CcQeMuju.js";import{i as P}from"./index-D7Rr-J2Y.js";import{t as F}from"./button-51Z3rsuv.js";var I=t(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),L=t(`package-plus`,[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`M16 17h6`,key:`1ook5g`}],[`path`,{d:`M19 14v6`,key:`1ckrd5`}],[`path`,{d:`M21 10.535V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.675-.955`,key:`28k6lz`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}]]),R=t(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),z=e(c()),B=r();function V(e,t){let n=String(e||``).toLowerCase();return n===`production`?a(t,`library.embedding.state.production`):n===`fallback`||n===`hash`||n===`local`?a(t,`library.embedding.state.fallback`):a(t,`library.embedding.state.unknown`)}function H(e,t){let n=String(e?.os||``).toLowerCase(),r=String(e?.arch||``).toLowerCase();return n?n===`darwin`&&r.startsWith(`arm`)?a(t,`library.runtime.appleSilicon`):n===`darwin`?`Mac`:n===`win32`||n.startsWith(`win`)?`Windows`:n===`linux`?`Linux`:a(t,`library.runtime.thisComputer`):a(t,`library.value.detected`)}function ee(e){return/[γ„±-힝]/u.test(e)?!1:e.trim().split(/\s+/).length>=6}var te=new Set([`loaded`,`ready`,`download_required`,`unavailable`,`unsupported`]),U=[{id:`models`,labelKey:`library.tab.models`},{id:`skills`,labelKey:`library.tab.skills`},{id:`mcp`,labelKey:`library.tab.mcp`},{id:`marketplace`,labelKey:`library.tab.marketplace`}];function W({initialTab:e}){let t=s(e=>e.mode),n=s(e=>e.language),[r,i]=z.useState(e||`models`);z.useEffect(()=>{U.some(t=>t.id===e)&&i(e)},[e]);let o=(t===`basic`?U.filter(e=>e.id===`models`):U).map(e=>({id:e.id,label:a(n,e.labelKey)})),c=e=>{i(e),P(`/`+e)};return(0,B.jsxs)(`div`,{className:`product-page library-page space-y-5`,children:[(0,B.jsxs)(`header`,{className:`page-hero`,children:[(0,B.jsxs)(`div`,{className:`page-kicker`,children:[(0,B.jsx)(I,{className:`h-4 w-4`}),` `,a(n,`library.kicker`)]}),(0,B.jsx)(`h1`,{className:`page-title`,children:a(n,`library.title`)}),(0,B.jsx)(`p`,{className:`page-copy`,children:a(n,`library.body`)})]}),(0,B.jsx)(G,{}),(0,B.jsx)(h,{tabs:o,value:r,onChange:e=>c(e)}),r===`models`?(0,B.jsx)(K,{}):null,r===`skills`?(0,B.jsx)(J,{}):null,r===`mcp`?(0,B.jsx)(Y,{}):null,r===`marketplace`?(0,B.jsx)(X,{}):null]})}function G(){let e=l(),t=s(e=>e.language),r=u({queryKey:[`models`],queryFn:i.models}),[c,d]=z.useState(null),[f,m]=z.useState(null),h=r.data?.data||{},g=o(h.loaded),_=String(h.current||g[0]||``),v=[...o(h.catalog),...o(h.recommended),...o(h.models)],y=e=>String(e.id||e.model_id||``),b=_?v.find(e=>y(e)===_):void 0,x=String(b?.name||``)||(_?n(_):``),S=v.filter(e=>{let t=y(e);return!t||t===_||g.includes(t)||e.download_required||q(e.runtime_compatibility).supported===!1||e.load_status===`unsupported`?!1:!!e.load_available||e.load_status===`ready`}).slice(0,3);async function C(n){let r=y(n);d(r),m(null);let o=String(n.recommended_engine||n.engine||``)||void 0,s=await i.loadModel(String(n.recommended_load_id||r),o,!1);d(null),s.ok||m(s.error||a(t,`library.active.switchFailed`)),await e.invalidateQueries({queryKey:[`models`]})}let w=!!(r.data&&!r.data.ok);return(0,B.jsxs)(`section`,{className:`library-active`,"aria-label":a(t,`library.active.title`),"data-testid":`library-active-model`,children:[(0,B.jsxs)(`div`,{className:`library-active-main`,children:[(0,B.jsx)(`span`,{className:`library-active-mark`,"aria-hidden":`true`,children:x&&!w?(0,B.jsx)(A,{className:`h-5 w-5`}):(0,B.jsx)(j,{className:`h-5 w-5`})}),(0,B.jsxs)(`div`,{className:`library-active-copy`,children:[(0,B.jsx)(`span`,{className:`library-active-kicker`,children:a(t,`library.active.title`)}),w?(0,B.jsx)(`strong`,{children:a(t,`library.active.unknown`)}):x?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`strong`,{children:x}),(0,B.jsx)(`small`,{children:a(t,`library.active.ready`)})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`strong`,{children:a(t,`library.active.none`)}),(0,B.jsx)(`small`,{children:a(t,`library.active.noneHint`)})]})]}),x&&!w?(0,B.jsx)(D,{variant:`success`,children:a(t,`library.model.loaded`)}):null]}),S.length&&!w?(0,B.jsxs)(`div`,{className:`library-active-switch`,children:[(0,B.jsxs)(`span`,{className:`library-active-switch-label`,children:[a(t,`library.active.switchTitle`),(0,B.jsx)(`small`,{children:a(t,`library.active.switchHint`)})]}),(0,B.jsx)(`div`,{className:`library-active-switch-options`,children:S.map(e=>{let r=y(e),i=String(e.name||``)||n(r);return(0,B.jsxs)(`button`,{type:`button`,disabled:!!c,"data-testid":`library-switch-${r}`,onClick:()=>void C(e),children:[c===r?(0,B.jsx)(p,{className:`h-3.5 w-3.5 animate-spin`,"aria-hidden":`true`}):(0,B.jsx)(O,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),c===r?a(t,`library.active.switching`):i]},r)})})]}):null,f?(0,B.jsx)(`p`,{className:`library-active-error`,role:`status`,children:f}):null]})}function K(){let e=l(),t=s(e=>e.mode),n=s(e=>e.language),r=u({queryKey:[`models`],queryFn:i.models}),c=u({queryKey:[`modelRecommendations`,`local_mlx`],queryFn:()=>i.modelRecommendations(`local_mlx`)}),d=u({queryKey:[`embeddings`],queryFn:i.embeddingsStatus}),[f,p]=z.useState(!1),[m,h]=z.useState(null),[_,v]=z.useState([]),[b,x]=z.useState(null),[C,k]=z.useState(null),[P,I]=z.useState(!1),R=z.useRef(!1),H=o(r.data?.data?.loaded),U=String(r.data?.data?.current||``),W=e=>{let t=String(e.id||e.model_id||``);return t&&(H.includes(t)||t===U)?0:e.load_available||e.load_status===`ready`?1:e.pulled?2:3},G=[...o(r.data?.data?.catalog),...o(r.data?.data?.recommended)].map((e,t)=>({model:e,index:t})).sort((e,t)=>W(e.model)-W(t.model)||e.index-t.index).map(e=>e.model),K=o(c.data?.data?.recommendations?.models),J=new Map(K.map(e=>[String(e.id),e])),Y=G.find(e=>{let t=String(e.id||``);return!!t&&(H.includes(t)||t===U)}),X=c.data?.data?.recommendations?.top_pick||null,Z=_[_.length-1]||null,Q=z.useCallback((e,r=`library.model.notReady`)=>{let i=String(e);if(n===`ko`&&ee(i))return a(n,r);if(t!==`basic`)return i;let o=i.replace(/gemma4_unified/gi,a(n,`library.model.localFormat`)).replace(/mlx[-_ ]?vlm|mlx[-_ ]?lm|local_mlx|\bmlx\b|\bgguf\b|\bollama\b|hugging face/gi,a(n,`library.model.localSupport`)).replace(/runtime/gi,a(n,`library.model.support`)).replace(/model_type/gi,a(n,`library.model.format`));return n===`en`?o.replace(/this local model format local model support format/gi,a(n,`library.model.localFormat`)).replace(/local model support model support/gi,a(n,`library.model.localSupport`)):o},[n,t]);async function $(t,n,r){I(!0),h(t),v([]),x(null),k(null),R.current=!1;let a=await i.streamModelPrepare({model:t,engine:n||`local_mlx`,allow_download:r},{onProgress:e=>v(t=>[...t.slice(-8),e]),onDone:e=>x(e),onError:e=>{R.current=!0,k(e)}});I(!1),await e.invalidateQueries({queryKey:[`models`]}),await e.invalidateQueries({queryKey:[`modelRecommendations`,`local_mlx`]}),!a.ok&&!R.current&&k(a.data)}return(0,B.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(S,{title:a(n,`library.models.setup.title`),description:a(n,`library.models.setup.desc`),result:c.data,children:r=>{let o=r.recommendations,s=r.profile;return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(re,{language:n,mode:t,profile:s||{},recommendation:o||{},current:Y,currentId:U,latestProgress:Z,lastResult:b,onReload:()=>{if(Y){let e=Y.recommended_load_id||Y.id;$(String(e||U),String(Y.recommended_engine||Y.engine||`local_mlx`),f)}},onUnload:()=>{U&&i.unloadModel(U).then(()=>e.invalidateQueries({queryKey:[`models`]}))}}),(0,B.jsx)(`ol`,{className:`library-setup-track`,"aria-label":a(n,`library.steps.aria`),children:[[a(n,`library.step.environment`),!0,j],[a(n,`library.step.recommend`),!!(X||G.length),O],[a(n,`library.step.install`),!!(Y||Z?.stage===`engine`),L],[a(n,`library.step.download`),!!(Y||Z?.stage===`download`),M],[a(n,`library.step.validate`),!!(Y||Z?.stage===`smoke_test`),N],[a(n,`library.step.ready`),!!(Y||b),A]].map(([e,t,r])=>(0,B.jsxs)(`li`,{className:t?`is-done`:``,children:[(0,B.jsx)(`span`,{className:`library-setup-mark`,"aria-hidden":`true`,children:z.createElement(r,{className:`h-3.5 w-3.5`})}),(0,B.jsx)(`span`,{className:`library-setup-label`,children:String(e)}),(0,B.jsx)(`span`,{className:`library-setup-state`,children:t?a(n,`library.step.done`):a(n,`library.step.pending`)})]},String(e)))}),(0,B.jsxs)(`label`,{className:`flex items-start gap-2 rounded-lg border border-border bg-background/55 p-3 text-sm leading-6`,children:[(0,B.jsx)(`input`,{className:`mt-1`,type:`checkbox`,checked:f,onChange:e=>p(e.target.checked)}),(0,B.jsx)(`span`,{children:a(n,`library.consent`)})]}),Z?(0,B.jsxs)(`div`,{className:`rounded-lg border border-border bg-background/55 p-3 text-sm`,children:[(0,B.jsx)(`div`,{className:`font-medium`,children:String(Z.message||a(n,`library.preparing`))}),(0,B.jsx)(`div`,{className:`mt-2 h-2 overflow-hidden rounded-full bg-muted`,children:(0,B.jsx)(`div`,{className:`h-full bg-primary`,style:{width:`${Number(Z.percent||8)}%`}})}),Z.detail?(0,B.jsx)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:String(Z.detail)}):null]}):null,C?(0,B.jsx)(ie,{error:C}):null]})}}),(0,B.jsx)(S,{title:t===`basic`?a(n,`library.panel.recommended.basic`):a(n,`library.panel.recommended.other`),result:r.data,children:e=>(0,B.jsxs)(`div`,{className:`grid gap-2`,children:[(G.length?G:o(e.loaded)).slice(0,t===`basic`?3:14).map((r,s)=>{let c=String(r.id||r.model_id||r.name||s),l=o(e.loaded).includes(c)||e.current===c||r.state===`loaded`,u=String(r.recommended_load_id||c),d=String(r.recommended_engine||r.engine||``),p=J.get(c)||J.get(u)||{},h=q(r.verification),g=q(p.verification),_=q(r.hardware),v=q(p.hardware),y=!!r.download_required,b=_.recommended_ram_gb||v.recommended_ram_gb,x=b?a(n,`library.model.ramRecommended`,{ram:String(b)}):t===`basic`?``:String(_.notes||v.notes||``),S=r.safety_notes||p.safety_notes,C=r.license||p.license,w=r.runtime_compatibility||p.runtime_compatibility||{},E=String(w.status||``)===`fallback_available`,O=r.load_status===`unsupported`||w.supported===!1,k=(!!r.load_available||l)&&!O,A=String(r.load_status||(l?`loaded`:`unavailable`)),j=y?a(n,`library.model.needsDownloadFirst`):Q(r.unavailable_reason||a(n,`library.model.notReady`)),M=String(r.runtime_label||w.preferred_runtime||d||`local_mlx`),N=String(w.action||A.replace(/_/g,` `)),I=te.has(A)?a(n,`library.model.status.${A}`):a(n,`library.model.status.unknown`),L=O&&t===`basic`?a(n,`library.model.needsAttention`):I,R=k||y,z=r.download_size||r.estimated_size||p.download_size||p.estimated_size||r.size||p.size,V=r.provider||p.provider||r.organization||p.organization;return(0,B.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 rounded-lg border border-border bg-background/55 p-4`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsx)(`div`,{className:`text-base font-semibold`,children:String(r.name||c)}),X?.id===c||r.recommended_default?(0,B.jsx)(D,{variant:`success`,children:a(n,`library.model.recommended`)}):null,String(r.modality||p.modality||``).includes(`multi`)||String(r.modality||``)===`multimodal`?(0,B.jsx)(D,{variant:`muted`,children:a(n,`library.model.multimodal`)}):null,h.verified||g.verified?(0,B.jsx)(D,{variant:`success`,title:a(n,`library.model.hfVerified`),children:a(n,`library.model.sourceVerified`)}):null]}),(0,B.jsx)(`div`,{className:`mt-1 text-sm text-muted-foreground`,children:t===`basic`?[Q(r.family||p.family||a(n,`library.model.local`)),/mlx|gguf|ollama/i.test(String(r.size||p.size||``))?``:r.size||p.size].filter(Boolean).map(String).join(` Β· `):[r.family||p.family||a(n,`library.value.local`),r.size||p.size].filter(Boolean).map(String).join(` Β· `)}),r.hardware||p.hardware?(0,B.jsx)(`div`,{className:`mt-1 text-[11px] text-muted-foreground/80`,children:String(x)}):null,(0,B.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1 text-[11px] text-muted-foreground`,children:[(0,B.jsx)(D,{variant:`muted`,children:y?a(n,`library.model.downloadSize`,{size:String(z||a(n,`library.model.downloadRequired`))}):a(n,`library.model.noDownload`)}),(0,B.jsx)(D,{variant:`muted`,children:y?a(n,`library.model.internetDuringDownload`):a(n,`library.model.runsLocally`)}),V?(0,B.jsx)(D,{variant:`muted`,children:String(V)}):null]}),O?(0,B.jsxs)(`div`,{className:`mt-3 rounded-lg border border-amber-500/30 bg-amber-500/10 p-3 text-sm`,children:[(0,B.jsx)(`div`,{className:`font-medium`,children:t===`basic`?a(n,`library.model.attentionBeforeLoad`):N}),(0,B.jsx)(`div`,{className:`text-muted-foreground`,children:Q(w.user_message||j,`library.model.unsupportedHere`)})]}):E?(0,B.jsxs)(`div`,{className:`mt-3 rounded-lg border border-amber-500/30 bg-amber-500/10 p-3 text-sm`,children:[(0,B.jsx)(`div`,{className:`font-medium`,children:t===`basic`?a(n,`library.model.compatiblePath`):a(n,`library.model.runtimeFallback`)}),(0,B.jsx)(`div`,{className:`text-muted-foreground`,children:Q(w.user_message||a(n,`library.model.compatibilityFallback`),`library.model.compatibilityFallback`)})]}):!l&&!k?(0,B.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:j}):null,t===`basic`?null:(0,B.jsxs)(`div`,{className:`mt-2 space-y-1 text-xs text-muted-foreground`,children:[(0,B.jsxs)(`div`,{children:[M,` Β· `,u,r.load_strategy||p.load_strategy?` Β· ${String(r.load_strategy||p.load_strategy)}`:``,h.notes?` Β· ${String(h.notes).slice(0,60)}`:``]}),S||C?(0,B.jsx)(`div`,{children:[C?a(n,`library.model.license`,{license:String(C)}):``,S?String(S):``].filter(Boolean).join(` Β· `)}):null]}),O||E?(0,B.jsx)(ne,{compatibility:w}):null]}),(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 md:justify-end`,children:[(0,B.jsx)(D,{variant:l?`success`:k?`muted`:`warning`,children:l?a(n,`library.model.loaded`):L}),l?(0,B.jsx)(T,{label:a(n,`library.runtime.unload`),action:()=>i.unloadModel(u),invalidate:[`models`]}):(0,B.jsx)(F,{variant:`outline`,disabled:P||O||!R||y&&!f,title:O?a(n,`library.model.status.unsupported`):y&&!f?a(n,`library.btn.needsConsent`):R?void 0:j,onClick:()=>$(u,d,f),children:m===u&&P?a(n,`library.btn.preparing`):y?a(n,`library.btn.installLoad`):a(n,`library.btn.validateLoad`)})]})]},c)}),t===`basic`&&G.length>3?(0,B.jsx)(`div`,{className:`rounded-lg border border-border bg-background/55 p-3 text-sm text-muted-foreground`,children:a(n,`library.model.shortListHint`)}):null]})})]}),(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(S,{title:t===`basic`?a(n,`library.models.embedding.basic`):a(n,`library.models.embedding.advanced`),result:d.data,children:e=>(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(g,{value:V(e.state,n)}),t===`basic`?null:(0,B.jsx)(E,{value:e})]})}),(0,B.jsx)(S,{title:t===`basic`?a(n,`library.models.validation`):a(n,`library.models.validationAdvanced`),result:r.data,children:e=>{let r=o(e.compat_profiles);return r.length?(0,B.jsx)(y,{items:r.map(e=>({...e,name:t===`basic`?e.name||e.display_name||a(n,`library.model.loadedName`):e.name||e.display_name||e.model_id,status:e.quality_status||e.load_status||a(n,`library.model.checked`)})),titleKey:`name`,metaKey:`status`,limit:6}):(0,B.jsx)(w,{title:a(n,`library.model.noneChecked`),detail:a(n,`library.model.noneCheckedHint`)})}})]})]})}function ne({compatibility:e}){let t=s(e=>e.mode),n=s(e=>e.language),r=o(e.alternatives);return r.length?(0,B.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:r.slice(0,3).map(e=>(0,B.jsx)(D,{variant:`muted`,children:t===`basic`&&/mlx|gguf|ollama|lm studio/i.test(String(e.name||e.id))?a(n,`library.model.compatibleAlternative`):String(e.name||e.id)},String(e.id||e.name)))}):null}function re({language:e=`en`,mode:t=`advanced`,profile:r,recommendation:i,current:o,currentId:s,latestProgress:c,lastResult:l,onReload:u,onUnload:d}){let f=String(o?.id||s||``),p=String(o?.name||``)||(f?n(f):``),m=String(o?.engine||o?.recommended_engine||c?.engine||`local_mlx`),h=String(o?.local_path||o?.storage_location||i.cache_path||i.storage_location||`~/.cache/huggingface / ~/.latticeai/models`),g=String(c?.stage||l?.stage||(p?a(e,`library.value.ready`):a(e,`library.value.idle`))),_=t===`basic`;return(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(b,{stats:_?[{label:a(e,`library.runtime.computer`),value:H(r,e)},{label:a(e,`library.runtime.loaded`),value:p||a(e,`library.runtime.noneShort`)}]:[{label:a(e,`library.runtime.computer`),value:H(r,e)},{label:a(e,`library.runtime.engine`),value:m},{label:a(e,`library.runtime.loaded`),value:p||a(e,`library.runtime.noLoaded`)},{label:a(e,`library.runtime.state`),value:g}]}),(0,B.jsxs)(`div`,{className:`rounded-lg border border-border bg-background/55 p-3 text-sm`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`font-medium`,children:p?a(e,`library.models.runtime.available`):a(e,`library.models.runtime.none`)}),_?null:(0,B.jsx)(`div`,{className:`mt-1 text-muted-foreground`,children:a(e,`library.runtime.cacheStorage`,{path:h})})]}),(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,B.jsx)(F,{variant:`outline`,size:`sm`,disabled:!p,onClick:u,children:a(e,`library.runtime.reload`)}),(0,B.jsx)(F,{variant:`outline`,size:`sm`,disabled:!p,onClick:d,children:a(e,`library.runtime.unload`)})]})]}),c?(0,B.jsxs)(`div`,{className:`mt-3`,children:[(0,B.jsxs)(`div`,{className:`flex justify-between text-xs text-muted-foreground`,children:[(0,B.jsx)(`span`,{children:String(c.message||a(e,`library.preparing`))}),(0,B.jsxs)(`span`,{children:[Number(c.percent||0),`%`]})]}),(0,B.jsx)(`div`,{className:`mt-1 h-2 overflow-hidden rounded-full bg-muted`,children:(0,B.jsx)(`div`,{className:`h-full bg-primary`,style:{width:`${Number(c.percent||8)}%`}})})]}):null]})]})}function ie({error:e}){let t=s(e=>e.language),n=o(e.recovery_guidance);return(0,B.jsxs)(`div`,{className:`rounded-lg border border-amber-500/30 bg-amber-500/10 p-3 text-sm`,children:[(0,B.jsx)(`div`,{className:`font-medium`,children:String(e.user_message||a(t,`library.model.setupAttention`))}),n.length?(0,B.jsx)(`ul`,{className:`mt-2 list-inside list-disc text-muted-foreground`,children:n.slice(0,3).map(e=>(0,B.jsx)(`li`,{children:e},e))}):null]})}function q(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function J(){let e=l(),t=s(e=>e.language),n=u({queryKey:[`skills`],queryFn:i.skills}),r=u({queryKey:[`skillsMarketplace`],queryFn:i.skillsMarketplace}),c=d({mutationFn:e=>i.skillInstall(String(e.name||e.id),String(e.plugin||``)),onSuccess:()=>e.invalidateQueries({queryKey:[`skills`]})});return(0,B.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,B.jsx)(S,{title:a(t,`library.skills.installed`),result:n.data,children:e=>(0,B.jsx)(`div`,{className:`flex flex-col gap-2`,children:o(e.skills).map(e=>(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border border-border p-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`font-medium`,children:String(e.name||e.id)}),(0,B.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:String(e.plugin||e.description||``)})]}),(0,B.jsx)(T,{label:a(t,e.enabled?`library.skills.disable`:`library.skills.enable`),action:()=>i.skillToggle(String(e.name||e.id),!!e.enabled),invalidate:[`skills`]})]},String(e.name||e.id)))})}),(0,B.jsx)(S,{title:a(t,`library.skills.marketplace`),result:r.data,children:e=>(0,B.jsx)(`div`,{className:`flex flex-col gap-2`,children:o(e.skills).slice(0,10).map(e=>(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border border-border p-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`font-medium`,children:String(e.name||e.id)}),(0,B.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:String(e.description||e.category||``)})]}),(0,B.jsx)(F,{variant:`outline`,disabled:c.isPending,onClick:()=>c.mutate(e),children:a(t,`library.skills.install`)})]},String(e.name||e.id)))})})]})}function Y(){let e=s(e=>e.mode),t=s(e=>e.language),[n,r]=z.useState(`github`),o=u({queryKey:[`mcpTools`],queryFn:i.mcpTools}),c=d({mutationFn:()=>i.mcpRecommend(n)});return(0,B.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,B.jsx)(S,{title:a(t,e===`basic`?`library.connector.connections`:`library.connector.mcpTools`),result:o.data,children:e=>(0,B.jsx)(y,{items:e.tools||e.installed_mcps,titleKey:`name`,metaKey:`status`})}),(0,B.jsxs)(C,{children:[(0,B.jsxs)(_,{children:[(0,B.jsxs)(f,{className:`flex items-center gap-2`,children:[(0,B.jsx)(R,{className:`h-4 w-4`}),` `,a(t,`library.connector.recommend`)]}),(0,B.jsx)(v,{children:a(t,`library.connector.recommendHint`)})]}),(0,B.jsxs)(x,{className:`space-y-3`,children:[(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(k,{value:n,onChange:e=>r(e.target.value)}),(0,B.jsx)(F,{onClick:()=>c.mutate(),disabled:!n.trim()||c.isPending,children:a(t,`library.connector.recommendAction`)})]}),c.data?(0,B.jsx)(m,{result:c.data,successLabel:a(t,`library.connector.recommendDone`)}):null]})]})]})}function X(){let e=s(e=>e.language),t=u({queryKey:[`templates`],queryFn:i.templates}),n=u({queryKey:[`plugins`],queryFn:i.pluginsRegistry}),r=u({queryKey:[`pluginsDirectory`],queryFn:i.pluginsDirectory});return(0,B.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,B.jsx)(S,{title:a(e,`library.market.templates`),result:t.data,children:e=>(0,B.jsx)(y,{items:e.templates,titleKey:`name`,metaKey:`kind`})}),(0,B.jsx)(S,{title:a(e,`library.market.installedPlugins`),result:n.data,children:e=>(0,B.jsx)(y,{items:e.plugins,titleKey:`name`,metaKey:`status`})}),(0,B.jsx)(S,{title:a(e,`library.market.pluginDirectory`),result:r.data,children:e=>(0,B.jsx)(y,{items:e.plugins,titleKey:`name`,metaKey:`category`})}),(0,B.jsxs)(C,{className:`xl:col-span-3`,children:[(0,B.jsxs)(_,{children:[(0,B.jsxs)(f,{className:`flex items-center gap-2`,children:[(0,B.jsx)(L,{className:`h-4 w-4`}),` `,a(e,`library.market.templateInstall`)]}),(0,B.jsx)(v,{children:a(e,`library.market.templateInstallHint`)})]}),(0,B.jsx)(x,{children:o(t.data?.data?.templates).length?(0,B.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:o(t.data?.data?.templates).slice(0,6).map(t=>(0,B.jsx)(T,{label:a(e,`library.market.installTemplate`,{name:String(t.name||t.id)}),action:()=>i.installTemplate(t)},String(t.id||t.name)))}):(0,B.jsx)(y,{items:[]})})]})]})}export{W as LibraryPage};
1
+ import{C as e,_ as t,a as n,b as r,d as i,m as a,t as o,v as s,x as c}from"./utils-zqPZJxdx.js";import{r as l,t as u}from"./useQuery-CXQiwbVT.js";import{t as d}from"./workspace-DXTihhfU.js";import{_ as f,b as p,c as m,d as h,f as g,g as _,h as v,i as y,l as b,m as x,n as S,p as C,r as w,t as T,u as E,v as D}from"./primitives-BCx6TvfG.js";import{n as O,t as k}from"./input-DSlJJxRs.js";import{t as A}from"./circle-play-ujXMcHxl.js";import{t as j}from"./cpu-k4awryFq.js";import{t as M}from"./download-DFbLJ_ig.js";import{t as N}from"./shield-alert-BlKdBXcG.js";import{i as P}from"./index-BpYkzcVm.js";import{t as F}from"./button-2j2Ijzgq.js";var I=t(`boxes`,[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`,key:`lc1i9w`}],[`path`,{d:`m7 16.5-4.74-2.85`,key:`1o9zyk`}],[`path`,{d:`m7 16.5 5-3`,key:`va8pkn`}],[`path`,{d:`M7 16.5v5.17`,key:`jnp8gn`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`,key:`8zsnat`}],[`path`,{d:`m17 16.5-5-3`,key:`8arw3v`}],[`path`,{d:`m17 16.5 4.74-2.85`,key:`8rfmw`}],[`path`,{d:`M17 16.5v5.17`,key:`k6z78m`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`,key:`1xygjf`}],[`path`,{d:`M12 8 7.26 5.15`,key:`1vbdud`}],[`path`,{d:`m12 8 4.74-2.85`,key:`3rx089`}],[`path`,{d:`M12 13.5V8`,key:`1io7kd`}]]),L=t(`package-plus`,[[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`path`,{d:`M16 17h6`,key:`1ook5g`}],[`path`,{d:`M19 14v6`,key:`1ckrd5`}],[`path`,{d:`M21 10.535V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.675-.955`,key:`28k6lz`}],[`path`,{d:`M3.29 7 12 12l8.71-5`,key:`19ckod`}],[`path`,{d:`m7.5 4.27 8.997 5.148`,key:`9yrvtv`}]]),R=t(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),z=e(c()),B=r();function V(e,t){let n=String(e||``).toLowerCase();return n===`production`?a(t,`library.embedding.state.production`):n===`fallback`||n===`hash`||n===`local`?a(t,`library.embedding.state.fallback`):a(t,`library.embedding.state.unknown`)}function H(e,t){let n=String(e?.os||``).toLowerCase(),r=String(e?.arch||``).toLowerCase();return n?n===`darwin`&&r.startsWith(`arm`)?a(t,`library.runtime.appleSilicon`):n===`darwin`?`Mac`:n===`win32`||n.startsWith(`win`)?`Windows`:n===`linux`?`Linux`:a(t,`library.runtime.thisComputer`):a(t,`library.value.detected`)}function ee(e){return/[γ„±-힝]/u.test(e)?!1:e.trim().split(/\s+/).length>=6}var te=new Set([`loaded`,`ready`,`download_required`,`unavailable`,`unsupported`]),U=[{id:`models`,labelKey:`library.tab.models`},{id:`skills`,labelKey:`library.tab.skills`},{id:`mcp`,labelKey:`library.tab.mcp`},{id:`marketplace`,labelKey:`library.tab.marketplace`}];function W({initialTab:e}){let t=s(e=>e.mode),n=s(e=>e.language),[r,i]=z.useState(e||`models`);z.useEffect(()=>{U.some(t=>t.id===e)&&i(e)},[e]);let o=(t===`basic`?U.filter(e=>e.id===`models`):U).map(e=>({id:e.id,label:a(n,e.labelKey)})),c=e=>{i(e),P(`/`+e)};return(0,B.jsxs)(`div`,{className:`product-page library-page space-y-5`,children:[(0,B.jsxs)(`header`,{className:`page-hero`,children:[(0,B.jsxs)(`div`,{className:`page-kicker`,children:[(0,B.jsx)(I,{className:`h-4 w-4`}),` `,a(n,`library.kicker`)]}),(0,B.jsx)(`h1`,{className:`page-title`,children:a(n,`library.title`)}),(0,B.jsx)(`p`,{className:`page-copy`,children:a(n,`library.body`)})]}),(0,B.jsx)(G,{}),(0,B.jsx)(h,{tabs:o,value:r,onChange:e=>c(e)}),r===`models`?(0,B.jsx)(K,{}):null,r===`skills`?(0,B.jsx)(J,{}):null,r===`mcp`?(0,B.jsx)(Y,{}):null,r===`marketplace`?(0,B.jsx)(X,{}):null]})}function G(){let e=l(),t=s(e=>e.language),r=u({queryKey:[`models`],queryFn:i.models}),[c,d]=z.useState(null),[f,m]=z.useState(null),h=r.data?.data||{},g=o(h.loaded),_=String(h.current||g[0]||``),v=[...o(h.catalog),...o(h.recommended),...o(h.models)],y=e=>String(e.id||e.model_id||``),b=_?v.find(e=>y(e)===_):void 0,x=String(b?.name||``)||(_?n(_):``),S=v.filter(e=>{let t=y(e);return!t||t===_||g.includes(t)||e.download_required||q(e.runtime_compatibility).supported===!1||e.load_status===`unsupported`?!1:!!e.load_available||e.load_status===`ready`}).slice(0,3);async function C(n){let r=y(n);d(r),m(null);let o=String(n.recommended_engine||n.engine||``)||void 0,s=await i.loadModel(String(n.recommended_load_id||r),o,!1);d(null),s.ok||m(s.error||a(t,`library.active.switchFailed`)),await e.invalidateQueries({queryKey:[`models`]})}let w=!!(r.data&&!r.data.ok);return(0,B.jsxs)(`section`,{className:`library-active`,"aria-label":a(t,`library.active.title`),"data-testid":`library-active-model`,children:[(0,B.jsxs)(`div`,{className:`library-active-main`,children:[(0,B.jsx)(`span`,{className:`library-active-mark`,"aria-hidden":`true`,children:x&&!w?(0,B.jsx)(A,{className:`h-5 w-5`}):(0,B.jsx)(j,{className:`h-5 w-5`})}),(0,B.jsxs)(`div`,{className:`library-active-copy`,children:[(0,B.jsx)(`span`,{className:`library-active-kicker`,children:a(t,`library.active.title`)}),w?(0,B.jsx)(`strong`,{children:a(t,`library.active.unknown`)}):x?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`strong`,{children:x}),(0,B.jsx)(`small`,{children:a(t,`library.active.ready`)})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`strong`,{children:a(t,`library.active.none`)}),(0,B.jsx)(`small`,{children:a(t,`library.active.noneHint`)})]})]}),x&&!w?(0,B.jsx)(D,{variant:`success`,children:a(t,`library.model.loaded`)}):null]}),S.length&&!w?(0,B.jsxs)(`div`,{className:`library-active-switch`,children:[(0,B.jsxs)(`span`,{className:`library-active-switch-label`,children:[a(t,`library.active.switchTitle`),(0,B.jsx)(`small`,{children:a(t,`library.active.switchHint`)})]}),(0,B.jsx)(`div`,{className:`library-active-switch-options`,children:S.map(e=>{let r=y(e),i=String(e.name||``)||n(r);return(0,B.jsxs)(`button`,{type:`button`,disabled:!!c,"data-testid":`library-switch-${r}`,onClick:()=>void C(e),children:[c===r?(0,B.jsx)(p,{className:`h-3.5 w-3.5 animate-spin`,"aria-hidden":`true`}):(0,B.jsx)(O,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),c===r?a(t,`library.active.switching`):i]},r)})})]}):null,f?(0,B.jsx)(`p`,{className:`library-active-error`,role:`status`,children:f}):null]})}function K(){let e=l(),t=s(e=>e.mode),n=s(e=>e.language),r=u({queryKey:[`models`],queryFn:i.models}),c=u({queryKey:[`modelRecommendations`,`local_mlx`],queryFn:()=>i.modelRecommendations(`local_mlx`)}),d=u({queryKey:[`embeddings`],queryFn:i.embeddingsStatus}),[f,p]=z.useState(!1),[m,h]=z.useState(null),[_,v]=z.useState([]),[b,x]=z.useState(null),[C,k]=z.useState(null),[P,I]=z.useState(!1),R=z.useRef(!1),H=o(r.data?.data?.loaded),U=String(r.data?.data?.current||``),W=e=>{let t=String(e.id||e.model_id||``);return t&&(H.includes(t)||t===U)?0:e.load_available||e.load_status===`ready`?1:e.pulled?2:3},G=[...o(r.data?.data?.catalog),...o(r.data?.data?.recommended)].map((e,t)=>({model:e,index:t})).sort((e,t)=>W(e.model)-W(t.model)||e.index-t.index).map(e=>e.model),K=o(c.data?.data?.recommendations?.models),J=new Map(K.map(e=>[String(e.id),e])),Y=G.find(e=>{let t=String(e.id||``);return!!t&&(H.includes(t)||t===U)}),X=c.data?.data?.recommendations?.top_pick||null,Z=_[_.length-1]||null,Q=z.useCallback((e,r=`library.model.notReady`)=>{let i=String(e);if(n===`ko`&&ee(i))return a(n,r);if(t!==`basic`)return i;let o=i.replace(/gemma4_unified/gi,a(n,`library.model.localFormat`)).replace(/mlx[-_ ]?vlm|mlx[-_ ]?lm|local_mlx|\bmlx\b|\bgguf\b|\bollama\b|hugging face/gi,a(n,`library.model.localSupport`)).replace(/runtime/gi,a(n,`library.model.support`)).replace(/model_type/gi,a(n,`library.model.format`));return n===`en`?o.replace(/this local model format local model support format/gi,a(n,`library.model.localFormat`)).replace(/local model support model support/gi,a(n,`library.model.localSupport`)):o},[n,t]);async function $(t,n,r){I(!0),h(t),v([]),x(null),k(null),R.current=!1;let a=await i.streamModelPrepare({model:t,engine:n||`local_mlx`,allow_download:r},{onProgress:e=>v(t=>[...t.slice(-8),e]),onDone:e=>x(e),onError:e=>{R.current=!0,k(e)}});I(!1),await e.invalidateQueries({queryKey:[`models`]}),await e.invalidateQueries({queryKey:[`modelRecommendations`,`local_mlx`]}),!a.ok&&!R.current&&k(a.data)}return(0,B.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(S,{title:a(n,`library.models.setup.title`),description:a(n,`library.models.setup.desc`),result:c.data,children:r=>{let o=r.recommendations,s=r.profile;return(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(re,{language:n,mode:t,profile:s||{},recommendation:o||{},current:Y,currentId:U,latestProgress:Z,lastResult:b,onReload:()=>{if(Y){let e=Y.recommended_load_id||Y.id;$(String(e||U),String(Y.recommended_engine||Y.engine||`local_mlx`),f)}},onUnload:()=>{U&&i.unloadModel(U).then(()=>e.invalidateQueries({queryKey:[`models`]}))}}),(0,B.jsx)(`ol`,{className:`library-setup-track`,"aria-label":a(n,`library.steps.aria`),children:[[a(n,`library.step.environment`),!0,j],[a(n,`library.step.recommend`),!!(X||G.length),O],[a(n,`library.step.install`),!!(Y||Z?.stage===`engine`),L],[a(n,`library.step.download`),!!(Y||Z?.stage===`download`),M],[a(n,`library.step.validate`),!!(Y||Z?.stage===`smoke_test`),N],[a(n,`library.step.ready`),!!(Y||b),A]].map(([e,t,r])=>(0,B.jsxs)(`li`,{className:t?`is-done`:``,children:[(0,B.jsx)(`span`,{className:`library-setup-mark`,"aria-hidden":`true`,children:z.createElement(r,{className:`h-3.5 w-3.5`})}),(0,B.jsx)(`span`,{className:`library-setup-label`,children:String(e)}),(0,B.jsx)(`span`,{className:`library-setup-state`,children:t?a(n,`library.step.done`):a(n,`library.step.pending`)})]},String(e)))}),(0,B.jsxs)(`label`,{className:`flex items-start gap-2 rounded-lg border border-border bg-background/55 p-3 text-sm leading-6`,children:[(0,B.jsx)(`input`,{className:`mt-1`,type:`checkbox`,checked:f,onChange:e=>p(e.target.checked)}),(0,B.jsx)(`span`,{children:a(n,`library.consent`)})]}),Z?(0,B.jsxs)(`div`,{className:`rounded-lg border border-border bg-background/55 p-3 text-sm`,children:[(0,B.jsx)(`div`,{className:`font-medium`,children:String(Z.message||a(n,`library.preparing`))}),(0,B.jsx)(`div`,{className:`mt-2 h-2 overflow-hidden rounded-full bg-muted`,children:(0,B.jsx)(`div`,{className:`h-full bg-primary`,style:{width:`${Number(Z.percent||8)}%`}})}),Z.detail?(0,B.jsx)(`div`,{className:`mt-2 text-xs text-muted-foreground`,children:String(Z.detail)}):null]}):null,C?(0,B.jsx)(ie,{error:C}):null]})}}),(0,B.jsx)(S,{title:t===`basic`?a(n,`library.panel.recommended.basic`):a(n,`library.panel.recommended.other`),result:r.data,children:e=>(0,B.jsxs)(`div`,{className:`grid gap-2`,children:[(G.length?G:o(e.loaded)).slice(0,t===`basic`?3:14).map((r,s)=>{let c=String(r.id||r.model_id||r.name||s),l=o(e.loaded).includes(c)||e.current===c||r.state===`loaded`,u=String(r.recommended_load_id||c),d=String(r.recommended_engine||r.engine||``),p=J.get(c)||J.get(u)||{},h=q(r.verification),g=q(p.verification),_=q(r.hardware),v=q(p.hardware),y=!!r.download_required,b=_.recommended_ram_gb||v.recommended_ram_gb,x=b?a(n,`library.model.ramRecommended`,{ram:String(b)}):t===`basic`?``:String(_.notes||v.notes||``),S=r.safety_notes||p.safety_notes,C=r.license||p.license,w=r.runtime_compatibility||p.runtime_compatibility||{},E=String(w.status||``)===`fallback_available`,O=r.load_status===`unsupported`||w.supported===!1,k=(!!r.load_available||l)&&!O,A=String(r.load_status||(l?`loaded`:`unavailable`)),j=y?a(n,`library.model.needsDownloadFirst`):Q(r.unavailable_reason||a(n,`library.model.notReady`)),M=String(r.runtime_label||w.preferred_runtime||d||`local_mlx`),N=String(w.action||A.replace(/_/g,` `)),I=te.has(A)?a(n,`library.model.status.${A}`):a(n,`library.model.status.unknown`),L=O&&t===`basic`?a(n,`library.model.needsAttention`):I,R=k||y,z=r.download_size||r.estimated_size||p.download_size||p.estimated_size||r.size||p.size,V=r.provider||p.provider||r.organization||p.organization;return(0,B.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 rounded-lg border border-border bg-background/55 p-4`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsx)(`div`,{className:`text-base font-semibold`,children:String(r.name||c)}),X?.id===c||r.recommended_default?(0,B.jsx)(D,{variant:`success`,children:a(n,`library.model.recommended`)}):null,String(r.modality||p.modality||``).includes(`multi`)||String(r.modality||``)===`multimodal`?(0,B.jsx)(D,{variant:`muted`,children:a(n,`library.model.multimodal`)}):null,h.verified||g.verified?(0,B.jsx)(D,{variant:`success`,title:a(n,`library.model.hfVerified`),children:a(n,`library.model.sourceVerified`)}):null]}),(0,B.jsx)(`div`,{className:`mt-1 text-sm text-muted-foreground`,children:t===`basic`?[Q(r.family||p.family||a(n,`library.model.local`)),/mlx|gguf|ollama/i.test(String(r.size||p.size||``))?``:r.size||p.size].filter(Boolean).map(String).join(` Β· `):[r.family||p.family||a(n,`library.value.local`),r.size||p.size].filter(Boolean).map(String).join(` Β· `)}),r.hardware||p.hardware?(0,B.jsx)(`div`,{className:`mt-1 text-[11px] text-muted-foreground/80`,children:String(x)}):null,(0,B.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1 text-[11px] text-muted-foreground`,children:[(0,B.jsx)(D,{variant:`muted`,children:y?a(n,`library.model.downloadSize`,{size:String(z||a(n,`library.model.downloadRequired`))}):a(n,`library.model.noDownload`)}),(0,B.jsx)(D,{variant:`muted`,children:y?a(n,`library.model.internetDuringDownload`):a(n,`library.model.runsLocally`)}),V?(0,B.jsx)(D,{variant:`muted`,children:String(V)}):null]}),O?(0,B.jsxs)(`div`,{className:`mt-3 rounded-lg border border-amber-500/30 bg-amber-500/10 p-3 text-sm`,children:[(0,B.jsx)(`div`,{className:`font-medium`,children:t===`basic`?a(n,`library.model.attentionBeforeLoad`):N}),(0,B.jsx)(`div`,{className:`text-muted-foreground`,children:Q(w.user_message||j,`library.model.unsupportedHere`)})]}):E?(0,B.jsxs)(`div`,{className:`mt-3 rounded-lg border border-amber-500/30 bg-amber-500/10 p-3 text-sm`,children:[(0,B.jsx)(`div`,{className:`font-medium`,children:t===`basic`?a(n,`library.model.compatiblePath`):a(n,`library.model.runtimeFallback`)}),(0,B.jsx)(`div`,{className:`text-muted-foreground`,children:Q(w.user_message||a(n,`library.model.compatibilityFallback`),`library.model.compatibilityFallback`)})]}):!l&&!k?(0,B.jsx)(`div`,{className:`mt-1 text-xs text-muted-foreground`,children:j}):null,t===`basic`?null:(0,B.jsxs)(`div`,{className:`mt-2 space-y-1 text-xs text-muted-foreground`,children:[(0,B.jsxs)(`div`,{children:[M,` Β· `,u,r.load_strategy||p.load_strategy?` Β· ${String(r.load_strategy||p.load_strategy)}`:``,h.notes?` Β· ${String(h.notes).slice(0,60)}`:``]}),S||C?(0,B.jsx)(`div`,{children:[C?a(n,`library.model.license`,{license:String(C)}):``,S?String(S):``].filter(Boolean).join(` Β· `)}):null]}),O||E?(0,B.jsx)(ne,{compatibility:w}):null]}),(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 md:justify-end`,children:[(0,B.jsx)(D,{variant:l?`success`:k?`muted`:`warning`,children:l?a(n,`library.model.loaded`):L}),l?(0,B.jsx)(T,{label:a(n,`library.runtime.unload`),action:()=>i.unloadModel(u),invalidate:[`models`]}):(0,B.jsx)(F,{variant:`outline`,disabled:P||O||!R||y&&!f,title:O?a(n,`library.model.status.unsupported`):y&&!f?a(n,`library.btn.needsConsent`):R?void 0:j,onClick:()=>$(u,d,f),children:m===u&&P?a(n,`library.btn.preparing`):y?a(n,`library.btn.installLoad`):a(n,`library.btn.validateLoad`)})]})]},c)}),t===`basic`&&G.length>3?(0,B.jsx)(`div`,{className:`rounded-lg border border-border bg-background/55 p-3 text-sm text-muted-foreground`,children:a(n,`library.model.shortListHint`)}):null]})})]}),(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(S,{title:t===`basic`?a(n,`library.models.embedding.basic`):a(n,`library.models.embedding.advanced`),result:d.data,children:e=>(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(g,{value:V(e.state,n)}),t===`basic`?null:(0,B.jsx)(E,{value:e})]})}),(0,B.jsx)(S,{title:t===`basic`?a(n,`library.models.validation`):a(n,`library.models.validationAdvanced`),result:r.data,children:e=>{let r=o(e.compat_profiles);return r.length?(0,B.jsx)(y,{items:r.map(e=>({...e,name:t===`basic`?e.name||e.display_name||a(n,`library.model.loadedName`):e.name||e.display_name||e.model_id,status:e.quality_status||e.load_status||a(n,`library.model.checked`)})),titleKey:`name`,metaKey:`status`,limit:6}):(0,B.jsx)(w,{title:a(n,`library.model.noneChecked`),detail:a(n,`library.model.noneCheckedHint`)})}})]})]})}function ne({compatibility:e}){let t=s(e=>e.mode),n=s(e=>e.language),r=o(e.alternatives);return r.length?(0,B.jsx)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:r.slice(0,3).map(e=>(0,B.jsx)(D,{variant:`muted`,children:t===`basic`&&/mlx|gguf|ollama|lm studio/i.test(String(e.name||e.id))?a(n,`library.model.compatibleAlternative`):String(e.name||e.id)},String(e.id||e.name)))}):null}function re({language:e=`en`,mode:t=`advanced`,profile:r,recommendation:i,current:o,currentId:s,latestProgress:c,lastResult:l,onReload:u,onUnload:d}){let f=String(o?.id||s||``),p=String(o?.name||``)||(f?n(f):``),m=String(o?.engine||o?.recommended_engine||c?.engine||`local_mlx`),h=String(o?.local_path||o?.storage_location||i.cache_path||i.storage_location||`~/.cache/huggingface / ~/.latticeai/models`),g=String(c?.stage||l?.stage||(p?a(e,`library.value.ready`):a(e,`library.value.idle`))),_=t===`basic`;return(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(b,{stats:_?[{label:a(e,`library.runtime.computer`),value:H(r,e)},{label:a(e,`library.runtime.loaded`),value:p||a(e,`library.runtime.noneShort`)}]:[{label:a(e,`library.runtime.computer`),value:H(r,e)},{label:a(e,`library.runtime.engine`),value:m},{label:a(e,`library.runtime.loaded`),value:p||a(e,`library.runtime.noLoaded`)},{label:a(e,`library.runtime.state`),value:g}]}),(0,B.jsxs)(`div`,{className:`rounded-lg border border-border bg-background/55 p-3 text-sm`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`font-medium`,children:p?a(e,`library.models.runtime.available`):a(e,`library.models.runtime.none`)}),_?null:(0,B.jsx)(`div`,{className:`mt-1 text-muted-foreground`,children:a(e,`library.runtime.cacheStorage`,{path:h})})]}),(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,B.jsx)(F,{variant:`outline`,size:`sm`,disabled:!p,onClick:u,children:a(e,`library.runtime.reload`)}),(0,B.jsx)(F,{variant:`outline`,size:`sm`,disabled:!p,onClick:d,children:a(e,`library.runtime.unload`)})]})]}),c?(0,B.jsxs)(`div`,{className:`mt-3`,children:[(0,B.jsxs)(`div`,{className:`flex justify-between text-xs text-muted-foreground`,children:[(0,B.jsx)(`span`,{children:String(c.message||a(e,`library.preparing`))}),(0,B.jsxs)(`span`,{children:[Number(c.percent||0),`%`]})]}),(0,B.jsx)(`div`,{className:`mt-1 h-2 overflow-hidden rounded-full bg-muted`,children:(0,B.jsx)(`div`,{className:`h-full bg-primary`,style:{width:`${Number(c.percent||8)}%`}})})]}):null]})]})}function ie({error:e}){let t=s(e=>e.language),n=o(e.recovery_guidance);return(0,B.jsxs)(`div`,{className:`rounded-lg border border-amber-500/30 bg-amber-500/10 p-3 text-sm`,children:[(0,B.jsx)(`div`,{className:`font-medium`,children:String(e.user_message||a(t,`library.model.setupAttention`))}),n.length?(0,B.jsx)(`ul`,{className:`mt-2 list-inside list-disc text-muted-foreground`,children:n.slice(0,3).map(e=>(0,B.jsx)(`li`,{children:e},e))}):null]})}function q(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}function J(){let e=l(),t=s(e=>e.language),n=u({queryKey:[`skills`],queryFn:i.skills}),r=u({queryKey:[`skillsMarketplace`],queryFn:i.skillsMarketplace}),c=d({mutationFn:e=>i.skillInstall(String(e.name||e.id),String(e.plugin||``)),onSuccess:()=>e.invalidateQueries({queryKey:[`skills`]})});return(0,B.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,B.jsx)(S,{title:a(t,`library.skills.installed`),result:n.data,children:e=>(0,B.jsx)(`div`,{className:`flex flex-col gap-2`,children:o(e.skills).map(e=>(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border border-border p-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`font-medium`,children:String(e.name||e.id)}),(0,B.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:String(e.plugin||e.description||``)})]}),(0,B.jsx)(T,{label:a(t,e.enabled?`library.skills.disable`:`library.skills.enable`),action:()=>i.skillToggle(String(e.name||e.id),!!e.enabled),invalidate:[`skills`]})]},String(e.name||e.id)))})}),(0,B.jsx)(S,{title:a(t,`library.skills.marketplace`),result:r.data,children:e=>(0,B.jsx)(`div`,{className:`flex flex-col gap-2`,children:o(e.skills).slice(0,10).map(e=>(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-md border border-border p-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`font-medium`,children:String(e.name||e.id)}),(0,B.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:String(e.description||e.category||``)})]}),(0,B.jsx)(F,{variant:`outline`,disabled:c.isPending,onClick:()=>c.mutate(e),children:a(t,`library.skills.install`)})]},String(e.name||e.id)))})})]})}function Y(){let e=s(e=>e.mode),t=s(e=>e.language),[n,r]=z.useState(`github`),o=u({queryKey:[`mcpTools`],queryFn:i.mcpTools}),c=d({mutationFn:()=>i.mcpRecommend(n)});return(0,B.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,B.jsx)(S,{title:a(t,e===`basic`?`library.connector.connections`:`library.connector.mcpTools`),result:o.data,children:e=>(0,B.jsx)(y,{items:e.tools||e.installed_mcps,titleKey:`name`,metaKey:`status`})}),(0,B.jsxs)(C,{children:[(0,B.jsxs)(_,{children:[(0,B.jsxs)(f,{className:`flex items-center gap-2`,children:[(0,B.jsx)(R,{className:`h-4 w-4`}),` `,a(t,`library.connector.recommend`)]}),(0,B.jsx)(v,{children:a(t,`library.connector.recommendHint`)})]}),(0,B.jsxs)(x,{className:`space-y-3`,children:[(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(k,{value:n,onChange:e=>r(e.target.value)}),(0,B.jsx)(F,{onClick:()=>c.mutate(),disabled:!n.trim()||c.isPending,children:a(t,`library.connector.recommendAction`)})]}),c.data?(0,B.jsx)(m,{result:c.data,successLabel:a(t,`library.connector.recommendDone`)}):null]})]})]})}function X(){let e=s(e=>e.language),t=u({queryKey:[`templates`],queryFn:i.templates}),n=u({queryKey:[`plugins`],queryFn:i.pluginsRegistry}),r=u({queryKey:[`pluginsDirectory`],queryFn:i.pluginsDirectory});return(0,B.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,B.jsx)(S,{title:a(e,`library.market.templates`),result:t.data,children:e=>(0,B.jsx)(y,{items:e.templates,titleKey:`name`,metaKey:`kind`})}),(0,B.jsx)(S,{title:a(e,`library.market.installedPlugins`),result:n.data,children:e=>(0,B.jsx)(y,{items:e.plugins,titleKey:`name`,metaKey:`status`})}),(0,B.jsx)(S,{title:a(e,`library.market.pluginDirectory`),result:r.data,children:e=>(0,B.jsx)(y,{items:e.plugins,titleKey:`name`,metaKey:`category`})}),(0,B.jsxs)(C,{className:`xl:col-span-3`,children:[(0,B.jsxs)(_,{children:[(0,B.jsxs)(f,{className:`flex items-center gap-2`,children:[(0,B.jsx)(L,{className:`h-4 w-4`}),` `,a(e,`library.market.templateInstall`)]}),(0,B.jsx)(v,{children:a(e,`library.market.templateInstallHint`)})]}),(0,B.jsx)(x,{children:o(t.data?.data?.templates).length?(0,B.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:o(t.data?.data?.templates).slice(0,6).map(t=>(0,B.jsx)(T,{label:a(e,`library.market.installTemplate`,{name:String(t.name||t.id)}),action:()=>i.installTemplate(t)},String(t.id||t.name)))}):(0,B.jsx)(y,{items:[]})})]})]})}export{W as LibraryPage};
@@ -1 +1 @@
1
- import{C as e,_ as t,b as n,m as r,r as i,v as a,x as o}from"./utils-DG1_ExrP.js";var s=t(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),c=t(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),l=e(o()),u=n(),d=Array.from({length:12},(e,t)=>t),f=[{x:22,y:32,delay:-.4,duration:5.8},{x:36,y:18,delay:-2.1,duration:6.4},{x:65,y:22,delay:-3.7,duration:5.4},{x:79,y:42,delay:-1.3,duration:6.8},{x:68,y:72,delay:-4.5,duration:5.9},{x:31,y:75,delay:-2.8,duration:6.2}];function p({state:e=`idle`,intensity:t=.6,onPulse:n,size:o=`large`,label:s,className:c,showLabel:p=!0,depth:h=0,onInteract:g}){let _=a(e=>e.language),v=l.useRef(null),y=l.useRef(null),b=l.useRef(null),x=l.useRef({x:0,y:0}),S=l.useId().replace(/:/g,``),C={left:`${S}-lobe-left`,right:`${S}-lobe-right`,bridge:`${S}-bridge`,stem:`${S}-stem`,sheen:`${S}-sheen`},w=l.useCallback(()=>{v.current&&(v.current.classList.add(`pulse`),y.current!==null&&window.clearTimeout(y.current),y.current=window.setTimeout(()=>{v.current&&v.current.classList.remove(`pulse`)},1350)),n?.()},[n]);l.useEffect(()=>{let e=()=>w();return window.addEventListener(`brain:recall`,e),()=>{window.removeEventListener(`brain:recall`,e),y.current!==null&&window.clearTimeout(y.current)}},[w]),l.useEffect(()=>{if(e===`recalling`||t>.82){let e=window.setTimeout(()=>w(),180);return()=>clearTimeout(e)}},[e,t,w]);let T=e,E=o===`large`,D=o===`trace`,O=Math.max(.35,Math.min(1,t)),k=Math.max(0,Math.min(5,h||0)),A=e===`thinking`||e===`recalling`||e===`synthesizing`||e===`acting`,j=()=>{w(),!A&&g?.()},M=l.useRef(!1);l.useEffect(()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>{M.current=e.matches};return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let N=l.useCallback(e=>{if(M.current||e.pointerType===`touch`)return;let t=e.currentTarget.getBoundingClientRect(),n=(e.clientX-t.left)/t.width*2-1;x.current={x:((e.clientY-t.top)/t.height*2-1)*-9,y:n*11},b.current===null&&(b.current=window.requestAnimationFrame(()=>{b.current=null;let e=v.current;e&&(e.style.setProperty(`--tilt-y`,`${x.current.y.toFixed(2)}deg`),e.style.setProperty(`--tilt-x`,`${x.current.x.toFixed(2)}deg`))}))},[]),P=l.useCallback(e=>{b.current!==null&&(window.cancelAnimationFrame(b.current),b.current=null);let t=e.currentTarget;t.style.setProperty(`--tilt-y`,`0deg`),t.style.setProperty(`--tilt-x`,`0deg`)},[]);return l.useEffect(()=>()=>{b.current!==null&&window.cancelAnimationFrame(b.current)},[]),(0,u.jsxs)(`div`,{className:i(`brain-presence select-none`,E&&`large`,D&&`trace`,c,k>0&&`is-exploring`),"aria-label":r(_,`brain.living.aria`),role:`group`,"data-depth":k,children:[(0,u.jsxs)(`button`,{type:`button`,ref:v,className:i(`brain-organism`,`size-${o}`,`depth-${k}`),"data-state":T,"data-testid":`living-brain`,"aria-label":r(_,k<5?`brain.living.open`:`brain.living.graph`),"aria-busy":A,style:{"--brain-scale":`${.96+(O-.5)*.09+k*.015}`},onClick:j,onPointerMove:N,onPointerLeave:P,title:r(_,k<5?`brain.living.open`:`brain.living.graph`),children:[(0,u.jsxs)(`div`,{className:`brain-vital-field`,"aria-hidden":`true`,children:[(0,u.jsx)(`span`,{className:`brain-vital-ring is-primary`}),(0,u.jsx)(`span`,{className:`brain-vital-ring is-echo`}),(0,u.jsx)(`span`,{className:`brain-orbit is-near`,children:(0,u.jsx)(`i`,{})}),(0,u.jsx)(`span`,{className:`brain-orbit is-far`,children:(0,u.jsx)(`i`,{})}),f.map((e,t)=>(0,u.jsx)(`i`,{className:`brain-vital-spark`,style:{left:`${e.x}%`,top:`${e.y}%`,animationDelay:`${e.delay}s`,animationDuration:`${e.duration}s`,"--spark-index":t}},`${e.x}-${e.y}`))]}),(0,u.jsx)(`div`,{className:`brain-core`,style:{"--core-scale":`${1+k*.045}`},children:(0,u.jsx)(`div`,{className:`brain-body-motion`,children:(0,u.jsxs)(`svg`,{className:`brain-anatomy`,viewBox:`0 0 220 174`,"aria-hidden":!0,children:[(0,u.jsxs)(`defs`,{children:[(0,u.jsxs)(`radialGradient`,{id:C.left,cx:`34%`,cy:`26%`,r:`85%`,children:[(0,u.jsx)(`stop`,{offset:`0%`,stopColor:`hsl(var(--brain-halo) / 0.8)`}),(0,u.jsx)(`stop`,{offset:`42%`,stopColor:`hsl(var(--brain-core) / 0.46)`}),(0,u.jsx)(`stop`,{offset:`78%`,stopColor:`hsl(var(--brain-core) / 0.2)`}),(0,u.jsx)(`stop`,{offset:`100%`,stopColor:`hsl(228 30% 8% / 0.28)`})]}),(0,u.jsxs)(`radialGradient`,{id:C.right,cx:`62%`,cy:`24%`,r:`88%`,children:[(0,u.jsx)(`stop`,{offset:`0%`,stopColor:`hsl(var(--connection) / 0.66)`}),(0,u.jsx)(`stop`,{offset:`46%`,stopColor:`hsl(var(--connection) / 0.32)`}),(0,u.jsx)(`stop`,{offset:`80%`,stopColor:`hsl(var(--connection) / 0.14)`}),(0,u.jsx)(`stop`,{offset:`100%`,stopColor:`hsl(228 30% 8% / 0.3)`})]}),(0,u.jsxs)(`radialGradient`,{id:C.bridge,cx:`50%`,cy:`30%`,r:`80%`,children:[(0,u.jsx)(`stop`,{offset:`0%`,stopColor:`hsl(var(--memory) / 0.55)`}),(0,u.jsx)(`stop`,{offset:`100%`,stopColor:`hsl(var(--memory) / 0.1)`})]}),(0,u.jsxs)(`linearGradient`,{id:C.stem,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,u.jsx)(`stop`,{offset:`0%`,stopColor:`hsl(var(--knowledge) / 0.42)`}),(0,u.jsx)(`stop`,{offset:`100%`,stopColor:`hsl(var(--knowledge) / 0.08)`})]}),(0,u.jsxs)(`linearGradient`,{id:C.sheen,x1:`0`,y1:`0`,x2:`0.4`,y2:`1`,children:[(0,u.jsx)(`stop`,{offset:`0%`,stopColor:`hsl(40 60% 98% / 0.5)`}),(0,u.jsx)(`stop`,{offset:`70%`,stopColor:`hsl(40 60% 98% / 0.06)`}),(0,u.jsx)(`stop`,{offset:`100%`,stopColor:`hsl(40 60% 98% / 0)`})]})]}),(0,u.jsx)(`path`,{className:`brain-lobe brain-lobe-left`,style:{fill:`url(#${C.left})`},d:`M102 30c-13-20-44-19-55 1-18 1-29 16-28 33-13 8-18 25-11 39-9 16-1 36 17 42 5 19 27 26 43 15 13 10 33 8 43-5 5-7 8-16 8-27V52c0-8-6-17-17-22Z`}),(0,u.jsx)(`path`,{className:`brain-lobe brain-lobe-right`,style:{fill:`url(#${C.right})`},d:`M118 30c13-20 44-19 55 1 18 1 29 16 28 33 13 8 18 25 11 39 9 16 1 36-17 42-5 19-27 26-43 15-13 10-33 8-43-5-5-7-8-16-8-27V52c0-8 6-17 17-22Z`}),(0,u.jsx)(`path`,{className:`brain-bridge`,style:{fill:`url(#${C.bridge})`},d:`M103 48c9-8 24-8 33 0 7 6 9 16 5 25-5 11-16 15-31 12-15 3-26-1-31-12-4-9-2-19 5-25 5-4 12-6 19 0Z`}),(0,u.jsx)(`path`,{className:`brain-stem`,style:{fill:`url(#${C.stem})`},d:`M92 137c10 9 26 9 36 0 1 14 7 25 20 33H76c12-8 17-19 16-33Z`}),(0,u.jsx)(`path`,{className:`brain-fold fold-a`,d:`M48 50c18-11 38-8 47 8`}),(0,u.jsx)(`path`,{className:`brain-fold fold-b`,d:`M34 82c22-8 45-5 58 8`}),(0,u.jsx)(`path`,{className:`brain-fold fold-c`,d:`M43 119c18 5 35 2 49-11`}),(0,u.jsx)(`path`,{className:`brain-fold fold-d`,d:`M172 50c-18-11-38-8-47 8`}),(0,u.jsx)(`path`,{className:`brain-fold fold-e`,d:`M186 82c-22-8-45-5-58 8`}),(0,u.jsx)(`path`,{className:`brain-fold fold-f`,d:`M177 119c-18 5-35 2-49-11`}),(0,u.jsx)(`path`,{className:`brain-fold fold-mid`,d:`M110 38c-5 30-5 70 0 112`}),(0,u.jsx)(`path`,{className:`brain-sheen`,style:{fill:`url(#${C.sheen})`},d:`M58 38c22-16 52-20 78-10-30-2-58 6-74 22-8 8-16 6-4-12Z`})]})})}),(0,u.jsx)(`div`,{className:`brain-aura`,style:{animationDuration:e===`thinking`?`1.65s`:e===`recalling`?`2.4s`:`6.8s`,"--aura-scale":`${1+k*.12}`,opacity:.65+k*.05,boxShadow:k>2?`0 0 var(--aura-blur, 60px) hsl(var(--brain-core) / 0.25)`:`none`}}),(0,u.jsx)(`div`,{className:`thought-activity`,"aria-hidden":!0,children:d.slice(0,Math.min(12,5+k*2)).map(e=>(0,u.jsx)(`div`,{className:i(`thought-particle`,k>=3&&`resolving`),style:{left:`${18+(e*13+k*4)%64}%`,top:`${22+e%5*14}%`,animationDelay:`-${e*.55+t*1.1-k*.2}s`,animationDuration:`${2.8+(1-O)*1.6-k*.15}s`}},e))}),Array.from({length:1+Math.floor(k/1.5)}).map((e,t)=>(0,u.jsx)(`div`,{className:`memory-ripple`,"aria-hidden":!0,style:{inset:`${18+t*6}%`,animationDelay:`${180+t*220}ms`,opacity:.55+k*.06}},t))]}),p&&!D&&(0,u.jsxs)(`div`,{className:`brain-presence-label`,"data-state":e,children:[(0,u.jsx)(`span`,{className:`dot`}),s||(k>0?r(_,`brain.living.depth`,{depth:k}):r(_,m(e)))]})]})}function m(e){switch(e){case`listening`:return`brain.living.state.listening`;case`thinking`:return`brain.living.state.thinking`;case`recalling`:return`brain.living.state.recalling`;case`synthesizing`:return`brain.living.state.synthesizing`;case`planning`:return`brain.living.state.planning`;case`acting`:return`brain.living.state.acting`;case`resting`:return`brain.living.state.resting`;default:return`brain.living.state.idle`}}function h(){typeof window<`u`&&window.dispatchEvent(new CustomEvent(`brain:recall`))}export{s as i,h as n,c as r,p as t};
1
+ import{C as e,_ as t,b as n,m as r,r as i,v as a,x as o}from"./utils-zqPZJxdx.js";var s=t(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),c=t(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),l=e(o()),u=n(),d=Array.from({length:12},(e,t)=>t),f=[{x:22,y:32,delay:-.4,duration:5.8},{x:36,y:18,delay:-2.1,duration:6.4},{x:65,y:22,delay:-3.7,duration:5.4},{x:79,y:42,delay:-1.3,duration:6.8},{x:68,y:72,delay:-4.5,duration:5.9},{x:31,y:75,delay:-2.8,duration:6.2}];function p({state:e=`idle`,intensity:t=.6,onPulse:n,size:o=`large`,label:s,className:c,showLabel:p=!0,depth:h=0,onInteract:g}){let _=a(e=>e.language),v=l.useRef(null),y=l.useRef(null),b=l.useRef(null),x=l.useRef({x:0,y:0}),S=l.useId().replace(/:/g,``),C={left:`${S}-lobe-left`,right:`${S}-lobe-right`,bridge:`${S}-bridge`,stem:`${S}-stem`,sheen:`${S}-sheen`},w=l.useCallback(()=>{v.current&&(v.current.classList.add(`pulse`),y.current!==null&&window.clearTimeout(y.current),y.current=window.setTimeout(()=>{v.current&&v.current.classList.remove(`pulse`)},1350)),n?.()},[n]);l.useEffect(()=>{let e=()=>w();return window.addEventListener(`brain:recall`,e),()=>{window.removeEventListener(`brain:recall`,e),y.current!==null&&window.clearTimeout(y.current)}},[w]),l.useEffect(()=>{if(e===`recalling`||t>.82){let e=window.setTimeout(()=>w(),180);return()=>clearTimeout(e)}},[e,t,w]);let T=e,E=o===`large`,D=o===`trace`,O=Math.max(.35,Math.min(1,t)),k=Math.max(0,Math.min(5,h||0)),A=e===`thinking`||e===`recalling`||e===`synthesizing`||e===`acting`,j=()=>{w(),!A&&g?.()},M=l.useRef(!1);l.useEffect(()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`),t=()=>{M.current=e.matches};return t(),e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let N=l.useCallback(e=>{if(M.current||e.pointerType===`touch`)return;let t=e.currentTarget.getBoundingClientRect(),n=(e.clientX-t.left)/t.width*2-1;x.current={x:((e.clientY-t.top)/t.height*2-1)*-9,y:n*11},b.current===null&&(b.current=window.requestAnimationFrame(()=>{b.current=null;let e=v.current;e&&(e.style.setProperty(`--tilt-y`,`${x.current.y.toFixed(2)}deg`),e.style.setProperty(`--tilt-x`,`${x.current.x.toFixed(2)}deg`))}))},[]),P=l.useCallback(e=>{b.current!==null&&(window.cancelAnimationFrame(b.current),b.current=null);let t=e.currentTarget;t.style.setProperty(`--tilt-y`,`0deg`),t.style.setProperty(`--tilt-x`,`0deg`)},[]);return l.useEffect(()=>()=>{b.current!==null&&window.cancelAnimationFrame(b.current)},[]),(0,u.jsxs)(`div`,{className:i(`brain-presence select-none`,E&&`large`,D&&`trace`,c,k>0&&`is-exploring`),"aria-label":r(_,`brain.living.aria`),role:`group`,"data-depth":k,children:[(0,u.jsxs)(`button`,{type:`button`,ref:v,className:i(`brain-organism`,`size-${o}`,`depth-${k}`),"data-state":T,"data-testid":`living-brain`,"aria-label":r(_,k<5?`brain.living.open`:`brain.living.graph`),"aria-busy":A,style:{"--brain-scale":`${.96+(O-.5)*.09+k*.015}`},onClick:j,onPointerMove:N,onPointerLeave:P,title:r(_,k<5?`brain.living.open`:`brain.living.graph`),children:[(0,u.jsxs)(`div`,{className:`brain-vital-field`,"aria-hidden":`true`,children:[(0,u.jsx)(`span`,{className:`brain-vital-ring is-primary`}),(0,u.jsx)(`span`,{className:`brain-vital-ring is-echo`}),(0,u.jsx)(`span`,{className:`brain-orbit is-near`,children:(0,u.jsx)(`i`,{})}),(0,u.jsx)(`span`,{className:`brain-orbit is-far`,children:(0,u.jsx)(`i`,{})}),f.map((e,t)=>(0,u.jsx)(`i`,{className:`brain-vital-spark`,style:{left:`${e.x}%`,top:`${e.y}%`,animationDelay:`${e.delay}s`,animationDuration:`${e.duration}s`,"--spark-index":t}},`${e.x}-${e.y}`))]}),(0,u.jsx)(`div`,{className:`brain-core`,style:{"--core-scale":`${1+k*.045}`},children:(0,u.jsx)(`div`,{className:`brain-body-motion`,children:(0,u.jsxs)(`svg`,{className:`brain-anatomy`,viewBox:`0 0 220 174`,"aria-hidden":!0,children:[(0,u.jsxs)(`defs`,{children:[(0,u.jsxs)(`radialGradient`,{id:C.left,cx:`34%`,cy:`26%`,r:`85%`,children:[(0,u.jsx)(`stop`,{offset:`0%`,stopColor:`hsl(var(--brain-halo) / 0.8)`}),(0,u.jsx)(`stop`,{offset:`42%`,stopColor:`hsl(var(--brain-core) / 0.46)`}),(0,u.jsx)(`stop`,{offset:`78%`,stopColor:`hsl(var(--brain-core) / 0.2)`}),(0,u.jsx)(`stop`,{offset:`100%`,stopColor:`hsl(228 30% 8% / 0.28)`})]}),(0,u.jsxs)(`radialGradient`,{id:C.right,cx:`62%`,cy:`24%`,r:`88%`,children:[(0,u.jsx)(`stop`,{offset:`0%`,stopColor:`hsl(var(--connection) / 0.66)`}),(0,u.jsx)(`stop`,{offset:`46%`,stopColor:`hsl(var(--connection) / 0.32)`}),(0,u.jsx)(`stop`,{offset:`80%`,stopColor:`hsl(var(--connection) / 0.14)`}),(0,u.jsx)(`stop`,{offset:`100%`,stopColor:`hsl(228 30% 8% / 0.3)`})]}),(0,u.jsxs)(`radialGradient`,{id:C.bridge,cx:`50%`,cy:`30%`,r:`80%`,children:[(0,u.jsx)(`stop`,{offset:`0%`,stopColor:`hsl(var(--memory) / 0.55)`}),(0,u.jsx)(`stop`,{offset:`100%`,stopColor:`hsl(var(--memory) / 0.1)`})]}),(0,u.jsxs)(`linearGradient`,{id:C.stem,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,u.jsx)(`stop`,{offset:`0%`,stopColor:`hsl(var(--knowledge) / 0.42)`}),(0,u.jsx)(`stop`,{offset:`100%`,stopColor:`hsl(var(--knowledge) / 0.08)`})]}),(0,u.jsxs)(`linearGradient`,{id:C.sheen,x1:`0`,y1:`0`,x2:`0.4`,y2:`1`,children:[(0,u.jsx)(`stop`,{offset:`0%`,stopColor:`hsl(40 60% 98% / 0.5)`}),(0,u.jsx)(`stop`,{offset:`70%`,stopColor:`hsl(40 60% 98% / 0.06)`}),(0,u.jsx)(`stop`,{offset:`100%`,stopColor:`hsl(40 60% 98% / 0)`})]})]}),(0,u.jsx)(`path`,{className:`brain-lobe brain-lobe-left`,style:{fill:`url(#${C.left})`},d:`M102 30c-13-20-44-19-55 1-18 1-29 16-28 33-13 8-18 25-11 39-9 16-1 36 17 42 5 19 27 26 43 15 13 10 33 8 43-5 5-7 8-16 8-27V52c0-8-6-17-17-22Z`}),(0,u.jsx)(`path`,{className:`brain-lobe brain-lobe-right`,style:{fill:`url(#${C.right})`},d:`M118 30c13-20 44-19 55 1 18 1 29 16 28 33 13 8 18 25 11 39 9 16 1 36-17 42-5 19-27 26-43 15-13 10-33 8-43-5-5-7-8-16-8-27V52c0-8 6-17 17-22Z`}),(0,u.jsx)(`path`,{className:`brain-bridge`,style:{fill:`url(#${C.bridge})`},d:`M103 48c9-8 24-8 33 0 7 6 9 16 5 25-5 11-16 15-31 12-15 3-26-1-31-12-4-9-2-19 5-25 5-4 12-6 19 0Z`}),(0,u.jsx)(`path`,{className:`brain-stem`,style:{fill:`url(#${C.stem})`},d:`M92 137c10 9 26 9 36 0 1 14 7 25 20 33H76c12-8 17-19 16-33Z`}),(0,u.jsx)(`path`,{className:`brain-fold fold-a`,d:`M48 50c18-11 38-8 47 8`}),(0,u.jsx)(`path`,{className:`brain-fold fold-b`,d:`M34 82c22-8 45-5 58 8`}),(0,u.jsx)(`path`,{className:`brain-fold fold-c`,d:`M43 119c18 5 35 2 49-11`}),(0,u.jsx)(`path`,{className:`brain-fold fold-d`,d:`M172 50c-18-11-38-8-47 8`}),(0,u.jsx)(`path`,{className:`brain-fold fold-e`,d:`M186 82c-22-8-45-5-58 8`}),(0,u.jsx)(`path`,{className:`brain-fold fold-f`,d:`M177 119c-18 5-35 2-49-11`}),(0,u.jsx)(`path`,{className:`brain-fold fold-mid`,d:`M110 38c-5 30-5 70 0 112`}),(0,u.jsx)(`path`,{className:`brain-sheen`,style:{fill:`url(#${C.sheen})`},d:`M58 38c22-16 52-20 78-10-30-2-58 6-74 22-8 8-16 6-4-12Z`})]})})}),(0,u.jsx)(`div`,{className:`brain-aura`,style:{animationDuration:e===`thinking`?`1.65s`:e===`recalling`?`2.4s`:`6.8s`,"--aura-scale":`${1+k*.12}`,opacity:.65+k*.05,boxShadow:k>2?`0 0 var(--aura-blur, 60px) hsl(var(--brain-core) / 0.25)`:`none`}}),(0,u.jsx)(`div`,{className:`thought-activity`,"aria-hidden":!0,children:d.slice(0,Math.min(12,5+k*2)).map(e=>(0,u.jsx)(`div`,{className:i(`thought-particle`,k>=3&&`resolving`),style:{left:`${18+(e*13+k*4)%64}%`,top:`${22+e%5*14}%`,animationDelay:`-${e*.55+t*1.1-k*.2}s`,animationDuration:`${2.8+(1-O)*1.6-k*.15}s`}},e))}),Array.from({length:1+Math.floor(k/1.5)}).map((e,t)=>(0,u.jsx)(`div`,{className:`memory-ripple`,"aria-hidden":!0,style:{inset:`${18+t*6}%`,animationDelay:`${180+t*220}ms`,opacity:.55+k*.06}},t))]}),p&&!D&&(0,u.jsxs)(`div`,{className:`brain-presence-label`,"data-state":e,children:[(0,u.jsx)(`span`,{className:`dot`}),s||(k>0?r(_,`brain.living.depth`,{depth:k}):r(_,m(e)))]})]})}function m(e){switch(e){case`listening`:return`brain.living.state.listening`;case`thinking`:return`brain.living.state.thinking`;case`recalling`:return`brain.living.state.recalling`;case`synthesizing`:return`brain.living.state.synthesizing`;case`planning`:return`brain.living.state.planning`;case`acting`:return`brain.living.state.acting`;case`resting`:return`brain.living.state.resting`;default:return`brain.living.state.idle`}}function h(){typeof window<`u`&&window.dispatchEvent(new CustomEvent(`brain:recall`))}export{s as i,h as n,c as r,p as t};
@@ -1 +1 @@
1
- import{C as e,_ as t,b as n,d as r,g as i,m as a,p as o,t as s,v as c,x as l}from"./utils-DG1_ExrP.js";import{i as u,r as d,t as f}from"./LivingBrain-Dfq_wEDI.js";import{n as p,t as m}from"./input-D4w_BZWl.js";import{t as h}from"./cpu-Bs6uc9W9.js";import{l as g,v as _}from"./index-D7Rr-J2Y.js";import"./brain-DDCLjRqO.js";import{t as v}from"./button-51Z3rsuv.js";var y=t(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),b=t(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),x=t(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),S=t(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),C=e(l());i({ko:{"flow.analysis.fact.computer":`컴퓨터`,"flow.analysis.fact.memory":`λ©”λͺ¨λ¦¬`,"flow.analysis.fact.graphics":`κ·Έλž˜ν”½`,"flow.analysis.fact.support":`둜컬 지원`,"flow.analysis.fact.models":`λͺ¨λΈ`,"flow.analysis.checking":`확인 쀑`,"flow.analysis.fact.computerDetail":`μš΄μ˜μ²΄μ œμ™€ μΉ©`,"flow.analysis.fact.memoryDetail":`둜컬 사고λ₯Ό μœ„ν•œ μ—¬μœ  곡간`,"flow.analysis.fact.graphicsDetail":`둜컬 가속 지원`,"flow.analysis.fact.supportDetail":`μ„€μΉ˜λœ λͺ¨λΈ λ„μš°λ―Έ`,"flow.analysis.fact.modelsDetail":`μ„€μΉ˜λœ 둜컬 Brain`,"flow.analysis.apple":`Apple Silicon Mac`,"flow.analysis.detected":`감지됨`,"flow.analysis.localReady":`둜컬 가속 쀀비됨`,"flow.analysis.standardLocal":`ν‘œμ€€ 둜컬 λͺ¨λ“œ`,"flow.analysis.supportReady":`쀀비됨`,"flow.analysis.supportInstall":`μ€€λΉ„ μ˜ˆμ •`,"flow.analysis.modelsInstalled":`{count}개 이미 μ„€μΉ˜λ¨`,"flow.analysis.noModels":`아직 μ„€μΉ˜λœ λͺ¨λΈ μ—†μŒ`,"flow.analysis.readyDetail":`둜컬 Digital Brain μ‚¬μš© μ€€λΉ„ μ™„λ£Œ`,"flow.analysis.memoryReadyDetail":`μΆ”μ²œ λͺ¨λΈμ— μΆ©λΆ„ν•œ μ»¨ν…μŠ€νŠΈ`,"flow.analysis.graphicsReadyDetail":`Latticeκ°€ κ°€μž₯ 쒋은 경둜λ₯Ό μ„ νƒν•©λ‹ˆλ‹€.`,"flow.analysis.supportReadyDetail":`μ„€μΉ˜λœ λͺ¨λΈ λ„μš°λ―Έκ°€ κ°μ§€λ˜μ—ˆμŠ΅λ‹ˆλ‹€.`,"flow.analysis.supportInstallDetail":`Latticeκ°€ ν•„μš”ν•œ ν•­λͺ©μ„ μΆ”κ°€ν•©λ‹ˆλ‹€.`,"flow.analysis.modelsReadyDetail":`μ¦‰μ‹œ λ‘œλ“œν•  수 μžˆλŠ” λͺ¨λΈμ΄ μžˆμŠ΅λ‹ˆλ‹€.`,"flow.analysis.modelsInstallDetail":`Latticeκ°€ 첫 μ„€μΉ˜λ₯Ό μ•ˆλ‚΄ν•©λ‹ˆλ‹€.`,"flow.recommend.reason.best":`졜적 κ²½ν—˜`,"flow.recommend.reason.faster":`λΉ λ₯Έ 선택`,"flow.recommend.reason.advanced":`κ³ κΈ‰ 선택`,"flow.recommend.reason.default":`μΆ”μ²œ`,"flow.recommend.sizeReady":`쀀비됨`,"flow.recommend.fallbackName":`μΆ”μ²œ Brain`,"flow.install.stage.idle":`μ•„λž˜ λ²„νŠΌμ„ λˆ„λ₯΄λ©΄ μ€€λΉ„λ₯Ό μ‹œμž‘ν•©λ‹ˆλ‹€.`,"flow.install.stage.install":`Brain μ€€λΉ„λ₯Ό μ‹œμž‘ν•©λ‹ˆλ‹€.`,"flow.install.stage.download":`λͺ¨λΈ νŒŒμΌμ„ λ°›λŠ” μ€‘μž…λ‹ˆλ‹€.`,"flow.install.stage.validate":`Brain이 응닡할 수 μžˆλŠ”μ§€ 확인 μ€‘μž…λ‹ˆλ‹€.`,"flow.install.stage.load":`Brain을 λΆˆλŸ¬μ˜€λŠ” μ€‘μž…λ‹ˆλ‹€.`,"flow.install.stage.done":`Brain이 μ€€λΉ„λ˜μ—ˆμŠ΅λ‹ˆλ‹€. κ³§ λŒ€ν™”κ°€ μ—΄λ¦½λ‹ˆλ‹€.`,"flow.install.stage.error":`확인이 ν•„μš”ν•œ 일이 μžˆμŠ΅λ‹ˆλ‹€.`,"flow.install.step.install":`μ€€λΉ„`,"flow.install.step.download":`λ‹€μš΄λ‘œλ“œ`,"flow.install.step.ready":`둜컬 확인`,"flow.install.step.validate":`확인`,"flow.install.step.load":`λ‘œλ“œ`,"flow.analysis.hardware.icon.chip":`πŸ–₯️`,"flow.analysis.hardware.icon.ram":`🧠`,"flow.analysis.hardware.icon.gpu":`⚑`,"flow.analysis.hardware.icon.support":`🧩`,"flow.analysis.hardware.icon.models":`πŸ“¦`,"flow.analysis.hardware.label.chip":`컴퓨터 (μš΄μ˜μ²΄μ œμ™€ μΉ©)`,"flow.analysis.hardware.label.ram":`λ©”λͺ¨λ¦¬ (생각할 μž‘μ—… 곡간, RAM)`,"flow.analysis.hardware.label.gpu":`κ·Έλž˜ν”½ (계산을 λ„μ™€μ£ΌλŠ” GPU)`,"flow.analysis.hardware.label.support":`둜컬 지원 (λͺ¨λΈ μ‹€ν–‰ λ„μš°λ―Έ)`,"flow.analysis.hardware.label.models":`λͺ¨λΈ (μ„€μΉ˜λœ AI Brain)`,"flow.recommend.timeEstimate":`λ‹€μš΄λ‘œλ“œ μ•½ {download} Β· 첫 응닡 μ•½ {response}초`,"flow.recommend.timeEstimate.ready":`λ‹€μš΄λ‘œλ“œ λΆˆν•„μš” Β· 첫 응닡 μ•½ {response}초`,"flow.recommend.timeEstimate.unknown":`λ‹€μš΄λ‘œλ“œ μ‹œκ°„ 미확인 Β· 첫 응닡 μ•½ {response}초`,"flow.recommend.timeNote":`λ„€νŠΈμ›Œν¬ 속도에 따라 λ‹¬λΌμ§ˆ 수 μžˆμ–΄μš”.`,"flow.recommend.alternatives":`λ‹€λ₯Έ 선택지`,"flow.recommend.minutes":`{count}λΆ„`,"flow.recommend.comparison.faster":`(더 빠름)`,"flow.recommend.comparison.advanced":`(더 κ°•λ ₯함)`,"flow.recommend.choose":`이 λͺ¨λΈ 선택`,"flow.recommend.primaryNote":`μ•½ {time} ν›„ μ‚¬μš© μ€€λΉ„ μ™„λ£Œ`,"flow.recommend.primaryNote.ready":`λ‹€μš΄λ‘œλ“œ 없이 λ°”λ‘œ μ‚¬μš© μ€€λΉ„ μ™„λ£Œ`,"flow.recommend.primaryNote.unknown":`λ‹€μš΄λ‘œλ“œ μ‹œκ°„ 확인 ν›„ μ‚¬μš© μ€€λΉ„`,"flow.recommend.nextHint":`μ„ νƒν•˜λ©΄ λ‹€μš΄λ‘œλ“œμ™€ μ€€λΉ„ ν™”λ©΄μœΌλ‘œ λ„˜μ–΄κ°€κ³ , λλ‚˜λ©΄ λ°”λ‘œ Brain이 μ—΄λ¦½λ‹ˆλ‹€.`,"flow.recommend.nextHint.ready":`μ„ νƒν•˜λ©΄ μ€€λΉ„ 확인 ν™”λ©΄μœΌλ‘œ λ„˜μ–΄κ°€κ³ , λλ‚˜λ©΄ λ°”λ‘œ Brain이 μ—΄λ¦½λ‹ˆλ‹€.`,"flow.install.expectedTitle":`μ˜ˆμƒ μ§„ν–‰`,"flow.install.expected":`μ•½ {download} λ‹€μš΄λ‘œλ“œ ν›„ μ•½ {response}초 μ•ˆμ— 첫 응닡`,"flow.install.expected.ready":`λ‹€μš΄λ‘œλ“œ 없이 μ•½ {response}초 μ•ˆμ— 첫 응닡`,"flow.install.expected.unknown":`λ‹€μš΄λ‘œλ“œ ν›„ μ•½ {response}초 μ•ˆμ— 첫 응닡`,"flow.install.timelineStep.download":`λͺ¨λΈ λ‹€μš΄λ‘œλ“œ`,"flow.install.timelineStep.ready":`둜컬 λͺ¨λΈ 확인`,"flow.install.timelineStep.validate":`응닡 확인`,"flow.install.timelineStep.load":`Brain에 λ‘œλ“œ`,"flow.install.timelineApprox":`μ•½ {time}`,"flow.install.timelineQuick":`잠깐`,"flow.install.expectedCompletion":`λλ‚˜λ©΄ λ°”λ‘œ Brain이 μ—΄λ¦½λ‹ˆλ‹€.`,"flow.shell":`λ‚΄ 둜컬 AI 브레인 λ§Œλ“€κΈ°`,"flow.wake.aria":`Brain 깨우기`,"flow.wake.title":`λ‚΄ 지식이 μ‚΄μ•„λ‚˜λŠ” Brain을 μ‹œμž‘ν•˜μ„Έμš”.`,"flow.wake.body":`Lattice AIλŠ” 이 컴퓨터 μ•ˆμ—μ„œ λ‚΄ λŒ€ν™”, λ¬Έμ„œ, 결정이 였래 λ‚¨λŠ” μž‘μ—… 기얡이 되게 ν•©λ‹ˆλ‹€. λͺ¨λΈμ€ 바꿔도 Brain은 계속 λ‚΄ κ²ƒμž…λ‹ˆλ‹€.`,"flow.wake.value.aria":`Brain μ‹œμž‘ κ°€μΉ˜`,"flow.wake.value.local.k":`μ™„μ „ 둜컬`,"flow.wake.value.local.v":`지식과 λŒ€ν™”λŠ” 이 μ»΄ν“¨ν„°μ—μ„œ λ¨Όμ € μ •λ¦¬λ©λ‹ˆλ‹€.`,"flow.wake.value.instant.k":`λ°”λ‘œ 이해`,"flow.wake.value.instant.v":`λ³΅μž‘ν•œ μ„€μ • λŒ€μ‹  3λ‹¨κ³„λ‘œ 첫 λŒ€ν™”λ₯Ό μ—½λ‹ˆλ‹€.`,"flow.wake.value.brain.k":`μ§€μ†λ˜λŠ” Brain`,"flow.wake.value.brain.v":`λͺ¨λΈμ„ 바꿔도 λ‚΄ κΈ°μ–΅κ³Ό κ·Έλž˜ν”„λŠ” μ΄μ–΄μ§‘λ‹ˆλ‹€.`,"flow.wake.plan.aria":`Brain μ‹œμž‘ 단계`,"flow.wake.step.identity":`주인 확인`,"flow.wake.step.check":`컴퓨터 확인`,"flow.wake.step.voice":`λͺ©μ†Œλ¦¬ 선택`,"flow.wake.primary":`Brain μ§€κΈˆ 깨우기`,"flow.wake.existing":`κΈ°μ‘΄ Brain μ—΄κΈ°`,"flow.wake.startNote":`평균 2λΆ„ μ•ˆμ— 첫 λŒ€ν™” μ‹œμž‘ Β· 둜컬 μš°μ„  Β· μ‚¬μš©μžκ°€ μ œμ–΄`,"flow.login.title":`이 Brain의 주인을 μ •ν•©λ‹ˆλ‹€.`,"flow.login.statement":`이 컴퓨터 μ•ˆμ—μ„œλ§Œ μ‚¬λŠ” 기얡을 λ§Œλ“­λ‹ˆλ‹€.`,"flow.login.body":`이 μ»΄ν“¨ν„°μ˜ 기얡을 λˆ„κ΅¬ κ²ƒμœΌλ‘œ ν• μ§€ μ •ν•©λ‹ˆλ‹€. κΈ°μ‘΄ Brain이 있으면 μƒˆλ‘œ λ§Œλ“€κΈ° 전에 λ¨Όμ € μ•ˆμ „ν•˜κ²Œ ν™•μΈν•©λ‹ˆλ‹€.`,"flow.name":`이름`,"flow.name.placeholder":`λ‚˜`,"flow.email":`이메일`,"flow.email.placeholder":`you@local`,"flow.password":`λΉ„λ°€λ²ˆν˜Έ`,"flow.password.placeholder":`둜컬 Brain λΉ„λ°€λ²ˆν˜Έ`,"flow.login.busy":`Brain μ—¬λŠ” 쀑...`,"flow.login.submit":`λ‚΄ Brain μ‹œμž‘ν•˜κΈ°`,"flow.login.note":`이 ν”„λ‘œν•„μ€ λ‚΄ AI 브레인의 μ£ΌμΈμž…λ‹ˆλ‹€. κΈ°μ‘΄ Brainκ³Ό λ‹€λ₯Έ 이메일이면 μƒˆλ‘œ λ§Œλ“€μ§€ μ•Šκ³  λ¨Όμ € ν™•μΈν•©λ‹ˆλ‹€.`,"flow.login.passwordLocal":`이 λΉ„λ°€λ²ˆν˜ΈλŠ” 이 μ»΄ν“¨ν„°μ˜ Brain μ „μš©μž…λ‹ˆλ‹€. ν΄λΌμš°λ“œλ‘œ μ „μ†‘λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.`,"flow.login.missing":`이름과 이메일, λΉ„λ°€λ²ˆν˜Έλ₯Ό μž…λ ₯ν•˜λ©΄ κΈ°μ‘΄ Brain을 μ•ˆμ „ν•˜κ²Œ ν™•μΈν•©λ‹ˆλ‹€.`,"flow.login.otherEmail":`이 μ»΄ν“¨ν„°μ˜ κΈ°μ‘΄ Brainκ³Ό λ‹€λ₯Έ μ΄λ©”μΌμž…λ‹ˆλ‹€. μ˜€νƒ€μΈμ§€ 확인해 μ£Όμ„Έμš”.`,"flow.login.wrongPassword":`κΈ°μ‘΄ Brain 이메일은 λ§žμ§€λ§Œ λΉ„λ°€λ²ˆν˜Έκ°€ λ‹€λ¦…λ‹ˆλ‹€. λΉ„λ°€λ²ˆν˜Έλ₯Ό λ‹€μ‹œ 확인해 μ£Όμ„Έμš”.`,"flow.login.unavailable":`둜컬 ν”„λ‘œν•„μ„ μ—΄ 수 μ—†μŠ΅λ‹ˆλ‹€. 이메일과 λΉ„λ°€λ²ˆν˜Έλ₯Ό 확인해 μ£Όμ„Έμš”.`,"flow.promise.memory.k":`였래 λ‚¨λŠ” 지식`,"flow.promise.memory.v":`λ‚΄ 일이 μž₯κΈ° 기얡이 λ©λ‹ˆλ‹€.`,"flow.promise.model.k":`ꡐ체 κ°€λŠ₯ν•œ λͺ¨λΈ`,"flow.promise.model.v":`λͺ¨λΈμ€ λͺ©μ†Œλ¦¬μ΄κ³ , μžμ‚°μ€ Brainμž…λ‹ˆλ‹€.`,"flow.promise.ownership.k":`μ‚¬μš©μž μ†Œμœ `,"flow.promise.ownership.v":`λ°±μ—…, 볡원, 이동을 직접 κ²°μ •ν•©λ‹ˆλ‹€.`,"flow.promise.aria":`Lattice AI μ œν’ˆ 약속`,"flow.analysis.title":`이 컴퓨터에 λ§žλŠ” Brain κ²½ν—˜μ„ ν™•μΈν•©λ‹ˆλ‹€.`,"flow.analysis.body":`μŠ€νŽ™ μ μˆ˜κ°€ μ•„λ‹ˆλΌ, 이 Macμ—μ„œ μ–΄λ–€ 둜컬 AI 브레인 κ²½ν—˜μ΄ νŽΈν•œμ§€ λ³΄μ—¬λ“œλ¦½λ‹ˆλ‹€. 확인은 둜컬 μƒνƒœλ₯Ό μ½λŠ” 것이고, ν΄λΌμš°λ“œ λͺ¨λΈμ€ 선택 μ‚¬ν•­μž…λ‹ˆλ‹€.`,"flow.analysis.finding":`κ°€μž₯ νŽΈν•œ 섀정을 μ°ΎλŠ” 쀑...`,"flow.analysis.ready":`μΆ”μ²œ λͺ¨λΈμ„ λ°”λ‘œ μ‹œμž‘ν•  수 있게 μ€€λΉ„ν–ˆμŠ΅λ‹ˆλ‹€.`,"flow.analysis.wait":`μž μ‹œλ§Œ 기닀리면 μžλ™μœΌλ‘œ μ •λ¦¬λ©λ‹ˆλ‹€.`,"flow.analysis.error":`Latticeκ°€ 이 컴퓨터λ₯Ό λκΉŒμ§€ ν™•μΈν•˜μ§€ λͺ»ν–ˆμŠ΅λ‹ˆλ‹€. κ·Έλž˜λ„ μ•ˆμ „ν•œ κΈ°λ³Έκ°’μœΌλ‘œ 계속할 수 μžˆμŠ΅λ‹ˆλ‹€.`,"flow.analysis.continue":`μΆ”μ²œ λͺ¨λΈ 보기`,"flow.analysis.bestFit":`{model}이 이 컴퓨터에 κ°€μž₯ 잘 λ§žμŠ΅λ‹ˆλ‹€.`,"flow.analysis.privateRecommended":`이 μ»΄ν“¨ν„°μ—λŠ” 개인 둜컬 Brain을 μΆ”μ²œν•©λ‹ˆλ‹€.`,"flow.analysis.os.windows":`Windows PC`,"flow.analysis.os.linux":`Linux 컴퓨터`,"flow.recommend.title":`μΆ”μ²œλŒ€λ‘œ μ‹œμž‘ν•˜μ„Έμš”.`,"flow.recommend.environment.apple":`컴퓨터 μ€€λΉ„ μ™„λ£Œ: 둜컬 MLX 지원(Apple Silicon, {ram}GB RAM 감지)`,"flow.recommend.environment.standard":`ꢌμž₯: κ°€λ²Όμš΄ 둜컬 λͺ¨λΈλ‘œ μ‹œμž‘ν•˜μ„Έμš”({ram}GB RAM 감지)`,"flow.recommend.body":`λͺ¨λΈμ€ Brain의 ν˜„μž¬ λͺ©μ†Œλ¦¬μž…λ‹ˆλ‹€. μΆ”μ²œ, λΉ λ₯Έ 선택, κ°•ν•œ μ„ νƒλ§Œ λ¨Όμ € λ³΄μ—¬λ“œλ € λ°”λ‘œ κ²°μ •ν•  수 있게 ν•©λ‹ˆλ‹€.`,"flow.recommend.primary":`μΆ”μ²œμœΌλ‘œ λ°”λ‘œ μ‹œμž‘`,"flow.recommend.unsupported":`이 μ»΄ν“¨ν„°μ—μ„œ μΆ”κ°€ 확인이 ν•„μš”ν•©λ‹ˆλ‹€`,"flow.recommend.back":`λ’€λ‘œ`,"flow.recommend.skip":`λͺ¨λΈ 없이 Brain μ—΄κΈ°`,"flow.recommend.hint":`잘 λͺ¨λ₯΄κ² λ‹€λ©΄ μΆ”μ²œλŒ€λ‘œ μ‹œμž‘ν•˜λ©΄ λ©λ‹ˆλ‹€.`,"flow.recommend.loading":`이 컴퓨터에 λ§žλŠ” λͺ¨λΈμ„ ν™•μΈν•˜λŠ” 쀑...`,"flow.recommend.unavailable.aria":`둜컬 λͺ¨λΈ μ€€λΉ„ μƒνƒœ`,"flow.recommend.unavailable.title":`μ§€κΈˆμ€ 이 μ»΄ν“¨ν„°μ—μ„œ λ°”λ‘œ μ“Έ 둜컬 λͺ¨λΈμ„ μ€€λΉ„ν•˜μ§€ λͺ»ν–ˆμŠ΅λ‹ˆλ‹€.`,"flow.recommend.unavailable.probe":`Latticeκ°€ 이 μ»΄ν“¨ν„°μ˜ 둜컬 ν™˜κ²½μ„ ν™•μΈν•˜μ§€ λͺ»ν–ˆμŠ΅λ‹ˆλ‹€. λ„€νŠΈμ›Œν¬μ™€ 둜컬 μ„œλΉ„μŠ€ μƒνƒœλ₯Ό ν™•μΈν•œ λ’€ λ‹€μ‹œ μ‹œλ„ν•΄ μ£Όμ„Έμš”.`,"flow.recommend.unavailable.empty":`이 μ»΄ν“¨ν„°μ—μ„œ λ°”λ‘œ μ‹€ν–‰ν•  수 μžˆλŠ” μΆ”μ²œ λͺ¨λΈμ„ μ°Ύμ§€ λͺ»ν–ˆμŠ΅λ‹ˆλ‹€. λ‹€μ‹œ ν™•μΈν•˜κ±°λ‚˜, λͺ¨λΈ 없이 Brain을 λ¨Όμ € μ—΄ 수 μžˆμŠ΅λ‹ˆλ‹€.`,"flow.recommend.unavailable.retry":`λ‹€μ‹œ 확인`,"flow.recommend.unavailable.hint":`λͺ¨λΈμ€ λ‚˜μ€‘μ— λΌμ΄λΈŒλŸ¬λ¦¬μ—μ„œ μ–Έμ œλ“  μΆ”κ°€ν•  수 μžˆμŠ΅λ‹ˆλ‹€.`,"flow.recommend.rank.best":`μΆ”μ²œ`,"flow.recommend.rank.faster":`λΉ λ₯Έ 선택`,"flow.recommend.rank.advanced":`κ³ κΈ‰ 선택`,"flow.recommend.rank.choice":`선택 {index}`,"flow.install.title":`λͺ¨λΈμ„ μ„€μΉ˜ν•˜κ³  μ‹œμž‘ν•©λ‹ˆλ‹€.`,"flow.install.title.ready":`λͺ¨λΈμ„ μ€€λΉ„ν•˜κ³  μ‹œμž‘ν•©λ‹ˆλ‹€.`,"flow.install.wait":`Brain이 μ‚¬μš©ν•  λͺ¨λΈμ„ 기닀리고 μžˆμŠ΅λ‹ˆλ‹€.`,"flow.install.prepare":`Brain μ€€λΉ„ μ€‘μž…λ‹ˆλ‹€.`,"flow.install.done":`Brain이 μ€€λΉ„λ˜μ—ˆμŠ΅λ‹ˆλ‹€.`,"flow.install.note":`큰 λͺ¨λΈμ€ λ‹€μš΄λ‘œλ“œμ— λͺ‡ λΆ„ 이상 걸릴 수 μžˆμŠ΅λ‹ˆλ‹€. μ§„ν–‰λ₯ μ€ λͺ¨λΈ λŸ°νƒ€μž„μ΄ μ•Œλ €μ£ΌλŠ” 만큼 ν‘œμ‹œν•˜κ³ , 멈좘 κ²ƒμ²˜λŸΌ 보여도 ν˜„μž¬ 단계가 μœ μ§€λ©λ‹ˆλ‹€.`,"flow.install.note.ready":`둜컬 응닡 확인은 보톡 잠깐이면 λλ‚©λ‹ˆλ‹€. μ‹€νŒ¨ν•˜λ©΄ λ‹€λ₯Έ λͺ¨λΈμ„ κ³ λ₯΄κ±°λ‚˜ λ‚˜μ€‘μ— λ‹€μ‹œ μ‹œλ„ν•  수 μžˆμŠ΅λ‹ˆλ‹€.`,"flow.install.retry":`λ‹€λ₯Έ λͺ¨λΈμ„ κ³ λ₯΄κ±°λ‚˜ λ‹€μ‹œ μ‹œλ„ν•  수 μžˆμŠ΅λ‹ˆλ‹€.`,"flow.install.back":`λ‹€λ₯Έ λͺ¨λΈ κ³ λ₯΄κΈ°`,"flow.install.start":`λ‹€μš΄λ‘œλ“œν•˜κ³  μ‹œμž‘ν•˜κΈ°`,"flow.install.startReady":`μ€€λΉ„ν•˜κ³  μ‹œμž‘ν•˜κΈ°`,"flow.install.busy":`λͺ¨λΈ μ€€λΉ„ 쀑...`,"flow.install.enter":`Brain으둜 λ“€μ–΄κ°€κΈ°`,"flow.install.later":`λ‚˜μ€‘μ— ν•˜κΈ°`,"flow.install.local":`λͺ¨λΈ λ‹€μš΄λ‘œλ“œμ™€ μ™ΈλΆ€ 톡신은 μ‚¬μš©μžκ°€ μ‹œμž‘ν•  λ•Œλ§Œ μ§„ν–‰λ©λ‹ˆλ‹€.`,"flow.install.local.ready":`이 선택은 μ™ΈλΆ€ λ‹€μš΄λ‘œλ“œ 없이 둜컬 μ€€λΉ„ μƒνƒœλ§Œ ν™•μΈν•©λ‹ˆλ‹€.`,"flow.consent.title":`λ‹€μš΄λ‘œλ“œ μ „ 확인`,"flow.consent.readyTitle":`둜컬 μ€€λΉ„ μƒνƒœ`,"flow.consent.body":`μ‹œμž‘ν•˜λ©΄ μ•„λž˜ λͺ¨λΈ νŒŒμΌμ„ μ™ΈλΆ€ μ €μž₯μ†Œμ—μ„œ λ°›μ•„ 이 컴퓨터에 μ €μž₯ν•©λ‹ˆλ‹€.`,"flow.consent.ready":`이미 μ€€λΉ„λœ λͺ¨λΈμž…λ‹ˆλ‹€. μ‹œμž‘ν•΄λ„ μ™ΈλΆ€ λ‹€μš΄λ‘œλ“œλ₯Ό μš”μ²­ν•˜μ§€ μ•Šκ³  λ‘œμ»¬μ—μ„œ 응닡 κ°€λŠ₯ μ—¬λΆ€λ§Œ ν™•μΈν•©λ‹ˆλ‹€.`,"flow.consent.state":`λ‹€μš΄λ‘œλ“œ ν•„μš”`,"flow.consent.stateReady":`μ—†μŒ`,"flow.consent.size":`λ‹€μš΄λ‘œλ“œ 크기`,"flow.consent.sizeUnknown":`λŸ°νƒ€μž„ 확인 ν›„ ν‘œμ‹œ`,"flow.consent.location":`μ €μž₯ μœ„μΉ˜`,"flow.consent.external":`μ™ΈλΆ€ 접속 λŒ€μƒ`,"flow.consent.externalUnknown":`λŸ°νƒ€μž„ 확인 ν›„ ν‘œμ‹œ`,"flow.consent.externalNone":`선택 μ „ μ™ΈλΆ€ 접속 μ—†μŒ`},en:{"flow.analysis.fact.computer":`Computer`,"flow.analysis.fact.memory":`Memory`,"flow.analysis.fact.graphics":`Graphics`,"flow.analysis.fact.support":`Local Support`,"flow.analysis.fact.models":`Models`,"flow.analysis.checking":`Checking`,"flow.analysis.fact.computerDetail":`Operating system and chip`,"flow.analysis.fact.memoryDetail":`Available room for local thinking`,"flow.analysis.fact.graphicsDetail":`Local acceleration support`,"flow.analysis.fact.supportDetail":`Installed model helpers`,"flow.analysis.fact.modelsDetail":`Installed local Brains`,"flow.analysis.apple":`Apple Silicon Mac`,"flow.analysis.detected":`Detected`,"flow.analysis.localReady":`Local acceleration ready`,"flow.analysis.standardLocal":`Standard local mode`,"flow.analysis.supportReady":`Ready`,"flow.analysis.supportInstall":`Will be prepared`,"flow.analysis.modelsInstalled":`{count} already installed`,"flow.analysis.noModels":`None installed yet`,"flow.analysis.readyDetail":`Ready for local Digital Brain use`,"flow.analysis.memoryReadyDetail":`Enough context for the recommended model`,"flow.analysis.graphicsReadyDetail":`Lattice will choose the best available path`,"flow.analysis.supportReadyDetail":`Installed model helpers detected`,"flow.analysis.supportInstallDetail":`Lattice will add what is needed`,"flow.analysis.modelsReadyDetail":`One can be loaded immediately`,"flow.analysis.modelsInstallDetail":`Lattice will guide the first install`,"flow.recommend.reason.best":`Best Experience`,"flow.recommend.reason.faster":`Faster`,"flow.recommend.reason.advanced":`Advanced`,"flow.recommend.reason.default":`Recommended`,"flow.recommend.sizeReady":`ready`,"flow.recommend.fallbackName":`Recommended Brain`,"flow.install.stage.idle":`Press the button below to start preparing.`,"flow.install.stage.install":`Starting to prepare your Brain.`,"flow.install.stage.download":`Getting the model files.`,"flow.install.stage.validate":`Checking that the Brain can answer.`,"flow.install.stage.load":`Loading the Brain.`,"flow.install.stage.done":`Your Brain is ready. Opening the conversation.`,"flow.install.stage.error":`Something needs attention.`,"flow.install.step.install":`Install`,"flow.install.step.download":`Download`,"flow.install.step.ready":`Local check`,"flow.install.step.validate":`Validate`,"flow.install.step.load":`Load`,"flow.analysis.hardware.icon.chip":`πŸ–₯️`,"flow.analysis.hardware.icon.ram":`🧠`,"flow.analysis.hardware.icon.gpu":`⚑`,"flow.analysis.hardware.icon.support":`🧩`,"flow.analysis.hardware.icon.models":`πŸ“¦`,"flow.analysis.hardware.label.chip":`Computer (operating system and chip)`,"flow.analysis.hardware.label.ram":`Memory (working space to think, RAM)`,"flow.analysis.hardware.label.gpu":`Graphics (the GPU that speeds up math)`,"flow.analysis.hardware.label.support":`Local support (helpers that run models)`,"flow.analysis.hardware.label.models":`Models (AI Brains already installed)`,"flow.recommend.timeEstimate":`Download about {download} Β· first reply about {response}s`,"flow.recommend.timeEstimate.ready":`No download needed Β· first reply about {response}s`,"flow.recommend.timeEstimate.unknown":`Download time unknown Β· first reply about {response}s`,"flow.recommend.timeNote":`Actual time depends on your network speed.`,"flow.recommend.alternatives":`Other options`,"flow.recommend.minutes":`{count} min`,"flow.recommend.comparison.faster":`(faster)`,"flow.recommend.comparison.advanced":`(more capable)`,"flow.recommend.choose":`Choose this model`,"flow.recommend.primaryNote":`Ready to use in about {time}`,"flow.recommend.primaryNote.ready":`Ready with no download`,"flow.recommend.primaryNote.unknown":`Ready after download time is confirmed`,"flow.recommend.nextHint":`Choosing takes you to download and setup, then your Brain opens automatically.`,"flow.recommend.nextHint.ready":`Choosing takes you to a readiness check, then your Brain opens automatically.`,"flow.install.expectedTitle":`What to expect`,"flow.install.expected":`About {download} to download, then a first reply within about {response}s`,"flow.install.expected.ready":`No download β€” first reply within about {response}s`,"flow.install.expected.unknown":`After download, a first reply within about {response}s`,"flow.install.timelineStep.download":`Download model`,"flow.install.timelineStep.ready":`Check local model`,"flow.install.timelineStep.validate":`Check the reply`,"flow.install.timelineStep.load":`Load into Brain`,"flow.install.timelineApprox":`about {time}`,"flow.install.timelineQuick":`moment`,"flow.install.expectedCompletion":`When it finishes, your Brain opens right away.`,"flow.shell":`Create your local AI Brain`,"flow.wake.aria":`Wake your Brain`,"flow.wake.title":`Start the Brain where your knowledge comes alive.`,"flow.wake.body":`Lattice AI turns your conversations, documents, and decisions into durable working memory on this computer. Models can change while your Brain remains yours.`,"flow.wake.value.aria":`Brain startup value`,"flow.wake.value.local.k":`Fully local`,"flow.wake.value.local.v":`Knowledge and conversations are organized on this computer first.`,"flow.wake.value.instant.k":`Clear start`,"flow.wake.value.instant.v":`Open the first conversation in three guided steps.`,"flow.wake.value.brain.k":`Durable Brain`,"flow.wake.value.brain.v":`Your memories and graph continue even when models change.`,"flow.wake.plan.aria":`Brain start steps`,"flow.wake.step.identity":`Confirm owner`,"flow.wake.step.check":`Check computer`,"flow.wake.step.voice":`Choose voice`,"flow.wake.primary":`Wake Brain`,"flow.wake.existing":`Open existing Brain`,"flow.wake.startNote":`First conversation in about 2 minutes Β· local-first Β· user controlled`,"flow.login.title":`Choose the owner of this Brain.`,"flow.login.statement":`Creates a memory system that lives only on this computer.`,"flow.login.body":`Decide who owns the memory on this computer. If a Brain already exists here, Lattice checks safely before creating anything new.`,"flow.name":`Name`,"flow.name.placeholder":`You`,"flow.email":`Email`,"flow.email.placeholder":`you@local`,"flow.password":`Password`,"flow.password.placeholder":`Local Brain password`,"flow.login.busy":`Opening Brain...`,"flow.login.submit":`Start my Brain`,"flow.login.note":`This profile owns your AI Brain. If the email differs from this computer's Brain, Lattice checks before creating anything new.`,"flow.login.passwordLocal":`This password is only for the Brain on this computer. It is not sent to the cloud.`,"flow.login.missing":`Enter your name, email, and password so Lattice can safely check your Brain.`,"flow.login.otherEmail":`This email differs from the Brain on this computer. Please check for a typo.`,"flow.login.wrongPassword":`The email matches this Brain, but the password is different. Please check it again.`,"flow.login.unavailable":`Could not open the local profile. Check your email and password.`,"flow.promise.memory.k":`Durable knowledge`,"flow.promise.memory.v":`Your work becomes long-term memory.`,"flow.promise.model.k":`Replaceable models`,"flow.promise.model.v":`The model is the voice; the Brain is the asset.`,"flow.promise.ownership.k":`User owned`,"flow.promise.ownership.v":`You decide when to back up, restore, or move it.`,"flow.promise.aria":`Lattice AI product promise`,"flow.analysis.title":`Checking the Brain experience for this computer.`,"flow.analysis.body":`This is not a spec score. Lattice reads local capability and explains which local AI Brain experience will feel comfortable on this Mac. Cloud models remain optional.`,"flow.analysis.finding":`Finding the easiest setup...`,"flow.analysis.ready":`Your recommended model is ready to start.`,"flow.analysis.wait":`This will be summarized automatically in a moment.`,"flow.analysis.error":`Lattice could not finish checking this computer. You can still continue with a safe default.`,"flow.analysis.continue":`View recommended models`,"flow.analysis.bestFit":`{model} looks like the best fit.`,"flow.analysis.privateRecommended":`A private local Brain is recommended for this computer.`,"flow.analysis.os.windows":`Windows PC`,"flow.analysis.os.linux":`Linux computer`,"flow.recommend.title":`Start with the recommendation.`,"flow.recommend.environment.apple":`Computer ready: local MLX supported (Apple Silicon, {ram}GB RAM detected)`,"flow.recommend.environment.standard":`Recommended: start with a lighter local model ({ram}GB RAM detected)`,"flow.recommend.body":`The model is your Brain's current voice. Lattice shows the recommendation, a faster choice, and a stronger choice first so you can decide quickly.`,"flow.recommend.primary":`Start with recommendation`,"flow.recommend.unsupported":`This computer needs one more check`,"flow.recommend.back":`Back`,"flow.recommend.skip":`Open Brain without a model`,"flow.recommend.hint":`If unsure, start with the recommendation.`,"flow.recommend.loading":`Checking which model fits this computer...`,"flow.recommend.unavailable.aria":`Local model readiness`,"flow.recommend.unavailable.title":`A local model isn't ready to run on this computer yet.`,"flow.recommend.unavailable.probe":`Lattice couldn't check this computer's local environment. Check your network and local services, then try again.`,"flow.recommend.unavailable.empty":`No recommended model can run on this computer right now. Try checking again, or open your Brain without a model first.`,"flow.recommend.unavailable.retry":`Check again`,"flow.recommend.unavailable.hint":`You can add a model anytime later from the library.`,"flow.recommend.rank.best":`Best Experience`,"flow.recommend.rank.faster":`Faster`,"flow.recommend.rank.advanced":`Advanced`,"flow.recommend.rank.choice":`Choice {index}`,"flow.install.title":`Install the model and start.`,"flow.install.title.ready":`Prepare the model and start.`,"flow.install.wait":`Waiting for the model your Brain will use.`,"flow.install.prepare":`Preparing your Brain.`,"flow.install.done":`Your Brain is ready.`,"flow.install.note":`Large models can take several minutes to download. Progress is shown when the model runtime reports it; a steady stage still means work is continuing.`,"flow.install.note.ready":`The local reply check usually takes a moment. If it fails, choose another model or try again later.`,"flow.install.retry":`Choose another model or try again.`,"flow.install.back":`Choose another model`,"flow.install.start":`Download and start`,"flow.install.startReady":`Check and start`,"flow.install.busy":`Preparing model...`,"flow.install.enter":`Enter Brain`,"flow.install.later":`Do later`,"flow.install.local":`Downloads and external communication start only when you choose them.`,"flow.install.local.ready":`This choice checks local readiness without starting an external download.`,"flow.consent.title":`Before downloading`,"flow.consent.readyTitle":`Local readiness`,"flow.consent.body":`Starting will fetch these model files from an external repository and store them on this computer.`,"flow.consent.ready":`This model is already ready. Starting checks whether it can answer locally without requesting an external download.`,"flow.consent.state":`Download needed`,"flow.consent.stateReady":`No`,"flow.consent.size":`Download size`,"flow.consent.sizeUnknown":`Reported by runtime`,"flow.consent.location":`Storage location`,"flow.consent.external":`External target`,"flow.consent.externalUnknown":`Reported by runtime`,"flow.consent.externalNone":`No external connection before selection`}});function ee(e){let t=k(e?.models),n=[...s(t.recommended),...s(t.catalog)],r=k(e?.recommendations?.recommendations),i=s(r.models),a=k(r.top_pick),o=new Map;for(let e of[...i,...n]){let t=String(e.id||e.model_id||e.recommended_load_id||``);t&&o.set(t,{...o.get(t)||{},...e})}a.id&&!o.has(String(a.id))&&o.set(String(a.id),a);let c=Array.from(o.values()).map(w).filter(e=>e.id),l=c.filter(e=>e.supported),u=l.length?l:c,d=(e=>u.find(t=>t.id===String(e)))(a.id)||(e=>u.find(t=>e.test(`${t.name} ${t.id}`)))(/gemma.*12|12b/i)||u[0],f=d?.id,p=u.find(e=>e.id!==f&&/qwen|8b|7b/i.test(`${e.name} ${e.id}`))||u.find(e=>e.id!==f),m=p?.id,h=u.find(e=>e.id!==f&&e.id!==m&&/26b|32b|70b|advanced/i.test(`${e.name} ${e.id}`))||u.find(e=>e.id!==f&&e.id!==m);return[d?{...d,role:`best`,reason:d.reason||`best`}:null,p?{...p,role:`faster`,reason:p.reason||`faster`}:null,h?{...h,role:`advanced`,reason:h.reason||`advanced`}:null].filter(Boolean)}function te(e){let{analysis:t,endpoints:n}=e;if(!n)return{status:`loading`,recommendations:[],reason:null,failedEndpoints:[]};let r=Object.keys(n).filter(e=>!n[e]);if(!(n.recommendations||n.models))return{status:`unavailable`,recommendations:[],reason:`probe_failed`,failedEndpoints:r};let i=ee(t).filter(e=>e.supported);return i.length?{status:`ready`,recommendations:i,reason:null,failedEndpoints:r}:{status:`unavailable`,recommendations:[],reason:`no_supported_model`,failedEndpoints:r}}function ne(){return{id:`mlx-community/Qwen3-VL-8B-Instruct-4bit`,loadId:`mlx-community/Qwen3-VL-8B-Instruct-4bit`,engine:`local_mlx`,name:`Qwen3-VL 8B`,shortName:`Qwen 3`,family:`Qwen 3`,size:``,role:`best`,reason:`best`,supported:!0,downloadRequired:!1,downloadSize:``,storageLocation:`~/.latticeai/models`,externalHost:``,estimatedDownloadMinutes:0,estimatedFirstResponseSeconds:5,parameterBillions:8}}function w(e){let t=k(e.runtime_compatibility),n=String(e.id||e.model_id||e.recommended_load_id||``),r=String(e.recommended_load_id||e.load_id||n),i=String(e.display_name||e.name||n||`recommended_brain`),a=e.load_status!==`unsupported`&&e.load_status!==`runtime_update_needed`&&e.status!==`not_recommended`&&t.supported!==!1,o=!!e.download_required,s=o?String(e.download_size||e.size||``):``,c=D(`${i} ${n}`);return{id:n,loadId:r,engine:String(e.recommended_engine||e.engine||`local_mlx`),name:i,shortName:O(i),family:O(String(e.family||i)),size:String(e.size||``),role:`best`,reason:String(e.reason||``),supported:a,downloadRequired:o,downloadSize:s,storageLocation:String(e.storage_location||e.local_path||`~/.latticeai/models`),externalHost:o?ie(e):``,estimatedDownloadMinutes:o?E(s):0,estimatedFirstResponseSeconds:re(c),parameterBillions:c}}function T(e){let t=String(e||``).match(/([\d.]+)\s*(t|g|m)?b?/i);if(!t)return null;let n=Number(t[1]);if(!Number.isFinite(n)||n<=0)return null;let r=(t[2]||`g`).toLowerCase();return r===`t`?n*1024*1024:r===`m`?n:n*1024}function E(e){let t=T(e);if(t===null)return null;let n=t/(15/8)/60;return Math.max(1,Math.round(n))}function D(e){let t=String(e||``).match(/(\d{1,3}(?:\.\d)?)\s*b\b/i);if(!t)return null;let n=Number(t[1]);return n>0?n:null}function re(e){return e===null?8:e<=9?5:e<=16?10:e<=40?18:30}function ie(e){let t=String(e.source_url||e.download_url||e.repository||e.provider||e.id||``);return t?/huggingface|hf\\.co|mlx-community/i.test(t)?`huggingface`:/ollama/i.test(t)?`ollama`:t.replace(/^https?:\/\//,``).split(`/`)[0]||t:``}function O(e){return String(e||`recommended_brain`).replace(/^mlx-community\//i,``).replace(/[-_]?Instruct/gi,``).replace(/[-_]?4bit/gi,``).replace(/Qwen3[-_ ]?VL/gi,`Qwen 3`).replace(/Qwen3/gi,`Qwen 3`).replace(/Gemma[-_ ]?4/gi,`Gemma 4`).replace(/A4B/gi,``).replace(/[-_]+/g,` `).replace(/\s+/g,` `).trim()}function k(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}var A=n();function ae({model:e}){let t=c(e=>e.language),n=e.downloadRequired?[{label:a(t,`flow.consent.size`),value:e.downloadSize||a(t,`flow.consent.sizeUnknown`)},{label:a(t,`flow.consent.location`),value:e.storageLocation},{label:a(t,`flow.consent.external`),value:e.externalHost||a(t,`flow.consent.externalUnknown`)}]:[{label:a(t,`flow.consent.state`),value:a(t,`flow.consent.stateReady`)},{label:a(t,`flow.consent.location`),value:e.storageLocation},{label:a(t,`flow.consent.external`),value:a(t,`flow.consent.externalNone`)}],r=e.downloadRequired?`flow.consent.title`:`flow.consent.readyTitle`;return(0,A.jsxs)(`section`,{className:`ritual-consent-panel`,"aria-label":a(t,r),children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`strong`,{children:a(t,r)}),(0,A.jsx)(`p`,{children:e.downloadRequired?a(t,`flow.consent.body`):a(t,`flow.consent.ready`)})]}),(0,A.jsx)(`dl`,{children:n.map(e=>(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{children:e.label}),(0,A.jsx)(`dd`,{children:e.value})]},e.label))})]})}function j({model:e,onBack:t,onComplete:n,onLater:i}){let o=c(e=>e.language),s=c(e=>e.mode),[l,u]=C.useState(!1),[d,f]=C.useState(`idle`),[m,h]=C.useState(0),[g,_]=C.useState(a(o,`flow.install.wait`)),[y,b]=C.useState(null),x=a(o,`flow.install.stage.${d}`,{defaultValue:g});async function S(){u(!0),b(null),f(`install`),h(8),_(a(o,`flow.install.prepare`));let t=await r.streamModelPrepare({model:e.loadId,engine:e.engine||`local_mlx`,allow_download:e.downloadRequired},{onProgress:e=>{let t=P(String(e.stage||``));f(t),h(Number(e.percent||F(t))),_(I(e,t,o))},onDone:()=>{f(`done`),h(100),_(a(o,`flow.install.done`))},onError:e=>{f(`error`),b(B(e))}});u(!1),t.ok?(f(`done`),h(100),_(a(o,`flow.install.done`)),window.setTimeout(n,700)):(f(`error`),b(B(t.data)))}return(0,A.jsxs)(`div`,{className:`ritual-install`,children:[(0,A.jsxs)(`header`,{children:[(0,A.jsx)(`h1`,{className:`ritual-title`,children:a(o,e.downloadRequired?`flow.install.title`:`flow.install.title.ready`)}),(0,A.jsxs)(`p`,{className:`ritual-subtitle`,children:[(0,A.jsx)(`strong`,{children:e.shortName}),` β€” `,e.reason,`.`]})]}),(0,A.jsxs)(`section`,{className:`ritual-card ritual-install-progress-unit`,"aria-label":x,children:[(0,A.jsxs)(`div`,{className:`ritual-progress w-full`,children:[(0,A.jsx)(`div`,{className:`ritual-stage-list`,children:[`install`,`download`,`load`,`validate`].map(t=>(0,A.jsxs)(`div`,{className:`ritual-stage ${z(d,t)}`,children:[(0,A.jsx)(p,{className:`ritual-stage-icon`}),(0,A.jsx)(`span`,{children:L(t,o,e)})]},t))}),(0,A.jsx)(`div`,{className:`ritual-bar`,children:(0,A.jsx)(`span`,{className:`ritual-bar-fill ${R(m)}`})})]}),(0,A.jsxs)(`div`,{className:`ritual-status`,children:[x,s===`advanced`&&g!==x?(0,A.jsx)(`span`,{className:`ritual-status-raw block text-xs opacity-70 mt-1`,children:g}):null]})]}),y&&(0,A.jsxs)(`div`,{className:`ritual-card ritual-error-card ritual-install-error`,role:`alert`,children:[y,(0,A.jsx)(`div`,{className:`ritual-error-detail`,children:a(o,`flow.install.retry`)})]}),(0,A.jsxs)(`details`,{className:`ritual-install-details`,children:[(0,A.jsxs)(`summary`,{className:`cursor-pointer py-2 text-sm text-muted-foreground hover:text-foreground`,children:[a(o,`flow.install.expectedTitle`),` & `,a(o,`flow.consent.readyTitle`)]}),(0,A.jsxs)(`div`,{className:`ritual-install-details-content flex flex-col gap-3 py-2`,children:[(0,A.jsxs)(`section`,{className:`ritual-card ritual-expected-card`,"aria-label":a(o,`flow.install.expectedTitle`),children:[(0,A.jsx)(`div`,{className:`ritual-fact-label`,children:a(o,`flow.install.expectedTitle`)}),(0,A.jsx)(`div`,{className:`ritual-time-estimate ritual-expected-line`,children:M(e,o)}),(0,A.jsx)(`ol`,{className:`ritual-timeline`,children:N(e,o).map(e=>(0,A.jsxs)(`li`,{className:`ritual-timeline-step`,children:[(0,A.jsx)(`span`,{className:`ritual-timeline-name`,children:e.name}),(0,A.jsx)(`span`,{className:`ritual-timeline-time`,children:e.time})]},e.key))}),(0,A.jsx)(`div`,{className:`ritual-muted-hint`,children:a(o,`flow.install.expectedCompletion`)})]}),(0,A.jsx)(ae,{model:e}),(0,A.jsx)(`div`,{className:`ritual-card ritual-status-card`,children:a(o,e.downloadRequired?`flow.install.note`:`flow.install.note.ready`)}),(0,A.jsx)(`div`,{className:`ritual-local-note`,children:a(o,e.downloadRequired?`flow.install.local`:`flow.install.local.ready`)})]})]}),(0,A.jsxs)(`div`,{className:`ritual-button-row`,children:[(0,A.jsx)(v,{variant:`ghost`,onClick:t,disabled:l,children:a(o,`flow.install.back`)}),(0,A.jsx)(v,{variant:`outline`,onClick:i,disabled:l,children:a(o,`flow.install.later`)}),d===`done`?(0,A.jsx)(v,{onClick:n,children:a(o,`flow.install.enter`)}):(0,A.jsx)(v,{onClick:S,disabled:l||!e.supported,children:l?a(o,`flow.install.busy`):a(o,e.downloadRequired?`flow.install.start`:`flow.install.startReady`)})]})]})}function M(e,t){let n=e.estimatedFirstResponseSeconds;return!e.downloadRequired||e.estimatedDownloadMinutes===0?a(t,`flow.install.expected.ready`,{response:n}):e.estimatedDownloadMinutes===null?a(t,`flow.install.expected.unknown`,{response:n}):a(t,`flow.install.expected`,{download:a(t,`flow.recommend.minutes`,{count:e.estimatedDownloadMinutes}),response:n})}function N(e,t){let n=e.downloadRequired&&e.estimatedDownloadMinutes?a(t,`flow.install.timelineApprox`,{time:a(t,`flow.recommend.minutes`,{count:e.estimatedDownloadMinutes})}):a(t,`flow.install.timelineQuick`);return[{key:`download`,name:a(t,e.downloadRequired?`flow.install.timelineStep.download`:`flow.install.timelineStep.ready`),time:n},{key:`validate`,name:a(t,`flow.install.timelineStep.validate`),time:a(t,`flow.install.timelineQuick`)},{key:`load`,name:a(t,`flow.install.timelineStep.load`),time:a(t,`flow.install.timelineApprox`,{time:`${e.estimatedFirstResponseSeconds}s`})}]}function P(e){return/download|pull|weights/i.test(e)?`download`:/smoke|validate|verify|test/i.test(e)?`validate`:/load|ready/i.test(e)?`load`:/done|complete/i.test(e)?`done`:`install`}function F(e){return e===`install`?20:e===`download`?55:e===`load`?82:e===`validate`?94:e===`done`?100:8}function I(e,t,n){let r={install:a(n,`flow.install.prepare`),download:a(n,`flow.install.stage.download`),validate:a(n,`flow.install.stage.validate`),load:a(n,`flow.install.stage.load`),done:a(n,`flow.install.done`),idle:a(n,`flow.install.wait`),error:a(n,`flow.install.stage.error`)}[t];return V(String(e.user_message||e.message||r))}function L(e,t,n){return e===`download`&&!n.downloadRequired?a(t,`flow.install.step.ready`):a(t,`flow.install.step.${e}`)}function R(e){return`progress-${Math.max(0,Math.min(100,Math.round(e/10)*10))}`}function z(e,t){let n=[`idle`,`install`,`download`,`load`,`validate`,`done`],r=n.indexOf(e),i=n.indexOf(t);return e===`error`?`is-error`:e===`done`||r>i?`is-done`:e===t?`is-active`:``}function B(e){let t=k(e),n=s(t.recovery_guidance).map(V).filter(Boolean);return[V(String(t.user_message||t.reason||t.error||`The selected model could not be loaded.`)),...n.slice(0,2)].join(` `)}function V(e){return String(e||``).replace(/gemma4_unified/gi,`this model format`).replace(/mlx[-_ ]?vlm|mlx[-_ ]?lm|local_mlx|\bmlx\b|\bgguf\b|\bollama\b|huggingface|hugging face/gi,`local model support`).replace(/runtime/gi,`model support`).replace(/No module named ['\"][^'\"]+['\"]/gi,`A local support component is missing`).replace(/\s+/g,` `).trim()}function H(){let e=c(e=>e.language),t=c(e=>e.setLanguage);return(0,A.jsx)(`div`,{className:`language-switcher ritual-language`,"aria-label":a(e,`language.label`),children:[`ko`,`en`].map(n=>(0,A.jsx)(`button`,{type:`button`,className:e===n?`is-active`:``,onClick:()=>t(n),"aria-pressed":e===n,children:o[n]},n))})}var U=`lattice.productFlow.user`;function W(){try{let e=localStorage.getItem(U);return e?JSON.parse(e):null}catch{}return null}function G({onSuccess:e}){let t=c(e=>e.language),[n,i]=C.useState(()=>W()?.email||`you@local`),[o,s]=C.useState(``),[l,u]=C.useState(()=>W()?.name||`You`),[d,f]=C.useState(!1),[p,h]=C.useState(null);async function g(i){i.preventDefault();let s=n.trim(),c=o.trim(),u=l.trim()||s.split(`@`)[0]||`You`;if(!s||!c){h(a(t,`flow.login.missing`));return}f(!0),h(null);let d=W(),p=await r.login(s,c);if(!p.ok){if((await r.profile()).ok&&(!d?.email||d.email===s)){try{localStorage.setItem(U,JSON.stringify({email:s,name:u}))}catch{}f(!1),e();return}if(d?.email&&d.email!==s){f(!1),h(a(t,`flow.login.otherEmail`));return}if(d?.email===s){f(!1),h(a(t,`flow.login.wrongPassword`));return}(await r.register({email:s,password:c,name:u,nickname:u})).ok&&(p=await r.login(s,c))}if(!p.ok){f(!1),h(a(t,`flow.login.unavailable`));return}try{localStorage.setItem(U,JSON.stringify({email:s,name:u}))}catch{}f(!1),e()}return(0,A.jsx)(`div`,{className:`ritual-login`,children:(0,A.jsxs)(`div`,{className:`ritual-login-grid`,children:[(0,A.jsxs)(`div`,{className:`ritual-login-left`,children:[(0,A.jsx)(`p`,{className:`ritual-login-statement`,children:a(t,`flow.login.statement`)}),(0,A.jsx)(K,{})]}),(0,A.jsxs)(`div`,{className:`ritual-login-right`,children:[(0,A.jsxs)(`header`,{children:[(0,A.jsx)(`h1`,{id:`login-title`,className:`ritual-title`,children:a(t,`flow.login.title`)}),(0,A.jsx)(`p`,{className:`ritual-subtitle`,children:a(t,`flow.login.body`)})]}),(0,A.jsx)(`div`,{className:`ritual-login-card`,children:(0,A.jsxs)(`form`,{onSubmit:g,className:`ritual-form`,"aria-labelledby":`login-title`,children:[(0,A.jsxs)(`div`,{className:`ritual-field-stack`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`login-name`,className:`ritual-field-label`,children:a(t,`flow.name`)}),(0,A.jsx)(m,{id:`login-name`,value:l,onChange:e=>u(e.target.value),placeholder:a(t,`flow.name.placeholder`),autoComplete:`name`})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`login-email`,className:`ritual-field-label`,children:a(t,`flow.email`)}),(0,A.jsx)(m,{id:`login-email`,value:n,onChange:e=>i(e.target.value),type:`email`,placeholder:a(t,`flow.email.placeholder`),autoComplete:`email`,required:!0,"aria-invalid":p?!0:void 0,"aria-describedby":p?`login-error`:void 0})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`login-password`,className:`ritual-field-label`,children:a(t,`flow.password`)}),(0,A.jsx)(m,{id:`login-password`,value:o,onChange:e=>s(e.target.value),type:`password`,placeholder:a(t,`flow.password.placeholder`),autoComplete:`current-password`,required:!0,"aria-invalid":p?!0:void 0,"aria-describedby":p?`login-error`:void 0})]})]}),p&&(0,A.jsx)(`div`,{id:`login-error`,className:`ritual-error`,role:`alert`,children:p}),(0,A.jsx)(v,{type:`submit`,disabled:d||!n.trim()||!o.trim(),className:`ritual-full-button`,children:d?a(t,`flow.login.busy`):a(t,`flow.login.submit`)}),(0,A.jsxs)(`div`,{className:`ritual-login-footnotes`,children:[(0,A.jsx)(`div`,{className:`ritual-muted-hint`,children:a(t,`flow.login.passwordLocal`)}),(0,A.jsx)(`div`,{className:`ritual-note`,children:a(t,`flow.login.note`)})]})]})})]})]})})}function K(){let e=c(e=>e.language);return(0,A.jsxs)(`aside`,{className:`ritual-promise is-quiet`,"aria-label":a(e,`flow.promise.aria`),children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{children:a(e,`flow.promise.memory.k`)}),(0,A.jsx)(`strong`,{children:a(e,`flow.promise.memory.v`)})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{children:a(e,`flow.promise.model.k`)}),(0,A.jsx)(`strong`,{children:a(e,`flow.promise.model.v`)})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{children:a(e,`flow.promise.ownership.k`)}),(0,A.jsx)(`strong`,{children:a(e,`flow.promise.ownership.v`)})]})]})}function q({status:e,reason:t,recommendations:n,analysis:r,onBack:i,onRetry:o,onSkipModel:s,onSelect:l}){let f=c(e=>e.language);if(e===`loading`)return(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`div`,{className:`ritual-title`,children:a(f,`flow.recommend.title`)}),(0,A.jsx)(`div`,{className:`ritual-subtitle`,children:a(f,`flow.recommend.body`)}),(0,A.jsxs)(`div`,{className:`ritual-scan-banner is-loading`,role:`status`,children:[(0,A.jsx)(`span`,{className:`ritual-scan-dot pulsing`}),(0,A.jsx)(`span`,{children:a(f,`flow.recommend.loading`)})]}),(0,A.jsxs)(`div`,{className:`ritual-action-row`,children:[(0,A.jsx)(v,{variant:`ghost`,onClick:i,children:a(f,`flow.recommend.back`)}),(0,A.jsx)(v,{variant:`outline`,onClick:s,children:a(f,`flow.recommend.skip`)})]})]});if(e===`unavailable`){let e=t===`no_supported_model`?`flow.recommend.unavailable.empty`:`flow.recommend.unavailable.probe`;return(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`div`,{className:`ritual-title`,children:a(f,`flow.recommend.title`)}),(0,A.jsx)(`section`,{className:`ritual-card ritual-error-card ritual-unavailable-card`,role:`alert`,"aria-label":a(f,`flow.recommend.unavailable.aria`),children:(0,A.jsxs)(`div`,{className:`ritual-inline-row`,children:[(0,A.jsx)(g,{className:`ritual-core-icon`,"aria-hidden":`true`}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`div`,{className:`ritual-strong-text`,children:a(f,`flow.recommend.unavailable.title`)}),(0,A.jsx)(`div`,{className:`ritual-muted-text`,children:a(f,e)})]})]})}),(0,A.jsxs)(`div`,{className:`ritual-button-row ritual-button-row-primary`,children:[(0,A.jsxs)(`button`,{type:`button`,className:`ritual-full-button ritual-full-button-primary`,onClick:o,children:[(0,A.jsx)(d,{size:16}),` `,a(f,`flow.recommend.unavailable.retry`)]}),(0,A.jsx)(`button`,{type:`button`,className:`ritual-secondary-button`,onClick:s,children:a(f,`flow.recommend.skip`)})]}),(0,A.jsxs)(`div`,{className:`ritual-action-row`,children:[(0,A.jsx)(v,{variant:`ghost`,onClick:i,children:a(f,`flow.recommend.back`)}),(0,A.jsx)(`div`,{className:`ritual-muted-hint`,children:a(f,`flow.recommend.unavailable.hint`)})]})]})}let p=n;function m(e,t){if(!e)return(0,A.jsxs)(`div`,{className:`ritual-scan-banner is-loading`,children:[(0,A.jsx)(`span`,{className:`ritual-scan-dot pulsing`}),(0,A.jsx)(`span`,{children:a(t,`flow.analysis.checking`)})]});let n=k(e.recommendations?.recommendations),r=k(e.setup?.environment),i=k(e.recommendations?.profile),o={...r,...i},s=Number(n.ram_gb||Number(o.ram_mb||0)/1024||0);return n.apple_silicon||String(o.arch||``).includes(`arm`)?(0,A.jsxs)(`div`,{className:`ritual-scan-banner is-success`,children:[(0,A.jsx)(`span`,{className:`ritual-scan-dot is-success`}),(0,A.jsx)(`span`,{children:a(t,`flow.recommend.environment.apple`,{ram:Math.round(s)})})]}):(0,A.jsxs)(`div`,{className:`ritual-scan-banner is-warning`,children:[(0,A.jsx)(`span`,{className:`ritual-scan-dot is-warning`}),(0,A.jsx)(`span`,{children:a(t,`flow.recommend.environment.standard`,{ram:Math.round(s)})})]})}return(0,A.jsxs)(`div`,{className:`ritual-recommend`,children:[(0,A.jsxs)(`header`,{children:[(0,A.jsx)(`h1`,{className:`ritual-title`,children:a(f,`flow.recommend.title`)}),(0,A.jsx)(`p`,{className:`ritual-subtitle`,children:a(f,`flow.recommend.body`)}),(0,A.jsx)(`div`,{className:`ritual-env-line`,children:m(r,f)})]}),p[0]?(0,A.jsxs)(`section`,{className:`ritual-primary-hero-card`,"aria-labelledby":`recommend-primary-name`,children:[(0,A.jsxs)(`div`,{className:`ritual-hero-topline`,children:[(0,A.jsxs)(`span`,{className:`ritual-hero-rank`,children:[(0,A.jsx)(x,{size:16,"aria-hidden":`true`}),Z(p[0].role,0,f)]}),(0,A.jsx)(`span`,{className:`ritual-hero-size`,children:p[0].size||a(f,`flow.recommend.sizeReady`)})]}),(0,A.jsx)(`h2`,{id:`recommend-primary-name`,className:`ritual-hero-name`,children:p[0].shortName}),(0,A.jsxs)(`p`,{className:`ritual-hero-reason`,children:[p[0].reason,X(p[0].role,f)?(0,A.jsxs)(`span`,{className:`ritual-model-comparison`,children:[` `,X(p[0].role,f)]}):null]}),(0,A.jsxs)(`p`,{className:`ritual-hero-time`,children:[(0,A.jsx)(`span`,{className:`ritual-time-estimate`,children:Y(p[0],f)}),(0,A.jsx)(`span`,{className:`ritual-time-note`,children:a(f,`flow.recommend.timeNote`)})]}),p[0].supported?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(v,{onClick:()=>l(p[0]),className:`ritual-primary-model-button`,children:[a(f,`flow.recommend.primary`),` `,(0,A.jsx)(u,{size:18,"aria-hidden":`true`})]}),(0,A.jsxs)(`p`,{className:`ritual-hero-next`,children:[oe(p[0],f),` Β· `,a(f,p[0].downloadRequired?`flow.recommend.nextHint`:`flow.recommend.nextHint.ready`)]})]}):(0,A.jsx)(`p`,{className:`ritual-model-warning`,children:a(f,`flow.recommend.unsupported`)})]}):null,p.length>1?(0,A.jsxs)(`details`,{className:`ritual-alternatives-details`,children:[(0,A.jsx)(`summary`,{id:`recommend-alternatives`,className:`ritual-alternatives-title cursor-pointer`,children:(0,A.jsx)(`h2`,{className:`inline text-sm font-semibold`,children:a(f,`flow.recommend.alternatives`)})}),(0,A.jsx)(`div`,{className:`ritual-alt-list`,children:p.slice(1,3).map((e,t)=>{let n=e.role===`faster`?S:y;return(0,A.jsxs)(`button`,{type:`button`,className:`ritual-model-card is-compact`,onClick:()=>e.supported&&l(e),disabled:!e.supported,children:[(0,A.jsxs)(`span`,{className:`ritual-model-heading`,children:[(0,A.jsx)(n,{size:15,"aria-hidden":`true`}),(0,A.jsx)(`span`,{className:`role`,children:Z(e.role,t+1,f)}),(0,A.jsx)(`span`,{className:`ritual-alt-size`,children:e.size||a(f,`flow.recommend.sizeReady`)})]}),(0,A.jsx)(`span`,{className:`name`,children:e.shortName}),(0,A.jsx)(`span`,{className:`reason`,children:e.reason}),(0,A.jsxs)(`span`,{className:`ritual-alt-footer`,children:[(0,A.jsx)(`span`,{className:`ritual-time-estimate`,children:Y(e,f)}),e.supported?(0,A.jsxs)(`span`,{className:`ritual-model-choose`,children:[a(f,`flow.recommend.choose`),` `,(0,A.jsx)(u,{size:14,"aria-hidden":`true`})]}):(0,A.jsx)(`span`,{className:`ritual-model-warning`,children:a(f,`flow.recommend.unsupported`)})]})]},`${e.role}-${e.id}`)})})]}):null,(0,A.jsxs)(`footer`,{className:`ritual-action-row is-split`,children:[(0,A.jsx)(v,{variant:`ghost`,onClick:i,children:a(f,`flow.recommend.back`)}),(0,A.jsxs)(`span`,{className:`ritual-action-tail`,children:[(0,A.jsx)(`span`,{className:`ritual-muted-hint`,children:a(f,`flow.recommend.hint`)}),(0,A.jsx)(v,{variant:`outline`,onClick:s,children:a(f,`flow.recommend.skip`)})]})]})]})}function J(e,t){return a(t,`flow.recommend.minutes`,{count:e})}function Y(e,t){let n=e.estimatedFirstResponseSeconds;return!e.downloadRequired||e.estimatedDownloadMinutes===0?a(t,`flow.recommend.timeEstimate.ready`,{response:n}):e.estimatedDownloadMinutes===null?a(t,`flow.recommend.timeEstimate.unknown`,{response:n}):a(t,`flow.recommend.timeEstimate`,{download:J(e.estimatedDownloadMinutes,t),response:n})}function oe(e,t){return!e.downloadRequired||e.estimatedDownloadMinutes===0?a(t,`flow.recommend.primaryNote.ready`):e.estimatedDownloadMinutes===null?a(t,`flow.recommend.primaryNote.unknown`):a(t,`flow.recommend.primaryNote`,{time:J(e.estimatedDownloadMinutes,t)})}function X(e,t){return e===`faster`?a(t,`flow.recommend.comparison.faster`):e===`advanced`?a(t,`flow.recommend.comparison.advanced`):``}function Z(e,t,n){return e===`best`?a(n,`flow.recommend.rank.best`):e===`faster`?a(n,`flow.recommend.rank.faster`):e===`advanced`?a(n,`flow.recommend.rank.advanced`):a(n,`flow.recommend.rank.choice`,{index:t+1})}function se({onComplete:e}){let t=c(e=>e.language),[n,i]=C.useState(`wake`),[o,s]=C.useState(null),[l,u]=C.useState(null),[d,p]=C.useState(0),[m,h]=C.useState(null),g=C.useMemo(()=>te({analysis:o,endpoints:l}),[o,l]);C.useEffect(()=>{let e=!1;async function t(){let[t,n,i,a]=await Promise.all([r.setupScan(),r.modelRecommendations(`local_mlx`),r.models(),r.sysinfo()]);e||(s({setup:t.ok?t.data:null,recommendations:n.ok?n.data:null,models:i.ok?i.data:null,sysinfo:a.ok?a.data:null}),u({setup:t.ok,recommendations:n.ok,models:i.ok,sysinfo:a.ok}))}return t(),()=>{e=!0}},[d]);let _=C.useCallback(()=>{s(null),u(null),p(e=>e+1)},[]);return(0,A.jsx)(`div`,{className:`ritual-shell`,children:(0,A.jsxs)(`main`,{className:`ritual-container`,"aria-label":a(t,`flow.shell`),children:[(0,A.jsx)(H,{}),(0,A.jsxs)(`div`,{className:`ritual-brain`,"data-scale":n===`wake`?`hero`:`mark`,children:[(0,A.jsx)(f,{state:le(n),intensity:n===`install`?.92:.7,size:`large`,showLabel:!1}),(0,A.jsx)(`div`,{className:`ritual-edition`,title:a(t,`brain.edition.tip`),children:a(t,`brain.edition`)})]}),n===`wake`&&(0,A.jsx)(Q,{onWake:()=>i(`login`),onUseExisting:()=>$(e)}),n===`login`&&(0,A.jsx)(G,{onSuccess:()=>i(`recommend`)}),n===`recommend`&&(0,A.jsx)(q,{status:g.status,reason:g.reason,recommendations:g.recommendations,analysis:o,onBack:()=>i(`login`),onRetry:_,onSkipModel:()=>$(e),onSelect:e=>{h(e),i(`install`)}}),n===`install`&&(0,A.jsx)(j,{model:ce(m,g.recommendations),onBack:()=>i(`recommend`),onComplete:()=>$(e),onLater:()=>$(e)})]})})}function Q({onWake:e,onUseExisting:t}){let n=c(e=>e.language),r=[{icon:b,label:a(n,`flow.wake.value.local.k`),body:a(n,`flow.wake.value.local.v`)},{icon:S,label:a(n,`flow.wake.value.instant.k`),body:a(n,`flow.wake.value.instant.v`)},{icon:h,label:a(n,`flow.wake.value.brain.k`),body:a(n,`flow.wake.value.brain.v`)}];return(0,A.jsxs)(`section`,{className:`ritual-wake`,"aria-label":a(n,`flow.wake.aria`),children:[(0,A.jsx)(`div`,{className:`ritual-title`,children:a(n,`flow.wake.title`)}),(0,A.jsx)(`div`,{className:`ritual-subtitle`,children:a(n,`flow.wake.body`)}),(0,A.jsx)(`div`,{className:`ritual-value-grid`,"aria-label":a(n,`flow.wake.value.aria`),children:r.map(e=>{let t=e.icon;return(0,A.jsxs)(`div`,{className:`ritual-value-card`,children:[(0,A.jsxs)(`div`,{className:`ritual-value-label`,children:[(0,A.jsx)(t,{size:14}),` `,e.label]}),(0,A.jsx)(`div`,{className:`ritual-value-body`,children:e.body})]},e.label)})}),(0,A.jsxs)(`div`,{className:`ritual-wake-plan`,"aria-label":a(n,`flow.wake.plan.aria`),children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{children:`1`}),(0,A.jsx)(`strong`,{children:a(n,`flow.wake.step.identity`)})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{children:`2`}),(0,A.jsx)(`strong`,{children:a(n,`flow.wake.step.check`)})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{children:`3`}),(0,A.jsx)(`strong`,{children:a(n,`flow.wake.step.voice`)})]})]}),(0,A.jsxs)(`div`,{className:`ritual-button-row ritual-button-row-primary`,children:[(0,A.jsxs)(`button`,{type:`button`,className:`ritual-full-button ritual-full-button-primary`,onClick:e,children:[a(n,`flow.wake.primary`),` `,(0,A.jsx)(u,{size:18})]}),(0,A.jsx)(`button`,{type:`button`,className:`ritual-secondary-button`,onClick:t,children:a(n,`flow.wake.existing`)})]}),(0,A.jsx)(`div`,{className:`ritual-start-note`,children:a(n,`flow.wake.startNote`)})]})}function $(e){_(),e()}function ce(e,t){return e||t[0]||ne()}function le(e){return e===`wake`?`idle`:e===`analysis`?`listening`:e===`recommend`?`recalling`:e===`install`?`thinking`:`idle`}export{se as ProductFlow};
1
+ import{C as e,_ as t,b as n,d as r,g as i,m as a,p as o,t as s,v as c,x as l}from"./utils-zqPZJxdx.js";import{i as u,r as d,t as f}from"./LivingBrain-DBwhto14.js";import{n as p,t as m}from"./input-DSlJJxRs.js";import{t as h}from"./cpu-k4awryFq.js";import{l as g,v as _}from"./index-BpYkzcVm.js";import"./brain-DJMoqrwx.js";import{t as v}from"./button-2j2Ijzgq.js";var y=t(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),b=t(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),x=t(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),S=t(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),C=e(l());i({ko:{"flow.analysis.fact.computer":`컴퓨터`,"flow.analysis.fact.memory":`λ©”λͺ¨λ¦¬`,"flow.analysis.fact.graphics":`κ·Έλž˜ν”½`,"flow.analysis.fact.support":`둜컬 지원`,"flow.analysis.fact.models":`λͺ¨λΈ`,"flow.analysis.checking":`확인 쀑`,"flow.analysis.fact.computerDetail":`μš΄μ˜μ²΄μ œμ™€ μΉ©`,"flow.analysis.fact.memoryDetail":`둜컬 사고λ₯Ό μœ„ν•œ μ—¬μœ  곡간`,"flow.analysis.fact.graphicsDetail":`둜컬 가속 지원`,"flow.analysis.fact.supportDetail":`μ„€μΉ˜λœ λͺ¨λΈ λ„μš°λ―Έ`,"flow.analysis.fact.modelsDetail":`μ„€μΉ˜λœ 둜컬 Brain`,"flow.analysis.apple":`Apple Silicon Mac`,"flow.analysis.detected":`감지됨`,"flow.analysis.localReady":`둜컬 가속 쀀비됨`,"flow.analysis.standardLocal":`ν‘œμ€€ 둜컬 λͺ¨λ“œ`,"flow.analysis.supportReady":`쀀비됨`,"flow.analysis.supportInstall":`μ€€λΉ„ μ˜ˆμ •`,"flow.analysis.modelsInstalled":`{count}개 이미 μ„€μΉ˜λ¨`,"flow.analysis.noModels":`아직 μ„€μΉ˜λœ λͺ¨λΈ μ—†μŒ`,"flow.analysis.readyDetail":`둜컬 Digital Brain μ‚¬μš© μ€€λΉ„ μ™„λ£Œ`,"flow.analysis.memoryReadyDetail":`μΆ”μ²œ λͺ¨λΈμ— μΆ©λΆ„ν•œ μ»¨ν…μŠ€νŠΈ`,"flow.analysis.graphicsReadyDetail":`Latticeκ°€ κ°€μž₯ 쒋은 경둜λ₯Ό μ„ νƒν•©λ‹ˆλ‹€.`,"flow.analysis.supportReadyDetail":`μ„€μΉ˜λœ λͺ¨λΈ λ„μš°λ―Έκ°€ κ°μ§€λ˜μ—ˆμŠ΅λ‹ˆλ‹€.`,"flow.analysis.supportInstallDetail":`Latticeκ°€ ν•„μš”ν•œ ν•­λͺ©μ„ μΆ”κ°€ν•©λ‹ˆλ‹€.`,"flow.analysis.modelsReadyDetail":`μ¦‰μ‹œ λ‘œλ“œν•  수 μžˆλŠ” λͺ¨λΈμ΄ μžˆμŠ΅λ‹ˆλ‹€.`,"flow.analysis.modelsInstallDetail":`Latticeκ°€ 첫 μ„€μΉ˜λ₯Ό μ•ˆλ‚΄ν•©λ‹ˆλ‹€.`,"flow.recommend.reason.best":`졜적 κ²½ν—˜`,"flow.recommend.reason.faster":`λΉ λ₯Έ 선택`,"flow.recommend.reason.advanced":`κ³ κΈ‰ 선택`,"flow.recommend.reason.default":`μΆ”μ²œ`,"flow.recommend.sizeReady":`쀀비됨`,"flow.recommend.fallbackName":`μΆ”μ²œ Brain`,"flow.install.stage.idle":`μ•„λž˜ λ²„νŠΌμ„ λˆ„λ₯΄λ©΄ μ€€λΉ„λ₯Ό μ‹œμž‘ν•©λ‹ˆλ‹€.`,"flow.install.stage.install":`Brain μ€€λΉ„λ₯Ό μ‹œμž‘ν•©λ‹ˆλ‹€.`,"flow.install.stage.download":`λͺ¨λΈ νŒŒμΌμ„ λ°›λŠ” μ€‘μž…λ‹ˆλ‹€.`,"flow.install.stage.validate":`Brain이 응닡할 수 μžˆλŠ”μ§€ 확인 μ€‘μž…λ‹ˆλ‹€.`,"flow.install.stage.load":`Brain을 λΆˆλŸ¬μ˜€λŠ” μ€‘μž…λ‹ˆλ‹€.`,"flow.install.stage.done":`Brain이 μ€€λΉ„λ˜μ—ˆμŠ΅λ‹ˆλ‹€. κ³§ λŒ€ν™”κ°€ μ—΄λ¦½λ‹ˆλ‹€.`,"flow.install.stage.error":`확인이 ν•„μš”ν•œ 일이 μžˆμŠ΅λ‹ˆλ‹€.`,"flow.install.step.install":`μ€€λΉ„`,"flow.install.step.download":`λ‹€μš΄λ‘œλ“œ`,"flow.install.step.ready":`둜컬 확인`,"flow.install.step.validate":`확인`,"flow.install.step.load":`λ‘œλ“œ`,"flow.analysis.hardware.icon.chip":`πŸ–₯️`,"flow.analysis.hardware.icon.ram":`🧠`,"flow.analysis.hardware.icon.gpu":`⚑`,"flow.analysis.hardware.icon.support":`🧩`,"flow.analysis.hardware.icon.models":`πŸ“¦`,"flow.analysis.hardware.label.chip":`컴퓨터 (μš΄μ˜μ²΄μ œμ™€ μΉ©)`,"flow.analysis.hardware.label.ram":`λ©”λͺ¨λ¦¬ (생각할 μž‘μ—… 곡간, RAM)`,"flow.analysis.hardware.label.gpu":`κ·Έλž˜ν”½ (계산을 λ„μ™€μ£ΌλŠ” GPU)`,"flow.analysis.hardware.label.support":`둜컬 지원 (λͺ¨λΈ μ‹€ν–‰ λ„μš°λ―Έ)`,"flow.analysis.hardware.label.models":`λͺ¨λΈ (μ„€μΉ˜λœ AI Brain)`,"flow.recommend.timeEstimate":`λ‹€μš΄λ‘œλ“œ μ•½ {download} Β· 첫 응닡 μ•½ {response}초`,"flow.recommend.timeEstimate.ready":`λ‹€μš΄λ‘œλ“œ λΆˆν•„μš” Β· 첫 응닡 μ•½ {response}초`,"flow.recommend.timeEstimate.unknown":`λ‹€μš΄λ‘œλ“œ μ‹œκ°„ 미확인 Β· 첫 응닡 μ•½ {response}초`,"flow.recommend.timeNote":`λ„€νŠΈμ›Œν¬ 속도에 따라 λ‹¬λΌμ§ˆ 수 μžˆμ–΄μš”.`,"flow.recommend.alternatives":`λ‹€λ₯Έ 선택지`,"flow.recommend.minutes":`{count}λΆ„`,"flow.recommend.comparison.faster":`(더 빠름)`,"flow.recommend.comparison.advanced":`(더 κ°•λ ₯함)`,"flow.recommend.choose":`이 λͺ¨λΈ 선택`,"flow.recommend.primaryNote":`μ•½ {time} ν›„ μ‚¬μš© μ€€λΉ„ μ™„λ£Œ`,"flow.recommend.primaryNote.ready":`λ‹€μš΄λ‘œλ“œ 없이 λ°”λ‘œ μ‚¬μš© μ€€λΉ„ μ™„λ£Œ`,"flow.recommend.primaryNote.unknown":`λ‹€μš΄λ‘œλ“œ μ‹œκ°„ 확인 ν›„ μ‚¬μš© μ€€λΉ„`,"flow.recommend.nextHint":`μ„ νƒν•˜λ©΄ λ‹€μš΄λ‘œλ“œμ™€ μ€€λΉ„ ν™”λ©΄μœΌλ‘œ λ„˜μ–΄κ°€κ³ , λλ‚˜λ©΄ λ°”λ‘œ Brain이 μ—΄λ¦½λ‹ˆλ‹€.`,"flow.recommend.nextHint.ready":`μ„ νƒν•˜λ©΄ μ€€λΉ„ 확인 ν™”λ©΄μœΌλ‘œ λ„˜μ–΄κ°€κ³ , λλ‚˜λ©΄ λ°”λ‘œ Brain이 μ—΄λ¦½λ‹ˆλ‹€.`,"flow.install.expectedTitle":`μ˜ˆμƒ μ§„ν–‰`,"flow.install.expected":`μ•½ {download} λ‹€μš΄λ‘œλ“œ ν›„ μ•½ {response}초 μ•ˆμ— 첫 응닡`,"flow.install.expected.ready":`λ‹€μš΄λ‘œλ“œ 없이 μ•½ {response}초 μ•ˆμ— 첫 응닡`,"flow.install.expected.unknown":`λ‹€μš΄λ‘œλ“œ ν›„ μ•½ {response}초 μ•ˆμ— 첫 응닡`,"flow.install.timelineStep.download":`λͺ¨λΈ λ‹€μš΄λ‘œλ“œ`,"flow.install.timelineStep.ready":`둜컬 λͺ¨λΈ 확인`,"flow.install.timelineStep.validate":`응닡 확인`,"flow.install.timelineStep.load":`Brain에 λ‘œλ“œ`,"flow.install.timelineApprox":`μ•½ {time}`,"flow.install.timelineQuick":`잠깐`,"flow.install.expectedCompletion":`λλ‚˜λ©΄ λ°”λ‘œ Brain이 μ—΄λ¦½λ‹ˆλ‹€.`,"flow.shell":`λ‚΄ 둜컬 AI 브레인 λ§Œλ“€κΈ°`,"flow.wake.aria":`Brain 깨우기`,"flow.wake.title":`λ‚΄ 지식이 μ‚΄μ•„λ‚˜λŠ” Brain을 μ‹œμž‘ν•˜μ„Έμš”.`,"flow.wake.body":`Lattice AIλŠ” 이 컴퓨터 μ•ˆμ—μ„œ λ‚΄ λŒ€ν™”, λ¬Έμ„œ, 결정이 였래 λ‚¨λŠ” μž‘μ—… 기얡이 되게 ν•©λ‹ˆλ‹€. λͺ¨λΈμ€ 바꿔도 Brain은 계속 λ‚΄ κ²ƒμž…λ‹ˆλ‹€.`,"flow.wake.value.aria":`Brain μ‹œμž‘ κ°€μΉ˜`,"flow.wake.value.local.k":`μ™„μ „ 둜컬`,"flow.wake.value.local.v":`지식과 λŒ€ν™”λŠ” 이 μ»΄ν“¨ν„°μ—μ„œ λ¨Όμ € μ •λ¦¬λ©λ‹ˆλ‹€.`,"flow.wake.value.instant.k":`λ°”λ‘œ 이해`,"flow.wake.value.instant.v":`λ³΅μž‘ν•œ μ„€μ • λŒ€μ‹  3λ‹¨κ³„λ‘œ 첫 λŒ€ν™”λ₯Ό μ—½λ‹ˆλ‹€.`,"flow.wake.value.brain.k":`μ§€μ†λ˜λŠ” Brain`,"flow.wake.value.brain.v":`λͺ¨λΈμ„ 바꿔도 λ‚΄ κΈ°μ–΅κ³Ό κ·Έλž˜ν”„λŠ” μ΄μ–΄μ§‘λ‹ˆλ‹€.`,"flow.wake.plan.aria":`Brain μ‹œμž‘ 단계`,"flow.wake.step.identity":`주인 확인`,"flow.wake.step.check":`컴퓨터 확인`,"flow.wake.step.voice":`λͺ©μ†Œλ¦¬ 선택`,"flow.wake.primary":`Brain μ§€κΈˆ 깨우기`,"flow.wake.existing":`κΈ°μ‘΄ Brain μ—΄κΈ°`,"flow.wake.startNote":`평균 2λΆ„ μ•ˆμ— 첫 λŒ€ν™” μ‹œμž‘ Β· 둜컬 μš°μ„  Β· μ‚¬μš©μžκ°€ μ œμ–΄`,"flow.login.title":`이 Brain의 주인을 μ •ν•©λ‹ˆλ‹€.`,"flow.login.statement":`이 컴퓨터 μ•ˆμ—μ„œλ§Œ μ‚¬λŠ” 기얡을 λ§Œλ“­λ‹ˆλ‹€.`,"flow.login.body":`이 μ»΄ν“¨ν„°μ˜ 기얡을 λˆ„κ΅¬ κ²ƒμœΌλ‘œ ν• μ§€ μ •ν•©λ‹ˆλ‹€. κΈ°μ‘΄ Brain이 있으면 μƒˆλ‘œ λ§Œλ“€κΈ° 전에 λ¨Όμ € μ•ˆμ „ν•˜κ²Œ ν™•μΈν•©λ‹ˆλ‹€.`,"flow.name":`이름`,"flow.name.placeholder":`λ‚˜`,"flow.email":`이메일`,"flow.email.placeholder":`you@local`,"flow.password":`λΉ„λ°€λ²ˆν˜Έ`,"flow.password.placeholder":`둜컬 Brain λΉ„λ°€λ²ˆν˜Έ`,"flow.login.busy":`Brain μ—¬λŠ” 쀑...`,"flow.login.submit":`λ‚΄ Brain μ‹œμž‘ν•˜κΈ°`,"flow.login.note":`이 ν”„λ‘œν•„μ€ λ‚΄ AI 브레인의 μ£ΌμΈμž…λ‹ˆλ‹€. κΈ°μ‘΄ Brainκ³Ό λ‹€λ₯Έ 이메일이면 μƒˆλ‘œ λ§Œλ“€μ§€ μ•Šκ³  λ¨Όμ € ν™•μΈν•©λ‹ˆλ‹€.`,"flow.login.passwordLocal":`이 λΉ„λ°€λ²ˆν˜ΈλŠ” 이 μ»΄ν“¨ν„°μ˜ Brain μ „μš©μž…λ‹ˆλ‹€. ν΄λΌμš°λ“œλ‘œ μ „μ†‘λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.`,"flow.login.missing":`이름과 이메일, λΉ„λ°€λ²ˆν˜Έλ₯Ό μž…λ ₯ν•˜λ©΄ κΈ°μ‘΄ Brain을 μ•ˆμ „ν•˜κ²Œ ν™•μΈν•©λ‹ˆλ‹€.`,"flow.login.otherEmail":`이 μ»΄ν“¨ν„°μ˜ κΈ°μ‘΄ Brainκ³Ό λ‹€λ₯Έ μ΄λ©”μΌμž…λ‹ˆλ‹€. μ˜€νƒ€μΈμ§€ 확인해 μ£Όμ„Έμš”.`,"flow.login.wrongPassword":`κΈ°μ‘΄ Brain 이메일은 λ§žμ§€λ§Œ λΉ„λ°€λ²ˆν˜Έκ°€ λ‹€λ¦…λ‹ˆλ‹€. λΉ„λ°€λ²ˆν˜Έλ₯Ό λ‹€μ‹œ 확인해 μ£Όμ„Έμš”.`,"flow.login.unavailable":`둜컬 ν”„λ‘œν•„μ„ μ—΄ 수 μ—†μŠ΅λ‹ˆλ‹€. 이메일과 λΉ„λ°€λ²ˆν˜Έλ₯Ό 확인해 μ£Όμ„Έμš”.`,"flow.promise.memory.k":`였래 λ‚¨λŠ” 지식`,"flow.promise.memory.v":`λ‚΄ 일이 μž₯κΈ° 기얡이 λ©λ‹ˆλ‹€.`,"flow.promise.model.k":`ꡐ체 κ°€λŠ₯ν•œ λͺ¨λΈ`,"flow.promise.model.v":`λͺ¨λΈμ€ λͺ©μ†Œλ¦¬μ΄κ³ , μžμ‚°μ€ Brainμž…λ‹ˆλ‹€.`,"flow.promise.ownership.k":`μ‚¬μš©μž μ†Œμœ `,"flow.promise.ownership.v":`λ°±μ—…, 볡원, 이동을 직접 κ²°μ •ν•©λ‹ˆλ‹€.`,"flow.promise.aria":`Lattice AI μ œν’ˆ 약속`,"flow.analysis.title":`이 컴퓨터에 λ§žλŠ” Brain κ²½ν—˜μ„ ν™•μΈν•©λ‹ˆλ‹€.`,"flow.analysis.body":`μŠ€νŽ™ μ μˆ˜κ°€ μ•„λ‹ˆλΌ, 이 Macμ—μ„œ μ–΄λ–€ 둜컬 AI 브레인 κ²½ν—˜μ΄ νŽΈν•œμ§€ λ³΄μ—¬λ“œλ¦½λ‹ˆλ‹€. 확인은 둜컬 μƒνƒœλ₯Ό μ½λŠ” 것이고, ν΄λΌμš°λ“œ λͺ¨λΈμ€ 선택 μ‚¬ν•­μž…λ‹ˆλ‹€.`,"flow.analysis.finding":`κ°€μž₯ νŽΈν•œ 섀정을 μ°ΎλŠ” 쀑...`,"flow.analysis.ready":`μΆ”μ²œ λͺ¨λΈμ„ λ°”λ‘œ μ‹œμž‘ν•  수 있게 μ€€λΉ„ν–ˆμŠ΅λ‹ˆλ‹€.`,"flow.analysis.wait":`μž μ‹œλ§Œ 기닀리면 μžλ™μœΌλ‘œ μ •λ¦¬λ©λ‹ˆλ‹€.`,"flow.analysis.error":`Latticeκ°€ 이 컴퓨터λ₯Ό λκΉŒμ§€ ν™•μΈν•˜μ§€ λͺ»ν–ˆμŠ΅λ‹ˆλ‹€. κ·Έλž˜λ„ μ•ˆμ „ν•œ κΈ°λ³Έκ°’μœΌλ‘œ 계속할 수 μžˆμŠ΅λ‹ˆλ‹€.`,"flow.analysis.continue":`μΆ”μ²œ λͺ¨λΈ 보기`,"flow.analysis.bestFit":`{model}이 이 컴퓨터에 κ°€μž₯ 잘 λ§žμŠ΅λ‹ˆλ‹€.`,"flow.analysis.privateRecommended":`이 μ»΄ν“¨ν„°μ—λŠ” 개인 둜컬 Brain을 μΆ”μ²œν•©λ‹ˆλ‹€.`,"flow.analysis.os.windows":`Windows PC`,"flow.analysis.os.linux":`Linux 컴퓨터`,"flow.recommend.title":`μΆ”μ²œλŒ€λ‘œ μ‹œμž‘ν•˜μ„Έμš”.`,"flow.recommend.environment.apple":`컴퓨터 μ€€λΉ„ μ™„λ£Œ: 둜컬 MLX 지원(Apple Silicon, {ram}GB RAM 감지)`,"flow.recommend.environment.standard":`ꢌμž₯: κ°€λ²Όμš΄ 둜컬 λͺ¨λΈλ‘œ μ‹œμž‘ν•˜μ„Έμš”({ram}GB RAM 감지)`,"flow.recommend.body":`λͺ¨λΈμ€ Brain의 ν˜„μž¬ λͺ©μ†Œλ¦¬μž…λ‹ˆλ‹€. μΆ”μ²œ, λΉ λ₯Έ 선택, κ°•ν•œ μ„ νƒλ§Œ λ¨Όμ € λ³΄μ—¬λ“œλ € λ°”λ‘œ κ²°μ •ν•  수 있게 ν•©λ‹ˆλ‹€.`,"flow.recommend.primary":`μΆ”μ²œμœΌλ‘œ λ°”λ‘œ μ‹œμž‘`,"flow.recommend.unsupported":`이 μ»΄ν“¨ν„°μ—μ„œ μΆ”κ°€ 확인이 ν•„μš”ν•©λ‹ˆλ‹€`,"flow.recommend.back":`λ’€λ‘œ`,"flow.recommend.skip":`λͺ¨λΈ 없이 Brain μ—΄κΈ°`,"flow.recommend.hint":`잘 λͺ¨λ₯΄κ² λ‹€λ©΄ μΆ”μ²œλŒ€λ‘œ μ‹œμž‘ν•˜λ©΄ λ©λ‹ˆλ‹€.`,"flow.recommend.loading":`이 컴퓨터에 λ§žλŠ” λͺ¨λΈμ„ ν™•μΈν•˜λŠ” 쀑...`,"flow.recommend.unavailable.aria":`둜컬 λͺ¨λΈ μ€€λΉ„ μƒνƒœ`,"flow.recommend.unavailable.title":`μ§€κΈˆμ€ 이 μ»΄ν“¨ν„°μ—μ„œ λ°”λ‘œ μ“Έ 둜컬 λͺ¨λΈμ„ μ€€λΉ„ν•˜μ§€ λͺ»ν–ˆμŠ΅λ‹ˆλ‹€.`,"flow.recommend.unavailable.probe":`Latticeκ°€ 이 μ»΄ν“¨ν„°μ˜ 둜컬 ν™˜κ²½μ„ ν™•μΈν•˜μ§€ λͺ»ν–ˆμŠ΅λ‹ˆλ‹€. λ„€νŠΈμ›Œν¬μ™€ 둜컬 μ„œλΉ„μŠ€ μƒνƒœλ₯Ό ν™•μΈν•œ λ’€ λ‹€μ‹œ μ‹œλ„ν•΄ μ£Όμ„Έμš”.`,"flow.recommend.unavailable.empty":`이 μ»΄ν“¨ν„°μ—μ„œ λ°”λ‘œ μ‹€ν–‰ν•  수 μžˆλŠ” μΆ”μ²œ λͺ¨λΈμ„ μ°Ύμ§€ λͺ»ν–ˆμŠ΅λ‹ˆλ‹€. λ‹€μ‹œ ν™•μΈν•˜κ±°λ‚˜, λͺ¨λΈ 없이 Brain을 λ¨Όμ € μ—΄ 수 μžˆμŠ΅λ‹ˆλ‹€.`,"flow.recommend.unavailable.retry":`λ‹€μ‹œ 확인`,"flow.recommend.unavailable.hint":`λͺ¨λΈμ€ λ‚˜μ€‘μ— λΌμ΄λΈŒλŸ¬λ¦¬μ—μ„œ μ–Έμ œλ“  μΆ”κ°€ν•  수 μžˆμŠ΅λ‹ˆλ‹€.`,"flow.recommend.rank.best":`μΆ”μ²œ`,"flow.recommend.rank.faster":`λΉ λ₯Έ 선택`,"flow.recommend.rank.advanced":`κ³ κΈ‰ 선택`,"flow.recommend.rank.choice":`선택 {index}`,"flow.install.title":`λͺ¨λΈμ„ μ„€μΉ˜ν•˜κ³  μ‹œμž‘ν•©λ‹ˆλ‹€.`,"flow.install.title.ready":`λͺ¨λΈμ„ μ€€λΉ„ν•˜κ³  μ‹œμž‘ν•©λ‹ˆλ‹€.`,"flow.install.wait":`Brain이 μ‚¬μš©ν•  λͺ¨λΈμ„ 기닀리고 μžˆμŠ΅λ‹ˆλ‹€.`,"flow.install.prepare":`Brain μ€€λΉ„ μ€‘μž…λ‹ˆλ‹€.`,"flow.install.done":`Brain이 μ€€λΉ„λ˜μ—ˆμŠ΅λ‹ˆλ‹€.`,"flow.install.note":`큰 λͺ¨λΈμ€ λ‹€μš΄λ‘œλ“œμ— λͺ‡ λΆ„ 이상 걸릴 수 μžˆμŠ΅λ‹ˆλ‹€. μ§„ν–‰λ₯ μ€ λͺ¨λΈ λŸ°νƒ€μž„μ΄ μ•Œλ €μ£ΌλŠ” 만큼 ν‘œμ‹œν•˜κ³ , 멈좘 κ²ƒμ²˜λŸΌ 보여도 ν˜„μž¬ 단계가 μœ μ§€λ©λ‹ˆλ‹€.`,"flow.install.note.ready":`둜컬 응닡 확인은 보톡 잠깐이면 λλ‚©λ‹ˆλ‹€. μ‹€νŒ¨ν•˜λ©΄ λ‹€λ₯Έ λͺ¨λΈμ„ κ³ λ₯΄κ±°λ‚˜ λ‚˜μ€‘μ— λ‹€μ‹œ μ‹œλ„ν•  수 μžˆμŠ΅λ‹ˆλ‹€.`,"flow.install.retry":`λ‹€λ₯Έ λͺ¨λΈμ„ κ³ λ₯΄κ±°λ‚˜ λ‹€μ‹œ μ‹œλ„ν•  수 μžˆμŠ΅λ‹ˆλ‹€.`,"flow.install.back":`λ‹€λ₯Έ λͺ¨λΈ κ³ λ₯΄κΈ°`,"flow.install.start":`λ‹€μš΄λ‘œλ“œν•˜κ³  μ‹œμž‘ν•˜κΈ°`,"flow.install.startReady":`μ€€λΉ„ν•˜κ³  μ‹œμž‘ν•˜κΈ°`,"flow.install.busy":`λͺ¨λΈ μ€€λΉ„ 쀑...`,"flow.install.enter":`Brain으둜 λ“€μ–΄κ°€κΈ°`,"flow.install.later":`λ‚˜μ€‘μ— ν•˜κΈ°`,"flow.install.local":`λͺ¨λΈ λ‹€μš΄λ‘œλ“œμ™€ μ™ΈλΆ€ 톡신은 μ‚¬μš©μžκ°€ μ‹œμž‘ν•  λ•Œλ§Œ μ§„ν–‰λ©λ‹ˆλ‹€.`,"flow.install.local.ready":`이 선택은 μ™ΈλΆ€ λ‹€μš΄λ‘œλ“œ 없이 둜컬 μ€€λΉ„ μƒνƒœλ§Œ ν™•μΈν•©λ‹ˆλ‹€.`,"flow.consent.title":`λ‹€μš΄λ‘œλ“œ μ „ 확인`,"flow.consent.readyTitle":`둜컬 μ€€λΉ„ μƒνƒœ`,"flow.consent.body":`μ‹œμž‘ν•˜λ©΄ μ•„λž˜ λͺ¨λΈ νŒŒμΌμ„ μ™ΈλΆ€ μ €μž₯μ†Œμ—μ„œ λ°›μ•„ 이 컴퓨터에 μ €μž₯ν•©λ‹ˆλ‹€.`,"flow.consent.ready":`이미 μ€€λΉ„λœ λͺ¨λΈμž…λ‹ˆλ‹€. μ‹œμž‘ν•΄λ„ μ™ΈλΆ€ λ‹€μš΄λ‘œλ“œλ₯Ό μš”μ²­ν•˜μ§€ μ•Šκ³  λ‘œμ»¬μ—μ„œ 응닡 κ°€λŠ₯ μ—¬λΆ€λ§Œ ν™•μΈν•©λ‹ˆλ‹€.`,"flow.consent.state":`λ‹€μš΄λ‘œλ“œ ν•„μš”`,"flow.consent.stateReady":`μ—†μŒ`,"flow.consent.size":`λ‹€μš΄λ‘œλ“œ 크기`,"flow.consent.sizeUnknown":`λŸ°νƒ€μž„ 확인 ν›„ ν‘œμ‹œ`,"flow.consent.location":`μ €μž₯ μœ„μΉ˜`,"flow.consent.external":`μ™ΈλΆ€ 접속 λŒ€μƒ`,"flow.consent.externalUnknown":`λŸ°νƒ€μž„ 확인 ν›„ ν‘œμ‹œ`,"flow.consent.externalNone":`선택 μ „ μ™ΈλΆ€ 접속 μ—†μŒ`},en:{"flow.analysis.fact.computer":`Computer`,"flow.analysis.fact.memory":`Memory`,"flow.analysis.fact.graphics":`Graphics`,"flow.analysis.fact.support":`Local Support`,"flow.analysis.fact.models":`Models`,"flow.analysis.checking":`Checking`,"flow.analysis.fact.computerDetail":`Operating system and chip`,"flow.analysis.fact.memoryDetail":`Available room for local thinking`,"flow.analysis.fact.graphicsDetail":`Local acceleration support`,"flow.analysis.fact.supportDetail":`Installed model helpers`,"flow.analysis.fact.modelsDetail":`Installed local Brains`,"flow.analysis.apple":`Apple Silicon Mac`,"flow.analysis.detected":`Detected`,"flow.analysis.localReady":`Local acceleration ready`,"flow.analysis.standardLocal":`Standard local mode`,"flow.analysis.supportReady":`Ready`,"flow.analysis.supportInstall":`Will be prepared`,"flow.analysis.modelsInstalled":`{count} already installed`,"flow.analysis.noModels":`None installed yet`,"flow.analysis.readyDetail":`Ready for local Digital Brain use`,"flow.analysis.memoryReadyDetail":`Enough context for the recommended model`,"flow.analysis.graphicsReadyDetail":`Lattice will choose the best available path`,"flow.analysis.supportReadyDetail":`Installed model helpers detected`,"flow.analysis.supportInstallDetail":`Lattice will add what is needed`,"flow.analysis.modelsReadyDetail":`One can be loaded immediately`,"flow.analysis.modelsInstallDetail":`Lattice will guide the first install`,"flow.recommend.reason.best":`Best Experience`,"flow.recommend.reason.faster":`Faster`,"flow.recommend.reason.advanced":`Advanced`,"flow.recommend.reason.default":`Recommended`,"flow.recommend.sizeReady":`ready`,"flow.recommend.fallbackName":`Recommended Brain`,"flow.install.stage.idle":`Press the button below to start preparing.`,"flow.install.stage.install":`Starting to prepare your Brain.`,"flow.install.stage.download":`Getting the model files.`,"flow.install.stage.validate":`Checking that the Brain can answer.`,"flow.install.stage.load":`Loading the Brain.`,"flow.install.stage.done":`Your Brain is ready. Opening the conversation.`,"flow.install.stage.error":`Something needs attention.`,"flow.install.step.install":`Install`,"flow.install.step.download":`Download`,"flow.install.step.ready":`Local check`,"flow.install.step.validate":`Validate`,"flow.install.step.load":`Load`,"flow.analysis.hardware.icon.chip":`πŸ–₯️`,"flow.analysis.hardware.icon.ram":`🧠`,"flow.analysis.hardware.icon.gpu":`⚑`,"flow.analysis.hardware.icon.support":`🧩`,"flow.analysis.hardware.icon.models":`πŸ“¦`,"flow.analysis.hardware.label.chip":`Computer (operating system and chip)`,"flow.analysis.hardware.label.ram":`Memory (working space to think, RAM)`,"flow.analysis.hardware.label.gpu":`Graphics (the GPU that speeds up math)`,"flow.analysis.hardware.label.support":`Local support (helpers that run models)`,"flow.analysis.hardware.label.models":`Models (AI Brains already installed)`,"flow.recommend.timeEstimate":`Download about {download} Β· first reply about {response}s`,"flow.recommend.timeEstimate.ready":`No download needed Β· first reply about {response}s`,"flow.recommend.timeEstimate.unknown":`Download time unknown Β· first reply about {response}s`,"flow.recommend.timeNote":`Actual time depends on your network speed.`,"flow.recommend.alternatives":`Other options`,"flow.recommend.minutes":`{count} min`,"flow.recommend.comparison.faster":`(faster)`,"flow.recommend.comparison.advanced":`(more capable)`,"flow.recommend.choose":`Choose this model`,"flow.recommend.primaryNote":`Ready to use in about {time}`,"flow.recommend.primaryNote.ready":`Ready with no download`,"flow.recommend.primaryNote.unknown":`Ready after download time is confirmed`,"flow.recommend.nextHint":`Choosing takes you to download and setup, then your Brain opens automatically.`,"flow.recommend.nextHint.ready":`Choosing takes you to a readiness check, then your Brain opens automatically.`,"flow.install.expectedTitle":`What to expect`,"flow.install.expected":`About {download} to download, then a first reply within about {response}s`,"flow.install.expected.ready":`No download β€” first reply within about {response}s`,"flow.install.expected.unknown":`After download, a first reply within about {response}s`,"flow.install.timelineStep.download":`Download model`,"flow.install.timelineStep.ready":`Check local model`,"flow.install.timelineStep.validate":`Check the reply`,"flow.install.timelineStep.load":`Load into Brain`,"flow.install.timelineApprox":`about {time}`,"flow.install.timelineQuick":`moment`,"flow.install.expectedCompletion":`When it finishes, your Brain opens right away.`,"flow.shell":`Create your local AI Brain`,"flow.wake.aria":`Wake your Brain`,"flow.wake.title":`Start the Brain where your knowledge comes alive.`,"flow.wake.body":`Lattice AI turns your conversations, documents, and decisions into durable working memory on this computer. Models can change while your Brain remains yours.`,"flow.wake.value.aria":`Brain startup value`,"flow.wake.value.local.k":`Fully local`,"flow.wake.value.local.v":`Knowledge and conversations are organized on this computer first.`,"flow.wake.value.instant.k":`Clear start`,"flow.wake.value.instant.v":`Open the first conversation in three guided steps.`,"flow.wake.value.brain.k":`Durable Brain`,"flow.wake.value.brain.v":`Your memories and graph continue even when models change.`,"flow.wake.plan.aria":`Brain start steps`,"flow.wake.step.identity":`Confirm owner`,"flow.wake.step.check":`Check computer`,"flow.wake.step.voice":`Choose voice`,"flow.wake.primary":`Wake Brain`,"flow.wake.existing":`Open existing Brain`,"flow.wake.startNote":`First conversation in about 2 minutes Β· local-first Β· user controlled`,"flow.login.title":`Choose the owner of this Brain.`,"flow.login.statement":`Creates a memory system that lives only on this computer.`,"flow.login.body":`Decide who owns the memory on this computer. If a Brain already exists here, Lattice checks safely before creating anything new.`,"flow.name":`Name`,"flow.name.placeholder":`You`,"flow.email":`Email`,"flow.email.placeholder":`you@local`,"flow.password":`Password`,"flow.password.placeholder":`Local Brain password`,"flow.login.busy":`Opening Brain...`,"flow.login.submit":`Start my Brain`,"flow.login.note":`This profile owns your AI Brain. If the email differs from this computer's Brain, Lattice checks before creating anything new.`,"flow.login.passwordLocal":`This password is only for the Brain on this computer. It is not sent to the cloud.`,"flow.login.missing":`Enter your name, email, and password so Lattice can safely check your Brain.`,"flow.login.otherEmail":`This email differs from the Brain on this computer. Please check for a typo.`,"flow.login.wrongPassword":`The email matches this Brain, but the password is different. Please check it again.`,"flow.login.unavailable":`Could not open the local profile. Check your email and password.`,"flow.promise.memory.k":`Durable knowledge`,"flow.promise.memory.v":`Your work becomes long-term memory.`,"flow.promise.model.k":`Replaceable models`,"flow.promise.model.v":`The model is the voice; the Brain is the asset.`,"flow.promise.ownership.k":`User owned`,"flow.promise.ownership.v":`You decide when to back up, restore, or move it.`,"flow.promise.aria":`Lattice AI product promise`,"flow.analysis.title":`Checking the Brain experience for this computer.`,"flow.analysis.body":`This is not a spec score. Lattice reads local capability and explains which local AI Brain experience will feel comfortable on this Mac. Cloud models remain optional.`,"flow.analysis.finding":`Finding the easiest setup...`,"flow.analysis.ready":`Your recommended model is ready to start.`,"flow.analysis.wait":`This will be summarized automatically in a moment.`,"flow.analysis.error":`Lattice could not finish checking this computer. You can still continue with a safe default.`,"flow.analysis.continue":`View recommended models`,"flow.analysis.bestFit":`{model} looks like the best fit.`,"flow.analysis.privateRecommended":`A private local Brain is recommended for this computer.`,"flow.analysis.os.windows":`Windows PC`,"flow.analysis.os.linux":`Linux computer`,"flow.recommend.title":`Start with the recommendation.`,"flow.recommend.environment.apple":`Computer ready: local MLX supported (Apple Silicon, {ram}GB RAM detected)`,"flow.recommend.environment.standard":`Recommended: start with a lighter local model ({ram}GB RAM detected)`,"flow.recommend.body":`The model is your Brain's current voice. Lattice shows the recommendation, a faster choice, and a stronger choice first so you can decide quickly.`,"flow.recommend.primary":`Start with recommendation`,"flow.recommend.unsupported":`This computer needs one more check`,"flow.recommend.back":`Back`,"flow.recommend.skip":`Open Brain without a model`,"flow.recommend.hint":`If unsure, start with the recommendation.`,"flow.recommend.loading":`Checking which model fits this computer...`,"flow.recommend.unavailable.aria":`Local model readiness`,"flow.recommend.unavailable.title":`A local model isn't ready to run on this computer yet.`,"flow.recommend.unavailable.probe":`Lattice couldn't check this computer's local environment. Check your network and local services, then try again.`,"flow.recommend.unavailable.empty":`No recommended model can run on this computer right now. Try checking again, or open your Brain without a model first.`,"flow.recommend.unavailable.retry":`Check again`,"flow.recommend.unavailable.hint":`You can add a model anytime later from the library.`,"flow.recommend.rank.best":`Best Experience`,"flow.recommend.rank.faster":`Faster`,"flow.recommend.rank.advanced":`Advanced`,"flow.recommend.rank.choice":`Choice {index}`,"flow.install.title":`Install the model and start.`,"flow.install.title.ready":`Prepare the model and start.`,"flow.install.wait":`Waiting for the model your Brain will use.`,"flow.install.prepare":`Preparing your Brain.`,"flow.install.done":`Your Brain is ready.`,"flow.install.note":`Large models can take several minutes to download. Progress is shown when the model runtime reports it; a steady stage still means work is continuing.`,"flow.install.note.ready":`The local reply check usually takes a moment. If it fails, choose another model or try again later.`,"flow.install.retry":`Choose another model or try again.`,"flow.install.back":`Choose another model`,"flow.install.start":`Download and start`,"flow.install.startReady":`Check and start`,"flow.install.busy":`Preparing model...`,"flow.install.enter":`Enter Brain`,"flow.install.later":`Do later`,"flow.install.local":`Downloads and external communication start only when you choose them.`,"flow.install.local.ready":`This choice checks local readiness without starting an external download.`,"flow.consent.title":`Before downloading`,"flow.consent.readyTitle":`Local readiness`,"flow.consent.body":`Starting will fetch these model files from an external repository and store them on this computer.`,"flow.consent.ready":`This model is already ready. Starting checks whether it can answer locally without requesting an external download.`,"flow.consent.state":`Download needed`,"flow.consent.stateReady":`No`,"flow.consent.size":`Download size`,"flow.consent.sizeUnknown":`Reported by runtime`,"flow.consent.location":`Storage location`,"flow.consent.external":`External target`,"flow.consent.externalUnknown":`Reported by runtime`,"flow.consent.externalNone":`No external connection before selection`}});function ee(e){let t=k(e?.models),n=[...s(t.recommended),...s(t.catalog)],r=k(e?.recommendations?.recommendations),i=s(r.models),a=k(r.top_pick),o=new Map;for(let e of[...i,...n]){let t=String(e.id||e.model_id||e.recommended_load_id||``);t&&o.set(t,{...o.get(t)||{},...e})}a.id&&!o.has(String(a.id))&&o.set(String(a.id),a);let c=Array.from(o.values()).map(w).filter(e=>e.id),l=c.filter(e=>e.supported),u=l.length?l:c,d=(e=>u.find(t=>t.id===String(e)))(a.id)||(e=>u.find(t=>e.test(`${t.name} ${t.id}`)))(/gemma.*12|12b/i)||u[0],f=d?.id,p=u.find(e=>e.id!==f&&/qwen|8b|7b/i.test(`${e.name} ${e.id}`))||u.find(e=>e.id!==f),m=p?.id,h=u.find(e=>e.id!==f&&e.id!==m&&/26b|32b|70b|advanced/i.test(`${e.name} ${e.id}`))||u.find(e=>e.id!==f&&e.id!==m);return[d?{...d,role:`best`,reason:d.reason||`best`}:null,p?{...p,role:`faster`,reason:p.reason||`faster`}:null,h?{...h,role:`advanced`,reason:h.reason||`advanced`}:null].filter(Boolean)}function te(e){let{analysis:t,endpoints:n}=e;if(!n)return{status:`loading`,recommendations:[],reason:null,failedEndpoints:[]};let r=Object.keys(n).filter(e=>!n[e]);if(!(n.recommendations||n.models))return{status:`unavailable`,recommendations:[],reason:`probe_failed`,failedEndpoints:r};let i=ee(t).filter(e=>e.supported);return i.length?{status:`ready`,recommendations:i,reason:null,failedEndpoints:r}:{status:`unavailable`,recommendations:[],reason:`no_supported_model`,failedEndpoints:r}}function ne(){return{id:`mlx-community/gemma-4-e2b-it-4bit`,loadId:`mlx-community/gemma-4-e2b-it-4bit`,engine:`local_mlx`,name:`Gemma 4 E2B`,shortName:`Gemma 4`,family:`Gemma 4`,size:``,role:`best`,reason:`best`,supported:!0,downloadRequired:!1,downloadSize:``,storageLocation:`~/.latticeai/models`,externalHost:``,estimatedDownloadMinutes:0,estimatedFirstResponseSeconds:5,parameterBillions:2}}function w(e){let t=k(e.runtime_compatibility),n=String(e.id||e.model_id||e.recommended_load_id||``),r=String(e.recommended_load_id||e.load_id||n),i=String(e.display_name||e.name||n||`recommended_brain`),a=e.load_status!==`unsupported`&&e.load_status!==`runtime_update_needed`&&e.status!==`not_recommended`&&t.supported!==!1,o=!!e.download_required,s=o?String(e.download_size||e.size||``):``,c=D(`${i} ${n}`);return{id:n,loadId:r,engine:String(e.recommended_engine||e.engine||`local_mlx`),name:i,shortName:O(i),family:O(String(e.family||i)),size:String(e.size||``),role:`best`,reason:String(e.reason||``),supported:a,downloadRequired:o,downloadSize:s,storageLocation:String(e.storage_location||e.local_path||`~/.latticeai/models`),externalHost:o?ie(e):``,estimatedDownloadMinutes:o?E(s):0,estimatedFirstResponseSeconds:re(c),parameterBillions:c}}function T(e){let t=String(e||``).match(/([\d.]+)\s*(t|g|m)?b?/i);if(!t)return null;let n=Number(t[1]);if(!Number.isFinite(n)||n<=0)return null;let r=(t[2]||`g`).toLowerCase();return r===`t`?n*1024*1024:r===`m`?n:n*1024}function E(e){let t=T(e);if(t===null)return null;let n=t/(15/8)/60;return Math.max(1,Math.round(n))}function D(e){let t=String(e||``).match(/(\d{1,3}(?:\.\d)?)\s*b\b/i);if(!t)return null;let n=Number(t[1]);return n>0?n:null}function re(e){return e===null?8:e<=9?5:e<=16?10:e<=40?18:30}function ie(e){let t=String(e.source_url||e.download_url||e.repository||e.provider||e.id||``);return t?/huggingface|hf\\.co|mlx-community/i.test(t)?`huggingface`:/ollama/i.test(t)?`ollama`:t.replace(/^https?:\/\//,``).split(`/`)[0]||t:``}function O(e){return String(e||`recommended_brain`).replace(/^mlx-community\//i,``).replace(/[-_]?Instruct/gi,``).replace(/[-_]?4bit/gi,``).replace(/Qwen3[-_ ]?VL/gi,`Qwen 3`).replace(/Qwen3/gi,`Qwen 3`).replace(/Gemma[-_ ]?4/gi,`Gemma 4`).replace(/A4B/gi,``).replace(/[-_]+/g,` `).replace(/\s+/g,` `).trim()}function k(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}var A=n();function ae({model:e}){let t=c(e=>e.language),n=e.downloadRequired?[{label:a(t,`flow.consent.size`),value:e.downloadSize||a(t,`flow.consent.sizeUnknown`)},{label:a(t,`flow.consent.location`),value:e.storageLocation},{label:a(t,`flow.consent.external`),value:e.externalHost||a(t,`flow.consent.externalUnknown`)}]:[{label:a(t,`flow.consent.state`),value:a(t,`flow.consent.stateReady`)},{label:a(t,`flow.consent.location`),value:e.storageLocation},{label:a(t,`flow.consent.external`),value:a(t,`flow.consent.externalNone`)}],r=e.downloadRequired?`flow.consent.title`:`flow.consent.readyTitle`;return(0,A.jsxs)(`section`,{className:`ritual-consent-panel`,"aria-label":a(t,r),children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`strong`,{children:a(t,r)}),(0,A.jsx)(`p`,{children:e.downloadRequired?a(t,`flow.consent.body`):a(t,`flow.consent.ready`)})]}),(0,A.jsx)(`dl`,{children:n.map(e=>(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`dt`,{children:e.label}),(0,A.jsx)(`dd`,{children:e.value})]},e.label))})]})}function j({model:e,onBack:t,onComplete:n,onLater:i}){let o=c(e=>e.language),s=c(e=>e.mode),[l,u]=C.useState(!1),[d,f]=C.useState(`idle`),[m,h]=C.useState(0),[g,_]=C.useState(a(o,`flow.install.wait`)),[y,b]=C.useState(null),x=a(o,`flow.install.stage.${d}`,{defaultValue:g});async function S(){u(!0),b(null),f(`install`),h(8),_(a(o,`flow.install.prepare`));let t=await r.streamModelPrepare({model:e.loadId,engine:e.engine||`local_mlx`,allow_download:e.downloadRequired},{onProgress:e=>{let t=P(String(e.stage||``));f(t),h(Number(e.percent||F(t))),_(I(e,t,o))},onDone:()=>{f(`done`),h(100),_(a(o,`flow.install.done`))},onError:e=>{f(`error`),b(B(e))}});u(!1),t.ok?(f(`done`),h(100),_(a(o,`flow.install.done`)),window.setTimeout(n,700)):(f(`error`),b(B(t.data)))}return(0,A.jsxs)(`div`,{className:`ritual-install`,children:[(0,A.jsxs)(`header`,{children:[(0,A.jsx)(`h1`,{className:`ritual-title`,children:a(o,e.downloadRequired?`flow.install.title`:`flow.install.title.ready`)}),(0,A.jsxs)(`p`,{className:`ritual-subtitle`,children:[(0,A.jsx)(`strong`,{children:e.shortName}),` β€” `,e.reason,`.`]})]}),(0,A.jsxs)(`section`,{className:`ritual-card ritual-install-progress-unit`,"aria-label":x,children:[(0,A.jsxs)(`div`,{className:`ritual-progress w-full`,children:[(0,A.jsx)(`div`,{className:`ritual-stage-list`,children:[`install`,`download`,`load`,`validate`].map(t=>(0,A.jsxs)(`div`,{className:`ritual-stage ${z(d,t)}`,children:[(0,A.jsx)(p,{className:`ritual-stage-icon`}),(0,A.jsx)(`span`,{children:L(t,o,e)})]},t))}),(0,A.jsx)(`div`,{className:`ritual-bar`,children:(0,A.jsx)(`span`,{className:`ritual-bar-fill ${R(m)}`})})]}),(0,A.jsxs)(`div`,{className:`ritual-status`,children:[x,s===`advanced`&&g!==x?(0,A.jsx)(`span`,{className:`ritual-status-raw block text-xs opacity-70 mt-1`,children:g}):null]})]}),y&&(0,A.jsxs)(`div`,{className:`ritual-card ritual-error-card ritual-install-error`,role:`alert`,children:[y,(0,A.jsx)(`div`,{className:`ritual-error-detail`,children:a(o,`flow.install.retry`)})]}),(0,A.jsxs)(`details`,{className:`ritual-install-details`,children:[(0,A.jsxs)(`summary`,{className:`cursor-pointer py-2 text-sm text-muted-foreground hover:text-foreground`,children:[a(o,`flow.install.expectedTitle`),` & `,a(o,`flow.consent.readyTitle`)]}),(0,A.jsxs)(`div`,{className:`ritual-install-details-content flex flex-col gap-3 py-2`,children:[(0,A.jsxs)(`section`,{className:`ritual-card ritual-expected-card`,"aria-label":a(o,`flow.install.expectedTitle`),children:[(0,A.jsx)(`div`,{className:`ritual-fact-label`,children:a(o,`flow.install.expectedTitle`)}),(0,A.jsx)(`div`,{className:`ritual-time-estimate ritual-expected-line`,children:M(e,o)}),(0,A.jsx)(`ol`,{className:`ritual-timeline`,children:N(e,o).map(e=>(0,A.jsxs)(`li`,{className:`ritual-timeline-step`,children:[(0,A.jsx)(`span`,{className:`ritual-timeline-name`,children:e.name}),(0,A.jsx)(`span`,{className:`ritual-timeline-time`,children:e.time})]},e.key))}),(0,A.jsx)(`div`,{className:`ritual-muted-hint`,children:a(o,`flow.install.expectedCompletion`)})]}),(0,A.jsx)(ae,{model:e}),(0,A.jsx)(`div`,{className:`ritual-card ritual-status-card`,children:a(o,e.downloadRequired?`flow.install.note`:`flow.install.note.ready`)}),(0,A.jsx)(`div`,{className:`ritual-local-note`,children:a(o,e.downloadRequired?`flow.install.local`:`flow.install.local.ready`)})]})]}),(0,A.jsxs)(`div`,{className:`ritual-button-row`,children:[(0,A.jsx)(v,{variant:`ghost`,onClick:t,disabled:l,children:a(o,`flow.install.back`)}),(0,A.jsx)(v,{variant:`outline`,onClick:i,disabled:l,children:a(o,`flow.install.later`)}),d===`done`?(0,A.jsx)(v,{onClick:n,children:a(o,`flow.install.enter`)}):(0,A.jsx)(v,{onClick:S,disabled:l||!e.supported,children:l?a(o,`flow.install.busy`):a(o,e.downloadRequired?`flow.install.start`:`flow.install.startReady`)})]})]})}function M(e,t){let n=e.estimatedFirstResponseSeconds;return!e.downloadRequired||e.estimatedDownloadMinutes===0?a(t,`flow.install.expected.ready`,{response:n}):e.estimatedDownloadMinutes===null?a(t,`flow.install.expected.unknown`,{response:n}):a(t,`flow.install.expected`,{download:a(t,`flow.recommend.minutes`,{count:e.estimatedDownloadMinutes}),response:n})}function N(e,t){let n=e.downloadRequired&&e.estimatedDownloadMinutes?a(t,`flow.install.timelineApprox`,{time:a(t,`flow.recommend.minutes`,{count:e.estimatedDownloadMinutes})}):a(t,`flow.install.timelineQuick`);return[{key:`download`,name:a(t,e.downloadRequired?`flow.install.timelineStep.download`:`flow.install.timelineStep.ready`),time:n},{key:`validate`,name:a(t,`flow.install.timelineStep.validate`),time:a(t,`flow.install.timelineQuick`)},{key:`load`,name:a(t,`flow.install.timelineStep.load`),time:a(t,`flow.install.timelineApprox`,{time:`${e.estimatedFirstResponseSeconds}s`})}]}function P(e){return/download|pull|weights/i.test(e)?`download`:/smoke|validate|verify|test/i.test(e)?`validate`:/load|ready/i.test(e)?`load`:/done|complete/i.test(e)?`done`:`install`}function F(e){return e===`install`?20:e===`download`?55:e===`load`?82:e===`validate`?94:e===`done`?100:8}function I(e,t,n){let r={install:a(n,`flow.install.prepare`),download:a(n,`flow.install.stage.download`),validate:a(n,`flow.install.stage.validate`),load:a(n,`flow.install.stage.load`),done:a(n,`flow.install.done`),idle:a(n,`flow.install.wait`),error:a(n,`flow.install.stage.error`)}[t];return V(String(e.user_message||e.message||r))}function L(e,t,n){return e===`download`&&!n.downloadRequired?a(t,`flow.install.step.ready`):a(t,`flow.install.step.${e}`)}function R(e){return`progress-${Math.max(0,Math.min(100,Math.round(e/10)*10))}`}function z(e,t){let n=[`idle`,`install`,`download`,`load`,`validate`,`done`],r=n.indexOf(e),i=n.indexOf(t);return e===`error`?`is-error`:e===`done`||r>i?`is-done`:e===t?`is-active`:``}function B(e){let t=k(e),n=s(t.recovery_guidance).map(V).filter(Boolean);return[V(String(t.user_message||t.reason||t.error||`The selected model could not be loaded.`)),...n.slice(0,2)].join(` `)}function V(e){return String(e||``).replace(/gemma4_unified/gi,`this model format`).replace(/mlx[-_ ]?vlm|mlx[-_ ]?lm|local_mlx|\bmlx\b|\bgguf\b|\bollama\b|huggingface|hugging face/gi,`local model support`).replace(/runtime/gi,`model support`).replace(/No module named ['\"][^'\"]+['\"]/gi,`A local support component is missing`).replace(/\s+/g,` `).trim()}function H(){let e=c(e=>e.language),t=c(e=>e.setLanguage);return(0,A.jsx)(`div`,{className:`language-switcher ritual-language`,"aria-label":a(e,`language.label`),children:[`ko`,`en`].map(n=>(0,A.jsx)(`button`,{type:`button`,className:e===n?`is-active`:``,onClick:()=>t(n),"aria-pressed":e===n,children:o[n]},n))})}var U=`lattice.productFlow.user`;function W(){try{let e=localStorage.getItem(U);return e?JSON.parse(e):null}catch{}return null}function G({onSuccess:e}){let t=c(e=>e.language),[n,i]=C.useState(()=>W()?.email||`you@local`),[o,s]=C.useState(``),[l,u]=C.useState(()=>W()?.name||`You`),[d,f]=C.useState(!1),[p,h]=C.useState(null);async function g(i){i.preventDefault();let s=n.trim(),c=o.trim(),u=l.trim()||s.split(`@`)[0]||`You`;if(!s||!c){h(a(t,`flow.login.missing`));return}f(!0),h(null);let d=W(),p=await r.login(s,c);if(!p.ok){if((await r.profile()).ok&&(!d?.email||d.email===s)){try{localStorage.setItem(U,JSON.stringify({email:s,name:u}))}catch{}f(!1),e();return}if(d?.email&&d.email!==s){f(!1),h(a(t,`flow.login.otherEmail`));return}if(d?.email===s){f(!1),h(a(t,`flow.login.wrongPassword`));return}(await r.register({email:s,password:c,name:u,nickname:u})).ok&&(p=await r.login(s,c))}if(!p.ok){f(!1),h(a(t,`flow.login.unavailable`));return}try{localStorage.setItem(U,JSON.stringify({email:s,name:u}))}catch{}f(!1),e()}return(0,A.jsx)(`div`,{className:`ritual-login`,children:(0,A.jsxs)(`div`,{className:`ritual-login-grid`,children:[(0,A.jsxs)(`div`,{className:`ritual-login-left`,children:[(0,A.jsx)(`p`,{className:`ritual-login-statement`,children:a(t,`flow.login.statement`)}),(0,A.jsx)(K,{})]}),(0,A.jsxs)(`div`,{className:`ritual-login-right`,children:[(0,A.jsxs)(`header`,{children:[(0,A.jsx)(`h1`,{id:`login-title`,className:`ritual-title`,children:a(t,`flow.login.title`)}),(0,A.jsx)(`p`,{className:`ritual-subtitle`,children:a(t,`flow.login.body`)})]}),(0,A.jsx)(`div`,{className:`ritual-login-card`,children:(0,A.jsxs)(`form`,{onSubmit:g,className:`ritual-form`,"aria-labelledby":`login-title`,children:[(0,A.jsxs)(`div`,{className:`ritual-field-stack`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`login-name`,className:`ritual-field-label`,children:a(t,`flow.name`)}),(0,A.jsx)(m,{id:`login-name`,value:l,onChange:e=>u(e.target.value),placeholder:a(t,`flow.name.placeholder`),autoComplete:`name`})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`login-email`,className:`ritual-field-label`,children:a(t,`flow.email`)}),(0,A.jsx)(m,{id:`login-email`,value:n,onChange:e=>i(e.target.value),type:`email`,placeholder:a(t,`flow.email.placeholder`),autoComplete:`email`,required:!0,"aria-invalid":p?!0:void 0,"aria-describedby":p?`login-error`:void 0})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{htmlFor:`login-password`,className:`ritual-field-label`,children:a(t,`flow.password`)}),(0,A.jsx)(m,{id:`login-password`,value:o,onChange:e=>s(e.target.value),type:`password`,placeholder:a(t,`flow.password.placeholder`),autoComplete:`current-password`,required:!0,"aria-invalid":p?!0:void 0,"aria-describedby":p?`login-error`:void 0})]})]}),p&&(0,A.jsx)(`div`,{id:`login-error`,className:`ritual-error`,role:`alert`,children:p}),(0,A.jsx)(v,{type:`submit`,disabled:d||!n.trim()||!o.trim(),className:`ritual-full-button`,children:d?a(t,`flow.login.busy`):a(t,`flow.login.submit`)}),(0,A.jsxs)(`div`,{className:`ritual-login-footnotes`,children:[(0,A.jsx)(`div`,{className:`ritual-muted-hint`,children:a(t,`flow.login.passwordLocal`)}),(0,A.jsx)(`div`,{className:`ritual-note`,children:a(t,`flow.login.note`)})]})]})})]})]})})}function K(){let e=c(e=>e.language);return(0,A.jsxs)(`aside`,{className:`ritual-promise is-quiet`,"aria-label":a(e,`flow.promise.aria`),children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{children:a(e,`flow.promise.memory.k`)}),(0,A.jsx)(`strong`,{children:a(e,`flow.promise.memory.v`)})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{children:a(e,`flow.promise.model.k`)}),(0,A.jsx)(`strong`,{children:a(e,`flow.promise.model.v`)})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{children:a(e,`flow.promise.ownership.k`)}),(0,A.jsx)(`strong`,{children:a(e,`flow.promise.ownership.v`)})]})]})}function q({status:e,reason:t,recommendations:n,analysis:r,onBack:i,onRetry:o,onSkipModel:s,onSelect:l}){let f=c(e=>e.language);if(e===`loading`)return(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`div`,{className:`ritual-title`,children:a(f,`flow.recommend.title`)}),(0,A.jsx)(`div`,{className:`ritual-subtitle`,children:a(f,`flow.recommend.body`)}),(0,A.jsxs)(`div`,{className:`ritual-scan-banner is-loading`,role:`status`,children:[(0,A.jsx)(`span`,{className:`ritual-scan-dot pulsing`}),(0,A.jsx)(`span`,{children:a(f,`flow.recommend.loading`)})]}),(0,A.jsxs)(`div`,{className:`ritual-action-row`,children:[(0,A.jsx)(v,{variant:`ghost`,onClick:i,children:a(f,`flow.recommend.back`)}),(0,A.jsx)(v,{variant:`outline`,onClick:s,children:a(f,`flow.recommend.skip`)})]})]});if(e===`unavailable`){let e=t===`no_supported_model`?`flow.recommend.unavailable.empty`:`flow.recommend.unavailable.probe`;return(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`div`,{className:`ritual-title`,children:a(f,`flow.recommend.title`)}),(0,A.jsx)(`section`,{className:`ritual-card ritual-error-card ritual-unavailable-card`,role:`alert`,"aria-label":a(f,`flow.recommend.unavailable.aria`),children:(0,A.jsxs)(`div`,{className:`ritual-inline-row`,children:[(0,A.jsx)(g,{className:`ritual-core-icon`,"aria-hidden":`true`}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`div`,{className:`ritual-strong-text`,children:a(f,`flow.recommend.unavailable.title`)}),(0,A.jsx)(`div`,{className:`ritual-muted-text`,children:a(f,e)})]})]})}),(0,A.jsxs)(`div`,{className:`ritual-button-row ritual-button-row-primary`,children:[(0,A.jsxs)(`button`,{type:`button`,className:`ritual-full-button ritual-full-button-primary`,onClick:o,children:[(0,A.jsx)(d,{size:16}),` `,a(f,`flow.recommend.unavailable.retry`)]}),(0,A.jsx)(`button`,{type:`button`,className:`ritual-secondary-button`,onClick:s,children:a(f,`flow.recommend.skip`)})]}),(0,A.jsxs)(`div`,{className:`ritual-action-row`,children:[(0,A.jsx)(v,{variant:`ghost`,onClick:i,children:a(f,`flow.recommend.back`)}),(0,A.jsx)(`div`,{className:`ritual-muted-hint`,children:a(f,`flow.recommend.unavailable.hint`)})]})]})}let p=n;function m(e,t){if(!e)return(0,A.jsxs)(`div`,{className:`ritual-scan-banner is-loading`,children:[(0,A.jsx)(`span`,{className:`ritual-scan-dot pulsing`}),(0,A.jsx)(`span`,{children:a(t,`flow.analysis.checking`)})]});let n=k(e.recommendations?.recommendations),r=k(e.setup?.environment),i=k(e.recommendations?.profile),o={...r,...i},s=Number(n.ram_gb||Number(o.ram_mb||0)/1024||0);return n.apple_silicon||String(o.arch||``).includes(`arm`)?(0,A.jsxs)(`div`,{className:`ritual-scan-banner is-success`,children:[(0,A.jsx)(`span`,{className:`ritual-scan-dot is-success`}),(0,A.jsx)(`span`,{children:a(t,`flow.recommend.environment.apple`,{ram:Math.round(s)})})]}):(0,A.jsxs)(`div`,{className:`ritual-scan-banner is-warning`,children:[(0,A.jsx)(`span`,{className:`ritual-scan-dot is-warning`}),(0,A.jsx)(`span`,{children:a(t,`flow.recommend.environment.standard`,{ram:Math.round(s)})})]})}return(0,A.jsxs)(`div`,{className:`ritual-recommend`,children:[(0,A.jsxs)(`header`,{children:[(0,A.jsx)(`h1`,{className:`ritual-title`,children:a(f,`flow.recommend.title`)}),(0,A.jsx)(`p`,{className:`ritual-subtitle`,children:a(f,`flow.recommend.body`)}),(0,A.jsx)(`div`,{className:`ritual-env-line`,children:m(r,f)})]}),p[0]?(0,A.jsxs)(`section`,{className:`ritual-primary-hero-card`,"aria-labelledby":`recommend-primary-name`,children:[(0,A.jsxs)(`div`,{className:`ritual-hero-topline`,children:[(0,A.jsxs)(`span`,{className:`ritual-hero-rank`,children:[(0,A.jsx)(x,{size:16,"aria-hidden":`true`}),Z(p[0].role,0,f)]}),(0,A.jsx)(`span`,{className:`ritual-hero-size`,children:p[0].size||a(f,`flow.recommend.sizeReady`)})]}),(0,A.jsx)(`h2`,{id:`recommend-primary-name`,className:`ritual-hero-name`,children:p[0].shortName}),(0,A.jsxs)(`p`,{className:`ritual-hero-reason`,children:[p[0].reason,X(p[0].role,f)?(0,A.jsxs)(`span`,{className:`ritual-model-comparison`,children:[` `,X(p[0].role,f)]}):null]}),(0,A.jsxs)(`p`,{className:`ritual-hero-time`,children:[(0,A.jsx)(`span`,{className:`ritual-time-estimate`,children:Y(p[0],f)}),(0,A.jsx)(`span`,{className:`ritual-time-note`,children:a(f,`flow.recommend.timeNote`)})]}),p[0].supported?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(v,{onClick:()=>l(p[0]),className:`ritual-primary-model-button`,children:[a(f,`flow.recommend.primary`),` `,(0,A.jsx)(u,{size:18,"aria-hidden":`true`})]}),(0,A.jsxs)(`p`,{className:`ritual-hero-next`,children:[oe(p[0],f),` Β· `,a(f,p[0].downloadRequired?`flow.recommend.nextHint`:`flow.recommend.nextHint.ready`)]})]}):(0,A.jsx)(`p`,{className:`ritual-model-warning`,children:a(f,`flow.recommend.unsupported`)})]}):null,p.length>1?(0,A.jsxs)(`details`,{className:`ritual-alternatives-details`,children:[(0,A.jsx)(`summary`,{id:`recommend-alternatives`,className:`ritual-alternatives-title cursor-pointer`,children:(0,A.jsx)(`h2`,{className:`inline text-sm font-semibold`,children:a(f,`flow.recommend.alternatives`)})}),(0,A.jsx)(`div`,{className:`ritual-alt-list`,children:p.slice(1,3).map((e,t)=>{let n=e.role===`faster`?S:y;return(0,A.jsxs)(`button`,{type:`button`,className:`ritual-model-card is-compact`,onClick:()=>e.supported&&l(e),disabled:!e.supported,children:[(0,A.jsxs)(`span`,{className:`ritual-model-heading`,children:[(0,A.jsx)(n,{size:15,"aria-hidden":`true`}),(0,A.jsx)(`span`,{className:`role`,children:Z(e.role,t+1,f)}),(0,A.jsx)(`span`,{className:`ritual-alt-size`,children:e.size||a(f,`flow.recommend.sizeReady`)})]}),(0,A.jsx)(`span`,{className:`name`,children:e.shortName}),(0,A.jsx)(`span`,{className:`reason`,children:e.reason}),(0,A.jsxs)(`span`,{className:`ritual-alt-footer`,children:[(0,A.jsx)(`span`,{className:`ritual-time-estimate`,children:Y(e,f)}),e.supported?(0,A.jsxs)(`span`,{className:`ritual-model-choose`,children:[a(f,`flow.recommend.choose`),` `,(0,A.jsx)(u,{size:14,"aria-hidden":`true`})]}):(0,A.jsx)(`span`,{className:`ritual-model-warning`,children:a(f,`flow.recommend.unsupported`)})]})]},`${e.role}-${e.id}`)})})]}):null,(0,A.jsxs)(`footer`,{className:`ritual-action-row is-split`,children:[(0,A.jsx)(v,{variant:`ghost`,onClick:i,children:a(f,`flow.recommend.back`)}),(0,A.jsxs)(`span`,{className:`ritual-action-tail`,children:[(0,A.jsx)(`span`,{className:`ritual-muted-hint`,children:a(f,`flow.recommend.hint`)}),(0,A.jsx)(v,{variant:`outline`,onClick:s,children:a(f,`flow.recommend.skip`)})]})]})]})}function J(e,t){return a(t,`flow.recommend.minutes`,{count:e})}function Y(e,t){let n=e.estimatedFirstResponseSeconds;return!e.downloadRequired||e.estimatedDownloadMinutes===0?a(t,`flow.recommend.timeEstimate.ready`,{response:n}):e.estimatedDownloadMinutes===null?a(t,`flow.recommend.timeEstimate.unknown`,{response:n}):a(t,`flow.recommend.timeEstimate`,{download:J(e.estimatedDownloadMinutes,t),response:n})}function oe(e,t){return!e.downloadRequired||e.estimatedDownloadMinutes===0?a(t,`flow.recommend.primaryNote.ready`):e.estimatedDownloadMinutes===null?a(t,`flow.recommend.primaryNote.unknown`):a(t,`flow.recommend.primaryNote`,{time:J(e.estimatedDownloadMinutes,t)})}function X(e,t){return e===`faster`?a(t,`flow.recommend.comparison.faster`):e===`advanced`?a(t,`flow.recommend.comparison.advanced`):``}function Z(e,t,n){return e===`best`?a(n,`flow.recommend.rank.best`):e===`faster`?a(n,`flow.recommend.rank.faster`):e===`advanced`?a(n,`flow.recommend.rank.advanced`):a(n,`flow.recommend.rank.choice`,{index:t+1})}function se({onComplete:e}){let t=c(e=>e.language),[n,i]=C.useState(`wake`),[o,s]=C.useState(null),[l,u]=C.useState(null),[d,p]=C.useState(0),[m,h]=C.useState(null),g=C.useMemo(()=>te({analysis:o,endpoints:l}),[o,l]);C.useEffect(()=>{let e=!1;async function t(){let[t,n,i,a]=await Promise.all([r.setupScan(),r.modelRecommendations(`local_mlx`),r.models(),r.sysinfo()]);e||(s({setup:t.ok?t.data:null,recommendations:n.ok?n.data:null,models:i.ok?i.data:null,sysinfo:a.ok?a.data:null}),u({setup:t.ok,recommendations:n.ok,models:i.ok,sysinfo:a.ok}))}return t(),()=>{e=!0}},[d]);let _=C.useCallback(()=>{s(null),u(null),p(e=>e+1)},[]);return(0,A.jsx)(`div`,{className:`ritual-shell`,children:(0,A.jsxs)(`main`,{className:`ritual-container`,"aria-label":a(t,`flow.shell`),children:[(0,A.jsx)(H,{}),(0,A.jsxs)(`div`,{className:`ritual-brain`,"data-scale":n===`wake`?`hero`:`mark`,children:[(0,A.jsx)(f,{state:le(n),intensity:n===`install`?.92:.7,size:`large`,showLabel:!1}),(0,A.jsx)(`div`,{className:`ritual-edition`,title:a(t,`brain.edition.tip`),children:a(t,`brain.edition`)})]}),n===`wake`&&(0,A.jsx)(Q,{onWake:()=>i(`login`),onUseExisting:()=>$(e)}),n===`login`&&(0,A.jsx)(G,{onSuccess:()=>i(`recommend`)}),n===`recommend`&&(0,A.jsx)(q,{status:g.status,reason:g.reason,recommendations:g.recommendations,analysis:o,onBack:()=>i(`login`),onRetry:_,onSkipModel:()=>$(e),onSelect:e=>{h(e),i(`install`)}}),n===`install`&&(0,A.jsx)(j,{model:ce(m,g.recommendations),onBack:()=>i(`recommend`),onComplete:()=>$(e),onLater:()=>$(e)})]})})}function Q({onWake:e,onUseExisting:t}){let n=c(e=>e.language),r=[{icon:b,label:a(n,`flow.wake.value.local.k`),body:a(n,`flow.wake.value.local.v`)},{icon:S,label:a(n,`flow.wake.value.instant.k`),body:a(n,`flow.wake.value.instant.v`)},{icon:h,label:a(n,`flow.wake.value.brain.k`),body:a(n,`flow.wake.value.brain.v`)}];return(0,A.jsxs)(`section`,{className:`ritual-wake`,"aria-label":a(n,`flow.wake.aria`),children:[(0,A.jsx)(`div`,{className:`ritual-title`,children:a(n,`flow.wake.title`)}),(0,A.jsx)(`div`,{className:`ritual-subtitle`,children:a(n,`flow.wake.body`)}),(0,A.jsx)(`div`,{className:`ritual-value-grid`,"aria-label":a(n,`flow.wake.value.aria`),children:r.map(e=>{let t=e.icon;return(0,A.jsxs)(`div`,{className:`ritual-value-card`,children:[(0,A.jsxs)(`div`,{className:`ritual-value-label`,children:[(0,A.jsx)(t,{size:14}),` `,e.label]}),(0,A.jsx)(`div`,{className:`ritual-value-body`,children:e.body})]},e.label)})}),(0,A.jsxs)(`div`,{className:`ritual-wake-plan`,"aria-label":a(n,`flow.wake.plan.aria`),children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{children:`1`}),(0,A.jsx)(`strong`,{children:a(n,`flow.wake.step.identity`)})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{children:`2`}),(0,A.jsx)(`strong`,{children:a(n,`flow.wake.step.check`)})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{children:`3`}),(0,A.jsx)(`strong`,{children:a(n,`flow.wake.step.voice`)})]})]}),(0,A.jsxs)(`div`,{className:`ritual-button-row ritual-button-row-primary`,children:[(0,A.jsxs)(`button`,{type:`button`,className:`ritual-full-button ritual-full-button-primary`,onClick:e,children:[a(n,`flow.wake.primary`),` `,(0,A.jsx)(u,{size:18})]}),(0,A.jsx)(`button`,{type:`button`,className:`ritual-secondary-button`,onClick:t,children:a(n,`flow.wake.existing`)})]}),(0,A.jsx)(`div`,{className:`ritual-start-note`,children:a(n,`flow.wake.startNote`)})]})}function $(e){_(),e()}function ce(e,t){return e||t[0]||ne()}function le(e){return e===`wake`?`idle`:e===`analysis`?`listening`:e===`recommend`?`recalling`:e===`install`?`thinking`:`idle`}export{se as ProductFlow};
@@ -1,3 +1,3 @@
1
- import{C as e,_ as t,b as n,d as r,m as i,o as a,v as o,x as s}from"./utils-DG1_ExrP.js";import{r as c}from"./useQuery-DRyD9opW.js";import{t as l}from"./workspace-CWVf3gsI.js";import{a as u,t as d,v as f}from"./primitives-d0g9pvzS.js";import{t as p}from"./input-D4w_BZWl.js";import{d as m}from"./index-D7Rr-J2Y.js";import{t as h}from"./button-51Z3rsuv.js";var g=t(`file-exclamation-point`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),_=t(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),v=e(s()),y=400,b=40,x=400;function S(e){return new TextEncoder().encode(e).length}async function C(e){let t=globalThis.crypto?.subtle;if(!t)return``;let n=await t.digest(`SHA-256`,new TextEncoder().encode(e));return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}function w(e,t,n){let r=[`--- a/${n}`,`+++ b/${n}`],i=e.length?e.split(`
1
+ import{C as e,_ as t,b as n,d as r,m as i,o as a,v as o,x as s}from"./utils-zqPZJxdx.js";import{r as c}from"./useQuery-CXQiwbVT.js";import{t as l}from"./workspace-DXTihhfU.js";import{a as u,t as d,v as f}from"./primitives-BCx6TvfG.js";import{t as p}from"./input-DSlJJxRs.js";import{d as m}from"./index-BpYkzcVm.js";import{t as h}from"./button-2j2Ijzgq.js";var g=t(`file-exclamation-point`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),_=t(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),v=e(s()),y=400,b=40,x=400;function S(e){return new TextEncoder().encode(e).length}async function C(e){let t=globalThis.crypto?.subtle;if(!t)return``;let n=await t.digest(`SHA-256`,new TextEncoder().encode(e));return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}function w(e,t,n){let r=[`--- a/${n}`,`+++ b/${n}`],i=e.length?e.split(`
2
2
  `):[],a=t.length?t.split(`
3
3
  `):[];if(i.length>x||a.length>x)return[...r,...i.map(e=>`-${e}`),...a.map(e=>`+${e}`)].slice(0,y);let o=i.length,s=a.length,c=Array.from({length:o+1},()=>new Uint32Array(s+1));for(let e=o-1;e>=0;--e)for(let t=s-1;t>=0;--t)c[e][t]=i[e]===a[t]?c[e+1][t+1]+1:Math.max(c[e+1][t],c[e][t+1]);let l=[],u=0,d=0;for(;u<o&&d<s;)i[u]===a[d]?(u+=1,d+=1):c[u+1][d]>=c[u][d+1]?(l.push(`-${i[u]}`),u+=1):(l.push(`+${a[d]}`),d+=1);for(;u<o;)l.push(`-${i[u++]}`);for(;d<s;)l.push(`+${a[d++]}`);return l.length?[...r,...l].slice(0,y):[]}async function T(e){let t=await r.proposalDetail(e);if(!t.ok)throw Error(t.error||`HTTP ${t.status}`);let n=t.data,i=a(n.payload)?n.payload:{},o=typeof i.path==`string`?i.path:``,s=typeof n.kind==`string`&&n.kind?n.kind:`file_update`;if(!o)throw Error(`proposal payload has no path`);let c=typeof i.new_content==`string`?i.new_content:``,l=await r.readWorkspaceFile(o);if(!l.ok&&l.status!==404)throw Error(l.error||`HTTP ${l.status}`);let u=l.ok,d=l.ok?l.data.content:``;if(s===`file_update`&&u&&d===c)return await r.rejectProposal(e,`rebase: content already applied`),`already_applied`;if(s===`file_delete`&&!u)return await r.rejectProposal(e,`rebase: file already deleted`),`already_applied`;let f=s===`file_delete`?``:c,p=w(d,f,o),m=u?await C(d):``,h=await r.createReviewItem({title:typeof n.title==`string`&&n.title?n.title:o,summary:typeof n.summary==`string`?n.summary:``,source:`change_proposal`,kind:s,payload:{path:o,diff:p,...s===`file_delete`?{}:{new_content:c},tier:s===`file_delete`?`large`:p.length<=b?`small`:`large`,before_bytes:S(d),after_bytes:S(f),...m||!u?{base_exists:u,base_sha256:m}:{}},provenance:{proposed_by:`user_rebase`,reason:`rebased_from:${e}`,source_detail:`proposal_conflict_rebase`}});if(!h.ok)throw Error(h.error||`HTTP ${h.status}`);let g=String(h.data.id||``);return await r.rejectProposal(e,g?`rebased_to:${g}`:`rebased`),`rebased`}var E=n();function D({language:e,itemId:t,onResolved:n}){let r=c(),[a,o]=v.useState(null),s=l({mutationFn:()=>T(t),onSuccess:async e=>{o(e),await Promise.all([r.invalidateQueries({queryKey:[`pendingProposals`]}),r.invalidateQueries({queryKey:[`proposalCounts`]}),r.invalidateQueries({queryKey:[`automationReviews`]}),r.invalidateQueries({queryKey:[`reviewItems`]})]),n?.(e)}});return(0,E.jsxs)(`div`,{className:`proposal-conflict-note`,role:`alert`,"data-testid":`proposal-conflict-note`,children:[(0,E.jsxs)(`div`,{className:`proposal-conflict-head`,children:[(0,E.jsx)(g,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,E.jsx)(`strong`,{children:i(e,`proposals.conflict.title`)})]}),(0,E.jsx)(`p`,{children:i(e,`proposals.conflict.detail`)}),a===`rebased`?(0,E.jsx)(`p`,{className:`proposal-conflict-done`,role:`status`,children:i(e,`proposals.conflict.rebased`)}):a===`already_applied`?(0,E.jsx)(`p`,{className:`proposal-conflict-done`,role:`status`,children:i(e,`proposals.conflict.alreadyApplied`)}):(0,E.jsxs)(`button`,{type:`button`,className:`proposal-conflict-rebase`,disabled:s.isPending,onClick:()=>s.mutate(),children:[(0,E.jsx)(m,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),s.isPending?i(e,`proposals.conflict.rebasing`):i(e,`proposals.conflict.rebase`)]}),s.isError?(0,E.jsx)(`small`,{className:`proposal-conflict-error`,children:i(e,`proposals.conflict.failed`,{reason:s.error instanceof Error?s.error.message:String(s.error)})}):null]})}var O=[{id:`pending`,labelKey:`review.filter.status.pending`},{id:`snoozed`,labelKey:`review.filter.status.snoozed`},{id:`all`,labelKey:`review.filter.status.all`},{id:`approved`,labelKey:`review.filter.status.approved`},{id:`dismissed`,labelKey:`review.filter.status.dismissed`}],k=[{id:`all`,labelKey:`review.filter.source.all`},{id:`workflow_run`,labelKey:`review.filter.source.workflow_run`},{id:`trigger`,labelKey:`review.filter.source.trigger`},{id:`kg_change_digest`,labelKey:`review.filter.source.kg_change_digest`},{id:`chat_followup`,labelKey:`review.filter.source.chat_followup`},{id:`agent_followup`,labelKey:`review.filter.source.agent_followup`},{id:`change_proposal`,labelKey:`review.filter.source.change_proposal`}];function A(e){return e===`pending`?`warning`:e===`snoozed`?`muted`:e===`approved`?`success`:e===`dismissed`?`danger`:`muted`}var j={pending:`review.itemStatus.pending`,snoozed:`review.itemStatus.snoozed`,approved:`review.itemStatus.approved`,dismissed:`review.itemStatus.dismissed`};function M(e,t){let n=j[t];return n?i(e,n):t}var N={workflow_run:`review.source.workflow_run`,trigger:`review.source.trigger`,kg_change_digest:`review.source.kg_change_digest`,chat_followup:`review.source.chat_followup`,agent_followup:`review.source.agent_followup`,change_proposal:`review.source.change_proposal`};function P(e,t){let n=t?N[t]:void 0;return n?i(e,n):t||i(e,`review.source.automation`)}function F(e,t,n){let r=t.source_detail;if(r!=null&&String(r).trim())return String(r);let i=t.trigger_id;return i!=null&&String(i).trim()?String(i):P(e,n)}var I={read:`review.risk.read`,write:`review.risk.write`,write_scoped:`review.risk.write_scoped`,exec:`review.risk.exec`,destructive:`review.risk.destructive`};function L(e,t){let n=typeof t==`string`?t.trim():``;if(!n)return``;let r=I[n];return r?i(e,r):n}var R={read:`review.change.read`,additive:`review.change.additive`,mutation:`review.change.mutation`,destructive:`review.change.destructive`,exec:`review.change.exec`};function z(e,t){let n=typeof t==`string`?t.trim():``;if(!n)return``;let r=R[n];return r?i(e,r):n}function B(){let e=new Date;return e.setDate(e.getDate()+1),e.toISOString()}function V(e,t){if(!t)return i(e,`review.snoozed.badge`);let n=new Date(t);return Number.isNaN(n.getTime())?i(e,`review.snoozed.until`,{value:t}):i(e,`review.snoozed.until`,{value:new Intl.DateTimeFormat(e===`ko`?`ko-KR`:`en-US`,{dateStyle:`medium`,timeStyle:`short`}).format(n)})}function H(e){return e.effective_status===`pending`||e.effective_status===`snoozed`}function U(e){let t=e.payload||{},n=e.provenance||{};return!!(t.last_run_id||n.run_id)}var W=24;function G({language:e,diff:t,path:n,className:r=``}){if(!t.length)return null;let a=t.slice(0,W),o=t.length-a.length;return(0,E.jsxs)(`figure`,{className:`m-0 grid gap-1 ${r}`,children:[(0,E.jsxs)(`figcaption`,{className:`flex flex-wrap items-baseline gap-2 text-xs text-muted-foreground`,children:[(0,E.jsx)(`strong`,{className:`font-medium text-foreground`,children:i(e,`proposals.diff.header`)}),n?(0,E.jsx)(`code`,{className:`break-all`,children:n}):null]}),(0,E.jsx)(`pre`,{className:`pending-proposal-diff`,"aria-label":i(e,`proposals.diff`),children:a.map((e,t)=>(0,E.jsx)(`span`,{className:`block ${K(e)}`,children:e||` `},t))}),o>0?(0,E.jsx)(`small`,{className:`text-xs text-muted-foreground`,children:i(e,`proposals.diff.more`,{count:o})}):null]})}function K(e){return/^\+(?!\+\+)/.test(e)?`text-success`:/^-(?!--)/.test(e)?`text-destructive`:``}function q({item:e,feedback:t,onAction:n}){let r=o(e=>e.mode),a=o(e=>e.language),[s,c]=v.useState(``),l=v.useId(),g=e.provenance||{},_=e.payload||{},y=U(e),b=e.effective_status===`snoozed`,x=H(e),S=e.source===`change_proposal`,C=e.source!==`chat_followup`&&e.source!==`agent_followup`&&!S,w=Array.isArray(_.diff)?_.diff:[],T=String(_.tier||`small`),O=typeof _.path==`string`&&_.path.trim()?_.path:void 0,k=L(a,g.risk),j=z(a,g.change_class),N=typeof g.tool==`string`&&g.tool.trim()?g.tool:``,I=typeof g.proposed_by==`string`&&g.proposed_by.trim()?g.proposed_by:``,R=r!==`basic`,B=!!(S&&w.length>0||b||k||j||N||I||R);return(0,E.jsxs)(`article`,{"aria-labelledby":l,className:`rounded-xl border border-border bg-card p-5 shadow-sm space-y-4`,children:[(0,E.jsxs)(`header`,{className:`flex flex-wrap items-start justify-between gap-3 border-b border-border/40 pb-3`,children:[(0,E.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[(0,E.jsx)(`h3`,{id:l,className:`font-bold text-base text-foreground`,children:e.title}),e.summary?(0,E.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:e.summary}):null]}),(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 shrink-0`,children:[(0,E.jsx)(f,{variant:`muted`,className:`text-xs`,children:P(a,e.source)}),S?(0,E.jsx)(f,{variant:`muted`,className:`text-xs`,children:i(a,e.kind===`file_delete`?`proposals.kind.delete`:T===`large`?`proposals.tier.large`:`proposals.tier.small`)}):null,(0,E.jsx)(f,{variant:A(e.effective_status),className:`text-xs font-semibold`,children:M(a,e.effective_status)})]})]}),(0,E.jsxs)(`div`,{className:`grid items-start gap-5 ${B?`md:grid-cols-12`:``}`,children:[(0,E.jsxs)(`div`,{className:B?`md:col-span-7 space-y-3`:`hidden`,children:[S&&w.length>0?(0,E.jsx)(`div`,{className:`rounded-lg border border-border/60 bg-muted/20 p-3 max-h-64 overflow-y-auto`,children:(0,E.jsx)(G,{language:a,diff:w,path:O})}):null,b?(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-lg border border-amber-500/30 bg-amber-500/5 p-3 text-xs`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{className:`font-semibold text-amber-600`,children:V(a,e.snoozed_until)}),(0,E.jsx)(`p`,{className:`text-muted-foreground text-[11px]`,children:i(a,`review.snoozed.detail`)})]}),(0,E.jsxs)(h,{size:`sm`,variant:`outline`,onClick:()=>n(e,`unsnooze`),disabled:!x,className:`h-7 text-xs`,children:[(0,E.jsx)(m,{className:`h-3 w-3 mr-1`}),` `,i(a,`review.unsnooze`)]})]}):null,k||j||N||I?(0,E.jsxs)(`div`,{className:`rounded-lg border border-border/40 bg-muted/10 p-3 space-y-2 text-xs`,children:[j||k?(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[j?(0,E.jsx)(f,{variant:`muted`,className:`text-[10px]`,children:j}):null,k?(0,E.jsx)(f,{variant:`muted`,className:`text-[10px]`,children:k}):null]}):null,N?(0,E.jsxs)(`p`,{className:`m-0 text-muted-foreground`,children:[(0,E.jsx)(`span`,{className:`font-semibold text-foreground`,children:i(a,`review.summary.tool`)}),` Β· `,N]}):null,I?(0,E.jsxs)(`p`,{className:`m-0 text-muted-foreground`,children:[(0,E.jsx)(`span`,{className:`font-semibold text-foreground`,children:i(a,`review.summary.proposedBy`)}),` Β· `,I]}):null]}):null,R?(0,E.jsxs)(`details`,{className:`rounded-lg border border-border/50 text-xs`,children:[(0,E.jsx)(`summary`,{className:`cursor-pointer select-none p-2.5 font-medium text-muted-foreground hover:text-foreground`,children:i(a,`review.technical.title`)}),(0,E.jsx)(`div`,{className:`p-3 pt-0`,children:(0,E.jsx)(u,{data:{workflow:g.workflow_id,trigger:g.trigger_id,run:_.last_run_id||g.run_id,...S?{path:_.path}:{},source_detail:F(a,g,e.source),snoozed_until:e.snoozed_until,created_at:e.created_at,updated_at:e.updated_at},limit:S?12:8})})]}):null]}),(0,E.jsxs)(`div`,{className:`rounded-xl border border-border/80 bg-muted/20 p-4 space-y-3 ${B?`md:col-span-5`:``}`,children:[(0,E.jsx)(`h4`,{className:`text-xs font-bold tracking-wide text-muted-foreground`,children:i(a,`review.decision.title`)}),x?(0,E.jsxs)(`div`,{className:`space-y-3`,children:[(0,E.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:i(a,C?`review.runNow.detail`:S?`review.proposal.detail`:e.source===`agent_followup`?`review.agent.detail`:`review.chat.detail`)}),S?(0,E.jsx)(p,{value:s,onChange:e=>c(e.target.value),placeholder:i(a,`review.proposal.rejectReason`),"aria-label":i(a,`review.proposal.rejectReason`),className:`text-xs h-8`}):null,(0,E.jsxs)(`div`,{className:`flex flex-col gap-2 pt-1`,role:`group`,"aria-label":i(a,`review.actions.aria`),children:[(0,E.jsxs)(`div`,{className:`flex gap-2`,children:[(0,E.jsx)(d,{label:i(a,S?`proposals.approve`:`review.approve`),action:()=>n(e,`approve`),invalidate:[]}),(0,E.jsx)(d,{label:i(a,S?`proposals.reject`:`review.dismiss`),action:()=>n(e,`dismiss`,!1,S?s:void 0),invalidate:[],variant:`destructive`})]}),(0,E.jsxs)(`div`,{className:`flex gap-2`,children:[C?(0,E.jsx)(d,{label:i(a,`review.runNow`),successLabel:y?i(a,`review.regenerated`):i(a,`review.executed`),action:()=>n(e,`run_now`,y),invalidate:[]}):null,b?null:(0,E.jsx)(d,{label:i(a,`review.snoozeDay`),action:()=>n(e,`snooze`),invalidate:[]})]})]})]}):(0,E.jsx)(`p`,{className:`text-xs text-muted-foreground italic`,children:M(a,e.effective_status)}),t?.conflict&&S?(0,E.jsx)(D,{language:a,itemId:e.id}):t?(0,E.jsxs)(`p`,{className:`text-xs p-2 rounded border ${t.tone===`error`?`border-amber-500/30 bg-amber-500/10 text-warning`:`border-emerald-500/30 bg-emerald-500/10 text-success`}`,children:[t.message,` - `,i(a,`review.feedback.open`),t.detail&&t.detail!==t.message?(0,E.jsx)(`span`,{className:`mt-0.5 block text-[11px] opacity-75`,children:t.detail}):null]}):null]})]})]})}export{O as a,k as i,q as n,D as o,B as r,_ as s,G as t};